@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,31 @@
|
|
|
1
|
+
import { OdsCommand } from '@salesforce/b2c-tooling-sdk/cli';
|
|
2
|
+
import type { OdsComponents } from '@salesforce/b2c-tooling-sdk';
|
|
3
|
+
type SandboxModel = OdsComponents['schemas']['SandboxModel'];
|
|
4
|
+
/**
|
|
5
|
+
* Response type for the list command.
|
|
6
|
+
*/
|
|
7
|
+
interface OdsListResponse {
|
|
8
|
+
count: number;
|
|
9
|
+
data: SandboxModel[];
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Command to list all on-demand sandboxes.
|
|
13
|
+
*/
|
|
14
|
+
export default class OdsList extends OdsCommand<typeof OdsList> {
|
|
15
|
+
static description: string;
|
|
16
|
+
static enableJsonFlag: boolean;
|
|
17
|
+
static examples: string[];
|
|
18
|
+
static flags: {
|
|
19
|
+
realm: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
20
|
+
'filter-params': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
21
|
+
'show-deleted': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
22
|
+
columns: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
23
|
+
extended: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
24
|
+
};
|
|
25
|
+
run(): Promise<OdsListResponse>;
|
|
26
|
+
/**
|
|
27
|
+
* Determines which columns to display based on flags.
|
|
28
|
+
*/
|
|
29
|
+
private getSelectedColumns;
|
|
30
|
+
}
|
|
31
|
+
export {};
|
|
@@ -0,0 +1,166 @@
|
|
|
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 } from '@oclif/core';
|
|
7
|
+
import { OdsCommand, TableRenderer } from '@salesforce/b2c-tooling-sdk/cli';
|
|
8
|
+
import { t } from '../../i18n/index.js';
|
|
9
|
+
const COLUMNS = {
|
|
10
|
+
realm: {
|
|
11
|
+
header: 'Realm',
|
|
12
|
+
get: (s) => s.realm || '-',
|
|
13
|
+
},
|
|
14
|
+
instance: {
|
|
15
|
+
header: 'Num',
|
|
16
|
+
get: (s) => s.instance || '-',
|
|
17
|
+
},
|
|
18
|
+
state: {
|
|
19
|
+
header: 'State',
|
|
20
|
+
get: (s) => s.state || '-',
|
|
21
|
+
},
|
|
22
|
+
profile: {
|
|
23
|
+
header: 'Profile',
|
|
24
|
+
get: (s) => s.resourceProfile || '-',
|
|
25
|
+
},
|
|
26
|
+
created: {
|
|
27
|
+
header: 'Created',
|
|
28
|
+
get: (s) => (s.createdAt ? new Date(s.createdAt).toISOString().slice(0, 10) : '-'),
|
|
29
|
+
},
|
|
30
|
+
eol: {
|
|
31
|
+
header: 'EOL',
|
|
32
|
+
get: (s) => (s.eol ? new Date(s.eol).toISOString().slice(0, 10) : '-'),
|
|
33
|
+
},
|
|
34
|
+
id: {
|
|
35
|
+
header: 'ID',
|
|
36
|
+
get: (s) => s.id || '-',
|
|
37
|
+
},
|
|
38
|
+
hostname: {
|
|
39
|
+
header: 'Hostname',
|
|
40
|
+
get: (s) => s.hostName || '-',
|
|
41
|
+
extended: true,
|
|
42
|
+
},
|
|
43
|
+
createdBy: {
|
|
44
|
+
header: 'Created By',
|
|
45
|
+
get: (s) => s.createdBy || '-',
|
|
46
|
+
extended: true,
|
|
47
|
+
},
|
|
48
|
+
autoScheduled: {
|
|
49
|
+
header: 'Auto',
|
|
50
|
+
get: (s) => (s.autoScheduled ? 'Yes' : 'No'),
|
|
51
|
+
extended: true,
|
|
52
|
+
},
|
|
53
|
+
};
|
|
54
|
+
/** Default columns shown without --extended */
|
|
55
|
+
const DEFAULT_COLUMNS = ['realm', 'instance', 'state', 'profile', 'created', 'eol', 'id'];
|
|
56
|
+
const tableRenderer = new TableRenderer(COLUMNS);
|
|
57
|
+
/**
|
|
58
|
+
* Command to list all on-demand sandboxes.
|
|
59
|
+
*/
|
|
60
|
+
export default class OdsList extends OdsCommand {
|
|
61
|
+
static description = t('commands.ods.list.description', 'List all on-demand sandboxes');
|
|
62
|
+
static enableJsonFlag = true;
|
|
63
|
+
static examples = [
|
|
64
|
+
'<%= config.bin %> <%= command.id %>',
|
|
65
|
+
'<%= config.bin %> <%= command.id %> --realm abcd',
|
|
66
|
+
'<%= config.bin %> <%= command.id %> --filter-params "realm=abcd&state=started"',
|
|
67
|
+
'<%= config.bin %> <%= command.id %> --show-deleted',
|
|
68
|
+
'<%= config.bin %> <%= command.id %> --extended',
|
|
69
|
+
'<%= config.bin %> <%= command.id %> --columns realm,instance,state,hostname',
|
|
70
|
+
'<%= config.bin %> <%= command.id %> --json',
|
|
71
|
+
];
|
|
72
|
+
static flags = {
|
|
73
|
+
realm: Flags.string({
|
|
74
|
+
char: 'r',
|
|
75
|
+
description: 'Filter by realm ID (four-letter ID)',
|
|
76
|
+
}),
|
|
77
|
+
'filter-params': Flags.string({
|
|
78
|
+
description: 'Raw filter parameters (e.g., "realm=abcd&state=started&resourceProfile=medium")',
|
|
79
|
+
}),
|
|
80
|
+
'show-deleted': Flags.boolean({
|
|
81
|
+
description: 'Include deleted sandboxes in the list',
|
|
82
|
+
default: false,
|
|
83
|
+
}),
|
|
84
|
+
columns: Flags.string({
|
|
85
|
+
char: 'c',
|
|
86
|
+
description: `Columns to display (comma-separated). Available: ${Object.keys(COLUMNS).join(', ')}`,
|
|
87
|
+
}),
|
|
88
|
+
extended: Flags.boolean({
|
|
89
|
+
char: 'x',
|
|
90
|
+
description: 'Show all columns including extended fields',
|
|
91
|
+
default: false,
|
|
92
|
+
}),
|
|
93
|
+
};
|
|
94
|
+
async run() {
|
|
95
|
+
const host = this.odsHost;
|
|
96
|
+
const includeDeleted = this.flags['show-deleted'];
|
|
97
|
+
const realm = this.flags.realm;
|
|
98
|
+
const rawFilterParams = this.flags['filter-params'];
|
|
99
|
+
// Build filter params string
|
|
100
|
+
let filterParams;
|
|
101
|
+
if (realm || rawFilterParams) {
|
|
102
|
+
const parts = [];
|
|
103
|
+
if (realm) {
|
|
104
|
+
parts.push(`realm=${realm}`);
|
|
105
|
+
}
|
|
106
|
+
if (rawFilterParams) {
|
|
107
|
+
parts.push(rawFilterParams);
|
|
108
|
+
}
|
|
109
|
+
filterParams = parts.join('&');
|
|
110
|
+
}
|
|
111
|
+
this.log(t('commands.ods.list.fetching', 'Fetching sandboxes from {{host}}...', { host }));
|
|
112
|
+
const result = await this.odsClient.GET('/sandboxes', {
|
|
113
|
+
params: {
|
|
114
|
+
query: {
|
|
115
|
+
include_deleted: includeDeleted,
|
|
116
|
+
filter_params: filterParams,
|
|
117
|
+
},
|
|
118
|
+
},
|
|
119
|
+
});
|
|
120
|
+
if (result.error) {
|
|
121
|
+
const errorResponse = result.error;
|
|
122
|
+
const errorMessage = errorResponse?.error?.message || result.response?.statusText || 'Unknown error';
|
|
123
|
+
this.error(t('commands.ods.list.error', 'Failed to fetch sandboxes: {{message}}', {
|
|
124
|
+
message: errorMessage,
|
|
125
|
+
}));
|
|
126
|
+
}
|
|
127
|
+
const sandboxes = result.data?.data ?? [];
|
|
128
|
+
const response = {
|
|
129
|
+
count: sandboxes.length,
|
|
130
|
+
data: sandboxes,
|
|
131
|
+
};
|
|
132
|
+
if (this.jsonEnabled()) {
|
|
133
|
+
return response;
|
|
134
|
+
}
|
|
135
|
+
if (sandboxes.length === 0) {
|
|
136
|
+
this.log(t('commands.ods.list.noSandboxes', 'No sandboxes found.'));
|
|
137
|
+
return response;
|
|
138
|
+
}
|
|
139
|
+
tableRenderer.render(sandboxes, this.getSelectedColumns());
|
|
140
|
+
return response;
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Determines which columns to display based on flags.
|
|
144
|
+
*/
|
|
145
|
+
getSelectedColumns() {
|
|
146
|
+
const columnsFlag = this.flags.columns;
|
|
147
|
+
const extended = this.flags.extended;
|
|
148
|
+
if (columnsFlag) {
|
|
149
|
+
// User specified explicit columns
|
|
150
|
+
const requested = columnsFlag.split(',').map((c) => c.trim());
|
|
151
|
+
const valid = tableRenderer.validateColumnKeys(requested);
|
|
152
|
+
if (valid.length === 0) {
|
|
153
|
+
this.warn(`No valid columns specified. Available: ${tableRenderer.getColumnKeys().join(', ')}`);
|
|
154
|
+
return DEFAULT_COLUMNS;
|
|
155
|
+
}
|
|
156
|
+
return valid;
|
|
157
|
+
}
|
|
158
|
+
if (extended) {
|
|
159
|
+
// Show all columns
|
|
160
|
+
return tableRenderer.getColumnKeys();
|
|
161
|
+
}
|
|
162
|
+
// Default columns (non-extended)
|
|
163
|
+
return DEFAULT_COLUMNS;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
//# sourceMappingURL=list.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list.js","sourceRoot":"","sources":["../../../src/commands/ods/list.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAC,KAAK,EAAC,MAAM,aAAa,CAAC;AAClC,OAAO,EAAC,UAAU,EAAE,aAAa,EAAiB,MAAM,iCAAiC,CAAC;AAE1F,OAAO,EAAC,CAAC,EAAC,MAAM,qBAAqB,CAAC;AAYtC,MAAM,OAAO,GAA4C;IACvD,KAAK,EAAE;QACL,MAAM,EAAE,OAAO;QACf,GAAG,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,IAAI,GAAG;KAC3B;IACD,QAAQ,EAAE;QACR,MAAM,EAAE,KAAK;QACb,GAAG,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,IAAI,GAAG;KAC9B;IACD,KAAK,EAAE;QACL,MAAM,EAAE,OAAO;QACf,GAAG,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,IAAI,GAAG;KAC3B;IACD,OAAO,EAAE;QACP,M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EAAE,CAAC;YACb,mBAAmB;YACnB,OAAO,aAAa,CAAC,aAAa,EAAE,CAAC;QACvC,CAAC;QAED,iCAAiC;QACjC,OAAO,eAAe,CAAC;IACzB,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { OdsCommand } from '@salesforce/b2c-tooling-sdk/cli';
|
|
2
|
+
import type { OdsComponents } from '@salesforce/b2c-tooling-sdk';
|
|
3
|
+
type SandboxOperationModel = OdsComponents['schemas']['SandboxOperationModel'];
|
|
4
|
+
/**
|
|
5
|
+
* Command to restart an on-demand sandbox.
|
|
6
|
+
*/
|
|
7
|
+
export default class OdsRestart extends OdsCommand<typeof OdsRestart> {
|
|
8
|
+
static args: {
|
|
9
|
+
sandboxId: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
|
|
10
|
+
};
|
|
11
|
+
static description: string;
|
|
12
|
+
static enableJsonFlag: boolean;
|
|
13
|
+
static examples: string[];
|
|
14
|
+
run(): Promise<SandboxOperationModel>;
|
|
15
|
+
}
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,51 @@
|
|
|
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 } from '@oclif/core';
|
|
7
|
+
import { OdsCommand } from '@salesforce/b2c-tooling-sdk/cli';
|
|
8
|
+
import { t } from '../../i18n/index.js';
|
|
9
|
+
/**
|
|
10
|
+
* Command to restart an on-demand sandbox.
|
|
11
|
+
*/
|
|
12
|
+
export default class OdsRestart extends OdsCommand {
|
|
13
|
+
static args = {
|
|
14
|
+
sandboxId: Args.string({
|
|
15
|
+
description: 'Sandbox ID (UUID)',
|
|
16
|
+
required: true,
|
|
17
|
+
}),
|
|
18
|
+
};
|
|
19
|
+
static description = t('commands.ods.restart.description', 'Restart an on-demand sandbox');
|
|
20
|
+
static enableJsonFlag = true;
|
|
21
|
+
static examples = [
|
|
22
|
+
'<%= config.bin %> <%= command.id %> abc12345-1234-1234-1234-abc123456789',
|
|
23
|
+
'<%= config.bin %> <%= command.id %> abc12345-1234-1234-1234-abc123456789 --json',
|
|
24
|
+
];
|
|
25
|
+
async run() {
|
|
26
|
+
const sandboxId = this.args.sandboxId;
|
|
27
|
+
this.log(t('commands.ods.restart.restarting', 'Restarting sandbox {{sandboxId}}...', { sandboxId }));
|
|
28
|
+
const result = await this.odsClient.POST('/sandboxes/{sandboxId}/operations', {
|
|
29
|
+
params: {
|
|
30
|
+
path: { sandboxId },
|
|
31
|
+
},
|
|
32
|
+
body: {
|
|
33
|
+
operation: 'restart',
|
|
34
|
+
},
|
|
35
|
+
});
|
|
36
|
+
if (!result.data?.data) {
|
|
37
|
+
const errorResponse = result.error;
|
|
38
|
+
const errorMessage = errorResponse?.error?.message || result.response?.statusText || 'Unknown error';
|
|
39
|
+
this.error(t('commands.ods.restart.error', 'Failed to restart sandbox: {{message}}', {
|
|
40
|
+
message: errorMessage,
|
|
41
|
+
}));
|
|
42
|
+
}
|
|
43
|
+
const operation = result.data.data;
|
|
44
|
+
this.log(t('commands.ods.restart.success', 'Restart operation {{operationState}}. Sandbox state: {{sandboxState}}', {
|
|
45
|
+
operationState: operation.operationState,
|
|
46
|
+
sandboxState: operation.sandboxState || 'unknown',
|
|
47
|
+
}));
|
|
48
|
+
return operation;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=restart.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"restart.js","sourceRoot":"","sources":["../../../src/commands/ods/restart.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAC,IAAI,EAAC,MAAM,aAAa,CAAC;AACjC,OAAO,EAAC,UAAU,EAAC,MAAM,iCAAiC,CAAC;AAE3D,OAAO,EAAC,CAAC,EAAC,MAAM,qBAAqB,C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AC,GAAG,CACN,CAAC,CAAC,8BAA8B,EAAE,uEAAuE,EAAE;YACzG,cAAc,EAAE,SAAS,CAAC,cAAc;YACxC,YAAY,EAAE,SAAS,CAAC,YAAY,IAAI,SAAS;SAClD,CAAC,CACH,CAAC;QAEF,OAAO,SAAS,CAAC;IACnB,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { OdsCommand } from '@salesforce/b2c-tooling-sdk/cli';
|
|
2
|
+
import type { OdsComponents } from '@salesforce/b2c-tooling-sdk';
|
|
3
|
+
type SandboxOperationModel = OdsComponents['schemas']['SandboxOperationModel'];
|
|
4
|
+
/**
|
|
5
|
+
* Command to start an on-demand sandbox.
|
|
6
|
+
*/
|
|
7
|
+
export default class OdsStart extends OdsCommand<typeof OdsStart> {
|
|
8
|
+
static args: {
|
|
9
|
+
sandboxId: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
|
|
10
|
+
};
|
|
11
|
+
static description: string;
|
|
12
|
+
static enableJsonFlag: boolean;
|
|
13
|
+
static examples: string[];
|
|
14
|
+
run(): Promise<SandboxOperationModel>;
|
|
15
|
+
}
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,51 @@
|
|
|
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 } from '@oclif/core';
|
|
7
|
+
import { OdsCommand } from '@salesforce/b2c-tooling-sdk/cli';
|
|
8
|
+
import { t } from '../../i18n/index.js';
|
|
9
|
+
/**
|
|
10
|
+
* Command to start an on-demand sandbox.
|
|
11
|
+
*/
|
|
12
|
+
export default class OdsStart extends OdsCommand {
|
|
13
|
+
static args = {
|
|
14
|
+
sandboxId: Args.string({
|
|
15
|
+
description: 'Sandbox ID (UUID)',
|
|
16
|
+
required: true,
|
|
17
|
+
}),
|
|
18
|
+
};
|
|
19
|
+
static description = t('commands.ods.start.description', 'Start an on-demand sandbox');
|
|
20
|
+
static enableJsonFlag = true;
|
|
21
|
+
static examples = [
|
|
22
|
+
'<%= config.bin %> <%= command.id %> abc12345-1234-1234-1234-abc123456789',
|
|
23
|
+
'<%= config.bin %> <%= command.id %> abc12345-1234-1234-1234-abc123456789 --json',
|
|
24
|
+
];
|
|
25
|
+
async run() {
|
|
26
|
+
const sandboxId = this.args.sandboxId;
|
|
27
|
+
this.log(t('commands.ods.start.starting', 'Starting sandbox {{sandboxId}}...', { sandboxId }));
|
|
28
|
+
const result = await this.odsClient.POST('/sandboxes/{sandboxId}/operations', {
|
|
29
|
+
params: {
|
|
30
|
+
path: { sandboxId },
|
|
31
|
+
},
|
|
32
|
+
body: {
|
|
33
|
+
operation: 'start',
|
|
34
|
+
},
|
|
35
|
+
});
|
|
36
|
+
if (!result.data?.data) {
|
|
37
|
+
const errorResponse = result.error;
|
|
38
|
+
const errorMessage = errorResponse?.error?.message || result.response?.statusText || 'Unknown error';
|
|
39
|
+
this.error(t('commands.ods.start.error', 'Failed to start sandbox: {{message}}', {
|
|
40
|
+
message: errorMessage,
|
|
41
|
+
}));
|
|
42
|
+
}
|
|
43
|
+
const operation = result.data.data;
|
|
44
|
+
this.log(t('commands.ods.start.success', 'Start operation {{operationState}}. Sandbox state: {{sandboxState}}', {
|
|
45
|
+
operationState: operation.operationState,
|
|
46
|
+
sandboxState: operation.sandboxState || 'unknown',
|
|
47
|
+
}));
|
|
48
|
+
return operation;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=start.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"start.js","sourceRoot":"","sources":["../../../src/commands/ods/start.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAC,IAAI,EAAC,MAAM,aAAa,CAAC;AACjC,OAAO,EAAC,UAAU,EAAC,MAAM,iCAAiC,CAAC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AM,CAAC,IAAI,CAAC,IAAI,CAAC;QAEnC,IAAI,CAAC,GAAG,CACN,CAAC,CAAC,4BAA4B,EAAE,qEAAqE,EAAE;YACrG,cAAc,EAAE,SAAS,CAAC,cAAc;YACxC,YAAY,EAAE,SAAS,CAAC,YAAY,IAAI,SAAS;SAClD,CAAC,CACH,CAAC;QAEF,OAAO,SAAS,CAAC;IACnB,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { OdsCommand } from '@salesforce/b2c-tooling-sdk/cli';
|
|
2
|
+
import type { OdsComponents } from '@salesforce/b2c-tooling-sdk';
|
|
3
|
+
type SandboxOperationModel = OdsComponents['schemas']['SandboxOperationModel'];
|
|
4
|
+
/**
|
|
5
|
+
* Command to stop an on-demand sandbox.
|
|
6
|
+
*/
|
|
7
|
+
export default class OdsStop extends OdsCommand<typeof OdsStop> {
|
|
8
|
+
static args: {
|
|
9
|
+
sandboxId: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
|
|
10
|
+
};
|
|
11
|
+
static description: string;
|
|
12
|
+
static enableJsonFlag: boolean;
|
|
13
|
+
static examples: string[];
|
|
14
|
+
run(): Promise<SandboxOperationModel>;
|
|
15
|
+
}
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,51 @@
|
|
|
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 } from '@oclif/core';
|
|
7
|
+
import { OdsCommand } from '@salesforce/b2c-tooling-sdk/cli';
|
|
8
|
+
import { t } from '../../i18n/index.js';
|
|
9
|
+
/**
|
|
10
|
+
* Command to stop an on-demand sandbox.
|
|
11
|
+
*/
|
|
12
|
+
export default class OdsStop extends OdsCommand {
|
|
13
|
+
static args = {
|
|
14
|
+
sandboxId: Args.string({
|
|
15
|
+
description: 'Sandbox ID (UUID)',
|
|
16
|
+
required: true,
|
|
17
|
+
}),
|
|
18
|
+
};
|
|
19
|
+
static description = t('commands.ods.stop.description', 'Stop an on-demand sandbox');
|
|
20
|
+
static enableJsonFlag = true;
|
|
21
|
+
static examples = [
|
|
22
|
+
'<%= config.bin %> <%= command.id %> abc12345-1234-1234-1234-abc123456789',
|
|
23
|
+
'<%= config.bin %> <%= command.id %> abc12345-1234-1234-1234-abc123456789 --json',
|
|
24
|
+
];
|
|
25
|
+
async run() {
|
|
26
|
+
const sandboxId = this.args.sandboxId;
|
|
27
|
+
this.log(t('commands.ods.stop.stopping', 'Stopping sandbox {{sandboxId}}...', { sandboxId }));
|
|
28
|
+
const result = await this.odsClient.POST('/sandboxes/{sandboxId}/operations', {
|
|
29
|
+
params: {
|
|
30
|
+
path: { sandboxId },
|
|
31
|
+
},
|
|
32
|
+
body: {
|
|
33
|
+
operation: 'stop',
|
|
34
|
+
},
|
|
35
|
+
});
|
|
36
|
+
if (!result.data?.data) {
|
|
37
|
+
const errorResponse = result.error;
|
|
38
|
+
const errorMessage = errorResponse?.error?.message || result.response?.statusText || 'Unknown error';
|
|
39
|
+
this.error(t('commands.ods.stop.error', 'Failed to stop sandbox: {{message}}', {
|
|
40
|
+
message: errorMessage,
|
|
41
|
+
}));
|
|
42
|
+
}
|
|
43
|
+
const operation = result.data.data;
|
|
44
|
+
this.log(t('commands.ods.stop.success', 'Stop operation {{operationState}}. Sandbox state: {{sandboxState}}', {
|
|
45
|
+
operationState: operation.operationState,
|
|
46
|
+
sandboxState: operation.sandboxState || 'unknown',
|
|
47
|
+
}));
|
|
48
|
+
return operation;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=stop.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stop.js","sourceRoot":"","sources":["../../../src/commands/ods/stop.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAC,IAAI,EAAC,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,YAAY;aACtB,CAAC,CACH,CAAC;QACJ,CAAC;QAED,MAAM,SAAS,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC;QAEnC,IAAI,CAAC,GAAG,CACN,CAAC,CAAC,2BAA2B,EAAE,oEAAoE,EAAE;YACnG,cAAc,EAAE,SAAS,CAAC,cAAc;YACxC,YAAY,EAAE,SAAS,CAAC,YAAY,IAAI,SAAS;SAClD,CAAC,CACH,CAAC;QAEF,OAAO,SAAS,CAAC;IACnB,CAAC"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { Command } from '@oclif/core';
|
|
2
|
+
import { OAuthCommand } from '@salesforce/b2c-tooling-sdk/cli';
|
|
3
|
+
import { type CustomApisComponents } from '@salesforce/b2c-tooling-sdk';
|
|
4
|
+
type CustomApiEndpoint = CustomApisComponents['schemas']['CustomApiEndpoint'];
|
|
5
|
+
/**
|
|
6
|
+
* Response type for the status command.
|
|
7
|
+
*/
|
|
8
|
+
interface CustomApiStatusResponse {
|
|
9
|
+
total: number;
|
|
10
|
+
activeCodeVersion?: string;
|
|
11
|
+
data: CustomApiEndpoint[];
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Base command for SCAPI Custom API operations.
|
|
15
|
+
*/
|
|
16
|
+
declare abstract class ScapiCustomCommand<T extends typeof Command> extends OAuthCommand<T> {
|
|
17
|
+
static baseFlags: {
|
|
18
|
+
'tenant-id': import("@oclif/core/interfaces").OptionFlag<string, 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
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Command to get the status of Custom API endpoints.
|
|
39
|
+
*/
|
|
40
|
+
export default class ScapiCustomStatus extends ScapiCustomCommand<typeof ScapiCustomStatus> {
|
|
41
|
+
static description: string;
|
|
42
|
+
static enableJsonFlag: boolean;
|
|
43
|
+
static examples: string[];
|
|
44
|
+
static flags: {
|
|
45
|
+
status: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
46
|
+
'group-by': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
47
|
+
columns: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
48
|
+
extended: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
49
|
+
'tenant-id': import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
50
|
+
'client-id': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
51
|
+
'client-secret': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
52
|
+
scope: import("@oclif/core/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
53
|
+
'short-code': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
54
|
+
'auth-methods': import("@oclif/core/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
55
|
+
'account-manager-host': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
56
|
+
'log-level': import("@oclif/core/interfaces").OptionFlag<"trace" | "debug" | "info" | "warn" | "error" | "silent" | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
57
|
+
debug: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
58
|
+
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
59
|
+
lang: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
60
|
+
config: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
61
|
+
instance: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
62
|
+
'working-directory': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
63
|
+
'extra-query': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
64
|
+
'extra-body': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
65
|
+
'extra-headers': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
66
|
+
};
|
|
67
|
+
run(): Promise<CustomApiStatusResponse>;
|
|
68
|
+
/**
|
|
69
|
+
* Determines which columns to display based on flags.
|
|
70
|
+
*/
|
|
71
|
+
private getSelectedColumns;
|
|
72
|
+
/**
|
|
73
|
+
* Groups endpoints by a key function.
|
|
74
|
+
*/
|
|
75
|
+
private groupEndpointsBy;
|
|
76
|
+
/**
|
|
77
|
+
* Renders endpoints, optionally grouped by type or site.
|
|
78
|
+
*/
|
|
79
|
+
private renderEndpoints;
|
|
80
|
+
}
|
|
81
|
+
export {};
|