@longvansoftware/storefront-js-client 3.7.6 → 3.7.8
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/product/queries.d.ts +1 -0
- package/dist/src/graphql/product/queries.js +53 -1
- package/dist/src/lib/product/index.d.ts +1 -0
- package/dist/src/lib/product/index.js +17 -0
- package/package.json +2 -3
- package/dist/src/graphql/accounting_service/mutations.d.ts +0 -2
- package/dist/src/graphql/accounting_service/mutations.js +0 -102
- package/dist/src/graphql/accounting_service/queries.d.ts +0 -1
- package/dist/src/graphql/accounting_service/queries.js +0 -62
- package/dist/src/graphql/crm_camping/mutations.d.ts +0 -1
- package/dist/src/graphql/crm_camping/mutations.js +0 -37
- package/dist/src/graphql/crm_camping/queries.d.ts +0 -8
- package/dist/src/graphql/crm_camping/queries.js +0 -279
- package/dist/src/graphql/fragments/product.d.ts +0 -38
- package/dist/src/graphql/fragments/product.js +0 -196
- package/dist/src/graphql/orderGraphQL/mutations.d.ts +0 -4
- package/dist/src/graphql/orderGraphQL/mutations.js +0 -359
- package/dist/src/graphql/orderGraphQL/queries.d.ts +0 -7
- package/dist/src/graphql/orderGraphQL/queries.js +0 -402
- package/dist/src/graphql/paymentLV/mutations.d.ts +0 -2
- package/dist/src/graphql/paymentLV/mutations.js +0 -25
- package/dist/src/graphql/paymentLV/queries.d.ts +0 -4
- package/dist/src/graphql/paymentLV/queries.js +0 -83
- package/dist/src/graphql/quicklab_service/mutations.d.ts +0 -8
- package/dist/src/graphql/quicklab_service/mutations.js +0 -171
- package/dist/src/graphql/quicklab_service/queries.d.ts +0 -6
- package/dist/src/graphql/quicklab_service/queries.js +0 -121
- package/dist/src/graphql/resource_permission/mutations.d.ts +0 -2
- package/dist/src/graphql/resource_permission/mutations.js +0 -63
- package/dist/src/graphql/resource_permission/queries.d.ts +0 -1
- package/dist/src/graphql/resource_permission/queries.js +0 -18
- package/dist/src/lib/accounting_service/index.d.ts +0 -9
- package/dist/src/lib/accounting_service/index.js +0 -69
- package/dist/src/lib/cloud_rest/index.d.ts +0 -17
- package/dist/src/lib/cloud_rest/index.js +0 -101
- package/dist/src/lib/crm_camping/index.d.ts +0 -16
- package/dist/src/lib/crm_camping/index.js +0 -227
- package/dist/src/lib/dns/index.d.ts +0 -7
- package/dist/src/lib/dns/index.js +0 -40
- package/dist/src/lib/orderGraphQL/index.d.ts +0 -16
- package/dist/src/lib/orderGraphQL/index.js +0 -192
- package/dist/src/lib/order_cloud_rest/index.d.ts +0 -7
- package/dist/src/lib/order_cloud_rest/index.js +0 -39
- package/dist/src/lib/paymentLV/index.d.ts +0 -12
- package/dist/src/lib/paymentLV/index.js +0 -132
- package/dist/src/lib/quicklab_service/index.d.ts +0 -18
- package/dist/src/lib/quicklab_service/index.js +0 -197
- package/dist/src/lib/resource_permission/index.d.ts +0 -9
- package/dist/src/lib/resource_permission/index.js +0 -81
- package/dist/src/lib/shareZalo/index.d.ts +0 -5
- package/dist/src/lib/shareZalo/index.js +0 -32
- package/dist/src/types/common.d.ts +0 -264
- package/dist/src/types/common.js +0 -35
- package/dist/src/utils/errorHandler.d.ts +0 -64
- package/dist/src/utils/errorHandler.js +0 -197
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.GET_LAB_SESSIONS_CHILL_BY_PARENT = exports.GET_LAB_SESSIONS_BY_USER_ID_AND_ARTICLE_ID = exports.GET_LAB_SESSIONS_BY_USER_ID = exports.GET_TYPE_LAB_SESSION = exports.GET_TEMPLATE_BY_ARTICLE_ID = void 0;
|
|
4
|
-
const graphql_tag_1 = require("graphql-tag");
|
|
5
|
-
// Danh sách template của bài lab
|
|
6
|
-
exports.GET_TEMPLATE_BY_ARTICLE_ID = (0, graphql_tag_1.gql) `
|
|
7
|
-
query GetTemplatesByArticleId($articleId: String!) {
|
|
8
|
-
getTemplatesByArticleId(articleId: $articleId) {
|
|
9
|
-
templateId
|
|
10
|
-
templateName
|
|
11
|
-
product {
|
|
12
|
-
id
|
|
13
|
-
title
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
`;
|
|
18
|
-
// Danh sách loại thực hành
|
|
19
|
-
exports.GET_TYPE_LAB_SESSION = (0, graphql_tag_1.gql) `
|
|
20
|
-
query {
|
|
21
|
-
getTypeLabSessions {
|
|
22
|
-
name
|
|
23
|
-
code
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
`;
|
|
27
|
-
// Danh sách phiên thực hành của người dùng
|
|
28
|
-
exports.GET_LAB_SESSIONS_BY_USER_ID = (0, graphql_tag_1.gql) `
|
|
29
|
-
query GetLabSessionsByUserId($userId: String!) {
|
|
30
|
-
getLabSessionsByUserId(userId: $userId) {
|
|
31
|
-
labSessionId
|
|
32
|
-
userId
|
|
33
|
-
typeLabSession
|
|
34
|
-
statusUseName
|
|
35
|
-
statusUse
|
|
36
|
-
startTime
|
|
37
|
-
endTime
|
|
38
|
-
note
|
|
39
|
-
articleId
|
|
40
|
-
articleTitle
|
|
41
|
-
computingId
|
|
42
|
-
computingName
|
|
43
|
-
computingState
|
|
44
|
-
templateId
|
|
45
|
-
templateName
|
|
46
|
-
productId
|
|
47
|
-
productName
|
|
48
|
-
parent
|
|
49
|
-
labSessionIdLast
|
|
50
|
-
statusUseLast
|
|
51
|
-
startTimeLast
|
|
52
|
-
endTimeLast
|
|
53
|
-
noteLast
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
`;
|
|
57
|
-
// Danh sách phiên thực hành theo bài lab của người dùng
|
|
58
|
-
exports.GET_LAB_SESSIONS_BY_USER_ID_AND_ARTICLE_ID = (0, graphql_tag_1.gql) `
|
|
59
|
-
query GetLabSessionsByUserIdAndArticleId(
|
|
60
|
-
$userId: String!
|
|
61
|
-
$articleId: String!
|
|
62
|
-
) {
|
|
63
|
-
getLabSessionsByUserIdAndArticleId(userId: $userId, articleId: $articleId) {
|
|
64
|
-
labSessionId
|
|
65
|
-
userId
|
|
66
|
-
typeLabSession
|
|
67
|
-
statusUseName
|
|
68
|
-
statusUse
|
|
69
|
-
startTime
|
|
70
|
-
endTime
|
|
71
|
-
note
|
|
72
|
-
articleId
|
|
73
|
-
articleTitle
|
|
74
|
-
computingId
|
|
75
|
-
computingName
|
|
76
|
-
computingState
|
|
77
|
-
templateId
|
|
78
|
-
templateName
|
|
79
|
-
productId
|
|
80
|
-
productName
|
|
81
|
-
parent
|
|
82
|
-
labSessionIdLast
|
|
83
|
-
statusUseLast
|
|
84
|
-
startTimeLast
|
|
85
|
-
endTimeLast
|
|
86
|
-
noteLast
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
`;
|
|
90
|
-
exports.GET_LAB_SESSIONS_CHILL_BY_PARENT = (0, graphql_tag_1.gql) `
|
|
91
|
-
query GetLabSessionsByUserIdAndArticleId(
|
|
92
|
-
$labSessionId: String!
|
|
93
|
-
$userId: String!
|
|
94
|
-
) {
|
|
95
|
-
getLabSessionsChillByParent(labSessionId: $labSessionId, userId: $userId) {
|
|
96
|
-
labSessionId
|
|
97
|
-
userId
|
|
98
|
-
typeLabSession
|
|
99
|
-
statusUseName
|
|
100
|
-
statusUse
|
|
101
|
-
startTime
|
|
102
|
-
endTime
|
|
103
|
-
note
|
|
104
|
-
articleId
|
|
105
|
-
articleTitle
|
|
106
|
-
computingId
|
|
107
|
-
computingName
|
|
108
|
-
computingState
|
|
109
|
-
templateId
|
|
110
|
-
templateName
|
|
111
|
-
productId
|
|
112
|
-
productName
|
|
113
|
-
parent
|
|
114
|
-
labSessionIdLast
|
|
115
|
-
statusUseLast
|
|
116
|
-
startTimeLast
|
|
117
|
-
endTimeLast
|
|
118
|
-
noteLast
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
`;
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.REMOVE_SHARE_PARTY = exports.SHARE_RESOURCE = void 0;
|
|
4
|
-
const graphql_tag_1 = require("graphql-tag");
|
|
5
|
-
exports.SHARE_RESOURCE = (0, graphql_tag_1.gql) `
|
|
6
|
-
mutation ShareResource(
|
|
7
|
-
$partnerId: String!
|
|
8
|
-
$createModel: ShareResourceRequest!
|
|
9
|
-
) {
|
|
10
|
-
shareResource(partnerId: $partnerId, createModel: $createModel) {
|
|
11
|
-
id
|
|
12
|
-
name
|
|
13
|
-
resourceId
|
|
14
|
-
org
|
|
15
|
-
resourceType
|
|
16
|
-
oauthSharePermissions {
|
|
17
|
-
role
|
|
18
|
-
partyId
|
|
19
|
-
partyName
|
|
20
|
-
permission
|
|
21
|
-
}
|
|
22
|
-
description
|
|
23
|
-
createdStamp
|
|
24
|
-
updatedStamp
|
|
25
|
-
updatedBy
|
|
26
|
-
createdBy
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
`;
|
|
30
|
-
exports.REMOVE_SHARE_PARTY = (0, graphql_tag_1.gql) `
|
|
31
|
-
mutation RemoveShareParty(
|
|
32
|
-
$partnerId: String!
|
|
33
|
-
$orgId: String!
|
|
34
|
-
$resourceType: String!
|
|
35
|
-
$resourceId: String!
|
|
36
|
-
$sharePartyId: String!
|
|
37
|
-
) {
|
|
38
|
-
removeShareParty(
|
|
39
|
-
partnerId: $partnerId
|
|
40
|
-
orgId: $orgId
|
|
41
|
-
resourceType: $resourceType
|
|
42
|
-
resourceId: $resourceId
|
|
43
|
-
sharePartyId: $sharePartyId
|
|
44
|
-
) {
|
|
45
|
-
id
|
|
46
|
-
name
|
|
47
|
-
resourceId
|
|
48
|
-
org
|
|
49
|
-
resourceType
|
|
50
|
-
oauthSharePermissions {
|
|
51
|
-
role
|
|
52
|
-
partyId
|
|
53
|
-
partyName
|
|
54
|
-
permission
|
|
55
|
-
}
|
|
56
|
-
description
|
|
57
|
-
createdStamp
|
|
58
|
-
updatedStamp
|
|
59
|
-
updatedBy
|
|
60
|
-
createdBy
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
`;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const GET_SHARED_USER_BY_SERVICE: import("graphql").DocumentNode;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.GET_SHARED_USER_BY_SERVICE = void 0;
|
|
4
|
-
const graphql_tag_1 = require("graphql-tag");
|
|
5
|
-
exports.GET_SHARED_USER_BY_SERVICE = (0, graphql_tag_1.gql) `
|
|
6
|
-
query GetSharedUserByService($resourceType: String!, $resourceId: String!) {
|
|
7
|
-
getSharedUserByService(
|
|
8
|
-
resourceType: $resourceType
|
|
9
|
-
resourceId: $resourceId
|
|
10
|
-
) {
|
|
11
|
-
role
|
|
12
|
-
partyId
|
|
13
|
-
partyName
|
|
14
|
-
permission
|
|
15
|
-
status
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
`;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { Service } from "../serviceSDK";
|
|
2
|
-
export declare class AccountingService extends Service {
|
|
3
|
-
constructor(endpoint: string, orgId: string, storeId: string);
|
|
4
|
-
setToken(token: string): void;
|
|
5
|
-
setStoreId(storeId: string): void;
|
|
6
|
-
depositWallet(data: any): Promise<any>;
|
|
7
|
-
confirmDepositWallet(data: any): Promise<any>;
|
|
8
|
-
financialAccountWalletInfo(data: any): Promise<any>;
|
|
9
|
-
}
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.AccountingService = void 0;
|
|
13
|
-
const mutations_1 = require("../../graphql/accounting_service/mutations");
|
|
14
|
-
const queries_1 = require("../../graphql/accounting_service/queries");
|
|
15
|
-
const serviceSDK_1 = require("../serviceSDK");
|
|
16
|
-
class AccountingService extends serviceSDK_1.Service {
|
|
17
|
-
constructor(endpoint, orgId, storeId) {
|
|
18
|
-
super(endpoint, orgId, storeId);
|
|
19
|
-
}
|
|
20
|
-
setToken(token) {
|
|
21
|
-
this.token = token;
|
|
22
|
-
}
|
|
23
|
-
setStoreId(storeId) {
|
|
24
|
-
this.storeId = storeId;
|
|
25
|
-
}
|
|
26
|
-
depositWallet(data) {
|
|
27
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
28
|
-
const mutation = mutations_1.DEPOSIT_WALLET;
|
|
29
|
-
const variables = Object.assign({ partnerId: this.orgId, storeId: this.storeId }, data);
|
|
30
|
-
try {
|
|
31
|
-
const response = yield this.graphqlMutationCustomHeader(mutation, variables);
|
|
32
|
-
return response.depositWallet;
|
|
33
|
-
}
|
|
34
|
-
catch (error) {
|
|
35
|
-
console.log(`Error in depositWallet: ${error}`);
|
|
36
|
-
throw error;
|
|
37
|
-
}
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
confirmDepositWallet(data) {
|
|
41
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
42
|
-
const mutation = mutations_1.CONFIRM_DEPOSIT_WALLET;
|
|
43
|
-
const variables = Object.assign({ partnerId: this.orgId }, data);
|
|
44
|
-
try {
|
|
45
|
-
const response = yield this.graphqlMutationCustomHeader(mutation, variables);
|
|
46
|
-
return response.confirmDepositWallet;
|
|
47
|
-
}
|
|
48
|
-
catch (error) {
|
|
49
|
-
console.log(`Error in confirmDepositWallet: ${error}`);
|
|
50
|
-
throw error;
|
|
51
|
-
}
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
financialAccountWalletInfo(data) {
|
|
55
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
56
|
-
const query = queries_1.FINANCIAL_ACCOUNT_WALLET_INFO;
|
|
57
|
-
const variables = Object.assign({ partnerId: this.orgId }, data);
|
|
58
|
-
try {
|
|
59
|
-
const response = yield this.graphqlQueryCustomHeader(query, variables);
|
|
60
|
-
return response.financialAccountWalletInfo;
|
|
61
|
-
}
|
|
62
|
-
catch (error) {
|
|
63
|
-
console.log(`Error in financialAccountWalletInfo: ${error}`);
|
|
64
|
-
throw error;
|
|
65
|
-
}
|
|
66
|
-
});
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
exports.AccountingService = AccountingService;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { Service } from "../serviceSDK";
|
|
2
|
-
export declare class CloudRestService extends Service {
|
|
3
|
-
/**
|
|
4
|
-
* Constructs a new OrderService instance.
|
|
5
|
-
* @param endpoint - The endpoint URL for the service.
|
|
6
|
-
* @param orgId - The organization ID.
|
|
7
|
-
* @param storeId - The store ID.
|
|
8
|
-
*/
|
|
9
|
-
constructor(endpoint: string, orgId: string, storeId: string);
|
|
10
|
-
setToken(token: string): void;
|
|
11
|
-
setStoreId(storeId: string): void;
|
|
12
|
-
getProvinces(): Promise<any>;
|
|
13
|
-
getDistrictsByProvinceId(provinceId: string): Promise<any>;
|
|
14
|
-
getWardByDistrictId(districtId: string): Promise<any>;
|
|
15
|
-
getEnterprises(gdtCode: string): Promise<any>;
|
|
16
|
-
getCountries(): Promise<any>;
|
|
17
|
-
}
|
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.CloudRestService = void 0;
|
|
13
|
-
const serviceSDK_1 = require("../serviceSDK");
|
|
14
|
-
class CloudRestService extends serviceSDK_1.Service {
|
|
15
|
-
/**
|
|
16
|
-
* Constructs a new OrderService instance.
|
|
17
|
-
* @param endpoint - The endpoint URL for the service.
|
|
18
|
-
* @param orgId - The organization ID.
|
|
19
|
-
* @param storeId - The store ID.
|
|
20
|
-
*/
|
|
21
|
-
constructor(endpoint, orgId, storeId) {
|
|
22
|
-
super(endpoint, orgId, storeId);
|
|
23
|
-
}
|
|
24
|
-
setToken(token) {
|
|
25
|
-
this.token = token;
|
|
26
|
-
}
|
|
27
|
-
setStoreId(storeId) {
|
|
28
|
-
this.storeId = storeId;
|
|
29
|
-
}
|
|
30
|
-
getProvinces() {
|
|
31
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
32
|
-
const endpoint = `/places/provinces`;
|
|
33
|
-
const method = "GET";
|
|
34
|
-
try {
|
|
35
|
-
const response = yield this.restApiCallWithToken(endpoint, method);
|
|
36
|
-
return response;
|
|
37
|
-
}
|
|
38
|
-
catch (error) {
|
|
39
|
-
console.log(`Error in getProvinces: ${error}`);
|
|
40
|
-
throw error;
|
|
41
|
-
}
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
getDistrictsByProvinceId(provinceId) {
|
|
45
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
46
|
-
const endpoint = `/places/districts/${provinceId}`;
|
|
47
|
-
const method = "GET";
|
|
48
|
-
try {
|
|
49
|
-
const response = yield this.restApiCallWithToken(endpoint, method);
|
|
50
|
-
return response;
|
|
51
|
-
}
|
|
52
|
-
catch (error) {
|
|
53
|
-
console.log(`Error in getDistrictsByProvinceId: ${error}`);
|
|
54
|
-
throw error;
|
|
55
|
-
}
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
getWardByDistrictId(districtId) {
|
|
59
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
60
|
-
const endpoint = `/places/wards/${districtId}`;
|
|
61
|
-
const method = "GET";
|
|
62
|
-
try {
|
|
63
|
-
const response = yield this.restApiCallWithToken(endpoint, method);
|
|
64
|
-
return response;
|
|
65
|
-
}
|
|
66
|
-
catch (error) {
|
|
67
|
-
console.log(`Error in getWardByDistrictId: ${error}`);
|
|
68
|
-
throw error;
|
|
69
|
-
}
|
|
70
|
-
});
|
|
71
|
-
}
|
|
72
|
-
getEnterprises(gdtCode) {
|
|
73
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
74
|
-
const endpoint = `/enterprises/query?gdtCode=${gdtCode}`;
|
|
75
|
-
const method = "GET";
|
|
76
|
-
try {
|
|
77
|
-
const response = yield this.restApiCallWithToken(endpoint, method);
|
|
78
|
-
return response;
|
|
79
|
-
}
|
|
80
|
-
catch (error) {
|
|
81
|
-
console.log(`Error in getEnterprises: ${error}`);
|
|
82
|
-
throw error;
|
|
83
|
-
}
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
|
-
getCountries() {
|
|
87
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
88
|
-
const endpoint = `/places/countries`;
|
|
89
|
-
const method = "GET";
|
|
90
|
-
try {
|
|
91
|
-
const response = yield this.restApiCallWithToken(endpoint, method);
|
|
92
|
-
return response;
|
|
93
|
-
}
|
|
94
|
-
catch (error) {
|
|
95
|
-
console.log(`Error in getCountries: ${error}`);
|
|
96
|
-
throw error;
|
|
97
|
-
}
|
|
98
|
-
});
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
exports.CloudRestService = CloudRestService;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { Service } from "../serviceSDK";
|
|
2
|
-
export declare class CrmCampingService extends Service {
|
|
3
|
-
constructor(endpoint: string, orgId: string, storeId: string);
|
|
4
|
-
setToken(token: string): void;
|
|
5
|
-
setStoreId(storeId: string): void;
|
|
6
|
-
searchProductQuantityPromotionAction(productId: string): Promise<any>;
|
|
7
|
-
addCustomerToVoucher(userId: string, voucherCode: string): Promise<any>;
|
|
8
|
-
getCampaignActionById(campaignActionId: string): Promise<any>;
|
|
9
|
-
suggestVoucher(customerId: string, scopeIgnore: string | null, scope: string | null, isNewCustomer: boolean): Promise<any>;
|
|
10
|
-
searchVouchers(campaignId: String, campaignActionId: String, campaignActionType: String, customerId: String, pageNumber: number, pageSize: number): Promise<any>;
|
|
11
|
-
getAverageRating(targetIds: [string], customerId: string, evaluationType: string): Promise<any>;
|
|
12
|
-
getUrlEvaluation(targetIds: [string], customerId: string, evaluationType: string): Promise<any>;
|
|
13
|
-
getNumberOfTicketEvaluation(customerId: string): Promise<any>;
|
|
14
|
-
searchProductGiftPromotionResponse(parameterSearchProductGift: any): Promise<any>;
|
|
15
|
-
addProductGiftPromotion(orderId: string, updatedBy: string, addData: any): Promise<any>;
|
|
16
|
-
}
|
|
@@ -1,227 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.CrmCampingService = void 0;
|
|
13
|
-
const mutations_1 = require("../../graphql/crm_camping/mutations");
|
|
14
|
-
const queries_1 = require("../../graphql/crm_camping/queries");
|
|
15
|
-
const serviceSDK_1 = require("../serviceSDK");
|
|
16
|
-
class CrmCampingService extends serviceSDK_1.Service {
|
|
17
|
-
constructor(endpoint, orgId, storeId) {
|
|
18
|
-
super(endpoint, orgId, storeId);
|
|
19
|
-
}
|
|
20
|
-
setToken(token) {
|
|
21
|
-
this.token = token;
|
|
22
|
-
}
|
|
23
|
-
setStoreId(storeId) {
|
|
24
|
-
this.storeId = storeId;
|
|
25
|
-
}
|
|
26
|
-
searchProductQuantityPromotionAction(productId) {
|
|
27
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
28
|
-
const query = queries_1.SEARCH_PRODUCT_QUANTITY_PROMOTION_ACTION;
|
|
29
|
-
const variables = {
|
|
30
|
-
productId,
|
|
31
|
-
partyId: this.orgId,
|
|
32
|
-
storeChannel: this.storeId,
|
|
33
|
-
};
|
|
34
|
-
try {
|
|
35
|
-
const response = yield this.graphqlQueryV2(query, variables);
|
|
36
|
-
return response.searchProductQuantityPromotionAction;
|
|
37
|
-
}
|
|
38
|
-
catch (error) {
|
|
39
|
-
console.log(`Error in searchProductQuantityPromotionAction: ${error}`);
|
|
40
|
-
throw error;
|
|
41
|
-
}
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
addCustomerToVoucher(userId, voucherCode) {
|
|
45
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
46
|
-
const mutation = mutations_1.ADD_CUSTOMER_TO_VOUCHER;
|
|
47
|
-
const variables = {
|
|
48
|
-
partyId: this.orgId,
|
|
49
|
-
userId,
|
|
50
|
-
voucherCode,
|
|
51
|
-
};
|
|
52
|
-
try {
|
|
53
|
-
const response = yield this.graphqlMutationV2(mutation, variables);
|
|
54
|
-
return response.addCustomerToVoucher;
|
|
55
|
-
}
|
|
56
|
-
catch (error) {
|
|
57
|
-
console.log(`Error in addCustomerToVoucher: ${error}`);
|
|
58
|
-
throw error;
|
|
59
|
-
}
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
getCampaignActionById(campaignActionId) {
|
|
63
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
64
|
-
const query = queries_1.GET_CAMPAIGN_ACTION_BY_ID;
|
|
65
|
-
const variables = { id: campaignActionId };
|
|
66
|
-
try {
|
|
67
|
-
const response = yield this.graphqlQueryV2(query, variables);
|
|
68
|
-
return response.getCampaignActionById;
|
|
69
|
-
}
|
|
70
|
-
catch (error) {
|
|
71
|
-
console.log(`Error in getCampaignActionById: ${error}`);
|
|
72
|
-
throw error;
|
|
73
|
-
}
|
|
74
|
-
});
|
|
75
|
-
}
|
|
76
|
-
// async suggestVoucher(customerId: String){
|
|
77
|
-
// const query = SUGGEST_VOUCHER;
|
|
78
|
-
// const variables = {
|
|
79
|
-
// partyId: this.orgId,
|
|
80
|
-
// customerId
|
|
81
|
-
// };
|
|
82
|
-
// console.log("🚀 Query:", SUGGEST_VOUCHER);
|
|
83
|
-
// console.log("🚀 Variables:", { partyId: this.orgId, customerId });
|
|
84
|
-
// try {
|
|
85
|
-
// const response = await this.graphqlQueryV2(query, variables);
|
|
86
|
-
// return response.suggestVoucher;
|
|
87
|
-
// } catch (error) {
|
|
88
|
-
// console.log(`Error in suggestVoucher: ${error}`);
|
|
89
|
-
// throw error;
|
|
90
|
-
// }
|
|
91
|
-
// }
|
|
92
|
-
suggestVoucher(customerId, scopeIgnore, scope, isNewCustomer) {
|
|
93
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
94
|
-
const query = queries_1.SUGGEST_VOUCHER;
|
|
95
|
-
const variables = {
|
|
96
|
-
partyId: this.orgId,
|
|
97
|
-
excludeExpired: true,
|
|
98
|
-
customerId,
|
|
99
|
-
scope,
|
|
100
|
-
isNewCustomer,
|
|
101
|
-
scopeIgnore,
|
|
102
|
-
};
|
|
103
|
-
try {
|
|
104
|
-
const response = yield this.graphqlQueryV2(query, variables);
|
|
105
|
-
return response.suggestVoucher;
|
|
106
|
-
}
|
|
107
|
-
catch (error) {
|
|
108
|
-
throw error;
|
|
109
|
-
}
|
|
110
|
-
});
|
|
111
|
-
}
|
|
112
|
-
searchVouchers(campaignId, campaignActionId, campaignActionType, customerId, pageNumber, pageSize) {
|
|
113
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
114
|
-
const query = queries_1.GET_VOUCHERS;
|
|
115
|
-
const variables = {
|
|
116
|
-
partyId: this.orgId,
|
|
117
|
-
campaignId,
|
|
118
|
-
campaignActionId,
|
|
119
|
-
campaignActionType,
|
|
120
|
-
customerId,
|
|
121
|
-
pageNumber,
|
|
122
|
-
pageSize,
|
|
123
|
-
};
|
|
124
|
-
try {
|
|
125
|
-
const response = yield this.graphqlQuery(query, variables);
|
|
126
|
-
return response.searchVoucher;
|
|
127
|
-
}
|
|
128
|
-
catch (error) {
|
|
129
|
-
console.log(`Error fetching searchVoucher: ${error}`);
|
|
130
|
-
throw error;
|
|
131
|
-
}
|
|
132
|
-
});
|
|
133
|
-
}
|
|
134
|
-
getAverageRating(targetIds, customerId, evaluationType) {
|
|
135
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
136
|
-
const query = queries_1.GET_AVERAGE_RATING;
|
|
137
|
-
const variables = {
|
|
138
|
-
targetIds,
|
|
139
|
-
customerId,
|
|
140
|
-
evaluationType,
|
|
141
|
-
orgId: this.orgId,
|
|
142
|
-
};
|
|
143
|
-
try {
|
|
144
|
-
const response = yield this.graphqlQueryV2(query, variables);
|
|
145
|
-
return response.getAverageRating;
|
|
146
|
-
}
|
|
147
|
-
catch (error) {
|
|
148
|
-
console.log(`Error in getAverageRating: ${error}`);
|
|
149
|
-
throw error;
|
|
150
|
-
}
|
|
151
|
-
});
|
|
152
|
-
}
|
|
153
|
-
getUrlEvaluation(targetIds, customerId, evaluationType) {
|
|
154
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
155
|
-
const query = queries_1.GET_URL_EVALUATION;
|
|
156
|
-
const variables = {
|
|
157
|
-
targetIds,
|
|
158
|
-
customerId,
|
|
159
|
-
evaluationType,
|
|
160
|
-
orgId: this.orgId,
|
|
161
|
-
};
|
|
162
|
-
try {
|
|
163
|
-
const response = yield this.graphqlQueryV2(query, variables);
|
|
164
|
-
return response.getUrlEvaluation;
|
|
165
|
-
}
|
|
166
|
-
catch (error) {
|
|
167
|
-
console.log(`Error in getUrlEvaluation: ${error}`);
|
|
168
|
-
throw error;
|
|
169
|
-
}
|
|
170
|
-
});
|
|
171
|
-
}
|
|
172
|
-
getNumberOfTicketEvaluation(customerId) {
|
|
173
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
174
|
-
const query = queries_1.GET_NUMBER_OF_TICKET_EVALUATION;
|
|
175
|
-
const variables = {
|
|
176
|
-
customerId,
|
|
177
|
-
orgId: this.orgId,
|
|
178
|
-
};
|
|
179
|
-
try {
|
|
180
|
-
const response = yield this.graphqlQueryV2(query, variables);
|
|
181
|
-
return response.getNumberOfTicketEvaluation;
|
|
182
|
-
}
|
|
183
|
-
catch (error) {
|
|
184
|
-
console.log(`Error in getNumberOfTicketEvaluation: ${error}`);
|
|
185
|
-
throw error;
|
|
186
|
-
}
|
|
187
|
-
});
|
|
188
|
-
}
|
|
189
|
-
searchProductGiftPromotionResponse(parameterSearchProductGift) {
|
|
190
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
191
|
-
// console.log("🚀 ~ CrmCampingService ~ searchProductGiftPromotionResponse ~ parameterSearchProductGift:", parameterSearchProductGift)
|
|
192
|
-
const query = queries_1.SEARCH_PRODUCT_GIFT_PROMOTION_RESPONSE;
|
|
193
|
-
const variables = {
|
|
194
|
-
parameterSearchProductGift: Object.assign({ partyId: this.orgId }, parameterSearchProductGift),
|
|
195
|
-
};
|
|
196
|
-
// console.log(
|
|
197
|
-
// "🚀 ~ CrmCampingService ~ searchProductGiftPromotionResponse ~ variables:",
|
|
198
|
-
// variables
|
|
199
|
-
// );
|
|
200
|
-
try {
|
|
201
|
-
const response = yield this.graphqlQueryV2(query, variables);
|
|
202
|
-
return response.searchProductGiftPromotionResponse;
|
|
203
|
-
}
|
|
204
|
-
catch (error) {
|
|
205
|
-
throw error;
|
|
206
|
-
}
|
|
207
|
-
});
|
|
208
|
-
}
|
|
209
|
-
addProductGiftPromotion(orderId, updatedBy, addData) {
|
|
210
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
211
|
-
const endpoint = `/orders/${this.orgId}/${this.storeId}/${orderId}/orderLineItem?updated_by=${updatedBy}`;
|
|
212
|
-
const method = "POST";
|
|
213
|
-
const data = addData;
|
|
214
|
-
console.log("data in add sdk", data);
|
|
215
|
-
try {
|
|
216
|
-
const response = yield this.restApiCallWithToken(endpoint, method, data);
|
|
217
|
-
console.log(response);
|
|
218
|
-
return response;
|
|
219
|
-
}
|
|
220
|
-
catch (error) {
|
|
221
|
-
console.log(`Error in addProductGiftPromotion: ${error}`);
|
|
222
|
-
throw error;
|
|
223
|
-
}
|
|
224
|
-
});
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
exports.CrmCampingService = CrmCampingService;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { Service } from "../serviceSDK";
|
|
2
|
-
export declare class DnsService extends Service {
|
|
3
|
-
constructor(endpoint: string, orgId: string, storeId: string);
|
|
4
|
-
setToken(token: string): void;
|
|
5
|
-
setStoreId(storeId: string): void;
|
|
6
|
-
getDomain(params: any): Promise<any>;
|
|
7
|
-
}
|