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

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 (141) hide show
  1. package/lib/{api-C_E9e1ea.d.ts → api-CrVODncY.d.ts} +16 -1
  2. package/lib/{api-C4jp_9vb.d.cts → api-DtxN9ZNI.d.cts} +16 -1
  3. package/lib/api.cjs +23 -23
  4. package/lib/api.d.cts +1 -1
  5. package/lib/api.d.ts +1 -1
  6. package/lib/api.js +13 -13
  7. package/lib/binding.cjs +3 -3
  8. package/lib/binding.d.cts +2 -2
  9. package/lib/binding.d.ts +2 -2
  10. package/lib/binding.js +2 -2
  11. package/lib/bundle.cjs +17 -17
  12. package/lib/bundle.d.cts +1 -1
  13. package/lib/bundle.d.ts +1 -1
  14. package/lib/bundle.js +15 -15
  15. package/lib/{chunk-3NDVX4SE.cjs → chunk-2H27UDGO.cjs} +4 -4
  16. package/lib/{chunk-3NDVX4SE.cjs.map → chunk-2H27UDGO.cjs.map} +1 -1
  17. package/lib/{chunk-LTIWXCVE.js → chunk-37LZALYC.js} +3 -3
  18. package/lib/{chunk-LTIWXCVE.js.map → chunk-37LZALYC.js.map} +1 -1
  19. package/lib/{chunk-I4LPOTDO.js → chunk-3AXLHEDT.js} +3 -3
  20. package/lib/{chunk-I4LPOTDO.js.map → chunk-3AXLHEDT.js.map} +1 -1
  21. package/lib/{chunk-WMUY7Z2Q.js → chunk-3PE2OE6B.js} +3 -3
  22. package/lib/{chunk-WMUY7Z2Q.js.map → chunk-3PE2OE6B.js.map} +1 -1
  23. package/lib/{chunk-MHV7FMLE.cjs → chunk-43XNULI4.cjs} +4 -4
  24. package/lib/{chunk-MHV7FMLE.cjs.map → chunk-43XNULI4.cjs.map} +1 -1
  25. package/lib/{chunk-KO4FQ4V2.cjs → chunk-4PMMCL4I.cjs} +4 -4
  26. package/lib/{chunk-KO4FQ4V2.cjs.map → chunk-4PMMCL4I.cjs.map} +1 -1
  27. package/lib/{chunk-OROPOAHK.cjs → chunk-4TC4U7TK.cjs} +4 -4
  28. package/lib/{chunk-OROPOAHK.cjs.map → chunk-4TC4U7TK.cjs.map} +1 -1
  29. package/lib/{chunk-T2U6MUX4.js → chunk-5VPJA5UV.js} +3 -3
  30. package/lib/{chunk-T2U6MUX4.js.map → chunk-5VPJA5UV.js.map} +1 -1
  31. package/lib/{chunk-ZWZHZ4SU.js → chunk-6FFP3YXV.js} +3 -3
  32. package/lib/{chunk-ZWZHZ4SU.js.map → chunk-6FFP3YXV.js.map} +1 -1
  33. package/lib/{chunk-YUNEDDTL.js → chunk-6MIFOPOB.js} +14 -14
  34. package/lib/{chunk-YUNEDDTL.js.map → chunk-6MIFOPOB.js.map} +1 -1
  35. package/lib/{chunk-STPXKF53.js → chunk-6PWTKNOC.js} +4 -4
  36. package/lib/{chunk-STPXKF53.js.map → chunk-6PWTKNOC.js.map} +1 -1
  37. package/lib/{chunk-CWXGTX7W.js → chunk-6SNLYMKG.js} +4 -4
  38. package/lib/{chunk-CWXGTX7W.js.map → chunk-6SNLYMKG.js.map} +1 -1
  39. package/lib/{chunk-FRLV5YFL.cjs → chunk-73VBQFUA.cjs} +4 -4
  40. package/lib/{chunk-FRLV5YFL.cjs.map → chunk-73VBQFUA.cjs.map} +1 -1
  41. package/lib/{chunk-IRFPCJTG.js → chunk-BFBXXP4Q.js} +3 -3
  42. package/lib/{chunk-IRFPCJTG.js.map → chunk-BFBXXP4Q.js.map} +1 -1
  43. package/lib/{chunk-XS6QLJHG.cjs → chunk-DDFTZDVN.cjs} +3 -3
  44. package/lib/{chunk-XS6QLJHG.cjs.map → chunk-DDFTZDVN.cjs.map} +1 -1
  45. package/lib/{chunk-TY46WNR6.cjs → chunk-DTORLDNE.cjs} +8 -8
  46. package/lib/{chunk-TY46WNR6.cjs.map → chunk-DTORLDNE.cjs.map} +1 -1
  47. package/lib/{chunk-DYMRH6LP.cjs → chunk-EUMMY3TQ.cjs} +4 -4
  48. package/lib/{chunk-DYMRH6LP.cjs.map → chunk-EUMMY3TQ.cjs.map} +1 -1
  49. package/lib/{chunk-6MXIGF2G.cjs → chunk-H5YSO3AX.cjs} +10 -10
  50. package/lib/{chunk-6MXIGF2G.cjs.map → chunk-H5YSO3AX.cjs.map} +1 -1
  51. package/lib/{chunk-EVDEBFHZ.cjs → chunk-HVYM2S4K.cjs} +35 -13
  52. package/lib/chunk-HVYM2S4K.cjs.map +1 -0
  53. package/lib/{chunk-G4JBHI2H.js → chunk-IRQX6AG3.js} +3 -3
  54. package/lib/{chunk-G4JBHI2H.js.map → chunk-IRQX6AG3.js.map} +1 -1
  55. package/lib/{chunk-ECGUWRRG.js → chunk-LSEKNECC.js} +3 -3
  56. package/lib/{chunk-ECGUWRRG.js.map → chunk-LSEKNECC.js.map} +1 -1
  57. package/lib/{chunk-3ILNEP2F.cjs → chunk-LV5XV2UF.cjs} +26 -26
  58. package/lib/{chunk-3ILNEP2F.cjs.map → chunk-LV5XV2UF.cjs.map} +1 -1
  59. package/lib/{chunk-FMHTNUZ4.cjs → chunk-MT2XP4UJ.cjs} +4 -4
  60. package/lib/{chunk-FMHTNUZ4.cjs.map → chunk-MT2XP4UJ.cjs.map} +1 -1
  61. package/lib/{chunk-7YEOUGXO.js → chunk-NDCVBYCJ.js} +3 -3
  62. package/lib/{chunk-7YEOUGXO.js.map → chunk-NDCVBYCJ.js.map} +1 -1
  63. package/lib/{chunk-GHXKZEH7.js → chunk-OTK6VLW5.js} +30 -8
  64. package/lib/chunk-OTK6VLW5.js.map +1 -0
  65. package/lib/{chunk-NDKGLF4B.cjs → chunk-PBYGXPJ6.cjs} +4 -4
  66. package/lib/{chunk-NDKGLF4B.cjs.map → chunk-PBYGXPJ6.cjs.map} +1 -1
  67. package/lib/{chunk-3PJNJ7B6.js → chunk-QTXYKCKC.js} +3 -3
  68. package/lib/{chunk-3PJNJ7B6.js.map → chunk-QTXYKCKC.js.map} +1 -1
  69. package/lib/{chunk-KT6LCJJQ.js → chunk-RWUBFJZ6.js} +3 -3
  70. package/lib/{chunk-KT6LCJJQ.js.map → chunk-RWUBFJZ6.js.map} +1 -1
  71. package/lib/{chunk-SQLX22US.js → chunk-VVSV5FR6.js} +3 -3
  72. package/lib/{chunk-SQLX22US.js.map → chunk-VVSV5FR6.js.map} +1 -1
  73. package/lib/{chunk-6FB54J7W.cjs → chunk-XKY46RI6.cjs} +4 -4
  74. package/lib/{chunk-6FB54J7W.cjs.map → chunk-XKY46RI6.cjs.map} +1 -1
  75. package/lib/{chunk-UILXNOZE.cjs → chunk-YAVEKFKE.cjs} +4 -4
  76. package/lib/{chunk-UILXNOZE.cjs.map → chunk-YAVEKFKE.cjs.map} +1 -1
  77. package/lib/{chunk-TXONK7R5.cjs → chunk-YYM7BH33.cjs} +4 -4
  78. package/lib/{chunk-TXONK7R5.cjs.map → chunk-YYM7BH33.cjs.map} +1 -1
  79. package/lib/commercelayer.cjs +10 -10
  80. package/lib/commercelayer.d.cts +1 -1
  81. package/lib/commercelayer.d.ts +1 -1
  82. package/lib/commercelayer.js +4 -4
  83. package/lib/enum.d.cts +1 -1
  84. package/lib/enum.d.ts +1 -1
  85. package/lib/index.cjs +22 -22
  86. package/lib/index.cjs.map +1 -1
  87. package/lib/index.d.cts +1 -1
  88. package/lib/index.d.ts +1 -1
  89. package/lib/index.js +17 -17
  90. package/lib/index.js.map +1 -1
  91. package/lib/model.d.cts +1 -1
  92. package/lib/model.d.ts +1 -1
  93. package/lib/resources/api_credentials.cjs +5 -5
  94. package/lib/resources/api_credentials.d.cts +2 -2
  95. package/lib/resources/api_credentials.d.ts +1 -1
  96. package/lib/resources/api_credentials.js +4 -4
  97. package/lib/resources/application_memberships.cjs +5 -5
  98. package/lib/resources/application_memberships.d.cts +2 -2
  99. package/lib/resources/application_memberships.d.ts +1 -1
  100. package/lib/resources/application_memberships.js +4 -4
  101. package/lib/resources/identity_providers.cjs +5 -5
  102. package/lib/resources/identity_providers.d.cts +2 -2
  103. package/lib/resources/identity_providers.d.ts +1 -1
  104. package/lib/resources/identity_providers.js +4 -4
  105. package/lib/resources/membership_profiles.cjs +5 -5
  106. package/lib/resources/membership_profiles.d.cts +2 -2
  107. package/lib/resources/membership_profiles.d.ts +1 -1
  108. package/lib/resources/membership_profiles.js +4 -4
  109. package/lib/resources/memberships.cjs +5 -5
  110. package/lib/resources/memberships.d.cts +2 -2
  111. package/lib/resources/memberships.d.ts +1 -1
  112. package/lib/resources/memberships.js +4 -4
  113. package/lib/resources/organizations.cjs +5 -5
  114. package/lib/resources/organizations.d.cts +2 -2
  115. package/lib/resources/organizations.d.ts +1 -1
  116. package/lib/resources/organizations.js +4 -4
  117. package/lib/resources/permissions.cjs +5 -5
  118. package/lib/resources/permissions.d.cts +2 -2
  119. package/lib/resources/permissions.d.ts +1 -1
  120. package/lib/resources/permissions.js +4 -4
  121. package/lib/resources/roles.cjs +5 -5
  122. package/lib/resources/roles.d.cts +2 -2
  123. package/lib/resources/roles.d.ts +1 -1
  124. package/lib/resources/roles.js +4 -4
  125. package/lib/resources/users.cjs +5 -5
  126. package/lib/resources/users.d.cts +2 -2
  127. package/lib/resources/users.d.ts +1 -1
  128. package/lib/resources/users.js +4 -4
  129. package/lib/resources/versions.cjs +5 -5
  130. package/lib/resources/versions.d.cts +2 -2
  131. package/lib/resources/versions.d.ts +1 -1
  132. package/lib/resources/versions.js +4 -4
  133. package/lib/static.cjs +6 -6
  134. package/lib/static.d.cts +1 -1
  135. package/lib/static.d.ts +1 -1
  136. package/lib/static.js +5 -5
  137. package/lib/version.cjs +4 -4
  138. package/lib/version.js +1 -1
  139. package/package.json +2 -2
  140. package/lib/chunk-EVDEBFHZ.cjs.map +0 -1
  141. package/lib/chunk-GHXKZEH7.js.map +0 -1
@@ -1,4 +1,4 @@
1
- import { ApiResource } from './chunk-GHXKZEH7.js';
1
+ import { ApiResource } from './chunk-OTK6VLW5.js';
2
2
 
3
3
  // gen/resources/versions.ts
4
4
  var Versions = class _Versions extends ApiResource {
@@ -20,5 +20,5 @@ var instance = new Versions();
20
20
  var versions_default = instance;
21
21
 
22
22
  export { versions_default };
23
- //# sourceMappingURL=chunk-G4JBHI2H.js.map
24
- //# sourceMappingURL=chunk-G4JBHI2H.js.map
23
+ //# sourceMappingURL=chunk-IRQX6AG3.js.map
24
+ //# sourceMappingURL=chunk-IRQX6AG3.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../gen/resources/versions.ts"],"names":[],"mappings":";;;AA4CA,IAAM,QAAA,GAAN,MAAM,SAAA,SAAiB,WAAA,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-G4JBHI2H.js","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":[],"mappings":";;;AA4CA,IAAM,QAAA,GAAN,MAAM,SAAA,SAAiB,WAAA,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-IRQX6AG3.js","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-GHXKZEH7.js';
1
+ import { ApiResource } from './chunk-OTK6VLW5.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-ECGUWRRG.js.map
78
- //# sourceMappingURL=chunk-ECGUWRRG.js.map
77
+ //# sourceMappingURL=chunk-LSEKNECC.js.map
78
+ //# sourceMappingURL=chunk-LSEKNECC.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;AAAA,MACxC,MAAA;AAAA,MACA;AAAA,KACF;AAAA,EACF;AAAA,EAEA,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,WAAA,CACJ,cAAA,EACA,MAAA,EACA,OAAA,EACmC;AACnC,IAAA,MAAM,eAAA,GAAmB,eAAgC,EAAA,IAAO,cAAA;AAChE,IAAA,OAAO,KAAK,SAAA,CAAU,KAAA;AAAA,MACpB,EAAE,MAAM,aAAA,EAAc;AAAA,MACtB,iBAAiB,eAAe,CAAA,YAAA,CAAA;AAAA,MAChC,MAAA;AAAA,M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AAyC;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
+ {"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,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,WAAA,CACJ,cAAA,EACA,MAAA,EACA,OAAA,EACmC;AACnC,IAAA,MAAM,eAAA,GAAmB,eAAgC,EAAA,IAAO,cAAA;AAChE,IAAA,OAAO,KAAK,SAAA,CAAU,KAAA;AAAA,MACpB,EAAE,MAAM,aAAA,EAAc;AAAA,MACtB,iBAAiB,eAAe,CAAA,YAAA,CAAA;AAAA,MAChC,MAAA;AAAA,MACA;AAAA,KACF;AAAA,EACF;AAAA,EAEA,MAAM,KAAA,CACJ,cAAA,EACA,MAAA,EACA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AA,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-LSEKNECC.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,21 +1,21 @@
1
1
  'use strict';
2
2
 
3
- var chunk6MXIGF2G_cjs = require('./chunk-6MXIGF2G.cjs');
4
- var chunkFRLV5YFL_cjs = require('./chunk-FRLV5YFL.cjs');
5
- var chunkKO4FQ4V2_cjs = require('./chunk-KO4FQ4V2.cjs');
6
- var chunk6FB54J7W_cjs = require('./chunk-6FB54J7W.cjs');
7
- var chunkDYMRH6LP_cjs = require('./chunk-DYMRH6LP.cjs');
8
- var chunkMHV7FMLE_cjs = require('./chunk-MHV7FMLE.cjs');
9
- var chunkUILXNOZE_cjs = require('./chunk-UILXNOZE.cjs');
10
- var chunkTXONK7R5_cjs = require('./chunk-TXONK7R5.cjs');
11
- var chunk3NDVX4SE_cjs = require('./chunk-3NDVX4SE.cjs');
12
- var chunkFMHTNUZ4_cjs = require('./chunk-FMHTNUZ4.cjs');
13
- var chunkNDKGLF4B_cjs = require('./chunk-NDKGLF4B.cjs');
14
- var chunkEVDEBFHZ_cjs = require('./chunk-EVDEBFHZ.cjs');
3
+ var chunkH5YSO3AX_cjs = require('./chunk-H5YSO3AX.cjs');
4
+ var chunk73VBQFUA_cjs = require('./chunk-73VBQFUA.cjs');
5
+ var chunk4PMMCL4I_cjs = require('./chunk-4PMMCL4I.cjs');
6
+ var chunkXKY46RI6_cjs = require('./chunk-XKY46RI6.cjs');
7
+ var chunkEUMMY3TQ_cjs = require('./chunk-EUMMY3TQ.cjs');
8
+ var chunk43XNULI4_cjs = require('./chunk-43XNULI4.cjs');
9
+ var chunkYAVEKFKE_cjs = require('./chunk-YAVEKFKE.cjs');
10
+ var chunkYYM7BH33_cjs = require('./chunk-YYM7BH33.cjs');
11
+ var chunk2H27UDGO_cjs = require('./chunk-2H27UDGO.cjs');
12
+ var chunkMT2XP4UJ_cjs = require('./chunk-MT2XP4UJ.cjs');
13
+ var chunkPBYGXPJ6_cjs = require('./chunk-PBYGXPJ6.cjs');
14
+ var chunkHVYM2S4K_cjs = require('./chunk-HVYM2S4K.cjs');
15
15
 
16
16
  // gen/bundle.ts
17
- var debug = chunkEVDEBFHZ_cjs.debug_default("bundle");
18
- var CommerceLayerProvisioningClient = class _CommerceLayerProvisioningClient extends chunk6MXIGF2G_cjs.CommerceLayerProvisioningBaseClient {
17
+ var debug = chunkHVYM2S4K_cjs.debug_default("bundle");
18
+ var CommerceLayerProvisioningClient = class _CommerceLayerProvisioningClient extends chunkH5YSO3AX_cjs.CommerceLayerProvisioningBaseClient {
19
19
  // ##__CL_RESOURCES_DEF_START__##
20
20
  // ##__CL_RESOURCES_DEF_TEMPLATE:: ##__TAB__#####__RESOURCE_TYPE__##?: api.##__RESOURCE_CLASS__##
21
21
  #api_credentials;
@@ -48,34 +48,34 @@ var CommerceLayerProvisioningClient = class _CommerceLayerProvisioningClient ext
48
48
  // ##__CL_RESOURCES_LAZY_LOADING_START__##
49
49
  // ##__CL_RESOURCES_LAZY_LOADING_TEMPLATE:: ##__TAB__##get ##__RESOURCE_TYPE__##(): api.##__RESOURCE_CLASS__## { return this.###__RESOURCE_TYPE__## || (this.###__RESOURCE_TYPE__## = api.##__RESOURCE_TYPE__##.withAdapter(this.adapter)) }
50
50
  get api_credentials() {
51
- return this.#api_credentials || (this.#api_credentials = chunkMHV7FMLE_cjs.api_credentials_default.withAdapter(this.adapter));
51
+ return this.#api_credentials || (this.#api_credentials = chunk43XNULI4_cjs.api_credentials_default.withAdapter(this.adapter));
52
52
  }
53
53
  get application_memberships() {
54
- return this.#application_memberships || (this.#application_memberships = chunkUILXNOZE_cjs.application_memberships_default.withAdapter(this.adapter));
54
+ return this.#application_memberships || (this.#application_memberships = chunkYAVEKFKE_cjs.application_memberships_default.withAdapter(this.adapter));
55
55
  }
56
56
  get identity_providers() {
57
- return this.#identity_providers || (this.#identity_providers = chunkTXONK7R5_cjs.identity_providers_default.withAdapter(this.adapter));
57
+ return this.#identity_providers || (this.#identity_providers = chunkYYM7BH33_cjs.identity_providers_default.withAdapter(this.adapter));
58
58
  }
59
59
  get memberships() {
60
- return this.#memberships || (this.#memberships = chunkFMHTNUZ4_cjs.memberships_default.withAdapter(this.adapter));
60
+ return this.#memberships || (this.#memberships = chunkMT2XP4UJ_cjs.memberships_default.withAdapter(this.adapter));
61
61
  }
62
62
  get membership_profiles() {
63
- return this.#membership_profiles || (this.#membership_profiles = chunk3NDVX4SE_cjs.membership_profiles_default.withAdapter(this.adapter));
63
+ return this.#membership_profiles || (this.#membership_profiles = chunk2H27UDGO_cjs.membership_profiles_default.withAdapter(this.adapter));
64
64
  }
65
65
  get organizations() {
66
- return this.#organizations || (this.#organizations = chunkNDKGLF4B_cjs.organizations_default.withAdapter(this.adapter));
66
+ return this.#organizations || (this.#organizations = chunkPBYGXPJ6_cjs.organizations_default.withAdapter(this.adapter));
67
67
  }
68
68
  get permissions() {
69
- return this.#permissions || (this.#permissions = chunkFRLV5YFL_cjs.permissions_default.withAdapter(this.adapter));
69
+ return this.#permissions || (this.#permissions = chunk73VBQFUA_cjs.permissions_default.withAdapter(this.adapter));
70
70
  }
71
71
  get roles() {
72
- return this.#roles || (this.#roles = chunkKO4FQ4V2_cjs.roles_default.withAdapter(this.adapter));
72
+ return this.#roles || (this.#roles = chunk4PMMCL4I_cjs.roles_default.withAdapter(this.adapter));
73
73
  }
74
74
  get user() {
75
- return this.#user || (this.#user = chunk6FB54J7W_cjs.users_default.withAdapter(this.adapter));
75
+ return this.#user || (this.#user = chunkXKY46RI6_cjs.users_default.withAdapter(this.adapter));
76
76
  }
77
77
  get versions() {
78
- return this.#versions || (this.#versions = chunkDYMRH6LP_cjs.versions_default.withAdapter(this.adapter));
78
+ return this.#versions || (this.#versions = chunkEUMMY3TQ_cjs.versions_default.withAdapter(this.adapter));
79
79
  }
80
80
  // ##__CL_RESOURCES_LAZY_LOADING_STOP__##
81
81
  // ##__CL_RESOURCES_ACCESSORS_ONLY_START__##
@@ -89,5 +89,5 @@ var bundle_default = CommerceLayerProvisioning;
89
89
 
90
90
  exports.CommerceLayerProvisioning = CommerceLayerProvisioning;
91
91
  exports.bundle_default = bundle_default;
92
- //# sourceMappingURL=chunk-3ILNEP2F.cjs.map
93
- //# sourceMappingURL=chunk-3ILNEP2F.cjs.map
92
+ //# sourceMappingURL=chunk-LV5XV2UF.cjs.map
93
+ //# sourceMappingURL=chunk-LV5XV2UF.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../gen/bundle.ts"],"names":["debug_default","CommerceLayerProvisioningBaseClient","api_credentials_default","application_memberships_default","identity_providers_default","memberships_default","membership_profiles_default","organizations_default","permissions_default","roles_default","users_default","versions_default"],"mappings":";;;;;;;;;;;;;;;;AAKA,IAAM,KAAA,GAAQA,gCAAM,QAAQ,CAAA;AAE5B,IAAM,+BAAA,GAAN,MAAM,gCAAA,SAAwCC,qDAAA,CAAoC;AAAA;AAAA;AAAA,EAGhF,gBAAA;AAAA,EACA,wBAAA;AAAA,EACA,mBAAA;AAAA,EACA,YAAA;AAAA,EACA,oBAAA;AAAA,EACA,cAAA;AAAA,EACA,YAAA;AAAA,EACA,MAAA;AAAA,EACA,KAAA;AAAA,EACA,SAAA;AAAA;AAAA,EAGO,YAAY,MAAA,EAAiC;AAClD,IAAA,KAAA,CAAM,MAAM,CAAA;AACZ,IAAA,KAAA,CAAM,wCAAwC,MAAM,CAAA;AAAA,EAKtD;AAAA,EAEA,OAAO,IAAI,MAAA,EAAmE;AAC5E,IAAA,IAAI,QAAQ,OAAQ,gCAAA,CAAgC,EAAA,GAAK,IAAI,iCAAgC,MAAM,CAAA;AAAA,SAAA,IAC1F,CAAC,gCAAA,CAAgC,EAAA;AACxC,MAAA,MAAM,IAAI,MAAM,yDAAyD,CAAA;AAC3E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,IAAI,KAAA,GAAmB;AACrB,IAAA,OAAO,KAAK,MAAA,KAAW,IAAA,CAAK,SAAaC,+BAAA,CAAM,WAAA,CAAY,KAAK,OAAO,CAAA,CAAA;AAAA,EACzE;AAAA,EACA,IAAI,IAAA,GAAkB;AACpB,IAAA,OAAO,KAAK,KAAA,KAAU,IAAA,CAAK,QAAYC,+BAAA,CAAK,WAAA,CAAY,KAAK,OAAO,CAAA,CAAA;AAAA,EACtE;AAAA,EACA,IAAI,QAAA,GAAyB;AAC3B,IAAA,OAAO,KAAK,SAAA,KAAc,IAAA,CAAK,YAAgBC,kCAAA,CAAS,WAAA,CAAY,KAAK,OAAO,CAAA,CAAA;AAAA,EAClF;AAAA;AAAA;AAAA;AAAA;AAMF,CAAA;AAEA,SAAS,0BAA0B,MAAA,EAAkE;AACnG,EAAA,OAAO,+BAAA,CAAgC,IAAI,MAAM,CAAA;AACnD;AAEA,IAAO,cAAA,GAAQ","file":"chunk-3ILNEP2F.cjs","sourcesContent":["import Debug from '@runtime/debug'\nimport type { ResourceAdapter } from '@runtime/resource'\nimport { type CommerceLayerInitConfig, CommerceLayerProvisioningBaseClient } from '../src/commercelayer'\nimport * as api from './api'\n\nconst debug = Debug('bundle')\n\nclass CommerceLayerProvisioningClient extends CommerceLayerProvisioningBaseClient {\n // ##__CL_RESOURCES_DEF_START__##\n // ##__CL_RESOURCES_DEF_TEMPLATE:: ##__TAB__#####__RESOURCE_TYPE__##?: api.##__RESOURCE_CLASS__##\n #api_credentials?: api.ApiCredentials\n #application_memberships?: api.ApplicationMemberships\n #identity_providers?: api.IdentityProviders\n #memberships?: api.Memberships\n #membership_profiles?: api.MembershipProfiles\n #organizations?: api.Organizations\n #permissions?: api.Permissions\n #roles?: api.Roles\n #user?: api.Users\n #versions?: api.Versions\n // ##__CL_RESOURCES_DEF_STOP__##\n\n public constructor(config: CommerceLayerInitConfig) {\n super(config)\n debug('new commercelayer bundle instance %O', config)\n\n // ##__CL_RESOURCES_INIT_START__##\n // ##__CL_RESOURCES_INIT_TEMPLATE:: ##__TAB__####__TAB__##this.##__RESOURCE_TYPE__## = new api.##__RESOURCE_CLASS__##(this.#adapter)\n // ##__CL_RESOURCES_INIT_STOP__##\n }\n\n static get(config?: CommerceLayerInitConfig): CommerceLayerProvisioningClient {\n if (config) return (CommerceLayerProvisioningClient.cl = new CommerceLayerProvisioningClient(config))\n else if (!CommerceLayerProvisioningClient.cl)\n throw new Error('CommerceLayerProvisioning bundle client not initialized')\n return CommerceLayerProvisioningClient.cl as CommerceLayerProvisioningClient\n }\n\n // Bundle clients are isolated: route this instance's requests, config and\n // interceptors through the adapter built for it, not the process-global\n // static one. The resource accessors below bind to this same adapter.\n protected override get adapter(): ResourceAdapter {\n return this.instanceAdapter\n }\n\n // ##__CL_RESOURCES_LAZY_LOADING_START__##\n // ##__CL_RESOURCES_LAZY_LOADING_TEMPLATE:: ##__TAB__##get ##__RESOURCE_TYPE__##(): api.##__RESOURCE_CLASS__## { return this.###__RESOURCE_TYPE__## || (this.###__RESOURCE_TYPE__## = api.##__RESOURCE_TYPE__##.withAdapter(this.adapter)) }\n get api_credentials(): api.ApiCredentials {\n return this.#api_credentials || (this.#api_credentials = api.api_credentials.withAdapter(this.adapter))\n }\n get application_memberships(): api.ApplicationMemberships {\n return (\n this.#application_memberships ||\n (this.#application_memberships = api.application_memberships.withAdapter(this.adapter))\n )\n }\n get identity_providers(): api.IdentityProviders {\n return this.#identity_providers || (this.#identity_providers = api.identity_providers.withAdapter(this.adapter))\n }\n get memberships(): api.Memberships {\n return this.#memberships || (this.#memberships = api.memberships.withAdapter(this.adapter))\n }\n get membership_profiles(): api.MembershipProfiles {\n return this.#membership_profiles || (this.#membership_profiles = api.membership_profiles.withAdapter(this.adapter))\n }\n get organizations(): api.Organizations {\n return this.#organizations || (this.#organizations = api.organizations.withAdapter(this.adapter))\n }\n get permissions(): api.Permissions {\n return this.#permissions || (this.#permissions = api.permissions.withAdapter(this.adapter))\n }\n get roles(): api.Roles {\n return this.#roles || (this.#roles = api.roles.withAdapter(this.adapter))\n }\n get user(): api.Users {\n return this.#user || (this.#user = api.user.withAdapter(this.adapter))\n }\n get versions(): api.Versions {\n return this.#versions || (this.#versions = api.versions.withAdapter(this.adapter))\n }\n // ##__CL_RESOURCES_LAZY_LOADING_STOP__##\n\n // ##__CL_RESOURCES_ACCESSORS_ONLY_START__##\n // ##__CL_RESOURCES_ACCESSORS_ONLY_TEMPLATE:: ##__TAB__##get ##__RESOURCE_TYPE__##(): api.##__RESOURCE_CLASS__## { return api.##__RESOURCE_TYPE__## }\n // ##__CL_RESOURCES_ACCESSORS_ONLY_STOP__##\n}\n\nfunction CommerceLayerProvisioning(config: CommerceLayerInitConfig): CommerceLayerProvisioningClient {\n return CommerceLayerProvisioningClient.get(config)\n}\n\nexport default CommerceLayerProvisioning\nexport { CommerceLayerProvisioning, type CommerceLayerProvisioningClient }\n"]}
1
+ {"version":3,"sources":["../gen/bundle.ts"],"names":["debug_default","CommerceLayerProvisioningBaseClient","api_credentials_default","application_memberships_default","identity_providers_default","memberships_default","membership_profiles_default","organizations_default","permissions_default","roles_default","users_default","versions_default"],"mappings":";;;;;;;;;;;;;;;;AAKA,IAAM,KAAA,GAAQA,gCAAM,QAAQ,CAAA;AAE5B,IAAM,+BAAA,GAAN,MAAM,gCAAA,SAAwCC,qDAAA,CAAoC;AAAA;AAAA;AAAA,EAGhF,gBAAA;AAAA,EACA,wBAAA;AAAA,EACA,mBAAA;AAAA,EACA,YAAA;AAAA,EACA,oBAAA;AAAA,EACA,cAAA;AAAA,EACA,YAAA;AAAA,EACA,MAAA;AAAA,EACA,KAAA;AAAA,EACA,SAAA;AAAA;AAAA,EAGO,YAAY,MAAA,EAAiC;AAClD,IAAA,KAAA,CAAM,MAAM,CAAA;AACZ,IAAA,KAAA,CAAM,wCAAwC,MAAM,CAAA;AAAA,EAKtD;AAAA,EAEA,OAAO,IAAI,MAAA,EAAmE;AAC5E,IAAA,IAAI,QAAQ,OAAQ,gCAAA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WAAA,GAA+B;AACjC,IAAA,OAAO,KAAK,YAAA,KAAiB,IAAA,CAAK,eAAmBC,qCAAA,CAAY,WAAA,CAAY,KAAK,OAAO,CAAA,CAAA;AAAA,EAC3F;AAAA,EACA,IAAI,KAAA,GAAmB;AACrB,IAAA,OAAO,KAAK,MAAA,KAAW,IAAA,CAAK,SAAaC,+BAAA,CAAM,WAAA,CAAY,KAAK,OAAO,CAAA,CAAA;AAAA,EACzE;AAAA,EACA,IAAI,IAAA,GAAkB;AACpB,IAAA,OAAO,KAAK,KAAA,KAAU,IAAA,CAAK,QAAYC,+BAAA,CAAK,WAAA,CAAY,KAAK,OAAO,CAAA,CAAA;AAAA,EACtE;AAAA,EACA,IAAI,QAAA,GAAyB;AAC3B,IAAA,OAAO,KAAK,SAAA,KAAc,IAAA,CAAK,YAAgBC,kCAAA,CAAS,WAAA,CAAY,KAAK,OAAO,CAAA,CAAA;AAAA,EAClF;AAAA;AAAA;AAAA;AAAA;AAMF,CAAA;AAEA,SAAS,0BAA0B,MAAA,EAAkE;AACnG,EAAA,OAAO,+BAAA,CAAgC,IAAI,MAAM,CAAA;AACnD;AAEA,IAAO,cAAA,GAAQ","file":"chunk-LV5XV2UF.cjs","sourcesContent":["import Debug from '@runtime/debug'\nimport type { ResourceAdapter } from '@runtime/resource'\nimport { type CommerceLayerInitConfig, CommerceLayerProvisioningBaseClient } from '../src/commercelayer'\nimport * as api from './api'\n\nconst debug = Debug('bundle')\n\nclass CommerceLayerProvisioningClient extends CommerceLayerProvisioningBaseClient {\n // ##__CL_RESOURCES_DEF_START__##\n // ##__CL_RESOURCES_DEF_TEMPLATE:: ##__TAB__#####__RESOURCE_TYPE__##?: api.##__RESOURCE_CLASS__##\n #api_credentials?: api.ApiCredentials\n #application_memberships?: api.ApplicationMemberships\n #identity_providers?: api.IdentityProviders\n #memberships?: api.Memberships\n #membership_profiles?: api.MembershipProfiles\n #organizations?: api.Organizations\n #permissions?: api.Permissions\n #roles?: api.Roles\n #user?: api.Users\n #versions?: api.Versions\n // ##__CL_RESOURCES_DEF_STOP__##\n\n public constructor(config: CommerceLayerInitConfig) {\n super(config)\n debug('new commercelayer bundle instance %O', config)\n\n // ##__CL_RESOURCES_INIT_START__##\n // ##__CL_RESOURCES_INIT_TEMPLATE:: ##__TAB__####__TAB__##this.##__RESOURCE_TYPE__## = new api.##__RESOURCE_CLASS__##(this.#adapter)\n // ##__CL_RESOURCES_INIT_STOP__##\n }\n\n static get(config?: CommerceLayerInitConfig): CommerceLayerProvisioningClient {\n if (config) return (CommerceLayerProvisioningClient.cl = new CommerceLayerProvisioningClient(config))\n else if (!CommerceLayerProvisioningClient.cl)\n throw new Error('CommerceLayerProvisioning bundle client not initialized')\n return CommerceLayerProvisioningClient.cl as CommerceLayerProvisioningClient\n }\n\n // Bundle clients are isolated: route this instance's requests, config and\n // interceptors through the adapter built for it, not the process-global\n // static one. The resource accessors below bind to this same adapter.\n protected override get adapter(): ResourceAdapter {\n return this.instanceAdapter\n }\n\n // ##__CL_RESOURCES_LAZY_LOADING_START__##\n // ##__CL_RESOURCES_LAZY_LOADING_TEMPLATE:: ##__TAB__##get ##__RESOURCE_TYPE__##(): api.##__RESOURCE_CLASS__## { return this.###__RESOURCE_TYPE__## || (this.###__RESOURCE_TYPE__## = api.##__RESOURCE_TYPE__##.withAdapter(this.adapter)) }\n get api_credentials(): api.ApiCredentials {\n return this.#api_credentials || (this.#api_credentials = api.api_credentials.withAdapter(this.adapter))\n }\n get application_memberships(): api.ApplicationMemberships {\n return (\n this.#application_memberships ||\n (this.#application_memberships = api.application_memberships.withAdapter(this.adapter))\n )\n }\n get identity_providers(): api.IdentityProviders {\n return this.#identity_providers || (this.#identity_providers = api.identity_providers.withAdapter(this.adapter))\n }\n get memberships(): api.Memberships {\n return this.#memberships || (this.#memberships = api.memberships.withAdapter(this.adapter))\n }\n get membership_profiles(): api.MembershipProfiles {\n return this.#membership_profiles || (this.#membership_profiles = api.membership_profiles.withAdapter(this.adapter))\n }\n get organizations(): api.Organizations {\n return this.#organizations || (this.#organizations = api.organizations.withAdapter(this.adapter))\n }\n get permissions(): api.Permissions {\n return this.#permissions || (this.#permissions = api.permissions.withAdapter(this.adapter))\n }\n get roles(): api.Roles {\n return this.#roles || (this.#roles = api.roles.withAdapter(this.adapter))\n }\n get user(): api.Users {\n return this.#user || (this.#user = api.user.withAdapter(this.adapter))\n }\n get versions(): api.Versions {\n return this.#versions || (this.#versions = api.versions.withAdapter(this.adapter))\n }\n // ##__CL_RESOURCES_LAZY_LOADING_STOP__##\n\n // ##__CL_RESOURCES_ACCESSORS_ONLY_START__##\n // ##__CL_RESOURCES_ACCESSORS_ONLY_TEMPLATE:: ##__TAB__##get ##__RESOURCE_TYPE__##(): api.##__RESOURCE_CLASS__## { return api.##__RESOURCE_TYPE__## }\n // ##__CL_RESOURCES_ACCESSORS_ONLY_STOP__##\n}\n\nfunction CommerceLayerProvisioning(config: CommerceLayerInitConfig): CommerceLayerProvisioningClient {\n return CommerceLayerProvisioningClient.get(config)\n}\n\nexport default CommerceLayerProvisioning\nexport { CommerceLayerProvisioning, type CommerceLayerProvisioningClient }\n"]}
@@ -1,9 +1,9 @@
1
1
  'use strict';
2
2
 
3
- var chunkEVDEBFHZ_cjs = require('./chunk-EVDEBFHZ.cjs');
3
+ var chunkHVYM2S4K_cjs = require('./chunk-HVYM2S4K.cjs');
4
4
 
5
5
  // gen/resources/memberships.ts
6
- var Memberships = class _Memberships extends chunkEVDEBFHZ_cjs.ApiResource {
6
+ var Memberships = class _Memberships extends chunkHVYM2S4K_cjs.ApiResource {
7
7
  static TYPE = "memberships";
8
8
  async create(resource, params, options) {
9
9
  return this.resources.create({ ...resource, type: _Memberships.TYPE }, params, options);
@@ -80,5 +80,5 @@ var instance = new Memberships();
80
80
  var memberships_default = instance;
81
81
 
82
82
  exports.memberships_default = memberships_default;
83
- //# sourceMappingURL=chunk-FMHTNUZ4.cjs.map
84
- //# sourceMappingURL=chunk-FMHTNUZ4.cjs.map
83
+ //#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A0C;AACxF,IAAA,MAAM,aAAA,GAAiB,aAA4B,EAAA,IAAO,YAAA;AAC1D,IAAA,MAAM,IAAA,CAAK,UAAU,MAAA,CAAO,MAAA,EAAQ,eAAe,aAAa,CAAA,OAAA,CAAA,EAAW,EAAC,EAAG,OAAO,CAAA;AAAA,EACxF;AAAA,EAEA,aAAa,QAAA,EAAuC;AAClD,IAAA,OAAO,QAAA,CAAS,IAAA,IAAQ,QAAA,CAAS,IAAA,KAAS,YAAA,CAAY,IAAA;AAAA,EACxD;AAAA,EAEA,aAAa,EAAA,EAA+C;AAC1D,IAAA,OAAO,KAAA,CAAM,qBAAoC,EAAE,CAAA;AAAA,EACrD;AAAA,EAEA,sBAAsB,GAAA,EAAgC;AACpD,IAAA,OAAO,KAAA,CAAM,qBAAA,CAAqC,GAAG,GAAG,CAAA;AAAA,EAC1D;AAAA,EAEA,IAAA,GAAuB;AACrB,IAAA,OAAO,YAAA,CAAY,IAAA;AAAA,EACrB;AACF,CAAA;AAEA,IAAM,QAAA,GAAW,IAAI,WAAA,EAAY;AACjC,IAAO,mBAAA,GAAQ","file":"chunk-FMHTNUZ4.cjs","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 { ApplicationMembership, ApplicationMembershipType } from './application_memberships'\nimport type { MembershipProfile, MembershipProfileType } from './membership_profiles'\nimport type { Organization, OrganizationType } from './organizations'\nimport type { Role, RoleType } from './roles'\nimport type { Version } from './versions'\n\ntype MembershipType = 'memberships'\ntype MembershipRel = ResourceRel & { type: MembershipType }\ntype OrganizationRel = ResourceRel & { type: OrganizationType }\ntype RoleRel = ResourceRel & { type: RoleType }\ntype ApplicationMembershipRel = ResourceRel & { type: ApplicationMembershipType }\ntype MembershipProfileRel = ResourceRel & { type: MembershipProfileType }\n\nexport type MembershipSort = Pick<Membership, 'id' | 'status'> & ResourceSort\n// export type MembershipFilter = Pick<Membership, 'id' | 'user_email' | 'status' | 'owner' | 'access_scope'> & ResourceFilter\n\n/**\n * The Membership object is returned as part of the response body of each successful list, retrieve, create, update or delete API call to the /api/memberships endpoint.\n *\n * @link https://docs.commercelayer.io/provisioning-api-reference/memberships/object\n */\ninterface Membership extends Resource {\n readonly type: MembershipType\n\n /**\n * The user email.\n * @example ```\"commercelayer@commercelayer.io\"```\n */\n user_email: string\n /**\n * The user first name.\n * @example ```\"John\"```\n */\n user_first_name?: string | null\n /**\n * The user last name.\n * @example ```\"Doe\"```\n */\n user_last_name?: string | null\n /**\n * The memberships status. One of `pending` (default), `active`.\n * @example ```\"pending\"```\n */\n status: 'pending' | 'active'\n /**\n * Indicates if the user it's the owner of the organization.\n * @example ```true```\n */\n owner?: boolean | null\n /**\n * Reflects the organization's access scope, either test_access or all_access.\n * @example ```true```\n */\n test_enabled?: boolean | null\n /**\n * The access scope for applications. One of `live_access` (default), `test_access`, `all_access`.\n * @example ```\"live_access\"```\n */\n access_scope?: 'live_access' | 'test_access' | 'all_access' | null\n\n organization?: Organization | null\n role?: Role | null\n application_memberships?: ApplicationMembership[] | null\n membership_profile?: MembershipProfile | null\n versions?: Version[] | null\n}\n\ninterface MembershipCreate extends ResourceCreate {\n /**\n * The user email.\n * @example ```\"commercelayer@commercelayer.io\"```\n */\n user_email: string\n /**\n * The access scope for applications. One of `live_access` (default), `test_access`, `all_access`.\n * @example ```\"live_access\"```\n */\n access_scope?: 'live_access' | 'test_access' | 'all_access' | null\n\n organization: OrganizationRel\n role: RoleRel\n application_memberships?: ApplicationMembershipRel[] | null\n membership_profile?: MembershipProfileRel | null\n}\n\ninterface MembershipUpdate extends ResourceUpdate {\n /**\n * The access scope for applications. One of `live_access` (default), `test_access`, `all_access`.\n * @example ```\"live_access\"```\n */\n access_scope?: 'live_access' | 'test_access' | 'all_access' | null\n\n role?: RoleRel | null\n application_memberships?: ApplicationMembershipRel[] | null\n membership_profile?: MembershipProfileRel | null\n}\n\nclass Memberships extends ApiResource<Membership> {\n static readonly TYPE: MembershipType = 'memberships' as const\n\n async create(\n resource: MembershipCreate,\n params?: QueryParamsRetrieve<Membership>,\n options?: ResourcesConfig,\n ): Promise<Membership> {\n return this.resources.create<MembershipCreate, Membership>({ ...resource, type: Memberships.TYPE }, params, options)\n }\n\n async update(\n resource: MembershipUpdate,\n params?: QueryParamsRetrieve<Membership>,\n options?: ResourcesConfig,\n ): Promise<Membership> {\n return this.resources.update<MembershipUpdate, Membership>({ ...resource, type: Memberships.TYPE }, params, options)\n }\n\n async delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void> {\n await this.resources.delete(typeof id === 'string' ? { id, type: Memberships.TYPE } : id, options)\n }\n\n async organization(\n membershipId: string | Membership,\n params?: QueryParamsRetrieve<Organization>,\n options?: ResourcesConfig,\n ): Promise<Organization> {\n const _membershipId = (membershipId as Membership).id || (membershipId as string)\n return this.resources.fetch<Organization>(\n { type: 'organizations' },\n `memberships/${_membershipId}/organization`,\n params,\n options,\n ) as unknown as Organization\n }\n\n async role(\n membershipId: string | Membership,\n params?: QueryParamsRetrieve<Role>,\n options?: ResourcesConfig,\n ): Promise<Role> {\n const _membershipId = (membershipId as Membership).id || (membershipId as string)\n return this.resources.fetch<Role>(\n { type: 'roles' },\n `memberships/${_membershipId}/role`,\n params,\n options,\n ) as unknown as Role\n }\n\n async application_memberships(\n membershipId: string | Membership,\n params?: QueryParamsList<ApplicationMembership>,\n options?: ResourcesConfig,\n ): Promise<ListResponse<ApplicationMembership>> {\n const _membershipId = (membershipId as Membership).id || (membershipId as string)\n return this.resources.fetch<ApplicationMembership>(\n { type: 'application_memberships' },\n `memberships/${_membershipId}/application_memberships`,\n params,\n options,\n ) as unknown as ListResponse<ApplicationMembership>\n }\n\n async membership_profile(\n membershipId: string | Membership,\n params?: QueryParamsRetrieve<MembershipProfile>,\n options?: ResourcesConfig,\n ): Promise<MembershipProfile> {\n const _membershipId = (membershipId as Membership).id || (membershipId as string)\n return this.resources.fetch<MembershipProfile>(\n { type: 'membership_profiles' },\n `memberships/${_membershipId}/membership_profile`,\n params,\n options,\n ) as unknown as MembershipProfile\n }\n\n async versions(\n membershipId: string | Membership,\n params?: QueryParamsList<Version>,\n options?: ResourcesConfig,\n ): Promise<ListResponse<Version>> {\n const _membershipId = (membershipId as Membership).id || (membershipId as string)\n return this.resources.fetch<Version>(\n { type: 'versions' },\n `memberships/${_membershipId}/versions`,\n params,\n options,\n ) as unknown as ListResponse<Version>\n }\n\n async resend(membershipId: string | Membership, options?: ResourcesConfig): Promise<void> {\n const _membershipId = (membershipId as Membership).id || (membershipId as string)\n await this.resources.action('POST', `memberships/${_membershipId}/resend`, {}, options)\n }\n\n isMembership(resource: any): resource is Membership {\n return resource.type && resource.type === Memberships.TYPE\n }\n\n relationship(id: string | ResourceId | null): MembershipRel {\n return super.relationshipOneToOne<MembershipRel>(id)\n }\n\n relationshipToMany(...ids: string[]): MembershipRel[] {\n return super.relationshipOneToMany<MembershipRel>(...ids)\n }\n\n type(): MembershipType {\n return Memberships.TYPE\n }\n}\n\nconst instance = new Memberships()\nexport default instance\n\nexport type { Membership, MembershipCreate, Memberships, MembershipType, MembershipUpdate }\n"]}
1
+ {"version":3,"sources":["../gen/resources/memberships.ts"],"names":["ApiResource"],"mappings":";;;;;AA6GA,IAAM,WAAA,GAAN,MAAM,YAAA,SAAoBA,6BAAA,CAAwB;AAAA,EAChD,OAAgB,IAAA,GAAuB,aAAA;AAAA,EAEvC,MAAM,MAAA,CACJ,QAAA,EACA,MAAA,EACA,OAAA,EACqB;AACrB,IAAA,OAAO,IAAA,CAAK,SAAA,CAAU,MAAA,CAAqC,EAAE,GAAG,QAAA,EAAU,IAAA,EAAM,YAAA,CAAY,IAAA,EAAK,EAAG,MAAA,EAAQ,OAAO,CAAA;AAAA,EACrH;AAAA,EAEA,MAAM,MAAA,CACJ,QA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AG,CAAA;AAAA,EAC1D;AAAA,EAEA,IAAA,GAAuB;AACrB,IAAA,OAAO,YAAA,CAAY,IAAA;AAAA,EACrB;AACF,CAAA;AAEA,IAAM,QAAA,GAAW,IAAI,WAAA,EAAY;AACjC,IAAO,mBAAA,GAAQ","file":"chunk-MT2XP4UJ.cjs","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 { ApplicationMembership, ApplicationMembershipType } from './application_memberships'\nimport type { MembershipProfile, MembershipProfileType } from './membership_profiles'\nimport type { Organization, OrganizationType } from './organizations'\nimport type { Role, RoleType } from './roles'\nimport type { Version } from './versions'\n\ntype MembershipType = 'memberships'\ntype MembershipRel = ResourceRel & { type: MembershipType }\ntype OrganizationRel = ResourceRel & { type: OrganizationType }\ntype RoleRel = ResourceRel & { type: RoleType }\ntype ApplicationMembershipRel = ResourceRel & { type: ApplicationMembershipType }\ntype MembershipProfileRel = ResourceRel & { type: MembershipProfileType }\n\nexport type MembershipSort = Pick<Membership, 'id' | 'status'> & ResourceSort\n// export type MembershipFilter = Pick<Membership, 'id' | 'user_email' | 'status' | 'owner' | 'access_scope'> & ResourceFilter\n\n/**\n * The Membership object is returned as part of the response body of each successful list, retrieve, create, update or delete API call to the /api/memberships endpoint.\n *\n * @link https://docs.commercelayer.io/provisioning-api-reference/memberships/object\n */\ninterface Membership extends Resource {\n readonly type: MembershipType\n\n /**\n * The user email.\n * @example ```\"commercelayer@commercelayer.io\"```\n */\n user_email: string\n /**\n * The user first name.\n * @example ```\"John\"```\n */\n user_first_name?: string | null\n /**\n * The user last name.\n * @example ```\"Doe\"```\n */\n user_last_name?: string | null\n /**\n * The memberships status. One of `pending` (default), `active`.\n * @example ```\"pending\"```\n */\n status: 'pending' | 'active'\n /**\n * Indicates if the user it's the owner of the organization.\n * @example ```true```\n */\n owner?: boolean | null\n /**\n * Reflects the organization's access scope, either test_access or all_access.\n * @example ```true```\n */\n test_enabled?: boolean | null\n /**\n * The access scope for applications. One of `live_access` (default), `test_access`, `all_access`.\n * @example ```\"live_access\"```\n */\n access_scope?: 'live_access' | 'test_access' | 'all_access' | null\n\n organization?: Organization | null\n role?: Role | null\n application_memberships?: ApplicationMembership[] | null\n membership_profile?: MembershipProfile | null\n versions?: Version[] | null\n}\n\ninterface MembershipCreate extends ResourceCreate {\n /**\n * The user email.\n * @example ```\"commercelayer@commercelayer.io\"```\n */\n user_email: string\n /**\n * The access scope for applications. One of `live_access` (default), `test_access`, `all_access`.\n * @example ```\"live_access\"```\n */\n access_scope?: 'live_access' | 'test_access' | 'all_access' | null\n\n organization: OrganizationRel\n role: RoleRel\n application_memberships?: ApplicationMembershipRel[] | null\n membership_profile?: MembershipProfileRel | null\n}\n\ninterface MembershipUpdate extends ResourceUpdate {\n /**\n * The access scope for applications. One of `live_access` (default), `test_access`, `all_access`.\n * @example ```\"live_access\"```\n */\n access_scope?: 'live_access' | 'test_access' | 'all_access' | null\n\n role?: RoleRel | null\n application_memberships?: ApplicationMembershipRel[] | null\n membership_profile?: MembershipProfileRel | null\n}\n\nclass Memberships extends ApiResource<Membership> {\n static readonly TYPE: MembershipType = 'memberships' as const\n\n async create(\n resource: MembershipCreate,\n params?: QueryParamsRetrieve<Membership>,\n options?: ResourcesConfig,\n ): Promise<Membership> {\n return this.resources.create<MembershipCreate, Membership>({ ...resource, type: Memberships.TYPE }, params, options)\n }\n\n async update(\n resource: MembershipUpdate,\n params?: QueryParamsRetrieve<Membership>,\n options?: ResourcesConfig,\n ): Promise<Membership> {\n return this.resources.update<MembershipUpdate, Membership>({ ...resource, type: Memberships.TYPE }, params, options)\n }\n\n async delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void> {\n await this.resources.delete(typeof id === 'string' ? { id, type: Memberships.TYPE } : id, options)\n }\n\n async organization(\n membershipId: string | Membership,\n params?: QueryParamsRetrieve<Organization>,\n options?: ResourcesConfig,\n ): Promise<Organization> {\n const _membershipId = (membershipId as Membership).id || (membershipId as string)\n return this.resources.fetch<Organization>(\n { type: 'organizations' },\n `memberships/${_membershipId}/organization`,\n params,\n options,\n ) as unknown as Organization\n }\n\n async role(\n membershipId: string | Membership,\n params?: QueryParamsRetrieve<Role>,\n options?: ResourcesConfig,\n ): Promise<Role> {\n const _membershipId = (membershipId as Membership).id || (membershipId as string)\n return this.resources.fetch<Role>(\n { type: 'roles' },\n `memberships/${_membershipId}/role`,\n params,\n options,\n ) as unknown as Role\n }\n\n async application_memberships(\n membershipId: string | Membership,\n params?: QueryParamsList<ApplicationMembership>,\n options?: ResourcesConfig,\n ): Promise<ListResponse<ApplicationMembership>> {\n const _membershipId = (membershipId as Membership).id || (membershipId as string)\n return this.resources.fetch<ApplicationMembership>(\n { type: 'application_memberships' },\n `memberships/${_membershipId}/application_memberships`,\n params,\n options,\n ) as unknown as ListResponse<ApplicationMembership>\n }\n\n async membership_profile(\n membershipId: string | Membership,\n params?: QueryParamsRetrieve<MembershipProfile>,\n options?: ResourcesConfig,\n ): Promise<MembershipProfile> {\n const _membershipId = (membershipId as Membership).id || (membershipId as string)\n return this.resources.fetch<MembershipProfile>(\n { type: 'membership_profiles' },\n `memberships/${_membershipId}/membership_profile`,\n params,\n options,\n ) as unknown as MembershipProfile\n }\n\n async versions(\n membershipId: string | Membership,\n params?: QueryParamsList<Version>,\n options?: ResourcesConfig,\n ): Promise<ListResponse<Version>> {\n const _membershipId = (membershipId as Membership).id || (membershipId as string)\n return this.resources.fetch<Version>(\n { type: 'versions' },\n `memberships/${_membershipId}/versions`,\n params,\n options,\n ) as unknown as ListResponse<Version>\n }\n\n async resend(membershipId: string | Membership, options?: ResourcesConfig): Promise<void> {\n const _membershipId = (membershipId as Membership).id || (membershipId as string)\n await this.resources.action('POST', `memberships/${_membershipId}/resend`, {}, options)\n }\n\n isMembership(resource: any): resource is Membership {\n return resource.type && resource.type === Memberships.TYPE\n }\n\n relationship(id: string | ResourceId | null): MembershipRel {\n return super.relationshipOneToOne<MembershipRel>(id)\n }\n\n relationshipToMany(...ids: string[]): MembershipRel[] {\n return super.relationshipOneToMany<MembershipRel>(...ids)\n }\n\n type(): MembershipType {\n return Memberships.TYPE\n }\n}\n\nconst instance = new Memberships()\nexport default instance\n\nexport type { Membership, MembershipCreate, Memberships, MembershipType, MembershipUpdate }\n"]}
@@ -1,4 +1,4 @@
1
- import { ApiResource } from './chunk-GHXKZEH7.js';
1
+ import { ApiResource } from './chunk-OTK6VLW5.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-7YEOUGXO.js.map
59
- //# sourceMappingURL=chunk-7YEOUGXO.js.map
58
+ //# sourceMappingURL=chunk-NDCVBYCJ.js.map
59
+ //# sourceMappingURL=chunk-NDCVBYCJ.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,QAA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AAG,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
+ {"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-NDCVBYCJ.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,4 +1,4 @@
1
- import { binding } from './chunk-3PJNJ7B6.js';
1
+ import { binding } from './chunk-QTXYKCKC.js';
2
2
 
3
3
  // ../sdk-runtime/src/debug.ts
4
4
  var PREFIX = "clsdk";
@@ -205,12 +205,29 @@ function isApiError(error) {
205
205
  }
206
206
 
207
207
  // ../sdk-runtime/src/util.ts
208
+ var decodeJwtSegment = (segment) => atob(segment.replace(/-/g, "+").replace(/_/g, "/"));
209
+ var COMMERCE_LAYER_DOMAINS = ["commercelayer.io", "commercelayer.co", "commercelayer.dev"];
210
+ var domainFromIssuer = (iss) => {
211
+ if (typeof iss !== "string") return void 0;
212
+ let host;
213
+ try {
214
+ const url = new URL(iss);
215
+ if (url.protocol !== "https:") return void 0;
216
+ host = url.hostname;
217
+ } catch {
218
+ return void 0;
219
+ }
220
+ if (!host.startsWith("auth.")) return void 0;
221
+ const domain = host.slice("auth.".length);
222
+ const trusted = COMMERCE_LAYER_DOMAINS.some((d) => domain === d || domain.endsWith(`.${d}`));
223
+ return trusted ? domain : void 0;
224
+ };
208
225
  var extractTokenData = (token) => {
209
226
  try {
210
- const data = JSON.parse(atob(token.split(".")[1]));
227
+ const data = JSON.parse(decodeJwtSegment(token.split(".")[1]));
211
228
  return {
212
- organization: data.organization.slug,
213
- domain: data.iss ? String(data.iss).replace("https://auth.", "") : void 0,
229
+ organization: data.organization?.slug,
230
+ domain: domainFromIssuer(data.iss),
214
231
  expiration: data.exp
215
232
  };
216
233
  } catch (_err) {
@@ -338,7 +355,11 @@ var ApiClient = class _ApiClient {
338
355
  async request(method, path, body, options) {
339
356
  debug3("request %s %s, %O, %O", method, path, body || {}, options || {});
340
357
  if (options?.userAgent) debug3("User-Agent header ignored in request config");
341
- const baseUrl = options?.organization || options?.apiVersion !== void 0 ? baseURL(options.organization || this.#organization, options.domain, options.apiVersion ?? this.#apiVersion) : this.#baseUrl;
358
+ const baseUrl = options?.organization || options?.apiVersion !== void 0 ? baseURL(
359
+ options.organization || this.#organization,
360
+ options.domain || this.#domain,
361
+ options.apiVersion ?? this.#apiVersion
362
+ ) : this.#baseUrl;
342
363
  const url = new URL(`${baseUrl}/${path}`);
343
364
  const bodyData = body ? JSON.stringify({ data: body }) : void 0;
344
365
  const headers = { ...this.requestHeaders, ...this.customHeaders(options?.headers) };
@@ -438,6 +459,7 @@ var denormalizeResource = (res, included, chain = []) => {
438
459
  type: res.type,
439
460
  ...res.attributes
440
461
  };
462
+ if (res.meta) resource.meta = res.meta;
441
463
  if (res.relationships)
442
464
  Object.keys(res.relationships).forEach((key) => {
443
465
  const rel = res.relationships[key].data;
@@ -461,7 +483,7 @@ var normalize = (resource) => {
461
483
  const attributes = {};
462
484
  const relationships = {};
463
485
  for (const field in resource) {
464
- if (["type", "id"].includes(field)) continue;
486
+ if (["type", "id", "meta"].includes(field)) continue;
465
487
  const value = resource[field];
466
488
  if (Array.isArray(value) && value.length === 1 && isResourceType(value[0]) && value[0].id === null) {
467
489
  relationships[field] = { data: [] };
@@ -809,5 +831,5 @@ var isResourceType = (resource) => {
809
831
  };
810
832
 
811
833
  export { ApiResource, ApiResourceAdapter, ApiSingleton, debug_default, isApiError, isSdkError, isTokenExpired };
812
- //# sourceMappingURL=chunk-GHXKZEH7.js.map
813
- //# sourceMappingURL=chunk-GHXKZEH7.js.map
834
+ //# sourceMappingURL=chunk-OTK6VLW5.js.map
835
+ //# sourceMappingURL=chunk-OTK6VLW5.js.map