@commercelayer/provisioning-sdk 3.0.0-beta.0 → 3.0.0-beta.2

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 (146) hide show
  1. package/README.md +18 -9
  2. package/lib/{api-BY0jb79k.d.cts → api-C4jp_9vb.d.cts} +489 -480
  3. package/lib/{api-e4p3q-SB.d.ts → api-C_E9e1ea.d.ts} +489 -480
  4. package/lib/api.cjs +23 -23
  5. package/lib/api.d.cts +1 -1
  6. package/lib/api.d.ts +1 -1
  7. package/lib/api.js +13 -13
  8. package/lib/binding.cjs +3 -3
  9. package/lib/binding.d.cts +2 -2
  10. package/lib/binding.d.ts +2 -2
  11. package/lib/binding.js +2 -2
  12. package/lib/bundle.cjs +17 -17
  13. package/lib/bundle.d.cts +1 -1
  14. package/lib/bundle.d.ts +1 -1
  15. package/lib/bundle.js +15 -15
  16. package/lib/{chunk-63TTSE4U.cjs → chunk-3ILNEP2F.cjs} +26 -26
  17. package/lib/{chunk-63TTSE4U.cjs.map → chunk-3ILNEP2F.cjs.map} +1 -1
  18. package/lib/{chunk-C6AOOHOR.cjs → chunk-3NDVX4SE.cjs} +4 -4
  19. package/lib/{chunk-C6AOOHOR.cjs.map → chunk-3NDVX4SE.cjs.map} +1 -1
  20. package/lib/{chunk-DTD2FIJ3.js → chunk-3PJNJ7B6.js} +3 -3
  21. package/lib/{chunk-DTD2FIJ3.js.map → chunk-3PJNJ7B6.js.map} +1 -1
  22. package/lib/{chunk-ELYBYKRM.cjs → chunk-6FB54J7W.cjs} +4 -4
  23. package/lib/chunk-6FB54J7W.cjs.map +1 -0
  24. package/lib/{chunk-5KN7B3T2.cjs → chunk-6MXIGF2G.cjs} +10 -10
  25. package/lib/{chunk-5KN7B3T2.cjs.map → chunk-6MXIGF2G.cjs.map} +1 -1
  26. package/lib/{chunk-YYHZPR4Z.js → chunk-7YEOUGXO.js} +3 -3
  27. package/lib/{chunk-YYHZPR4Z.js.map → chunk-7YEOUGXO.js.map} +1 -1
  28. package/lib/{chunk-E2ERI2EX.js → chunk-CWXGTX7W.js} +4 -4
  29. package/lib/{chunk-E2ERI2EX.js.map → chunk-CWXGTX7W.js.map} +1 -1
  30. package/lib/{chunk-HAZ53WDW.cjs → chunk-DYMRH6LP.cjs} +4 -4
  31. package/lib/{chunk-HAZ53WDW.cjs.map → chunk-DYMRH6LP.cjs.map} +1 -1
  32. package/lib/{chunk-FWF7HBWB.js → chunk-ECGUWRRG.js} +3 -3
  33. package/lib/{chunk-FWF7HBWB.js.map → chunk-ECGUWRRG.js.map} +1 -1
  34. package/lib/{chunk-F2RLD5SN.cjs → chunk-EVDEBFHZ.cjs} +13 -8
  35. package/lib/chunk-EVDEBFHZ.cjs.map +1 -0
  36. package/lib/{chunk-BWDFMGX6.cjs → chunk-FMHTNUZ4.cjs} +4 -4
  37. package/lib/{chunk-BWDFMGX6.cjs.map → chunk-FMHTNUZ4.cjs.map} +1 -1
  38. package/lib/{chunk-HOL7SMFN.cjs → chunk-FRLV5YFL.cjs} +4 -4
  39. package/lib/{chunk-HOL7SMFN.cjs.map → chunk-FRLV5YFL.cjs.map} +1 -1
  40. package/lib/{chunk-UYATAIX7.js → chunk-G4JBHI2H.js} +3 -3
  41. package/lib/{chunk-UYATAIX7.js.map → chunk-G4JBHI2H.js.map} +1 -1
  42. package/lib/{chunk-4Z4U45XQ.js → chunk-GHXKZEH7.js} +8 -3
  43. package/lib/chunk-GHXKZEH7.js.map +1 -0
  44. package/lib/{chunk-35GNS3WW.js → chunk-I4LPOTDO.js} +3 -3
  45. package/lib/{chunk-35GNS3WW.js.map → chunk-I4LPOTDO.js.map} +1 -1
  46. package/lib/{chunk-VAL4CE5R.js → chunk-IRFPCJTG.js} +3 -3
  47. package/lib/{chunk-VAL4CE5R.js.map → chunk-IRFPCJTG.js.map} +1 -1
  48. package/lib/{chunk-3XLKYXM6.cjs → chunk-KO4FQ4V2.cjs} +4 -4
  49. package/lib/{chunk-3XLKYXM6.cjs.map → chunk-KO4FQ4V2.cjs.map} +1 -1
  50. package/lib/{chunk-U2CAAK2J.js → chunk-KT6LCJJQ.js} +3 -3
  51. package/lib/{chunk-U2CAAK2J.js.map → chunk-KT6LCJJQ.js.map} +1 -1
  52. package/lib/{chunk-FOU52N6P.js → chunk-LTIWXCVE.js} +3 -3
  53. package/lib/{chunk-FOU52N6P.js.map → chunk-LTIWXCVE.js.map} +1 -1
  54. package/lib/{chunk-W6XILXYS.cjs → chunk-MHV7FMLE.cjs} +4 -4
  55. package/lib/{chunk-W6XILXYS.cjs.map → chunk-MHV7FMLE.cjs.map} +1 -1
  56. package/lib/{chunk-Z4IAVXOO.cjs → chunk-NDKGLF4B.cjs} +4 -4
  57. package/lib/{chunk-Z4IAVXOO.cjs.map → chunk-NDKGLF4B.cjs.map} +1 -1
  58. package/lib/{chunk-CFU5DNH2.cjs → chunk-OROPOAHK.cjs} +4 -4
  59. package/lib/{chunk-CFU5DNH2.cjs.map → chunk-OROPOAHK.cjs.map} +1 -1
  60. package/lib/{chunk-UB3WPGDV.js → chunk-SQLX22US.js} +3 -3
  61. package/lib/chunk-SQLX22US.js.map +1 -0
  62. package/lib/{chunk-3ELZDTFF.js → chunk-STPXKF53.js} +4 -4
  63. package/lib/{chunk-3ELZDTFF.js.map → chunk-STPXKF53.js.map} +1 -1
  64. package/lib/{chunk-RDLVNJEW.js → chunk-T2U6MUX4.js} +3 -3
  65. package/lib/{chunk-RDLVNJEW.js.map → chunk-T2U6MUX4.js.map} +1 -1
  66. package/lib/{chunk-CLOSZJSZ.cjs → chunk-TXONK7R5.cjs} +4 -4
  67. package/lib/{chunk-CLOSZJSZ.cjs.map → chunk-TXONK7R5.cjs.map} +1 -1
  68. package/lib/{chunk-WRVLCJQZ.cjs → chunk-TY46WNR6.cjs} +8 -8
  69. package/lib/{chunk-WRVLCJQZ.cjs.map → chunk-TY46WNR6.cjs.map} +1 -1
  70. package/lib/{chunk-7OPCEEJV.cjs → chunk-UILXNOZE.cjs} +4 -4
  71. package/lib/{chunk-7OPCEEJV.cjs.map → chunk-UILXNOZE.cjs.map} +1 -1
  72. package/lib/{chunk-GES5UXTI.js → chunk-WMUY7Z2Q.js} +3 -3
  73. package/lib/{chunk-GES5UXTI.js.map → chunk-WMUY7Z2Q.js.map} +1 -1
  74. package/lib/{chunk-3FP4NVLD.cjs → chunk-XS6QLJHG.cjs} +3 -3
  75. package/lib/chunk-XS6QLJHG.cjs.map +1 -0
  76. package/lib/{chunk-6I5KGZAU.js → chunk-YUNEDDTL.js} +14 -14
  77. package/lib/{chunk-6I5KGZAU.js.map → chunk-YUNEDDTL.js.map} +1 -1
  78. package/lib/{chunk-QRZGS4TB.js → chunk-ZWZHZ4SU.js} +3 -3
  79. package/lib/chunk-ZWZHZ4SU.js.map +1 -0
  80. package/lib/commercelayer.cjs +10 -10
  81. package/lib/commercelayer.d.cts +1 -1
  82. package/lib/commercelayer.d.ts +1 -1
  83. package/lib/commercelayer.js +4 -4
  84. package/lib/enum.d.cts +1 -1
  85. package/lib/enum.d.ts +1 -1
  86. package/lib/index.cjs +22 -22
  87. package/lib/index.cjs.map +1 -1
  88. package/lib/index.d.cts +1 -1
  89. package/lib/index.d.ts +1 -1
  90. package/lib/index.js +17 -17
  91. package/lib/index.js.map +1 -1
  92. package/lib/model.d.cts +1 -1
  93. package/lib/model.d.ts +1 -1
  94. package/lib/resources/api_credentials.cjs +5 -5
  95. package/lib/resources/api_credentials.d.cts +2 -2
  96. package/lib/resources/api_credentials.d.ts +1 -1
  97. package/lib/resources/api_credentials.js +4 -4
  98. package/lib/resources/application_memberships.cjs +5 -5
  99. package/lib/resources/application_memberships.d.cts +2 -2
  100. package/lib/resources/application_memberships.d.ts +1 -1
  101. package/lib/resources/application_memberships.js +4 -4
  102. package/lib/resources/identity_providers.cjs +5 -5
  103. package/lib/resources/identity_providers.d.cts +2 -2
  104. package/lib/resources/identity_providers.d.ts +1 -1
  105. package/lib/resources/identity_providers.js +4 -4
  106. package/lib/resources/membership_profiles.cjs +5 -5
  107. package/lib/resources/membership_profiles.d.cts +2 -2
  108. package/lib/resources/membership_profiles.d.ts +1 -1
  109. package/lib/resources/membership_profiles.js +4 -4
  110. package/lib/resources/memberships.cjs +5 -5
  111. package/lib/resources/memberships.d.cts +2 -2
  112. package/lib/resources/memberships.d.ts +1 -1
  113. package/lib/resources/memberships.js +4 -4
  114. package/lib/resources/organizations.cjs +5 -5
  115. package/lib/resources/organizations.d.cts +2 -2
  116. package/lib/resources/organizations.d.ts +1 -1
  117. package/lib/resources/organizations.js +4 -4
  118. package/lib/resources/permissions.cjs +5 -5
  119. package/lib/resources/permissions.d.cts +2 -2
  120. package/lib/resources/permissions.d.ts +1 -1
  121. package/lib/resources/permissions.js +4 -4
  122. package/lib/resources/roles.cjs +5 -5
  123. package/lib/resources/roles.d.cts +2 -2
  124. package/lib/resources/roles.d.ts +1 -1
  125. package/lib/resources/roles.js +4 -4
  126. package/lib/resources/users.cjs +5 -5
  127. package/lib/resources/users.d.cts +2 -2
  128. package/lib/resources/users.d.ts +1 -1
  129. package/lib/resources/users.js +4 -4
  130. package/lib/resources/versions.cjs +5 -5
  131. package/lib/resources/versions.d.cts +2 -2
  132. package/lib/resources/versions.d.ts +1 -1
  133. package/lib/resources/versions.js +4 -4
  134. package/lib/static.cjs +6 -6
  135. package/lib/static.d.cts +1 -1
  136. package/lib/static.d.ts +1 -1
  137. package/lib/static.js +5 -5
  138. package/lib/version.cjs +4 -4
  139. package/lib/version.js +1 -1
  140. package/package.json +10 -11
  141. package/lib/chunk-3FP4NVLD.cjs.map +0 -1
  142. package/lib/chunk-4Z4U45XQ.js.map +0 -1
  143. package/lib/chunk-ELYBYKRM.cjs.map +0 -1
  144. package/lib/chunk-F2RLD5SN.cjs.map +0 -1
  145. package/lib/chunk-QRZGS4TB.js.map +0 -1
  146. package/lib/chunk-UB3WPGDV.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/commercelayer.ts"],"names":["debug_default","API_SCHEM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AAA,MACT,EAAA,EAAI;AAAA,KACN;AAEA,IAAA,eAAe,uBAAuB,QAAA,EAA6C;AACjF,MAAA,MAAA,CAAO,WAAA,GAAc,MAAM,QAAA,EACvB,KAAA,GACD,IAAA,EAAK,CACL,MAAM,MAAM;AAAA,MAAC,CAAC,CAAA;AACjB,MAAA,MAAA,CAAO,KAAK,QAAA,CAAS,EAAA;AACrB,MAAA,IAAI,SAAS,OAAA,EAAS;AACpB,QAAA,MAAM,KAAiB,EAAC;AACxB,QAAA,QAAA,CAAS,OAAA,CAAQ,OAAA,CAAQ,CAAC,KAAA,EAAO,GAAA,KAAQ;AACvC,UAAA,EAAA,CAAG,GAAG,CAAA,GAAI,KAAA;AAAA,QACZ,CAAC,CAAA;AACD,QAAA,MAAA,CAAO,OAAA,GAAU,EAAA;AAAA,MACnB;AACA,MAAA,OAAO,QAAA;AAAA,IACT;AAE0B,IAAA,IAAA,CAAK,aAAa,SAAA,GAAY;AAAA,MACtD,SAAA,EAAW,sBAAA;AAAA,MACX,SAAA,EAAW;AAAA,KACb;AACA,IAAA,MAAA,CAAO,EAAA,GAAK,CAAA;AAEZ,IAAA,OAAO,MAAA;AAAA,EACT;AAAA,EAEA,uBAAA,GAAwE;AAKtE,IAAA,IAAA,CAAK,aAAa,SAAA,GAAY,MAAA;AAAA,EAChC;AACF;AAEA,IAAM,yBAAA,GAA4B,CAAC,MAAA,KAAyE;AAC1G,EAAA,OAAO,mCAAA,CAAoC,IAAI,MAAM,CAAA;AACvD;AAEA,IAAO,qBAAA,GAAQ","file":"chunk-5KN7B3T2.cjs","sourcesContent":["import Debug from '@runtime/debug'\nimport { type ApiError, isApiError } from '@runtime/error'\nimport type {\n ErrorInterceptor,\n HeadersObj,\n InterceptorManager,\n InterceptorType,\n RawResponseReader,\n RequestInterceptor,\n ResponseInterceptor,\n ResponseObj,\n} from '@runtime/interceptor'\nimport { ApiResourceAdapter, type ResourceAdapter, type ResourcesInitConfig } from '@runtime/resource'\n// import * as api from '../gen/api'\nimport { getResources } from '../gen/enum'\nimport { API_SCHEMA_VERSION, API_SUPPORTED_VERSIONS, type ApiVersion, SDK_VERSION } from '../gen/version'\n\nconst debug = Debug('commercelayer')\n\nexport { API_SCHEMA_VERSION, API_SUPPORTED_VERSIONS, type ApiVersion, SDK_VERSION }\n\n// SDK local configuration\ntype SdkConfig = {\n /** Set to `false` to omit the `X-CL-SDK` request header that identifies the SDK and its version. Defaults to `true`. */\n telemetry?: boolean\n}\n\n/**\n * The `apiVersion` init option, conditioned on how the SDK was generated:\n * - **Version-aware (unified) builds** — {@link API_SUPPORTED_VERSIONS} is\n * non-empty — **require** `apiVersion`. The chosen value becomes a URL path\n * segment (`/api/2026-05/orders`), keeping requests aligned with the version\n * the types were generated for.\n * - **Legacy builds** — empty {@link API_SUPPORTED_VERSIONS}, so {@link ApiVersion}\n * is `never` — take **no** `apiVersion` argument. The API is unversioned\n * (`/api/orders`).\n */\ntype ApiVersionConfig = [ApiVersion] extends [never] ? { apiVersion?: never } : { apiVersion: ApiVersion }\n\ntype CommerceLayerInitConfig = SdkConfig & ApiVersionConfig & ResourcesInitConfig\ntype CommerceLayerConfig = Partial<CommerceLayerInitConfig>\n\nclass CommerceLayerProvisioningBaseClient {\n readonly apiSchemaVersion = API_SCHEMA_VERSION\n readonly apiSupportedVersions = API_SUPPORTED_VERSIONS\n\n protected static cl: CommerceLayerProvisioningBaseClient\n\n static get(config?: CommerceLayerInitConfig): CommerceLayerProvisioningBaseClient {\n if (config) return (CommerceLayerProvisioningBaseClient.cl = new CommerceLayerProvisioningBaseClient(config))\n else if (!CommerceLayerProvisioningBaseClient.cl)\n throw new Error('CommerceLayerProvisioning client not initialized')\n return CommerceLayerProvisioningBaseClient.cl\n }\n\n // The ResourceAdapter created for this specific client instance. Every\n // `CommerceLayerProvisioning(config)` call builds a fresh adapter (its own ApiClient\n // with its own access token). The bundle client reads this so two clients\n // stay isolated; see the `adapter` seam below.\n protected readonly instanceAdapter: ResourceAdapter\n\n protected constructor(config: CommerceLayerInitConfig) {\n debug('new commercelayer instance %O', config)\n\n // `init` builds a new adapter AND sets the process-global static one.\n // We keep the return value so the bundle can bind resources to this\n // exact adapter; the static assignment stays for the plain SDK, whose\n // directly-imported resource singletons resolve through it.\n this.instanceAdapter = ApiResourceAdapter.init(config)\n }\n\n // Adapter seam. The base (plain SDK) reports the process-global static\n // adapter so `config()` and the getters below stay in sync with the\n // directly-imported resource singletons — unchanged behaviour. The bundle\n // overrides this to return its own `instanceAdapter`, isolating clients.\n protected get adapter(): ResourceAdapter {\n return ApiResourceAdapter.get()\n }\n\n get currentOrganization(): string {\n return this.adapter.client?.currentOrganization\n }\n get currentAccessToken(): string {\n return this.adapter.client?.currentAccessToken\n }\n /** The API version pinned via `apiVersion`, or `undefined` when requests are unversioned. */\n get currentApiVersion(): string | undefined {\n return this.adapter.client?.currentApiVersion\n }\n private get interceptors(): InterceptorManager {\n return this.adapter.client?.interceptors\n }\n\n private localConfig(_config: Partial<SdkConfig>): void {\n // if (config.abc) this.abc = config.abc\n }\n\n config(config: CommerceLayerConfig): this {\n debug('config %o', config)\n\n // CommerceLayerProvisioning config\n this.localConfig(config)\n // ResourceAdapter config\n this.adapter.config(config)\n\n return this\n }\n\n resources(sort?: boolean): readonly string[] {\n return getResources(sort)\n }\n\n isApiError(error: any): error is ApiError {\n return isApiError(error)\n }\n\n addRequestInterceptor(onSuccess?: RequestInterceptor, onFailure?: ErrorInterceptor): number {\n this.interceptors.request = { onSuccess, onFailure }\n return 1\n }\n\n addResponseInterceptor(onSuccess?: ResponseInterceptor, onFailure?: ErrorInterceptor): number {\n this.interceptors.response = { onSuccess, onFailure }\n return 1\n }\n\n removeInterceptor(type: InterceptorType, _id: number = 1): void {\n this.interceptors[type] = undefined\n }\n\n removeInterceptors(): void {\n this.removeInterceptor('request')\n this.removeInterceptor('response')\n this.removeRawResponseReader()\n }\n\n addRawResponseReader(options?: { headers: boolean }): RawResponseReader {\n const reader: RawResponseReader = {\n id: 0,\n rawResponse: undefined,\n headers: undefined,\n ok: true,\n }\n\n async function rawResponseInterceptor(response: ResponseObj): Promise<ResponseObj> {\n reader.rawResponse = await response\n ?.clone()\n .json()\n .catch(() => {})\n reader.ok = response.ok\n if (options?.headers) {\n const ho: HeadersObj = {}\n response.headers.forEach((value, key) => {\n ho[key] = value\n })\n reader.headers = ho\n }\n return response\n }\n\n /* const interceptor = */ this.interceptors.rawReader = {\n onSuccess: rawResponseInterceptor,\n onFailure: rawResponseInterceptor,\n }\n reader.id = 1 // interceptor\n\n return reader\n }\n\n removeRawResponseReader(/* reader: number | RawResponseReader */): void {\n /*\n\t\tconst id = (typeof reader === 'number') ? reader : reader?.id\n\t\tif (id && (id >= 0)) this.removeInterceptor('response', id)\n\t\t*/\n this.interceptors.rawReader = undefined\n }\n}\n\nconst CommerceLayerProvisioning = (config: CommerceLayerInitConfig): CommerceLayerProvisioningBaseClient => {\n return CommerceLayerProvisioningBaseClient.get(config)\n}\n\nexport default CommerceLayerProvisioning\nexport type { CommerceLayerConfig, CommerceLayerInitConfig }\nexport { CommerceLayerProvisioning, CommerceLayerProvisioningBaseClient }\n"]}
1
+ {"version":3,"sources":["../src/commercelayer.ts"],"names":["debug_default","API_SCHEMA_VERSION","API_SUPPORTED_VERSIONS","ApiResourceAdapter","getResources","isApiError"],"mappings":";;;;;;;AAiBA,IAAM,KAAA,GAAQA,gCAAM,eAAe,CAAA;AAyBnC,IAAM,mCAAA,GAAN,MAAM,oCAAA,CAAoC;AAAA,EAC/B,gBAAA,GAAmBC,oCAAA;AAAA,EACnB,oBAAA,GAAuBC,wCAAA;AAAA,EAEhC,OAAiB,EAAA;AAAA,EAEjB,OAAO,IAAI,MAAA,EAAuE;AAChF,IAAA,IAAI,QAAQ,OAAQ,oCAAA,CAAoC,EAAA,GAAK,IAAI,qCAAoC,MAAM,CAAA;AAAA,SAAA,IAClG,CAAC,oCAAA,CAAoC,EAAA;AAC5C,MAAA,MAAM,IAAI,MAAM,kDAAkD,CAAA;AACpE,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O,OAAA,GAAU,EAAA;AAAA,MACnB;AACA,MAAA,OAAO,QAAA;AAAA,IACT;AAE0B,IAAA,IAAA,CAAK,aAAa,SAAA,GAAY;AAAA,MACtD,SAAA,EAAW,sBAAA;AAAA,MACX,SAAA,EAAW;AAAA,KACb;AACA,IAAA,MAAA,CAAO,EAAA,GAAK,CAAA;AAEZ,IAAA,OAAO,MAAA;AAAA,EACT;AAAA,EAEA,uBAAA,GAAwE;AAKtE,IAAA,IAAA,CAAK,aAAa,SAAA,GAAY,MAAA;AAAA,EAChC;AACF;AAEA,IAAM,yBAAA,GAA4B,CAAC,MAAA,KAAyE;AAC1G,EAAA,OAAO,mCAAA,CAAoC,IAAI,MAAM,CAAA;AACvD;AAEA,IAAO,qBAAA,GAAQ","file":"chunk-6MXIGF2G.cjs","sourcesContent":["import Debug from '@runtime/debug'\nimport { type ApiError, isApiError } from '@runtime/error'\nimport type {\n ErrorInterceptor,\n HeadersObj,\n InterceptorManager,\n InterceptorType,\n RawResponseReader,\n RequestInterceptor,\n ResponseInterceptor,\n ResponseObj,\n} from '@runtime/interceptor'\nimport { ApiResourceAdapter, type ResourceAdapter, type ResourcesInitConfig } from '@runtime/resource'\n// import * as api from '../gen/api'\nimport { getResources } from '../gen/enum'\nimport { API_SCHEMA_VERSION, API_SUPPORTED_VERSIONS, type ApiVersion, SDK_VERSION } from '../gen/version'\n\nconst debug = Debug('commercelayer')\n\nexport { API_SCHEMA_VERSION, API_SUPPORTED_VERSIONS, type ApiVersion, SDK_VERSION }\n\n// SDK local configuration\ntype SdkConfig = {\n /** Set to `false` to omit the `X-CL-SDK` request header that identifies the SDK and its version. Defaults to `true`. */\n telemetry?: boolean\n}\n\n/**\n * The `apiVersion` init option, conditioned on how the SDK was generated:\n * - **Version-aware (unified) builds** — {@link API_SUPPORTED_VERSIONS} is\n * non-empty — **require** `apiVersion`. The chosen value becomes a URL path\n * segment (`/api/2026-05/orders`), keeping requests aligned with the version\n * the types were generated for.\n * - **Legacy builds** — empty {@link API_SUPPORTED_VERSIONS}, so {@link ApiVersion}\n * is `never` — take **no** `apiVersion` argument. The API is unversioned\n * (`/api/orders`).\n */\ntype ApiVersionConfig = [ApiVersion] extends [never] ? { apiVersion?: never } : { apiVersion: ApiVersion }\n\ntype CommerceLayerInitConfig = SdkConfig & ApiVersionConfig & ResourcesInitConfig\ntype CommerceLayerConfig = Partial<CommerceLayerInitConfig>\n\nclass CommerceLayerProvisioningBaseClient {\n readonly apiSchemaVersion = API_SCHEMA_VERSION\n readonly apiSupportedVersions = API_SUPPORTED_VERSIONS\n\n protected static cl: CommerceLayerProvisioningBaseClient\n\n static get(config?: CommerceLayerInitConfig): CommerceLayerProvisioningBaseClient {\n if (config) return (CommerceLayerProvisioningBaseClient.cl = new CommerceLayerProvisioningBaseClient(config))\n else if (!CommerceLayerProvisioningBaseClient.cl)\n throw new Error('CommerceLayerProvisioning client not initialized')\n return CommerceLayerProvisioningBaseClient.cl\n }\n\n // The ResourceAdapter created for this specific client instance. Every\n // `CommerceLayerProvisioning(config)` call builds a fresh adapter (its own ApiClient\n // with its own access token). The bundle client reads this so two clients\n // stay isolated; see the `adapter` seam below.\n protected readonly instanceAdapter: ResourceAdapter\n\n protected constructor(config: CommerceLayerInitConfig) {\n debug('new commercelayer instance %O', config)\n\n // `init` builds a new adapter AND sets the process-global static one.\n // We keep the return value so the bundle can bind resources to this\n // exact adapter; the static assignment stays for the plain SDK, whose\n // directly-imported resource singletons resolve through it.\n this.instanceAdapter = ApiResourceAdapter.init(config)\n }\n\n // Adapter seam. The base (plain SDK) reports the process-global static\n // adapter so `config()` and the getters below stay in sync with the\n // directly-imported resource singletons — unchanged behaviour. The bundle\n // overrides this to return its own `instanceAdapter`, isolating clients.\n protected get adapter(): ResourceAdapter {\n return ApiResourceAdapter.get()\n }\n\n get currentOrganization(): string {\n return this.adapter.client?.currentOrganization\n }\n get currentAccessToken(): string {\n return this.adapter.client?.currentAccessToken\n }\n /** The API version pinned via `apiVersion`, or `undefined` when requests are unversioned. */\n get currentApiVersion(): string | undefined {\n return this.adapter.client?.currentApiVersion\n }\n private get interceptors(): InterceptorManager {\n return this.adapter.client?.interceptors\n }\n\n private localConfig(_config: Partial<SdkConfig>): void {\n // if (config.abc) this.abc = config.abc\n }\n\n config(config: CommerceLayerConfig): this {\n debug('config %o', config)\n\n // CommerceLayerProvisioning config\n this.localConfig(config)\n // ResourceAdapter config\n this.adapter.config(config)\n\n return this\n }\n\n resources(sort?: boolean): readonly string[] {\n return getResources(sort)\n }\n\n isApiError(error: any): error is ApiError {\n return isApiError(error)\n }\n\n addRequestInterceptor(onSuccess?: RequestInterceptor, onFailure?: ErrorInterceptor): number {\n this.interceptors.request = { onSuccess, onFailure }\n return 1\n }\n\n addResponseInterceptor(onSuccess?: ResponseInterceptor, onFailure?: ErrorInterceptor): number {\n this.interceptors.response = { onSuccess, onFailure }\n return 1\n }\n\n removeInterceptor(type: InterceptorType, _id: number = 1): void {\n this.interceptors[type] = undefined\n }\n\n removeInterceptors(): void {\n this.removeInterceptor('request')\n this.removeInterceptor('response')\n this.removeRawResponseReader()\n }\n\n addRawResponseReader(options?: { headers: boolean }): RawResponseReader {\n const reader: RawResponseReader = {\n id: 0,\n rawResponse: undefined,\n headers: undefined,\n ok: true,\n }\n\n async function rawResponseInterceptor(response: ResponseObj): Promise<ResponseObj> {\n reader.rawResponse = await response\n ?.clone()\n .json()\n .catch(() => {})\n reader.ok = response.ok\n if (options?.headers) {\n const ho: HeadersObj = {}\n response.headers.forEach((value, key) => {\n ho[key] = value\n })\n reader.headers = ho\n }\n return response\n }\n\n /* const interceptor = */ this.interceptors.rawReader = {\n onSuccess: rawResponseInterceptor,\n onFailure: rawResponseInterceptor,\n }\n reader.id = 1 // interceptor\n\n return reader\n }\n\n removeRawResponseReader(/* reader: number | RawResponseReader */): void {\n /*\n\t\tconst id = (typeof reader === 'number') ? reader : reader?.id\n\t\tif (id && (id >= 0)) this.removeInterceptor('response', id)\n\t\t*/\n this.interceptors.rawReader = undefined\n }\n}\n\nconst CommerceLayerProvisioning = (config: CommerceLayerInitConfig): CommerceLayerProvisioningBaseClient => {\n return CommerceLayerProvisioningBaseClient.get(config)\n}\n\nexport default CommerceLayerProvisioning\nexport type { CommerceLayerConfig, CommerceLayerInitConfig }\nexport { CommerceLayerProvisioning, CommerceLayerProvisioningBaseClient }\n"]}
@@ -1,4 +1,4 @@
1
- import { ApiResource } from './chunk-4Z4U45XQ.js';
1
+ import { ApiResource } from './chunk-GHXKZEH7.js';
2
2
 
3
3
  // gen/resources/api_credentials.ts
4
4
  var ApiCredentials = class _ApiCredentials extends ApiResource {
@@ -55,5 +55,5 @@ var instance = new ApiCredentials();
55
55
  var api_credentials_default = instance;
56
56
 
57
57
  export { api_credentials_default };
58
- //# sourceMappingURL=chunk-YYHZPR4Z.js.map
59
- //# sourceMappingURL=chunk-YYHZPR4Z.js.map
58
+ //# sourceMappingURL=chunk-7YEOUGXO.js.map
59
+ //# sourceMappingURL=chunk-7YEOUGXO.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../gen/resources/api_credentials.ts"],"names":[],"mappings":";;;AA4IA,IAAM,cAAA,GAAN,MAAM,eAAA,SAAuB,WAAA,CAA2B;AAAA,EACtD,OAAgB,IAAA,GAA0B,iBAAA;AAAA,EAE1C,MAAM,MAAA,CACJ,QAAA,EACA,MAAA,EACA,OAAA,EACwB;AACxB,IAAA,OAAO,KAAK,SAAA,CAAU,MAAA;AAAA,MACpB,EAAE,GAAG,QAAA,EAAU,IAAA,EAAM,gBAAe,IAAA,EAAK;AAAA,MACzC,MAAA;AAAA,MACA;AAAA,KACF;AAAA,EACF;AAAA,EAEA,MAAM,MAAA,CACJ,QAAA,EACA,MAAA,EACA,OAAA,EACwB;AACxB,IAAA,OAAO,KAAK,SAAA,CAAU,MAAA;AAAA,MACpB,EAAE,GAAG,QAAA,EAAU,IAAA,EAAM,gBAAe,IAAA,EAAK;AAAA,MACzC,MAAA;AAAA,MACA;AAAA,KACF;AAAA,EACF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A,EACxB;AACF,CAAA;AAEA,IAAM,QAAA,GAAW,IAAI,cAAA,EAAe;AACpC,IAAO,uBAAA,GAAQ","file":"chunk-YYHZPR4Z.js","sourcesContent":["import type { QueryParamsRetrieve } from '@runtime/query'\nimport type {\n Resource,\n ResourceCreate,\n ResourceId,\n ResourceRel,\n ResourceSort,\n /* ResourceFilter */ ResourcesConfig,\n ResourceUpdate,\n} from '@runtime/resource'\nimport { ApiResource } from '@runtime/resource'\n\nimport type { Organization, OrganizationType } from './organizations'\nimport type { Role, RoleType } from './roles'\n\ntype ApiCredentialType = 'api_credentials'\ntype ApiCredentialRel = ResourceRel & { type: ApiCredentialType }\ntype OrganizationRel = ResourceRel & { type: OrganizationType }\ntype RoleRel = ResourceRel & { type: RoleType }\n\nexport type ApiCredentialSort = Pick<ApiCredential, 'id' | 'name' | 'mode'> & ResourceSort\n// export type ApiCredentialFilter = Pick<ApiCredential, 'id' | 'name' | 'kind' | 'confidential' | 'redirect_uri' | 'client_id' | 'scopes' | 'expires_in' | 'mode' | 'custom'> & ResourceFilter\n\n/**\n * The Api credential object is returned as part of the response body of each successful list, retrieve, create, update or delete API call to the /api/api_credentials endpoint.\n *\n * @link https://docs.commercelayer.io/provisioning-api-reference/api_credentials/object\n */\ninterface ApiCredential extends Resource {\n readonly type: ApiCredentialType\n\n /**\n * The API credential internal name.\n * @example ```\"My app\"```\n */\n name: string\n /**\n * The API credential kind, can be one of: `webapp`, `sales_channel`, `integration` or the kind of app you want to fork (e.g. `orders`, `imports`, etc.).\n * @example ```\"sales_channel\"```\n */\n kind: string\n /**\n * Indicates if the API credential it's confidential.\n * @example ```true```\n */\n confidential?: boolean | null\n /**\n * The API credential redirect URI.\n * @example ```\"https://bluebrand.com/img/logo.svg\"```\n */\n redirect_uri?: string | null\n /**\n * The API credential unique ID.\n * @example ```\"xxxx-yyyy-zzzz\"```\n */\n client_id?: string | null\n /**\n * The API credential unique secret.\n * @example ```\"xxxx-yyyy-zzzz\"```\n */\n client_secret?: string | null\n /**\n * The API credential scopes.\n * @example ```\"market:all market:9 market:122 market:6 stock_location:6 stock_location:33\"```\n */\n scopes?: string | null\n /**\n * The lifetime of the access token in seconds (min. `7200`, max. `31536000`. Default is `14400` for Sales channels and `7200` for other client types).\n * @example ```7200```\n */\n expires_in?: number | null\n /**\n * Indicates the environment the resource belongs to (one of `test` or `live`).\n * @example ```\"test\"```\n */\n mode?: string | null\n /**\n * Indicates if the API credential is used to create a custom app (e.g. fork a hosted app).\n */\n custom?: boolean | null\n\n organization?: Organization | null\n role?: Role | null\n}\n\ninterface ApiCredentialCreate extends ResourceCreate {\n /**\n * The API credential internal name.\n * @example ```\"My app\"```\n */\n name: string\n /**\n * The API credential kind, can be one of: `webapp`, `sales_channel`, `integration` or the kind of app you want to fork (e.g. `orders`, `imports`, etc.).\n * @example ```\"sales_channel\"```\n */\n kind: string\n /**\n * The API credential redirect URI.\n * @example ```\"https://bluebrand.com/img/logo.svg\"```\n */\n redirect_uri?: string | null\n /**\n * The lifetime of the access token in seconds (min. `7200`, max. `31536000`. Default is `14400` for Sales channels and `7200` for other client types).\n * @example ```7200```\n */\n expires_in?: number | null\n /**\n * Indicates the environment the resource belongs to (one of `test` or `live`).\n * @example ```\"test\"```\n */\n mode?: string | null\n /**\n * Indicates if the API credential is used to create a custom app (e.g. fork a hosted app).\n */\n custom?: boolean | null\n\n organization: OrganizationRel\n role?: RoleRel | null\n}\n\ninterface ApiCredentialUpdate extends ResourceUpdate {\n /**\n * The API credential internal name.\n * @example ```\"My app\"```\n */\n name?: string | null\n /**\n * The API credential redirect URI.\n * @example ```\"https://bluebrand.com/img/logo.svg\"```\n */\n redirect_uri?: string | null\n /**\n * The lifetime of the access token in seconds (min. `7200`, max. `31536000`. Default is `14400` for Sales channels and `7200` for other client types).\n * @example ```7200```\n */\n expires_in?: number | null\n\n role?: RoleRel | null\n}\n\nclass ApiCredentials extends ApiResource<ApiCredential> {\n static readonly TYPE: ApiCredentialType = 'api_credentials' as const\n\n async create(\n resource: ApiCredentialCreate,\n params?: QueryParamsRetrieve<ApiCredential>,\n options?: ResourcesConfig,\n ): Promise<ApiCredential> {\n return this.resources.create<ApiCredentialCreate, ApiCredential>(\n { ...resource, type: ApiCredentials.TYPE },\n params,\n options,\n )\n }\n\n async update(\n resource: ApiCredentialUpdate,\n params?: QueryParamsRetrieve<ApiCredential>,\n options?: ResourcesConfig,\n ): Promise<ApiCredential> {\n return this.resources.update<ApiCredentialUpdate, ApiCredential>(\n { ...resource, type: ApiCredentials.TYPE },\n params,\n options,\n )\n }\n\n async delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void> {\n await this.resources.delete(typeof id === 'string' ? { id, type: ApiCredentials.TYPE } : id, options)\n }\n\n async organization(\n apiCredentialId: string | ApiCredential,\n params?: QueryParamsRetrieve<Organization>,\n options?: ResourcesConfig,\n ): Promise<Organization> {\n const _apiCredentialId = (apiCredentialId as ApiCredential).id || (apiCredentialId as string)\n return this.resources.fetch<Organization>(\n { type: 'organizations' },\n `api_credentials/${_apiCredentialId}/organization`,\n params,\n options,\n ) as unknown as Organization\n }\n\n async role(\n apiCredentialId: string | ApiCredential,\n params?: QueryParamsRetrieve<Role>,\n options?: ResourcesConfig,\n ): Promise<Role> {\n const _apiCredentialId = (apiCredentialId as ApiCredential).id || (apiCredentialId as string)\n return this.resources.fetch<Role>(\n { type: 'roles' },\n `api_credentials/${_apiCredentialId}/role`,\n params,\n options,\n ) as unknown as Role\n }\n\n isApiCredential(resource: any): resource is ApiCredential {\n return resource.type && resource.type === ApiCredentials.TYPE\n }\n\n relationship(id: string | ResourceId | null): ApiCredentialRel {\n return super.relationshipOneToOne<ApiCredentialRel>(id)\n }\n\n relationshipToMany(...ids: string[]): ApiCredentialRel[] {\n return super.relationshipOneToMany<ApiCredentialRel>(...ids)\n }\n\n type(): ApiCredentialType {\n return ApiCredentials.TYPE\n }\n}\n\nconst instance = new ApiCredentials()\nexport default instance\n\nexport type { ApiCredential, ApiCredentialCreate, ApiCredentials, ApiCredentialType, ApiCredentialUpdate }\n"]}
1
+ {"version":3,"sources":["../gen/resources/api_credentials.ts"],"names":[],"mappings":";;;AA4IA,IAAM,cAAA,GAAN,MAAM,eAAA,SAAuB,WAAA,CAA2B;AAAA,EACtD,OAAgB,IAAA,GAA0B,iBAAA;AAAA,EAE1C,MAAM,MAAA,CACJ,QAAA,EACA,MAAA,EACA,OAAA,EACwB;AACxB,IAAA,OAAO,KAAK,SAAA,CAAU,MAAA;AAAA,MACpB,EAAE,GAAG,QAAA,EAAU,IAAA,EAAM,gBAAe,IAAA,EAAK;AAAA,MACzC,MAAA;AAAA,MACA;AAAA,KACF;AAAA,EACF;AAAA,EAEA,MAAM,MAAA,CACJ,QAAA,EACA,MAAA,EACA,OAAA,EACwB;AACxB,IAAA,OAAO,KAAK,SAAA,CAAU,MAAA;AAAA,MACpB,EAAE,GAAG,QAAA,EAAU,IAAA,EAAM,gBAAe,IAAA,EAAK;AAAA,MACzC,MAAA;AAAA,MACA;AAAA,KACF;AAAA,EACF;AAAA,EAEA,MAAM,MAAA,CAAO,EAAA,EAAyB,OAAA,EAA0C;AAC9E,IAAA,MAAM,IAAA,CAAK,SAAA,CAAU,MAAA,CAAO,OAAO,EAAA,KAAO,QAAA,GAAW,EAAE,EAAA,EAAI,IAAA,EAAM,eAAA,CAAe,IAAA,EAAK,GAAI,IAAI,OAAO,CAAA;AAAA,EACtG;AAAA,EAEA,MAAM,YAAA,CACJ,eAAA,EACA,MAAA,EACA,OAAA,EACuB;AACvB,IAAA,MAAM,gBAAA,GAAoB,gBAAkC,EAAA,IAAO,eAAA;AACnE,IAAA,OAAO,KAAK,SAAA,CAAU,KAAA;AAAA,MACpB,EAAE,MAAM,eAAA,EAAgB;AAAA,MACxB,mBAAmB,gBAAgB,CAAA,aAAA,CAAA;AAAA,MACnC,MAAA;AAAA,MACA;AAAA,KACF;AAAA,EACF;AAAA,EAEA,MAAM,IAAA,CACJ,eAAA,EACA,MAAA,EACA,OAAA,EACe;AACf,IAAA,MAAM,gBAAA,GAAoB,gBAAkC,EAAA,IAAO,eAAA;AACnE,IAAA,OAAO,KAAK,SAAA,CAAU,KAAA;AAAA,MACpB,EAAE,MAAM,OAAA,EAAQ;AAAA,MAChB,mBAAmB,gBAAgB,CAAA,KAAA,CAAA;AAAA,MACnC,MAAA;AAAA,MACA;AAAA,KACF;AAAA,EACF;AAAA,EAEA,gBAAgB,QAAA,EAA0C;AACxD,IAAA,OAAO,QAAA,CAAS,IAAA,IAAQ,QAAA,CAAS,IAAA,KAAS,eAAA,CAAe,IAAA;AAAA,EAC3D;AAAA,EAEA,aAAa,EAAA,EAAkD;AAC7D,IAAA,OAAO,KAAA,CAAM,qBAAuC,EAAE,CAAA;AAAA,EACxD;AAAA,EAEA,sBAAsB,GAAA,EAAmC;AACvD,IAAA,OAAO,KAAA,CAAM,qBAAA,CAAwC,GAAG,GAAG,CAAA;AAAA,EAC7D;AAAA,EAEA,IAAA,GAA0B;AACxB,IAAA,OAAO,eAAA,CAAe,IAAA;AAAA,EACxB;AACF,CAAA;AAEA,IAAM,QAAA,GAAW,IAAI,cAAA,EAAe;AACpC,IAAO,uBAAA,GAAQ","file":"chunk-7YEOUGXO.js","sourcesContent":["import type { QueryParamsRetrieve } from '@runtime/query'\nimport type {\n Resource,\n ResourceCreate,\n ResourceId,\n ResourceRel,\n ResourceSort,\n /* ResourceFilter */ ResourcesConfig,\n ResourceUpdate,\n} from '@runtime/resource'\nimport { ApiResource } from '@runtime/resource'\n\nimport type { Organization, OrganizationType } from './organizations'\nimport type { Role, RoleType } from './roles'\n\ntype ApiCredentialType = 'api_credentials'\ntype ApiCredentialRel = ResourceRel & { type: ApiCredentialType }\ntype OrganizationRel = ResourceRel & { type: OrganizationType }\ntype RoleRel = ResourceRel & { type: RoleType }\n\nexport type ApiCredentialSort = Pick<ApiCredential, 'id' | 'name' | 'mode'> & ResourceSort\n// export type ApiCredentialFilter = Pick<ApiCredential, 'id' | 'name' | 'kind' | 'confidential' | 'redirect_uri' | 'client_id' | 'scopes' | 'expires_in' | 'mode' | 'custom'> & ResourceFilter\n\n/**\n * The Api credential object is returned as part of the response body of each successful list, retrieve, create, update or delete API call to the /api/api_credentials endpoint.\n *\n * @link https://docs.commercelayer.io/provisioning-api-reference/api_credentials/object\n */\ninterface ApiCredential extends Resource {\n readonly type: ApiCredentialType\n\n /**\n * The API credential internal name.\n * @example ```\"My app\"```\n */\n name: string\n /**\n * The API credential kind, can be one of: `webapp`, `sales_channel`, `integration` or the kind of app you want to fork (e.g. `orders`, `imports`, etc.).\n * @example ```\"sales_channel\"```\n */\n kind: string\n /**\n * Indicates if the API credential it's confidential.\n * @example ```true```\n */\n confidential?: boolean | null\n /**\n * The API credential redirect URI.\n * @example ```\"https://bluebrand.com/img/logo.svg\"```\n */\n redirect_uri?: string | null\n /**\n * The API credential unique ID.\n * @example ```\"xxxx-yyyy-zzzz\"```\n */\n client_id?: string | null\n /**\n * The API credential unique secret.\n * @example ```\"xxxx-yyyy-zzzz\"```\n */\n client_secret?: string | null\n /**\n * The API credential scopes.\n * @example ```\"market:all market:9 market:122 market:6 stock_location:6 stock_location:33\"```\n */\n scopes?: string | null\n /**\n * The lifetime of the access token in seconds (min. `7200`, max. `31536000`. Default is `14400` for Sales channels and `7200` for other client types).\n * @example ```7200```\n */\n expires_in?: number | null\n /**\n * Indicates the environment the resource belongs to (one of `test` or `live`).\n * @example ```\"test\"```\n */\n mode?: string | null\n /**\n * Indicates if the API credential is used to create a custom app (e.g. fork a hosted app).\n */\n custom?: boolean | null\n\n organization?: Organization | null\n role?: Role | null\n}\n\ninterface ApiCredentialCreate extends ResourceCreate {\n /**\n * The API credential internal name.\n * @example ```\"My app\"```\n */\n name: string\n /**\n * The API credential kind, can be one of: `webapp`, `sales_channel`, `integration` or the kind of app you want to fork (e.g. `orders`, `imports`, etc.).\n * @example ```\"sales_channel\"```\n */\n kind: string\n /**\n * The API credential redirect URI.\n * @example ```\"https://bluebrand.com/img/logo.svg\"```\n */\n redirect_uri?: string | null\n /**\n * The lifetime of the access token in seconds (min. `7200`, max. `31536000`. Default is `14400` for Sales channels and `7200` for other client types).\n * @example ```7200```\n */\n expires_in?: number | null\n /**\n * Indicates the environment the resource belongs to (one of `test` or `live`).\n * @example ```\"test\"```\n */\n mode?: string | null\n /**\n * Indicates if the API credential is used to create a custom app (e.g. fork a hosted app).\n */\n custom?: boolean | null\n\n organization: OrganizationRel\n role?: RoleRel | null\n}\n\ninterface ApiCredentialUpdate extends ResourceUpdate {\n /**\n * The API credential internal name.\n * @example ```\"My app\"```\n */\n name?: string | null\n /**\n * The API credential redirect URI.\n * @example ```\"https://bluebrand.com/img/logo.svg\"```\n */\n redirect_uri?: string | null\n /**\n * The lifetime of the access token in seconds (min. `7200`, max. `31536000`. Default is `14400` for Sales channels and `7200` for other client types).\n * @example ```7200```\n */\n expires_in?: number | null\n\n role?: RoleRel | null\n}\n\nclass ApiCredentials extends ApiResource<ApiCredential> {\n static readonly TYPE: ApiCredentialType = 'api_credentials' as const\n\n async create(\n resource: ApiCredentialCreate,\n params?: QueryParamsRetrieve<ApiCredential>,\n options?: ResourcesConfig,\n ): Promise<ApiCredential> {\n return this.resources.create<ApiCredentialCreate, ApiCredential>(\n { ...resource, type: ApiCredentials.TYPE },\n params,\n options,\n )\n }\n\n async update(\n resource: ApiCredentialUpdate,\n params?: QueryParamsRetrieve<ApiCredential>,\n options?: ResourcesConfig,\n ): Promise<ApiCredential> {\n return this.resources.update<ApiCredentialUpdate, ApiCredential>(\n { ...resource, type: ApiCredentials.TYPE },\n params,\n options,\n )\n }\n\n async delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void> {\n await this.resources.delete(typeof id === 'string' ? { id, type: ApiCredentials.TYPE } : id, options)\n }\n\n async organization(\n apiCredentialId: string | ApiCredential,\n params?: QueryParamsRetrieve<Organization>,\n options?: ResourcesConfig,\n ): Promise<Organization> {\n const _apiCredentialId = (apiCredentialId as ApiCredential).id || (apiCredentialId as string)\n return this.resources.fetch<Organization>(\n { type: 'organizations' },\n `api_credentials/${_apiCredentialId}/organization`,\n params,\n options,\n ) as unknown as Organization\n }\n\n async role(\n apiCredentialId: string | ApiCredential,\n params?: QueryParamsRetrieve<Role>,\n options?: ResourcesConfig,\n ): Promise<Role> {\n const _apiCredentialId = (apiCredentialId as ApiCredential).id || (apiCredentialId as string)\n return this.resources.fetch<Role>(\n { type: 'roles' },\n `api_credentials/${_apiCredentialId}/role`,\n params,\n options,\n ) as unknown as Role\n }\n\n isApiCredential(resource: any): resource is ApiCredential {\n return resource.type && resource.type === ApiCredentials.TYPE\n }\n\n relationship(id: string | ResourceId | null): ApiCredentialRel {\n return super.relationshipOneToOne<ApiCredentialRel>(id)\n }\n\n relationshipToMany(...ids: string[]): ApiCredentialRel[] {\n return super.relationshipOneToMany<ApiCredentialRel>(...ids)\n }\n\n type(): ApiCredentialType {\n return ApiCredentials.TYPE\n }\n}\n\nconst instance = new ApiCredentials()\nexport default instance\n\nexport type { ApiCredential, ApiCredentialCreate, ApiCredentials, ApiCredentialType, ApiCredentialUpdate }\n"]}
@@ -1,5 +1,5 @@
1
- import { debug_default, ApiResourceAdapter, isApiError } from './chunk-4Z4U45XQ.js';
2
- import { API_SCHEMA_VERSION, API_SUPPORTED_VERSIONS } from './chunk-UB3WPGDV.js';
1
+ import { debug_default, ApiResourceAdapter, isApiError } from './chunk-GHXKZEH7.js';
2
+ import { API_SCHEMA_VERSION, API_SUPPORTED_VERSIONS } from './chunk-SQLX22US.js';
3
3
  import { getResources } from './chunk-YS5PCY5D.js';
4
4
 
5
5
  // src/commercelayer.ts
@@ -110,5 +110,5 @@ var CommerceLayerProvisioning = (config) => {
110
110
  var commercelayer_default = CommerceLayerProvisioning;
111
111
 
112
112
  export { CommerceLayerProvisioning, CommerceLayerProvisioningBaseClient, commercelayer_default };
113
- //# sourceMappingURL=chunk-E2ERI2EX.js.map
114
- //# sourceMappingURL=chunk-E2ERI2EX.js.map
113
+ //# sourceMappingURL=chunk-CWXGTX7W.js.map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,MACb,OAAA,EAAS,MAAA;AAAA,MACT,EAAA,EAAI;AAAA,KACN;AAEA,IAAA,eAAe,uBAAuB,QAAA,EAA6C;AACjF,MAAA,MAAA,CAAO,WAAA,GAAc,MAAM,QAAA,EACvB,KAAA,GACD,IAAA,EAAK,CACL,MAAM,MAAM;AAAA,MAAC,CAAC,CAAA;AACjB,MAAA,MAAA,CAAO,KAAK,QAAA,CAAS,EAAA;AACrB,MAAA,IAAI,SAAS,OAAA,EAAS;AACpB,QAAA,MAAM,KAAiB,EAAC;AACxB,QAAA,QAAA,CAAS,OAAA,CAAQ,OAAA,CAAQ,CAAC,KAAA,EAAO,GAAA,KAAQ;AACvC,UAAA,EAAA,CAAG,GAAG,CAAA,GAAI,KAAA;AAAA,QACZ,CAAC,CAAA;AACD,QAAA,MAAA,CAAO,OAAA,GAAU,EAAA;AAAA,MACnB;AACA,MAAA,OAAO,QAAA;AAAA,IACT;AAE0B,IAAA,IAAA,CAAK,aAAa,SAAA,GAAY;AAAA,MACtD,SAAA,EAAW,sBAAA;AAAA,MACX,SAAA,EAAW;AAAA,KACb;AACA,IAAA,MAAA,CAAO,EAAA,GAAK,CAAA;AAEZ,IAAA,OAAO,MAAA;AAAA,EACT;AAAA,EAEA,uBAAA,GAAwE;AAKtE,IAAA,IAAA,CAAK,aAAa,SAAA,GAAY,MAAA;AAAA,EAChC;AACF;AAEA,IAAM,yBAAA,GAA4B,CAAC,MAAA,KAAyE;AAC1G,EAAA,OAAO,mCAAA,CAAoC,IAAI,MAAM,CAAA;AACvD;AAEA,IAAO,qBAAA,GAAQ","file":"chunk-E2ERI2EX.js","sourcesContent":["import Debug from '@runtime/debug'\nimport { type ApiError, isApiError } from '@runtime/error'\nimport type {\n ErrorInterceptor,\n HeadersObj,\n InterceptorManager,\n InterceptorType,\n RawResponseReader,\n RequestInterceptor,\n ResponseInterceptor,\n ResponseObj,\n} from '@runtime/interceptor'\nimport { ApiResourceAdapter, type ResourceAdapter, type ResourcesInitConfig } from '@runtime/resource'\n// import * as api from '../gen/api'\nimport { getResources } from '../gen/enum'\nimport { API_SCHEMA_VERSION, API_SUPPORTED_VERSIONS, type ApiVersion, SDK_VERSION } from '../gen/version'\n\nconst debug = Debug('commercelayer')\n\nexport { API_SCHEMA_VERSION, API_SUPPORTED_VERSIONS, type ApiVersion, SDK_VERSION }\n\n// SDK local configuration\ntype SdkConfig = {\n /** Set to `false` to omit the `X-CL-SDK` request header that identifies the SDK and its version. Defaults to `true`. */\n telemetry?: boolean\n}\n\n/**\n * The `apiVersion` init option, conditioned on how the SDK was generated:\n * - **Version-aware (unified) builds** — {@link API_SUPPORTED_VERSIONS} is\n * non-empty — **require** `apiVersion`. The chosen value becomes a URL path\n * segment (`/api/2026-05/orders`), keeping requests aligned with the version\n * the types were generated for.\n * - **Legacy builds** — empty {@link API_SUPPORTED_VERSIONS}, so {@link ApiVersion}\n * is `never` — take **no** `apiVersion` argument. The API is unversioned\n * (`/api/orders`).\n */\ntype ApiVersionConfig = [ApiVersion] extends [never] ? { apiVersion?: never } : { apiVersion: ApiVersion }\n\ntype CommerceLayerInitConfig = SdkConfig & ApiVersionConfig & ResourcesInitConfig\ntype CommerceLayerConfig = Partial<CommerceLayerInitConfig>\n\nclass CommerceLayerProvisioningBaseClient {\n readonly apiSchemaVersion = API_SCHEMA_VERSION\n readonly apiSupportedVersions = API_SUPPORTED_VERSIONS\n\n protected static cl: CommerceLayerProvisioningBaseClient\n\n static get(config?: CommerceLayerInitConfig): CommerceLayerProvisioningBaseClient {\n if (config) return (CommerceLayerProvisioningBaseClient.cl = new CommerceLayerProvisioningBaseClient(config))\n else if (!CommerceLayerProvisioningBaseClient.cl)\n throw new Error('CommerceLayerProvisioning client not initialized')\n return CommerceLayerProvisioningBaseClient.cl\n }\n\n // The ResourceAdapter created for this specific client instance. Every\n // `CommerceLayerProvisioning(config)` call builds a fresh adapter (its own ApiClient\n // with its own access token). The bundle client reads this so two clients\n // stay isolated; see the `adapter` seam below.\n protected readonly instanceAdapter: ResourceAdapter\n\n protected constructor(config: CommerceLayerInitConfig) {\n debug('new commercelayer instance %O', config)\n\n // `init` builds a new adapter AND sets the process-global static one.\n // We keep the return value so the bundle can bind resources to this\n // exact adapter; the static assignment stays for the plain SDK, whose\n // directly-imported resource singletons resolve through it.\n this.instanceAdapter = ApiResourceAdapter.init(config)\n }\n\n // Adapter seam. The base (plain SDK) reports the process-global static\n // adapter so `config()` and the getters below stay in sync with the\n // directly-imported resource singletons — unchanged behaviour. The bundle\n // overrides this to return its own `instanceAdapter`, isolating clients.\n protected get adapter(): ResourceAdapter {\n return ApiResourceAdapter.get()\n }\n\n get currentOrganization(): string {\n return this.adapter.client?.currentOrganization\n }\n get currentAccessToken(): string {\n return this.adapter.client?.currentAccessToken\n }\n /** The API version pinned via `apiVersion`, or `undefined` when requests are unversioned. */\n get currentApiVersion(): string | undefined {\n return this.adapter.client?.currentApiVersion\n }\n private get interceptors(): InterceptorManager {\n return this.adapter.client?.interceptors\n }\n\n private localConfig(_config: Partial<SdkConfig>): void {\n // if (config.abc) this.abc = config.abc\n }\n\n config(config: CommerceLayerConfig): this {\n debug('config %o', config)\n\n // CommerceLayerProvisioning config\n this.localConfig(config)\n // ResourceAdapter config\n this.adapter.config(config)\n\n return this\n }\n\n resources(sort?: boolean): readonly string[] {\n return getResources(sort)\n }\n\n isApiError(error: any): error is ApiError {\n return isApiError(error)\n }\n\n addRequestInterceptor(onSuccess?: RequestInterceptor, onFailure?: ErrorInterceptor): number {\n this.interceptors.request = { onSuccess, onFailure }\n return 1\n }\n\n addResponseInterceptor(onSuccess?: ResponseInterceptor, onFailure?: ErrorInterceptor): number {\n this.interceptors.response = { onSuccess, onFailure }\n return 1\n }\n\n removeInterceptor(type: InterceptorType, _id: number = 1): void {\n this.interceptors[type] = undefined\n }\n\n removeInterceptors(): void {\n this.removeInterceptor('request')\n this.removeInterceptor('response')\n this.removeRawResponseReader()\n }\n\n addRawResponseReader(options?: { headers: boolean }): RawResponseReader {\n const reader: RawResponseReader = {\n id: 0,\n rawResponse: undefined,\n headers: undefined,\n ok: true,\n }\n\n async function rawResponseInterceptor(response: ResponseObj): Promise<ResponseObj> {\n reader.rawResponse = await response\n ?.clone()\n .json()\n .catch(() => {})\n reader.ok = response.ok\n if (options?.headers) {\n const ho: HeadersObj = {}\n response.headers.forEach((value, key) => {\n ho[key] = value\n })\n reader.headers = ho\n }\n return response\n }\n\n /* const interceptor = */ this.interceptors.rawReader = {\n onSuccess: rawResponseInterceptor,\n onFailure: rawResponseInterceptor,\n }\n reader.id = 1 // interceptor\n\n return reader\n }\n\n removeRawResponseReader(/* reader: number | RawResponseReader */): void {\n /*\n\t\tconst id = (typeof reader === 'number') ? reader : reader?.id\n\t\tif (id && (id >= 0)) this.removeInterceptor('response', id)\n\t\t*/\n this.interceptors.rawReader = undefined\n }\n}\n\nconst CommerceLayerProvisioning = (config: CommerceLayerInitConfig): CommerceLayerProvisioningBaseClient => {\n return CommerceLayerProvisioningBaseClient.get(config)\n}\n\nexport default CommerceLayerProvisioning\nexport type { CommerceLayerConfig, CommerceLayerInitConfig }\nexport { CommerceLayerProvisioning, CommerceLayerProvisioningBaseClient }\n"]}
1
+ {"version":3,"sources":["../src/commercelayer.ts"],"names":[],"mappings":";;;;;AAiBA,IAAM,KAAA,GAAQ,cAAM,eAAe,CAAA;AAyBnC,IAAM,mCAAA,GAAN,MAAM,oCAAA,CAAoC;AAAA,EAC/B,gBAAA,GAAmB,kBAAA;AAAA,EACnB,oBAAA,GAAuB,sBAAA;AAAA,EAEhC,OAAiB,EAAA;AAAA,EAEjB,OAAO,IAAI,MAAA,EAAuE;AAChF,IAAA,IAAI,QAAQ,OAAQ,oCAAA,CAAoC,EAAA,GAAK,IAAI,qCAAoC,MAAM,CAAA;AAAA,SAAA,IAClG,CAAC,oCAAA,CAAoC,EAAA;AAC5C,MAAA,MAAM,IAAI,MAAM,kDAAkD,CAAA;AACpE,IAAA,OAAO,oCAAA,CAAoC,EAAA;AAAA,EAC7C;AAAA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AA,IACT;AAE0B,IAAA,IAAA,CAAK,aAAa,SAAA,GAAY;AAAA,MACtD,SAAA,EAAW,sBAAA;AAAA,MACX,SAAA,EAAW;AAAA,KACb;AACA,IAAA,MAAA,CAAO,EAAA,GAAK,CAAA;AAEZ,IAAA,OAAO,MAAA;AAAA,EACT;AAAA,EAEA,uBAAA,GAAwE;AAKtE,IAAA,IAAA,CAAK,aAAa,SAAA,GAAY,MAAA;AAAA,EAChC;AACF;AAEA,IAAM,yBAAA,GAA4B,CAAC,MAAA,KAAyE;AAC1G,EAAA,OAAO,mCAAA,CAAoC,IAAI,MAAM,CAAA;AACvD;AAEA,IAAO,qBAAA,GAAQ","file":"chunk-CWXGTX7W.js","sourcesContent":["import Debug from '@runtime/debug'\nimport { type ApiError, isApiError } from '@runtime/error'\nimport type {\n ErrorInterceptor,\n HeadersObj,\n InterceptorManager,\n InterceptorType,\n RawResponseReader,\n RequestInterceptor,\n ResponseInterceptor,\n ResponseObj,\n} from '@runtime/interceptor'\nimport { ApiResourceAdapter, type ResourceAdapter, type ResourcesInitConfig } from '@runtime/resource'\n// import * as api from '../gen/api'\nimport { getResources } from '../gen/enum'\nimport { API_SCHEMA_VERSION, API_SUPPORTED_VERSIONS, type ApiVersion, SDK_VERSION } from '../gen/version'\n\nconst debug = Debug('commercelayer')\n\nexport { API_SCHEMA_VERSION, API_SUPPORTED_VERSIONS, type ApiVersion, SDK_VERSION }\n\n// SDK local configuration\ntype SdkConfig = {\n /** Set to `false` to omit the `X-CL-SDK` request header that identifies the SDK and its version. Defaults to `true`. */\n telemetry?: boolean\n}\n\n/**\n * The `apiVersion` init option, conditioned on how the SDK was generated:\n * - **Version-aware (unified) builds** — {@link API_SUPPORTED_VERSIONS} is\n * non-empty — **require** `apiVersion`. The chosen value becomes a URL path\n * segment (`/api/2026-05/orders`), keeping requests aligned with the version\n * the types were generated for.\n * - **Legacy builds** — empty {@link API_SUPPORTED_VERSIONS}, so {@link ApiVersion}\n * is `never` — take **no** `apiVersion` argument. The API is unversioned\n * (`/api/orders`).\n */\ntype ApiVersionConfig = [ApiVersion] extends [never] ? { apiVersion?: never } : { apiVersion: ApiVersion }\n\ntype CommerceLayerInitConfig = SdkConfig & ApiVersionConfig & ResourcesInitConfig\ntype CommerceLayerConfig = Partial<CommerceLayerInitConfig>\n\nclass CommerceLayerProvisioningBaseClient {\n readonly apiSchemaVersion = API_SCHEMA_VERSION\n readonly apiSupportedVersions = API_SUPPORTED_VERSIONS\n\n protected static cl: CommerceLayerProvisioningBaseClient\n\n static get(config?: CommerceLayerInitConfig): CommerceLayerProvisioningBaseClient {\n if (config) return (CommerceLayerProvisioningBaseClient.cl = new CommerceLayerProvisioningBaseClient(config))\n else if (!CommerceLayerProvisioningBaseClient.cl)\n throw new Error('CommerceLayerProvisioning client not initialized')\n return CommerceLayerProvisioningBaseClient.cl\n }\n\n // The ResourceAdapter created for this specific client instance. Every\n // `CommerceLayerProvisioning(config)` call builds a fresh adapter (its own ApiClient\n // with its own access token). The bundle client reads this so two clients\n // stay isolated; see the `adapter` seam below.\n protected readonly instanceAdapter: ResourceAdapter\n\n protected constructor(config: CommerceLayerInitConfig) {\n debug('new commercelayer instance %O', config)\n\n // `init` builds a new adapter AND sets the process-global static one.\n // We keep the return value so the bundle can bind resources to this\n // exact adapter; the static assignment stays for the plain SDK, whose\n // directly-imported resource singletons resolve through it.\n this.instanceAdapter = ApiResourceAdapter.init(config)\n }\n\n // Adapter seam. The base (plain SDK) reports the process-global static\n // adapter so `config()` and the getters below stay in sync with the\n // directly-imported resource singletons — unchanged behaviour. The bundle\n // overrides this to return its own `instanceAdapter`, isolating clients.\n protected get adapter(): ResourceAdapter {\n return ApiResourceAdapter.get()\n }\n\n get currentOrganization(): string {\n return this.adapter.client?.currentOrganization\n }\n get currentAccessToken(): string {\n return this.adapter.client?.currentAccessToken\n }\n /** The API version pinned via `apiVersion`, or `undefined` when requests are unversioned. */\n get currentApiVersion(): string | undefined {\n return this.adapter.client?.currentApiVersion\n }\n private get interceptors(): InterceptorManager {\n return this.adapter.client?.interceptors\n }\n\n private localConfig(_config: Partial<SdkConfig>): void {\n // if (config.abc) this.abc = config.abc\n }\n\n config(config: CommerceLayerConfig): this {\n debug('config %o', config)\n\n // CommerceLayerProvisioning config\n this.localConfig(config)\n // ResourceAdapter config\n this.adapter.config(config)\n\n return this\n }\n\n resources(sort?: boolean): readonly string[] {\n return getResources(sort)\n }\n\n isApiError(error: any): error is ApiError {\n return isApiError(error)\n }\n\n addRequestInterceptor(onSuccess?: RequestInterceptor, onFailure?: ErrorInterceptor): number {\n this.interceptors.request = { onSuccess, onFailure }\n return 1\n }\n\n addResponseInterceptor(onSuccess?: ResponseInterceptor, onFailure?: ErrorInterceptor): number {\n this.interceptors.response = { onSuccess, onFailure }\n return 1\n }\n\n removeInterceptor(type: InterceptorType, _id: number = 1): void {\n this.interceptors[type] = undefined\n }\n\n removeInterceptors(): void {\n this.removeInterceptor('request')\n this.removeInterceptor('response')\n this.removeRawResponseReader()\n }\n\n addRawResponseReader(options?: { headers: boolean }): RawResponseReader {\n const reader: RawResponseReader = {\n id: 0,\n rawResponse: undefined,\n headers: undefined,\n ok: true,\n }\n\n async function rawResponseInterceptor(response: ResponseObj): Promise<ResponseObj> {\n reader.rawResponse = await response\n ?.clone()\n .json()\n .catch(() => {})\n reader.ok = response.ok\n if (options?.headers) {\n const ho: HeadersObj = {}\n response.headers.forEach((value, key) => {\n ho[key] = value\n })\n reader.headers = ho\n }\n return response\n }\n\n /* const interceptor = */ this.interceptors.rawReader = {\n onSuccess: rawResponseInterceptor,\n onFailure: rawResponseInterceptor,\n }\n reader.id = 1 // interceptor\n\n return reader\n }\n\n removeRawResponseReader(/* reader: number | RawResponseReader */): void {\n /*\n\t\tconst id = (typeof reader === 'number') ? reader : reader?.id\n\t\tif (id && (id >= 0)) this.removeInterceptor('response', id)\n\t\t*/\n this.interceptors.rawReader = undefined\n }\n}\n\nconst CommerceLayerProvisioning = (config: CommerceLayerInitConfig): CommerceLayerProvisioningBaseClient => {\n return CommerceLayerProvisioningBaseClient.get(config)\n}\n\nexport default CommerceLayerProvisioning\nexport type { CommerceLayerConfig, CommerceLayerInitConfig }\nexport { CommerceLayerProvisioning, CommerceLayerProvisioningBaseClient }\n"]}
@@ -1,9 +1,9 @@
1
1
  'use strict';
2
2
 
3
- var chunkF2RLD5SN_cjs = require('./chunk-F2RLD5SN.cjs');
3
+ var chunkEVDEBFHZ_cjs = require('./chunk-EVDEBFHZ.cjs');
4
4
 
5
5
  // gen/resources/versions.ts
6
- var Versions = class _Versions extends chunkF2RLD5SN_cjs.ApiResource {
6
+ var Versions = class _Versions extends chunkEVDEBFHZ_cjs.ApiResource {
7
7
  static TYPE = "versions";
8
8
  isVersion(resource) {
9
9
  return resource.type && resource.type === _Versions.TYPE;
@@ -22,5 +22,5 @@ var instance = new Versions();
22
22
  var versions_default = instance;
23
23
 
24
24
  exports.versions_default = versions_default;
25
- //# sourceMappingURL=chunk-HAZ53WDW.cjs.map
26
- //# sourceMappingURL=chunk-HAZ53WDW.cjs.map
25
+ //# sourceMappingURL=chunk-DYMRH6LP.cjs.map
26
+ //# sourceMappingURL=chunk-DYMRH6LP.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../gen/resources/versions.ts"],"names":["ApiResource"],"mappings":";;;;;AA4CA,IAAM,QAAA,GAAN,MAAM,SAAA,SAAiBA,6BAAA,CAAqB;AAAA,EAC1C,OAAgB,IAAA,GAAoB,UAAA;AAAA,EAEpC,UAAU,QAAA,EAAoC;AAC5C,IAAA,OAAO,QAAA,CAAS,IAAA,IAAQ,QAAA,CAAS,IAAA,KAAS,SAAA,CAAS,IAAA;AAAA,EACrD;AAAA,EAEA,aAAa,EAAA,EAA4C;AACvD,IAAA,OAAO,KAAA,CAAM,qBAAiC,EAAE,CAAA;AAAA,EAClD;AAAA,EAEA,sBAAsB,GAAA,EAA6B;AACjD,IAAA,OAAO,KAAA,CAAM,qBAAA,CAAkC,GAAG,GAAG,CAAA;AAAA,EACvD;AAAA,EAEA,IAAA,GAAoB;AAClB,IAAA,OAAO,SAAA,CAAS,IAAA;AAAA,EAClB;AACF,CAAA;AAEA,IAAM,QAAA,GAAW,IAAI,QAAA,EAAS;AAC9B,IAAO,gBAAA,GAAQ","file":"chunk-HAZ53WDW.cjs","sourcesContent":["import type { Resource, ResourceId, ResourceRel, ResourceSort /* ResourceFilter */ } from '@runtime/resource'\nimport { ApiResource } from '@runtime/resource'\n\ntype VersionType = 'versions'\ntype VersionRel = ResourceRel & { type: VersionType }\n\nexport type VersionSort = Pick<Version, 'id'> & ResourceSort\n// export type VersionFilter = Pick<Version, 'id' | 'resource_type' | 'resource_id'> & ResourceFilter\n\n/**\n * The Version object is returned as part of the response body of each successful list or retrieve API call to the /api/versions endpoint.\n *\n * @link https://docs.commercelayer.io/provisioning-api-reference/versions/object\n */\ninterface Version extends Resource {\n readonly type: VersionType\n\n /**\n * The type of the versioned resource.\n * @example ```\"roles\"```\n */\n resource_type?: string | null\n /**\n * The versioned resource ID.\n * @example ```\"PzdJhdLdYV\"```\n */\n resource_id?: string | null\n /**\n * The event which generates the version.\n * @example ```\"update\"```\n */\n event?: string | null\n /**\n * The object changes payload.\n * @example ```{\"name\":[\"previous\",\"new\"]}```\n */\n changes?: Record<string, any> | null\n /**\n * Information about who triggered the change, only showed when it's from a JWT token.\n * @example ```{\"application\":{\"id\":\"DNOPYiZYpn\",\"kind\":\"integration\",\"public\":true}}```\n */\n who?: Record<string, any> | null\n}\n\nclass Versions extends ApiResource<Version> {\n static readonly TYPE: VersionType = 'versions' as const\n\n isVersion(resource: any): resource is Version {\n return resource.type && resource.type === Versions.TYPE\n }\n\n relationship(id: string | ResourceId | null): VersionRel {\n return super.relationshipOneToOne<VersionRel>(id)\n }\n\n relationshipToMany(...ids: string[]): VersionRel[] {\n return super.relationshipOneToMany<VersionRel>(...ids)\n }\n\n type(): VersionType {\n return Versions.TYPE\n }\n}\n\nconst instance = new Versions()\nexport default instance\n\nexport type { Version, Versions, VersionType }\n"]}
1
+ {"version":3,"sources":["../gen/resources/versions.ts"],"names":["ApiResource"],"mappings":";;;;;AA4CA,IAAM,QAAA,GAAN,MAAM,SAAA,SAAiBA,6BAAA,CAAqB;AAAA,EAC1C,OAAgB,IAAA,GAAoB,UAAA;AAAA,EAEpC,UAAU,QAAA,EAAoC;AAC5C,IAAA,OAAO,QAAA,CAAS,IAAA,IAAQ,QAAA,CAAS,IAAA,KAAS,SAAA,CAAS,IAAA;AAAA,EACrD;AAAA,EAEA,aAAa,EAAA,EAA4C;AACvD,IAAA,OAAO,KAAA,CAAM,qBAAiC,EAAE,CAAA;AAAA,EAClD;AAAA,EAEA,sBAAsB,GAAA,EAA6B;AACjD,IAAA,OAAO,KAAA,CAAM,qBAAA,CAAkC,GAAG,GAAG,CAAA;AAAA,EACvD;AAAA,EAEA,IAAA,GAAoB;AAClB,IAAA,OAAO,SAAA,CAAS,IAAA;AAAA,EAClB;AACF,CAAA;AAEA,IAAM,QAAA,GAAW,IAAI,QAAA,EAAS;AAC9B,IAAO,gBAAA,GAAQ","file":"chunk-DYMRH6LP.cjs","sourcesContent":["import type { Resource, ResourceId, ResourceRel, ResourceSort /* ResourceFilter */ } from '@runtime/resource'\nimport { ApiResource } from '@runtime/resource'\n\ntype VersionType = 'versions'\ntype VersionRel = ResourceRel & { type: VersionType }\n\nexport type VersionSort = Pick<Version, 'id'> & ResourceSort\n// export type VersionFilter = Pick<Version, 'id' | 'resource_type' | 'resource_id'> & ResourceFilter\n\n/**\n * The Version object is returned as part of the response body of each successful list or retrieve API call to the /api/versions endpoint.\n *\n * @link https://docs.commercelayer.io/provisioning-api-reference/versions/object\n */\ninterface Version extends Resource {\n readonly type: VersionType\n\n /**\n * The type of the versioned resource.\n * @example ```\"roles\"```\n */\n resource_type?: string | null\n /**\n * The versioned resource ID.\n * @example ```\"PzdJhdLdYV\"```\n */\n resource_id?: string | null\n /**\n * The event which generates the version.\n * @example ```\"update\"```\n */\n event?: string | null\n /**\n * The object changes payload.\n * @example ```{\"name\":[\"previous\",\"new\"]}```\n */\n changes?: Record<string, any> | null\n /**\n * Information about who triggered the change, only showed when it's from a JWT token.\n * @example ```{\"application\":{\"id\":\"DNOPYiZYpn\",\"kind\":\"integration\",\"public\":true}}```\n */\n who?: Record<string, any> | null\n}\n\nclass Versions extends ApiResource<Version> {\n static readonly TYPE: VersionType = 'versions' as const\n\n isVersion(resource: any): resource is Version {\n return resource.type && resource.type === Versions.TYPE\n }\n\n relationship(id: string | ResourceId | null): VersionRel {\n return super.relationshipOneToOne<VersionRel>(id)\n }\n\n relationshipToMany(...ids: string[]): VersionRel[] {\n return super.relationshipOneToMany<VersionRel>(...ids)\n }\n\n type(): VersionType {\n return Versions.TYPE\n }\n}\n\nconst instance = new Versions()\nexport default instance\n\nexport type { Version, Versions, VersionType }\n"]}
@@ -1,4 +1,4 @@
1
- import { ApiResource } from './chunk-4Z4U45XQ.js';
1
+ import { ApiResource } from './chunk-GHXKZEH7.js';
2
2
 
3
3
  // gen/resources/organizations.ts
4
4
  var Organizations = class _Organizations extends ApiResource {
@@ -74,5 +74,5 @@ var instance = new Organizations();
74
74
  var organizations_default = instance;
75
75
 
76
76
  export { organizations_default };
77
- //# sourceMappingURL=chunk-FWF7HBWB.js.map
78
- //# sourceMappingURL=chunk-FWF7HBWB.js.map
77
+ //# sourceMappingURL=chunk-ECGUWRRG.js.map
78
+ //# sourceMappingURL=chunk-ECGUWRRG.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../gen/resources/organizations.ts"],"names":[],"mappings":";;;AAgcA,IAAM,aAAA,GAAN,MAAM,cAAA,SAAsB,WAAA,CAA0B;AAAA,EACpD,OAAgB,IAAA,GAAyB,eAAA;AAAA,EAEzC,MAAM,MAAA,CACJ,QAAA,EACA,MAAA,EACA,OAAA,EACuB;AACvB,IAAA,OAAO,KAAK,SAAA,CAAU,MAAA;AAAA,MACpB,EAAE,GAAG,QAAA,EAAU,IAAA,EAAM,eAAc,IAAA,EAAK;A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MAAM,eAAA,GAAmB,eAAgC,EAAA,IAAO,cAAA;AAChE,IAAA,OAAO,KAAK,SAAA,CAAU,KAAA;AAAA,MACpB,EAAE,MAAM,iBAAA,EAAkB;AAAA,MAC1B,iBAAiB,eAAe,CAAA,gBAAA,CAAA;AAAA,MAChC,MAAA;AAAA,MACA;AAAA,KACF;AAAA,EACF;AAAA,EAEA,MAAM,kBAAA,CACJ,cAAA,EACA,OAAA,EACA,OAAA,EACe;AACf,IAAA,MAAM,eAAA,GAAmB,eAAgC,EAAA,IAAO,cAAA;AAChE,IAAA,MAAM,IAAA,CAAK,SAAA,CAAU,MAAA,CAAO,OAAA,EAAS,CAAA,cAAA,EAAiB,eAAe,CAAA,mBAAA,CAAA,EAAuB,EAAE,GAAG,OAAA,EAAQ,EAAG,OAAO,CAAA;AAAA,EACrH;AAAA,EAEA,eAAe,QAAA,EAAyC;AACtD,IAAA,OAAO,QAAA,CAAS,IAAA,IAAQ,QAAA,CAAS,IAAA,KAAS,cAAA,CAAc,IAAA;AAAA,EAC1D;AAAA,EAEA,aAAa,EAAA,EAAiD;AAC5D,IAAA,OAAO,KAAA,CAAM,qBAAsC,EAAE,CAAA;AAAA,EACvD;AAAA,EAEA,sBAAsB,GAAA,EAAkC;AACtD,IAAA,OAAO,KAAA,CAAM,qBAAA,CAAuC,GAAG,GAAG,CAAA;AAAA,EAC5D;AAAA,EAEA,IAAA,GAAyB;AACvB,IAAA,OAAO,cAAA,CAAc,IAAA;AAAA,EACvB;AACF,CAAA;AAEA,IAAM,QAAA,GAAW,IAAI,aAAA,EAAc;AACnC,IAAO,qBAAA,GAAQ","file":"chunk-FWF7HBWB.js","sourcesContent":["import type { QueryParamsList, QueryParamsRetrieve } from '@runtime/query'\nimport type {\n ListResponse,\n Resource,\n ResourceCreate,\n ResourceId,\n ResourceRel,\n ResourceSort,\n /* ResourceFilter */ ResourcesConfig,\n ResourceUpdate,\n} from '@runtime/resource'\nimport { ApiResource } from '@runtime/resource'\nimport type { TransferOwnershipDataType } from '../../src/actions'\nimport type { ApiCredential } from './api_credentials'\nimport type { Membership } from './memberships'\nimport type { Permission } from './permissions'\nimport type { Role } from './roles'\n\ntype OrganizationType = 'organizations'\ntype OrganizationRel = ResourceRel & { type: OrganizationType }\n\nexport type OrganizationSort = Pick<Organization, 'id' | 'name' | 'slug' | 'domain'> & ResourceSort\n// export type OrganizationFilter = Pick<Organization, 'id' | 'name' | 'slug' | 'domain' | 'contrast_color' | 'region'> & ResourceFilter\n\n/**\n * The Organization object is returned as part of the response body of each successful list, retrieve, create or update API call to the /api/organizations endpoint.\n *\n * @link https://docs.commercelayer.io/provisioning-api-reference/organizations/object\n */\ninterface Organization extends Resource {\n readonly type: OrganizationType\n\n /**\n * The organization's internal name.\n * @example ```\"The Blue Brand\"```\n */\n name: string\n /**\n * The organization's slug name.\n * @example ```\"the-blue-brand\"```\n */\n slug?: string | null\n /**\n * The organization's domain.\n * @example ```\"the-blue-brand.commercelayer.io\"```\n */\n domain?: string | null\n /**\n * The organization's support phone.\n * @example ```\"+01 30800857\"```\n */\n support_phone?: string | null\n /**\n * The organization's support email.\n * @example ```\"support@bluebrand.com\"```\n */\n support_email?: string | null\n /**\n * The URL to the organization's logo.\n * @example ```\"https://bluebrand.com/img/logo.svg\"```\n */\n logo_url?: string | null\n /**\n * The URL to the organization's favicon.\n * @example ```\"https://bluebrand.com/img/favicon.ico\"```\n */\n favicon_url?: string | null\n /**\n * The organization's primary color.\n * @example ```\"#C8984E\"```\n */\n primary_color?: string | null\n /**\n * The organization's contrast color. Format is HEX (starts with `#` and is followed by six letters and/or numbers).\n * @example ```\"#FFFFCC\"```\n */\n contrast_color?: string | null\n /**\n * The organization's Google Tag Manager ID.\n * @example ```\"GTM-5FJXX6\"```\n */\n gtm_id?: string | null\n /**\n * The organization's Google Tag Manager ID for test.\n * @example ```\"GTM-5FJXX7\"```\n */\n gtm_id_test?: string | null\n /**\n * The region where the organization is located. The default value is `eu-west-1`.\n * @example ```\"eu-west-1\"```\n */\n region?: string | null\n /**\n * Indicates if the organization can switch to live mode.\n */\n can_switch_live?: boolean | null\n /**\n * Information about the current subscription such as the plan type, limits, and subscription totals counter.\n * @example ```{\"plan_type\":\"growth\",\"limits\":{\"markets\":5,\"skus\":10000,\"organizations\":2,\"memberships\":5},\"totals\":{\"organizations\":1,\"markets\":0,\"memberships\":2,\"skus\":0}}```\n */\n subscription_info?: Record<string, any> | null\n /**\n * The organization's configuration.\n * @example ```{\"mfe\":{\"language\":\"it-IT\",\"default\":{\"links\":{\"cart\":\"https://cart.example.com/:order_id?accessToken=:access_token\",\"checkout\":\"https://checkout.example.com/:order_id?accessToken=:access_token\",\"identity\":\"https://example.com/login\",\"microstore\":\"https://example.com/microstore/?accessToken=:access_token\",\"my_account\":\"https://example.com/my-custom-account?accessToken=:access_token\"},\"checkout\":{\"optional_billing_info\":false,\"thankyou_page\":\"https://example.com/thanks/:lang/:order_id\",\"billing_countries\":[{\"value\":\"ES\",\"label\":\"Espana\"},{\"value\":\"IT\",\"label\":\"Italia\"},{\"value\":\"US\",\"label\":\"Unites States of America\"}],\"shipping_countries\":[{\"value\":\"ES\",\"label\":\"Espana\"},{\"value\":\"IT\",\"label\":\"Italia\"},{\"value\":\"US\",\"label\":\"Unites States of America\"}],\"billing_states\":{\"FR\":[{\"value\":\"PA\",\"label\":\"Paris\"},{\"value\":\"LY\",\"label\":\"Lyon\"},{\"value\":\"NI\",\"label\":\"Nice\"},{\"value\":\"MA\",\"label\":\"Marseille\"},{\"value\":\"BO\",\"label\":\"Bordeaux\"}]},\"shipping_states\":{\"FR\":[{\"value\":\"PA\",\"label\":\"Paris\"},{\"value\":\"LY\",\"label\":\"Lyon\"},{\"value\":\"NI\",\"label\":\"Nice\"},{\"value\":\"MA\",\"label\":\"Marseille\"},{\"value\":\"BO\",\"label\":\"Bordeaux\"}]},\"default_country\":\"US\"},\"urls\":{\"privacy\":\"https://example.com/privacy/:lang\",\"terms\":\"https://example.com/terms/:lang\"}},\"market:id:ZKcv13rT\":{\"links\":{\"cart\":\"https://example.com/custom-cart/:order_id?accessToken=:access_token\"},\"checkout\":{\"thankyou_page\":\"https://example.com/thanks/:order_id\"}}},\"well-known\":{\"shopping\":{\"catalog_mcp_url\":\"https://catalog-mcp.example.com/mcp\",\"client_id\":\"abc123example\",\"locale_scopes\":{\"it-IT\":{\"id\":\"ZKcv13rT\"},\"en-US\":{\"id\":\"ZKcv13rT\"}},\"ui\":{\"domain\":\"\",\"csp\":{\"resourceDomains\":[\"https://data.commercelayer.app\",\"https://cdn.brand.com\"],\"baseUriDomains\":[],\"connectDomains\":[],\"frameDomains\":[]}}}}}```\n */\n config?: Record<string, any> | null\n /**\n * Enables the redirect on the new Auth API.\n * @example ```true```\n */\n api_auth_redirect?: boolean | null\n /**\n * Enables fragment caching for resources with related directive.\n */\n api_fragment_caching_enabled?: boolean | null\n /**\n * Enables the rules engine for flex promotions and price list rules.\n */\n api_rules_engine?: boolean | null\n /**\n * The fallback maximum number of conditions within a rules payload on a ruleable object, default is {API_RULES_ENGINE_MAX_CONDITIONS_SIZE}.\n * @example ```150```\n */\n api_rules_engine_max_conditions_size?: number | null\n /**\n * The fallback maximum number of rules within a rules payload on a ruleable object, default is {API_RULES_ENGINE_MAX_RULES_SIZE}.\n * @example ```15```\n */\n api_rules_engine_max_rules_size?: number | null\n /**\n * Forces the usage of the new Authentication API.\n * @example ```true```\n */\n api_new_auth?: boolean | null\n /**\n * Enables the purge of cached single resources when list is purged.\n */\n api_purge_single_resource?: boolean | null\n /**\n * The maximum length for the regular expressions, default is {API_MAX_REGEX_LENGTH}.\n * @example ```5000```\n */\n api_max_regex_length?: number | null\n /**\n * Indicates if AVS checking will be enforced during payment workflow by passing specific attributes, default is {ADDRESSES_AVS_CHECK}.\n * @example ```true```\n */\n addresses_avs_check?: boolean | null\n /**\n * Indicates if the phone attribute is required for addresses, default is {ADDRESSES_PHONE_REQUIRED}.\n * @example ```true```\n */\n addresses_phone_required?: boolean | null\n /**\n * Indicates if a sales channel application without customer can read and update just guest orders.\n * @example ```true```\n */\n orders_sales_channel_guest_only?: boolean | null\n /**\n * The minimum lapse in fraction of seconds to be observed between two consecutive shipments rebuilt. If shipments rebuilt is triggered within the minimum lapse, the update is performed, but no rebuilt is done.\n */\n orders_min_rebuild_shipments_lapse?: number | null\n /**\n * The minimum lapse in fraction of seconds to be observed between two consecutive order refreshes. If refresh is triggered within the minimum lapse, the update is performed, but no order refresh is done.\n */\n orders_min_refresh_lapse?: number | null\n /**\n * The maximum number line items allowed for a test order before disabling the autorefresh option.\n * @example ```50```\n */\n orders_autorefresh_cutoff_test?: number | null\n /**\n * The maximum number line items allowed for a live order before disabling the autorefresh option.\n * @example ```500```\n */\n orders_autorefresh_cutoff_live?: number | null\n /**\n * Enables orders number editing as a string in test (for enterprise plans only).\n */\n orders_number_editable_test?: boolean | null\n /**\n * Enables orders number editing as a string in live (for enterprise plans only).\n */\n orders_number_editable_live?: boolean | null\n /**\n * Enables to use the order number as payment reference on supported gateways.\n * @example ```true```\n */\n orders_number_as_reference?: boolean | null\n /**\n * Enables raising of API errors in case the provided coupon code is invalid, default is {ORDERS_INVALID_COUPON_ERRORS}.\n * @example ```true```\n */\n orders_invalid_coupon_errors?: boolean | null\n /**\n * Enables raising of API errors in case the provided gift card code is invalid, default is {ORDERS_INVALID_GIFT_CARD_ERRORS}.\n * @example ```true```\n */\n orders_invalid_gift_card_errors?: boolean | null\n /**\n * Enables the validation of the generated stock line items and stock transfers before placing the order, default is {ORDERS_VALIDATE_SHIPPING_STOCK}.\n */\n orders_validate_shipping_stock?: boolean | null\n /**\n * The maximum number of SKUs allowed for bundles, default is {BUNDLES_MAX_ITEMS_COUNT}.\n * @example ```10```\n */\n bundles_max_items_count?: number | null\n /**\n * The minimum length for coupon code, default is {COUPONS_MIN_CODE_LENGTH}.\n * @example ```8```\n */\n coupons_min_code_length?: number | null\n /**\n * The maximum length for coupon code, default is {COUPONS_MAX_CODE_LENGTH}.\n * @example ```40```\n */\n coupons_max_code_length?: number | null\n /**\n * Enables matching the gift card code by its exact value, instead of by its first charachters, default is {GIFT_CARDS_EXACT_CODE_MATCHING}.\n */\n gift_cards_exact_code_matching?: boolean | null\n /**\n * The minimum length for gift card code, default is {GIFT_CARDS_MIN_CODE_LENGTH}.\n * @example ```8```\n */\n gift_cards_min_code_length?: number | null\n /**\n * The maximum length for gift card code, default is {GIFT_CARDS_MAX_CODE_LENGTH}.\n * @example ```40```\n */\n gift_cards_max_code_length?: number | null\n /**\n * The maximum number of concurrent cleanups allowed for your organization, default is {CLEANUPS_MAX_CONCURRENT_COUNT}.\n * @example ```10```\n */\n cleanups_max_concurrent_count?: number | null\n /**\n * The maximum number of concurrent exports allowed for your organization, default is {EXPORTS_MAX_CONCURRENT_COUNT}.\n * @example ```10```\n */\n exports_max_concurrent_count?: number | null\n /**\n * The maximum number of concurrent imports allowed for your organization, default is {IMPORTS_MAX_CONCURRENT_COUNT}.\n * @example ```10```\n */\n imports_max_concurrent_count?: number | null\n /**\n * Enables purging of cached resources upon succeeded imports.\n * @example ```true```\n */\n imports_purge_cache?: boolean | null\n /**\n * Disables the interruption of the import in case its errors exceeds the 10% threshold, default is {IMPORTS_SKIP_ERRORS}.\n */\n imports_skip_errors?: boolean | null\n /**\n * The maximum number for stock locations cutoff, default is {INVENTORY_MODELS_MAX_STOCK_LOCATIONS_CUTOFF}.\n * @example ```10```\n */\n inventory_models_max_stock_locations_cutoff?: number | null\n /**\n * The maximum number of active concurrent promotions allowed for your organization, default is {PROMOTIONS_MAX_CONCURRENT_COUNT}.\n * @example ```10```\n */\n promotions_max_concurrent_count?: number | null\n /**\n * The maximum number of conditions within a rules payload on a promotion object, default is {PROMOTIONS_MAX_CONDITIONS_SIZE}.\n * @example ```150```\n */\n promotions_max_conditions_size?: number | null\n /**\n * The maximum number of rules within a rules payload on a promotion object, default is {PROMOTIONS_MAX_RULES_SIZE}.\n * @example ```15```\n */\n promotions_max_rules_size?: number | null\n /**\n * The maximum number of conditions within a rules payload on a price list object, default is {PRICE_LISTS_MAX_CONDITIONS_SIZE}.\n * @example ```150```\n */\n price_lists_max_conditions_size?: number | null\n /**\n * The maximum number of rules within a rules payload on a price list object, default is {PRICE_LISTS_MAX_RULES_SIZE}.\n * @example ```15```\n */\n price_lists_max_rules_size?: number | null\n /**\n * Enables triggering of webhooks during imports, default is {IMPORTS_TRIGGER_WEBHOOKS}.\n * @example ```\"false\"```\n */\n imports_trigger_webhooks?: number | null\n /**\n * Enables the use of an external discount engine in place of the standard one, default is {DISCOUNT_ENGINES_ENABLED}.\n */\n discount_engines_enabled?: boolean | null\n /**\n * Enables raising of API errors in case of discount engine failure, default is {DISCOUNT_ENGINES_ERRORS}.\n */\n discount_engines_errors?: boolean | null\n /**\n * The maximum length for the tag name, default is {TAGS_MAX_NAME_LENGTH}.\n * @example ```25```\n */\n tags_max_name_length?: number | null\n /**\n * The maximum allowed number of tags for each resource, default is {TAGS_MAX_ALLOWED_NUMBER}.\n * @example ```10```\n */\n tags_max_allowed_number?: number | null\n /**\n * Enables raising of API errors in case of tax calculation failure, default is {TAX_CALCULATORS_ERRORS}.\n */\n tax_calculators_errors?: boolean | null\n /**\n * Enables raising of API errors in case of external promotion failure, default is {EXTERNAL_PROMOTIONS_ERRORS}.\n */\n external_promotions_errors?: boolean | null\n /**\n * Enables raising of API errors in case of external price failure, default is {EXTERNAL_PRICES_ERRORS}.\n * @example ```true```\n */\n external_prices_errors?: boolean | null\n /**\n * Enables the Sku discovery by similarity search.\n */\n skus_discovery?: boolean | null\n /**\n * Enables the creation of the authorization when the gateway event is received, even if there is no reference on Commerce Layer.\n */\n payment_gateways_transaction_on_event?: boolean | null\n\n memberships?: Membership[] | null\n roles?: Role[] | null\n permissions?: Permission[] | null\n api_credentials?: ApiCredential[] | null\n}\n\ninterface OrganizationCreate extends ResourceCreate {\n /**\n * The organization's internal name.\n * @example ```\"The Blue Brand\"```\n */\n name: string\n /**\n * The organization's support phone.\n * @example ```\"+01 30800857\"```\n */\n support_phone?: string | null\n /**\n * The organization's support email.\n * @example ```\"support@bluebrand.com\"```\n */\n support_email?: string | null\n /**\n * The URL to the organization's logo.\n * @example ```\"https://bluebrand.com/img/logo.svg\"```\n */\n logo_url?: string | null\n /**\n * The URL to the organization's favicon.\n * @example ```\"https://bluebrand.com/img/favicon.ico\"```\n */\n favicon_url?: string | null\n /**\n * The organization's primary color.\n * @example ```\"#C8984E\"```\n */\n primary_color?: string | null\n /**\n * The organization's contrast color. Format is HEX (starts with `#` and is followed by six letters and/or numbers).\n * @example ```\"#FFFFCC\"```\n */\n contrast_color?: string | null\n /**\n * The organization's Google Tag Manager ID.\n * @example ```\"GTM-5FJXX6\"```\n */\n gtm_id?: string | null\n /**\n * The organization's Google Tag Manager ID for test.\n * @example ```\"GTM-5FJXX7\"```\n */\n gtm_id_test?: string | null\n /**\n * The region where the organization is located. The default value is `eu-west-1`.\n * @example ```\"eu-west-1\"```\n */\n region?: string | null\n /**\n * The organization's configuration.\n * @example ```{\"mfe\":{\"language\":\"it-IT\",\"default\":{\"links\":{\"cart\":\"https://cart.example.com/:order_id?accessToken=:access_token\",\"checkout\":\"https://checkout.example.com/:order_id?accessToken=:access_token\",\"identity\":\"https://example.com/login\",\"microstore\":\"https://example.com/microstore/?accessToken=:access_token\",\"my_account\":\"https://example.com/my-custom-account?accessToken=:access_token\"},\"checkout\":{\"optional_billing_info\":false,\"thankyou_page\":\"https://example.com/thanks/:lang/:order_id\",\"billing_countries\":[{\"value\":\"ES\",\"label\":\"Espana\"},{\"value\":\"IT\",\"label\":\"Italia\"},{\"value\":\"US\",\"label\":\"Unites States of America\"}],\"shipping_countries\":[{\"value\":\"ES\",\"label\":\"Espana\"},{\"value\":\"IT\",\"label\":\"Italia\"},{\"value\":\"US\",\"label\":\"Unites States of America\"}],\"billing_states\":{\"FR\":[{\"value\":\"PA\",\"label\":\"Paris\"},{\"value\":\"LY\",\"label\":\"Lyon\"},{\"value\":\"NI\",\"label\":\"Nice\"},{\"value\":\"MA\",\"label\":\"Marseille\"},{\"value\":\"BO\",\"label\":\"Bordeaux\"}]},\"shipping_states\":{\"FR\":[{\"value\":\"PA\",\"label\":\"Paris\"},{\"value\":\"LY\",\"label\":\"Lyon\"},{\"value\":\"NI\",\"label\":\"Nice\"},{\"value\":\"MA\",\"label\":\"Marseille\"},{\"value\":\"BO\",\"label\":\"Bordeaux\"}]},\"default_country\":\"US\"},\"urls\":{\"privacy\":\"https://example.com/privacy/:lang\",\"terms\":\"https://example.com/terms/:lang\"}},\"market:id:ZKcv13rT\":{\"links\":{\"cart\":\"https://example.com/custom-cart/:order_id?accessToken=:access_token\"},\"checkout\":{\"thankyou_page\":\"https://example.com/thanks/:order_id\"}}},\"well-known\":{\"shopping\":{\"catalog_mcp_url\":\"https://catalog-mcp.example.com/mcp\",\"client_id\":\"abc123example\",\"locale_scopes\":{\"it-IT\":{\"id\":\"ZKcv13rT\"},\"en-US\":{\"id\":\"ZKcv13rT\"}},\"ui\":{\"domain\":\"\",\"csp\":{\"resourceDomains\":[\"https://data.commercelayer.app\",\"https://cdn.brand.com\"],\"baseUriDomains\":[],\"connectDomains\":[],\"frameDomains\":[]}}}}}```\n */\n config?: Record<string, any> | null\n}\n\ninterface OrganizationUpdate extends ResourceUpdate {\n /**\n * The organization's internal name.\n * @example ```\"The Blue Brand\"```\n */\n name?: string | null\n /**\n * The organization's support phone.\n * @example ```\"+01 30800857\"```\n */\n support_phone?: string | null\n /**\n * The organization's support email.\n * @example ```\"support@bluebrand.com\"```\n */\n support_email?: string | null\n /**\n * The URL to the organization's logo.\n * @example ```\"https://bluebrand.com/img/logo.svg\"```\n */\n logo_url?: string | null\n /**\n * The URL to the organization's favicon.\n * @example ```\"https://bluebrand.com/img/favicon.ico\"```\n */\n favicon_url?: string | null\n /**\n * The organization's primary color.\n * @example ```\"#C8984E\"```\n */\n primary_color?: string | null\n /**\n * The organization's contrast color. Format is HEX (starts with `#` and is followed by six letters and/or numbers).\n * @example ```\"#FFFFCC\"```\n */\n contrast_color?: string | null\n /**\n * The organization's Google Tag Manager ID.\n * @example ```\"GTM-5FJXX6\"```\n */\n gtm_id?: string | null\n /**\n * The organization's Google Tag Manager ID for test.\n * @example ```\"GTM-5FJXX7\"```\n */\n gtm_id_test?: string | null\n /**\n * The organization's configuration.\n * @example ```{\"mfe\":{\"language\":\"it-IT\",\"default\":{\"links\":{\"cart\":\"https://cart.example.com/:order_id?accessToken=:access_token\",\"checkout\":\"https://checkout.example.com/:order_id?accessToken=:access_token\",\"identity\":\"https://example.com/login\",\"microstore\":\"https://example.com/microstore/?accessToken=:access_token\",\"my_account\":\"https://example.com/my-custom-account?accessToken=:access_token\"},\"checkout\":{\"optional_billing_info\":false,\"thankyou_page\":\"https://example.com/thanks/:lang/:order_id\",\"billing_countries\":[{\"value\":\"ES\",\"label\":\"Espana\"},{\"value\":\"IT\",\"label\":\"Italia\"},{\"value\":\"US\",\"label\":\"Unites States of America\"}],\"shipping_countries\":[{\"value\":\"ES\",\"label\":\"Espana\"},{\"value\":\"IT\",\"label\":\"Italia\"},{\"value\":\"US\",\"label\":\"Unites States of America\"}],\"billing_states\":{\"FR\":[{\"value\":\"PA\",\"label\":\"Paris\"},{\"value\":\"LY\",\"label\":\"Lyon\"},{\"value\":\"NI\",\"label\":\"Nice\"},{\"value\":\"MA\",\"label\":\"Marseille\"},{\"value\":\"BO\",\"label\":\"Bordeaux\"}]},\"shipping_states\":{\"FR\":[{\"value\":\"PA\",\"label\":\"Paris\"},{\"value\":\"LY\",\"label\":\"Lyon\"},{\"value\":\"NI\",\"label\":\"Nice\"},{\"value\":\"MA\",\"label\":\"Marseille\"},{\"value\":\"BO\",\"label\":\"Bordeaux\"}]},\"default_country\":\"US\"},\"urls\":{\"privacy\":\"https://example.com/privacy/:lang\",\"terms\":\"https://example.com/terms/:lang\"}},\"market:id:ZKcv13rT\":{\"links\":{\"cart\":\"https://example.com/custom-cart/:order_id?accessToken=:access_token\"},\"checkout\":{\"thankyou_page\":\"https://example.com/thanks/:order_id\"}}},\"well-known\":{\"shopping\":{\"catalog_mcp_url\":\"https://catalog-mcp.example.com/mcp\",\"client_id\":\"abc123example\",\"locale_scopes\":{\"it-IT\":{\"id\":\"ZKcv13rT\"},\"en-US\":{\"id\":\"ZKcv13rT\"}},\"ui\":{\"domain\":\"\",\"csp\":{\"resourceDomains\":[\"https://data.commercelayer.app\",\"https://cdn.brand.com\"],\"baseUriDomains\":[],\"connectDomains\":[],\"frameDomains\":[]}}}}}```\n */\n config?: Record<string, any> | null\n}\n\nclass Organizations extends ApiResource<Organization> {\n static readonly TYPE: OrganizationType = 'organizations' as const\n\n async create(\n resource: OrganizationCreate,\n params?: QueryParamsRetrieve<Organization>,\n options?: ResourcesConfig,\n ): Promise<Organization> {\n return this.resources.create<OrganizationCreate, Organization>(\n { ...resource, type: Organizations.TYPE },\n params,\n options,\n )\n }\n\n async update(\n resource: OrganizationUpdate,\n params?: QueryParamsRetrieve<Organization>,\n options?: ResourcesConfig,\n ): Promise<Organization> {\n return this.resources.update<OrganizationUpdate, Organization>(\n { ...resource, type: Organizations.TYPE },\n params,\n options,\n )\n }\n\n async memberships(\n organizationId: string | Organization,\n params?: QueryParamsList<Membership>,\n options?: ResourcesConfig,\n ): Promise<ListResponse<Membership>> {\n const _organizationId = (organizationId as Organization).id || (organizationId as string)\n return this.resources.fetch<Membership>(\n { type: 'memberships' },\n `organizations/${_organizationId}/memberships`,\n params,\n options,\n ) as unknown as ListResponse<Membership>\n }\n\n async roles(\n organizationId: string | Organization,\n params?: QueryParamsList<Role>,\n options?: ResourcesConfig,\n ): Promise<ListResponse<Role>> {\n const _organizationId = (organizationId as Organization).id || (organizationId as string)\n return this.resources.fetch<Role>(\n { type: 'roles' },\n `organizations/${_organizationId}/roles`,\n params,\n options,\n ) as unknown as ListResponse<Role>\n }\n\n async permissions(\n organizationId: string | Organization,\n params?: QueryParamsList<Permission>,\n options?: ResourcesConfig,\n ): Promise<ListResponse<Permission>> {\n const _organizationId = (organizationId as Organization).id || (organizationId as string)\n return this.resources.fetch<Permission>(\n { type: 'permissions' },\n `organizations/${_organizationId}/permissions`,\n params,\n options,\n ) as unknown as ListResponse<Permission>\n }\n\n async api_credentials(\n organizationId: string | Organization,\n params?: QueryParamsList<ApiCredential>,\n options?: ResourcesConfig,\n ): Promise<ListResponse<ApiCredential>> {\n const _organizationId = (organizationId as Organization).id || (organizationId as string)\n return this.resources.fetch<ApiCredential>(\n { type: 'api_credentials' },\n `organizations/${_organizationId}/api_credentials`,\n params,\n options,\n ) as unknown as ListResponse<ApiCredential>\n }\n\n async transfer_ownership(\n organizationId: string | Organization,\n payload: TransferOwnershipDataType,\n options?: ResourcesConfig,\n ): Promise<void> {\n const _organizationId = (organizationId as Organization).id || (organizationId as string)\n await this.resources.action('PATCH', `organizations/${_organizationId}/transfer_ownership`, { ...payload }, options)\n }\n\n isOrganization(resource: any): resource is Organization {\n return resource.type && resource.type === Organizations.TYPE\n }\n\n relationship(id: string | ResourceId | null): OrganizationRel {\n return super.relationshipOneToOne<OrganizationRel>(id)\n }\n\n relationshipToMany(...ids: string[]): OrganizationRel[] {\n return super.relationshipOneToMany<OrganizationRel>(...ids)\n }\n\n type(): OrganizationType {\n return Organizations.TYPE\n }\n}\n\nconst instance = new Organizations()\nexport default instance\n\nexport type { Organization, OrganizationCreate, Organizations, OrganizationType, OrganizationUpdate }\n"]}
1
+ {"version":3,"sources":["../gen/resources/organizations.ts"],"names":[],"mappings":";;;AAgcA,IAAM,aAAA,GAAN,MAAM,cAAA,SAAsB,WAAA,CAA0B;AAAA,EACpD,OAAgB,IAAA,GAAyB,eAAA;AAAA,EAEzC,MAAM,MAAA,CACJ,QAAA,EACA,MAAA,EACA,OAAA,EACuB;AACvB,IAAA,OAAO,KAAK,SAAA,CAAU,MAAA;AAAA,MACpB,EAAE,GAAG,QAAA,EAAU,IAAA,EAAM,eAAc,IAAA,EAAK;AAAA,MACxC,MAAA;AAAA,MACA;AAAA,KACF;AAAA,EACF;AAAA,EAEA,MAAM,MAAA,CAC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AAU,KAAA;AAAA,MACpB,EAAE,MAAM,iBAAA,EAAkB;AAAA,MAC1B,iBAAiB,eAAe,CAAA,gBAAA,CAAA;AAAA,MAChC,MAAA;AAAA,MACA;AAAA,KACF;AAAA,EACF;AAAA,EAEA,MAAM,kBAAA,CACJ,cAAA,EACA,OAAA,EACA,OAAA,EACe;AACf,IAAA,MAAM,eAAA,GAAmB,eAAgC,EAAA,IAAO,cAAA;AAChE,IAAA,MAAM,IAAA,CAAK,SAAA,CAAU,MAAA,CAAO,OAAA,EAAS,CAAA,cAAA,EAAiB,eAAe,CAAA,mBAAA,CAAA,EAAuB,EAAE,GAAG,OAAA,EAAQ,EAAG,OAAO,CAAA;AAAA,EACrH;AAAA,EAEA,eAAe,QAAA,EAAyC;AACtD,IAAA,OAAO,QAAA,CAAS,IAAA,IAAQ,QAAA,CAAS,IAAA,KAAS,cAAA,CAAc,IAAA;AAAA,EAC1D;AAAA,EAEA,aAAa,EAAA,EAAiD;AAC5D,IAAA,OAAO,KAAA,CAAM,qBAAsC,EAAE,CAAA;AAAA,EACvD;AAAA,EAEA,sBAAsB,GAAA,EAAkC;AACtD,IAAA,OAAO,KAAA,CAAM,qBAAA,CAAuC,GAAG,GAAG,CAAA;AAAA,EAC5D;AAAA,EAEA,IAAA,GAAyB;AACvB,IAAA,OAAO,cAAA,CAAc,IAAA;AAAA,EACvB;AACF,CAAA;AAEA,IAAM,QAAA,GAAW,IAAI,aAAA,EAAc;AACnC,IAAO,qBAAA,GAAQ","file":"chunk-ECGUWRRG.js","sourcesContent":["import type { QueryParamsList, QueryParamsRetrieve } from '@runtime/query'\nimport type {\n ListResponse,\n Resource,\n ResourceCreate,\n ResourceId,\n ResourceRel,\n ResourceSort,\n /* ResourceFilter */ ResourcesConfig,\n ResourceUpdate,\n} from '@runtime/resource'\nimport { ApiResource } from '@runtime/resource'\nimport type { TransferOwnershipDataType } from '../../src/actions'\nimport type { ApiCredential } from './api_credentials'\nimport type { Membership } from './memberships'\nimport type { Permission } from './permissions'\nimport type { Role } from './roles'\n\ntype OrganizationType = 'organizations'\ntype OrganizationRel = ResourceRel & { type: OrganizationType }\n\nexport type OrganizationSort = Pick<Organization, 'id' | 'name' | 'slug' | 'domain'> & ResourceSort\n// export type OrganizationFilter = Pick<Organization, 'id' | 'name' | 'slug' | 'domain' | 'contrast_color' | 'region'> & ResourceFilter\n\n/**\n * The Organization object is returned as part of the response body of each successful list, retrieve, create or update API call to the /api/organizations endpoint.\n *\n * @link https://docs.commercelayer.io/provisioning-api-reference/organizations/object\n */\ninterface Organization extends Resource {\n readonly type: OrganizationType\n\n /**\n * The organization's internal name.\n * @example ```\"The Blue Brand\"```\n */\n name: string\n /**\n * The organization's slug name.\n * @example ```\"the-blue-brand\"```\n */\n slug?: string | null\n /**\n * The organization's domain.\n * @example ```\"the-blue-brand.commercelayer.io\"```\n */\n domain?: string | null\n /**\n * The organization's support phone.\n * @example ```\"+01 30800857\"```\n */\n support_phone?: string | null\n /**\n * The organization's support email.\n * @example ```\"support@bluebrand.com\"```\n */\n support_email?: string | null\n /**\n * The URL to the organization's logo.\n * @example ```\"https://bluebrand.com/img/logo.svg\"```\n */\n logo_url?: string | null\n /**\n * The URL to the organization's favicon.\n * @example ```\"https://bluebrand.com/img/favicon.ico\"```\n */\n favicon_url?: string | null\n /**\n * The organization's primary color.\n * @example ```\"#C8984E\"```\n */\n primary_color?: string | null\n /**\n * The organization's contrast color. Format is HEX (starts with `#` and is followed by six letters and/or numbers).\n * @example ```\"#FFFFCC\"```\n */\n contrast_color?: string | null\n /**\n * The organization's Google Tag Manager ID.\n * @example ```\"GTM-5FJXX6\"```\n */\n gtm_id?: string | null\n /**\n * The organization's Google Tag Manager ID for test.\n * @example ```\"GTM-5FJXX7\"```\n */\n gtm_id_test?: string | null\n /**\n * The region where the organization is located. The default value is `eu-west-1`.\n * @example ```\"eu-west-1\"```\n */\n region?: string | null\n /**\n * Indicates if the organization can switch to live mode.\n */\n can_switch_live?: boolean | null\n /**\n * Information about the current subscription such as the plan type, limits, and subscription totals counter.\n * @example ```{\"plan_type\":\"growth\",\"limits\":{\"markets\":5,\"skus\":10000,\"organizations\":2,\"memberships\":5},\"totals\":{\"organizations\":1,\"markets\":0,\"memberships\":2,\"skus\":0}}```\n */\n subscription_info?: Record<string, any> | null\n /**\n * The organization's configuration.\n * @example ```{\"mfe\":{\"language\":\"it-IT\",\"default\":{\"links\":{\"cart\":\"https://cart.example.com/:order_id?accessToken=:access_token\",\"checkout\":\"https://checkout.example.com/:order_id?accessToken=:access_token\",\"identity\":\"https://example.com/login\",\"microstore\":\"https://example.com/microstore/?accessToken=:access_token\",\"my_account\":\"https://example.com/my-custom-account?accessToken=:access_token\"},\"checkout\":{\"optional_billing_info\":false,\"thankyou_page\":\"https://example.com/thanks/:lang/:order_id\",\"billing_countries\":[{\"value\":\"ES\",\"label\":\"Espana\"},{\"value\":\"IT\",\"label\":\"Italia\"},{\"value\":\"US\",\"label\":\"Unites States of America\"}],\"shipping_countries\":[{\"value\":\"ES\",\"label\":\"Espana\"},{\"value\":\"IT\",\"label\":\"Italia\"},{\"value\":\"US\",\"label\":\"Unites States of America\"}],\"billing_states\":{\"FR\":[{\"value\":\"PA\",\"label\":\"Paris\"},{\"value\":\"LY\",\"label\":\"Lyon\"},{\"value\":\"NI\",\"label\":\"Nice\"},{\"value\":\"MA\",\"label\":\"Marseille\"},{\"value\":\"BO\",\"label\":\"Bordeaux\"}]},\"shipping_states\":{\"FR\":[{\"value\":\"PA\",\"label\":\"Paris\"},{\"value\":\"LY\",\"label\":\"Lyon\"},{\"value\":\"NI\",\"label\":\"Nice\"},{\"value\":\"MA\",\"label\":\"Marseille\"},{\"value\":\"BO\",\"label\":\"Bordeaux\"}]},\"default_country\":\"US\"},\"urls\":{\"privacy\":\"https://example.com/privacy/:lang\",\"terms\":\"https://example.com/terms/:lang\"}},\"market:id:ZKcv13rT\":{\"links\":{\"cart\":\"https://example.com/custom-cart/:order_id?accessToken=:access_token\"},\"checkout\":{\"thankyou_page\":\"https://example.com/thanks/:order_id\"}}},\"well-known\":{\"shopping\":{\"catalog_mcp_url\":\"https://catalog-mcp.example.com/mcp\",\"client_id\":\"abc123example\",\"locale_scopes\":{\"it-IT\":{\"id\":\"ZKcv13rT\"},\"en-US\":{\"id\":\"ZKcv13rT\"}},\"ui\":{\"domain\":\"\",\"csp\":{\"resourceDomains\":[\"https://data.commercelayer.app\",\"https://cdn.brand.com\"],\"baseUriDomains\":[],\"connectDomains\":[],\"frameDomains\":[]}}}}}```\n */\n config?: Record<string, any> | null\n /**\n * Enables the redirect on the new Auth API.\n * @example ```true```\n */\n api_auth_redirect?: boolean | null\n /**\n * Enables fragment caching for resources with related directive.\n */\n api_fragment_caching_enabled?: boolean | null\n /**\n * Enables the rules engine for flex promotions and price list rules.\n */\n api_rules_engine?: boolean | null\n /**\n * The fallback maximum number of conditions within a rules payload on a ruleable object, default is {API_RULES_ENGINE_MAX_CONDITIONS_SIZE}.\n * @example ```150```\n */\n api_rules_engine_max_conditions_size?: number | null\n /**\n * The fallback maximum number of rules within a rules payload on a ruleable object, default is {API_RULES_ENGINE_MAX_RULES_SIZE}.\n * @example ```15```\n */\n api_rules_engine_max_rules_size?: number | null\n /**\n * Forces the usage of the new Authentication API.\n * @example ```true```\n */\n api_new_auth?: boolean | null\n /**\n * Enables the purge of cached single resources when list is purged.\n */\n api_purge_single_resource?: boolean | null\n /**\n * The maximum length for the regular expressions, default is {API_MAX_REGEX_LENGTH}.\n * @example ```5000```\n */\n api_max_regex_length?: number | null\n /**\n * Indicates if AVS checking will be enforced during payment workflow by passing specific attributes, default is {ADDRESSES_AVS_CHECK}.\n * @example ```true```\n */\n addresses_avs_check?: boolean | null\n /**\n * Indicates if the phone attribute is required for addresses, default is {ADDRESSES_PHONE_REQUIRED}.\n * @example ```true```\n */\n addresses_phone_required?: boolean | null\n /**\n * Indicates if a sales channel application without customer can read and update just guest orders.\n * @example ```true```\n */\n orders_sales_channel_guest_only?: boolean | null\n /**\n * The minimum lapse in fraction of seconds to be observed between two consecutive shipments rebuilt. If shipments rebuilt is triggered within the minimum lapse, the update is performed, but no rebuilt is done.\n */\n orders_min_rebuild_shipments_lapse?: number | null\n /**\n * The minimum lapse in fraction of seconds to be observed between two consecutive order refreshes. If refresh is triggered within the minimum lapse, the update is performed, but no order refresh is done.\n */\n orders_min_refresh_lapse?: number | null\n /**\n * The maximum number line items allowed for a test order before disabling the autorefresh option.\n * @example ```50```\n */\n orders_autorefresh_cutoff_test?: number | null\n /**\n * The maximum number line items allowed for a live order before disabling the autorefresh option.\n * @example ```500```\n */\n orders_autorefresh_cutoff_live?: number | null\n /**\n * Enables orders number editing as a string in test (for enterprise plans only).\n */\n orders_number_editable_test?: boolean | null\n /**\n * Enables orders number editing as a string in live (for enterprise plans only).\n */\n orders_number_editable_live?: boolean | null\n /**\n * Enables to use the order number as payment reference on supported gateways.\n * @example ```true```\n */\n orders_number_as_reference?: boolean | null\n /**\n * Enables raising of API errors in case the provided coupon code is invalid, default is {ORDERS_INVALID_COUPON_ERRORS}.\n * @example ```true```\n */\n orders_invalid_coupon_errors?: boolean | null\n /**\n * Enables raising of API errors in case the provided gift card code is invalid, default is {ORDERS_INVALID_GIFT_CARD_ERRORS}.\n * @example ```true```\n */\n orders_invalid_gift_card_errors?: boolean | null\n /**\n * Enables the validation of the generated stock line items and stock transfers before placing the order, default is {ORDERS_VALIDATE_SHIPPING_STOCK}.\n */\n orders_validate_shipping_stock?: boolean | null\n /**\n * The maximum number of SKUs allowed for bundles, default is {BUNDLES_MAX_ITEMS_COUNT}.\n * @example ```10```\n */\n bundles_max_items_count?: number | null\n /**\n * The minimum length for coupon code, default is {COUPONS_MIN_CODE_LENGTH}.\n * @example ```8```\n */\n coupons_min_code_length?: number | null\n /**\n * The maximum length for coupon code, default is {COUPONS_MAX_CODE_LENGTH}.\n * @example ```40```\n */\n coupons_max_code_length?: number | null\n /**\n * Enables matching the gift card code by its exact value, instead of by its first charachters, default is {GIFT_CARDS_EXACT_CODE_MATCHING}.\n */\n gift_cards_exact_code_matching?: boolean | null\n /**\n * The minimum length for gift card code, default is {GIFT_CARDS_MIN_CODE_LENGTH}.\n * @example ```8```\n */\n gift_cards_min_code_length?: number | null\n /**\n * The maximum length for gift card code, default is {GIFT_CARDS_MAX_CODE_LENGTH}.\n * @example ```40```\n */\n gift_cards_max_code_length?: number | null\n /**\n * The maximum number of concurrent cleanups allowed for your organization, default is {CLEANUPS_MAX_CONCURRENT_COUNT}.\n * @example ```10```\n */\n cleanups_max_concurrent_count?: number | null\n /**\n * The maximum number of concurrent exports allowed for your organization, default is {EXPORTS_MAX_CONCURRENT_COUNT}.\n * @example ```10```\n */\n exports_max_concurrent_count?: number | null\n /**\n * The maximum number of concurrent imports allowed for your organization, default is {IMPORTS_MAX_CONCURRENT_COUNT}.\n * @example ```10```\n */\n imports_max_concurrent_count?: number | null\n /**\n * Enables purging of cached resources upon succeeded imports.\n * @example ```true```\n */\n imports_purge_cache?: boolean | null\n /**\n * Disables the interruption of the import in case its errors exceeds the 10% threshold, default is {IMPORTS_SKIP_ERRORS}.\n */\n imports_skip_errors?: boolean | null\n /**\n * The maximum number for stock locations cutoff, default is {INVENTORY_MODELS_MAX_STOCK_LOCATIONS_CUTOFF}.\n * @example ```10```\n */\n inventory_models_max_stock_locations_cutoff?: number | null\n /**\n * The maximum number of active concurrent promotions allowed for your organization, default is {PROMOTIONS_MAX_CONCURRENT_COUNT}.\n * @example ```10```\n */\n promotions_max_concurrent_count?: number | null\n /**\n * The maximum number of conditions within a rules payload on a promotion object, default is {PROMOTIONS_MAX_CONDITIONS_SIZE}.\n * @example ```150```\n */\n promotions_max_conditions_size?: number | null\n /**\n * The maximum number of rules within a rules payload on a promotion object, default is {PROMOTIONS_MAX_RULES_SIZE}.\n * @example ```15```\n */\n promotions_max_rules_size?: number | null\n /**\n * The maximum number of conditions within a rules payload on a price list object, default is {PRICE_LISTS_MAX_CONDITIONS_SIZE}.\n * @example ```150```\n */\n price_lists_max_conditions_size?: number | null\n /**\n * The maximum number of rules within a rules payload on a price list object, default is {PRICE_LISTS_MAX_RULES_SIZE}.\n * @example ```15```\n */\n price_lists_max_rules_size?: number | null\n /**\n * Enables triggering of webhooks during imports, default is {IMPORTS_TRIGGER_WEBHOOKS}.\n * @example ```\"false\"```\n */\n imports_trigger_webhooks?: number | null\n /**\n * Enables the use of an external discount engine in place of the standard one, default is {DISCOUNT_ENGINES_ENABLED}.\n */\n discount_engines_enabled?: boolean | null\n /**\n * Enables raising of API errors in case of discount engine failure, default is {DISCOUNT_ENGINES_ERRORS}.\n */\n discount_engines_errors?: boolean | null\n /**\n * The maximum length for the tag name, default is {TAGS_MAX_NAME_LENGTH}.\n * @example ```25```\n */\n tags_max_name_length?: number | null\n /**\n * The maximum allowed number of tags for each resource, default is {TAGS_MAX_ALLOWED_NUMBER}.\n * @example ```10```\n */\n tags_max_allowed_number?: number | null\n /**\n * Enables raising of API errors in case of tax calculation failure, default is {TAX_CALCULATORS_ERRORS}.\n */\n tax_calculators_errors?: boolean | null\n /**\n * Enables raising of API errors in case of external promotion failure, default is {EXTERNAL_PROMOTIONS_ERRORS}.\n */\n external_promotions_errors?: boolean | null\n /**\n * Enables raising of API errors in case of external price failure, default is {EXTERNAL_PRICES_ERRORS}.\n * @example ```true```\n */\n external_prices_errors?: boolean | null\n /**\n * Enables the Sku discovery by similarity search.\n */\n skus_discovery?: boolean | null\n /**\n * Enables the creation of the authorization when the gateway event is received, even if there is no reference on Commerce Layer.\n */\n payment_gateways_transaction_on_event?: boolean | null\n\n memberships?: Membership[] | null\n roles?: Role[] | null\n permissions?: Permission[] | null\n api_credentials?: ApiCredential[] | null\n}\n\ninterface OrganizationCreate extends ResourceCreate {\n /**\n * The organization's internal name.\n * @example ```\"The Blue Brand\"```\n */\n name: string\n /**\n * The organization's support phone.\n * @example ```\"+01 30800857\"```\n */\n support_phone?: string | null\n /**\n * The organization's support email.\n * @example ```\"support@bluebrand.com\"```\n */\n support_email?: string | null\n /**\n * The URL to the organization's logo.\n * @example ```\"https://bluebrand.com/img/logo.svg\"```\n */\n logo_url?: string | null\n /**\n * The URL to the organization's favicon.\n * @example ```\"https://bluebrand.com/img/favicon.ico\"```\n */\n favicon_url?: string | null\n /**\n * The organization's primary color.\n * @example ```\"#C8984E\"```\n */\n primary_color?: string | null\n /**\n * The organization's contrast color. Format is HEX (starts with `#` and is followed by six letters and/or numbers).\n * @example ```\"#FFFFCC\"```\n */\n contrast_color?: string | null\n /**\n * The organization's Google Tag Manager ID.\n * @example ```\"GTM-5FJXX6\"```\n */\n gtm_id?: string | null\n /**\n * The organization's Google Tag Manager ID for test.\n * @example ```\"GTM-5FJXX7\"```\n */\n gtm_id_test?: string | null\n /**\n * The region where the organization is located. The default value is `eu-west-1`.\n * @example ```\"eu-west-1\"```\n */\n region?: string | null\n /**\n * The organization's configuration.\n * @example ```{\"mfe\":{\"language\":\"it-IT\",\"default\":{\"links\":{\"cart\":\"https://cart.example.com/:order_id?accessToken=:access_token\",\"checkout\":\"https://checkout.example.com/:order_id?accessToken=:access_token\",\"identity\":\"https://example.com/login\",\"microstore\":\"https://example.com/microstore/?accessToken=:access_token\",\"my_account\":\"https://example.com/my-custom-account?accessToken=:access_token\"},\"checkout\":{\"optional_billing_info\":false,\"thankyou_page\":\"https://example.com/thanks/:lang/:order_id\",\"billing_countries\":[{\"value\":\"ES\",\"label\":\"Espana\"},{\"value\":\"IT\",\"label\":\"Italia\"},{\"value\":\"US\",\"label\":\"Unites States of America\"}],\"shipping_countries\":[{\"value\":\"ES\",\"label\":\"Espana\"},{\"value\":\"IT\",\"label\":\"Italia\"},{\"value\":\"US\",\"label\":\"Unites States of America\"}],\"billing_states\":{\"FR\":[{\"value\":\"PA\",\"label\":\"Paris\"},{\"value\":\"LY\",\"label\":\"Lyon\"},{\"value\":\"NI\",\"label\":\"Nice\"},{\"value\":\"MA\",\"label\":\"Marseille\"},{\"value\":\"BO\",\"label\":\"Bordeaux\"}]},\"shipping_states\":{\"FR\":[{\"value\":\"PA\",\"label\":\"Paris\"},{\"value\":\"LY\",\"label\":\"Lyon\"},{\"value\":\"NI\",\"label\":\"Nice\"},{\"value\":\"MA\",\"label\":\"Marseille\"},{\"value\":\"BO\",\"label\":\"Bordeaux\"}]},\"default_country\":\"US\"},\"urls\":{\"privacy\":\"https://example.com/privacy/:lang\",\"terms\":\"https://example.com/terms/:lang\"}},\"market:id:ZKcv13rT\":{\"links\":{\"cart\":\"https://example.com/custom-cart/:order_id?accessToken=:access_token\"},\"checkout\":{\"thankyou_page\":\"https://example.com/thanks/:order_id\"}}},\"well-known\":{\"shopping\":{\"catalog_mcp_url\":\"https://catalog-mcp.example.com/mcp\",\"client_id\":\"abc123example\",\"locale_scopes\":{\"it-IT\":{\"id\":\"ZKcv13rT\"},\"en-US\":{\"id\":\"ZKcv13rT\"}},\"ui\":{\"domain\":\"\",\"csp\":{\"resourceDomains\":[\"https://data.commercelayer.app\",\"https://cdn.brand.com\"],\"baseUriDomains\":[],\"connectDomains\":[],\"frameDomains\":[]}}}}}```\n */\n config?: Record<string, any> | null\n}\n\ninterface OrganizationUpdate extends ResourceUpdate {\n /**\n * The organization's internal name.\n * @example ```\"The Blue Brand\"```\n */\n name?: string | null\n /**\n * The organization's support phone.\n * @example ```\"+01 30800857\"```\n */\n support_phone?: string | null\n /**\n * The organization's support email.\n * @example ```\"support@bluebrand.com\"```\n */\n support_email?: string | null\n /**\n * The URL to the organization's logo.\n * @example ```\"https://bluebrand.com/img/logo.svg\"```\n */\n logo_url?: string | null\n /**\n * The URL to the organization's favicon.\n * @example ```\"https://bluebrand.com/img/favicon.ico\"```\n */\n favicon_url?: string | null\n /**\n * The organization's primary color.\n * @example ```\"#C8984E\"```\n */\n primary_color?: string | null\n /**\n * The organization's contrast color. Format is HEX (starts with `#` and is followed by six letters and/or numbers).\n * @example ```\"#FFFFCC\"```\n */\n contrast_color?: string | null\n /**\n * The organization's Google Tag Manager ID.\n * @example ```\"GTM-5FJXX6\"```\n */\n gtm_id?: string | null\n /**\n * The organization's Google Tag Manager ID for test.\n * @example ```\"GTM-5FJXX7\"```\n */\n gtm_id_test?: string | null\n /**\n * The organization's configuration.\n * @example ```{\"mfe\":{\"language\":\"it-IT\",\"default\":{\"links\":{\"cart\":\"https://cart.example.com/:order_id?accessToken=:access_token\",\"checkout\":\"https://checkout.example.com/:order_id?accessToken=:access_token\",\"identity\":\"https://example.com/login\",\"microstore\":\"https://example.com/microstore/?accessToken=:access_token\",\"my_account\":\"https://example.com/my-custom-account?accessToken=:access_token\"},\"checkout\":{\"optional_billing_info\":false,\"thankyou_page\":\"https://example.com/thanks/:lang/:order_id\",\"billing_countries\":[{\"value\":\"ES\",\"label\":\"Espana\"},{\"value\":\"IT\",\"label\":\"Italia\"},{\"value\":\"US\",\"label\":\"Unites States of America\"}],\"shipping_countries\":[{\"value\":\"ES\",\"label\":\"Espana\"},{\"value\":\"IT\",\"label\":\"Italia\"},{\"value\":\"US\",\"label\":\"Unites States of America\"}],\"billing_states\":{\"FR\":[{\"value\":\"PA\",\"label\":\"Paris\"},{\"value\":\"LY\",\"label\":\"Lyon\"},{\"value\":\"NI\",\"label\":\"Nice\"},{\"value\":\"MA\",\"label\":\"Marseille\"},{\"value\":\"BO\",\"label\":\"Bordeaux\"}]},\"shipping_states\":{\"FR\":[{\"value\":\"PA\",\"label\":\"Paris\"},{\"value\":\"LY\",\"label\":\"Lyon\"},{\"value\":\"NI\",\"label\":\"Nice\"},{\"value\":\"MA\",\"label\":\"Marseille\"},{\"value\":\"BO\",\"label\":\"Bordeaux\"}]},\"default_country\":\"US\"},\"urls\":{\"privacy\":\"https://example.com/privacy/:lang\",\"terms\":\"https://example.com/terms/:lang\"}},\"market:id:ZKcv13rT\":{\"links\":{\"cart\":\"https://example.com/custom-cart/:order_id?accessToken=:access_token\"},\"checkout\":{\"thankyou_page\":\"https://example.com/thanks/:order_id\"}}},\"well-known\":{\"shopping\":{\"catalog_mcp_url\":\"https://catalog-mcp.example.com/mcp\",\"client_id\":\"abc123example\",\"locale_scopes\":{\"it-IT\":{\"id\":\"ZKcv13rT\"},\"en-US\":{\"id\":\"ZKcv13rT\"}},\"ui\":{\"domain\":\"\",\"csp\":{\"resourceDomains\":[\"https://data.commercelayer.app\",\"https://cdn.brand.com\"],\"baseUriDomains\":[],\"connectDomains\":[],\"frameDomains\":[]}}}}}```\n */\n config?: Record<string, any> | null\n}\n\nclass Organizations extends ApiResource<Organization> {\n static readonly TYPE: OrganizationType = 'organizations' as const\n\n async create(\n resource: OrganizationCreate,\n params?: QueryParamsRetrieve<Organization>,\n options?: ResourcesConfig,\n ): Promise<Organization> {\n return this.resources.create<OrganizationCreate, Organization>(\n { ...resource, type: Organizations.TYPE },\n params,\n options,\n )\n }\n\n async update(\n resource: OrganizationUpdate,\n params?: QueryParamsRetrieve<Organization>,\n options?: ResourcesConfig,\n ): Promise<Organization> {\n return this.resources.update<OrganizationUpdate, Organization>(\n { ...resource, type: Organizations.TYPE },\n params,\n options,\n )\n }\n\n async memberships(\n organizationId: string | Organization,\n params?: QueryParamsList<Membership>,\n options?: ResourcesConfig,\n ): Promise<ListResponse<Membership>> {\n const _organizationId = (organizationId as Organization).id || (organizationId as string)\n return this.resources.fetch<Membership>(\n { type: 'memberships' },\n `organizations/${_organizationId}/memberships`,\n params,\n options,\n ) as unknown as ListResponse<Membership>\n }\n\n async roles(\n organizationId: string | Organization,\n params?: QueryParamsList<Role>,\n options?: ResourcesConfig,\n ): Promise<ListResponse<Role>> {\n const _organizationId = (organizationId as Organization).id || (organizationId as string)\n return this.resources.fetch<Role>(\n { type: 'roles' },\n `organizations/${_organizationId}/roles`,\n params,\n options,\n ) as unknown as ListResponse<Role>\n }\n\n async permissions(\n organizationId: string | Organization,\n params?: QueryParamsList<Permission>,\n options?: ResourcesConfig,\n ): Promise<ListResponse<Permission>> {\n const _organizationId = (organizationId as Organization).id || (organizationId as string)\n return this.resources.fetch<Permission>(\n { type: 'permissions' },\n `organizations/${_organizationId}/permissions`,\n params,\n options,\n ) as unknown as ListResponse<Permission>\n }\n\n async api_credentials(\n organizationId: string | Organization,\n params?: QueryParamsList<ApiCredential>,\n options?: ResourcesConfig,\n ): Promise<ListResponse<ApiCredential>> {\n const _organizationId = (organizationId as Organization).id || (organizationId as string)\n return this.resources.fetch<ApiCredential>(\n { type: 'api_credentials' },\n `organizations/${_organizationId}/api_credentials`,\n params,\n options,\n ) as unknown as ListResponse<ApiCredential>\n }\n\n async transfer_ownership(\n organizationId: string | Organization,\n payload: TransferOwnershipDataType,\n options?: ResourcesConfig,\n ): Promise<void> {\n const _organizationId = (organizationId as Organization).id || (organizationId as string)\n await this.resources.action('PATCH', `organizations/${_organizationId}/transfer_ownership`, { ...payload }, options)\n }\n\n isOrganization(resource: any): resource is Organization {\n return resource.type && resource.type === Organizations.TYPE\n }\n\n relationship(id: string | ResourceId | null): OrganizationRel {\n return super.relationshipOneToOne<OrganizationRel>(id)\n }\n\n relationshipToMany(...ids: string[]): OrganizationRel[] {\n return super.relationshipOneToMany<OrganizationRel>(...ids)\n }\n\n type(): OrganizationType {\n return Organizations.TYPE\n }\n}\n\nconst instance = new Organizations()\nexport default instance\n\nexport type { Organization, OrganizationCreate, Organizations, OrganizationType, OrganizationUpdate }\n"]}
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkCFU5DNH2_cjs = require('./chunk-CFU5DNH2.cjs');
3
+ var chunkOROPOAHK_cjs = require('./chunk-OROPOAHK.cjs');
4
4
 
5
5
  // ../sdk-runtime/src/debug.ts
6
6
  var PREFIX = "clsdk";
@@ -250,7 +250,7 @@ var CLIENT_HEADER_NAME = "X-CL-SDK";
250
250
  var debug3 = debug_default("client");
251
251
  var baseURL = (organization, domain, apiVersion) => {
252
252
  const versionSegment = apiVersion ? `/${apiVersion}` : "";
253
- const subdomain = chunkCFU5DNH2_cjs.binding.subdomain ?? organization.toLowerCase();
253
+ const subdomain = chunkOROPOAHK_cjs.binding.subdomain ?? organization.toLowerCase();
254
254
  return `https://${subdomain}.${domain || config_default.default.domain}/api${versionSegment}`;
255
255
  };
256
256
  var ApiClient = class _ApiClient {
@@ -260,7 +260,7 @@ var ApiClient = class _ApiClient {
260
260
  if (!options.organization && tokenData?.organization) options.organization = tokenData.organization;
261
261
  if (!options.domain && tokenData?.domain) options.domain = tokenData.domain;
262
262
  }
263
- const required = chunkCFU5DNH2_cjs.binding.subdomain ? config_default.client.requiredAttributes.filter((a) => a !== "organization") : config_default.client.requiredAttributes;
263
+ const required = chunkOROPOAHK_cjs.binding.subdomain ? config_default.client.requiredAttributes.filter((a) => a !== "organization") : config_default.client.requiredAttributes;
264
264
  for (const attr of required) if (!options[attr]) throw new SdkError({ message: `Undefined '${attr}' parameter` });
265
265
  return new _ApiClient(options);
266
266
  }
@@ -290,7 +290,7 @@ var ApiClient = class _ApiClient {
290
290
  "Content-Type": "application/vnd.api+json",
291
291
  Authorization: "Bearer " + this.#accessToken
292
292
  };
293
- if (options.telemetry !== false) headers[CLIENT_HEADER_NAME] = `js/${chunkCFU5DNH2_cjs.binding.name}-v${chunkCFU5DNH2_cjs.binding.sdkVersion}`;
293
+ if (options.telemetry !== false) headers[CLIENT_HEADER_NAME] = `js/${chunkOROPOAHK_cjs.binding.name}-v${chunkOROPOAHK_cjs.binding.sdkVersion}`;
294
294
  if (options.userAgent) headers["User-Agent"] = options.userAgent;
295
295
  fetchConfig.headers = headers;
296
296
  this.#clientConfig = fetchConfig;
@@ -569,6 +569,9 @@ var ListResponse = class extends Array {
569
569
  getRecordCount() {
570
570
  return this.meta.recordCount;
571
571
  }
572
+ getRecordCountEstimated() {
573
+ return this.meta.recordCountEstimated;
574
+ }
572
575
  getPageCount() {
573
576
  return this.meta.pageCount;
574
577
  }
@@ -599,6 +602,7 @@ var buildListMeta = (res, links, params) => {
599
602
  // shared `meta.*` interface still resolves (see ListMeta).
600
603
  pageCount: NaN,
601
604
  recordCount: NaN,
605
+ recordCountEstimated: false,
602
606
  currentPage: NaN,
603
607
  recordsPerPage,
604
608
  cursor: {
@@ -610,6 +614,7 @@ var buildListMeta = (res, links, params) => {
610
614
  return {
611
615
  pageCount: Number(res.meta?.page_count),
612
616
  recordCount: Number(res.meta?.record_count),
617
+ recordCountEstimated: Boolean(res.meta?.record_count_estimated),
613
618
  currentPage: params?.pageNumber || config_default.default.pageNumber,
614
619
  recordsPerPage
615
620
  };
@@ -799,10 +804,10 @@ var ApiSingleton = class extends ApiResourceBase {
799
804
  }
800
805
  };
801
806
  var isResourceId = (resource) => {
802
- return resource?.type && resource.id && chunkCFU5DNH2_cjs.binding.resourceList.includes(resource.type);
807
+ return resource?.type && resource.id && chunkOROPOAHK_cjs.binding.resourceList.includes(resource.type);
803
808
  };
804
809
  var isResourceType = (resource) => {
805
- return resource?.type && chunkCFU5DNH2_cjs.binding.resourceList.includes(resource.type);
810
+ return resource?.type && chunkOROPOAHK_cjs.binding.resourceList.includes(resource.type);
806
811
  };
807
812
 
808
813
  exports.ApiResource = ApiResource;
@@ -812,5 +817,5 @@ exports.debug_default = debug_default;
812
817
  exports.isApiError = isApiError;
813
818
  exports.isSdkError = isSdkError;
814
819
  exports.isTokenExpired = isTokenExpired;
815
- //# sourceMappingURL=chunk-F2RLD5SN.cjs.map
816
- //# sourceMappingURL=chunk-F2RLD5SN.cjs.map
820
+ //# sourceMappingURL=chunk-EVDEBFHZ.cjs.map
821
+ //# sourceMappingURL=chunk-EVDEBFHZ.cjs.map