Skip to content

Commit

Permalink
fix: change name
Browse files Browse the repository at this point in the history
  • Loading branch information
btrn11 committed Dec 12, 2024
1 parent 4b3d2ae commit 409f619
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
4 changes: 2 additions & 2 deletions src/interfaces/packagingInterfacesAndType.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,13 +136,13 @@ export type PackageVersionListResult = {
Language?: string;
};

export type PackagePushUpgradeListQueryOptions = {
export type PackagePushRequestListQueryOptions = {
packageId: string;
scheduledLastDays?: number;
status?: 'Created' | 'Cancelled' | 'Pending' | 'In Progress' | 'Failed' | 'Succeeded';
};

export type PackagePushUpgradeListResult = {
export type PackagePushRequestListResult = {
PushRequestId: string;
PackageVersionId: string;
PushRequestStatus: string;
Expand Down
15 changes: 7 additions & 8 deletions src/package/packagePushUpgrade.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,13 @@
* Licensed under the BSD 3-Clause license.
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
*/
/* eslint-disable class-methods-use-this */
import util from 'node:util';
import { Connection, SfProject } from '@salesforce/core';
import { Schema } from '@jsforce/jsforce-node';
import { PackagePushUpgradeListQueryOptions, PackagePushUpgradeListResult } from '../interfaces';
import { PackagePushRequestListQueryOptions, PackagePushRequestListResult } from '../interfaces';
import { applyErrorAction, massageErrorMessage } from '../utils/packageUtils';

export type PackagePushUpgradeListOptions = {
export type PackagePushRequestListOptions = {
connection: Connection;
packageId: string;
project?: SfProject;
Expand All @@ -22,8 +21,8 @@ export class PackagePushUpgrade {

public static async list(
connection: Connection,
options?: PackagePushUpgradeListQueryOptions
): Promise<PackagePushUpgradeListResult[]> {
options?: PackagePushRequestListQueryOptions
): Promise<PackagePushRequestListResult[]> {
try {
const whereClause = constructWhere(options);
return await query(util.format(getQuery(), whereClause), connection);
Expand All @@ -37,8 +36,8 @@ export class PackagePushUpgrade {
}

// eslint-disable-next-line @typescript-eslint/no-shadow
async function query(query: string, connection: Connection): Promise<PackagePushUpgradeListResult[]> {
type QueryRecord = PackagePushUpgradeListResult & Schema;
async function query(query: string, connection: Connection): Promise<PackagePushRequestListResult[]> {
type QueryRecord = PackagePushRequestListResult & Schema;
const queryResult = await connection.autoFetchQuery<QueryRecord>(query, { tooling: true });

return (queryResult.records ? queryResult.records : []).map((record) => ({
Expand All @@ -52,7 +51,7 @@ async function query(query: string, connection: Connection): Promise<PackagePush
}));
}

export function constructWhere(options?: PackagePushUpgradeListQueryOptions): string {
export function constructWhere(options?: PackagePushRequestListQueryOptions): string {
const where: string[] = [];

if (options?.packageId) {
Expand Down

0 comments on commit 409f619

Please sign in to comment.