@longvansoftware/service-js-client 2.8.9 → 2.9.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/src/graphql/campaign/queries.d.ts +11 -13
- package/dist/src/graphql/campaign/queries.js +111 -39
- package/dist/src/graphql/cloudCloud/mutations.d.ts +0 -2
- package/dist/src/graphql/cloudCloud/mutations.js +27 -101
- package/dist/src/graphql/cloudCloud/queries.js +0 -4
- package/dist/src/graphql/computing/queries.d.ts +1 -0
- package/dist/src/graphql/computing/queries.js +6 -1
- package/dist/src/graphql/crm/queries.d.ts +1 -0
- package/dist/src/graphql/crm/queries.js +20 -1
- package/dist/src/graphql/orderCloud/mutations.d.ts +1 -3
- package/dist/src/graphql/orderCloud/mutations.js +5 -21
- package/dist/src/graphql/paymentV2/mutations.d.ts +0 -1
- package/dist/src/graphql/paymentV2/mutations.js +37 -23
- package/dist/src/graphql/paymentV2/queries.d.ts +0 -2
- package/dist/src/graphql/paymentV2/queries.js +1 -58
- package/dist/src/lib/campaign/index.d.ts +0 -1
- package/dist/src/lib/campaign/index.js +12 -69
- package/dist/src/lib/cloudCloud/index.d.ts +0 -1
- package/dist/src/lib/cloudCloud/index.js +0 -16
- package/dist/src/lib/computing/index.d.ts +1 -0
- package/dist/src/lib/computing/index.js +16 -0
- package/dist/src/lib/crm/index.d.ts +1 -0
- package/dist/src/lib/crm/index.js +17 -0
- package/dist/src/lib/orderCloud/index.d.ts +0 -2
- package/dist/src/lib/orderCloud/index.js +1 -47
- package/dist/src/lib/paymentV2/index.d.ts +1 -11
- package/dist/src/lib/paymentV2/index.js +14 -55
- package/dist/src/lib/portal/index.d.ts +2 -10
- package/dist/src/lib/portal/index.js +11 -171
- package/dist/src/lib/service.d.ts +14 -0
- package/dist/src/lib/service.js +101 -0
- package/dist/src/utils/build-field-string.d.ts +1 -0
- package/dist/src/utils/build-field-string.js +16 -0
- package/package.json +1 -1
- package/dist/src/graphql/storefont/mutation.d.ts +0 -4
- package/dist/src/graphql/storefont/mutation.js +0 -56
- package/dist/src/graphql/storefont/queries.d.ts +0 -5
- package/dist/src/graphql/storefont/queries.js +0 -106
- package/dist/src/graphql/tag/mutations.d.ts +0 -2
- package/dist/src/graphql/tag/mutations.js +0 -44
- package/dist/src/graphql/tag/queries.d.ts +0 -1
- package/dist/src/graphql/tag/queries.js +0 -20
- package/dist/src/lib/imageGateway/index.d.ts +0 -6
- package/dist/src/lib/imageGateway/index.js +0 -18
- package/dist/src/lib/storefont/index.d.ts +0 -23
- package/dist/src/lib/storefont/index.js +0 -160
- package/dist/src/lib/tag/index.d.ts +0 -7
- package/dist/src/lib/tag/index.js +0 -61
|
@@ -77,6 +77,14 @@ class PortalService extends serviceSDK_1.Service {
|
|
|
77
77
|
const url = `${this.endpoint}/facility/manager/session/inventory-item-by-product.xhtml?${sku ? `sku=${sku}` : `id=${id}`}&orgId=${this.orgId}`;
|
|
78
78
|
return url;
|
|
79
79
|
}
|
|
80
|
+
imageProduct(parentId, parentType, width, height) {
|
|
81
|
+
const url = `${this.endpoint}/image-gateway/public/image/${parentType}/${parentId}${width ? `?w=${width}` : ``}${`${height ? `&h=${height}` : ``}`} `;
|
|
82
|
+
return url;
|
|
83
|
+
}
|
|
84
|
+
imagesProduct(parentId, parentType, width, height) {
|
|
85
|
+
const url = `${this.endpoint}/image-gateway/public/images/${parentType}/${parentId}?w=${width}&h=${height}`;
|
|
86
|
+
return url;
|
|
87
|
+
}
|
|
80
88
|
completeOrder(orderId, byUser) {
|
|
81
89
|
return __awaiter(this, void 0, void 0, function* () {
|
|
82
90
|
const endpoint = `/fulfillment-api/public/fulfillment/${this.orgId}/${orderId}/complete-fulfillment/${byUser}`;
|
|
@@ -149,7 +157,7 @@ class PortalService extends serviceSDK_1.Service {
|
|
|
149
157
|
const endpoint = `/fulfillment-api/public/fulfillment/${this.orgId}/packageBoxes`;
|
|
150
158
|
const method = "GET";
|
|
151
159
|
try {
|
|
152
|
-
const response = yield this.
|
|
160
|
+
const response = yield this.restApiCallWithNoHeader(endpoint, method);
|
|
153
161
|
return response;
|
|
154
162
|
}
|
|
155
163
|
catch (error) {
|
|
@@ -162,7 +170,7 @@ class PortalService extends serviceSDK_1.Service {
|
|
|
162
170
|
const endpoint = `/fulfillment-api/public/fulfillment/${this.orgId}/${orderId}/shipment-parameters`;
|
|
163
171
|
const method = "GET";
|
|
164
172
|
try {
|
|
165
|
-
const response = yield this.
|
|
173
|
+
const response = yield this.restApiCallWithNoHeader(endpoint, method);
|
|
166
174
|
return response;
|
|
167
175
|
}
|
|
168
176
|
catch (error) {
|
|
@@ -191,7 +199,7 @@ class PortalService extends serviceSDK_1.Service {
|
|
|
191
199
|
const endpoint = `/fulfillment-api/public/fulfillment/${this.orgId}/${orderId}/fulfillment-stage`;
|
|
192
200
|
const method = "GET";
|
|
193
201
|
try {
|
|
194
|
-
const response = yield this.
|
|
202
|
+
const response = yield this.restApiCallWithNoHeader(endpoint, method);
|
|
195
203
|
return response;
|
|
196
204
|
}
|
|
197
205
|
catch (error) {
|
|
@@ -444,173 +452,5 @@ class PortalService extends serviceSDK_1.Service {
|
|
|
444
452
|
}
|
|
445
453
|
});
|
|
446
454
|
}
|
|
447
|
-
getSlugPathFromDynamicFrom(query) {
|
|
448
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
449
|
-
const method = "GET";
|
|
450
|
-
const baseUrl = `/dynamic-collection/public/v2/records/slug_path/slug_path_view`;
|
|
451
|
-
const params = new URLSearchParams();
|
|
452
|
-
if (query) {
|
|
453
|
-
Object.entries(query).forEach(([key, value]) => {
|
|
454
|
-
if (value !== undefined && value !== null) {
|
|
455
|
-
params.append(key, String(value));
|
|
456
|
-
}
|
|
457
|
-
});
|
|
458
|
-
}
|
|
459
|
-
const endpoint = params.toString()
|
|
460
|
-
? `${baseUrl}?${params.toString()}`
|
|
461
|
-
: baseUrl;
|
|
462
|
-
try {
|
|
463
|
-
const response = yield this.restApiCallWithNoToken(endpoint, method);
|
|
464
|
-
return response;
|
|
465
|
-
}
|
|
466
|
-
catch (error) {
|
|
467
|
-
throw error;
|
|
468
|
-
}
|
|
469
|
-
});
|
|
470
|
-
}
|
|
471
|
-
putSlugPathFromDynamicFrom(data) {
|
|
472
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
473
|
-
const method = "PUT";
|
|
474
|
-
const endpoint = `/dynamic-collection/public/v2/records/slug_path/slug_path_form`;
|
|
475
|
-
try {
|
|
476
|
-
const response = yield this.restApiCallWithNoToken(endpoint, method, data);
|
|
477
|
-
return response;
|
|
478
|
-
}
|
|
479
|
-
catch (error) {
|
|
480
|
-
throw error;
|
|
481
|
-
}
|
|
482
|
-
});
|
|
483
|
-
}
|
|
484
|
-
postSlugPathFromDynamicFrom(data) {
|
|
485
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
486
|
-
const method = "POST";
|
|
487
|
-
const endpoint = `/dynamic-collection/public/v2/records/slug_path/slug_path_form`;
|
|
488
|
-
try {
|
|
489
|
-
const response = yield this.restApiCallWithNoHeader(endpoint, method, data);
|
|
490
|
-
return response;
|
|
491
|
-
}
|
|
492
|
-
catch (error) {
|
|
493
|
-
throw error;
|
|
494
|
-
}
|
|
495
|
-
});
|
|
496
|
-
}
|
|
497
|
-
getExamGroupTimeSlots(query) {
|
|
498
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
499
|
-
const method = "GET";
|
|
500
|
-
const baseUrl = `/dynamic-collection/public/v2/exam-group/time-slots`;
|
|
501
|
-
const params = new URLSearchParams();
|
|
502
|
-
if (query) {
|
|
503
|
-
Object.entries(query).forEach(([key, value]) => {
|
|
504
|
-
if (value !== undefined && value !== null) {
|
|
505
|
-
params.append(key, String(value));
|
|
506
|
-
}
|
|
507
|
-
});
|
|
508
|
-
}
|
|
509
|
-
const endpoint = params.toString()
|
|
510
|
-
? `${baseUrl}?${params.toString()}`
|
|
511
|
-
: baseUrl;
|
|
512
|
-
try {
|
|
513
|
-
const response = yield this.restApiCallWithNoToken(endpoint, method);
|
|
514
|
-
return response;
|
|
515
|
-
}
|
|
516
|
-
catch (error) {
|
|
517
|
-
throw error;
|
|
518
|
-
}
|
|
519
|
-
});
|
|
520
|
-
}
|
|
521
|
-
getExamGroupExecutionDates(query) {
|
|
522
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
523
|
-
const method = "GET";
|
|
524
|
-
const baseUrl = `/dynamic-collection/public/v2/exam-group/execution-dates`;
|
|
525
|
-
const params = new URLSearchParams();
|
|
526
|
-
if (query) {
|
|
527
|
-
Object.entries(query).forEach(([key, value]) => {
|
|
528
|
-
if (value !== undefined && value !== null) {
|
|
529
|
-
params.append(key, String(value));
|
|
530
|
-
}
|
|
531
|
-
});
|
|
532
|
-
}
|
|
533
|
-
const endpoint = params.toString()
|
|
534
|
-
? `${baseUrl}?${params.toString()}`
|
|
535
|
-
: baseUrl;
|
|
536
|
-
try {
|
|
537
|
-
const response = yield this.restApiCallWithNoToken(endpoint, method);
|
|
538
|
-
return response;
|
|
539
|
-
}
|
|
540
|
-
catch (error) {
|
|
541
|
-
throw error;
|
|
542
|
-
}
|
|
543
|
-
});
|
|
544
|
-
}
|
|
545
|
-
getExamGroupExecutionLocations(query) {
|
|
546
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
547
|
-
const method = "GET";
|
|
548
|
-
const baseUrl = `/dynamic-collection/public/v2/exam-group/execution-locations`;
|
|
549
|
-
const params = new URLSearchParams();
|
|
550
|
-
if (query) {
|
|
551
|
-
Object.entries(query).forEach(([key, value]) => {
|
|
552
|
-
if (value !== undefined && value !== null) {
|
|
553
|
-
params.append(key, String(value));
|
|
554
|
-
}
|
|
555
|
-
});
|
|
556
|
-
}
|
|
557
|
-
const endpoint = params.toString()
|
|
558
|
-
? `${baseUrl}?${params.toString()}`
|
|
559
|
-
: baseUrl;
|
|
560
|
-
try {
|
|
561
|
-
const response = yield this.restApiCallWithNoToken(endpoint, method);
|
|
562
|
-
return response;
|
|
563
|
-
}
|
|
564
|
-
catch (error) {
|
|
565
|
-
throw error;
|
|
566
|
-
}
|
|
567
|
-
});
|
|
568
|
-
}
|
|
569
|
-
getEventsActivity(query) {
|
|
570
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
571
|
-
const method = "GET";
|
|
572
|
-
const baseUrl = `/dynamic-collection/public/v2/event/event-activity`;
|
|
573
|
-
const params = new URLSearchParams();
|
|
574
|
-
if (query) {
|
|
575
|
-
Object.entries(query).forEach(([key, value]) => {
|
|
576
|
-
if (value !== undefined && value !== null) {
|
|
577
|
-
params.append(key, String(value));
|
|
578
|
-
}
|
|
579
|
-
});
|
|
580
|
-
}
|
|
581
|
-
const endpoint = params.toString()
|
|
582
|
-
? `${baseUrl}?${params.toString()}`
|
|
583
|
-
: baseUrl;
|
|
584
|
-
try {
|
|
585
|
-
const response = yield this.restApiCallWithNoToken(endpoint, method);
|
|
586
|
-
return response;
|
|
587
|
-
}
|
|
588
|
-
catch (error) {
|
|
589
|
-
throw error;
|
|
590
|
-
}
|
|
591
|
-
});
|
|
592
|
-
}
|
|
593
|
-
imageProduct(parentId, parentType, width, height) {
|
|
594
|
-
const url = `${this.endpoint}/image-gateway/public/image/${parentType}/${parentId}${width ? `?w=${width}` : ``}${`${height ? `&h=${height}` : ``}`} `;
|
|
595
|
-
return url;
|
|
596
|
-
}
|
|
597
|
-
imagesProduct(parentId, parentType, width, height) {
|
|
598
|
-
const url = `${this.endpoint}/image-gateway/public/images/${parentType}/${parentId}?w=${width}&h=${height}`;
|
|
599
|
-
return url;
|
|
600
|
-
}
|
|
601
|
-
// API confirmOrder xử lý FFM cho order có mặt hàng có offerType = SUBCRIPTION
|
|
602
|
-
confirmOrderWithoutPaid(partnerId, orderId, createBy) {
|
|
603
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
604
|
-
const endpoint = `/order-cloud-service/service-webhook/confirm-order-without-paid?partnerId=${partnerId}&orderId=${orderId}&createBy=${createBy}`;
|
|
605
|
-
const method = "GET";
|
|
606
|
-
try {
|
|
607
|
-
const response = yield this.restApiCallWithNoHeader(endpoint, method);
|
|
608
|
-
return response;
|
|
609
|
-
}
|
|
610
|
-
catch (error) {
|
|
611
|
-
throw error;
|
|
612
|
-
}
|
|
613
|
-
});
|
|
614
|
-
}
|
|
615
455
|
}
|
|
616
456
|
exports.PortalService = PortalService;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ApolloClient, NormalizedCacheObject } from "@apollo/client";
|
|
2
|
+
import { DocumentNode } from "graphql";
|
|
3
|
+
export declare class Service {
|
|
4
|
+
protected token: string | null;
|
|
5
|
+
protected client: ApolloClient<NormalizedCacheObject>;
|
|
6
|
+
protected orgId: string;
|
|
7
|
+
protected storeId: string;
|
|
8
|
+
protected endpoint: string;
|
|
9
|
+
constructor(endpoint: string, orgId: string, storeId: string);
|
|
10
|
+
setToken(token: string): void;
|
|
11
|
+
protected graphqlQuery(query: DocumentNode, variables: any): Promise<any>;
|
|
12
|
+
protected graphqlMutation(mutation: DocumentNode, variables: any): Promise<any>;
|
|
13
|
+
protected restApiCallWithToken(path: string, method: "GET" | "POST" | "PUT" | "DELETE", data?: any, headers?: any): Promise<any>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// src/service.ts
|
|
3
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
4
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
5
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
6
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
7
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
8
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
9
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
10
|
+
});
|
|
11
|
+
};
|
|
12
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
13
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
14
|
+
};
|
|
15
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
exports.Service = void 0;
|
|
17
|
+
const client_1 = require("@apollo/client");
|
|
18
|
+
const axios_1 = __importDefault(require("axios"));
|
|
19
|
+
class Service {
|
|
20
|
+
constructor(endpoint, orgId, storeId) {
|
|
21
|
+
this.token = null;
|
|
22
|
+
this.client = new client_1.ApolloClient({
|
|
23
|
+
uri: endpoint,
|
|
24
|
+
cache: new client_1.InMemoryCache(),
|
|
25
|
+
defaultOptions: {
|
|
26
|
+
query: {
|
|
27
|
+
fetchPolicy: "network-only",
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
});
|
|
31
|
+
this.orgId = orgId;
|
|
32
|
+
this.storeId = storeId;
|
|
33
|
+
this.endpoint = endpoint;
|
|
34
|
+
}
|
|
35
|
+
setToken(token) {
|
|
36
|
+
this.token = token;
|
|
37
|
+
}
|
|
38
|
+
// setOrgId(orgId: string) {
|
|
39
|
+
// this.orgId = orgId;
|
|
40
|
+
// }
|
|
41
|
+
graphqlQuery(query, variables) {
|
|
42
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
43
|
+
try {
|
|
44
|
+
const { data, errors } = yield this.client.query({
|
|
45
|
+
query: (0, client_1.gql) `
|
|
46
|
+
${query}
|
|
47
|
+
`,
|
|
48
|
+
variables,
|
|
49
|
+
});
|
|
50
|
+
if (errors) {
|
|
51
|
+
throw new Error(`GraphQL error! errors: ${errors}`);
|
|
52
|
+
}
|
|
53
|
+
return data;
|
|
54
|
+
}
|
|
55
|
+
catch (error) {
|
|
56
|
+
console.log(`Error in graphqlQuery: ${error}`);
|
|
57
|
+
throw error;
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
graphqlMutation(mutation, variables) {
|
|
62
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
63
|
+
try {
|
|
64
|
+
const { data, errors } = yield this.client.mutate({
|
|
65
|
+
mutation: (0, client_1.gql) `
|
|
66
|
+
${mutation}
|
|
67
|
+
`,
|
|
68
|
+
variables,
|
|
69
|
+
});
|
|
70
|
+
if (errors) {
|
|
71
|
+
throw new Error(`GraphQL error! errors: ${errors}`);
|
|
72
|
+
}
|
|
73
|
+
return data;
|
|
74
|
+
}
|
|
75
|
+
catch (error) {
|
|
76
|
+
console.log(`Error in graphqlMutation: ${error}`);
|
|
77
|
+
throw error;
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
restApiCallWithToken(path, method, data, headers) {
|
|
82
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
83
|
+
try {
|
|
84
|
+
const modifiedHeaders = Object.assign(Object.assign({}, headers), { "Partner-Id": this.orgId, "X-Ecomos-Access-Token": this.token });
|
|
85
|
+
console.log("🚀 ~ Service ~ modifiedHeaders:", modifiedHeaders);
|
|
86
|
+
const response = yield (0, axios_1.default)({
|
|
87
|
+
url: this.endpoint + path,
|
|
88
|
+
method,
|
|
89
|
+
data,
|
|
90
|
+
headers: modifiedHeaders,
|
|
91
|
+
});
|
|
92
|
+
return response.data;
|
|
93
|
+
}
|
|
94
|
+
catch (error) {
|
|
95
|
+
console.log(`Error in restApiCallWithToken: ${error}`);
|
|
96
|
+
throw error;
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
exports.Service = Service;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function buildFieldString(fields: (string | Record<string, any>)[], indent?: number): string;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.buildFieldString = void 0;
|
|
4
|
+
function buildFieldString(fields, indent = 6) {
|
|
5
|
+
const space = " ".repeat(indent);
|
|
6
|
+
return fields
|
|
7
|
+
.map((field) => {
|
|
8
|
+
if (typeof field === "string")
|
|
9
|
+
return `${space}${field}`;
|
|
10
|
+
const [key, value] = Object.entries(field)[0];
|
|
11
|
+
const nested = buildFieldString(value, indent + 2);
|
|
12
|
+
return `${space}${key} {\n${nested}\n${space}}`;
|
|
13
|
+
})
|
|
14
|
+
.join("\n");
|
|
15
|
+
}
|
|
16
|
+
exports.buildFieldString = buildFieldString;
|
package/package.json
CHANGED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.UPDATE_ORDER_LINE_ITEM_RESOURCE = exports.MERGE_ORDER_CART = exports.QUICK_ADD_ORDER_ITEM = void 0;
|
|
4
|
-
const graphql_tag_1 = require("graphql-tag");
|
|
5
|
-
const helpers_1 = require("../../utils/helpers");
|
|
6
|
-
exports.QUICK_ADD_ORDER_ITEM = (0, graphql_tag_1.gql) `
|
|
7
|
-
mutation QuickAddOrderItem(
|
|
8
|
-
$partnerId: String!
|
|
9
|
-
$storeId: String!
|
|
10
|
-
$input: QuickAddOrderItemInput!
|
|
11
|
-
) {
|
|
12
|
-
quickAddOrderItem(partnerId: $partnerId, storeId: $storeId, input: $input) {
|
|
13
|
-
status
|
|
14
|
-
message
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
`;
|
|
18
|
-
const MERGE_ORDER_CART = (fields = []) => {
|
|
19
|
-
return (0, graphql_tag_1.gql) `
|
|
20
|
-
mutation MergeOrderCart(
|
|
21
|
-
$oldCartId: String!
|
|
22
|
-
$newCartId: String!
|
|
23
|
-
$actorId: String!
|
|
24
|
-
$isAllowedToMergeItem: Boolean!
|
|
25
|
-
) {
|
|
26
|
-
mergeOrderCart(
|
|
27
|
-
input: {
|
|
28
|
-
oldCartId: $oldCartId
|
|
29
|
-
newCartId: $newCartId
|
|
30
|
-
actorId: $actorId
|
|
31
|
-
isAllowedToMergeItem: $isAllowedToMergeItem
|
|
32
|
-
}
|
|
33
|
-
) ${(0, helpers_1.hasFields)(fields) ? `{ ${(0, helpers_1.joinField)(fields)} }` : ""}
|
|
34
|
-
}
|
|
35
|
-
`;
|
|
36
|
-
};
|
|
37
|
-
exports.MERGE_ORDER_CART = MERGE_ORDER_CART;
|
|
38
|
-
exports.UPDATE_ORDER_LINE_ITEM_RESOURCE = (0, graphql_tag_1.gql) `
|
|
39
|
-
mutation updateOrderLineItemResource(
|
|
40
|
-
$partnerId: String!
|
|
41
|
-
$orderId: String!
|
|
42
|
-
$lineItemId: String!
|
|
43
|
-
$input: ProductConfigurationInput!
|
|
44
|
-
) {
|
|
45
|
-
updateOrderLineItemResource(
|
|
46
|
-
partnerId: $partnerId
|
|
47
|
-
orderId: $orderId
|
|
48
|
-
lineItemId: $lineItemId
|
|
49
|
-
input: $input
|
|
50
|
-
) {
|
|
51
|
-
status
|
|
52
|
-
message
|
|
53
|
-
lineItem
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
`;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export declare const GET_REVENUE_STATISTIC_BY_PRODUCT: import("graphql").DocumentNode;
|
|
2
|
-
export declare const GET_REVENUE_STATISTIC_BY_GROUP_OR_CATEGORY: import("graphql").DocumentNode;
|
|
3
|
-
export declare const GET_FIRST_TRIAL_TREATMENT_MONTHLY_REPORT: import("graphql").DocumentNode;
|
|
4
|
-
export declare const GET_FIRST_TRIAL_TREATMENT_MONTHLY_DETAIL: import("graphql").DocumentNode;
|
|
5
|
-
export declare const GET_FIRST_TRIAL_TREATMENT_REMAINING_USES_REPORT: import("graphql").DocumentNode;
|
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.GET_FIRST_TRIAL_TREATMENT_REMAINING_USES_REPORT = exports.GET_FIRST_TRIAL_TREATMENT_MONTHLY_DETAIL = exports.GET_FIRST_TRIAL_TREATMENT_MONTHLY_REPORT = exports.GET_REVENUE_STATISTIC_BY_GROUP_OR_CATEGORY = exports.GET_REVENUE_STATISTIC_BY_PRODUCT = void 0;
|
|
4
|
-
const graphql_tag_1 = require("graphql-tag");
|
|
5
|
-
exports.GET_REVENUE_STATISTIC_BY_PRODUCT = (0, graphql_tag_1.gql) `
|
|
6
|
-
query GetRevenueStatisticByProduct($input: ProductStatisticPagedInput!) {
|
|
7
|
-
getRevenueStatisticByProduct(input: $input) {
|
|
8
|
-
totalElements
|
|
9
|
-
totalPages
|
|
10
|
-
page
|
|
11
|
-
size
|
|
12
|
-
content {
|
|
13
|
-
id
|
|
14
|
-
name
|
|
15
|
-
sku
|
|
16
|
-
image
|
|
17
|
-
productParentId
|
|
18
|
-
totalQuantity
|
|
19
|
-
inventory
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
`;
|
|
24
|
-
exports.GET_REVENUE_STATISTIC_BY_GROUP_OR_CATEGORY = (0, graphql_tag_1.gql) `
|
|
25
|
-
query GetRevenueStatisticByGroupOrCategory(
|
|
26
|
-
$input: ProductStatisticInput!
|
|
27
|
-
$groupBy: StatisticGroupBy!
|
|
28
|
-
) {
|
|
29
|
-
getRevenueStatisticByGroupOrCategory(input: $input, groupBy: $groupBy) {
|
|
30
|
-
totalElements
|
|
31
|
-
totalPages
|
|
32
|
-
page
|
|
33
|
-
size
|
|
34
|
-
content {
|
|
35
|
-
id
|
|
36
|
-
name
|
|
37
|
-
totalOrders
|
|
38
|
-
totalPriceOfSales
|
|
39
|
-
totalPriceOfService
|
|
40
|
-
totalPriceOfRenewals
|
|
41
|
-
totalPrice
|
|
42
|
-
totalNotPayYet
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
`;
|
|
47
|
-
exports.GET_FIRST_TRIAL_TREATMENT_MONTHLY_REPORT = (0, graphql_tag_1.gql) `
|
|
48
|
-
query GetFirstTrialTreatmentMonthlyReport(
|
|
49
|
-
$storeIds: [String!]
|
|
50
|
-
$monthCount: Int
|
|
51
|
-
) {
|
|
52
|
-
getFirstTrialTreatmentMonthlyReport(
|
|
53
|
-
storeIds: $storeIds
|
|
54
|
-
monthCount: $monthCount
|
|
55
|
-
) {
|
|
56
|
-
totalFirstTrialCount
|
|
57
|
-
totalNewTreatmentCount
|
|
58
|
-
items {
|
|
59
|
-
month
|
|
60
|
-
firstTrialCount
|
|
61
|
-
newTreatmentCount
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
`;
|
|
66
|
-
exports.GET_FIRST_TRIAL_TREATMENT_MONTHLY_DETAIL = (0, graphql_tag_1.gql) `
|
|
67
|
-
query GetFirstTrialTreatmentMonthlyDetail(
|
|
68
|
-
$month: String!
|
|
69
|
-
$storeIds: [String!]
|
|
70
|
-
) {
|
|
71
|
-
getFirstTrialTreatmentMonthlyDetail(month: $month, storeIds: $storeIds) {
|
|
72
|
-
month
|
|
73
|
-
totalFirstTrialCount
|
|
74
|
-
totalNewTreatmentCount
|
|
75
|
-
items {
|
|
76
|
-
salePartyId
|
|
77
|
-
saleName
|
|
78
|
-
firstTrialCount
|
|
79
|
-
newTreatmentCount
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
`;
|
|
84
|
-
exports.GET_FIRST_TRIAL_TREATMENT_REMAINING_USES_REPORT = (0, graphql_tag_1.gql) `
|
|
85
|
-
query GetFirstTrialTreatmentRemainingUsesReport($storeIds: [String!]) {
|
|
86
|
-
getFirstTrialTreatmentRemainingUsesReport(storeIds: $storeIds) {
|
|
87
|
-
totalOutOfUsesCount
|
|
88
|
-
totalUnderThreeUsesCount
|
|
89
|
-
totalUnderFiveUsesCount
|
|
90
|
-
items {
|
|
91
|
-
productId
|
|
92
|
-
productName
|
|
93
|
-
totalUses
|
|
94
|
-
outOfUsesCount
|
|
95
|
-
underThreeUsesCount
|
|
96
|
-
underFiveUsesCount
|
|
97
|
-
}
|
|
98
|
-
remainingUsesRanges {
|
|
99
|
-
key
|
|
100
|
-
displayThreshold
|
|
101
|
-
from
|
|
102
|
-
to
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
`;
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.REMOVE_TAG_TO_TAG_GROUP = exports.ADD_TAG_TO_TAG_GROUP = void 0;
|
|
4
|
-
const graphql_tag_1 = require("graphql-tag");
|
|
5
|
-
exports.ADD_TAG_TO_TAG_GROUP = (0, graphql_tag_1.gql) `
|
|
6
|
-
mutation AddTagToTagGroup(
|
|
7
|
-
$resourceId: String!
|
|
8
|
-
$resourceType: String!
|
|
9
|
-
$tagId: String!
|
|
10
|
-
$tagGroupId: String
|
|
11
|
-
$addedBy: String!
|
|
12
|
-
) {
|
|
13
|
-
addTagToTagGroup(
|
|
14
|
-
resourceId: $resourceId
|
|
15
|
-
resourceType: $resourceType
|
|
16
|
-
tagId: $tagId
|
|
17
|
-
tagGroupId: $tagGroupId
|
|
18
|
-
addedBy: $addedBy
|
|
19
|
-
) {
|
|
20
|
-
code
|
|
21
|
-
message
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
`;
|
|
25
|
-
exports.REMOVE_TAG_TO_TAG_GROUP = (0, graphql_tag_1.gql) `
|
|
26
|
-
mutation RemoveTagToTagGroup(
|
|
27
|
-
$resourceId: String!
|
|
28
|
-
$resourceType: String!
|
|
29
|
-
$tagId: String!
|
|
30
|
-
$tagGroupId: String
|
|
31
|
-
$updateBy: String!
|
|
32
|
-
) {
|
|
33
|
-
removeTagToTagGroup(
|
|
34
|
-
resourceId: $resourceId
|
|
35
|
-
resourceType: $resourceType
|
|
36
|
-
tagId: $tagId
|
|
37
|
-
tagGroupId: $tagGroupId
|
|
38
|
-
updateBy: $updateBy
|
|
39
|
-
) {
|
|
40
|
-
code
|
|
41
|
-
message
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
`;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const GET_RESULT_TAG: import("graphql").DocumentNode;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.GET_RESULT_TAG = void 0;
|
|
4
|
-
const graphql_tag_1 = require("graphql-tag");
|
|
5
|
-
exports.GET_RESULT_TAG = (0, graphql_tag_1.gql) `
|
|
6
|
-
query GetResultTag($resourceId: String!, $resourceType: String!) {
|
|
7
|
-
getResultTag(resourceId: $resourceId, resourceType: $resourceType) {
|
|
8
|
-
id
|
|
9
|
-
title
|
|
10
|
-
items {
|
|
11
|
-
id
|
|
12
|
-
title
|
|
13
|
-
items {
|
|
14
|
-
id
|
|
15
|
-
title
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
`;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { Service } from "../serviceSDK";
|
|
2
|
-
export declare class ImageGateService extends Service {
|
|
3
|
-
constructor(endpoint: string, orgId: string, storeId: string);
|
|
4
|
-
imageProduct(parentId: string, parentType: string, width?: number, height?: number): string;
|
|
5
|
-
imagesProduct(parentId: string, parentType: string, width?: number, height?: number): string;
|
|
6
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ImageGateService = void 0;
|
|
4
|
-
const serviceSDK_1 = require("../serviceSDK");
|
|
5
|
-
class ImageGateService extends serviceSDK_1.Service {
|
|
6
|
-
constructor(endpoint, orgId, storeId) {
|
|
7
|
-
super(endpoint, orgId, storeId);
|
|
8
|
-
}
|
|
9
|
-
imageProduct(parentId, parentType, width, height) {
|
|
10
|
-
const url = `${this.endpoint}/image-gateway/public/image/${parentType}/${parentId}${width ? `?w=${width}` : ``}${`${height ? `&h=${height}` : ``}`} `;
|
|
11
|
-
return url;
|
|
12
|
-
}
|
|
13
|
-
imagesProduct(parentId, parentType, width, height) {
|
|
14
|
-
const url = `${this.endpoint}/image-gateway/public/images/${parentType}/${parentId}?w=${width}&h=${height}`;
|
|
15
|
-
return url;
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
exports.ImageGateService = ImageGateService;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { Service } from "../serviceSDK";
|
|
2
|
-
export interface QuickAddOrderItemInput {
|
|
3
|
-
orderId: string;
|
|
4
|
-
itemName: string;
|
|
5
|
-
unitPrice: string;
|
|
6
|
-
quantity?: string;
|
|
7
|
-
unit?: string | null;
|
|
8
|
-
itemType?: string | null;
|
|
9
|
-
vatRate?: string | null;
|
|
10
|
-
customAttributes?: any;
|
|
11
|
-
}
|
|
12
|
-
export declare class StorefontService extends Service {
|
|
13
|
-
constructor(endpoint: string, orgId: string, storeId: string);
|
|
14
|
-
setToken(token: string): void;
|
|
15
|
-
getRevenueStatisticByGroupOrCategory(dataQuery: any, groupBy: any): Promise<any>;
|
|
16
|
-
getRevenueStatisticByProduct(dataQuery: any): Promise<any>;
|
|
17
|
-
quickAddOrderItem(input: QuickAddOrderItemInput): Promise<any>;
|
|
18
|
-
getFirstTrialTreatmentMonthlyReport(monthCount: number, storeIds: [string]): Promise<any>;
|
|
19
|
-
getFirstTrialTreatmentMonthlyDetail(month: string, storeIds: [string]): Promise<any>;
|
|
20
|
-
mergeOrderCart(oldCartId: string, newCartId: string, actorId: string, isAllowedToMergeItem: boolean, fields?: string[]): Promise<any>;
|
|
21
|
-
getFirstTrialTreatmentRemainingUsesReport(storeIds: [string]): Promise<any>;
|
|
22
|
-
updateOrderLineItemResource(orderId: string, lineItemId: string, input: any): Promise<any>;
|
|
23
|
-
}
|