@commercelayer/provisioning-sdk 2.10.2 → 3.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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-BQ6Y-J8P.d.ts} +546 -495
- package/lib/api-BQZ9r4RA.d.cts +1643 -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-47HG76BX.cjs +19 -0
- package/lib/chunk-47HG76BX.cjs.map +1 -0
- package/lib/chunk-4GOUGGBM.js +114 -0
- package/lib/chunk-4GOUGGBM.js.map +1 -0
- package/lib/chunk-5D5YOHG4.cjs +93 -0
- package/lib/chunk-5D5YOHG4.cjs.map +1 -0
- package/lib/chunk-6B2AFMGT.js +82 -0
- package/lib/chunk-6B2AFMGT.js.map +1 -0
- package/lib/chunk-BFXJ3YNR.js +57 -0
- package/lib/chunk-BFXJ3YNR.js.map +1 -0
- package/lib/chunk-BI4FXO5V.cjs +43 -0
- package/lib/chunk-BI4FXO5V.cjs.map +1 -0
- package/lib/chunk-CESAPW7Z.js +90 -0
- package/lib/chunk-CESAPW7Z.js.map +1 -0
- package/lib/chunk-F2Z6XJTZ.js +59 -0
- package/lib/chunk-F2Z6XJTZ.js.map +1 -0
- package/lib/chunk-FHXWFSIQ.cjs +88 -0
- package/lib/chunk-FHXWFSIQ.cjs.map +1 -0
- package/lib/chunk-HNSO4ZPF.js +808 -0
- package/lib/chunk-HNSO4ZPF.js.map +1 -0
- package/lib/chunk-IW2T22VR.js +3 -0
- package/lib/chunk-IW2T22VR.js.map +1 -0
- package/lib/chunk-JDXNOZFC.cjs +66 -0
- package/lib/chunk-JDXNOZFC.cjs.map +1 -0
- package/lib/chunk-KJRFIWHK.cjs +61 -0
- package/lib/chunk-KJRFIWHK.cjs.map +1 -0
- package/lib/chunk-LISATEFD.cjs +26 -0
- package/lib/chunk-LISATEFD.cjs.map +1 -0
- package/lib/chunk-MANW7JPJ.js +12 -0
- package/lib/chunk-MANW7JPJ.js.map +1 -0
- package/lib/chunk-N567T7FT.cjs +4 -0
- package/lib/chunk-N567T7FT.cjs.map +1 -0
- package/lib/chunk-NFF6DWKZ.cjs +32 -0
- package/lib/chunk-NFF6DWKZ.cjs.map +1 -0
- package/lib/chunk-O6ACW64H.js +30 -0
- package/lib/chunk-O6ACW64H.js.map +1 -0
- package/lib/chunk-OAXFNHFA.js +59 -0
- package/lib/chunk-OAXFNHFA.js.map +1 -0
- package/lib/chunk-OEYUWL5K.js +41 -0
- package/lib/chunk-OEYUWL5K.js.map +1 -0
- package/lib/chunk-OKBMV3W5.cjs +59 -0
- package/lib/chunk-OKBMV3W5.cjs.map +1 -0
- package/lib/chunk-PIDJDUN3.js +86 -0
- package/lib/chunk-PIDJDUN3.js.map +1 -0
- package/lib/chunk-QRMCUYRK.js +24 -0
- package/lib/chunk-QRMCUYRK.js.map +1 -0
- package/lib/chunk-QTTL5EGB.cjs +816 -0
- package/lib/chunk-QTTL5EGB.cjs.map +1 -0
- package/lib/chunk-QVV2ORWB.cjs +61 -0
- package/lib/chunk-QVV2ORWB.cjs.map +1 -0
- package/lib/chunk-RSAADRRH.cjs +84 -0
- package/lib/chunk-RSAADRRH.cjs.map +1 -0
- package/lib/chunk-SZSANTXM.cjs +118 -0
- package/lib/chunk-SZSANTXM.cjs.map +1 -0
- package/lib/chunk-TOXS3OUT.cjs +80 -0
- package/lib/chunk-TOXS3OUT.cjs.map +1 -0
- package/lib/chunk-U76G3DPW.js +64 -0
- package/lib/chunk-U76G3DPW.js.map +1 -0
- package/lib/chunk-VFTFSHXQ.cjs +88 -0
- package/lib/chunk-VFTFSHXQ.cjs.map +1 -0
- package/lib/chunk-XCKSYX22.js +78 -0
- package/lib/chunk-XCKSYX22.js.map +1 -0
- package/lib/chunk-XV25RH6C.js +17 -0
- package/lib/chunk-XV25RH6C.js.map +1 -0
- package/lib/chunk-YFZRO7OE.cjs +84 -0
- package/lib/chunk-YFZRO7OE.cjs.map +1 -0
- package/lib/chunk-YLA6YCK5.cjs +16 -0
- package/lib/chunk-YLA6YCK5.cjs.map +1 -0
- package/lib/chunk-YS5PCY5D.js +76 -0
- package/lib/chunk-YS5PCY5D.js.map +1 -0
- package/lib/chunk-ZTAL3U2D.js +82 -0
- package/lib/chunk-ZTAL3U2D.js.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
|
@@ -0,0 +1,1643 @@
|
|
|
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> = {
|
|
18
|
+
onSuccess?: S;
|
|
19
|
+
onFailure?: F;
|
|
20
|
+
};
|
|
21
|
+
type RequestEventManager = InterceptorEventManager<RequestInterceptor, ErrorInterceptor>;
|
|
22
|
+
type ResponseEventManager = InterceptorEventManager<ResponseInterceptor, ErrorInterceptor>;
|
|
23
|
+
type ErrorEventManager = InterceptorEventManager<ResponseInterceptor, ResponseInterceptor>;
|
|
24
|
+
type InterceptorManager = {
|
|
25
|
+
request?: RequestEventManager;
|
|
26
|
+
response?: ResponseEventManager;
|
|
27
|
+
rawReader?: ErrorEventManager;
|
|
28
|
+
};
|
|
29
|
+
type RequestObj = {
|
|
30
|
+
url: URL;
|
|
31
|
+
options: FetchRequestOptions;
|
|
32
|
+
};
|
|
33
|
+
type RequestInterceptor = (request: RequestObj) => RequestObj | Promise<RequestObj>;
|
|
34
|
+
type ResponseObj = Response;
|
|
35
|
+
type ResponseInterceptor = (response: ResponseObj) => ResponseObj | Promise<ResponseObj>;
|
|
36
|
+
type ApiHeadersLock = 'x-ratelimit-limit' | 'x-ratelimit-interval' | 'x-ratelimit-remaining';
|
|
37
|
+
type ApiHeaders = {
|
|
38
|
+
[key in ApiHeadersLock]: string | number | boolean;
|
|
39
|
+
};
|
|
40
|
+
type HeadersObj = Record<string, string> | ApiHeaders;
|
|
41
|
+
type ErrorObj = FetchError;
|
|
42
|
+
type ErrorInterceptor = (error: ErrorObj) => ErrorObj | Promise<ErrorObj>;
|
|
43
|
+
type InterceptorType = 'request' | 'response';
|
|
44
|
+
|
|
45
|
+
type RawResponseReader = {
|
|
46
|
+
id: number;
|
|
47
|
+
rawResponse?: any;
|
|
48
|
+
headers?: HeadersObj;
|
|
49
|
+
ok: boolean;
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
type ObjectType = Record<string, any>;
|
|
53
|
+
type CreateArrayWithLengthX<LENGTH extends number, ACC extends unknown[] = []> = ACC['length'] extends LENGTH ? ACC : CreateArrayWithLengthX<LENGTH, [...ACC, 1]>;
|
|
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']>;
|
|
55
|
+
type PositiveNumberRange<MAX extends number> = NumericNumberRange<CreateArrayWithLengthX<1>, MAX>;
|
|
56
|
+
type StringKey<T> = Extract<keyof T, string>;
|
|
57
|
+
|
|
58
|
+
type QueryResType<T extends Resource> = T['type'];
|
|
59
|
+
type QueryInclude = string[];
|
|
60
|
+
type QueryResourceFields<R extends ResourceTypeLock> = keyof ResourceFields[R];
|
|
61
|
+
type QueryArrayFields<R extends Resource> = Array<QueryResourceFields<QueryResType<R>>>;
|
|
62
|
+
type QueryRecordFields = {
|
|
63
|
+
[key in keyof ResourceFields]?: Array<QueryResourceFields<key>>;
|
|
64
|
+
};
|
|
65
|
+
type QueryFields<R extends Resource> = QueryArrayFields<R> | QueryRecordFields;
|
|
66
|
+
interface QueryParamsRetrieve<R extends Resource = Resource> {
|
|
67
|
+
include?: QueryInclude;
|
|
68
|
+
fields?: QueryFields<R>;
|
|
69
|
+
}
|
|
70
|
+
type QuerySortType = 'asc' | 'desc';
|
|
71
|
+
type QueryResourceSortable<R extends Resource> = ResourceSortFields[QueryResType<R>];
|
|
72
|
+
type QueryResourceSortableFields<R extends Resource> = StringKey<QueryResourceSortable<R>>;
|
|
73
|
+
type QueryArraySortable<R extends Resource> = Array<QueryResourceSortableFields<R> | `-${QueryResourceSortableFields<R>}`>;
|
|
74
|
+
type QueryRecordSortable<R extends Resource> = Partial<Record<keyof QueryResourceSortable<R>, QuerySortType>>;
|
|
75
|
+
type QuerySort<R extends Resource> = QueryArraySortable<R> | QueryRecordSortable<R>;
|
|
76
|
+
type QueryFilter = Record<string, string | number | boolean | object | Array<string | number>>;
|
|
77
|
+
type QueryPageNumber = number;
|
|
78
|
+
type QueryPageSize = PositiveNumberRange<25>;
|
|
79
|
+
type QueryPageCursor = string;
|
|
80
|
+
interface QueryParamsList<R extends Resource = Resource> extends QueryParamsRetrieve<R> {
|
|
81
|
+
sort?: QuerySort<R>;
|
|
82
|
+
filters?: QueryFilter;
|
|
83
|
+
pageNumber?: QueryPageNumber;
|
|
84
|
+
pageSize?: QueryPageSize;
|
|
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;
|
|
97
|
+
}
|
|
98
|
+
type QueryParams<R extends Resource = Resource> = QueryParamsRetrieve<R> | QueryParamsList<R>;
|
|
99
|
+
|
|
100
|
+
type MembershipProfileType = 'membership_profiles';
|
|
101
|
+
type MembershipProfileRel$2 = ResourceRel & {
|
|
102
|
+
type: MembershipProfileType;
|
|
103
|
+
};
|
|
104
|
+
type OrganizationRel$5 = ResourceRel & {
|
|
105
|
+
type: OrganizationType;
|
|
106
|
+
};
|
|
107
|
+
type ApplicationMembershipRel$2 = ResourceRel & {
|
|
108
|
+
type: ApplicationMembershipType;
|
|
109
|
+
};
|
|
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
|
+
*/
|
|
116
|
+
interface MembershipProfile extends Resource {
|
|
117
|
+
readonly type: MembershipProfileType;
|
|
118
|
+
/**
|
|
119
|
+
* The membership profile name.
|
|
120
|
+
* @example ```"Marketing group"```
|
|
121
|
+
*/
|
|
122
|
+
name: string;
|
|
123
|
+
/**
|
|
124
|
+
* Reflects the organization's access scope, either test_access or all_access.
|
|
125
|
+
* @example ```true```
|
|
126
|
+
*/
|
|
127
|
+
test_enabled?: boolean | null;
|
|
128
|
+
/**
|
|
129
|
+
* The access scope for applications. One of `live_access` (default), `test_access`, `all_access`.
|
|
130
|
+
* @example ```"live_access"```
|
|
131
|
+
*/
|
|
132
|
+
access_scope: 'live_access' | 'test_access' | 'all_access';
|
|
133
|
+
organization?: Organization | null;
|
|
134
|
+
application_memberships?: ApplicationMembership[] | null;
|
|
135
|
+
}
|
|
136
|
+
interface MembershipProfileCreate extends ResourceCreate {
|
|
137
|
+
/**
|
|
138
|
+
* The membership profile name.
|
|
139
|
+
* @example ```"Marketing group"```
|
|
140
|
+
*/
|
|
141
|
+
name: string;
|
|
142
|
+
/**
|
|
143
|
+
* The access scope for applications. One of `live_access` (default), `test_access`, `all_access`.
|
|
144
|
+
* @example ```"live_access"```
|
|
145
|
+
*/
|
|
146
|
+
access_scope: 'live_access' | 'test_access' | 'all_access';
|
|
147
|
+
organization: OrganizationRel$5;
|
|
148
|
+
application_memberships?: ApplicationMembershipRel$2[] | null;
|
|
149
|
+
}
|
|
150
|
+
interface MembershipProfileUpdate extends ResourceUpdate {
|
|
151
|
+
/**
|
|
152
|
+
* The membership profile name.
|
|
153
|
+
* @example ```"Marketing group"```
|
|
154
|
+
*/
|
|
155
|
+
name?: string | null;
|
|
156
|
+
/**
|
|
157
|
+
* The access scope for applications. One of `live_access` (default), `test_access`, `all_access`.
|
|
158
|
+
* @example ```"live_access"```
|
|
159
|
+
*/
|
|
160
|
+
access_scope?: 'live_access' | 'test_access' | 'all_access' | null;
|
|
161
|
+
application_memberships?: ApplicationMembershipRel$2[] | null;
|
|
162
|
+
}
|
|
163
|
+
declare class MembershipProfiles extends ApiResource<MembershipProfile> {
|
|
164
|
+
static readonly TYPE: MembershipProfileType;
|
|
165
|
+
create(resource: MembershipProfileCreate, params?: QueryParamsRetrieve<MembershipProfile>, options?: ResourcesConfig): Promise<MembershipProfile>;
|
|
166
|
+
update(resource: MembershipProfileUpdate, params?: QueryParamsRetrieve<MembershipProfile>, options?: ResourcesConfig): Promise<MembershipProfile>;
|
|
167
|
+
delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void>;
|
|
168
|
+
organization(membershipProfileId: string | MembershipProfile, params?: QueryParamsRetrieve<Organization>, options?: ResourcesConfig): Promise<Organization>;
|
|
169
|
+
application_memberships(membershipProfileId: string | MembershipProfile, params?: QueryParamsList<ApplicationMembership>, options?: ResourcesConfig): Promise<ListResponse<ApplicationMembership>>;
|
|
170
|
+
isMembershipProfile(resource: any): resource is MembershipProfile;
|
|
171
|
+
relationship(id: string | ResourceId | null): MembershipProfileRel$2;
|
|
172
|
+
relationshipToMany(...ids: string[]): MembershipProfileRel$2[];
|
|
173
|
+
type(): MembershipProfileType;
|
|
174
|
+
}
|
|
175
|
+
declare const instance$9: MembershipProfiles;
|
|
176
|
+
|
|
177
|
+
type VersionType = 'versions';
|
|
178
|
+
type VersionRel = ResourceRel & {
|
|
179
|
+
type: VersionType;
|
|
180
|
+
};
|
|
181
|
+
type VersionSort = Pick<Version, 'id'> & ResourceSort;
|
|
182
|
+
/**
|
|
183
|
+
* The Version object is returned as part of the response body of each successful list or retrieve API call to the /api/versions endpoint.
|
|
184
|
+
*
|
|
185
|
+
* @link https://docs.commercelayer.io/provisioning-api-reference/versions/object
|
|
186
|
+
*/
|
|
187
|
+
interface Version extends Resource {
|
|
188
|
+
readonly type: VersionType;
|
|
189
|
+
/**
|
|
190
|
+
* The type of the versioned resource.
|
|
191
|
+
* @example ```"roles"```
|
|
192
|
+
*/
|
|
193
|
+
resource_type?: string | null;
|
|
194
|
+
/**
|
|
195
|
+
* The versioned resource ID.
|
|
196
|
+
* @example ```"PzdJhdLdYV"```
|
|
197
|
+
*/
|
|
198
|
+
resource_id?: string | null;
|
|
199
|
+
/**
|
|
200
|
+
* The event which generates the version.
|
|
201
|
+
* @example ```"update"```
|
|
202
|
+
*/
|
|
203
|
+
event?: string | null;
|
|
204
|
+
/**
|
|
205
|
+
* The object changes payload.
|
|
206
|
+
* @example ```{"name":["previous","new"]}```
|
|
207
|
+
*/
|
|
208
|
+
changes?: Record<string, any> | null;
|
|
209
|
+
/**
|
|
210
|
+
* Information about who triggered the change, only showed when it's from a JWT token.
|
|
211
|
+
* @example ```{"application":{"id":"DNOPYiZYpn","kind":"integration","public":true}}```
|
|
212
|
+
*/
|
|
213
|
+
who?: Record<string, any> | null;
|
|
214
|
+
}
|
|
215
|
+
declare class Versions extends ApiResource<Version> {
|
|
216
|
+
static readonly TYPE: VersionType;
|
|
217
|
+
isVersion(resource: any): resource is Version;
|
|
218
|
+
relationship(id: string | ResourceId | null): VersionRel;
|
|
219
|
+
relationshipToMany(...ids: string[]): VersionRel[];
|
|
220
|
+
type(): VersionType;
|
|
221
|
+
}
|
|
222
|
+
declare const instance$8: Versions;
|
|
223
|
+
|
|
224
|
+
type PermissionType = 'permissions';
|
|
225
|
+
type PermissionRel = ResourceRel & {
|
|
226
|
+
type: PermissionType;
|
|
227
|
+
};
|
|
228
|
+
type RoleRel$4 = ResourceRel & {
|
|
229
|
+
type: RoleType;
|
|
230
|
+
};
|
|
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
|
+
*/
|
|
237
|
+
interface Permission extends Resource {
|
|
238
|
+
readonly type: PermissionType;
|
|
239
|
+
/**
|
|
240
|
+
* Determines if the permission have access to create rights.
|
|
241
|
+
*/
|
|
242
|
+
can_create: boolean;
|
|
243
|
+
/**
|
|
244
|
+
* Determines if the permission have access to read rights.
|
|
245
|
+
*/
|
|
246
|
+
can_read: boolean;
|
|
247
|
+
/**
|
|
248
|
+
* Determines if the permission have access to update rights.
|
|
249
|
+
*/
|
|
250
|
+
can_update: boolean;
|
|
251
|
+
/**
|
|
252
|
+
* Determines if the permission have access to destroy rights.
|
|
253
|
+
*/
|
|
254
|
+
can_destroy: boolean;
|
|
255
|
+
/**
|
|
256
|
+
* The resource where this permission is applied.
|
|
257
|
+
*/
|
|
258
|
+
subject: string;
|
|
259
|
+
/**
|
|
260
|
+
* An object that contains additional restrictions.
|
|
261
|
+
* @example ```{"foo":"bar"}```
|
|
262
|
+
*/
|
|
263
|
+
restrictions?: Record<string, any> | null;
|
|
264
|
+
organization?: Organization | null;
|
|
265
|
+
role?: Role | null;
|
|
266
|
+
versions?: Version[] | null;
|
|
267
|
+
}
|
|
268
|
+
interface PermissionCreate extends ResourceCreate {
|
|
269
|
+
/**
|
|
270
|
+
* Determines if the permission have access to create rights.
|
|
271
|
+
*/
|
|
272
|
+
can_create: boolean;
|
|
273
|
+
/**
|
|
274
|
+
* Determines if the permission have access to read rights.
|
|
275
|
+
*/
|
|
276
|
+
can_read: boolean;
|
|
277
|
+
/**
|
|
278
|
+
* Determines if the permission have access to update rights.
|
|
279
|
+
*/
|
|
280
|
+
can_update: boolean;
|
|
281
|
+
/**
|
|
282
|
+
* Determines if the permission have access to destroy rights.
|
|
283
|
+
*/
|
|
284
|
+
can_destroy: boolean;
|
|
285
|
+
/**
|
|
286
|
+
* The resource where this permission is applied.
|
|
287
|
+
*/
|
|
288
|
+
subject: string;
|
|
289
|
+
role: RoleRel$4;
|
|
290
|
+
}
|
|
291
|
+
interface PermissionUpdate extends ResourceUpdate {
|
|
292
|
+
/**
|
|
293
|
+
* Determines if the permission have access to create rights.
|
|
294
|
+
*/
|
|
295
|
+
can_create?: boolean | null;
|
|
296
|
+
/**
|
|
297
|
+
* Determines if the permission have access to read rights.
|
|
298
|
+
*/
|
|
299
|
+
can_read?: boolean | null;
|
|
300
|
+
/**
|
|
301
|
+
* Determines if the permission have access to update rights.
|
|
302
|
+
*/
|
|
303
|
+
can_update?: boolean | null;
|
|
304
|
+
/**
|
|
305
|
+
* Determines if the permission have access to destroy rights.
|
|
306
|
+
*/
|
|
307
|
+
can_destroy?: boolean | null;
|
|
308
|
+
}
|
|
309
|
+
declare class Permissions extends ApiResource<Permission> {
|
|
310
|
+
static readonly TYPE: PermissionType;
|
|
311
|
+
create(resource: PermissionCreate, params?: QueryParamsRetrieve<Permission>, options?: ResourcesConfig): Promise<Permission>;
|
|
312
|
+
update(resource: PermissionUpdate, params?: QueryParamsRetrieve<Permission>, options?: ResourcesConfig): Promise<Permission>;
|
|
313
|
+
organization(permissionId: string | Permission, params?: QueryParamsRetrieve<Organization>, options?: ResourcesConfig): Promise<Organization>;
|
|
314
|
+
role(permissionId: string | Permission, params?: QueryParamsRetrieve<Role>, options?: ResourcesConfig): Promise<Role>;
|
|
315
|
+
versions(permissionId: string | Permission, params?: QueryParamsList<Version>, options?: ResourcesConfig): Promise<ListResponse<Version>>;
|
|
316
|
+
isPermission(resource: any): resource is Permission;
|
|
317
|
+
relationship(id: string | ResourceId | null): PermissionRel;
|
|
318
|
+
relationshipToMany(...ids: string[]): PermissionRel[];
|
|
319
|
+
type(): PermissionType;
|
|
320
|
+
}
|
|
321
|
+
declare const instance$7: Permissions;
|
|
322
|
+
|
|
323
|
+
type RoleType = 'roles';
|
|
324
|
+
type RoleRel$3 = ResourceRel & {
|
|
325
|
+
type: RoleType;
|
|
326
|
+
};
|
|
327
|
+
type OrganizationRel$4 = ResourceRel & {
|
|
328
|
+
type: OrganizationType;
|
|
329
|
+
};
|
|
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
|
+
*/
|
|
336
|
+
interface Role extends Resource {
|
|
337
|
+
readonly type: RoleType;
|
|
338
|
+
/**
|
|
339
|
+
* The role name.
|
|
340
|
+
* @example ```"Custom role"```
|
|
341
|
+
*/
|
|
342
|
+
name: string;
|
|
343
|
+
/**
|
|
344
|
+
* The kind of role, one of: `custom`, `admin`, `read_only`.
|
|
345
|
+
* @example ```"custom"```
|
|
346
|
+
*/
|
|
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;
|
|
353
|
+
}
|
|
354
|
+
interface RoleCreate extends ResourceCreate {
|
|
355
|
+
/**
|
|
356
|
+
* The role name.
|
|
357
|
+
* @example ```"Custom role"```
|
|
358
|
+
*/
|
|
359
|
+
name: string;
|
|
360
|
+
organization: OrganizationRel$4;
|
|
361
|
+
}
|
|
362
|
+
interface RoleUpdate extends ResourceUpdate {
|
|
363
|
+
/**
|
|
364
|
+
* The role name.
|
|
365
|
+
* @example ```"Custom role"```
|
|
366
|
+
*/
|
|
367
|
+
name?: string | null;
|
|
368
|
+
/**
|
|
369
|
+
* Send this attribute if you want to update the role base permissions.
|
|
370
|
+
* @example ```true```
|
|
371
|
+
*/
|
|
372
|
+
_add_missing_base_permissions?: boolean | null;
|
|
373
|
+
}
|
|
374
|
+
declare class Roles extends ApiResource<Role> {
|
|
375
|
+
static readonly TYPE: RoleType;
|
|
376
|
+
create(resource: RoleCreate, params?: QueryParamsRetrieve<Role>, options?: ResourcesConfig): Promise<Role>;
|
|
377
|
+
update(resource: RoleUpdate, params?: QueryParamsRetrieve<Role>, options?: ResourcesConfig): Promise<Role>;
|
|
378
|
+
organization(roleId: string | Role, params?: QueryParamsRetrieve<Organization>, options?: ResourcesConfig): Promise<Organization>;
|
|
379
|
+
permissions(roleId: string | Role, params?: QueryParamsList<Permission>, options?: ResourcesConfig): Promise<ListResponse<Permission>>;
|
|
380
|
+
memberships(roleId: string | Role, params?: QueryParamsList<Membership>, options?: ResourcesConfig): Promise<ListResponse<Membership>>;
|
|
381
|
+
api_credentials(roleId: string | Role, params?: QueryParamsList<ApiCredential>, options?: ResourcesConfig): Promise<ListResponse<ApiCredential>>;
|
|
382
|
+
versions(roleId: string | Role, params?: QueryParamsList<Version>, options?: ResourcesConfig): Promise<ListResponse<Version>>;
|
|
383
|
+
_add_missing_base_permissions(id: string | Role, params?: QueryParamsRetrieve<Role>, options?: ResourcesConfig): Promise<Role>;
|
|
384
|
+
isRole(resource: any): resource is Role;
|
|
385
|
+
relationship(id: string | ResourceId | null): RoleRel$3;
|
|
386
|
+
relationshipToMany(...ids: string[]): RoleRel$3[];
|
|
387
|
+
type(): RoleType;
|
|
388
|
+
}
|
|
389
|
+
declare const instance$6: Roles;
|
|
390
|
+
|
|
391
|
+
type ApplicationMembershipType = 'application_memberships';
|
|
392
|
+
type ApplicationMembershipRel$1 = ResourceRel & {
|
|
393
|
+
type: ApplicationMembershipType;
|
|
394
|
+
};
|
|
395
|
+
type ApiCredentialRel$1 = ResourceRel & {
|
|
396
|
+
type: ApiCredentialType;
|
|
397
|
+
};
|
|
398
|
+
type MembershipRel$1 = ResourceRel & {
|
|
399
|
+
type: MembershipType;
|
|
400
|
+
};
|
|
401
|
+
type MembershipProfileRel$1 = ResourceRel & {
|
|
402
|
+
type: MembershipProfileType;
|
|
403
|
+
};
|
|
404
|
+
type OrganizationRel$3 = ResourceRel & {
|
|
405
|
+
type: OrganizationType;
|
|
406
|
+
};
|
|
407
|
+
type RoleRel$2 = ResourceRel & {
|
|
408
|
+
type: RoleType;
|
|
409
|
+
};
|
|
410
|
+
type ApplicationMembershipSort = Pick<ApplicationMembership, 'id'> & ResourceSort;
|
|
411
|
+
/**
|
|
412
|
+
* The Application membership object is returned as part of the response body of each successful list, retrieve, create, update or delete API call to the /api/application_memberships endpoint.
|
|
413
|
+
*
|
|
414
|
+
* @link https://docs.commercelayer.io/provisioning-api-reference/application_memberships/object
|
|
415
|
+
*/
|
|
416
|
+
interface ApplicationMembership extends Resource {
|
|
417
|
+
readonly type: ApplicationMembershipType;
|
|
418
|
+
/**
|
|
419
|
+
* Set of key-value pairs that contains restrictions and scopes of the application membership.
|
|
420
|
+
* @example ```{"market_id_in":[202,203]}```
|
|
421
|
+
*/
|
|
422
|
+
filters?: Record<string, any> | null;
|
|
423
|
+
api_credential?: ApiCredential | null;
|
|
424
|
+
membership?: Membership | null;
|
|
425
|
+
membership_profile?: MembershipProfile | null;
|
|
426
|
+
organization?: Organization | null;
|
|
427
|
+
role?: Role | null;
|
|
428
|
+
}
|
|
429
|
+
interface ApplicationMembershipCreate extends ResourceCreate {
|
|
430
|
+
/**
|
|
431
|
+
* Set of key-value pairs that contains restrictions and scopes of the application membership.
|
|
432
|
+
* @example ```{"market_id_in":[202,203]}```
|
|
433
|
+
*/
|
|
434
|
+
filters?: Record<string, any> | null;
|
|
435
|
+
api_credential: ApiCredentialRel$1;
|
|
436
|
+
membership?: MembershipRel$1 | null;
|
|
437
|
+
membership_profile?: MembershipProfileRel$1 | null;
|
|
438
|
+
organization: OrganizationRel$3;
|
|
439
|
+
role: RoleRel$2;
|
|
440
|
+
}
|
|
441
|
+
interface ApplicationMembershipUpdate extends ResourceUpdate {
|
|
442
|
+
/**
|
|
443
|
+
* Set of key-value pairs that contains restrictions and scopes of the application membership.
|
|
444
|
+
* @example ```{"market_id_in":[202,203]}```
|
|
445
|
+
*/
|
|
446
|
+
filters?: Record<string, any> | null;
|
|
447
|
+
membership_profile?: MembershipProfileRel$1 | null;
|
|
448
|
+
role?: RoleRel$2 | null;
|
|
449
|
+
}
|
|
450
|
+
declare class ApplicationMemberships extends ApiResource<ApplicationMembership> {
|
|
451
|
+
static readonly TYPE: ApplicationMembershipType;
|
|
452
|
+
create(resource: ApplicationMembershipCreate, params?: QueryParamsRetrieve<ApplicationMembership>, options?: ResourcesConfig): Promise<ApplicationMembership>;
|
|
453
|
+
update(resource: ApplicationMembershipUpdate, params?: QueryParamsRetrieve<ApplicationMembership>, options?: ResourcesConfig): Promise<ApplicationMembership>;
|
|
454
|
+
delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void>;
|
|
455
|
+
api_credential(applicationMembershipId: string | ApplicationMembership, params?: QueryParamsRetrieve<ApiCredential>, options?: ResourcesConfig): Promise<ApiCredential>;
|
|
456
|
+
membership(applicationMembershipId: string | ApplicationMembership, params?: QueryParamsRetrieve<Membership>, options?: ResourcesConfig): Promise<Membership>;
|
|
457
|
+
membership_profile(applicationMembershipId: string | ApplicationMembership, params?: QueryParamsRetrieve<MembershipProfile>, options?: ResourcesConfig): Promise<MembershipProfile>;
|
|
458
|
+
organization(applicationMembershipId: string | ApplicationMembership, params?: QueryParamsRetrieve<Organization>, options?: ResourcesConfig): Promise<Organization>;
|
|
459
|
+
role(applicationMembershipId: string | ApplicationMembership, params?: QueryParamsRetrieve<Role>, options?: ResourcesConfig): Promise<Role>;
|
|
460
|
+
isApplicationMembership(resource: any): resource is ApplicationMembership;
|
|
461
|
+
relationship(id: string | ResourceId | null): ApplicationMembershipRel$1;
|
|
462
|
+
relationshipToMany(...ids: string[]): ApplicationMembershipRel$1[];
|
|
463
|
+
type(): ApplicationMembershipType;
|
|
464
|
+
}
|
|
465
|
+
declare const instance$5: ApplicationMemberships;
|
|
466
|
+
|
|
467
|
+
type MembershipType = 'memberships';
|
|
468
|
+
type MembershipRel = ResourceRel & {
|
|
469
|
+
type: MembershipType;
|
|
470
|
+
};
|
|
471
|
+
type OrganizationRel$2 = ResourceRel & {
|
|
472
|
+
type: OrganizationType;
|
|
473
|
+
};
|
|
474
|
+
type RoleRel$1 = ResourceRel & {
|
|
475
|
+
type: RoleType;
|
|
476
|
+
};
|
|
477
|
+
type ApplicationMembershipRel = ResourceRel & {
|
|
478
|
+
type: ApplicationMembershipType;
|
|
479
|
+
};
|
|
480
|
+
type MembershipProfileRel = ResourceRel & {
|
|
481
|
+
type: MembershipProfileType;
|
|
482
|
+
};
|
|
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
|
+
*/
|
|
489
|
+
interface Membership extends Resource {
|
|
490
|
+
readonly type: MembershipType;
|
|
491
|
+
/**
|
|
492
|
+
* The user email.
|
|
493
|
+
* @example ```"commercelayer@commercelayer.io"```
|
|
494
|
+
*/
|
|
495
|
+
user_email: string;
|
|
496
|
+
/**
|
|
497
|
+
* The user first name.
|
|
498
|
+
* @example ```"John"```
|
|
499
|
+
*/
|
|
500
|
+
user_first_name?: string | null;
|
|
501
|
+
/**
|
|
502
|
+
* The user last name.
|
|
503
|
+
* @example ```"Doe"```
|
|
504
|
+
*/
|
|
505
|
+
user_last_name?: string | null;
|
|
506
|
+
/**
|
|
507
|
+
* The memberships status. One of `pending` (default), `active`.
|
|
508
|
+
* @example ```"pending"```
|
|
509
|
+
*/
|
|
510
|
+
status: 'pending' | 'active';
|
|
511
|
+
/**
|
|
512
|
+
* Indicates if the user it's the owner of the organization.
|
|
513
|
+
* @example ```true```
|
|
514
|
+
*/
|
|
515
|
+
owner?: boolean | null;
|
|
516
|
+
/**
|
|
517
|
+
* Reflects the organization's access scope, either test_access or all_access.
|
|
518
|
+
* @example ```true```
|
|
519
|
+
*/
|
|
520
|
+
test_enabled?: boolean | null;
|
|
521
|
+
/**
|
|
522
|
+
* The access scope for applications. One of `live_access` (default), `test_access`, `all_access`.
|
|
523
|
+
* @example ```"live_access"```
|
|
524
|
+
*/
|
|
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;
|
|
531
|
+
}
|
|
532
|
+
interface MembershipCreate extends ResourceCreate {
|
|
533
|
+
/**
|
|
534
|
+
* The user email.
|
|
535
|
+
* @example ```"commercelayer@commercelayer.io"```
|
|
536
|
+
*/
|
|
537
|
+
user_email: string;
|
|
538
|
+
/**
|
|
539
|
+
* The access scope for applications. One of `live_access` (default), `test_access`, `all_access`.
|
|
540
|
+
* @example ```"live_access"```
|
|
541
|
+
*/
|
|
542
|
+
access_scope?: 'live_access' | 'test_access' | 'all_access' | null;
|
|
543
|
+
organization: OrganizationRel$2;
|
|
544
|
+
role: RoleRel$1;
|
|
545
|
+
application_memberships?: ApplicationMembershipRel[] | null;
|
|
546
|
+
membership_profile?: MembershipProfileRel | null;
|
|
547
|
+
}
|
|
548
|
+
interface MembershipUpdate extends ResourceUpdate {
|
|
549
|
+
/**
|
|
550
|
+
* The access scope for applications. One of `live_access` (default), `test_access`, `all_access`.
|
|
551
|
+
* @example ```"live_access"```
|
|
552
|
+
*/
|
|
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;
|
|
557
|
+
}
|
|
558
|
+
declare class Memberships extends ApiResource<Membership> {
|
|
559
|
+
static readonly TYPE: MembershipType;
|
|
560
|
+
create(resource: MembershipCreate, params?: QueryParamsRetrieve<Membership>, options?: ResourcesConfig): Promise<Membership>;
|
|
561
|
+
update(resource: MembershipUpdate, params?: QueryParamsRetrieve<Membership>, options?: ResourcesConfig): Promise<Membership>;
|
|
562
|
+
delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void>;
|
|
563
|
+
organization(membershipId: string | Membership, params?: QueryParamsRetrieve<Organization>, options?: ResourcesConfig): Promise<Organization>;
|
|
564
|
+
role(membershipId: string | Membership, params?: QueryParamsRetrieve<Role>, options?: ResourcesConfig): Promise<Role>;
|
|
565
|
+
application_memberships(membershipId: string | Membership, params?: QueryParamsList<ApplicationMembership>, options?: ResourcesConfig): Promise<ListResponse<ApplicationMembership>>;
|
|
566
|
+
membership_profile(membershipId: string | Membership, params?: QueryParamsRetrieve<MembershipProfile>, options?: ResourcesConfig): Promise<MembershipProfile>;
|
|
567
|
+
versions(membershipId: string | Membership, params?: QueryParamsList<Version>, options?: ResourcesConfig): Promise<ListResponse<Version>>;
|
|
568
|
+
resend(membershipId: string | Membership, options?: ResourcesConfig): Promise<void>;
|
|
569
|
+
isMembership(resource: any): resource is Membership;
|
|
570
|
+
relationship(id: string | ResourceId | null): MembershipRel;
|
|
571
|
+
relationshipToMany(...ids: string[]): MembershipRel[];
|
|
572
|
+
type(): MembershipType;
|
|
573
|
+
}
|
|
574
|
+
declare const instance$4: Memberships;
|
|
575
|
+
|
|
576
|
+
type OrganizationType = 'organizations';
|
|
577
|
+
type OrganizationRel$1 = ResourceRel & {
|
|
578
|
+
type: OrganizationType;
|
|
579
|
+
};
|
|
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
|
+
*/
|
|
586
|
+
interface Organization extends Resource {
|
|
587
|
+
readonly type: OrganizationType;
|
|
588
|
+
/**
|
|
589
|
+
* The organization's internal name.
|
|
590
|
+
* @example ```"The Blue Brand"```
|
|
591
|
+
*/
|
|
592
|
+
name: string;
|
|
593
|
+
/**
|
|
594
|
+
* The organization's slug name.
|
|
595
|
+
* @example ```"the-blue-brand"```
|
|
596
|
+
*/
|
|
597
|
+
slug?: string | null;
|
|
598
|
+
/**
|
|
599
|
+
* The organization's domain.
|
|
600
|
+
* @example ```"the-blue-brand.commercelayer.io"```
|
|
601
|
+
*/
|
|
602
|
+
domain?: string | null;
|
|
603
|
+
/**
|
|
604
|
+
* The organization's support phone.
|
|
605
|
+
* @example ```"+01 30800857"```
|
|
606
|
+
*/
|
|
607
|
+
support_phone?: string | null;
|
|
608
|
+
/**
|
|
609
|
+
* The organization's support email.
|
|
610
|
+
* @example ```"support@bluebrand.com"```
|
|
611
|
+
*/
|
|
612
|
+
support_email?: string | null;
|
|
613
|
+
/**
|
|
614
|
+
* The URL to the organization's logo.
|
|
615
|
+
* @example ```"https://bluebrand.com/img/logo.svg"```
|
|
616
|
+
*/
|
|
617
|
+
logo_url?: string | null;
|
|
618
|
+
/**
|
|
619
|
+
* The URL to the organization's favicon.
|
|
620
|
+
* @example ```"https://bluebrand.com/img/favicon.ico"```
|
|
621
|
+
*/
|
|
622
|
+
favicon_url?: string | null;
|
|
623
|
+
/**
|
|
624
|
+
* The organization's primary color.
|
|
625
|
+
* @example ```"#C8984E"```
|
|
626
|
+
*/
|
|
627
|
+
primary_color?: string | null;
|
|
628
|
+
/**
|
|
629
|
+
* The organization's contrast color. Format is HEX (starts with `#` and is followed by six letters and/or numbers).
|
|
630
|
+
* @example ```"#FFFFCC"```
|
|
631
|
+
*/
|
|
632
|
+
contrast_color?: string | null;
|
|
633
|
+
/**
|
|
634
|
+
* The organization's Google Tag Manager ID.
|
|
635
|
+
* @example ```"GTM-5FJXX6"```
|
|
636
|
+
*/
|
|
637
|
+
gtm_id?: string | null;
|
|
638
|
+
/**
|
|
639
|
+
* The organization's Google Tag Manager ID for test.
|
|
640
|
+
* @example ```"GTM-5FJXX7"```
|
|
641
|
+
*/
|
|
642
|
+
gtm_id_test?: string | null;
|
|
643
|
+
/**
|
|
644
|
+
* The region where the organization is located. The default value is `eu-west-1`.
|
|
645
|
+
* @example ```"eu-west-1"```
|
|
646
|
+
*/
|
|
647
|
+
region?: string | null;
|
|
648
|
+
/**
|
|
649
|
+
* Indicates if the organization can switch to live mode.
|
|
650
|
+
*/
|
|
651
|
+
can_switch_live?: boolean | null;
|
|
652
|
+
/**
|
|
653
|
+
* Information about the current subscription such as the plan type, limits, and subscription totals counter.
|
|
654
|
+
* @example ```{"plan_type":"growth","limits":{"markets":5,"skus":10000,"organizations":2,"memberships":5},"totals":{"organizations":1,"markets":0,"memberships":2,"skus":0}}```
|
|
655
|
+
*/
|
|
656
|
+
subscription_info?: Record<string, any> | null;
|
|
657
|
+
/**
|
|
658
|
+
* The organization's configuration.
|
|
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":[]}}}}}```
|
|
660
|
+
*/
|
|
661
|
+
config?: Record<string, any> | null;
|
|
662
|
+
/**
|
|
663
|
+
* Enables the redirect on the new Auth API.
|
|
664
|
+
* @example ```true```
|
|
665
|
+
*/
|
|
666
|
+
api_auth_redirect?: boolean | null;
|
|
667
|
+
/**
|
|
668
|
+
* Enables fragment caching for resources with related directive.
|
|
669
|
+
*/
|
|
670
|
+
api_fragment_caching_enabled?: boolean | null;
|
|
671
|
+
/**
|
|
672
|
+
* Enables the rules engine for flex promotions and price list rules.
|
|
673
|
+
*/
|
|
674
|
+
api_rules_engine?: boolean | null;
|
|
675
|
+
/**
|
|
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```
|
|
678
|
+
*/
|
|
679
|
+
api_rules_engine_max_conditions_size?: number | null;
|
|
680
|
+
/**
|
|
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```
|
|
683
|
+
*/
|
|
684
|
+
api_rules_engine_max_rules_size?: number | null;
|
|
685
|
+
/**
|
|
686
|
+
* Forces the usage of the new Authentication API.
|
|
687
|
+
* @example ```true```
|
|
688
|
+
*/
|
|
689
|
+
api_new_auth?: boolean | null;
|
|
690
|
+
/**
|
|
691
|
+
* Enables the purge of cached single resources when list is purged.
|
|
692
|
+
*/
|
|
693
|
+
api_purge_single_resource?: boolean | null;
|
|
694
|
+
/**
|
|
695
|
+
* The maximum length for the regular expressions, default is {API_MAX_REGEX_LENGTH}.
|
|
696
|
+
* @example ```5000```
|
|
697
|
+
*/
|
|
698
|
+
api_max_regex_length?: number | null;
|
|
699
|
+
/**
|
|
700
|
+
* Indicates if AVS checking will be enforced during payment workflow by passing specific attributes, default is {ADDRESSES_AVS_CHECK}.
|
|
701
|
+
* @example ```true```
|
|
702
|
+
*/
|
|
703
|
+
addresses_avs_check?: boolean | null;
|
|
704
|
+
/**
|
|
705
|
+
* Indicates if the phone attribute is required for addresses, default is {ADDRESSES_PHONE_REQUIRED}.
|
|
706
|
+
* @example ```true```
|
|
707
|
+
*/
|
|
708
|
+
addresses_phone_required?: boolean | null;
|
|
709
|
+
/**
|
|
710
|
+
* Indicates if a sales channel application without customer can read and update just guest orders.
|
|
711
|
+
* @example ```true```
|
|
712
|
+
*/
|
|
713
|
+
orders_sales_channel_guest_only?: boolean | null;
|
|
714
|
+
/**
|
|
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.
|
|
716
|
+
*/
|
|
717
|
+
orders_min_rebuild_shipments_lapse?: number | null;
|
|
718
|
+
/**
|
|
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.
|
|
720
|
+
*/
|
|
721
|
+
orders_min_refresh_lapse?: number | null;
|
|
722
|
+
/**
|
|
723
|
+
* The maximum number line items allowed for a test order before disabling the autorefresh option.
|
|
724
|
+
* @example ```50```
|
|
725
|
+
*/
|
|
726
|
+
orders_autorefresh_cutoff_test?: number | null;
|
|
727
|
+
/**
|
|
728
|
+
* The maximum number line items allowed for a live order before disabling the autorefresh option.
|
|
729
|
+
* @example ```500```
|
|
730
|
+
*/
|
|
731
|
+
orders_autorefresh_cutoff_live?: number | null;
|
|
732
|
+
/**
|
|
733
|
+
* Enables orders number editing as a string in test (for enterprise plans only).
|
|
734
|
+
*/
|
|
735
|
+
orders_number_editable_test?: boolean | null;
|
|
736
|
+
/**
|
|
737
|
+
* Enables orders number editing as a string in live (for enterprise plans only).
|
|
738
|
+
*/
|
|
739
|
+
orders_number_editable_live?: boolean | null;
|
|
740
|
+
/**
|
|
741
|
+
* Enables to use the order number as payment reference on supported gateways.
|
|
742
|
+
* @example ```true```
|
|
743
|
+
*/
|
|
744
|
+
orders_number_as_reference?: boolean | null;
|
|
745
|
+
/**
|
|
746
|
+
* Enables raising of API errors in case the provided coupon code is invalid, default is {ORDERS_INVALID_COUPON_ERRORS}.
|
|
747
|
+
* @example ```true```
|
|
748
|
+
*/
|
|
749
|
+
orders_invalid_coupon_errors?: boolean | null;
|
|
750
|
+
/**
|
|
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```
|
|
753
|
+
*/
|
|
754
|
+
orders_invalid_gift_card_errors?: boolean | null;
|
|
755
|
+
/**
|
|
756
|
+
* Enables the validation of the generated stock line items and stock transfers before placing the order, default is {ORDERS_VALIDATE_SHIPPING_STOCK}.
|
|
757
|
+
*/
|
|
758
|
+
orders_validate_shipping_stock?: boolean | null;
|
|
759
|
+
/**
|
|
760
|
+
* The maximum number of SKUs allowed for bundles, default is {BUNDLES_MAX_ITEMS_COUNT}.
|
|
761
|
+
* @example ```10```
|
|
762
|
+
*/
|
|
763
|
+
bundles_max_items_count?: number | null;
|
|
764
|
+
/**
|
|
765
|
+
* The minimum length for coupon code, default is {COUPONS_MIN_CODE_LENGTH}.
|
|
766
|
+
* @example ```8```
|
|
767
|
+
*/
|
|
768
|
+
coupons_min_code_length?: number | null;
|
|
769
|
+
/**
|
|
770
|
+
* The maximum length for coupon code, default is {COUPONS_MAX_CODE_LENGTH}.
|
|
771
|
+
* @example ```40```
|
|
772
|
+
*/
|
|
773
|
+
coupons_max_code_length?: number | null;
|
|
774
|
+
/**
|
|
775
|
+
* Enables matching the gift card code by its exact value, instead of by its first charachters, default is {GIFT_CARDS_EXACT_CODE_MATCHING}.
|
|
776
|
+
*/
|
|
777
|
+
gift_cards_exact_code_matching?: boolean | null;
|
|
778
|
+
/**
|
|
779
|
+
* The minimum length for gift card code, default is {GIFT_CARDS_MIN_CODE_LENGTH}.
|
|
780
|
+
* @example ```8```
|
|
781
|
+
*/
|
|
782
|
+
gift_cards_min_code_length?: number | null;
|
|
783
|
+
/**
|
|
784
|
+
* The maximum length for gift card code, default is {GIFT_CARDS_MAX_CODE_LENGTH}.
|
|
785
|
+
* @example ```40```
|
|
786
|
+
*/
|
|
787
|
+
gift_cards_max_code_length?: number | null;
|
|
788
|
+
/**
|
|
789
|
+
* The maximum number of concurrent cleanups allowed for your organization, default is {CLEANUPS_MAX_CONCURRENT_COUNT}.
|
|
790
|
+
* @example ```10```
|
|
791
|
+
*/
|
|
792
|
+
cleanups_max_concurrent_count?: number | null;
|
|
793
|
+
/**
|
|
794
|
+
* The maximum number of concurrent exports allowed for your organization, default is {EXPORTS_MAX_CONCURRENT_COUNT}.
|
|
795
|
+
* @example ```10```
|
|
796
|
+
*/
|
|
797
|
+
exports_max_concurrent_count?: number | null;
|
|
798
|
+
/**
|
|
799
|
+
* The maximum number of concurrent imports allowed for your organization, default is {IMPORTS_MAX_CONCURRENT_COUNT}.
|
|
800
|
+
* @example ```10```
|
|
801
|
+
*/
|
|
802
|
+
imports_max_concurrent_count?: number | null;
|
|
803
|
+
/**
|
|
804
|
+
* Enables purging of cached resources upon succeeded imports.
|
|
805
|
+
* @example ```true```
|
|
806
|
+
*/
|
|
807
|
+
imports_purge_cache?: boolean | null;
|
|
808
|
+
/**
|
|
809
|
+
* Disables the interruption of the import in case its errors exceeds the 10% threshold, default is {IMPORTS_SKIP_ERRORS}.
|
|
810
|
+
*/
|
|
811
|
+
imports_skip_errors?: boolean | null;
|
|
812
|
+
/**
|
|
813
|
+
* The maximum number for stock locations cutoff, default is {INVENTORY_MODELS_MAX_STOCK_LOCATIONS_CUTOFF}.
|
|
814
|
+
* @example ```10```
|
|
815
|
+
*/
|
|
816
|
+
inventory_models_max_stock_locations_cutoff?: number | null;
|
|
817
|
+
/**
|
|
818
|
+
* The maximum number of active concurrent promotions allowed for your organization, default is {PROMOTIONS_MAX_CONCURRENT_COUNT}.
|
|
819
|
+
* @example ```10```
|
|
820
|
+
*/
|
|
821
|
+
promotions_max_concurrent_count?: number | null;
|
|
822
|
+
/**
|
|
823
|
+
* The maximum number of conditions within a rules payload on a promotion object, default is {PROMOTIONS_MAX_CONDITIONS_SIZE}.
|
|
824
|
+
* @example ```150```
|
|
825
|
+
*/
|
|
826
|
+
promotions_max_conditions_size?: number | null;
|
|
827
|
+
/**
|
|
828
|
+
* The maximum number of rules within a rules payload on a promotion object, default is {PROMOTIONS_MAX_RULES_SIZE}.
|
|
829
|
+
* @example ```15```
|
|
830
|
+
*/
|
|
831
|
+
promotions_max_rules_size?: number | null;
|
|
832
|
+
/**
|
|
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```
|
|
835
|
+
*/
|
|
836
|
+
price_lists_max_conditions_size?: number | null;
|
|
837
|
+
/**
|
|
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```
|
|
840
|
+
*/
|
|
841
|
+
price_lists_max_rules_size?: number | null;
|
|
842
|
+
/**
|
|
843
|
+
* Enables triggering of webhooks during imports, default is {IMPORTS_TRIGGER_WEBHOOKS}.
|
|
844
|
+
* @example ```"false"```
|
|
845
|
+
*/
|
|
846
|
+
imports_trigger_webhooks?: number | null;
|
|
847
|
+
/**
|
|
848
|
+
* Enables the use of an external discount engine in place of the standard one, default is {DISCOUNT_ENGINES_ENABLED}.
|
|
849
|
+
*/
|
|
850
|
+
discount_engines_enabled?: boolean | null;
|
|
851
|
+
/**
|
|
852
|
+
* Enables raising of API errors in case of discount engine failure, default is {DISCOUNT_ENGINES_ERRORS}.
|
|
853
|
+
*/
|
|
854
|
+
discount_engines_errors?: boolean | null;
|
|
855
|
+
/**
|
|
856
|
+
* The maximum length for the tag name, default is {TAGS_MAX_NAME_LENGTH}.
|
|
857
|
+
* @example ```25```
|
|
858
|
+
*/
|
|
859
|
+
tags_max_name_length?: number | null;
|
|
860
|
+
/**
|
|
861
|
+
* The maximum allowed number of tags for each resource, default is {TAGS_MAX_ALLOWED_NUMBER}.
|
|
862
|
+
* @example ```10```
|
|
863
|
+
*/
|
|
864
|
+
tags_max_allowed_number?: number | null;
|
|
865
|
+
/**
|
|
866
|
+
* Enables raising of API errors in case of tax calculation failure, default is {TAX_CALCULATORS_ERRORS}.
|
|
867
|
+
*/
|
|
868
|
+
tax_calculators_errors?: boolean | null;
|
|
869
|
+
/**
|
|
870
|
+
* Enables raising of API errors in case of external promotion failure, default is {EXTERNAL_PROMOTIONS_ERRORS}.
|
|
871
|
+
*/
|
|
872
|
+
external_promotions_errors?: boolean | null;
|
|
873
|
+
/**
|
|
874
|
+
* Enables raising of API errors in case of external price failure, default is {EXTERNAL_PRICES_ERRORS}.
|
|
875
|
+
* @example ```true```
|
|
876
|
+
*/
|
|
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;
|
|
890
|
+
}
|
|
891
|
+
interface OrganizationCreate extends ResourceCreate {
|
|
892
|
+
/**
|
|
893
|
+
* The organization's internal name.
|
|
894
|
+
* @example ```"The Blue Brand"```
|
|
895
|
+
*/
|
|
896
|
+
name: string;
|
|
897
|
+
/**
|
|
898
|
+
* The organization's support phone.
|
|
899
|
+
* @example ```"+01 30800857"```
|
|
900
|
+
*/
|
|
901
|
+
support_phone?: string | null;
|
|
902
|
+
/**
|
|
903
|
+
* The organization's support email.
|
|
904
|
+
* @example ```"support@bluebrand.com"```
|
|
905
|
+
*/
|
|
906
|
+
support_email?: string | null;
|
|
907
|
+
/**
|
|
908
|
+
* The URL to the organization's logo.
|
|
909
|
+
* @example ```"https://bluebrand.com/img/logo.svg"```
|
|
910
|
+
*/
|
|
911
|
+
logo_url?: string | null;
|
|
912
|
+
/**
|
|
913
|
+
* The URL to the organization's favicon.
|
|
914
|
+
* @example ```"https://bluebrand.com/img/favicon.ico"```
|
|
915
|
+
*/
|
|
916
|
+
favicon_url?: string | null;
|
|
917
|
+
/**
|
|
918
|
+
* The organization's primary color.
|
|
919
|
+
* @example ```"#C8984E"```
|
|
920
|
+
*/
|
|
921
|
+
primary_color?: string | null;
|
|
922
|
+
/**
|
|
923
|
+
* The organization's contrast color. Format is HEX (starts with `#` and is followed by six letters and/or numbers).
|
|
924
|
+
* @example ```"#FFFFCC"```
|
|
925
|
+
*/
|
|
926
|
+
contrast_color?: string | null;
|
|
927
|
+
/**
|
|
928
|
+
* The organization's Google Tag Manager ID.
|
|
929
|
+
* @example ```"GTM-5FJXX6"```
|
|
930
|
+
*/
|
|
931
|
+
gtm_id?: string | null;
|
|
932
|
+
/**
|
|
933
|
+
* The organization's Google Tag Manager ID for test.
|
|
934
|
+
* @example ```"GTM-5FJXX7"```
|
|
935
|
+
*/
|
|
936
|
+
gtm_id_test?: string | null;
|
|
937
|
+
/**
|
|
938
|
+
* The region where the organization is located. The default value is `eu-west-1`.
|
|
939
|
+
* @example ```"eu-west-1"```
|
|
940
|
+
*/
|
|
941
|
+
region?: string | null;
|
|
942
|
+
/**
|
|
943
|
+
* The organization's configuration.
|
|
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":[]}}}}}```
|
|
945
|
+
*/
|
|
946
|
+
config?: Record<string, any> | null;
|
|
947
|
+
}
|
|
948
|
+
interface OrganizationUpdate extends ResourceUpdate {
|
|
949
|
+
/**
|
|
950
|
+
* The organization's internal name.
|
|
951
|
+
* @example ```"The Blue Brand"```
|
|
952
|
+
*/
|
|
953
|
+
name?: string | null;
|
|
954
|
+
/**
|
|
955
|
+
* The organization's support phone.
|
|
956
|
+
* @example ```"+01 30800857"```
|
|
957
|
+
*/
|
|
958
|
+
support_phone?: string | null;
|
|
959
|
+
/**
|
|
960
|
+
* The organization's support email.
|
|
961
|
+
* @example ```"support@bluebrand.com"```
|
|
962
|
+
*/
|
|
963
|
+
support_email?: string | null;
|
|
964
|
+
/**
|
|
965
|
+
* The URL to the organization's logo.
|
|
966
|
+
* @example ```"https://bluebrand.com/img/logo.svg"```
|
|
967
|
+
*/
|
|
968
|
+
logo_url?: string | null;
|
|
969
|
+
/**
|
|
970
|
+
* The URL to the organization's favicon.
|
|
971
|
+
* @example ```"https://bluebrand.com/img/favicon.ico"```
|
|
972
|
+
*/
|
|
973
|
+
favicon_url?: string | null;
|
|
974
|
+
/**
|
|
975
|
+
* The organization's primary color.
|
|
976
|
+
* @example ```"#C8984E"```
|
|
977
|
+
*/
|
|
978
|
+
primary_color?: string | null;
|
|
979
|
+
/**
|
|
980
|
+
* The organization's contrast color. Format is HEX (starts with `#` and is followed by six letters and/or numbers).
|
|
981
|
+
* @example ```"#FFFFCC"```
|
|
982
|
+
*/
|
|
983
|
+
contrast_color?: string | null;
|
|
984
|
+
/**
|
|
985
|
+
* The organization's Google Tag Manager ID.
|
|
986
|
+
* @example ```"GTM-5FJXX6"```
|
|
987
|
+
*/
|
|
988
|
+
gtm_id?: string | null;
|
|
989
|
+
/**
|
|
990
|
+
* The organization's Google Tag Manager ID for test.
|
|
991
|
+
* @example ```"GTM-5FJXX7"```
|
|
992
|
+
*/
|
|
993
|
+
gtm_id_test?: string | null;
|
|
994
|
+
/**
|
|
995
|
+
* The organization's configuration.
|
|
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":[]}}}}}```
|
|
997
|
+
*/
|
|
998
|
+
config?: Record<string, any> | null;
|
|
999
|
+
}
|
|
1000
|
+
declare class Organizations extends ApiResource<Organization> {
|
|
1001
|
+
static readonly TYPE: OrganizationType;
|
|
1002
|
+
create(resource: OrganizationCreate, params?: QueryParamsRetrieve<Organization>, options?: ResourcesConfig): Promise<Organization>;
|
|
1003
|
+
update(resource: OrganizationUpdate, params?: QueryParamsRetrieve<Organization>, options?: ResourcesConfig): Promise<Organization>;
|
|
1004
|
+
memberships(organizationId: string | Organization, params?: QueryParamsList<Membership>, options?: ResourcesConfig): Promise<ListResponse<Membership>>;
|
|
1005
|
+
roles(organizationId: string | Organization, params?: QueryParamsList<Role>, options?: ResourcesConfig): Promise<ListResponse<Role>>;
|
|
1006
|
+
permissions(organizationId: string | Organization, params?: QueryParamsList<Permission>, options?: ResourcesConfig): Promise<ListResponse<Permission>>;
|
|
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>;
|
|
1009
|
+
isOrganization(resource: any): resource is Organization;
|
|
1010
|
+
relationship(id: string | ResourceId | null): OrganizationRel$1;
|
|
1011
|
+
relationshipToMany(...ids: string[]): OrganizationRel$1[];
|
|
1012
|
+
type(): OrganizationType;
|
|
1013
|
+
}
|
|
1014
|
+
declare const instance$3: Organizations;
|
|
1015
|
+
|
|
1016
|
+
type ApiCredentialType = 'api_credentials';
|
|
1017
|
+
type ApiCredentialRel = ResourceRel & {
|
|
1018
|
+
type: ApiCredentialType;
|
|
1019
|
+
};
|
|
1020
|
+
type OrganizationRel = ResourceRel & {
|
|
1021
|
+
type: OrganizationType;
|
|
1022
|
+
};
|
|
1023
|
+
type RoleRel = ResourceRel & {
|
|
1024
|
+
type: RoleType;
|
|
1025
|
+
};
|
|
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
|
+
*/
|
|
1032
|
+
interface ApiCredential extends Resource {
|
|
1033
|
+
readonly type: ApiCredentialType;
|
|
1034
|
+
/**
|
|
1035
|
+
* The API credential internal name.
|
|
1036
|
+
* @example ```"My app"```
|
|
1037
|
+
*/
|
|
1038
|
+
name: string;
|
|
1039
|
+
/**
|
|
1040
|
+
* The API credential kind, can be one of: `webapp`, `sales_channel`, `integration` or the kind of app you want to fork (e.g. `orders`, `imports`, etc.).
|
|
1041
|
+
* @example ```"sales_channel"```
|
|
1042
|
+
*/
|
|
1043
|
+
kind: string;
|
|
1044
|
+
/**
|
|
1045
|
+
* Indicates if the API credential it's confidential.
|
|
1046
|
+
* @example ```true```
|
|
1047
|
+
*/
|
|
1048
|
+
confidential?: boolean | null;
|
|
1049
|
+
/**
|
|
1050
|
+
* The API credential redirect URI.
|
|
1051
|
+
* @example ```"https://bluebrand.com/img/logo.svg"```
|
|
1052
|
+
*/
|
|
1053
|
+
redirect_uri?: string | null;
|
|
1054
|
+
/**
|
|
1055
|
+
* The API credential unique ID.
|
|
1056
|
+
* @example ```"xxxx-yyyy-zzzz"```
|
|
1057
|
+
*/
|
|
1058
|
+
client_id?: string | null;
|
|
1059
|
+
/**
|
|
1060
|
+
* The API credential unique secret.
|
|
1061
|
+
* @example ```"xxxx-yyyy-zzzz"```
|
|
1062
|
+
*/
|
|
1063
|
+
client_secret?: string | null;
|
|
1064
|
+
/**
|
|
1065
|
+
* The API credential scopes.
|
|
1066
|
+
* @example ```"market:all market:9 market:122 market:6 stock_location:6 stock_location:33"```
|
|
1067
|
+
*/
|
|
1068
|
+
scopes?: string | null;
|
|
1069
|
+
/**
|
|
1070
|
+
* The lifetime of the access token in seconds (min. `7200`, max. `31536000`. Default is `14400` for Sales channels and `7200` for other client types).
|
|
1071
|
+
* @example ```7200```
|
|
1072
|
+
*/
|
|
1073
|
+
expires_in?: number | null;
|
|
1074
|
+
/**
|
|
1075
|
+
* Indicates the environment the resource belongs to (one of `test` or `live`).
|
|
1076
|
+
* @example ```"test"```
|
|
1077
|
+
*/
|
|
1078
|
+
mode?: string | null;
|
|
1079
|
+
/**
|
|
1080
|
+
* Indicates if the API credential is used to create a custom app (e.g. fork a hosted app).
|
|
1081
|
+
*/
|
|
1082
|
+
custom?: boolean | null;
|
|
1083
|
+
organization?: Organization | null;
|
|
1084
|
+
role?: Role | null;
|
|
1085
|
+
}
|
|
1086
|
+
interface ApiCredentialCreate extends ResourceCreate {
|
|
1087
|
+
/**
|
|
1088
|
+
* The API credential internal name.
|
|
1089
|
+
* @example ```"My app"```
|
|
1090
|
+
*/
|
|
1091
|
+
name: string;
|
|
1092
|
+
/**
|
|
1093
|
+
* The API credential kind, can be one of: `webapp`, `sales_channel`, `integration` or the kind of app you want to fork (e.g. `orders`, `imports`, etc.).
|
|
1094
|
+
* @example ```"sales_channel"```
|
|
1095
|
+
*/
|
|
1096
|
+
kind: string;
|
|
1097
|
+
/**
|
|
1098
|
+
* The API credential redirect URI.
|
|
1099
|
+
* @example ```"https://bluebrand.com/img/logo.svg"```
|
|
1100
|
+
*/
|
|
1101
|
+
redirect_uri?: string | null;
|
|
1102
|
+
/**
|
|
1103
|
+
* The lifetime of the access token in seconds (min. `7200`, max. `31536000`. Default is `14400` for Sales channels and `7200` for other client types).
|
|
1104
|
+
* @example ```7200```
|
|
1105
|
+
*/
|
|
1106
|
+
expires_in?: number | null;
|
|
1107
|
+
/**
|
|
1108
|
+
* Indicates the environment the resource belongs to (one of `test` or `live`).
|
|
1109
|
+
* @example ```"test"```
|
|
1110
|
+
*/
|
|
1111
|
+
mode?: string | null;
|
|
1112
|
+
/**
|
|
1113
|
+
* Indicates if the API credential is used to create a custom app (e.g. fork a hosted app).
|
|
1114
|
+
*/
|
|
1115
|
+
custom?: boolean | null;
|
|
1116
|
+
organization: OrganizationRel;
|
|
1117
|
+
role?: RoleRel | null;
|
|
1118
|
+
}
|
|
1119
|
+
interface ApiCredentialUpdate extends ResourceUpdate {
|
|
1120
|
+
/**
|
|
1121
|
+
* The API credential internal name.
|
|
1122
|
+
* @example ```"My app"```
|
|
1123
|
+
*/
|
|
1124
|
+
name?: string | null;
|
|
1125
|
+
/**
|
|
1126
|
+
* The API credential redirect URI.
|
|
1127
|
+
* @example ```"https://bluebrand.com/img/logo.svg"```
|
|
1128
|
+
*/
|
|
1129
|
+
redirect_uri?: string | null;
|
|
1130
|
+
/**
|
|
1131
|
+
* The lifetime of the access token in seconds (min. `7200`, max. `31536000`. Default is `14400` for Sales channels and `7200` for other client types).
|
|
1132
|
+
* @example ```7200```
|
|
1133
|
+
*/
|
|
1134
|
+
expires_in?: number | null;
|
|
1135
|
+
role?: RoleRel | null;
|
|
1136
|
+
}
|
|
1137
|
+
declare class ApiCredentials extends ApiResource<ApiCredential> {
|
|
1138
|
+
static readonly TYPE: ApiCredentialType;
|
|
1139
|
+
create(resource: ApiCredentialCreate, params?: QueryParamsRetrieve<ApiCredential>, options?: ResourcesConfig): Promise<ApiCredential>;
|
|
1140
|
+
update(resource: ApiCredentialUpdate, params?: QueryParamsRetrieve<ApiCredential>, options?: ResourcesConfig): Promise<ApiCredential>;
|
|
1141
|
+
delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void>;
|
|
1142
|
+
organization(apiCredentialId: string | ApiCredential, params?: QueryParamsRetrieve<Organization>, options?: ResourcesConfig): Promise<Organization>;
|
|
1143
|
+
role(apiCredentialId: string | ApiCredential, params?: QueryParamsRetrieve<Role>, options?: ResourcesConfig): Promise<Role>;
|
|
1144
|
+
isApiCredential(resource: any): resource is ApiCredential;
|
|
1145
|
+
relationship(id: string | ResourceId | null): ApiCredentialRel;
|
|
1146
|
+
relationshipToMany(...ids: string[]): ApiCredentialRel[];
|
|
1147
|
+
type(): ApiCredentialType;
|
|
1148
|
+
}
|
|
1149
|
+
declare const instance$2: ApiCredentials;
|
|
1150
|
+
|
|
1151
|
+
type UserType = 'users';
|
|
1152
|
+
type UserRel = ResourceRel & {
|
|
1153
|
+
type: UserType;
|
|
1154
|
+
};
|
|
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
|
+
*/
|
|
1161
|
+
interface User extends Resource {
|
|
1162
|
+
readonly type: UserType;
|
|
1163
|
+
/**
|
|
1164
|
+
* The user email.
|
|
1165
|
+
* @example ```"user@commercelayer.io"```
|
|
1166
|
+
*/
|
|
1167
|
+
email: string;
|
|
1168
|
+
/**
|
|
1169
|
+
* The user first name.
|
|
1170
|
+
* @example ```"John"```
|
|
1171
|
+
*/
|
|
1172
|
+
first_name: string;
|
|
1173
|
+
/**
|
|
1174
|
+
* The user last name.
|
|
1175
|
+
* @example ```"Doe"```
|
|
1176
|
+
*/
|
|
1177
|
+
last_name: string;
|
|
1178
|
+
/**
|
|
1179
|
+
* The user preferred timezone.
|
|
1180
|
+
* @example ```"UTC"```
|
|
1181
|
+
*/
|
|
1182
|
+
time_zone?: string | null;
|
|
1183
|
+
/**
|
|
1184
|
+
* The user 2FA setting.
|
|
1185
|
+
* @example ```true```
|
|
1186
|
+
*/
|
|
1187
|
+
otp_required_for_login?: boolean | null;
|
|
1188
|
+
}
|
|
1189
|
+
interface UserUpdate extends SingletonUpdate {
|
|
1190
|
+
/**
|
|
1191
|
+
* The user email.
|
|
1192
|
+
* @example ```"user@commercelayer.io"```
|
|
1193
|
+
*/
|
|
1194
|
+
email?: string | null;
|
|
1195
|
+
/**
|
|
1196
|
+
* The user first name.
|
|
1197
|
+
* @example ```"John"```
|
|
1198
|
+
*/
|
|
1199
|
+
first_name?: string | null;
|
|
1200
|
+
/**
|
|
1201
|
+
* The user last name.
|
|
1202
|
+
* @example ```"Doe"```
|
|
1203
|
+
*/
|
|
1204
|
+
last_name?: string | null;
|
|
1205
|
+
/**
|
|
1206
|
+
* The user preferred timezone.
|
|
1207
|
+
* @example ```"UTC"```
|
|
1208
|
+
*/
|
|
1209
|
+
time_zone?: string | null;
|
|
1210
|
+
}
|
|
1211
|
+
declare class Users extends ApiSingleton<User> {
|
|
1212
|
+
static readonly TYPE: UserType;
|
|
1213
|
+
update(resource: UserUpdate, params?: QueryParamsRetrieve<User>, options?: ResourcesConfig): Promise<User>;
|
|
1214
|
+
isUser(resource: any): resource is User;
|
|
1215
|
+
relationship(id: string | ResourceId | null): UserRel;
|
|
1216
|
+
relationshipToMany(...ids: string[]): UserRel[];
|
|
1217
|
+
type(): UserType;
|
|
1218
|
+
path(): string;
|
|
1219
|
+
}
|
|
1220
|
+
declare const instance$1: Users;
|
|
1221
|
+
|
|
1222
|
+
type IdentityProviderType = 'identity_providers';
|
|
1223
|
+
type IdentityProviderRel = ResourceRel & {
|
|
1224
|
+
type: IdentityProviderType;
|
|
1225
|
+
};
|
|
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
|
+
*/
|
|
1232
|
+
interface IdentityProvider extends Resource {
|
|
1233
|
+
readonly type: IdentityProviderType;
|
|
1234
|
+
/**
|
|
1235
|
+
* The name of the Identity provider.
|
|
1236
|
+
* @example ```"Org auth0"```
|
|
1237
|
+
*/
|
|
1238
|
+
name: string;
|
|
1239
|
+
/**
|
|
1240
|
+
* The client ID used for the auth workflow.
|
|
1241
|
+
* @example ```"a6CDk5v1ZV99GrtOcfYVEZRnDDt"```
|
|
1242
|
+
*/
|
|
1243
|
+
client_id: string;
|
|
1244
|
+
/**
|
|
1245
|
+
* The client secret used for the auth workflow.
|
|
1246
|
+
* @example ```"s6CD55v1ZV99ArtOcfYVEZRnDDf"```
|
|
1247
|
+
*/
|
|
1248
|
+
client_secret: string;
|
|
1249
|
+
/**
|
|
1250
|
+
* The issuer used for the auth workflow.
|
|
1251
|
+
* @example ```"https://dev.auth987.com/"```
|
|
1252
|
+
*/
|
|
1253
|
+
issuer: string;
|
|
1254
|
+
/**
|
|
1255
|
+
* The identity provider status. One of `pending` (default), `verified` or `error`.
|
|
1256
|
+
* @example ```"pending"```
|
|
1257
|
+
*/
|
|
1258
|
+
status: 'pending' | 'verified' | 'error';
|
|
1259
|
+
/**
|
|
1260
|
+
* The list of domains in scope (comma-separated).
|
|
1261
|
+
* @example ```"dev.auth987.com,stg.auth987.com"```
|
|
1262
|
+
*/
|
|
1263
|
+
domains: string;
|
|
1264
|
+
/**
|
|
1265
|
+
* The token URL used for the auth workflow.
|
|
1266
|
+
* @example ```"https://dev.auth987.com/oauth/token"```
|
|
1267
|
+
*/
|
|
1268
|
+
token_url: string;
|
|
1269
|
+
/**
|
|
1270
|
+
* The authorize URL used for the auth workflow.
|
|
1271
|
+
* @example ```"https://dev.auth987.com/authorize"```
|
|
1272
|
+
*/
|
|
1273
|
+
authorize_url: string;
|
|
1274
|
+
/**
|
|
1275
|
+
* The JWKS key store URL used for the auth workflow.
|
|
1276
|
+
* @example ```"https://dev.auth987.com/.well-known/jwks.json"```
|
|
1277
|
+
*/
|
|
1278
|
+
jwks_url: string;
|
|
1279
|
+
/**
|
|
1280
|
+
* The TXT record value used to check the domain.
|
|
1281
|
+
* @example ```"cl-verification=a6CDk5v"```
|
|
1282
|
+
*/
|
|
1283
|
+
txt_record?: string | null;
|
|
1284
|
+
/**
|
|
1285
|
+
* The organization identifier for authorize params.
|
|
1286
|
+
* @example ```"org_76gsfs5gd"```
|
|
1287
|
+
*/
|
|
1288
|
+
organization?: string | null;
|
|
1289
|
+
/**
|
|
1290
|
+
* Time at which this resource was disabled.
|
|
1291
|
+
* @example ```"2018-01-01T12:00:00.000Z"```
|
|
1292
|
+
*/
|
|
1293
|
+
disabled_at?: string | null;
|
|
1294
|
+
user?: User | null;
|
|
1295
|
+
}
|
|
1296
|
+
interface IdentityProviderCreate extends ResourceCreate {
|
|
1297
|
+
/**
|
|
1298
|
+
* The name of the Identity provider.
|
|
1299
|
+
* @example ```"Org auth0"```
|
|
1300
|
+
*/
|
|
1301
|
+
name: string;
|
|
1302
|
+
/**
|
|
1303
|
+
* The client ID used for the auth workflow.
|
|
1304
|
+
* @example ```"a6CDk5v1ZV99GrtOcfYVEZRnDDt"```
|
|
1305
|
+
*/
|
|
1306
|
+
client_id: string;
|
|
1307
|
+
/**
|
|
1308
|
+
* The client secret used for the auth workflow.
|
|
1309
|
+
* @example ```"s6CD55v1ZV99ArtOcfYVEZRnDDf"```
|
|
1310
|
+
*/
|
|
1311
|
+
client_secret: string;
|
|
1312
|
+
/**
|
|
1313
|
+
* The issuer used for the auth workflow.
|
|
1314
|
+
* @example ```"https://dev.auth987.com/"```
|
|
1315
|
+
*/
|
|
1316
|
+
issuer: string;
|
|
1317
|
+
/**
|
|
1318
|
+
* The list of domains in scope (comma-separated).
|
|
1319
|
+
* @example ```"dev.auth987.com,stg.auth987.com"```
|
|
1320
|
+
*/
|
|
1321
|
+
domains: string;
|
|
1322
|
+
/**
|
|
1323
|
+
* The token URL used for the auth workflow.
|
|
1324
|
+
* @example ```"https://dev.auth987.com/oauth/token"```
|
|
1325
|
+
*/
|
|
1326
|
+
token_url: string;
|
|
1327
|
+
/**
|
|
1328
|
+
* The authorize URL used for the auth workflow.
|
|
1329
|
+
* @example ```"https://dev.auth987.com/authorize"```
|
|
1330
|
+
*/
|
|
1331
|
+
authorize_url: string;
|
|
1332
|
+
/**
|
|
1333
|
+
* The JWKS key store URL used for the auth workflow.
|
|
1334
|
+
* @example ```"https://dev.auth987.com/.well-known/jwks.json"```
|
|
1335
|
+
*/
|
|
1336
|
+
jwks_url: string;
|
|
1337
|
+
/**
|
|
1338
|
+
* The organization identifier for authorize params.
|
|
1339
|
+
* @example ```"org_76gsfs5gd"```
|
|
1340
|
+
*/
|
|
1341
|
+
organization?: string | null;
|
|
1342
|
+
/**
|
|
1343
|
+
* Send this attribute if you want to mark this resource as disabled.
|
|
1344
|
+
* @example ```true```
|
|
1345
|
+
*/
|
|
1346
|
+
_disable?: boolean | null;
|
|
1347
|
+
/**
|
|
1348
|
+
* Send this attribute if you want to mark this resource as enabled.
|
|
1349
|
+
* @example ```true```
|
|
1350
|
+
*/
|
|
1351
|
+
_enable?: boolean | null;
|
|
1352
|
+
}
|
|
1353
|
+
interface IdentityProviderUpdate extends ResourceUpdate {
|
|
1354
|
+
/**
|
|
1355
|
+
* The name of the Identity provider.
|
|
1356
|
+
* @example ```"Org auth0"```
|
|
1357
|
+
*/
|
|
1358
|
+
name?: string | null;
|
|
1359
|
+
/**
|
|
1360
|
+
* The client ID used for the auth workflow.
|
|
1361
|
+
* @example ```"a6CDk5v1ZV99GrtOcfYVEZRnDDt"```
|
|
1362
|
+
*/
|
|
1363
|
+
client_id?: string | null;
|
|
1364
|
+
/**
|
|
1365
|
+
* The client secret used for the auth workflow.
|
|
1366
|
+
* @example ```"s6CD55v1ZV99ArtOcfYVEZRnDDf"```
|
|
1367
|
+
*/
|
|
1368
|
+
client_secret?: string | null;
|
|
1369
|
+
/**
|
|
1370
|
+
* The issuer used for the auth workflow.
|
|
1371
|
+
* @example ```"https://dev.auth987.com/"```
|
|
1372
|
+
*/
|
|
1373
|
+
issuer?: string | null;
|
|
1374
|
+
/**
|
|
1375
|
+
* The list of domains in scope (comma-separated).
|
|
1376
|
+
* @example ```"dev.auth987.com,stg.auth987.com"```
|
|
1377
|
+
*/
|
|
1378
|
+
domains?: string | null;
|
|
1379
|
+
/**
|
|
1380
|
+
* The token URL used for the auth workflow.
|
|
1381
|
+
* @example ```"https://dev.auth987.com/oauth/token"```
|
|
1382
|
+
*/
|
|
1383
|
+
token_url?: string | null;
|
|
1384
|
+
/**
|
|
1385
|
+
* The authorize URL used for the auth workflow.
|
|
1386
|
+
* @example ```"https://dev.auth987.com/authorize"```
|
|
1387
|
+
*/
|
|
1388
|
+
authorize_url?: string | null;
|
|
1389
|
+
/**
|
|
1390
|
+
* The JWKS key store URL used for the auth workflow.
|
|
1391
|
+
* @example ```"https://dev.auth987.com/.well-known/jwks.json"```
|
|
1392
|
+
*/
|
|
1393
|
+
jwks_url?: string | null;
|
|
1394
|
+
/**
|
|
1395
|
+
* The organization identifier for authorize params.
|
|
1396
|
+
* @example ```"org_76gsfs5gd"```
|
|
1397
|
+
*/
|
|
1398
|
+
organization?: string | null;
|
|
1399
|
+
/**
|
|
1400
|
+
* Send this attribute if you want to mark this resource as disabled.
|
|
1401
|
+
* @example ```true```
|
|
1402
|
+
*/
|
|
1403
|
+
_disable?: boolean | null;
|
|
1404
|
+
/**
|
|
1405
|
+
* Send this attribute if you want to mark this resource as enabled.
|
|
1406
|
+
* @example ```true```
|
|
1407
|
+
*/
|
|
1408
|
+
_enable?: boolean | null;
|
|
1409
|
+
}
|
|
1410
|
+
declare class IdentityProviders extends ApiResource<IdentityProvider> {
|
|
1411
|
+
static readonly TYPE: IdentityProviderType;
|
|
1412
|
+
create(resource: IdentityProviderCreate, params?: QueryParamsRetrieve<IdentityProvider>, options?: ResourcesConfig): Promise<IdentityProvider>;
|
|
1413
|
+
update(resource: IdentityProviderUpdate, params?: QueryParamsRetrieve<IdentityProvider>, options?: ResourcesConfig): Promise<IdentityProvider>;
|
|
1414
|
+
delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void>;
|
|
1415
|
+
user(identityProviderId: string | IdentityProvider, params?: QueryParamsRetrieve<User>, options?: ResourcesConfig): Promise<User>;
|
|
1416
|
+
_disable(id: string | IdentityProvider, params?: QueryParamsRetrieve<IdentityProvider>, options?: ResourcesConfig): Promise<IdentityProvider>;
|
|
1417
|
+
_enable(id: string | IdentityProvider, params?: QueryParamsRetrieve<IdentityProvider>, options?: ResourcesConfig): Promise<IdentityProvider>;
|
|
1418
|
+
isIdentityProvider(resource: any): resource is IdentityProvider;
|
|
1419
|
+
relationship(id: string | ResourceId | null): IdentityProviderRel;
|
|
1420
|
+
relationshipToMany(...ids: string[]): IdentityProviderRel[];
|
|
1421
|
+
type(): IdentityProviderType;
|
|
1422
|
+
}
|
|
1423
|
+
declare const instance: IdentityProviders;
|
|
1424
|
+
|
|
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"];
|
|
1429
|
+
type RetrievableResourceType = ResourceTypeLock;
|
|
1430
|
+
type RetrievableResource = Resource & {
|
|
1431
|
+
type: RetrievableResourceType;
|
|
1432
|
+
};
|
|
1433
|
+
type ListableResourceType = Exclude<ResourceTypeLock, 'users'>;
|
|
1434
|
+
type ListableResource = Resource & {
|
|
1435
|
+
type: ListableResourceType;
|
|
1436
|
+
};
|
|
1437
|
+
declare const creatableResources: readonly ["api_credentials", "application_memberships", "identity_providers", "memberships", "membership_profiles", "organizations", "permissions", "roles"];
|
|
1438
|
+
type CreatableResourceType = (typeof creatableResources)[number];
|
|
1439
|
+
type CreatableResource = Resource & {
|
|
1440
|
+
type: CreatableResourceType;
|
|
1441
|
+
};
|
|
1442
|
+
declare const updatableResources: readonly ["api_credentials", "application_memberships", "identity_providers", "memberships", "membership_profiles", "organizations", "permissions", "roles"];
|
|
1443
|
+
type UpdatableResourceType = (typeof updatableResources)[number];
|
|
1444
|
+
type UpdatableResource = Resource & {
|
|
1445
|
+
type: UpdatableResourceType;
|
|
1446
|
+
};
|
|
1447
|
+
declare const deletableResources: readonly ["api_credentials", "application_memberships", "identity_providers", "memberships", "membership_profiles"];
|
|
1448
|
+
type DeletableResourceType = (typeof deletableResources)[number];
|
|
1449
|
+
type DeletableResource = Resource & {
|
|
1450
|
+
type: DeletableResourceType;
|
|
1451
|
+
};
|
|
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;
|
|
1458
|
+
type ResourceFields = {
|
|
1459
|
+
api_credentials: ApiCredential;
|
|
1460
|
+
application_memberships: ApplicationMembership;
|
|
1461
|
+
identity_providers: IdentityProvider;
|
|
1462
|
+
memberships: Membership;
|
|
1463
|
+
membership_profiles: MembershipProfile;
|
|
1464
|
+
organizations: Organization;
|
|
1465
|
+
permissions: Permission;
|
|
1466
|
+
roles: Role;
|
|
1467
|
+
users: User;
|
|
1468
|
+
versions: Version;
|
|
1469
|
+
};
|
|
1470
|
+
type ResourceSortFields = {
|
|
1471
|
+
api_credentials: ApiCredentialSort;
|
|
1472
|
+
application_memberships: ApplicationMembershipSort;
|
|
1473
|
+
identity_providers: IdentityProviderSort;
|
|
1474
|
+
memberships: MembershipSort;
|
|
1475
|
+
membership_profiles: MembershipProfileSort;
|
|
1476
|
+
organizations: OrganizationSort;
|
|
1477
|
+
permissions: PermissionSort;
|
|
1478
|
+
roles: RoleSort;
|
|
1479
|
+
users: UserSort;
|
|
1480
|
+
versions: VersionSort;
|
|
1481
|
+
};
|
|
1482
|
+
|
|
1483
|
+
type RequestParams = Record<string, string | number | boolean>;
|
|
1484
|
+
type RequestHeaders = Record<string, string>;
|
|
1485
|
+
type RefreshToken = (expiredToken: string) => Promise<string>;
|
|
1486
|
+
type RequestConfig = {
|
|
1487
|
+
timeout?: number;
|
|
1488
|
+
params?: RequestParams;
|
|
1489
|
+
headers?: RequestHeaders;
|
|
1490
|
+
userAgent?: string;
|
|
1491
|
+
fetch?: Fetch;
|
|
1492
|
+
refreshToken?: RefreshToken;
|
|
1493
|
+
telemetry?: boolean;
|
|
1494
|
+
};
|
|
1495
|
+
type ApiConfig = {
|
|
1496
|
+
organization?: string;
|
|
1497
|
+
domain?: string;
|
|
1498
|
+
accessToken: string;
|
|
1499
|
+
apiVersion?: string;
|
|
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;
|
|
1518
|
+
}
|
|
1519
|
+
|
|
1520
|
+
type ResourceNull = {
|
|
1521
|
+
id: null;
|
|
1522
|
+
} & ResourceType;
|
|
1523
|
+
type ResourceRel = ResourceId | ResourceNull;
|
|
1524
|
+
type Metadata = ObjectType;
|
|
1525
|
+
interface ResourceType {
|
|
1526
|
+
readonly type: ResourceTypeLock;
|
|
1527
|
+
}
|
|
1528
|
+
interface ResourceId extends ResourceType {
|
|
1529
|
+
readonly id: string;
|
|
1530
|
+
}
|
|
1531
|
+
interface ResourceBase {
|
|
1532
|
+
reference?: string | null;
|
|
1533
|
+
reference_origin?: string | null;
|
|
1534
|
+
metadata?: Metadata;
|
|
1535
|
+
}
|
|
1536
|
+
interface Resource extends ResourceBase, ResourceId {
|
|
1537
|
+
readonly created_at: string;
|
|
1538
|
+
readonly updated_at: string;
|
|
1539
|
+
}
|
|
1540
|
+
interface ResourceCreate extends ResourceBase {
|
|
1541
|
+
}
|
|
1542
|
+
interface ResourceUpdate extends ResourceBase {
|
|
1543
|
+
readonly id: string;
|
|
1544
|
+
}
|
|
1545
|
+
/**
|
|
1546
|
+
* Update payload for a singleton resource, which carries no `id` because it is
|
|
1547
|
+
* addressed at a singular path (`/user`, not `/users/{id}`). Distinct from
|
|
1548
|
+
* `ResourceUpdate` purely to keep `id` off the caller's payload.
|
|
1549
|
+
*/
|
|
1550
|
+
interface SingletonUpdate extends ResourceBase {
|
|
1551
|
+
}
|
|
1552
|
+
type PageCursor = {
|
|
1553
|
+
readonly before?: string;
|
|
1554
|
+
readonly after?: string;
|
|
1555
|
+
};
|
|
1556
|
+
type ListMeta = {
|
|
1557
|
+
readonly pageCount: number;
|
|
1558
|
+
readonly recordCount: number;
|
|
1559
|
+
readonly currentPage: number;
|
|
1560
|
+
readonly recordsPerPage: number;
|
|
1561
|
+
readonly cursor?: {
|
|
1562
|
+
readonly prev?: PageCursor;
|
|
1563
|
+
readonly next?: PageCursor;
|
|
1564
|
+
};
|
|
1565
|
+
};
|
|
1566
|
+
declare class ListResponse<R extends Resource = Resource> extends Array<R> {
|
|
1567
|
+
readonly meta: ListMeta;
|
|
1568
|
+
constructor(meta: ListMeta, data: R[]);
|
|
1569
|
+
first(): R | undefined;
|
|
1570
|
+
last(): R | undefined;
|
|
1571
|
+
get(index: number): R | undefined;
|
|
1572
|
+
hasNextPage(): boolean;
|
|
1573
|
+
hasPrevPage(): boolean;
|
|
1574
|
+
getRecordCount(): number;
|
|
1575
|
+
getPageCount(): number;
|
|
1576
|
+
get recordCount(): number;
|
|
1577
|
+
get pageCount(): number;
|
|
1578
|
+
}
|
|
1579
|
+
|
|
1580
|
+
type ResourceSort = Pick<Resource, 'id' | 'reference' | 'reference_origin' | 'created_at' | 'updated_at'>;
|
|
1581
|
+
type ResourceFilter = Pick<Resource, 'id' | 'reference' | 'reference_origin' | 'metadata' | 'created_at' | 'updated_at'>;
|
|
1582
|
+
type ResourceAdapterConfig = {};
|
|
1583
|
+
type ResourcesInitConfig = ResourceAdapterConfig & ApiClientInitConfig;
|
|
1584
|
+
type ResourcesConfig = Partial<ResourcesInitConfig>;
|
|
1585
|
+
declare class ResourceAdapter {
|
|
1586
|
+
#private;
|
|
1587
|
+
constructor(config: ResourcesInitConfig);
|
|
1588
|
+
private localConfig;
|
|
1589
|
+
config(config: ResourcesConfig): this;
|
|
1590
|
+
get client(): Readonly<ApiClient>;
|
|
1591
|
+
singleton<R extends Resource>(resource: ResourceType, params?: QueryParamsRetrieve<R>, options?: ResourcesConfig, path?: string): Promise<R>;
|
|
1592
|
+
retrieve<R extends Resource>(resource: ResourceId, params?: QueryParamsRetrieve<R>, options?: ResourcesConfig): Promise<R>;
|
|
1593
|
+
list<R extends Resource>(resource: ResourceType, params?: QueryParamsList<R>, options?: ResourcesConfig): Promise<ListResponse<R>>;
|
|
1594
|
+
create<C extends ResourceCreate, R extends Resource>(resource: C & ResourceType, params?: QueryParamsRetrieve<R>, options?: ResourcesConfig): Promise<R>;
|
|
1595
|
+
update<U extends ResourceUpdate | SingletonUpdate, R extends Resource>(resource: U & ResourceType, params?: QueryParamsRetrieve<R>, options?: ResourcesConfig,
|
|
1596
|
+
/**
|
|
1597
|
+
* Singular path override for singleton resources, e.g. `user` rather than
|
|
1598
|
+
* `users/{id}`. Mirrors `singleton()` above. Core never needed it — both
|
|
1599
|
+
* its singletons are retrieve-only — but the Provisioning API's `user` is
|
|
1600
|
+
* updatable, and without this the request targets `/users/{id}` and 404s.
|
|
1601
|
+
*/
|
|
1602
|
+
path?: string): Promise<R>;
|
|
1603
|
+
delete(resource: ResourceId, options?: ResourcesConfig): Promise<void>;
|
|
1604
|
+
/**
|
|
1605
|
+
* Calls a non-CRUD endpoint hosted at a sub-path of a resource, e.g.
|
|
1606
|
+
* `POST memberships/:id/resend`. These endpoints are not described by the
|
|
1607
|
+
* public resources schema, so they are declared in a target config and
|
|
1608
|
+
* emitted from it.
|
|
1609
|
+
*/
|
|
1610
|
+
action(cmd: Extract<Method, 'POST' | 'PATCH'>, path: string, payload?: any, options?: ResourcesConfig): Promise<void>;
|
|
1611
|
+
fetch<R extends Resource>(resource: string | ResourceType, path: string, params?: QueryParams<R>, options?: ResourcesConfig): Promise<R | ListResponse<R>>;
|
|
1612
|
+
}
|
|
1613
|
+
declare abstract class ApiResourceBase<R extends Resource> {
|
|
1614
|
+
#private;
|
|
1615
|
+
static readonly TYPE: ResourceTypeLock;
|
|
1616
|
+
constructor(adapter?: ResourceAdapter);
|
|
1617
|
+
protected get resources(): ResourceAdapter;
|
|
1618
|
+
/**
|
|
1619
|
+
* Returns a copy of this resource instance bound to a specific
|
|
1620
|
+
* `ResourceAdapter`. Used by the bundle client so each client instance
|
|
1621
|
+
* routes requests through its own adapter (its own access token) instead
|
|
1622
|
+
* of the process-global static adapter. Resource classes are type-only
|
|
1623
|
+
* exports, so we clone via `this.constructor` rather than referencing the
|
|
1624
|
+
* class directly.
|
|
1625
|
+
*/
|
|
1626
|
+
withAdapter(adapter: ResourceAdapter): this;
|
|
1627
|
+
abstract relationship(id: string | ResourceId | null): ResourceRel;
|
|
1628
|
+
protected relationshipOneToOne<RR extends ResourceRel>(id: string | ResourceId | null): RR;
|
|
1629
|
+
protected relationshipOneToMany<RR extends ResourceRel>(...ids: string[]): RR[];
|
|
1630
|
+
abstract type(): ResourceTypeLock;
|
|
1631
|
+
protected path(): string;
|
|
1632
|
+
update(resource: ResourceUpdate, params?: QueryParamsRetrieve<R>, options?: ResourcesConfig): Promise<R>;
|
|
1633
|
+
}
|
|
1634
|
+
declare abstract class ApiResource<R extends Resource> extends ApiResourceBase<R> {
|
|
1635
|
+
retrieve(id: string | ResourceId, params?: QueryParamsRetrieve<R>, options?: ResourcesConfig): Promise<R>;
|
|
1636
|
+
list(params?: QueryParamsList<R>, options?: ResourcesConfig): Promise<ListResponse<R>>;
|
|
1637
|
+
count(filter?: QueryFilter | QueryParamsList<R>, options?: ResourcesConfig): Promise<number>;
|
|
1638
|
+
}
|
|
1639
|
+
declare abstract class ApiSingleton<R extends Resource> extends ApiResourceBase<R> {
|
|
1640
|
+
retrieve(params?: QueryParamsRetrieve<R>, options?: ResourcesConfig): Promise<R>;
|
|
1641
|
+
}
|
|
1642
|
+
|
|
1643
|
+
export { type QueryPageSize as $, type ApiCredential as A, type MembershipSort as B, type CreatableResource as C, type DeletableResource as D, type ErrorObj as E, type MembershipUpdate as F, Memberships as G, type HeadersObj as H, type IdentityProvider as I, type Metadata as J, type OrganizationCreate as K, type ListMeta as L, type Membership as M, type OrganizationSort as N, type Organization as O, type OrganizationUpdate as P, Organizations as Q, type Permission as R, type PermissionCreate as S, type PermissionSort as T, type PermissionUpdate as U, Permissions as V, type QueryFields as W, type QueryFilter as X, type QueryInclude as Y, type QueryPageCursor as Z, type QueryPageNumber as _, type ApiCredentialCreate as a, type IdentityProviderType as a$, type QueryParams as a0, type QueryParamsList as a1, type QueryParamsRetrieve as a2, type QuerySort as a3, type RequestObj as a4, type Resource as a5, type ResourceCreate as a6, type ResourceFields as a7, type ResourceFilter as a8, type ResourceId as a9, resourceList as aA, singletonList as aB, getResources as aC, ResourceAdapter as aD, type RequestInterceptor as aE, type ErrorInterceptor as aF, type ResponseInterceptor as aG, type InterceptorType as aH, type RawResponseReader as aI, type MembershipProfileType as aJ, instance$9 as aK, type VersionType as aL, instance$8 as aM, type PermissionType as aN, instance$7 as aO, type RoleType as aP, instance$6 as aQ, type ApplicationMembershipType as aR, instance$5 as aS, type MembershipType as aT, instance$4 as aU, type OrganizationType as aV, instance$3 as aW, type ApiCredentialType as aX, instance$2 as aY, type UserType as aZ, instance$1 as a_, type ResourceRel as aa, type ResourceSort as ab, type ResourceSortFields as ac, type ResourceType as ad, type ResourceTypeLock as ae, type ResourceUpdate as af, type ResourcesConfig as ag, type ResourcesInitConfig as ah, type ResponseObj as ai, type RetrievableResource as aj, type RetrievableResourceType as ak, type Role as al, type RoleCreate as am, type RoleSort as an, type RoleUpdate as ao, Roles as ap, type SingletonUpdate as aq, type UpdatableResource as ar, type UpdatableResourceType as as, type User as at, type UserSort as au, type UserUpdate as av, Users as aw, type Version as ax, type VersionSort as ay, Versions as az, type ApiCredentialSort as b, instance as b0, creatableResources as b1, deletableResources as b2, getSingletons as b3, isCreatable as b4, isDeletable as b5, isSingleton as b6, isUpdatable as b7, updatableResources as b8, type ApiCredentialUpdate as c, ApiCredentials as d, ApiResource as e, ApiSingleton as f, type ApplicationMembership as g, type ApplicationMembershipCreate as h, type ApplicationMembershipSort as i, type ApplicationMembershipUpdate as j, ApplicationMemberships as k, type CreatableResourceType as l, type DeletableResourceType as m, type IdentityProviderCreate as n, type IdentityProviderSort as o, type IdentityProviderUpdate as p, IdentityProviders as q, ListResponse as r, type ListableResource as s, type ListableResourceType as t, type MembershipCreate as u, type MembershipProfile as v, type MembershipProfileCreate as w, type MembershipProfileSort as x, type MembershipProfileUpdate as y, MembershipProfiles as z };
|