@longvansoftware/service-js-client 1.17.7 → 1.17.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.
@@ -359,7 +359,6 @@ exports.GET_ELASTIC_CLOUD_RESOURCE = (0, graphql_tag_1.gql) `
359
359
  size
360
360
  used
361
361
  }
362
- provinces
363
362
  }
364
363
  }
365
364
  `;
@@ -83,10 +83,22 @@ exports.GET_CAMPAIGN_ACTION_BY_ID = (0, graphql_tag_1.gql) `
83
83
  // `;
84
84
  exports.SUGGEST_VOUCHER = (0, graphql_tag_1.gql) `
85
85
  query SuggestVoucher(
86
- $searchVoucherRequest: SearchVoucherRequest
86
+ $partyId: String
87
+ $excludeExpired: Boolean
88
+ $customerId: String
89
+ $scope: String
90
+ $isNewCustomer: Boolean
91
+ $scopeIgnore: String
87
92
  ) {
88
93
  suggestVoucher(
89
- searchVoucherRequest: $searchVoucherRequest
94
+ searchVoucherRequest: {
95
+ partyId: $partyId
96
+ excludeExpired: $excludeExpired
97
+ customerId: $customerId
98
+ scope: $scope
99
+ isNewCustomer: $isNewCustomer
100
+ scopeIgnore: $scopeIgnore
101
+ }
90
102
  ) {
91
103
  total
92
104
  totalPages
@@ -234,6 +246,9 @@ exports.SEARCH_PRODUCT_GIFT_PROMOTION_RESPONSE = (0, graphql_tag_1.gql) `
234
246
  searchProductGiftPromotionResponse(
235
247
  parameterSearchProductGift: $parameterSearchProductGift
236
248
  ) {
249
+ total
250
+ totalPages
251
+ totalElements
237
252
  content {
238
253
  id
239
254
  partyId
@@ -245,39 +260,20 @@ exports.SEARCH_PRODUCT_GIFT_PROMOTION_RESPONSE = (0, graphql_tag_1.gql) `
245
260
  giftPromotions {
246
261
  fromQuantity
247
262
  toProductId
248
- toProductParentId
249
263
  toQuantity
250
- priceType
251
264
  productName
252
265
  sku
253
266
  featureImage
254
- unit
255
267
  }
256
- unit
257
268
  campaignActionName
258
269
  startDate
259
270
  endDate
260
271
  newCustomer
261
- minimumSpend
262
272
  createdStamp
263
273
  updatedStamp
264
274
  updatedBy
265
275
  createdBy
266
276
  }
267
- total
268
- totalPages
269
- totalElements
270
- last
271
- first
272
- number
273
- numberOfElements
274
- size
275
- empty
276
- sort {
277
- sorted
278
- unsorted
279
- empty
280
- }
281
277
  }
282
278
  }
283
279
  `;
@@ -313,12 +309,13 @@ exports.GET_VOUCHERS_V2 = (0, graphql_tag_1.gql) `
313
309
  isBirthday
314
310
  customerId
315
311
  scope
312
+ maximumDiscountType
316
313
  }
317
314
  }
318
315
  }
319
316
  `;
320
317
  exports.SEARCH_CAMPAIGN = (0, graphql_tag_1.gql) `
321
- query SearchCampaign($searchCampaignRequest: SearchCampaignRequest) {
318
+ query SearchCampaign($searchCampaignRequest: SearchCampaignRequest) {
322
319
  searchCampaign(searchCampaignRequest: $searchCampaignRequest) {
323
320
  content {
324
321
  id
@@ -330,9 +330,6 @@ exports.ADD_TO_CART = (0, graphql_tag_1.gql) `
330
330
  quantity
331
331
  unit
332
332
  productId
333
- unitGift
334
- giftDuration
335
- giftDurationUnit
336
333
  }
337
334
  resourceConfigs {
338
335
  name
@@ -113,8 +113,6 @@ exports.GET_ORDER_DETAIL = (0, graphql_tag_1.gql) `
113
113
  currencyCode
114
114
  }
115
115
  orderLineItemParentId
116
- giftConditionProductId
117
- giftQuantity
118
116
  variant {
119
117
  id
120
118
  price {
@@ -137,46 +135,18 @@ exports.GET_ORDER_DETAIL = (0, graphql_tag_1.gql) `
137
135
  value
138
136
  title
139
137
  }
138
+ resourceItems {
139
+ name
140
+ quantity
141
+ unit
142
+ productId
143
+ }
140
144
  resourceConfigs {
141
- name
142
- quantity
143
- unit
144
- productId
145
- giftProductId
146
- gift
147
- giftQuantity
148
- campaignId
149
- campaignActionId
150
- qualify
151
- idParent
152
- addQuantity
153
- defaultQuantity
154
- title
155
- price
156
- unitPrice
157
- totalResource
158
- }
159
- resourceItems {
160
- name
161
- quantity
162
- unit
163
- productId
164
- giftProductId
165
- gift
166
- giftQuantity
167
- campaignId
168
- campaignActionId
169
- qualify
170
- idParent
171
- addQuantity
172
- defaultQuantity
173
- title
174
- price
175
- unitPrice
176
- totalResource
177
- unitGift
178
- giftDuration
179
- }
145
+ name
146
+ quantity
147
+ unit
148
+ productId
149
+ }
180
150
  itemType
181
151
  }
182
152
  serviceId
@@ -211,7 +181,6 @@ exports.GET_QUANTITY_ORDER_LINEITEMS = (0, graphql_tag_1.gql) `
211
181
  }
212
182
  itemType
213
183
  orderLineItemParentId
214
- giftConditionProductId
215
184
  }
216
185
  }
217
186
  }
@@ -271,8 +240,6 @@ exports.GET_ORDER_LINE_ITEM_BY_SERVICE_ID = (0, graphql_tag_1.gql) `
271
240
  updatedStamp
272
241
  completedAt
273
242
  orderLineItemParentId
274
- giftConditionProductId
275
- giftQuantity
276
243
  orderStatus
277
244
  totalVAT {
278
245
  amount
@@ -93,15 +93,12 @@ class CrmCampingService extends serviceSDK_1.Service {
93
93
  return __awaiter(this, void 0, void 0, function* () {
94
94
  const query = queries_1.SUGGEST_VOUCHER;
95
95
  const variables = {
96
- searchVoucherRequest: {
97
- partyId: this.orgId,
98
- excludeExpired: true,
99
- customerId,
100
- scope,
101
- isNewCustomer,
102
- scopeIgnore,
103
- isPageAble: false,
104
- },
96
+ partyId: this.orgId,
97
+ excludeExpired: true,
98
+ customerId,
99
+ scope,
100
+ isNewCustomer,
101
+ scopeIgnore,
105
102
  };
106
103
  try {
107
104
  const response = yield this.graphqlQueryV2(query, variables);
@@ -471,6 +471,4 @@ export declare class OrderService extends Service {
471
471
  addProductInOrderWithoutLogin(orderId: string, updated_by: string, data: any, store: string): Promise<any>;
472
472
  findCampaignActionGiftVoucher(): Promise<any>;
473
473
  addProductGiftPromotion(orderId: string, updatedBy: string, data: any): Promise<any>;
474
- removeProductGiftPromotion(orderId: string, orderLineItemId: string): Promise<any>;
475
- checkNewCustomer(orderId: string, customer_id: string): Promise<any>;
476
474
  }
@@ -1295,40 +1295,5 @@ class OrderService extends serviceSDK_1.Service {
1295
1295
  }
1296
1296
  });
1297
1297
  }
1298
- // https://storefront.dev.longvan.vn/swagger-ui/index.html#/Order%20API/removeGiftQuantity
1299
- removeProductGiftPromotion(orderId, orderLineItemId) {
1300
- return __awaiter(this, void 0, void 0, function* () {
1301
- console.log("🚀 ~ OrderService ~ removeProductGiftPromotion ~ orderLineItemId:", orderLineItemId);
1302
- console.log("🚀 ~ OrderService ~ removeProductGiftPromotion ~ orderId:", orderId);
1303
- const endpoint = `/orders/${this.orgId}/${orderId}/${orderLineItemId}/giftQuantity`;
1304
- const method = "PUT";
1305
- try {
1306
- const response = yield this.restApiCallWithToken(endpoint, method);
1307
- console.log(response);
1308
- return response;
1309
- }
1310
- catch (error) {
1311
- console.log(`Error in removeProductGiftPromotion: ${error}`);
1312
- throw error;
1313
- }
1314
- });
1315
- }
1316
- checkNewCustomer(orderId, customer_id) {
1317
- return __awaiter(this, void 0, void 0, function* () {
1318
- console.log("🚀 ~ OrderService ~ removeProductGiftPromotion ~ orderLineItemId:", customer_id);
1319
- console.log("🚀 ~ OrderService ~ removeProductGiftPromotion ~ orderId:", orderId);
1320
- const endpoint = `/front/orders/${this.orgId}/${customer_id}/${orderId}/newCustomer`;
1321
- const method = "GET";
1322
- try {
1323
- const response = yield this.restApiCallWithToken(endpoint, method);
1324
- console.log(response);
1325
- return response;
1326
- }
1327
- catch (error) {
1328
- console.log(`Error in removeProductGiftPromotion: ${error}`);
1329
- throw error;
1330
- }
1331
- });
1332
- }
1333
1298
  }
1334
1299
  exports.OrderService = OrderService;
@@ -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): Promise<any>;
7
- removeShareParty(resourceId: string, sharePartyId: string, resourceType: string): Promise<any>;
6
+ shareResource(createModel: any, partnerId: string): Promise<any>;
7
+ removeShareParty(resourceId: string, sharePartyId: string, resourceType: string, partnerId: 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) {
26
+ shareResource(createModel, partnerId) {
27
27
  return __awaiter(this, void 0, void 0, function* () {
28
28
  const mutation = mutations_1.SHARE_RESOURCE;
29
29
  const variables = {
30
- partnerId: this.orgId,
30
+ partnerId: partnerId,
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) {
43
+ removeShareParty(resourceId, sharePartyId, resourceType, partnerId) {
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: this.orgId,
47
+ partnerId: partnerId,
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.7",
3
+ "version": "1.17.9",
4
4
  "main": "dist/src/index.js",
5
5
  "types": "dist/src/index.d.ts",
6
6
  "files": [