@salesforce/b2c-cli 0.0.0-nightly.20260121201541 → 0.0.0-nightly.20260122144746
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/ecdn/cache/purge.d.ts +43 -0
- package/dist/commands/ecdn/cache/purge.js +104 -0
- package/dist/commands/ecdn/cache/purge.js.map +1 -0
- package/dist/commands/ecdn/certificates/add.d.ts +44 -0
- package/dist/commands/ecdn/certificates/add.js +109 -0
- package/dist/commands/ecdn/certificates/add.js.map +1 -0
- package/dist/commands/ecdn/certificates/delete.d.ts +41 -0
- package/dist/commands/ecdn/certificates/delete.js +69 -0
- package/dist/commands/ecdn/certificates/delete.js.map +1 -0
- package/dist/commands/ecdn/certificates/list.d.ts +46 -0
- package/dist/commands/ecdn/certificates/list.js +124 -0
- package/dist/commands/ecdn/certificates/list.js.map +1 -0
- package/dist/commands/ecdn/certificates/update.d.ts +45 -0
- package/dist/commands/ecdn/certificates/update.js +104 -0
- package/dist/commands/ecdn/certificates/update.js.map +1 -0
- package/dist/commands/ecdn/certificates/validate.d.ts +40 -0
- package/dist/commands/ecdn/certificates/validate.js +68 -0
- package/dist/commands/ecdn/certificates/validate.js.map +1 -0
- package/dist/commands/ecdn/cipher-suites/get.d.ts +39 -0
- package/dist/commands/ecdn/cipher-suites/get.js +63 -0
- package/dist/commands/ecdn/cipher-suites/get.js.map +1 -0
- package/dist/commands/ecdn/cipher-suites/update.d.ts +41 -0
- package/dist/commands/ecdn/cipher-suites/update.js +81 -0
- package/dist/commands/ecdn/cipher-suites/update.js.map +1 -0
- package/dist/commands/ecdn/logpush/jobs/create.d.ts +45 -0
- package/dist/commands/ecdn/logpush/jobs/create.js +103 -0
- package/dist/commands/ecdn/logpush/jobs/create.js.map +1 -0
- package/dist/commands/ecdn/logpush/jobs/delete.d.ts +39 -0
- package/dist/commands/ecdn/logpush/jobs/delete.js +50 -0
- package/dist/commands/ecdn/logpush/jobs/delete.js.map +1 -0
- package/dist/commands/ecdn/logpush/jobs/get.d.ts +40 -0
- package/dist/commands/ecdn/logpush/jobs/get.js +85 -0
- package/dist/commands/ecdn/logpush/jobs/get.js.map +1 -0
- package/dist/commands/ecdn/logpush/jobs/list.d.ts +43 -0
- package/dist/commands/ecdn/logpush/jobs/list.js +124 -0
- package/dist/commands/ecdn/logpush/jobs/list.js.map +1 -0
- package/dist/commands/ecdn/logpush/jobs/update.d.ts +43 -0
- package/dist/commands/ecdn/logpush/jobs/update.js +94 -0
- package/dist/commands/ecdn/logpush/jobs/update.js.map +1 -0
- package/dist/commands/ecdn/logpush/ownership.d.ts +39 -0
- package/dist/commands/ecdn/logpush/ownership.js +72 -0
- package/dist/commands/ecdn/logpush/ownership.js.map +1 -0
- package/dist/commands/ecdn/mrt-rules/create.d.ts +42 -0
- package/dist/commands/ecdn/mrt-rules/create.js +81 -0
- package/dist/commands/ecdn/mrt-rules/create.js.map +1 -0
- package/dist/commands/ecdn/mrt-rules/delete.d.ts +39 -0
- package/dist/commands/ecdn/mrt-rules/delete.js +52 -0
- package/dist/commands/ecdn/mrt-rules/delete.js.map +1 -0
- package/dist/commands/ecdn/mrt-rules/get.d.ts +39 -0
- package/dist/commands/ecdn/mrt-rules/get.js +89 -0
- package/dist/commands/ecdn/mrt-rules/get.js.map +1 -0
- package/dist/commands/ecdn/mrt-rules/rules/delete.d.ts +40 -0
- package/dist/commands/ecdn/mrt-rules/rules/delete.js +57 -0
- package/dist/commands/ecdn/mrt-rules/rules/delete.js.map +1 -0
- package/dist/commands/ecdn/mrt-rules/rules/update.d.ts +44 -0
- package/dist/commands/ecdn/mrt-rules/rules/update.js +88 -0
- package/dist/commands/ecdn/mrt-rules/rules/update.js.map +1 -0
- package/dist/commands/ecdn/mrt-rules/update.d.ts +43 -0
- package/dist/commands/ecdn/mrt-rules/update.js +87 -0
- package/dist/commands/ecdn/mrt-rules/update.js.map +1 -0
- package/dist/commands/ecdn/mtls/create.d.ts +41 -0
- package/dist/commands/ecdn/mtls/create.js +84 -0
- package/dist/commands/ecdn/mtls/create.js.map +1 -0
- package/dist/commands/ecdn/mtls/delete.d.ts +38 -0
- package/dist/commands/ecdn/mtls/delete.js +53 -0
- package/dist/commands/ecdn/mtls/delete.js.map +1 -0
- package/dist/commands/ecdn/mtls/get.d.ts +39 -0
- package/dist/commands/ecdn/mtls/get.js +72 -0
- package/dist/commands/ecdn/mtls/get.js.map +1 -0
- package/dist/commands/ecdn/mtls/list.d.ts +42 -0
- package/dist/commands/ecdn/mtls/list.js +118 -0
- package/dist/commands/ecdn/mtls/list.js.map +1 -0
- package/dist/commands/ecdn/origin-headers/delete.d.ts +37 -0
- package/dist/commands/ecdn/origin-headers/delete.js +46 -0
- package/dist/commands/ecdn/origin-headers/delete.js.map +1 -0
- package/dist/commands/ecdn/origin-headers/get.d.ts +39 -0
- package/dist/commands/ecdn/origin-headers/get.js +61 -0
- package/dist/commands/ecdn/origin-headers/get.js.map +1 -0
- package/dist/commands/ecdn/origin-headers/set.d.ts +41 -0
- package/dist/commands/ecdn/origin-headers/set.js +76 -0
- package/dist/commands/ecdn/origin-headers/set.js.map +1 -0
- package/dist/commands/ecdn/page-shield/notifications/create.d.ts +41 -0
- package/dist/commands/ecdn/page-shield/notifications/create.js +84 -0
- package/dist/commands/ecdn/page-shield/notifications/create.js.map +1 -0
- package/dist/commands/ecdn/page-shield/notifications/delete.d.ts +38 -0
- package/dist/commands/ecdn/page-shield/notifications/delete.js +53 -0
- package/dist/commands/ecdn/page-shield/notifications/delete.js.map +1 -0
- package/dist/commands/ecdn/page-shield/notifications/list.d.ts +42 -0
- package/dist/commands/ecdn/page-shield/notifications/list.js +118 -0
- package/dist/commands/ecdn/page-shield/notifications/list.js.map +1 -0
- package/dist/commands/ecdn/page-shield/policies/create.d.ts +44 -0
- package/dist/commands/ecdn/page-shield/policies/create.js +100 -0
- package/dist/commands/ecdn/page-shield/policies/create.js.map +1 -0
- package/dist/commands/ecdn/page-shield/policies/delete.d.ts +39 -0
- package/dist/commands/ecdn/page-shield/policies/delete.js +56 -0
- package/dist/commands/ecdn/page-shield/policies/delete.js.map +1 -0
- package/dist/commands/ecdn/page-shield/policies/get.d.ts +40 -0
- package/dist/commands/ecdn/page-shield/policies/get.js +72 -0
- package/dist/commands/ecdn/page-shield/policies/get.js.map +1 -0
- package/dist/commands/ecdn/page-shield/policies/list.d.ts +43 -0
- package/dist/commands/ecdn/page-shield/policies/list.js +119 -0
- package/dist/commands/ecdn/page-shield/policies/list.js.map +1 -0
- package/dist/commands/ecdn/page-shield/policies/update.d.ts +45 -0
- package/dist/commands/ecdn/page-shield/policies/update.js +110 -0
- package/dist/commands/ecdn/page-shield/policies/update.js.map +1 -0
- package/dist/commands/ecdn/page-shield/scripts/get.d.ts +40 -0
- package/dist/commands/ecdn/page-shield/scripts/get.js +99 -0
- package/dist/commands/ecdn/page-shield/scripts/get.js.map +1 -0
- package/dist/commands/ecdn/page-shield/scripts/list.d.ts +43 -0
- package/dist/commands/ecdn/page-shield/scripts/list.js +124 -0
- package/dist/commands/ecdn/page-shield/scripts/list.js.map +1 -0
- package/dist/commands/ecdn/security/get.d.ts +39 -0
- package/dist/commands/ecdn/security/get.js +69 -0
- package/dist/commands/ecdn/security/get.js.map +1 -0
- package/dist/commands/ecdn/security/update.d.ts +47 -0
- package/dist/commands/ecdn/security/update.js +136 -0
- package/dist/commands/ecdn/security/update.js.map +1 -0
- package/dist/commands/ecdn/speed/get.d.ts +39 -0
- package/dist/commands/ecdn/speed/get.js +64 -0
- package/dist/commands/ecdn/speed/get.js.map +1 -0
- package/dist/commands/ecdn/speed/update.d.ts +46 -0
- package/dist/commands/ecdn/speed/update.js +105 -0
- package/dist/commands/ecdn/speed/update.js.map +1 -0
- package/dist/commands/ecdn/waf/groups/list.d.ts +42 -0
- package/dist/commands/ecdn/waf/groups/list.js +89 -0
- package/dist/commands/ecdn/waf/groups/list.js.map +1 -0
- package/dist/commands/ecdn/waf/groups/update.d.ts +43 -0
- package/dist/commands/ecdn/waf/groups/update.js +84 -0
- package/dist/commands/ecdn/waf/groups/update.js.map +1 -0
- package/dist/commands/ecdn/waf/managed-rules/list.d.ts +44 -0
- package/dist/commands/ecdn/waf/managed-rules/list.js +124 -0
- package/dist/commands/ecdn/waf/managed-rules/list.js.map +1 -0
- package/dist/commands/ecdn/waf/managed-rules/update.d.ts +43 -0
- package/dist/commands/ecdn/waf/managed-rules/update.js +94 -0
- package/dist/commands/ecdn/waf/managed-rules/update.js.map +1 -0
- package/dist/commands/ecdn/waf/migrate.d.ts +40 -0
- package/dist/commands/ecdn/waf/migrate.js +83 -0
- package/dist/commands/ecdn/waf/migrate.js.map +1 -0
- package/dist/commands/ecdn/waf/owasp/get.d.ts +40 -0
- package/dist/commands/ecdn/waf/owasp/get.js +64 -0
- package/dist/commands/ecdn/waf/owasp/get.js.map +1 -0
- package/dist/commands/ecdn/waf/owasp/update.d.ts +42 -0
- package/dist/commands/ecdn/waf/owasp/update.js +79 -0
- package/dist/commands/ecdn/waf/owasp/update.js.map +1 -0
- package/dist/commands/ecdn/waf/rules/get.d.ts +41 -0
- package/dist/commands/ecdn/waf/rules/get.js +68 -0
- package/dist/commands/ecdn/waf/rules/get.js.map +1 -0
- package/dist/commands/ecdn/waf/rules/list.d.ts +45 -0
- package/dist/commands/ecdn/waf/rules/list.js +120 -0
- package/dist/commands/ecdn/waf/rules/list.js.map +1 -0
- package/dist/commands/ecdn/waf/rules/update.d.ts +42 -0
- package/dist/commands/ecdn/waf/rules/update.js +77 -0
- package/dist/commands/ecdn/waf/rules/update.js.map +1 -0
- package/dist/commands/ecdn/waf/rulesets/list.d.ts +43 -0
- package/dist/commands/ecdn/waf/rulesets/list.js +119 -0
- package/dist/commands/ecdn/waf/rulesets/list.js.map +1 -0
- package/dist/commands/ecdn/waf/rulesets/update.d.ts +44 -0
- package/dist/commands/ecdn/waf/rulesets/update.js +101 -0
- package/dist/commands/ecdn/waf/rulesets/update.js.map +1 -0
- package/dist/commands/ecdn/zones/create.d.ts +40 -0
- package/dist/commands/ecdn/zones/create.js +71 -0
- package/dist/commands/ecdn/zones/create.js.map +1 -0
- package/dist/commands/ecdn/zones/list.d.ts +44 -0
- package/dist/commands/ecdn/zones/list.js +112 -0
- package/dist/commands/ecdn/zones/list.js.map +1 -0
- package/dist/commands/mrt/{push.d.ts → bundle/deploy.d.ts} +24 -9
- package/dist/commands/mrt/bundle/deploy.js +182 -0
- package/dist/commands/mrt/bundle/deploy.js.map +1 -0
- package/dist/commands/mrt/bundle/download.d.ts +40 -0
- package/dist/commands/mrt/bundle/download.js +109 -0
- package/dist/commands/mrt/bundle/download.js.map +1 -0
- package/dist/commands/mrt/bundle/history.d.ts +30 -0
- package/dist/commands/mrt/bundle/history.js +90 -0
- package/dist/commands/mrt/bundle/history.js.map +1 -0
- package/dist/commands/mrt/bundle/list.d.ts +30 -0
- package/dist/commands/mrt/bundle/list.js +79 -0
- package/dist/commands/mrt/bundle/list.js.map +1 -0
- package/dist/commands/mrt/env/access-control/list.d.ts +30 -0
- package/dist/commands/mrt/env/access-control/list.js +83 -0
- package/dist/commands/mrt/env/access-control/list.js.map +1 -0
- package/dist/commands/mrt/env/b2c.d.ts +32 -0
- package/dist/commands/mrt/env/b2c.js +120 -0
- package/dist/commands/mrt/env/b2c.js.map +1 -0
- package/dist/commands/mrt/env/get.d.ts +28 -0
- package/dist/commands/mrt/env/get.js +98 -0
- package/dist/commands/mrt/env/get.js.map +1 -0
- package/dist/commands/mrt/env/invalidate.d.ts +29 -0
- package/dist/commands/mrt/env/invalidate.js +66 -0
- package/dist/commands/mrt/env/invalidate.js.map +1 -0
- package/dist/commands/mrt/env/list.d.ts +28 -0
- package/dist/commands/mrt/env/list.js +68 -0
- package/dist/commands/mrt/env/list.js.map +1 -0
- package/dist/commands/mrt/env/redirect/clone.d.ts +31 -0
- package/dist/commands/mrt/env/redirect/clone.js +95 -0
- package/dist/commands/mrt/env/redirect/clone.js.map +1 -0
- package/dist/commands/mrt/env/redirect/create.d.ts +33 -0
- package/dist/commands/mrt/env/redirect/create.js +87 -0
- package/dist/commands/mrt/env/redirect/create.js.map +1 -0
- package/dist/commands/mrt/env/redirect/delete.d.ts +34 -0
- package/dist/commands/mrt/env/redirect/delete.js +92 -0
- package/dist/commands/mrt/env/redirect/delete.js.map +1 -0
- package/dist/commands/mrt/env/redirect/list.d.ts +31 -0
- package/dist/commands/mrt/env/redirect/list.js +90 -0
- package/dist/commands/mrt/env/redirect/list.js.map +1 -0
- package/dist/commands/mrt/env/update.d.ts +37 -0
- package/dist/commands/mrt/env/update.js +173 -0
- package/dist/commands/mrt/env/update.js.map +1 -0
- package/dist/commands/mrt/org/b2c.d.ts +31 -0
- package/dist/commands/mrt/org/b2c.js +55 -0
- package/dist/commands/mrt/org/b2c.js.map +1 -0
- package/dist/commands/mrt/org/list.d.ts +30 -0
- package/dist/commands/mrt/org/list.js +70 -0
- package/dist/commands/mrt/org/list.js.map +1 -0
- package/dist/commands/mrt/project/create.d.ts +35 -0
- package/dist/commands/mrt/project/create.js +129 -0
- package/dist/commands/mrt/project/create.js.map +1 -0
- package/dist/commands/mrt/project/delete.d.ts +39 -0
- package/dist/commands/mrt/project/delete.js +81 -0
- package/dist/commands/mrt/project/delete.js.map +1 -0
- package/dist/commands/mrt/project/get.d.ts +31 -0
- package/dist/commands/mrt/project/get.js +79 -0
- package/dist/commands/mrt/project/get.js.map +1 -0
- package/dist/commands/mrt/project/list.d.ts +31 -0
- package/dist/commands/mrt/project/list.js +80 -0
- package/dist/commands/mrt/project/list.js.map +1 -0
- package/dist/commands/mrt/project/member/add.d.ts +32 -0
- package/dist/commands/mrt/project/member/add.js +73 -0
- package/dist/commands/mrt/project/member/add.js.map +1 -0
- package/dist/commands/mrt/project/member/get.d.ts +31 -0
- package/dist/commands/mrt/project/member/get.js +70 -0
- package/dist/commands/mrt/project/member/get.js.map +1 -0
- package/dist/commands/mrt/project/member/list.d.ts +32 -0
- package/dist/commands/mrt/project/member/list.js +82 -0
- package/dist/commands/mrt/project/member/list.js.map +1 -0
- package/dist/commands/mrt/project/member/remove.d.ts +34 -0
- package/dist/commands/mrt/project/member/remove.js +89 -0
- package/dist/commands/mrt/project/member/remove.js.map +1 -0
- package/dist/commands/mrt/project/member/update.d.ts +32 -0
- package/dist/commands/mrt/project/member/update.js +72 -0
- package/dist/commands/mrt/project/member/update.js.map +1 -0
- package/dist/commands/mrt/project/notification/create.d.ts +33 -0
- package/dist/commands/mrt/project/notification/create.js +86 -0
- package/dist/commands/mrt/project/notification/create.js.map +1 -0
- package/dist/commands/mrt/project/notification/delete.d.ts +34 -0
- package/dist/commands/mrt/project/notification/delete.js +88 -0
- package/dist/commands/mrt/project/notification/delete.js.map +1 -0
- package/dist/commands/mrt/project/notification/get.d.ts +31 -0
- package/dist/commands/mrt/project/notification/get.js +86 -0
- package/dist/commands/mrt/project/notification/get.js.map +1 -0
- package/dist/commands/mrt/project/notification/list.d.ts +31 -0
- package/dist/commands/mrt/project/notification/list.js +88 -0
- package/dist/commands/mrt/project/notification/list.js.map +1 -0
- package/dist/commands/mrt/project/notification/update.d.ts +36 -0
- package/dist/commands/mrt/project/notification/update.js +86 -0
- package/dist/commands/mrt/project/notification/update.js.map +1 -0
- package/dist/commands/mrt/project/update.d.ts +34 -0
- package/dist/commands/mrt/project/update.js +123 -0
- package/dist/commands/mrt/project/update.js.map +1 -0
- package/dist/commands/mrt/user/api-key.d.ts +30 -0
- package/dist/commands/mrt/user/api-key.js +63 -0
- package/dist/commands/mrt/user/api-key.js.map +1 -0
- package/dist/commands/mrt/user/email-prefs.d.ts +30 -0
- package/dist/commands/mrt/user/email-prefs.js +83 -0
- package/dist/commands/mrt/user/email-prefs.js.map +1 -0
- package/dist/commands/mrt/user/profile.d.ts +28 -0
- package/dist/commands/mrt/user/profile.js +50 -0
- package/dist/commands/mrt/user/profile.js.map +1 -0
- package/dist/commands/ods/create.d.ts +1 -1
- package/dist/commands/ods/create.js +2 -3
- package/dist/commands/ods/create.js.map +1 -1
- package/dist/commands/ods/delete.js +2 -3
- package/dist/commands/ods/delete.js.map +1 -1
- package/dist/commands/ods/list.d.ts +1 -1
- package/dist/commands/ods/list.js +2 -3
- package/dist/commands/ods/list.js.map +1 -1
- package/dist/commands/ods/restart.d.ts +1 -1
- package/dist/commands/ods/restart.js +2 -3
- package/dist/commands/ods/restart.js.map +1 -1
- package/dist/commands/ods/start.d.ts +1 -1
- package/dist/commands/ods/start.js +2 -3
- package/dist/commands/ods/start.js.map +1 -1
- package/dist/commands/ods/stop.d.ts +1 -1
- package/dist/commands/ods/stop.js +2 -3
- package/dist/commands/ods/stop.js.map +1 -1
- package/dist/commands/scapi/custom/status.js +3 -3
- package/dist/commands/scapi/custom/status.js.map +1 -1
- package/dist/commands/scapi/schemas/get.js +2 -2
- package/dist/commands/scapi/schemas/get.js.map +1 -1
- package/dist/commands/scapi/schemas/list.js +2 -2
- package/dist/commands/scapi/schemas/list.js.map +1 -1
- package/dist/commands/sites/list.js +5 -2
- package/dist/commands/sites/list.js.map +1 -1
- package/dist/commands/slas/client/create.js +1 -1
- package/dist/commands/slas/client/create.js.map +1 -1
- package/dist/commands/slas/client/delete.js +2 -2
- package/dist/commands/slas/client/delete.js.map +1 -1
- package/dist/commands/slas/client/get.js +2 -2
- package/dist/commands/slas/client/get.js.map +1 -1
- package/dist/commands/slas/client/list.js +2 -2
- package/dist/commands/slas/client/list.js.map +1 -1
- package/dist/commands/slas/client/update.js +4 -4
- package/dist/commands/slas/client/update.js.map +1 -1
- package/dist/utils/ecdn/base-command.d.ts +46 -0
- package/dist/utils/ecdn/base-command.js +69 -0
- package/dist/utils/ecdn/base-command.js.map +1 -0
- package/dist/utils/ecdn/index.d.ts +2 -0
- package/dist/utils/ecdn/index.js +8 -0
- package/dist/utils/ecdn/index.js.map +1 -0
- package/dist/utils/ecdn/zone-command.d.ts +42 -0
- package/dist/utils/ecdn/zone-command.js +75 -0
- package/dist/utils/ecdn/zone-command.js.map +1 -0
- package/dist/utils/scapi/schemas.d.ts +1 -1
- package/dist/utils/scapi/schemas.js +3 -3
- package/dist/utils/scapi/schemas.js.map +1 -1
- package/dist/utils/slas/client.d.ts +1 -1
- package/dist/utils/slas/client.js +6 -6
- package/dist/utils/slas/client.js.map +1 -1
- package/oclif.manifest.json +19610 -933
- package/package.json +118 -8
- package/dist/commands/mrt/push.js +0 -125
- package/dist/commands/mrt/push.js.map +0 -1
|
@@ -0,0 +1,86 @@
|
|
|
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, ux } from '@oclif/core';
|
|
7
|
+
import cliui from 'cliui';
|
|
8
|
+
import { MrtCommand } from '@salesforce/b2c-tooling-sdk/cli';
|
|
9
|
+
import { getNotification } from '@salesforce/b2c-tooling-sdk/operations/mrt';
|
|
10
|
+
import { t } from '../../../../i18n/index.js';
|
|
11
|
+
/**
|
|
12
|
+
* Print notification details in a formatted table.
|
|
13
|
+
*/
|
|
14
|
+
function printNotificationDetails(notification, project) {
|
|
15
|
+
const ui = cliui({ width: process.stdout.columns || 80 });
|
|
16
|
+
const labelWidth = 16;
|
|
17
|
+
const events = [];
|
|
18
|
+
if (notification.deployment_start)
|
|
19
|
+
events.push('start');
|
|
20
|
+
if (notification.deployment_success)
|
|
21
|
+
events.push('success');
|
|
22
|
+
if (notification.deployment_failed)
|
|
23
|
+
events.push('failed');
|
|
24
|
+
ui.div('');
|
|
25
|
+
ui.div({ text: 'ID:', width: labelWidth }, { text: notification.id ?? '' });
|
|
26
|
+
ui.div({ text: 'Project:', width: labelWidth }, { text: project });
|
|
27
|
+
ui.div({ text: 'Targets:', width: labelWidth }, { text: notification.targets?.join(', ') ?? '-' });
|
|
28
|
+
ui.div({ text: 'Recipients:', width: labelWidth }, { text: notification.recipients?.join(', ') ?? '-' });
|
|
29
|
+
ui.div({ text: 'Events:', width: labelWidth }, { text: events.join(', ') || '-' });
|
|
30
|
+
if (notification.created_at) {
|
|
31
|
+
ui.div({ text: 'Created:', width: labelWidth }, { text: new Date(notification.created_at).toLocaleString() });
|
|
32
|
+
}
|
|
33
|
+
if (notification.updated_at) {
|
|
34
|
+
ui.div({ text: 'Updated:', width: labelWidth }, { text: new Date(notification.updated_at).toLocaleString() });
|
|
35
|
+
}
|
|
36
|
+
ux.stdout(ui.toString());
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Get details of a notification.
|
|
40
|
+
*/
|
|
41
|
+
export default class MrtNotificationGet extends MrtCommand {
|
|
42
|
+
static args = {
|
|
43
|
+
id: Args.string({
|
|
44
|
+
description: 'Notification ID',
|
|
45
|
+
required: true,
|
|
46
|
+
}),
|
|
47
|
+
};
|
|
48
|
+
static description = t('commands.mrt.notification.get.description', 'Get details of a Managed Runtime notification');
|
|
49
|
+
static enableJsonFlag = true;
|
|
50
|
+
static examples = [
|
|
51
|
+
'<%= config.bin %> <%= command.id %> abc-123 --project my-storefront',
|
|
52
|
+
'<%= config.bin %> <%= command.id %> abc-123 -p my-storefront --json',
|
|
53
|
+
];
|
|
54
|
+
static flags = {
|
|
55
|
+
...MrtCommand.baseFlags,
|
|
56
|
+
};
|
|
57
|
+
async run() {
|
|
58
|
+
this.requireMrtCredentials();
|
|
59
|
+
const { id } = this.args;
|
|
60
|
+
const { mrtProject: project } = this.resolvedConfig.values;
|
|
61
|
+
if (!project) {
|
|
62
|
+
this.error('MRT project is required. Provide --project flag, set SFCC_MRT_PROJECT, or set mrtProject in dw.json.');
|
|
63
|
+
}
|
|
64
|
+
this.log(t('commands.mrt.notification.get.fetching', 'Fetching notification {{id}}...', { id }));
|
|
65
|
+
try {
|
|
66
|
+
const result = await getNotification({
|
|
67
|
+
projectSlug: project,
|
|
68
|
+
notificationId: id,
|
|
69
|
+
origin: this.resolvedConfig.values.mrtOrigin,
|
|
70
|
+
}, this.getMrtAuth());
|
|
71
|
+
if (!this.jsonEnabled()) {
|
|
72
|
+
printNotificationDetails(result, project);
|
|
73
|
+
}
|
|
74
|
+
return result;
|
|
75
|
+
}
|
|
76
|
+
catch (error) {
|
|
77
|
+
if (error instanceof Error) {
|
|
78
|
+
this.error(t('commands.mrt.notification.get.failed', 'Failed to get notification: {{message}}', {
|
|
79
|
+
message: error.message,
|
|
80
|
+
}));
|
|
81
|
+
}
|
|
82
|
+
throw error;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
//# sourceMappingURL=get.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get.js","sourceRoot":"","sources":["../../../../../src/commands/mrt/project/notification/get.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAC,IAAI,EAAE,EAAE,EAAC,MAAM,aAAa,CAAC;AACrC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,UAAU,EAAC,MAAM,iCAAiC,CAAC;AAC3D,OAAO,EAAC,eAAe,EAAuB,MAAM,4CAA4C,CAAC;AACjG,OAAO,EAAC,CAAC,EAAC,MAAM,2BAA2B,CAAC;AAE5C;;GAEG;AACH,SAAS,wBAAwB,CAAC,YAA6B,EAAE,OAAe;IAC9E,MAAM,EAAE,GAAG,KAAK,CAAC,EAAC,KAAK,EAAE,OAAO,CAAC,MAAM,CAAC,OAAO,IAAI,EAAE,EAAC,CAAC,CAAC;IACxD,MAAM,UAAU,GAAG,EAAE,CAAC;IAEtB,MAAM,MAAM,GAAa,EAAE,CAAC;IAC5B,IAAI,YAAY,CAAC,gBAAgB;QAAE,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACxD,IAAI,YAAY,CAAC,kBAAkB;QAAE,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IAC5D,IAAI,YAAY,CAAC,iBAAiB;QAAE,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAE1D,EAAE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cAAc,CAAC,MAAM,CAAC,SAAS;aAC7C,EACD,IAAI,CAAC,UAAU,EAAE,CAClB,CAAC;YAEF,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,EAAE,CAAC;gBACxB,wBAAwB,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;YAC5C,CAAC;YAED,OAAO,MAAM,CAAC;QAChB,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,IAAI,KAAK,YAAY,KAAK,EAAE,CAAC;gBAC3B,IAAI,CAAC,KAAK,CACR,CAAC,CAAC,sCAAsC,EAAE,yCAAyC,EAAE;oBACnF,OAAO,EAAE,KAAK,CAAC,OAAO;iBACvB,CAAC,CACH,CAAC;YACJ,CAAC;YACD,MAAM,KAAK,CAAC;QACd,CAAC;IACH,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { MrtCommand } from '@salesforce/b2c-tooling-sdk/cli';
|
|
2
|
+
import { type ListNotificationsResult } from '@salesforce/b2c-tooling-sdk/operations/mrt';
|
|
3
|
+
/**
|
|
4
|
+
* List notifications for an MRT project.
|
|
5
|
+
*/
|
|
6
|
+
export default class MrtNotificationList extends MrtCommand<typeof MrtNotificationList> {
|
|
7
|
+
static description: string;
|
|
8
|
+
static enableJsonFlag: boolean;
|
|
9
|
+
static examples: string[];
|
|
10
|
+
static flags: {
|
|
11
|
+
limit: import("@oclif/core/interfaces").OptionFlag<number | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
|
+
offset: import("@oclif/core/interfaces").OptionFlag<number | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
13
|
+
target: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
14
|
+
'api-key': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
15
|
+
project: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
16
|
+
environment: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
17
|
+
'cloud-origin': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
18
|
+
'credentials-file': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
19
|
+
'log-level': import("@oclif/core/interfaces").OptionFlag<"trace" | "debug" | "info" | "warn" | "error" | "silent" | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
20
|
+
debug: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
21
|
+
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
22
|
+
lang: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
23
|
+
config: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
24
|
+
instance: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
25
|
+
'working-directory': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
26
|
+
'extra-query': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
27
|
+
'extra-body': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
28
|
+
'extra-headers': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
29
|
+
};
|
|
30
|
+
run(): Promise<ListNotificationsResult>;
|
|
31
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
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 { MrtCommand, createTable } from '@salesforce/b2c-tooling-sdk/cli';
|
|
8
|
+
import { listNotifications, } from '@salesforce/b2c-tooling-sdk/operations/mrt';
|
|
9
|
+
import { t } from '../../../../i18n/index.js';
|
|
10
|
+
const COLUMNS = {
|
|
11
|
+
id: {
|
|
12
|
+
header: 'ID',
|
|
13
|
+
get: (n) => n.id ?? '-',
|
|
14
|
+
},
|
|
15
|
+
targets: {
|
|
16
|
+
header: 'Targets',
|
|
17
|
+
get: (n) => n.targets?.join(', ') ?? '-',
|
|
18
|
+
},
|
|
19
|
+
recipients: {
|
|
20
|
+
header: 'Recipients',
|
|
21
|
+
get: (n) => n.recipients?.join(', ') ?? '-',
|
|
22
|
+
},
|
|
23
|
+
events: {
|
|
24
|
+
header: 'Events',
|
|
25
|
+
get(n) {
|
|
26
|
+
const events = [];
|
|
27
|
+
if (n.deployment_start)
|
|
28
|
+
events.push('start');
|
|
29
|
+
if (n.deployment_success)
|
|
30
|
+
events.push('success');
|
|
31
|
+
if (n.deployment_failed)
|
|
32
|
+
events.push('failed');
|
|
33
|
+
return events.join(', ') || '-';
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
};
|
|
37
|
+
const DEFAULT_COLUMNS = ['id', 'targets', 'recipients', 'events'];
|
|
38
|
+
/**
|
|
39
|
+
* List notifications for an MRT project.
|
|
40
|
+
*/
|
|
41
|
+
export default class MrtNotificationList extends MrtCommand {
|
|
42
|
+
static description = t('commands.mrt.notification.list.description', 'List notifications for a Managed Runtime project');
|
|
43
|
+
static enableJsonFlag = true;
|
|
44
|
+
static examples = [
|
|
45
|
+
'<%= config.bin %> <%= command.id %> --project my-storefront',
|
|
46
|
+
'<%= config.bin %> <%= command.id %> -p my-storefront --target staging',
|
|
47
|
+
'<%= config.bin %> <%= command.id %> -p my-storefront --json',
|
|
48
|
+
];
|
|
49
|
+
static flags = {
|
|
50
|
+
...MrtCommand.baseFlags,
|
|
51
|
+
limit: Flags.integer({
|
|
52
|
+
description: 'Maximum number of results to return',
|
|
53
|
+
}),
|
|
54
|
+
offset: Flags.integer({
|
|
55
|
+
description: 'Offset for pagination',
|
|
56
|
+
}),
|
|
57
|
+
target: Flags.string({
|
|
58
|
+
description: 'Filter by target slug',
|
|
59
|
+
}),
|
|
60
|
+
};
|
|
61
|
+
async run() {
|
|
62
|
+
this.requireMrtCredentials();
|
|
63
|
+
const { mrtProject: project } = this.resolvedConfig.values;
|
|
64
|
+
if (!project) {
|
|
65
|
+
this.error('MRT project is required. Provide --project flag, set SFCC_MRT_PROJECT, or set mrtProject in dw.json.');
|
|
66
|
+
}
|
|
67
|
+
const { limit, offset, target } = this.flags;
|
|
68
|
+
this.log(t('commands.mrt.notification.list.fetching', 'Fetching notifications for {{project}}...', { project }));
|
|
69
|
+
const result = await listNotifications({
|
|
70
|
+
projectSlug: project,
|
|
71
|
+
limit,
|
|
72
|
+
offset,
|
|
73
|
+
targetSlug: target,
|
|
74
|
+
origin: this.resolvedConfig.values.mrtOrigin,
|
|
75
|
+
}, this.getMrtAuth());
|
|
76
|
+
if (!this.jsonEnabled()) {
|
|
77
|
+
if (result.notifications.length === 0) {
|
|
78
|
+
this.log(t('commands.mrt.notification.list.empty', 'No notifications found.'));
|
|
79
|
+
}
|
|
80
|
+
else {
|
|
81
|
+
this.log(t('commands.mrt.notification.list.count', 'Found {{count}} notification(s):', { count: result.count }));
|
|
82
|
+
createTable(COLUMNS).render(result.notifications, DEFAULT_COLUMNS);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
return result;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
//# sourceMappingURL=list.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list.js","sourceRoot":"","sources":["../../../../../src/commands/mrt/project/notification/list.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAC,KAAK,EAAC,MAAM,aAAa,CAAC;AAClC,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AM,CAAC,aAAa,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;gBACtC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,sCAAsC,EAAE,yBAAyB,CAAC,CAAC,CAAC;YACjF,CAAC;iBAAM,CAAC;gBACN,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,sCAAsC,EAAE,kCAAkC,EAAE,EAAC,KAAK,EAAE,MAAM,CAAC,KAAK,EAAC,CAAC,CAAC,CAAC;gBAC/G,WAAW,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,aAAa,EAAE,eAAe,CAAC,CAAC;YACrE,CAAC;QACH,CAAC;QAED,OAAO,MAAM,CAAC;IAChB,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { MrtCommand } from '@salesforce/b2c-tooling-sdk/cli';
|
|
2
|
+
import { type MrtNotification } from '@salesforce/b2c-tooling-sdk/operations/mrt';
|
|
3
|
+
/**
|
|
4
|
+
* Update a notification in an MRT project.
|
|
5
|
+
*/
|
|
6
|
+
export default class MrtNotificationUpdate extends MrtCommand<typeof MrtNotificationUpdate> {
|
|
7
|
+
static args: {
|
|
8
|
+
id: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
|
|
9
|
+
};
|
|
10
|
+
static description: string;
|
|
11
|
+
static enableJsonFlag: boolean;
|
|
12
|
+
static examples: string[];
|
|
13
|
+
static flags: {
|
|
14
|
+
target: import("@oclif/core/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
15
|
+
recipient: import("@oclif/core/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
16
|
+
'on-start': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
17
|
+
'on-success': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
18
|
+
'on-failed': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
19
|
+
'api-key': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
20
|
+
project: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
21
|
+
environment: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
22
|
+
'cloud-origin': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
23
|
+
'credentials-file': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
24
|
+
'log-level': import("@oclif/core/interfaces").OptionFlag<"trace" | "debug" | "info" | "warn" | "error" | "silent" | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
25
|
+
debug: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
26
|
+
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
27
|
+
lang: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
28
|
+
config: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
29
|
+
instance: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
30
|
+
'working-directory': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
31
|
+
'extra-query': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
32
|
+
'extra-body': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
33
|
+
'extra-headers': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
34
|
+
};
|
|
35
|
+
run(): Promise<MrtNotification>;
|
|
36
|
+
}
|
|
@@ -0,0 +1,86 @@
|
|
|
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 { MrtCommand } from '@salesforce/b2c-tooling-sdk/cli';
|
|
8
|
+
import { updateNotification } from '@salesforce/b2c-tooling-sdk/operations/mrt';
|
|
9
|
+
import { t } from '../../../../i18n/index.js';
|
|
10
|
+
/**
|
|
11
|
+
* Update a notification in an MRT project.
|
|
12
|
+
*/
|
|
13
|
+
export default class MrtNotificationUpdate extends MrtCommand {
|
|
14
|
+
static args = {
|
|
15
|
+
id: Args.string({
|
|
16
|
+
description: 'Notification ID',
|
|
17
|
+
required: true,
|
|
18
|
+
}),
|
|
19
|
+
};
|
|
20
|
+
static description = t('commands.mrt.notification.update.description', 'Update a Managed Runtime notification');
|
|
21
|
+
static enableJsonFlag = true;
|
|
22
|
+
static examples = [
|
|
23
|
+
'<%= config.bin %> <%= command.id %> abc-123 --project my-storefront --on-start --on-failed',
|
|
24
|
+
'<%= config.bin %> <%= command.id %> abc-123 -p my-storefront --recipient new-team@example.com',
|
|
25
|
+
];
|
|
26
|
+
static flags = {
|
|
27
|
+
...MrtCommand.baseFlags,
|
|
28
|
+
target: Flags.string({
|
|
29
|
+
char: 't',
|
|
30
|
+
description: 'Target slug to associate with this notification (can be specified multiple times)',
|
|
31
|
+
multiple: true,
|
|
32
|
+
}),
|
|
33
|
+
recipient: Flags.string({
|
|
34
|
+
char: 'r',
|
|
35
|
+
description: 'Email recipient for this notification (can be specified multiple times)',
|
|
36
|
+
multiple: true,
|
|
37
|
+
}),
|
|
38
|
+
'on-start': Flags.boolean({
|
|
39
|
+
description: 'Trigger notification when deployment starts',
|
|
40
|
+
allowNo: true,
|
|
41
|
+
}),
|
|
42
|
+
'on-success': Flags.boolean({
|
|
43
|
+
description: 'Trigger notification when deployment succeeds',
|
|
44
|
+
allowNo: true,
|
|
45
|
+
}),
|
|
46
|
+
'on-failed': Flags.boolean({
|
|
47
|
+
description: 'Trigger notification when deployment fails',
|
|
48
|
+
allowNo: true,
|
|
49
|
+
}),
|
|
50
|
+
};
|
|
51
|
+
async run() {
|
|
52
|
+
this.requireMrtCredentials();
|
|
53
|
+
const { id } = this.args;
|
|
54
|
+
const { mrtProject: project } = this.resolvedConfig.values;
|
|
55
|
+
if (!project) {
|
|
56
|
+
this.error('MRT project is required. Provide --project flag, set SFCC_MRT_PROJECT, or set mrtProject in dw.json.');
|
|
57
|
+
}
|
|
58
|
+
const { target: targets, recipient: recipients, 'on-start': onStart, 'on-success': onSuccess, 'on-failed': onFailed, } = this.flags;
|
|
59
|
+
this.log(t('commands.mrt.notification.update.updating', 'Updating notification {{id}}...', { id }));
|
|
60
|
+
try {
|
|
61
|
+
const result = await updateNotification({
|
|
62
|
+
projectSlug: project,
|
|
63
|
+
notificationId: id,
|
|
64
|
+
targets,
|
|
65
|
+
recipients,
|
|
66
|
+
deploymentStart: onStart,
|
|
67
|
+
deploymentSuccess: onSuccess,
|
|
68
|
+
deploymentFailed: onFailed,
|
|
69
|
+
origin: this.resolvedConfig.values.mrtOrigin,
|
|
70
|
+
}, this.getMrtAuth());
|
|
71
|
+
if (!this.jsonEnabled()) {
|
|
72
|
+
this.log(t('commands.mrt.notification.update.success', 'Notification {{id}} updated.', { id }));
|
|
73
|
+
}
|
|
74
|
+
return result;
|
|
75
|
+
}
|
|
76
|
+
catch (error) {
|
|
77
|
+
if (error instanceof Error) {
|
|
78
|
+
this.error(t('commands.mrt.notification.update.failed', 'Failed to update notification: {{message}}', {
|
|
79
|
+
message: error.message,
|
|
80
|
+
}));
|
|
81
|
+
}
|
|
82
|
+
throw error;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
//# sourceMappingURL=update.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update.js","sourceRoot":"","sources":["../../../../../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I,KAAK,YAAY,KAAK,EAAE,CAAC;gBAC3B,IAAI,CAAC,KAAK,CACR,CAAC,CAAC,yCAAyC,EAAE,4CAA4C,EAAE;oBACzF,OAAO,EAAE,KAAK,CAAC,OAAO;iBACvB,CAAC,CACH,CAAC;YACJ,CAAC;YACD,MAAM,KAAK,CAAC;QACd,CAAC;IACH,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { MrtCommand } from '@salesforce/b2c-tooling-sdk/cli';
|
|
2
|
+
import { type MrtProjectUpdate as MrtProjectUpdateType } from '@salesforce/b2c-tooling-sdk/operations/mrt';
|
|
3
|
+
/**
|
|
4
|
+
* Update an MRT project.
|
|
5
|
+
*/
|
|
6
|
+
export default class MrtProjectUpdate extends MrtCommand<typeof MrtProjectUpdate> {
|
|
7
|
+
static args: {
|
|
8
|
+
slug: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
|
|
9
|
+
};
|
|
10
|
+
static description: string;
|
|
11
|
+
static enableJsonFlag: boolean;
|
|
12
|
+
static examples: string[];
|
|
13
|
+
static flags: {
|
|
14
|
+
name: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
15
|
+
url: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
16
|
+
region: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
17
|
+
'api-key': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
18
|
+
project: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
19
|
+
environment: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
20
|
+
'cloud-origin': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
21
|
+
'credentials-file': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
22
|
+
'log-level': import("@oclif/core/interfaces").OptionFlag<"trace" | "debug" | "info" | "warn" | "error" | "silent" | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
23
|
+
debug: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
24
|
+
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
25
|
+
lang: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
26
|
+
config: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
27
|
+
instance: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
28
|
+
'working-directory': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
29
|
+
'extra-query': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
30
|
+
'extra-body': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
31
|
+
'extra-headers': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
32
|
+
};
|
|
33
|
+
run(): Promise<MrtProjectUpdateType>;
|
|
34
|
+
}
|
|
@@ -0,0 +1,123 @@
|
|
|
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, ux } from '@oclif/core';
|
|
7
|
+
import cliui from 'cliui';
|
|
8
|
+
import { MrtCommand } from '@salesforce/b2c-tooling-sdk/cli';
|
|
9
|
+
import { updateProject } from '@salesforce/b2c-tooling-sdk/operations/mrt';
|
|
10
|
+
import { t } from '../../../i18n/index.js';
|
|
11
|
+
/**
|
|
12
|
+
* Valid AWS regions for MRT projects.
|
|
13
|
+
*/
|
|
14
|
+
const SSR_REGIONS = [
|
|
15
|
+
'us-east-1',
|
|
16
|
+
'us-east-2',
|
|
17
|
+
'us-west-1',
|
|
18
|
+
'us-west-2',
|
|
19
|
+
'ap-south-1',
|
|
20
|
+
'ap-south-2',
|
|
21
|
+
'ap-northeast-2',
|
|
22
|
+
'ap-southeast-1',
|
|
23
|
+
'ap-southeast-2',
|
|
24
|
+
'ap-southeast-3',
|
|
25
|
+
'ap-northeast-1',
|
|
26
|
+
'ap-northeast-3',
|
|
27
|
+
'ca-central-1',
|
|
28
|
+
'eu-central-1',
|
|
29
|
+
'eu-central-2',
|
|
30
|
+
'eu-west-1',
|
|
31
|
+
'eu-west-2',
|
|
32
|
+
'eu-west-3',
|
|
33
|
+
'eu-north-1',
|
|
34
|
+
'eu-south-1',
|
|
35
|
+
'il-central-1',
|
|
36
|
+
'me-central-1',
|
|
37
|
+
'sa-east-1',
|
|
38
|
+
];
|
|
39
|
+
/**
|
|
40
|
+
* Print project details in a formatted display.
|
|
41
|
+
*/
|
|
42
|
+
function printProjectDetails(project) {
|
|
43
|
+
const ui = cliui({ width: process.stdout.columns || 80 });
|
|
44
|
+
const labelWidth = 16;
|
|
45
|
+
ui.div('');
|
|
46
|
+
ui.div({ text: 'Name:', width: labelWidth }, { text: project.name });
|
|
47
|
+
ui.div({ text: 'Slug:', width: labelWidth }, { text: project.slug ?? '' });
|
|
48
|
+
ui.div({ text: 'Organization:', width: labelWidth }, { text: project.organization ?? '' });
|
|
49
|
+
if (project.ssr_region) {
|
|
50
|
+
ui.div({ text: 'Region:', width: labelWidth }, { text: project.ssr_region });
|
|
51
|
+
}
|
|
52
|
+
if (project.url) {
|
|
53
|
+
ui.div({ text: 'URL:', width: labelWidth }, { text: project.url });
|
|
54
|
+
}
|
|
55
|
+
if (project.updated_at) {
|
|
56
|
+
ui.div({ text: 'Updated:', width: labelWidth }, { text: new Date(project.updated_at).toLocaleString() });
|
|
57
|
+
}
|
|
58
|
+
ux.stdout(ui.toString());
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Update an MRT project.
|
|
62
|
+
*/
|
|
63
|
+
export default class MrtProjectUpdate extends MrtCommand {
|
|
64
|
+
static args = {
|
|
65
|
+
slug: Args.string({
|
|
66
|
+
description: 'Project slug',
|
|
67
|
+
required: true,
|
|
68
|
+
}),
|
|
69
|
+
};
|
|
70
|
+
static description = t('commands.mrt.project.update.description', 'Update a Managed Runtime project');
|
|
71
|
+
static enableJsonFlag = true;
|
|
72
|
+
static examples = [
|
|
73
|
+
'<%= config.bin %> <%= command.id %> my-storefront --name "New Name"',
|
|
74
|
+
'<%= config.bin %> <%= command.id %> my-storefront --region eu-west-1',
|
|
75
|
+
'<%= config.bin %> <%= command.id %> my-storefront --url https://example.com',
|
|
76
|
+
];
|
|
77
|
+
static flags = {
|
|
78
|
+
...MrtCommand.baseFlags,
|
|
79
|
+
name: Flags.string({
|
|
80
|
+
char: 'n',
|
|
81
|
+
description: 'New name for the project',
|
|
82
|
+
}),
|
|
83
|
+
url: Flags.string({
|
|
84
|
+
description: 'New URL for the project',
|
|
85
|
+
}),
|
|
86
|
+
region: Flags.string({
|
|
87
|
+
char: 'r',
|
|
88
|
+
description: 'New default AWS region for new environments',
|
|
89
|
+
options: SSR_REGIONS,
|
|
90
|
+
}),
|
|
91
|
+
};
|
|
92
|
+
async run() {
|
|
93
|
+
this.requireMrtCredentials();
|
|
94
|
+
const { slug } = this.args;
|
|
95
|
+
const { name, url, region } = this.flags;
|
|
96
|
+
if (!name && !url && !region) {
|
|
97
|
+
this.error('At least one of --name, --url, or --region must be provided.');
|
|
98
|
+
}
|
|
99
|
+
this.log(t('commands.mrt.project.update.updating', 'Updating project "{{slug}}"...', { slug }));
|
|
100
|
+
try {
|
|
101
|
+
const result = await updateProject({
|
|
102
|
+
projectSlug: slug,
|
|
103
|
+
name,
|
|
104
|
+
url,
|
|
105
|
+
ssrRegion: region,
|
|
106
|
+
origin: this.resolvedConfig.values.mrtOrigin,
|
|
107
|
+
}, this.getMrtAuth());
|
|
108
|
+
if (this.jsonEnabled()) {
|
|
109
|
+
return result;
|
|
110
|
+
}
|
|
111
|
+
this.log(t('commands.mrt.project.update.success', 'Project updated successfully.'));
|
|
112
|
+
printProjectDetails(result);
|
|
113
|
+
return result;
|
|
114
|
+
}
|
|
115
|
+
catch (error) {
|
|
116
|
+
if (error instanceof Error) {
|
|
117
|
+
this.error(t('commands.mrt.project.update.failed', 'Failed to update project: {{message}}', { message: error.message }));
|
|
118
|
+
}
|
|
119
|
+
throw error;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
//# sourceMappingURL=update.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update.js","sourceRoot":"","sources":["../../../../src/commands/mrt/project/update.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAC,IAAI,EAAE,KAAK,EAAE,EAAE,EAAC,MAAM,aAAa,CAAC;AAC5C,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,UAAU,EAAC,MAAM,iCAAiC,CAAC;AAC3D,OAAO,EAAC,aAAa,EAAgD,MAAM,4CAA4C,CAAC;AACxH,OAAO,EAAC,CAAC,EAAC,MAAM,wBAAwB,CAAC;AAEzC;;GAEG;AACH,MAAM,WAAW,GAAG;IAClB,WAAW;IACX,WAAW;IACX,WAAW;IACX,WAAW;IACX,YAAY;IACZ,YAAY;IACZ,gBAAgB;IAChB,gBAAgB;IAChB,gBAAgB;IAChB,gBAAgB;IAChB,gBAAgB;IAChB,gBAAgB;IAChB,cAAc;IACd,cAAc;IACd,cAAc;IACd,WAAW;IACX,WAAW;IACX,WAAW;IACX,YAAY;IACZ,YAAY;IACZ,cAAc;IACd,cAAc;IACd,WAAW;CACH,CAAC;AAIX;;G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AI,CAAC,MAAM,EAAE,CAAC;YAC7B,IAAI,CAAC,KAAK,CAAC,8DAA8D,CAAC,CAAC;QAC7E,CAAC;QAED,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,sCAAsC,EAAE,gCAAgC,EAAE,EAAC,IAAI,EAAC,CAAC,CAAC,CAAC;QAE9F,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,MAAM,aAAa,CAChC;gBACE,WAAW,EAAE,IAAI;gBACjB,IAAI;gBACJ,GAAG;gBACH,SAAS,EAAE,MAA+B;gBAC1C,MAAM,EAAE,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,SAAS;aAC7C,EACD,IAAI,CAAC,UAAU,EAAE,CAClB,CAAC;YAEF,IAAI,IAAI,CAAC,WAAW,EAAE,EAAE,CAAC;gBACvB,OAAO,MAAM,CAAC;YAChB,CAAC;YAED,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,qCAAqC,EAAE,+BAA+B,CAAC,CAAC,CAAC;YACpF,mBAAmB,CAAC,MAAM,CAAC,CAAC;YAE5B,OAAO,MAAM,CAAC;QAChB,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,IAAI,KAAK,YAAY,KAAK,EAAE,CAAC;gBAC3B,IAAI,CAAC,KAAK,CACR,CAAC,CAAC,oCAAoC,EAAE,uCAAuC,EAAE,EAAC,OAAO,EAAE,KAAK,CAAC,OAAO,EAAC,CAAC,CAC3G,CAAC;YACJ,CAAC;YACD,MAAM,KAAK,CAAC;QACd,CAAC;IACH,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { MrtCommand } from '@salesforce/b2c-tooling-sdk/cli';
|
|
2
|
+
import { type ApiKeyResult } from '@salesforce/b2c-tooling-sdk/operations/mrt';
|
|
3
|
+
/**
|
|
4
|
+
* Reset the current user's API key.
|
|
5
|
+
*/
|
|
6
|
+
export default class MrtUserApiKey extends MrtCommand<typeof MrtUserApiKey> {
|
|
7
|
+
static description: string;
|
|
8
|
+
static enableJsonFlag: boolean;
|
|
9
|
+
static examples: string[];
|
|
10
|
+
static flags: {
|
|
11
|
+
yes: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
12
|
+
'api-key': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
13
|
+
project: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
14
|
+
environment: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
15
|
+
'cloud-origin': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
16
|
+
'credentials-file': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
17
|
+
'log-level': import("@oclif/core/interfaces").OptionFlag<"trace" | "debug" | "info" | "warn" | "error" | "silent" | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
18
|
+
debug: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
19
|
+
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
20
|
+
lang: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
21
|
+
config: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
22
|
+
instance: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
23
|
+
'working-directory': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
24
|
+
'extra-query': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
25
|
+
'extra-body': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
26
|
+
'extra-headers': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
27
|
+
};
|
|
28
|
+
run(): Promise<ApiKeyResult>;
|
|
29
|
+
private confirm;
|
|
30
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
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 * as readline from 'node:readline';
|
|
8
|
+
import { MrtCommand } from '@salesforce/b2c-tooling-sdk/cli';
|
|
9
|
+
import { resetApiKey } from '@salesforce/b2c-tooling-sdk/operations/mrt';
|
|
10
|
+
import { t } from '../../../i18n/index.js';
|
|
11
|
+
/**
|
|
12
|
+
* Reset the current user's API key.
|
|
13
|
+
*/
|
|
14
|
+
export default class MrtUserApiKey extends MrtCommand {
|
|
15
|
+
static description = t('commands.mrt.user.api-key.description', 'Reset the API key for the current user (invalidates current key)');
|
|
16
|
+
static enableJsonFlag = true;
|
|
17
|
+
static examples = [
|
|
18
|
+
'<%= config.bin %> <%= command.id %>',
|
|
19
|
+
'<%= config.bin %> <%= command.id %> --yes',
|
|
20
|
+
'<%= config.bin %> <%= command.id %> --json',
|
|
21
|
+
];
|
|
22
|
+
static flags = {
|
|
23
|
+
...MrtCommand.baseFlags,
|
|
24
|
+
yes: Flags.boolean({
|
|
25
|
+
char: 'y',
|
|
26
|
+
description: 'Skip confirmation prompt',
|
|
27
|
+
default: false,
|
|
28
|
+
}),
|
|
29
|
+
};
|
|
30
|
+
async run() {
|
|
31
|
+
this.requireMrtCredentials();
|
|
32
|
+
const { yes } = this.flags;
|
|
33
|
+
if (!yes && !this.jsonEnabled()) {
|
|
34
|
+
const confirmed = await this.confirm(t('commands.mrt.user.api-key.confirm', 'Warning: This will invalidate your current API key.\nAre you sure you want to reset your API key? (yes/no): '));
|
|
35
|
+
if (!confirmed) {
|
|
36
|
+
this.error('API key reset cancelled.');
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
this.log(t('commands.mrt.user.api-key.resetting', 'Resetting API key...'));
|
|
40
|
+
const result = await resetApiKey({
|
|
41
|
+
origin: this.resolvedConfig.values.mrtOrigin,
|
|
42
|
+
}, this.getMrtAuth());
|
|
43
|
+
if (!this.jsonEnabled()) {
|
|
44
|
+
this.log(t('commands.mrt.user.api-key.success', 'API key has been reset successfully.'));
|
|
45
|
+
this.log(t('commands.mrt.user.api-key.new-key', '\nNew API key: {{apiKey}}', { apiKey: result.api_key }));
|
|
46
|
+
this.log(t('commands.mrt.user.api-key.warning', '\nIMPORTANT: Please update your stored API key immediately. The old key is now invalid.'));
|
|
47
|
+
}
|
|
48
|
+
return result;
|
|
49
|
+
}
|
|
50
|
+
async confirm(message) {
|
|
51
|
+
const rl = readline.createInterface({
|
|
52
|
+
input: process.stdin,
|
|
53
|
+
output: process.stdout,
|
|
54
|
+
});
|
|
55
|
+
return new Promise((resolve) => {
|
|
56
|
+
rl.question(message, (answer) => {
|
|
57
|
+
rl.close();
|
|
58
|
+
resolve(answer.toLowerCase() === 'yes' || answer.toLowerCase() === 'y');
|
|
59
|
+
});
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=api-key.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-key.js","sourceRoot":"","sources":["../../../../src/commands/mrt/user/api-key.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAC,KAAK,EAAC,MAAM,aAAa,CAAC;AAClC,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAC,UAAU,EAAC,MAAM,iCAAiC,CAAC;AAC3D,OAAO,EAAC,WAAW,EAAoB,MAAM,4CAA4C,CAAC;AAC1F,OAAO,EAAC,CAAC,EAAC,MAAM,wBAAwB,CAAC;AAEzC;;GAE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