@djust-b2b/djust-front-sdk 2.8.0 → 2.10.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 -1
- package/lib/services/commercial-order/definitions.d.ts +3 -0
- package/lib/services/commercial-order/index.d.ts +8 -2
- package/lib/services/commercial-order/index.js +11 -2
- package/lib/services/operation/definitions.d.ts +72 -0
- package/lib/services/operation/index.d.ts +104 -1
- package/lib/services/operation/index.js +144 -0
- package/package.json +1 -1
package/lib/index.d.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
export declare const DjustSDK: {
|
|
2
2
|
initialize: (initConfig: import("./settings/fetch-instance").ClientConfig) => void;
|
|
3
3
|
updateConfiguration: (newConfig: Partial<import("./settings/fetch-instance").ClientConfig>) => void;
|
|
4
|
+
getShopOperations({ page, size, sort, ids, name, startDateFrom, startDateTo, endDateFrom, endDateTo, locale, }: import("./services/operation/definitions").GetShopOperationsParameters): Promise<import("./services/operation/definitions").GetShopOperationsResponse>;
|
|
4
5
|
getOperations({ page, size, sort, type, status, ids, name, startDateFrom, startDateTo, endDateFrom, endDateTo, ownerIds, idType, locale, }: import("./services/operation/definitions").GetOperationsParameters): Promise<import("./services/operation/definitions").GetOperationsResponse>;
|
|
6
|
+
getShopOperation({ operationId, locale, }: import("./services/operation/definitions").GetShopOperationParameters): Promise<import("./services/operation/definitions").GetShopOperationResponse>;
|
|
5
7
|
getOperation({ operationId, }: import("./services/operation/definitions").GetOperationParameters): Promise<import("./services/operation/definitions").GetOperationResponse>;
|
|
6
8
|
updateOperation({ operationId, status, }: import("./services/operation/definitions").UpdateOperationParameters): Promise<void>;
|
|
7
9
|
updateOperationDetails({ operationId, customFieldValues, descriptions, endDate, names, startDate, }: import("./services/operation/definitions").UpdateOperationDetailsParameters): Promise<import("./services/operation/definitions").UpdateOperationDetailsResponse>;
|
|
@@ -9,6 +11,7 @@ export declare const DjustSDK: {
|
|
|
9
11
|
getOperationAccounts({ operationId, page, size, sort, accountIds, accountName, }: import("./services/operation/definitions").GetOperationAccountsParameters): Promise<import("./services/operation/definitions").GetOperationAccountsResponse>;
|
|
10
12
|
addOperationAccounts({ operationId, accountIds, }: import("./services/operation/definitions").AddOperationAccountsParameters): Promise<void>;
|
|
11
13
|
removeOperationLines({ operationId, variantIds, }: import("./services/operation/definitions").RemoveOperationLinesParameters): Promise<void>;
|
|
14
|
+
getShopOperationLines({ operationId, page, size, sort, variantIds, variantName, locale, }: import("./services/operation/definitions").GetShopOperationLinesParameters): Promise<import("./services/operation/definitions").GetShopOperationLinesResponse>;
|
|
12
15
|
getOperationLines({ operationId, page, size, sort, variantIds, variantName, minQuantity, maxQuantity, recommendedQuantity, locale, }: import("./services/operation/definitions").GetOperationLinesParameters): Promise<import("./services/operation/definitions").GetOperationLinesResponse>;
|
|
13
16
|
addOperationLines({ operationId, lines, }: import("./services/operation/definitions").AddOperationLinesParameters): Promise<void>;
|
|
14
17
|
createOperation({ customFieldValues, descriptions, endDate, externalId, names, startDate, type, }: import("./services/operation/definitions").CreateOperationParameters): Promise<import("./services/operation/definitions").CreateOperationResponse>;
|
|
@@ -32,7 +35,7 @@ export declare const DjustSDK: {
|
|
|
32
35
|
getIncidentsV2({ customerAccountIds, linkedType, ids, status, idType, page, size, sort, supplierIds, }: import("./services/incident/definitions").getIncidentsParameters): Promise<import("./services/incident/definitions").getIncidentsResponse>;
|
|
33
36
|
getCommercialOrders({ locale, nbPreviewLines, page, size, sort, connectedUserOnly, customerAccountIds, isValidated, }: import("./interfaces").GetCommercialOrdersParameters): Promise<import("./interfaces").GetCommercialOrdersResponse>;
|
|
34
37
|
createCommercialOrder({ nbPreviewLines, channel, customFields, locale, origin, originId, paymentInfo, }: import("./interfaces").CreateCommercialOrderParameters): Promise<import("./interfaces").CreateCommercialOrderResponse>;
|
|
35
|
-
createCommercialOrderV2({ customFieldIdType, customFields, }: import("./interfaces").CreateCommercialOrderV2Parameters): Promise<import("./interfaces").CreateCommercialOrderV2Response>;
|
|
38
|
+
createCommercialOrderV2({ customFieldIdType, customFields, isFull, sourceId, sourceType, }: import("./interfaces").CreateCommercialOrderV2Parameters): Promise<import("./interfaces").CreateCommercialOrderV2Response>;
|
|
36
39
|
getCommercialOrder({ orderId, idType, locale, nbPreviewLines, }: import("./interfaces").GetCommercialOrderParameters): Promise<import("./interfaces").GetCommercialOrderResponse>;
|
|
37
40
|
updateCommercialOrder({ commercialOrderId, customFieldIdType, customFields, }: import("./interfaces").UpdateCommercialOrderParameters): Promise<void>;
|
|
38
41
|
createCommercialOrderCardRegistration({ orderId, paymentProvider, currency, }: import("./interfaces").CreateCommercialOrderCardRegistrationParameters): Promise<import("./interfaces").CreateCommercialOrderCardRegistrationResponse>;
|
|
@@ -39,6 +39,9 @@ export interface CreateCommercialOrderParameters {
|
|
|
39
39
|
export interface CreateCommercialOrderV2Parameters {
|
|
40
40
|
customFieldIdType?: IdType;
|
|
41
41
|
customFields?: CustomFieldValueRequest[];
|
|
42
|
+
isFull?: boolean;
|
|
43
|
+
sourceId?: string;
|
|
44
|
+
sourceType?: string;
|
|
42
45
|
}
|
|
43
46
|
export interface UpdateCommercialOrderParameters extends CreateCommercialOrderV2Parameters {
|
|
44
47
|
commercialOrderId: string;
|
|
@@ -85,6 +85,9 @@ export declare function createCommercialOrder({ nbPreviewLines, channel, customF
|
|
|
85
85
|
* |----------------------|--------------------------------------|-----------------------------------------------------------------------|
|
|
86
86
|
* | `customFieldIdType` | `IdType` | ❌ | The custom field id type to use. |
|
|
87
87
|
* | `customFields` | `CustomFieldValueRequest[]` | ❌ | The custom fields to add to the created commercial order. |
|
|
88
|
+
* | `isFull` | `boolean` | ❌ | Whether the order is full or not. |
|
|
89
|
+
* | `sourceId` | `string` | ❌ | The source ID for the order. |
|
|
90
|
+
* | `sourceType` | `string` | ❌ | The type of source (e.g., "OPERATION"). |
|
|
88
91
|
*
|
|
89
92
|
* 📤 **Returns**:
|
|
90
93
|
* A `Promise` resolving to a single `CreateCommercialOrderV2Response` object representing the created commercial orders [ORDER-108].
|
|
@@ -92,20 +95,23 @@ export declare function createCommercialOrder({ nbPreviewLines, channel, customF
|
|
|
92
95
|
* 🛠 **Example usage**:
|
|
93
96
|
* ```ts
|
|
94
97
|
* const orders = await createCommercialOrderV2({
|
|
95
|
-
* customFieldIdType: "
|
|
98
|
+
* customFieldIdType: "EXTERNAL_ID",
|
|
96
99
|
* customFields: [
|
|
97
100
|
* {
|
|
98
101
|
* "customFieldId": "string",
|
|
99
102
|
* "customFieldValue": "string"
|
|
100
103
|
* }
|
|
101
104
|
* ],
|
|
105
|
+
* isFull: true,
|
|
106
|
+
* sourceId: "OPE-UK-SUMMER-2025",
|
|
107
|
+
* sourceType: "OPERATION"
|
|
102
108
|
* });
|
|
103
109
|
* ```
|
|
104
110
|
*
|
|
105
111
|
* @param {CreateCommercialOrderV2Parameters} params - The body of the request.
|
|
106
112
|
* @returns {Promise<CreateCommercialOrderV2Response>} A promise resolving to the response containing the created commercial orders.
|
|
107
113
|
*/
|
|
108
|
-
export declare function createCommercialOrderV2({ customFieldIdType, customFields, }: CreateCommercialOrderV2Parameters): Promise<CreateCommercialOrderV2Response>;
|
|
114
|
+
export declare function createCommercialOrderV2({ customFieldIdType, customFields, isFull, sourceId, sourceType, }: CreateCommercialOrderV2Parameters): Promise<CreateCommercialOrderV2Response>;
|
|
109
115
|
/**
|
|
110
116
|
* 🚚 Gets a specific commercial order.
|
|
111
117
|
*
|
|
@@ -143,6 +143,9 @@ async function createCommercialOrder({ nbPreviewLines, channel, customFields, lo
|
|
|
143
143
|
* |----------------------|--------------------------------------|-----------------------------------------------------------------------|
|
|
144
144
|
* | `customFieldIdType` | `IdType` | ❌ | The custom field id type to use. |
|
|
145
145
|
* | `customFields` | `CustomFieldValueRequest[]` | ❌ | The custom fields to add to the created commercial order. |
|
|
146
|
+
* | `isFull` | `boolean` | ❌ | Whether the order is full or not. |
|
|
147
|
+
* | `sourceId` | `string` | ❌ | The source ID for the order. |
|
|
148
|
+
* | `sourceType` | `string` | ❌ | The type of source (e.g., "OPERATION"). |
|
|
146
149
|
*
|
|
147
150
|
* 📤 **Returns**:
|
|
148
151
|
* A `Promise` resolving to a single `CreateCommercialOrderV2Response` object representing the created commercial orders [ORDER-108].
|
|
@@ -150,26 +153,32 @@ async function createCommercialOrder({ nbPreviewLines, channel, customFields, lo
|
|
|
150
153
|
* 🛠 **Example usage**:
|
|
151
154
|
* ```ts
|
|
152
155
|
* const orders = await createCommercialOrderV2({
|
|
153
|
-
* customFieldIdType: "
|
|
156
|
+
* customFieldIdType: "EXTERNAL_ID",
|
|
154
157
|
* customFields: [
|
|
155
158
|
* {
|
|
156
159
|
* "customFieldId": "string",
|
|
157
160
|
* "customFieldValue": "string"
|
|
158
161
|
* }
|
|
159
162
|
* ],
|
|
163
|
+
* isFull: true,
|
|
164
|
+
* sourceId: "OPE-UK-SUMMER-2025",
|
|
165
|
+
* sourceType: "OPERATION"
|
|
160
166
|
* });
|
|
161
167
|
* ```
|
|
162
168
|
*
|
|
163
169
|
* @param {CreateCommercialOrderV2Parameters} params - The body of the request.
|
|
164
170
|
* @returns {Promise<CreateCommercialOrderV2Response>} A promise resolving to the response containing the created commercial orders.
|
|
165
171
|
*/
|
|
166
|
-
async function createCommercialOrderV2({ customFieldIdType, customFields, }) {
|
|
172
|
+
async function createCommercialOrderV2({ customFieldIdType, customFields, isFull, sourceId, sourceType, }) {
|
|
167
173
|
const { data } = await (0, fetch_instance_1.enhancedFetch)({
|
|
168
174
|
method: "POST",
|
|
169
175
|
path: `/v2/shop/commercial-orders`,
|
|
170
176
|
body: JSON.stringify({
|
|
171
177
|
customFieldIdType,
|
|
172
178
|
customFields,
|
|
179
|
+
isFull,
|
|
180
|
+
sourceId,
|
|
181
|
+
sourceType,
|
|
173
182
|
}),
|
|
174
183
|
});
|
|
175
184
|
return data;
|
|
@@ -14,6 +14,18 @@ export declare enum OperationStatus {
|
|
|
14
14
|
/**
|
|
15
15
|
* Request parameters type definitions
|
|
16
16
|
*/
|
|
17
|
+
export interface GetShopOperationsParameters {
|
|
18
|
+
page?: number;
|
|
19
|
+
size?: number;
|
|
20
|
+
sort?: string[];
|
|
21
|
+
ids?: string[];
|
|
22
|
+
name?: string;
|
|
23
|
+
startDateFrom?: string;
|
|
24
|
+
startDateTo?: string;
|
|
25
|
+
endDateFrom?: string;
|
|
26
|
+
endDateTo?: string;
|
|
27
|
+
locale?: string;
|
|
28
|
+
}
|
|
17
29
|
export interface GetOperationsParameters {
|
|
18
30
|
page?: number;
|
|
19
31
|
size?: number;
|
|
@@ -45,6 +57,10 @@ export interface CreateOperationParameters {
|
|
|
45
57
|
export interface DeleteOperationParameters {
|
|
46
58
|
operationId: string;
|
|
47
59
|
}
|
|
60
|
+
export interface GetShopOperationParameters {
|
|
61
|
+
operationId: string;
|
|
62
|
+
locale?: string;
|
|
63
|
+
}
|
|
48
64
|
export interface GetOperationParameters {
|
|
49
65
|
operationId: string;
|
|
50
66
|
}
|
|
@@ -83,6 +99,15 @@ export interface RemoveOperationLinesParameters {
|
|
|
83
99
|
operationId: string;
|
|
84
100
|
variantIds: string[];
|
|
85
101
|
}
|
|
102
|
+
export interface GetShopOperationLinesParameters {
|
|
103
|
+
operationId: string;
|
|
104
|
+
page?: number;
|
|
105
|
+
size?: number;
|
|
106
|
+
sort?: string[];
|
|
107
|
+
variantIds?: string[];
|
|
108
|
+
variantName?: string;
|
|
109
|
+
locale?: string;
|
|
110
|
+
}
|
|
86
111
|
export interface GetOperationLinesParameters {
|
|
87
112
|
operationId: string;
|
|
88
113
|
page?: number;
|
|
@@ -107,6 +132,14 @@ export interface AddOperationLinesParameters {
|
|
|
107
132
|
/**
|
|
108
133
|
* Response type definitions
|
|
109
134
|
*/
|
|
135
|
+
export interface ShopOperation {
|
|
136
|
+
createdAt: string;
|
|
137
|
+
endDate: string;
|
|
138
|
+
id: string;
|
|
139
|
+
name: string;
|
|
140
|
+
startDate: string;
|
|
141
|
+
type: OperationType;
|
|
142
|
+
}
|
|
110
143
|
export interface Operation {
|
|
111
144
|
id: string;
|
|
112
145
|
name: string;
|
|
@@ -122,6 +155,16 @@ export interface Operation {
|
|
|
122
155
|
ownerLastName: string;
|
|
123
156
|
externalId: string;
|
|
124
157
|
}
|
|
158
|
+
export interface GetShopOperationsResponse {
|
|
159
|
+
content: ShopOperation[];
|
|
160
|
+
empty: boolean;
|
|
161
|
+
first: boolean;
|
|
162
|
+
last: boolean;
|
|
163
|
+
number: number;
|
|
164
|
+
numberOfElements: number;
|
|
165
|
+
size: number;
|
|
166
|
+
sort: string[];
|
|
167
|
+
}
|
|
125
168
|
export interface GetOperationsResponse {
|
|
126
169
|
content: Operation[];
|
|
127
170
|
empty: boolean;
|
|
@@ -152,6 +195,14 @@ export interface GetOperationAccountsResponse {
|
|
|
152
195
|
size: number;
|
|
153
196
|
sort: string[];
|
|
154
197
|
}
|
|
198
|
+
export interface ShopOperationLine {
|
|
199
|
+
sku: string;
|
|
200
|
+
variantId: string;
|
|
201
|
+
variantName: string;
|
|
202
|
+
minQuantity: number;
|
|
203
|
+
maxQuantity: number;
|
|
204
|
+
recommendedQuantity: number;
|
|
205
|
+
}
|
|
155
206
|
export interface OperationLine {
|
|
156
207
|
variantId: string;
|
|
157
208
|
variantName: string;
|
|
@@ -159,6 +210,16 @@ export interface OperationLine {
|
|
|
159
210
|
maxQuantity: number;
|
|
160
211
|
recommendedQuantity: number;
|
|
161
212
|
}
|
|
213
|
+
export interface GetShopOperationLinesResponse {
|
|
214
|
+
content: ShopOperationLine[];
|
|
215
|
+
empty: boolean;
|
|
216
|
+
first: boolean;
|
|
217
|
+
last: boolean;
|
|
218
|
+
number: number;
|
|
219
|
+
numberOfElements: number;
|
|
220
|
+
size: number;
|
|
221
|
+
sort: string[];
|
|
222
|
+
}
|
|
162
223
|
export interface GetOperationLinesResponse {
|
|
163
224
|
content: OperationLine[];
|
|
164
225
|
empty: boolean;
|
|
@@ -187,6 +248,17 @@ export interface CustomFieldValue {
|
|
|
187
248
|
customField: CustomField;
|
|
188
249
|
value: any;
|
|
189
250
|
}
|
|
251
|
+
export interface GetShopOperationResponse {
|
|
252
|
+
createdAt: string;
|
|
253
|
+
customFieldValues: CustomFieldValue[];
|
|
254
|
+
descriptions: string;
|
|
255
|
+
endDate: string;
|
|
256
|
+
id: string;
|
|
257
|
+
name: string;
|
|
258
|
+
startDate: string;
|
|
259
|
+
type: OperationType;
|
|
260
|
+
updatedDate: string;
|
|
261
|
+
}
|
|
190
262
|
export interface GetOperationResponse {
|
|
191
263
|
id: string;
|
|
192
264
|
name: string;
|
|
@@ -1,7 +1,47 @@
|
|
|
1
|
-
import { GetOperationsParameters, GetOperationsResponse, CreateOperationParameters, CreateOperationResponse, DeleteOperationParameters, GetOperationParameters, GetOperationResponse, UpdateOperationParameters, UpdateOperationDetailsParameters, UpdateOperationDetailsResponse, RemoveOperationAccountsParameters, GetOperationAccountsParameters, GetOperationAccountsResponse, AddOperationAccountsParameters, RemoveOperationLinesParameters, GetOperationLinesParameters, GetOperationLinesResponse, AddOperationLinesParameters } from "./definitions";
|
|
1
|
+
import { GetShopOperationsParameters, GetShopOperationsResponse, GetShopOperationParameters, GetShopOperationResponse, GetShopOperationLinesParameters, GetShopOperationLinesResponse, GetOperationsParameters, GetOperationsResponse, CreateOperationParameters, CreateOperationResponse, DeleteOperationParameters, GetOperationParameters, GetOperationResponse, UpdateOperationParameters, UpdateOperationDetailsParameters, UpdateOperationDetailsResponse, RemoveOperationAccountsParameters, GetOperationAccountsParameters, GetOperationAccountsResponse, AddOperationAccountsParameters, RemoveOperationLinesParameters, GetOperationLinesParameters, GetOperationLinesResponse, AddOperationLinesParameters } from "./definitions";
|
|
2
2
|
/**
|
|
3
3
|
* OPERATION ENDPOINT
|
|
4
4
|
*/
|
|
5
|
+
/**
|
|
6
|
+
* 🎯 Gets shop operations.
|
|
7
|
+
*
|
|
8
|
+
* This function retrieves all shop operations.
|
|
9
|
+
*
|
|
10
|
+
* 🛠 **Endpoint**: `GET /v1/shop/operations`
|
|
11
|
+
*
|
|
12
|
+
* | Parameter | Type | Required | Description |
|
|
13
|
+
* |------------------------|---------------------|----------|------------------------------------------|
|
|
14
|
+
* | `page` | `number` | ❌ | The page number to retrieve (0-based). |
|
|
15
|
+
* | `size` | `number` | ❌ | The number of items per page. |
|
|
16
|
+
* | `sort` | `string[]` | ❌ | The sort to apply to the results. |
|
|
17
|
+
* | `ids` | `string[]` | ❌ | Filter by operation IDs. |
|
|
18
|
+
* | `name` | `string` | ❌ | Case-insensitive substring match on Operation name. |
|
|
19
|
+
* | `startDateFrom` | `string` | ❌ | Return Operations starting on or after this ISO date (inclusive). |
|
|
20
|
+
* | `startDateTo` | `string` | ❌ | Return Operations starting on or before this ISO date (inclusive). |
|
|
21
|
+
* | `endDateFrom` | `string` | ❌ | Return Operations ending on or after this ISO date (inclusive). |
|
|
22
|
+
* | `endDateTo` | `string` | ❌ | Return Operations ending on or before this ISO date (inclusive). |
|
|
23
|
+
* | `locale` | `string` | ❌ | Locale to use for localized fields (e.g., `name`). |
|
|
24
|
+
*
|
|
25
|
+
* 📤 **Returns**:
|
|
26
|
+
* A `Promise` resolving to a single `GetShopOperationsResponse` object representing the page of shop operations.
|
|
27
|
+
*
|
|
28
|
+
* 🛠 **Example usage**:
|
|
29
|
+
* ```ts
|
|
30
|
+
* const shopOperations = await getShopOperations({
|
|
31
|
+
* page: 0,
|
|
32
|
+
* size: 10,
|
|
33
|
+
* startDateFrom: "2025-01-01",
|
|
34
|
+
* startDateTo: "2025-12-31",
|
|
35
|
+
* endDateFrom: "2025-01-01",
|
|
36
|
+
* endDateTo: "2025-12-31",
|
|
37
|
+
* locale: "en-US"
|
|
38
|
+
* });
|
|
39
|
+
* ```
|
|
40
|
+
*
|
|
41
|
+
* @param {GetShopOperationsParameters} params - The parameters for retrieving the shop operations.
|
|
42
|
+
* @returns {Promise<GetShopOperationsResponse>} A promise resolving to the response containing page object.
|
|
43
|
+
*/
|
|
44
|
+
export declare function getShopOperations({ page, size, sort, ids, name, startDateFrom, startDateTo, endDateFrom, endDateTo, locale, }: GetShopOperationsParameters): Promise<GetShopOperationsResponse>;
|
|
5
45
|
/**
|
|
6
46
|
* 🎯 Gets operations.
|
|
7
47
|
*
|
|
@@ -44,6 +84,33 @@ import { GetOperationsParameters, GetOperationsResponse, CreateOperationParamete
|
|
|
44
84
|
* @returns {Promise<GetOperationsResponse>} A promise resolving to the response containing page object.
|
|
45
85
|
*/
|
|
46
86
|
export declare function getOperations({ page, size, sort, type, status, ids, name, startDateFrom, startDateTo, endDateFrom, endDateTo, ownerIds, idType, locale, }: GetOperationsParameters): Promise<GetOperationsResponse>;
|
|
87
|
+
/**
|
|
88
|
+
* 🔍 Gets a single shop operation by ID.
|
|
89
|
+
*
|
|
90
|
+
* This function retrieves detailed information about a specific shop operation.
|
|
91
|
+
*
|
|
92
|
+
* 🛠 **Endpoint**: `GET /v1/shop/operations/{operationId}`
|
|
93
|
+
*
|
|
94
|
+
* | Parameter | Type | Required | Description |
|
|
95
|
+
* |------------------------|---------------------|----------|------------------------------------------|
|
|
96
|
+
* | `operationId` | `string` | ✅ | Operation identifier to retrieve. |
|
|
97
|
+
* | `locale` | `string` | ❌ | Locale to use for localized fields (e.g., `name`). |
|
|
98
|
+
*
|
|
99
|
+
* 📤 **Returns**:
|
|
100
|
+
* A `Promise` resolving to a single `GetShopOperationResponse` object containing the operation details.
|
|
101
|
+
*
|
|
102
|
+
* 🛠 **Example usage**:
|
|
103
|
+
* ```ts
|
|
104
|
+
* const operation = await getShopOperation({
|
|
105
|
+
* operationId: "ope_123",
|
|
106
|
+
* locale: "en-US"
|
|
107
|
+
* });
|
|
108
|
+
* ```
|
|
109
|
+
*
|
|
110
|
+
* @param {GetShopOperationParameters} params - The parameters for retrieving the shop operation.
|
|
111
|
+
* @returns {Promise<GetShopOperationResponse>} A promise resolving to the operation details.
|
|
112
|
+
*/
|
|
113
|
+
export declare function getShopOperation({ operationId, locale, }: GetShopOperationParameters): Promise<GetShopOperationResponse>;
|
|
47
114
|
/**
|
|
48
115
|
* 🔍 Gets a single operation by ID.
|
|
49
116
|
*
|
|
@@ -259,6 +326,42 @@ export declare function addOperationAccounts({ operationId, accountIds, }: AddOp
|
|
|
259
326
|
* @returns {Promise<void>} A promise that resolves when the variants are removed.
|
|
260
327
|
*/
|
|
261
328
|
export declare function removeOperationLines({ operationId, variantIds, }: RemoveOperationLinesParameters): Promise<void>;
|
|
329
|
+
/**
|
|
330
|
+
* 📦 Gets variants linked to an operation.
|
|
331
|
+
*
|
|
332
|
+
* This function retrieves a paginated list of variants linked to a specific operation
|
|
333
|
+
* with various filtering options including quantity ranges and variant names.
|
|
334
|
+
*
|
|
335
|
+
* 🛠 **Endpoint**: `GET /v1/shop/operations/{operationId}/lines`
|
|
336
|
+
*
|
|
337
|
+
* | Parameter | Type | Required | Description |
|
|
338
|
+
* |------------------------|---------------------|----------|------------------------------------------|
|
|
339
|
+
* | `operationId` | `string` | ✅ | Operation identifier to retrieve lines from. |
|
|
340
|
+
* | `page` | `number` | ❌ | The page number to retrieve (0-based). |
|
|
341
|
+
* | `size` | `number` | ❌ | The number of items per page. |
|
|
342
|
+
* | `sort` | `string[]` | ❌ | The sort to apply to the results. |
|
|
343
|
+
* | `variantIds` | `string[]` | ❌ | Filter by a list of external variant IDs. |
|
|
344
|
+
* | `variantName` | `string` | ❌ | Filter by variant name (case-insensitive, partial or exact match). |
|
|
345
|
+
* | `locale` | `string` | ❌ | Locale to use for localized fields. |
|
|
346
|
+
*
|
|
347
|
+
* 📤 **Returns**:
|
|
348
|
+
* A `Promise` resolving to a single `GetShopOperationLinesResponse` object representing the page of variants.
|
|
349
|
+
*
|
|
350
|
+
* 🛠 **Example usage**:
|
|
351
|
+
* ```ts
|
|
352
|
+
* const variants = await getShopOperationLines({
|
|
353
|
+
* operationId: "ope_123",
|
|
354
|
+
* page: 0,
|
|
355
|
+
* size: 20,
|
|
356
|
+
* variantName: "Shirt",
|
|
357
|
+
* locale: "en-US"
|
|
358
|
+
* });
|
|
359
|
+
* ```
|
|
360
|
+
*
|
|
361
|
+
* @param {GetShopOperationLinesParameters} params - The parameters for the request.
|
|
362
|
+
* @returns {Promise<GetShopOperationLinesResponse>} A promise resolving to the response containing page of variants.
|
|
363
|
+
*/
|
|
364
|
+
export declare function getShopOperationLines({ operationId, page, size, sort, variantIds, variantName, locale, }: GetShopOperationLinesParameters): Promise<GetShopOperationLinesResponse>;
|
|
262
365
|
/**
|
|
263
366
|
* 📦 Gets variants linked to an operation.
|
|
264
367
|
*
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getShopOperations = getShopOperations;
|
|
3
4
|
exports.getOperations = getOperations;
|
|
5
|
+
exports.getShopOperation = getShopOperation;
|
|
4
6
|
exports.getOperation = getOperation;
|
|
5
7
|
exports.updateOperation = updateOperation;
|
|
6
8
|
exports.updateOperationDetails = updateOperationDetails;
|
|
@@ -8,6 +10,7 @@ exports.removeOperationAccounts = removeOperationAccounts;
|
|
|
8
10
|
exports.getOperationAccounts = getOperationAccounts;
|
|
9
11
|
exports.addOperationAccounts = addOperationAccounts;
|
|
10
12
|
exports.removeOperationLines = removeOperationLines;
|
|
13
|
+
exports.getShopOperationLines = getShopOperationLines;
|
|
11
14
|
exports.getOperationLines = getOperationLines;
|
|
12
15
|
exports.addOperationLines = addOperationLines;
|
|
13
16
|
exports.createOperation = createOperation;
|
|
@@ -16,6 +19,64 @@ const fetch_instance_1 = require("../../settings/fetch-instance");
|
|
|
16
19
|
/**
|
|
17
20
|
* OPERATION ENDPOINT
|
|
18
21
|
*/
|
|
22
|
+
/**
|
|
23
|
+
* 🎯 Gets shop operations.
|
|
24
|
+
*
|
|
25
|
+
* This function retrieves all shop operations.
|
|
26
|
+
*
|
|
27
|
+
* 🛠 **Endpoint**: `GET /v1/shop/operations`
|
|
28
|
+
*
|
|
29
|
+
* | Parameter | Type | Required | Description |
|
|
30
|
+
* |------------------------|---------------------|----------|------------------------------------------|
|
|
31
|
+
* | `page` | `number` | ❌ | The page number to retrieve (0-based). |
|
|
32
|
+
* | `size` | `number` | ❌ | The number of items per page. |
|
|
33
|
+
* | `sort` | `string[]` | ❌ | The sort to apply to the results. |
|
|
34
|
+
* | `ids` | `string[]` | ❌ | Filter by operation IDs. |
|
|
35
|
+
* | `name` | `string` | ❌ | Case-insensitive substring match on Operation name. |
|
|
36
|
+
* | `startDateFrom` | `string` | ❌ | Return Operations starting on or after this ISO date (inclusive). |
|
|
37
|
+
* | `startDateTo` | `string` | ❌ | Return Operations starting on or before this ISO date (inclusive). |
|
|
38
|
+
* | `endDateFrom` | `string` | ❌ | Return Operations ending on or after this ISO date (inclusive). |
|
|
39
|
+
* | `endDateTo` | `string` | ❌ | Return Operations ending on or before this ISO date (inclusive). |
|
|
40
|
+
* | `locale` | `string` | ❌ | Locale to use for localized fields (e.g., `name`). |
|
|
41
|
+
*
|
|
42
|
+
* 📤 **Returns**:
|
|
43
|
+
* A `Promise` resolving to a single `GetShopOperationsResponse` object representing the page of shop operations.
|
|
44
|
+
*
|
|
45
|
+
* 🛠 **Example usage**:
|
|
46
|
+
* ```ts
|
|
47
|
+
* const shopOperations = await getShopOperations({
|
|
48
|
+
* page: 0,
|
|
49
|
+
* size: 10,
|
|
50
|
+
* startDateFrom: "2025-01-01",
|
|
51
|
+
* startDateTo: "2025-12-31",
|
|
52
|
+
* endDateFrom: "2025-01-01",
|
|
53
|
+
* endDateTo: "2025-12-31",
|
|
54
|
+
* locale: "en-US"
|
|
55
|
+
* });
|
|
56
|
+
* ```
|
|
57
|
+
*
|
|
58
|
+
* @param {GetShopOperationsParameters} params - The parameters for retrieving the shop operations.
|
|
59
|
+
* @returns {Promise<GetShopOperationsResponse>} A promise resolving to the response containing page object.
|
|
60
|
+
*/
|
|
61
|
+
async function getShopOperations({ page, size, sort, ids, name, startDateFrom, startDateTo, endDateFrom, endDateTo, locale, }) {
|
|
62
|
+
const { data } = await (0, fetch_instance_1.enhancedFetch)({
|
|
63
|
+
method: "GET",
|
|
64
|
+
path: `/v1/shop/operations`,
|
|
65
|
+
params: {
|
|
66
|
+
page,
|
|
67
|
+
size,
|
|
68
|
+
sort,
|
|
69
|
+
ids,
|
|
70
|
+
name,
|
|
71
|
+
startDateFrom,
|
|
72
|
+
startDateTo,
|
|
73
|
+
endDateFrom,
|
|
74
|
+
endDateTo,
|
|
75
|
+
locale,
|
|
76
|
+
},
|
|
77
|
+
});
|
|
78
|
+
return data;
|
|
79
|
+
}
|
|
19
80
|
/**
|
|
20
81
|
* 🎯 Gets operations.
|
|
21
82
|
*
|
|
@@ -80,6 +141,39 @@ async function getOperations({ page, size, sort, type, status, ids, name, startD
|
|
|
80
141
|
});
|
|
81
142
|
return data;
|
|
82
143
|
}
|
|
144
|
+
/**
|
|
145
|
+
* 🔍 Gets a single shop operation by ID.
|
|
146
|
+
*
|
|
147
|
+
* This function retrieves detailed information about a specific shop operation.
|
|
148
|
+
*
|
|
149
|
+
* 🛠 **Endpoint**: `GET /v1/shop/operations/{operationId}`
|
|
150
|
+
*
|
|
151
|
+
* | Parameter | Type | Required | Description |
|
|
152
|
+
* |------------------------|---------------------|----------|------------------------------------------|
|
|
153
|
+
* | `operationId` | `string` | ✅ | Operation identifier to retrieve. |
|
|
154
|
+
* | `locale` | `string` | ❌ | Locale to use for localized fields (e.g., `name`). |
|
|
155
|
+
*
|
|
156
|
+
* 📤 **Returns**:
|
|
157
|
+
* A `Promise` resolving to a single `GetShopOperationResponse` object containing the operation details.
|
|
158
|
+
*
|
|
159
|
+
* 🛠 **Example usage**:
|
|
160
|
+
* ```ts
|
|
161
|
+
* const operation = await getShopOperation({
|
|
162
|
+
* operationId: "ope_123",
|
|
163
|
+
* locale: "en-US"
|
|
164
|
+
* });
|
|
165
|
+
* ```
|
|
166
|
+
*
|
|
167
|
+
* @param {GetShopOperationParameters} params - The parameters for retrieving the shop operation.
|
|
168
|
+
* @returns {Promise<GetShopOperationResponse>} A promise resolving to the operation details.
|
|
169
|
+
*/
|
|
170
|
+
async function getShopOperation({ operationId, locale, }) {
|
|
171
|
+
const { data } = await (0, fetch_instance_1.enhancedFetch)({
|
|
172
|
+
method: "GET",
|
|
173
|
+
path: `/v1/shop/operations/${operationId}`,
|
|
174
|
+
});
|
|
175
|
+
return data;
|
|
176
|
+
}
|
|
83
177
|
/**
|
|
84
178
|
* 🔍 Gets a single operation by ID.
|
|
85
179
|
*
|
|
@@ -359,6 +453,56 @@ async function removeOperationLines({ operationId, variantIds, }) {
|
|
|
359
453
|
}),
|
|
360
454
|
});
|
|
361
455
|
}
|
|
456
|
+
/**
|
|
457
|
+
* 📦 Gets variants linked to an operation.
|
|
458
|
+
*
|
|
459
|
+
* This function retrieves a paginated list of variants linked to a specific operation
|
|
460
|
+
* with various filtering options including quantity ranges and variant names.
|
|
461
|
+
*
|
|
462
|
+
* 🛠 **Endpoint**: `GET /v1/shop/operations/{operationId}/lines`
|
|
463
|
+
*
|
|
464
|
+
* | Parameter | Type | Required | Description |
|
|
465
|
+
* |------------------------|---------------------|----------|------------------------------------------|
|
|
466
|
+
* | `operationId` | `string` | ✅ | Operation identifier to retrieve lines from. |
|
|
467
|
+
* | `page` | `number` | ❌ | The page number to retrieve (0-based). |
|
|
468
|
+
* | `size` | `number` | ❌ | The number of items per page. |
|
|
469
|
+
* | `sort` | `string[]` | ❌ | The sort to apply to the results. |
|
|
470
|
+
* | `variantIds` | `string[]` | ❌ | Filter by a list of external variant IDs. |
|
|
471
|
+
* | `variantName` | `string` | ❌ | Filter by variant name (case-insensitive, partial or exact match). |
|
|
472
|
+
* | `locale` | `string` | ❌ | Locale to use for localized fields. |
|
|
473
|
+
*
|
|
474
|
+
* 📤 **Returns**:
|
|
475
|
+
* A `Promise` resolving to a single `GetShopOperationLinesResponse` object representing the page of variants.
|
|
476
|
+
*
|
|
477
|
+
* 🛠 **Example usage**:
|
|
478
|
+
* ```ts
|
|
479
|
+
* const variants = await getShopOperationLines({
|
|
480
|
+
* operationId: "ope_123",
|
|
481
|
+
* page: 0,
|
|
482
|
+
* size: 20,
|
|
483
|
+
* variantName: "Shirt",
|
|
484
|
+
* locale: "en-US"
|
|
485
|
+
* });
|
|
486
|
+
* ```
|
|
487
|
+
*
|
|
488
|
+
* @param {GetShopOperationLinesParameters} params - The parameters for the request.
|
|
489
|
+
* @returns {Promise<GetShopOperationLinesResponse>} A promise resolving to the response containing page of variants.
|
|
490
|
+
*/
|
|
491
|
+
async function getShopOperationLines({ operationId, page, size, sort, variantIds, variantName, locale, }) {
|
|
492
|
+
const { data } = await (0, fetch_instance_1.enhancedFetch)({
|
|
493
|
+
method: "GET",
|
|
494
|
+
path: `/v1/shop/operations/${operationId}/lines`,
|
|
495
|
+
params: {
|
|
496
|
+
page,
|
|
497
|
+
size,
|
|
498
|
+
sort,
|
|
499
|
+
variantIds,
|
|
500
|
+
variantName,
|
|
501
|
+
locale,
|
|
502
|
+
},
|
|
503
|
+
});
|
|
504
|
+
return data;
|
|
505
|
+
}
|
|
362
506
|
/**
|
|
363
507
|
* 📦 Gets variants linked to an operation.
|
|
364
508
|
*
|