@commercelayer/provisioning-sdk 2.10.2 → 3.0.0-beta.1

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 (199) hide show
  1. package/LICENSE +1 -1
  2. package/lib/actions.cjs +4 -0
  3. package/lib/actions.cjs.map +1 -0
  4. package/lib/actions.d.cts +15 -0
  5. package/lib/actions.d.ts +15 -0
  6. package/lib/actions.js +3 -0
  7. package/lib/actions.js.map +1 -0
  8. package/lib/{index.d.mts → api-BQ6Y-J8P.d.ts} +546 -495
  9. package/lib/api-BQZ9r4RA.d.cts +1643 -0
  10. package/lib/api.cjs +62 -0
  11. package/lib/api.cjs.map +1 -0
  12. package/lib/api.d.cts +2 -0
  13. package/lib/api.d.ts +2 -0
  14. package/lib/api.js +17 -0
  15. package/lib/api.js.map +1 -0
  16. package/lib/binding.cjs +14 -0
  17. package/lib/binding.cjs.map +1 -0
  18. package/lib/binding.d.cts +21 -0
  19. package/lib/binding.d.ts +21 -0
  20. package/lib/binding.js +5 -0
  21. package/lib/binding.js.map +1 -0
  22. package/lib/bundle.cjs +34 -0
  23. package/lib/bundle.cjs.map +1 -0
  24. package/lib/bundle.d.cts +27 -0
  25. package/lib/bundle.d.ts +25 -0
  26. package/lib/bundle.js +19 -0
  27. package/lib/bundle.js.map +1 -0
  28. package/lib/chunk-47HG76BX.cjs +19 -0
  29. package/lib/chunk-47HG76BX.cjs.map +1 -0
  30. package/lib/chunk-4GOUGGBM.js +114 -0
  31. package/lib/chunk-4GOUGGBM.js.map +1 -0
  32. package/lib/chunk-5D5YOHG4.cjs +93 -0
  33. package/lib/chunk-5D5YOHG4.cjs.map +1 -0
  34. package/lib/chunk-6B2AFMGT.js +82 -0
  35. package/lib/chunk-6B2AFMGT.js.map +1 -0
  36. package/lib/chunk-BFXJ3YNR.js +57 -0
  37. package/lib/chunk-BFXJ3YNR.js.map +1 -0
  38. package/lib/chunk-BI4FXO5V.cjs +43 -0
  39. package/lib/chunk-BI4FXO5V.cjs.map +1 -0
  40. package/lib/chunk-CESAPW7Z.js +90 -0
  41. package/lib/chunk-CESAPW7Z.js.map +1 -0
  42. package/lib/chunk-F2Z6XJTZ.js +59 -0
  43. package/lib/chunk-F2Z6XJTZ.js.map +1 -0
  44. package/lib/chunk-FHXWFSIQ.cjs +88 -0
  45. package/lib/chunk-FHXWFSIQ.cjs.map +1 -0
  46. package/lib/chunk-HNSO4ZPF.js +808 -0
  47. package/lib/chunk-HNSO4ZPF.js.map +1 -0
  48. package/lib/chunk-IW2T22VR.js +3 -0
  49. package/lib/chunk-IW2T22VR.js.map +1 -0
  50. package/lib/chunk-JDXNOZFC.cjs +66 -0
  51. package/lib/chunk-JDXNOZFC.cjs.map +1 -0
  52. package/lib/chunk-KJRFIWHK.cjs +61 -0
  53. package/lib/chunk-KJRFIWHK.cjs.map +1 -0
  54. package/lib/chunk-LISATEFD.cjs +26 -0
  55. package/lib/chunk-LISATEFD.cjs.map +1 -0
  56. package/lib/chunk-MANW7JPJ.js +12 -0
  57. package/lib/chunk-MANW7JPJ.js.map +1 -0
  58. package/lib/chunk-N567T7FT.cjs +4 -0
  59. package/lib/chunk-N567T7FT.cjs.map +1 -0
  60. package/lib/chunk-NFF6DWKZ.cjs +32 -0
  61. package/lib/chunk-NFF6DWKZ.cjs.map +1 -0
  62. package/lib/chunk-O6ACW64H.js +30 -0
  63. package/lib/chunk-O6ACW64H.js.map +1 -0
  64. package/lib/chunk-OAXFNHFA.js +59 -0
  65. package/lib/chunk-OAXFNHFA.js.map +1 -0
  66. package/lib/chunk-OEYUWL5K.js +41 -0
  67. package/lib/chunk-OEYUWL5K.js.map +1 -0
  68. package/lib/chunk-OKBMV3W5.cjs +59 -0
  69. package/lib/chunk-OKBMV3W5.cjs.map +1 -0
  70. package/lib/chunk-PIDJDUN3.js +86 -0
  71. package/lib/chunk-PIDJDUN3.js.map +1 -0
  72. package/lib/chunk-QRMCUYRK.js +24 -0
  73. package/lib/chunk-QRMCUYRK.js.map +1 -0
  74. package/lib/chunk-QTTL5EGB.cjs +816 -0
  75. package/lib/chunk-QTTL5EGB.cjs.map +1 -0
  76. package/lib/chunk-QVV2ORWB.cjs +61 -0
  77. package/lib/chunk-QVV2ORWB.cjs.map +1 -0
  78. package/lib/chunk-RSAADRRH.cjs +84 -0
  79. package/lib/chunk-RSAADRRH.cjs.map +1 -0
  80. package/lib/chunk-SZSANTXM.cjs +118 -0
  81. package/lib/chunk-SZSANTXM.cjs.map +1 -0
  82. package/lib/chunk-TOXS3OUT.cjs +80 -0
  83. package/lib/chunk-TOXS3OUT.cjs.map +1 -0
  84. package/lib/chunk-U76G3DPW.js +64 -0
  85. package/lib/chunk-U76G3DPW.js.map +1 -0
  86. package/lib/chunk-VFTFSHXQ.cjs +88 -0
  87. package/lib/chunk-VFTFSHXQ.cjs.map +1 -0
  88. package/lib/chunk-XCKSYX22.js +78 -0
  89. package/lib/chunk-XCKSYX22.js.map +1 -0
  90. package/lib/chunk-XV25RH6C.js +17 -0
  91. package/lib/chunk-XV25RH6C.js.map +1 -0
  92. package/lib/chunk-YFZRO7OE.cjs +84 -0
  93. package/lib/chunk-YFZRO7OE.cjs.map +1 -0
  94. package/lib/chunk-YLA6YCK5.cjs +16 -0
  95. package/lib/chunk-YLA6YCK5.cjs.map +1 -0
  96. package/lib/chunk-YS5PCY5D.js +76 -0
  97. package/lib/chunk-YS5PCY5D.js.map +1 -0
  98. package/lib/chunk-ZTAL3U2D.js +82 -0
  99. package/lib/chunk-ZTAL3U2D.js.map +1 -0
  100. package/lib/commercelayer.cjs +38 -0
  101. package/lib/commercelayer.cjs.map +1 -0
  102. package/lib/commercelayer.d.cts +58 -0
  103. package/lib/commercelayer.d.ts +56 -0
  104. package/lib/commercelayer.js +7 -0
  105. package/lib/commercelayer.js.map +1 -0
  106. package/lib/enum.cjs +52 -0
  107. package/lib/enum.cjs.map +1 -0
  108. package/lib/enum.d.cts +2 -0
  109. package/lib/enum.d.ts +2 -0
  110. package/lib/enum.js +3 -0
  111. package/lib/enum.js.map +1 -0
  112. package/lib/error-CVRdwnY9.d.cts +33 -0
  113. package/lib/error-CVRdwnY9.d.ts +33 -0
  114. package/lib/index.cjs +57 -0
  115. package/lib/index.cjs.map +1 -0
  116. package/lib/index.d.cts +14 -0
  117. package/lib/index.d.ts +9 -1591
  118. package/lib/index.js +26 -1
  119. package/lib/index.js.map +1 -0
  120. package/lib/model.cjs +4 -0
  121. package/lib/model.cjs.map +1 -0
  122. package/lib/model.d.cts +2 -0
  123. package/lib/model.d.ts +2 -0
  124. package/lib/model.js +3 -0
  125. package/lib/model.js.map +1 -0
  126. package/lib/resources/api_credentials.cjs +15 -0
  127. package/lib/resources/api_credentials.cjs.map +1 -0
  128. package/lib/resources/api_credentials.d.cts +5 -0
  129. package/lib/resources/api_credentials.d.ts +2 -0
  130. package/lib/resources/api_credentials.js +7 -0
  131. package/lib/resources/api_credentials.js.map +1 -0
  132. package/lib/resources/application_memberships.cjs +15 -0
  133. package/lib/resources/application_memberships.cjs.map +1 -0
  134. package/lib/resources/application_memberships.d.cts +5 -0
  135. package/lib/resources/application_memberships.d.ts +2 -0
  136. package/lib/resources/application_memberships.js +7 -0
  137. package/lib/resources/application_memberships.js.map +1 -0
  138. package/lib/resources/identity_providers.cjs +15 -0
  139. package/lib/resources/identity_providers.cjs.map +1 -0
  140. package/lib/resources/identity_providers.d.cts +5 -0
  141. package/lib/resources/identity_providers.d.ts +2 -0
  142. package/lib/resources/identity_providers.js +7 -0
  143. package/lib/resources/identity_providers.js.map +1 -0
  144. package/lib/resources/membership_profiles.cjs +15 -0
  145. package/lib/resources/membership_profiles.cjs.map +1 -0
  146. package/lib/resources/membership_profiles.d.cts +5 -0
  147. package/lib/resources/membership_profiles.d.ts +2 -0
  148. package/lib/resources/membership_profiles.js +7 -0
  149. package/lib/resources/membership_profiles.js.map +1 -0
  150. package/lib/resources/memberships.cjs +15 -0
  151. package/lib/resources/memberships.cjs.map +1 -0
  152. package/lib/resources/memberships.d.cts +5 -0
  153. package/lib/resources/memberships.d.ts +2 -0
  154. package/lib/resources/memberships.js +7 -0
  155. package/lib/resources/memberships.js.map +1 -0
  156. package/lib/resources/organizations.cjs +15 -0
  157. package/lib/resources/organizations.cjs.map +1 -0
  158. package/lib/resources/organizations.d.cts +5 -0
  159. package/lib/resources/organizations.d.ts +2 -0
  160. package/lib/resources/organizations.js +7 -0
  161. package/lib/resources/organizations.js.map +1 -0
  162. package/lib/resources/permissions.cjs +15 -0
  163. package/lib/resources/permissions.cjs.map +1 -0
  164. package/lib/resources/permissions.d.cts +5 -0
  165. package/lib/resources/permissions.d.ts +2 -0
  166. package/lib/resources/permissions.js +7 -0
  167. package/lib/resources/permissions.js.map +1 -0
  168. package/lib/resources/roles.cjs +15 -0
  169. package/lib/resources/roles.cjs.map +1 -0
  170. package/lib/resources/roles.d.cts +5 -0
  171. package/lib/resources/roles.d.ts +2 -0
  172. package/lib/resources/roles.js +7 -0
  173. package/lib/resources/roles.js.map +1 -0
  174. package/lib/resources/users.cjs +15 -0
  175. package/lib/resources/users.cjs.map +1 -0
  176. package/lib/resources/users.d.cts +5 -0
  177. package/lib/resources/users.d.ts +2 -0
  178. package/lib/resources/users.js +7 -0
  179. package/lib/resources/users.js.map +1 -0
  180. package/lib/resources/versions.cjs +15 -0
  181. package/lib/resources/versions.cjs.map +1 -0
  182. package/lib/resources/versions.d.cts +5 -0
  183. package/lib/resources/versions.d.ts +2 -0
  184. package/lib/resources/versions.js +7 -0
  185. package/lib/resources/versions.js.map +1 -0
  186. package/lib/static.cjs +17 -0
  187. package/lib/static.cjs.map +1 -0
  188. package/lib/static.d.cts +18 -0
  189. package/lib/static.d.ts +18 -0
  190. package/lib/static.js +8 -0
  191. package/lib/static.js.map +1 -0
  192. package/lib/version.cjs +20 -0
  193. package/lib/version.cjs.map +1 -0
  194. package/lib/version.d.cts +12 -0
  195. package/lib/version.d.ts +12 -0
  196. package/lib/version.js +3 -0
  197. package/lib/version.js.map +1 -0
  198. package/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IAAA,OAAO,QAAA,CAAS,IAAA,IAAQ,QAAA,CAAS,IAAA,KAAS,MAAA,CAAM,IAAA;AAAA,EAClD;AAAA,EAEA,aAAa,EAAA,EAAyC;AACpD,IAAA,OAAO,KAAA,CAAM,qBAA8B,EAAE,CAAA;AAAA,EAC/C;AAAA,EAEA,sBAAsB,GAAA,EAA0B;AAC9C,IAAA,OAAO,KAAA,CAAM,qBAAA,CAA+B,GAAG,GAAG,CAAA;AAAA,EACpD;AAAA,EAEA,IAAA,GAAiB;AACf,IAAA,OAAO,MAAA,CAAM,IAAA;AAAA,EACf;AACF,CAAA;AAEA,IAAM,QAAA,GAAW,IAAI,KAAA,EAAM;AAC3B,IAAO,aAAA,GAAQ","file":"chunk-6B2AFMGT.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 { ApiCredential } from './api_credentials'\nimport type { Membership } from './memberships'\nimport type { Organization, OrganizationType } from './organizations'\nimport type { Permission } from './permissions'\nimport type { Version } from './versions'\n\ntype RoleType = 'roles'\ntype RoleRel = ResourceRel & { type: RoleType }\ntype OrganizationRel = ResourceRel & { type: OrganizationType }\n\nexport type RoleSort = Pick<Role, 'id' | 'name'> & ResourceSort\n// export type RoleFilter = Pick<Role, 'id' | 'name' | 'kind'> & ResourceFilter\n\n/**\n * The Role object is returned as part of the response body of each successful list, retrieve, create or update API call to the /api/roles endpoint.\n *\n * @link https://docs.commercelayer.io/provisioning-api-reference/roles/object\n */\ninterface Role extends Resource {\n readonly type: RoleType\n\n /**\n * The role name.\n * @example ```\"Custom role\"```\n */\n name: string\n /**\n * The kind of role, one of: `custom`, `admin`, `read_only`.\n * @example ```\"custom\"```\n */\n kind?: string | null\n\n organization?: Organization | null\n permissions?: Permission[] | null\n memberships?: Membership[] | null\n api_credentials?: ApiCredential[] | null\n versions?: Version[] | null\n}\n\ninterface RoleCreate extends ResourceCreate {\n /**\n * The role name.\n * @example ```\"Custom role\"```\n */\n name: string\n\n organization: OrganizationRel\n}\n\ninterface RoleUpdate extends ResourceUpdate {\n /**\n * The role name.\n * @example ```\"Custom role\"```\n */\n name?: string | null\n /**\n * Send this attribute if you want to update the role base permissions.\n * @example ```true```\n */\n _add_missing_base_permissions?: boolean | null\n}\n\nclass Roles extends ApiResource<Role> {\n static readonly TYPE: RoleType = 'roles' as const\n\n async create(resource: RoleCreate, params?: QueryParamsRetrieve<Role>, options?: ResourcesConfig): Promise<Role> {\n return this.resources.create<RoleCreate, Role>({ ...resource, type: Roles.TYPE }, params, options)\n }\n\n async update(resource: RoleUpdate, params?: QueryParamsRetrieve<Role>, options?: ResourcesConfig): Promise<Role> {\n return this.resources.update<RoleUpdate, Role>({ ...resource, type: Roles.TYPE }, params, options)\n }\n\n async organization(\n roleId: string | Role,\n params?: QueryParamsRetrieve<Organization>,\n options?: ResourcesConfig,\n ): Promise<Organization> {\n const _roleId = (roleId as Role).id || (roleId as string)\n return this.resources.fetch<Organization>(\n { type: 'organizations' },\n `roles/${_roleId}/organization`,\n params,\n options,\n ) as unknown as Organization\n }\n\n async permissions(\n roleId: string | Role,\n params?: QueryParamsList<Permission>,\n options?: ResourcesConfig,\n ): Promise<ListResponse<Permission>> {\n const _roleId = (roleId as Role).id || (roleId as string)\n return this.resources.fetch<Permission>(\n { type: 'permissions' },\n `roles/${_roleId}/permissions`,\n params,\n options,\n ) as unknown as ListResponse<Permission>\n }\n\n async memberships(\n roleId: string | Role,\n params?: QueryParamsList<Membership>,\n options?: ResourcesConfig,\n ): Promise<ListResponse<Membership>> {\n const _roleId = (roleId as Role).id || (roleId as string)\n return this.resources.fetch<Membership>(\n { type: 'memberships' },\n `roles/${_roleId}/memberships`,\n params,\n options,\n ) as unknown as ListResponse<Membership>\n }\n\n async api_credentials(\n roleId: string | Role,\n params?: QueryParamsList<ApiCredential>,\n options?: ResourcesConfig,\n ): Promise<ListResponse<ApiCredential>> {\n const _roleId = (roleId as Role).id || (roleId as string)\n return this.resources.fetch<ApiCredential>(\n { type: 'api_credentials' },\n `roles/${_roleId}/api_credentials`,\n params,\n options,\n ) as unknown as ListResponse<ApiCredential>\n }\n\n async versions(\n roleId: string | Role,\n params?: QueryParamsList<Version>,\n options?: ResourcesConfig,\n ): Promise<ListResponse<Version>> {\n const _roleId = (roleId as Role).id || (roleId as string)\n return this.resources.fetch<Version>(\n { type: 'versions' },\n `roles/${_roleId}/versions`,\n params,\n options,\n ) as unknown as ListResponse<Version>\n }\n\n async _add_missing_base_permissions(\n id: string | Role,\n params?: QueryParamsRetrieve<Role>,\n options?: ResourcesConfig,\n ): Promise<Role> {\n return this.resources.update<RoleUpdate, Role>(\n { id: typeof id === 'string' ? id : id.id, type: Roles.TYPE, _add_missing_base_permissions: true },\n params,\n options,\n )\n }\n\n isRole(resource: any): resource is Role {\n return resource.type && resource.type === Roles.TYPE\n }\n\n relationship(id: string | ResourceId | null): RoleRel {\n return super.relationshipOneToOne<RoleRel>(id)\n }\n\n relationshipToMany(...ids: string[]): RoleRel[] {\n return super.relationshipOneToMany<RoleRel>(...ids)\n }\n\n type(): RoleType {\n return Roles.TYPE\n }\n}\n\nconst instance = new Roles()\nexport default instance\n\nexport type { Role, RoleCreate, Roles, RoleType, RoleUpdate }\n"]}
@@ -0,0 +1,57 @@
1
+ import { ApiResource } from './chunk-HNSO4ZPF.js';
2
+
3
+ // gen/resources/permissions.ts
4
+ var Permissions = class _Permissions extends ApiResource {
5
+ static TYPE = "permissions";
6
+ async create(resource, params, options) {
7
+ return this.resources.create({ ...resource, type: _Permissions.TYPE }, params, options);
8
+ }
9
+ async update(resource, params, options) {
10
+ return this.resources.update({ ...resource, type: _Permissions.TYPE }, params, options);
11
+ }
12
+ async organization(permissionId, params, options) {
13
+ const _permissionId = permissionId.id || permissionId;
14
+ return this.resources.fetch(
15
+ { type: "organizations" },
16
+ `permissions/${_permissionId}/organization`,
17
+ params,
18
+ options
19
+ );
20
+ }
21
+ async role(permissionId, params, options) {
22
+ const _permissionId = permissionId.id || permissionId;
23
+ return this.resources.fetch(
24
+ { type: "roles" },
25
+ `permissions/${_permissionId}/role`,
26
+ params,
27
+ options
28
+ );
29
+ }
30
+ async versions(permissionId, params, options) {
31
+ const _permissionId = permissionId.id || permissionId;
32
+ return this.resources.fetch(
33
+ { type: "versions" },
34
+ `permissions/${_permissionId}/versions`,
35
+ params,
36
+ options
37
+ );
38
+ }
39
+ isPermission(resource) {
40
+ return resource.type && resource.type === _Permissions.TYPE;
41
+ }
42
+ relationship(id) {
43
+ return super.relationshipOneToOne(id);
44
+ }
45
+ relationshipToMany(...ids) {
46
+ return super.relationshipOneToMany(...ids);
47
+ }
48
+ type() {
49
+ return _Permissions.TYPE;
50
+ }
51
+ };
52
+ var instance = new Permissions();
53
+ var permissions_default = instance;
54
+
55
+ export { permissions_default };
56
+ //# sourceMappingURL=chunk-BFXJ3YNR.js.map
57
+ //# sourceMappingURL=chunk-BFXJ3YNR.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../gen/resources/permissions.ts"],"names":[],"mappings":";;;AA2GA,IAAM,WAAA,GAAN,MAAM,YAAA,SAAoB,WAAA,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,QAAA,EACA,MAAA,EACA,OAAA,EACqB;AACrB,IAAA,OAAO,IAAA,CAAK,SAAA,CAAU,MAAA,CAAqC,EAAE,GAAG,QAAA,EAAU,I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O,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-BFXJ3YNR.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'\n\nimport type { Organization } from './organizations'\nimport type { Role, RoleType } from './roles'\nimport type { Version } from './versions'\n\ntype PermissionType = 'permissions'\ntype PermissionRel = ResourceRel & { type: PermissionType }\ntype RoleRel = ResourceRel & { type: RoleType }\n\nexport type PermissionSort = Pick<Permission, 'id'> & ResourceSort\n// export type PermissionFilter = Pick<Permission, 'id' | 'can_create' | 'can_read' | 'can_update' | 'can_destroy' | 'subject' | 'restrictions'> & ResourceFilter\n\n/**\n * The Permission object is returned as part of the response body of each successful list, retrieve, create or update API call to the /api/permissions endpoint.\n *\n * @link https://docs.commercelayer.io/provisioning-api-reference/permissions/object\n */\ninterface Permission extends Resource {\n readonly type: PermissionType\n\n /**\n * Determines if the permission have access to create rights.\n */\n can_create: boolean\n /**\n * Determines if the permission have access to read rights.\n */\n can_read: boolean\n /**\n * Determines if the permission have access to update rights.\n */\n can_update: boolean\n /**\n * Determines if the permission have access to destroy rights.\n */\n can_destroy: boolean\n /**\n * The resource where this permission is applied.\n */\n subject: string\n /**\n * An object that contains additional restrictions.\n * @example ```{\"foo\":\"bar\"}```\n */\n restrictions?: Record<string, any> | null\n\n organization?: Organization | null\n role?: Role | null\n versions?: Version[] | null\n}\n\ninterface PermissionCreate extends ResourceCreate {\n /**\n * Determines if the permission have access to create rights.\n */\n can_create: boolean\n /**\n * Determines if the permission have access to read rights.\n */\n can_read: boolean\n /**\n * Determines if the permission have access to update rights.\n */\n can_update: boolean\n /**\n * Determines if the permission have access to destroy rights.\n */\n can_destroy: boolean\n /**\n * The resource where this permission is applied.\n */\n subject: string\n\n role: RoleRel\n}\n\ninterface PermissionUpdate extends ResourceUpdate {\n /**\n * Determines if the permission have access to create rights.\n */\n can_create?: boolean | null\n /**\n * Determines if the permission have access to read rights.\n */\n can_read?: boolean | null\n /**\n * Determines if the permission have access to update rights.\n */\n can_update?: boolean | null\n /**\n * Determines if the permission have access to destroy rights.\n */\n can_destroy?: boolean | null\n}\n\nclass Permissions extends ApiResource<Permission> {\n static readonly TYPE: PermissionType = 'permissions' as const\n\n async create(\n resource: PermissionCreate,\n params?: QueryParamsRetrieve<Permission>,\n options?: ResourcesConfig,\n ): Promise<Permission> {\n return this.resources.create<PermissionCreate, Permission>({ ...resource, type: Permissions.TYPE }, params, options)\n }\n\n async update(\n resource: PermissionUpdate,\n params?: QueryParamsRetrieve<Permission>,\n options?: ResourcesConfig,\n ): Promise<Permission> {\n return this.resources.update<PermissionUpdate, Permission>({ ...resource, type: Permissions.TYPE }, params, options)\n }\n\n async organization(\n permissionId: string | Permission,\n params?: QueryParamsRetrieve<Organization>,\n options?: ResourcesConfig,\n ): Promise<Organization> {\n const _permissionId = (permissionId as Permission).id || (permissionId as string)\n return this.resources.fetch<Organization>(\n { type: 'organizations' },\n `permissions/${_permissionId}/organization`,\n params,\n options,\n ) as unknown as Organization\n }\n\n async role(\n permissionId: string | Permission,\n params?: QueryParamsRetrieve<Role>,\n options?: ResourcesConfig,\n ): Promise<Role> {\n const _permissionId = (permissionId as Permission).id || (permissionId as string)\n return this.resources.fetch<Role>(\n { type: 'roles' },\n `permissions/${_permissionId}/role`,\n params,\n options,\n ) as unknown as Role\n }\n\n async versions(\n permissionId: string | Permission,\n params?: QueryParamsList<Version>,\n options?: ResourcesConfig,\n ): Promise<ListResponse<Version>> {\n const _permissionId = (permissionId as Permission).id || (permissionId as string)\n return this.resources.fetch<Version>(\n { type: 'versions' },\n `permissions/${_permissionId}/versions`,\n params,\n options,\n ) as unknown as ListResponse<Version>\n }\n\n isPermission(resource: any): resource is Permission {\n return resource.type && resource.type === Permissions.TYPE\n }\n\n relationship(id: string | ResourceId | null): PermissionRel {\n return super.relationshipOneToOne<PermissionRel>(id)\n }\n\n relationshipToMany(...ids: string[]): PermissionRel[] {\n return super.relationshipOneToMany<PermissionRel>(...ids)\n }\n\n type(): PermissionType {\n return Permissions.TYPE\n }\n}\n\nconst instance = new Permissions()\nexport default instance\n\nexport type { Permission, PermissionCreate, Permissions, PermissionType, PermissionUpdate }\n"]}
@@ -0,0 +1,43 @@
1
+ 'use strict';
2
+
3
+ var chunkQTTL5EGB_cjs = require('./chunk-QTTL5EGB.cjs');
4
+ var chunkYLA6YCK5_cjs = require('./chunk-YLA6YCK5.cjs');
5
+ var chunkVFTFSHXQ_cjs = require('./chunk-VFTFSHXQ.cjs');
6
+
7
+ // src/static.ts
8
+ var CommerceLayerProvisioningStatic = {
9
+ resources: (sort) => {
10
+ return chunkVFTFSHXQ_cjs.getResources(sort);
11
+ },
12
+ singletons: (sort) => {
13
+ return chunkVFTFSHXQ_cjs.getSingletons(sort);
14
+ },
15
+ isSingleton: (resource) => {
16
+ return chunkVFTFSHXQ_cjs.isSingleton(resource);
17
+ },
18
+ isCreatable: (resource) => {
19
+ return chunkVFTFSHXQ_cjs.isCreatable(resource);
20
+ },
21
+ isUpdatable: (resource) => {
22
+ return chunkVFTFSHXQ_cjs.isUpdatable(resource);
23
+ },
24
+ isDeletable: (resource) => {
25
+ return chunkVFTFSHXQ_cjs.isDeletable(resource);
26
+ },
27
+ isSdkError: (error) => {
28
+ return chunkQTTL5EGB_cjs.isSdkError(error);
29
+ },
30
+ isApiError: (error) => {
31
+ return chunkQTTL5EGB_cjs.isApiError(error);
32
+ },
33
+ isTokenExpired: (token) => {
34
+ return chunkQTTL5EGB_cjs.isTokenExpired(token);
35
+ },
36
+ get schemaVersion() {
37
+ return chunkYLA6YCK5_cjs.API_SCHEMA_VERSION;
38
+ }
39
+ };
40
+
41
+ exports.CommerceLayerProvisioningStatic = CommerceLayerProvisioningStatic;
42
+ //# sourceMappingURL=chunk-BI4FXO5V.cjs.map
43
+ //# sourceMappingURL=chunk-BI4FXO5V.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/static.ts"],"names":["getResources","getSingletons","isSingleton","isCreatable","isUpdatable","isDeletable","isSdkError","isApiError","isTokenExpired","API_SCHEMA_VERSION"],"mappings":";;;;;;;AAOO,IAAM,+BAAA,GAAkC;AAAA,EAC7C,SAAA,EAAW,CAAC,IAAA,KAAsC;AAChD,IAAA,OAAOA,+BAAa,IAAI,CAAA;AAAA,EAC1B,CAAA;AAAA,EAEA,UAAA,EAAY,CAAC,IAAA,KAAsC;AACjD,IAAA,OAAOC,gCAAc,IAAI,CAAA;AAAA,EAC3B,CAAA;AAAA,EAEA,WAAA,EAAa,CAAC,QAAA,KAAwC;AACpD,IAAA,OAAOC,8BAAY,QAAQ,CAAA;AAAA,EAC7B,CAAA;AAAA,EAEA,WAAA,EAAa,CAAC,QAAA,KAAwC;AACpD,IAAA,OAAOC,8BAAY,QAAQ,CAAA;AAAA,EAC7B,CAAA;AAAA,EAEA,WAAA,EAAa,CAAC,QAAA,KAAwC;AACpD,IAAA,OAAOC,8BAAY,QAAQ,CAAA;AAAA,EAC7B,CAAA;AAAA,EAEA,WAAA,EAAa,CAAC,QAAA,KAAwC;AACpD,IAAA,OAAOC,8BAAY,QAAQ,CAAA;AAAA,EAC7B,CAAA;AAAA,EAEA,UAAA,EAAY,CAAC,KAAA,KAAsC;AACjD,IAAA,OAAOC,6BAAW,KAAK,CAAA;AAAA,EACzB,CAAA;AAAA,EAEA,UAAA,EAAY,CAAC,KAAA,KAAsC;AACjD,IAAA,OAAOC,6BAAW,KAAK,CAAA;AAAA,EACzB,CAAA;AAAA,EAEA,cAAA,EAAgB,CAAC,KAAA,KAA2B;AAC1C,IAAA,OAAOC,iCAAe,KAAK,CAAA;AAAA,EAC7B,CAAA;AAAA,EAEA,IAAI,aAAA,GAAwB;AAC1B,IAAA,OAAOC,oCAAA;AAAA,EACT;AACF","file":"chunk-BI4FXO5V.cjs","sourcesContent":["import { type ApiError, isApiError, isSdkError, type SdkError } from '@runtime/error'\nimport { isTokenExpired } from '@runtime/util'\nimport type { ResourceTypeLock } from '../gen/enum'\nimport { getResources, getSingletons, isCreatable, isDeletable, isSingleton, isUpdatable } from '../gen/enum'\nimport { API_SCHEMA_VERSION } from './commercelayer'\n\n/* Static functions */\nexport const CommerceLayerProvisioningStatic = {\n resources: (sort?: boolean): readonly string[] => {\n return getResources(sort)\n },\n\n singletons: (sort?: boolean): readonly string[] => {\n return getSingletons(sort)\n },\n\n isSingleton: (resource: ResourceTypeLock): boolean => {\n return isSingleton(resource)\n },\n\n isCreatable: (resource: ResourceTypeLock): boolean => {\n return isCreatable(resource)\n },\n\n isUpdatable: (resource: ResourceTypeLock): boolean => {\n return isUpdatable(resource)\n },\n\n isDeletable: (resource: ResourceTypeLock): boolean => {\n return isDeletable(resource)\n },\n\n isSdkError: (error: unknown): error is SdkError => {\n return isSdkError(error)\n },\n\n isApiError: (error: unknown): error is ApiError => {\n return isApiError(error)\n },\n\n isTokenExpired: (token: string): boolean => {\n return isTokenExpired(token)\n },\n\n get schemaVersion(): string {\n return API_SCHEMA_VERSION\n },\n}\n"]}
@@ -0,0 +1,90 @@
1
+ import { CommerceLayerProvisioningBaseClient } from './chunk-4GOUGGBM.js';
2
+ import { permissions_default } from './chunk-BFXJ3YNR.js';
3
+ import { roles_default } from './chunk-6B2AFMGT.js';
4
+ import { users_default } from './chunk-O6ACW64H.js';
5
+ import { versions_default } from './chunk-QRMCUYRK.js';
6
+ import { api_credentials_default } from './chunk-F2Z6XJTZ.js';
7
+ import { application_memberships_default } from './chunk-PIDJDUN3.js';
8
+ import { identity_providers_default } from './chunk-U76G3DPW.js';
9
+ import { membership_profiles_default } from './chunk-OAXFNHFA.js';
10
+ import { memberships_default } from './chunk-ZTAL3U2D.js';
11
+ import { organizations_default } from './chunk-XCKSYX22.js';
12
+ import { debug_default } from './chunk-HNSO4ZPF.js';
13
+
14
+ // gen/bundle.ts
15
+ var debug = debug_default("bundle");
16
+ var CommerceLayerProvisioningClient = class _CommerceLayerProvisioningClient extends CommerceLayerProvisioningBaseClient {
17
+ // ##__CL_RESOURCES_DEF_START__##
18
+ // ##__CL_RESOURCES_DEF_TEMPLATE:: ##__TAB__#####__RESOURCE_TYPE__##?: api.##__RESOURCE_CLASS__##
19
+ #api_credentials;
20
+ #application_memberships;
21
+ #identity_providers;
22
+ #memberships;
23
+ #membership_profiles;
24
+ #organizations;
25
+ #permissions;
26
+ #roles;
27
+ #user;
28
+ #versions;
29
+ // ##__CL_RESOURCES_DEF_STOP__##
30
+ constructor(config) {
31
+ super(config);
32
+ debug("new commercelayer bundle instance %O", config);
33
+ }
34
+ static get(config) {
35
+ if (config) return _CommerceLayerProvisioningClient.cl = new _CommerceLayerProvisioningClient(config);
36
+ else if (!_CommerceLayerProvisioningClient.cl)
37
+ throw new Error("CommerceLayerProvisioning bundle client not initialized");
38
+ return _CommerceLayerProvisioningClient.cl;
39
+ }
40
+ // Bundle clients are isolated: route this instance's requests, config and
41
+ // interceptors through the adapter built for it, not the process-global
42
+ // static one. The resource accessors below bind to this same adapter.
43
+ get adapter() {
44
+ return this.instanceAdapter;
45
+ }
46
+ // ##__CL_RESOURCES_LAZY_LOADING_START__##
47
+ // ##__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)) }
48
+ get api_credentials() {
49
+ return this.#api_credentials || (this.#api_credentials = api_credentials_default.withAdapter(this.adapter));
50
+ }
51
+ get application_memberships() {
52
+ return this.#application_memberships || (this.#application_memberships = application_memberships_default.withAdapter(this.adapter));
53
+ }
54
+ get identity_providers() {
55
+ return this.#identity_providers || (this.#identity_providers = identity_providers_default.withAdapter(this.adapter));
56
+ }
57
+ get memberships() {
58
+ return this.#memberships || (this.#memberships = memberships_default.withAdapter(this.adapter));
59
+ }
60
+ get membership_profiles() {
61
+ return this.#membership_profiles || (this.#membership_profiles = membership_profiles_default.withAdapter(this.adapter));
62
+ }
63
+ get organizations() {
64
+ return this.#organizations || (this.#organizations = organizations_default.withAdapter(this.adapter));
65
+ }
66
+ get permissions() {
67
+ return this.#permissions || (this.#permissions = permissions_default.withAdapter(this.adapter));
68
+ }
69
+ get roles() {
70
+ return this.#roles || (this.#roles = roles_default.withAdapter(this.adapter));
71
+ }
72
+ get user() {
73
+ return this.#user || (this.#user = users_default.withAdapter(this.adapter));
74
+ }
75
+ get versions() {
76
+ return this.#versions || (this.#versions = versions_default.withAdapter(this.adapter));
77
+ }
78
+ // ##__CL_RESOURCES_LAZY_LOADING_STOP__##
79
+ // ##__CL_RESOURCES_ACCESSORS_ONLY_START__##
80
+ // ##__CL_RESOURCES_ACCESSORS_ONLY_TEMPLATE:: ##__TAB__##get ##__RESOURCE_TYPE__##(): api.##__RESOURCE_CLASS__## { return api.##__RESOURCE_TYPE__## }
81
+ // ##__CL_RESOURCES_ACCESSORS_ONLY_STOP__##
82
+ };
83
+ function CommerceLayerProvisioning(config) {
84
+ return CommerceLayerProvisioningClient.get(config);
85
+ }
86
+ var bundle_default = CommerceLayerProvisioning;
87
+
88
+ export { CommerceLayerProvisioning, bundle_default };
89
+ //# sourceMappingURL=chunk-CESAPW7Z.js.map
90
+ //# sourceMappingURL=chunk-CESAPW7Z.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../gen/bundle.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAKA,IAAM,KAAA,GAAQ,cAAM,QAAQ,CAAA;AAE5B,IAAM,+BAAA,GAAN,MAAM,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AK,YAAA,KAAiB,IAAA,CAAK,eAAmB,mBAAA,CAAY,WAAA,CAAY,KAAK,OAAO,CAAA,CAAA;AAAA,EAC3F;AAAA,EACA,IAAI,mBAAA,GAA8C;AAChD,IAAA,OAAO,KAAK,oBAAA,KAAyB,IAAA,CAAK,uBAA2B,2BAAA,CAAoB,WAAA,CAAY,KAAK,OAAO,CAAA,CAAA;AAAA,EACnH;AAAA,EACA,IAAI,aAAA,GAAmC;AACrC,IAAA,OAAO,KAAK,cAAA,KAAmB,IAAA,CAAK,iBAAqB,qBAAA,CAAc,WAAA,CAAY,KAAK,OAAO,CAAA,CAAA;AAAA,EACjG;AAAA,EACA,IAAI,WAAA,GAA+B;AACjC,IAAA,OAAO,KAAK,YAAA,KAAiB,IAAA,CAAK,eAAmB,mBAAA,CAAY,WAAA,CAAY,KAAK,OAAO,CAAA,CAAA;AAAA,EAC3F;AAAA,EACA,IAAI,KAAA,GAAmB;AACrB,IAAA,OAAO,KAAK,MAAA,KAAW,IAAA,CAAK,SAAa,aAAA,CAAM,WAAA,CAAY,KAAK,OAAO,CAAA,CAAA;AAAA,EACzE;AAAA,EACA,IAAI,IAAA,GAAkB;AACpB,IAAA,OAAO,KAAK,KAAA,KAAU,IAAA,CAAK,QAAY,aAAA,CAAK,WAAA,CAAY,KAAK,OAAO,CAAA,CAAA;AAAA,EACtE;AAAA,EACA,IAAI,QAAA,GAAyB;AAC3B,IAAA,OAAO,KAAK,SAAA,KAAc,IAAA,CAAK,YAAgB,gBAAA,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-CESAPW7Z.js","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"]}
@@ -0,0 +1,59 @@
1
+ import { ApiResource } from './chunk-HNSO4ZPF.js';
2
+
3
+ // gen/resources/api_credentials.ts
4
+ var ApiCredentials = class _ApiCredentials extends ApiResource {
5
+ static TYPE = "api_credentials";
6
+ async create(resource, params, options) {
7
+ return this.resources.create(
8
+ { ...resource, type: _ApiCredentials.TYPE },
9
+ params,
10
+ options
11
+ );
12
+ }
13
+ async update(resource, params, options) {
14
+ return this.resources.update(
15
+ { ...resource, type: _ApiCredentials.TYPE },
16
+ params,
17
+ options
18
+ );
19
+ }
20
+ async delete(id, options) {
21
+ await this.resources.delete(typeof id === "string" ? { id, type: _ApiCredentials.TYPE } : id, options);
22
+ }
23
+ async organization(apiCredentialId, params, options) {
24
+ const _apiCredentialId = apiCredentialId.id || apiCredentialId;
25
+ return this.resources.fetch(
26
+ { type: "organizations" },
27
+ `api_credentials/${_apiCredentialId}/organization`,
28
+ params,
29
+ options
30
+ );
31
+ }
32
+ async role(apiCredentialId, params, options) {
33
+ const _apiCredentialId = apiCredentialId.id || apiCredentialId;
34
+ return this.resources.fetch(
35
+ { type: "roles" },
36
+ `api_credentials/${_apiCredentialId}/role`,
37
+ params,
38
+ options
39
+ );
40
+ }
41
+ isApiCredential(resource) {
42
+ return resource.type && resource.type === _ApiCredentials.TYPE;
43
+ }
44
+ relationship(id) {
45
+ return super.relationshipOneToOne(id);
46
+ }
47
+ relationshipToMany(...ids) {
48
+ return super.relationshipOneToMany(...ids);
49
+ }
50
+ type() {
51
+ return _ApiCredentials.TYPE;
52
+ }
53
+ };
54
+ var instance = new ApiCredentials();
55
+ var api_credentials_default = instance;
56
+
57
+ export { api_credentials_default };
58
+ //# sourceMappingURL=chunk-F2Z6XJTZ.js.map
59
+ //# sourceMappingURL=chunk-F2Z6XJTZ.js.map
@@ -0,0 +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,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D,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-F2Z6XJTZ.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"]}
@@ -0,0 +1,88 @@
1
+ 'use strict';
2
+
3
+ var chunkQTTL5EGB_cjs = require('./chunk-QTTL5EGB.cjs');
4
+
5
+ // gen/resources/application_memberships.ts
6
+ var ApplicationMemberships = class _ApplicationMemberships extends chunkQTTL5EGB_cjs.ApiResource {
7
+ static TYPE = "application_memberships";
8
+ async create(resource, params, options) {
9
+ return this.resources.create(
10
+ { ...resource, type: _ApplicationMemberships.TYPE },
11
+ params,
12
+ options
13
+ );
14
+ }
15
+ async update(resource, params, options) {
16
+ return this.resources.update(
17
+ { ...resource, type: _ApplicationMemberships.TYPE },
18
+ params,
19
+ options
20
+ );
21
+ }
22
+ async delete(id, options) {
23
+ await this.resources.delete(typeof id === "string" ? { id, type: _ApplicationMemberships.TYPE } : id, options);
24
+ }
25
+ async api_credential(applicationMembershipId, params, options) {
26
+ const _applicationMembershipId = applicationMembershipId.id || applicationMembershipId;
27
+ return this.resources.fetch(
28
+ { type: "api_credentials" },
29
+ `application_memberships/${_applicationMembershipId}/api_credential`,
30
+ params,
31
+ options
32
+ );
33
+ }
34
+ async membership(applicationMembershipId, params, options) {
35
+ const _applicationMembershipId = applicationMembershipId.id || applicationMembershipId;
36
+ return this.resources.fetch(
37
+ { type: "memberships" },
38
+ `application_memberships/${_applicationMembershipId}/membership`,
39
+ params,
40
+ options
41
+ );
42
+ }
43
+ async membership_profile(applicationMembershipId, params, options) {
44
+ const _applicationMembershipId = applicationMembershipId.id || applicationMembershipId;
45
+ return this.resources.fetch(
46
+ { type: "membership_profiles" },
47
+ `application_memberships/${_applicationMembershipId}/membership_profile`,
48
+ params,
49
+ options
50
+ );
51
+ }
52
+ async organization(applicationMembershipId, params, options) {
53
+ const _applicationMembershipId = applicationMembershipId.id || applicationMembershipId;
54
+ return this.resources.fetch(
55
+ { type: "organizations" },
56
+ `application_memberships/${_applicationMembershipId}/organization`,
57
+ params,
58
+ options
59
+ );
60
+ }
61
+ async role(applicationMembershipId, params, options) {
62
+ const _applicationMembershipId = applicationMembershipId.id || applicationMembershipId;
63
+ return this.resources.fetch(
64
+ { type: "roles" },
65
+ `application_memberships/${_applicationMembershipId}/role`,
66
+ params,
67
+ options
68
+ );
69
+ }
70
+ isApplicationMembership(resource) {
71
+ return resource.type && resource.type === _ApplicationMemberships.TYPE;
72
+ }
73
+ relationship(id) {
74
+ return super.relationshipOneToOne(id);
75
+ }
76
+ relationshipToMany(...ids) {
77
+ return super.relationshipOneToMany(...ids);
78
+ }
79
+ type() {
80
+ return _ApplicationMemberships.TYPE;
81
+ }
82
+ };
83
+ var instance = new ApplicationMemberships();
84
+ var application_memberships_default = instance;
85
+
86
+ exports.application_memberships_default = application_memberships_default;
87
+ //# sourceMappingURL=chunk-FHXWFSIQ.cjs.map
88
+ //# sourceMappingURL=chunk-FHXWFSIQ.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../gen/resources/application_memberships.ts"],"names":["ApiResource"],"mappings":";;;;;AA2EA,IAAM,sBAAA,GAAN,MAAM,uBAAA,SAA+BA,6BAAA,CAAmC;AAAA,EACtE,OAAgB,IAAA,GAAkC,yBAAA;AAAA,EAElD,MAAM,MAAA,CACJ,QAAA,EACA,MAAA,EACA,OAAA,EACgC;AAChC,IAAA,OAAO,KAAK,SAAA,CAAU,MAAA;AAAA,MACpB,EAAE,GAAG,QAAA,EAAU,IAAA,EAAM,wB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AEA,IAAM,QAAA,GAAW,IAAI,sBAAA,EAAuB;AAC5C,IAAO,+BAAA,GAAQ","file":"chunk-FHXWFSIQ.cjs","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 { ApiCredential, ApiCredentialType } from './api_credentials'\nimport type { MembershipProfile, MembershipProfileType } from './membership_profiles'\nimport type { Membership, MembershipType } from './memberships'\nimport type { Organization, OrganizationType } from './organizations'\nimport type { Role, RoleType } from './roles'\n\ntype ApplicationMembershipType = 'application_memberships'\ntype ApplicationMembershipRel = ResourceRel & { type: ApplicationMembershipType }\ntype ApiCredentialRel = ResourceRel & { type: ApiCredentialType }\ntype MembershipRel = ResourceRel & { type: MembershipType }\ntype MembershipProfileRel = ResourceRel & { type: MembershipProfileType }\ntype OrganizationRel = ResourceRel & { type: OrganizationType }\ntype RoleRel = ResourceRel & { type: RoleType }\n\nexport type ApplicationMembershipSort = Pick<ApplicationMembership, 'id'> & ResourceSort\n// export type ApplicationMembershipFilter = Pick<ApplicationMembership, 'id' | 'filters'> & ResourceFilter\n\n/**\n * The Application membership object is returned as part of the response body of each successful list, retrieve, create, update or delete API call to the /api/application_memberships endpoint.\n *\n * @link https://docs.commercelayer.io/provisioning-api-reference/application_memberships/object\n */\ninterface ApplicationMembership extends Resource {\n readonly type: ApplicationMembershipType\n\n /**\n * Set of key-value pairs that contains restrictions and scopes of the application membership.\n * @example ```{\"market_id_in\":[202,203]}```\n */\n filters?: Record<string, any> | null\n\n api_credential?: ApiCredential | null\n membership?: Membership | null\n membership_profile?: MembershipProfile | null\n organization?: Organization | null\n role?: Role | null\n}\n\ninterface ApplicationMembershipCreate extends ResourceCreate {\n /**\n * Set of key-value pairs that contains restrictions and scopes of the application membership.\n * @example ```{\"market_id_in\":[202,203]}```\n */\n filters?: Record<string, any> | null\n\n api_credential: ApiCredentialRel\n membership?: MembershipRel | null\n membership_profile?: MembershipProfileRel | null\n organization: OrganizationRel\n role: RoleRel\n}\n\ninterface ApplicationMembershipUpdate extends ResourceUpdate {\n /**\n * Set of key-value pairs that contains restrictions and scopes of the application membership.\n * @example ```{\"market_id_in\":[202,203]}```\n */\n filters?: Record<string, any> | null\n\n membership_profile?: MembershipProfileRel | null\n role?: RoleRel | null\n}\n\nclass ApplicationMemberships extends ApiResource<ApplicationMembership> {\n static readonly TYPE: ApplicationMembershipType = 'application_memberships' as const\n\n async create(\n resource: ApplicationMembershipCreate,\n params?: QueryParamsRetrieve<ApplicationMembership>,\n options?: ResourcesConfig,\n ): Promise<ApplicationMembership> {\n return this.resources.create<ApplicationMembershipCreate, ApplicationMembership>(\n { ...resource, type: ApplicationMemberships.TYPE },\n params,\n options,\n )\n }\n\n async update(\n resource: ApplicationMembershipUpdate,\n params?: QueryParamsRetrieve<ApplicationMembership>,\n options?: ResourcesConfig,\n ): Promise<ApplicationMembership> {\n return this.resources.update<ApplicationMembershipUpdate, ApplicationMembership>(\n { ...resource, type: ApplicationMemberships.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: ApplicationMemberships.TYPE } : id, options)\n }\n\n async api_credential(\n applicationMembershipId: string | ApplicationMembership,\n params?: QueryParamsRetrieve<ApiCredential>,\n options?: ResourcesConfig,\n ): Promise<ApiCredential> {\n const _applicationMembershipId =\n (applicationMembershipId as ApplicationMembership).id || (applicationMembershipId as string)\n return this.resources.fetch<ApiCredential>(\n { type: 'api_credentials' },\n `application_memberships/${_applicationMembershipId}/api_credential`,\n params,\n options,\n ) as unknown as ApiCredential\n }\n\n async membership(\n applicationMembershipId: string | ApplicationMembership,\n params?: QueryParamsRetrieve<Membership>,\n options?: ResourcesConfig,\n ): Promise<Membership> {\n const _applicationMembershipId =\n (applicationMembershipId as ApplicationMembership).id || (applicationMembershipId as string)\n return this.resources.fetch<Membership>(\n { type: 'memberships' },\n `application_memberships/${_applicationMembershipId}/membership`,\n params,\n options,\n ) as unknown as Membership\n }\n\n async membership_profile(\n applicationMembershipId: string | ApplicationMembership,\n params?: QueryParamsRetrieve<MembershipProfile>,\n options?: ResourcesConfig,\n ): Promise<MembershipProfile> {\n const _applicationMembershipId =\n (applicationMembershipId as ApplicationMembership).id || (applicationMembershipId as string)\n return this.resources.fetch<MembershipProfile>(\n { type: 'membership_profiles' },\n `application_memberships/${_applicationMembershipId}/membership_profile`,\n params,\n options,\n ) as unknown as MembershipProfile\n }\n\n async organization(\n applicationMembershipId: string | ApplicationMembership,\n params?: QueryParamsRetrieve<Organization>,\n options?: ResourcesConfig,\n ): Promise<Organization> {\n const _applicationMembershipId =\n (applicationMembershipId as ApplicationMembership).id || (applicationMembershipId as string)\n return this.resources.fetch<Organization>(\n { type: 'organizations' },\n `application_memberships/${_applicationMembershipId}/organization`,\n params,\n options,\n ) as unknown as Organization\n }\n\n async role(\n applicationMembershipId: string | ApplicationMembership,\n params?: QueryParamsRetrieve<Role>,\n options?: ResourcesConfig,\n ): Promise<Role> {\n const _applicationMembershipId =\n (applicationMembershipId as ApplicationMembership).id || (applicationMembershipId as string)\n return this.resources.fetch<Role>(\n { type: 'roles' },\n `application_memberships/${_applicationMembershipId}/role`,\n params,\n options,\n ) as unknown as Role\n }\n\n isApplicationMembership(resource: any): resource is ApplicationMembership {\n return resource.type && resource.type === ApplicationMemberships.TYPE\n }\n\n relationship(id: string | ResourceId | null): ApplicationMembershipRel {\n return super.relationshipOneToOne<ApplicationMembershipRel>(id)\n }\n\n relationshipToMany(...ids: string[]): ApplicationMembershipRel[] {\n return super.relationshipOneToMany<ApplicationMembershipRel>(...ids)\n }\n\n type(): ApplicationMembershipType {\n return ApplicationMemberships.TYPE\n }\n}\n\nconst instance = new ApplicationMemberships()\nexport default instance\n\nexport type {\n ApplicationMembership,\n ApplicationMembershipCreate,\n ApplicationMemberships,\n ApplicationMembershipType,\n ApplicationMembershipUpdate,\n}\n"]}