@salesforce/b2c-cli 1.21.4 → 1.22.1
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/dist/commands/auth/client/index.d.ts +3 -4
- package/dist/commands/auth/client/index.js +12 -17
- package/dist/commands/auth/client/index.js.map +1 -1
- package/dist/commands/auth/client/token.d.ts +6 -3
- package/dist/commands/auth/client/token.js +39 -25
- package/dist/commands/auth/client/token.js.map +1 -1
- package/dist/commands/auth/login.d.ts +5 -3
- package/dist/commands/auth/login.js +41 -26
- package/dist/commands/auth/login.js.map +1 -1
- package/dist/commands/auth/logout.d.ts +3 -3
- package/dist/commands/auth/logout.js +5 -5
- package/dist/commands/auth/logout.js.map +1 -1
- package/dist/commands/cap/install.d.ts +5 -1
- package/dist/commands/cap/install.js +31 -7
- package/dist/commands/cap/install.js.map +1 -1
- package/dist/commands/content/export.js +14 -6
- package/dist/commands/content/export.js.map +1 -1
- package/dist/commands/content/list.js +42 -26
- package/dist/commands/content/list.js.map +1 -1
- package/dist/commands/job/import-set.d.ts +66 -0
- package/dist/commands/job/import-set.js +276 -0
- package/dist/commands/job/import-set.js.map +1 -0
- package/dist/commands/mrt/bundle/deploy.js +28 -3
- package/dist/commands/mrt/bundle/deploy.js.map +1 -1
- package/dist/commands/mrt/project/get.js +1 -1
- package/dist/commands/mrt/project/get.js.map +1 -1
- package/dist/commands/mrt/project/list.js +1 -1
- package/dist/commands/mrt/project/list.js.map +1 -1
- package/dist/commands/sandbox/clone/create.d.ts +9 -0
- package/dist/commands/sandbox/clone/create.js +130 -52
- package/dist/commands/sandbox/clone/create.js.map +1 -1
- package/dist/commands/sandbox/clone/get.js +2 -0
- package/dist/commands/sandbox/clone/get.js.map +1 -1
- package/dist/commands/sandbox/clone/list.d.ts +1 -0
- package/dist/commands/sandbox/clone/list.js +20 -2
- package/dist/commands/sandbox/clone/list.js.map +1 -1
- package/dist/commands/sandbox/create.js +10 -39
- package/dist/commands/sandbox/create.js.map +1 -1
- package/dist/commands/setup/inspect.d.ts +4 -0
- package/dist/commands/setup/inspect.js +51 -41
- package/dist/commands/setup/inspect.js.map +1 -1
- package/dist/script-types/node_modules/@salesforce/b2c-script-types/package.json +1 -1
- package/dist/script-types/node_modules/@salesforce/b2c-script-types/types/dw/catalog/CatalogMgr.d.ts +6 -2
- package/dist/script-types/node_modules/@salesforce/b2c-script-types/types/dw/catalog/ProductSearchModel.d.ts +35 -0
- package/dist/script-types/node_modules/@salesforce/b2c-script-types/types/dw/commerceapps/ConnectionHealthStatusCodes.d.ts +27 -0
- package/dist/script-types/node_modules/@salesforce/b2c-script-types/types/dw/commerceapps/hooks/ConnectionHealthCheckHooks.d.ts +80 -0
- package/dist/script-types/node_modules/@salesforce/b2c-script-types/types/dw/commerceapps/hooks/index.d.ts +5 -0
- package/dist/script-types/node_modules/@salesforce/b2c-script-types/types/dw/commerceapps/index.d.ts +5 -0
- package/dist/script-types/node_modules/@salesforce/b2c-script-types/types/dw/customer/ProductListMgr.d.ts +3 -0
- package/dist/script-types/node_modules/@salesforce/b2c-script-types/types/dw/customer/consent/ShopperConsentErrorCodes.d.ts +20 -0
- package/dist/script-types/node_modules/@salesforce/b2c-script-types/types/dw/customer/consent/ShopperConsentException.d.ts +18 -10
- package/dist/script-types/node_modules/@salesforce/b2c-script-types/types/dw/customer/consent/ShopperConsentMgr.d.ts +1 -1
- package/dist/script-types/node_modules/@salesforce/b2c-script-types/types/dw/order/LineItemTax.d.ts +2 -1
- package/dist/script-types/node_modules/@salesforce/b2c-script-types/types/dw/order/ShippingMgr.d.ts +33 -0
- package/dist/script-types/node_modules/@salesforce/b2c-script-types/types/dw/order/hooks/ShippingHooks.d.ts +159 -0
- package/dist/script-types/node_modules/@salesforce/b2c-script-types/types/dw/order/hooks/index.d.ts +2 -0
- package/dist/script-types/node_modules/@salesforce/b2c-script-types/types/dw/sitemap/SitemapMgr.d.ts +9 -0
- package/dist/script-types/node_modules/@salesforce/b2c-script-types/types/dw/suggest/SuggestModel.d.ts +35 -0
- package/dist/script-types/node_modules/@salesforce/b2c-script-types/types/global.d.ts +16 -1
- package/dist/script-types/node_modules/@salesforce/b2c-script-types/types/upstream-package.json +1 -1
- package/dist/script-types/node_modules/@salesforce/b2c-script-types/types/upstream-tsconfig.json +5 -3
- package/dist/utils/bm/user-auth-command.d.ts +5 -4
- package/dist/utils/bm/user-auth-command.js +6 -5
- package/dist/utils/bm/user-auth-command.js.map +1 -1
- package/dist/utils/slas/client.d.ts +1 -1
- package/dist/utils/slas/client.js +5 -3
- package/dist/utils/slas/client.js.map +1 -1
- package/oclif.manifest.json +9999 -9448
- package/package.json +2 -2
- package/dist/commands/auth/client/renew.d.ts +0 -20
- package/dist/commands/auth/client/renew.js +0 -88
- package/dist/commands/auth/client/renew.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforce/b2c-cli",
|
|
3
3
|
"description": "A Salesforce B2C Commerce CLI",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.22.1",
|
|
5
5
|
"author": "Charles Lavery",
|
|
6
6
|
"bin": {
|
|
7
7
|
"b2c": "./bin/run.js"
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"marked": "15.0.12",
|
|
26
26
|
"marked-terminal": "7.3.0",
|
|
27
27
|
"open": "11.0.0",
|
|
28
|
-
"@salesforce/b2c-tooling-sdk": "1.
|
|
28
|
+
"@salesforce/b2c-tooling-sdk": "1.23.0"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@eslint/compat": "^1",
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { BaseCommand } from '@salesforce/b2c-tooling-sdk/cli';
|
|
2
|
-
/**
|
|
3
|
-
* Renew the client authentication token using stored credentials.
|
|
4
|
-
* Mirrors sfcc-ci `client:auth:renew` command behavior. Requires that the initial
|
|
5
|
-
* authentication was done with the --renew flag (which stores the credentials needed
|
|
6
|
-
* for renewal).
|
|
7
|
-
*
|
|
8
|
-
* Uses refresh_token grant when a refresh token is stored, otherwise falls back
|
|
9
|
-
* to client_credentials grant using the stored base64-encoded client:secret.
|
|
10
|
-
*/
|
|
11
|
-
export default class AuthClientRenew extends BaseCommand<typeof AuthClientRenew> {
|
|
12
|
-
static description: string;
|
|
13
|
-
static examples: string[];
|
|
14
|
-
static flags: {
|
|
15
|
-
'account-manager-host': import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
16
|
-
};
|
|
17
|
-
static hiddenAliases: string[];
|
|
18
|
-
protected loadConfiguration(): Promise<import("@salesforce/b2c-tooling-sdk").ResolvedB2CConfig>;
|
|
19
|
-
run(): Promise<void>;
|
|
20
|
-
}
|
|
@@ -1,88 +0,0 @@
|
|
|
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 { BaseCommand, loadConfig } from '@salesforce/b2c-tooling-sdk/cli';
|
|
8
|
-
import { getStoredSession, setStoredSession } from '@salesforce/b2c-tooling-sdk/auth';
|
|
9
|
-
import { DEFAULT_ACCOUNT_MANAGER_HOST } from '@salesforce/b2c-tooling-sdk';
|
|
10
|
-
import { t } from '../../../i18n/index.js';
|
|
11
|
-
/**
|
|
12
|
-
* Renew the client authentication token using stored credentials.
|
|
13
|
-
* Mirrors sfcc-ci `client:auth:renew` command behavior. Requires that the initial
|
|
14
|
-
* authentication was done with the --renew flag (which stores the credentials needed
|
|
15
|
-
* for renewal).
|
|
16
|
-
*
|
|
17
|
-
* Uses refresh_token grant when a refresh token is stored, otherwise falls back
|
|
18
|
-
* to client_credentials grant using the stored base64-encoded client:secret.
|
|
19
|
-
*/
|
|
20
|
-
export default class AuthClientRenew extends BaseCommand {
|
|
21
|
-
static description = t('commands.auth.client.renew.description', 'Renew the client authentication token');
|
|
22
|
-
static examples = ['<%= config.bin %> <%= command.id %>'];
|
|
23
|
-
static flags = {
|
|
24
|
-
'account-manager-host': Flags.string({
|
|
25
|
-
description: `Account Manager hostname for OAuth (default: ${DEFAULT_ACCOUNT_MANAGER_HOST})`,
|
|
26
|
-
env: 'SFCC_ACCOUNT_MANAGER_HOST',
|
|
27
|
-
default: async () => process.env.SFCC_LOGIN_URL || undefined,
|
|
28
|
-
helpGroup: 'AUTH',
|
|
29
|
-
}),
|
|
30
|
-
};
|
|
31
|
-
static hiddenAliases = ['client:auth:renew'];
|
|
32
|
-
loadConfiguration() {
|
|
33
|
-
return loadConfig({ accountManagerHost: this.flags['account-manager-host'] }, this.getBaseConfigOptions());
|
|
34
|
-
}
|
|
35
|
-
async run() {
|
|
36
|
-
const session = getStoredSession();
|
|
37
|
-
if (!session?.renewBase) {
|
|
38
|
-
this.error(t('commands.auth.client.renew.notRenewable', 'Authentication renewal not possible. Ensure initial authentication is done with --renew flag.'));
|
|
39
|
-
}
|
|
40
|
-
const accountManagerHost = this.resolvedConfig.values.accountManagerHost ?? DEFAULT_ACCOUNT_MANAGER_HOST;
|
|
41
|
-
const url = `https://${accountManagerHost}/dwsso/oauth2/access_token`;
|
|
42
|
-
// Use refresh_token grant if available, otherwise client_credentials
|
|
43
|
-
const grantPayload = session.refreshToken !== null && session.refreshToken !== undefined && session.refreshToken !== ''
|
|
44
|
-
? { grant_type: 'refresh_token', refresh_token: session.refreshToken }
|
|
45
|
-
: { grant_type: 'client_credentials' };
|
|
46
|
-
const method = 'POST';
|
|
47
|
-
const body = new URLSearchParams(grantPayload).toString();
|
|
48
|
-
this.logger.debug({ grantType: grantPayload.grant_type, clientId: session.clientId }, `[StatefulAuth] Renewing token using OAuth ${grantPayload.grant_type} grant for client: ${session.clientId}`);
|
|
49
|
-
this.logger.debug({ method, url }, `[StatefulAuth REQ] ${method} ${url}`);
|
|
50
|
-
this.logger.trace({ method, url, body }, `[StatefulAuth REQ BODY] ${method} ${url}`);
|
|
51
|
-
const startTime = Date.now();
|
|
52
|
-
const response = await fetch(url, {
|
|
53
|
-
method,
|
|
54
|
-
headers: {
|
|
55
|
-
Authorization: `Basic ${session.renewBase}`,
|
|
56
|
-
'Content-Type': 'application/x-www-form-urlencoded',
|
|
57
|
-
},
|
|
58
|
-
body,
|
|
59
|
-
});
|
|
60
|
-
const duration = Date.now() - startTime;
|
|
61
|
-
this.logger.debug({ method, url, status: response.status, duration }, `[StatefulAuth RESP] ${method} ${url} ${response.status} ${duration}ms`);
|
|
62
|
-
if (!response.ok) {
|
|
63
|
-
const errorText = await response.text();
|
|
64
|
-
this.logger.trace({ method, url, body: errorText }, `[StatefulAuth RESP BODY] ${method} ${url}`);
|
|
65
|
-
let errorMsg;
|
|
66
|
-
try {
|
|
67
|
-
const parsed = JSON.parse(errorText);
|
|
68
|
-
errorMsg = parsed.error_description ?? errorText;
|
|
69
|
-
}
|
|
70
|
-
catch {
|
|
71
|
-
errorMsg = errorText;
|
|
72
|
-
}
|
|
73
|
-
this.error(t('commands.auth.client.renew.failed', 'Authentication renewal failed: {{error}}', { error: errorMsg }));
|
|
74
|
-
}
|
|
75
|
-
const data = (await response.json());
|
|
76
|
-
this.logger.trace({ method, url, body: data }, `[StatefulAuth RESP BODY] ${method} ${url}`);
|
|
77
|
-
// Update stored session with new token (server may issue a new refresh token)
|
|
78
|
-
setStoredSession({
|
|
79
|
-
clientId: session.clientId,
|
|
80
|
-
accessToken: data.access_token,
|
|
81
|
-
refreshToken: data.refresh_token ?? session.refreshToken ?? null,
|
|
82
|
-
renewBase: session.renewBase,
|
|
83
|
-
user: session.user ?? null,
|
|
84
|
-
});
|
|
85
|
-
this.log(t('commands.auth.client.renew.success', 'Authentication renewal succeeded.'));
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
//# sourceMappingURL=renew.js.map
|
|
@@ -1 +0,0 @@
|
|
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