sfdx-hardis 6.9.1-alpha202510261312.0 → 6.9.1-alpha202510261844.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.
@@ -0,0 +1,37 @@
1
+ import { CommonPullRequestInfo } from '../gitProvider/index.js';
2
+ export interface PrePostCommand {
3
+ id: string;
4
+ label: string;
5
+ type: 'command' | 'data' | 'apex' | 'publish-community' | 'manual';
6
+ parameters?: {
7
+ apexScript?: string;
8
+ sfdmuProject?: string;
9
+ communityName?: string;
10
+ instructions?: string;
11
+ [key: string]: any;
12
+ };
13
+ command: string;
14
+ context: 'all' | 'check-deployment-only' | 'process-deployment-only';
15
+ skipIfError?: boolean;
16
+ allowFailure?: boolean;
17
+ runOnlyOnceByOrg?: boolean;
18
+ pullRequest?: CommonPullRequestInfo;
19
+ result?: ActionResult;
20
+ }
21
+ export type ActionResult = {
22
+ statusCode: 'success' | 'failed' | 'skipped';
23
+ output?: string;
24
+ skippedReason?: string;
25
+ };
26
+ export declare abstract class ActionsProvider {
27
+ static buildActionInstance(cmd: PrePostCommand): Promise<ActionsProvider>;
28
+ getLabel(): string;
29
+ /**
30
+ * Perform pre-run validations for the given command.
31
+ * Return null when the command is valid and may proceed.
32
+ * Return an ActionResult when the command must be short-circuited
33
+ * (for example: missing parameters -> failed, or manual -> skipped).
34
+ */
35
+ checkValidityIssues(cmd: PrePostCommand): Promise<ActionResult | null>;
36
+ run(cmd: PrePostCommand): Promise<ActionResult>;
37
+ }
@@ -0,0 +1,56 @@
1
+ import { SfError } from '@salesforce/core';
2
+ import c from 'chalk';
3
+ import { uxLog } from '../utils/index.js';
4
+ export class ActionsProvider {
5
+ static async buildActionInstance(cmd) {
6
+ let actionInstance = null;
7
+ const type = cmd.type || 'command';
8
+ if (type === 'command') {
9
+ const CommandAction = await import('./commandAction.js');
10
+ actionInstance = new CommandAction.CommandAction();
11
+ }
12
+ else if (type === 'apex') {
13
+ const ApexAction = await import('./apexAction.js');
14
+ actionInstance = new ApexAction.ApexAction();
15
+ }
16
+ else if (type === 'data') {
17
+ const DataAction = await import('./dataAction.js');
18
+ actionInstance = new DataAction.DataAction();
19
+ }
20
+ else if (type === 'publish-community') {
21
+ const PublishCommunityAction = await import('./publishCommunityAction.js');
22
+ actionInstance = new PublishCommunityAction.PublishCommunityAction();
23
+ }
24
+ else if (type === 'manual') {
25
+ const ManualAction = await import('./manualAction.js');
26
+ actionInstance = new ManualAction.ManualAction();
27
+ }
28
+ else {
29
+ uxLog("error", this, c.yellow(`[DeploymentActions] Action type [${cmd.type}] is not yet implemented for action [${cmd.id}]: ${cmd.label}`));
30
+ cmd.result = {
31
+ statusCode: "failed",
32
+ skippedReason: `Action type [${cmd.type}] is not implemented`
33
+ };
34
+ }
35
+ return actionInstance;
36
+ }
37
+ getLabel() {
38
+ throw new SfError('getLabel should be implemented on this call');
39
+ }
40
+ /**
41
+ * Perform pre-run validations for the given command.
42
+ * Return null when the command is valid and may proceed.
43
+ * Return an ActionResult when the command must be short-circuited
44
+ * (for example: missing parameters -> failed, or manual -> skipped).
45
+ */
46
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
47
+ async checkValidityIssues(cmd) {
48
+ return null;
49
+ }
50
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
51
+ async run(cmd) {
52
+ uxLog('warning', this, c.yellow(`run is not implemented on ${this.getLabel()}`));
53
+ return { statusCode: 'skipped', skippedReason: 'Not implemented' };
54
+ }
55
+ }
56
+ //# sourceMappingURL=actionsProvider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"actionsProvider.js","sourceRoot":"","sources":["../../../src/common/actionsProvider/actionsProvider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,CAAC,MAAM,OAAO,CAAC;AACtB,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AA+B1C,MAAM,OAAgB,eAAe;IAE5B,MAAM,C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AQ;gBACpB,aAAa,EAAE,gBAAgB,GAAG,CAAC,IAAI,sBAAsB;aAC9D,CAAC;QACJ,CAAC;QACD,OAAO,cAAc,CAAC;IACxB,CAAC;IAEM,QAAQ;QACb,MAAM,IAAI,OAAO,CAAC,6CAA6C,CAAC,CAAC;IACnE,CAAC;IAED;;;;;OAKG;IACH,6DAA6D;IACtD,KAAK,CAAC,mBAAmB,CAAC,GAAmB;QAClD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,6DAA6D;IACtD,KAAK,CAAC,GAAG,CAAC,GAAmB;QAClC,KAAK,CAAC,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,6BAA6B,IAAI,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAC;QACjF,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,aAAa,EAAE,iBAAiB,EAAE,CAAC;IACrE,CAAC;CACF"}
@@ -0,0 +1,6 @@
1
+ import { ActionsProvider, ActionResult, PrePostCommand } from './actionsProvider.js';
2
+ export declare class ApexAction extends ActionsProvider {
3
+ getLabel(): string;
4
+ checkValidity(cmd: PrePostCommand): Promise<ActionResult | null>;
5
+ run(cmd: PrePostCommand): Promise<ActionResult>;
6
+ }
@@ -0,0 +1,35 @@
1
+ import { ActionsProvider } from './actionsProvider.js';
2
+ import { execCommand, uxLog } from '../utils/index.js';
3
+ import fs from 'fs-extra';
4
+ import c from 'chalk';
5
+ export class ApexAction extends ActionsProvider {
6
+ getLabel() {
7
+ return 'ApexAction';
8
+ }
9
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
10
+ async checkValidity(cmd) {
11
+ const apexScript = cmd.parameters?.apexScript || '';
12
+ if (!apexScript) {
13
+ uxLog('error', this, c.red(`[DeploymentActions] No apexScript parameter provided for action [${cmd.id}]: ${cmd.label}`));
14
+ return { statusCode: 'failed', skippedReason: 'No apexScript parameter provided' };
15
+ }
16
+ if (!fs.existsSync(apexScript)) {
17
+ uxLog('error', this, c.red(`[DeploymentActions] Apex script file ${apexScript} does not exist for action [${cmd.id}]: ${cmd.label}`));
18
+ return { statusCode: 'failed', skippedReason: `Apex script file ${apexScript} does not exist` };
19
+ }
20
+ return null;
21
+ }
22
+ async run(cmd) {
23
+ const validity = await this.checkValidityIssues(cmd);
24
+ if (validity)
25
+ return validity;
26
+ const apexScript = cmd.parameters?.apexScript || '';
27
+ const apexCommand = `sf apex run --file ${apexScript}`;
28
+ const res = await execCommand(apexCommand, null, { fail: false, output: true });
29
+ if (res.status === 0) {
30
+ return { statusCode: 'success', output: (res.stdout || '') + '\n' + (res.stderr || '') };
31
+ }
32
+ return { statusCode: 'failed', output: (res.stdout || '') + '\n' + (res.stderr || '') };
33
+ }
34
+ }
35
+ //# sourceMappingURL=apexAction.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"apexAction.js","sourceRoot":"","sources":["../../../src/common/actionsProvider/apexAction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAgC,MAAM,sBAAsB,CAAC;AACrF,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAE,MAAM,UAAU,CAAC;AAC1B,OAAO,CAAC,MAAM,OAAO,CAAC;AAEtB,MAAM,OAAO,UAAW,SAAQ,eAAe;IACtC,QAAQ;QACb,OAAO,YAAY,CAAC;IACtB,CAAC;IAED,6DAA6D;IACtD,KAAK,CAAC,aAAa,CAAC,GAAmB;QAC5C,MAAM,UAAU,GAAI,GAAG,CAAC,UAAU,EAAE,UAAqB,IAAI,EAAE,CAAC;QAChE,IAAI,CAAC,UAAU,EAAE,CAAC;YAChB,KAAK,CAAC,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,oEAAoE,GAAG,CAAC,EAAE,MAAM,GAAG,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;YACzH,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,aAAa,EAAE,kCAAkC,EAAE,CAAC;QACr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ActionsProvider, ActionResult, PrePostCommand } from './actionsProvider.js';
2
+ export declare class CommandAction extends ActionsProvider {
3
+ getLabel(): string;
4
+ checkValidityIssues(cmd: PrePostCommand): Promise<ActionResult | null>;
5
+ run(cmd: PrePostCommand): Promise<ActionResult>;
6
+ }
@@ -0,0 +1,28 @@
1
+ import { ActionsProvider } from './actionsProvider.js';
2
+ import { execCommand, uxLog } from '../utils/index.js';
3
+ import c from 'chalk';
4
+ export class CommandAction extends ActionsProvider {
5
+ getLabel() {
6
+ return 'CommandAction';
7
+ }
8
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
9
+ async checkValidityIssues(cmd) {
10
+ const command = cmd.command;
11
+ if (!command) {
12
+ uxLog('error', this, c.red(`[DeploymentActions] No command provided for action [${cmd.id}]: ${cmd.label}`));
13
+ return { statusCode: 'failed', skippedReason: 'No command provided' };
14
+ }
15
+ return null;
16
+ }
17
+ async run(cmd) {
18
+ const validity = await this.checkValidityIssues(cmd);
19
+ if (validity)
20
+ return validity;
21
+ const res = await execCommand(cmd.command, null, { fail: false, output: true });
22
+ if (res.status === 0) {
23
+ return { statusCode: 'success', output: (res.stdout || '') + '\n' + (res.stderr || '') };
24
+ }
25
+ return { statusCode: 'failed', output: (res.stdout || '') + '\n' + (res.stderr || '') };
26
+ }
27
+ }
28
+ //# sourceMappingURL=commandAction.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"commandAction.js","sourceRoot":"","sources":["../../../src/common/actionsProvider/commandAction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAgC,MAAM,sBAAsB,CAAC;AACrF,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,CAAC,MAAM,OAAO,CAAC;AAEtB,MAAM,OAAO,aAAc,SAAQ,eAAe;IACzC,QAAQ;QACb,OAAO,eAAe,CAAC;IACzB,CAAC;IAED,6DAA6D;IACtD,KAAK,CAAC,mBAAmB,CAAC,GAAmB;QAClD,MAAM,OAAO,GAAG,GAAG,CAAC,OAAO,CAAC;QAC5B,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,KAAK,CAAC,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,uDAAuD,GAAG,CAAC,EAAE,MAAM,GAAG,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;YAC5G,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,aAAa,EAAE,qBAAqB,EAAkB,CAAC;QACxF,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IAEM,KAAK,CAAC,GAAG,CAAC,GAAmB;QAClC,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,mBAAmB,CAAC,GAAG,CAAC,CAAC;QACrD,IAAI,QAAQ;YAAE,OAAO,QAAQ,CAAC;QAC9B,MAAM,GAAG,GAAG,MAAM,WAAW,CAAC,GAAG,CAAC,OAAO,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;QAChF,IAAI,GAAG,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACrB,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,EAAE,CAAC,GAAG,CAAC,MAAM,IAAI,EAAE,CAAC,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,MAAM,IAAI,EAAE,CAAC,EAAE,CAAC;QAC3F,CAAC;QACD,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC,GAAG,CAAC,MAAM,IAAI,EAAE,CAAC,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,MAAM,IAAI,EAAE,CAAC,EAAE,CAAC;IAC1F,CAAC;CACF"}
@@ -0,0 +1,6 @@
1
+ import { ActionsProvider, ActionResult, PrePostCommand } from './actionsProvider.js';
2
+ export declare class DataAction extends ActionsProvider {
3
+ getLabel(): string;
4
+ checkValidityIssues(cmd: PrePostCommand): Promise<ActionResult | null>;
5
+ run(cmd: PrePostCommand): Promise<ActionResult>;
6
+ }
@@ -0,0 +1,30 @@
1
+ import { ActionsProvider } from './actionsProvider.js';
2
+ import { execCommand, uxLog } from '../utils/index.js';
3
+ import c from 'chalk';
4
+ export class DataAction extends ActionsProvider {
5
+ getLabel() {
6
+ return 'DataAction';
7
+ }
8
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
9
+ async checkValidityIssues(cmd) {
10
+ const sfdmuProject = cmd.parameters?.sfdmuProject || '';
11
+ if (!sfdmuProject) {
12
+ uxLog('error', this, c.red(`[DeploymentActions] No sfdmuProject parameter provided for action [${cmd.id}]: ${cmd.label}`));
13
+ return { statusCode: 'failed', skippedReason: 'No sfdmuProject parameter provided' };
14
+ }
15
+ return null;
16
+ }
17
+ async run(cmd) {
18
+ const validity = await this.checkValidityIssues(cmd);
19
+ if (validity)
20
+ return validity;
21
+ const sfdmuProject = cmd.parameters?.sfdmuProject || '';
22
+ const dataCommand = `sf sfdmu run -p ${sfdmuProject}`;
23
+ const res = await execCommand(dataCommand, null, { fail: false, output: true });
24
+ if (res.status === 0) {
25
+ return { statusCode: 'success', output: (res.stdout || '') + '\n' + (res.stderr || '') };
26
+ }
27
+ return { statusCode: 'failed', output: (res.stdout || '') + '\n' + (res.stderr || '') };
28
+ }
29
+ }
30
+ //# sourceMappingURL=dataAction.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dataAction.js","sourceRoot":"","sources":["../../../src/common/actionsProvider/dataAction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAgC,MAAM,sBAAsB,CAAC;AACrF,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,CAAC,MAAM,OAAO,CAAC;AAEtB,MAAM,OAAO,UAAW,SAAQ,eAAe;IACtC,QAAQ;QACb,OAAO,YAAY,CAAC;IACtB,CAAC;IAED,6DAA6D;IACtD,KAAK,CAAC,mBAAmB,CAAC,GAAmB;QAClD,MA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ActionsProvider, ActionResult, PrePostCommand } from './actionsProvider.js';
2
+ export declare class ManualAction extends ActionsProvider {
3
+ getLabel(): string;
4
+ checkValidityIssues(cmd: PrePostCommand): Promise<ActionResult | null>;
5
+ run(cmd: PrePostCommand): Promise<ActionResult>;
6
+ }
@@ -0,0 +1,26 @@
1
+ import { ActionsProvider } from './actionsProvider.js';
2
+ import { uxLog } from '../utils/index.js';
3
+ import c from 'chalk';
4
+ export class ManualAction extends ActionsProvider {
5
+ getLabel() {
6
+ return 'ManualAction';
7
+ }
8
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
9
+ async checkValidityIssues(cmd) {
10
+ const instructions = cmd.parameters?.instructions || '';
11
+ if (!instructions) {
12
+ uxLog('warning', this, c.yellow(`[DeploymentActions] No instructions for manual action [${cmd.id}]: ${cmd.label}`));
13
+ return { statusCode: 'skipped', skippedReason: 'No instructions provided' };
14
+ }
15
+ return null;
16
+ }
17
+ async run(cmd) {
18
+ const validity = await this.checkValidityIssues(cmd);
19
+ if (validity)
20
+ return validity;
21
+ const instructions = cmd.parameters?.instructions || '';
22
+ // Manual actions are not executed automatically. We just record the instructions.
23
+ return { statusCode: 'skipped', skippedReason: 'Manual action - see output for instructions', output: instructions };
24
+ }
25
+ }
26
+ //# sourceMappingURL=manualAction.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"manualAction.js","sourceRoot":"","sources":["../../../src/common/actionsProvider/manualAction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAgC,MAAM,sBAAsB,CAAC;AACrF,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,OAAO,CAAC,MAAM,OAAO,CAAC;AAEtB,MAAM,OAAO,YAAa,SAAQ,eAAe;IACxC,QAAQ;QACb,OAAO,cAAc,CAAC;IACxB,CAAC;IAED,6DAA6D;IACtD,KAAK,CAAC,mBAAmB,CAAC,GAAmB;QAClD,MAAM,YAAY,GAAI,GAAG,CAAC,UAAU,EAAE,YAAuB,IAAI,EAAE,CAAC;QACpE,IAAI,CAAC,YAAY,EAAE,CAAC;YAClB,KAAK,CAAC,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,0DAA0D,GAAG,CAAC,EAAE,MAAM,GAAG,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;YACpH,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,aAAa,EAAE,0BAA0B,EAAE,CAAC;QAC9E,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IAEM,KAAK,CAAC,GAAG,CAAC,GAAmB;QAClC,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,mBAAmB,CAAC,GAAG,CAAC,CAAC;QACrD,IAAI,QAAQ;YAAE,OAAO,QAAQ,CAAC;QAC9B,MAAM,YAAY,GAAI,GAAG,CAAC,UAAU,EAAE,YAAuB,IAAI,EAAE,CAAC;QACpE,kFAAkF;QAClF,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,aAAa,EAAE,6CAA6C,EAAE,MAAM,EAAE,YAAY,EAAE,CAAC;IACvH,CAAC;CACF"}
@@ -0,0 +1,6 @@
1
+ import { ActionsProvider, ActionResult, PrePostCommand } from './actionsProvider.js';
2
+ export declare class PublishCommunityAction extends ActionsProvider {
3
+ getLabel(): string;
4
+ checkValidityIssues(cmd: PrePostCommand): Promise<ActionResult | null>;
5
+ run(cmd: PrePostCommand): Promise<ActionResult>;
6
+ }
@@ -0,0 +1,30 @@
1
+ import { ActionsProvider } from './actionsProvider.js';
2
+ import { execCommand, uxLog } from '../utils/index.js';
3
+ import c from 'chalk';
4
+ export class PublishCommunityAction extends ActionsProvider {
5
+ getLabel() {
6
+ return 'PublishCommunityAction';
7
+ }
8
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
9
+ async checkValidityIssues(cmd) {
10
+ const communityName = cmd.parameters?.communityName || '';
11
+ if (!communityName) {
12
+ uxLog('error', this, c.red(`[DeploymentActions] No communityName parameter provided for action [${cmd.id}]: ${cmd.label}`));
13
+ return { statusCode: 'failed', skippedReason: 'No communityName parameter provided' };
14
+ }
15
+ return null;
16
+ }
17
+ async run(cmd) {
18
+ const validity = await this.checkValidityIssues(cmd);
19
+ if (validity)
20
+ return validity;
21
+ const communityName = cmd.parameters?.communityName || '';
22
+ const publishCmd = `sf community publish -n "${communityName}"`;
23
+ const res = await execCommand(publishCmd, null, { fail: false, output: true });
24
+ if (res.status === 0) {
25
+ return { statusCode: 'success', output: (res.stdout || '') + '\n' + (res.stderr || '') };
26
+ }
27
+ return { statusCode: 'failed', output: (res.stdout || '') + '\n' + (res.stderr || '') };
28
+ }
29
+ }
30
+ //# sourceMappingURL=publishCommunityAction.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"publishCommunityAction.js","sourceRoot":"","sources":["../../../src/common/actionsProvider/publishCommunityAction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAgC,MAAM,sBAAsB,CAAC;AACrF,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,CAAC,MAAM,OAAO,CAAC;AAEtB,MAAM,OAAO,sBAAuB,SAAQ,eAAe;IAClD,QAAQ;QACb,OAAO,wBAAwB,CAAC;IAClC,CAAC;IAED,6DAA6D;IACtD,KAAK,CAAC,mBAAmB,CAAC,GAAmB;QAClD,MAAM,aAAa,GAAI,GAAG,CAAC,UAAU,EAAE,aAAwB,IAAI,EAAE,CAAC;QACtE,IAAI,CAAC,aAAa,EAAE,CAAC;YACnB,KAAK,CAAC,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,uEAAuE,GAAG,CAAC,EAAE,MAAM,GAAG,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;YAC5H,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,aAAa,EAAE,qCAAqC,EAAE,CAAC;QACxF,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IAEM,KAAK,CAAC,GAAG,CAAC,GAAmB;QAClC,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,mBAAmB,CAAC,GAAG,CAAC,CAAC;QACrD,IAAI,QAAQ;YAAE,OAAO,QAAQ,CAAC;QAC9B,MAAM,aAAa,GAAI,GAAG,CAAC,UAAU,EAAE,aAAwB,IAAI,EAAE,CAAC;QACtE,MAAM,UAAU,GAAG,4BAA4B,aAAa,GAAG,CAAC;QAChE,MAAM,GAAG,GAAG,MAAM,WAAW,CAAC,UAAU,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;QAC/E,IAAI,GAAG,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACrB,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,EAAE,CAAC,GAAG,CAAC,MAAM,IAAI,EAAE,CAAC,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,MAAM,IAAI,EAAE,CAAC,EAAE,CAAC;QAC3F,CAAC;QACD,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC,GAAG,CAAC,MAAM,IAAI,EAAE,CAAC,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,MAAM,IAAI,EAAE,CAAC,EAAE,CAAC;IAC1F,CAAC;CACF"}
@@ -1,28 +1,4 @@
1
1
  import { Connection } from '@salesforce/core';
2
- import { CommonPullRequestInfo } from '../gitProvider/index.js';
3
- export interface PrePostCommand {
4
- id: string;
5
- label: string;
6
- type: 'command' | 'data' | 'apex' | 'publish-community' | 'manual';
7
- parameters?: {
8
- apexScript?: string;
9
- sfdmuProject?: string;
10
- communityName?: string;
11
- instructions?: string;
12
- [key: string]: any;
13
- };
14
- command: string;
15
- context: 'all' | 'check-deployment-only' | 'process-deployment-only';
16
- skipIfError?: boolean;
17
- allowFailure?: boolean;
18
- runOnlyOnceByOrg?: boolean;
19
- pullRequest?: CommonPullRequestInfo;
20
- result?: {
21
- statusCode: "success" | "failed" | "skipped";
22
- output?: string;
23
- skippedReason?: string;
24
- };
25
- }
26
2
  export declare function executePrePostCommands(property: 'commandsPreDeploy' | 'commandsPostDeploy', options: {
27
3
  success: boolean;
28
4
  checkOnly: boolean;