@salesforce/b2c-cli 1.21.3 → 1.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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.js +4 -35
- package/dist/commands/setup/inspect.js.map +1 -1
- package/dist/i18n/locales/en.d.ts +2 -0
- package/dist/i18n/locales/en.js +3 -1
- package/dist/i18n/locales/en.js.map +1 -1
- package/dist/i18n/locales/index.d.ts +2 -0
- 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 +12283 -11732
- 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
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { BaseCommand } from '@salesforce/b2c-tooling-sdk/cli';
|
|
2
2
|
/**
|
|
3
3
|
* Authenticate an API client (client_credentials or password grant) and persist the session.
|
|
4
|
-
* Mirrors sfcc-ci `client:auth` command behavior. Uses the same stateful store so tokens
|
|
5
|
-
* are shared with sfcc-ci, b2c auth:login, and subsequent CLI commands.
|
|
6
4
|
*
|
|
7
5
|
* Grant type is auto-detected based on credentials provided:
|
|
8
6
|
* - client_credentials: when only --client-id + --client-secret are given
|
|
9
7
|
* - password: when --user + --user-password are also provided
|
|
10
8
|
*
|
|
11
|
-
*
|
|
9
|
+
* Only the access token is persisted — the client secret is NEVER stored.
|
|
10
|
+
* When the access token expires, re-run this command with the same credentials
|
|
11
|
+
* to obtain a new one. There is no automatic refresh.
|
|
12
12
|
*/
|
|
13
13
|
export default class AuthClient extends BaseCommand<typeof AuthClient> {
|
|
14
14
|
static description: string;
|
|
@@ -18,7 +18,6 @@ export default class AuthClient extends BaseCommand<typeof AuthClient> {
|
|
|
18
18
|
'client-secret': import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
19
19
|
'account-manager-host': import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
20
20
|
'auth-scope': import("@oclif/core/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
21
|
-
renew: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
22
21
|
'grant-type': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
23
22
|
user: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
24
23
|
'user-password': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
@@ -5,25 +5,24 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import { Flags } from '@oclif/core';
|
|
7
7
|
import { BaseCommand, loadConfig } from '@salesforce/b2c-tooling-sdk/cli';
|
|
8
|
-
import {
|
|
8
|
+
import { saveAuthSession, decodeJWT, encodeBasicClientCredentials } from '@salesforce/b2c-tooling-sdk/auth';
|
|
9
9
|
import { DEFAULT_ACCOUNT_MANAGER_HOST } from '@salesforce/b2c-tooling-sdk';
|
|
10
10
|
import { t } from '../../../i18n/index.js';
|
|
11
11
|
/**
|
|
12
12
|
* Authenticate an API client (client_credentials or password grant) and persist the session.
|
|
13
|
-
* Mirrors sfcc-ci `client:auth` command behavior. Uses the same stateful store so tokens
|
|
14
|
-
* are shared with sfcc-ci, b2c auth:login, and subsequent CLI commands.
|
|
15
13
|
*
|
|
16
14
|
* Grant type is auto-detected based on credentials provided:
|
|
17
15
|
* - client_credentials: when only --client-id + --client-secret are given
|
|
18
16
|
* - password: when --user + --user-password are also provided
|
|
19
17
|
*
|
|
20
|
-
*
|
|
18
|
+
* Only the access token is persisted — the client secret is NEVER stored.
|
|
19
|
+
* When the access token expires, re-run this command with the same credentials
|
|
20
|
+
* to obtain a new one. There is no automatic refresh.
|
|
21
21
|
*/
|
|
22
22
|
export default class AuthClient extends BaseCommand {
|
|
23
23
|
static description = t('commands.auth.client.description', 'Authenticate an API client and save session');
|
|
24
24
|
static examples = [
|
|
25
25
|
'<%= config.bin %> <%= command.id %> --client-id <id> --client-secret <secret>',
|
|
26
|
-
'<%= config.bin %> <%= command.id %> --client-id <id> --client-secret <secret> --renew',
|
|
27
26
|
'<%= config.bin %> <%= command.id %> --client-id <id> --client-secret <secret> --user <email> --user-password <pwd>',
|
|
28
27
|
'<%= config.bin %> <%= command.id %> --client-id <id> --client-secret <secret> --grant-type client_credentials',
|
|
29
28
|
];
|
|
@@ -54,11 +53,6 @@ export default class AuthClient extends BaseCommand {
|
|
|
54
53
|
delimiter: ',',
|
|
55
54
|
helpGroup: 'AUTH',
|
|
56
55
|
}),
|
|
57
|
-
renew: Flags.boolean({
|
|
58
|
-
char: 'r',
|
|
59
|
-
description: 'Enable automatic token renewal (stores credentials for later refresh)',
|
|
60
|
-
default: false,
|
|
61
|
-
}),
|
|
62
56
|
'grant-type': Flags.string({
|
|
63
57
|
char: 't',
|
|
64
58
|
description: 'OAuth grant type (default: auto-detect based on provided credentials)',
|
|
@@ -92,7 +86,6 @@ export default class AuthClient extends BaseCommand {
|
|
|
92
86
|
const user = this.flags.user;
|
|
93
87
|
const userPassword = this.flags['user-password'];
|
|
94
88
|
const grantType = this.resolveGrantType(this.flags['grant-type'], user);
|
|
95
|
-
const autoRenew = this.flags.renew;
|
|
96
89
|
if (grantType === 'password' && (!user || !userPassword)) {
|
|
97
90
|
this.error(t('commands.auth.client.userRequired', 'Username and password are required for password grant. Provide --user and --user-password.'));
|
|
98
91
|
}
|
|
@@ -140,15 +133,17 @@ export default class AuthClient extends BaseCommand {
|
|
|
140
133
|
catch {
|
|
141
134
|
// not a JWT; ignore
|
|
142
135
|
}
|
|
143
|
-
|
|
136
|
+
saveAuthSession({
|
|
144
137
|
clientId,
|
|
138
|
+
flow: 'client-credentials',
|
|
145
139
|
accessToken: data.access_token,
|
|
146
|
-
refreshToken:
|
|
147
|
-
|
|
148
|
-
|
|
140
|
+
refreshToken: null,
|
|
141
|
+
sub: this.extractUser(data.id_token),
|
|
142
|
+
expiresAt: new Date(Date.now() + (data.expires_in ?? 0) * 1000).toISOString(),
|
|
143
|
+
scopes: data.scope ? data.scope.split(' ') : (scopes ?? []),
|
|
144
|
+
accountManagerHost,
|
|
149
145
|
});
|
|
150
|
-
|
|
151
|
-
this.log(t('commands.auth.client.success', 'Authentication succeeded.{{renewMsg}}', { renewMsg }));
|
|
146
|
+
this.log(t('commands.auth.client.success', 'Authentication succeeded.'));
|
|
152
147
|
}
|
|
153
148
|
extractUser(idToken) {
|
|
154
149
|
if (!idToken)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/commands/auth/client/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAC,KAAK,EAAC,MAAM,aAAa,CAAC;AAClC,OAAO,EAAC,WAAW,EAAE,UAAU,EAAC,MAAM,iCAAiC,CAAC;AACxE,OAAO,EAAC,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/commands/auth/client/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAC,KAAK,EAAC,MAAM,aAAa,CAAC;AAClC,OAAO,EAAC,WAAW,EAAE,UAAU,EAAC,MAAM,iCAAiC,CAAC;AACxE,OAAO,EAAC,eAAe,EAAE,SAAS,EAAE,4BAA4B,EAAC,MAAM,kCAAkC,CAAC;AAC1G,OAAO,EAAC,4BAA4B,EAAC,MAAM,6BAA6B,CAAC;AACzE,OAAO,EAAC,CAAC,EAAC,MAAM,wBAAwB,CAAC;AAEzC;;;;;;;;;;GAUG;AACH,MAAM,CAAC,OAAO,OAAO,UAAW,SAAQ,WAA8B;IACpE,MAAM,CAAC,WAAW,GAAG,C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ACd,CAAC;IACH,CAAC;IAEO,iBAAiB,CAAC,SAAiB;QACzC,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,SAAS,CAAiC,CAAC;YACrE,OAAO,MAAM,CAAC,iBAAiB,IAAI,SAAS,CAAC;QAC/C,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,SAAS,CAAC;QACnB,CAAC;IACH,CAAC;IAEO,gBAAgB,CAAC,aAAiC,EAAE,IAAwB;QAClF,IAAI,aAAa;YAAE,OAAO,aAAa,CAAC;QACxC,IAAI,IAAI;YAAE,OAAO,UAAU,CAAC;QAC5B,OAAO,oBAAoB,CAAC;IAC9B,CAAC"}
|
|
@@ -6,18 +6,21 @@ interface AuthClientTokenOutput {
|
|
|
6
6
|
accessToken: string;
|
|
7
7
|
clientId: string;
|
|
8
8
|
expires: string;
|
|
9
|
-
renewable: boolean;
|
|
10
9
|
scopes: string[];
|
|
11
10
|
user: null | string;
|
|
12
11
|
}
|
|
13
12
|
/**
|
|
14
|
-
* Return the
|
|
15
|
-
*
|
|
13
|
+
* Return the stored authentication token. With multiple stored sessions
|
|
14
|
+
* (e.g. one from `auth client`, one from `auth login`), pass `--client-id`
|
|
15
|
+
* to disambiguate.
|
|
16
16
|
*/
|
|
17
17
|
export default class AuthClientToken extends BaseCommand<typeof AuthClientToken> {
|
|
18
18
|
static description: string;
|
|
19
19
|
static enableJsonFlag: boolean;
|
|
20
20
|
static examples: string[];
|
|
21
|
+
static flags: {
|
|
22
|
+
'client-id': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
23
|
+
};
|
|
21
24
|
static hiddenAliases: string[];
|
|
22
25
|
run(): Promise<AuthClientTokenOutput>;
|
|
23
26
|
}
|
|
@@ -3,62 +3,76 @@
|
|
|
3
3
|
* SPDX-License-Identifier: Apache-2
|
|
4
4
|
* For full license text, see the license.txt file in the repo root or http://www.apache.org/licenses/LICENSE-2.0
|
|
5
5
|
*/
|
|
6
|
-
import { ux } from '@oclif/core';
|
|
6
|
+
import { Flags, ux } from '@oclif/core';
|
|
7
7
|
import { BaseCommand } from '@salesforce/b2c-tooling-sdk/cli';
|
|
8
|
-
import {
|
|
8
|
+
import { findAuthSession, listAuthSessions, isAuthSessionTokenValid, decodeJWT } from '@salesforce/b2c-tooling-sdk/auth';
|
|
9
9
|
import { t } from '../../../i18n/index.js';
|
|
10
10
|
/**
|
|
11
|
-
* Return the
|
|
12
|
-
*
|
|
11
|
+
* Return the stored authentication token. With multiple stored sessions
|
|
12
|
+
* (e.g. one from `auth client`, one from `auth login`), pass `--client-id`
|
|
13
|
+
* to disambiguate.
|
|
13
14
|
*/
|
|
14
15
|
export default class AuthClientToken extends BaseCommand {
|
|
15
|
-
static description = t('commands.auth.client.token.description', 'Return the
|
|
16
|
+
static description = t('commands.auth.client.token.description', 'Return the stored authentication token');
|
|
16
17
|
static enableJsonFlag = true;
|
|
17
|
-
static examples = [
|
|
18
|
+
static examples = [
|
|
19
|
+
'<%= config.bin %> <%= command.id %>',
|
|
20
|
+
'<%= config.bin %> <%= command.id %> --client-id <id>',
|
|
21
|
+
'<%= config.bin %> <%= command.id %> --json',
|
|
22
|
+
];
|
|
23
|
+
static flags = {
|
|
24
|
+
'client-id': Flags.string({
|
|
25
|
+
description: 'Client ID for the stored session to read',
|
|
26
|
+
env: 'SFCC_CLIENT_ID',
|
|
27
|
+
helpGroup: 'AUTH',
|
|
28
|
+
}),
|
|
29
|
+
};
|
|
18
30
|
static hiddenAliases = ['client:auth:token'];
|
|
19
31
|
async run() {
|
|
20
|
-
this.
|
|
21
|
-
|
|
32
|
+
const requestedClientId = this.flags['client-id'];
|
|
33
|
+
let session = requestedClientId ? findAuthSession(requestedClientId) : null;
|
|
34
|
+
if (!session && !requestedClientId) {
|
|
35
|
+
const all = listAuthSessions();
|
|
36
|
+
if (all.length === 1) {
|
|
37
|
+
session = all[0];
|
|
38
|
+
}
|
|
39
|
+
else if (all.length > 1) {
|
|
40
|
+
this.error(t('commands.auth.client.token.ambiguous', 'Multiple stored sessions found. Pass --client-id to choose one.'));
|
|
41
|
+
}
|
|
42
|
+
}
|
|
22
43
|
if (!session?.accessToken) {
|
|
23
|
-
this.
|
|
24
|
-
this.error(t('commands.auth.client.token.noToken', 'No authentication token found. Run `auth client` to authenticate first.'));
|
|
44
|
+
this.error(t('commands.auth.client.token.noToken', 'No authentication token found. Run `auth client` or `auth login` to authenticate first.'));
|
|
25
45
|
}
|
|
26
|
-
this.logger.debug({ clientId: session.clientId, user: session.user }, `[StatefulAuth] Found session for client: ${session.clientId}`);
|
|
27
|
-
// Decode JWT to extract metadata
|
|
28
46
|
let expires = '';
|
|
29
|
-
let scopes = [];
|
|
47
|
+
let scopes = session.scopes ?? [];
|
|
30
48
|
try {
|
|
31
49
|
const decoded = decodeJWT(session.accessToken);
|
|
32
50
|
const exp = decoded.payload.exp;
|
|
33
51
|
if (typeof exp === 'number') {
|
|
34
52
|
expires = new Date(exp * 1000).toISOString();
|
|
35
53
|
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
54
|
+
if (scopes.length === 0) {
|
|
55
|
+
const scope = decoded.payload.scope;
|
|
56
|
+
scopes = scope === null || scope === undefined ? [] : Array.isArray(scope) ? scope : scope.split(' ');
|
|
57
|
+
}
|
|
40
58
|
}
|
|
41
59
|
catch {
|
|
42
|
-
|
|
60
|
+
// not a JWT; ignore
|
|
43
61
|
}
|
|
44
|
-
const valid =
|
|
45
|
-
const renewable = session.renewBase !== null && session.renewBase !== undefined && session.renewBase !== '';
|
|
46
|
-
this.logger.debug({ valid, renewable }, `[StatefulAuth] Token valid: ${valid}, renewable: ${renewable}`);
|
|
62
|
+
const valid = isAuthSessionTokenValid(session);
|
|
47
63
|
const output = {
|
|
48
64
|
accessToken: session.accessToken,
|
|
49
65
|
clientId: session.clientId,
|
|
50
66
|
expires,
|
|
51
|
-
renewable,
|
|
52
67
|
scopes,
|
|
53
|
-
user: session.
|
|
68
|
+
user: session.sub ?? null,
|
|
54
69
|
};
|
|
55
70
|
if (this.jsonEnabled()) {
|
|
56
71
|
if (!valid) {
|
|
57
|
-
this.warn(t('commands.auth.client.token.expired', 'Token is expired or invalid. Run `auth client
|
|
72
|
+
this.warn(t('commands.auth.client.token.expired', 'Token is expired or invalid. Run `auth client` or `auth login` to re-authenticate.'));
|
|
58
73
|
}
|
|
59
74
|
return output;
|
|
60
75
|
}
|
|
61
|
-
// In normal mode, output just the raw token to stdout (matches sfcc-ci behavior)
|
|
62
76
|
ux.stdout(session.accessToken);
|
|
63
77
|
return output;
|
|
64
78
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"token.js","sourceRoot":"","sources":["../../../../src/commands/auth/client/token.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAC,EAAE,EAAC,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"token.js","sourceRoot":"","sources":["../../../../src/commands/auth/client/token.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAC,KAAK,EAAE,EAAE,EAAC,MAAM,aAAa,CAAC;AACtC,OAAO,EAAC,WAAW,EAAC,MAAM,iCAAiC,CAAC;AAC5D,OAAO,EAAC,eAAe,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,SAAS,EAAC,MAAM,kCAAkC,CAAC;AACvH,OAAO,EAAC,CAAC,EAAC,MAAM,wBAAwB,CAAC;AAazC;;;;GAIG;AACH,MAAM,CAAC,OAAO,OAAO,eAAgB,SAAQ,WAAmC;IAC9E,MAAM,CAAC,WAAW,GAAG,CAAC,CAAC,wCAAwC,EAAE,wCAAwC,CAAC,CAAC;IAE3G,MAAM,CAAC,cAAc,GAAG,IAAI,CAAC;IAE7B,MAAM,CAAC,QAAQ,GAAG;QAChB,qCAAqC;QACrC,sDAAsD;QACtD,4CAA4C;KAC7C,CAAC;IAEF,MAAM,CAAC,KAAK,GAAG;QACb,WAAW,EA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AAC,GAAG,GAAG,IAAI,CAAC,CAAC,WAAW,EAAE,CAAC;YAC/C,CAAC;YACD,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;gBACxB,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,KAAsC,CAAC;gBACrE,MAAM,GAAG,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;YACxG,CAAC;QACH,CAAC;QAAC,MAAM,CAAC;YACP,oBAAoB;QACtB,CAAC;QAED,MAAM,KAAK,GAAG,uBAAuB,CAAC,OAAO,CAAC,CAAC;QAE/C,MAAM,MAAM,GAA0B;YACpC,WAAW,EAAE,OAAO,CAAC,WAAW;YAChC,QAAQ,EAAE,OAAO,CAAC,QAAQ;YAC1B,OAAO;YACP,MAAM;YACN,IAAI,EAAE,OAAO,CAAC,GAAG,IAAI,IAAI;SAC1B,CAAC;QAEF,IAAI,IAAI,CAAC,WAAW,EAAE,EAAE,CAAC;YACvB,IAAI,CAAC,KAAK,EAAE,CAAC;gBACX,IAAI,CAAC,IAAI,CACP,CAAC,CACC,oCAAoC,EACpC,oFAAoF,CACrF,CACF,CAAC;YACJ,CAAC;YACD,OAAO,MAAM,CAAC;QAChB,CAAC;QAED,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;QAE/B,OAAO,MAAM,CAAC;IAChB,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { BaseCommand } from '@salesforce/b2c-tooling-sdk/cli';
|
|
2
2
|
/**
|
|
3
|
-
* Log in via browser (
|
|
4
|
-
*
|
|
5
|
-
*
|
|
3
|
+
* Log in via browser (Authorization Code + PKCE) and persist the session for
|
|
4
|
+
* stateful auth. PKCE sessions use the CLI's unified multi-session store; old
|
|
5
|
+
* sfcc-ci-compatible renewal records are intentionally not reused.
|
|
6
6
|
*/
|
|
7
7
|
export default class AuthLogin extends BaseCommand<typeof AuthLogin> {
|
|
8
8
|
static args: {
|
|
@@ -13,8 +13,10 @@ export default class AuthLogin extends BaseCommand<typeof AuthLogin> {
|
|
|
13
13
|
static flags: {
|
|
14
14
|
'account-manager-host': import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
15
15
|
'auth-scope': import("@oclif/core/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
16
|
+
'auth-methods': import("@oclif/core/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
16
17
|
};
|
|
17
18
|
static hiddenAliases: string[];
|
|
18
19
|
protected loadConfiguration(): Promise<import("@salesforce/b2c-tooling-sdk").ResolvedB2CConfig>;
|
|
19
20
|
run(): Promise<void>;
|
|
21
|
+
private selectMethod;
|
|
20
22
|
}
|
|
@@ -5,13 +5,14 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import { Args, Flags } from '@oclif/core';
|
|
7
7
|
import { BaseCommand, ERROR_CODE, loadConfig } from '@salesforce/b2c-tooling-sdk/cli';
|
|
8
|
-
import { ImplicitOAuthStrategy,
|
|
8
|
+
import { ImplicitOAuthStrategy, createUserAuthStrategy } from '@salesforce/b2c-tooling-sdk/auth';
|
|
9
9
|
import { DEFAULT_ACCOUNT_MANAGER_HOST } from '@salesforce/b2c-tooling-sdk';
|
|
10
10
|
import { t, withDocs } from '../../i18n/index.js';
|
|
11
|
+
const LOGIN_AUTH_METHODS = ['user', 'implicit'];
|
|
11
12
|
/**
|
|
12
|
-
* Log in via browser (
|
|
13
|
-
*
|
|
14
|
-
*
|
|
13
|
+
* Log in via browser (Authorization Code + PKCE) and persist the session for
|
|
14
|
+
* stateful auth. PKCE sessions use the CLI's unified multi-session store; old
|
|
15
|
+
* sfcc-ci-compatible renewal records are intentionally not reused.
|
|
15
16
|
*/
|
|
16
17
|
export default class AuthLogin extends BaseCommand {
|
|
17
18
|
static args = {
|
|
@@ -21,7 +22,11 @@ export default class AuthLogin extends BaseCommand {
|
|
|
21
22
|
}),
|
|
22
23
|
};
|
|
23
24
|
static description = withDocs(t('commands.auth.login.description', 'Log in via browser and save session (stateful auth)'), '/cli/auth.html#b2c-auth-login');
|
|
24
|
-
static examples = [
|
|
25
|
+
static examples = [
|
|
26
|
+
'<%= config.bin %> <%= command.id %>',
|
|
27
|
+
'<%= config.bin %> <%= command.id %> your-client-id',
|
|
28
|
+
'<%= config.bin %> <%= command.id %> --auth-methods implicit',
|
|
29
|
+
];
|
|
25
30
|
static flags = {
|
|
26
31
|
'account-manager-host': Flags.string({
|
|
27
32
|
description: `Account Manager hostname for OAuth (default: ${DEFAULT_ACCOUNT_MANAGER_HOST})`,
|
|
@@ -37,14 +42,25 @@ export default class AuthLogin extends BaseCommand {
|
|
|
37
42
|
delimiter: ',',
|
|
38
43
|
helpGroup: 'AUTH',
|
|
39
44
|
}),
|
|
45
|
+
'auth-methods': Flags.string({
|
|
46
|
+
description: 'Browser-based auth flow to use. Defaults to "user" (Authorization Code + PKCE).',
|
|
47
|
+
env: 'SFCC_AUTH_METHODS',
|
|
48
|
+
options: [...LOGIN_AUTH_METHODS],
|
|
49
|
+
multiple: true,
|
|
50
|
+
multipleNonGreedy: true,
|
|
51
|
+
delimiter: ',',
|
|
52
|
+
helpGroup: 'AUTH',
|
|
53
|
+
}),
|
|
40
54
|
};
|
|
41
55
|
static hiddenAliases = ['auth:login'];
|
|
42
56
|
loadConfiguration() {
|
|
43
57
|
const scopes = this.flags['auth-scope'];
|
|
58
|
+
const authMethods = this.flags['auth-methods'];
|
|
44
59
|
return loadConfig({
|
|
45
60
|
clientId: this.args.clientId ?? process.env.SFCC_CLIENT_ID,
|
|
46
61
|
accountManagerHost: this.flags['account-manager-host'],
|
|
47
62
|
scopes: scopes && scopes.length > 0 ? scopes : undefined,
|
|
63
|
+
authMethods: authMethods && authMethods.length > 0 ? authMethods : undefined,
|
|
48
64
|
}, this.getBaseConfigOptions());
|
|
49
65
|
}
|
|
50
66
|
async run() {
|
|
@@ -54,30 +70,29 @@ export default class AuthLogin extends BaseCommand {
|
|
|
54
70
|
}
|
|
55
71
|
const accountManagerHost = this.resolvedConfig.values.accountManagerHost ?? DEFAULT_ACCOUNT_MANAGER_HOST;
|
|
56
72
|
const scopes = this.resolvedConfig.values.scopes;
|
|
57
|
-
const
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
try {
|
|
65
|
-
const decoded = decodeJWT(tokenResponse.accessToken);
|
|
66
|
-
if (typeof decoded.payload.sub === 'string') {
|
|
67
|
-
user = decoded.payload.sub;
|
|
68
|
-
}
|
|
73
|
+
const method = this.selectMethod();
|
|
74
|
+
if (method === 'implicit') {
|
|
75
|
+
this.warn(t('warning.implicitFlowDeprecated', 'The OAuth implicit flow is deprecated. Create a new public OAuth client in Account Manager ' +
|
|
76
|
+
'and use Authorization Code + PKCE (the default) instead. ' +
|
|
77
|
+
'See https://salesforcecommercecloud.github.io/b2c-developer-tooling/guide/authentication.html#implicit-flow-deprecation'));
|
|
78
|
+
const strategy = new ImplicitOAuthStrategy({ clientId, scopes, accountManagerHost });
|
|
79
|
+
await strategy.getTokenResponse();
|
|
69
80
|
}
|
|
70
|
-
|
|
71
|
-
//
|
|
81
|
+
else {
|
|
82
|
+
// PKCE with an automatic, WARN-logged fallback to the implicit flow for
|
|
83
|
+
// clients not yet registered for PKCE (see oauth-pkce-fallback in the SDK).
|
|
84
|
+
const strategy = createUserAuthStrategy({ clientId, scopes, accountManagerHost });
|
|
85
|
+
await strategy.getTokenResponse();
|
|
72
86
|
}
|
|
73
|
-
setStoredSession({
|
|
74
|
-
clientId,
|
|
75
|
-
accessToken: tokenResponse.accessToken,
|
|
76
|
-
refreshToken: null,
|
|
77
|
-
renewBase: null,
|
|
78
|
-
user,
|
|
79
|
-
});
|
|
80
87
|
this.log(t('commands.auth.login.success', 'Login succeeded. Session saved for stateful auth.'));
|
|
81
88
|
}
|
|
89
|
+
selectMethod() {
|
|
90
|
+
// CLI/env values are merged into resolvedConfig by loadConfiguration(), so
|
|
91
|
+
// this also honors an explicit dw.json `auth-methods` selection. Ignore
|
|
92
|
+
// non-browser methods because `auth login` is browser-only; absent an
|
|
93
|
+
// explicit browser method, PKCE remains the absolute default.
|
|
94
|
+
const method = this.resolvedConfig.values.authMethods?.find((candidate) => LOGIN_AUTH_METHODS.includes(candidate));
|
|
95
|
+
return method ?? 'user';
|
|
96
|
+
}
|
|
82
97
|
}
|
|
83
98
|
//# sourceMappingURL=login.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"login.js","sourceRoot":"","sources":["../../../src/commands/auth/login.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAC,IAAI,EAAE,KAAK,EAAC,MAAM,aAAa,CAAC;AACxC,OAAO,EAAC,WAAW,EAAE,UAAU,EAAE,UAAU,EAAC,MAAM,iCAAiC,CAAC;AACpF,OAAO,EAAC,qBAAqB,EAAE,
|
|
1
|
+
{"version":3,"file":"login.js","sourceRoot":"","sources":["../../../src/commands/auth/login.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAC,IAAI,EAAE,KAAK,EAAC,MAAM,aAAa,CAAC;AACxC,OAAO,EAAC,WAAW,EAAE,UAAU,EAAE,UAAU,EAAC,MAAM,iCAAiC,CAAC;AACpF,OAAO,EAAC,qBAAqB,EAAE,sBAAsB,EAAC,MAAM,kCAAkC,CAAC;AAC/F,OAAO,EAAC,4BAA4B,EAAC,MAAM,6BAA6B,CAAC;AACzE,OAAO,EAAC,CAAC,EAAE,QAAQ,EAAC,MAAM,qBAAqB,CAAC;AAEhD,MAAM,kBAAkB,GAAG,CAAC,MAAM,EAAE,UAAU,CAAU,C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H,CAC5H,CACF,CAAC;YACF,MAAM,QAAQ,GAAG,IAAI,qBAAqB,CAAC,EAAC,QAAQ,EAAE,MAAM,EAAE,kBAAkB,EAAC,CAAC,CAAC;YACnF,MAAM,QAAQ,CAAC,gBAAgB,EAAE,CAAC;QACpC,CAAC;aAAM,CAAC;YACN,wEAAwE;YACxE,4EAA4E;YAC5E,MAAM,QAAQ,GAAG,sBAAsB,CAAC,EAAC,QAAQ,EAAE,MAAM,EAAE,kBAAkB,EAAC,CAAC,CAAC;YAChF,MAAM,QAAQ,CAAC,gBAAgB,EAAE,CAAC;QACpC,CAAC;QAED,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,6BAA6B,EAAE,mDAAmD,CAAC,CAAC,CAAC;IAClG,CAAC;IAEO,YAAY;QAClB,2EAA2E;QAC3E,wEAAwE;QACxE,sEAAsE;QACtE,8DAA8D;QAC9D,MAAM,MAAM,GAAG,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC,SAAS,EAAgC,EAAE,CACtG,kBAAkB,CAAC,QAAQ,CAAC,SAA4B,CAAC,CAC1D,CAAC;QACF,OAAO,MAAM,IAAI,MAAM,CAAC;IAC1B,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { BaseCommand } from '@salesforce/b2c-tooling-sdk/cli';
|
|
2
2
|
/**
|
|
3
|
-
* Clear
|
|
4
|
-
*
|
|
5
|
-
*
|
|
3
|
+
* Clear all stored OAuth sessions, including the legacy sfcc-ci-compatible
|
|
4
|
+
* renewal record. After logout, commands resolve a configured stateless flow
|
|
5
|
+
* or start the default PKCE browser flow.
|
|
6
6
|
*/
|
|
7
7
|
export default class AuthLogout extends BaseCommand<typeof AuthLogout> {
|
|
8
8
|
static description: string;
|
|
@@ -4,19 +4,19 @@
|
|
|
4
4
|
* For full license text, see the license.txt file in the repo root or http://www.apache.org/licenses/LICENSE-2.0
|
|
5
5
|
*/
|
|
6
6
|
import { BaseCommand } from '@salesforce/b2c-tooling-sdk/cli';
|
|
7
|
-
import {
|
|
7
|
+
import { clearAllAuthSessions } from '@salesforce/b2c-tooling-sdk/auth';
|
|
8
8
|
import { t, withDocs } from '../../i18n/index.js';
|
|
9
9
|
/**
|
|
10
|
-
* Clear
|
|
11
|
-
*
|
|
12
|
-
*
|
|
10
|
+
* Clear all stored OAuth sessions, including the legacy sfcc-ci-compatible
|
|
11
|
+
* renewal record. After logout, commands resolve a configured stateless flow
|
|
12
|
+
* or start the default PKCE browser flow.
|
|
13
13
|
*/
|
|
14
14
|
export default class AuthLogout extends BaseCommand {
|
|
15
15
|
static description = withDocs(t('commands.auth.logout.description', 'Clear stored session (stateful auth)'), '/cli/auth.html#b2c-auth-logout');
|
|
16
16
|
static examples = ['<%= config.bin %> <%= command.id %>'];
|
|
17
17
|
static hiddenAliases = ['auth:logout'];
|
|
18
18
|
async run() {
|
|
19
|
-
|
|
19
|
+
clearAllAuthSessions();
|
|
20
20
|
this.log(t('commands.auth.logout.success', 'Logged out. Stored session cleared.'));
|
|
21
21
|
}
|
|
22
22
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logout.js","sourceRoot":"","sources":["../../../src/commands/auth/logout.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAC,WAAW,EAAC,MAAM,iCAAiC,CAAC;AAC5D,OAAO,EAAC,
|
|
1
|
+
{"version":3,"file":"logout.js","sourceRoot":"","sources":["../../../src/commands/auth/logout.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAC,WAAW,EAAC,MAAM,iCAAiC,CAAC;AAC5D,OAAO,EAAC,oBAAoB,EAAC,MAAM,kCAAkC,CAAC;AACtE,OAAO,EAAC,CAAC,EAAE,QAAQ,EAAC,MAAM,qBAAqB,CAAC;AAEhD;;;;GAIG;AACH,MAAM,CAAC,OAAO,OAAO,UAAW,SAAQ,WAA8B;IACpE,MAAM,CAAC,WAAW,GAAG,QAAQ,CAC3B,CAAC,CAAC,kCAAkC,EAAE,sCAAsC,CAAC,EAC7E,gCAAgC,CACjC,CAAC;IAEF,MAAM,CAAC,QAAQ,GAAG,CAAC,qCAAqC,CAAC,CAAC;IAE1D,MAAM,CAAC,aAAa,GAAG,CAAC,aAAa,CAAC,CAAC;IAEvC,KAAK,CAAC,GAAG;QACP,oBAAoB,EAAE,CAAC;QACvB,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,8BAA8B,EAAE,qCAAqC,CAAC,CAAC,CAAC;IACrF,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { JobCommand } from '@salesforce/b2c-tooling-sdk/cli';
|
|
2
|
-
import { commerceAppInstall, validateCap, type CommerceAppInstallResult } from '@salesforce/b2c-tooling-sdk/operations/cap';
|
|
2
|
+
import { commerceAppInstall, readManifestFromTarget, validateCap, type CommerceAppInstallResult } from '@salesforce/b2c-tooling-sdk/operations/cap';
|
|
3
|
+
import { confirm } from '@salesforce/b2c-tooling-sdk/ux';
|
|
3
4
|
export default class CapInstall extends JobCommand<typeof CapInstall> {
|
|
4
5
|
static args: {
|
|
5
6
|
path: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
|
|
@@ -13,6 +14,7 @@ export default class CapInstall extends JobCommand<typeof CapInstall> {
|
|
|
13
14
|
timeout: import("@oclif/core/interfaces").OptionFlag<number | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
14
15
|
'skip-validate': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
15
16
|
'create-pr': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
17
|
+
force: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
16
18
|
server: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
17
19
|
'webdav-server': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
18
20
|
'code-version': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
@@ -47,7 +49,9 @@ export default class CapInstall extends JobCommand<typeof CapInstall> {
|
|
|
47
49
|
};
|
|
48
50
|
protected operations: {
|
|
49
51
|
commerceAppInstall: typeof commerceAppInstall;
|
|
52
|
+
readManifestFromTarget: typeof readManifestFromTarget;
|
|
50
53
|
validateCap: typeof validateCap;
|
|
54
|
+
confirm: typeof confirm;
|
|
51
55
|
};
|
|
52
56
|
run(): Promise<CommerceAppInstallResult>;
|
|
53
57
|
}
|
|
@@ -5,8 +5,12 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import { Args, Flags } from '@oclif/core';
|
|
7
7
|
import { JobCommand } from '@salesforce/b2c-tooling-sdk/cli';
|
|
8
|
-
import { commerceAppInstall, validateCap, JobExecutionError, } from '@salesforce/b2c-tooling-sdk/operations/cap';
|
|
8
|
+
import { commerceAppInstall, readManifestFromTarget, validateCap, JobExecutionError, } from '@salesforce/b2c-tooling-sdk/operations/cap';
|
|
9
|
+
import { confirm } from '@salesforce/b2c-tooling-sdk/ux';
|
|
9
10
|
import { t, withDocs } from '../../i18n/index.js';
|
|
11
|
+
const NON_SFDC_WARNING = 'You are installing a Non-SFDC Application, as that term may be defined in the MSA between SFDC and Customer. ' +
|
|
12
|
+
'SFDC does not warrant or support Non-SFDC Applications or other non-SFDC products or services. ' +
|
|
13
|
+
'By proceeding, you acknowledge these terms.';
|
|
10
14
|
export default class CapInstall extends JobCommand {
|
|
11
15
|
static args = {
|
|
12
16
|
path: Args.string({
|
|
@@ -46,18 +50,26 @@ export default class CapInstall extends JobCommand {
|
|
|
46
50
|
description: 'Create a pull request against the connected Storefront Next repository when the app includes storefront content',
|
|
47
51
|
default: false,
|
|
48
52
|
}),
|
|
53
|
+
force: Flags.boolean({
|
|
54
|
+
char: 'f',
|
|
55
|
+
description: 'Skip the non-Salesforce app confirmation prompt',
|
|
56
|
+
default: false,
|
|
57
|
+
}),
|
|
49
58
|
};
|
|
50
59
|
operations = {
|
|
51
60
|
commerceAppInstall,
|
|
61
|
+
readManifestFromTarget,
|
|
52
62
|
validateCap,
|
|
63
|
+
confirm,
|
|
53
64
|
};
|
|
54
65
|
async run() {
|
|
55
66
|
this.requireOAuthCredentials();
|
|
56
67
|
this.requireWebDavCredentials();
|
|
57
68
|
const { path } = this.args;
|
|
58
|
-
const { 'site-id': site, 'clean-archive': cleanArchive, timeout, 'skip-validate': skipValidate, 'create-pr': createPr, } = this.flags;
|
|
69
|
+
const { 'site-id': site, 'clean-archive': cleanArchive, timeout, 'skip-validate': skipValidate, 'create-pr': createPr, force, } = this.flags;
|
|
59
70
|
const hostname = this.resolvedConfig.values.hostname;
|
|
60
71
|
// Validate first unless skipped
|
|
72
|
+
let manifest;
|
|
61
73
|
if (!skipValidate) {
|
|
62
74
|
this.log(t('commands.cap.install.validating', 'Validating CAP structure...'));
|
|
63
75
|
const validation = await this.operations.validateCap(path);
|
|
@@ -72,12 +84,8 @@ export default class CapInstall extends JobCommand {
|
|
|
72
84
|
this.log(` ⚠ ${warn}`);
|
|
73
85
|
}
|
|
74
86
|
}
|
|
87
|
+
manifest = validation.manifest;
|
|
75
88
|
}
|
|
76
|
-
this.log(t('commands.cap.install.installing', 'Installing CAP {{path}} to {{hostname}} (site: {{site}})...', {
|
|
77
|
-
path,
|
|
78
|
-
hostname,
|
|
79
|
-
site,
|
|
80
|
-
}));
|
|
81
89
|
const context = this.createContext('cap:install', { path, site, hostname });
|
|
82
90
|
const beforeResult = await this.runBeforeHooks(context);
|
|
83
91
|
if (beforeResult.skip) {
|
|
@@ -92,6 +100,22 @@ export default class CapInstall extends JobCommand {
|
|
|
92
100
|
archiveKept: false,
|
|
93
101
|
};
|
|
94
102
|
}
|
|
103
|
+
manifest ??= await this.operations.readManifestFromTarget(path);
|
|
104
|
+
if (manifest.provider !== 'salesforce') {
|
|
105
|
+
this.log(`⚠ ${NON_SFDC_WARNING}`);
|
|
106
|
+
if (!force && !this.jsonEnabled()) {
|
|
107
|
+
const proceed = await this.operations.confirm(t('commands.cap.install.confirmNonSfdc', 'Proceed with installing this non-Salesforce app?'));
|
|
108
|
+
if (!proceed) {
|
|
109
|
+
this.log(t('commands.cap.install.cancelled', 'Install cancelled'));
|
|
110
|
+
this.exit(0);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
this.log(t('commands.cap.install.installing', 'Installing CAP {{path}} to {{hostname}} (site: {{site}})...', {
|
|
115
|
+
path,
|
|
116
|
+
hostname,
|
|
117
|
+
site,
|
|
118
|
+
}));
|
|
95
119
|
try {
|
|
96
120
|
const result = await this.operations.commerceAppInstall(this.instance, path, {
|
|
97
121
|
siteId: site,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"install.js","sourceRoot":"","sources":["../../../src/commands/cap/install.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,kBAAkB,EAClB,WAAW,EACX,iBAAiB,
|
|
1
|
+
{"version":3,"file":"install.js","sourceRoot":"","sources":["../../../src/commands/cap/install.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,kBAAkB,EAClB,sBAAsB,EACtB,WAAW,EACX,iBAAiB,GAGlB,MAAM,4CAA4C,CAAC;AACpD,OAAO,EAAC,OAAO,EAAC,MAAM,gCAAgC,CAAC;AACvD,OAAO,EAAC,CAAC,EAAE,QAAQ,EAAC,MAAM,qBAAqB,CAAC;AAEhD,MAAM,gBAAgB,GACpB,+GAA+G;IAC/G,iGAAiG;IACjG,6CAA6C,CAAC;AAEhD,MAAM,CAAC,OAAO,OAAO,UAAW,S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