@longvansoftware/storefront-js-client 3.4.6 → 3.4.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/config/config.js +2 -2
- package/dist/src/graphql/accounting_service/mutations.d.ts +2 -0
- package/dist/src/graphql/accounting_service/mutations.js +102 -0
- package/dist/src/graphql/accounting_service/queries.d.ts +1 -0
- package/dist/src/graphql/accounting_service/queries.js +62 -0
- package/dist/src/graphql/auth/mutations.d.ts +3 -0
- package/dist/src/graphql/auth/mutations.js +41 -3
- package/dist/src/graphql/crm_camping/mutations.d.ts +1 -0
- package/dist/src/graphql/crm_camping/mutations.js +37 -0
- package/dist/src/graphql/crm_camping/queries.d.ts +8 -0
- package/dist/src/graphql/crm_camping/queries.js +279 -0
- package/dist/src/graphql/orderGraphQL/mutations.d.ts +4 -0
- package/dist/src/graphql/orderGraphQL/mutations.js +359 -0
- package/dist/src/graphql/orderGraphQL/queries.d.ts +7 -0
- package/dist/src/graphql/orderGraphQL/queries.js +402 -0
- package/dist/src/graphql/paymentLV/mutations.d.ts +2 -0
- package/dist/src/graphql/paymentLV/mutations.js +25 -0
- package/dist/src/graphql/paymentLV/queries.d.ts +4 -0
- package/dist/src/graphql/paymentLV/queries.js +83 -0
- package/dist/src/graphql/quicklab_service/mutations.d.ts +8 -0
- package/dist/src/graphql/quicklab_service/mutations.js +171 -0
- package/dist/src/graphql/quicklab_service/queries.d.ts +6 -0
- package/dist/src/graphql/quicklab_service/queries.js +121 -0
- package/dist/src/graphql/resource_permission/mutations.d.ts +2 -0
- package/dist/src/graphql/resource_permission/mutations.js +63 -0
- package/dist/src/graphql/resource_permission/queries.d.ts +1 -0
- package/dist/src/graphql/resource_permission/queries.js +18 -0
- package/dist/src/lib/accounting_service/index.d.ts +9 -0
- package/dist/src/lib/accounting_service/index.js +69 -0
- package/dist/src/lib/auth/index.d.ts +7 -3
- package/dist/src/lib/auth/index.js +68 -3
- package/dist/src/lib/cloud_rest/index.d.ts +17 -0
- package/dist/src/lib/cloud_rest/index.js +101 -0
- package/dist/src/lib/crm_camping/index.d.ts +16 -0
- package/dist/src/lib/crm_camping/index.js +227 -0
- package/dist/src/lib/dns/index.d.ts +7 -0
- package/dist/src/lib/dns/index.js +40 -0
- package/dist/src/lib/fileService/index.js +2 -2
- package/dist/src/lib/orderGraphQL/index.d.ts +16 -0
- package/dist/src/lib/orderGraphQL/index.js +192 -0
- package/dist/src/lib/order_cloud_rest/index.d.ts +7 -0
- package/dist/src/lib/order_cloud_rest/index.js +39 -0
- package/dist/src/lib/paymentLV/index.d.ts +12 -0
- package/dist/src/lib/paymentLV/index.js +132 -0
- package/dist/src/lib/quicklab_service/index.d.ts +18 -0
- package/dist/src/lib/quicklab_service/index.js +197 -0
- package/dist/src/lib/resource_permission/index.d.ts +9 -0
- package/dist/src/lib/resource_permission/index.js +81 -0
- package/package.json +1 -1
|
@@ -0,0 +1,121 @@
|
|
|
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
|
+
`;
|
|
@@ -0,0 +1,63 @@
|
|
|
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
|
+
`;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const GET_SHARED_USER_BY_SERVICE: import("graphql").DocumentNode;
|
|
@@ -0,0 +1,18 @@
|
|
|
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
|
+
`;
|
|
@@ -0,0 +1,9 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
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;
|
|
@@ -92,7 +92,8 @@ export declare class AuthService extends Service {
|
|
|
92
92
|
* @returns A promise that resolves to the result of the sendOTP mutation.
|
|
93
93
|
* @throws Will throw an error if the GraphQL mutation fails.
|
|
94
94
|
*/
|
|
95
|
-
sendOTP(phone: string, type?:
|
|
95
|
+
sendOTP(phone: string, type?: "SMS" | "ZALO"): Promise<SendOTPResponse>;
|
|
96
|
+
sendOTPV2(orgId: String, phone: string, type?: "SMS" | "ZALO"): Promise<SendOTPResponse>;
|
|
96
97
|
/**
|
|
97
98
|
* Validates OTP code for the specified phone number.
|
|
98
99
|
*
|
|
@@ -102,7 +103,7 @@ export declare class AuthService extends Service {
|
|
|
102
103
|
* @returns A promise that resolves to the result of the validateOTP mutation.
|
|
103
104
|
* @throws Will throw an error if the GraphQL mutation fails.
|
|
104
105
|
*/
|
|
105
|
-
validateOTP(otpCode: string, phone: string, type?:
|
|
106
|
+
validateOTP(otpCode: string, phone: string, type?: "SMS" | "ZALO"): Promise<ValidateOTPResponse>;
|
|
106
107
|
/**
|
|
107
108
|
* Gets access token by validating OTP code for the specified phone number.
|
|
108
109
|
* This function validates the OTP and returns an access token if successful.
|
|
@@ -113,7 +114,7 @@ export declare class AuthService extends Service {
|
|
|
113
114
|
* @returns A promise that resolves to an object containing the access token.
|
|
114
115
|
* @throws Will throw an error if the GraphQL query fails.
|
|
115
116
|
*/
|
|
116
|
-
getAccessTokenByOTP(otpCode: string, phone: string, type?:
|
|
117
|
+
getAccessTokenByOTP(otpCode: string, phone: string, type?: "SMS" | "ZALO"): Promise<GetAccessTokenByOTPResponse>;
|
|
117
118
|
/**
|
|
118
119
|
* Creates/sets a password for a user using the updateInfo mutation.
|
|
119
120
|
* Uses the SDK's internal orgId and token (accessToken).
|
|
@@ -134,4 +135,7 @@ export declare class AuthService extends Service {
|
|
|
134
135
|
* @throws Will throw an error if the GraphQL mutation fails.
|
|
135
136
|
*/
|
|
136
137
|
updateInfo(updateUserRequest?: any, type?: string, password?: string): Promise<UpdateInfoResponse>;
|
|
138
|
+
createResetKey(userLoginId: string): Promise<any>;
|
|
139
|
+
checkResetKey(resetKey: string): Promise<any>;
|
|
140
|
+
resetPasswordV2(orgId: string, username: string, newPassword: string, accessToken: string): Promise<any>;
|
|
137
141
|
}
|
|
@@ -408,7 +408,24 @@ class AuthService extends serviceSDK_1.Service {
|
|
|
408
408
|
const variables = {
|
|
409
409
|
orgId: this.orgId,
|
|
410
410
|
phone,
|
|
411
|
-
channelType: type ||
|
|
411
|
+
channelType: type || "SMS", // Default to SMS if not specified
|
|
412
|
+
};
|
|
413
|
+
try {
|
|
414
|
+
const response = yield this.graphqlMutation(mutations_1.SEND_OTP_MUTATION, variables);
|
|
415
|
+
return response.sendOTP;
|
|
416
|
+
}
|
|
417
|
+
catch (error) {
|
|
418
|
+
console.log(`Error in sendOTP: ${error}`);
|
|
419
|
+
throw error;
|
|
420
|
+
}
|
|
421
|
+
});
|
|
422
|
+
}
|
|
423
|
+
sendOTPV2(orgId, phone, type) {
|
|
424
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
425
|
+
const variables = {
|
|
426
|
+
orgId: orgId,
|
|
427
|
+
phone,
|
|
428
|
+
channelType: type || "SMS", // Default to SMS if not specified
|
|
412
429
|
};
|
|
413
430
|
try {
|
|
414
431
|
const response = yield this.graphqlMutation(mutations_1.SEND_OTP_MUTATION, variables);
|
|
@@ -434,7 +451,7 @@ class AuthService extends serviceSDK_1.Service {
|
|
|
434
451
|
const variables = {
|
|
435
452
|
otpCode,
|
|
436
453
|
phone,
|
|
437
|
-
channelType: type ||
|
|
454
|
+
channelType: type || "SMS",
|
|
438
455
|
};
|
|
439
456
|
try {
|
|
440
457
|
const response = yield this.graphqlMutation(mutations_1.VALIDATE_OTP_MUTATION, variables);
|
|
@@ -461,7 +478,7 @@ class AuthService extends serviceSDK_1.Service {
|
|
|
461
478
|
const variables = {
|
|
462
479
|
otpCode,
|
|
463
480
|
phone,
|
|
464
|
-
channelType: type ||
|
|
481
|
+
channelType: type || "SMS",
|
|
465
482
|
};
|
|
466
483
|
try {
|
|
467
484
|
const response = yield this.graphqlQuery(queries_1.GET_ACCESS_TOKEN_BY_OTP_QUERY, variables);
|
|
@@ -527,5 +544,53 @@ class AuthService extends serviceSDK_1.Service {
|
|
|
527
544
|
}
|
|
528
545
|
});
|
|
529
546
|
}
|
|
547
|
+
createResetKey(userLoginId) {
|
|
548
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
549
|
+
const mutation = mutations_1.CREATE_RESET_KEY;
|
|
550
|
+
const variables = {
|
|
551
|
+
userLoginId,
|
|
552
|
+
};
|
|
553
|
+
try {
|
|
554
|
+
const response = yield this.graphqlMutation(mutation, variables);
|
|
555
|
+
return response.createResetKey;
|
|
556
|
+
}
|
|
557
|
+
catch (error) {
|
|
558
|
+
throw error;
|
|
559
|
+
}
|
|
560
|
+
});
|
|
561
|
+
}
|
|
562
|
+
checkResetKey(resetKey) {
|
|
563
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
564
|
+
const mutations = mutations_1.CHECK_RESET_KEY;
|
|
565
|
+
const variables = {
|
|
566
|
+
resetKey,
|
|
567
|
+
};
|
|
568
|
+
try {
|
|
569
|
+
const response = yield this.graphqlMutation(mutations, variables);
|
|
570
|
+
return response.checkResetKey;
|
|
571
|
+
}
|
|
572
|
+
catch (error) {
|
|
573
|
+
throw error;
|
|
574
|
+
}
|
|
575
|
+
});
|
|
576
|
+
}
|
|
577
|
+
resetPasswordV2(orgId, username, newPassword, accessToken) {
|
|
578
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
579
|
+
const mutation = mutations_1.RESET_PASSWORD;
|
|
580
|
+
const variables = {
|
|
581
|
+
orgId,
|
|
582
|
+
username,
|
|
583
|
+
newPassword,
|
|
584
|
+
accessToken
|
|
585
|
+
};
|
|
586
|
+
try {
|
|
587
|
+
const response = yield this.graphqlMutation(mutation, variables);
|
|
588
|
+
return response.resetPasswordV2;
|
|
589
|
+
}
|
|
590
|
+
catch (error) {
|
|
591
|
+
throw error;
|
|
592
|
+
}
|
|
593
|
+
});
|
|
594
|
+
}
|
|
530
595
|
}
|
|
531
596
|
exports.AuthService = AuthService;
|
|
@@ -0,0 +1,17 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,101 @@
|
|
|
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;
|
|
@@ -0,0 +1,16 @@
|
|
|
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
|
+
}
|