@salesforce/b2c-cli 0.0.0-nightly.20260119053920
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 +222 -0
- package/bin/dev.cmd +3 -0
- package/bin/dev.js +17 -0
- package/bin/run.cmd +3 -0
- package/bin/run.js +17 -0
- package/dist/commands/_test/index.d.ts +6 -0
- package/dist/commands/_test/index.js +39 -0
- package/dist/commands/_test/index.js.map +1 -0
- package/dist/commands/auth/token.d.ts +16 -0
- package/dist/commands/auth/token.js +35 -0
- package/dist/commands/auth/token.js.map +1 -0
- package/dist/commands/code/activate.d.ts +33 -0
- package/dist/commands/code/activate.js +83 -0
- package/dist/commands/code/activate.js.map +1 -0
- package/dist/commands/code/delete.d.ts +33 -0
- package/dist/commands/code/delete.js +67 -0
- package/dist/commands/code/delete.js.map +1 -0
- package/dist/commands/code/deploy.d.ts +38 -0
- package/dist/commands/code/deploy.js +141 -0
- package/dist/commands/code/deploy.js.map +1 -0
- package/dist/commands/code/list.d.ts +8 -0
- package/dist/commands/code/list.js +64 -0
- package/dist/commands/code/list.js.map +1 -0
- package/dist/commands/code/watch.d.ts +34 -0
- package/dist/commands/code/watch.js +70 -0
- package/dist/commands/code/watch.js.map +1 -0
- package/dist/commands/docs/download.d.ts +35 -0
- package/dist/commands/docs/download.js +58 -0
- package/dist/commands/docs/download.js.map +1 -0
- package/dist/commands/docs/read.d.ts +29 -0
- package/dist/commands/docs/read.js +70 -0
- package/dist/commands/docs/read.js.map +1 -0
- package/dist/commands/docs/schema.d.ts +32 -0
- package/dist/commands/docs/schema.js +68 -0
- package/dist/commands/docs/schema.js.map +1 -0
- package/dist/commands/docs/search.d.ts +33 -0
- package/dist/commands/docs/search.js +102 -0
- package/dist/commands/docs/search.js.map +1 -0
- package/dist/commands/job/export.d.ts +50 -0
- package/dist/commands/job/export.js +270 -0
- package/dist/commands/job/export.js.map +1 -0
- package/dist/commands/job/import.d.ts +38 -0
- package/dist/commands/job/import.js +143 -0
- package/dist/commands/job/import.js.map +1 -0
- package/dist/commands/job/run.d.ts +45 -0
- package/dist/commands/job/run.js +205 -0
- package/dist/commands/job/run.js.map +1 -0
- package/dist/commands/job/search.d.ts +37 -0
- package/dist/commands/job/search.js +102 -0
- package/dist/commands/job/search.js.map +1 -0
- package/dist/commands/job/wait.d.ts +38 -0
- package/dist/commands/job/wait.js +85 -0
- package/dist/commands/job/wait.js.map +1 -0
- package/dist/commands/mrt/env/create.d.ts +41 -0
- package/dist/commands/mrt/env/create.js +226 -0
- package/dist/commands/mrt/env/create.js.map +1 -0
- package/dist/commands/mrt/env/delete.d.ts +34 -0
- package/dist/commands/mrt/env/delete.js +94 -0
- package/dist/commands/mrt/env/delete.js.map +1 -0
- package/dist/commands/mrt/env/var/delete.d.ts +34 -0
- package/dist/commands/mrt/env/var/delete.js +53 -0
- package/dist/commands/mrt/env/var/delete.js.map +1 -0
- package/dist/commands/mrt/env/var/list.d.ts +28 -0
- package/dist/commands/mrt/env/var/list.js +71 -0
- package/dist/commands/mrt/env/var/list.js.map +1 -0
- package/dist/commands/mrt/env/var/set.d.ts +35 -0
- package/dist/commands/mrt/env/var/set.js +84 -0
- package/dist/commands/mrt/env/var/set.js.map +1 -0
- package/dist/commands/mrt/push.d.ts +37 -0
- package/dist/commands/mrt/push.js +122 -0
- package/dist/commands/mrt/push.js.map +1 -0
- package/dist/commands/ods/create.d.ts +42 -0
- package/dist/commands/ods/create.js +255 -0
- package/dist/commands/ods/create.js.map +1 -0
- package/dist/commands/ods/delete.d.ts +15 -0
- package/dist/commands/ods/delete.js +86 -0
- package/dist/commands/ods/delete.js.map +1 -0
- package/dist/commands/ods/get.d.ts +17 -0
- package/dist/commands/ods/get.js +99 -0
- package/dist/commands/ods/get.js.map +1 -0
- package/dist/commands/ods/info.d.ts +27 -0
- package/dist/commands/ods/info.js +109 -0
- package/dist/commands/ods/info.js.map +1 -0
- package/dist/commands/ods/list.d.ts +31 -0
- package/dist/commands/ods/list.js +166 -0
- package/dist/commands/ods/list.js.map +1 -0
- package/dist/commands/ods/restart.d.ts +16 -0
- package/dist/commands/ods/restart.js +51 -0
- package/dist/commands/ods/restart.js.map +1 -0
- package/dist/commands/ods/start.d.ts +16 -0
- package/dist/commands/ods/start.js +51 -0
- package/dist/commands/ods/start.js.map +1 -0
- package/dist/commands/ods/stop.d.ts +16 -0
- package/dist/commands/ods/stop.js +51 -0
- package/dist/commands/ods/stop.js.map +1 -0
- package/dist/commands/scapi/custom/status.d.ts +81 -0
- package/dist/commands/scapi/custom/status.js +321 -0
- package/dist/commands/scapi/custom/status.js.map +1 -0
- package/dist/commands/scapi/schemas/get.d.ts +86 -0
- package/dist/commands/scapi/schemas/get.js +317 -0
- package/dist/commands/scapi/schemas/get.js.map +1 -0
- package/dist/commands/scapi/schemas/list.d.ts +48 -0
- package/dist/commands/scapi/schemas/list.js +148 -0
- package/dist/commands/scapi/schemas/list.js.map +1 -0
- package/dist/commands/sites/list.d.ts +10 -0
- package/dist/commands/sites/list.js +56 -0
- package/dist/commands/sites/list.js.map +1 -0
- package/dist/commands/slas/client/create.d.ts +38 -0
- package/dist/commands/slas/client/create.js +168 -0
- package/dist/commands/slas/client/create.js.map +1 -0
- package/dist/commands/slas/client/delete.d.ts +34 -0
- package/dist/commands/slas/client/delete.js +54 -0
- package/dist/commands/slas/client/delete.js.map +1 -0
- package/dist/commands/slas/client/get.d.ts +29 -0
- package/dist/commands/slas/client/get.js +51 -0
- package/dist/commands/slas/client/get.js.map +1 -0
- package/dist/commands/slas/client/list.d.ts +30 -0
- package/dist/commands/slas/client/list.js +64 -0
- package/dist/commands/slas/client/list.js.map +1 -0
- package/dist/commands/slas/client/open.d.ts +25 -0
- package/dist/commands/slas/client/open.js +56 -0
- package/dist/commands/slas/client/open.js.map +1 -0
- package/dist/commands/slas/client/update.d.ts +60 -0
- package/dist/commands/slas/client/update.js +183 -0
- package/dist/commands/slas/client/update.js.map +1 -0
- package/dist/commands/webdav/get.d.ts +41 -0
- package/dist/commands/webdav/get.js +61 -0
- package/dist/commands/webdav/get.js.map +1 -0
- package/dist/commands/webdav/ls.d.ts +17 -0
- package/dist/commands/webdav/ls.js +101 -0
- package/dist/commands/webdav/ls.js.map +1 -0
- package/dist/commands/webdav/mkdir.d.ts +19 -0
- package/dist/commands/webdav/mkdir.js +48 -0
- package/dist/commands/webdav/mkdir.js.map +1 -0
- package/dist/commands/webdav/put.d.ts +23 -0
- package/dist/commands/webdav/put.js +107 -0
- package/dist/commands/webdav/put.js.map +1 -0
- package/dist/commands/webdav/rm.d.ts +40 -0
- package/dist/commands/webdav/rm.js +67 -0
- package/dist/commands/webdav/rm.js.map +1 -0
- package/dist/commands/webdav/unzip.d.ts +15 -0
- package/dist/commands/webdav/unzip.js +48 -0
- package/dist/commands/webdav/unzip.js.map +1 -0
- package/dist/commands/webdav/zip.d.ts +15 -0
- package/dist/commands/webdav/zip.js +47 -0
- package/dist/commands/webdav/zip.js.map +1 -0
- package/dist/i18n/index.d.ts +29 -0
- package/dist/i18n/index.js +43 -0
- package/dist/i18n/index.js.map +1 -0
- package/dist/i18n/locales/de.d.ts +51 -0
- package/dist/i18n/locales/de.js +57 -0
- package/dist/i18n/locales/de.js.map +1 -0
- package/dist/i18n/locales/en.d.ts +118 -0
- package/dist/i18n/locales/en.js +124 -0
- package/dist/i18n/locales/en.js.map +1 -0
- package/dist/i18n/locales/index.d.ts +177 -0
- package/dist/i18n/locales/index.js +26 -0
- package/dist/i18n/locales/index.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +13 -0
- package/dist/index.js.map +1 -0
- package/dist/utils/scapi/schemas.d.ts +40 -0
- package/dist/utils/scapi/schemas.js +49 -0
- package/dist/utils/scapi/schemas.js.map +1 -0
- package/dist/utils/slas/client.d.ts +65 -0
- package/dist/utils/slas/client.js +146 -0
- package/dist/utils/slas/client.js.map +1 -0
- package/oclif.manifest.json +10942 -0
- package/package.json +154 -0
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2025, Salesforce, Inc.
|
|
3
|
+
* SPDX-License-Identifier: Apache-2
|
|
4
|
+
* For full license text, see the license.txt file in the repo root or http://www.apache.org/licenses/LICENSE-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { Args, Flags } from '@oclif/core';
|
|
7
|
+
import { JobCommand } from '@salesforce/b2c-tooling-sdk/cli';
|
|
8
|
+
import { siteArchiveImport, JobExecutionError, } from '@salesforce/b2c-tooling-sdk/operations/jobs';
|
|
9
|
+
import { t } from '../../i18n/index.js';
|
|
10
|
+
export default class JobImport extends JobCommand {
|
|
11
|
+
static args = {
|
|
12
|
+
target: Args.string({
|
|
13
|
+
description: 'Directory, zip file, or remote filename to import',
|
|
14
|
+
required: true,
|
|
15
|
+
}),
|
|
16
|
+
};
|
|
17
|
+
static description = t('commands.job.import.description', 'Import a site archive to a B2C Commerce instance using sfcc-site-archive-import job');
|
|
18
|
+
static enableJsonFlag = true;
|
|
19
|
+
static examples = [
|
|
20
|
+
'<%= config.bin %> <%= command.id %> ./my-site-data',
|
|
21
|
+
'<%= config.bin %> <%= command.id %> ./export.zip',
|
|
22
|
+
'<%= config.bin %> <%= command.id %> ./my-site-data --keep-archive',
|
|
23
|
+
'<%= config.bin %> <%= command.id %> existing-archive.zip --remote',
|
|
24
|
+
];
|
|
25
|
+
static flags = {
|
|
26
|
+
...JobCommand.baseFlags,
|
|
27
|
+
'keep-archive': Flags.boolean({
|
|
28
|
+
char: 'k',
|
|
29
|
+
description: 'Keep archive on instance after import',
|
|
30
|
+
default: false,
|
|
31
|
+
}),
|
|
32
|
+
remote: Flags.boolean({
|
|
33
|
+
char: 'r',
|
|
34
|
+
description: 'Target is a filename already on the instance (in Impex/src/instance/)',
|
|
35
|
+
default: false,
|
|
36
|
+
}),
|
|
37
|
+
timeout: Flags.integer({
|
|
38
|
+
char: 't',
|
|
39
|
+
description: 'Timeout in seconds (default: no timeout)',
|
|
40
|
+
}),
|
|
41
|
+
'show-log': Flags.boolean({
|
|
42
|
+
description: 'Show job log on failure',
|
|
43
|
+
default: true,
|
|
44
|
+
}),
|
|
45
|
+
};
|
|
46
|
+
async run() {
|
|
47
|
+
this.requireOAuthCredentials();
|
|
48
|
+
this.requireWebDavCredentials();
|
|
49
|
+
const { target } = this.args;
|
|
50
|
+
const { 'keep-archive': keepArchive, remote, timeout, 'show-log': showLog } = this.flags;
|
|
51
|
+
const hostname = this.resolvedConfig.values.hostname;
|
|
52
|
+
// Create lifecycle context
|
|
53
|
+
const context = this.createContext('job:import', {
|
|
54
|
+
target,
|
|
55
|
+
remote,
|
|
56
|
+
keepArchive,
|
|
57
|
+
hostname,
|
|
58
|
+
});
|
|
59
|
+
// Run beforeOperation hooks - check for skip
|
|
60
|
+
const beforeResult = await this.runBeforeHooks(context);
|
|
61
|
+
if (beforeResult.skip) {
|
|
62
|
+
this.log(t('commands.job.import.skipped', 'Import skipped: {{reason}}', {
|
|
63
|
+
reason: beforeResult.skipReason || 'skipped by plugin',
|
|
64
|
+
}));
|
|
65
|
+
return {
|
|
66
|
+
execution: { execution_status: 'finished', exit_status: { code: 'skipped' } },
|
|
67
|
+
archiveFilename: '',
|
|
68
|
+
archiveKept: false,
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
if (remote) {
|
|
72
|
+
this.log(t('commands.job.import.importingRemote', 'Importing {{target}} from {{hostname}}...', {
|
|
73
|
+
target,
|
|
74
|
+
hostname,
|
|
75
|
+
}));
|
|
76
|
+
}
|
|
77
|
+
else {
|
|
78
|
+
this.log(t('commands.job.import.importing', 'Importing {{target}} to {{hostname}}...', {
|
|
79
|
+
target,
|
|
80
|
+
hostname,
|
|
81
|
+
}));
|
|
82
|
+
}
|
|
83
|
+
try {
|
|
84
|
+
const importTarget = remote ? { remoteFilename: target } : target;
|
|
85
|
+
const result = await siteArchiveImport(this.instance, importTarget, {
|
|
86
|
+
keepArchive,
|
|
87
|
+
waitOptions: {
|
|
88
|
+
timeout: timeout ? timeout * 1000 : undefined,
|
|
89
|
+
onProgress: (exec, elapsed) => {
|
|
90
|
+
if (!this.jsonEnabled()) {
|
|
91
|
+
const elapsedSec = Math.floor(elapsed / 1000);
|
|
92
|
+
this.log(t('commands.job.import.progress', ' Status: {{status}} ({{elapsed}}s elapsed)', {
|
|
93
|
+
status: exec.execution_status,
|
|
94
|
+
elapsed: elapsedSec.toString(),
|
|
95
|
+
}));
|
|
96
|
+
}
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
});
|
|
100
|
+
const durationSec = result.execution.duration ? (result.execution.duration / 1000).toFixed(1) : 'N/A';
|
|
101
|
+
this.log(t('commands.job.import.completed', 'Import completed: {{status}} (duration: {{duration}}s)', {
|
|
102
|
+
status: result.execution.exit_status?.code || result.execution.execution_status,
|
|
103
|
+
duration: durationSec,
|
|
104
|
+
}));
|
|
105
|
+
if (result.archiveKept) {
|
|
106
|
+
this.log(t('commands.job.import.archiveKept', 'Archive kept at: Impex/src/instance/{{filename}}', {
|
|
107
|
+
filename: result.archiveFilename,
|
|
108
|
+
}));
|
|
109
|
+
}
|
|
110
|
+
// Run afterOperation hooks with success
|
|
111
|
+
await this.runAfterHooks(context, {
|
|
112
|
+
success: true,
|
|
113
|
+
duration: Date.now() - context.startTime,
|
|
114
|
+
data: result,
|
|
115
|
+
});
|
|
116
|
+
return result;
|
|
117
|
+
}
|
|
118
|
+
catch (error) {
|
|
119
|
+
// Run afterOperation hooks with failure
|
|
120
|
+
await this.runAfterHooks(context, {
|
|
121
|
+
success: false,
|
|
122
|
+
error: error instanceof Error ? error : new Error(String(error)),
|
|
123
|
+
duration: Date.now() - context.startTime,
|
|
124
|
+
data: error instanceof JobExecutionError ? error.execution : undefined,
|
|
125
|
+
});
|
|
126
|
+
if (error instanceof JobExecutionError) {
|
|
127
|
+
if (showLog) {
|
|
128
|
+
await this.showJobLog(error.execution);
|
|
129
|
+
}
|
|
130
|
+
this.error(t('commands.job.import.failed', 'Import failed: {{status}}', {
|
|
131
|
+
status: error.execution.exit_status?.code || 'ERROR',
|
|
132
|
+
}));
|
|
133
|
+
}
|
|
134
|
+
if (error instanceof Error) {
|
|
135
|
+
this.error(t('commands.job.import.error', 'Import error: {{message}}', {
|
|
136
|
+
message: error.message,
|
|
137
|
+
}));
|
|
138
|
+
}
|
|
139
|
+
throw error;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
//# sourceMappingURL=import.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"import.js","sourceRoot":"","sources":["../../../src/commands/job/import.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAC,IAAI,EAAE,KAAK,EAAC,MAAM,aAAa,CAAC;AACxC,OAAO,EAAC,UAAU,EAAC,MAAM,iCAAiC,CAAC;AAC3D,OAAO,EACL,iBAAiB,EACjB,iBAAiB,GAElB,MAAM,6CAA6C,CAAC;AACrD,OAAO,EAAC,CAAC,EAAC,MAAM,qBAAqB,CAAC;AAEtC,MAAM,CAAC,OAAO,OAAO,SAAU,SAAQ,UAA4B;IACjE,MAAM,CAAC,IAAI,GAAG;QACZ,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC;YAClB,WAAW,EAAE,mDAAmD;YAChE,QAAQ,EAAE,IAAI;SACf,CAAC;KACH,CAAC;IAEF,MAAM,CAAC,WAAW,GAAG,CAAC,CACpB,iCAAiC,EACjC,qFAAqF,CACtF,CAAC;IAEF,MAAM,CAAC,cAAc,GAAG,IAAI,CAAC;IAE7B,MAAM,CAAC,QAAQ,GAAG;QAChB,oDAAoD;QACpD,kDAAkD;QAClD,mEAAmE;QACnE,mEAAmE;KACpE,CAAC;IAEF,MAAM,CAAC,KAAK,GAAG;QACb,GAAG,UAAU,CAAC,SAAS;QACvB,cAAc,EAAE,KAAK,CAAC,OAAO,CAAC;YAC5B,IAAI,EAAE,GAAG;YACT,WAAW,EAAE,uCAAuC;YACpD,OAAO,EAAE,KAAK;SACf,CAAC;QACF,M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CAAC,UAAU,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;gBACzC,CAAC;gBACD,IAAI,CAAC,KAAK,CACR,CAAC,CAAC,4BAA4B,EAAE,2BAA2B,EAAE;oBAC3D,MAAM,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,EAAE,IAAI,IAAI,OAAO;iBACrD,CAAC,CACH,CAAC;YACJ,CAAC;YACD,IAAI,KAAK,YAAY,KAAK,EAAE,CAAC;gBAC3B,IAAI,CAAC,KAAK,CACR,CAAC,CAAC,2BAA2B,EAAE,2BAA2B,EAAE;oBAC1D,OAAO,EAAE,KAAK,CAAC,OAAO;iBACvB,CAAC,CACH,CAAC;YACJ,CAAC;YACD,MAAM,KAAK,CAAC;QACd,CAAC;IACH,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { JobCommand } from '@salesforce/b2c-tooling-sdk/cli';
|
|
2
|
+
import { type JobExecution } from '@salesforce/b2c-tooling-sdk/operations/jobs';
|
|
3
|
+
export default class JobRun extends JobCommand<typeof JobRun> {
|
|
4
|
+
static args: {
|
|
5
|
+
jobId: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
|
|
6
|
+
};
|
|
7
|
+
static description: string;
|
|
8
|
+
static enableJsonFlag: boolean;
|
|
9
|
+
static examples: string[];
|
|
10
|
+
static flags: {
|
|
11
|
+
wait: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
12
|
+
timeout: import("@oclif/core/interfaces").OptionFlag<number | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
13
|
+
param: import("@oclif/core/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
14
|
+
body: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
15
|
+
'no-wait-running': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
16
|
+
'show-log': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
17
|
+
server: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
18
|
+
'webdav-server': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
19
|
+
'code-version': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
20
|
+
username: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
21
|
+
password: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
22
|
+
'client-id': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
23
|
+
'client-secret': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
24
|
+
scope: import("@oclif/core/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
25
|
+
'short-code': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
26
|
+
'auth-methods': import("@oclif/core/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
27
|
+
'account-manager-host': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
28
|
+
'log-level': import("@oclif/core/interfaces").OptionFlag<"trace" | "debug" | "info" | "warn" | "error" | "silent" | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
29
|
+
debug: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
30
|
+
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
31
|
+
lang: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
32
|
+
config: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
33
|
+
instance: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
34
|
+
'working-directory': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
35
|
+
'extra-query': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
36
|
+
'extra-body': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
37
|
+
'extra-headers': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
38
|
+
};
|
|
39
|
+
run(): Promise<JobExecution>;
|
|
40
|
+
private handleExecutionError;
|
|
41
|
+
private handleWaitError;
|
|
42
|
+
private parseBody;
|
|
43
|
+
private parseParameters;
|
|
44
|
+
private waitForJobCompletion;
|
|
45
|
+
}
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2025, Salesforce, Inc.
|
|
3
|
+
* SPDX-License-Identifier: Apache-2
|
|
4
|
+
* For full license text, see the license.txt file in the repo root or http://www.apache.org/licenses/LICENSE-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { Args, Flags } from '@oclif/core';
|
|
7
|
+
import { JobCommand } from '@salesforce/b2c-tooling-sdk/cli';
|
|
8
|
+
import { executeJob, waitForJob, JobExecutionError, } from '@salesforce/b2c-tooling-sdk/operations/jobs';
|
|
9
|
+
import { t } from '../../i18n/index.js';
|
|
10
|
+
export default class JobRun extends JobCommand {
|
|
11
|
+
static args = {
|
|
12
|
+
jobId: Args.string({
|
|
13
|
+
description: 'Job ID to execute',
|
|
14
|
+
required: true,
|
|
15
|
+
}),
|
|
16
|
+
};
|
|
17
|
+
static description = t('commands.job.run.description', 'Execute a job on a B2C Commerce instance');
|
|
18
|
+
static enableJsonFlag = true;
|
|
19
|
+
static examples = [
|
|
20
|
+
'<%= config.bin %> <%= command.id %> my-custom-job',
|
|
21
|
+
'<%= config.bin %> <%= command.id %> my-custom-job --wait',
|
|
22
|
+
String.raw `<%= config.bin %> <%= command.id %> my-custom-job -P "SiteScope={\"all_storefront_sites\":true}" -P OtherParam=value`,
|
|
23
|
+
'<%= config.bin %> <%= command.id %> my-custom-job --wait --timeout 600',
|
|
24
|
+
String.raw `<%= config.bin %> <%= command.id %> sfcc-search-index-product-full-update --body '{"site_scope":{"named_sites":["RefArch"]}}'`,
|
|
25
|
+
];
|
|
26
|
+
static flags = {
|
|
27
|
+
...JobCommand.baseFlags,
|
|
28
|
+
wait: Flags.boolean({
|
|
29
|
+
char: 'w',
|
|
30
|
+
description: 'Wait for job to complete',
|
|
31
|
+
default: false,
|
|
32
|
+
}),
|
|
33
|
+
timeout: Flags.integer({
|
|
34
|
+
char: 't',
|
|
35
|
+
description: 'Timeout in seconds when waiting (default: no timeout)',
|
|
36
|
+
}),
|
|
37
|
+
param: Flags.string({
|
|
38
|
+
char: 'P',
|
|
39
|
+
description: 'Job parameter in format "name=value" (use -P multiple times for multiple params)',
|
|
40
|
+
multiple: true,
|
|
41
|
+
multipleNonGreedy: true,
|
|
42
|
+
exclusive: ['body'],
|
|
43
|
+
}),
|
|
44
|
+
body: Flags.string({
|
|
45
|
+
char: 'B',
|
|
46
|
+
description: 'Raw JSON request body (for system jobs with non-standard schemas)',
|
|
47
|
+
exclusive: ['param'],
|
|
48
|
+
}),
|
|
49
|
+
'no-wait-running': Flags.boolean({
|
|
50
|
+
description: 'Do not wait for running job to finish before starting',
|
|
51
|
+
default: false,
|
|
52
|
+
}),
|
|
53
|
+
'show-log': Flags.boolean({
|
|
54
|
+
description: 'Show job log on failure',
|
|
55
|
+
default: true,
|
|
56
|
+
}),
|
|
57
|
+
};
|
|
58
|
+
async run() {
|
|
59
|
+
this.requireOAuthCredentials();
|
|
60
|
+
const { jobId } = this.args;
|
|
61
|
+
const { wait, timeout, param, body, 'no-wait-running': noWaitRunning, 'show-log': showLog } = this.flags;
|
|
62
|
+
// Parse parameters or body
|
|
63
|
+
const parameters = this.parseParameters(param || []);
|
|
64
|
+
const rawBody = body ? this.parseBody(body) : undefined;
|
|
65
|
+
// Create lifecycle context
|
|
66
|
+
const context = this.createContext('job:run', {
|
|
67
|
+
jobId,
|
|
68
|
+
parameters: rawBody ? undefined : parameters,
|
|
69
|
+
body: rawBody,
|
|
70
|
+
wait,
|
|
71
|
+
hostname: this.resolvedConfig.values.hostname,
|
|
72
|
+
});
|
|
73
|
+
// Run beforeOperation hooks - check for skip
|
|
74
|
+
const beforeResult = await this.runBeforeHooks(context);
|
|
75
|
+
if (beforeResult.skip) {
|
|
76
|
+
this.log(t('commands.job.run.skipped', 'Job execution skipped: {{reason}}', {
|
|
77
|
+
reason: beforeResult.skipReason || 'skipped by plugin',
|
|
78
|
+
}));
|
|
79
|
+
// Return a mock execution for JSON output
|
|
80
|
+
return { execution_status: 'finished', exit_status: { code: 'skipped' } };
|
|
81
|
+
}
|
|
82
|
+
this.log(t('commands.job.run.executing', 'Executing job {{jobId}} on {{hostname}}...', {
|
|
83
|
+
jobId,
|
|
84
|
+
hostname: this.resolvedConfig.values.hostname,
|
|
85
|
+
}));
|
|
86
|
+
let execution;
|
|
87
|
+
try {
|
|
88
|
+
execution = await executeJob(this.instance, jobId, {
|
|
89
|
+
parameters: rawBody ? undefined : parameters,
|
|
90
|
+
body: rawBody,
|
|
91
|
+
waitForRunning: !noWaitRunning,
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
catch (error) {
|
|
95
|
+
this.handleExecutionError(error, context);
|
|
96
|
+
}
|
|
97
|
+
this.log(t('commands.job.run.started', 'Job started: {{executionId}} (status: {{status}})', {
|
|
98
|
+
executionId: execution.id,
|
|
99
|
+
status: execution.execution_status,
|
|
100
|
+
}));
|
|
101
|
+
// Wait for completion if requested
|
|
102
|
+
if (wait) {
|
|
103
|
+
execution = await this.waitForJobCompletion({
|
|
104
|
+
jobId,
|
|
105
|
+
executionId: execution.id,
|
|
106
|
+
timeout,
|
|
107
|
+
showLog,
|
|
108
|
+
context,
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
else {
|
|
112
|
+
// Not waiting - run afterOperation hooks with current state
|
|
113
|
+
await this.runAfterHooks(context, {
|
|
114
|
+
success: true,
|
|
115
|
+
duration: Date.now() - context.startTime,
|
|
116
|
+
data: execution,
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
return execution;
|
|
120
|
+
}
|
|
121
|
+
handleExecutionError(error, context) {
|
|
122
|
+
// Run afterOperation hooks with failure (fire-and-forget, errors ignored)
|
|
123
|
+
this.runAfterHooks(context, {
|
|
124
|
+
success: false,
|
|
125
|
+
error: error instanceof Error ? error : new Error(String(error)),
|
|
126
|
+
duration: Date.now() - context.startTime,
|
|
127
|
+
}).catch(() => { });
|
|
128
|
+
if (error instanceof Error) {
|
|
129
|
+
this.error(t('commands.job.run.executionFailed', 'Failed to execute job: {{message}}', { message: error.message }));
|
|
130
|
+
}
|
|
131
|
+
throw error;
|
|
132
|
+
}
|
|
133
|
+
async handleWaitError(error, showLog, context) {
|
|
134
|
+
// Run afterOperation hooks with failure
|
|
135
|
+
await this.runAfterHooks(context, {
|
|
136
|
+
success: false,
|
|
137
|
+
error: error instanceof Error ? error : new Error(String(error)),
|
|
138
|
+
duration: Date.now() - context.startTime,
|
|
139
|
+
data: error instanceof JobExecutionError ? error.execution : undefined,
|
|
140
|
+
});
|
|
141
|
+
if (error instanceof JobExecutionError) {
|
|
142
|
+
if (showLog) {
|
|
143
|
+
await this.showJobLog(error.execution);
|
|
144
|
+
}
|
|
145
|
+
this.error(t('commands.job.run.jobFailed', 'Job failed: {{status}}', {
|
|
146
|
+
status: error.execution.exit_status?.code || 'ERROR',
|
|
147
|
+
}));
|
|
148
|
+
}
|
|
149
|
+
throw error;
|
|
150
|
+
}
|
|
151
|
+
parseBody(body) {
|
|
152
|
+
try {
|
|
153
|
+
return JSON.parse(body);
|
|
154
|
+
}
|
|
155
|
+
catch {
|
|
156
|
+
this.error(t('commands.job.run.invalidBody', 'Invalid JSON body: {{body}}', { body }));
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
parseParameters(params) {
|
|
160
|
+
return params.map((p) => {
|
|
161
|
+
const eqIndex = p.indexOf('=');
|
|
162
|
+
if (eqIndex === -1) {
|
|
163
|
+
this.error(t('commands.job.run.invalidParam', 'Invalid parameter format: {{param}}. Expected "name=value"', { param: p }));
|
|
164
|
+
}
|
|
165
|
+
return {
|
|
166
|
+
name: p.slice(0, eqIndex),
|
|
167
|
+
value: p.slice(eqIndex + 1),
|
|
168
|
+
};
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
async waitForJobCompletion(options) {
|
|
172
|
+
const { jobId, executionId, timeout, showLog, context } = options;
|
|
173
|
+
this.log(t('commands.job.run.waiting', 'Waiting for job to complete...'));
|
|
174
|
+
try {
|
|
175
|
+
const execution = await waitForJob(this.instance, jobId, executionId, {
|
|
176
|
+
timeout: timeout ? timeout * 1000 : undefined,
|
|
177
|
+
onProgress: (exec, elapsed) => {
|
|
178
|
+
if (!this.jsonEnabled()) {
|
|
179
|
+
const elapsedSec = Math.floor(elapsed / 1000);
|
|
180
|
+
this.log(t('commands.job.run.progress', ' Status: {{status}} ({{elapsed}}s elapsed)', {
|
|
181
|
+
status: exec.execution_status,
|
|
182
|
+
elapsed: elapsedSec.toString(),
|
|
183
|
+
}));
|
|
184
|
+
}
|
|
185
|
+
},
|
|
186
|
+
});
|
|
187
|
+
const durationSec = execution.duration ? (execution.duration / 1000).toFixed(1) : 'N/A';
|
|
188
|
+
this.log(t('commands.job.run.completed', 'Job completed: {{status}} (duration: {{duration}}s)', {
|
|
189
|
+
status: execution.exit_status?.code || execution.execution_status,
|
|
190
|
+
duration: durationSec,
|
|
191
|
+
}));
|
|
192
|
+
// Run afterOperation hooks with success
|
|
193
|
+
await this.runAfterHooks(context, {
|
|
194
|
+
success: true,
|
|
195
|
+
duration: Date.now() - context.startTime,
|
|
196
|
+
data: execution,
|
|
197
|
+
});
|
|
198
|
+
return execution;
|
|
199
|
+
}
|
|
200
|
+
catch (error) {
|
|
201
|
+
return this.handleWaitError(error, showLog, context);
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
//# sourceMappingURL=run.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run.js","sourceRoot":"","sources":["../../../src/commands/job/run.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAC,IAAI,EAAE,KAAK,EAAC,MAAM,aAAa,CAAC;AACxC,OAAO,EAAC,UAAU,EAA2B,MAAM,iCAAiC,CAAC;AACrF,OAAO,EACL,UAAU,EACV,UAAU,EACV,iBAAiB,GAElB,MAAM,6CAA6C,CAAC;AACrD,OAAO,EAAC,CAAC,EAAC,MAAM,qBAAqB,CAAC;AAEtC,MAAM,CAAC,OAAO,OAAO,MAAO,SAAQ,UAAyB;IAC3D,MAAM,CAAC,IAAI,GAAG;QACZ,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC;YACjB,WAAW,EAAE,mBAAmB;YAChC,QAAQ,EAAE,IAAI;SACf,CAAC;KACH,CAAC;IAEF,MAAM,CAAC,WAAW,GAAG,CAAC,CAAC,8BAA8B,EAAE,0CAA0C,CAAC,CAAC;IAEnG,MAAM,CAAC,cAAc,GAAG,IAAI,CAAC;IAE7B,MAAM,CAAC,QAAQ,GAAG;QAChB,mDAAmD;QACnD,0DAA0D;QAC1D,MAAM,CAAC,GAAG,CAAA,sHAAsH;QAChI,wEAAwE;QACxE,MAAM,CAAC,GAAG,CAAA,+HAA+H;KAC1I,CAAC;IAEF,MAAM,CAAC,KAAK,GAAG;QACb,GAAG,UAAU,CAAC,SAAS;QACvB,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC;YAClB,IAAI,EAAE,GAAG;YACT,WAAW,EAAE,0BAA0B;YACvC,OAAO,EAAE,KAAK;SACf,CAAC;QACF,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC;Y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AI,CAAC,GAAG,CACN,CAAC,CAAC,4BAA4B,EAAE,qDAAqD,EAAE;gBACrF,MAAM,EAAE,SAAS,CAAC,WAAW,EAAE,IAAI,IAAI,SAAS,CAAC,gBAAgB;gBACjE,QAAQ,EAAE,WAAW;aACtB,CAAC,CACH,CAAC;YAEF,wCAAwC;YACxC,MAAM,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE;gBAChC,OAAO,EAAE,IAAI;gBACb,QAAQ,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,OAAO,CAAC,SAAS;gBACxC,IAAI,EAAE,SAAS;aAChB,CAAC,CAAC;YAEH,OAAO,SAAS,CAAC;QACnB,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,IAAI,CAAC,eAAe,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;QACvD,CAAC;IACH,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { InstanceCommand } from '@salesforce/b2c-tooling-sdk/cli';
|
|
2
|
+
import { type JobExecutionSearchResult } from '@salesforce/b2c-tooling-sdk/operations/jobs';
|
|
3
|
+
export default class JobSearch extends InstanceCommand<typeof JobSearch> {
|
|
4
|
+
static description: string;
|
|
5
|
+
static enableJsonFlag: boolean;
|
|
6
|
+
static examples: string[];
|
|
7
|
+
static flags: {
|
|
8
|
+
'job-id': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
|
+
status: import("@oclif/core/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
|
+
count: import("@oclif/core/interfaces").OptionFlag<number, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
|
+
start: import("@oclif/core/interfaces").OptionFlag<number, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
|
+
'sort-by': import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
13
|
+
'sort-order': import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
14
|
+
server: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
15
|
+
'webdav-server': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
16
|
+
'code-version': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
17
|
+
username: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
18
|
+
password: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
19
|
+
'client-id': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
20
|
+
'client-secret': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
21
|
+
scope: import("@oclif/core/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
22
|
+
'short-code': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
23
|
+
'auth-methods': import("@oclif/core/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
24
|
+
'account-manager-host': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
25
|
+
'log-level': import("@oclif/core/interfaces").OptionFlag<"trace" | "debug" | "info" | "warn" | "error" | "silent" | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
26
|
+
debug: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
27
|
+
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
28
|
+
lang: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
29
|
+
config: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
30
|
+
instance: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
31
|
+
'working-directory': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
32
|
+
'extra-query': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
33
|
+
'extra-body': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
34
|
+
'extra-headers': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
35
|
+
};
|
|
36
|
+
run(): Promise<JobExecutionSearchResult>;
|
|
37
|
+
}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2025, Salesforce, Inc.
|
|
3
|
+
* SPDX-License-Identifier: Apache-2
|
|
4
|
+
* For full license text, see the license.txt file in the repo root or http://www.apache.org/licenses/LICENSE-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { Flags, ux } from '@oclif/core';
|
|
7
|
+
import { InstanceCommand, createTable } from '@salesforce/b2c-tooling-sdk/cli';
|
|
8
|
+
import { searchJobExecutions, } from '@salesforce/b2c-tooling-sdk/operations/jobs';
|
|
9
|
+
import { t } from '../../i18n/index.js';
|
|
10
|
+
const COLUMNS = {
|
|
11
|
+
id: {
|
|
12
|
+
header: 'Execution ID',
|
|
13
|
+
get: (e) => e.id ?? '-',
|
|
14
|
+
},
|
|
15
|
+
jobId: {
|
|
16
|
+
header: 'Job ID',
|
|
17
|
+
get: (e) => e.job_id ?? '-',
|
|
18
|
+
},
|
|
19
|
+
status: {
|
|
20
|
+
header: 'Status',
|
|
21
|
+
get: (e) => e.exit_status?.code || e.execution_status || '-',
|
|
22
|
+
},
|
|
23
|
+
startTime: {
|
|
24
|
+
header: 'Start Time',
|
|
25
|
+
get: (e) => (e.start_time ? new Date(e.start_time).toISOString().replace('T', ' ').slice(0, 19) : '-'),
|
|
26
|
+
},
|
|
27
|
+
};
|
|
28
|
+
const DEFAULT_COLUMNS = ['id', 'jobId', 'status', 'startTime'];
|
|
29
|
+
export default class JobSearch extends InstanceCommand {
|
|
30
|
+
static description = t('commands.job.search.description', 'Search for job executions on a B2C Commerce instance');
|
|
31
|
+
static enableJsonFlag = true;
|
|
32
|
+
static examples = [
|
|
33
|
+
'<%= config.bin %> <%= command.id %>',
|
|
34
|
+
'<%= config.bin %> <%= command.id %> --job-id my-custom-job',
|
|
35
|
+
'<%= config.bin %> <%= command.id %> --status RUNNING,PENDING',
|
|
36
|
+
'<%= config.bin %> <%= command.id %> --count 50',
|
|
37
|
+
'<%= config.bin %> <%= command.id %> --json',
|
|
38
|
+
];
|
|
39
|
+
static flags = {
|
|
40
|
+
...InstanceCommand.baseFlags,
|
|
41
|
+
'job-id': Flags.string({
|
|
42
|
+
char: 'j',
|
|
43
|
+
description: 'Filter by job ID',
|
|
44
|
+
}),
|
|
45
|
+
status: Flags.string({
|
|
46
|
+
description: 'Filter by status (comma-separated: RUNNING,PENDING,OK,ERROR)',
|
|
47
|
+
multiple: true,
|
|
48
|
+
multipleNonGreedy: true,
|
|
49
|
+
delimiter: ',',
|
|
50
|
+
}),
|
|
51
|
+
count: Flags.integer({
|
|
52
|
+
char: 'n',
|
|
53
|
+
description: 'Maximum number of results',
|
|
54
|
+
default: 25,
|
|
55
|
+
}),
|
|
56
|
+
start: Flags.integer({
|
|
57
|
+
description: 'Starting index for pagination',
|
|
58
|
+
default: 0,
|
|
59
|
+
}),
|
|
60
|
+
'sort-by': Flags.string({
|
|
61
|
+
description: 'Sort by field',
|
|
62
|
+
options: ['start_time', 'end_time', 'job_id', 'status'],
|
|
63
|
+
default: 'start_time',
|
|
64
|
+
}),
|
|
65
|
+
'sort-order': Flags.string({
|
|
66
|
+
description: 'Sort order',
|
|
67
|
+
options: ['asc', 'desc'],
|
|
68
|
+
default: 'desc',
|
|
69
|
+
}),
|
|
70
|
+
};
|
|
71
|
+
async run() {
|
|
72
|
+
this.requireOAuthCredentials();
|
|
73
|
+
const { 'job-id': jobId, status, count, start, 'sort-by': sortBy, 'sort-order': sortOrder } = this.flags;
|
|
74
|
+
this.log(t('commands.job.search.searching', 'Searching job executions on {{hostname}}...', {
|
|
75
|
+
hostname: this.resolvedConfig.values.hostname,
|
|
76
|
+
}));
|
|
77
|
+
const results = await searchJobExecutions(this.instance, {
|
|
78
|
+
jobId,
|
|
79
|
+
status,
|
|
80
|
+
count,
|
|
81
|
+
start,
|
|
82
|
+
sortBy,
|
|
83
|
+
sortOrder: sortOrder,
|
|
84
|
+
});
|
|
85
|
+
// JSON output handled by oclif
|
|
86
|
+
if (this.jsonEnabled()) {
|
|
87
|
+
return results;
|
|
88
|
+
}
|
|
89
|
+
// Human-readable output
|
|
90
|
+
if (results.total === 0) {
|
|
91
|
+
ux.stdout(t('commands.job.search.noResults', 'No job executions found.'));
|
|
92
|
+
return results;
|
|
93
|
+
}
|
|
94
|
+
this.log(t('commands.job.search.found', 'Found {{total}} job execution(s) (showing {{count}})', {
|
|
95
|
+
total: results.total,
|
|
96
|
+
count: results.hits.length,
|
|
97
|
+
}));
|
|
98
|
+
createTable(COLUMNS).render(results.hits, DEFAULT_COLUMNS);
|
|
99
|
+
return results;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
//# sourceMappingURL=search.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search.js","sourceRoot":"","sources":["../../../src/commands/job/search.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAC,KAAK,EAAE,EAAE,EAAC,MAAM,aAAa,CAAC;AACtC,OAAO,EAAC,eAAe,EAAE,WAAW,EAAiB,MAAM,iCAAiC,CAAC;AAC7F,OAAO,EACL,mBAAmB,GAGpB,MAAM,6CAA6C,CAAC;AACrD,OAAO,EAAC,CAAC,EAAC,MAAM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AAI,CAAC,QAAQ,EAAE;YACvD,KAAK;YACL,MAAM;YACN,KAAK;YACL,KAAK;YACL,MAAM;YACN,SAAS,EAAE,SAA2B;SACvC,CAAC,CAAC;QAEH,+BAA+B;QAC/B,IAAI,IAAI,CAAC,WAAW,EAAE,EAAE,CAAC;YACvB,OAAO,OAAO,CAAC;QACjB,CAAC;QAED,wBAAwB;QACxB,IAAI,OAAO,CAAC,KAAK,KAAK,CAAC,EAAE,CAAC;YACxB,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,+BAA+B,EAAE,0BAA0B,CAAC,CAAC,CAAC;YAC1E,OAAO,OAAO,CAAC;QACjB,CAAC;QAED,IAAI,CAAC,GAAG,CACN,CAAC,CAAC,2BAA2B,EAAE,sDAAsD,EAAE;YACrF,KAAK,EAAE,OAAO,CAAC,KAAK;YACpB,KAAK,EAAE,OAAO,CAAC,IAAI,CAAC,MAAM;SAC3B,CAAC,CACH,CAAC;QAEF,WAAW,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,eAAe,CAAC,CAAC;QAE3D,OAAO,OAAO,CAAC;IACjB,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { JobCommand } from '@salesforce/b2c-tooling-sdk/cli';
|
|
2
|
+
import { type JobExecution } from '@salesforce/b2c-tooling-sdk/operations/jobs';
|
|
3
|
+
export default class JobWait extends JobCommand<typeof JobWait> {
|
|
4
|
+
static args: {
|
|
5
|
+
jobId: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
|
|
6
|
+
executionId: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
|
|
7
|
+
};
|
|
8
|
+
static description: string;
|
|
9
|
+
static enableJsonFlag: boolean;
|
|
10
|
+
static examples: string[];
|
|
11
|
+
static flags: {
|
|
12
|
+
timeout: import("@oclif/core/interfaces").OptionFlag<number | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
13
|
+
'poll-interval': import("@oclif/core/interfaces").OptionFlag<number, import("@oclif/core/interfaces").CustomOptions>;
|
|
14
|
+
'show-log': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
15
|
+
server: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
16
|
+
'webdav-server': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
17
|
+
'code-version': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
18
|
+
username: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
19
|
+
password: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
20
|
+
'client-id': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
21
|
+
'client-secret': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
22
|
+
scope: import("@oclif/core/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
23
|
+
'short-code': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
24
|
+
'auth-methods': import("@oclif/core/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
25
|
+
'account-manager-host': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
26
|
+
'log-level': import("@oclif/core/interfaces").OptionFlag<"trace" | "debug" | "info" | "warn" | "error" | "silent" | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
27
|
+
debug: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
28
|
+
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
29
|
+
lang: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
30
|
+
config: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
31
|
+
instance: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
32
|
+
'working-directory': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
33
|
+
'extra-query': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
34
|
+
'extra-body': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
35
|
+
'extra-headers': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
36
|
+
};
|
|
37
|
+
run(): Promise<JobExecution>;
|
|
38
|
+
}
|