@djust-b2b/djust-front-sdk 1.14.0 → 1.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.d.ts +4 -6
- package/lib/interfaces/models/incident.d.ts +1 -0
- package/lib/services/custom-field/definitions.d.ts +100 -0
- package/lib/services/custom-field/definitions.js +60 -0
- package/lib/services/custom-field/index.d.ts +121 -0
- package/lib/services/custom-field/index.js +145 -0
- package/lib/services/incident/definitions.d.ts +9 -27
- package/lib/services/incident/index.d.ts +38 -119
- package/lib/services/incident/index.js +46 -153
- package/lib/services/product/definitions.d.ts +1 -1
- package/lib/services/product/index.d.ts +1762 -19
- package/lib/services/product/index.js +1777 -34
- package/package.json +1 -1
package/lib/index.d.ts
CHANGED
|
@@ -21,12 +21,10 @@ export declare const DjustSDK: {
|
|
|
21
21
|
storeId?: string;
|
|
22
22
|
storeViewId?: string;
|
|
23
23
|
}>) => void;
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
getOrderLogisticLineIncidents({ logisticOrderId, lineId, status, idType, page, size, sort, }: import("./services/incident/definitions").getOrderLogisticLineIncidentsParameters): Promise<import("./services/incident/definitions").getOrderLogisticLineIncidentsResponse>;
|
|
24
|
+
getIncidents({ customerAccountIds, linkedType, ids, status, idType, page, size, sort, }: import("./services/incident/definitions").getIncidentsParameters): Promise<import("./services/incident/definitions").getIncidentsResponse>;
|
|
25
|
+
getIncident({ incidentId, idType, }: import("./services/incident/definitions").getIncidentParameters): Promise<import("./services/incident/definitions").getIncidentResponse>;
|
|
27
26
|
createOrderLogisticIncident({ logisticOrderId, idType, customField, reasonCode, }: import("./services/incident/definitions").createOrderLogisticIncidentParameters): Promise<import("./services/incident/definitions").createOrderLogisticIncidentResponse>;
|
|
28
27
|
createOrderLogisticLineIncident({ logisticOrderId, idType, customFieldIdType, orderLines, reasonCode, }: import("./services/incident/definitions").createOrderLogisticLineIncidentParameters): Promise<import("./services/incident/definitions").createOrderLogisticLineIncidentResponse>;
|
|
29
|
-
getCustomerAccountIncidents({ customerAccountId, status, page, size, sort, }: import("./services/incident/definitions").getCustomerAccountIncidentsParameters): Promise<import("./services/incident/definitions").getCustomerAccountIncidentsResponse>;
|
|
30
28
|
getCommercialOrders({ locale, nbPreviewLines, }: import("./interfaces").GetCommercialOrdersParameters): Promise<import("./interfaces").GetCommercialOrdersResponse>;
|
|
31
29
|
createCommercialOrder({ nbPreviewLines, channel, customFields, locale, originId, paymentInfo, }: import("./interfaces").CreateCommercialOrderParameters): Promise<import("./interfaces").CreateCommercialOrderResponse>;
|
|
32
30
|
getCommercialOrder({ orderId, idType, locale, nbPreviewLines, }: import("./interfaces").GetCommercialOrderParameters): Promise<import("./interfaces").GetCommercialOrderResponse>;
|
|
@@ -90,13 +88,13 @@ export declare const DjustSDK: {
|
|
|
90
88
|
getProductVariantSuppliers({ productVariantId, }: import("./interfaces").GetProductVariantSuppliersParameters): Promise<import("./interfaces").GetProductVariantSuppliersResponse>;
|
|
91
89
|
getProduct({ productIdentifier, productIdType, locale, }: import("./interfaces").GetProductParameters): Promise<import("./interfaces").GetProductsListResponse>;
|
|
92
90
|
getProductOffers({ productIdentifier, productIdType, locale, currency, }: import("./interfaces").GetProductOffersParameters): Promise<import("./interfaces").GetProductOffersResponse>;
|
|
93
|
-
|
|
91
|
+
getProductPaginatedOffers({ productIdentifier, productIdType, currency, locale, withoutPrices, pageable, }: import("./interfaces").GetProductPaginatedOffersParameters): Promise<import("./interfaces").GetProductPaginatedOffersResponse>;
|
|
92
|
+
getRelatedProducts({ productIdentifier, productIdType, locale, currency, pageable, }: import("./interfaces").GetRelatedProductsParameters): Promise<import("./interfaces").GetRelatedProductsResponse>;
|
|
94
93
|
getProductReviews({ productIdentifier, productIdType, }: import("./interfaces").GetProductReviewsParameters): Promise<import("./interfaces").GetProductReviewsResponse>;
|
|
95
94
|
getProductStatReviews({ productIdentifier, productIdType, }: import("./interfaces").GetProductStatReviewsParameters): Promise<import("./interfaces").GetProductStatReviewsResponse>;
|
|
96
95
|
getProductVariantAttributes({ productIdentifier, productIdType, locale, }: import("./interfaces").GetProductVariantAttributesParameters): Promise<import("./interfaces").GetProductVariantAttributesResponse>;
|
|
97
96
|
createProductReview({ message, productSku, rating, }: import("./interfaces").CreateProductReviewParameters): Promise<import("./interfaces").CreateProductReviewResponse>;
|
|
98
97
|
updateProductReview({ productReviewId, message, rating, }: import("./interfaces").UpdateProductReviewParameters): Promise<import("./interfaces").UpdateProductReviewResponse>;
|
|
99
|
-
getProductPaginatedOffers({ productIdentifier, productIdType, currency, locale, withoutPrices, pageable, }: import("./interfaces").GetProductPaginatedOffersParameters): Promise<import("./interfaces").GetProductPaginatedOffersResponse>;
|
|
100
98
|
getNavigationCategories({ locale, }: import("./interfaces").GetNavigationCategoriesParameters): Promise<import("./interfaces").GetNavigationCategoriesResponse>;
|
|
101
99
|
getNavigationCategory({ locale, idType, navigationCategoryId, }: import("./interfaces").GetNavigationCategoryParameters): Promise<import("./interfaces").GetNavigationCategoryResponse>;
|
|
102
100
|
getNavigationCategoryBreadcrumbs({ locale, idType, navigationCategoryId, }: import("./interfaces").GetNavigationCategoryBreadcrumbsParameters): Promise<import("./interfaces").GetNavigationCategoryBreadcrumbsResponse>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { CustomFieldValueObject } from "./custom-field";
|
|
2
2
|
export type IncidentStatus = "OPEN" | "ON_GOING" | "CLOSED";
|
|
3
3
|
export type IncidentIdType = "DJUST_ID" | "EXTERNAL_ID";
|
|
4
|
+
export type IncidentLinkedType = "ORDER" | "ORDER_LINES";
|
|
4
5
|
export interface IncidentLogisticOrder {
|
|
5
6
|
id: string;
|
|
6
7
|
externalId: string;
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { Order, PageableObject } from "../../interfaces/models/common";
|
|
2
|
+
declare enum SealedTarget {
|
|
3
|
+
OFFER = 0,
|
|
4
|
+
ACCOUNT = 1,
|
|
5
|
+
NAVIGATION_CATEGORY = 2,
|
|
6
|
+
SUPPLIER = 3,
|
|
7
|
+
CUSTOMER_USER = 4,
|
|
8
|
+
CUSTOMER_ORGANISATION = 5,
|
|
9
|
+
ORDER_LOGISTIC = 6,
|
|
10
|
+
ORDER_COMMERCIAL = 7,
|
|
11
|
+
ORDER_LOGISTIC_LINE = 8,
|
|
12
|
+
QUOTE = 9,
|
|
13
|
+
QUOTE_LINE = 10,
|
|
14
|
+
ORDER_INCIDENT = 11,
|
|
15
|
+
THREAD_MESSAGE = 12
|
|
16
|
+
}
|
|
17
|
+
declare enum ExternalSource {
|
|
18
|
+
MIRAKL = 0,
|
|
19
|
+
CLIENT = 1,
|
|
20
|
+
NOT_DEFINED = 2,
|
|
21
|
+
EXTERN = 3,
|
|
22
|
+
SYSTEM = 4
|
|
23
|
+
}
|
|
24
|
+
declare enum CustomFieldRole {
|
|
25
|
+
PRODUCT_TAX_RATE = 0,
|
|
26
|
+
SHIPPING_TAX_RATE = 1,
|
|
27
|
+
SHIPPING_TAX_CODE = 2,
|
|
28
|
+
PRODUCT_TAX_CODE = 3,
|
|
29
|
+
ORDERS_MANAGED_INTERNALLY = 4,
|
|
30
|
+
OFFER_VALIDITY_START_DATE = 5,
|
|
31
|
+
OFFER_VALIDITY_END_DATE = 6,
|
|
32
|
+
AUTOMATIC_ORDER_VALIDATION = 7
|
|
33
|
+
}
|
|
34
|
+
declare enum CustomFieldStatus {
|
|
35
|
+
ACTIVE = 0,
|
|
36
|
+
INACTIVE = 1
|
|
37
|
+
}
|
|
38
|
+
declare enum CustomFieldType {
|
|
39
|
+
LONG_TEXT = 0,
|
|
40
|
+
TEXT = 1,
|
|
41
|
+
NUMBER = 2,
|
|
42
|
+
METRIC = 3,
|
|
43
|
+
DATE = 4,
|
|
44
|
+
LIST_TEXT = 5,
|
|
45
|
+
LIST_METRIC = 6,
|
|
46
|
+
LIST_NUMBER = 7,
|
|
47
|
+
BOOLEAN = 8,
|
|
48
|
+
MEDIA = 9
|
|
49
|
+
}
|
|
50
|
+
declare enum CustomFieldIdType {
|
|
51
|
+
BUSINESS_ID = 0,
|
|
52
|
+
EXTERNAL_ID = 1
|
|
53
|
+
}
|
|
54
|
+
interface CustomFieldDto {
|
|
55
|
+
externalId: string;
|
|
56
|
+
externalSource: ExternalSource;
|
|
57
|
+
faceted?: boolean;
|
|
58
|
+
id?: string;
|
|
59
|
+
indexable?: boolean;
|
|
60
|
+
mandatory: boolean;
|
|
61
|
+
name: string;
|
|
62
|
+
role?: CustomFieldRole;
|
|
63
|
+
sealedTarget: boolean;
|
|
64
|
+
searchable?: boolean;
|
|
65
|
+
sortable?: boolean;
|
|
66
|
+
status: CustomFieldStatus;
|
|
67
|
+
type?: CustomFieldType;
|
|
68
|
+
}
|
|
69
|
+
export interface GetCustomFieldParameters {
|
|
70
|
+
sealedTarget: SealedTarget;
|
|
71
|
+
status?: CustomFieldStatus;
|
|
72
|
+
type?: CustomFieldType;
|
|
73
|
+
searchCriteria?: string;
|
|
74
|
+
searchable?: boolean;
|
|
75
|
+
sortable?: boolean;
|
|
76
|
+
page?: number;
|
|
77
|
+
size?: number;
|
|
78
|
+
sort?: string[];
|
|
79
|
+
}
|
|
80
|
+
export interface GetCustomFieldResponse {
|
|
81
|
+
content: CustomFieldDto[];
|
|
82
|
+
empty?: boolean;
|
|
83
|
+
first?: boolean;
|
|
84
|
+
last?: boolean;
|
|
85
|
+
number?: number;
|
|
86
|
+
numberOfElements?: number;
|
|
87
|
+
pageable?: PageableObject;
|
|
88
|
+
size?: number;
|
|
89
|
+
sort?: Order[];
|
|
90
|
+
totalElemets?: number;
|
|
91
|
+
totalPages?: number;
|
|
92
|
+
}
|
|
93
|
+
export interface PostMediaCustomFieldParameters {
|
|
94
|
+
id: string;
|
|
95
|
+
customFieldIdType?: CustomFieldIdType;
|
|
96
|
+
sealedTarget?: SealedTarget;
|
|
97
|
+
fileName: string;
|
|
98
|
+
fileSize: number;
|
|
99
|
+
}
|
|
100
|
+
export {};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var SealedTarget;
|
|
4
|
+
(function (SealedTarget) {
|
|
5
|
+
SealedTarget[SealedTarget["OFFER"] = 0] = "OFFER";
|
|
6
|
+
SealedTarget[SealedTarget["ACCOUNT"] = 1] = "ACCOUNT";
|
|
7
|
+
SealedTarget[SealedTarget["NAVIGATION_CATEGORY"] = 2] = "NAVIGATION_CATEGORY";
|
|
8
|
+
SealedTarget[SealedTarget["SUPPLIER"] = 3] = "SUPPLIER";
|
|
9
|
+
SealedTarget[SealedTarget["CUSTOMER_USER"] = 4] = "CUSTOMER_USER";
|
|
10
|
+
SealedTarget[SealedTarget["CUSTOMER_ORGANISATION"] = 5] = "CUSTOMER_ORGANISATION";
|
|
11
|
+
SealedTarget[SealedTarget["ORDER_LOGISTIC"] = 6] = "ORDER_LOGISTIC";
|
|
12
|
+
SealedTarget[SealedTarget["ORDER_COMMERCIAL"] = 7] = "ORDER_COMMERCIAL";
|
|
13
|
+
SealedTarget[SealedTarget["ORDER_LOGISTIC_LINE"] = 8] = "ORDER_LOGISTIC_LINE";
|
|
14
|
+
SealedTarget[SealedTarget["QUOTE"] = 9] = "QUOTE";
|
|
15
|
+
SealedTarget[SealedTarget["QUOTE_LINE"] = 10] = "QUOTE_LINE";
|
|
16
|
+
SealedTarget[SealedTarget["ORDER_INCIDENT"] = 11] = "ORDER_INCIDENT";
|
|
17
|
+
SealedTarget[SealedTarget["THREAD_MESSAGE"] = 12] = "THREAD_MESSAGE";
|
|
18
|
+
})(SealedTarget || (SealedTarget = {}));
|
|
19
|
+
var ExternalSource;
|
|
20
|
+
(function (ExternalSource) {
|
|
21
|
+
ExternalSource[ExternalSource["MIRAKL"] = 0] = "MIRAKL";
|
|
22
|
+
ExternalSource[ExternalSource["CLIENT"] = 1] = "CLIENT";
|
|
23
|
+
ExternalSource[ExternalSource["NOT_DEFINED"] = 2] = "NOT_DEFINED";
|
|
24
|
+
ExternalSource[ExternalSource["EXTERN"] = 3] = "EXTERN";
|
|
25
|
+
ExternalSource[ExternalSource["SYSTEM"] = 4] = "SYSTEM";
|
|
26
|
+
})(ExternalSource || (ExternalSource = {}));
|
|
27
|
+
var CustomFieldRole;
|
|
28
|
+
(function (CustomFieldRole) {
|
|
29
|
+
CustomFieldRole[CustomFieldRole["PRODUCT_TAX_RATE"] = 0] = "PRODUCT_TAX_RATE";
|
|
30
|
+
CustomFieldRole[CustomFieldRole["SHIPPING_TAX_RATE"] = 1] = "SHIPPING_TAX_RATE";
|
|
31
|
+
CustomFieldRole[CustomFieldRole["SHIPPING_TAX_CODE"] = 2] = "SHIPPING_TAX_CODE";
|
|
32
|
+
CustomFieldRole[CustomFieldRole["PRODUCT_TAX_CODE"] = 3] = "PRODUCT_TAX_CODE";
|
|
33
|
+
CustomFieldRole[CustomFieldRole["ORDERS_MANAGED_INTERNALLY"] = 4] = "ORDERS_MANAGED_INTERNALLY";
|
|
34
|
+
CustomFieldRole[CustomFieldRole["OFFER_VALIDITY_START_DATE"] = 5] = "OFFER_VALIDITY_START_DATE";
|
|
35
|
+
CustomFieldRole[CustomFieldRole["OFFER_VALIDITY_END_DATE"] = 6] = "OFFER_VALIDITY_END_DATE";
|
|
36
|
+
CustomFieldRole[CustomFieldRole["AUTOMATIC_ORDER_VALIDATION"] = 7] = "AUTOMATIC_ORDER_VALIDATION";
|
|
37
|
+
})(CustomFieldRole || (CustomFieldRole = {}));
|
|
38
|
+
var CustomFieldStatus;
|
|
39
|
+
(function (CustomFieldStatus) {
|
|
40
|
+
CustomFieldStatus[CustomFieldStatus["ACTIVE"] = 0] = "ACTIVE";
|
|
41
|
+
CustomFieldStatus[CustomFieldStatus["INACTIVE"] = 1] = "INACTIVE";
|
|
42
|
+
})(CustomFieldStatus || (CustomFieldStatus = {}));
|
|
43
|
+
var CustomFieldType;
|
|
44
|
+
(function (CustomFieldType) {
|
|
45
|
+
CustomFieldType[CustomFieldType["LONG_TEXT"] = 0] = "LONG_TEXT";
|
|
46
|
+
CustomFieldType[CustomFieldType["TEXT"] = 1] = "TEXT";
|
|
47
|
+
CustomFieldType[CustomFieldType["NUMBER"] = 2] = "NUMBER";
|
|
48
|
+
CustomFieldType[CustomFieldType["METRIC"] = 3] = "METRIC";
|
|
49
|
+
CustomFieldType[CustomFieldType["DATE"] = 4] = "DATE";
|
|
50
|
+
CustomFieldType[CustomFieldType["LIST_TEXT"] = 5] = "LIST_TEXT";
|
|
51
|
+
CustomFieldType[CustomFieldType["LIST_METRIC"] = 6] = "LIST_METRIC";
|
|
52
|
+
CustomFieldType[CustomFieldType["LIST_NUMBER"] = 7] = "LIST_NUMBER";
|
|
53
|
+
CustomFieldType[CustomFieldType["BOOLEAN"] = 8] = "BOOLEAN";
|
|
54
|
+
CustomFieldType[CustomFieldType["MEDIA"] = 9] = "MEDIA";
|
|
55
|
+
})(CustomFieldType || (CustomFieldType = {}));
|
|
56
|
+
var CustomFieldIdType;
|
|
57
|
+
(function (CustomFieldIdType) {
|
|
58
|
+
CustomFieldIdType[CustomFieldIdType["BUSINESS_ID"] = 0] = "BUSINESS_ID";
|
|
59
|
+
CustomFieldIdType[CustomFieldIdType["EXTERNAL_ID"] = 1] = "EXTERNAL_ID";
|
|
60
|
+
})(CustomFieldIdType || (CustomFieldIdType = {}));
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import type { GetCustomFieldParameters, GetCustomFieldResponse, PostMediaCustomFieldParameters } from "./definitions";
|
|
2
|
+
/**
|
|
3
|
+
* APICODE(listPaginatedCustomFields)
|
|
4
|
+
* Retrieves custom fields.
|
|
5
|
+
*
|
|
6
|
+
* This function allows fetching custom fields based on the provided parameters.
|
|
7
|
+
*
|
|
8
|
+
* @param {GetCustomFieldParameters} params - The parameters for retrieving custom fields, including:
|
|
9
|
+
* #### fieldType - `string` | <strong style={{ color: 'red' }}>required</strong>
|
|
10
|
+
*
|
|
11
|
+
* The type of the custom field to retrieve.
|
|
12
|
+
* #### includeInactive - `boolean`
|
|
13
|
+
*
|
|
14
|
+
* Whether to include inactive custom fields in the response.
|
|
15
|
+
* #### limit - `number`
|
|
16
|
+
*
|
|
17
|
+
* The maximum number of custom fields to return.
|
|
18
|
+
* #### offset - `number`
|
|
19
|
+
*
|
|
20
|
+
* The number of custom fields to skip before starting to collect the result set.
|
|
21
|
+
*
|
|
22
|
+
* @returns {Promise<GetCustomFieldResponse>} - An object containing the retrieved custom fields.
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* #### input
|
|
26
|
+
* ```typescript
|
|
27
|
+
* const customFields = await getCustomFields({ fieldType: 'text', includeInactive: false });
|
|
28
|
+
* ```
|
|
29
|
+
#### output
|
|
30
|
+
* ```json
|
|
31
|
+
* {
|
|
32
|
+
* "content": [
|
|
33
|
+
* {
|
|
34
|
+
* "externalId": "field1",
|
|
35
|
+
* "externalSource": "MIRAKL",
|
|
36
|
+
* "faceted": true,
|
|
37
|
+
* "id": "field1",
|
|
38
|
+
* "indexable": true,
|
|
39
|
+
* "mandatory": true,
|
|
40
|
+
* "name": "Field 1",
|
|
41
|
+
* "role": "PRODUCT_TAX_RATE",
|
|
42
|
+
* "sealedTarget": true,
|
|
43
|
+
* "searchable": true,
|
|
44
|
+
* "sortable": true,
|
|
45
|
+
* "status": "ACTIVE",
|
|
46
|
+
* "type": "TEXT"
|
|
47
|
+
* },
|
|
48
|
+
* {
|
|
49
|
+
* "externalId": "field2",
|
|
50
|
+
* "externalSource": "CLIENT",
|
|
51
|
+
* "faceted": false,
|
|
52
|
+
* "id": "field2",
|
|
53
|
+
* "indexable": false,
|
|
54
|
+
* "mandatory": false,
|
|
55
|
+
* "name": "Field 2",
|
|
56
|
+
* "role": "SHIPPING_TAX_CODE",
|
|
57
|
+
* "sealedTarget": false,
|
|
58
|
+
* "searchable": false,
|
|
59
|
+
* "sortable": false,
|
|
60
|
+
* "status": "INACTIVE",
|
|
61
|
+
* "type": "LONG_TEXT"
|
|
62
|
+
* }
|
|
63
|
+
* ],
|
|
64
|
+
* "empty": false,
|
|
65
|
+
* "first": true,
|
|
66
|
+
* "last": false,
|
|
67
|
+
* "number": 0,
|
|
68
|
+
* "numberOfElements": 2,
|
|
69
|
+
* "pageable": {
|
|
70
|
+
* "page": 0,
|
|
71
|
+
* "size": 10,
|
|
72
|
+
* "sort": []
|
|
73
|
+
* },
|
|
74
|
+
* "size": 10,
|
|
75
|
+
* "sort": [],
|
|
76
|
+
* "totalElemets": 2,
|
|
77
|
+
* "totalPages": 1
|
|
78
|
+
* }
|
|
79
|
+
* ```
|
|
80
|
+
*/
|
|
81
|
+
export declare function getCustomFields(params: GetCustomFieldParameters): Promise<GetCustomFieldResponse>;
|
|
82
|
+
/**
|
|
83
|
+
* APICODE(postMediaCustomField)
|
|
84
|
+
* Publishes a media custom field.
|
|
85
|
+
*
|
|
86
|
+
* This function allows publishing a media file associated with a specific custom field.
|
|
87
|
+
*
|
|
88
|
+
* @param {PostMediaCustomFieldParameters} params - The parameters for publishing the media field, including:
|
|
89
|
+
* #### id - `string` | <strong style={{ color: 'red' }}>required</strong>
|
|
90
|
+
*
|
|
91
|
+
* The identifier of the custom field to which the media is associated.
|
|
92
|
+
* #### customFieldIdType - `string` | <strong style={{ color: 'red' }}>required</strong></strong>
|
|
93
|
+
*
|
|
94
|
+
* The type of the custom field identifier (e.g., 'externalId').
|
|
95
|
+
* #### sealedTarget - `boolean`
|
|
96
|
+
*
|
|
97
|
+
* Indicates whether the media should be sealed.
|
|
98
|
+
* #### fileName - `string` | <strong style={{ color: 'red' }}>required</strong>
|
|
99
|
+
*
|
|
100
|
+
* The name of the media file being uploaded.
|
|
101
|
+
* #### fileSize - `number` | <strong style={{ color: 'red' }}>required</strong>
|
|
102
|
+
*
|
|
103
|
+
* The size of the media file in bytes.
|
|
104
|
+
*
|
|
105
|
+
* @returns {Promise<string>} - A promise that resolves to the url where post the media.
|
|
106
|
+
*
|
|
107
|
+
* @example
|
|
108
|
+
* #### input
|
|
109
|
+
* ```typescript
|
|
110
|
+
* const mediaId = await postMediaCustomField(
|
|
111
|
+
* {
|
|
112
|
+
* id: 'field1',
|
|
113
|
+
* customFieldIdType: 'externalId',
|
|
114
|
+
* sealedTarget: true,
|
|
115
|
+
* fileName: 'image.jpg',
|
|
116
|
+
* fileSize: 2048
|
|
117
|
+
* }
|
|
118
|
+
* );
|
|
119
|
+
* ```
|
|
120
|
+
*/
|
|
121
|
+
export declare function postMediaCustomField(params: PostMediaCustomFieldParameters): Promise<string>;
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getCustomFields = getCustomFields;
|
|
4
|
+
exports.postMediaCustomField = postMediaCustomField;
|
|
5
|
+
/**
|
|
6
|
+
* @packageDocumentation
|
|
7
|
+
*
|
|
8
|
+
* @document documents/custom-field.md
|
|
9
|
+
*/
|
|
10
|
+
const fetch_instance_1 = require("../../settings/fetch-instance");
|
|
11
|
+
/**
|
|
12
|
+
* APICODE(listPaginatedCustomFields)
|
|
13
|
+
* Retrieves custom fields.
|
|
14
|
+
*
|
|
15
|
+
* This function allows fetching custom fields based on the provided parameters.
|
|
16
|
+
*
|
|
17
|
+
* @param {GetCustomFieldParameters} params - The parameters for retrieving custom fields, including:
|
|
18
|
+
* #### fieldType - `string` | <strong style={{ color: 'red' }}>required</strong>
|
|
19
|
+
*
|
|
20
|
+
* The type of the custom field to retrieve.
|
|
21
|
+
* #### includeInactive - `boolean`
|
|
22
|
+
*
|
|
23
|
+
* Whether to include inactive custom fields in the response.
|
|
24
|
+
* #### limit - `number`
|
|
25
|
+
*
|
|
26
|
+
* The maximum number of custom fields to return.
|
|
27
|
+
* #### offset - `number`
|
|
28
|
+
*
|
|
29
|
+
* The number of custom fields to skip before starting to collect the result set.
|
|
30
|
+
*
|
|
31
|
+
* @returns {Promise<GetCustomFieldResponse>} - An object containing the retrieved custom fields.
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* #### input
|
|
35
|
+
* ```typescript
|
|
36
|
+
* const customFields = await getCustomFields({ fieldType: 'text', includeInactive: false });
|
|
37
|
+
* ```
|
|
38
|
+
#### output
|
|
39
|
+
* ```json
|
|
40
|
+
* {
|
|
41
|
+
* "content": [
|
|
42
|
+
* {
|
|
43
|
+
* "externalId": "field1",
|
|
44
|
+
* "externalSource": "MIRAKL",
|
|
45
|
+
* "faceted": true,
|
|
46
|
+
* "id": "field1",
|
|
47
|
+
* "indexable": true,
|
|
48
|
+
* "mandatory": true,
|
|
49
|
+
* "name": "Field 1",
|
|
50
|
+
* "role": "PRODUCT_TAX_RATE",
|
|
51
|
+
* "sealedTarget": true,
|
|
52
|
+
* "searchable": true,
|
|
53
|
+
* "sortable": true,
|
|
54
|
+
* "status": "ACTIVE",
|
|
55
|
+
* "type": "TEXT"
|
|
56
|
+
* },
|
|
57
|
+
* {
|
|
58
|
+
* "externalId": "field2",
|
|
59
|
+
* "externalSource": "CLIENT",
|
|
60
|
+
* "faceted": false,
|
|
61
|
+
* "id": "field2",
|
|
62
|
+
* "indexable": false,
|
|
63
|
+
* "mandatory": false,
|
|
64
|
+
* "name": "Field 2",
|
|
65
|
+
* "role": "SHIPPING_TAX_CODE",
|
|
66
|
+
* "sealedTarget": false,
|
|
67
|
+
* "searchable": false,
|
|
68
|
+
* "sortable": false,
|
|
69
|
+
* "status": "INACTIVE",
|
|
70
|
+
* "type": "LONG_TEXT"
|
|
71
|
+
* }
|
|
72
|
+
* ],
|
|
73
|
+
* "empty": false,
|
|
74
|
+
* "first": true,
|
|
75
|
+
* "last": false,
|
|
76
|
+
* "number": 0,
|
|
77
|
+
* "numberOfElements": 2,
|
|
78
|
+
* "pageable": {
|
|
79
|
+
* "page": 0,
|
|
80
|
+
* "size": 10,
|
|
81
|
+
* "sort": []
|
|
82
|
+
* },
|
|
83
|
+
* "size": 10,
|
|
84
|
+
* "sort": [],
|
|
85
|
+
* "totalElemets": 2,
|
|
86
|
+
* "totalPages": 1
|
|
87
|
+
* }
|
|
88
|
+
* ```
|
|
89
|
+
*/
|
|
90
|
+
async function getCustomFields(params) {
|
|
91
|
+
const { data } = await (0, fetch_instance_1.enhancedFetch)({
|
|
92
|
+
method: "GET",
|
|
93
|
+
path: `/v2/shop/custom-fields`,
|
|
94
|
+
params,
|
|
95
|
+
});
|
|
96
|
+
return data;
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* APICODE(postMediaCustomField)
|
|
100
|
+
* Publishes a media custom field.
|
|
101
|
+
*
|
|
102
|
+
* This function allows publishing a media file associated with a specific custom field.
|
|
103
|
+
*
|
|
104
|
+
* @param {PostMediaCustomFieldParameters} params - The parameters for publishing the media field, including:
|
|
105
|
+
* #### id - `string` | <strong style={{ color: 'red' }}>required</strong>
|
|
106
|
+
*
|
|
107
|
+
* The identifier of the custom field to which the media is associated.
|
|
108
|
+
* #### customFieldIdType - `string` | <strong style={{ color: 'red' }}>required</strong></strong>
|
|
109
|
+
*
|
|
110
|
+
* The type of the custom field identifier (e.g., 'externalId').
|
|
111
|
+
* #### sealedTarget - `boolean`
|
|
112
|
+
*
|
|
113
|
+
* Indicates whether the media should be sealed.
|
|
114
|
+
* #### fileName - `string` | <strong style={{ color: 'red' }}>required</strong>
|
|
115
|
+
*
|
|
116
|
+
* The name of the media file being uploaded.
|
|
117
|
+
* #### fileSize - `number` | <strong style={{ color: 'red' }}>required</strong>
|
|
118
|
+
*
|
|
119
|
+
* The size of the media file in bytes.
|
|
120
|
+
*
|
|
121
|
+
* @returns {Promise<string>} - A promise that resolves to the url where post the media.
|
|
122
|
+
*
|
|
123
|
+
* @example
|
|
124
|
+
* #### input
|
|
125
|
+
* ```typescript
|
|
126
|
+
* const mediaId = await postMediaCustomField(
|
|
127
|
+
* {
|
|
128
|
+
* id: 'field1',
|
|
129
|
+
* customFieldIdType: 'externalId',
|
|
130
|
+
* sealedTarget: true,
|
|
131
|
+
* fileName: 'image.jpg',
|
|
132
|
+
* fileSize: 2048
|
|
133
|
+
* }
|
|
134
|
+
* );
|
|
135
|
+
* ```
|
|
136
|
+
*/
|
|
137
|
+
async function postMediaCustomField(params) {
|
|
138
|
+
const { id, customFieldIdType, sealedTarget, fileName, fileSize } = params;
|
|
139
|
+
const { data } = await (0, fetch_instance_1.enhancedFetch)({
|
|
140
|
+
method: "POST",
|
|
141
|
+
path: `/v2/shop/custom-fields/${id}/media`,
|
|
142
|
+
params: { customFieldIdType, sealedTarget, fileName, fileSize },
|
|
143
|
+
});
|
|
144
|
+
return data;
|
|
145
|
+
}
|
|
@@ -1,30 +1,22 @@
|
|
|
1
|
-
import { IncidentDto, IncidentStatus, IncidentIdType, IncidentCreatedDto } from "../../interfaces/models/incident";
|
|
1
|
+
import { IncidentDto, IncidentStatus, IncidentIdType, IncidentLogisticOrder, IncidentCreatedDto } from "../../interfaces/models/incident";
|
|
2
2
|
import { CustomFieldValueRequest } from "../../interfaces/models/custom-field";
|
|
3
3
|
/**
|
|
4
4
|
* Request parameters type definitions
|
|
5
5
|
*/
|
|
6
|
-
export interface
|
|
7
|
-
|
|
6
|
+
export interface getIncidentsParameters {
|
|
7
|
+
customerAccountIds: String[];
|
|
8
|
+
linkedType: IncidentLogisticOrder;
|
|
9
|
+
ids: String[];
|
|
8
10
|
status: IncidentStatus[];
|
|
9
11
|
idType: IncidentIdType;
|
|
10
12
|
page: number;
|
|
11
13
|
size: number;
|
|
12
14
|
sort: String[];
|
|
13
15
|
}
|
|
14
|
-
export interface
|
|
15
|
-
logisticOrderId: string;
|
|
16
|
+
export interface getIncidentParameters {
|
|
16
17
|
incidentId: string;
|
|
17
18
|
idType: IncidentIdType;
|
|
18
19
|
}
|
|
19
|
-
export interface getOrderLogisticLineIncidentsParameters {
|
|
20
|
-
logisticOrderId: string;
|
|
21
|
-
lineId: string;
|
|
22
|
-
status: IncidentStatus[];
|
|
23
|
-
idType: IncidentIdType;
|
|
24
|
-
page: number;
|
|
25
|
-
size: number;
|
|
26
|
-
sort: String[];
|
|
27
|
-
}
|
|
28
20
|
export interface createOrderLogisticIncidentParameters {
|
|
29
21
|
logisticOrderId: string;
|
|
30
22
|
idType: IncidentIdType;
|
|
@@ -45,24 +37,14 @@ export interface createOrderLogisticLineIncidentParameters {
|
|
|
45
37
|
}[];
|
|
46
38
|
reasonCode: string[];
|
|
47
39
|
}
|
|
48
|
-
export interface getCustomerAccountIncidentsParameters {
|
|
49
|
-
customerAccountId: string;
|
|
50
|
-
status: IncidentStatus[];
|
|
51
|
-
page: number;
|
|
52
|
-
size: number;
|
|
53
|
-
sort: String[];
|
|
54
|
-
}
|
|
55
40
|
/**
|
|
41
|
+
* Request response type definitions
|
|
56
42
|
*/
|
|
57
|
-
export interface
|
|
43
|
+
export interface getIncidentsResponse extends Array<IncidentDto> {
|
|
58
44
|
}
|
|
59
|
-
export interface
|
|
60
|
-
}
|
|
61
|
-
export interface getOrderLogisticLineIncidentsResponse extends Array<IncidentDto> {
|
|
45
|
+
export interface getIncidentResponse extends IncidentDto {
|
|
62
46
|
}
|
|
63
47
|
export interface createOrderLogisticIncidentResponse extends IncidentCreatedDto {
|
|
64
48
|
}
|
|
65
49
|
export interface createOrderLogisticLineIncidentResponse extends IncidentCreatedDto {
|
|
66
50
|
}
|
|
67
|
-
export interface getCustomerAccountIncidentsResponse extends Array<IncidentDto> {
|
|
68
|
-
}
|