@salesforce/b2c-cli 1.14.1 → 1.16.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/cip/report/bot-traffic-share.d.ts +42 -0
- package/dist/commands/cip/report/bot-traffic-share.js +24 -0
- package/dist/commands/cip/report/bot-traffic-share.js.map +1 -0
- package/dist/commands/cip/report/checkout-funnel-dropoff.d.ts +42 -0
- package/dist/commands/cip/report/checkout-funnel-dropoff.js +24 -0
- package/dist/commands/cip/report/checkout-funnel-dropoff.js.map +1 -0
- package/dist/commands/cip/report/controller-error-rate-trend.d.ts +42 -0
- package/dist/commands/cip/report/controller-error-rate-trend.js +24 -0
- package/dist/commands/cip/report/controller-error-rate-trend.js.map +1 -0
- package/dist/commands/cip/report/controller-health-scorecard.d.ts +42 -0
- package/dist/commands/cip/report/controller-health-scorecard.js +24 -0
- package/dist/commands/cip/report/controller-health-scorecard.js.map +1 -0
- package/dist/commands/cip/report/customer-registration-trends.d.ts +4 -2
- package/dist/commands/cip/report/customer-registration-trends.js +8 -6
- package/dist/commands/cip/report/customer-registration-trends.js.map +1 -1
- package/dist/commands/cip/report/discount-depth-breakdown.d.ts +42 -0
- package/dist/commands/cip/report/discount-depth-breakdown.js +24 -0
- package/dist/commands/cip/report/discount-depth-breakdown.js.map +1 -0
- package/dist/commands/cip/report/inventory-stockout-by-location.d.ts +42 -0
- package/dist/commands/cip/report/inventory-stockout-by-location.js +24 -0
- package/dist/commands/cip/report/inventory-stockout-by-location.js.map +1 -0
- package/dist/commands/cip/report/list.d.ts +29 -0
- package/dist/commands/cip/report/list.js +89 -0
- package/dist/commands/cip/report/list.js.map +1 -0
- package/dist/commands/cip/report/new-vs-returning-buyer-revenue.d.ts +42 -0
- package/dist/commands/cip/report/new-vs-returning-buyer-revenue.js +24 -0
- package/dist/commands/cip/report/new-vs-returning-buyer-revenue.js.map +1 -0
- package/dist/commands/cip/report/ocapi-client-usage.d.ts +42 -0
- package/dist/commands/cip/report/ocapi-client-usage.js +24 -0
- package/dist/commands/cip/report/ocapi-client-usage.js.map +1 -0
- package/dist/commands/cip/report/ocapi-requests.d.ts +4 -2
- package/dist/commands/cip/report/ocapi-requests.js +8 -6
- package/dist/commands/cip/report/ocapi-requests.js.map +1 -1
- package/dist/commands/cip/report/payment-method-performance.d.ts +4 -2
- package/dist/commands/cip/report/payment-method-performance.js +8 -6
- package/dist/commands/cip/report/payment-method-performance.js.map +1 -1
- package/dist/commands/cip/report/product-co-purchase-analysis.d.ts +4 -2
- package/dist/commands/cip/report/product-co-purchase-analysis.js +8 -6
- package/dist/commands/cip/report/product-co-purchase-analysis.js.map +1 -1
- package/dist/commands/cip/report/promotion-discount-analysis.d.ts +4 -1
- package/dist/commands/cip/report/promotion-discount-analysis.js +8 -4
- package/dist/commands/cip/report/promotion-discount-analysis.js.map +1 -1
- package/dist/commands/cip/report/promotion-roi-leaderboard.d.ts +42 -0
- package/dist/commands/cip/report/promotion-roi-leaderboard.js +24 -0
- package/dist/commands/cip/report/promotion-roi-leaderboard.js.map +1 -0
- package/dist/commands/cip/report/recommender-effectiveness.d.ts +42 -0
- package/dist/commands/cip/report/recommender-effectiveness.js +24 -0
- package/dist/commands/cip/report/recommender-effectiveness.js.map +1 -0
- package/dist/commands/cip/report/remote-include-performance.d.ts +42 -0
- package/dist/commands/cip/report/remote-include-performance.js +24 -0
- package/dist/commands/cip/report/remote-include-performance.js.map +1 -0
- package/dist/commands/cip/report/revenue-by-channel.d.ts +42 -0
- package/dist/commands/cip/report/revenue-by-channel.js +24 -0
- package/dist/commands/cip/report/revenue-by-channel.js.map +1 -0
- package/dist/commands/cip/report/sales-analytics.d.ts +4 -2
- package/dist/commands/cip/report/sales-analytics.js +8 -6
- package/dist/commands/cip/report/sales-analytics.js.map +1 -1
- package/dist/commands/cip/report/sales-summary.d.ts +4 -2
- package/dist/commands/cip/report/sales-summary.js +8 -6
- package/dist/commands/cip/report/sales-summary.js.map +1 -1
- package/dist/commands/cip/report/scapi-cache-hit-ratio.d.ts +42 -0
- package/dist/commands/cip/report/scapi-cache-hit-ratio.js +24 -0
- package/dist/commands/cip/report/scapi-cache-hit-ratio.js.map +1 -0
- package/dist/commands/cip/report/scapi-error-rate-by-status.d.ts +42 -0
- package/dist/commands/cip/report/scapi-error-rate-by-status.js +24 -0
- package/dist/commands/cip/report/scapi-error-rate-by-status.js.map +1 -0
- package/dist/commands/cip/report/scapi-latency-distribution.d.ts +42 -0
- package/dist/commands/cip/report/scapi-latency-distribution.js +24 -0
- package/dist/commands/cip/report/scapi-latency-distribution.js.map +1 -0
- package/dist/commands/cip/report/scapi-traffic-latency.d.ts +42 -0
- package/dist/commands/cip/report/scapi-traffic-latency.js +24 -0
- package/dist/commands/cip/report/scapi-traffic-latency.js.map +1 -0
- package/dist/commands/cip/report/search-query-performance.d.ts +4 -3
- package/dist/commands/cip/report/search-query-performance.js +8 -19
- package/dist/commands/cip/report/search-query-performance.js.map +1 -1
- package/dist/commands/cip/report/top-referrers.d.ts +4 -3
- package/dist/commands/cip/report/top-referrers.js +8 -7
- package/dist/commands/cip/report/top-referrers.js.map +1 -1
- package/dist/commands/cip/report/top-selling-products.d.ts +4 -2
- package/dist/commands/cip/report/top-selling-products.js +8 -6
- package/dist/commands/cip/report/top-selling-products.js.map +1 -1
- package/dist/commands/cip/report/zero-result-searches.d.ts +42 -0
- package/dist/commands/cip/report/zero-result-searches.js +24 -0
- package/dist/commands/cip/report/zero-result-searches.js.map +1 -0
- package/dist/commands/setup/inspect.js +1 -1
- package/dist/commands/setup/inspect.js.map +1 -1
- package/dist/commands/setup/skills.js +5 -3
- package/dist/commands/setup/skills.js.map +1 -1
- package/dist/i18n/locales/en.js +3 -2
- package/dist/i18n/locales/en.js.map +1 -1
- package/dist/utils/cip/report-command.d.ts +7 -1
- package/dist/utils/cip/report-command.js +36 -0
- package/dist/utils/cip/report-command.js.map +1 -1
- package/dist/utils/cip/report-flags.d.ts +17 -2
- package/dist/utils/cip/report-flags.js +70 -0
- package/dist/utils/cip/report-flags.js.map +1 -1
- package/oclif.manifest.json +9081 -2672
- package/package.json +5 -5
|
@@ -4,6 +4,11 @@
|
|
|
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 { Flags } from '@oclif/core';
|
|
7
|
+
import { getCipReportByName } from '@salesforce/b2c-tooling-sdk';
|
|
8
|
+
/** Converts a camelCase report parameter name to its kebab-case CLI flag name. */
|
|
9
|
+
export function paramNameToFlag(name) {
|
|
10
|
+
return name.replaceAll(/[A-Z]/gu, (match) => `-${match.toLowerCase()}`);
|
|
11
|
+
}
|
|
7
12
|
export function createSiteIdFlag(options = {}) {
|
|
8
13
|
return Flags.string({
|
|
9
14
|
description: 'Site ID parameter for CIP report filters',
|
|
@@ -20,4 +25,69 @@ export function createLimitFlag(options = {}) {
|
|
|
20
25
|
required: false,
|
|
21
26
|
});
|
|
22
27
|
}
|
|
28
|
+
/**
|
|
29
|
+
* Maps a single report parameter definition to an oclif flag.
|
|
30
|
+
*
|
|
31
|
+
* `from`/`to` are intentionally skipped because they are already provided by
|
|
32
|
+
* {@link CipCommand.baseFlags}; callers should exclude them. Number params become
|
|
33
|
+
* range-checked integer flags, enum params become string flags with `options`, and
|
|
34
|
+
* `multiple` params accept repeated values.
|
|
35
|
+
*/
|
|
36
|
+
function paramToFlag(parameter) {
|
|
37
|
+
// Report params are intentionally NOT marked oclif-required even when the catalog
|
|
38
|
+
// marks them required: the SDK's validateReportParams enforces required-ness when
|
|
39
|
+
// building SQL, and `--describe` / metadata flows must run without supplying them.
|
|
40
|
+
// Making them oclif-required would break `cip report <name> --describe`.
|
|
41
|
+
const common = {
|
|
42
|
+
description: parameter.description,
|
|
43
|
+
helpGroup: 'QUERY',
|
|
44
|
+
required: false,
|
|
45
|
+
};
|
|
46
|
+
if (parameter.type === 'number') {
|
|
47
|
+
return Flags.integer({
|
|
48
|
+
...common,
|
|
49
|
+
...(parameter.min === undefined ? {} : { min: parameter.min }),
|
|
50
|
+
...(parameter.max === undefined ? {} : { max: parameter.max }),
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
// string / boolean / date all surface as string flags; the SDK validates and
|
|
54
|
+
// escapes the value when building SQL. Enum params constrain to their options.
|
|
55
|
+
const options = parameter.options && parameter.options.length > 0 ? parameter.options : undefined;
|
|
56
|
+
if (parameter.multiple) {
|
|
57
|
+
return Flags.string({ ...common, multiple: true, ...(options ? { options } : {}) });
|
|
58
|
+
}
|
|
59
|
+
return Flags.string({ ...common, ...(options ? { options } : {}) });
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Builds the oclif flag map for a report's own parameters from its catalog
|
|
63
|
+
* definition, excluding `from`/`to` which are handled by the base command. `siteId`
|
|
64
|
+
* is mapped to the shared `--site-id` flag. Returns flags keyed by kebab-cased name.
|
|
65
|
+
*/
|
|
66
|
+
export function buildReportFlags(report) {
|
|
67
|
+
const flags = {};
|
|
68
|
+
for (const parameter of report.parameters) {
|
|
69
|
+
if (parameter.name === 'from' || parameter.name === 'to') {
|
|
70
|
+
continue;
|
|
71
|
+
}
|
|
72
|
+
if (parameter.name === 'siteId') {
|
|
73
|
+
// Not oclif-required; the SDK validates required-ness at SQL-build time so
|
|
74
|
+
// `--describe` works without a site id (matches the historical behavior).
|
|
75
|
+
flags['site-id'] = createSiteIdFlag({ required: false });
|
|
76
|
+
continue;
|
|
77
|
+
}
|
|
78
|
+
flags[paramNameToFlag(parameter.name)] = paramToFlag(parameter);
|
|
79
|
+
}
|
|
80
|
+
return flags;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Resolves a report definition by name or throws — used by per-command files at
|
|
84
|
+
* module load to fail loudly if a report name does not exist in the catalog.
|
|
85
|
+
*/
|
|
86
|
+
export function requireReport(reportName) {
|
|
87
|
+
const report = getCipReportByName(reportName);
|
|
88
|
+
if (!report) {
|
|
89
|
+
throw new Error(`Unknown CIP report referenced by command: ${reportName}`);
|
|
90
|
+
}
|
|
91
|
+
return report;
|
|
92
|
+
}
|
|
23
93
|
//# sourceMappingURL=report-flags.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"report-flags.js","sourceRoot":"","sources":["../../../src/utils/cip/report-flags.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAC,KAAK,
|
|
1
|
+
{"version":3,"file":"report-flags.js","sourceRoot":"","sources":["../../../src/utils/cip/report-flags.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAC,KAAK,EAAkB,MAAM,aAAa,CAAC;AACnD,OAAO,EAAC,kBAAkB,EAA0D,MAAM,6BAA6B,CAAC;AAWxH,kFAAkF;AAClF,MAAM,UAAU,eAAe,CAAC,IAAY;IAC1C,OAAO,IAAI,CAAC,UAAU,CAAC,SAAS,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,KAAK,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC;AAC1E,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,UAA6B,EAAE;IAC9D,OAAO,KAAK,CAAC,MAAM,CAAC;QAClB,WAAW,EAAE,0CAA0C;QACvD,SAAS,EAAE,OAAO;QAClB,QAAQ,EAAE,OAAO,CAAC,QAAQ,IAAI,KAAK;KACpC,CAAC,CAAC;AACL,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,UAA4B,EAAE;IAC5D,OAAO,KAAK,CAAC,OAAO,CAAC;QACnB,WAAW,EAAE,wBAAwB;QACrC,SAAS,EAAE,OAAO;QAClB,GAAG,EAAE,OAAO,CAAC,GAAG,IAAI,GAAG;QACvB,GAAG,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;QACrB,QAAQ,EAAE,KAAK;KAChB,CAAC,CAAC;AACL,CAAC;AAED;;;;;;;GAOG;AACH,SAAS,WAAW,CAAC,SAAmC;IACtD,kFAAkF;IAClF,kFAAkF;IAClF,mFAAmF;IACnF,yEA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