@longvansoftware/service-js-client 2.7.8 → 2.7.9
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/config/config.js +2 -2
- package/dist/src/graphql/campaign/queries.d.ts +11 -13
- package/dist/src/graphql/campaign/queries.js +111 -39
- package/dist/src/graphql/paymentV2/mutations.d.ts +0 -1
- package/dist/src/graphql/paymentV2/mutations.js +1 -15
- package/dist/src/graphql/paymentV2/queries.d.ts +0 -2
- package/dist/src/graphql/paymentV2/queries.js +1 -58
- package/dist/src/graphql/quicklab_service/mutations.js +0 -2
- package/dist/src/graphql/quicklab_service/queries.d.ts +0 -3
- package/dist/src/graphql/quicklab_service/queries.js +1 -25
- package/dist/src/lib/campaign/index.d.ts +0 -1
- package/dist/src/lib/campaign/index.js +12 -69
- package/dist/src/lib/paymentV2/index.d.ts +0 -10
- package/dist/src/lib/paymentV2/index.js +0 -39
- package/dist/src/lib/portal/index.d.ts +0 -3
- package/dist/src/lib/portal/index.js +0 -50
- package/dist/src/lib/quicklab_service/index.d.ts +1 -4
- package/dist/src/lib/quicklab_service/index.js +3 -47
- 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/marketplace/mutations.d.ts +0 -3
- package/dist/src/graphql/marketplace/mutations.js +0 -54
- package/dist/src/graphql/marketplace/queries.d.ts +0 -2
- package/dist/src/graphql/marketplace/queries.js +0 -42
- package/dist/src/graphql/storefont/mutation.d.ts +0 -0
- package/dist/src/graphql/storefont/mutation.js +0 -1
- package/dist/src/graphql/storefont/queries.d.ts +0 -2
- package/dist/src/graphql/storefont/queries.js +0 -46
- 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/marketplace/index.d.ts +0 -9
- package/dist/src/lib/marketplace/index.js +0 -106
- package/dist/src/lib/storefont/index.d.ts +0 -6
- package/dist/src/lib/storefont/index.js +0 -51
- package/dist/src/lib/tag/index.d.ts +0 -7
- package/dist/src/lib/tag/index.js +0 -61
|
@@ -260,44 +260,5 @@ class PaymentServiceV2 extends serviceSDK_1.Service {
|
|
|
260
260
|
}
|
|
261
261
|
});
|
|
262
262
|
}
|
|
263
|
-
createPayment(paymentData) {
|
|
264
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
265
|
-
const mutation = mutations_1.CREATE_PAYMENT;
|
|
266
|
-
const variables = { paymentData };
|
|
267
|
-
try {
|
|
268
|
-
const response = yield this.graphqlMutationV3(mutation, variables);
|
|
269
|
-
return response.createPayment;
|
|
270
|
-
}
|
|
271
|
-
catch (error) {
|
|
272
|
-
throw error;
|
|
273
|
-
}
|
|
274
|
-
});
|
|
275
|
-
}
|
|
276
|
-
paymentMethodsByPartner(partnerCode) {
|
|
277
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
278
|
-
const query = queries_1.PAYMENT_METHODS_BY_PARTNER;
|
|
279
|
-
const variables = { partnerCode };
|
|
280
|
-
try {
|
|
281
|
-
const response = yield this.graphqlQueryV3(query, variables);
|
|
282
|
-
return response.paymentMethods;
|
|
283
|
-
}
|
|
284
|
-
catch (error) {
|
|
285
|
-
throw error;
|
|
286
|
-
}
|
|
287
|
-
});
|
|
288
|
-
}
|
|
289
|
-
getPaymentMethodTypesWithGatewayConfig(partnerId, storeId) {
|
|
290
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
291
|
-
const query = queries_1.GET_PAYMENT_METHOD_TYPES_WITH_GATEWAY_CONFIG;
|
|
292
|
-
const variables = { partnerId, storeId };
|
|
293
|
-
try {
|
|
294
|
-
const response = yield this.graphqlQueryV3(query, variables);
|
|
295
|
-
return response.getPaymentMethodTypes;
|
|
296
|
-
}
|
|
297
|
-
catch (error) {
|
|
298
|
-
throw error;
|
|
299
|
-
}
|
|
300
|
-
});
|
|
301
|
-
}
|
|
302
263
|
}
|
|
303
264
|
exports.PaymentServiceV2 = PaymentServiceV2;
|
|
@@ -30,7 +30,4 @@ export declare class PortalService extends Service {
|
|
|
30
30
|
getPosition(query?: Record<string, any>): Promise<any>;
|
|
31
31
|
getPositionForTime(query?: Record<string, any>): Promise<any>;
|
|
32
32
|
getBookingCount(query?: Record<string, any>): Promise<any>;
|
|
33
|
-
getSlugPathFromDynamicFrom(query?: Record<string, any>): Promise<any>;
|
|
34
|
-
putSlugPathFromDynamicFrom(data: any): Promise<any>;
|
|
35
|
-
postSlugPathFromDynamicFrom(data: any): Promise<any>;
|
|
36
33
|
}
|
|
@@ -452,55 +452,5 @@ class PortalService extends serviceSDK_1.Service {
|
|
|
452
452
|
}
|
|
453
453
|
});
|
|
454
454
|
}
|
|
455
|
-
getSlugPathFromDynamicFrom(query) {
|
|
456
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
457
|
-
const method = "GET";
|
|
458
|
-
const baseUrl = `/dynamic-collection/public/v2/records/slug_path/slug_path_view`;
|
|
459
|
-
const params = new URLSearchParams();
|
|
460
|
-
if (query) {
|
|
461
|
-
Object.entries(query).forEach(([key, value]) => {
|
|
462
|
-
if (value !== undefined && value !== null) {
|
|
463
|
-
params.append(key, String(value));
|
|
464
|
-
}
|
|
465
|
-
});
|
|
466
|
-
}
|
|
467
|
-
const endpoint = params.toString()
|
|
468
|
-
? `${baseUrl}?${params.toString()}`
|
|
469
|
-
: baseUrl;
|
|
470
|
-
try {
|
|
471
|
-
const response = yield this.restApiCallWithNoToken(endpoint, method);
|
|
472
|
-
return response;
|
|
473
|
-
}
|
|
474
|
-
catch (error) {
|
|
475
|
-
throw error;
|
|
476
|
-
}
|
|
477
|
-
});
|
|
478
|
-
}
|
|
479
|
-
putSlugPathFromDynamicFrom(data) {
|
|
480
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
481
|
-
const method = "PUT";
|
|
482
|
-
const endpoint = `/dynamic-collection/public/v2/records/slug_path/slug_path_form`;
|
|
483
|
-
try {
|
|
484
|
-
const response = yield this.restApiCallWithNoToken(endpoint, method, data);
|
|
485
|
-
return response;
|
|
486
|
-
}
|
|
487
|
-
catch (error) {
|
|
488
|
-
throw error;
|
|
489
|
-
}
|
|
490
|
-
});
|
|
491
|
-
}
|
|
492
|
-
postSlugPathFromDynamicFrom(data) {
|
|
493
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
494
|
-
const method = "POST";
|
|
495
|
-
const endpoint = `/dynamic-collection/public/v2/records/slug_path/slug_path_form`;
|
|
496
|
-
try {
|
|
497
|
-
const response = yield this.restApiCallWithNoHeader(endpoint, method, data);
|
|
498
|
-
return response;
|
|
499
|
-
}
|
|
500
|
-
catch (error) {
|
|
501
|
-
throw error;
|
|
502
|
-
}
|
|
503
|
-
});
|
|
504
|
-
}
|
|
505
455
|
}
|
|
506
456
|
exports.PortalService = PortalService;
|
|
@@ -17,13 +17,10 @@ export declare class QuicklabService extends Service {
|
|
|
17
17
|
stopLabSessionForCustomer(labSessionId: string, userId: string, note: string): Promise<any>;
|
|
18
18
|
getLabDoingAndDoneByUserId(userId: string, fields: string[]): Promise<any>;
|
|
19
19
|
calculateComputingLabActionPricing(userId: string, timeUse: number | string, action: string, productId: string, computingId: string, price: number | string, fields: string[]): Promise<any>;
|
|
20
|
-
createComputingLabByTemplateId(templateId: string, userId: string, productId: string, province: string, timeUse: number | string, createBy: string, price: number | string,
|
|
20
|
+
createComputingLabByTemplateId(templateId: string, userId: string, productId: string, province: string, timeUse: number | string, createBy: string, price: number | string, fields?: string[]): Promise<any>;
|
|
21
21
|
getSessionLab(userId: string, computingId: string, fields: string[]): Promise<any>;
|
|
22
22
|
removeComputingLab(userId: string, computingId: string, updateBy: string): Promise<any>;
|
|
23
23
|
offComputingLab(userId: string, computingId: string, timeUse: string | number, updateBy: string): Promise<any>;
|
|
24
24
|
filterComputingLab(id: string, search: string, createdStampFrom: string, createdStampTo: string, offset: number, maxResult: number, userId: string, fields?: string[]): Promise<any>;
|
|
25
25
|
onComputingLab(userId: string, computingId: string, timeUse: string | number, updateBy: string, price: number | string): Promise<any>;
|
|
26
|
-
getLabSessions(): Promise<any>;
|
|
27
|
-
updateComputingLabTypeLabSessionCode(userId: string, computingId: string, typeLabSessionCode: string, updateBy: string): Promise<any>;
|
|
28
|
-
stopComputingLabByTypeLabSessionCode(userId: string, computingId: string, updateBy: string): Promise<any>;
|
|
29
26
|
}
|
|
@@ -221,8 +221,8 @@ class QuicklabService extends serviceSDK_1.Service {
|
|
|
221
221
|
}
|
|
222
222
|
});
|
|
223
223
|
}
|
|
224
|
-
createComputingLabByTemplateId(templateId_1, userId_1, productId_1, province_1, timeUse_1, createBy_1, price_1
|
|
225
|
-
return __awaiter(this, arguments, void 0, function* (templateId, userId, productId, province, timeUse, createBy, price,
|
|
224
|
+
createComputingLabByTemplateId(templateId_1, userId_1, productId_1, province_1, timeUse_1, createBy_1, price_1) {
|
|
225
|
+
return __awaiter(this, arguments, void 0, function* (templateId, userId, productId, province, timeUse, createBy, price, fields = []) {
|
|
226
226
|
const mutation = (0, mutations_1.CREATE_COMPUTING_LAB_BY_TEMPLATE_ID)(fields);
|
|
227
227
|
const variables = {
|
|
228
228
|
templateId,
|
|
@@ -231,8 +231,7 @@ class QuicklabService extends serviceSDK_1.Service {
|
|
|
231
231
|
province,
|
|
232
232
|
timeUse: Number(timeUse),
|
|
233
233
|
createBy,
|
|
234
|
-
price: price != null ? Number(price) : null
|
|
235
|
-
typeLabSessionCode: typeLabSessionCode || null
|
|
234
|
+
price: price != null ? Number(price) : null
|
|
236
235
|
};
|
|
237
236
|
try {
|
|
238
237
|
const response = yield this.graphqlMutation(mutation, variables);
|
|
@@ -347,48 +346,5 @@ class QuicklabService extends serviceSDK_1.Service {
|
|
|
347
346
|
}
|
|
348
347
|
});
|
|
349
348
|
}
|
|
350
|
-
getLabSessions() {
|
|
351
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
352
|
-
try {
|
|
353
|
-
const response = yield this.graphqlMutationV2(queries_1.GET_TYPE_LAB_SESSIONS, {});
|
|
354
|
-
return response.getTypeLabSessions;
|
|
355
|
-
}
|
|
356
|
-
catch (error) {
|
|
357
|
-
console.log(`Error in getTypeLabSessions: ${error}`);
|
|
358
|
-
throw error;
|
|
359
|
-
}
|
|
360
|
-
});
|
|
361
|
-
}
|
|
362
|
-
updateComputingLabTypeLabSessionCode(userId, computingId, typeLabSessionCode, updateBy) {
|
|
363
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
364
|
-
const variables = { partnerId: this.orgId, userId, computingId, typeLabSessionCode, updateBy };
|
|
365
|
-
try {
|
|
366
|
-
const response = yield this.graphqlMutation(queries_1.UPDATE_COMPUTING_LAB_TYPE_LAB_SESSION_CODE, variables);
|
|
367
|
-
return response.updateComputingLabTypeLabSessionCode;
|
|
368
|
-
}
|
|
369
|
-
catch (error) {
|
|
370
|
-
console.log(`Error in updateComputingLabTypeLabSessionCode: ${error}`);
|
|
371
|
-
throw error;
|
|
372
|
-
}
|
|
373
|
-
});
|
|
374
|
-
}
|
|
375
|
-
stopComputingLabByTypeLabSessionCode(userId, computingId, updateBy) {
|
|
376
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
377
|
-
const variables = {
|
|
378
|
-
partnerId: this.orgId,
|
|
379
|
-
userId,
|
|
380
|
-
computingId,
|
|
381
|
-
updateBy
|
|
382
|
-
};
|
|
383
|
-
try {
|
|
384
|
-
const response = yield this.graphqlMutation(queries_1.STOP_COMPUTING_LAB_BY_TYPE_LAB_SESSION_CODE, variables);
|
|
385
|
-
return response.stopComputingLabByTypeLabSessionCode;
|
|
386
|
-
}
|
|
387
|
-
catch (error) {
|
|
388
|
-
console.log(`Error in stopComputingLabByTypeLabSessionCode: ${error}`);
|
|
389
|
-
throw error;
|
|
390
|
-
}
|
|
391
|
-
});
|
|
392
|
-
}
|
|
393
349
|
}
|
|
394
350
|
exports.QuicklabService = QuicklabService;
|
|
@@ -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,54 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.REMOVE_PRODUCT_TAG = exports.ADD_PRODUCT_TAG = exports.CREATE_TAG = void 0;
|
|
4
|
-
const graphql_tag_1 = require("graphql-tag");
|
|
5
|
-
exports.CREATE_TAG = (0, graphql_tag_1.gql) `
|
|
6
|
-
mutation CreateTag($name: String!, $slug: String!, $createdBy: String!) {
|
|
7
|
-
createTag(name: $name, slug: $slug, createdBy: $createdBy) {
|
|
8
|
-
id
|
|
9
|
-
name
|
|
10
|
-
slug
|
|
11
|
-
type
|
|
12
|
-
scope
|
|
13
|
-
storeIds
|
|
14
|
-
selected
|
|
15
|
-
title
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
`;
|
|
19
|
-
exports.ADD_PRODUCT_TAG = (0, graphql_tag_1.gql) `
|
|
20
|
-
mutation AddProductTag(
|
|
21
|
-
$productId: String!
|
|
22
|
-
$tagId: String!
|
|
23
|
-
$tagGroupId: String
|
|
24
|
-
$createBy: String!
|
|
25
|
-
) {
|
|
26
|
-
addProductTag(
|
|
27
|
-
productId: $productId
|
|
28
|
-
tagId: $tagId
|
|
29
|
-
tagGroupId: $tagGroupId
|
|
30
|
-
createBy: $createBy
|
|
31
|
-
) {
|
|
32
|
-
status
|
|
33
|
-
message
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
`;
|
|
37
|
-
exports.REMOVE_PRODUCT_TAG = (0, graphql_tag_1.gql) `
|
|
38
|
-
mutation RemoveProductTag(
|
|
39
|
-
$productId: String!
|
|
40
|
-
$tagId: String!
|
|
41
|
-
$tagGroupId: String
|
|
42
|
-
$updatedBy: String!
|
|
43
|
-
) {
|
|
44
|
-
removeProductTag(
|
|
45
|
-
productId: $productId
|
|
46
|
-
tagId: $tagId
|
|
47
|
-
tagGroupId: $tagGroupId
|
|
48
|
-
updatedBy: $updatedBy
|
|
49
|
-
) {
|
|
50
|
-
status
|
|
51
|
-
message
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
`;
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SEARCH_TAG = exports.GET_TAGS_BY_PRODUCT_ID = void 0;
|
|
4
|
-
const graphql_tag_1 = require("graphql-tag");
|
|
5
|
-
exports.GET_TAGS_BY_PRODUCT_ID = (0, graphql_tag_1.gql) `
|
|
6
|
-
query GetTagsByProductId($productId: String!) {
|
|
7
|
-
getTagsByProductId(productId: $productId) {
|
|
8
|
-
id
|
|
9
|
-
title
|
|
10
|
-
items {
|
|
11
|
-
id
|
|
12
|
-
name
|
|
13
|
-
slug
|
|
14
|
-
type
|
|
15
|
-
scope
|
|
16
|
-
storeIds
|
|
17
|
-
selected
|
|
18
|
-
title
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
`;
|
|
23
|
-
exports.SEARCH_TAG = (0, graphql_tag_1.gql) `
|
|
24
|
-
query SearchTag($keyword: String, $currentPage: Int, $maxResult: Int) {
|
|
25
|
-
searchTag(keyword: $keyword, currentPage: $currentPage, maxResult: $maxResult) {
|
|
26
|
-
total
|
|
27
|
-
maxResult
|
|
28
|
-
index
|
|
29
|
-
resultList {
|
|
30
|
-
id
|
|
31
|
-
name
|
|
32
|
-
slug
|
|
33
|
-
type
|
|
34
|
-
scope
|
|
35
|
-
storeIds
|
|
36
|
-
selected
|
|
37
|
-
title
|
|
38
|
-
tagId
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
`;
|
|
File without changes
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
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
|
-
`;
|
|
@@ -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,9 +0,0 @@
|
|
|
1
|
-
import { Service } from "../serviceSDK";
|
|
2
|
-
export declare class MarketPlaceService extends Service {
|
|
3
|
-
constructor(endpoint: string, orgId: string, storeId: string);
|
|
4
|
-
createTag(name: string, slug: string, createdBy: string): Promise<any>;
|
|
5
|
-
searchTag(keyword: string, currentPage: number, maxResult: number): Promise<any>;
|
|
6
|
-
getTagsByProductId(productId: string): Promise<any>;
|
|
7
|
-
removeProductTag(productId: string, tagId: string, updatedBy: string, tagGroupId?: string): Promise<any>;
|
|
8
|
-
addProductTag(productId: string, tagId: string, createBy: string, tagGroupId?: string): Promise<any>;
|
|
9
|
-
}
|