@longvansoftware/service-js-client 1.13.2 → 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.
@@ -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
@@ -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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@longvansoftware/service-js-client",
3
- "version": "1.13.2",
3
+ "version": "1.13.3",
4
4
  "main": "dist/src/index.js",
5
5
  "types": "dist/src/index.d.ts",
6
6
  "files": [