@commercelayer/provisioning-sdk 2.10.1 → 3.0.0-beta.0
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/LICENSE +1 -1
- package/lib/actions.cjs +4 -0
- package/lib/actions.cjs.map +1 -0
- package/lib/actions.d.cts +15 -0
- package/lib/actions.d.ts +15 -0
- package/lib/actions.js +3 -0
- package/lib/actions.js.map +1 -0
- package/lib/{index.d.mts → api-BY0jb79k.d.cts} +540 -496
- package/lib/api-e4p3q-SB.d.ts +1636 -0
- package/lib/api.cjs +62 -0
- package/lib/api.cjs.map +1 -0
- package/lib/api.d.cts +2 -0
- package/lib/api.d.ts +2 -0
- package/lib/api.js +17 -0
- package/lib/api.js.map +1 -0
- package/lib/binding.cjs +14 -0
- package/lib/binding.cjs.map +1 -0
- package/lib/binding.d.cts +21 -0
- package/lib/binding.d.ts +21 -0
- package/lib/binding.js +5 -0
- package/lib/binding.js.map +1 -0
- package/lib/bundle.cjs +34 -0
- package/lib/bundle.cjs.map +1 -0
- package/lib/bundle.d.cts +27 -0
- package/lib/bundle.d.ts +25 -0
- package/lib/bundle.js +19 -0
- package/lib/bundle.js.map +1 -0
- package/lib/chunk-35GNS3WW.js +57 -0
- package/lib/chunk-35GNS3WW.js.map +1 -0
- package/lib/chunk-3ELZDTFF.js +41 -0
- package/lib/chunk-3ELZDTFF.js.map +1 -0
- package/lib/chunk-3FP4NVLD.cjs +16 -0
- package/lib/chunk-3FP4NVLD.cjs.map +1 -0
- package/lib/chunk-3XLKYXM6.cjs +84 -0
- package/lib/chunk-3XLKYXM6.cjs.map +1 -0
- package/lib/chunk-4Z4U45XQ.js +808 -0
- package/lib/chunk-4Z4U45XQ.js.map +1 -0
- package/lib/chunk-5KN7B3T2.cjs +118 -0
- package/lib/chunk-5KN7B3T2.cjs.map +1 -0
- package/lib/chunk-63TTSE4U.cjs +93 -0
- package/lib/chunk-63TTSE4U.cjs.map +1 -0
- package/lib/chunk-6I5KGZAU.js +90 -0
- package/lib/chunk-6I5KGZAU.js.map +1 -0
- package/lib/chunk-7OPCEEJV.cjs +88 -0
- package/lib/chunk-7OPCEEJV.cjs.map +1 -0
- package/lib/chunk-BWDFMGX6.cjs +84 -0
- package/lib/chunk-BWDFMGX6.cjs.map +1 -0
- package/lib/chunk-C6AOOHOR.cjs +61 -0
- package/lib/chunk-C6AOOHOR.cjs.map +1 -0
- package/lib/chunk-CFU5DNH2.cjs +19 -0
- package/lib/chunk-CFU5DNH2.cjs.map +1 -0
- package/lib/chunk-CLOSZJSZ.cjs +66 -0
- package/lib/chunk-CLOSZJSZ.cjs.map +1 -0
- package/lib/chunk-DTD2FIJ3.js +17 -0
- package/lib/chunk-DTD2FIJ3.js.map +1 -0
- package/lib/chunk-E2ERI2EX.js +114 -0
- package/lib/chunk-E2ERI2EX.js.map +1 -0
- package/lib/chunk-ELYBYKRM.cjs +32 -0
- package/lib/chunk-ELYBYKRM.cjs.map +1 -0
- package/lib/chunk-F2RLD5SN.cjs +816 -0
- package/lib/chunk-F2RLD5SN.cjs.map +1 -0
- package/lib/chunk-FOU52N6P.js +86 -0
- package/lib/chunk-FOU52N6P.js.map +1 -0
- package/lib/chunk-FWF7HBWB.js +78 -0
- package/lib/chunk-FWF7HBWB.js.map +1 -0
- package/lib/chunk-GES5UXTI.js +64 -0
- package/lib/chunk-GES5UXTI.js.map +1 -0
- package/lib/chunk-HAZ53WDW.cjs +26 -0
- package/lib/chunk-HAZ53WDW.cjs.map +1 -0
- package/lib/chunk-HOL7SMFN.cjs +59 -0
- package/lib/chunk-HOL7SMFN.cjs.map +1 -0
- package/lib/chunk-IW2T22VR.js +3 -0
- package/lib/chunk-IW2T22VR.js.map +1 -0
- package/lib/chunk-N567T7FT.cjs +4 -0
- package/lib/chunk-N567T7FT.cjs.map +1 -0
- package/lib/chunk-QRZGS4TB.js +30 -0
- package/lib/chunk-QRZGS4TB.js.map +1 -0
- package/lib/chunk-RDLVNJEW.js +82 -0
- package/lib/chunk-RDLVNJEW.js.map +1 -0
- package/lib/chunk-U2CAAK2J.js +59 -0
- package/lib/chunk-U2CAAK2J.js.map +1 -0
- package/lib/chunk-UB3WPGDV.js +12 -0
- package/lib/chunk-UB3WPGDV.js.map +1 -0
- package/lib/chunk-UYATAIX7.js +24 -0
- package/lib/chunk-UYATAIX7.js.map +1 -0
- package/lib/chunk-VAL4CE5R.js +82 -0
- package/lib/chunk-VAL4CE5R.js.map +1 -0
- package/lib/chunk-VFTFSHXQ.cjs +88 -0
- package/lib/chunk-VFTFSHXQ.cjs.map +1 -0
- package/lib/chunk-W6XILXYS.cjs +61 -0
- package/lib/chunk-W6XILXYS.cjs.map +1 -0
- package/lib/chunk-WRVLCJQZ.cjs +43 -0
- package/lib/chunk-WRVLCJQZ.cjs.map +1 -0
- package/lib/chunk-YS5PCY5D.js +76 -0
- package/lib/chunk-YS5PCY5D.js.map +1 -0
- package/lib/chunk-YYHZPR4Z.js +59 -0
- package/lib/chunk-YYHZPR4Z.js.map +1 -0
- package/lib/chunk-Z4IAVXOO.cjs +80 -0
- package/lib/chunk-Z4IAVXOO.cjs.map +1 -0
- package/lib/commercelayer.cjs +38 -0
- package/lib/commercelayer.cjs.map +1 -0
- package/lib/commercelayer.d.cts +58 -0
- package/lib/commercelayer.d.ts +56 -0
- package/lib/commercelayer.js +7 -0
- package/lib/commercelayer.js.map +1 -0
- package/lib/enum.cjs +52 -0
- package/lib/enum.cjs.map +1 -0
- package/lib/enum.d.cts +2 -0
- package/lib/enum.d.ts +2 -0
- package/lib/enum.js +3 -0
- package/lib/enum.js.map +1 -0
- package/lib/error-CVRdwnY9.d.cts +33 -0
- package/lib/error-CVRdwnY9.d.ts +33 -0
- package/lib/index.cjs +57 -0
- package/lib/index.cjs.map +1 -0
- package/lib/index.d.cts +14 -0
- package/lib/index.d.ts +9 -1591
- package/lib/index.js +26 -1
- package/lib/index.js.map +1 -0
- package/lib/model.cjs +4 -0
- package/lib/model.cjs.map +1 -0
- package/lib/model.d.cts +2 -0
- package/lib/model.d.ts +2 -0
- package/lib/model.js +3 -0
- package/lib/model.js.map +1 -0
- package/lib/resources/api_credentials.cjs +15 -0
- package/lib/resources/api_credentials.cjs.map +1 -0
- package/lib/resources/api_credentials.d.cts +5 -0
- package/lib/resources/api_credentials.d.ts +2 -0
- package/lib/resources/api_credentials.js +7 -0
- package/lib/resources/api_credentials.js.map +1 -0
- package/lib/resources/application_memberships.cjs +15 -0
- package/lib/resources/application_memberships.cjs.map +1 -0
- package/lib/resources/application_memberships.d.cts +5 -0
- package/lib/resources/application_memberships.d.ts +2 -0
- package/lib/resources/application_memberships.js +7 -0
- package/lib/resources/application_memberships.js.map +1 -0
- package/lib/resources/identity_providers.cjs +15 -0
- package/lib/resources/identity_providers.cjs.map +1 -0
- package/lib/resources/identity_providers.d.cts +5 -0
- package/lib/resources/identity_providers.d.ts +2 -0
- package/lib/resources/identity_providers.js +7 -0
- package/lib/resources/identity_providers.js.map +1 -0
- package/lib/resources/membership_profiles.cjs +15 -0
- package/lib/resources/membership_profiles.cjs.map +1 -0
- package/lib/resources/membership_profiles.d.cts +5 -0
- package/lib/resources/membership_profiles.d.ts +2 -0
- package/lib/resources/membership_profiles.js +7 -0
- package/lib/resources/membership_profiles.js.map +1 -0
- package/lib/resources/memberships.cjs +15 -0
- package/lib/resources/memberships.cjs.map +1 -0
- package/lib/resources/memberships.d.cts +5 -0
- package/lib/resources/memberships.d.ts +2 -0
- package/lib/resources/memberships.js +7 -0
- package/lib/resources/memberships.js.map +1 -0
- package/lib/resources/organizations.cjs +15 -0
- package/lib/resources/organizations.cjs.map +1 -0
- package/lib/resources/organizations.d.cts +5 -0
- package/lib/resources/organizations.d.ts +2 -0
- package/lib/resources/organizations.js +7 -0
- package/lib/resources/organizations.js.map +1 -0
- package/lib/resources/permissions.cjs +15 -0
- package/lib/resources/permissions.cjs.map +1 -0
- package/lib/resources/permissions.d.cts +5 -0
- package/lib/resources/permissions.d.ts +2 -0
- package/lib/resources/permissions.js +7 -0
- package/lib/resources/permissions.js.map +1 -0
- package/lib/resources/roles.cjs +15 -0
- package/lib/resources/roles.cjs.map +1 -0
- package/lib/resources/roles.d.cts +5 -0
- package/lib/resources/roles.d.ts +2 -0
- package/lib/resources/roles.js +7 -0
- package/lib/resources/roles.js.map +1 -0
- package/lib/resources/users.cjs +15 -0
- package/lib/resources/users.cjs.map +1 -0
- package/lib/resources/users.d.cts +5 -0
- package/lib/resources/users.d.ts +2 -0
- package/lib/resources/users.js +7 -0
- package/lib/resources/users.js.map +1 -0
- package/lib/resources/versions.cjs +15 -0
- package/lib/resources/versions.cjs.map +1 -0
- package/lib/resources/versions.d.cts +5 -0
- package/lib/resources/versions.d.ts +2 -0
- package/lib/resources/versions.js +7 -0
- package/lib/resources/versions.js.map +1 -0
- package/lib/static.cjs +17 -0
- package/lib/static.cjs.map +1 -0
- package/lib/static.d.cts +18 -0
- package/lib/static.d.ts +18 -0
- package/lib/static.js +8 -0
- package/lib/static.js.map +1 -0
- package/lib/version.cjs +20 -0
- package/lib/version.cjs.map +1 -0
- package/lib/version.d.cts +12 -0
- package/lib/version.d.ts +12 -0
- package/lib/version.js +3 -0
- package/lib/version.js.map +1 -0
- package/package.json +36 -26
- package/lib/index.mjs +0 -1
|
@@ -1,4 +1,20 @@
|
|
|
1
|
-
|
|
1
|
+
import { TransferOwnershipDataType } from './actions.cjs';
|
|
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
|
+
type InterceptorEventManager<S extends RequestInterceptor | ResponseInterceptor, F extends ErrorInterceptor | ResponseInterceptor> = {
|
|
2
18
|
onSuccess?: S;
|
|
3
19
|
onFailure?: F;
|
|
4
20
|
};
|
|
@@ -17,9 +33,9 @@ type RequestObj = {
|
|
|
17
33
|
type RequestInterceptor = (request: RequestObj) => RequestObj | Promise<RequestObj>;
|
|
18
34
|
type ResponseObj = Response;
|
|
19
35
|
type ResponseInterceptor = (response: ResponseObj) => ResponseObj | Promise<ResponseObj>;
|
|
20
|
-
type
|
|
36
|
+
type ApiHeadersLock = 'x-ratelimit-limit' | 'x-ratelimit-interval' | 'x-ratelimit-remaining';
|
|
21
37
|
type ApiHeaders = {
|
|
22
|
-
[key in
|
|
38
|
+
[key in ApiHeadersLock]: string | number | boolean;
|
|
23
39
|
};
|
|
24
40
|
type HeadersObj = Record<string, string> | ApiHeaders;
|
|
25
41
|
type ErrorObj = FetchError;
|
|
@@ -33,173 +49,53 @@ type RawResponseReader = {
|
|
|
33
49
|
ok: boolean;
|
|
34
50
|
};
|
|
35
51
|
|
|
36
|
-
type
|
|
37
|
-
type FetchResponse = any;
|
|
38
|
-
type FetchRequestOptions = RequestInit;
|
|
39
|
-
declare class FetchError extends Error {
|
|
40
|
-
#private;
|
|
41
|
-
static isFetchError: (error: any) => error is FetchError;
|
|
42
|
-
constructor(status: number, statusText: string, body?: any);
|
|
43
|
-
get errors(): any[] | undefined;
|
|
44
|
-
get status(): number;
|
|
45
|
-
get statusText(): string;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
type RequestParams = Record<string, string | number | boolean>;
|
|
49
|
-
type RequestHeaders = Record<string, string>;
|
|
50
|
-
type RefreshToken = (expiredToken: string) => Promise<string>;
|
|
51
|
-
type RequestConfig = {
|
|
52
|
-
timeout?: number;
|
|
53
|
-
params?: RequestParams;
|
|
54
|
-
headers?: RequestHeaders;
|
|
55
|
-
userAgent?: string;
|
|
56
|
-
fetch?: Fetch;
|
|
57
|
-
refreshToken?: RefreshToken;
|
|
58
|
-
};
|
|
59
|
-
type ApiConfig = {
|
|
60
|
-
domain?: string;
|
|
61
|
-
accessToken: string;
|
|
62
|
-
};
|
|
63
|
-
type ApiClientInitConfig = ApiConfig & RequestConfig;
|
|
64
|
-
type ApiClientConfig = Partial<ApiClientInitConfig>;
|
|
65
|
-
type Method = 'GET' | 'DELETE' | 'POST' | 'PUT' | 'PATCH';
|
|
66
|
-
declare class ApiClient {
|
|
67
|
-
#private;
|
|
68
|
-
static create(options: ApiClientInitConfig): ApiClient;
|
|
69
|
-
private constructor();
|
|
70
|
-
get interceptors(): InterceptorManager;
|
|
71
|
-
get requestHeaders(): RequestHeaders;
|
|
72
|
-
config(config: ApiClientConfig): this;
|
|
73
|
-
userAgent(userAgent: string): this;
|
|
74
|
-
request(method: Method, path: string, body?: any, options?: ApiClientConfig): Promise<FetchResponse>;
|
|
75
|
-
private customHeaders;
|
|
76
|
-
get currentAccessToken(): string;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
type Nullable<T> = T | null;
|
|
52
|
+
type ObjectType = Record<string, any>;
|
|
80
53
|
type CreateArrayWithLengthX<LENGTH extends number, ACC extends unknown[] = []> = ACC['length'] extends LENGTH ? ACC : CreateArrayWithLengthX<LENGTH, [...ACC, 1]>;
|
|
81
54
|
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']>;
|
|
82
55
|
type PositiveNumberRange<MAX extends number> = NumericNumberRange<CreateArrayWithLengthX<1>, MAX>;
|
|
83
56
|
type StringKey<T> = Extract<keyof T, string>;
|
|
84
57
|
|
|
85
|
-
type ResourceNull = {
|
|
86
|
-
id: null;
|
|
87
|
-
} & ResourceType;
|
|
88
|
-
type ResourceRel = ResourceId | ResourceNull;
|
|
89
|
-
type Metadata = Record<string, any>;
|
|
90
|
-
interface ResourceType {
|
|
91
|
-
readonly type: ResourceTypeLock;
|
|
92
|
-
}
|
|
93
|
-
interface ResourceId extends ResourceType {
|
|
94
|
-
readonly id: string;
|
|
95
|
-
}
|
|
96
|
-
interface ResourceBase {
|
|
97
|
-
reference?: Nullable<string>;
|
|
98
|
-
reference_origin?: Nullable<string>;
|
|
99
|
-
metadata?: Metadata;
|
|
100
|
-
}
|
|
101
|
-
interface Resource extends ResourceBase, ResourceId {
|
|
102
|
-
readonly created_at: string;
|
|
103
|
-
readonly updated_at: string;
|
|
104
|
-
}
|
|
105
|
-
interface ResourceCreate extends ResourceBase {
|
|
106
|
-
}
|
|
107
|
-
interface ResourceUpdate extends ResourceBase {
|
|
108
|
-
readonly id: string;
|
|
109
|
-
}
|
|
110
|
-
interface SingletonUpdate extends ResourceBase {
|
|
111
|
-
}
|
|
112
|
-
type ListMeta = {
|
|
113
|
-
readonly pageCount: number;
|
|
114
|
-
readonly recordCount: number;
|
|
115
|
-
readonly currentPage: number;
|
|
116
|
-
readonly recordsPerPage: number;
|
|
117
|
-
};
|
|
118
|
-
declare class ListResponse<R extends Resource = Resource> extends Array<R> {
|
|
119
|
-
readonly meta: ListMeta;
|
|
120
|
-
constructor(meta: ListMeta, data: R[]);
|
|
121
|
-
first(): R | undefined;
|
|
122
|
-
last(): R | undefined;
|
|
123
|
-
get(index: number): R | undefined;
|
|
124
|
-
hasNextPage(): boolean;
|
|
125
|
-
hasPrevPage(): boolean;
|
|
126
|
-
getRecordCount(): number;
|
|
127
|
-
getPageCount(): number;
|
|
128
|
-
get recordCount(): number;
|
|
129
|
-
get pageCount(): number;
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
type ResourceSort = Pick<Resource, 'id' | 'reference' | 'reference_origin' | 'created_at' | 'updated_at'>;
|
|
133
|
-
type ResourceFilter = Pick<Resource, 'id' | 'reference' | 'reference_origin' | 'metadata' | 'created_at' | 'updated_at'>;
|
|
134
|
-
type ResourceAdapterConfig = {};
|
|
135
|
-
type ResourcesInitConfig = ResourceAdapterConfig & ApiClientInitConfig;
|
|
136
|
-
type ResourcesConfig = Partial<ResourcesInitConfig>;
|
|
137
|
-
declare const apiResourceAdapter: (config: ResourcesInitConfig) => ResourceAdapter;
|
|
138
|
-
declare class ResourceAdapter {
|
|
139
|
-
#private;
|
|
140
|
-
constructor(config: ResourcesInitConfig);
|
|
141
|
-
private localConfig;
|
|
142
|
-
config(config: ResourcesConfig): this;
|
|
143
|
-
get client(): Readonly<ApiClient>;
|
|
144
|
-
retrieve<R extends Resource>(resource: ResourceId | ResourceType, params?: QueryParamsRetrieve<R>, options?: ResourcesConfig, path?: string): Promise<R>;
|
|
145
|
-
list<R extends Resource>(resource: ResourceType, params?: QueryParamsList<R>, options?: ResourcesConfig): Promise<ListResponse<R>>;
|
|
146
|
-
create<C extends ResourceCreate, R extends Resource>(resource: C & ResourceType, params?: QueryParamsRetrieve<R>, options?: ResourcesConfig): Promise<R>;
|
|
147
|
-
update<U extends (ResourceUpdate | SingletonUpdate), R extends Resource>(resource: U & ResourceType, params?: QueryParamsRetrieve<R>, options?: ResourcesConfig, path?: string): Promise<R>;
|
|
148
|
-
delete(resource: ResourceId, options?: ResourcesConfig): Promise<void>;
|
|
149
|
-
fetch<R extends Resource>(resource: string | ResourceType, path: string, params?: QueryParams<R>, options?: ResourcesConfig): Promise<R | ListResponse<R>>;
|
|
150
|
-
action(cmd: Extract<Method, 'POST' | 'PATCH'>, path: string, payload?: any, options?: ResourcesConfig): Promise<void>;
|
|
151
|
-
}
|
|
152
|
-
declare abstract class ApiResourceBase<R extends Resource> {
|
|
153
|
-
static readonly TYPE: ResourceTypeLock;
|
|
154
|
-
protected readonly resources: ResourceAdapter;
|
|
155
|
-
constructor(adapter: ResourceAdapter);
|
|
156
|
-
abstract relationship(id: string | ResourceId | null): ResourceRel;
|
|
157
|
-
protected relationshipOneToOne<RR extends ResourceRel>(id: string | ResourceId | null): RR;
|
|
158
|
-
protected relationshipOneToMany<RR extends ResourceRel>(...ids: string[]): RR[];
|
|
159
|
-
abstract type(): ResourceTypeLock;
|
|
160
|
-
protected path(): string;
|
|
161
|
-
parse(resource: string): R | R[];
|
|
162
|
-
update(resource: ResourceUpdate, params?: QueryParamsRetrieve<R>, options?: ResourcesConfig): Promise<R>;
|
|
163
|
-
}
|
|
164
|
-
declare abstract class ApiResource<R extends Resource> extends ApiResourceBase<R> {
|
|
165
|
-
retrieve(id: string | ResourceId, params?: QueryParamsRetrieve<R>, options?: ResourcesConfig): Promise<R>;
|
|
166
|
-
list(params?: QueryParamsList<R>, options?: ResourcesConfig): Promise<ListResponse<R>>;
|
|
167
|
-
count(filter?: QueryFilter | QueryParamsList<R>, options?: ResourcesConfig): Promise<number>;
|
|
168
|
-
}
|
|
169
|
-
declare abstract class ApiSingleton<R extends Resource> extends ApiResourceBase<R> {
|
|
170
|
-
retrieve(params?: QueryParamsRetrieve<R>, options?: ResourcesConfig): Promise<R>;
|
|
171
|
-
}
|
|
172
|
-
|
|
173
58
|
type QueryResType<T extends Resource> = T['type'];
|
|
174
59
|
type QueryInclude = string[];
|
|
175
60
|
type QueryResourceFields<R extends ResourceTypeLock> = keyof ResourceFields[R];
|
|
176
61
|
type QueryArrayFields<R extends Resource> = Array<QueryResourceFields<QueryResType<R>>>;
|
|
177
62
|
type QueryRecordFields = {
|
|
178
|
-
[key in keyof ResourceFields]?: Array<
|
|
63
|
+
[key in keyof ResourceFields]?: Array<QueryResourceFields<key>>;
|
|
179
64
|
};
|
|
65
|
+
type QueryFields<R extends Resource> = QueryArrayFields<R> | QueryRecordFields;
|
|
180
66
|
interface QueryParamsRetrieve<R extends Resource = Resource> {
|
|
181
67
|
include?: QueryInclude;
|
|
182
|
-
fields?:
|
|
68
|
+
fields?: QueryFields<R>;
|
|
183
69
|
}
|
|
184
70
|
type QuerySortType = 'asc' | 'desc';
|
|
185
71
|
type QueryResourceSortable<R extends Resource> = ResourceSortFields[QueryResType<R>];
|
|
186
72
|
type QueryResourceSortableFields<R extends Resource> = StringKey<QueryResourceSortable<R>>;
|
|
187
73
|
type QueryArraySortable<R extends Resource> = Array<QueryResourceSortableFields<R> | `-${QueryResourceSortableFields<R>}`>;
|
|
188
74
|
type QueryRecordSortable<R extends Resource> = Partial<Record<keyof QueryResourceSortable<R>, QuerySortType>>;
|
|
75
|
+
type QuerySort<R extends Resource> = QueryArraySortable<R> | QueryRecordSortable<R>;
|
|
189
76
|
type QueryFilter = Record<string, string | number | boolean | object | Array<string | number>>;
|
|
190
77
|
type QueryPageNumber = number;
|
|
191
78
|
type QueryPageSize = PositiveNumberRange<25>;
|
|
79
|
+
type QueryPageCursor = string;
|
|
192
80
|
interface QueryParamsList<R extends Resource = Resource> extends QueryParamsRetrieve<R> {
|
|
193
|
-
sort?:
|
|
81
|
+
sort?: QuerySort<R>;
|
|
194
82
|
filters?: QueryFilter;
|
|
195
83
|
pageNumber?: QueryPageNumber;
|
|
196
84
|
pageSize?: QueryPageSize;
|
|
85
|
+
/**
|
|
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.
|
|
89
|
+
*/
|
|
90
|
+
pageAfter?: QueryPageCursor;
|
|
91
|
+
/**
|
|
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.
|
|
95
|
+
*/
|
|
96
|
+
pageBefore?: QueryPageCursor;
|
|
197
97
|
}
|
|
198
98
|
type QueryParams<R extends Resource = Resource> = QueryParamsRetrieve<R> | QueryParamsList<R>;
|
|
199
|
-
declare const isParamsList: <R extends Resource>(params: any) => params is QueryParamsList<R>;
|
|
200
|
-
type QueryStringParams = Record<string, string>;
|
|
201
|
-
declare const generateQueryStringParams: <R extends Resource>(params: QueryParams<R> | undefined, res: string | ResourceType) => QueryStringParams;
|
|
202
|
-
declare const generateSearchString: (params?: QueryStringParams, questionMark?: boolean) => string;
|
|
203
99
|
|
|
204
100
|
type MembershipProfileType = 'membership_profiles';
|
|
205
101
|
type MembershipProfileRel$2 = ResourceRel & {
|
|
@@ -212,6 +108,11 @@ type ApplicationMembershipRel$2 = ResourceRel & {
|
|
|
212
108
|
type: ApplicationMembershipType;
|
|
213
109
|
};
|
|
214
110
|
type MembershipProfileSort = Pick<MembershipProfile, 'id' | 'name'> & ResourceSort;
|
|
111
|
+
/**
|
|
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.
|
|
113
|
+
*
|
|
114
|
+
* @link https://docs.commercelayer.io/provisioning-api-reference/membership_profiles/object
|
|
115
|
+
*/
|
|
215
116
|
interface MembershipProfile extends Resource {
|
|
216
117
|
readonly type: MembershipProfileType;
|
|
217
118
|
/**
|
|
@@ -221,15 +122,16 @@ interface MembershipProfile extends Resource {
|
|
|
221
122
|
name: string;
|
|
222
123
|
/**
|
|
223
124
|
* Reflects the organization's access scope, either test_access or all_access.
|
|
125
|
+
* @example ```true```
|
|
224
126
|
*/
|
|
225
|
-
test_enabled
|
|
127
|
+
test_enabled?: boolean | null;
|
|
226
128
|
/**
|
|
227
129
|
* The access scope for applications. One of `live_access` (default), `test_access`, `all_access`.
|
|
228
130
|
* @example ```"live_access"```
|
|
229
131
|
*/
|
|
230
132
|
access_scope: 'live_access' | 'test_access' | 'all_access';
|
|
231
|
-
organization?:
|
|
232
|
-
application_memberships?:
|
|
133
|
+
organization?: Organization | null;
|
|
134
|
+
application_memberships?: ApplicationMembership[] | null;
|
|
233
135
|
}
|
|
234
136
|
interface MembershipProfileCreate extends ResourceCreate {
|
|
235
137
|
/**
|
|
@@ -243,20 +145,20 @@ interface MembershipProfileCreate extends ResourceCreate {
|
|
|
243
145
|
*/
|
|
244
146
|
access_scope: 'live_access' | 'test_access' | 'all_access';
|
|
245
147
|
organization: OrganizationRel$5;
|
|
246
|
-
application_memberships?:
|
|
148
|
+
application_memberships?: ApplicationMembershipRel$2[] | null;
|
|
247
149
|
}
|
|
248
150
|
interface MembershipProfileUpdate extends ResourceUpdate {
|
|
249
151
|
/**
|
|
250
152
|
* The membership profile name.
|
|
251
153
|
* @example ```"Marketing group"```
|
|
252
154
|
*/
|
|
253
|
-
name?:
|
|
155
|
+
name?: string | null;
|
|
254
156
|
/**
|
|
255
157
|
* The access scope for applications. One of `live_access` (default), `test_access`, `all_access`.
|
|
256
158
|
* @example ```"live_access"```
|
|
257
159
|
*/
|
|
258
|
-
access_scope?:
|
|
259
|
-
application_memberships?:
|
|
160
|
+
access_scope?: 'live_access' | 'test_access' | 'all_access' | null;
|
|
161
|
+
application_memberships?: ApplicationMembershipRel$2[] | null;
|
|
260
162
|
}
|
|
261
163
|
declare class MembershipProfiles extends ApiResource<MembershipProfile> {
|
|
262
164
|
static readonly TYPE: MembershipProfileType;
|
|
@@ -270,39 +172,45 @@ declare class MembershipProfiles extends ApiResource<MembershipProfile> {
|
|
|
270
172
|
relationshipToMany(...ids: string[]): MembershipProfileRel$2[];
|
|
271
173
|
type(): MembershipProfileType;
|
|
272
174
|
}
|
|
175
|
+
declare const instance$9: MembershipProfiles;
|
|
273
176
|
|
|
274
177
|
type VersionType = 'versions';
|
|
275
178
|
type VersionRel = ResourceRel & {
|
|
276
179
|
type: VersionType;
|
|
277
180
|
};
|
|
278
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
|
+
*/
|
|
279
187
|
interface Version extends Resource {
|
|
280
188
|
readonly type: VersionType;
|
|
281
189
|
/**
|
|
282
190
|
* The type of the versioned resource.
|
|
283
191
|
* @example ```"roles"```
|
|
284
192
|
*/
|
|
285
|
-
resource_type
|
|
193
|
+
resource_type?: string | null;
|
|
286
194
|
/**
|
|
287
195
|
* The versioned resource ID.
|
|
288
196
|
* @example ```"PzdJhdLdYV"```
|
|
289
197
|
*/
|
|
290
|
-
resource_id
|
|
198
|
+
resource_id?: string | null;
|
|
291
199
|
/**
|
|
292
200
|
* The event which generates the version.
|
|
293
201
|
* @example ```"update"```
|
|
294
202
|
*/
|
|
295
|
-
event
|
|
203
|
+
event?: string | null;
|
|
296
204
|
/**
|
|
297
205
|
* The object changes payload.
|
|
298
206
|
* @example ```{"name":["previous","new"]}```
|
|
299
207
|
*/
|
|
300
|
-
changes
|
|
208
|
+
changes?: Record<string, any> | null;
|
|
301
209
|
/**
|
|
302
210
|
* Information about who triggered the change, only showed when it's from a JWT token.
|
|
303
211
|
* @example ```{"application":{"id":"DNOPYiZYpn","kind":"integration","public":true}}```
|
|
304
212
|
*/
|
|
305
|
-
who
|
|
213
|
+
who?: Record<string, any> | null;
|
|
306
214
|
}
|
|
307
215
|
declare class Versions extends ApiResource<Version> {
|
|
308
216
|
static readonly TYPE: VersionType;
|
|
@@ -311,6 +219,7 @@ declare class Versions extends ApiResource<Version> {
|
|
|
311
219
|
relationshipToMany(...ids: string[]): VersionRel[];
|
|
312
220
|
type(): VersionType;
|
|
313
221
|
}
|
|
222
|
+
declare const instance$8: Versions;
|
|
314
223
|
|
|
315
224
|
type PermissionType = 'permissions';
|
|
316
225
|
type PermissionRel = ResourceRel & {
|
|
@@ -320,6 +229,11 @@ type RoleRel$4 = ResourceRel & {
|
|
|
320
229
|
type: RoleType;
|
|
321
230
|
};
|
|
322
231
|
type PermissionSort = Pick<Permission, 'id'> & ResourceSort;
|
|
232
|
+
/**
|
|
233
|
+
* The Permission object is returned as part of the response body of each successful list, retrieve, create or update API call to the /api/permissions endpoint.
|
|
234
|
+
*
|
|
235
|
+
* @link https://docs.commercelayer.io/provisioning-api-reference/permissions/object
|
|
236
|
+
*/
|
|
323
237
|
interface Permission extends Resource {
|
|
324
238
|
readonly type: PermissionType;
|
|
325
239
|
/**
|
|
@@ -346,10 +260,10 @@ interface Permission extends Resource {
|
|
|
346
260
|
* An object that contains additional restrictions.
|
|
347
261
|
* @example ```{"foo":"bar"}```
|
|
348
262
|
*/
|
|
349
|
-
restrictions
|
|
350
|
-
organization?:
|
|
351
|
-
role?:
|
|
352
|
-
versions?:
|
|
263
|
+
restrictions?: Record<string, any> | null;
|
|
264
|
+
organization?: Organization | null;
|
|
265
|
+
role?: Role | null;
|
|
266
|
+
versions?: Version[] | null;
|
|
353
267
|
}
|
|
354
268
|
interface PermissionCreate extends ResourceCreate {
|
|
355
269
|
/**
|
|
@@ -378,19 +292,19 @@ interface PermissionUpdate extends ResourceUpdate {
|
|
|
378
292
|
/**
|
|
379
293
|
* Determines if the permission have access to create rights.
|
|
380
294
|
*/
|
|
381
|
-
can_create?:
|
|
295
|
+
can_create?: boolean | null;
|
|
382
296
|
/**
|
|
383
297
|
* Determines if the permission have access to read rights.
|
|
384
298
|
*/
|
|
385
|
-
can_read?:
|
|
299
|
+
can_read?: boolean | null;
|
|
386
300
|
/**
|
|
387
301
|
* Determines if the permission have access to update rights.
|
|
388
302
|
*/
|
|
389
|
-
can_update?:
|
|
303
|
+
can_update?: boolean | null;
|
|
390
304
|
/**
|
|
391
305
|
* Determines if the permission have access to destroy rights.
|
|
392
306
|
*/
|
|
393
|
-
can_destroy?:
|
|
307
|
+
can_destroy?: boolean | null;
|
|
394
308
|
}
|
|
395
309
|
declare class Permissions extends ApiResource<Permission> {
|
|
396
310
|
static readonly TYPE: PermissionType;
|
|
@@ -404,6 +318,7 @@ declare class Permissions extends ApiResource<Permission> {
|
|
|
404
318
|
relationshipToMany(...ids: string[]): PermissionRel[];
|
|
405
319
|
type(): PermissionType;
|
|
406
320
|
}
|
|
321
|
+
declare const instance$7: Permissions;
|
|
407
322
|
|
|
408
323
|
type RoleType = 'roles';
|
|
409
324
|
type RoleRel$3 = ResourceRel & {
|
|
@@ -412,7 +327,12 @@ type RoleRel$3 = ResourceRel & {
|
|
|
412
327
|
type OrganizationRel$4 = ResourceRel & {
|
|
413
328
|
type: OrganizationType;
|
|
414
329
|
};
|
|
415
|
-
type RoleSort = Pick<Role, 'id'> & ResourceSort;
|
|
330
|
+
type RoleSort = Pick<Role, 'id' | 'name'> & ResourceSort;
|
|
331
|
+
/**
|
|
332
|
+
* The Role object is returned as part of the response body of each successful list, retrieve, create or update API call to the /api/roles endpoint.
|
|
333
|
+
*
|
|
334
|
+
* @link https://docs.commercelayer.io/provisioning-api-reference/roles/object
|
|
335
|
+
*/
|
|
416
336
|
interface Role extends Resource {
|
|
417
337
|
readonly type: RoleType;
|
|
418
338
|
/**
|
|
@@ -424,12 +344,12 @@ interface Role extends Resource {
|
|
|
424
344
|
* The kind of role, one of: `custom`, `admin`, `read_only`.
|
|
425
345
|
* @example ```"custom"```
|
|
426
346
|
*/
|
|
427
|
-
kind
|
|
428
|
-
organization?:
|
|
429
|
-
permissions?:
|
|
430
|
-
memberships?:
|
|
431
|
-
api_credentials?:
|
|
432
|
-
versions?:
|
|
347
|
+
kind?: string | null;
|
|
348
|
+
organization?: Organization | null;
|
|
349
|
+
permissions?: Permission[] | null;
|
|
350
|
+
memberships?: Membership[] | null;
|
|
351
|
+
api_credentials?: ApiCredential[] | null;
|
|
352
|
+
versions?: Version[] | null;
|
|
433
353
|
}
|
|
434
354
|
interface RoleCreate extends ResourceCreate {
|
|
435
355
|
/**
|
|
@@ -444,12 +364,12 @@ interface RoleUpdate extends ResourceUpdate {
|
|
|
444
364
|
* The role name.
|
|
445
365
|
* @example ```"Custom role"```
|
|
446
366
|
*/
|
|
447
|
-
name?:
|
|
367
|
+
name?: string | null;
|
|
448
368
|
/**
|
|
449
369
|
* Send this attribute if you want to update the role base permissions.
|
|
450
|
-
* @example ```
|
|
370
|
+
* @example ```true```
|
|
451
371
|
*/
|
|
452
|
-
_add_missing_base_permissions?:
|
|
372
|
+
_add_missing_base_permissions?: boolean | null;
|
|
453
373
|
}
|
|
454
374
|
declare class Roles extends ApiResource<Role> {
|
|
455
375
|
static readonly TYPE: RoleType;
|
|
@@ -466,6 +386,7 @@ declare class Roles extends ApiResource<Role> {
|
|
|
466
386
|
relationshipToMany(...ids: string[]): RoleRel$3[];
|
|
467
387
|
type(): RoleType;
|
|
468
388
|
}
|
|
389
|
+
declare const instance$6: Roles;
|
|
469
390
|
|
|
470
391
|
type ApplicationMembershipType = 'application_memberships';
|
|
471
392
|
type ApplicationMembershipRel$1 = ResourceRel & {
|
|
@@ -487,28 +408,33 @@ type RoleRel$2 = ResourceRel & {
|
|
|
487
408
|
type: RoleType;
|
|
488
409
|
};
|
|
489
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
|
+
*/
|
|
490
416
|
interface ApplicationMembership extends Resource {
|
|
491
417
|
readonly type: ApplicationMembershipType;
|
|
492
418
|
/**
|
|
493
419
|
* Set of key-value pairs that contains restrictions and scopes of the application membership.
|
|
494
420
|
* @example ```{"market_id_in":[202,203]}```
|
|
495
421
|
*/
|
|
496
|
-
filters?:
|
|
497
|
-
api_credential?:
|
|
498
|
-
membership?:
|
|
499
|
-
membership_profile?:
|
|
500
|
-
organization?:
|
|
501
|
-
role?:
|
|
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;
|
|
502
428
|
}
|
|
503
429
|
interface ApplicationMembershipCreate extends ResourceCreate {
|
|
504
430
|
/**
|
|
505
431
|
* Set of key-value pairs that contains restrictions and scopes of the application membership.
|
|
506
432
|
* @example ```{"market_id_in":[202,203]}```
|
|
507
433
|
*/
|
|
508
|
-
filters?:
|
|
434
|
+
filters?: Record<string, any> | null;
|
|
509
435
|
api_credential: ApiCredentialRel$1;
|
|
510
|
-
membership?:
|
|
511
|
-
membership_profile?:
|
|
436
|
+
membership?: MembershipRel$1 | null;
|
|
437
|
+
membership_profile?: MembershipProfileRel$1 | null;
|
|
512
438
|
organization: OrganizationRel$3;
|
|
513
439
|
role: RoleRel$2;
|
|
514
440
|
}
|
|
@@ -517,9 +443,9 @@ interface ApplicationMembershipUpdate extends ResourceUpdate {
|
|
|
517
443
|
* Set of key-value pairs that contains restrictions and scopes of the application membership.
|
|
518
444
|
* @example ```{"market_id_in":[202,203]}```
|
|
519
445
|
*/
|
|
520
|
-
filters?:
|
|
521
|
-
membership_profile?:
|
|
522
|
-
role?:
|
|
446
|
+
filters?: Record<string, any> | null;
|
|
447
|
+
membership_profile?: MembershipProfileRel$1 | null;
|
|
448
|
+
role?: RoleRel$2 | null;
|
|
523
449
|
}
|
|
524
450
|
declare class ApplicationMemberships extends ApiResource<ApplicationMembership> {
|
|
525
451
|
static readonly TYPE: ApplicationMembershipType;
|
|
@@ -536,6 +462,7 @@ declare class ApplicationMemberships extends ApiResource<ApplicationMembership>
|
|
|
536
462
|
relationshipToMany(...ids: string[]): ApplicationMembershipRel$1[];
|
|
537
463
|
type(): ApplicationMembershipType;
|
|
538
464
|
}
|
|
465
|
+
declare const instance$5: ApplicationMemberships;
|
|
539
466
|
|
|
540
467
|
type MembershipType = 'memberships';
|
|
541
468
|
type MembershipRel = ResourceRel & {
|
|
@@ -554,6 +481,11 @@ type MembershipProfileRel = ResourceRel & {
|
|
|
554
481
|
type: MembershipProfileType;
|
|
555
482
|
};
|
|
556
483
|
type MembershipSort = Pick<Membership, 'id' | 'status'> & ResourceSort;
|
|
484
|
+
/**
|
|
485
|
+
* The Membership object is returned as part of the response body of each successful list, retrieve, create, update or delete API call to the /api/memberships endpoint.
|
|
486
|
+
*
|
|
487
|
+
* @link https://docs.commercelayer.io/provisioning-api-reference/memberships/object
|
|
488
|
+
*/
|
|
557
489
|
interface Membership extends Resource {
|
|
558
490
|
readonly type: MembershipType;
|
|
559
491
|
/**
|
|
@@ -565,12 +497,12 @@ interface Membership extends Resource {
|
|
|
565
497
|
* The user first name.
|
|
566
498
|
* @example ```"John"```
|
|
567
499
|
*/
|
|
568
|
-
user_first_name
|
|
500
|
+
user_first_name?: string | null;
|
|
569
501
|
/**
|
|
570
502
|
* The user last name.
|
|
571
503
|
* @example ```"Doe"```
|
|
572
504
|
*/
|
|
573
|
-
user_last_name
|
|
505
|
+
user_last_name?: string | null;
|
|
574
506
|
/**
|
|
575
507
|
* The memberships status. One of `pending` (default), `active`.
|
|
576
508
|
* @example ```"pending"```
|
|
@@ -578,23 +510,24 @@ interface Membership extends Resource {
|
|
|
578
510
|
status: 'pending' | 'active';
|
|
579
511
|
/**
|
|
580
512
|
* Indicates if the user it's the owner of the organization.
|
|
581
|
-
* @example ```
|
|
513
|
+
* @example ```true```
|
|
582
514
|
*/
|
|
583
|
-
owner
|
|
515
|
+
owner?: boolean | null;
|
|
584
516
|
/**
|
|
585
517
|
* Reflects the organization's access scope, either test_access or all_access.
|
|
518
|
+
* @example ```true```
|
|
586
519
|
*/
|
|
587
|
-
test_enabled
|
|
520
|
+
test_enabled?: boolean | null;
|
|
588
521
|
/**
|
|
589
522
|
* The access scope for applications. One of `live_access` (default), `test_access`, `all_access`.
|
|
590
523
|
* @example ```"live_access"```
|
|
591
524
|
*/
|
|
592
|
-
access_scope?:
|
|
593
|
-
organization?:
|
|
594
|
-
role?:
|
|
595
|
-
application_memberships?:
|
|
596
|
-
membership_profile?:
|
|
597
|
-
versions?:
|
|
525
|
+
access_scope?: 'live_access' | 'test_access' | 'all_access' | null;
|
|
526
|
+
organization?: Organization | null;
|
|
527
|
+
role?: Role | null;
|
|
528
|
+
application_memberships?: ApplicationMembership[] | null;
|
|
529
|
+
membership_profile?: MembershipProfile | null;
|
|
530
|
+
versions?: Version[] | null;
|
|
598
531
|
}
|
|
599
532
|
interface MembershipCreate extends ResourceCreate {
|
|
600
533
|
/**
|
|
@@ -606,44 +539,50 @@ interface MembershipCreate extends ResourceCreate {
|
|
|
606
539
|
* The access scope for applications. One of `live_access` (default), `test_access`, `all_access`.
|
|
607
540
|
* @example ```"live_access"```
|
|
608
541
|
*/
|
|
609
|
-
access_scope?:
|
|
542
|
+
access_scope?: 'live_access' | 'test_access' | 'all_access' | null;
|
|
610
543
|
organization: OrganizationRel$2;
|
|
611
544
|
role: RoleRel$1;
|
|
612
|
-
application_memberships?:
|
|
613
|
-
membership_profile?:
|
|
545
|
+
application_memberships?: ApplicationMembershipRel[] | null;
|
|
546
|
+
membership_profile?: MembershipProfileRel | null;
|
|
614
547
|
}
|
|
615
548
|
interface MembershipUpdate extends ResourceUpdate {
|
|
616
549
|
/**
|
|
617
550
|
* The access scope for applications. One of `live_access` (default), `test_access`, `all_access`.
|
|
618
551
|
* @example ```"live_access"```
|
|
619
552
|
*/
|
|
620
|
-
access_scope?:
|
|
621
|
-
role?:
|
|
622
|
-
application_memberships?:
|
|
623
|
-
membership_profile?:
|
|
553
|
+
access_scope?: 'live_access' | 'test_access' | 'all_access' | null;
|
|
554
|
+
role?: RoleRel$1 | null;
|
|
555
|
+
application_memberships?: ApplicationMembershipRel[] | null;
|
|
556
|
+
membership_profile?: MembershipProfileRel | null;
|
|
624
557
|
}
|
|
625
558
|
declare class Memberships extends ApiResource<Membership> {
|
|
626
559
|
static readonly TYPE: MembershipType;
|
|
627
560
|
create(resource: MembershipCreate, params?: QueryParamsRetrieve<Membership>, options?: ResourcesConfig): Promise<Membership>;
|
|
628
561
|
update(resource: MembershipUpdate, params?: QueryParamsRetrieve<Membership>, options?: ResourcesConfig): Promise<Membership>;
|
|
629
562
|
delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void>;
|
|
630
|
-
resend(membershipId: string | Membership, options?: ResourcesConfig): Promise<void>;
|
|
631
563
|
organization(membershipId: string | Membership, params?: QueryParamsRetrieve<Organization>, options?: ResourcesConfig): Promise<Organization>;
|
|
632
564
|
role(membershipId: string | Membership, params?: QueryParamsRetrieve<Role>, options?: ResourcesConfig): Promise<Role>;
|
|
633
565
|
application_memberships(membershipId: string | Membership, params?: QueryParamsList<ApplicationMembership>, options?: ResourcesConfig): Promise<ListResponse<ApplicationMembership>>;
|
|
634
566
|
membership_profile(membershipId: string | Membership, params?: QueryParamsRetrieve<MembershipProfile>, options?: ResourcesConfig): Promise<MembershipProfile>;
|
|
635
567
|
versions(membershipId: string | Membership, params?: QueryParamsList<Version>, options?: ResourcesConfig): Promise<ListResponse<Version>>;
|
|
568
|
+
resend(membershipId: string | Membership, options?: ResourcesConfig): Promise<void>;
|
|
636
569
|
isMembership(resource: any): resource is Membership;
|
|
637
570
|
relationship(id: string | ResourceId | null): MembershipRel;
|
|
638
571
|
relationshipToMany(...ids: string[]): MembershipRel[];
|
|
639
572
|
type(): MembershipType;
|
|
640
573
|
}
|
|
574
|
+
declare const instance$4: Memberships;
|
|
641
575
|
|
|
642
576
|
type OrganizationType = 'organizations';
|
|
643
577
|
type OrganizationRel$1 = ResourceRel & {
|
|
644
578
|
type: OrganizationType;
|
|
645
579
|
};
|
|
646
580
|
type OrganizationSort = Pick<Organization, 'id' | 'name' | 'slug' | 'domain'> & ResourceSort;
|
|
581
|
+
/**
|
|
582
|
+
* The Organization object is returned as part of the response body of each successful list, retrieve, create or update API call to the /api/organizations endpoint.
|
|
583
|
+
*
|
|
584
|
+
* @link https://docs.commercelayer.io/provisioning-api-reference/organizations/object
|
|
585
|
+
*/
|
|
647
586
|
interface Organization extends Resource {
|
|
648
587
|
readonly type: OrganizationType;
|
|
649
588
|
/**
|
|
@@ -655,286 +594,299 @@ interface Organization extends Resource {
|
|
|
655
594
|
* The organization's slug name.
|
|
656
595
|
* @example ```"the-blue-brand"```
|
|
657
596
|
*/
|
|
658
|
-
slug
|
|
597
|
+
slug?: string | null;
|
|
659
598
|
/**
|
|
660
599
|
* The organization's domain.
|
|
661
600
|
* @example ```"the-blue-brand.commercelayer.io"```
|
|
662
601
|
*/
|
|
663
|
-
domain
|
|
602
|
+
domain?: string | null;
|
|
664
603
|
/**
|
|
665
604
|
* The organization's support phone.
|
|
666
605
|
* @example ```"+01 30800857"```
|
|
667
606
|
*/
|
|
668
|
-
support_phone?:
|
|
607
|
+
support_phone?: string | null;
|
|
669
608
|
/**
|
|
670
609
|
* The organization's support email.
|
|
671
610
|
* @example ```"support@bluebrand.com"```
|
|
672
611
|
*/
|
|
673
|
-
support_email?:
|
|
612
|
+
support_email?: string | null;
|
|
674
613
|
/**
|
|
675
614
|
* The URL to the organization's logo.
|
|
676
615
|
* @example ```"https://bluebrand.com/img/logo.svg"```
|
|
677
616
|
*/
|
|
678
|
-
logo_url?:
|
|
617
|
+
logo_url?: string | null;
|
|
679
618
|
/**
|
|
680
619
|
* The URL to the organization's favicon.
|
|
681
620
|
* @example ```"https://bluebrand.com/img/favicon.ico"```
|
|
682
621
|
*/
|
|
683
|
-
favicon_url?:
|
|
622
|
+
favicon_url?: string | null;
|
|
684
623
|
/**
|
|
685
624
|
* The organization's primary color.
|
|
686
625
|
* @example ```"#C8984E"```
|
|
687
626
|
*/
|
|
688
|
-
primary_color?:
|
|
627
|
+
primary_color?: string | null;
|
|
689
628
|
/**
|
|
690
629
|
* The organization's contrast color. Format is HEX (starts with `#` and is followed by six letters and/or numbers).
|
|
691
630
|
* @example ```"#FFFFCC"```
|
|
692
631
|
*/
|
|
693
|
-
contrast_color?:
|
|
632
|
+
contrast_color?: string | null;
|
|
694
633
|
/**
|
|
695
634
|
* The organization's Google Tag Manager ID.
|
|
696
635
|
* @example ```"GTM-5FJXX6"```
|
|
697
636
|
*/
|
|
698
|
-
gtm_id?:
|
|
637
|
+
gtm_id?: string | null;
|
|
699
638
|
/**
|
|
700
639
|
* The organization's Google Tag Manager ID for test.
|
|
701
640
|
* @example ```"GTM-5FJXX7"```
|
|
702
641
|
*/
|
|
703
|
-
gtm_id_test?:
|
|
642
|
+
gtm_id_test?: string | null;
|
|
704
643
|
/**
|
|
705
644
|
* The region where the organization is located. The default value is `eu-west-1`.
|
|
706
645
|
* @example ```"eu-west-1"```
|
|
707
646
|
*/
|
|
708
|
-
region?:
|
|
647
|
+
region?: string | null;
|
|
709
648
|
/**
|
|
710
649
|
* Indicates if the organization can switch to live mode.
|
|
711
650
|
*/
|
|
712
|
-
can_switch_live
|
|
651
|
+
can_switch_live?: boolean | null;
|
|
713
652
|
/**
|
|
714
653
|
* Information about the current subscription such as the plan type, limits, and subscription totals counter.
|
|
715
654
|
* @example ```{"plan_type":"growth","limits":{"markets":5,"skus":10000,"organizations":2,"memberships":5},"totals":{"organizations":1,"markets":0,"memberships":2,"skus":0}}```
|
|
716
655
|
*/
|
|
717
|
-
subscription_info
|
|
656
|
+
subscription_info?: Record<string, any> | null;
|
|
718
657
|
/**
|
|
719
658
|
* The organization's configuration.
|
|
720
|
-
* @example ```{"mfe":{"language":"it-IT","default":{"links":{"cart":"https://cart.example.com/:order_id?accessToken=:access_token","checkout":"https://checkout.example.com/:order_id?accessToken=:access_token","identity":"https://example.com/login","microstore":"https://example.com/microstore/?accessToken=:access_token","my_account":"https://example.com/my-custom-account?accessToken=:access_token"},"checkout":{"optional_billing_info":false,"thankyou_page":"https://example.com/thanks/:lang/:order_id","billing_countries":[{"value":"ES","label":"Espana"},{"value":"IT","label":"Italia"},{"value":"US","label":"Unites States of America"}],"shipping_countries":[{"value":"ES","label":"Espana"},{"value":"IT","label":"Italia"},{"value":"US","label":"Unites States of America"}],"billing_states":{"FR":[{"value":"PA","label":"Paris"},{"value":"LY","label":"Lyon"},{"value":"NI","label":"Nice"},{"value":"MA","label":"Marseille"},{"value":"BO","label":"Bordeaux"}]},"shipping_states":{"FR":[{"value":"PA","label":"Paris"},{"value":"LY","label":"Lyon"},{"value":"NI","label":"Nice"},{"value":"MA","label":"Marseille"},{"value":"BO","label":"Bordeaux"}]},"default_country":"US"},"urls":{"privacy":"https://example.com/privacy/:lang","terms":"https://example.com/terms/:lang"}},"market:id:ZKcv13rT":{"links":{"cart":"https://example.com/custom-cart/:order_id?accessToken=:access_token"},"checkout":{"thankyou_page":"https://example.com/thanks/:order_id"}}}}```
|
|
659
|
+
* @example ```{"mfe":{"language":"it-IT","default":{"links":{"cart":"https://cart.example.com/:order_id?accessToken=:access_token","checkout":"https://checkout.example.com/:order_id?accessToken=:access_token","identity":"https://example.com/login","microstore":"https://example.com/microstore/?accessToken=:access_token","my_account":"https://example.com/my-custom-account?accessToken=:access_token"},"checkout":{"optional_billing_info":false,"thankyou_page":"https://example.com/thanks/:lang/:order_id","billing_countries":[{"value":"ES","label":"Espana"},{"value":"IT","label":"Italia"},{"value":"US","label":"Unites States of America"}],"shipping_countries":[{"value":"ES","label":"Espana"},{"value":"IT","label":"Italia"},{"value":"US","label":"Unites States of America"}],"billing_states":{"FR":[{"value":"PA","label":"Paris"},{"value":"LY","label":"Lyon"},{"value":"NI","label":"Nice"},{"value":"MA","label":"Marseille"},{"value":"BO","label":"Bordeaux"}]},"shipping_states":{"FR":[{"value":"PA","label":"Paris"},{"value":"LY","label":"Lyon"},{"value":"NI","label":"Nice"},{"value":"MA","label":"Marseille"},{"value":"BO","label":"Bordeaux"}]},"default_country":"US"},"urls":{"privacy":"https://example.com/privacy/:lang","terms":"https://example.com/terms/:lang"}},"market:id:ZKcv13rT":{"links":{"cart":"https://example.com/custom-cart/:order_id?accessToken=:access_token"},"checkout":{"thankyou_page":"https://example.com/thanks/:order_id"}}},"well-known":{"shopping":{"catalog_mcp_url":"https://catalog-mcp.example.com/mcp","client_id":"abc123example","locale_scopes":{"it-IT":{"id":"ZKcv13rT"},"en-US":{"id":"ZKcv13rT"}},"ui":{"domain":"","csp":{"resourceDomains":["https://data.commercelayer.app","https://cdn.brand.com"],"baseUriDomains":[],"connectDomains":[],"frameDomains":[]}}}}}```
|
|
721
660
|
*/
|
|
722
|
-
config?:
|
|
661
|
+
config?: Record<string, any> | null;
|
|
723
662
|
/**
|
|
724
663
|
* Enables the redirect on the new Auth API.
|
|
725
|
-
* @example ```
|
|
664
|
+
* @example ```true```
|
|
665
|
+
*/
|
|
666
|
+
api_auth_redirect?: boolean | null;
|
|
667
|
+
/**
|
|
668
|
+
* Enables fragment caching for resources with related directive.
|
|
726
669
|
*/
|
|
727
|
-
|
|
670
|
+
api_fragment_caching_enabled?: boolean | null;
|
|
728
671
|
/**
|
|
729
672
|
* Enables the rules engine for flex promotions and price list rules.
|
|
730
673
|
*/
|
|
731
|
-
api_rules_engine
|
|
674
|
+
api_rules_engine?: boolean | null;
|
|
732
675
|
/**
|
|
733
|
-
* The fallback maximum number of conditions within a rules payload on a ruleable object, default is
|
|
734
|
-
* @example ```
|
|
676
|
+
* The fallback maximum number of conditions within a rules payload on a ruleable object, default is {API_RULES_ENGINE_MAX_CONDITIONS_SIZE}.
|
|
677
|
+
* @example ```150```
|
|
735
678
|
*/
|
|
736
|
-
api_rules_engine_max_conditions_size
|
|
679
|
+
api_rules_engine_max_conditions_size?: number | null;
|
|
737
680
|
/**
|
|
738
|
-
* The fallback maximum number of rules within a rules payload on a ruleable object, default is
|
|
739
|
-
* @example ```
|
|
681
|
+
* The fallback maximum number of rules within a rules payload on a ruleable object, default is {API_RULES_ENGINE_MAX_RULES_SIZE}.
|
|
682
|
+
* @example ```15```
|
|
740
683
|
*/
|
|
741
|
-
api_rules_engine_max_rules_size
|
|
684
|
+
api_rules_engine_max_rules_size?: number | null;
|
|
742
685
|
/**
|
|
743
686
|
* Forces the usage of the new Authentication API.
|
|
744
|
-
* @example ```
|
|
687
|
+
* @example ```true```
|
|
745
688
|
*/
|
|
746
|
-
api_new_auth
|
|
689
|
+
api_new_auth?: boolean | null;
|
|
747
690
|
/**
|
|
748
691
|
* Enables the purge of cached single resources when list is purged.
|
|
749
692
|
*/
|
|
750
|
-
api_purge_single_resource
|
|
693
|
+
api_purge_single_resource?: boolean | null;
|
|
751
694
|
/**
|
|
752
|
-
* The maximum length for the regular expressions, default is
|
|
753
|
-
* @example ```
|
|
695
|
+
* The maximum length for the regular expressions, default is {API_MAX_REGEX_LENGTH}.
|
|
696
|
+
* @example ```5000```
|
|
754
697
|
*/
|
|
755
|
-
api_max_regex_length
|
|
698
|
+
api_max_regex_length?: number | null;
|
|
756
699
|
/**
|
|
757
|
-
* Indicates if AVS checking will be enforced during payment workflow by passing specific attributes, default is
|
|
758
|
-
* @example ```
|
|
700
|
+
* Indicates if AVS checking will be enforced during payment workflow by passing specific attributes, default is {ADDRESSES_AVS_CHECK}.
|
|
701
|
+
* @example ```true```
|
|
759
702
|
*/
|
|
760
|
-
addresses_avs_check
|
|
703
|
+
addresses_avs_check?: boolean | null;
|
|
761
704
|
/**
|
|
762
|
-
* Indicates if the phone attribute is required for addresses, default is
|
|
763
|
-
* @example ```
|
|
705
|
+
* Indicates if the phone attribute is required for addresses, default is {ADDRESSES_PHONE_REQUIRED}.
|
|
706
|
+
* @example ```true```
|
|
764
707
|
*/
|
|
765
|
-
addresses_phone_required
|
|
708
|
+
addresses_phone_required?: boolean | null;
|
|
766
709
|
/**
|
|
767
710
|
* Indicates if a sales channel application without customer can read and update just guest orders.
|
|
768
|
-
* @example ```
|
|
711
|
+
* @example ```true```
|
|
769
712
|
*/
|
|
770
|
-
orders_sales_channel_guest_only
|
|
713
|
+
orders_sales_channel_guest_only?: boolean | null;
|
|
771
714
|
/**
|
|
772
715
|
* The minimum lapse in fraction of seconds to be observed between two consecutive shipments rebuilt. If shipments rebuilt is triggered within the minimum lapse, the update is performed, but no rebuilt is done.
|
|
773
716
|
*/
|
|
774
|
-
orders_min_rebuild_shipments_lapse
|
|
717
|
+
orders_min_rebuild_shipments_lapse?: number | null;
|
|
775
718
|
/**
|
|
776
719
|
* The minimum lapse in fraction of seconds to be observed between two consecutive order refreshes. If refresh is triggered within the minimum lapse, the update is performed, but no order refresh is done.
|
|
777
720
|
*/
|
|
778
|
-
orders_min_refresh_lapse
|
|
721
|
+
orders_min_refresh_lapse?: number | null;
|
|
779
722
|
/**
|
|
780
723
|
* The maximum number line items allowed for a test order before disabling the autorefresh option.
|
|
781
|
-
* @example ```
|
|
724
|
+
* @example ```50```
|
|
782
725
|
*/
|
|
783
|
-
orders_autorefresh_cutoff_test
|
|
726
|
+
orders_autorefresh_cutoff_test?: number | null;
|
|
784
727
|
/**
|
|
785
728
|
* The maximum number line items allowed for a live order before disabling the autorefresh option.
|
|
786
|
-
* @example ```
|
|
729
|
+
* @example ```500```
|
|
787
730
|
*/
|
|
788
|
-
orders_autorefresh_cutoff_live
|
|
731
|
+
orders_autorefresh_cutoff_live?: number | null;
|
|
789
732
|
/**
|
|
790
733
|
* Enables orders number editing as a string in test (for enterprise plans only).
|
|
791
734
|
*/
|
|
792
|
-
orders_number_editable_test
|
|
735
|
+
orders_number_editable_test?: boolean | null;
|
|
793
736
|
/**
|
|
794
737
|
* Enables orders number editing as a string in live (for enterprise plans only).
|
|
795
738
|
*/
|
|
796
|
-
orders_number_editable_live
|
|
739
|
+
orders_number_editable_live?: boolean | null;
|
|
797
740
|
/**
|
|
798
741
|
* Enables to use the order number as payment reference on supported gateways.
|
|
799
|
-
* @example ```
|
|
742
|
+
* @example ```true```
|
|
800
743
|
*/
|
|
801
|
-
orders_number_as_reference
|
|
744
|
+
orders_number_as_reference?: boolean | null;
|
|
802
745
|
/**
|
|
803
|
-
* Enables raising of API errors in case the provided coupon code is invalid, default is
|
|
804
|
-
* @example ```
|
|
746
|
+
* Enables raising of API errors in case the provided coupon code is invalid, default is {ORDERS_INVALID_COUPON_ERRORS}.
|
|
747
|
+
* @example ```true```
|
|
805
748
|
*/
|
|
806
|
-
orders_invalid_coupon_errors
|
|
749
|
+
orders_invalid_coupon_errors?: boolean | null;
|
|
807
750
|
/**
|
|
808
|
-
* Enables raising of API errors in case the provided gift card code is invalid, default is
|
|
809
|
-
* @example ```
|
|
751
|
+
* Enables raising of API errors in case the provided gift card code is invalid, default is {ORDERS_INVALID_GIFT_CARD_ERRORS}.
|
|
752
|
+
* @example ```true```
|
|
810
753
|
*/
|
|
811
|
-
orders_invalid_gift_card_errors
|
|
754
|
+
orders_invalid_gift_card_errors?: boolean | null;
|
|
812
755
|
/**
|
|
813
|
-
* Enables the validation of the generated stock line items and stock transfers before placing the order, default is
|
|
756
|
+
* Enables the validation of the generated stock line items and stock transfers before placing the order, default is {ORDERS_VALIDATE_SHIPPING_STOCK}.
|
|
814
757
|
*/
|
|
815
|
-
orders_validate_shipping_stock
|
|
758
|
+
orders_validate_shipping_stock?: boolean | null;
|
|
816
759
|
/**
|
|
817
|
-
* The maximum number of SKUs allowed for bundles, default is
|
|
818
|
-
* @example ```
|
|
760
|
+
* The maximum number of SKUs allowed for bundles, default is {BUNDLES_MAX_ITEMS_COUNT}.
|
|
761
|
+
* @example ```10```
|
|
819
762
|
*/
|
|
820
|
-
bundles_max_items_count
|
|
763
|
+
bundles_max_items_count?: number | null;
|
|
821
764
|
/**
|
|
822
|
-
* The minimum length for coupon code, default is
|
|
823
|
-
* @example ```
|
|
765
|
+
* The minimum length for coupon code, default is {COUPONS_MIN_CODE_LENGTH}.
|
|
766
|
+
* @example ```8```
|
|
824
767
|
*/
|
|
825
|
-
coupons_min_code_length
|
|
768
|
+
coupons_min_code_length?: number | null;
|
|
826
769
|
/**
|
|
827
|
-
* The maximum length for coupon code, default is
|
|
828
|
-
* @example ```
|
|
770
|
+
* The maximum length for coupon code, default is {COUPONS_MAX_CODE_LENGTH}.
|
|
771
|
+
* @example ```40```
|
|
829
772
|
*/
|
|
830
|
-
coupons_max_code_length
|
|
773
|
+
coupons_max_code_length?: number | null;
|
|
831
774
|
/**
|
|
832
|
-
* Enables matching the gift card code by its exact value, instead of by its first charachters, default is
|
|
775
|
+
* Enables matching the gift card code by its exact value, instead of by its first charachters, default is {GIFT_CARDS_EXACT_CODE_MATCHING}.
|
|
833
776
|
*/
|
|
834
|
-
gift_cards_exact_code_matching
|
|
777
|
+
gift_cards_exact_code_matching?: boolean | null;
|
|
835
778
|
/**
|
|
836
|
-
* The minimum length for gift card code, default is
|
|
837
|
-
* @example ```
|
|
779
|
+
* The minimum length for gift card code, default is {GIFT_CARDS_MIN_CODE_LENGTH}.
|
|
780
|
+
* @example ```8```
|
|
838
781
|
*/
|
|
839
|
-
gift_cards_min_code_length
|
|
782
|
+
gift_cards_min_code_length?: number | null;
|
|
840
783
|
/**
|
|
841
|
-
* The maximum length for gift card code, default is
|
|
842
|
-
* @example ```
|
|
784
|
+
* The maximum length for gift card code, default is {GIFT_CARDS_MAX_CODE_LENGTH}.
|
|
785
|
+
* @example ```40```
|
|
843
786
|
*/
|
|
844
|
-
gift_cards_max_code_length
|
|
787
|
+
gift_cards_max_code_length?: number | null;
|
|
845
788
|
/**
|
|
846
|
-
* The maximum number of concurrent cleanups allowed for your organization, default is
|
|
847
|
-
* @example ```
|
|
789
|
+
* The maximum number of concurrent cleanups allowed for your organization, default is {CLEANUPS_MAX_CONCURRENT_COUNT}.
|
|
790
|
+
* @example ```10```
|
|
848
791
|
*/
|
|
849
|
-
cleanups_max_concurrent_count
|
|
792
|
+
cleanups_max_concurrent_count?: number | null;
|
|
850
793
|
/**
|
|
851
|
-
* The maximum number of concurrent exports allowed for your organization, default is
|
|
852
|
-
* @example ```
|
|
794
|
+
* The maximum number of concurrent exports allowed for your organization, default is {EXPORTS_MAX_CONCURRENT_COUNT}.
|
|
795
|
+
* @example ```10```
|
|
853
796
|
*/
|
|
854
|
-
exports_max_concurrent_count
|
|
797
|
+
exports_max_concurrent_count?: number | null;
|
|
855
798
|
/**
|
|
856
|
-
* The maximum number of concurrent imports allowed for your organization, default is
|
|
857
|
-
* @example ```
|
|
799
|
+
* The maximum number of concurrent imports allowed for your organization, default is {IMPORTS_MAX_CONCURRENT_COUNT}.
|
|
800
|
+
* @example ```10```
|
|
858
801
|
*/
|
|
859
|
-
imports_max_concurrent_count
|
|
802
|
+
imports_max_concurrent_count?: number | null;
|
|
860
803
|
/**
|
|
861
804
|
* Enables purging of cached resources upon succeeded imports.
|
|
862
|
-
* @example ```
|
|
805
|
+
* @example ```true```
|
|
863
806
|
*/
|
|
864
|
-
imports_purge_cache
|
|
807
|
+
imports_purge_cache?: boolean | null;
|
|
865
808
|
/**
|
|
866
|
-
* Disables the interruption of the import in case its errors exceeds the 10% threshold, default is
|
|
809
|
+
* Disables the interruption of the import in case its errors exceeds the 10% threshold, default is {IMPORTS_SKIP_ERRORS}.
|
|
867
810
|
*/
|
|
868
|
-
imports_skip_errors
|
|
811
|
+
imports_skip_errors?: boolean | null;
|
|
869
812
|
/**
|
|
870
|
-
* The maximum number for stock locations cutoff, default is
|
|
871
|
-
* @example ```
|
|
813
|
+
* The maximum number for stock locations cutoff, default is {INVENTORY_MODELS_MAX_STOCK_LOCATIONS_CUTOFF}.
|
|
814
|
+
* @example ```10```
|
|
872
815
|
*/
|
|
873
|
-
inventory_models_max_stock_locations_cutoff
|
|
816
|
+
inventory_models_max_stock_locations_cutoff?: number | null;
|
|
874
817
|
/**
|
|
875
|
-
* The maximum number of active concurrent promotions allowed for your organization, default is
|
|
876
|
-
* @example ```
|
|
818
|
+
* The maximum number of active concurrent promotions allowed for your organization, default is {PROMOTIONS_MAX_CONCURRENT_COUNT}.
|
|
819
|
+
* @example ```10```
|
|
877
820
|
*/
|
|
878
|
-
promotions_max_concurrent_count
|
|
821
|
+
promotions_max_concurrent_count?: number | null;
|
|
879
822
|
/**
|
|
880
|
-
* The maximum number of conditions within a rules payload on a promotion object, default is
|
|
881
|
-
* @example ```
|
|
823
|
+
* The maximum number of conditions within a rules payload on a promotion object, default is {PROMOTIONS_MAX_CONDITIONS_SIZE}.
|
|
824
|
+
* @example ```150```
|
|
882
825
|
*/
|
|
883
|
-
promotions_max_conditions_size
|
|
826
|
+
promotions_max_conditions_size?: number | null;
|
|
884
827
|
/**
|
|
885
|
-
* The maximum number of rules within a rules payload on a promotion object, default is
|
|
886
|
-
* @example ```
|
|
828
|
+
* The maximum number of rules within a rules payload on a promotion object, default is {PROMOTIONS_MAX_RULES_SIZE}.
|
|
829
|
+
* @example ```15```
|
|
887
830
|
*/
|
|
888
|
-
promotions_max_rules_size
|
|
831
|
+
promotions_max_rules_size?: number | null;
|
|
889
832
|
/**
|
|
890
|
-
* The maximum number of conditions within a rules payload on a price list object, default is
|
|
891
|
-
* @example ```
|
|
833
|
+
* The maximum number of conditions within a rules payload on a price list object, default is {PRICE_LISTS_MAX_CONDITIONS_SIZE}.
|
|
834
|
+
* @example ```150```
|
|
892
835
|
*/
|
|
893
|
-
price_lists_max_conditions_size
|
|
836
|
+
price_lists_max_conditions_size?: number | null;
|
|
894
837
|
/**
|
|
895
|
-
* The maximum number of rules within a rules payload on a price list object, default is
|
|
896
|
-
* @example ```
|
|
838
|
+
* The maximum number of rules within a rules payload on a price list object, default is {PRICE_LISTS_MAX_RULES_SIZE}.
|
|
839
|
+
* @example ```15```
|
|
897
840
|
*/
|
|
898
|
-
price_lists_max_rules_size
|
|
841
|
+
price_lists_max_rules_size?: number | null;
|
|
899
842
|
/**
|
|
900
|
-
* Enables triggering of webhooks during imports, default is
|
|
843
|
+
* Enables triggering of webhooks during imports, default is {IMPORTS_TRIGGER_WEBHOOKS}.
|
|
844
|
+
* @example ```"false"```
|
|
901
845
|
*/
|
|
902
|
-
imports_trigger_webhooks
|
|
846
|
+
imports_trigger_webhooks?: number | null;
|
|
903
847
|
/**
|
|
904
|
-
* Enables the use of an external discount engine in place of the standard one, default is
|
|
848
|
+
* Enables the use of an external discount engine in place of the standard one, default is {DISCOUNT_ENGINES_ENABLED}.
|
|
905
849
|
*/
|
|
906
|
-
discount_engines_enabled
|
|
850
|
+
discount_engines_enabled?: boolean | null;
|
|
907
851
|
/**
|
|
908
|
-
* Enables raising of API errors in case of discount engine failure, default is
|
|
852
|
+
* Enables raising of API errors in case of discount engine failure, default is {DISCOUNT_ENGINES_ERRORS}.
|
|
909
853
|
*/
|
|
910
|
-
discount_engines_errors
|
|
854
|
+
discount_engines_errors?: boolean | null;
|
|
911
855
|
/**
|
|
912
|
-
* The maximum length for the tag name, default is
|
|
913
|
-
* @example ```
|
|
856
|
+
* The maximum length for the tag name, default is {TAGS_MAX_NAME_LENGTH}.
|
|
857
|
+
* @example ```25```
|
|
914
858
|
*/
|
|
915
|
-
tags_max_name_length
|
|
859
|
+
tags_max_name_length?: number | null;
|
|
916
860
|
/**
|
|
917
|
-
* The maximum allowed number of tags for each resource, default is
|
|
918
|
-
* @example ```
|
|
861
|
+
* The maximum allowed number of tags for each resource, default is {TAGS_MAX_ALLOWED_NUMBER}.
|
|
862
|
+
* @example ```10```
|
|
919
863
|
*/
|
|
920
|
-
tags_max_allowed_number
|
|
864
|
+
tags_max_allowed_number?: number | null;
|
|
921
865
|
/**
|
|
922
|
-
* Enables raising of API errors in case of tax calculation failure, default is
|
|
866
|
+
* Enables raising of API errors in case of tax calculation failure, default is {TAX_CALCULATORS_ERRORS}.
|
|
923
867
|
*/
|
|
924
|
-
tax_calculators_errors
|
|
868
|
+
tax_calculators_errors?: boolean | null;
|
|
925
869
|
/**
|
|
926
|
-
* Enables raising of API errors in case of external promotion failure, default is
|
|
870
|
+
* Enables raising of API errors in case of external promotion failure, default is {EXTERNAL_PROMOTIONS_ERRORS}.
|
|
927
871
|
*/
|
|
928
|
-
external_promotions_errors
|
|
872
|
+
external_promotions_errors?: boolean | null;
|
|
929
873
|
/**
|
|
930
|
-
* Enables raising of API errors in case of external price failure, default is
|
|
931
|
-
* @example ```
|
|
874
|
+
* Enables raising of API errors in case of external price failure, default is {EXTERNAL_PRICES_ERRORS}.
|
|
875
|
+
* @example ```true```
|
|
932
876
|
*/
|
|
933
|
-
external_prices_errors
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
877
|
+
external_prices_errors?: boolean | null;
|
|
878
|
+
/**
|
|
879
|
+
* Enables the Sku discovery by similarity search.
|
|
880
|
+
*/
|
|
881
|
+
skus_discovery?: boolean | null;
|
|
882
|
+
/**
|
|
883
|
+
* Enables the creation of the authorization when the gateway event is received, even if there is no reference on Commerce Layer.
|
|
884
|
+
*/
|
|
885
|
+
payment_gateways_transaction_on_event?: boolean | null;
|
|
886
|
+
memberships?: Membership[] | null;
|
|
887
|
+
roles?: Role[] | null;
|
|
888
|
+
permissions?: Permission[] | null;
|
|
889
|
+
api_credentials?: ApiCredential[] | null;
|
|
938
890
|
}
|
|
939
891
|
interface OrganizationCreate extends ResourceCreate {
|
|
940
892
|
/**
|
|
@@ -946,125 +898,120 @@ interface OrganizationCreate extends ResourceCreate {
|
|
|
946
898
|
* The organization's support phone.
|
|
947
899
|
* @example ```"+01 30800857"```
|
|
948
900
|
*/
|
|
949
|
-
support_phone?:
|
|
901
|
+
support_phone?: string | null;
|
|
950
902
|
/**
|
|
951
903
|
* The organization's support email.
|
|
952
904
|
* @example ```"support@bluebrand.com"```
|
|
953
905
|
*/
|
|
954
|
-
support_email?:
|
|
906
|
+
support_email?: string | null;
|
|
955
907
|
/**
|
|
956
908
|
* The URL to the organization's logo.
|
|
957
909
|
* @example ```"https://bluebrand.com/img/logo.svg"```
|
|
958
910
|
*/
|
|
959
|
-
logo_url?:
|
|
911
|
+
logo_url?: string | null;
|
|
960
912
|
/**
|
|
961
913
|
* The URL to the organization's favicon.
|
|
962
914
|
* @example ```"https://bluebrand.com/img/favicon.ico"```
|
|
963
915
|
*/
|
|
964
|
-
favicon_url?:
|
|
916
|
+
favicon_url?: string | null;
|
|
965
917
|
/**
|
|
966
918
|
* The organization's primary color.
|
|
967
919
|
* @example ```"#C8984E"```
|
|
968
920
|
*/
|
|
969
|
-
primary_color?:
|
|
921
|
+
primary_color?: string | null;
|
|
970
922
|
/**
|
|
971
923
|
* The organization's contrast color. Format is HEX (starts with `#` and is followed by six letters and/or numbers).
|
|
972
924
|
* @example ```"#FFFFCC"```
|
|
973
925
|
*/
|
|
974
|
-
contrast_color?:
|
|
926
|
+
contrast_color?: string | null;
|
|
975
927
|
/**
|
|
976
928
|
* The organization's Google Tag Manager ID.
|
|
977
929
|
* @example ```"GTM-5FJXX6"```
|
|
978
930
|
*/
|
|
979
|
-
gtm_id?:
|
|
931
|
+
gtm_id?: string | null;
|
|
980
932
|
/**
|
|
981
933
|
* The organization's Google Tag Manager ID for test.
|
|
982
934
|
* @example ```"GTM-5FJXX7"```
|
|
983
935
|
*/
|
|
984
|
-
gtm_id_test?:
|
|
936
|
+
gtm_id_test?: string | null;
|
|
985
937
|
/**
|
|
986
938
|
* The region where the organization is located. The default value is `eu-west-1`.
|
|
987
939
|
* @example ```"eu-west-1"```
|
|
988
940
|
*/
|
|
989
|
-
region?:
|
|
941
|
+
region?: string | null;
|
|
990
942
|
/**
|
|
991
943
|
* The organization's configuration.
|
|
992
|
-
* @example ```{"mfe":{"language":"it-IT","default":{"links":{"cart":"https://cart.example.com/:order_id?accessToken=:access_token","checkout":"https://checkout.example.com/:order_id?accessToken=:access_token","identity":"https://example.com/login","microstore":"https://example.com/microstore/?accessToken=:access_token","my_account":"https://example.com/my-custom-account?accessToken=:access_token"},"checkout":{"optional_billing_info":false,"thankyou_page":"https://example.com/thanks/:lang/:order_id","billing_countries":[{"value":"ES","label":"Espana"},{"value":"IT","label":"Italia"},{"value":"US","label":"Unites States of America"}],"shipping_countries":[{"value":"ES","label":"Espana"},{"value":"IT","label":"Italia"},{"value":"US","label":"Unites States of America"}],"billing_states":{"FR":[{"value":"PA","label":"Paris"},{"value":"LY","label":"Lyon"},{"value":"NI","label":"Nice"},{"value":"MA","label":"Marseille"},{"value":"BO","label":"Bordeaux"}]},"shipping_states":{"FR":[{"value":"PA","label":"Paris"},{"value":"LY","label":"Lyon"},{"value":"NI","label":"Nice"},{"value":"MA","label":"Marseille"},{"value":"BO","label":"Bordeaux"}]},"default_country":"US"},"urls":{"privacy":"https://example.com/privacy/:lang","terms":"https://example.com/terms/:lang"}},"market:id:ZKcv13rT":{"links":{"cart":"https://example.com/custom-cart/:order_id?accessToken=:access_token"},"checkout":{"thankyou_page":"https://example.com/thanks/:order_id"}}}}```
|
|
944
|
+
* @example ```{"mfe":{"language":"it-IT","default":{"links":{"cart":"https://cart.example.com/:order_id?accessToken=:access_token","checkout":"https://checkout.example.com/:order_id?accessToken=:access_token","identity":"https://example.com/login","microstore":"https://example.com/microstore/?accessToken=:access_token","my_account":"https://example.com/my-custom-account?accessToken=:access_token"},"checkout":{"optional_billing_info":false,"thankyou_page":"https://example.com/thanks/:lang/:order_id","billing_countries":[{"value":"ES","label":"Espana"},{"value":"IT","label":"Italia"},{"value":"US","label":"Unites States of America"}],"shipping_countries":[{"value":"ES","label":"Espana"},{"value":"IT","label":"Italia"},{"value":"US","label":"Unites States of America"}],"billing_states":{"FR":[{"value":"PA","label":"Paris"},{"value":"LY","label":"Lyon"},{"value":"NI","label":"Nice"},{"value":"MA","label":"Marseille"},{"value":"BO","label":"Bordeaux"}]},"shipping_states":{"FR":[{"value":"PA","label":"Paris"},{"value":"LY","label":"Lyon"},{"value":"NI","label":"Nice"},{"value":"MA","label":"Marseille"},{"value":"BO","label":"Bordeaux"}]},"default_country":"US"},"urls":{"privacy":"https://example.com/privacy/:lang","terms":"https://example.com/terms/:lang"}},"market:id:ZKcv13rT":{"links":{"cart":"https://example.com/custom-cart/:order_id?accessToken=:access_token"},"checkout":{"thankyou_page":"https://example.com/thanks/:order_id"}}},"well-known":{"shopping":{"catalog_mcp_url":"https://catalog-mcp.example.com/mcp","client_id":"abc123example","locale_scopes":{"it-IT":{"id":"ZKcv13rT"},"en-US":{"id":"ZKcv13rT"}},"ui":{"domain":"","csp":{"resourceDomains":["https://data.commercelayer.app","https://cdn.brand.com"],"baseUriDomains":[],"connectDomains":[],"frameDomains":[]}}}}}```
|
|
993
945
|
*/
|
|
994
|
-
config?:
|
|
946
|
+
config?: Record<string, any> | null;
|
|
995
947
|
}
|
|
996
948
|
interface OrganizationUpdate extends ResourceUpdate {
|
|
997
949
|
/**
|
|
998
950
|
* The organization's internal name.
|
|
999
951
|
* @example ```"The Blue Brand"```
|
|
1000
952
|
*/
|
|
1001
|
-
name?:
|
|
953
|
+
name?: string | null;
|
|
1002
954
|
/**
|
|
1003
955
|
* The organization's support phone.
|
|
1004
956
|
* @example ```"+01 30800857"```
|
|
1005
957
|
*/
|
|
1006
|
-
support_phone?:
|
|
958
|
+
support_phone?: string | null;
|
|
1007
959
|
/**
|
|
1008
960
|
* The organization's support email.
|
|
1009
961
|
* @example ```"support@bluebrand.com"```
|
|
1010
962
|
*/
|
|
1011
|
-
support_email?:
|
|
963
|
+
support_email?: string | null;
|
|
1012
964
|
/**
|
|
1013
965
|
* The URL to the organization's logo.
|
|
1014
966
|
* @example ```"https://bluebrand.com/img/logo.svg"```
|
|
1015
967
|
*/
|
|
1016
|
-
logo_url?:
|
|
968
|
+
logo_url?: string | null;
|
|
1017
969
|
/**
|
|
1018
970
|
* The URL to the organization's favicon.
|
|
1019
971
|
* @example ```"https://bluebrand.com/img/favicon.ico"```
|
|
1020
972
|
*/
|
|
1021
|
-
favicon_url?:
|
|
973
|
+
favicon_url?: string | null;
|
|
1022
974
|
/**
|
|
1023
975
|
* The organization's primary color.
|
|
1024
976
|
* @example ```"#C8984E"```
|
|
1025
977
|
*/
|
|
1026
|
-
primary_color?:
|
|
978
|
+
primary_color?: string | null;
|
|
1027
979
|
/**
|
|
1028
980
|
* The organization's contrast color. Format is HEX (starts with `#` and is followed by six letters and/or numbers).
|
|
1029
981
|
* @example ```"#FFFFCC"```
|
|
1030
982
|
*/
|
|
1031
|
-
contrast_color?:
|
|
983
|
+
contrast_color?: string | null;
|
|
1032
984
|
/**
|
|
1033
985
|
* The organization's Google Tag Manager ID.
|
|
1034
986
|
* @example ```"GTM-5FJXX6"```
|
|
1035
987
|
*/
|
|
1036
|
-
gtm_id?:
|
|
988
|
+
gtm_id?: string | null;
|
|
1037
989
|
/**
|
|
1038
990
|
* The organization's Google Tag Manager ID for test.
|
|
1039
991
|
* @example ```"GTM-5FJXX7"```
|
|
1040
992
|
*/
|
|
1041
|
-
gtm_id_test?:
|
|
993
|
+
gtm_id_test?: string | null;
|
|
1042
994
|
/**
|
|
1043
995
|
* The organization's configuration.
|
|
1044
|
-
* @example ```{"mfe":{"language":"it-IT","default":{"links":{"cart":"https://cart.example.com/:order_id?accessToken=:access_token","checkout":"https://checkout.example.com/:order_id?accessToken=:access_token","identity":"https://example.com/login","microstore":"https://example.com/microstore/?accessToken=:access_token","my_account":"https://example.com/my-custom-account?accessToken=:access_token"},"checkout":{"optional_billing_info":false,"thankyou_page":"https://example.com/thanks/:lang/:order_id","billing_countries":[{"value":"ES","label":"Espana"},{"value":"IT","label":"Italia"},{"value":"US","label":"Unites States of America"}],"shipping_countries":[{"value":"ES","label":"Espana"},{"value":"IT","label":"Italia"},{"value":"US","label":"Unites States of America"}],"billing_states":{"FR":[{"value":"PA","label":"Paris"},{"value":"LY","label":"Lyon"},{"value":"NI","label":"Nice"},{"value":"MA","label":"Marseille"},{"value":"BO","label":"Bordeaux"}]},"shipping_states":{"FR":[{"value":"PA","label":"Paris"},{"value":"LY","label":"Lyon"},{"value":"NI","label":"Nice"},{"value":"MA","label":"Marseille"},{"value":"BO","label":"Bordeaux"}]},"default_country":"US"},"urls":{"privacy":"https://example.com/privacy/:lang","terms":"https://example.com/terms/:lang"}},"market:id:ZKcv13rT":{"links":{"cart":"https://example.com/custom-cart/:order_id?accessToken=:access_token"},"checkout":{"thankyou_page":"https://example.com/thanks/:order_id"}}}}```
|
|
996
|
+
* @example ```{"mfe":{"language":"it-IT","default":{"links":{"cart":"https://cart.example.com/:order_id?accessToken=:access_token","checkout":"https://checkout.example.com/:order_id?accessToken=:access_token","identity":"https://example.com/login","microstore":"https://example.com/microstore/?accessToken=:access_token","my_account":"https://example.com/my-custom-account?accessToken=:access_token"},"checkout":{"optional_billing_info":false,"thankyou_page":"https://example.com/thanks/:lang/:order_id","billing_countries":[{"value":"ES","label":"Espana"},{"value":"IT","label":"Italia"},{"value":"US","label":"Unites States of America"}],"shipping_countries":[{"value":"ES","label":"Espana"},{"value":"IT","label":"Italia"},{"value":"US","label":"Unites States of America"}],"billing_states":{"FR":[{"value":"PA","label":"Paris"},{"value":"LY","label":"Lyon"},{"value":"NI","label":"Nice"},{"value":"MA","label":"Marseille"},{"value":"BO","label":"Bordeaux"}]},"shipping_states":{"FR":[{"value":"PA","label":"Paris"},{"value":"LY","label":"Lyon"},{"value":"NI","label":"Nice"},{"value":"MA","label":"Marseille"},{"value":"BO","label":"Bordeaux"}]},"default_country":"US"},"urls":{"privacy":"https://example.com/privacy/:lang","terms":"https://example.com/terms/:lang"}},"market:id:ZKcv13rT":{"links":{"cart":"https://example.com/custom-cart/:order_id?accessToken=:access_token"},"checkout":{"thankyou_page":"https://example.com/thanks/:order_id"}}},"well-known":{"shopping":{"catalog_mcp_url":"https://catalog-mcp.example.com/mcp","client_id":"abc123example","locale_scopes":{"it-IT":{"id":"ZKcv13rT"},"en-US":{"id":"ZKcv13rT"}},"ui":{"domain":"","csp":{"resourceDomains":["https://data.commercelayer.app","https://cdn.brand.com"],"baseUriDomains":[],"connectDomains":[],"frameDomains":[]}}}}}```
|
|
1045
997
|
*/
|
|
1046
|
-
config?:
|
|
998
|
+
config?: Record<string, any> | null;
|
|
1047
999
|
}
|
|
1048
1000
|
declare class Organizations extends ApiResource<Organization> {
|
|
1049
1001
|
static readonly TYPE: OrganizationType;
|
|
1050
1002
|
create(resource: OrganizationCreate, params?: QueryParamsRetrieve<Organization>, options?: ResourcesConfig): Promise<Organization>;
|
|
1051
1003
|
update(resource: OrganizationUpdate, params?: QueryParamsRetrieve<Organization>, options?: ResourcesConfig): Promise<Organization>;
|
|
1052
|
-
transfer_ownership(organizationId: string | Organization, payload: TransferOwnershipDataType, options?: ResourcesConfig): Promise<void>;
|
|
1053
1004
|
memberships(organizationId: string | Organization, params?: QueryParamsList<Membership>, options?: ResourcesConfig): Promise<ListResponse<Membership>>;
|
|
1054
1005
|
roles(organizationId: string | Organization, params?: QueryParamsList<Role>, options?: ResourcesConfig): Promise<ListResponse<Role>>;
|
|
1055
1006
|
permissions(organizationId: string | Organization, params?: QueryParamsList<Permission>, options?: ResourcesConfig): Promise<ListResponse<Permission>>;
|
|
1056
1007
|
api_credentials(organizationId: string | Organization, params?: QueryParamsList<ApiCredential>, options?: ResourcesConfig): Promise<ListResponse<ApiCredential>>;
|
|
1008
|
+
transfer_ownership(organizationId: string | Organization, payload: TransferOwnershipDataType, options?: ResourcesConfig): Promise<void>;
|
|
1057
1009
|
isOrganization(resource: any): resource is Organization;
|
|
1058
1010
|
relationship(id: string | ResourceId | null): OrganizationRel$1;
|
|
1059
1011
|
relationshipToMany(...ids: string[]): OrganizationRel$1[];
|
|
1060
1012
|
type(): OrganizationType;
|
|
1061
1013
|
}
|
|
1062
|
-
|
|
1063
|
-
type TransferOwnershipDataType = {
|
|
1064
|
-
type: 'organizations';
|
|
1065
|
-
id: string;
|
|
1066
|
-
new_owner_email: string;
|
|
1067
|
-
};
|
|
1014
|
+
declare const instance$3: Organizations;
|
|
1068
1015
|
|
|
1069
1016
|
type ApiCredentialType = 'api_credentials';
|
|
1070
1017
|
type ApiCredentialRel = ResourceRel & {
|
|
@@ -1076,7 +1023,12 @@ type OrganizationRel = ResourceRel & {
|
|
|
1076
1023
|
type RoleRel = ResourceRel & {
|
|
1077
1024
|
type: RoleType;
|
|
1078
1025
|
};
|
|
1079
|
-
type ApiCredentialSort = Pick<ApiCredential, 'id' | 'mode'> & ResourceSort;
|
|
1026
|
+
type ApiCredentialSort = Pick<ApiCredential, 'id' | 'name' | 'mode'> & ResourceSort;
|
|
1027
|
+
/**
|
|
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.
|
|
1029
|
+
*
|
|
1030
|
+
* @link https://docs.commercelayer.io/provisioning-api-reference/api_credentials/object
|
|
1031
|
+
*/
|
|
1080
1032
|
interface ApiCredential extends Resource {
|
|
1081
1033
|
readonly type: ApiCredentialType;
|
|
1082
1034
|
/**
|
|
@@ -1091,45 +1043,45 @@ interface ApiCredential extends Resource {
|
|
|
1091
1043
|
kind: string;
|
|
1092
1044
|
/**
|
|
1093
1045
|
* Indicates if the API credential it's confidential.
|
|
1094
|
-
* @example ```
|
|
1046
|
+
* @example ```true```
|
|
1095
1047
|
*/
|
|
1096
|
-
confidential
|
|
1048
|
+
confidential?: boolean | null;
|
|
1097
1049
|
/**
|
|
1098
1050
|
* The API credential redirect URI.
|
|
1099
1051
|
* @example ```"https://bluebrand.com/img/logo.svg"```
|
|
1100
1052
|
*/
|
|
1101
|
-
redirect_uri?:
|
|
1053
|
+
redirect_uri?: string | null;
|
|
1102
1054
|
/**
|
|
1103
1055
|
* The API credential unique ID.
|
|
1104
1056
|
* @example ```"xxxx-yyyy-zzzz"```
|
|
1105
1057
|
*/
|
|
1106
|
-
client_id
|
|
1058
|
+
client_id?: string | null;
|
|
1107
1059
|
/**
|
|
1108
1060
|
* The API credential unique secret.
|
|
1109
1061
|
* @example ```"xxxx-yyyy-zzzz"```
|
|
1110
1062
|
*/
|
|
1111
|
-
client_secret
|
|
1063
|
+
client_secret?: string | null;
|
|
1112
1064
|
/**
|
|
1113
1065
|
* The API credential scopes.
|
|
1114
1066
|
* @example ```"market:all market:9 market:122 market:6 stock_location:6 stock_location:33"```
|
|
1115
1067
|
*/
|
|
1116
|
-
scopes
|
|
1068
|
+
scopes?: string | null;
|
|
1117
1069
|
/**
|
|
1118
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).
|
|
1119
|
-
* @example ```
|
|
1071
|
+
* @example ```7200```
|
|
1120
1072
|
*/
|
|
1121
|
-
expires_in?:
|
|
1073
|
+
expires_in?: number | null;
|
|
1122
1074
|
/**
|
|
1123
1075
|
* Indicates the environment the resource belongs to (one of `test` or `live`).
|
|
1124
1076
|
* @example ```"test"```
|
|
1125
1077
|
*/
|
|
1126
|
-
mode?:
|
|
1078
|
+
mode?: string | null;
|
|
1127
1079
|
/**
|
|
1128
1080
|
* Indicates if the API credential is used to create a custom app (e.g. fork a hosted app).
|
|
1129
1081
|
*/
|
|
1130
|
-
custom?:
|
|
1131
|
-
organization?:
|
|
1132
|
-
role?:
|
|
1082
|
+
custom?: boolean | null;
|
|
1083
|
+
organization?: Organization | null;
|
|
1084
|
+
role?: Role | null;
|
|
1133
1085
|
}
|
|
1134
1086
|
interface ApiCredentialCreate extends ResourceCreate {
|
|
1135
1087
|
/**
|
|
@@ -1146,41 +1098,41 @@ interface ApiCredentialCreate extends ResourceCreate {
|
|
|
1146
1098
|
* The API credential redirect URI.
|
|
1147
1099
|
* @example ```"https://bluebrand.com/img/logo.svg"```
|
|
1148
1100
|
*/
|
|
1149
|
-
redirect_uri?:
|
|
1101
|
+
redirect_uri?: string | null;
|
|
1150
1102
|
/**
|
|
1151
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).
|
|
1152
|
-
* @example ```
|
|
1104
|
+
* @example ```7200```
|
|
1153
1105
|
*/
|
|
1154
|
-
expires_in?:
|
|
1106
|
+
expires_in?: number | null;
|
|
1155
1107
|
/**
|
|
1156
1108
|
* Indicates the environment the resource belongs to (one of `test` or `live`).
|
|
1157
1109
|
* @example ```"test"```
|
|
1158
1110
|
*/
|
|
1159
|
-
mode?:
|
|
1111
|
+
mode?: string | null;
|
|
1160
1112
|
/**
|
|
1161
1113
|
* Indicates if the API credential is used to create a custom app (e.g. fork a hosted app).
|
|
1162
1114
|
*/
|
|
1163
|
-
custom?:
|
|
1115
|
+
custom?: boolean | null;
|
|
1164
1116
|
organization: OrganizationRel;
|
|
1165
|
-
role?:
|
|
1117
|
+
role?: RoleRel | null;
|
|
1166
1118
|
}
|
|
1167
1119
|
interface ApiCredentialUpdate extends ResourceUpdate {
|
|
1168
1120
|
/**
|
|
1169
1121
|
* The API credential internal name.
|
|
1170
1122
|
* @example ```"My app"```
|
|
1171
1123
|
*/
|
|
1172
|
-
name?:
|
|
1124
|
+
name?: string | null;
|
|
1173
1125
|
/**
|
|
1174
1126
|
* The API credential redirect URI.
|
|
1175
1127
|
* @example ```"https://bluebrand.com/img/logo.svg"```
|
|
1176
1128
|
*/
|
|
1177
|
-
redirect_uri?:
|
|
1129
|
+
redirect_uri?: string | null;
|
|
1178
1130
|
/**
|
|
1179
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).
|
|
1180
|
-
* @example ```
|
|
1132
|
+
* @example ```7200```
|
|
1181
1133
|
*/
|
|
1182
|
-
expires_in?:
|
|
1183
|
-
role?:
|
|
1134
|
+
expires_in?: number | null;
|
|
1135
|
+
role?: RoleRel | null;
|
|
1184
1136
|
}
|
|
1185
1137
|
declare class ApiCredentials extends ApiResource<ApiCredential> {
|
|
1186
1138
|
static readonly TYPE: ApiCredentialType;
|
|
@@ -1194,12 +1146,18 @@ declare class ApiCredentials extends ApiResource<ApiCredential> {
|
|
|
1194
1146
|
relationshipToMany(...ids: string[]): ApiCredentialRel[];
|
|
1195
1147
|
type(): ApiCredentialType;
|
|
1196
1148
|
}
|
|
1149
|
+
declare const instance$2: ApiCredentials;
|
|
1197
1150
|
|
|
1198
1151
|
type UserType = 'users';
|
|
1199
1152
|
type UserRel = ResourceRel & {
|
|
1200
1153
|
type: UserType;
|
|
1201
1154
|
};
|
|
1202
1155
|
type UserSort = Pick<User, 'id' | 'email' | 'first_name' | 'last_name'> & ResourceSort;
|
|
1156
|
+
/**
|
|
1157
|
+
* The User object is returned as part of the response body of each successful retrieve or update API call to the /api/user endpoint.
|
|
1158
|
+
*
|
|
1159
|
+
* @link https://docs.commercelayer.io/provisioning-api-reference/users/object
|
|
1160
|
+
*/
|
|
1203
1161
|
interface User extends Resource {
|
|
1204
1162
|
readonly type: UserType;
|
|
1205
1163
|
/**
|
|
@@ -1221,33 +1179,34 @@ interface User extends Resource {
|
|
|
1221
1179
|
* The user preferred timezone.
|
|
1222
1180
|
* @example ```"UTC"```
|
|
1223
1181
|
*/
|
|
1224
|
-
time_zone?:
|
|
1182
|
+
time_zone?: string | null;
|
|
1225
1183
|
/**
|
|
1226
1184
|
* The user 2FA setting.
|
|
1185
|
+
* @example ```true```
|
|
1227
1186
|
*/
|
|
1228
|
-
otp_required_for_login
|
|
1187
|
+
otp_required_for_login?: boolean | null;
|
|
1229
1188
|
}
|
|
1230
|
-
interface UserUpdate extends
|
|
1189
|
+
interface UserUpdate extends ResourceUpdate {
|
|
1231
1190
|
/**
|
|
1232
1191
|
* The user email.
|
|
1233
1192
|
* @example ```"user@commercelayer.io"```
|
|
1234
1193
|
*/
|
|
1235
|
-
email?:
|
|
1194
|
+
email?: string | null;
|
|
1236
1195
|
/**
|
|
1237
1196
|
* The user first name.
|
|
1238
1197
|
* @example ```"John"```
|
|
1239
1198
|
*/
|
|
1240
|
-
first_name?:
|
|
1199
|
+
first_name?: string | null;
|
|
1241
1200
|
/**
|
|
1242
1201
|
* The user last name.
|
|
1243
1202
|
* @example ```"Doe"```
|
|
1244
1203
|
*/
|
|
1245
|
-
last_name?:
|
|
1204
|
+
last_name?: string | null;
|
|
1246
1205
|
/**
|
|
1247
1206
|
* The user preferred timezone.
|
|
1248
1207
|
* @example ```"UTC"```
|
|
1249
1208
|
*/
|
|
1250
|
-
time_zone?:
|
|
1209
|
+
time_zone?: string | null;
|
|
1251
1210
|
}
|
|
1252
1211
|
declare class Users extends ApiSingleton<User> {
|
|
1253
1212
|
static readonly TYPE: UserType;
|
|
@@ -1258,12 +1217,18 @@ declare class Users extends ApiSingleton<User> {
|
|
|
1258
1217
|
type(): UserType;
|
|
1259
1218
|
path(): string;
|
|
1260
1219
|
}
|
|
1220
|
+
declare const instance$1: Users;
|
|
1261
1221
|
|
|
1262
1222
|
type IdentityProviderType = 'identity_providers';
|
|
1263
1223
|
type IdentityProviderRel = ResourceRel & {
|
|
1264
1224
|
type: IdentityProviderType;
|
|
1265
1225
|
};
|
|
1266
1226
|
type IdentityProviderSort = Pick<IdentityProvider, 'id' | 'name' | 'client_id' | 'client_secret' | 'issuer' | 'status' | 'domains' | 'token_url' | 'authorize_url' | 'jwks_url' | 'txt_record' | 'organization' | 'disabled_at'> & ResourceSort;
|
|
1227
|
+
/**
|
|
1228
|
+
* The Identity provider object is returned as part of the response body of each successful list, retrieve, create, update or delete API call to the /api/identity_providers endpoint.
|
|
1229
|
+
*
|
|
1230
|
+
* @link https://docs.commercelayer.io/provisioning-api-reference/identity_providers/object
|
|
1231
|
+
*/
|
|
1267
1232
|
interface IdentityProvider extends Resource {
|
|
1268
1233
|
readonly type: IdentityProviderType;
|
|
1269
1234
|
/**
|
|
@@ -1315,18 +1280,18 @@ interface IdentityProvider extends Resource {
|
|
|
1315
1280
|
* The TXT record value used to check the domain.
|
|
1316
1281
|
* @example ```"cl-verification=a6CDk5v"```
|
|
1317
1282
|
*/
|
|
1318
|
-
txt_record
|
|
1283
|
+
txt_record?: string | null;
|
|
1319
1284
|
/**
|
|
1320
1285
|
* The organization identifier for authorize params.
|
|
1321
1286
|
* @example ```"org_76gsfs5gd"```
|
|
1322
1287
|
*/
|
|
1323
|
-
organization?:
|
|
1288
|
+
organization?: string | null;
|
|
1324
1289
|
/**
|
|
1325
1290
|
* Time at which this resource was disabled.
|
|
1326
1291
|
* @example ```"2018-01-01T12:00:00.000Z"```
|
|
1327
1292
|
*/
|
|
1328
|
-
disabled_at
|
|
1329
|
-
user?:
|
|
1293
|
+
disabled_at?: string | null;
|
|
1294
|
+
user?: User | null;
|
|
1330
1295
|
}
|
|
1331
1296
|
interface IdentityProviderCreate extends ResourceCreate {
|
|
1332
1297
|
/**
|
|
@@ -1373,74 +1338,74 @@ interface IdentityProviderCreate extends ResourceCreate {
|
|
|
1373
1338
|
* The organization identifier for authorize params.
|
|
1374
1339
|
* @example ```"org_76gsfs5gd"```
|
|
1375
1340
|
*/
|
|
1376
|
-
organization?:
|
|
1341
|
+
organization?: string | null;
|
|
1377
1342
|
/**
|
|
1378
1343
|
* Send this attribute if you want to mark this resource as disabled.
|
|
1379
|
-
* @example ```
|
|
1344
|
+
* @example ```true```
|
|
1380
1345
|
*/
|
|
1381
|
-
_disable?:
|
|
1346
|
+
_disable?: boolean | null;
|
|
1382
1347
|
/**
|
|
1383
1348
|
* Send this attribute if you want to mark this resource as enabled.
|
|
1384
|
-
* @example ```
|
|
1349
|
+
* @example ```true```
|
|
1385
1350
|
*/
|
|
1386
|
-
_enable?:
|
|
1351
|
+
_enable?: boolean | null;
|
|
1387
1352
|
}
|
|
1388
1353
|
interface IdentityProviderUpdate extends ResourceUpdate {
|
|
1389
1354
|
/**
|
|
1390
1355
|
* The name of the Identity provider.
|
|
1391
1356
|
* @example ```"Org auth0"```
|
|
1392
1357
|
*/
|
|
1393
|
-
name?:
|
|
1358
|
+
name?: string | null;
|
|
1394
1359
|
/**
|
|
1395
1360
|
* The client ID used for the auth workflow.
|
|
1396
1361
|
* @example ```"a6CDk5v1ZV99GrtOcfYVEZRnDDt"```
|
|
1397
1362
|
*/
|
|
1398
|
-
client_id?:
|
|
1363
|
+
client_id?: string | null;
|
|
1399
1364
|
/**
|
|
1400
1365
|
* The client secret used for the auth workflow.
|
|
1401
1366
|
* @example ```"s6CD55v1ZV99ArtOcfYVEZRnDDf"```
|
|
1402
1367
|
*/
|
|
1403
|
-
client_secret?:
|
|
1368
|
+
client_secret?: string | null;
|
|
1404
1369
|
/**
|
|
1405
1370
|
* The issuer used for the auth workflow.
|
|
1406
1371
|
* @example ```"https://dev.auth987.com/"```
|
|
1407
1372
|
*/
|
|
1408
|
-
issuer?:
|
|
1373
|
+
issuer?: string | null;
|
|
1409
1374
|
/**
|
|
1410
1375
|
* The list of domains in scope (comma-separated).
|
|
1411
1376
|
* @example ```"dev.auth987.com,stg.auth987.com"```
|
|
1412
1377
|
*/
|
|
1413
|
-
domains?:
|
|
1378
|
+
domains?: string | null;
|
|
1414
1379
|
/**
|
|
1415
1380
|
* The token URL used for the auth workflow.
|
|
1416
1381
|
* @example ```"https://dev.auth987.com/oauth/token"```
|
|
1417
1382
|
*/
|
|
1418
|
-
token_url?:
|
|
1383
|
+
token_url?: string | null;
|
|
1419
1384
|
/**
|
|
1420
1385
|
* The authorize URL used for the auth workflow.
|
|
1421
1386
|
* @example ```"https://dev.auth987.com/authorize"```
|
|
1422
1387
|
*/
|
|
1423
|
-
authorize_url?:
|
|
1388
|
+
authorize_url?: string | null;
|
|
1424
1389
|
/**
|
|
1425
1390
|
* The JWKS key store URL used for the auth workflow.
|
|
1426
1391
|
* @example ```"https://dev.auth987.com/.well-known/jwks.json"```
|
|
1427
1392
|
*/
|
|
1428
|
-
jwks_url?:
|
|
1393
|
+
jwks_url?: string | null;
|
|
1429
1394
|
/**
|
|
1430
1395
|
* The organization identifier for authorize params.
|
|
1431
1396
|
* @example ```"org_76gsfs5gd"```
|
|
1432
1397
|
*/
|
|
1433
|
-
organization?:
|
|
1398
|
+
organization?: string | null;
|
|
1434
1399
|
/**
|
|
1435
1400
|
* Send this attribute if you want to mark this resource as disabled.
|
|
1436
|
-
* @example ```
|
|
1401
|
+
* @example ```true```
|
|
1437
1402
|
*/
|
|
1438
|
-
_disable?:
|
|
1403
|
+
_disable?: boolean | null;
|
|
1439
1404
|
/**
|
|
1440
1405
|
* Send this attribute if you want to mark this resource as enabled.
|
|
1441
|
-
* @example ```
|
|
1406
|
+
* @example ```true```
|
|
1442
1407
|
*/
|
|
1443
|
-
_enable?:
|
|
1408
|
+
_enable?: boolean | null;
|
|
1444
1409
|
}
|
|
1445
1410
|
declare class IdentityProviders extends ApiResource<IdentityProvider> {
|
|
1446
1411
|
static readonly TYPE: IdentityProviderType;
|
|
@@ -1455,10 +1420,12 @@ declare class IdentityProviders extends ApiResource<IdentityProvider> {
|
|
|
1455
1420
|
relationshipToMany(...ids: string[]): IdentityProviderRel[];
|
|
1456
1421
|
type(): IdentityProviderType;
|
|
1457
1422
|
}
|
|
1423
|
+
declare const instance: IdentityProviders;
|
|
1458
1424
|
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
declare const
|
|
1425
|
+
declare const apiResources: readonly ["api_credentials", "application_memberships", "identity_providers", "memberships", "membership_profiles", "organizations", "permissions", "roles", "users", "versions"];
|
|
1426
|
+
type ResourceTypeLock = (typeof apiResources)[number];
|
|
1427
|
+
declare const resourceList: readonly ResourceTypeLock[];
|
|
1428
|
+
declare const singletonList: readonly ["users"];
|
|
1462
1429
|
type RetrievableResourceType = ResourceTypeLock;
|
|
1463
1430
|
type RetrievableResource = Resource & {
|
|
1464
1431
|
type: RetrievableResourceType;
|
|
@@ -1467,25 +1434,27 @@ type ListableResourceType = Exclude<ResourceTypeLock, 'users'>;
|
|
|
1467
1434
|
type ListableResource = Resource & {
|
|
1468
1435
|
type: ListableResourceType;
|
|
1469
1436
|
};
|
|
1470
|
-
|
|
1437
|
+
declare const creatableResources: readonly ["api_credentials", "application_memberships", "identity_providers", "memberships", "membership_profiles", "organizations", "permissions", "roles"];
|
|
1438
|
+
type CreatableResourceType = (typeof creatableResources)[number];
|
|
1471
1439
|
type CreatableResource = Resource & {
|
|
1472
1440
|
type: CreatableResourceType;
|
|
1473
1441
|
};
|
|
1474
|
-
|
|
1442
|
+
declare const updatableResources: readonly ["api_credentials", "application_memberships", "identity_providers", "memberships", "membership_profiles", "organizations", "permissions", "roles"];
|
|
1443
|
+
type UpdatableResourceType = (typeof updatableResources)[number];
|
|
1475
1444
|
type UpdatableResource = Resource & {
|
|
1476
1445
|
type: UpdatableResourceType;
|
|
1477
1446
|
};
|
|
1478
|
-
|
|
1447
|
+
declare const deletableResources: readonly ["api_credentials", "application_memberships", "identity_providers", "memberships", "membership_profiles"];
|
|
1448
|
+
type DeletableResourceType = (typeof deletableResources)[number];
|
|
1479
1449
|
type DeletableResource = Resource & {
|
|
1480
1450
|
type: DeletableResourceType;
|
|
1481
1451
|
};
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
};
|
|
1452
|
+
declare function getResources(sort?: boolean): readonly ResourceTypeLock[];
|
|
1453
|
+
declare function getSingletons(sort?: boolean): readonly string[];
|
|
1454
|
+
declare function isSingleton(resource: ResourceTypeLock): boolean;
|
|
1455
|
+
declare function isCreatable(resource: ResourceTypeLock): boolean;
|
|
1456
|
+
declare function isUpdatable(resource: ResourceTypeLock): boolean;
|
|
1457
|
+
declare function isDeletable(resource: ResourceTypeLock): boolean;
|
|
1489
1458
|
type ResourceFields = {
|
|
1490
1459
|
api_credentials: ApiCredential;
|
|
1491
1460
|
application_memberships: ApplicationMembership;
|
|
@@ -1511,82 +1480,157 @@ type ResourceSortFields = {
|
|
|
1511
1480
|
versions: VersionSort;
|
|
1512
1481
|
};
|
|
1513
1482
|
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
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;
|
|
1500
|
+
};
|
|
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;
|
|
1522
1518
|
}
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
type?: ErrorType;
|
|
1532
|
-
});
|
|
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;
|
|
1533
1527
|
}
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
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;
|
|
1544
|
+
}
|
|
1545
|
+
type PageCursor = {
|
|
1546
|
+
readonly before?: string;
|
|
1547
|
+
readonly after?: string;
|
|
1548
|
+
};
|
|
1549
|
+
type ListMeta = {
|
|
1550
|
+
readonly pageCount: number;
|
|
1551
|
+
readonly recordCount: number;
|
|
1552
|
+
readonly currentPage: number;
|
|
1553
|
+
readonly recordsPerPage: number;
|
|
1554
|
+
readonly cursor?: {
|
|
1555
|
+
readonly prev?: PageCursor;
|
|
1556
|
+
readonly next?: PageCursor;
|
|
1557
|
+
};
|
|
1558
|
+
};
|
|
1559
|
+
declare class ListResponse<R extends Resource = Resource> extends Array<R> {
|
|
1560
|
+
readonly meta: ListMeta;
|
|
1561
|
+
constructor(meta: ListMeta, data: R[]);
|
|
1562
|
+
first(): R | undefined;
|
|
1563
|
+
last(): R | undefined;
|
|
1564
|
+
get(index: number): R | undefined;
|
|
1565
|
+
hasNextPage(): boolean;
|
|
1566
|
+
hasPrevPage(): boolean;
|
|
1567
|
+
getRecordCount(): number;
|
|
1568
|
+
getPageCount(): number;
|
|
1569
|
+
get recordCount(): number;
|
|
1570
|
+
get pageCount(): number;
|
|
1544
1571
|
}
|
|
1545
1572
|
|
|
1546
|
-
type
|
|
1547
|
-
type
|
|
1548
|
-
type
|
|
1549
|
-
|
|
1573
|
+
type ResourceSort = Pick<Resource, 'id' | 'reference' | 'reference_origin' | 'created_at' | 'updated_at'>;
|
|
1574
|
+
type ResourceFilter = Pick<Resource, 'id' | 'reference' | 'reference_origin' | 'metadata' | 'created_at' | 'updated_at'>;
|
|
1575
|
+
type ResourceAdapterConfig = {};
|
|
1576
|
+
type ResourcesInitConfig = ResourceAdapterConfig & ApiClientInitConfig;
|
|
1577
|
+
type ResourcesConfig = Partial<ResourcesInitConfig>;
|
|
1578
|
+
declare class ResourceAdapter {
|
|
1550
1579
|
#private;
|
|
1551
|
-
|
|
1552
|
-
constructor(config: CommerceLayerInitConfig);
|
|
1553
|
-
get api_credentials(): ApiCredentials;
|
|
1554
|
-
get application_memberships(): ApplicationMemberships;
|
|
1555
|
-
get identity_providers(): IdentityProviders;
|
|
1556
|
-
get memberships(): Memberships;
|
|
1557
|
-
get membership_profiles(): MembershipProfiles;
|
|
1558
|
-
get organizations(): Organizations;
|
|
1559
|
-
get permissions(): Permissions;
|
|
1560
|
-
get roles(): Roles;
|
|
1561
|
-
get user(): Users;
|
|
1562
|
-
get versions(): Versions;
|
|
1563
|
-
get currentAccessToken(): string;
|
|
1564
|
-
private get interceptors();
|
|
1580
|
+
constructor(config: ResourcesInitConfig);
|
|
1565
1581
|
private localConfig;
|
|
1566
|
-
config(config:
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1582
|
+
config(config: ResourcesConfig): this;
|
|
1583
|
+
get client(): Readonly<ApiClient>;
|
|
1584
|
+
singleton<R extends Resource>(resource: ResourceType, params?: QueryParamsRetrieve<R>, options?: ResourcesConfig, path?: string): Promise<R>;
|
|
1585
|
+
retrieve<R extends Resource>(resource: ResourceId, params?: QueryParamsRetrieve<R>, options?: ResourcesConfig): Promise<R>;
|
|
1586
|
+
list<R extends Resource>(resource: ResourceType, params?: QueryParamsList<R>, options?: ResourcesConfig): Promise<ListResponse<R>>;
|
|
1587
|
+
create<C extends ResourceCreate, R extends Resource>(resource: C & ResourceType, params?: QueryParamsRetrieve<R>, options?: ResourcesConfig): Promise<R>;
|
|
1588
|
+
update<U extends ResourceUpdate, R extends Resource>(resource: U & ResourceId, params?: QueryParamsRetrieve<R>, options?: ResourcesConfig,
|
|
1589
|
+
/**
|
|
1590
|
+
* Singular path override for singleton resources, e.g. `user` rather than
|
|
1591
|
+
* `users/{id}`. Mirrors `singleton()` above. Core never needed it — both
|
|
1592
|
+
* its singletons are retrieve-only — but the Provisioning API's `user` is
|
|
1593
|
+
* updatable, and without this the request targets `/users/{id}` and 404s.
|
|
1594
|
+
*/
|
|
1595
|
+
path?: string): Promise<R>;
|
|
1596
|
+
delete(resource: ResourceId, options?: ResourcesConfig): Promise<void>;
|
|
1597
|
+
/**
|
|
1598
|
+
* Calls a non-CRUD endpoint hosted at a sub-path of a resource, e.g.
|
|
1599
|
+
* `POST memberships/:id/resend`. These endpoints are not described by the
|
|
1600
|
+
* public resources schema, so they are declared in a target config and
|
|
1601
|
+
* emitted from it.
|
|
1602
|
+
*/
|
|
1603
|
+
action(cmd: Extract<Method, 'POST' | 'PATCH'>, path: string, payload?: any, options?: ResourcesConfig): Promise<void>;
|
|
1604
|
+
fetch<R extends Resource>(resource: string | ResourceType, path: string, params?: QueryParams<R>, options?: ResourcesConfig): Promise<R | ListResponse<R>>;
|
|
1605
|
+
}
|
|
1606
|
+
declare abstract class ApiResourceBase<R extends Resource> {
|
|
1607
|
+
#private;
|
|
1608
|
+
static readonly TYPE: ResourceTypeLock;
|
|
1609
|
+
constructor(adapter?: ResourceAdapter);
|
|
1610
|
+
protected get resources(): ResourceAdapter;
|
|
1611
|
+
/**
|
|
1612
|
+
* Returns a copy of this resource instance bound to a specific
|
|
1613
|
+
* `ResourceAdapter`. Used by the bundle client so each client instance
|
|
1614
|
+
* routes requests through its own adapter (its own access token) instead
|
|
1615
|
+
* of the process-global static adapter. Resource classes are type-only
|
|
1616
|
+
* exports, so we clone via `this.constructor` rather than referencing the
|
|
1617
|
+
* class directly.
|
|
1618
|
+
*/
|
|
1619
|
+
withAdapter(adapter: ResourceAdapter): this;
|
|
1620
|
+
abstract relationship(id: string | ResourceId | null): ResourceRel;
|
|
1621
|
+
protected relationshipOneToOne<RR extends ResourceRel>(id: string | ResourceId | null): RR;
|
|
1622
|
+
protected relationshipOneToMany<RR extends ResourceRel>(...ids: string[]): RR[];
|
|
1623
|
+
abstract type(): ResourceTypeLock;
|
|
1624
|
+
protected path(): string;
|
|
1625
|
+
update(resource: ResourceUpdate, params?: QueryParamsRetrieve<R>, options?: ResourcesConfig): Promise<R>;
|
|
1626
|
+
}
|
|
1627
|
+
declare abstract class ApiResource<R extends Resource> extends ApiResourceBase<R> {
|
|
1628
|
+
retrieve(id: string | ResourceId, params?: QueryParamsRetrieve<R>, options?: ResourcesConfig): Promise<R>;
|
|
1629
|
+
list(params?: QueryParamsList<R>, options?: ResourcesConfig): Promise<ListResponse<R>>;
|
|
1630
|
+
count(filter?: QueryFilter | QueryParamsList<R>, options?: ResourcesConfig): Promise<number>;
|
|
1631
|
+
}
|
|
1632
|
+
declare abstract class ApiSingleton<R extends Resource> extends ApiResourceBase<R> {
|
|
1633
|
+
retrieve(params?: QueryParamsRetrieve<R>, options?: ResourcesConfig): Promise<R>;
|
|
1579
1634
|
}
|
|
1580
|
-
declare const CommerceLayerProvisioning: (config: CommerceLayerInitConfig) => CommerceLayerProvisioningClient;
|
|
1581
|
-
|
|
1582
|
-
declare const CommerceLayerProvisioningStatic: {
|
|
1583
|
-
resources: (sort?: boolean) => readonly string[];
|
|
1584
|
-
singletons: (sort?: boolean) => readonly string[];
|
|
1585
|
-
isSingleton: (resource: ResourceTypeLock) => boolean;
|
|
1586
|
-
isSdkError: (error: unknown) => error is SdkError;
|
|
1587
|
-
isApiError: (error: unknown) => error is ApiError;
|
|
1588
|
-
init: (config: CommerceLayerInitConfig) => CommerceLayerProvisioningClient;
|
|
1589
|
-
readonly schemaVersion: string;
|
|
1590
|
-
};
|
|
1591
1635
|
|
|
1592
|
-
export { type ApiCredential, type
|
|
1636
|
+
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, instance 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, singletonList as aA, getResources as aB, ResourceAdapter as aC, type RequestInterceptor as aD, type ErrorInterceptor as aE, type ResponseInterceptor as aF, type InterceptorType as aG, type RawResponseReader as aH, type MembershipProfileType as aI, instance$9 as aJ, type VersionType as aK, instance$8 as aL, type PermissionType as aM, instance$7 as aN, type RoleType as aO, instance$6 as aP, type ApplicationMembershipType as aQ, instance$5 as aR, type MembershipType as aS, instance$4 as aT, type OrganizationType as aU, instance$3 as aV, type ApiCredentialType as aW, instance$2 as aX, type UserType as aY, instance$1 as aZ, type IdentityProviderType 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 UpdatableResource as aq, type UpdatableResourceType as ar, type User as as, type UserSort as at, type UserUpdate as au, Users as av, type Version as aw, type VersionSort as ax, Versions as ay, resourceList as az, type ApiCredentialSort 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 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 };
|