@longvansoftware/service-js-client 1.17.2 → 1.17.4

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.
@@ -6,3 +6,5 @@ export declare const GET_AVERAGE_RATING: import("graphql").DocumentNode;
6
6
  export declare const GET_URL_EVALUATION: import("graphql").DocumentNode;
7
7
  export declare const GET_NUMBER_OF_TICKET_EVALUATION: import("graphql").DocumentNode;
8
8
  export declare const SEARCH_PRODUCT_GIFT_PROMOTION_RESPONSE: import("graphql").DocumentNode;
9
+ export declare const GET_VOUCHERS_V2: import("graphql").DocumentNode;
10
+ export declare const SEARCH_CAMPAIGN: import("graphql").DocumentNode;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SEARCH_PRODUCT_GIFT_PROMOTION_RESPONSE = exports.GET_NUMBER_OF_TICKET_EVALUATION = exports.GET_URL_EVALUATION = exports.GET_AVERAGE_RATING = exports.GET_VOUCHERS = exports.SUGGEST_VOUCHER = exports.GET_CAMPAIGN_ACTION_BY_ID = exports.SEARCH_PRODUCT_QUANTITY_PROMOTION_ACTION = void 0;
3
+ exports.SEARCH_CAMPAIGN = exports.GET_VOUCHERS_V2 = exports.SEARCH_PRODUCT_GIFT_PROMOTION_RESPONSE = exports.GET_NUMBER_OF_TICKET_EVALUATION = exports.GET_URL_EVALUATION = exports.GET_AVERAGE_RATING = exports.GET_VOUCHERS = exports.SUGGEST_VOUCHER = exports.GET_CAMPAIGN_ACTION_BY_ID = exports.SEARCH_PRODUCT_QUANTITY_PROMOTION_ACTION = void 0;
4
4
  const graphql_tag_1 = require("graphql-tag");
5
5
  exports.SEARCH_PRODUCT_QUANTITY_PROMOTION_ACTION = (0, graphql_tag_1.gql) `
6
6
  query SearchProductQuantityPromotionAction(
@@ -280,3 +280,75 @@ exports.SEARCH_PRODUCT_GIFT_PROMOTION_RESPONSE = (0, graphql_tag_1.gql) `
280
280
  }
281
281
  }
282
282
  `;
283
+ exports.GET_VOUCHERS_V2 = (0, graphql_tag_1.gql) `
284
+ query SearchVoucher($searchVoucherRequest: SearchVoucherRequest) {
285
+ searchVoucher(searchVoucherRequest: $searchVoucherRequest) {
286
+ total
287
+ totalPages
288
+ totalElements
289
+ last
290
+ first
291
+ number
292
+ numberOfElements
293
+ size
294
+ empty
295
+ content {
296
+ campaignActionId
297
+ campaignId
298
+ partyId
299
+ voucherCode
300
+ voucherType
301
+ status
302
+ discountAmount
303
+ discountPercent
304
+ usageLimitPerVoucher
305
+ maximumDiscount
306
+ numberOfTimeUsed
307
+ id
308
+ createdStamp
309
+ updatedStamp
310
+ updatedBy
311
+ createdBy
312
+ isBirthday
313
+ customerId
314
+ scope
315
+ }
316
+ }
317
+ }
318
+ `;
319
+ exports.SEARCH_CAMPAIGN = (0, graphql_tag_1.gql) `
320
+ query SearchCampaign($searchCampaignRequest: SearchCampaignRequest) {
321
+ searchCampaign(searchCampaignRequest: $searchCampaignRequest) {
322
+ content {
323
+ id
324
+ createdStamp
325
+ updatedStamp
326
+ updatedBy
327
+ createdBy
328
+ useForAll
329
+ description
330
+ partyId
331
+ name
332
+ type
333
+ domain
334
+ fromDate
335
+ toDate
336
+ status
337
+ }
338
+ total
339
+ totalPages
340
+ totalElements
341
+ last
342
+ first
343
+ number
344
+ numberOfElements
345
+ size
346
+ empty
347
+ sort {
348
+ sorted
349
+ unsorted
350
+ empty
351
+ }
352
+ }
353
+ }
354
+ `;
@@ -13,4 +13,6 @@ export declare class CrmCampingService extends Service {
13
13
  getNumberOfTicketEvaluation(customerId: string): Promise<any>;
14
14
  searchProductGiftPromotionResponse(parameterSearchProductGift: any): Promise<any>;
15
15
  addProductGiftPromotion(orderId: string, updatedBy: string, addData: any): Promise<any>;
16
+ searchVouchersV2(searchVoucherRequest: any): Promise<any>;
17
+ searchCampaign(searchCampaignRequest: any): Promise<any>;
16
18
  }
@@ -223,5 +223,37 @@ class CrmCampingService extends serviceSDK_1.Service {
223
223
  }
224
224
  });
225
225
  }
226
+ searchVouchersV2(searchVoucherRequest) {
227
+ return __awaiter(this, void 0, void 0, function* () {
228
+ const query = queries_1.GET_VOUCHERS_V2;
229
+ const variables = {
230
+ searchVoucherRequest: Object.assign({ partyId: this.orgId }, searchVoucherRequest),
231
+ };
232
+ try {
233
+ const response = yield this.graphqlQuery(query, variables);
234
+ return response.searchVoucher;
235
+ }
236
+ catch (error) {
237
+ console.log(`Error fetching searchVoucher: ${error}`);
238
+ throw error;
239
+ }
240
+ });
241
+ }
242
+ searchCampaign(searchCampaignRequest) {
243
+ return __awaiter(this, void 0, void 0, function* () {
244
+ const query = queries_1.SEARCH_CAMPAIGN;
245
+ const variables = {
246
+ searchCampaignRequest: Object.assign({ partyId: this.orgId }, searchCampaignRequest),
247
+ };
248
+ try {
249
+ const response = yield this.graphqlQuery(query, variables);
250
+ return response.searchCampaign;
251
+ }
252
+ catch (error) {
253
+ console.log(`Error fetching searchCampaign: ${error}`);
254
+ throw error;
255
+ }
256
+ });
257
+ }
226
258
  }
227
259
  exports.CrmCampingService = CrmCampingService;
@@ -3,7 +3,7 @@ export declare class ResourcePermissionService extends Service {
3
3
  constructor(endpoint: string, orgId: string, storeId: string);
4
4
  setToken(token: string): void;
5
5
  setStoreId(storeId: string): void;
6
- shareResource(createModel: any, partnerId: string): Promise<any>;
7
- removeShareParty(resourceId: string, sharePartyId: string, resourceType: string, partnerId: string): Promise<any>;
6
+ shareResource(createModel: any): Promise<any>;
7
+ removeShareParty(resourceId: string, sharePartyId: string, resourceType: string): Promise<any>;
8
8
  getSharedUserByService(resourceType: string, resourceId: string): Promise<any>;
9
9
  }
@@ -23,11 +23,11 @@ class ResourcePermissionService extends serviceSDK_1.Service {
23
23
  setStoreId(storeId) {
24
24
  this.storeId = storeId;
25
25
  }
26
- shareResource(createModel, partnerId) {
26
+ shareResource(createModel) {
27
27
  return __awaiter(this, void 0, void 0, function* () {
28
28
  const mutation = mutations_1.SHARE_RESOURCE;
29
29
  const variables = {
30
- partnerId: partnerId,
30
+ partnerId: this.orgId,
31
31
  createModel,
32
32
  };
33
33
  try {
@@ -40,11 +40,11 @@ class ResourcePermissionService extends serviceSDK_1.Service {
40
40
  }
41
41
  });
42
42
  }
43
- removeShareParty(resourceId, sharePartyId, resourceType, partnerId) {
43
+ removeShareParty(resourceId, sharePartyId, resourceType) {
44
44
  return __awaiter(this, void 0, void 0, function* () {
45
45
  const mutation = mutations_1.REMOVE_SHARE_PARTY;
46
46
  const variables = {
47
- partnerId: partnerId,
47
+ partnerId: this.orgId,
48
48
  orgId: this.orgId,
49
49
  resourceType,
50
50
  resourceId,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@longvansoftware/service-js-client",
3
- "version": "1.17.2",
3
+ "version": "1.17.4",
4
4
  "main": "dist/src/index.js",
5
5
  "types": "dist/src/index.d.ts",
6
6
  "files": [