@djust-b2b/djust-front-sdk 3.1.0 → 3.2.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/dist/.tsbuildinfo +1 -1
- package/dist/.tsbuildinfo-esm +1 -1
- package/dist/client/create-client.d.ts +1 -0
- package/dist/client/create-client.d.ts.map +1 -1
- package/dist/index.d.ts +6 -15
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +43 -433
- package/dist/services/module.d.ts +1 -1
- package/dist/services/module.d.ts.map +1 -1
- package/dist/services/operation/definitions.d.ts +4 -175
- package/dist/services/operation/definitions.d.ts.map +1 -1
- package/dist/services/operation/endpoints.d.ts +1 -5
- package/dist/services/operation/endpoints.d.ts.map +1 -1
- package/dist/services/operation/index.d.ts +12 -510
- package/dist/services/operation/index.d.ts.map +1 -1
- package/dist/services/operation/module.d.ts +1 -1
- package/dist/services/operation/module.d.ts.map +1 -1
- package/dist/services/operation/operation.service.d.ts +34 -16
- package/dist/services/operation/operation.service.d.ts.map +1 -1
- package/dist/services/operation/types.d.ts +1 -106
- package/dist/services/operation/types.d.ts.map +1 -1
- package/dist/settings/sdk-version.d.ts +1 -1
- package/lib/.tsbuildinfo +1 -1
- package/lib/client/create-client.d.ts +1 -0
- package/lib/client/create-client.d.ts.map +1 -1
- package/lib/client/create-client.js +1 -0
- package/lib/client/create-client.js.map +1 -1
- package/lib/index.d.ts +6 -15
- package/lib/index.d.ts.map +1 -1
- package/lib/services/module.d.ts +1 -1
- package/lib/services/module.d.ts.map +1 -1
- package/lib/services/module.js.map +1 -1
- package/lib/services/operation/definitions.d.ts +4 -175
- package/lib/services/operation/definitions.d.ts.map +1 -1
- package/lib/services/operation/definitions.js.map +1 -1
- package/lib/services/operation/endpoints.d.ts +1 -5
- package/lib/services/operation/endpoints.d.ts.map +1 -1
- package/lib/services/operation/endpoints.js +1 -7
- package/lib/services/operation/endpoints.js.map +1 -1
- package/lib/services/operation/index.d.ts +12 -510
- package/lib/services/operation/index.d.ts.map +1 -1
- package/lib/services/operation/index.js +14 -650
- package/lib/services/operation/index.js.map +1 -1
- package/lib/services/operation/module.d.ts +1 -1
- package/lib/services/operation/module.d.ts.map +1 -1
- package/lib/services/operation/module.js.map +1 -1
- package/lib/services/operation/operation.service.d.ts +34 -16
- package/lib/services/operation/operation.service.d.ts.map +1 -1
- package/lib/services/operation/operation.service.js +36 -155
- package/lib/services/operation/operation.service.js.map +1 -1
- package/lib/services/operation/types.d.ts +1 -106
- package/lib/services/operation/types.d.ts.map +1 -1
- package/lib/services/operation/types.js +1 -1
- package/lib/settings/sdk-version.d.ts +1 -1
- package/lib/settings/sdk-version.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/services/operation/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/services/operation/index.ts"],"names":[],"mappings":";;;AAeA,sCA8BC;AAOD,oCAWC;AAOD,8CAuBC;AA7FD,kEAA8D;AAU9D;;;;GAIG;AACI,KAAK,UAAU,aAAa,CAAC,EAClC,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,GAAG,EACH,IAAI,EACJ,aAAa,EACb,WAAW,EACX,WAAW,EACX,SAAS,EACT,MAAM,GACkB;IACxB,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,IAAA,8BAAa,EAAwB;QAC1D,MAAM,EAAE,KAAK;QACb,IAAI,EAAE,qBAAqB;QAC3B,MAAM,EAAE;YACN,IAAI;YACJ,IAAI;YACJ,IAAI;YACJ,GAAG;YACH,IAAI;YACJ,aAAa;YACb,WAAW;YACX,WAAW;YACX,SAAS;YACT,MAAM;SACP;KACF,CAAC,CAAC;IAEH,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;;;GAIG;AACI,KAAK,UAAU,YAAY,CAAC,EACjC,WAAW,EACX,MAAM,GACiB;IACvB,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,IAAA,8BAAa,EAAuB;QACzD,MAAM,EAAE,KAAK;QACb,IAAI,EAAE,uBAAuB,WAAW,EAAE;QAC1C,MAAM,EAAE,EAAE,MAAM,EAAE;KACnB,CAAC,CAAC;IAEH,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;;;GAIG;AACI,KAAK,UAAU,iBAAiB,CAAC,EACtC,WAAW,EACX,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,UAAU,EACV,WAAW,EACX,MAAM,GACsB;IAC5B,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,IAAA,8BAAa,EAA4B;QAC9D,MAAM,EAAE,KAAK;QACb,IAAI,EAAE,uBAAuB,WAAW,QAAQ;QAChD,MAAM,EAAE;YACN,IAAI;YACJ,IAAI;YACJ,IAAI;YACJ,UAAU;YACV,WAAW;YACX,MAAM;SACP;KACF,CAAC,CAAC;IAEH,OAAO,IAAI,CAAC;AACd,CAAC;AAaD,6CAA+D;AAAtD,4GAAA,aAAa,OAAA;AAAE,8GAAA,eAAe,OAAA"}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* @module services/operation
|
|
6
6
|
* @since 2.17.0
|
|
7
7
|
*/
|
|
8
|
-
export type { OperationType, OperationStatus,
|
|
8
|
+
export type { OperationType, OperationStatus, CustomFieldValueRequest, GetOperationsParams, GetOperationParams, GetOperationLinesParams, Operation, OperationLine, GetOperationsResponse, GetOperationResponse, GetOperationLinesResponse, } from "./types";
|
|
9
9
|
export { OperationEndpoints, type OperationEndpoint } from "./endpoints";
|
|
10
10
|
export { OperationService } from "./operation.service";
|
|
11
11
|
//# sourceMappingURL=module.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../../src/services/operation/module.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,YAAY,EACV,aAAa,EACb,eAAe,EACf,
|
|
1
|
+
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../../src/services/operation/module.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,YAAY,EACV,aAAa,EACb,eAAe,EACf,uBAAuB,EACvB,mBAAmB,EACnB,kBAAkB,EAClB,uBAAuB,EACvB,SAAS,EACT,aAAa,EACb,qBAAqB,EACrB,oBAAoB,EACpB,yBAAyB,GAC1B,MAAM,SAAS,CAAC;AAEjB,OAAO,EAAE,kBAAkB,EAAE,KAAK,iBAAiB,EAAE,MAAM,aAAa,CAAC;AACzE,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module.js","sourceRoot":"","sources":["../../../src/services/operation/module.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;
|
|
1
|
+
{"version":3,"file":"module.js","sourceRoot":"","sources":["../../../src/services/operation/module.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAgBH,yCAAyE;AAAhE,+GAAA,kBAAkB,OAAA;AAC3B,yDAAuD;AAA9C,qHAAA,gBAAgB,OAAA"}
|
|
@@ -1,32 +1,50 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
* Service class for operation management.
|
|
2
|
+
* # Operation Service
|
|
4
3
|
*
|
|
4
|
+
* Time-bound assortments of product variants with quantity constraints and scoped
|
|
5
|
+
* visibility (PUBLIC or PRIVATE). Customer users browse active operations via the
|
|
6
|
+
* shop API.
|
|
7
|
+
*
|
|
8
|
+
* @see https://djust-api.readme.io/docs/operations
|
|
5
9
|
* @module services/operation/service
|
|
6
10
|
* @since 2.17.0
|
|
7
11
|
*/
|
|
8
12
|
import { BaseService } from "../base.service";
|
|
9
13
|
import type { RequestContext } from "../../client/transport";
|
|
10
|
-
import type {
|
|
14
|
+
import type { GetOperationsParams, GetOperationParams, GetOperationLinesParams, GetOperationsResponse, GetOperationResponse, GetOperationLinesResponse } from "./types";
|
|
11
15
|
/**
|
|
12
|
-
* Service for operation
|
|
16
|
+
* Service for shop (buyer) operation browsing.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```typescript
|
|
20
|
+
* import { createDjustClient } from '@djust-b2b/djust-front-sdk';
|
|
21
|
+
*
|
|
22
|
+
* const client = createDjustClient({ baseUrl, clientId, apiKey });
|
|
23
|
+
* const sdk = client.withContext({ accessToken, customerAccountId });
|
|
24
|
+
*
|
|
25
|
+
* const { content } = await sdk.getOperations({ locale: 'fr-FR', page: 0, size: 10 });
|
|
26
|
+
* await sdk.createCommercialOrderV2({ operationId: content[0].id });
|
|
27
|
+
* ```
|
|
13
28
|
*/
|
|
14
29
|
export declare class OperationService extends BaseService {
|
|
15
30
|
readonly serviceName = "operation";
|
|
16
|
-
|
|
31
|
+
/**
|
|
32
|
+
* List ACTIVE operations visible to the caller on the effective store.
|
|
33
|
+
*
|
|
34
|
+
* **Endpoint**: `GET /v1/shop/operations [OPERATION-550]`
|
|
35
|
+
*/
|
|
17
36
|
getOperations(params?: GetOperationsParams, context?: RequestContext): Promise<GetOperationsResponse>;
|
|
18
|
-
|
|
37
|
+
/**
|
|
38
|
+
* Get a single operation visible to the caller (metadata only).
|
|
39
|
+
*
|
|
40
|
+
* **Endpoint**: `GET /v1/shop/operations/{operationId} [OPERATION-500]`
|
|
41
|
+
*/
|
|
19
42
|
getOperation(params: GetOperationParams, context?: RequestContext): Promise<GetOperationResponse>;
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
addOperationAccounts(params: AddOperationAccountsParams, context?: RequestContext): Promise<void>;
|
|
26
|
-
removeOperationAccounts(params: RemoveOperationAccountsParams, context?: RequestContext): Promise<void>;
|
|
27
|
-
getShopOperationLines(params: GetShopOperationLinesParams, context?: RequestContext): Promise<GetShopOperationLinesResponse>;
|
|
43
|
+
/**
|
|
44
|
+
* List product variant lines for a shop operation.
|
|
45
|
+
*
|
|
46
|
+
* **Endpoint**: `GET /v1/shop/operations/{operationId}/lines [OPERATION-551]`
|
|
47
|
+
*/
|
|
28
48
|
getOperationLines(params: GetOperationLinesParams, context?: RequestContext): Promise<GetOperationLinesResponse>;
|
|
29
|
-
addOperationLines(params: AddOperationLinesParams, context?: RequestContext): Promise<void>;
|
|
30
|
-
removeOperationLines(params: RemoveOperationLinesParams, context?: RequestContext): Promise<void>;
|
|
31
49
|
}
|
|
32
50
|
//# sourceMappingURL=operation.service.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operation.service.d.ts","sourceRoot":"","sources":["../../../src/services/operation/operation.service.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"operation.service.d.ts","sourceRoot":"","sources":["../../../src/services/operation/operation.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAE7D,OAAO,KAAK,EACV,mBAAmB,EACnB,kBAAkB,EAClB,uBAAuB,EACvB,qBAAqB,EACrB,oBAAoB,EACpB,yBAAyB,EAC1B,MAAM,SAAS,CAAC;AAEjB;;;;;;;;;;;;;GAaG;AACH,qBAAa,gBAAiB,SAAQ,WAAW;IAC/C,QAAQ,CAAC,WAAW,eAAe;IAEnC;;;;OAIG;IACG,aAAa,CACjB,MAAM,GAAE,mBAAwB,EAChC,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,qBAAqB,CAAC;IAWjC;;;;OAIG;IACG,YAAY,CAChB,MAAM,EAAE,kBAAkB,EAC1B,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,oBAAoB,CAAC;IAehC;;;;OAIG;IACG,iBAAiB,CACrB,MAAM,EAAE,uBAAuB,EAC/B,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,yBAAyB,CAAC;CAqBtC"}
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
* Service class for operation management.
|
|
3
|
+
* # Operation Service
|
|
5
4
|
*
|
|
5
|
+
* Time-bound assortments of product variants with quantity constraints and scoped
|
|
6
|
+
* visibility (PUBLIC or PRIVATE). Customer users browse active operations via the
|
|
7
|
+
* shop API.
|
|
8
|
+
*
|
|
9
|
+
* @see https://djust-api.readme.io/docs/operations
|
|
6
10
|
* @module services/operation/service
|
|
7
11
|
* @since 2.17.0
|
|
8
12
|
*/
|
|
@@ -11,28 +15,42 @@ exports.OperationService = void 0;
|
|
|
11
15
|
const base_service_1 = require("../base.service");
|
|
12
16
|
const endpoints_1 = require("./endpoints");
|
|
13
17
|
/**
|
|
14
|
-
* Service for operation
|
|
18
|
+
* Service for shop (buyer) operation browsing.
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```typescript
|
|
22
|
+
* import { createDjustClient } from '@djust-b2b/djust-front-sdk';
|
|
23
|
+
*
|
|
24
|
+
* const client = createDjustClient({ baseUrl, clientId, apiKey });
|
|
25
|
+
* const sdk = client.withContext({ accessToken, customerAccountId });
|
|
26
|
+
*
|
|
27
|
+
* const { content } = await sdk.getOperations({ locale: 'fr-FR', page: 0, size: 10 });
|
|
28
|
+
* await sdk.createCommercialOrderV2({ operationId: content[0].id });
|
|
29
|
+
* ```
|
|
15
30
|
*/
|
|
16
31
|
class OperationService extends base_service_1.BaseService {
|
|
17
32
|
constructor() {
|
|
18
33
|
super(...arguments);
|
|
19
34
|
this.serviceName = "operation";
|
|
20
35
|
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}, context);
|
|
27
|
-
}
|
|
36
|
+
/**
|
|
37
|
+
* List ACTIVE operations visible to the caller on the effective store.
|
|
38
|
+
*
|
|
39
|
+
* **Endpoint**: `GET /v1/shop/operations [OPERATION-550]`
|
|
40
|
+
*/
|
|
28
41
|
async getOperations(params = {}, context) {
|
|
29
42
|
return this.request({
|
|
30
43
|
method: "GET",
|
|
31
|
-
path: endpoints_1.OperationEndpoints.
|
|
44
|
+
path: endpoints_1.OperationEndpoints.SHOP_OPERATIONS,
|
|
32
45
|
params: this.buildParams(params),
|
|
33
46
|
}, context);
|
|
34
47
|
}
|
|
35
|
-
|
|
48
|
+
/**
|
|
49
|
+
* Get a single operation visible to the caller (metadata only).
|
|
50
|
+
*
|
|
51
|
+
* **Endpoint**: `GET /v1/shop/operations/{operationId} [OPERATION-500]`
|
|
52
|
+
*/
|
|
53
|
+
async getOperation(params, context) {
|
|
36
54
|
this.required(params, ["operationId"]);
|
|
37
55
|
return this.request({
|
|
38
56
|
method: "GET",
|
|
@@ -42,130 +60,16 @@ class OperationService extends base_service_1.BaseService {
|
|
|
42
60
|
params: this.buildParams({ locale: params.locale }),
|
|
43
61
|
}, context);
|
|
44
62
|
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
operationId: params.operationId,
|
|
51
|
-
}),
|
|
52
|
-
}, context);
|
|
53
|
-
}
|
|
54
|
-
async createOperation(params, context) {
|
|
55
|
-
this.required(params, [
|
|
56
|
-
"externalId",
|
|
57
|
-
"names",
|
|
58
|
-
"startDate",
|
|
59
|
-
"endDate",
|
|
60
|
-
"type",
|
|
61
|
-
]);
|
|
62
|
-
return this.request({
|
|
63
|
-
method: "POST",
|
|
64
|
-
path: endpoints_1.OperationEndpoints.OPERATIONS,
|
|
65
|
-
body: {
|
|
66
|
-
customFieldValues: params.customFieldValues,
|
|
67
|
-
descriptions: params.descriptions,
|
|
68
|
-
endDate: params.endDate,
|
|
69
|
-
externalId: params.externalId,
|
|
70
|
-
names: params.names,
|
|
71
|
-
startDate: params.startDate,
|
|
72
|
-
type: params.type,
|
|
73
|
-
},
|
|
74
|
-
}, context);
|
|
75
|
-
}
|
|
76
|
-
async updateOperation(params, context) {
|
|
77
|
-
this.required(params, ["operationId", "status"]);
|
|
78
|
-
await this.request({
|
|
79
|
-
method: "PATCH",
|
|
80
|
-
path: this.buildPath(endpoints_1.OperationEndpoints.OPERATION, {
|
|
81
|
-
operationId: params.operationId,
|
|
82
|
-
}),
|
|
83
|
-
body: { status: params.status },
|
|
84
|
-
}, context);
|
|
85
|
-
}
|
|
86
|
-
async updateOperationDetails(params, context) {
|
|
87
|
-
this.required(params, ["operationId"]);
|
|
88
|
-
return this.request({
|
|
89
|
-
method: "PUT",
|
|
90
|
-
path: this.buildPath(endpoints_1.OperationEndpoints.OPERATION, {
|
|
91
|
-
operationId: params.operationId,
|
|
92
|
-
}),
|
|
93
|
-
body: {
|
|
94
|
-
customFieldValues: params.customFieldValues,
|
|
95
|
-
descriptions: params.descriptions,
|
|
96
|
-
endDate: params.endDate,
|
|
97
|
-
names: params.names,
|
|
98
|
-
startDate: params.startDate,
|
|
99
|
-
},
|
|
100
|
-
}, context);
|
|
101
|
-
}
|
|
102
|
-
async deleteOperation(params, context) {
|
|
103
|
-
this.required(params, ["operationId"]);
|
|
104
|
-
await this.request({
|
|
105
|
-
method: "DELETE",
|
|
106
|
-
path: this.buildPath(endpoints_1.OperationEndpoints.OPERATION, {
|
|
107
|
-
operationId: params.operationId,
|
|
108
|
-
}),
|
|
109
|
-
}, context);
|
|
110
|
-
}
|
|
111
|
-
async getOperationAccounts(params, context) {
|
|
112
|
-
this.required(params, ["operationId"]);
|
|
113
|
-
return this.request({
|
|
114
|
-
method: "GET",
|
|
115
|
-
path: this.buildPath(endpoints_1.OperationEndpoints.OPERATION_ACCOUNTS, {
|
|
116
|
-
operationId: params.operationId,
|
|
117
|
-
}),
|
|
118
|
-
params: this.buildParams({
|
|
119
|
-
page: params.page,
|
|
120
|
-
size: params.size,
|
|
121
|
-
sort: params.sort,
|
|
122
|
-
accountIds: params.accountIds,
|
|
123
|
-
accountName: params.accountName,
|
|
124
|
-
}),
|
|
125
|
-
}, context);
|
|
126
|
-
}
|
|
127
|
-
async addOperationAccounts(params, context) {
|
|
128
|
-
this.required(params, ["operationId", "accountIds"]);
|
|
129
|
-
await this.request({
|
|
130
|
-
method: "PUT",
|
|
131
|
-
path: this.buildPath(endpoints_1.OperationEndpoints.OPERATION_ACCOUNTS, {
|
|
132
|
-
operationId: params.operationId,
|
|
133
|
-
}),
|
|
134
|
-
body: { accountIds: params.accountIds },
|
|
135
|
-
}, context);
|
|
136
|
-
}
|
|
137
|
-
async removeOperationAccounts(params, context) {
|
|
138
|
-
this.required(params, ["operationId", "accountIds"]);
|
|
139
|
-
await this.request({
|
|
140
|
-
method: "DELETE",
|
|
141
|
-
path: this.buildPath(endpoints_1.OperationEndpoints.OPERATION_ACCOUNTS, {
|
|
142
|
-
operationId: params.operationId,
|
|
143
|
-
}),
|
|
144
|
-
body: { accountIds: params.accountIds },
|
|
145
|
-
}, context);
|
|
146
|
-
}
|
|
147
|
-
async getShopOperationLines(params, context) {
|
|
148
|
-
this.required(params, ["operationId"]);
|
|
149
|
-
return this.request({
|
|
150
|
-
method: "GET",
|
|
151
|
-
path: this.buildPath(endpoints_1.OperationEndpoints.SHOP_OPERATION_LINES, {
|
|
152
|
-
operationId: params.operationId,
|
|
153
|
-
}),
|
|
154
|
-
params: this.buildParams({
|
|
155
|
-
page: params.page,
|
|
156
|
-
size: params.size,
|
|
157
|
-
sort: params.sort,
|
|
158
|
-
variantIds: params.variantIds,
|
|
159
|
-
variantName: params.variantName,
|
|
160
|
-
locale: params.locale,
|
|
161
|
-
}),
|
|
162
|
-
}, context);
|
|
163
|
-
}
|
|
63
|
+
/**
|
|
64
|
+
* List product variant lines for a shop operation.
|
|
65
|
+
*
|
|
66
|
+
* **Endpoint**: `GET /v1/shop/operations/{operationId}/lines [OPERATION-551]`
|
|
67
|
+
*/
|
|
164
68
|
async getOperationLines(params, context) {
|
|
165
69
|
this.required(params, ["operationId"]);
|
|
166
70
|
return this.request({
|
|
167
71
|
method: "GET",
|
|
168
|
-
path: this.buildPath(endpoints_1.OperationEndpoints.
|
|
72
|
+
path: this.buildPath(endpoints_1.OperationEndpoints.SHOP_OPERATION_LINES, {
|
|
169
73
|
operationId: params.operationId,
|
|
170
74
|
}),
|
|
171
75
|
params: this.buildParams({
|
|
@@ -174,33 +78,10 @@ class OperationService extends base_service_1.BaseService {
|
|
|
174
78
|
sort: params.sort,
|
|
175
79
|
variantIds: params.variantIds,
|
|
176
80
|
variantName: params.variantName,
|
|
177
|
-
minQuantity: params.minQuantity,
|
|
178
|
-
maxQuantity: params.maxQuantity,
|
|
179
|
-
recommendedQuantity: params.recommendedQuantity,
|
|
180
81
|
locale: params.locale,
|
|
181
82
|
}),
|
|
182
83
|
}, context);
|
|
183
84
|
}
|
|
184
|
-
async addOperationLines(params, context) {
|
|
185
|
-
this.required(params, ["operationId", "lines"]);
|
|
186
|
-
await this.request({
|
|
187
|
-
method: "PUT",
|
|
188
|
-
path: this.buildPath(endpoints_1.OperationEndpoints.OPERATION_LINES, {
|
|
189
|
-
operationId: params.operationId,
|
|
190
|
-
}),
|
|
191
|
-
body: params.lines,
|
|
192
|
-
}, context);
|
|
193
|
-
}
|
|
194
|
-
async removeOperationLines(params, context) {
|
|
195
|
-
this.required(params, ["operationId", "variantIds"]);
|
|
196
|
-
await this.request({
|
|
197
|
-
method: "DELETE",
|
|
198
|
-
path: this.buildPath(endpoints_1.OperationEndpoints.OPERATION_LINES, {
|
|
199
|
-
operationId: params.operationId,
|
|
200
|
-
}),
|
|
201
|
-
body: { variantIds: params.variantIds },
|
|
202
|
-
}, context);
|
|
203
|
-
}
|
|
204
85
|
}
|
|
205
86
|
exports.OperationService = OperationService;
|
|
206
87
|
//# sourceMappingURL=operation.service.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operation.service.js","sourceRoot":"","sources":["../../../src/services/operation/operation.service.ts"],"names":[],"mappings":";AAAA
|
|
1
|
+
{"version":3,"file":"operation.service.js","sourceRoot":"","sources":["../../../src/services/operation/operation.service.ts"],"names":[],"mappings":";AAAA;;;;;;;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AAI,EAAE,MAAM,CAAC,IAAI;gBACjB,IAAI,EAAE,MAAM,CAAC,IAAI;gBACjB,IAAI,EAAE,MAAM,CAAC,IAAI;gBACjB,UAAU,EAAE,MAAM,CAAC,UAAU;gBAC7B,WAAW,EAAE,MAAM,CAAC,WAAW;gBAC/B,MAAM,EAAE,MAAM,CAAC,MAAM;aACtB,CAAC;SACH,EACD,OAAO,CACR,CAAC;IACJ,CAAC;CACF;AA1ED,4CA0EC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* DJUST SDK Operation Service - Types
|
|
3
|
-
* Type definitions for operation
|
|
3
|
+
* Type definitions for shop (buyer) operation APIs.
|
|
4
4
|
*
|
|
5
5
|
* @module services/operation/types
|
|
6
6
|
* @since 2.17.0
|
|
@@ -8,99 +8,24 @@
|
|
|
8
8
|
import type { PaginatedResponse } from "../types";
|
|
9
9
|
export type OperationType = "PUBLIC" | "PRIVATE";
|
|
10
10
|
export type OperationStatus = "DRAFT" | "ACTIVE" | "INACTIVE";
|
|
11
|
-
export type IdType = "DJUST_ID" | "EXTERNAL_ID";
|
|
12
11
|
export interface CustomFieldValueRequest {
|
|
13
12
|
customFieldId: string;
|
|
14
13
|
customFieldValue?: string;
|
|
15
14
|
}
|
|
16
|
-
export interface OperationLineRequest {
|
|
17
|
-
variantId: string;
|
|
18
|
-
minQuantity: number;
|
|
19
|
-
maxQuantity: number;
|
|
20
|
-
recommendedQuantity: number;
|
|
21
|
-
}
|
|
22
|
-
export interface GetShopOperationsParams {
|
|
23
|
-
page?: number;
|
|
24
|
-
size?: number;
|
|
25
|
-
sort?: string[];
|
|
26
|
-
ids?: string[];
|
|
27
|
-
name?: string;
|
|
28
|
-
startDateFrom?: string;
|
|
29
|
-
startDateTo?: string;
|
|
30
|
-
endDateFrom?: string;
|
|
31
|
-
endDateTo?: string;
|
|
32
|
-
locale?: string;
|
|
33
|
-
}
|
|
34
15
|
export interface GetOperationsParams {
|
|
35
16
|
page?: number;
|
|
36
17
|
size?: number;
|
|
37
18
|
sort?: string[];
|
|
38
|
-
type?: OperationType;
|
|
39
|
-
status?: OperationStatus;
|
|
40
19
|
ids?: string[];
|
|
41
20
|
name?: string;
|
|
42
21
|
startDateFrom?: string;
|
|
43
22
|
startDateTo?: string;
|
|
44
23
|
endDateFrom?: string;
|
|
45
24
|
endDateTo?: string;
|
|
46
|
-
ownerIds?: string[];
|
|
47
|
-
idType?: IdType;
|
|
48
|
-
locale?: string;
|
|
49
|
-
}
|
|
50
|
-
export interface GetShopOperationParams {
|
|
51
|
-
operationId: string;
|
|
52
25
|
locale?: string;
|
|
53
26
|
}
|
|
54
27
|
export interface GetOperationParams {
|
|
55
28
|
operationId: string;
|
|
56
|
-
}
|
|
57
|
-
export interface CreateOperationParams {
|
|
58
|
-
externalId: string;
|
|
59
|
-
names: string;
|
|
60
|
-
startDate: string;
|
|
61
|
-
endDate: string;
|
|
62
|
-
type: OperationType;
|
|
63
|
-
customFieldValues?: CustomFieldValueRequest[];
|
|
64
|
-
descriptions?: string;
|
|
65
|
-
}
|
|
66
|
-
export interface UpdateOperationParams {
|
|
67
|
-
operationId: string;
|
|
68
|
-
status: OperationStatus;
|
|
69
|
-
}
|
|
70
|
-
export interface UpdateOperationDetailsParams {
|
|
71
|
-
operationId: string;
|
|
72
|
-
customFieldValues?: CustomFieldValueRequest[];
|
|
73
|
-
descriptions?: string;
|
|
74
|
-
endDate?: string;
|
|
75
|
-
names?: string;
|
|
76
|
-
startDate?: string;
|
|
77
|
-
}
|
|
78
|
-
export interface DeleteOperationParams {
|
|
79
|
-
operationId: string;
|
|
80
|
-
}
|
|
81
|
-
export interface GetOperationAccountsParams {
|
|
82
|
-
operationId: string;
|
|
83
|
-
page?: number;
|
|
84
|
-
size?: number;
|
|
85
|
-
sort?: string[];
|
|
86
|
-
accountIds?: string[];
|
|
87
|
-
accountName?: string;
|
|
88
|
-
}
|
|
89
|
-
export interface AddOperationAccountsParams {
|
|
90
|
-
operationId: string;
|
|
91
|
-
accountIds: string[];
|
|
92
|
-
}
|
|
93
|
-
export interface RemoveOperationAccountsParams {
|
|
94
|
-
operationId: string;
|
|
95
|
-
accountIds: string[];
|
|
96
|
-
}
|
|
97
|
-
export interface GetShopOperationLinesParams {
|
|
98
|
-
operationId: string;
|
|
99
|
-
page?: number;
|
|
100
|
-
size?: number;
|
|
101
|
-
sort?: string[];
|
|
102
|
-
variantIds?: string[];
|
|
103
|
-
variantName?: string;
|
|
104
29
|
locale?: string;
|
|
105
30
|
}
|
|
106
31
|
export interface GetOperationLinesParams {
|
|
@@ -110,19 +35,8 @@ export interface GetOperationLinesParams {
|
|
|
110
35
|
sort?: string[];
|
|
111
36
|
variantIds?: string[];
|
|
112
37
|
variantName?: string;
|
|
113
|
-
minQuantity?: number;
|
|
114
|
-
maxQuantity?: number;
|
|
115
|
-
recommendedQuantity?: number;
|
|
116
38
|
locale?: string;
|
|
117
39
|
}
|
|
118
|
-
export interface AddOperationLinesParams {
|
|
119
|
-
operationId: string;
|
|
120
|
-
lines: OperationLineRequest[];
|
|
121
|
-
}
|
|
122
|
-
export interface RemoveOperationLinesParams {
|
|
123
|
-
operationId: string;
|
|
124
|
-
variantIds: string[];
|
|
125
|
-
}
|
|
126
40
|
export interface Operation {
|
|
127
41
|
id: string;
|
|
128
42
|
externalId?: string;
|
|
@@ -137,11 +51,6 @@ export interface Operation {
|
|
|
137
51
|
createdAt: string;
|
|
138
52
|
updatedAt: string;
|
|
139
53
|
}
|
|
140
|
-
export interface OperationAccount {
|
|
141
|
-
id: string;
|
|
142
|
-
externalId?: string;
|
|
143
|
-
name: string;
|
|
144
|
-
}
|
|
145
54
|
export interface OperationLine {
|
|
146
55
|
id: string;
|
|
147
56
|
variantId: string;
|
|
@@ -151,24 +60,10 @@ export interface OperationLine {
|
|
|
151
60
|
maxQuantity: number;
|
|
152
61
|
recommendedQuantity: number;
|
|
153
62
|
}
|
|
154
|
-
export interface GetShopOperationsResponse extends PaginatedResponse<Operation> {
|
|
155
|
-
}
|
|
156
63
|
export interface GetOperationsResponse extends PaginatedResponse<Operation> {
|
|
157
64
|
}
|
|
158
|
-
export interface GetShopOperationResponse extends Operation {
|
|
159
|
-
}
|
|
160
65
|
export interface GetOperationResponse extends Operation {
|
|
161
66
|
}
|
|
162
|
-
export interface CreateOperationResponse {
|
|
163
|
-
id: string;
|
|
164
|
-
}
|
|
165
|
-
export interface UpdateOperationDetailsResponse {
|
|
166
|
-
id: string;
|
|
167
|
-
}
|
|
168
|
-
export interface GetOperationAccountsResponse extends PaginatedResponse<OperationAccount> {
|
|
169
|
-
}
|
|
170
|
-
export interface GetShopOperationLinesResponse extends PaginatedResponse<OperationLine> {
|
|
171
|
-
}
|
|
172
67
|
export interface GetOperationLinesResponse extends PaginatedResponse<OperationLine> {
|
|
173
68
|
}
|
|
174
69
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/services/operation/types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/services/operation/types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAMlD,MAAM,MAAM,aAAa,GAAG,QAAQ,GAAG,SAAS,CAAC;AACjD,MAAM,MAAM,eAAe,GAAG,OAAO,GAAG,QAAQ,GAAG,UAAU,CAAC;AAE9D,MAAM,WAAW,uBAAuB;IACtC,aAAa,EAAE,MAAM,CAAC;IACtB,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAMD,MAAM,WAAW,mBAAmB;IAClC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,GAAG,CAAC,EAAE,MAAM,E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AW,EAAE,MAAM,CAAC;IACpB,mBAAmB,EAAE,MAAM,CAAC;CAC7B;AAED,MAAM,WAAW,qBAAsB,SAAQ,iBAAiB,CAAC,SAAS,CAAC;CAAG;AAC9E,MAAM,WAAW,oBAAqB,SAAQ,SAAS;CAAG;AAC1D,MAAM,WAAW,yBACf,SAAQ,iBAAiB,CAAC,aAAa,CAAC;CAAG"}
|
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.SDK_VERSION = void 0;
|
|
4
4
|
/** Auto-generated by scripts/sync-sdk-version.js — do not edit */
|
|
5
|
-
exports.SDK_VERSION = "3.
|
|
5
|
+
exports.SDK_VERSION = "3.2.0";
|
|
6
6
|
//# sourceMappingURL=sdk-version.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@djust-b2b/djust-front-sdk",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.2.0",
|
|
4
4
|
"description": "DJUST Front SDK - Universal TypeScript SDK for DJUST B2B API. SSR-safe, type-safe, production-ready.",
|
|
5
5
|
"main": "./dist/index.cjs",
|
|
6
6
|
"module": "./dist/index.mjs",
|