@salesforce/b2c-tooling-sdk 1.17.0 → 1.19.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.
Files changed (94) hide show
  1. package/data/content-schemas/componenttype.json +79 -17
  2. package/data/content-schemas/pagetype.json +4 -0
  3. package/data/guides/enrichment.json +11264 -0
  4. package/data/guides/index.json +15166 -0
  5. package/data/job-steps/index.json +71 -1
  6. package/data/job-steps/job-steps.json +1 -1
  7. package/data/script-api/index.json +2145 -37
  8. package/data/tooling/index.json +222 -0
  9. package/data/xsd/index.json +1 -1
  10. package/dist/esm/auth/client-credentials.d.ts +27 -0
  11. package/dist/esm/auth/client-credentials.js +60 -0
  12. package/dist/esm/auth/client-credentials.js.map +1 -0
  13. package/dist/esm/auth/index.d.ts +1 -0
  14. package/dist/esm/auth/index.js +2 -0
  15. package/dist/esm/auth/index.js.map +1 -1
  16. package/dist/esm/auth/oauth.js +2 -1
  17. package/dist/esm/auth/oauth.js.map +1 -1
  18. package/dist/esm/cli/base-command.d.ts +40 -0
  19. package/dist/esm/cli/base-command.js +66 -5
  20. package/dist/esm/cli/base-command.js.map +1 -1
  21. package/dist/esm/cli/index.d.ts +2 -2
  22. package/dist/esm/cli/index.js +1 -1
  23. package/dist/esm/cli/index.js.map +1 -1
  24. package/dist/esm/cli/instance-command.d.ts +1 -1
  25. package/dist/esm/cli/instance-command.js +5 -3
  26. package/dist/esm/cli/instance-command.js.map +1 -1
  27. package/dist/esm/cli/oauth-command.d.ts +1 -1
  28. package/dist/esm/cli/oauth-command.js +5 -3
  29. package/dist/esm/cli/oauth-command.js.map +1 -1
  30. package/dist/esm/cli/ods-command.d.ts +1 -1
  31. package/dist/esm/cli/webdav-command.d.ts +1 -1
  32. package/dist/esm/clients/index.d.ts +2 -0
  33. package/dist/esm/clients/index.js +1 -0
  34. package/dist/esm/clients/index.js.map +1 -1
  35. package/dist/esm/clients/metrics.d.ts +123 -0
  36. package/dist/esm/clients/metrics.generated.d.ts +1016 -0
  37. package/dist/esm/clients/metrics.generated.js +6 -0
  38. package/dist/esm/clients/metrics.generated.js.map +1 -0
  39. package/dist/esm/clients/metrics.js +65 -0
  40. package/dist/esm/clients/metrics.js.map +1 -0
  41. package/dist/esm/clients/middleware-registry.d.ts +1 -1
  42. package/dist/esm/clients/middleware-registry.js.map +1 -1
  43. package/dist/esm/config/sources/env-source.js +1 -0
  44. package/dist/esm/config/sources/env-source.js.map +1 -1
  45. package/dist/esm/discovery/detector.d.ts +0 -5
  46. package/dist/esm/discovery/detector.js +24 -3
  47. package/dist/esm/discovery/detector.js.map +1 -1
  48. package/dist/esm/discovery/index.d.ts +1 -0
  49. package/dist/esm/discovery/index.js +1 -0
  50. package/dist/esm/discovery/index.js.map +1 -1
  51. package/dist/esm/discovery/patterns/index.d.ts +4 -2
  52. package/dist/esm/discovery/patterns/index.js +9 -3
  53. package/dist/esm/discovery/patterns/index.js.map +1 -1
  54. package/dist/esm/discovery/patterns/pwa-kit.d.ts +12 -0
  55. package/dist/esm/discovery/patterns/pwa-kit.js +18 -7
  56. package/dist/esm/discovery/patterns/pwa-kit.js.map +1 -1
  57. package/dist/esm/discovery/patterns/sfra.d.ts +5 -4
  58. package/dist/esm/discovery/patterns/sfra.js +1 -1
  59. package/dist/esm/discovery/patterns/sfra.js.map +1 -1
  60. package/dist/esm/discovery/patterns/storefront-next.js +18 -2
  61. package/dist/esm/discovery/patterns/storefront-next.js.map +1 -1
  62. package/dist/esm/discovery/types.d.ts +13 -4
  63. package/dist/esm/discovery/types.js +11 -1
  64. package/dist/esm/discovery/types.js.map +1 -1
  65. package/dist/esm/docs/index.d.ts +3 -3
  66. package/dist/esm/docs/index.js +1 -1
  67. package/dist/esm/docs/index.js.map +1 -1
  68. package/dist/esm/docs/search.d.ts +111 -38
  69. package/dist/esm/docs/search.js +402 -81
  70. package/dist/esm/docs/search.js.map +1 -1
  71. package/dist/esm/docs/types.d.ts +56 -6
  72. package/dist/esm/docs/types.js +2 -0
  73. package/dist/esm/docs/types.js.map +1 -1
  74. package/dist/esm/index.d.ts +4 -2
  75. package/dist/esm/index.js +3 -1
  76. package/dist/esm/index.js.map +1 -1
  77. package/dist/esm/operations/logs/filter.d.ts +6 -1
  78. package/dist/esm/operations/logs/filter.js +7 -2
  79. package/dist/esm/operations/logs/filter.js.map +1 -1
  80. package/dist/esm/operations/metrics/index.d.ts +371 -0
  81. package/dist/esm/operations/metrics/index.js +478 -0
  82. package/dist/esm/operations/metrics/index.js.map +1 -0
  83. package/dist/esm/operations/metrics/tags.d.ts +148 -0
  84. package/dist/esm/operations/metrics/tags.js +235 -0
  85. package/dist/esm/operations/metrics/tags.js.map +1 -0
  86. package/dist/esm/slas/token.d.ts +9 -2
  87. package/dist/esm/slas/token.js +25 -29
  88. package/dist/esm/slas/token.js.map +1 -1
  89. package/dist/esm/telemetry/telemetry.d.ts +1 -0
  90. package/dist/esm/telemetry/telemetry.js +32 -0
  91. package/dist/esm/telemetry/telemetry.js.map +1 -1
  92. package/dist/esm/telemetry/types.d.ts +6 -0
  93. package/package.json +12 -3
  94. package/specs/metrics-v1.json +1713 -0
@@ -1,17 +1,67 @@
1
1
  export declare const SCRIPT_API_DATA_DIR: string;
2
2
  export declare const XSD_DATA_DIR: string;
3
3
  export declare const JOB_STEPS_DATA_DIR: string;
4
+ export declare const GUIDES_DATA_DIR: string;
5
+ export declare const TOOLING_DATA_DIR: string;
6
+ /**
7
+ * The corpus a documentation entry belongs to. Used to tag and filter results
8
+ * so agents can narrow a search to a documentation set (e.g., only Storefront
9
+ * Next guides, or only the Script API reference).
10
+ *
11
+ * - `script-api` — B2C Commerce Script API class/module reference
12
+ * - `job-step` — standard (system) job step reference
13
+ * - `commerce-api` / `pwa-kit-managed-runtime` / `sfnext` / `sfra` / `b2c-commerce`
14
+ * — Developer Center prose guides, one category per Developer Center project
15
+ * - `tooling` — this project's own conceptual guides (CLI/MCP/SDK usage)
16
+ */
17
+ export type DocCategory = 'script-api' | 'job-step' | 'commerce-api' | 'pwa-kit-managed-runtime' | 'sfnext' | 'sfra' | 'b2c-commerce' | 'tooling';
4
18
  /**
5
19
  * A documentation entry in the search index.
20
+ *
21
+ * Entries span multiple corpora (Script API reference, job steps, Developer
22
+ * Center guides, and this project's own docs). Reference entries are bundled
23
+ * on disk and read via {@link DocEntry.filePath}; guide entries are indexed
24
+ * locally but their full content is fetched on demand from {@link DocEntry.url}.
6
25
  */
7
26
  export interface DocEntry {
8
- /** Unique identifier - the filename without .md extension (e.g., "dw.catalog.ProductMgr") */
27
+ /**
28
+ * Unique identifier. For bundled reference this is the filename without its
29
+ * extension (e.g., "dw.catalog.ProductMgr"); for guides it is namespaced by
30
+ * category to avoid cross-corpus collisions (e.g., "sfnext/sfnext-get-started").
31
+ */
9
32
  id: string;
10
- /** The title from the document heading (e.g., "Class ProductMgr") */
33
+ /** The title from the document's first heading (e.g., "Class ProductMgr"). */
11
34
  title: string;
12
- /** The filename (e.g., "dw.catalog.ProductMgr.md") */
13
- filePath: string;
14
- /** Optional preview/excerpt from the document */
35
+ /** The corpus/category this entry belongs to. */
36
+ category?: DocCategory;
37
+ /**
38
+ * Path of the bundled markdown file relative to its corpus data directory.
39
+ * Present for entries whose content ships in the package; absent for entries
40
+ * whose content is fetched online (see {@link DocEntry.sourceUrl}).
41
+ */
42
+ filePath?: string;
43
+ /**
44
+ * Canonical human-facing published URL (the rendered `.html` page, e.g. on
45
+ * developer.salesforce.com). This is the durable link to cite/open in a
46
+ * browser. Present for every corpus that has a public page (guides, Script
47
+ * API reference, tooling); absent for corpora with no public page (job steps).
48
+ */
49
+ url?: string;
50
+ /**
51
+ * The raw-markdown (`.md`) URL for the same document — the machine-readable
52
+ * source. For online-only entries (guides) this is what {@link readEntryContent}
53
+ * fetches at read time. Bundled corpora (Script API, tooling) also carry it so
54
+ * callers can retrieve the raw source on request even though content ships in
55
+ * the package. Absent for corpora with no public page (job steps).
56
+ */
57
+ sourceUrl?: string;
58
+ /** Section headings joined into a single searchable string (indexed, not for display). */
59
+ headings?: string;
60
+ /** One-line summary describing what task/topic the doc helps with (agent triage). */
61
+ summary?: string;
62
+ /** Search keywords/synonyms an agent or developer might use to find this doc. */
63
+ keywords?: string[];
64
+ /** Optional preview/excerpt from the document. */
15
65
  preview?: string;
16
66
  }
17
67
  /**
@@ -31,7 +81,7 @@ export interface SearchIndex {
31
81
  export interface SearchResult {
32
82
  /** The matching documentation entry */
33
83
  entry: DocEntry;
34
- /** Match score (lower is better in Fuse.js, 0 = perfect match) */
84
+ /** Relevance score (higher is better; scale is engine-relative, not normalized). */
35
85
  score: number;
36
86
  }
37
87
  /**
@@ -13,4 +13,6 @@ const packageRoot = path.dirname(require.resolve('@salesforce/b2c-tooling-sdk/pa
13
13
  export const SCRIPT_API_DATA_DIR = path.join(packageRoot, 'data/script-api');
14
14
  export const XSD_DATA_DIR = path.join(packageRoot, 'data/xsd');
15
15
  export const JOB_STEPS_DATA_DIR = path.join(packageRoot, 'data/job-steps');
16
+ export const GUIDES_DATA_DIR = path.join(packageRoot, 'data/guides');
17
+ export const TOOLING_DATA_DIR = path.join(packageRoot, 'data/tooling');
16
18
  //# sourceMappingURL=types.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/docs/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAC,aAAa,EAAC,MAAM,aAAa,CAAC;AAE1C,qDAAqD;AACrD,wEAAwE;AACxE,iEAAiE;AACjE,MAAM,OAAO,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC/C,MAAM,WAAW,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,0CAA0C,CAAC,CAAC,CAAC;AAE9F,MAAM,CAAC,MAAM,mBAAmB,GAAG,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,iBAAiB,CAAC,CAAC;AAC7E,MAAM,CAAC,MAAM,YAAY,GAAG,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,UAAU,CAAC,CAAC;AAC/D,MAAM,CAAC,MAAM,kBAAkB,GAAG,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,gBAAgB,CAAC,CAAC"}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/docs/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAC,aAAa,EAAC,MAAM,aAAa,CAAC;AAE1C,qDAAqD;AACrD,wEAAwE;AACxE,iEAAiE;AACjE,MAAM,OAAO,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC/C,MAAM,WAAW,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,0CAA0C,CAAC,CAAC,CAAC;AAE9F,MAAM,CAAC,MAAM,mBAAmB,GAAG,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,iBAAiB,CAAC,CAAC;AAC7E,MAAM,CAAC,MAAM,YAAY,GAAG,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,UAAU,CAAC,CAAC;AAC/D,MAAM,CAAC,MAAM,kBAAkB,GAAG,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,gBAAgB,CAAC,CAAC;AAC3E,MAAM,CAAC,MAAM,eAAe,GAAG,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,aAAa,CAAC,CAAC;AACrE,MAAM,CAAC,MAAM,gBAAgB,GAAG,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,cAAc,CAAC,CAAC"}
@@ -8,8 +8,8 @@ export { BasicAuthStrategy, OAuthStrategy, ImplicitOAuthStrategy, JwtOAuthStrate
8
8
  export type { AuthStrategy, AccessTokenResponse, DecodedJWT, OAuthConfig, ImplicitOAuthConfig, JwtOAuthConfig, AuthConfig, BasicAuthConfig, OAuthAuthConfig, ApiKeyAuthConfig, AuthMethod, AuthCredentials, ResolveAuthStrategyOptions, AvailableAuthMethods, } from './auth/index.js';
9
9
  export { B2CInstance } from './instance/index.js';
10
10
  export type { InstanceConfig } from './instance/index.js';
11
- export { WebDavClient, createOcapiClient, createAuthMiddleware, createExtraParamsMiddleware, createSlasClient, createOdsClient, createCustomApisClient, createAccountManagerUsersClient, createAccountManagerRolesClient, createAccountManagerApiClientsClient, createAccountManagerOrgsClient, createCdnZonesClient, createGranularReplicationsClient, createCipClient, toOrganizationId, normalizeTenantId, buildTenantScope, getApiErrorMessage, isValidRoleTenantFilter, fetchRoleMapping, resolveToInternalRole, resolveFromInternalRole, ORGANIZATION_ID_PREFIX, ROLE_TENANT_FILTER_PATTERN, SCAPI_TENANT_SCOPE_PREFIX, CUSTOM_APIS_DEFAULT_SCOPES, CDN_ZONES_READ_SCOPES, CDN_ZONES_RW_SCOPES, DEFAULT_CIP_HOST, DEFAULT_CIP_STAGING_HOST, } from './clients/index.js';
12
- export type { PropfindEntry, ExtraParamsConfig, OcapiClient, OcapiError, OcapiResponse, OcapiPaths, OcapiComponents, SlasClient, SlasClientConfig, SlasError, SlasResponse, SlasPaths, SlasComponents, OdsClient, OdsClientConfig, OdsError, OdsResponse, OdsPaths, OdsComponents, CustomApisClient, CustomApisClientConfig, CustomApisError, CustomApisResponse, CustomApisPaths, CustomApisComponents, AccountManagerUsersClient, AccountManagerClientConfig, AccountManagerUser, AccountManagerResponse, AccountManagerError, UserCreate, UserUpdate, UserCollection, UserState, UserExpandOption, AccountManagerRolesClient, AccountManagerRole, AccountManagerRolesResponse, AccountManagerRolesError, RoleCollection, ListRolesOptions, RoleMapping, OrgMapping, AccountManagerApiClientsClient, AccountManagerApiClient, APIClientCreate, APIClientUpdate, APIClientCollection, ApiClientExpandOption, ListApiClientsOptions, AccountManagerOrgsClient, AccountManagerOrganization, OrganizationCollection, ListOrgsOptions, CdnZonesClient, CdnZonesClientConfig, CdnZonesClientOptions, CdnZonesError, CdnZonesResponse, Zone, ZonesEnvelope, CdnZonesPaths, CdnZonesComponents, GranularReplicationsClient, GranularReplicationsClientConfig, GranularReplicationsError, GranularReplicationsResponse, ProductItem, PriceTableItem, ContentAssetItemPrivate, ContentAssetItemShared, PublishProcessResponse, PublishProcessListResponse, PublishIdResponse, GranularReplicationsPaths, GranularReplicationsComponents, CipClient, CipClientConfig, CipColumn, CipExecuteResponse, CipFetchResponse, CipFrame, CipQueryOptions, CipQueryResult, } from './clients/index.js';
11
+ export { WebDavClient, createOcapiClient, createAuthMiddleware, createExtraParamsMiddleware, createSlasClient, createOdsClient, createCustomApisClient, createAccountManagerUsersClient, createAccountManagerRolesClient, createAccountManagerApiClientsClient, createAccountManagerOrgsClient, createCdnZonesClient, createGranularReplicationsClient, createCipClient, createMetricsClient, METRICS_DEFAULT_SCOPES, toOrganizationId, normalizeTenantId, buildTenantScope, getApiErrorMessage, isValidRoleTenantFilter, fetchRoleMapping, resolveToInternalRole, resolveFromInternalRole, ORGANIZATION_ID_PREFIX, ROLE_TENANT_FILTER_PATTERN, SCAPI_TENANT_SCOPE_PREFIX, CUSTOM_APIS_DEFAULT_SCOPES, CDN_ZONES_READ_SCOPES, CDN_ZONES_RW_SCOPES, DEFAULT_CIP_HOST, DEFAULT_CIP_STAGING_HOST, } from './clients/index.js';
12
+ export type { PropfindEntry, ExtraParamsConfig, OcapiClient, OcapiError, OcapiResponse, OcapiPaths, OcapiComponents, SlasClient, SlasClientConfig, SlasError, SlasResponse, SlasPaths, SlasComponents, OdsClient, OdsClientConfig, OdsError, OdsResponse, OdsPaths, OdsComponents, CustomApisClient, CustomApisClientConfig, CustomApisError, CustomApisResponse, CustomApisPaths, CustomApisComponents, AccountManagerUsersClient, AccountManagerClientConfig, AccountManagerUser, AccountManagerResponse, AccountManagerError, UserCreate, UserUpdate, UserCollection, UserState, UserExpandOption, AccountManagerRolesClient, AccountManagerRole, AccountManagerRolesResponse, AccountManagerRolesError, RoleCollection, ListRolesOptions, RoleMapping, OrgMapping, AccountManagerApiClientsClient, AccountManagerApiClient, APIClientCreate, APIClientUpdate, APIClientCollection, ApiClientExpandOption, ListApiClientsOptions, AccountManagerOrgsClient, AccountManagerOrganization, OrganizationCollection, ListOrgsOptions, CdnZonesClient, CdnZonesClientConfig, CdnZonesClientOptions, CdnZonesError, CdnZonesResponse, Zone, ZonesEnvelope, CdnZonesPaths, CdnZonesComponents, GranularReplicationsClient, GranularReplicationsClientConfig, GranularReplicationsError, GranularReplicationsResponse, ProductItem, PriceTableItem, ContentAssetItemPrivate, ContentAssetItemShared, PublishProcessResponse, PublishProcessListResponse, PublishIdResponse, GranularReplicationsPaths, GranularReplicationsComponents, CipClient, CipClientConfig, CipColumn, CipExecuteResponse, CipFetchResponse, CipFrame, CipQueryOptions, CipQueryResult, MetricsClient, MetricsClientConfig, MetricsResponse, MetricsDataResponse, Metric, MetricDataSeries, MetricDataPoint, MetricsError, } from './clients/index.js';
13
13
  export { findCartridges, listCodeVersions, getActiveCodeVersion, activateCodeVersion, reloadCodeVersion, deleteCodeVersion, createCodeVersion, findAndDeployCartridges, uploadCartridges, deleteCartridges, watchCartridges, } from './operations/code/index.js';
14
14
  export type { CartridgeMapping, FindCartridgesOptions, CodeVersion, CodeVersionResult, DeployOptions, DeployResult, WatchOptions, WatchResult, } from './operations/code/index.js';
15
15
  export { executeJob, getJobExecution, waitForJob, searchJobExecutions, findRunningJobExecution, getJobLog, getJobErrorMessage, JobExecutionError, siteArchiveImport, siteArchiveExport, siteArchiveExportToPath, } from './operations/jobs/index.js';
@@ -21,6 +21,8 @@ export type { SandboxState, WaitForSandboxOptions, WaitForSandboxPollInfo } from
21
21
  export type { CloneState, WaitForCloneOptions, WaitForClonePollInfo } from './operations/ods/index.js';
22
22
  export { booleanLiteral, buildCipReportSql, dateLiteral, describeCipTable, escapeSqlString, executeCipReport, getCipReportByName, integerLiteral, isReservedIdentifier, listCipReports, listCipTables, quoteIdentifierIfReserved, stringInList, stringLiteral, } from './operations/cip/index.js';
23
23
  export type { CipColumnMetadata, CipDescribeTableOptions, CipDescribeTableResult, CipListTablesOptions, CipListTablesResult, CipReportDefinition, CipReportExecutionOptions, CipReportParamType, CipReportParamDefinition, CipReportQueryExecutor, CipReportQueryResult, CipReportSqlResult, CipTableMetadata, } from './operations/cip/index.js';
24
+ export { getOverallMetrics, getSalesMetrics, getEcdnMetrics, getThirdPartyMetrics, getScapiMetrics, getScapiHooksMetrics, getMrtMetrics, getControllerMetrics, getOcapiMetrics, getMetricsByCategory, parseMetricsBound, resolveMetricsWindow, parseSeriesTags, enrichMetricsTags, METRIC_CATEGORIES, METRICS_RETENTION_MS, METRICS_RETENTION_SAFETY_MARGIN_MS, METRICS_DEFAULT_WINDOW_MS, } from './operations/metrics/index.js';
25
+ export type { MetricCategory, MetricsTimeWindow, MetricsBoundInput, MetricsWindowInput, ResolvedMetricsWindow, MetricSeriesTags, MetricsTagContext, MetricsTaggedResponse, ThirdPartyMetricsOptions, ScapiMetricsOptions, OcapiMetricsOptions, MetricsQueryOptions, } from './operations/metrics/index.js';
24
26
  export { getUser, getUserByLogin, listUsers, createUser, updateUser, deleteUser, purgeUser, resetUser, grantRole, revokeRole, } from './operations/users/index.js';
25
27
  export { validateCap, commerceAppInstall, commerceAppUninstall, commerceAppPackage, discoverLocalApps, listInstalledApps, parseCommerceFeatureStatesXml, readManifest, pullCommerceApps, } from './operations/cap/index.js';
26
28
  export type { CapValidationResult, CommerceAppManifest, CommerceAppInstallOptions, CommerceAppInstallResult, CommerceAppUninstallOptions, CommerceAppUninstallResult, CommerceAppPackageOptions, CommerceAppPackageResult, CommerceFeatureState, LocalCommerceApp, ListInstalledAppsOptions, ListInstalledAppsResult, PullCommerceAppsOptions, PullCommerceAppsResult, PulledApp, PullSource, } from './operations/cap/index.js';
package/dist/esm/index.js CHANGED
@@ -13,7 +13,7 @@ export { BasicAuthStrategy, OAuthStrategy, ImplicitOAuthStrategy, JwtOAuthStrate
13
13
  // Context Layer - Instance
14
14
  export { B2CInstance } from './instance/index.js';
15
15
  // Clients
16
- export { WebDavClient, createOcapiClient, createAuthMiddleware, createExtraParamsMiddleware, createSlasClient, createOdsClient, createCustomApisClient, createAccountManagerUsersClient, createAccountManagerRolesClient, createAccountManagerApiClientsClient, createAccountManagerOrgsClient, createCdnZonesClient, createGranularReplicationsClient, createCipClient, toOrganizationId, normalizeTenantId, buildTenantScope, getApiErrorMessage, isValidRoleTenantFilter, fetchRoleMapping, resolveToInternalRole, resolveFromInternalRole, ORGANIZATION_ID_PREFIX, ROLE_TENANT_FILTER_PATTERN, SCAPI_TENANT_SCOPE_PREFIX, CUSTOM_APIS_DEFAULT_SCOPES, CDN_ZONES_READ_SCOPES, CDN_ZONES_RW_SCOPES, DEFAULT_CIP_HOST, DEFAULT_CIP_STAGING_HOST, } from './clients/index.js';
16
+ export { WebDavClient, createOcapiClient, createAuthMiddleware, createExtraParamsMiddleware, createSlasClient, createOdsClient, createCustomApisClient, createAccountManagerUsersClient, createAccountManagerRolesClient, createAccountManagerApiClientsClient, createAccountManagerOrgsClient, createCdnZonesClient, createGranularReplicationsClient, createCipClient, createMetricsClient, METRICS_DEFAULT_SCOPES, toOrganizationId, normalizeTenantId, buildTenantScope, getApiErrorMessage, isValidRoleTenantFilter, fetchRoleMapping, resolveToInternalRole, resolveFromInternalRole, ORGANIZATION_ID_PREFIX, ROLE_TENANT_FILTER_PATTERN, SCAPI_TENANT_SCOPE_PREFIX, CUSTOM_APIS_DEFAULT_SCOPES, CDN_ZONES_READ_SCOPES, CDN_ZONES_RW_SCOPES, DEFAULT_CIP_HOST, DEFAULT_CIP_STAGING_HOST, } from './clients/index.js';
17
17
  // Operations - Code
18
18
  export { findCartridges, listCodeVersions, getActiveCodeVersion, activateCodeVersion, reloadCodeVersion, deleteCodeVersion, createCodeVersion, findAndDeployCartridges, uploadCartridges, deleteCartridges, watchCartridges, } from './operations/code/index.js';
19
19
  // Operations - Jobs
@@ -24,6 +24,8 @@ export { searchDocs, readDoc, readDocByQuery, listDocs, loadSearchIndex, listSch
24
24
  export { isUuid, isFriendlySandboxId, parseFriendlySandboxId, resolveSandboxId, SandboxNotFoundError, waitForSandbox, SandboxPollingTimeoutError, SandboxPollingError, SandboxTerminalStateError, waitForClone, ClonePollingTimeoutError, ClonePollingError, CloneFailedError, } from './operations/ods/index.js';
25
25
  // Operations - CIP
26
26
  export { booleanLiteral, buildCipReportSql, dateLiteral, describeCipTable, escapeSqlString, executeCipReport, getCipReportByName, integerLiteral, isReservedIdentifier, listCipReports, listCipTables, quoteIdentifierIfReserved, stringInList, stringLiteral, } from './operations/cip/index.js';
27
+ // Operations - Metrics (Observability)
28
+ export { getOverallMetrics, getSalesMetrics, getEcdnMetrics, getThirdPartyMetrics, getScapiMetrics, getScapiHooksMetrics, getMrtMetrics, getControllerMetrics, getOcapiMetrics, getMetricsByCategory, parseMetricsBound, resolveMetricsWindow, parseSeriesTags, enrichMetricsTags, METRIC_CATEGORIES, METRICS_RETENTION_MS, METRICS_RETENTION_SAFETY_MARGIN_MS, METRICS_DEFAULT_WINDOW_MS, } from './operations/metrics/index.js';
27
29
  // Operations - Users
28
30
  export { getUser, getUserByLogin, listUsers, createUser, updateUser, deleteUser, purgeUser, resetUser, grantRole, revokeRole, } from './operations/users/index.js';
29
31
  // Operations - CAP (Commerce App Packages)
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAC,YAAY,EAAE,eAAe,EAAE,SAAS,EAAE,WAAW,EAAE,kBAAkB,EAAC,MAAM,oBAAoB,CAAC;AAG7G,OAAO;AACP,OAAO,EAAC,CAAC,EAAE,WAAW,EAAE,WAAW,EAAE,eAAe,EAAE,oBAAoB,EAAE,aAAa,EAAC,MAAM,iBAAiB,CAAC;AAGlH,SAAS;AACT,OAAO,EAAC,UAAU,EAAE,UAAU,EAAE,aAAa,EAAE,cAAc,EAAE,oBAAoB,EAAC,MAAM,mBAAmB,CAA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EAAE,WAAW,EAAE,cAAc,EAAC,MAAM,cAAc,CAAC"}
@@ -9,8 +9,13 @@ export declare function parseRelativeTime(timeStr: string): null | number;
9
9
  * Supports:
10
10
  * - Relative times: "5m", "1h", "2d"
11
11
  * - ISO 8601: "2026-01-25T10:00:00"
12
+ *
13
+ * @param sinceStr - The value to parse
14
+ * @param now - Reference time for relative values (defaults to the current time).
15
+ * Injectable so callers that resolve several bounds together, or that need
16
+ * deterministic behavior in tests, can pin a single "now".
12
17
  */
13
- export declare function parseSinceTime(sinceStr: string): Date;
18
+ export declare function parseSinceTime(sinceStr: string, now?: Date): Date;
14
19
  /**
15
20
  * Parses a B2C log timestamp into a Date object.
16
21
  * Expected format: "2025-01-25 10:30:45.123 GMT"
@@ -34,11 +34,16 @@ export function parseRelativeTime(timeStr) {
34
34
  * Supports:
35
35
  * - Relative times: "5m", "1h", "2d"
36
36
  * - ISO 8601: "2026-01-25T10:00:00"
37
+ *
38
+ * @param sinceStr - The value to parse
39
+ * @param now - Reference time for relative values (defaults to the current time).
40
+ * Injectable so callers that resolve several bounds together, or that need
41
+ * deterministic behavior in tests, can pin a single "now".
37
42
  */
38
- export function parseSinceTime(sinceStr) {
43
+ export function parseSinceTime(sinceStr, now = new Date()) {
39
44
  const relativeMs = parseRelativeTime(sinceStr);
40
45
  if (relativeMs !== null) {
41
- return new Date(Date.now() - relativeMs);
46
+ return new Date(now.getTime() - relativeMs);
42
47
  }
43
48
  const date = new Date(sinceStr);
44
49
  if (Number.isNaN(date.getTime())) {
@@ -1 +1 @@
1
- {"version":3,"file":"filter.js","sourceRoot":"","sources":["../../../../src/operations/logs/filter.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH;;;GAGG;AACH,MAAM,UAAU,iBAAiB,CAAC,OAAe;IAC/C,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC;IAC/C,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,OAAO,IAAI,CAAC;IACd,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,CAAC,WAAW,CAAC,CAAC;IAC5G,CAAC,CAAC,CAAC;AACL,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,YAAY,CAAC,KAAe,EAAE,MAAgB;IAC5D,IAAI,CAAC,KAAK,CAAC,KAAK;QAAE,OAAO,KAAK,CAAC;IAC/B,MAAM,WAAW,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC;IAChE,OAAO,WAAW,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC,CAAC;AACpD,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,aAAa,CAAC,KAAe,EAAE,MAAc;IAC3D,MAAM,WAAW,GAAG,MAAM,CAAC,WAAW,EAAE,CAAC;IACzC,OAAO,KAAK,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,WAAW,CAAC,IAAI,KAAK,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;AAC5G,CAAC"}
@@ -0,0 +1,371 @@
1
+ /**
2
+ * Metrics operations for B2C Commerce (Observability).
3
+ *
4
+ * This module provides typed, high-level functions for retrieving operational
5
+ * time-series metrics from the SCAPI Observability Metrics API
6
+ * (`observability/metrics/v1`). Each metric *category* has its own function; all
7
+ * return the same {@link MetricsDataResponse} envelope.
8
+ *
9
+ * ## Categories
10
+ *
11
+ * - {@link getOverallMetrics} — overall application metrics
12
+ * - {@link getSalesMetrics} — sales metrics
13
+ * - {@link getEcdnMetrics} — embedded CDN metrics
14
+ * - {@link getThirdPartyMetrics} — third-party service call metrics (filterable by service)
15
+ * - {@link getScapiMetrics} — SCAPI request metrics (filterable by API family/name)
16
+ * - {@link getScapiHooksMetrics} — SCAPI hook execution metrics
17
+ * - {@link getMrtMetrics} — Managed Runtime metrics
18
+ * - {@link getControllerMetrics} — controller/pipeline metrics
19
+ * - {@link getOcapiMetrics} — OCAPI request metrics (filterable by category/api)
20
+ *
21
+ * {@link getMetricsByCategory} dispatches to the correct function by category
22
+ * name — convenient for CLIs and tools that take a category as input.
23
+ *
24
+ * ## Usage
25
+ *
26
+ * ```typescript
27
+ * import {createMetricsClient} from '@salesforce/b2c-tooling-sdk/clients';
28
+ * import {getOverallMetrics} from '@salesforce/b2c-tooling-sdk/operations/metrics';
29
+ *
30
+ * const client = createMetricsClient({shortCode, tenantId}, auth);
31
+ * const result = await getOverallMetrics(client, tenantId, {from, to});
32
+ * for (const metric of result.data) {
33
+ * console.log(metric.title, metric.dataSeries.length);
34
+ * }
35
+ * ```
36
+ *
37
+ * ## Authentication
38
+ *
39
+ * Requires OAuth client-credentials with the `sfcc.metrics` admin scope. The
40
+ * {@link createMetricsClient} factory attaches this scope plus the tenant scope
41
+ * automatically.
42
+ *
43
+ * @module operations/metrics
44
+ */
45
+ import type { MetricsClient, MetricsDataResponse } from '../../clients/metrics.js';
46
+ export type { MetricsClient, MetricsClientConfig, MetricsDataResponse, Metric, MetricDataSeries, MetricDataPoint, MetricsError, } from '../../clients/metrics.js';
47
+ /**
48
+ * All metric categories exposed by the Metrics API, in a stable, documented order.
49
+ *
50
+ * Values match the API path segments (e.g. `overall` → `/metrics/overall`).
51
+ */
52
+ export declare const METRIC_CATEGORIES: readonly ["overall", "sales", "ecdn", "third-party", "scapi", "scapi-hooks", "mrt", "controller", "ocapi"];
53
+ /**
54
+ * A metric category name. One of {@link METRIC_CATEGORIES}.
55
+ */
56
+ export type MetricCategory = (typeof METRIC_CATEGORIES)[number];
57
+ /**
58
+ * Time-window options common to every metrics operation.
59
+ *
60
+ * Accepts either a {@link Date} or a number of **epoch milliseconds** (the same
61
+ * unit as `Date.now()`), for both `from` and `to`. Both are optional; when
62
+ * omitted the API applies its default window. When both are supplied, `from`
63
+ * must be before `to` or the API returns a 400.
64
+ *
65
+ * > **Note:** The Metrics API wire format is epoch **seconds**, and the data
66
+ * > points it returns are timestamped in **seconds**. These operations convert
67
+ * > millisecond inputs to seconds on the way out and normalize response
68
+ * > timestamps back to **milliseconds** on the way in, so callers work in
69
+ * > JS-native millisecond time throughout (e.g. `new Date(point.timestamp)`).
70
+ */
71
+ export interface MetricsTimeWindow {
72
+ /** Start of the window — a {@link Date} or epoch milliseconds (inclusive). */
73
+ from?: Date | number;
74
+ /** End of the window — a {@link Date} or epoch milliseconds (inclusive). */
75
+ to?: Date | number;
76
+ }
77
+ /**
78
+ * Options for {@link getThirdPartyMetrics}: time window plus an optional
79
+ * third-party service filter.
80
+ */
81
+ export interface ThirdPartyMetricsOptions extends MetricsTimeWindow {
82
+ /** Restrict results to a single third-party service by its id. */
83
+ thirdPartyServiceId?: string;
84
+ }
85
+ /**
86
+ * Options for {@link getScapiMetrics}: time window plus optional SCAPI filters.
87
+ */
88
+ export interface ScapiMetricsOptions extends MetricsTimeWindow {
89
+ /** Restrict results to a SCAPI API family (e.g. `product`, `checkout`). */
90
+ apiFamily?: string;
91
+ /** Restrict results to a SCAPI API name (e.g. `shopper-products`). */
92
+ apiName?: string;
93
+ }
94
+ /**
95
+ * Options for {@link getOcapiMetrics}: time window plus optional OCAPI filters.
96
+ */
97
+ export interface OcapiMetricsOptions extends MetricsTimeWindow {
98
+ /** Restrict results to an OCAPI category (e.g. `shop`, `data`). */
99
+ ocapiCategory?: string;
100
+ /** Restrict results to a specific OCAPI API. */
101
+ ocapiApi?: string;
102
+ }
103
+ /**
104
+ * Union of every option shape accepted by {@link getMetricsByCategory}.
105
+ */
106
+ export type MetricsQueryOptions = MetricsTimeWindow & Partial<Pick<ThirdPartyMetricsOptions, 'thirdPartyServiceId'>> & Partial<Pick<ScapiMetricsOptions, 'apiFamily' | 'apiName'>> & Partial<Pick<OcapiMetricsOptions, 'ocapiCategory' | 'ocapiApi'>>;
107
+ /**
108
+ * How far back the Metrics API retains data: `from` must be no older than
109
+ * `serverNow - 30 days`, or the API returns 400.
110
+ */
111
+ export declare const METRICS_RETENTION_MS: number;
112
+ /**
113
+ * Default (and maximum) width of a metrics time window: 24 hours.
114
+ *
115
+ * The Metrics API pairs a request that omits `to` with its own `now` and then
116
+ * enforces a maximum window of `to - from ≤ 24h`, rejecting anything wider with a
117
+ * 400. An open-ended `from` older than 24h therefore always fails. To make the
118
+ * behavior predictable, {@link resolveMetricsWindow} fills in a 24-hour window
119
+ * (clamped so `to` never exceeds `now`) for any bound the caller leaves open, and
120
+ * always sends both `from` and `to`. This is only a *default* for derivation — an
121
+ * explicit `from`+`to` range wider than 24h is still sent as-is, letting the API
122
+ * remain authoritative and return its own error.
123
+ */
124
+ export declare const METRICS_DEFAULT_WINDOW_MS: number;
125
+ /**
126
+ * Safety margin kept *inside* the retention window when clamping `from`. Because
127
+ * the server evaluates retention against its own clock at request time, a `from`
128
+ * computed as exactly "30 days ago" on the client is reliably rejected once
129
+ * request latency and client/server clock skew are added. {@link resolveMetricsWindow}
130
+ * therefore clamps a `from` that lands within this margin of the retention floor
131
+ * up to `now - 30 days + margin`, so edge requests (e.g. `--from 30d`) succeed.
132
+ * 5 minutes comfortably covers latency and typical skew while costing a
133
+ * negligible fraction of the 30-day window.
134
+ */
135
+ export declare const METRICS_RETENTION_SAFETY_MARGIN_MS: number;
136
+ /**
137
+ * A metrics bound as accepted from a CLI flag or MCP argument: a {@link Date},
138
+ * epoch **milliseconds**, or a human string — a relative duration (`5m`, `1h`,
139
+ * `2d`, interpreted as "ago") or an ISO 8601 timestamp.
140
+ */
141
+ export type MetricsBoundInput = Date | number | string;
142
+ /**
143
+ * Parses a single metrics time bound (`from` or `to`) into a {@link Date}.
144
+ *
145
+ * This is the shared bound parser for the CLI `metrics get` command and the MCP
146
+ * `metrics_get` tool. It resolves a single bound in isolation; deriving the
147
+ * companion bound and applying the 24-hour default window is the job of
148
+ * {@link resolveMetricsWindow}.
149
+ *
150
+ * @param value - The bound: a Date, epoch milliseconds, a relative duration
151
+ * (`5m`/`1h`/`2d`, relative to `now`), or an ISO 8601 timestamp
152
+ * @param now - Reference time for relative durations (defaults to the current
153
+ * time; injectable for deterministic tests)
154
+ * @returns The resolved {@link Date}
155
+ * @throws TypeError if a string value is neither a valid relative duration nor
156
+ * a parseable ISO 8601 timestamp
157
+ *
158
+ * @example
159
+ * ```typescript
160
+ * const from = parseMetricsBound('2d'); // 2 days ago
161
+ * const to = parseMetricsBound('2026-01-25T12:00:00Z');
162
+ * await getSalesMetrics(client, tenantId, {from, to});
163
+ * ```
164
+ */
165
+ export declare function parseMetricsBound(value: MetricsBoundInput, now?: Date): Date;
166
+ /**
167
+ * Raw `from`/`to`/`window` inputs, as accepted from CLI flags or MCP arguments,
168
+ * before resolution. Any subset may be provided.
169
+ */
170
+ export interface MetricsWindowInput {
171
+ /** Start bound (Date, epoch ms, relative like `7d`, or ISO 8601). */
172
+ from?: MetricsBoundInput;
173
+ /** End bound (Date, epoch ms, relative like `6h`, or ISO 8601). */
174
+ to?: MetricsBoundInput;
175
+ /**
176
+ * Window duration as a relative string (`1h`, `30m`, `2d`) or a number of
177
+ * **milliseconds**. Combined with exactly one of `from`/`to` it derives the
178
+ * other bound; supplied alone it means "the last {window}".
179
+ */
180
+ window?: number | string;
181
+ }
182
+ /**
183
+ * A resolved metrics window. Both `from` and `to` are always present: the
184
+ * resolver derives whichever bound the caller left open using the 24-hour
185
+ * default window (see {@link METRICS_DEFAULT_WINDOW_MS}) and always sends an
186
+ * explicit range, so the request never depends on the server's implicit `to`.
187
+ * Epoch-second echoes are included for reporting.
188
+ */
189
+ export interface ResolvedMetricsWindow {
190
+ /** Resolved start bound. */
191
+ from: Date;
192
+ /** Resolved end bound. */
193
+ to: Date;
194
+ /** ISO 8601 form of {@link from}. */
195
+ fromIso: string;
196
+ /** ISO 8601 form of {@link to}. */
197
+ toIso: string;
198
+ /** Epoch **seconds** form of {@link from} (the API wire unit). */
199
+ fromEpochSeconds: number;
200
+ /** Epoch **seconds** form of {@link to} (the API wire unit). */
201
+ toEpochSeconds: number;
202
+ /**
203
+ * True when `from` was clamped forward to stay inside the retention window
204
+ * (see {@link METRICS_RETENTION_SAFETY_MARGIN_MS}). Surfaced so callers can
205
+ * report that the effective start differs slightly from what was requested.
206
+ */
207
+ clampedFrom: boolean;
208
+ /**
209
+ * True when a bound was derived from the 24-hour default window rather than
210
+ * supplied by the caller (e.g. `from` alone, `to` alone, or nothing at all).
211
+ * Surfaced so callers can note that the effective range was defaulted.
212
+ */
213
+ defaultedWindow: boolean;
214
+ }
215
+ /**
216
+ * Resolves `from`/`to`/`window` inputs into the concrete bounds to send to the
217
+ * Metrics API. This is the shared resolver for the CLI `metrics get` command and
218
+ * the MCP `metrics_get` tool, so both share identical, tested semantics.
219
+ *
220
+ * The resolver always produces an explicit `from`+`to` pair. The Metrics API
221
+ * pairs a request that omits `to` with its own `now` and enforces a 24-hour
222
+ * maximum window, so an open-ended `from` older than 24 hours always fails; to
223
+ * make the behavior predictable, any bound the caller leaves open is filled from
224
+ * the 24-hour default window (see {@link METRICS_DEFAULT_WINDOW_MS}) rather than
225
+ * relying on the server's implicit end.
226
+ *
227
+ * The `window` duration makes fixed-width lookbacks easy without hand-computing
228
+ * a second timestamp — e.g. "a 1-hour window starting 7 days ago" is
229
+ * `{from: '7d', window: '1h'}`. Resolution rules:
230
+ *
231
+ * - `from` + `to` — used as given; `window` must NOT also be set. An explicit
232
+ * range wider than the 24-hour maximum is still sent as-is, leaving the API to
233
+ * return its own error.
234
+ * - `from` + `window` — `to = from + window`.
235
+ * - `to` + `window` — `from = to - window`.
236
+ * - `window` only — the last `window`: `to = now`, `from = now - window`.
237
+ * - `from` only — a 24-hour window forward from `from`: `to = min(from + 24h, now)`.
238
+ * - `to` only — a 24-hour window back from `to`: `from = to - 24h`.
239
+ * - nothing — the last 24 hours: `to = now`, `from = now - 24h`.
240
+ *
241
+ * Bounds filled from the 24-hour default (the last three rules) set
242
+ * {@link ResolvedMetricsWindow.defaultedWindow}. Validation is structural
243
+ * (over-specification and `from` after `to`). Additionally, a `from` that lands
244
+ * at or beyond the 30-day retention floor is clamped *forward* to
245
+ * `now - 30 days + margin` (see {@link METRICS_RETENTION_SAFETY_MARGIN_MS}) so
246
+ * requests like `--from 30d` are not rejected by the server's own slightly-later
247
+ * clock; the clamp is applied before deriving the companion bound so the window
248
+ * width is preserved, only ever moves `from` toward `now`, and is reported via
249
+ * {@link ResolvedMetricsWindow.clampedFrom}.
250
+ *
251
+ * @param input - The raw `from`/`to`/`window` inputs
252
+ * @param now - Reference time for relative bounds, default/window modes, and the
253
+ * retention clamp (defaults to the current time; injectable for deterministic tests)
254
+ * @returns The resolved bounds plus ISO/epoch-second echoes and clamp/default flags
255
+ * @throws TypeError if a bound or the window string is unparseable
256
+ * @throws RangeError if all three are supplied, or the resolved `from` is after `to`
257
+ *
258
+ * @example
259
+ * ```typescript
260
+ * // A 1-hour window starting 7 days ago:
261
+ * const w = resolveMetricsWindow({from: '7d', window: '1h'});
262
+ * await getScapiMetrics(client, tenantId, {from: w.from, to: w.to});
263
+ * ```
264
+ */
265
+ export declare function resolveMetricsWindow(input?: MetricsWindowInput, now?: Date): ResolvedMetricsWindow;
266
+ /**
267
+ * Retrieves overall application metrics for an organization.
268
+ *
269
+ * @param client - Metrics API client from {@link createMetricsClient}
270
+ * @param tenantId - Tenant ID (with or without the `f_ecom_` prefix)
271
+ * @param options - Optional time window (epoch milliseconds)
272
+ * @returns The metrics data response
273
+ * @throws Error if the request fails
274
+ */
275
+ export declare function getOverallMetrics(client: MetricsClient, tenantId: string, options?: MetricsTimeWindow): Promise<MetricsDataResponse>;
276
+ /**
277
+ * Retrieves sales metrics for an organization.
278
+ *
279
+ * @param client - Metrics API client from {@link createMetricsClient}
280
+ * @param tenantId - Tenant ID (with or without the `f_ecom_` prefix)
281
+ * @param options - Optional time window (epoch milliseconds)
282
+ * @returns The metrics data response
283
+ * @throws Error if the request fails
284
+ */
285
+ export declare function getSalesMetrics(client: MetricsClient, tenantId: string, options?: MetricsTimeWindow): Promise<MetricsDataResponse>;
286
+ /**
287
+ * Retrieves embedded CDN (eCDN) metrics for an organization.
288
+ *
289
+ * @param client - Metrics API client from {@link createMetricsClient}
290
+ * @param tenantId - Tenant ID (with or without the `f_ecom_` prefix)
291
+ * @param options - Optional time window (epoch milliseconds)
292
+ * @returns The metrics data response
293
+ * @throws Error if the request fails
294
+ */
295
+ export declare function getEcdnMetrics(client: MetricsClient, tenantId: string, options?: MetricsTimeWindow): Promise<MetricsDataResponse>;
296
+ /**
297
+ * Retrieves third-party service call metrics for an organization.
298
+ *
299
+ * @param client - Metrics API client from {@link createMetricsClient}
300
+ * @param tenantId - Tenant ID (with or without the `f_ecom_` prefix)
301
+ * @param options - Optional time window and `thirdPartyServiceId` filter
302
+ * @returns The metrics data response
303
+ * @throws Error if the request fails
304
+ */
305
+ export declare function getThirdPartyMetrics(client: MetricsClient, tenantId: string, options?: ThirdPartyMetricsOptions): Promise<MetricsDataResponse>;
306
+ /**
307
+ * Retrieves SCAPI request metrics for an organization.
308
+ *
309
+ * @param client - Metrics API client from {@link createMetricsClient}
310
+ * @param tenantId - Tenant ID (with or without the `f_ecom_` prefix)
311
+ * @param options - Optional time window and `apiFamily`/`apiName` filters
312
+ * @returns The metrics data response
313
+ * @throws Error if the request fails
314
+ */
315
+ export declare function getScapiMetrics(client: MetricsClient, tenantId: string, options?: ScapiMetricsOptions): Promise<MetricsDataResponse>;
316
+ /**
317
+ * Retrieves SCAPI hook execution metrics for an organization.
318
+ *
319
+ * @param client - Metrics API client from {@link createMetricsClient}
320
+ * @param tenantId - Tenant ID (with or without the `f_ecom_` prefix)
321
+ * @param options - Optional time window (epoch milliseconds)
322
+ * @returns The metrics data response
323
+ * @throws Error if the request fails
324
+ */
325
+ export declare function getScapiHooksMetrics(client: MetricsClient, tenantId: string, options?: MetricsTimeWindow): Promise<MetricsDataResponse>;
326
+ /**
327
+ * Retrieves Managed Runtime (MRT) metrics for an organization.
328
+ *
329
+ * @param client - Metrics API client from {@link createMetricsClient}
330
+ * @param tenantId - Tenant ID (with or without the `f_ecom_` prefix)
331
+ * @param options - Optional time window (epoch milliseconds)
332
+ * @returns The metrics data response
333
+ * @throws Error if the request fails
334
+ */
335
+ export declare function getMrtMetrics(client: MetricsClient, tenantId: string, options?: MetricsTimeWindow): Promise<MetricsDataResponse>;
336
+ /**
337
+ * Retrieves controller/pipeline metrics for an organization.
338
+ *
339
+ * @param client - Metrics API client from {@link createMetricsClient}
340
+ * @param tenantId - Tenant ID (with or without the `f_ecom_` prefix)
341
+ * @param options - Optional time window (epoch milliseconds)
342
+ * @returns The metrics data response
343
+ * @throws Error if the request fails
344
+ */
345
+ export declare function getControllerMetrics(client: MetricsClient, tenantId: string, options?: MetricsTimeWindow): Promise<MetricsDataResponse>;
346
+ /**
347
+ * Retrieves OCAPI request metrics for an organization.
348
+ *
349
+ * @param client - Metrics API client from {@link createMetricsClient}
350
+ * @param tenantId - Tenant ID (with or without the `f_ecom_` prefix)
351
+ * @param options - Optional time window and `ocapiCategory`/`ocapiApi` filters
352
+ * @returns The metrics data response
353
+ * @throws Error if the request fails
354
+ */
355
+ export declare function getOcapiMetrics(client: MetricsClient, tenantId: string, options?: OcapiMetricsOptions): Promise<MetricsDataResponse>;
356
+ /**
357
+ * Retrieves metrics for a category by name, dispatching to the category-specific
358
+ * function. Category-specific filters (`thirdPartyServiceId`, `apiFamily`,
359
+ * `apiName`, `ocapiCategory`, `ocapiApi`) are applied only for the categories
360
+ * that support them and ignored otherwise.
361
+ *
362
+ * @param client - Metrics API client from {@link createMetricsClient}
363
+ * @param tenantId - Tenant ID (with or without the `f_ecom_` prefix)
364
+ * @param category - One of {@link METRIC_CATEGORIES}
365
+ * @param options - Optional time window and category-specific filters
366
+ * @returns The metrics data response
367
+ * @throws Error if the request fails or the category is unknown
368
+ */
369
+ export declare function getMetricsByCategory(client: MetricsClient, tenantId: string, category: MetricCategory, options?: MetricsQueryOptions): Promise<MetricsDataResponse>;
370
+ export { parseSeriesTags, enrichMetricsTags } from './tags.js';
371
+ export type { MetricSeriesTags, MetricsTagContext, MetricsTaggedResponse } from './tags.js';