@aurigma/axios-storefront-api-client 2.24.1 → 2.25.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/dist/cjs/storefront-api-client.d.ts +57 -16
- package/dist/cjs/storefront-api-client.js +81 -1
- package/dist/cjs/storefront-api-client.js.map +1 -1
- package/dist/esm/storefront-api-client.d.ts +57 -16
- package/dist/esm/storefront-api-client.js +80 -0
- package/dist/esm/storefront-api-client.js.map +1 -1
- package/package.json +1 -1
|
@@ -64,7 +64,7 @@ export interface IProductReferencesApiClient {
|
|
|
64
64
|
* @param body (optional) Create operation parameters.
|
|
65
65
|
* @return Success
|
|
66
66
|
*/
|
|
67
|
-
create(storefrontId: number, tenantId?: number | null | undefined, body?: CreateProductReferenceDto | undefined): Promise<ProductReferenceDto>;
|
|
67
|
+
create(storefrontId: number, tenantId?: number | null | undefined, body?: CreateProductReferenceDto | null | undefined): Promise<ProductReferenceDto>;
|
|
68
68
|
/**
|
|
69
69
|
* Returns a storefront product reference.
|
|
70
70
|
* @param reference Product reference - external reference to Customer's Canvas product specification, e.g online store product identifier.
|
|
@@ -136,7 +136,7 @@ export declare class ProductReferencesApiClient extends ApiClientBase implements
|
|
|
136
136
|
* @param body (optional) Create operation parameters.
|
|
137
137
|
* @return Success
|
|
138
138
|
*/
|
|
139
|
-
create(storefrontId: number, tenantId?: number | null | undefined, body?: CreateProductReferenceDto | undefined, cancelToken?: CancelToken | undefined): Promise<ProductReferenceDto>;
|
|
139
|
+
create(storefrontId: number, tenantId?: number | null | undefined, body?: CreateProductReferenceDto | null | undefined, cancelToken?: CancelToken | undefined): Promise<ProductReferenceDto>;
|
|
140
140
|
protected processCreate(response: AxiosResponse): Promise<ProductReferenceDto>;
|
|
141
141
|
/**
|
|
142
142
|
* Returns a storefront product reference.
|
|
@@ -271,7 +271,7 @@ export interface IProjectsApiClient {
|
|
|
271
271
|
* @param body (optional) Create operation parameters.
|
|
272
272
|
* @return Success
|
|
273
273
|
*/
|
|
274
|
-
create(storefrontId: number, tenantId?: number | null | undefined, body?: CreateProjectDto | undefined): Promise<ProjectDto>;
|
|
274
|
+
create(storefrontId: number, tenantId?: number | null | undefined, body?: CreateProjectDto | null | undefined): Promise<ProjectDto>;
|
|
275
275
|
/**
|
|
276
276
|
* Returns a project by identifier.
|
|
277
277
|
* @param id Project identifier.
|
|
@@ -293,7 +293,7 @@ export interface IProjectsApiClient {
|
|
|
293
293
|
* @param body (optional) Create operation parameters.
|
|
294
294
|
* @return Success
|
|
295
295
|
*/
|
|
296
|
-
createByRenderHiResScenario(storefrontId: number, tenantId?: number | null | undefined, body?: CreateProjectByRenderHiResScenarioDto | undefined): Promise<ProjectDto>;
|
|
296
|
+
createByRenderHiResScenario(storefrontId: number, tenantId?: number | null | undefined, body?: CreateProjectByRenderHiResScenarioDto | null | undefined): Promise<ProjectDto>;
|
|
297
297
|
/**
|
|
298
298
|
* Returns all available status transitions for a project.
|
|
299
299
|
* @param id Project identifier.
|
|
@@ -378,6 +378,14 @@ export interface IProjectsApiClient {
|
|
|
378
378
|
* @return Success
|
|
379
379
|
*/
|
|
380
380
|
getProjectOrder(id: number, tenantId?: number | null | undefined): Promise<any>;
|
|
381
|
+
/**
|
|
382
|
+
* Attachs the specified data to the project's order in ecommerce system.
|
|
383
|
+
* @param id Project identifier.
|
|
384
|
+
* @param tenantId (optional) Tenant identifier.
|
|
385
|
+
* @param body (optional) A list of data items, which should be attached to project's order.
|
|
386
|
+
* @return Success
|
|
387
|
+
*/
|
|
388
|
+
attachDataToProjectOrder(id: number, tenantId?: number | null | undefined, body?: OrderDataItemDto[] | null | undefined): Promise<void>;
|
|
381
389
|
}
|
|
382
390
|
export declare class ProjectsApiClient extends ApiClientBase implements IProjectsApiClient {
|
|
383
391
|
private instance;
|
|
@@ -408,7 +416,7 @@ export declare class ProjectsApiClient extends ApiClientBase implements IProject
|
|
|
408
416
|
* @param body (optional) Create operation parameters.
|
|
409
417
|
* @return Success
|
|
410
418
|
*/
|
|
411
|
-
create(storefrontId: number, tenantId?: number | null | undefined, body?: CreateProjectDto | undefined, cancelToken?: CancelToken | undefined): Promise<ProjectDto>;
|
|
419
|
+
create(storefrontId: number, tenantId?: number | null | undefined, body?: CreateProjectDto | null | undefined, cancelToken?: CancelToken | undefined): Promise<ProjectDto>;
|
|
412
420
|
protected processCreate(response: AxiosResponse): Promise<ProjectDto>;
|
|
413
421
|
/**
|
|
414
422
|
* Returns a project by identifier.
|
|
@@ -433,7 +441,7 @@ export declare class ProjectsApiClient extends ApiClientBase implements IProject
|
|
|
433
441
|
* @param body (optional) Create operation parameters.
|
|
434
442
|
* @return Success
|
|
435
443
|
*/
|
|
436
|
-
createByRenderHiResScenario(storefrontId: number, tenantId?: number | null | undefined, body?: CreateProjectByRenderHiResScenarioDto | undefined, cancelToken?: CancelToken | undefined): Promise<ProjectDto>;
|
|
444
|
+
createByRenderHiResScenario(storefrontId: number, tenantId?: number | null | undefined, body?: CreateProjectByRenderHiResScenarioDto | null | undefined, cancelToken?: CancelToken | undefined): Promise<ProjectDto>;
|
|
437
445
|
protected processCreateByRenderHiResScenario(response: AxiosResponse): Promise<ProjectDto>;
|
|
438
446
|
/**
|
|
439
447
|
* Returns all available status transitions for a project.
|
|
@@ -530,6 +538,15 @@ export declare class ProjectsApiClient extends ApiClientBase implements IProject
|
|
|
530
538
|
*/
|
|
531
539
|
getProjectOrder(id: number, tenantId?: number | null | undefined, cancelToken?: CancelToken | undefined): Promise<any>;
|
|
532
540
|
protected processGetProjectOrder(response: AxiosResponse): Promise<any>;
|
|
541
|
+
/**
|
|
542
|
+
* Attachs the specified data to the project's order in ecommerce system.
|
|
543
|
+
* @param id Project identifier.
|
|
544
|
+
* @param tenantId (optional) Tenant identifier.
|
|
545
|
+
* @param body (optional) A list of data items, which should be attached to project's order.
|
|
546
|
+
* @return Success
|
|
547
|
+
*/
|
|
548
|
+
attachDataToProjectOrder(id: number, tenantId?: number | null | undefined, body?: OrderDataItemDto[] | null | undefined, cancelToken?: CancelToken | undefined): Promise<void>;
|
|
549
|
+
protected processAttachDataToProjectOrder(response: AxiosResponse): Promise<void>;
|
|
533
550
|
}
|
|
534
551
|
export interface IStorefrontsApiClient {
|
|
535
552
|
/**
|
|
@@ -597,7 +614,7 @@ export interface IStorefrontUsersApiClient {
|
|
|
597
614
|
* @param body (optional) Operation parameters.
|
|
598
615
|
* @return Success
|
|
599
616
|
*/
|
|
600
|
-
create(storefrontId: number, tenantId?: number | null | undefined, body?: CreateStorefrontUserDto | undefined): Promise<StorefrontUserDto>;
|
|
617
|
+
create(storefrontId: number, tenantId?: number | null | undefined, body?: CreateStorefrontUserDto | null | undefined): Promise<StorefrontUserDto>;
|
|
601
618
|
/**
|
|
602
619
|
* Returns a storefront user by identifier.
|
|
603
620
|
* @param id Storefront user identifier.
|
|
@@ -613,7 +630,7 @@ export interface IStorefrontUsersApiClient {
|
|
|
613
630
|
* @param body (optional) Operation parameters.
|
|
614
631
|
* @return Success
|
|
615
632
|
*/
|
|
616
|
-
register(storefrontId: number, tenantId?: number | null | undefined, body?: RegisterStorefrontUserInput | undefined): Promise<StorefrontUserDto>;
|
|
633
|
+
register(storefrontId: number, tenantId?: number | null | undefined, body?: RegisterStorefrontUserInput | null | undefined): Promise<StorefrontUserDto>;
|
|
617
634
|
/**
|
|
618
635
|
* Transfers all existing data for the anonymous storefront user to the selected regular storefront user account.
|
|
619
636
|
* @param storefrontId Storefront identifier.
|
|
@@ -621,7 +638,7 @@ export interface IStorefrontUsersApiClient {
|
|
|
621
638
|
* @param body (optional) Operation parameters.
|
|
622
639
|
* @return Success
|
|
623
640
|
*/
|
|
624
|
-
mergeAnonymous(storefrontId: number, tenantId?: number | null | undefined, body?: MergeAnonymousUserDataInput | undefined): Promise<void>;
|
|
641
|
+
mergeAnonymous(storefrontId: number, tenantId?: number | null | undefined, body?: MergeAnonymousUserDataInput | null | undefined): Promise<void>;
|
|
625
642
|
/**
|
|
626
643
|
* Returns an API access token for the specified storefront user.
|
|
627
644
|
* @param storefrontUserId Storefront user identifier.
|
|
@@ -656,7 +673,7 @@ export declare class StorefrontUsersApiClient extends ApiClientBase implements I
|
|
|
656
673
|
* @param body (optional) Operation parameters.
|
|
657
674
|
* @return Success
|
|
658
675
|
*/
|
|
659
|
-
create(storefrontId: number, tenantId?: number | null | undefined, body?: CreateStorefrontUserDto | undefined, cancelToken?: CancelToken | undefined): Promise<StorefrontUserDto>;
|
|
676
|
+
create(storefrontId: number, tenantId?: number | null | undefined, body?: CreateStorefrontUserDto | null | undefined, cancelToken?: CancelToken | undefined): Promise<StorefrontUserDto>;
|
|
660
677
|
protected processCreate(response: AxiosResponse): Promise<StorefrontUserDto>;
|
|
661
678
|
/**
|
|
662
679
|
* Returns a storefront user by identifier.
|
|
@@ -674,7 +691,7 @@ export declare class StorefrontUsersApiClient extends ApiClientBase implements I
|
|
|
674
691
|
* @param body (optional) Operation parameters.
|
|
675
692
|
* @return Success
|
|
676
693
|
*/
|
|
677
|
-
register(storefrontId: number, tenantId?: number | null | undefined, body?: RegisterStorefrontUserInput | undefined, cancelToken?: CancelToken | undefined): Promise<StorefrontUserDto>;
|
|
694
|
+
register(storefrontId: number, tenantId?: number | null | undefined, body?: RegisterStorefrontUserInput | null | undefined, cancelToken?: CancelToken | undefined): Promise<StorefrontUserDto>;
|
|
678
695
|
protected processRegister(response: AxiosResponse): Promise<StorefrontUserDto>;
|
|
679
696
|
/**
|
|
680
697
|
* Transfers all existing data for the anonymous storefront user to the selected regular storefront user account.
|
|
@@ -683,7 +700,7 @@ export declare class StorefrontUsersApiClient extends ApiClientBase implements I
|
|
|
683
700
|
* @param body (optional) Operation parameters.
|
|
684
701
|
* @return Success
|
|
685
702
|
*/
|
|
686
|
-
mergeAnonymous(storefrontId: number, tenantId?: number | null | undefined, body?: MergeAnonymousUserDataInput | undefined, cancelToken?: CancelToken | undefined): Promise<void>;
|
|
703
|
+
mergeAnonymous(storefrontId: number, tenantId?: number | null | undefined, body?: MergeAnonymousUserDataInput | null | undefined, cancelToken?: CancelToken | undefined): Promise<void>;
|
|
687
704
|
protected processMergeAnonymous(response: AxiosResponse): Promise<void>;
|
|
688
705
|
/**
|
|
689
706
|
* Returns an API access token for the specified storefront user.
|
|
@@ -856,6 +873,7 @@ export interface ProjectItemResourceDto {
|
|
|
856
873
|
resourceId?: string | null;
|
|
857
874
|
/** Resource name. */
|
|
858
875
|
name?: string | null;
|
|
876
|
+
/** Resource type. */
|
|
859
877
|
type?: ProjectItemResourceType;
|
|
860
878
|
}
|
|
861
879
|
/** Dto class, containing information about a project item. */
|
|
@@ -929,6 +947,7 @@ export interface ProjectItemResourceParametersDto {
|
|
|
929
947
|
url?: string | null;
|
|
930
948
|
/** Resource name. */
|
|
931
949
|
name?: string | null;
|
|
950
|
+
/** Resource type. */
|
|
932
951
|
type?: ProjectItemResourceType;
|
|
933
952
|
}
|
|
934
953
|
/** Dto class, containing create operation paramters for a project item. */
|
|
@@ -1019,9 +1038,12 @@ export interface RenderHiResScenarioDto {
|
|
|
1019
1038
|
name?: string | null;
|
|
1020
1039
|
/** Output file DPI. */
|
|
1021
1040
|
dpi?: number;
|
|
1022
|
-
format
|
|
1023
|
-
|
|
1024
|
-
|
|
1041
|
+
/** Output file format. */
|
|
1042
|
+
format?: RenderHiResScenarioOutputFormat | null;
|
|
1043
|
+
/** Output file color space. */
|
|
1044
|
+
colorSpace?: RenderHiResScenarioOutputColorSpace | null;
|
|
1045
|
+
/** Output file flip mode. */
|
|
1046
|
+
flipMode?: RenderHiResScenarioOutputFlipMode | null;
|
|
1025
1047
|
/** Output file access mode. */
|
|
1026
1048
|
anonymousAccess?: boolean | null;
|
|
1027
1049
|
}
|
|
@@ -1033,7 +1055,9 @@ export interface CreateProjectByRenderHiResScenarioDto {
|
|
|
1033
1055
|
name?: string | null;
|
|
1034
1056
|
/** Description of the project. */
|
|
1035
1057
|
description?: string | null;
|
|
1036
|
-
|
|
1058
|
+
/** Ecommerce system order description. */
|
|
1059
|
+
orderDetails?: OrderDetailsDto | null;
|
|
1060
|
+
/** List of project items. */
|
|
1037
1061
|
scenario: RenderHiResScenarioDto;
|
|
1038
1062
|
}
|
|
1039
1063
|
/** Project transition dto class. */
|
|
@@ -1100,12 +1124,28 @@ export interface ProjectOutputFileDetailsDto {
|
|
|
1100
1124
|
}
|
|
1101
1125
|
/** Dto class, containing description of project processing results. */
|
|
1102
1126
|
export interface ProjectProcessingResultsDto {
|
|
1127
|
+
/** Project processing status. */
|
|
1103
1128
|
status?: ProjectProcessingStatus;
|
|
1104
1129
|
/** Project status description. */
|
|
1105
1130
|
statusDescription?: string | null;
|
|
1106
1131
|
/** Collection of project output file descriptions. */
|
|
1107
1132
|
outputFileDetails?: ProjectOutputFileDetailsDto[] | null;
|
|
1108
1133
|
}
|
|
1134
|
+
/** Available value types for order data item. */
|
|
1135
|
+
export declare enum OrderDataItemValueType {
|
|
1136
|
+
PlainText = "PlainText",
|
|
1137
|
+
CommaSeparatedList = "CommaSeparatedList",
|
|
1138
|
+
SerializedJson = "SerializedJson"
|
|
1139
|
+
}
|
|
1140
|
+
/** Dto class, containing information about project's order data item. */
|
|
1141
|
+
export interface OrderDataItemDto {
|
|
1142
|
+
/** Order data item key (eventuall order metadata field name). */
|
|
1143
|
+
key?: string | null;
|
|
1144
|
+
/** Order data item value. */
|
|
1145
|
+
value?: string | null;
|
|
1146
|
+
/** Order data item type. */
|
|
1147
|
+
type?: OrderDataItemValueType;
|
|
1148
|
+
}
|
|
1109
1149
|
/** Storefront types. */
|
|
1110
1150
|
export declare enum StorefrontType {
|
|
1111
1151
|
Custom = "Custom",
|
|
@@ -1126,6 +1166,7 @@ export interface StorefrontDto {
|
|
|
1126
1166
|
tenantId?: number;
|
|
1127
1167
|
/** Storefront name. */
|
|
1128
1168
|
name?: string | null;
|
|
1169
|
+
/** Storefront ecommerce system type. */
|
|
1129
1170
|
type?: StorefrontType;
|
|
1130
1171
|
/** Storefront entity creation date and time. */
|
|
1131
1172
|
created?: string;
|
|
@@ -2198,6 +2198,79 @@ export class ProjectsApiClient extends ApiClientBase {
|
|
|
2198
2198
|
}
|
|
2199
2199
|
return Promise.resolve(null);
|
|
2200
2200
|
}
|
|
2201
|
+
/**
|
|
2202
|
+
* Attachs the specified data to the project's order in ecommerce system.
|
|
2203
|
+
* @param id Project identifier.
|
|
2204
|
+
* @param tenantId (optional) Tenant identifier.
|
|
2205
|
+
* @param body (optional) A list of data items, which should be attached to project's order.
|
|
2206
|
+
* @return Success
|
|
2207
|
+
*/
|
|
2208
|
+
attachDataToProjectOrder(id, tenantId, body, cancelToken) {
|
|
2209
|
+
let url_ = this.baseUrl + "/api/storefront/v1/projects/{id}/order-data?";
|
|
2210
|
+
if (id === undefined || id === null)
|
|
2211
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
2212
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
2213
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
2214
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2215
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
2216
|
+
const content_ = JSON.stringify(body);
|
|
2217
|
+
let options_ = {
|
|
2218
|
+
data: content_,
|
|
2219
|
+
method: "POST",
|
|
2220
|
+
url: url_,
|
|
2221
|
+
headers: {
|
|
2222
|
+
"Content-Type": "application/json-patch+json",
|
|
2223
|
+
},
|
|
2224
|
+
cancelToken
|
|
2225
|
+
};
|
|
2226
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
2227
|
+
return this.instance.request(transformedOptions_);
|
|
2228
|
+
}).catch((_error) => {
|
|
2229
|
+
if (isAxiosError(_error) && _error.response) {
|
|
2230
|
+
return _error.response;
|
|
2231
|
+
}
|
|
2232
|
+
else {
|
|
2233
|
+
throw _error;
|
|
2234
|
+
}
|
|
2235
|
+
}).then((_response) => {
|
|
2236
|
+
return this.transformResult(url_, _response, (_response) => this.processAttachDataToProjectOrder(_response));
|
|
2237
|
+
});
|
|
2238
|
+
}
|
|
2239
|
+
processAttachDataToProjectOrder(response) {
|
|
2240
|
+
const status = response.status;
|
|
2241
|
+
let _headers = {};
|
|
2242
|
+
if (response.headers && typeof response.headers === "object") {
|
|
2243
|
+
for (let k in response.headers) {
|
|
2244
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
2245
|
+
_headers[k] = response.headers[k];
|
|
2246
|
+
}
|
|
2247
|
+
}
|
|
2248
|
+
}
|
|
2249
|
+
if (status === 204) {
|
|
2250
|
+
const _responseText = response.data;
|
|
2251
|
+
return Promise.resolve(null);
|
|
2252
|
+
}
|
|
2253
|
+
else if (status === 404) {
|
|
2254
|
+
const _responseText = response.data;
|
|
2255
|
+
let result404 = null;
|
|
2256
|
+
let resultData404 = _responseText;
|
|
2257
|
+
result404 = JSON.parse(resultData404);
|
|
2258
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
2259
|
+
}
|
|
2260
|
+
else if (status === 401) {
|
|
2261
|
+
const _responseText = response.data;
|
|
2262
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
2263
|
+
}
|
|
2264
|
+
else if (status === 403) {
|
|
2265
|
+
const _responseText = response.data;
|
|
2266
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
2267
|
+
}
|
|
2268
|
+
else if (status !== 200 && status !== 204) {
|
|
2269
|
+
const _responseText = response.data;
|
|
2270
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
2271
|
+
}
|
|
2272
|
+
return Promise.resolve(null);
|
|
2273
|
+
}
|
|
2201
2274
|
}
|
|
2202
2275
|
export class StorefrontsApiClient extends ApiClientBase {
|
|
2203
2276
|
instance;
|
|
@@ -3091,6 +3164,13 @@ export var ProjectProcessingStatus;
|
|
|
3091
3164
|
ProjectProcessingStatus["Completed"] = "Completed";
|
|
3092
3165
|
ProjectProcessingStatus["Failed"] = "Failed";
|
|
3093
3166
|
})(ProjectProcessingStatus || (ProjectProcessingStatus = {}));
|
|
3167
|
+
/** Available value types for order data item. */
|
|
3168
|
+
export var OrderDataItemValueType;
|
|
3169
|
+
(function (OrderDataItemValueType) {
|
|
3170
|
+
OrderDataItemValueType["PlainText"] = "PlainText";
|
|
3171
|
+
OrderDataItemValueType["CommaSeparatedList"] = "CommaSeparatedList";
|
|
3172
|
+
OrderDataItemValueType["SerializedJson"] = "SerializedJson";
|
|
3173
|
+
})(OrderDataItemValueType || (OrderDataItemValueType = {}));
|
|
3094
3174
|
/** Storefront types. */
|
|
3095
3175
|
export var StorefrontType;
|
|
3096
3176
|
(function (StorefrontType) {
|