@commercelayer/provisioning-sdk 3.0.0-beta.1 → 3.0.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +18 -9
- package/lib/{api-BQZ9r4RA.d.cts → api-C4jp_9vb.d.cts} +487 -485
- package/lib/{api-BQ6Y-J8P.d.ts → api-C_E9e1ea.d.ts} +487 -485
- package/lib/api.cjs +23 -23
- package/lib/api.d.cts +1 -1
- package/lib/api.d.ts +1 -1
- package/lib/api.js +13 -13
- package/lib/binding.cjs +3 -3
- package/lib/binding.d.cts +2 -2
- package/lib/binding.d.ts +2 -2
- package/lib/binding.js +2 -2
- package/lib/bundle.cjs +17 -17
- package/lib/bundle.d.cts +1 -1
- package/lib/bundle.d.ts +1 -1
- package/lib/bundle.js +15 -15
- package/lib/{chunk-5D5YOHG4.cjs → chunk-3ILNEP2F.cjs} +26 -26
- package/lib/{chunk-5D5YOHG4.cjs.map → chunk-3ILNEP2F.cjs.map} +1 -1
- package/lib/{chunk-QVV2ORWB.cjs → chunk-3NDVX4SE.cjs} +4 -4
- package/lib/{chunk-QVV2ORWB.cjs.map → chunk-3NDVX4SE.cjs.map} +1 -1
- package/lib/{chunk-XV25RH6C.js → chunk-3PJNJ7B6.js} +3 -3
- package/lib/{chunk-XV25RH6C.js.map → chunk-3PJNJ7B6.js.map} +1 -1
- package/lib/{chunk-NFF6DWKZ.cjs → chunk-6FB54J7W.cjs} +4 -4
- package/lib/{chunk-NFF6DWKZ.cjs.map → chunk-6FB54J7W.cjs.map} +1 -1
- package/lib/{chunk-SZSANTXM.cjs → chunk-6MXIGF2G.cjs} +10 -10
- package/lib/{chunk-SZSANTXM.cjs.map → chunk-6MXIGF2G.cjs.map} +1 -1
- package/lib/{chunk-F2Z6XJTZ.js → chunk-7YEOUGXO.js} +3 -3
- package/lib/{chunk-F2Z6XJTZ.js.map → chunk-7YEOUGXO.js.map} +1 -1
- package/lib/{chunk-4GOUGGBM.js → chunk-CWXGTX7W.js} +4 -4
- package/lib/{chunk-4GOUGGBM.js.map → chunk-CWXGTX7W.js.map} +1 -1
- package/lib/{chunk-LISATEFD.cjs → chunk-DYMRH6LP.cjs} +4 -4
- package/lib/{chunk-LISATEFD.cjs.map → chunk-DYMRH6LP.cjs.map} +1 -1
- package/lib/{chunk-XCKSYX22.js → chunk-ECGUWRRG.js} +3 -3
- package/lib/{chunk-XCKSYX22.js.map → chunk-ECGUWRRG.js.map} +1 -1
- package/lib/{chunk-QTTL5EGB.cjs → chunk-EVDEBFHZ.cjs} +13 -8
- package/lib/chunk-EVDEBFHZ.cjs.map +1 -0
- package/lib/{chunk-YFZRO7OE.cjs → chunk-FMHTNUZ4.cjs} +4 -4
- package/lib/{chunk-YFZRO7OE.cjs.map → chunk-FMHTNUZ4.cjs.map} +1 -1
- package/lib/{chunk-OKBMV3W5.cjs → chunk-FRLV5YFL.cjs} +4 -4
- package/lib/{chunk-OKBMV3W5.cjs.map → chunk-FRLV5YFL.cjs.map} +1 -1
- package/lib/{chunk-QRMCUYRK.js → chunk-G4JBHI2H.js} +3 -3
- package/lib/{chunk-QRMCUYRK.js.map → chunk-G4JBHI2H.js.map} +1 -1
- package/lib/{chunk-HNSO4ZPF.js → chunk-GHXKZEH7.js} +8 -3
- package/lib/chunk-GHXKZEH7.js.map +1 -0
- package/lib/{chunk-BFXJ3YNR.js → chunk-I4LPOTDO.js} +3 -3
- package/lib/{chunk-BFXJ3YNR.js.map → chunk-I4LPOTDO.js.map} +1 -1
- package/lib/{chunk-6B2AFMGT.js → chunk-IRFPCJTG.js} +3 -3
- package/lib/{chunk-6B2AFMGT.js.map → chunk-IRFPCJTG.js.map} +1 -1
- package/lib/{chunk-RSAADRRH.cjs → chunk-KO4FQ4V2.cjs} +4 -4
- package/lib/{chunk-RSAADRRH.cjs.map → chunk-KO4FQ4V2.cjs.map} +1 -1
- package/lib/{chunk-OAXFNHFA.js → chunk-KT6LCJJQ.js} +3 -3
- package/lib/{chunk-OAXFNHFA.js.map → chunk-KT6LCJJQ.js.map} +1 -1
- package/lib/{chunk-PIDJDUN3.js → chunk-LTIWXCVE.js} +3 -3
- package/lib/{chunk-PIDJDUN3.js.map → chunk-LTIWXCVE.js.map} +1 -1
- package/lib/{chunk-KJRFIWHK.cjs → chunk-MHV7FMLE.cjs} +4 -4
- package/lib/{chunk-KJRFIWHK.cjs.map → chunk-MHV7FMLE.cjs.map} +1 -1
- package/lib/{chunk-TOXS3OUT.cjs → chunk-NDKGLF4B.cjs} +4 -4
- package/lib/{chunk-TOXS3OUT.cjs.map → chunk-NDKGLF4B.cjs.map} +1 -1
- package/lib/{chunk-47HG76BX.cjs → chunk-OROPOAHK.cjs} +4 -4
- package/lib/{chunk-47HG76BX.cjs.map → chunk-OROPOAHK.cjs.map} +1 -1
- package/lib/{chunk-MANW7JPJ.js → chunk-SQLX22US.js} +3 -3
- package/lib/chunk-SQLX22US.js.map +1 -0
- package/lib/{chunk-OEYUWL5K.js → chunk-STPXKF53.js} +4 -4
- package/lib/{chunk-OEYUWL5K.js.map → chunk-STPXKF53.js.map} +1 -1
- package/lib/{chunk-ZTAL3U2D.js → chunk-T2U6MUX4.js} +3 -3
- package/lib/{chunk-ZTAL3U2D.js.map → chunk-T2U6MUX4.js.map} +1 -1
- package/lib/{chunk-JDXNOZFC.cjs → chunk-TXONK7R5.cjs} +4 -4
- package/lib/{chunk-JDXNOZFC.cjs.map → chunk-TXONK7R5.cjs.map} +1 -1
- package/lib/{chunk-BI4FXO5V.cjs → chunk-TY46WNR6.cjs} +8 -8
- package/lib/{chunk-BI4FXO5V.cjs.map → chunk-TY46WNR6.cjs.map} +1 -1
- package/lib/{chunk-FHXWFSIQ.cjs → chunk-UILXNOZE.cjs} +4 -4
- package/lib/{chunk-FHXWFSIQ.cjs.map → chunk-UILXNOZE.cjs.map} +1 -1
- package/lib/{chunk-U76G3DPW.js → chunk-WMUY7Z2Q.js} +3 -3
- package/lib/{chunk-U76G3DPW.js.map → chunk-WMUY7Z2Q.js.map} +1 -1
- package/lib/{chunk-YLA6YCK5.cjs → chunk-XS6QLJHG.cjs} +3 -3
- package/lib/chunk-XS6QLJHG.cjs.map +1 -0
- package/lib/{chunk-CESAPW7Z.js → chunk-YUNEDDTL.js} +14 -14
- package/lib/{chunk-CESAPW7Z.js.map → chunk-YUNEDDTL.js.map} +1 -1
- package/lib/{chunk-O6ACW64H.js → chunk-ZWZHZ4SU.js} +3 -3
- package/lib/{chunk-O6ACW64H.js.map → chunk-ZWZHZ4SU.js.map} +1 -1
- package/lib/commercelayer.cjs +10 -10
- package/lib/commercelayer.d.cts +1 -1
- package/lib/commercelayer.d.ts +1 -1
- package/lib/commercelayer.js +4 -4
- package/lib/enum.d.cts +1 -1
- package/lib/enum.d.ts +1 -1
- package/lib/index.cjs +22 -22
- package/lib/index.d.cts +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +17 -17
- package/lib/model.d.cts +1 -1
- package/lib/model.d.ts +1 -1
- package/lib/resources/api_credentials.cjs +5 -5
- package/lib/resources/api_credentials.d.cts +2 -2
- package/lib/resources/api_credentials.d.ts +1 -1
- package/lib/resources/api_credentials.js +4 -4
- package/lib/resources/application_memberships.cjs +5 -5
- package/lib/resources/application_memberships.d.cts +2 -2
- package/lib/resources/application_memberships.d.ts +1 -1
- package/lib/resources/application_memberships.js +4 -4
- package/lib/resources/identity_providers.cjs +5 -5
- package/lib/resources/identity_providers.d.cts +2 -2
- package/lib/resources/identity_providers.d.ts +1 -1
- package/lib/resources/identity_providers.js +4 -4
- package/lib/resources/membership_profiles.cjs +5 -5
- package/lib/resources/membership_profiles.d.cts +2 -2
- package/lib/resources/membership_profiles.d.ts +1 -1
- package/lib/resources/membership_profiles.js +4 -4
- package/lib/resources/memberships.cjs +5 -5
- package/lib/resources/memberships.d.cts +2 -2
- package/lib/resources/memberships.d.ts +1 -1
- package/lib/resources/memberships.js +4 -4
- package/lib/resources/organizations.cjs +5 -5
- package/lib/resources/organizations.d.cts +2 -2
- package/lib/resources/organizations.d.ts +1 -1
- package/lib/resources/organizations.js +4 -4
- package/lib/resources/permissions.cjs +5 -5
- package/lib/resources/permissions.d.cts +2 -2
- package/lib/resources/permissions.d.ts +1 -1
- package/lib/resources/permissions.js +4 -4
- package/lib/resources/roles.cjs +5 -5
- package/lib/resources/roles.d.cts +2 -2
- package/lib/resources/roles.d.ts +1 -1
- package/lib/resources/roles.js +4 -4
- package/lib/resources/users.cjs +5 -5
- package/lib/resources/users.d.cts +2 -2
- package/lib/resources/users.d.ts +1 -1
- package/lib/resources/users.js +4 -4
- package/lib/resources/versions.cjs +5 -5
- package/lib/resources/versions.d.cts +2 -2
- package/lib/resources/versions.d.ts +1 -1
- package/lib/resources/versions.js +4 -4
- package/lib/static.cjs +6 -6
- package/lib/static.d.cts +1 -1
- package/lib/static.d.ts +1 -1
- package/lib/static.js +5 -5
- package/lib/version.cjs +4 -4
- package/lib/version.js +1 -1
- package/package.json +10 -11
- package/lib/chunk-HNSO4ZPF.js.map +0 -1
- package/lib/chunk-MANW7JPJ.js.map +0 -1
- package/lib/chunk-QTTL5EGB.cjs.map +0 -1
- 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,213 @@ 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
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
type
|
|
62
|
-
type
|
|
63
|
-
|
|
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
|
+
interface Resource extends ResourceBase, ResourceId {
|
|
112
|
+
readonly created_at: string;
|
|
113
|
+
readonly updated_at: string;
|
|
114
|
+
}
|
|
115
|
+
interface ResourceCreate extends ResourceBase {
|
|
116
|
+
}
|
|
117
|
+
interface ResourceUpdate extends ResourceBase {
|
|
118
|
+
readonly id: string;
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Update payload for a singleton resource, which carries no `id` because it is
|
|
122
|
+
* addressed at a singular path (`/user`, not `/users/{id}`). Distinct from
|
|
123
|
+
* `ResourceUpdate` purely to keep `id` off the caller's payload.
|
|
124
|
+
*/
|
|
125
|
+
interface SingletonUpdate extends ResourceBase {
|
|
126
|
+
}
|
|
127
|
+
type PageCursor = {
|
|
128
|
+
readonly before?: string;
|
|
129
|
+
readonly after?: string;
|
|
64
130
|
};
|
|
65
|
-
type
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
131
|
+
type ListMeta = {
|
|
132
|
+
readonly pageCount: number;
|
|
133
|
+
readonly recordCount: number;
|
|
134
|
+
readonly recordCountEstimated: boolean;
|
|
135
|
+
readonly currentPage: number;
|
|
136
|
+
readonly recordsPerPage: number;
|
|
137
|
+
readonly cursor?: {
|
|
138
|
+
readonly prev?: PageCursor;
|
|
139
|
+
readonly next?: PageCursor;
|
|
140
|
+
};
|
|
141
|
+
};
|
|
142
|
+
declare class ListResponse<R extends Resource = Resource> extends Array<R> {
|
|
143
|
+
readonly meta: ListMeta;
|
|
144
|
+
constructor(meta: ListMeta, data: R[]);
|
|
145
|
+
first(): R | undefined;
|
|
146
|
+
last(): R | undefined;
|
|
147
|
+
get(index: number): R | undefined;
|
|
148
|
+
hasNextPage(): boolean;
|
|
149
|
+
hasPrevPage(): boolean;
|
|
150
|
+
getRecordCount(): number;
|
|
151
|
+
getRecordCountEstimated(): boolean;
|
|
152
|
+
getPageCount(): number;
|
|
153
|
+
get recordCount(): number;
|
|
154
|
+
get pageCount(): number;
|
|
69
155
|
}
|
|
70
|
-
|
|
71
|
-
type
|
|
72
|
-
type
|
|
73
|
-
type
|
|
74
|
-
type
|
|
75
|
-
type
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
156
|
+
|
|
157
|
+
type ResourceSort = Pick<Resource, 'id' | 'reference' | 'reference_origin' | 'created_at' | 'updated_at'>;
|
|
158
|
+
type ResourceFilter = Pick<Resource, 'id' | 'reference' | 'reference_origin' | 'metadata' | 'created_at' | 'updated_at'>;
|
|
159
|
+
type ResourceAdapterConfig = {};
|
|
160
|
+
type ResourcesInitConfig = ResourceAdapterConfig & ApiClientInitConfig;
|
|
161
|
+
type ResourcesConfig = Partial<ResourcesInitConfig>;
|
|
162
|
+
declare class ResourceAdapter {
|
|
163
|
+
#private;
|
|
164
|
+
constructor(config: ResourcesInitConfig);
|
|
165
|
+
private localConfig;
|
|
166
|
+
config(config: ResourcesConfig): this;
|
|
167
|
+
get client(): Readonly<ApiClient>;
|
|
168
|
+
singleton<R extends Resource>(resource: ResourceType, params?: QueryParamsRetrieve<R>, options?: ResourcesConfig, path?: string): Promise<R>;
|
|
169
|
+
retrieve<R extends Resource>(resource: ResourceId, params?: QueryParamsRetrieve<R>, options?: ResourcesConfig): Promise<R>;
|
|
170
|
+
list<R extends Resource>(resource: ResourceType, params?: QueryParamsList<R>, options?: ResourcesConfig): Promise<ListResponse<R>>;
|
|
171
|
+
create<C extends ResourceCreate, R extends Resource>(resource: C & ResourceType, params?: QueryParamsRetrieve<R>, options?: ResourcesConfig): Promise<R>;
|
|
172
|
+
update<U extends ResourceUpdate | SingletonUpdate, R extends Resource>(resource: U & ResourceType, params?: QueryParamsRetrieve<R>, options?: ResourcesConfig,
|
|
85
173
|
/**
|
|
86
|
-
*
|
|
87
|
-
*
|
|
88
|
-
*
|
|
174
|
+
* Singular path override for singleton resources, e.g. `user` rather than
|
|
175
|
+
* `users/{id}`. Mirrors `singleton()` above. Core never needed it — both
|
|
176
|
+
* its singletons are retrieve-only — but the Provisioning API's `user` is
|
|
177
|
+
* updatable, and without this the request targets `/users/{id}` and 404s.
|
|
89
178
|
*/
|
|
90
|
-
|
|
179
|
+
path?: string): Promise<R>;
|
|
180
|
+
delete(resource: ResourceId, options?: ResourcesConfig): Promise<void>;
|
|
91
181
|
/**
|
|
92
|
-
*
|
|
93
|
-
*
|
|
94
|
-
*
|
|
182
|
+
* Calls a non-CRUD endpoint hosted at a sub-path of a resource, e.g.
|
|
183
|
+
* `POST memberships/:id/resend`. These endpoints are not described by the
|
|
184
|
+
* public resources schema, so they are declared in a target config and
|
|
185
|
+
* emitted from it.
|
|
95
186
|
*/
|
|
96
|
-
|
|
187
|
+
action(cmd: Extract<Method, 'POST' | 'PATCH'>, path: string, payload?: any, options?: ResourcesConfig): Promise<void>;
|
|
188
|
+
fetch<R extends Resource>(resource: string | ResourceType, path: string, params?: QueryParams<R>, options?: ResourcesConfig): Promise<R | ListResponse<R>>;
|
|
189
|
+
}
|
|
190
|
+
declare abstract class ApiResourceBase<R extends Resource> {
|
|
191
|
+
#private;
|
|
192
|
+
static readonly TYPE: ResourceTypeLock;
|
|
193
|
+
constructor(adapter?: ResourceAdapter);
|
|
194
|
+
protected get resources(): ResourceAdapter;
|
|
195
|
+
/**
|
|
196
|
+
* Returns a copy of this resource instance bound to a specific
|
|
197
|
+
* `ResourceAdapter`. Used by the bundle client so each client instance
|
|
198
|
+
* routes requests through its own adapter (its own access token) instead
|
|
199
|
+
* of the process-global static adapter. Resource classes are type-only
|
|
200
|
+
* exports, so we clone via `this.constructor` rather than referencing the
|
|
201
|
+
* class directly.
|
|
202
|
+
*/
|
|
203
|
+
withAdapter(adapter: ResourceAdapter): this;
|
|
204
|
+
abstract relationship(id: string | ResourceId | null): ResourceRel;
|
|
205
|
+
protected relationshipOneToOne<RR extends ResourceRel>(id: string | ResourceId | null): RR;
|
|
206
|
+
protected relationshipOneToMany<RR extends ResourceRel>(...ids: string[]): RR[];
|
|
207
|
+
abstract type(): ResourceTypeLock;
|
|
208
|
+
protected path(): string;
|
|
209
|
+
update(resource: ResourceUpdate, params?: QueryParamsRetrieve<R>, options?: ResourcesConfig): Promise<R>;
|
|
210
|
+
}
|
|
211
|
+
declare abstract class ApiResource<R extends Resource> extends ApiResourceBase<R> {
|
|
212
|
+
retrieve(id: string | ResourceId, params?: QueryParamsRetrieve<R>, options?: ResourcesConfig): Promise<R>;
|
|
213
|
+
list(params?: QueryParamsList<R>, options?: ResourcesConfig): Promise<ListResponse<R>>;
|
|
214
|
+
count(filter?: QueryFilter | QueryParamsList<R>, options?: ResourcesConfig): Promise<number>;
|
|
215
|
+
}
|
|
216
|
+
declare abstract class ApiSingleton<R extends Resource> extends ApiResourceBase<R> {
|
|
217
|
+
retrieve(params?: QueryParamsRetrieve<R>, options?: ResourcesConfig): Promise<R>;
|
|
97
218
|
}
|
|
98
|
-
type QueryParams<R extends Resource = Resource> = QueryParamsRetrieve<R> | QueryParamsList<R>;
|
|
99
219
|
|
|
100
|
-
type
|
|
101
|
-
type
|
|
102
|
-
type:
|
|
103
|
-
};
|
|
104
|
-
type OrganizationRel$5 = ResourceRel & {
|
|
105
|
-
type: OrganizationType;
|
|
106
|
-
};
|
|
107
|
-
type ApplicationMembershipRel$2 = ResourceRel & {
|
|
108
|
-
type: ApplicationMembershipType;
|
|
220
|
+
type VersionType = 'versions';
|
|
221
|
+
type VersionRel = ResourceRel & {
|
|
222
|
+
type: VersionType;
|
|
109
223
|
};
|
|
110
|
-
type
|
|
224
|
+
type VersionSort = Pick<Version, 'id'> & ResourceSort;
|
|
111
225
|
/**
|
|
112
|
-
* The
|
|
226
|
+
* 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
227
|
*
|
|
114
|
-
* @link https://docs.commercelayer.io/provisioning-api-reference/
|
|
228
|
+
* @link https://docs.commercelayer.io/provisioning-api-reference/versions/object
|
|
115
229
|
*/
|
|
116
|
-
interface
|
|
117
|
-
readonly type:
|
|
230
|
+
interface Version extends Resource {
|
|
231
|
+
readonly type: VersionType;
|
|
118
232
|
/**
|
|
119
|
-
* The
|
|
120
|
-
* @example ```"
|
|
233
|
+
* The type of the versioned resource.
|
|
234
|
+
* @example ```"roles"```
|
|
121
235
|
*/
|
|
122
|
-
|
|
236
|
+
resource_type?: string | null;
|
|
123
237
|
/**
|
|
124
|
-
*
|
|
125
|
-
* @example ```
|
|
238
|
+
* The versioned resource ID.
|
|
239
|
+
* @example ```"PzdJhdLdYV"```
|
|
126
240
|
*/
|
|
127
|
-
|
|
241
|
+
resource_id?: string | null;
|
|
128
242
|
/**
|
|
129
|
-
* The
|
|
130
|
-
* @example ```"
|
|
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"```
|
|
243
|
+
* The event which generates the version.
|
|
244
|
+
* @example ```"update"```
|
|
202
245
|
*/
|
|
203
246
|
event?: string | null;
|
|
204
247
|
/**
|
|
@@ -219,7 +262,7 @@ declare class Versions extends ApiResource<Version> {
|
|
|
219
262
|
relationshipToMany(...ids: string[]): VersionRel[];
|
|
220
263
|
type(): VersionType;
|
|
221
264
|
}
|
|
222
|
-
declare const instance$
|
|
265
|
+
declare const instance$9: Versions;
|
|
223
266
|
|
|
224
267
|
type PermissionType = 'permissions';
|
|
225
268
|
type PermissionRel = ResourceRel & {
|
|
@@ -318,13 +361,13 @@ declare class Permissions extends ApiResource<Permission> {
|
|
|
318
361
|
relationshipToMany(...ids: string[]): PermissionRel[];
|
|
319
362
|
type(): PermissionType;
|
|
320
363
|
}
|
|
321
|
-
declare const instance$
|
|
364
|
+
declare const instance$8: Permissions;
|
|
322
365
|
|
|
323
366
|
type RoleType = 'roles';
|
|
324
367
|
type RoleRel$3 = ResourceRel & {
|
|
325
368
|
type: RoleType;
|
|
326
369
|
};
|
|
327
|
-
type OrganizationRel$
|
|
370
|
+
type OrganizationRel$5 = ResourceRel & {
|
|
328
371
|
type: OrganizationType;
|
|
329
372
|
};
|
|
330
373
|
type RoleSort = Pick<Role, 'id' | 'name'> & ResourceSort;
|
|
@@ -357,7 +400,7 @@ interface RoleCreate extends ResourceCreate {
|
|
|
357
400
|
* @example ```"Custom role"```
|
|
358
401
|
*/
|
|
359
402
|
name: string;
|
|
360
|
-
organization: OrganizationRel$
|
|
403
|
+
organization: OrganizationRel$5;
|
|
361
404
|
}
|
|
362
405
|
interface RoleUpdate extends ResourceUpdate {
|
|
363
406
|
/**
|
|
@@ -386,98 +429,22 @@ declare class Roles extends ApiResource<Role> {
|
|
|
386
429
|
relationshipToMany(...ids: string[]): RoleRel$3[];
|
|
387
430
|
type(): RoleType;
|
|
388
431
|
}
|
|
389
|
-
declare const instance$
|
|
432
|
+
declare const instance$7: Roles;
|
|
390
433
|
|
|
391
|
-
type
|
|
392
|
-
type ApplicationMembershipRel$1 = ResourceRel & {
|
|
393
|
-
type: ApplicationMembershipType;
|
|
394
|
-
};
|
|
395
|
-
type ApiCredentialRel$1 = ResourceRel & {
|
|
396
|
-
type: ApiCredentialType;
|
|
397
|
-
};
|
|
434
|
+
type MembershipType = 'memberships';
|
|
398
435
|
type MembershipRel$1 = ResourceRel & {
|
|
399
436
|
type: MembershipType;
|
|
400
437
|
};
|
|
401
|
-
type
|
|
402
|
-
type: MembershipProfileType;
|
|
403
|
-
};
|
|
404
|
-
type OrganizationRel$3 = ResourceRel & {
|
|
438
|
+
type OrganizationRel$4 = ResourceRel & {
|
|
405
439
|
type: OrganizationType;
|
|
406
440
|
};
|
|
407
441
|
type RoleRel$2 = ResourceRel & {
|
|
408
442
|
type: RoleType;
|
|
409
443
|
};
|
|
410
|
-
type
|
|
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 & {
|
|
444
|
+
type ApplicationMembershipRel$2 = ResourceRel & {
|
|
478
445
|
type: ApplicationMembershipType;
|
|
479
446
|
};
|
|
480
|
-
type MembershipProfileRel = ResourceRel & {
|
|
447
|
+
type MembershipProfileRel$2 = ResourceRel & {
|
|
481
448
|
type: MembershipProfileType;
|
|
482
449
|
};
|
|
483
450
|
type MembershipSort = Pick<Membership, 'id' | 'status'> & ResourceSort;
|
|
@@ -540,10 +507,10 @@ interface MembershipCreate extends ResourceCreate {
|
|
|
540
507
|
* @example ```"live_access"```
|
|
541
508
|
*/
|
|
542
509
|
access_scope?: 'live_access' | 'test_access' | 'all_access' | null;
|
|
543
|
-
organization: OrganizationRel$
|
|
544
|
-
role: RoleRel$
|
|
545
|
-
application_memberships?: ApplicationMembershipRel[] | null;
|
|
546
|
-
membership_profile?: MembershipProfileRel | null;
|
|
510
|
+
organization: OrganizationRel$4;
|
|
511
|
+
role: RoleRel$2;
|
|
512
|
+
application_memberships?: ApplicationMembershipRel$2[] | null;
|
|
513
|
+
membership_profile?: MembershipProfileRel$2 | null;
|
|
547
514
|
}
|
|
548
515
|
interface MembershipUpdate extends ResourceUpdate {
|
|
549
516
|
/**
|
|
@@ -551,9 +518,9 @@ interface MembershipUpdate extends ResourceUpdate {
|
|
|
551
518
|
* @example ```"live_access"```
|
|
552
519
|
*/
|
|
553
520
|
access_scope?: 'live_access' | 'test_access' | 'all_access' | null;
|
|
554
|
-
role?: RoleRel$
|
|
555
|
-
application_memberships?: ApplicationMembershipRel[] | null;
|
|
556
|
-
membership_profile?: MembershipProfileRel | null;
|
|
521
|
+
role?: RoleRel$2 | null;
|
|
522
|
+
application_memberships?: ApplicationMembershipRel$2[] | null;
|
|
523
|
+
membership_profile?: MembershipProfileRel$2 | null;
|
|
557
524
|
}
|
|
558
525
|
declare class Memberships extends ApiResource<Membership> {
|
|
559
526
|
static readonly TYPE: MembershipType;
|
|
@@ -567,14 +534,14 @@ declare class Memberships extends ApiResource<Membership> {
|
|
|
567
534
|
versions(membershipId: string | Membership, params?: QueryParamsList<Version>, options?: ResourcesConfig): Promise<ListResponse<Version>>;
|
|
568
535
|
resend(membershipId: string | Membership, options?: ResourcesConfig): Promise<void>;
|
|
569
536
|
isMembership(resource: any): resource is Membership;
|
|
570
|
-
relationship(id: string | ResourceId | null): MembershipRel;
|
|
571
|
-
relationshipToMany(...ids: string[]): MembershipRel[];
|
|
537
|
+
relationship(id: string | ResourceId | null): MembershipRel$1;
|
|
538
|
+
relationshipToMany(...ids: string[]): MembershipRel$1[];
|
|
572
539
|
type(): MembershipType;
|
|
573
540
|
}
|
|
574
|
-
declare const instance$
|
|
541
|
+
declare const instance$6: Memberships;
|
|
575
542
|
|
|
576
543
|
type OrganizationType = 'organizations';
|
|
577
|
-
type OrganizationRel$
|
|
544
|
+
type OrganizationRel$3 = ResourceRel & {
|
|
578
545
|
type: OrganizationType;
|
|
579
546
|
};
|
|
580
547
|
type OrganizationSort = Pick<Organization, 'id' | 'name' | 'slug' | 'domain'> & ResourceSort;
|
|
@@ -1007,146 +974,164 @@ declare class Organizations extends ApiResource<Organization> {
|
|
|
1007
974
|
api_credentials(organizationId: string | Organization, params?: QueryParamsList<ApiCredential>, options?: ResourcesConfig): Promise<ListResponse<ApiCredential>>;
|
|
1008
975
|
transfer_ownership(organizationId: string | Organization, payload: TransferOwnershipDataType, options?: ResourcesConfig): Promise<void>;
|
|
1009
976
|
isOrganization(resource: any): resource is Organization;
|
|
1010
|
-
relationship(id: string | ResourceId | null): OrganizationRel$
|
|
1011
|
-
relationshipToMany(...ids: string[]): OrganizationRel$
|
|
977
|
+
relationship(id: string | ResourceId | null): OrganizationRel$3;
|
|
978
|
+
relationshipToMany(...ids: string[]): OrganizationRel$3[];
|
|
1012
979
|
type(): OrganizationType;
|
|
1013
980
|
}
|
|
1014
|
-
declare const instance$
|
|
981
|
+
declare const instance$5: Organizations;
|
|
1015
982
|
|
|
1016
|
-
type
|
|
1017
|
-
type
|
|
1018
|
-
type:
|
|
983
|
+
type MembershipProfileType = 'membership_profiles';
|
|
984
|
+
type MembershipProfileRel$1 = ResourceRel & {
|
|
985
|
+
type: MembershipProfileType;
|
|
1019
986
|
};
|
|
1020
|
-
type OrganizationRel = ResourceRel & {
|
|
987
|
+
type OrganizationRel$2 = ResourceRel & {
|
|
1021
988
|
type: OrganizationType;
|
|
1022
989
|
};
|
|
1023
|
-
type
|
|
1024
|
-
type:
|
|
990
|
+
type ApplicationMembershipRel$1 = ResourceRel & {
|
|
991
|
+
type: ApplicationMembershipType;
|
|
1025
992
|
};
|
|
1026
|
-
type
|
|
993
|
+
type MembershipProfileSort = Pick<MembershipProfile, 'id' | 'name'> & ResourceSort;
|
|
1027
994
|
/**
|
|
1028
|
-
* The
|
|
995
|
+
* 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
996
|
*
|
|
1030
|
-
* @link https://docs.commercelayer.io/provisioning-api-reference/
|
|
997
|
+
* @link https://docs.commercelayer.io/provisioning-api-reference/membership_profiles/object
|
|
1031
998
|
*/
|
|
1032
|
-
interface
|
|
1033
|
-
readonly type:
|
|
999
|
+
interface MembershipProfile extends Resource {
|
|
1000
|
+
readonly type: MembershipProfileType;
|
|
1034
1001
|
/**
|
|
1035
|
-
* The
|
|
1036
|
-
* @example ```"
|
|
1002
|
+
* The membership profile name.
|
|
1003
|
+
* @example ```"Marketing group"```
|
|
1037
1004
|
*/
|
|
1038
1005
|
name: string;
|
|
1039
1006
|
/**
|
|
1040
|
-
*
|
|
1041
|
-
* @example ```"sales_channel"```
|
|
1042
|
-
*/
|
|
1043
|
-
kind: string;
|
|
1044
|
-
/**
|
|
1045
|
-
* Indicates if the API credential it's confidential.
|
|
1007
|
+
* Reflects the organization's access scope, either test_access or all_access.
|
|
1046
1008
|
* @example ```true```
|
|
1047
1009
|
*/
|
|
1048
|
-
|
|
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;
|
|
1010
|
+
test_enabled?: boolean | null;
|
|
1079
1011
|
/**
|
|
1080
|
-
*
|
|
1012
|
+
* The access scope for applications. One of `live_access` (default), `test_access`, `all_access`.
|
|
1013
|
+
* @example ```"live_access"```
|
|
1081
1014
|
*/
|
|
1082
|
-
|
|
1015
|
+
access_scope: 'live_access' | 'test_access' | 'all_access';
|
|
1083
1016
|
organization?: Organization | null;
|
|
1084
|
-
|
|
1017
|
+
application_memberships?: ApplicationMembership[] | null;
|
|
1085
1018
|
}
|
|
1086
|
-
interface
|
|
1019
|
+
interface MembershipProfileCreate extends ResourceCreate {
|
|
1087
1020
|
/**
|
|
1088
|
-
* The
|
|
1089
|
-
* @example ```"
|
|
1021
|
+
* The membership profile name.
|
|
1022
|
+
* @example ```"Marketing group"```
|
|
1090
1023
|
*/
|
|
1091
1024
|
name: string;
|
|
1092
1025
|
/**
|
|
1093
|
-
* The
|
|
1094
|
-
* @example ```"
|
|
1026
|
+
* The access scope for applications. One of `live_access` (default), `test_access`, `all_access`.
|
|
1027
|
+
* @example ```"live_access"```
|
|
1095
1028
|
*/
|
|
1096
|
-
|
|
1029
|
+
access_scope: 'live_access' | 'test_access' | 'all_access';
|
|
1030
|
+
organization: OrganizationRel$2;
|
|
1031
|
+
application_memberships?: ApplicationMembershipRel$1[] | null;
|
|
1032
|
+
}
|
|
1033
|
+
interface MembershipProfileUpdate extends ResourceUpdate {
|
|
1097
1034
|
/**
|
|
1098
|
-
* The
|
|
1099
|
-
* @example ```"
|
|
1035
|
+
* The membership profile name.
|
|
1036
|
+
* @example ```"Marketing group"```
|
|
1100
1037
|
*/
|
|
1101
|
-
|
|
1038
|
+
name?: string | null;
|
|
1102
1039
|
/**
|
|
1103
|
-
* The
|
|
1104
|
-
* @example ```
|
|
1040
|
+
* The access scope for applications. One of `live_access` (default), `test_access`, `all_access`.
|
|
1041
|
+
* @example ```"live_access"```
|
|
1105
1042
|
*/
|
|
1106
|
-
|
|
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).
|
|
1114
|
-
*/
|
|
1115
|
-
custom?: boolean | null;
|
|
1116
|
-
organization: OrganizationRel;
|
|
1117
|
-
role?: RoleRel | null;
|
|
1043
|
+
access_scope?: 'live_access' | 'test_access' | 'all_access' | null;
|
|
1044
|
+
application_memberships?: ApplicationMembershipRel$1[] | null;
|
|
1118
1045
|
}
|
|
1119
|
-
|
|
1046
|
+
declare class MembershipProfiles extends ApiResource<MembershipProfile> {
|
|
1047
|
+
static readonly TYPE: MembershipProfileType;
|
|
1048
|
+
create(resource: MembershipProfileCreate, params?: QueryParamsRetrieve<MembershipProfile>, options?: ResourcesConfig): Promise<MembershipProfile>;
|
|
1049
|
+
update(resource: MembershipProfileUpdate, params?: QueryParamsRetrieve<MembershipProfile>, options?: ResourcesConfig): Promise<MembershipProfile>;
|
|
1050
|
+
delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void>;
|
|
1051
|
+
organization(membershipProfileId: string | MembershipProfile, params?: QueryParamsRetrieve<Organization>, options?: ResourcesConfig): Promise<Organization>;
|
|
1052
|
+
application_memberships(membershipProfileId: string | MembershipProfile, params?: QueryParamsList<ApplicationMembership>, options?: ResourcesConfig): Promise<ListResponse<ApplicationMembership>>;
|
|
1053
|
+
isMembershipProfile(resource: any): resource is MembershipProfile;
|
|
1054
|
+
relationship(id: string | ResourceId | null): MembershipProfileRel$1;
|
|
1055
|
+
relationshipToMany(...ids: string[]): MembershipProfileRel$1[];
|
|
1056
|
+
type(): MembershipProfileType;
|
|
1057
|
+
}
|
|
1058
|
+
declare const instance$4: MembershipProfiles;
|
|
1059
|
+
|
|
1060
|
+
type ApplicationMembershipType = 'application_memberships';
|
|
1061
|
+
type ApplicationMembershipRel = ResourceRel & {
|
|
1062
|
+
type: ApplicationMembershipType;
|
|
1063
|
+
};
|
|
1064
|
+
type ApiCredentialRel$1 = ResourceRel & {
|
|
1065
|
+
type: ApiCredentialType;
|
|
1066
|
+
};
|
|
1067
|
+
type MembershipRel = ResourceRel & {
|
|
1068
|
+
type: MembershipType;
|
|
1069
|
+
};
|
|
1070
|
+
type MembershipProfileRel = ResourceRel & {
|
|
1071
|
+
type: MembershipProfileType;
|
|
1072
|
+
};
|
|
1073
|
+
type OrganizationRel$1 = ResourceRel & {
|
|
1074
|
+
type: OrganizationType;
|
|
1075
|
+
};
|
|
1076
|
+
type RoleRel$1 = ResourceRel & {
|
|
1077
|
+
type: RoleType;
|
|
1078
|
+
};
|
|
1079
|
+
type ApplicationMembershipSort = Pick<ApplicationMembership, 'id'> & ResourceSort;
|
|
1080
|
+
/**
|
|
1081
|
+
* 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.
|
|
1082
|
+
*
|
|
1083
|
+
* @link https://docs.commercelayer.io/provisioning-api-reference/application_memberships/object
|
|
1084
|
+
*/
|
|
1085
|
+
interface ApplicationMembership extends Resource {
|
|
1086
|
+
readonly type: ApplicationMembershipType;
|
|
1120
1087
|
/**
|
|
1121
|
-
*
|
|
1122
|
-
* @example ```"
|
|
1088
|
+
* Set of key-value pairs that contains restrictions and scopes of the application membership.
|
|
1089
|
+
* @example ```{"market_id_in":[202,203]}```
|
|
1123
1090
|
*/
|
|
1124
|
-
|
|
1091
|
+
filters?: Record<string, any> | null;
|
|
1092
|
+
api_credential?: ApiCredential | null;
|
|
1093
|
+
membership?: Membership | null;
|
|
1094
|
+
membership_profile?: MembershipProfile | null;
|
|
1095
|
+
organization?: Organization | null;
|
|
1096
|
+
role?: Role | null;
|
|
1097
|
+
}
|
|
1098
|
+
interface ApplicationMembershipCreate extends ResourceCreate {
|
|
1125
1099
|
/**
|
|
1126
|
-
*
|
|
1127
|
-
* @example ```"
|
|
1100
|
+
* Set of key-value pairs that contains restrictions and scopes of the application membership.
|
|
1101
|
+
* @example ```{"market_id_in":[202,203]}```
|
|
1128
1102
|
*/
|
|
1129
|
-
|
|
1103
|
+
filters?: Record<string, any> | null;
|
|
1104
|
+
api_credential: ApiCredentialRel$1;
|
|
1105
|
+
membership?: MembershipRel | null;
|
|
1106
|
+
membership_profile?: MembershipProfileRel | null;
|
|
1107
|
+
organization: OrganizationRel$1;
|
|
1108
|
+
role: RoleRel$1;
|
|
1109
|
+
}
|
|
1110
|
+
interface ApplicationMembershipUpdate extends ResourceUpdate {
|
|
1130
1111
|
/**
|
|
1131
|
-
*
|
|
1132
|
-
* @example ```
|
|
1112
|
+
* Set of key-value pairs that contains restrictions and scopes of the application membership.
|
|
1113
|
+
* @example ```{"market_id_in":[202,203]}```
|
|
1133
1114
|
*/
|
|
1134
|
-
|
|
1135
|
-
|
|
1115
|
+
filters?: Record<string, any> | null;
|
|
1116
|
+
membership_profile?: MembershipProfileRel | null;
|
|
1117
|
+
role?: RoleRel$1 | null;
|
|
1136
1118
|
}
|
|
1137
|
-
declare class
|
|
1138
|
-
static readonly TYPE:
|
|
1139
|
-
create(resource:
|
|
1140
|
-
update(resource:
|
|
1119
|
+
declare class ApplicationMemberships extends ApiResource<ApplicationMembership> {
|
|
1120
|
+
static readonly TYPE: ApplicationMembershipType;
|
|
1121
|
+
create(resource: ApplicationMembershipCreate, params?: QueryParamsRetrieve<ApplicationMembership>, options?: ResourcesConfig): Promise<ApplicationMembership>;
|
|
1122
|
+
update(resource: ApplicationMembershipUpdate, params?: QueryParamsRetrieve<ApplicationMembership>, options?: ResourcesConfig): Promise<ApplicationMembership>;
|
|
1141
1123
|
delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void>;
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1124
|
+
api_credential(applicationMembershipId: string | ApplicationMembership, params?: QueryParamsRetrieve<ApiCredential>, options?: ResourcesConfig): Promise<ApiCredential>;
|
|
1125
|
+
membership(applicationMembershipId: string | ApplicationMembership, params?: QueryParamsRetrieve<Membership>, options?: ResourcesConfig): Promise<Membership>;
|
|
1126
|
+
membership_profile(applicationMembershipId: string | ApplicationMembership, params?: QueryParamsRetrieve<MembershipProfile>, options?: ResourcesConfig): Promise<MembershipProfile>;
|
|
1127
|
+
organization(applicationMembershipId: string | ApplicationMembership, params?: QueryParamsRetrieve<Organization>, options?: ResourcesConfig): Promise<Organization>;
|
|
1128
|
+
role(applicationMembershipId: string | ApplicationMembership, params?: QueryParamsRetrieve<Role>, options?: ResourcesConfig): Promise<Role>;
|
|
1129
|
+
isApplicationMembership(resource: any): resource is ApplicationMembership;
|
|
1130
|
+
relationship(id: string | ResourceId | null): ApplicationMembershipRel;
|
|
1131
|
+
relationshipToMany(...ids: string[]): ApplicationMembershipRel[];
|
|
1132
|
+
type(): ApplicationMembershipType;
|
|
1148
1133
|
}
|
|
1149
|
-
declare const instance$
|
|
1134
|
+
declare const instance$3: ApplicationMemberships;
|
|
1150
1135
|
|
|
1151
1136
|
type UserType = 'users';
|
|
1152
1137
|
type UserRel = ResourceRel & {
|
|
@@ -1217,7 +1202,7 @@ declare class Users extends ApiSingleton<User> {
|
|
|
1217
1202
|
type(): UserType;
|
|
1218
1203
|
path(): string;
|
|
1219
1204
|
}
|
|
1220
|
-
declare const instance$
|
|
1205
|
+
declare const instance$2: Users;
|
|
1221
1206
|
|
|
1222
1207
|
type IdentityProviderType = 'identity_providers';
|
|
1223
1208
|
type IdentityProviderRel = ResourceRel & {
|
|
@@ -1420,7 +1405,7 @@ declare class IdentityProviders extends ApiResource<IdentityProvider> {
|
|
|
1420
1405
|
relationshipToMany(...ids: string[]): IdentityProviderRel[];
|
|
1421
1406
|
type(): IdentityProviderType;
|
|
1422
1407
|
}
|
|
1423
|
-
declare const instance: IdentityProviders;
|
|
1408
|
+
declare const instance$1: IdentityProviders;
|
|
1424
1409
|
|
|
1425
1410
|
declare const apiResources: readonly ["api_credentials", "application_memberships", "identity_providers", "memberships", "membership_profiles", "organizations", "permissions", "roles", "users", "versions"];
|
|
1426
1411
|
type ResourceTypeLock = (typeof apiResources)[number];
|
|
@@ -1480,164 +1465,181 @@ type ResourceSortFields = {
|
|
|
1480
1465
|
versions: VersionSort;
|
|
1481
1466
|
};
|
|
1482
1467
|
|
|
1483
|
-
type
|
|
1484
|
-
type
|
|
1485
|
-
type
|
|
1486
|
-
type
|
|
1487
|
-
|
|
1488
|
-
|
|
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;
|
|
1468
|
+
type QueryResType<T extends Resource> = T['type'];
|
|
1469
|
+
type QueryInclude = string[];
|
|
1470
|
+
type QueryResourceFields<R extends ResourceTypeLock> = keyof ResourceFields[R];
|
|
1471
|
+
type QueryArrayFields<R extends Resource> = Array<QueryResourceFields<QueryResType<R>>>;
|
|
1472
|
+
type QueryRecordFields = {
|
|
1473
|
+
[key in keyof ResourceFields]?: Array<QueryResourceFields<key>>;
|
|
1500
1474
|
};
|
|
1501
|
-
type
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
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;
|
|
1475
|
+
type QueryFields<R extends Resource> = QueryArrayFields<R> | QueryRecordFields;
|
|
1476
|
+
interface QueryParamsRetrieve<R extends Resource = Resource> {
|
|
1477
|
+
include?: QueryInclude;
|
|
1478
|
+
fields?: QueryFields<R>;
|
|
1544
1479
|
}
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1480
|
+
type QuerySortType = 'asc' | 'desc';
|
|
1481
|
+
type QueryResourceSortable<R extends Resource> = ResourceSortFields[QueryResType<R>];
|
|
1482
|
+
type QueryResourceSortableFields<R extends Resource> = StringKey<QueryResourceSortable<R>>;
|
|
1483
|
+
type QueryArraySortable<R extends Resource> = Array<QueryResourceSortableFields<R> | `-${QueryResourceSortableFields<R>}`>;
|
|
1484
|
+
type QueryRecordSortable<R extends Resource> = Partial<Record<keyof QueryResourceSortable<R>, QuerySortType>>;
|
|
1485
|
+
type QuerySort<R extends Resource> = QueryArraySortable<R> | QueryRecordSortable<R>;
|
|
1486
|
+
type QueryFilter = Record<string, string | number | boolean | object | Array<string | number>>;
|
|
1487
|
+
type QueryPageNumber = number;
|
|
1488
|
+
type QueryPageSize = PositiveNumberRange<25>;
|
|
1489
|
+
type QueryPageCursor = string;
|
|
1490
|
+
interface QueryParamsList<R extends Resource = Resource> extends QueryParamsRetrieve<R> {
|
|
1491
|
+
sort?: QuerySort<R>;
|
|
1492
|
+
filters?: QueryFilter;
|
|
1493
|
+
pageNumber?: QueryPageNumber;
|
|
1494
|
+
pageSize?: QueryPageSize;
|
|
1495
|
+
/**
|
|
1496
|
+
* Cursor for cursor-based pagination — returns the records after the given cursor.
|
|
1497
|
+
* Only cursor-paginated resources (e.g. `event_stores`) honor it; offset-paginated
|
|
1498
|
+
* resources ignore it. Emitted as the `page[after]` query parameter.
|
|
1499
|
+
*/
|
|
1500
|
+
pageAfter?: QueryPageCursor;
|
|
1501
|
+
/**
|
|
1502
|
+
* Cursor for cursor-based pagination — returns the records before the given cursor.
|
|
1503
|
+
* Only cursor-paginated resources honor it; offset-paginated resources ignore it.
|
|
1504
|
+
* Emitted as the `page[before]` query parameter.
|
|
1505
|
+
*/
|
|
1506
|
+
pageBefore?: QueryPageCursor;
|
|
1551
1507
|
}
|
|
1552
|
-
type
|
|
1553
|
-
|
|
1554
|
-
|
|
1508
|
+
type QueryParams<R extends Resource = Resource> = QueryParamsRetrieve<R> | QueryParamsList<R>;
|
|
1509
|
+
|
|
1510
|
+
type ApiCredentialType = 'api_credentials';
|
|
1511
|
+
type ApiCredentialRel = ResourceRel & {
|
|
1512
|
+
type: ApiCredentialType;
|
|
1555
1513
|
};
|
|
1556
|
-
type
|
|
1557
|
-
|
|
1558
|
-
readonly recordCount: number;
|
|
1559
|
-
readonly currentPage: number;
|
|
1560
|
-
readonly recordsPerPage: number;
|
|
1561
|
-
readonly cursor?: {
|
|
1562
|
-
readonly prev?: PageCursor;
|
|
1563
|
-
readonly next?: PageCursor;
|
|
1564
|
-
};
|
|
1514
|
+
type OrganizationRel = ResourceRel & {
|
|
1515
|
+
type: OrganizationType;
|
|
1565
1516
|
};
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
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,
|
|
1517
|
+
type RoleRel = ResourceRel & {
|
|
1518
|
+
type: RoleType;
|
|
1519
|
+
};
|
|
1520
|
+
type ApiCredentialSort = Pick<ApiCredential, 'id' | 'name' | 'mode'> & ResourceSort;
|
|
1521
|
+
/**
|
|
1522
|
+
* 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.
|
|
1523
|
+
*
|
|
1524
|
+
* @link https://docs.commercelayer.io/provisioning-api-reference/api_credentials/object
|
|
1525
|
+
*/
|
|
1526
|
+
interface ApiCredential extends Resource {
|
|
1527
|
+
readonly type: ApiCredentialType;
|
|
1596
1528
|
/**
|
|
1597
|
-
*
|
|
1598
|
-
*
|
|
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.
|
|
1529
|
+
* The API credential internal name.
|
|
1530
|
+
* @example ```"My app"```
|
|
1601
1531
|
*/
|
|
1602
|
-
|
|
1603
|
-
delete(resource: ResourceId, options?: ResourcesConfig): Promise<void>;
|
|
1532
|
+
name: string;
|
|
1604
1533
|
/**
|
|
1605
|
-
*
|
|
1606
|
-
*
|
|
1607
|
-
* public resources schema, so they are declared in a target config and
|
|
1608
|
-
* emitted from it.
|
|
1534
|
+
* 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.).
|
|
1535
|
+
* @example ```"sales_channel"```
|
|
1609
1536
|
*/
|
|
1610
|
-
|
|
1611
|
-
|
|
1537
|
+
kind: string;
|
|
1538
|
+
/**
|
|
1539
|
+
* Indicates if the API credential it's confidential.
|
|
1540
|
+
* @example ```true```
|
|
1541
|
+
*/
|
|
1542
|
+
confidential?: boolean | null;
|
|
1543
|
+
/**
|
|
1544
|
+
* The API credential redirect URI.
|
|
1545
|
+
* @example ```"https://bluebrand.com/img/logo.svg"```
|
|
1546
|
+
*/
|
|
1547
|
+
redirect_uri?: string | null;
|
|
1548
|
+
/**
|
|
1549
|
+
* The API credential unique ID.
|
|
1550
|
+
* @example ```"xxxx-yyyy-zzzz"```
|
|
1551
|
+
*/
|
|
1552
|
+
client_id?: string | null;
|
|
1553
|
+
/**
|
|
1554
|
+
* The API credential unique secret.
|
|
1555
|
+
* @example ```"xxxx-yyyy-zzzz"```
|
|
1556
|
+
*/
|
|
1557
|
+
client_secret?: string | null;
|
|
1558
|
+
/**
|
|
1559
|
+
* The API credential scopes.
|
|
1560
|
+
* @example ```"market:all market:9 market:122 market:6 stock_location:6 stock_location:33"```
|
|
1561
|
+
*/
|
|
1562
|
+
scopes?: string | null;
|
|
1563
|
+
/**
|
|
1564
|
+
* The lifetime of the access token in seconds (min. `7200`, max. `31536000`. Default is `14400` for Sales channels and `7200` for other client types).
|
|
1565
|
+
* @example ```7200```
|
|
1566
|
+
*/
|
|
1567
|
+
expires_in?: number | null;
|
|
1568
|
+
/**
|
|
1569
|
+
* Indicates the environment the resource belongs to (one of `test` or `live`).
|
|
1570
|
+
* @example ```"test"```
|
|
1571
|
+
*/
|
|
1572
|
+
mode?: string | null;
|
|
1573
|
+
/**
|
|
1574
|
+
* Indicates if the API credential is used to create a custom app (e.g. fork a hosted app).
|
|
1575
|
+
*/
|
|
1576
|
+
custom?: boolean | null;
|
|
1577
|
+
organization?: Organization | null;
|
|
1578
|
+
role?: Role | null;
|
|
1612
1579
|
}
|
|
1613
|
-
|
|
1614
|
-
#private;
|
|
1615
|
-
static readonly TYPE: ResourceTypeLock;
|
|
1616
|
-
constructor(adapter?: ResourceAdapter);
|
|
1617
|
-
protected get resources(): ResourceAdapter;
|
|
1580
|
+
interface ApiCredentialCreate extends ResourceCreate {
|
|
1618
1581
|
/**
|
|
1619
|
-
*
|
|
1620
|
-
*
|
|
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.
|
|
1582
|
+
* The API credential internal name.
|
|
1583
|
+
* @example ```"My app"```
|
|
1625
1584
|
*/
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1585
|
+
name: string;
|
|
1586
|
+
/**
|
|
1587
|
+
* 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.).
|
|
1588
|
+
* @example ```"sales_channel"```
|
|
1589
|
+
*/
|
|
1590
|
+
kind: string;
|
|
1591
|
+
/**
|
|
1592
|
+
* The API credential redirect URI.
|
|
1593
|
+
* @example ```"https://bluebrand.com/img/logo.svg"```
|
|
1594
|
+
*/
|
|
1595
|
+
redirect_uri?: string | null;
|
|
1596
|
+
/**
|
|
1597
|
+
* The lifetime of the access token in seconds (min. `7200`, max. `31536000`. Default is `14400` for Sales channels and `7200` for other client types).
|
|
1598
|
+
* @example ```7200```
|
|
1599
|
+
*/
|
|
1600
|
+
expires_in?: number | null;
|
|
1601
|
+
/**
|
|
1602
|
+
* Indicates the environment the resource belongs to (one of `test` or `live`).
|
|
1603
|
+
* @example ```"test"```
|
|
1604
|
+
*/
|
|
1605
|
+
mode?: string | null;
|
|
1606
|
+
/**
|
|
1607
|
+
* Indicates if the API credential is used to create a custom app (e.g. fork a hosted app).
|
|
1608
|
+
*/
|
|
1609
|
+
custom?: boolean | null;
|
|
1610
|
+
organization: OrganizationRel;
|
|
1611
|
+
role?: RoleRel | null;
|
|
1633
1612
|
}
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1613
|
+
interface ApiCredentialUpdate extends ResourceUpdate {
|
|
1614
|
+
/**
|
|
1615
|
+
* The API credential internal name.
|
|
1616
|
+
* @example ```"My app"```
|
|
1617
|
+
*/
|
|
1618
|
+
name?: string | null;
|
|
1619
|
+
/**
|
|
1620
|
+
* The API credential redirect URI.
|
|
1621
|
+
* @example ```"https://bluebrand.com/img/logo.svg"```
|
|
1622
|
+
*/
|
|
1623
|
+
redirect_uri?: string | null;
|
|
1624
|
+
/**
|
|
1625
|
+
* The lifetime of the access token in seconds (min. `7200`, max. `31536000`. Default is `14400` for Sales channels and `7200` for other client types).
|
|
1626
|
+
* @example ```7200```
|
|
1627
|
+
*/
|
|
1628
|
+
expires_in?: number | null;
|
|
1629
|
+
role?: RoleRel | null;
|
|
1638
1630
|
}
|
|
1639
|
-
declare
|
|
1640
|
-
|
|
1631
|
+
declare class ApiCredentials extends ApiResource<ApiCredential> {
|
|
1632
|
+
static readonly TYPE: ApiCredentialType;
|
|
1633
|
+
create(resource: ApiCredentialCreate, params?: QueryParamsRetrieve<ApiCredential>, options?: ResourcesConfig): Promise<ApiCredential>;
|
|
1634
|
+
update(resource: ApiCredentialUpdate, params?: QueryParamsRetrieve<ApiCredential>, options?: ResourcesConfig): Promise<ApiCredential>;
|
|
1635
|
+
delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void>;
|
|
1636
|
+
organization(apiCredentialId: string | ApiCredential, params?: QueryParamsRetrieve<Organization>, options?: ResourcesConfig): Promise<Organization>;
|
|
1637
|
+
role(apiCredentialId: string | ApiCredential, params?: QueryParamsRetrieve<Role>, options?: ResourcesConfig): Promise<Role>;
|
|
1638
|
+
isApiCredential(resource: any): resource is ApiCredential;
|
|
1639
|
+
relationship(id: string | ResourceId | null): ApiCredentialRel;
|
|
1640
|
+
relationshipToMany(...ids: string[]): ApiCredentialRel[];
|
|
1641
|
+
type(): ApiCredentialType;
|
|
1641
1642
|
}
|
|
1643
|
+
declare const instance: ApiCredentials;
|
|
1642
1644
|
|
|
1643
|
-
export { type
|
|
1645
|
+
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, creatableResources 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, Versions as aA, resourceList as aB, singletonList 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 VersionType as aJ, instance$9 as aK, type PermissionType as aL, instance$8 as aM, type RoleType as aN, instance$7 as aO, type MembershipType as aP, instance$6 as aQ, type OrganizationType as aR, instance$5 as aS, type MembershipProfileType as aT, instance$4 as aU, type ApplicationMembershipType as aV, instance$3 as aW, type UserType as aX, instance$2 as aY, type IdentityProviderType as aZ, instance$1 as a_, type ResourceCreate as aa, type ResourceFilter as ab, type ResourceId as ac, type ResourceRel as ad, type ResourceSort as ae, type ResourceType as af, type ResourceUpdate as ag, type ResourcesConfig as ah, type ResourcesInitConfig as ai, type ResponseObj as aj, type RetrievableResource as ak, type RetrievableResourceType as al, type Role as am, type RoleCreate as an, type RoleSort as ao, type RoleUpdate as ap, Roles as aq, type SingletonUpdate as ar, type UpdatableResource as as, type UpdatableResourceType as at, type User as au, type UserSort as av, type UserUpdate as aw, Users as ax, type Version as ay, type VersionSort as az, type ResourceTypeLock as b, deletableResources as b0, getSingletons as b1, isCreatable as b2, isDeletable as b3, isSingleton as b4, isUpdatable as b5, updatableResources as b6, type ApiCredentialType as b7, instance as b8, 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 };
|