@longvansoftware/service-js-client 1.13.1 → 1.13.3
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/mutations.js +4 -4
- package/dist/src/graphql/crm_camping/queries.js +3 -1
- package/dist/src/graphql/orderGraphQL/queries.d.ts +1 -0
- package/dist/src/graphql/orderGraphQL/queries.js +6 -1
- package/dist/src/lib/auth/index.d.ts +2 -2
- package/dist/src/lib/auth/index.js +4 -2
- package/dist/src/lib/crm_camping/index.d.ts +1 -1
- package/dist/src/lib/crm_camping/index.js +4 -3
- package/dist/src/lib/orderGraphQL/index.d.ts +1 -0
- package/dist/src/lib/orderGraphQL/index.js +17 -0
- package/package.json +1 -1
@@ -190,8 +190,8 @@ exports.LINKING_USER_LOGIN_AND_USER_DETAIL = (0, graphql_tag_1.gql) `
|
|
190
190
|
}
|
191
191
|
`;
|
192
192
|
exports.SEND_OTP = (0, graphql_tag_1.gql) `
|
193
|
-
mutation SendOTP($orgId: String!, $phone: String
|
194
|
-
sendOTP(orgId: $orgId, phone: $phone) {
|
193
|
+
mutation SendOTP($orgId: String!, $phone: String!, $channelType: String) {
|
194
|
+
sendOTP(orgId: $orgId, phone: $phone, channelType: $channelType) {
|
195
195
|
id
|
196
196
|
code
|
197
197
|
username
|
@@ -200,8 +200,8 @@ exports.SEND_OTP = (0, graphql_tag_1.gql) `
|
|
200
200
|
}
|
201
201
|
`;
|
202
202
|
exports.VALIDATE_OTP = (0, graphql_tag_1.gql) `
|
203
|
-
mutation ValidateOTP($otpCode: String!, $phone: String
|
204
|
-
validateOTP(otpCode: $otpCode, phone: $phone)
|
203
|
+
mutation ValidateOTP($otpCode: String!, $phone: String!, $channelType: String) {
|
204
|
+
validateOTP(otpCode: $otpCode, phone: $phone, channelType: $channelType)
|
205
205
|
}
|
206
206
|
`;
|
207
207
|
exports.CREATE_USER_LOGIN = (0, graphql_tag_1.gql) `
|
@@ -82,12 +82,14 @@ exports.GET_CAMPAIGN_ACTION_BY_ID = (0, graphql_tag_1.gql) `
|
|
82
82
|
// }
|
83
83
|
// `;
|
84
84
|
exports.SUGGEST_VOUCHER = (0, graphql_tag_1.gql) `
|
85
|
-
query SuggestVoucher($partyId: String, $excludeExpired: Boolean, $customerId: String) {
|
85
|
+
query SuggestVoucher($partyId: String, $excludeExpired: Boolean, $customerId: String, $scope: String, $isNewCustomer: Boolean) {
|
86
86
|
suggestVoucher(
|
87
87
|
searchVoucherRequest: {
|
88
88
|
partyId: $partyId
|
89
89
|
excludeExpired: $excludeExpired
|
90
90
|
customerId: $customerId
|
91
|
+
scope: $scope
|
92
|
+
isNewCustomer: $isNewCustomer
|
91
93
|
}
|
92
94
|
) {
|
93
95
|
total
|
@@ -2,3 +2,4 @@ export declare const GET_ORDER_DETAIL: import("graphql").DocumentNode;
|
|
2
2
|
export declare const GET_QUANTITY_ORDER_LINEITEMS: import("graphql").DocumentNode;
|
3
3
|
export declare const GET_ORDER_LINE_ITEM_BY_SERVICE_ID: import("graphql").DocumentNode;
|
4
4
|
export declare const GET_ORDER_BY_SERVICE_ID: import("graphql").DocumentNode;
|
5
|
+
export declare const FIND_ORDER_BY_OWNER_PARTYID: import("graphql").DocumentNode;
|
@@ -1,6 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.GET_ORDER_BY_SERVICE_ID = exports.GET_ORDER_LINE_ITEM_BY_SERVICE_ID = exports.GET_QUANTITY_ORDER_LINEITEMS = exports.GET_ORDER_DETAIL = void 0;
|
3
|
+
exports.FIND_ORDER_BY_OWNER_PARTYID = exports.GET_ORDER_BY_SERVICE_ID = exports.GET_ORDER_LINE_ITEM_BY_SERVICE_ID = exports.GET_QUANTITY_ORDER_LINEITEMS = exports.GET_ORDER_DETAIL = void 0;
|
4
4
|
const graphql_tag_1 = require("graphql-tag");
|
5
5
|
exports.GET_ORDER_DETAIL = (0, graphql_tag_1.gql) `
|
6
6
|
query getOrderDetail($orderId: String!) {
|
@@ -371,3 +371,8 @@ exports.GET_ORDER_BY_SERVICE_ID = (0, graphql_tag_1.gql) `
|
|
371
371
|
}
|
372
372
|
}
|
373
373
|
`;
|
374
|
+
exports.FIND_ORDER_BY_OWNER_PARTYID = (0, graphql_tag_1.gql) `
|
375
|
+
query FindOrderByOwnerPartyId($partnerId: String!, $ownerPartyId: String!) {
|
376
|
+
findOrderByOwnerPartyId(partnerId: $partnerId, ownerPartyId: $ownerPartyId)
|
377
|
+
}
|
378
|
+
`;
|
@@ -37,8 +37,8 @@ export declare class AuthService extends Service {
|
|
37
37
|
getUserLoginByUserLoginId(userLoginId: string): Promise<any>;
|
38
38
|
checkUsernameExisted(username: string): Promise<any>;
|
39
39
|
getUserLoginsByPartyId(partyId: string): Promise<any>;
|
40
|
-
sendOTP(phone: string): Promise<any>;
|
41
|
-
validateOTP(otpCode: string, phone: string): Promise<any>;
|
40
|
+
sendOTP(phone: string, channelType: string | null): Promise<any>;
|
41
|
+
validateOTP(otpCode: string, phone: string, channelType: string | null): Promise<any>;
|
42
42
|
createUserLogin(userLoginId: string): Promise<any>;
|
43
43
|
createUserDetailWithoutUserLogin(name: string, phone: string, email: string): Promise<any>;
|
44
44
|
getPhoneByPartyId(partyId: string): Promise<any>;
|
@@ -271,12 +271,13 @@ class AuthService extends serviceSDK_1.Service {
|
|
271
271
|
}
|
272
272
|
});
|
273
273
|
}
|
274
|
-
sendOTP(phone) {
|
274
|
+
sendOTP(phone, channelType) {
|
275
275
|
return __awaiter(this, void 0, void 0, function* () {
|
276
276
|
const mutation = mutations_1.SEND_OTP;
|
277
277
|
const variables = {
|
278
278
|
orgId: this.orgId,
|
279
279
|
phone,
|
280
|
+
channelType
|
280
281
|
};
|
281
282
|
try {
|
282
283
|
const response = yield this.graphqlMutation(mutation, variables);
|
@@ -288,12 +289,13 @@ class AuthService extends serviceSDK_1.Service {
|
|
288
289
|
}
|
289
290
|
});
|
290
291
|
}
|
291
|
-
validateOTP(otpCode, phone) {
|
292
|
+
validateOTP(otpCode, phone, channelType) {
|
292
293
|
return __awaiter(this, void 0, void 0, function* () {
|
293
294
|
const mutation = mutations_1.VALIDATE_OTP;
|
294
295
|
const variables = {
|
295
296
|
otpCode,
|
296
297
|
phone,
|
298
|
+
channelType
|
297
299
|
};
|
298
300
|
try {
|
299
301
|
const response = yield this.graphqlMutation(mutation, variables);
|
@@ -6,6 +6,6 @@ export declare class CrmCampingService extends Service {
|
|
6
6
|
searchProductQuantityPromotionAction(productId: string): Promise<any>;
|
7
7
|
addCustomerToVoucher(userId: string, voucherCode: string): Promise<any>;
|
8
8
|
getCampaignActionById(campaignActionId: string): Promise<any>;
|
9
|
-
suggestVoucher(customerId: string): Promise<any>;
|
9
|
+
suggestVoucher(customerId: string, scope: string | null, isNewCustomer: boolean): Promise<any>;
|
10
10
|
searchVouchers(campaignId: String, campaignActionId: String, campaignActionType: String, customerId: String, pageNumber: number, pageSize: number): Promise<any>;
|
11
11
|
}
|
@@ -89,15 +89,16 @@ class CrmCampingService extends serviceSDK_1.Service {
|
|
89
89
|
// throw error;
|
90
90
|
// }
|
91
91
|
// }
|
92
|
-
suggestVoucher(customerId) {
|
92
|
+
suggestVoucher(customerId, scope, isNewCustomer) {
|
93
93
|
return __awaiter(this, void 0, void 0, function* () {
|
94
94
|
const query = queries_1.SUGGEST_VOUCHER;
|
95
95
|
const variables = {
|
96
96
|
partyId: this.orgId,
|
97
97
|
excludeExpired: true,
|
98
|
-
customerId
|
98
|
+
customerId,
|
99
|
+
scope,
|
100
|
+
isNewCustomer
|
99
101
|
};
|
100
|
-
console.log("cusID sdk", customerId);
|
101
102
|
try {
|
102
103
|
const response = yield this.graphqlQueryV2(query, variables);
|
103
104
|
return response.suggestVoucher;
|
@@ -11,4 +11,5 @@ export declare class OrderGraphQLService extends Service {
|
|
11
11
|
getOrderByServiceId(serviceId: string): Promise<any>;
|
12
12
|
addToCart(serviceId: string, actorId: string, cartId: string): Promise<any>;
|
13
13
|
removeProductOptionOrderLineItem(orderLineItemId: string, optionId: string, updateBy: string): Promise<any>;
|
14
|
+
findOrderByOwnerPartyId(ownerPartyId: string): Promise<any>;
|
14
15
|
}
|
@@ -155,5 +155,22 @@ class OrderGraphQLService extends serviceSDK_1.Service {
|
|
155
155
|
}
|
156
156
|
});
|
157
157
|
}
|
158
|
+
findOrderByOwnerPartyId(ownerPartyId) {
|
159
|
+
return __awaiter(this, void 0, void 0, function* () {
|
160
|
+
const query = queries_1.FIND_ORDER_BY_OWNER_PARTYID;
|
161
|
+
const variables = {
|
162
|
+
partnerId: this.orgId,
|
163
|
+
ownerPartyId,
|
164
|
+
};
|
165
|
+
try {
|
166
|
+
const response = yield this.graphqlQueryV2(query, variables);
|
167
|
+
return response.findOrderByOwnerPartyId;
|
168
|
+
}
|
169
|
+
catch (error) {
|
170
|
+
console.log(`Error in findOrderByOwnerPartyId: ${error}`);
|
171
|
+
throw error;
|
172
|
+
}
|
173
|
+
});
|
174
|
+
}
|
158
175
|
}
|
159
176
|
exports.OrderGraphQLService = OrderGraphQLService;
|