@commercelayer/provisioning-sdk 3.0.0-beta.1 → 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 (144) hide show
  1. package/README.md +18 -9
  2. package/lib/{api-BQ6Y-J8P.d.ts → api-CrVODncY.d.ts} +502 -485
  3. package/lib/{api-BQZ9r4RA.d.cts → api-DtxN9ZNI.d.cts} +502 -485
  4. package/lib/api.cjs +23 -23
  5. package/lib/api.d.cts +1 -1
  6. package/lib/api.d.ts +1 -1
  7. package/lib/api.js +13 -13
  8. package/lib/binding.cjs +3 -3
  9. package/lib/binding.d.cts +2 -2
  10. package/lib/binding.d.ts +2 -2
  11. package/lib/binding.js +2 -2
  12. package/lib/bundle.cjs +17 -17
  13. package/lib/bundle.d.cts +1 -1
  14. package/lib/bundle.d.ts +1 -1
  15. package/lib/bundle.js +15 -15
  16. package/lib/{chunk-QVV2ORWB.cjs → chunk-2H27UDGO.cjs} +4 -4
  17. package/lib/{chunk-QVV2ORWB.cjs.map → chunk-2H27UDGO.cjs.map} +1 -1
  18. package/lib/{chunk-PIDJDUN3.js → chunk-37LZALYC.js} +3 -3
  19. package/lib/{chunk-PIDJDUN3.js.map → chunk-37LZALYC.js.map} +1 -1
  20. package/lib/{chunk-BFXJ3YNR.js → chunk-3AXLHEDT.js} +3 -3
  21. package/lib/{chunk-BFXJ3YNR.js.map → chunk-3AXLHEDT.js.map} +1 -1
  22. package/lib/{chunk-U76G3DPW.js → chunk-3PE2OE6B.js} +3 -3
  23. package/lib/{chunk-U76G3DPW.js.map → chunk-3PE2OE6B.js.map} +1 -1
  24. package/lib/{chunk-KJRFIWHK.cjs → chunk-43XNULI4.cjs} +4 -4
  25. package/lib/{chunk-KJRFIWHK.cjs.map → chunk-43XNULI4.cjs.map} +1 -1
  26. package/lib/{chunk-RSAADRRH.cjs → chunk-4PMMCL4I.cjs} +4 -4
  27. package/lib/{chunk-RSAADRRH.cjs.map → chunk-4PMMCL4I.cjs.map} +1 -1
  28. package/lib/{chunk-47HG76BX.cjs → chunk-4TC4U7TK.cjs} +4 -4
  29. package/lib/{chunk-47HG76BX.cjs.map → chunk-4TC4U7TK.cjs.map} +1 -1
  30. package/lib/{chunk-ZTAL3U2D.js → chunk-5VPJA5UV.js} +3 -3
  31. package/lib/{chunk-ZTAL3U2D.js.map → chunk-5VPJA5UV.js.map} +1 -1
  32. package/lib/{chunk-O6ACW64H.js → chunk-6FFP3YXV.js} +3 -3
  33. package/lib/{chunk-O6ACW64H.js.map → chunk-6FFP3YXV.js.map} +1 -1
  34. package/lib/{chunk-CESAPW7Z.js → chunk-6MIFOPOB.js} +14 -14
  35. package/lib/{chunk-CESAPW7Z.js.map → chunk-6MIFOPOB.js.map} +1 -1
  36. package/lib/{chunk-OEYUWL5K.js → chunk-6PWTKNOC.js} +4 -4
  37. package/lib/{chunk-OEYUWL5K.js.map → chunk-6PWTKNOC.js.map} +1 -1
  38. package/lib/{chunk-4GOUGGBM.js → chunk-6SNLYMKG.js} +4 -4
  39. package/lib/{chunk-4GOUGGBM.js.map → chunk-6SNLYMKG.js.map} +1 -1
  40. package/lib/{chunk-OKBMV3W5.cjs → chunk-73VBQFUA.cjs} +4 -4
  41. package/lib/{chunk-OKBMV3W5.cjs.map → chunk-73VBQFUA.cjs.map} +1 -1
  42. package/lib/{chunk-6B2AFMGT.js → chunk-BFBXXP4Q.js} +3 -3
  43. package/lib/{chunk-6B2AFMGT.js.map → chunk-BFBXXP4Q.js.map} +1 -1
  44. package/lib/{chunk-YLA6YCK5.cjs → chunk-DDFTZDVN.cjs} +3 -3
  45. package/lib/chunk-DDFTZDVN.cjs.map +1 -0
  46. package/lib/{chunk-BI4FXO5V.cjs → chunk-DTORLDNE.cjs} +8 -8
  47. package/lib/{chunk-BI4FXO5V.cjs.map → chunk-DTORLDNE.cjs.map} +1 -1
  48. package/lib/{chunk-LISATEFD.cjs → chunk-EUMMY3TQ.cjs} +4 -4
  49. package/lib/{chunk-LISATEFD.cjs.map → chunk-EUMMY3TQ.cjs.map} +1 -1
  50. package/lib/{chunk-SZSANTXM.cjs → chunk-H5YSO3AX.cjs} +10 -10
  51. package/lib/{chunk-SZSANTXM.cjs.map → chunk-H5YSO3AX.cjs.map} +1 -1
  52. package/lib/{chunk-QTTL5EGB.cjs → chunk-HVYM2S4K.cjs} +40 -13
  53. package/lib/chunk-HVYM2S4K.cjs.map +1 -0
  54. package/lib/{chunk-QRMCUYRK.js → chunk-IRQX6AG3.js} +3 -3
  55. package/lib/{chunk-QRMCUYRK.js.map → chunk-IRQX6AG3.js.map} +1 -1
  56. package/lib/{chunk-XCKSYX22.js → chunk-LSEKNECC.js} +3 -3
  57. package/lib/{chunk-XCKSYX22.js.map → chunk-LSEKNECC.js.map} +1 -1
  58. package/lib/{chunk-5D5YOHG4.cjs → chunk-LV5XV2UF.cjs} +26 -26
  59. package/lib/{chunk-5D5YOHG4.cjs.map → chunk-LV5XV2UF.cjs.map} +1 -1
  60. package/lib/{chunk-YFZRO7OE.cjs → chunk-MT2XP4UJ.cjs} +4 -4
  61. package/lib/{chunk-YFZRO7OE.cjs.map → chunk-MT2XP4UJ.cjs.map} +1 -1
  62. package/lib/{chunk-F2Z6XJTZ.js → chunk-NDCVBYCJ.js} +3 -3
  63. package/lib/{chunk-F2Z6XJTZ.js.map → chunk-NDCVBYCJ.js.map} +1 -1
  64. package/lib/{chunk-HNSO4ZPF.js → chunk-OTK6VLW5.js} +35 -8
  65. package/lib/chunk-OTK6VLW5.js.map +1 -0
  66. package/lib/{chunk-TOXS3OUT.cjs → chunk-PBYGXPJ6.cjs} +4 -4
  67. package/lib/{chunk-TOXS3OUT.cjs.map → chunk-PBYGXPJ6.cjs.map} +1 -1
  68. package/lib/{chunk-XV25RH6C.js → chunk-QTXYKCKC.js} +3 -3
  69. package/lib/{chunk-XV25RH6C.js.map → chunk-QTXYKCKC.js.map} +1 -1
  70. package/lib/{chunk-OAXFNHFA.js → chunk-RWUBFJZ6.js} +3 -3
  71. package/lib/{chunk-OAXFNHFA.js.map → chunk-RWUBFJZ6.js.map} +1 -1
  72. package/lib/{chunk-MANW7JPJ.js → chunk-VVSV5FR6.js} +3 -3
  73. package/lib/chunk-VVSV5FR6.js.map +1 -0
  74. package/lib/{chunk-NFF6DWKZ.cjs → chunk-XKY46RI6.cjs} +4 -4
  75. package/lib/{chunk-NFF6DWKZ.cjs.map → chunk-XKY46RI6.cjs.map} +1 -1
  76. package/lib/{chunk-FHXWFSIQ.cjs → chunk-YAVEKFKE.cjs} +4 -4
  77. package/lib/{chunk-FHXWFSIQ.cjs.map → chunk-YAVEKFKE.cjs.map} +1 -1
  78. package/lib/{chunk-JDXNOZFC.cjs → chunk-YYM7BH33.cjs} +4 -4
  79. package/lib/{chunk-JDXNOZFC.cjs.map → chunk-YYM7BH33.cjs.map} +1 -1
  80. package/lib/commercelayer.cjs +10 -10
  81. package/lib/commercelayer.d.cts +1 -1
  82. package/lib/commercelayer.d.ts +1 -1
  83. package/lib/commercelayer.js +4 -4
  84. package/lib/enum.d.cts +1 -1
  85. package/lib/enum.d.ts +1 -1
  86. package/lib/index.cjs +22 -22
  87. package/lib/index.cjs.map +1 -1
  88. package/lib/index.d.cts +1 -1
  89. package/lib/index.d.ts +1 -1
  90. package/lib/index.js +17 -17
  91. package/lib/index.js.map +1 -1
  92. package/lib/model.d.cts +1 -1
  93. package/lib/model.d.ts +1 -1
  94. package/lib/resources/api_credentials.cjs +5 -5
  95. package/lib/resources/api_credentials.d.cts +2 -2
  96. package/lib/resources/api_credentials.d.ts +1 -1
  97. package/lib/resources/api_credentials.js +4 -4
  98. package/lib/resources/application_memberships.cjs +5 -5
  99. package/lib/resources/application_memberships.d.cts +2 -2
  100. package/lib/resources/application_memberships.d.ts +1 -1
  101. package/lib/resources/application_memberships.js +4 -4
  102. package/lib/resources/identity_providers.cjs +5 -5
  103. package/lib/resources/identity_providers.d.cts +2 -2
  104. package/lib/resources/identity_providers.d.ts +1 -1
  105. package/lib/resources/identity_providers.js +4 -4
  106. package/lib/resources/membership_profiles.cjs +5 -5
  107. package/lib/resources/membership_profiles.d.cts +2 -2
  108. package/lib/resources/membership_profiles.d.ts +1 -1
  109. package/lib/resources/membership_profiles.js +4 -4
  110. package/lib/resources/memberships.cjs +5 -5
  111. package/lib/resources/memberships.d.cts +2 -2
  112. package/lib/resources/memberships.d.ts +1 -1
  113. package/lib/resources/memberships.js +4 -4
  114. package/lib/resources/organizations.cjs +5 -5
  115. package/lib/resources/organizations.d.cts +2 -2
  116. package/lib/resources/organizations.d.ts +1 -1
  117. package/lib/resources/organizations.js +4 -4
  118. package/lib/resources/permissions.cjs +5 -5
  119. package/lib/resources/permissions.d.cts +2 -2
  120. package/lib/resources/permissions.d.ts +1 -1
  121. package/lib/resources/permissions.js +4 -4
  122. package/lib/resources/roles.cjs +5 -5
  123. package/lib/resources/roles.d.cts +2 -2
  124. package/lib/resources/roles.d.ts +1 -1
  125. package/lib/resources/roles.js +4 -4
  126. package/lib/resources/users.cjs +5 -5
  127. package/lib/resources/users.d.cts +2 -2
  128. package/lib/resources/users.d.ts +1 -1
  129. package/lib/resources/users.js +4 -4
  130. package/lib/resources/versions.cjs +5 -5
  131. package/lib/resources/versions.d.cts +2 -2
  132. package/lib/resources/versions.d.ts +1 -1
  133. package/lib/resources/versions.js +4 -4
  134. package/lib/static.cjs +6 -6
  135. package/lib/static.d.cts +1 -1
  136. package/lib/static.d.ts +1 -1
  137. package/lib/static.js +5 -5
  138. package/lib/version.cjs +4 -4
  139. package/lib/version.js +1 -1
  140. package/package.json +10 -11
  141. package/lib/chunk-HNSO4ZPF.js.map +0 -1
  142. package/lib/chunk-MANW7JPJ.js.map +0 -1
  143. package/lib/chunk-QTTL5EGB.cjs.map +0 -1
  144. package/lib/chunk-YLA6YCK5.cjs.map +0 -1
@@ -1,19 +1,5 @@
1
1
  import { TransferOwnershipDataType } from './actions.cjs';
2
2
 
3
- type Fetch = (input: string | URL | Request, init?: RequestInit) => Promise<Response>;
4
- type FetchResponse = any;
5
- type FetchRequestOptions = RequestInit;
6
- declare class FetchError extends Error {
7
- #private;
8
- static NAME: string;
9
- static isFetchError: (error: any) => error is FetchError;
10
- constructor(status: number, statusText: string, body?: any, request?: FetchRequestOptions);
11
- get errors(): any[] | undefined;
12
- get status(): number;
13
- get statusText(): string;
14
- get request(): Partial<FetchRequestOptions> | undefined;
15
- }
16
-
17
3
  type InterceptorEventManager<S extends RequestInterceptor | ResponseInterceptor, F extends ErrorInterceptor | ResponseInterceptor> = {
18
4
  onSuccess?: S;
19
5
  onFailure?: F;
@@ -49,156 +35,228 @@ type RawResponseReader = {
49
35
  ok: boolean;
50
36
  };
51
37
 
38
+ type Fetch = (input: string | URL | Request, init?: RequestInit) => Promise<Response>;
39
+ type FetchResponse = any;
40
+ type FetchRequestOptions = RequestInit;
41
+ declare class FetchError extends Error {
42
+ #private;
43
+ static NAME: string;
44
+ static isFetchError: (error: any) => error is FetchError;
45
+ constructor(status: number, statusText: string, body?: any, request?: FetchRequestOptions);
46
+ get errors(): any[] | undefined;
47
+ get status(): number;
48
+ get statusText(): string;
49
+ get request(): Partial<FetchRequestOptions> | undefined;
50
+ }
51
+
52
+ type RequestParams = Record<string, string | number | boolean>;
53
+ type RequestHeaders = Record<string, string>;
54
+ type RefreshToken = (expiredToken: string) => Promise<string>;
55
+ type RequestConfig = {
56
+ timeout?: number;
57
+ params?: RequestParams;
58
+ headers?: RequestHeaders;
59
+ userAgent?: string;
60
+ fetch?: Fetch;
61
+ refreshToken?: RefreshToken;
62
+ telemetry?: boolean;
63
+ };
64
+ type ApiConfig = {
65
+ organization?: string;
66
+ domain?: string;
67
+ accessToken: string;
68
+ apiVersion?: string;
69
+ };
70
+ type ApiClientInitConfig = ApiConfig & RequestConfig;
71
+ type ApiClientConfig = Partial<ApiClientInitConfig>;
72
+ type Method = 'GET' | 'DELETE' | 'POST' | 'PUT' | 'PATCH';
73
+ declare class ApiClient {
74
+ #private;
75
+ static create(options: ApiClientInitConfig): ApiClient;
76
+ private constructor();
77
+ get interceptors(): InterceptorManager;
78
+ get requestHeaders(): RequestHeaders;
79
+ config(config: ApiClientConfig): this;
80
+ userAgent(userAgent: string): this;
81
+ request(method: Method, path: string, body?: any, options?: ApiClientConfig): Promise<FetchResponse>;
82
+ private customHeaders;
83
+ get currentAccessToken(): string;
84
+ get currentOrganization(): string;
85
+ /** The API version pinned via `apiVersion`, or `undefined` when requests are unversioned. */
86
+ get currentApiVersion(): string | undefined;
87
+ }
88
+
52
89
  type ObjectType = Record<string, any>;
53
90
  type CreateArrayWithLengthX<LENGTH extends number, ACC extends unknown[] = []> = ACC['length'] extends LENGTH ? ACC : CreateArrayWithLengthX<LENGTH, [...ACC, 1]>;
54
91
  type NumericNumberRange<START_ARR extends number[], END extends number, ACC extends number = never> = START_ARR['length'] extends END ? ACC | END : NumericNumberRange<[...START_ARR, 1], END, ACC | START_ARR['length']>;
55
92
  type PositiveNumberRange<MAX extends number> = NumericNumberRange<CreateArrayWithLengthX<1>, MAX>;
56
93
  type StringKey<T> = Extract<keyof T, string>;
57
94
 
58
- type QueryResType<T extends Resource> = T['type'];
59
- type QueryInclude = string[];
60
- type QueryResourceFields<R extends ResourceTypeLock> = keyof ResourceFields[R];
61
- type QueryArrayFields<R extends Resource> = Array<QueryResourceFields<QueryResType<R>>>;
62
- type QueryRecordFields = {
63
- [key in keyof ResourceFields]?: Array<QueryResourceFields<key>>;
95
+ type ResourceNull = {
96
+ id: null;
97
+ } & ResourceType;
98
+ type ResourceRel = ResourceId | ResourceNull;
99
+ type Metadata = ObjectType;
100
+ interface ResourceType {
101
+ readonly type: ResourceTypeLock;
102
+ }
103
+ interface ResourceId extends ResourceType {
104
+ readonly id: string;
105
+ }
106
+ interface ResourceBase {
107
+ reference?: string | null;
108
+ reference_origin?: string | null;
109
+ metadata?: Metadata;
110
+ }
111
+ /**
112
+ * The JSON:API `meta` member of a resource object — server-supplied facts about
113
+ * the resource rather than fields of it. Not to be confused with `metadata`,
114
+ * which is a user-writable attribute.
115
+ *
116
+ * Distinct from the document-level `meta` of a list response, which is what
117
+ * `ListMeta` reflects.
118
+ */
119
+ type ResourceMeta = {
120
+ /** The API version the resource was created with, when the API reports it. */
121
+ readonly created_with_version?: string;
122
+ readonly [key: string]: unknown;
64
123
  };
65
- type QueryFields<R extends Resource> = QueryArrayFields<R> | QueryRecordFields;
66
- interface QueryParamsRetrieve<R extends Resource = Resource> {
67
- include?: QueryInclude;
68
- fields?: QueryFields<R>;
124
+ interface Resource extends ResourceBase, ResourceId {
125
+ readonly created_at: string;
126
+ readonly updated_at: string;
127
+ /** Present only when the API returns a `meta` member for this resource. */
128
+ readonly meta?: ResourceMeta;
69
129
  }
70
- type QuerySortType = 'asc' | 'desc';
71
- type QueryResourceSortable<R extends Resource> = ResourceSortFields[QueryResType<R>];
72
- type QueryResourceSortableFields<R extends Resource> = StringKey<QueryResourceSortable<R>>;
73
- type QueryArraySortable<R extends Resource> = Array<QueryResourceSortableFields<R> | `-${QueryResourceSortableFields<R>}`>;
74
- type QueryRecordSortable<R extends Resource> = Partial<Record<keyof QueryResourceSortable<R>, QuerySortType>>;
75
- type QuerySort<R extends Resource> = QueryArraySortable<R> | QueryRecordSortable<R>;
76
- type QueryFilter = Record<string, string | number | boolean | object | Array<string | number>>;
77
- type QueryPageNumber = number;
78
- type QueryPageSize = PositiveNumberRange<25>;
79
- type QueryPageCursor = string;
80
- interface QueryParamsList<R extends Resource = Resource> extends QueryParamsRetrieve<R> {
81
- sort?: QuerySort<R>;
82
- filters?: QueryFilter;
83
- pageNumber?: QueryPageNumber;
84
- pageSize?: QueryPageSize;
130
+ interface ResourceCreate extends ResourceBase {
131
+ }
132
+ interface ResourceUpdate extends ResourceBase {
133
+ readonly id: string;
134
+ }
135
+ /**
136
+ * Update payload for a singleton resource, which carries no `id` because it is
137
+ * addressed at a singular path (`/user`, not `/users/{id}`). Distinct from
138
+ * `ResourceUpdate` purely to keep `id` off the caller's payload.
139
+ */
140
+ interface SingletonUpdate extends ResourceBase {
141
+ }
142
+ type PageCursor = {
143
+ readonly before?: string;
144
+ readonly after?: string;
145
+ };
146
+ type ListMeta = {
147
+ readonly pageCount: number;
148
+ readonly recordCount: number;
149
+ readonly recordCountEstimated: boolean;
150
+ readonly currentPage: number;
151
+ readonly recordsPerPage: number;
152
+ readonly cursor?: {
153
+ readonly prev?: PageCursor;
154
+ readonly next?: PageCursor;
155
+ };
156
+ };
157
+ declare class ListResponse<R extends Resource = Resource> extends Array<R> {
158
+ readonly meta: ListMeta;
159
+ constructor(meta: ListMeta, data: R[]);
160
+ first(): R | undefined;
161
+ last(): R | undefined;
162
+ get(index: number): R | undefined;
163
+ hasNextPage(): boolean;
164
+ hasPrevPage(): boolean;
165
+ getRecordCount(): number;
166
+ getRecordCountEstimated(): boolean;
167
+ getPageCount(): number;
168
+ get recordCount(): number;
169
+ get pageCount(): number;
170
+ }
171
+
172
+ type ResourceSort = Pick<Resource, 'id' | 'reference' | 'reference_origin' | 'created_at' | 'updated_at'>;
173
+ type ResourceFilter = Pick<Resource, 'id' | 'reference' | 'reference_origin' | 'metadata' | 'created_at' | 'updated_at'>;
174
+ type ResourceAdapterConfig = {};
175
+ type ResourcesInitConfig = ResourceAdapterConfig & ApiClientInitConfig;
176
+ type ResourcesConfig = Partial<ResourcesInitConfig>;
177
+ declare class ResourceAdapter {
178
+ #private;
179
+ constructor(config: ResourcesInitConfig);
180
+ private localConfig;
181
+ config(config: ResourcesConfig): this;
182
+ get client(): Readonly<ApiClient>;
183
+ singleton<R extends Resource>(resource: ResourceType, params?: QueryParamsRetrieve<R>, options?: ResourcesConfig, path?: string): Promise<R>;
184
+ retrieve<R extends Resource>(resource: ResourceId, params?: QueryParamsRetrieve<R>, options?: ResourcesConfig): Promise<R>;
185
+ list<R extends Resource>(resource: ResourceType, params?: QueryParamsList<R>, options?: ResourcesConfig): Promise<ListResponse<R>>;
186
+ create<C extends ResourceCreate, R extends Resource>(resource: C & ResourceType, params?: QueryParamsRetrieve<R>, options?: ResourcesConfig): Promise<R>;
187
+ update<U extends ResourceUpdate | SingletonUpdate, R extends Resource>(resource: U & ResourceType, params?: QueryParamsRetrieve<R>, options?: ResourcesConfig,
85
188
  /**
86
- * Cursor for cursor-based pagination — returns the records after the given cursor.
87
- * Only cursor-paginated resources (e.g. `event_stores`) honor it; offset-paginated
88
- * resources ignore it. Emitted as the `page[after]` query parameter.
189
+ * Singular path override for singleton resources, e.g. `user` rather than
190
+ * `users/{id}`. Mirrors `singleton()` above. Core never needed it — both
191
+ * its singletons are retrieve-only — but the Provisioning API's `user` is
192
+ * updatable, and without this the request targets `/users/{id}` and 404s.
89
193
  */
90
- pageAfter?: QueryPageCursor;
194
+ path?: string): Promise<R>;
195
+ delete(resource: ResourceId, options?: ResourcesConfig): Promise<void>;
91
196
  /**
92
- * Cursor for cursor-based pagination — returns the records before the given cursor.
93
- * Only cursor-paginated resources honor it; offset-paginated resources ignore it.
94
- * Emitted as the `page[before]` query parameter.
197
+ * Calls a non-CRUD endpoint hosted at a sub-path of a resource, e.g.
198
+ * `POST memberships/:id/resend`. These endpoints are not described by the
199
+ * public resources schema, so they are declared in a target config and
200
+ * emitted from it.
95
201
  */
96
- pageBefore?: QueryPageCursor;
202
+ action(cmd: Extract<Method, 'POST' | 'PATCH'>, path: string, payload?: any, options?: ResourcesConfig): Promise<void>;
203
+ fetch<R extends Resource>(resource: string | ResourceType, path: string, params?: QueryParams<R>, options?: ResourcesConfig): Promise<R | ListResponse<R>>;
204
+ }
205
+ declare abstract class ApiResourceBase<R extends Resource> {
206
+ #private;
207
+ static readonly TYPE: ResourceTypeLock;
208
+ constructor(adapter?: ResourceAdapter);
209
+ protected get resources(): ResourceAdapter;
210
+ /**
211
+ * Returns a copy of this resource instance bound to a specific
212
+ * `ResourceAdapter`. Used by the bundle client so each client instance
213
+ * routes requests through its own adapter (its own access token) instead
214
+ * of the process-global static adapter. Resource classes are type-only
215
+ * exports, so we clone via `this.constructor` rather than referencing the
216
+ * class directly.
217
+ */
218
+ withAdapter(adapter: ResourceAdapter): this;
219
+ abstract relationship(id: string | ResourceId | null): ResourceRel;
220
+ protected relationshipOneToOne<RR extends ResourceRel>(id: string | ResourceId | null): RR;
221
+ protected relationshipOneToMany<RR extends ResourceRel>(...ids: string[]): RR[];
222
+ abstract type(): ResourceTypeLock;
223
+ protected path(): string;
224
+ update(resource: ResourceUpdate, params?: QueryParamsRetrieve<R>, options?: ResourcesConfig): Promise<R>;
225
+ }
226
+ declare abstract class ApiResource<R extends Resource> extends ApiResourceBase<R> {
227
+ retrieve(id: string | ResourceId, params?: QueryParamsRetrieve<R>, options?: ResourcesConfig): Promise<R>;
228
+ list(params?: QueryParamsList<R>, options?: ResourcesConfig): Promise<ListResponse<R>>;
229
+ count(filter?: QueryFilter | QueryParamsList<R>, options?: ResourcesConfig): Promise<number>;
230
+ }
231
+ declare abstract class ApiSingleton<R extends Resource> extends ApiResourceBase<R> {
232
+ retrieve(params?: QueryParamsRetrieve<R>, options?: ResourcesConfig): Promise<R>;
97
233
  }
98
- type QueryParams<R extends Resource = Resource> = QueryParamsRetrieve<R> | QueryParamsList<R>;
99
234
 
100
- type MembershipProfileType = 'membership_profiles';
101
- type MembershipProfileRel$2 = ResourceRel & {
102
- type: MembershipProfileType;
103
- };
104
- type OrganizationRel$5 = ResourceRel & {
105
- type: OrganizationType;
106
- };
107
- type ApplicationMembershipRel$2 = ResourceRel & {
108
- type: ApplicationMembershipType;
235
+ type VersionType = 'versions';
236
+ type VersionRel = ResourceRel & {
237
+ type: VersionType;
109
238
  };
110
- type MembershipProfileSort = Pick<MembershipProfile, 'id' | 'name'> & ResourceSort;
239
+ type VersionSort = Pick<Version, 'id'> & ResourceSort;
111
240
  /**
112
- * The Membership profile object is returned as part of the response body of each successful list, retrieve, create, update or delete API call to the /api/membership_profiles endpoint.
241
+ * The Version object is returned as part of the response body of each successful list or retrieve API call to the /api/versions endpoint.
113
242
  *
114
- * @link https://docs.commercelayer.io/provisioning-api-reference/membership_profiles/object
243
+ * @link https://docs.commercelayer.io/provisioning-api-reference/versions/object
115
244
  */
116
- interface MembershipProfile extends Resource {
117
- readonly type: MembershipProfileType;
245
+ interface Version extends Resource {
246
+ readonly type: VersionType;
118
247
  /**
119
- * The membership profile name.
120
- * @example ```"Marketing group"```
248
+ * The type of the versioned resource.
249
+ * @example ```"roles"```
121
250
  */
122
- name: string;
251
+ resource_type?: string | null;
123
252
  /**
124
- * Reflects the organization's access scope, either test_access or all_access.
125
- * @example ```true```
253
+ * The versioned resource ID.
254
+ * @example ```"PzdJhdLdYV"```
126
255
  */
127
- test_enabled?: boolean | null;
256
+ resource_id?: string | null;
128
257
  /**
129
- * The access scope for applications. One of `live_access` (default), `test_access`, `all_access`.
130
- * @example ```"live_access"```
131
- */
132
- access_scope: 'live_access' | 'test_access' | 'all_access';
133
- organization?: Organization | null;
134
- application_memberships?: ApplicationMembership[] | null;
135
- }
136
- interface MembershipProfileCreate extends ResourceCreate {
137
- /**
138
- * The membership profile name.
139
- * @example ```"Marketing group"```
140
- */
141
- name: string;
142
- /**
143
- * The access scope for applications. One of `live_access` (default), `test_access`, `all_access`.
144
- * @example ```"live_access"```
145
- */
146
- access_scope: 'live_access' | 'test_access' | 'all_access';
147
- organization: OrganizationRel$5;
148
- application_memberships?: ApplicationMembershipRel$2[] | null;
149
- }
150
- interface MembershipProfileUpdate extends ResourceUpdate {
151
- /**
152
- * The membership profile name.
153
- * @example ```"Marketing group"```
154
- */
155
- name?: string | null;
156
- /**
157
- * The access scope for applications. One of `live_access` (default), `test_access`, `all_access`.
158
- * @example ```"live_access"```
159
- */
160
- access_scope?: 'live_access' | 'test_access' | 'all_access' | null;
161
- application_memberships?: ApplicationMembershipRel$2[] | null;
162
- }
163
- declare class MembershipProfiles extends ApiResource<MembershipProfile> {
164
- static readonly TYPE: MembershipProfileType;
165
- create(resource: MembershipProfileCreate, params?: QueryParamsRetrieve<MembershipProfile>, options?: ResourcesConfig): Promise<MembershipProfile>;
166
- update(resource: MembershipProfileUpdate, params?: QueryParamsRetrieve<MembershipProfile>, options?: ResourcesConfig): Promise<MembershipProfile>;
167
- delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void>;
168
- organization(membershipProfileId: string | MembershipProfile, params?: QueryParamsRetrieve<Organization>, options?: ResourcesConfig): Promise<Organization>;
169
- application_memberships(membershipProfileId: string | MembershipProfile, params?: QueryParamsList<ApplicationMembership>, options?: ResourcesConfig): Promise<ListResponse<ApplicationMembership>>;
170
- isMembershipProfile(resource: any): resource is MembershipProfile;
171
- relationship(id: string | ResourceId | null): MembershipProfileRel$2;
172
- relationshipToMany(...ids: string[]): MembershipProfileRel$2[];
173
- type(): MembershipProfileType;
174
- }
175
- declare const instance$9: MembershipProfiles;
176
-
177
- type VersionType = 'versions';
178
- type VersionRel = ResourceRel & {
179
- type: VersionType;
180
- };
181
- type VersionSort = Pick<Version, 'id'> & ResourceSort;
182
- /**
183
- * The Version object is returned as part of the response body of each successful list or retrieve API call to the /api/versions endpoint.
184
- *
185
- * @link https://docs.commercelayer.io/provisioning-api-reference/versions/object
186
- */
187
- interface Version extends Resource {
188
- readonly type: VersionType;
189
- /**
190
- * The type of the versioned resource.
191
- * @example ```"roles"```
192
- */
193
- resource_type?: string | null;
194
- /**
195
- * The versioned resource ID.
196
- * @example ```"PzdJhdLdYV"```
197
- */
198
- resource_id?: string | null;
199
- /**
200
- * The event which generates the version.
201
- * @example ```"update"```
258
+ * The event which generates the version.
259
+ * @example ```"update"```
202
260
  */
203
261
  event?: string | null;
204
262
  /**
@@ -219,7 +277,7 @@ declare class Versions extends ApiResource<Version> {
219
277
  relationshipToMany(...ids: string[]): VersionRel[];
220
278
  type(): VersionType;
221
279
  }
222
- declare const instance$8: Versions;
280
+ declare const instance$9: Versions;
223
281
 
224
282
  type PermissionType = 'permissions';
225
283
  type PermissionRel = ResourceRel & {
@@ -318,13 +376,13 @@ declare class Permissions extends ApiResource<Permission> {
318
376
  relationshipToMany(...ids: string[]): PermissionRel[];
319
377
  type(): PermissionType;
320
378
  }
321
- declare const instance$7: Permissions;
379
+ declare const instance$8: Permissions;
322
380
 
323
381
  type RoleType = 'roles';
324
382
  type RoleRel$3 = ResourceRel & {
325
383
  type: RoleType;
326
384
  };
327
- type OrganizationRel$4 = ResourceRel & {
385
+ type OrganizationRel$5 = ResourceRel & {
328
386
  type: OrganizationType;
329
387
  };
330
388
  type RoleSort = Pick<Role, 'id' | 'name'> & ResourceSort;
@@ -357,7 +415,7 @@ interface RoleCreate extends ResourceCreate {
357
415
  * @example ```"Custom role"```
358
416
  */
359
417
  name: string;
360
- organization: OrganizationRel$4;
418
+ organization: OrganizationRel$5;
361
419
  }
362
420
  interface RoleUpdate extends ResourceUpdate {
363
421
  /**
@@ -386,98 +444,22 @@ declare class Roles extends ApiResource<Role> {
386
444
  relationshipToMany(...ids: string[]): RoleRel$3[];
387
445
  type(): RoleType;
388
446
  }
389
- declare const instance$6: Roles;
447
+ declare const instance$7: Roles;
390
448
 
391
- type ApplicationMembershipType = 'application_memberships';
392
- type ApplicationMembershipRel$1 = ResourceRel & {
393
- type: ApplicationMembershipType;
394
- };
395
- type ApiCredentialRel$1 = ResourceRel & {
396
- type: ApiCredentialType;
397
- };
449
+ type MembershipType = 'memberships';
398
450
  type MembershipRel$1 = ResourceRel & {
399
451
  type: MembershipType;
400
452
  };
401
- type MembershipProfileRel$1 = ResourceRel & {
402
- type: MembershipProfileType;
403
- };
404
- type OrganizationRel$3 = ResourceRel & {
453
+ type OrganizationRel$4 = ResourceRel & {
405
454
  type: OrganizationType;
406
455
  };
407
456
  type RoleRel$2 = ResourceRel & {
408
457
  type: RoleType;
409
458
  };
410
- type ApplicationMembershipSort = Pick<ApplicationMembership, 'id'> & ResourceSort;
411
- /**
412
- * 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.
413
- *
414
- * @link https://docs.commercelayer.io/provisioning-api-reference/application_memberships/object
415
- */
416
- interface ApplicationMembership extends Resource {
417
- readonly type: ApplicationMembershipType;
418
- /**
419
- * Set of key-value pairs that contains restrictions and scopes of the application membership.
420
- * @example ```{"market_id_in":[202,203]}```
421
- */
422
- filters?: Record<string, any> | null;
423
- api_credential?: ApiCredential | null;
424
- membership?: Membership | null;
425
- membership_profile?: MembershipProfile | null;
426
- organization?: Organization | null;
427
- role?: Role | null;
428
- }
429
- interface ApplicationMembershipCreate extends ResourceCreate {
430
- /**
431
- * Set of key-value pairs that contains restrictions and scopes of the application membership.
432
- * @example ```{"market_id_in":[202,203]}```
433
- */
434
- filters?: Record<string, any> | null;
435
- api_credential: ApiCredentialRel$1;
436
- membership?: MembershipRel$1 | null;
437
- membership_profile?: MembershipProfileRel$1 | null;
438
- organization: OrganizationRel$3;
439
- role: RoleRel$2;
440
- }
441
- interface ApplicationMembershipUpdate extends ResourceUpdate {
442
- /**
443
- * Set of key-value pairs that contains restrictions and scopes of the application membership.
444
- * @example ```{"market_id_in":[202,203]}```
445
- */
446
- filters?: Record<string, any> | null;
447
- membership_profile?: MembershipProfileRel$1 | null;
448
- role?: RoleRel$2 | null;
449
- }
450
- declare class ApplicationMemberships extends ApiResource<ApplicationMembership> {
451
- static readonly TYPE: ApplicationMembershipType;
452
- create(resource: ApplicationMembershipCreate, params?: QueryParamsRetrieve<ApplicationMembership>, options?: ResourcesConfig): Promise<ApplicationMembership>;
453
- update(resource: ApplicationMembershipUpdate, params?: QueryParamsRetrieve<ApplicationMembership>, options?: ResourcesConfig): Promise<ApplicationMembership>;
454
- delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void>;
455
- api_credential(applicationMembershipId: string | ApplicationMembership, params?: QueryParamsRetrieve<ApiCredential>, options?: ResourcesConfig): Promise<ApiCredential>;
456
- membership(applicationMembershipId: string | ApplicationMembership, params?: QueryParamsRetrieve<Membership>, options?: ResourcesConfig): Promise<Membership>;
457
- membership_profile(applicationMembershipId: string | ApplicationMembership, params?: QueryParamsRetrieve<MembershipProfile>, options?: ResourcesConfig): Promise<MembershipProfile>;
458
- organization(applicationMembershipId: string | ApplicationMembership, params?: QueryParamsRetrieve<Organization>, options?: ResourcesConfig): Promise<Organization>;
459
- role(applicationMembershipId: string | ApplicationMembership, params?: QueryParamsRetrieve<Role>, options?: ResourcesConfig): Promise<Role>;
460
- isApplicationMembership(resource: any): resource is ApplicationMembership;
461
- relationship(id: string | ResourceId | null): ApplicationMembershipRel$1;
462
- relationshipToMany(...ids: string[]): ApplicationMembershipRel$1[];
463
- type(): ApplicationMembershipType;
464
- }
465
- declare const instance$5: ApplicationMemberships;
466
-
467
- type MembershipType = 'memberships';
468
- type MembershipRel = ResourceRel & {
469
- type: MembershipType;
470
- };
471
- type OrganizationRel$2 = ResourceRel & {
472
- type: OrganizationType;
473
- };
474
- type RoleRel$1 = ResourceRel & {
475
- type: RoleType;
476
- };
477
- type ApplicationMembershipRel = ResourceRel & {
459
+ type ApplicationMembershipRel$2 = ResourceRel & {
478
460
  type: ApplicationMembershipType;
479
461
  };
480
- type MembershipProfileRel = ResourceRel & {
462
+ type MembershipProfileRel$2 = ResourceRel & {
481
463
  type: MembershipProfileType;
482
464
  };
483
465
  type MembershipSort = Pick<Membership, 'id' | 'status'> & ResourceSort;
@@ -540,10 +522,10 @@ interface MembershipCreate extends ResourceCreate {
540
522
  * @example ```"live_access"```
541
523
  */
542
524
  access_scope?: 'live_access' | 'test_access' | 'all_access' | null;
543
- organization: OrganizationRel$2;
544
- role: RoleRel$1;
545
- application_memberships?: ApplicationMembershipRel[] | null;
546
- membership_profile?: MembershipProfileRel | null;
525
+ organization: OrganizationRel$4;
526
+ role: RoleRel$2;
527
+ application_memberships?: ApplicationMembershipRel$2[] | null;
528
+ membership_profile?: MembershipProfileRel$2 | null;
547
529
  }
548
530
  interface MembershipUpdate extends ResourceUpdate {
549
531
  /**
@@ -551,9 +533,9 @@ interface MembershipUpdate extends ResourceUpdate {
551
533
  * @example ```"live_access"```
552
534
  */
553
535
  access_scope?: 'live_access' | 'test_access' | 'all_access' | null;
554
- role?: RoleRel$1 | null;
555
- application_memberships?: ApplicationMembershipRel[] | null;
556
- membership_profile?: MembershipProfileRel | null;
536
+ role?: RoleRel$2 | null;
537
+ application_memberships?: ApplicationMembershipRel$2[] | null;
538
+ membership_profile?: MembershipProfileRel$2 | null;
557
539
  }
558
540
  declare class Memberships extends ApiResource<Membership> {
559
541
  static readonly TYPE: MembershipType;
@@ -567,14 +549,14 @@ declare class Memberships extends ApiResource<Membership> {
567
549
  versions(membershipId: string | Membership, params?: QueryParamsList<Version>, options?: ResourcesConfig): Promise<ListResponse<Version>>;
568
550
  resend(membershipId: string | Membership, options?: ResourcesConfig): Promise<void>;
569
551
  isMembership(resource: any): resource is Membership;
570
- relationship(id: string | ResourceId | null): MembershipRel;
571
- relationshipToMany(...ids: string[]): MembershipRel[];
552
+ relationship(id: string | ResourceId | null): MembershipRel$1;
553
+ relationshipToMany(...ids: string[]): MembershipRel$1[];
572
554
  type(): MembershipType;
573
555
  }
574
- declare const instance$4: Memberships;
556
+ declare const instance$6: Memberships;
575
557
 
576
558
  type OrganizationType = 'organizations';
577
- type OrganizationRel$1 = ResourceRel & {
559
+ type OrganizationRel$3 = ResourceRel & {
578
560
  type: OrganizationType;
579
561
  };
580
562
  type OrganizationSort = Pick<Organization, 'id' | 'name' | 'slug' | 'domain'> & ResourceSort;
@@ -1007,146 +989,164 @@ declare class Organizations extends ApiResource<Organization> {
1007
989
  api_credentials(organizationId: string | Organization, params?: QueryParamsList<ApiCredential>, options?: ResourcesConfig): Promise<ListResponse<ApiCredential>>;
1008
990
  transfer_ownership(organizationId: string | Organization, payload: TransferOwnershipDataType, options?: ResourcesConfig): Promise<void>;
1009
991
  isOrganization(resource: any): resource is Organization;
1010
- relationship(id: string | ResourceId | null): OrganizationRel$1;
1011
- relationshipToMany(...ids: string[]): OrganizationRel$1[];
992
+ relationship(id: string | ResourceId | null): OrganizationRel$3;
993
+ relationshipToMany(...ids: string[]): OrganizationRel$3[];
1012
994
  type(): OrganizationType;
1013
995
  }
1014
- declare const instance$3: Organizations;
996
+ declare const instance$5: Organizations;
1015
997
 
1016
- type ApiCredentialType = 'api_credentials';
1017
- type ApiCredentialRel = ResourceRel & {
1018
- type: ApiCredentialType;
998
+ type MembershipProfileType = 'membership_profiles';
999
+ type MembershipProfileRel$1 = ResourceRel & {
1000
+ type: MembershipProfileType;
1019
1001
  };
1020
- type OrganizationRel = ResourceRel & {
1002
+ type OrganizationRel$2 = ResourceRel & {
1021
1003
  type: OrganizationType;
1022
1004
  };
1023
- type RoleRel = ResourceRel & {
1024
- type: RoleType;
1005
+ type ApplicationMembershipRel$1 = ResourceRel & {
1006
+ type: ApplicationMembershipType;
1025
1007
  };
1026
- type ApiCredentialSort = Pick<ApiCredential, 'id' | 'name' | 'mode'> & ResourceSort;
1008
+ type MembershipProfileSort = Pick<MembershipProfile, 'id' | 'name'> & ResourceSort;
1027
1009
  /**
1028
- * 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.
1010
+ * The Membership profile object is returned as part of the response body of each successful list, retrieve, create, update or delete API call to the /api/membership_profiles endpoint.
1029
1011
  *
1030
- * @link https://docs.commercelayer.io/provisioning-api-reference/api_credentials/object
1012
+ * @link https://docs.commercelayer.io/provisioning-api-reference/membership_profiles/object
1031
1013
  */
1032
- interface ApiCredential extends Resource {
1033
- readonly type: ApiCredentialType;
1014
+ interface MembershipProfile extends Resource {
1015
+ readonly type: MembershipProfileType;
1034
1016
  /**
1035
- * The API credential internal name.
1036
- * @example ```"My app"```
1017
+ * The membership profile name.
1018
+ * @example ```"Marketing group"```
1037
1019
  */
1038
1020
  name: string;
1039
1021
  /**
1040
- * 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.).
1041
- * @example ```"sales_channel"```
1042
- */
1043
- kind: string;
1044
- /**
1045
- * Indicates if the API credential it's confidential.
1022
+ * Reflects the organization's access scope, either test_access or all_access.
1046
1023
  * @example ```true```
1047
1024
  */
1048
- confidential?: boolean | null;
1049
- /**
1050
- * The API credential redirect URI.
1051
- * @example ```"https://bluebrand.com/img/logo.svg"```
1052
- */
1053
- redirect_uri?: string | null;
1054
- /**
1055
- * The API credential unique ID.
1056
- * @example ```"xxxx-yyyy-zzzz"```
1057
- */
1058
- client_id?: string | null;
1059
- /**
1060
- * The API credential unique secret.
1061
- * @example ```"xxxx-yyyy-zzzz"```
1062
- */
1063
- client_secret?: string | null;
1064
- /**
1065
- * The API credential scopes.
1066
- * @example ```"market:all market:9 market:122 market:6 stock_location:6 stock_location:33"```
1067
- */
1068
- scopes?: string | null;
1069
- /**
1070
- * The lifetime of the access token in seconds (min. `7200`, max. `31536000`. Default is `14400` for Sales channels and `7200` for other client types).
1071
- * @example ```7200```
1072
- */
1073
- expires_in?: number | null;
1074
- /**
1075
- * Indicates the environment the resource belongs to (one of `test` or `live`).
1076
- * @example ```"test"```
1077
- */
1078
- mode?: string | null;
1025
+ test_enabled?: boolean | null;
1079
1026
  /**
1080
- * Indicates if the API credential is used to create a custom app (e.g. fork a hosted app).
1027
+ * The access scope for applications. One of `live_access` (default), `test_access`, `all_access`.
1028
+ * @example ```"live_access"```
1081
1029
  */
1082
- custom?: boolean | null;
1030
+ access_scope: 'live_access' | 'test_access' | 'all_access';
1083
1031
  organization?: Organization | null;
1084
- role?: Role | null;
1032
+ application_memberships?: ApplicationMembership[] | null;
1085
1033
  }
1086
- interface ApiCredentialCreate extends ResourceCreate {
1034
+ interface MembershipProfileCreate extends ResourceCreate {
1087
1035
  /**
1088
- * The API credential internal name.
1089
- * @example ```"My app"```
1036
+ * The membership profile name.
1037
+ * @example ```"Marketing group"```
1090
1038
  */
1091
1039
  name: string;
1092
1040
  /**
1093
- * 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.).
1094
- * @example ```"sales_channel"```
1041
+ * The access scope for applications. One of `live_access` (default), `test_access`, `all_access`.
1042
+ * @example ```"live_access"```
1095
1043
  */
1096
- kind: string;
1044
+ access_scope: 'live_access' | 'test_access' | 'all_access';
1045
+ organization: OrganizationRel$2;
1046
+ application_memberships?: ApplicationMembershipRel$1[] | null;
1047
+ }
1048
+ interface MembershipProfileUpdate extends ResourceUpdate {
1097
1049
  /**
1098
- * The API credential redirect URI.
1099
- * @example ```"https://bluebrand.com/img/logo.svg"```
1050
+ * The membership profile name.
1051
+ * @example ```"Marketing group"```
1100
1052
  */
1101
- redirect_uri?: string | null;
1053
+ name?: string | null;
1102
1054
  /**
1103
- * The lifetime of the access token in seconds (min. `7200`, max. `31536000`. Default is `14400` for Sales channels and `7200` for other client types).
1104
- * @example ```7200```
1105
- */
1106
- expires_in?: number | null;
1107
- /**
1108
- * Indicates the environment the resource belongs to (one of `test` or `live`).
1109
- * @example ```"test"```
1110
- */
1111
- mode?: string | null;
1112
- /**
1113
- * Indicates if the API credential is used to create a custom app (e.g. fork a hosted app).
1055
+ * The access scope for applications. One of `live_access` (default), `test_access`, `all_access`.
1056
+ * @example ```"live_access"```
1114
1057
  */
1115
- custom?: boolean | null;
1116
- organization: OrganizationRel;
1117
- role?: RoleRel | null;
1058
+ access_scope?: 'live_access' | 'test_access' | 'all_access' | null;
1059
+ application_memberships?: ApplicationMembershipRel$1[] | null;
1118
1060
  }
1119
- interface ApiCredentialUpdate extends ResourceUpdate {
1061
+ declare class MembershipProfiles extends ApiResource<MembershipProfile> {
1062
+ static readonly TYPE: MembershipProfileType;
1063
+ create(resource: MembershipProfileCreate, params?: QueryParamsRetrieve<MembershipProfile>, options?: ResourcesConfig): Promise<MembershipProfile>;
1064
+ update(resource: MembershipProfileUpdate, params?: QueryParamsRetrieve<MembershipProfile>, options?: ResourcesConfig): Promise<MembershipProfile>;
1065
+ delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void>;
1066
+ organization(membershipProfileId: string | MembershipProfile, params?: QueryParamsRetrieve<Organization>, options?: ResourcesConfig): Promise<Organization>;
1067
+ application_memberships(membershipProfileId: string | MembershipProfile, params?: QueryParamsList<ApplicationMembership>, options?: ResourcesConfig): Promise<ListResponse<ApplicationMembership>>;
1068
+ isMembershipProfile(resource: any): resource is MembershipProfile;
1069
+ relationship(id: string | ResourceId | null): MembershipProfileRel$1;
1070
+ relationshipToMany(...ids: string[]): MembershipProfileRel$1[];
1071
+ type(): MembershipProfileType;
1072
+ }
1073
+ declare const instance$4: MembershipProfiles;
1074
+
1075
+ type ApplicationMembershipType = 'application_memberships';
1076
+ type ApplicationMembershipRel = ResourceRel & {
1077
+ type: ApplicationMembershipType;
1078
+ };
1079
+ type ApiCredentialRel$1 = ResourceRel & {
1080
+ type: ApiCredentialType;
1081
+ };
1082
+ type MembershipRel = ResourceRel & {
1083
+ type: MembershipType;
1084
+ };
1085
+ type MembershipProfileRel = ResourceRel & {
1086
+ type: MembershipProfileType;
1087
+ };
1088
+ type OrganizationRel$1 = ResourceRel & {
1089
+ type: OrganizationType;
1090
+ };
1091
+ type RoleRel$1 = ResourceRel & {
1092
+ type: RoleType;
1093
+ };
1094
+ type ApplicationMembershipSort = Pick<ApplicationMembership, 'id'> & ResourceSort;
1095
+ /**
1096
+ * 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.
1097
+ *
1098
+ * @link https://docs.commercelayer.io/provisioning-api-reference/application_memberships/object
1099
+ */
1100
+ interface ApplicationMembership extends Resource {
1101
+ readonly type: ApplicationMembershipType;
1120
1102
  /**
1121
- * The API credential internal name.
1122
- * @example ```"My app"```
1103
+ * Set of key-value pairs that contains restrictions and scopes of the application membership.
1104
+ * @example ```{"market_id_in":[202,203]}```
1123
1105
  */
1124
- name?: string | null;
1106
+ filters?: Record<string, any> | null;
1107
+ api_credential?: ApiCredential | null;
1108
+ membership?: Membership | null;
1109
+ membership_profile?: MembershipProfile | null;
1110
+ organization?: Organization | null;
1111
+ role?: Role | null;
1112
+ }
1113
+ interface ApplicationMembershipCreate extends ResourceCreate {
1125
1114
  /**
1126
- * The API credential redirect URI.
1127
- * @example ```"https://bluebrand.com/img/logo.svg"```
1115
+ * Set of key-value pairs that contains restrictions and scopes of the application membership.
1116
+ * @example ```{"market_id_in":[202,203]}```
1128
1117
  */
1129
- redirect_uri?: string | null;
1118
+ filters?: Record<string, any> | null;
1119
+ api_credential: ApiCredentialRel$1;
1120
+ membership?: MembershipRel | null;
1121
+ membership_profile?: MembershipProfileRel | null;
1122
+ organization: OrganizationRel$1;
1123
+ role: RoleRel$1;
1124
+ }
1125
+ interface ApplicationMembershipUpdate extends ResourceUpdate {
1130
1126
  /**
1131
- * The lifetime of the access token in seconds (min. `7200`, max. `31536000`. Default is `14400` for Sales channels and `7200` for other client types).
1132
- * @example ```7200```
1127
+ * Set of key-value pairs that contains restrictions and scopes of the application membership.
1128
+ * @example ```{"market_id_in":[202,203]}```
1133
1129
  */
1134
- expires_in?: number | null;
1135
- role?: RoleRel | null;
1130
+ filters?: Record<string, any> | null;
1131
+ membership_profile?: MembershipProfileRel | null;
1132
+ role?: RoleRel$1 | null;
1136
1133
  }
1137
- declare class ApiCredentials extends ApiResource<ApiCredential> {
1138
- static readonly TYPE: ApiCredentialType;
1139
- create(resource: ApiCredentialCreate, params?: QueryParamsRetrieve<ApiCredential>, options?: ResourcesConfig): Promise<ApiCredential>;
1140
- update(resource: ApiCredentialUpdate, params?: QueryParamsRetrieve<ApiCredential>, options?: ResourcesConfig): Promise<ApiCredential>;
1134
+ declare class ApplicationMemberships extends ApiResource<ApplicationMembership> {
1135
+ static readonly TYPE: ApplicationMembershipType;
1136
+ create(resource: ApplicationMembershipCreate, params?: QueryParamsRetrieve<ApplicationMembership>, options?: ResourcesConfig): Promise<ApplicationMembership>;
1137
+ update(resource: ApplicationMembershipUpdate, params?: QueryParamsRetrieve<ApplicationMembership>, options?: ResourcesConfig): Promise<ApplicationMembership>;
1141
1138
  delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void>;
1142
- organization(apiCredentialId: string | ApiCredential, params?: QueryParamsRetrieve<Organization>, options?: ResourcesConfig): Promise<Organization>;
1143
- role(apiCredentialId: string | ApiCredential, params?: QueryParamsRetrieve<Role>, options?: ResourcesConfig): Promise<Role>;
1144
- isApiCredential(resource: any): resource is ApiCredential;
1145
- relationship(id: string | ResourceId | null): ApiCredentialRel;
1146
- relationshipToMany(...ids: string[]): ApiCredentialRel[];
1147
- type(): ApiCredentialType;
1139
+ api_credential(applicationMembershipId: string | ApplicationMembership, params?: QueryParamsRetrieve<ApiCredential>, options?: ResourcesConfig): Promise<ApiCredential>;
1140
+ membership(applicationMembershipId: string | ApplicationMembership, params?: QueryParamsRetrieve<Membership>, options?: ResourcesConfig): Promise<Membership>;
1141
+ membership_profile(applicationMembershipId: string | ApplicationMembership, params?: QueryParamsRetrieve<MembershipProfile>, options?: ResourcesConfig): Promise<MembershipProfile>;
1142
+ organization(applicationMembershipId: string | ApplicationMembership, params?: QueryParamsRetrieve<Organization>, options?: ResourcesConfig): Promise<Organization>;
1143
+ role(applicationMembershipId: string | ApplicationMembership, params?: QueryParamsRetrieve<Role>, options?: ResourcesConfig): Promise<Role>;
1144
+ isApplicationMembership(resource: any): resource is ApplicationMembership;
1145
+ relationship(id: string | ResourceId | null): ApplicationMembershipRel;
1146
+ relationshipToMany(...ids: string[]): ApplicationMembershipRel[];
1147
+ type(): ApplicationMembershipType;
1148
1148
  }
1149
- declare const instance$2: ApiCredentials;
1149
+ declare const instance$3: ApplicationMemberships;
1150
1150
 
1151
1151
  type UserType = 'users';
1152
1152
  type UserRel = ResourceRel & {
@@ -1217,7 +1217,7 @@ declare class Users extends ApiSingleton<User> {
1217
1217
  type(): UserType;
1218
1218
  path(): string;
1219
1219
  }
1220
- declare const instance$1: Users;
1220
+ declare const instance$2: Users;
1221
1221
 
1222
1222
  type IdentityProviderType = 'identity_providers';
1223
1223
  type IdentityProviderRel = ResourceRel & {
@@ -1420,7 +1420,7 @@ declare class IdentityProviders extends ApiResource<IdentityProvider> {
1420
1420
  relationshipToMany(...ids: string[]): IdentityProviderRel[];
1421
1421
  type(): IdentityProviderType;
1422
1422
  }
1423
- declare const instance: IdentityProviders;
1423
+ declare const instance$1: IdentityProviders;
1424
1424
 
1425
1425
  declare const apiResources: readonly ["api_credentials", "application_memberships", "identity_providers", "memberships", "membership_profiles", "organizations", "permissions", "roles", "users", "versions"];
1426
1426
  type ResourceTypeLock = (typeof apiResources)[number];
@@ -1480,164 +1480,181 @@ type ResourceSortFields = {
1480
1480
  versions: VersionSort;
1481
1481
  };
1482
1482
 
1483
- type RequestParams = Record<string, string | number | boolean>;
1484
- type RequestHeaders = Record<string, string>;
1485
- type RefreshToken = (expiredToken: string) => Promise<string>;
1486
- type RequestConfig = {
1487
- timeout?: number;
1488
- params?: RequestParams;
1489
- headers?: RequestHeaders;
1490
- userAgent?: string;
1491
- fetch?: Fetch;
1492
- refreshToken?: RefreshToken;
1493
- telemetry?: boolean;
1494
- };
1495
- type ApiConfig = {
1496
- organization?: string;
1497
- domain?: string;
1498
- accessToken: string;
1499
- apiVersion?: string;
1483
+ type QueryResType<T extends Resource> = T['type'];
1484
+ type QueryInclude = string[];
1485
+ type QueryResourceFields<R extends ResourceTypeLock> = keyof ResourceFields[R];
1486
+ type QueryArrayFields<R extends Resource> = Array<QueryResourceFields<QueryResType<R>>>;
1487
+ type QueryRecordFields = {
1488
+ [key in keyof ResourceFields]?: Array<QueryResourceFields<key>>;
1500
1489
  };
1501
- type ApiClientInitConfig = ApiConfig & RequestConfig;
1502
- type ApiClientConfig = Partial<ApiClientInitConfig>;
1503
- type Method = 'GET' | 'DELETE' | 'POST' | 'PUT' | 'PATCH';
1504
- declare class ApiClient {
1505
- #private;
1506
- static create(options: ApiClientInitConfig): ApiClient;
1507
- private constructor();
1508
- get interceptors(): InterceptorManager;
1509
- get requestHeaders(): RequestHeaders;
1510
- config(config: ApiClientConfig): this;
1511
- userAgent(userAgent: string): this;
1512
- request(method: Method, path: string, body?: any, options?: ApiClientConfig): Promise<FetchResponse>;
1513
- private customHeaders;
1514
- get currentAccessToken(): string;
1515
- get currentOrganization(): string;
1516
- /** The API version pinned via `apiVersion`, or `undefined` when requests are unversioned. */
1517
- get currentApiVersion(): string | undefined;
1518
- }
1519
-
1520
- type ResourceNull = {
1521
- id: null;
1522
- } & ResourceType;
1523
- type ResourceRel = ResourceId | ResourceNull;
1524
- type Metadata = ObjectType;
1525
- interface ResourceType {
1526
- readonly type: ResourceTypeLock;
1527
- }
1528
- interface ResourceId extends ResourceType {
1529
- readonly id: string;
1530
- }
1531
- interface ResourceBase {
1532
- reference?: string | null;
1533
- reference_origin?: string | null;
1534
- metadata?: Metadata;
1535
- }
1536
- interface Resource extends ResourceBase, ResourceId {
1537
- readonly created_at: string;
1538
- readonly updated_at: string;
1539
- }
1540
- interface ResourceCreate extends ResourceBase {
1541
- }
1542
- interface ResourceUpdate extends ResourceBase {
1543
- readonly id: string;
1490
+ type QueryFields<R extends Resource> = QueryArrayFields<R> | QueryRecordFields;
1491
+ interface QueryParamsRetrieve<R extends Resource = Resource> {
1492
+ include?: QueryInclude;
1493
+ fields?: QueryFields<R>;
1544
1494
  }
1545
- /**
1546
- * Update payload for a singleton resource, which carries no `id` because it is
1547
- * addressed at a singular path (`/user`, not `/users/{id}`). Distinct from
1548
- * `ResourceUpdate` purely to keep `id` off the caller's payload.
1549
- */
1550
- interface SingletonUpdate extends ResourceBase {
1495
+ type QuerySortType = 'asc' | 'desc';
1496
+ type QueryResourceSortable<R extends Resource> = ResourceSortFields[QueryResType<R>];
1497
+ type QueryResourceSortableFields<R extends Resource> = StringKey<QueryResourceSortable<R>>;
1498
+ type QueryArraySortable<R extends Resource> = Array<QueryResourceSortableFields<R> | `-${QueryResourceSortableFields<R>}`>;
1499
+ type QueryRecordSortable<R extends Resource> = Partial<Record<keyof QueryResourceSortable<R>, QuerySortType>>;
1500
+ type QuerySort<R extends Resource> = QueryArraySortable<R> | QueryRecordSortable<R>;
1501
+ type QueryFilter = Record<string, string | number | boolean | object | Array<string | number>>;
1502
+ type QueryPageNumber = number;
1503
+ type QueryPageSize = PositiveNumberRange<25>;
1504
+ type QueryPageCursor = string;
1505
+ interface QueryParamsList<R extends Resource = Resource> extends QueryParamsRetrieve<R> {
1506
+ sort?: QuerySort<R>;
1507
+ filters?: QueryFilter;
1508
+ pageNumber?: QueryPageNumber;
1509
+ pageSize?: QueryPageSize;
1510
+ /**
1511
+ * Cursor for cursor-based pagination — returns the records after the given cursor.
1512
+ * Only cursor-paginated resources (e.g. `event_stores`) honor it; offset-paginated
1513
+ * resources ignore it. Emitted as the `page[after]` query parameter.
1514
+ */
1515
+ pageAfter?: QueryPageCursor;
1516
+ /**
1517
+ * Cursor for cursor-based pagination — returns the records before the given cursor.
1518
+ * Only cursor-paginated resources honor it; offset-paginated resources ignore it.
1519
+ * Emitted as the `page[before]` query parameter.
1520
+ */
1521
+ pageBefore?: QueryPageCursor;
1551
1522
  }
1552
- type PageCursor = {
1553
- readonly before?: string;
1554
- readonly after?: string;
1523
+ type QueryParams<R extends Resource = Resource> = QueryParamsRetrieve<R> | QueryParamsList<R>;
1524
+
1525
+ type ApiCredentialType = 'api_credentials';
1526
+ type ApiCredentialRel = ResourceRel & {
1527
+ type: ApiCredentialType;
1555
1528
  };
1556
- type ListMeta = {
1557
- readonly pageCount: number;
1558
- readonly recordCount: number;
1559
- readonly currentPage: number;
1560
- readonly recordsPerPage: number;
1561
- readonly cursor?: {
1562
- readonly prev?: PageCursor;
1563
- readonly next?: PageCursor;
1564
- };
1529
+ type OrganizationRel = ResourceRel & {
1530
+ type: OrganizationType;
1565
1531
  };
1566
- declare class ListResponse<R extends Resource = Resource> extends Array<R> {
1567
- readonly meta: ListMeta;
1568
- constructor(meta: ListMeta, data: R[]);
1569
- first(): R | undefined;
1570
- last(): R | undefined;
1571
- get(index: number): R | undefined;
1572
- hasNextPage(): boolean;
1573
- hasPrevPage(): boolean;
1574
- getRecordCount(): number;
1575
- getPageCount(): number;
1576
- get recordCount(): number;
1577
- get pageCount(): number;
1578
- }
1579
-
1580
- type ResourceSort = Pick<Resource, 'id' | 'reference' | 'reference_origin' | 'created_at' | 'updated_at'>;
1581
- type ResourceFilter = Pick<Resource, 'id' | 'reference' | 'reference_origin' | 'metadata' | 'created_at' | 'updated_at'>;
1582
- type ResourceAdapterConfig = {};
1583
- type ResourcesInitConfig = ResourceAdapterConfig & ApiClientInitConfig;
1584
- type ResourcesConfig = Partial<ResourcesInitConfig>;
1585
- declare class ResourceAdapter {
1586
- #private;
1587
- constructor(config: ResourcesInitConfig);
1588
- private localConfig;
1589
- config(config: ResourcesConfig): this;
1590
- get client(): Readonly<ApiClient>;
1591
- singleton<R extends Resource>(resource: ResourceType, params?: QueryParamsRetrieve<R>, options?: ResourcesConfig, path?: string): Promise<R>;
1592
- retrieve<R extends Resource>(resource: ResourceId, params?: QueryParamsRetrieve<R>, options?: ResourcesConfig): Promise<R>;
1593
- list<R extends Resource>(resource: ResourceType, params?: QueryParamsList<R>, options?: ResourcesConfig): Promise<ListResponse<R>>;
1594
- create<C extends ResourceCreate, R extends Resource>(resource: C & ResourceType, params?: QueryParamsRetrieve<R>, options?: ResourcesConfig): Promise<R>;
1595
- update<U extends ResourceUpdate | SingletonUpdate, R extends Resource>(resource: U & ResourceType, params?: QueryParamsRetrieve<R>, options?: ResourcesConfig,
1532
+ type RoleRel = ResourceRel & {
1533
+ type: RoleType;
1534
+ };
1535
+ type ApiCredentialSort = Pick<ApiCredential, 'id' | 'name' | 'mode'> & ResourceSort;
1536
+ /**
1537
+ * 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.
1538
+ *
1539
+ * @link https://docs.commercelayer.io/provisioning-api-reference/api_credentials/object
1540
+ */
1541
+ interface ApiCredential extends Resource {
1542
+ readonly type: ApiCredentialType;
1596
1543
  /**
1597
- * Singular path override for singleton resources, e.g. `user` rather than
1598
- * `users/{id}`. Mirrors `singleton()` above. Core never needed it — both
1599
- * its singletons are retrieve-only — but the Provisioning API's `user` is
1600
- * updatable, and without this the request targets `/users/{id}` and 404s.
1544
+ * The API credential internal name.
1545
+ * @example ```"My app"```
1601
1546
  */
1602
- path?: string): Promise<R>;
1603
- delete(resource: ResourceId, options?: ResourcesConfig): Promise<void>;
1547
+ name: string;
1604
1548
  /**
1605
- * Calls a non-CRUD endpoint hosted at a sub-path of a resource, e.g.
1606
- * `POST memberships/:id/resend`. These endpoints are not described by the
1607
- * public resources schema, so they are declared in a target config and
1608
- * emitted from it.
1549
+ * 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.).
1550
+ * @example ```"sales_channel"```
1609
1551
  */
1610
- action(cmd: Extract<Method, 'POST' | 'PATCH'>, path: string, payload?: any, options?: ResourcesConfig): Promise<void>;
1611
- fetch<R extends Resource>(resource: string | ResourceType, path: string, params?: QueryParams<R>, options?: ResourcesConfig): Promise<R | ListResponse<R>>;
1552
+ kind: string;
1553
+ /**
1554
+ * Indicates if the API credential it's confidential.
1555
+ * @example ```true```
1556
+ */
1557
+ confidential?: boolean | null;
1558
+ /**
1559
+ * The API credential redirect URI.
1560
+ * @example ```"https://bluebrand.com/img/logo.svg"```
1561
+ */
1562
+ redirect_uri?: string | null;
1563
+ /**
1564
+ * The API credential unique ID.
1565
+ * @example ```"xxxx-yyyy-zzzz"```
1566
+ */
1567
+ client_id?: string | null;
1568
+ /**
1569
+ * The API credential unique secret.
1570
+ * @example ```"xxxx-yyyy-zzzz"```
1571
+ */
1572
+ client_secret?: string | null;
1573
+ /**
1574
+ * The API credential scopes.
1575
+ * @example ```"market:all market:9 market:122 market:6 stock_location:6 stock_location:33"```
1576
+ */
1577
+ scopes?: string | null;
1578
+ /**
1579
+ * The lifetime of the access token in seconds (min. `7200`, max. `31536000`. Default is `14400` for Sales channels and `7200` for other client types).
1580
+ * @example ```7200```
1581
+ */
1582
+ expires_in?: number | null;
1583
+ /**
1584
+ * Indicates the environment the resource belongs to (one of `test` or `live`).
1585
+ * @example ```"test"```
1586
+ */
1587
+ mode?: string | null;
1588
+ /**
1589
+ * Indicates if the API credential is used to create a custom app (e.g. fork a hosted app).
1590
+ */
1591
+ custom?: boolean | null;
1592
+ organization?: Organization | null;
1593
+ role?: Role | null;
1612
1594
  }
1613
- declare abstract class ApiResourceBase<R extends Resource> {
1614
- #private;
1615
- static readonly TYPE: ResourceTypeLock;
1616
- constructor(adapter?: ResourceAdapter);
1617
- protected get resources(): ResourceAdapter;
1595
+ interface ApiCredentialCreate extends ResourceCreate {
1618
1596
  /**
1619
- * Returns a copy of this resource instance bound to a specific
1620
- * `ResourceAdapter`. Used by the bundle client so each client instance
1621
- * routes requests through its own adapter (its own access token) instead
1622
- * of the process-global static adapter. Resource classes are type-only
1623
- * exports, so we clone via `this.constructor` rather than referencing the
1624
- * class directly.
1597
+ * The API credential internal name.
1598
+ * @example ```"My app"```
1625
1599
  */
1626
- withAdapter(adapter: ResourceAdapter): this;
1627
- abstract relationship(id: string | ResourceId | null): ResourceRel;
1628
- protected relationshipOneToOne<RR extends ResourceRel>(id: string | ResourceId | null): RR;
1629
- protected relationshipOneToMany<RR extends ResourceRel>(...ids: string[]): RR[];
1630
- abstract type(): ResourceTypeLock;
1631
- protected path(): string;
1632
- update(resource: ResourceUpdate, params?: QueryParamsRetrieve<R>, options?: ResourcesConfig): Promise<R>;
1600
+ name: string;
1601
+ /**
1602
+ * 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.).
1603
+ * @example ```"sales_channel"```
1604
+ */
1605
+ kind: string;
1606
+ /**
1607
+ * The API credential redirect URI.
1608
+ * @example ```"https://bluebrand.com/img/logo.svg"```
1609
+ */
1610
+ redirect_uri?: string | null;
1611
+ /**
1612
+ * The lifetime of the access token in seconds (min. `7200`, max. `31536000`. Default is `14400` for Sales channels and `7200` for other client types).
1613
+ * @example ```7200```
1614
+ */
1615
+ expires_in?: number | null;
1616
+ /**
1617
+ * Indicates the environment the resource belongs to (one of `test` or `live`).
1618
+ * @example ```"test"```
1619
+ */
1620
+ mode?: string | null;
1621
+ /**
1622
+ * Indicates if the API credential is used to create a custom app (e.g. fork a hosted app).
1623
+ */
1624
+ custom?: boolean | null;
1625
+ organization: OrganizationRel;
1626
+ role?: RoleRel | null;
1633
1627
  }
1634
- declare abstract class ApiResource<R extends Resource> extends ApiResourceBase<R> {
1635
- retrieve(id: string | ResourceId, params?: QueryParamsRetrieve<R>, options?: ResourcesConfig): Promise<R>;
1636
- list(params?: QueryParamsList<R>, options?: ResourcesConfig): Promise<ListResponse<R>>;
1637
- count(filter?: QueryFilter | QueryParamsList<R>, options?: ResourcesConfig): Promise<number>;
1628
+ interface ApiCredentialUpdate extends ResourceUpdate {
1629
+ /**
1630
+ * The API credential internal name.
1631
+ * @example ```"My app"```
1632
+ */
1633
+ name?: string | null;
1634
+ /**
1635
+ * The API credential redirect URI.
1636
+ * @example ```"https://bluebrand.com/img/logo.svg"```
1637
+ */
1638
+ redirect_uri?: string | null;
1639
+ /**
1640
+ * The lifetime of the access token in seconds (min. `7200`, max. `31536000`. Default is `14400` for Sales channels and `7200` for other client types).
1641
+ * @example ```7200```
1642
+ */
1643
+ expires_in?: number | null;
1644
+ role?: RoleRel | null;
1638
1645
  }
1639
- declare abstract class ApiSingleton<R extends Resource> extends ApiResourceBase<R> {
1640
- retrieve(params?: QueryParamsRetrieve<R>, options?: ResourcesConfig): Promise<R>;
1646
+ declare class ApiCredentials extends ApiResource<ApiCredential> {
1647
+ static readonly TYPE: ApiCredentialType;
1648
+ create(resource: ApiCredentialCreate, params?: QueryParamsRetrieve<ApiCredential>, options?: ResourcesConfig): Promise<ApiCredential>;
1649
+ update(resource: ApiCredentialUpdate, params?: QueryParamsRetrieve<ApiCredential>, options?: ResourcesConfig): Promise<ApiCredential>;
1650
+ delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void>;
1651
+ organization(apiCredentialId: string | ApiCredential, params?: QueryParamsRetrieve<Organization>, options?: ResourcesConfig): Promise<Organization>;
1652
+ role(apiCredentialId: string | ApiCredential, params?: QueryParamsRetrieve<Role>, options?: ResourcesConfig): Promise<Role>;
1653
+ isApiCredential(resource: any): resource is ApiCredential;
1654
+ relationship(id: string | ResourceId | null): ApiCredentialRel;
1655
+ relationshipToMany(...ids: string[]): ApiCredentialRel[];
1656
+ type(): ApiCredentialType;
1641
1657
  }
1658
+ declare const instance: ApiCredentials;
1642
1659
 
1643
- export { type QueryPageSize as $, type ApiCredential as A, type MembershipSort as B, type CreatableResource as C, type DeletableResource as D, type ErrorObj as E, type MembershipUpdate as F, Memberships as G, type HeadersObj as H, type IdentityProvider as I, type Metadata as J, type OrganizationCreate as K, type ListMeta as L, type Membership as M, type OrganizationSort as N, type Organization as O, type OrganizationUpdate as P, Organizations as Q, type Permission as R, type PermissionCreate as S, type PermissionSort as T, type PermissionUpdate as U, Permissions as V, type QueryFields as W, type QueryFilter as X, type QueryInclude as Y, type QueryPageCursor as Z, type QueryPageNumber as _, type ApiCredentialCreate as a, type IdentityProviderType as a$, type QueryParams as a0, type QueryParamsList as a1, type QueryParamsRetrieve as a2, type QuerySort as a3, type RequestObj as a4, type Resource as a5, type ResourceCreate as a6, type ResourceFields as a7, type ResourceFilter as a8, type ResourceId as a9, resourceList as aA, singletonList as aB, getResources as aC, ResourceAdapter as aD, type RequestInterceptor as aE, type ErrorInterceptor as aF, type ResponseInterceptor as aG, type InterceptorType as aH, type RawResponseReader as aI, type MembershipProfileType as aJ, instance$9 as aK, type VersionType as aL, instance$8 as aM, type PermissionType as aN, instance$7 as aO, type RoleType as aP, instance$6 as aQ, type ApplicationMembershipType as aR, instance$5 as aS, type MembershipType as aT, instance$4 as aU, type OrganizationType as aV, instance$3 as aW, type ApiCredentialType as aX, instance$2 as aY, type UserType as aZ, instance$1 as a_, type ResourceRel as aa, type ResourceSort as ab, type ResourceSortFields as ac, type ResourceType as ad, type ResourceTypeLock as ae, type ResourceUpdate as af, type ResourcesConfig as ag, type ResourcesInitConfig as ah, type ResponseObj as ai, type RetrievableResource as aj, type RetrievableResourceType as ak, type Role as al, type RoleCreate as am, type RoleSort as an, type RoleUpdate as ao, Roles as ap, type SingletonUpdate as aq, type UpdatableResource as ar, type UpdatableResourceType as as, type User as at, type UserSort as au, type UserUpdate as av, Users as aw, type Version as ax, type VersionSort as ay, Versions as az, type ApiCredentialSort as b, instance as b0, creatableResources as b1, deletableResources as b2, getSingletons as b3, isCreatable as b4, isDeletable as b5, isSingleton as b6, isUpdatable as b7, updatableResources as b8, type ApiCredentialUpdate as c, ApiCredentials as d, ApiResource as e, ApiSingleton as f, type ApplicationMembership as g, type ApplicationMembershipCreate as h, type ApplicationMembershipSort as i, type ApplicationMembershipUpdate as j, ApplicationMemberships as k, type CreatableResourceType as l, type DeletableResourceType as m, type IdentityProviderCreate as n, type IdentityProviderSort as o, type IdentityProviderUpdate as p, IdentityProviders as q, ListResponse as r, type ListableResource as s, type ListableResourceType as t, type MembershipCreate as u, type MembershipProfile as v, type MembershipProfileCreate as w, type MembershipProfileSort as x, type MembershipProfileUpdate as y, MembershipProfiles as z };
1660
+ export { type QueryFilter as $, type ApiCredential as A, type MembershipProfileSort as B, type CreatableResource as C, type DeletableResource as D, type ErrorObj as E, type MembershipProfileUpdate as F, MembershipProfiles as G, type HeadersObj as H, type IdentityProvider as I, type MembershipSort as J, type MembershipUpdate as K, type ListMeta as L, type Membership as M, Memberships as N, type Metadata as O, type Organization as P, type OrganizationCreate as Q, type ResourceFields as R, type OrganizationSort as S, type OrganizationUpdate as T, Organizations as U, type Permission as V, type PermissionCreate as W, type PermissionSort as X, type PermissionUpdate as Y, Permissions as Z, type QueryFields as _, type ResourceSortFields as a, instance$1 as a$, type QueryInclude as a0, type QueryPageCursor as a1, type QueryPageNumber as a2, type QueryPageSize as a3, type QueryParams as a4, type QueryParamsList as a5, type QueryParamsRetrieve as a6, type QuerySort as a7, type RequestObj as a8, type Resource as a9, type VersionSort as aA, Versions as aB, resourceList as aC, singletonList as aD, ResourceAdapter as aE, type RequestInterceptor as aF, type ErrorInterceptor as aG, type ResponseInterceptor as aH, type InterceptorType as aI, type RawResponseReader as aJ, type VersionType as aK, instance$9 as aL, type PermissionType as aM, instance$8 as aN, type RoleType as aO, instance$7 as aP, type MembershipType as aQ, instance$6 as aR, type OrganizationType as aS, instance$5 as aT, type MembershipProfileType as aU, instance$4 as aV, type ApplicationMembershipType as aW, instance$3 as aX, type UserType as aY, instance$2 as aZ, type IdentityProviderType as a_, type ResourceCreate as aa, type ResourceFilter as ab, type ResourceId as ac, type ResourceMeta as ad, type ResourceRel as ae, type ResourceSort as af, type ResourceType as ag, type ResourceUpdate as ah, type ResourcesConfig as ai, type ResourcesInitConfig as aj, type ResponseObj as ak, type RetrievableResource as al, type RetrievableResourceType as am, type Role as an, type RoleCreate as ao, type RoleSort as ap, type RoleUpdate as aq, Roles as ar, type SingletonUpdate as as, type UpdatableResource as at, type UpdatableResourceType as au, type User as av, type UserSort as aw, type UserUpdate as ax, Users as ay, type Version as az, type ResourceTypeLock as b, creatableResources as b0, deletableResources as b1, getSingletons as b2, isCreatable as b3, isDeletable as b4, isSingleton as b5, isUpdatable as b6, updatableResources as b7, type ApiCredentialType as b8, instance as b9, type ApiCredentialCreate as c, type ApiCredentialSort as d, type ApiCredentialUpdate as e, ApiCredentials as f, getResources as g, ApiResource as h, ApiSingleton as i, type ApplicationMembership as j, type ApplicationMembershipCreate as k, type ApplicationMembershipSort as l, type ApplicationMembershipUpdate as m, ApplicationMemberships as n, type CreatableResourceType as o, type DeletableResourceType as p, type IdentityProviderCreate as q, type IdentityProviderSort as r, type IdentityProviderUpdate as s, IdentityProviders as t, ListResponse as u, type ListableResource as v, type ListableResourceType as w, type MembershipCreate as x, type MembershipProfile as y, type MembershipProfileCreate as z };