@longvansoftware/service-js-client 1.6.7 → 1.6.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/src/graphql/auth/queries.d.ts +2 -0
- package/dist/src/graphql/auth/queries.js +11 -1
- package/dist/src/graphql/crm_camping/mutations.d.ts +1 -0
- package/dist/src/graphql/crm_camping/mutations.js +36 -0
- package/dist/src/lib/auth/index.d.ts +2 -0
- package/dist/src/lib/auth/index.js +32 -0
- package/dist/src/lib/crm_camping/index.d.ts +1 -0
- package/dist/src/lib/crm_camping/index.js +20 -1
- package/dist/src/lib/order/index.d.ts +1 -0
- package/dist/src/lib/order/index.js +14 -0
- package/package.json +1 -1
@@ -3,3 +3,5 @@ export declare const GET_USER_LOGIN_BY_TOKEN: import("graphql").DocumentNode;
|
|
3
3
|
export declare const GET_USER_LOGIN_BY_USER_LOGIN_ID: import("graphql").DocumentNode;
|
4
4
|
export declare const CHECK_USERNAME_EXISTED: import("graphql").DocumentNode;
|
5
5
|
export declare const GET_USER_LOGIN_BY_PARTY_ID: import("graphql").DocumentNode;
|
6
|
+
export declare const GET_PHONE_BY_PARTYID: import("graphql").DocumentNode;
|
7
|
+
export declare const GET_EMAIL_BY_PARTYID: import("graphql").DocumentNode;
|
@@ -1,6 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.GET_USER_LOGIN_BY_PARTY_ID = exports.CHECK_USERNAME_EXISTED = exports.GET_USER_LOGIN_BY_USER_LOGIN_ID = exports.GET_USER_LOGIN_BY_TOKEN = exports.GET_USER_DETAIL = void 0;
|
3
|
+
exports.GET_EMAIL_BY_PARTYID = exports.GET_PHONE_BY_PARTYID = exports.GET_USER_LOGIN_BY_PARTY_ID = exports.CHECK_USERNAME_EXISTED = exports.GET_USER_LOGIN_BY_USER_LOGIN_ID = exports.GET_USER_LOGIN_BY_TOKEN = exports.GET_USER_DETAIL = void 0;
|
4
4
|
const graphql_tag_1 = require("graphql-tag");
|
5
5
|
exports.GET_USER_DETAIL = (0, graphql_tag_1.gql) `
|
6
6
|
query GetUserDetail($orgId: String!, $accessToken: String!) {
|
@@ -63,3 +63,13 @@ exports.GET_USER_LOGIN_BY_PARTY_ID = (0, graphql_tag_1.gql) `
|
|
63
63
|
}
|
64
64
|
}
|
65
65
|
`;
|
66
|
+
exports.GET_PHONE_BY_PARTYID = (0, graphql_tag_1.gql) `
|
67
|
+
query GetPhoneByPartyId($partyId: String!) {
|
68
|
+
getPhoneByPartyId(partyId: $partyId)
|
69
|
+
}
|
70
|
+
`;
|
71
|
+
exports.GET_EMAIL_BY_PARTYID = (0, graphql_tag_1.gql) `
|
72
|
+
query GetEmailByPartyId($partyId: String!) {
|
73
|
+
getEmailByPartyId(partyId: $partyId)
|
74
|
+
}
|
75
|
+
`;
|
@@ -0,0 +1 @@
|
|
1
|
+
export declare const ADD_CUSTOMER_TO_VOUCHER: import("graphql").DocumentNode;
|
@@ -0,0 +1,36 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.ADD_CUSTOMER_TO_VOUCHER = void 0;
|
4
|
+
const graphql_tag_1 = require("graphql-tag");
|
5
|
+
exports.ADD_CUSTOMER_TO_VOUCHER = (0, graphql_tag_1.gql) `
|
6
|
+
mutation AddCustomerToVoucher(
|
7
|
+
$partyId: String!
|
8
|
+
$userId: String!
|
9
|
+
$campaignActionId: String!
|
10
|
+
) {
|
11
|
+
addCustomerToVoucher(
|
12
|
+
partyId: $partyId
|
13
|
+
userId: $userId
|
14
|
+
campaignActionId: $campaignActionId
|
15
|
+
) {
|
16
|
+
campaignActionId
|
17
|
+
campaignId
|
18
|
+
partyId
|
19
|
+
voucherCode
|
20
|
+
voucherType
|
21
|
+
status
|
22
|
+
discountAmount
|
23
|
+
discountPercent
|
24
|
+
usageLimitPerVoucher
|
25
|
+
maximumDiscount
|
26
|
+
numberOfTimeUsed
|
27
|
+
id
|
28
|
+
createdStamp
|
29
|
+
updatedStamp
|
30
|
+
updatedBy
|
31
|
+
createdBy
|
32
|
+
isBirthday
|
33
|
+
customerId
|
34
|
+
}
|
35
|
+
}
|
36
|
+
`;
|
@@ -40,4 +40,6 @@ export declare class AuthService extends Service {
|
|
40
40
|
validateOTP(otpCode: string, phone: string): Promise<any>;
|
41
41
|
createUserLogin(userLoginId: string): Promise<any>;
|
42
42
|
createUserDetailWithoutUserLogin(name: string, phone: string, email: string): Promise<any>;
|
43
|
+
getPhoneByPartyId(partyId: string): Promise<any>;
|
44
|
+
getEmailByPartyId(partyId: string): Promise<any>;
|
43
45
|
}
|
@@ -309,5 +309,37 @@ class AuthService extends serviceSDK_1.Service {
|
|
309
309
|
}
|
310
310
|
});
|
311
311
|
}
|
312
|
+
getPhoneByPartyId(partyId) {
|
313
|
+
return __awaiter(this, void 0, void 0, function* () {
|
314
|
+
const query = queries_1.GET_PHONE_BY_PARTYID;
|
315
|
+
const variables = {
|
316
|
+
partyId,
|
317
|
+
};
|
318
|
+
try {
|
319
|
+
const response = yield this.graphqlQuery(query, variables);
|
320
|
+
return response.getPhoneByPartyId;
|
321
|
+
}
|
322
|
+
catch (error) {
|
323
|
+
console.log(`Error in getPhoneByPartyId: ${error}`);
|
324
|
+
throw error;
|
325
|
+
}
|
326
|
+
});
|
327
|
+
}
|
328
|
+
getEmailByPartyId(partyId) {
|
329
|
+
return __awaiter(this, void 0, void 0, function* () {
|
330
|
+
const query = queries_1.GET_EMAIL_BY_PARTYID;
|
331
|
+
const variables = {
|
332
|
+
partyId,
|
333
|
+
};
|
334
|
+
try {
|
335
|
+
const response = yield this.graphqlQuery(query, variables);
|
336
|
+
return response.getEmailByPartyId;
|
337
|
+
}
|
338
|
+
catch (error) {
|
339
|
+
console.log(`Error in getEmailByPartyId: ${error}`);
|
340
|
+
throw error;
|
341
|
+
}
|
342
|
+
});
|
343
|
+
}
|
312
344
|
}
|
313
345
|
exports.AuthService = AuthService;
|
@@ -4,4 +4,5 @@ export declare class CrmCampingService extends Service {
|
|
4
4
|
setToken(token: string): void;
|
5
5
|
setStoreId(storeId: string): void;
|
6
6
|
searchProductQuantityPromotionAction(productId: string): Promise<any>;
|
7
|
+
addCustomerToVoucher(userId: string, campaignActionId: string): Promise<any>;
|
7
8
|
}
|
@@ -10,6 +10,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
10
10
|
};
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
12
12
|
exports.CrmCampingService = void 0;
|
13
|
+
const mutations_1 = require("../../graphql/crm_camping/mutations");
|
13
14
|
const queries_1 = require("../../graphql/crm_camping/queries");
|
14
15
|
const serviceSDK_1 = require("../serviceSDK");
|
15
16
|
class CrmCampingService extends serviceSDK_1.Service {
|
@@ -28,7 +29,7 @@ class CrmCampingService extends serviceSDK_1.Service {
|
|
28
29
|
const variables = {
|
29
30
|
productId,
|
30
31
|
partyId: this.orgId,
|
31
|
-
storeChannel: this.storeId
|
32
|
+
storeChannel: this.storeId,
|
32
33
|
};
|
33
34
|
try {
|
34
35
|
const response = yield this.graphqlQueryV2(query, variables);
|
@@ -40,5 +41,23 @@ class CrmCampingService extends serviceSDK_1.Service {
|
|
40
41
|
}
|
41
42
|
});
|
42
43
|
}
|
44
|
+
addCustomerToVoucher(userId, campaignActionId) {
|
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
|
+
campaignActionId,
|
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
|
+
}
|
43
62
|
}
|
44
63
|
exports.CrmCampingService = CrmCampingService;
|
@@ -468,4 +468,5 @@ export declare class OrderService extends Service {
|
|
468
468
|
* @throws If an error occurs while updating the customer and shipping address.
|
469
469
|
*/
|
470
470
|
addProductInOrderWithoutLogin(orderId: string, updated_by: string, data: any, store: string): Promise<any>;
|
471
|
+
findCampaignActionGiftVoucher(): Promise<any>;
|
471
472
|
}
|
@@ -1249,5 +1249,19 @@ class OrderService extends serviceSDK_1.Service {
|
|
1249
1249
|
}
|
1250
1250
|
});
|
1251
1251
|
}
|
1252
|
+
findCampaignActionGiftVoucher() {
|
1253
|
+
return __awaiter(this, void 0, void 0, function* () {
|
1254
|
+
const endpoint = `/orders/${this.orgId}/findCampaignActionGiftVoucher`;
|
1255
|
+
const method = "GET";
|
1256
|
+
try {
|
1257
|
+
const response = yield this.restApiCallWithToken(endpoint, method);
|
1258
|
+
return response;
|
1259
|
+
}
|
1260
|
+
catch (error) {
|
1261
|
+
console.log(`Error in deleteNoteWithoutLogin: ${error}`);
|
1262
|
+
throw error;
|
1263
|
+
}
|
1264
|
+
});
|
1265
|
+
}
|
1252
1266
|
}
|
1253
1267
|
exports.OrderService = OrderService;
|