@copado/agentia-cli 0.56.0-alpha.0 → 0.58.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1180 -117
- package/dist/commands/cicd/data/commit/create.d.ts +11 -0
- package/dist/commands/cicd/data/commit/create.js +41 -0
- package/dist/commands/cicd/data/commit/create.js.map +1 -0
- package/dist/commands/cicd/data/commit/list.d.ts +10 -0
- package/dist/commands/cicd/data/commit/list.js +42 -0
- package/dist/commands/cicd/data/commit/list.js.map +1 -0
- package/dist/commands/cicd/data/dataset-file/content.d.ts +10 -0
- package/dist/commands/cicd/data/dataset-file/content.js +53 -0
- package/dist/commands/cicd/data/dataset-file/content.js.map +1 -0
- package/dist/commands/cicd/data/dataset-file/list.d.ts +10 -0
- package/dist/commands/cicd/data/dataset-file/list.js +42 -0
- package/dist/commands/cicd/data/dataset-file/list.js.map +1 -0
- package/dist/commands/cicd/data/filter/add.d.ts +13 -0
- package/dist/commands/cicd/data/filter/add.js +42 -0
- package/dist/commands/cicd/data/filter/add.js.map +1 -0
- package/dist/commands/cicd/data/filter/delete.d.ts +10 -0
- package/dist/commands/cicd/data/filter/delete.js +33 -0
- package/dist/commands/cicd/data/filter/delete.js.map +1 -0
- package/dist/commands/cicd/data/filter/list.d.ts +10 -0
- package/dist/commands/cicd/data/filter/list.js +42 -0
- package/dist/commands/cicd/data/filter/list.js.map +1 -0
- package/dist/commands/cicd/data/filter/update.d.ts +14 -0
- package/dist/commands/cicd/data/filter/update.js +46 -0
- package/dist/commands/cicd/data/filter/update.js.map +1 -0
- package/dist/commands/cicd/data/formula/create.d.ts +16 -0
- package/dist/commands/cicd/data/formula/create.js +62 -0
- package/dist/commands/cicd/data/formula/create.js.map +1 -0
- package/dist/commands/cicd/data/formula/list.d.ts +10 -0
- package/dist/commands/cicd/data/formula/list.js +42 -0
- package/dist/commands/cicd/data/formula/list.js.map +1 -0
- package/dist/commands/cicd/data/formula/update.d.ts +18 -0
- package/dist/commands/cicd/data/formula/update.js +78 -0
- package/dist/commands/cicd/data/formula/update.js.map +1 -0
- package/dist/commands/cicd/data/records/match.d.ts +11 -0
- package/dist/commands/cicd/data/records/match.js +39 -0
- package/dist/commands/cicd/data/records/match.js.map +1 -0
- package/dist/commands/cicd/data/records/search.d.ts +14 -0
- package/dist/commands/cicd/data/records/search.js +65 -0
- package/dist/commands/cicd/data/records/search.js.map +1 -0
- package/dist/commands/cicd/data/sobject/fields.d.ts +13 -0
- package/dist/commands/cicd/data/sobject/fields.js +56 -0
- package/dist/commands/cicd/data/sobject/fields.js.map +1 -0
- package/dist/commands/cicd/data/sobject/relationships.d.ts +13 -0
- package/dist/commands/cicd/data/sobject/relationships.js +66 -0
- package/dist/commands/cicd/data/sobject/relationships.js.map +1 -0
- package/dist/commands/cicd/data/sync/apply.d.ts +11 -0
- package/dist/commands/cicd/data/sync/apply.js +40 -0
- package/dist/commands/cicd/data/sync/apply.js.map +1 -0
- package/dist/commands/cicd/data/sync/preview-updates.d.ts +11 -0
- package/dist/commands/cicd/data/sync/preview-updates.js +58 -0
- package/dist/commands/cicd/data/sync/preview-updates.js.map +1 -0
- package/dist/commands/cicd/data/template/convert-old.d.ts +9 -0
- package/dist/commands/cicd/data/template/convert-old.js +29 -0
- package/dist/commands/cicd/data/template/convert-old.js.map +1 -0
- package/dist/commands/cicd/data/template/create.d.ts +13 -0
- package/dist/commands/cicd/data/template/create.js +56 -0
- package/dist/commands/cicd/data/template/create.js.map +1 -0
- package/dist/commands/cicd/data/template/delete.d.ts +9 -0
- package/dist/commands/cicd/data/template/delete.js +29 -0
- package/dist/commands/cicd/data/template/delete.js.map +1 -0
- package/dist/commands/cicd/data/template/get-detail.d.ts +10 -0
- package/dist/commands/cicd/data/template/get-detail.js +29 -0
- package/dist/commands/cicd/data/template/get-detail.js.map +1 -0
- package/dist/commands/cicd/data/template/get.d.ts +10 -0
- package/dist/commands/cicd/data/template/get.js +29 -0
- package/dist/commands/cicd/data/template/get.js.map +1 -0
- package/dist/commands/cicd/data/template/list.d.ts +11 -0
- package/dist/commands/cicd/data/template/list.js +44 -0
- package/dist/commands/cicd/data/template/list.js.map +1 -0
- package/dist/commands/cicd/data/template/save-detail.d.ts +13 -0
- package/dist/commands/cicd/data/template/save-detail.js +42 -0
- package/dist/commands/cicd/data/template/save-detail.js.map +1 -0
- package/dist/commands/cicd/function/defaults.d.ts +12 -0
- package/dist/commands/cicd/function/defaults.js +31 -0
- package/dist/commands/cicd/function/defaults.js.map +1 -0
- package/dist/commands/cicd/function/delete.d.ts +11 -0
- package/dist/commands/cicd/function/delete.js +29 -0
- package/dist/commands/cicd/function/delete.js.map +1 -0
- package/dist/commands/cicd/function/get.d.ts +10 -0
- package/dist/commands/cicd/function/get.js +30 -0
- package/dist/commands/cicd/function/get.js.map +1 -0
- package/dist/commands/cicd/function/list.d.ts +10 -0
- package/dist/commands/cicd/function/list.js +36 -0
- package/dist/commands/cicd/function/list.js.map +1 -0
- package/dist/commands/cicd/function/result/get.d.ts +10 -0
- package/dist/commands/cicd/function/result/get.js +30 -0
- package/dist/commands/cicd/function/result/get.js.map +1 -0
- package/dist/commands/cicd/function/result/log/get.d.ts +17 -0
- package/dist/commands/cicd/function/result/log/get.js +41 -0
- package/dist/commands/cicd/function/result/log/get.js.map +1 -0
- package/dist/commands/cicd/function/run-local.d.ts +17 -0
- package/dist/commands/cicd/function/run-local.js +64 -0
- package/dist/commands/cicd/function/run-local.js.map +1 -0
- package/dist/commands/cicd/function/run.d.ts +16 -0
- package/dist/commands/cicd/function/run.js +42 -0
- package/dist/commands/cicd/function/run.js.map +1 -0
- package/dist/commands/cicd/function/upsert.d.ts +27 -0
- package/dist/commands/cicd/function/upsert.js +45 -0
- package/dist/commands/cicd/function/upsert.js.map +1 -0
- package/dist/commands/cicd/promotion/run.d.ts +23 -0
- package/dist/commands/cicd/promotion/run.js +137 -0
- package/dist/commands/cicd/promotion/run.js.map +1 -0
- package/dist/commands/cicd/work/promote.d.ts +25 -0
- package/dist/commands/cicd/work/promote.js +141 -0
- package/dist/commands/cicd/work/promote.js.map +1 -0
- package/dist/lib/cicd-gateway.js +3 -2
- package/dist/lib/cicd-gateway.js.map +1 -1
- package/dist/lib/data-flags.d.ts +14 -0
- package/dist/lib/data-flags.js +61 -0
- package/dist/lib/data-flags.js.map +1 -0
- package/dist/lib/data-types.d.ts +322 -0
- package/dist/lib/data-types.js +176 -0
- package/dist/lib/data-types.js.map +1 -0
- package/dist/lib/function-flags.d.ts +69 -0
- package/dist/lib/function-flags.js +199 -0
- package/dist/lib/function-flags.js.map +1 -0
- package/dist/lib/function-local-run.d.ts +64 -0
- package/dist/lib/function-local-run.js +148 -0
- package/dist/lib/function-local-run.js.map +1 -0
- package/dist/lib/function-types.d.ts +106 -0
- package/dist/lib/function-types.js +171 -0
- package/dist/lib/function-types.js.map +1 -0
- package/dist/lib/mcp/data-tools.d.ts +159 -0
- package/dist/lib/mcp/data-tools.js +547 -0
- package/dist/lib/mcp/data-tools.js.map +1 -0
- package/dist/lib/mcp/tools.d.ts +231 -0
- package/dist/lib/mcp/tools.js +288 -0
- package/dist/lib/mcp/tools.js.map +1 -1
- package/dist/lib/mcp/work-tools.d.ts +29 -0
- package/dist/lib/mcp/work-tools.js +62 -0
- package/dist/lib/mcp/work-tools.js.map +1 -1
- package/dist/lib/promotion-run.d.ts +105 -0
- package/dist/lib/promotion-run.js +481 -0
- package/dist/lib/promotion-run.js.map +1 -0
- package/dist/lib/salesforce-id.d.ts +9 -0
- package/dist/lib/salesforce-id.js +30 -0
- package/dist/lib/salesforce-id.js.map +1 -1
- package/dist/lib/sf-org-context.js +5 -5
- package/dist/lib/sf-org-context.js.map +1 -1
- package/oclif.manifest.json +4818 -2752
- package/package.json +28 -1
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { type PromotionDetail } from './promotion-types.js';
|
|
2
|
+
export declare const PROMOTION_OPERATIONS: readonly ["merge", "merge_and_deploy"];
|
|
3
|
+
export declare const PROMOTION_RUN_DEFAULT_TIMEOUT_SECONDS = 900;
|
|
4
|
+
export type PromotionOperation = (typeof PROMOTION_OPERATIONS)[number];
|
|
5
|
+
export type PromotionStartedJobPhase = 'deployment' | 'promotion';
|
|
6
|
+
export type PromotionRunRecord = {
|
|
7
|
+
id?: null | string;
|
|
8
|
+
link?: null | string;
|
|
9
|
+
name?: null | string;
|
|
10
|
+
status?: null | string;
|
|
11
|
+
};
|
|
12
|
+
export type PromotionRunResponse = {
|
|
13
|
+
[key: string]: unknown;
|
|
14
|
+
jobExecution?: null | PromotionRunRecord;
|
|
15
|
+
promotion?: null | PromotionRunRecord;
|
|
16
|
+
startedJobPhase?: null | PromotionStartedJobPhase;
|
|
17
|
+
};
|
|
18
|
+
export type PromotionJobMonitor = {
|
|
19
|
+
[key: string]: unknown;
|
|
20
|
+
executionSteps?: unknown[];
|
|
21
|
+
jobExecutionErrorMessage?: null | string;
|
|
22
|
+
jobExecutionId?: null | string;
|
|
23
|
+
jobExecutionStatus?: null | string;
|
|
24
|
+
};
|
|
25
|
+
export type PromotionDeploymentStep = {
|
|
26
|
+
[key: string]: unknown;
|
|
27
|
+
id: string;
|
|
28
|
+
};
|
|
29
|
+
export type PromotionRunRequest = {
|
|
30
|
+
deploymentStepIds?: string[];
|
|
31
|
+
operation: PromotionOperation;
|
|
32
|
+
recreatePromotionBranch?: boolean;
|
|
33
|
+
};
|
|
34
|
+
export type PromotionRunHooks = {
|
|
35
|
+
log: (message?: string) => void;
|
|
36
|
+
withSpinner: <T>(message: string, action: () => Promise<T>) => Promise<T>;
|
|
37
|
+
};
|
|
38
|
+
export type PromotionRunResult = {
|
|
39
|
+
context: Record<string, unknown>;
|
|
40
|
+
deploymentSteps: PromotionDeploymentStep[];
|
|
41
|
+
ignoredMetadata?: unknown[];
|
|
42
|
+
jobMonitors: PromotionJobMonitor[];
|
|
43
|
+
mode: 'resume' | 'run';
|
|
44
|
+
operation?: PromotionOperation;
|
|
45
|
+
promotionAfter?: PromotionDetail;
|
|
46
|
+
promotionBefore: PromotionDetail;
|
|
47
|
+
promotionId: string;
|
|
48
|
+
request?: PromotionRunRequest;
|
|
49
|
+
resultId: string;
|
|
50
|
+
run: PromotionRunResponse;
|
|
51
|
+
wait: boolean;
|
|
52
|
+
};
|
|
53
|
+
export declare class PromotionRunValidationError extends Error {
|
|
54
|
+
constructor(message: string);
|
|
55
|
+
}
|
|
56
|
+
export declare class PromotionRunJobFailedError extends Error {
|
|
57
|
+
readonly jobMonitor: PromotionJobMonitor;
|
|
58
|
+
readonly result?: PromotionRunResult;
|
|
59
|
+
constructor(jobMonitor: PromotionJobMonitor, result?: PromotionRunResult);
|
|
60
|
+
}
|
|
61
|
+
export declare class PromotionRunTimeoutError extends Error {
|
|
62
|
+
readonly jobMonitor?: PromotionJobMonitor;
|
|
63
|
+
readonly result?: PromotionRunResult;
|
|
64
|
+
constructor(timeoutSeconds: number, jobMonitor?: PromotionJobMonitor, result?: PromotionRunResult);
|
|
65
|
+
}
|
|
66
|
+
export declare class PromotionRunIncompleteResponseError extends Error {
|
|
67
|
+
readonly result?: PromotionRunResult;
|
|
68
|
+
constructor(message: string, result?: PromotionRunResult);
|
|
69
|
+
}
|
|
70
|
+
export type PromotionRunExecutionError = PromotionRunIncompleteResponseError | PromotionRunJobFailedError | PromotionRunTimeoutError;
|
|
71
|
+
export declare function isPromotionRunExecutionError(error: unknown): error is PromotionRunExecutionError;
|
|
72
|
+
export declare function promotionRunErrorJson(base: Record<string, unknown>, error: unknown): Record<string, unknown>;
|
|
73
|
+
export type SleepFn = (ms: number) => Promise<void>;
|
|
74
|
+
export declare function setPromotionRunSleepForTests(nextSleep: SleepFn): void;
|
|
75
|
+
export declare function resetPromotionRunSleepForTests(): void;
|
|
76
|
+
export declare function requirePromotionId(value: string): string;
|
|
77
|
+
export declare function promotionRunDetailEndpoint(promotionId: string): string;
|
|
78
|
+
export declare function promotionContextEndpoint(promotionId: string, operation: PromotionOperation): string;
|
|
79
|
+
export declare function promotionDeploymentStepsEndpoint(promotionId: string): string;
|
|
80
|
+
export declare function promotionIgnoredMetadataEndpoint(promotionId: string): string;
|
|
81
|
+
export declare function promotionRunEndpoint(promotionId: string): string;
|
|
82
|
+
export declare function promotionResumeEndpoint(promotionId: string, jobExecutionId: string): string;
|
|
83
|
+
export declare function promotionValidateResolutionEndpoint(promotionId: string): string;
|
|
84
|
+
export declare function promotionJobMonitorEndpoint(jobExecutionId: string, promotionId: string): string;
|
|
85
|
+
export declare function parseIgnoredMetadataJson(value?: string): undefined | unknown[];
|
|
86
|
+
export declare function resolvePromotionIdForWorkItem(userStoryId: string, explicitPromotionId?: string): Promise<string>;
|
|
87
|
+
export declare function assertPromotionContextReady(context: Record<string, unknown>, operation: PromotionOperation): void;
|
|
88
|
+
export declare function performPromotionRun(options: {
|
|
89
|
+
deploymentStepIds?: string[];
|
|
90
|
+
hooks: PromotionRunHooks;
|
|
91
|
+
ignoredMetadata?: unknown[];
|
|
92
|
+
operation: PromotionOperation;
|
|
93
|
+
promotionId: string;
|
|
94
|
+
recreatePromotionBranch?: boolean;
|
|
95
|
+
timeoutSeconds: number;
|
|
96
|
+
wait: boolean;
|
|
97
|
+
}): Promise<PromotionRunResult>;
|
|
98
|
+
export declare function performPromotionResume(options: {
|
|
99
|
+
hooks: PromotionRunHooks;
|
|
100
|
+
jobExecutionId: string;
|
|
101
|
+
promotionId: string;
|
|
102
|
+
timeoutSeconds: number;
|
|
103
|
+
wait: boolean;
|
|
104
|
+
}): Promise<PromotionRunResult>;
|
|
105
|
+
export declare function formatPromotionRunResult(result: PromotionRunResult): string;
|
|
@@ -0,0 +1,481 @@
|
|
|
1
|
+
import { CicdGateway } from './cicd-gateway.js';
|
|
2
|
+
import { cellValue } from './format.js';
|
|
3
|
+
import { normalizePromotionDetail, normalizePromotionsListPage, promotionListEndpoint, } from './promotion-types.js';
|
|
4
|
+
export const PROMOTION_OPERATIONS = ['merge', 'merge_and_deploy'];
|
|
5
|
+
export const PROMOTION_RUN_DEFAULT_TIMEOUT_SECONDS = 900;
|
|
6
|
+
const FAILED_JOB_STATUSES = new Set(['canceled', 'completed with errors', 'error', 'failed', 'skipped', 'validation failed']);
|
|
7
|
+
const POLL_BACKOFF_SECONDS = [2, 3, 5, 10];
|
|
8
|
+
const SUCCESSFUL_JOB_STATUSES = new Set(['completed', 'success', 'successful', 'validated']);
|
|
9
|
+
const SALESFORCE_ID_18_PATTERN = /^[A-Za-z0-9]{18}$/;
|
|
10
|
+
export class PromotionRunValidationError extends Error {
|
|
11
|
+
constructor(message) {
|
|
12
|
+
super(message);
|
|
13
|
+
this.name = 'PromotionRunValidationError';
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
export class PromotionRunJobFailedError extends Error {
|
|
17
|
+
jobMonitor;
|
|
18
|
+
result;
|
|
19
|
+
constructor(jobMonitor, result) {
|
|
20
|
+
const status = jobMonitor.jobExecutionStatus ?? 'unknown';
|
|
21
|
+
const jobId = jobMonitor.jobExecutionId?.trim();
|
|
22
|
+
const detail = jobMonitor.jobExecutionErrorMessage?.trim();
|
|
23
|
+
const prefix = jobId && jobId.length > 0 ? `Promotion job ${jobId}` : 'Promotion job';
|
|
24
|
+
super(detail && detail.length > 0 ? `${prefix} finished with status ${status}: ${detail}` : `${prefix} finished with status ${status}.`);
|
|
25
|
+
this.jobMonitor = jobMonitor;
|
|
26
|
+
this.name = 'PromotionRunJobFailedError';
|
|
27
|
+
this.result = result;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
export class PromotionRunTimeoutError extends Error {
|
|
31
|
+
jobMonitor;
|
|
32
|
+
result;
|
|
33
|
+
constructor(timeoutSeconds, jobMonitor, result) {
|
|
34
|
+
const jobId = jobMonitor?.jobExecutionId?.trim();
|
|
35
|
+
const suffix = jobId && jobId.length > 0 ? ` Last job execution ID: ${jobId}.` : '';
|
|
36
|
+
super(`Promotion execution did not finish within ${timeoutSeconds}s.${suffix}`);
|
|
37
|
+
this.jobMonitor = jobMonitor;
|
|
38
|
+
this.name = 'PromotionRunTimeoutError';
|
|
39
|
+
this.result = result;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
export class PromotionRunIncompleteResponseError extends Error {
|
|
43
|
+
result;
|
|
44
|
+
constructor(message, result) {
|
|
45
|
+
super(message);
|
|
46
|
+
this.name = 'PromotionRunIncompleteResponseError';
|
|
47
|
+
this.result = result;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
export function isPromotionRunExecutionError(error) {
|
|
51
|
+
return (error instanceof PromotionRunJobFailedError ||
|
|
52
|
+
error instanceof PromotionRunTimeoutError ||
|
|
53
|
+
error instanceof PromotionRunIncompleteResponseError);
|
|
54
|
+
}
|
|
55
|
+
export function promotionRunErrorJson(base, error) {
|
|
56
|
+
if (!isPromotionRunExecutionError(error)) {
|
|
57
|
+
return base;
|
|
58
|
+
}
|
|
59
|
+
return {
|
|
60
|
+
...base,
|
|
61
|
+
error: {
|
|
62
|
+
...(base.error && typeof base.error === 'object' ? base.error : {}),
|
|
63
|
+
...(error instanceof PromotionRunJobFailedError || error instanceof PromotionRunTimeoutError
|
|
64
|
+
? error.jobMonitor === undefined
|
|
65
|
+
? {}
|
|
66
|
+
: { jobMonitor: error.jobMonitor }
|
|
67
|
+
: {}),
|
|
68
|
+
...(error.result === undefined ? {} : { result: error.result }),
|
|
69
|
+
},
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
const defaultSleep = async (ms) => new Promise((resolve) => {
|
|
73
|
+
setTimeout(resolve, ms);
|
|
74
|
+
});
|
|
75
|
+
let sleepFn = defaultSleep;
|
|
76
|
+
// Test-only hook
|
|
77
|
+
export function setPromotionRunSleepForTests(nextSleep) {
|
|
78
|
+
sleepFn = nextSleep;
|
|
79
|
+
}
|
|
80
|
+
// Test-only hook
|
|
81
|
+
export function resetPromotionRunSleepForTests() {
|
|
82
|
+
sleepFn = defaultSleep;
|
|
83
|
+
}
|
|
84
|
+
function isRecord(value) {
|
|
85
|
+
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
86
|
+
}
|
|
87
|
+
function normalizeStatus(status) {
|
|
88
|
+
return status?.trim().toLowerCase() ?? '';
|
|
89
|
+
}
|
|
90
|
+
function isTerminalJobStatus(status) {
|
|
91
|
+
const normalized = normalizeStatus(status);
|
|
92
|
+
return SUCCESSFUL_JOB_STATUSES.has(normalized) || FAILED_JOB_STATUSES.has(normalized);
|
|
93
|
+
}
|
|
94
|
+
function isFailedJobStatus(status) {
|
|
95
|
+
return FAILED_JOB_STATUSES.has(normalizeStatus(status));
|
|
96
|
+
}
|
|
97
|
+
export function requirePromotionId(value) {
|
|
98
|
+
const promotionId = value.trim();
|
|
99
|
+
if (!SALESFORCE_ID_18_PATTERN.test(promotionId)) {
|
|
100
|
+
throw new PromotionRunValidationError('Promotion ID must be an 18-character Salesforce ID, not a display name.');
|
|
101
|
+
}
|
|
102
|
+
return promotionId;
|
|
103
|
+
}
|
|
104
|
+
function requireExecutionId(value) {
|
|
105
|
+
const executionId = value.trim();
|
|
106
|
+
if (executionId.length === 0) {
|
|
107
|
+
throw new PromotionRunValidationError('Job execution ID is required.');
|
|
108
|
+
}
|
|
109
|
+
return executionId;
|
|
110
|
+
}
|
|
111
|
+
export function promotionRunDetailEndpoint(promotionId) {
|
|
112
|
+
return `/release/promotion/${requirePromotionId(promotionId)}`;
|
|
113
|
+
}
|
|
114
|
+
export function promotionContextEndpoint(promotionId, operation) {
|
|
115
|
+
const params = new URLSearchParams({ operation, view: 'steps' });
|
|
116
|
+
return `${promotionRunDetailEndpoint(promotionId)}/context?${params.toString()}`;
|
|
117
|
+
}
|
|
118
|
+
export function promotionDeploymentStepsEndpoint(promotionId) {
|
|
119
|
+
const params = new URLSearchParams({ operation: 'merge_and_deploy' });
|
|
120
|
+
return `${promotionRunDetailEndpoint(promotionId)}/deployment-steps?${params.toString()}`;
|
|
121
|
+
}
|
|
122
|
+
export function promotionIgnoredMetadataEndpoint(promotionId) {
|
|
123
|
+
return `${promotionRunDetailEndpoint(promotionId)}/ignored-metadata`;
|
|
124
|
+
}
|
|
125
|
+
export function promotionRunEndpoint(promotionId) {
|
|
126
|
+
return `${promotionRunDetailEndpoint(promotionId)}/run`;
|
|
127
|
+
}
|
|
128
|
+
export function promotionResumeEndpoint(promotionId, jobExecutionId) {
|
|
129
|
+
return `${promotionRunDetailEndpoint(promotionId)}/job-executions/${requireExecutionId(jobExecutionId)}/resume`;
|
|
130
|
+
}
|
|
131
|
+
export function promotionValidateResolutionEndpoint(promotionId) {
|
|
132
|
+
return `${promotionRunDetailEndpoint(promotionId)}/validate-resolution`;
|
|
133
|
+
}
|
|
134
|
+
export function promotionJobMonitorEndpoint(jobExecutionId, promotionId) {
|
|
135
|
+
const params = new URLSearchParams();
|
|
136
|
+
params.set('discover_sub_executions', 'true');
|
|
137
|
+
params.set('include_history', 'true');
|
|
138
|
+
params.set('promotion_id', requirePromotionId(promotionId));
|
|
139
|
+
return `/release/job-monitor/execution/${requireExecutionId(jobExecutionId)}?${params.toString()}`;
|
|
140
|
+
}
|
|
141
|
+
function normalizeDeploymentSteps(value) {
|
|
142
|
+
const candidate = isRecord(value) && Array.isArray(value.deploymentSteps)
|
|
143
|
+
? value.deploymentSteps
|
|
144
|
+
: isRecord(value) && Array.isArray(value.data)
|
|
145
|
+
? value.data
|
|
146
|
+
: value;
|
|
147
|
+
if (!Array.isArray(candidate)) {
|
|
148
|
+
return [];
|
|
149
|
+
}
|
|
150
|
+
return candidate.flatMap((step) => {
|
|
151
|
+
if (!isRecord(step) || typeof step.id !== 'string' || step.id.trim().length === 0) {
|
|
152
|
+
return [];
|
|
153
|
+
}
|
|
154
|
+
return [{ ...step, id: step.id.trim() }];
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
export function parseIgnoredMetadataJson(value) {
|
|
158
|
+
if (value === undefined) {
|
|
159
|
+
return undefined;
|
|
160
|
+
}
|
|
161
|
+
let parsed;
|
|
162
|
+
try {
|
|
163
|
+
parsed = JSON.parse(value);
|
|
164
|
+
}
|
|
165
|
+
catch (error) {
|
|
166
|
+
throw new PromotionRunValidationError(`--ignored-metadata-json must contain valid JSON: ${error.message}`);
|
|
167
|
+
}
|
|
168
|
+
if (!Array.isArray(parsed)) {
|
|
169
|
+
throw new PromotionRunValidationError('--ignored-metadata-json must be a JSON array.');
|
|
170
|
+
}
|
|
171
|
+
return parsed;
|
|
172
|
+
}
|
|
173
|
+
export async function resolvePromotionIdForWorkItem(userStoryId, explicitPromotionId) {
|
|
174
|
+
if (explicitPromotionId !== undefined) {
|
|
175
|
+
return requirePromotionId(explicitPromotionId);
|
|
176
|
+
}
|
|
177
|
+
const response = await CicdGateway.call({
|
|
178
|
+
endpoint: promotionListEndpoint({ pageSize: 200, userStoryId }),
|
|
179
|
+
method: 'GET',
|
|
180
|
+
});
|
|
181
|
+
const promotions = normalizePromotionsListPage(response).data;
|
|
182
|
+
if (promotions.length === 0) {
|
|
183
|
+
throw new PromotionRunValidationError(`No promotion contains User Story ${userStoryId}.`);
|
|
184
|
+
}
|
|
185
|
+
if (promotions.length > 1) {
|
|
186
|
+
const matches = promotions.map((promotion) => `${promotion.name ?? 'unnamed'} (${promotion.id})`).join(', ');
|
|
187
|
+
throw new PromotionRunValidationError(`User Story ${userStoryId} belongs to multiple promotions: ${matches}. Pass --promotion-id to select one.`);
|
|
188
|
+
}
|
|
189
|
+
return requirePromotionId(promotions[0].id);
|
|
190
|
+
}
|
|
191
|
+
async function getPromotionDetail(promotionId) {
|
|
192
|
+
const response = await CicdGateway.call({
|
|
193
|
+
endpoint: promotionRunDetailEndpoint(promotionId),
|
|
194
|
+
method: 'GET',
|
|
195
|
+
});
|
|
196
|
+
return normalizePromotionDetail(response);
|
|
197
|
+
}
|
|
198
|
+
function assertRunnablePromotion(promotion) {
|
|
199
|
+
const status = normalizeStatus(promotion.status);
|
|
200
|
+
if (status === 'in progress' || status === 'scheduled') {
|
|
201
|
+
const executionId = promotion.lastPromotionExecutionId?.trim();
|
|
202
|
+
const suffix = executionId && executionId.length > 0 ? ` Existing execution: ${executionId}.` : '';
|
|
203
|
+
throw new PromotionRunValidationError(`Promotion ${promotion.id} is ${promotion.status}; refusing to start a duplicate run.${suffix}`);
|
|
204
|
+
}
|
|
205
|
+
if (status !== 'merge conflict') {
|
|
206
|
+
return;
|
|
207
|
+
}
|
|
208
|
+
const executionId = promotion.lastPromotionExecutionId?.trim();
|
|
209
|
+
const resume = executionId && executionId.length > 0 ? ` --resume ${executionId}` : ' --resume <job-execution-id>';
|
|
210
|
+
throw new PromotionRunValidationError(`Promotion ${promotion.id} is in Merge Conflict. Resolve every conflict, validate the resolution, then resume the original execution with \`agentia cicd promotion run ${promotion.id}${resume}\`. Do not start /run again.`);
|
|
211
|
+
}
|
|
212
|
+
function contextStepsPreview(context) {
|
|
213
|
+
return isRecord(context.stepsPreview) ? context.stepsPreview : context;
|
|
214
|
+
}
|
|
215
|
+
export function assertPromotionContextReady(context, operation) {
|
|
216
|
+
const preview = contextStepsPreview(context);
|
|
217
|
+
const status = typeof preview.promotionStatus === 'string' ? normalizeStatus(preview.promotionStatus) : '';
|
|
218
|
+
if (status === 'in progress' || status === 'scheduled') {
|
|
219
|
+
const promotionJob = isRecord(preview.promotionJob) ? preview.promotionJob : undefined;
|
|
220
|
+
const jobExecutionId = promotionJob && typeof promotionJob.jobExecutionId === 'string' ? promotionJob.jobExecutionId.trim() : '';
|
|
221
|
+
const suffix = jobExecutionId.length > 0 ? ` Existing execution: ${jobExecutionId}.` : '';
|
|
222
|
+
throw new PromotionRunValidationError(`Promotion context is ${preview.promotionStatus}; refusing to start a duplicate run.${suffix}`);
|
|
223
|
+
}
|
|
224
|
+
if (operation === 'merge') {
|
|
225
|
+
if (preview.executePromotion === false || preview.executeDeployment === true || preview.deploymentDryRun === true) {
|
|
226
|
+
throw new PromotionRunValidationError('Promotion context flags do not match the merge operation.');
|
|
227
|
+
}
|
|
228
|
+
const summary = isRecord(preview.includedMetadataSummary) ? preview.includedMetadataSummary : undefined;
|
|
229
|
+
if (summary?.changeCount === 0) {
|
|
230
|
+
throw new PromotionRunValidationError('Promote-only requires at least one metadata change.');
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
if (operation === 'merge_and_deploy' && preview.executeDeployment === false) {
|
|
234
|
+
throw new PromotionRunValidationError('Promotion context flags do not enable deployment for merge_and_deploy.');
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
async function waitForPromotionJob(options) {
|
|
238
|
+
const { deadline, hooks, jobExecutionId, promotionId, timeoutSeconds } = options;
|
|
239
|
+
let lastResult;
|
|
240
|
+
let pollCount = 0;
|
|
241
|
+
for (;;) {
|
|
242
|
+
// eslint-disable-next-line no-await-in-loop -- job polling must be sequential
|
|
243
|
+
const result = await CicdGateway.call({
|
|
244
|
+
endpoint: promotionJobMonitorEndpoint(jobExecutionId, promotionId),
|
|
245
|
+
method: 'GET',
|
|
246
|
+
});
|
|
247
|
+
lastResult = result;
|
|
248
|
+
hooks.log(`Promotion job ${jobExecutionId}: ${result.jobExecutionStatus ?? 'unknown'}`);
|
|
249
|
+
if (isTerminalJobStatus(result.jobExecutionStatus)) {
|
|
250
|
+
if (isFailedJobStatus(result.jobExecutionStatus)) {
|
|
251
|
+
throw new PromotionRunJobFailedError(result);
|
|
252
|
+
}
|
|
253
|
+
return result;
|
|
254
|
+
}
|
|
255
|
+
const remainingMs = deadline - Date.now();
|
|
256
|
+
if (remainingMs <= 0) {
|
|
257
|
+
throw new PromotionRunTimeoutError(timeoutSeconds, lastResult);
|
|
258
|
+
}
|
|
259
|
+
const delaySeconds = POLL_BACKOFF_SECONDS[Math.min(pollCount, POLL_BACKOFF_SECONDS.length - 1)];
|
|
260
|
+
// eslint-disable-next-line no-await-in-loop -- bounded polling backoff
|
|
261
|
+
await sleepFn(Math.min(delaySeconds * 1000, remainingMs));
|
|
262
|
+
pollCount += 1;
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
async function discoverDeploymentExecution(options) {
|
|
266
|
+
const { deadline, hooks, previousExecutionId, promotionId } = options;
|
|
267
|
+
let pollCount = 0;
|
|
268
|
+
for (;;) {
|
|
269
|
+
// eslint-disable-next-line no-await-in-loop -- deployment execution appears asynchronously
|
|
270
|
+
const promotion = await getPromotionDetail(promotionId);
|
|
271
|
+
const executionId = promotion.lastDeploymentExecutionId?.trim();
|
|
272
|
+
if (executionId && executionId.length > 0 && executionId !== previousExecutionId) {
|
|
273
|
+
return { executionId, promotion };
|
|
274
|
+
}
|
|
275
|
+
const remainingMs = deadline - Date.now();
|
|
276
|
+
if (remainingMs <= 0) {
|
|
277
|
+
return { promotion };
|
|
278
|
+
}
|
|
279
|
+
const delaySeconds = POLL_BACKOFF_SECONDS[Math.min(pollCount, POLL_BACKOFF_SECONDS.length - 1)];
|
|
280
|
+
hooks.log(`Waiting for deployment execution for promotion ${promotionId}.`);
|
|
281
|
+
// eslint-disable-next-line no-await-in-loop -- bounded deployment discovery
|
|
282
|
+
await sleepFn(Math.min(delaySeconds * 1000, remainingMs));
|
|
283
|
+
pollCount += 1;
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
function promotionRunResult(options) {
|
|
287
|
+
return { ...options, mode: 'run' };
|
|
288
|
+
}
|
|
289
|
+
// eslint-disable-next-line complexity -- orchestration intentionally mirrors the sequential promotion API lifecycle
|
|
290
|
+
export async function performPromotionRun(options) {
|
|
291
|
+
const { deploymentStepIds, hooks, ignoredMetadata, operation, promotionId: rawPromotionId, recreatePromotionBranch, timeoutSeconds, wait, } = options;
|
|
292
|
+
const promotionId = requirePromotionId(rawPromotionId);
|
|
293
|
+
const promotionBefore = await hooks.withSpinner('Fetching promotion details', () => getPromotionDetail(promotionId));
|
|
294
|
+
assertRunnablePromotion(promotionBefore);
|
|
295
|
+
const context = await hooks.withSpinner('Checking promotion readiness', () => CicdGateway.call({
|
|
296
|
+
endpoint: promotionContextEndpoint(promotionId, operation),
|
|
297
|
+
method: 'GET',
|
|
298
|
+
}));
|
|
299
|
+
assertPromotionContextReady(context, operation);
|
|
300
|
+
const deploymentSteps = operation === 'merge_and_deploy'
|
|
301
|
+
? await hooks.withSpinner('Fetching deployment steps', async () => normalizeDeploymentSteps(await CicdGateway.call({
|
|
302
|
+
endpoint: promotionDeploymentStepsEndpoint(promotionId),
|
|
303
|
+
method: 'GET',
|
|
304
|
+
})))
|
|
305
|
+
: [];
|
|
306
|
+
const orderedStepIds = deploymentStepIds ?? deploymentSteps.map((step) => step.id);
|
|
307
|
+
if (ignoredMetadata !== undefined) {
|
|
308
|
+
await hooks.withSpinner('Persisting ignored metadata', () => CicdGateway.call({
|
|
309
|
+
body: { ignoredMetadata },
|
|
310
|
+
endpoint: promotionIgnoredMetadataEndpoint(promotionId),
|
|
311
|
+
headers: { 'Content-Type': 'application/json' },
|
|
312
|
+
method: 'PUT',
|
|
313
|
+
}));
|
|
314
|
+
}
|
|
315
|
+
const request = {
|
|
316
|
+
...(orderedStepIds.length === 0 ? {} : { deploymentStepIds: orderedStepIds }),
|
|
317
|
+
operation,
|
|
318
|
+
...(recreatePromotionBranch === undefined ? {} : { recreatePromotionBranch }),
|
|
319
|
+
};
|
|
320
|
+
const run = await hooks.withSpinner('Starting promotion execution', () => CicdGateway.call({
|
|
321
|
+
body: request,
|
|
322
|
+
endpoint: promotionRunEndpoint(promotionId),
|
|
323
|
+
headers: { 'Content-Type': 'application/json' },
|
|
324
|
+
method: 'POST',
|
|
325
|
+
}));
|
|
326
|
+
const resultId = run.jobExecution?.id?.trim();
|
|
327
|
+
if (!resultId) {
|
|
328
|
+
throw new PromotionRunIncompleteResponseError(`Promotion execution started without jobExecution.id. Promotion link: ${run.promotion?.link ?? promotionId}`);
|
|
329
|
+
}
|
|
330
|
+
const baseResult = {
|
|
331
|
+
context,
|
|
332
|
+
deploymentSteps,
|
|
333
|
+
...(ignoredMetadata === undefined ? {} : { ignoredMetadata }),
|
|
334
|
+
jobMonitors: [],
|
|
335
|
+
operation,
|
|
336
|
+
promotionBefore,
|
|
337
|
+
promotionId,
|
|
338
|
+
request,
|
|
339
|
+
resultId,
|
|
340
|
+
run,
|
|
341
|
+
wait,
|
|
342
|
+
};
|
|
343
|
+
if (operation === 'merge_and_deploy' &&
|
|
344
|
+
run.startedJobPhase !== 'promotion' &&
|
|
345
|
+
run.startedJobPhase !== 'deployment') {
|
|
346
|
+
throw new PromotionRunIncompleteResponseError('merge_and_deploy response did not include a recognized startedJobPhase.', promotionRunResult(baseResult));
|
|
347
|
+
}
|
|
348
|
+
if (!wait) {
|
|
349
|
+
return promotionRunResult(baseResult);
|
|
350
|
+
}
|
|
351
|
+
const deadline = Date.now() + timeoutSeconds * 1000;
|
|
352
|
+
let promotionAfter;
|
|
353
|
+
try {
|
|
354
|
+
const firstMonitor = await hooks.withSpinner('Waiting for promotion execution', () => waitForPromotionJob({ deadline, hooks, jobExecutionId: resultId, promotionId, timeoutSeconds }));
|
|
355
|
+
baseResult.jobMonitors.push(firstMonitor);
|
|
356
|
+
if (operation === 'merge_and_deploy' && run.startedJobPhase === 'promotion') {
|
|
357
|
+
const discovered = await discoverDeploymentExecution({
|
|
358
|
+
deadline,
|
|
359
|
+
hooks,
|
|
360
|
+
previousExecutionId: promotionBefore.lastDeploymentExecutionId,
|
|
361
|
+
promotionId,
|
|
362
|
+
});
|
|
363
|
+
promotionAfter = discovered.promotion;
|
|
364
|
+
const partial = promotionRunResult({ ...baseResult, promotionAfter });
|
|
365
|
+
if (discovered.executionId === undefined) {
|
|
366
|
+
throw new PromotionRunTimeoutError(timeoutSeconds, undefined, partial);
|
|
367
|
+
}
|
|
368
|
+
const deploymentMonitor = await hooks.withSpinner('Waiting for deployment execution', () => waitForPromotionJob({
|
|
369
|
+
deadline,
|
|
370
|
+
hooks,
|
|
371
|
+
jobExecutionId: discovered.executionId,
|
|
372
|
+
promotionId,
|
|
373
|
+
timeoutSeconds,
|
|
374
|
+
}));
|
|
375
|
+
baseResult.jobMonitors.push(deploymentMonitor);
|
|
376
|
+
return promotionRunResult({ ...baseResult, promotionAfter });
|
|
377
|
+
}
|
|
378
|
+
return promotionRunResult(baseResult);
|
|
379
|
+
}
|
|
380
|
+
catch (error) {
|
|
381
|
+
if (error instanceof PromotionRunJobFailedError || error instanceof PromotionRunTimeoutError) {
|
|
382
|
+
const monitor = error.jobMonitor;
|
|
383
|
+
const jobMonitors = monitor === undefined ? baseResult.jobMonitors : [...baseResult.jobMonitors, monitor];
|
|
384
|
+
const partial = promotionRunResult({
|
|
385
|
+
...baseResult,
|
|
386
|
+
jobMonitors,
|
|
387
|
+
...(promotionAfter === undefined ? {} : { promotionAfter }),
|
|
388
|
+
});
|
|
389
|
+
if (error instanceof PromotionRunJobFailedError) {
|
|
390
|
+
throw new PromotionRunJobFailedError(error.jobMonitor, partial);
|
|
391
|
+
}
|
|
392
|
+
throw new PromotionRunTimeoutError(timeoutSeconds, monitor, partial);
|
|
393
|
+
}
|
|
394
|
+
throw error;
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
export async function performPromotionResume(options) {
|
|
398
|
+
const { hooks, jobExecutionId: rawJobExecutionId, promotionId: rawPromotionId, timeoutSeconds, wait } = options;
|
|
399
|
+
const promotionId = requirePromotionId(rawPromotionId);
|
|
400
|
+
const jobExecutionId = requireExecutionId(rawJobExecutionId);
|
|
401
|
+
const promotionBefore = await hooks.withSpinner('Fetching promotion details', () => getPromotionDetail(promotionId));
|
|
402
|
+
if (normalizeStatus(promotionBefore.status) === 'merge conflict') {
|
|
403
|
+
throw new PromotionRunValidationError(`Promotion ${promotionId} still has unresolved merge conflicts. Resolve every conflict before resuming execution ${jobExecutionId}.`);
|
|
404
|
+
}
|
|
405
|
+
if (normalizeStatus(promotionBefore.status) === 'conflicts resolved') {
|
|
406
|
+
const validation = await hooks.withSpinner('Validating conflict resolution', () => CicdGateway.call({
|
|
407
|
+
endpoint: promotionValidateResolutionEndpoint(promotionId),
|
|
408
|
+
method: 'POST',
|
|
409
|
+
}));
|
|
410
|
+
if (validation.ok !== true) {
|
|
411
|
+
throw new PromotionRunValidationError(`Conflict resolution validation failed for promotion ${promotionId}.`);
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
const run = await hooks.withSpinner('Resuming promotion execution', () => CicdGateway.call({
|
|
415
|
+
endpoint: promotionResumeEndpoint(promotionId, jobExecutionId),
|
|
416
|
+
method: 'POST',
|
|
417
|
+
}));
|
|
418
|
+
const resultId = run.jobExecution?.id?.trim();
|
|
419
|
+
if (!resultId) {
|
|
420
|
+
throw new PromotionRunIncompleteResponseError(`Promotion resume returned no jobExecution.id. Promotion link: ${run.promotion?.link ?? promotionId}`);
|
|
421
|
+
}
|
|
422
|
+
const result = {
|
|
423
|
+
context: {},
|
|
424
|
+
deploymentSteps: [],
|
|
425
|
+
jobMonitors: [],
|
|
426
|
+
mode: 'resume',
|
|
427
|
+
promotionBefore,
|
|
428
|
+
promotionId,
|
|
429
|
+
resultId,
|
|
430
|
+
run,
|
|
431
|
+
wait,
|
|
432
|
+
};
|
|
433
|
+
if (!wait) {
|
|
434
|
+
return result;
|
|
435
|
+
}
|
|
436
|
+
const deadline = Date.now() + timeoutSeconds * 1000;
|
|
437
|
+
try {
|
|
438
|
+
const monitor = await hooks.withSpinner('Waiting for resumed promotion execution', () => waitForPromotionJob({ deadline, hooks, jobExecutionId: resultId, promotionId, timeoutSeconds }));
|
|
439
|
+
result.jobMonitors.push(monitor);
|
|
440
|
+
return result;
|
|
441
|
+
}
|
|
442
|
+
catch (error) {
|
|
443
|
+
if (error instanceof PromotionRunJobFailedError) {
|
|
444
|
+
throw new PromotionRunJobFailedError(error.jobMonitor, { ...result, jobMonitors: [error.jobMonitor] });
|
|
445
|
+
}
|
|
446
|
+
if (error instanceof PromotionRunTimeoutError) {
|
|
447
|
+
throw new PromotionRunTimeoutError(timeoutSeconds, error.jobMonitor, {
|
|
448
|
+
...result,
|
|
449
|
+
...(error.jobMonitor === undefined ? {} : { jobMonitors: [error.jobMonitor] }),
|
|
450
|
+
});
|
|
451
|
+
}
|
|
452
|
+
throw error;
|
|
453
|
+
}
|
|
454
|
+
}
|
|
455
|
+
function formatRunRecord(label, record) {
|
|
456
|
+
if (record === undefined || record === null) {
|
|
457
|
+
return [];
|
|
458
|
+
}
|
|
459
|
+
return [
|
|
460
|
+
`${label}: ${cellValue(record.name ?? record.id)}`,
|
|
461
|
+
` ID: ${cellValue(record.id)}`,
|
|
462
|
+
` Status: ${cellValue(record.status)}`,
|
|
463
|
+
` Link: ${cellValue(record.link)}`,
|
|
464
|
+
];
|
|
465
|
+
}
|
|
466
|
+
export function formatPromotionRunResult(result) {
|
|
467
|
+
const lines = [
|
|
468
|
+
`Promotion ID: ${result.promotionId}`,
|
|
469
|
+
`Mode: ${result.mode}`,
|
|
470
|
+
`Operation: ${cellValue(result.operation)}`,
|
|
471
|
+
`Started Job Phase: ${cellValue(result.run.startedJobPhase)}`,
|
|
472
|
+
`Result ID: ${result.resultId}`,
|
|
473
|
+
...formatRunRecord('Promotion', result.run.promotion),
|
|
474
|
+
...formatRunRecord('Job Execution', result.run.jobExecution),
|
|
475
|
+
];
|
|
476
|
+
for (const monitor of result.jobMonitors) {
|
|
477
|
+
lines.push(`Execution ${cellValue(monitor.jobExecutionId)}: ${cellValue(monitor.jobExecutionStatus)}`, ...(monitor.jobExecutionErrorMessage ? [` Error: ${monitor.jobExecutionErrorMessage}`] : []));
|
|
478
|
+
}
|
|
479
|
+
return lines.join('\n');
|
|
480
|
+
}
|
|
481
|
+
//# sourceMappingURL=promotion-run.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"promotion-run.js","sourceRoot":"","sources":["../../src/lib/promotion-run.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,WAAW,EAAC,MAAM,mBAAmB,CAAA;AAC7C,OAAO,EAAC,SAAS,EAAC,MAAM,aAAa,CAAA;AACrC,OAAO,EACL,wBAAwB,EACxB,2BAA2B,EAI3B,qBAAqB,GAEtB,MAAM,sBAAsB,CAAA;AAE7B,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC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E,CAAC,CAC9F,CAAA;IACH,CAAC;IAED,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AACzB,CAAC"}
|
|
@@ -1 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Normalize Salesforce Ids to the 15-character form for comparisons and remote
|
|
3
|
+
* path segments where case-insensitive matching is desirable.
|
|
4
|
+
*/
|
|
1
5
|
export declare function normalizeSalesforceId(value: string): string;
|
|
6
|
+
/**
|
|
7
|
+
* Convert valid Salesforce Ids to the case-safe 18-character form required by
|
|
8
|
+
* local gateway headers.
|
|
9
|
+
*/
|
|
10
|
+
export declare function preferSalesforceId(value: string): string;
|