@djust-b2b/djust-front-sdk 1.13.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.
Files changed (29) hide show
  1. package/lib/index.d.ts +11 -10
  2. package/lib/interfaces/models/customer-user.d.ts +6 -0
  3. package/lib/interfaces/models/incident.d.ts +1 -0
  4. package/lib/interfaces/models/order.d.ts +96 -0
  5. package/lib/services/auth/index.d.ts +12 -13
  6. package/lib/services/auth/index.js +12 -13
  7. package/lib/services/commercial-order/definitions.d.ts +20 -3
  8. package/lib/services/commercial-order/index.d.ts +361 -15
  9. package/lib/services/commercial-order/index.js +397 -33
  10. package/lib/services/custom-field/definitions.d.ts +100 -0
  11. package/lib/services/custom-field/definitions.js +60 -0
  12. package/lib/services/custom-field/index.d.ts +121 -0
  13. package/lib/services/custom-field/index.js +145 -0
  14. package/lib/services/customer-account/index.d.ts +1781 -23
  15. package/lib/services/customer-account/index.js +1780 -45
  16. package/lib/services/customer-user/definitions.d.ts +3 -1
  17. package/lib/services/customer-user/index.d.ts +2 -2
  18. package/lib/services/incident/definitions.d.ts +9 -27
  19. package/lib/services/incident/index.d.ts +38 -119
  20. package/lib/services/incident/index.js +46 -153
  21. package/lib/services/logistic-order/definitions.d.ts +16 -1
  22. package/lib/services/logistic-order/index.d.ts +799 -28
  23. package/lib/services/logistic-order/index.js +823 -28
  24. package/lib/services/navigation-category/index.d.ts +122 -3
  25. package/lib/services/navigation-category/index.js +122 -3
  26. package/lib/services/product/definitions.d.ts +1 -1
  27. package/lib/services/product/index.d.ts +1762 -19
  28. package/lib/services/product/index.js +1777 -34
  29. package/package.json +1 -1
@@ -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
+ }