@longvansoftware/storefront-js-client 4.6.6 → 4.6.8

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.
@@ -19,4 +19,5 @@ export declare class CampaignService extends Service {
19
19
  searchProductGiftPromotionResponse(productIds: string[], campaignActionId: string): Promise<any>;
20
20
  getCampaign(id: string): Promise<any>;
21
21
  searchProductPricePromotionResponse(campaignId: string, campaignActionId: string, statusActive: string): Promise<any>;
22
+ voucherForUserRequest(orderId: string, customerId?: string, paymentMethodId?: string, shippingCompanyId?: string, pageNumber?: number, pageSize?: number, fields?: string[]): Promise<any>;
22
23
  }
@@ -30,7 +30,7 @@ class CampaignService extends serviceSDK_1.Service {
30
30
  partyId: this.orgId,
31
31
  productStoreId: this.storeId,
32
32
  customerId,
33
- campaignActionType,
33
+ campaignActionType
34
34
  };
35
35
  try {
36
36
  const response = yield this.graphqlQuery(query, variables);
@@ -54,7 +54,7 @@ class CampaignService extends serviceSDK_1.Service {
54
54
  customerId,
55
55
  excludeExpired,
56
56
  pageNumber,
57
- pageSize,
57
+ pageSize
58
58
  };
59
59
  try {
60
60
  const response = yield this.graphqlQuery(query, variables);
@@ -73,7 +73,7 @@ class CampaignService extends serviceSDK_1.Service {
73
73
  partyId: this.orgId,
74
74
  productStoreId: this.storeId,
75
75
  customerId,
76
- voucherCode,
76
+ voucherCode
77
77
  };
78
78
  try {
79
79
  const response = yield this.graphqlQuery(query, variables);
@@ -92,7 +92,7 @@ class CampaignService extends serviceSDK_1.Service {
92
92
  partyId: this.orgId,
93
93
  productStoreId: this.storeId,
94
94
  campaignActionType,
95
- customerId,
95
+ customerId
96
96
  };
97
97
  try {
98
98
  const response = yield this.graphqlQuery(query, variables);
@@ -110,7 +110,7 @@ class CampaignService extends serviceSDK_1.Service {
110
110
  partyId: this.orgId,
111
111
  productStoreId: this.storeId,
112
112
  productId,
113
- productPrice,
113
+ productPrice
114
114
  };
115
115
  try {
116
116
  const response = yield this.graphqlQuery(query, variables);
@@ -131,7 +131,7 @@ class CampaignService extends serviceSDK_1.Service {
131
131
  campaignActionId,
132
132
  customerId,
133
133
  excludeExpired,
134
- isPageAble,
134
+ isPageAble
135
135
  };
136
136
  try {
137
137
  const response = yield this.graphqlQuery(query, variables);
@@ -149,7 +149,7 @@ class CampaignService extends serviceSDK_1.Service {
149
149
  partyId: this.orgId,
150
150
  voucherCode,
151
151
  userId,
152
- affiliateId,
152
+ affiliateId
153
153
  };
154
154
  try {
155
155
  const response = yield this.graphqlMutation(query, variables);
@@ -169,7 +169,7 @@ class CampaignService extends serviceSDK_1.Service {
169
169
  campaignId: campaignId,
170
170
  campaignActionId: campaignActionId,
171
171
  excludeExpired: true,
172
- isBirthday: isBirthday,
172
+ isBirthday: isBirthday
173
173
  };
174
174
  try {
175
175
  const response = yield this.graphqlQuery(query, variables);
@@ -184,7 +184,7 @@ class CampaignService extends serviceSDK_1.Service {
184
184
  return __awaiter(this, void 0, void 0, function* () {
185
185
  const query = queries_1.GET_CAMPAIGN_ACTION_BY_ID;
186
186
  const variables = {
187
- id,
187
+ id
188
188
  };
189
189
  try {
190
190
  const response = yield this.graphqlQuery(query, variables);
@@ -203,7 +203,7 @@ class CampaignService extends serviceSDK_1.Service {
203
203
  storeId: this.storeId,
204
204
  productIds: productIds,
205
205
  campaignActionId: campaignActionId,
206
- sort: { asc: true, key: "createdStamp" },
206
+ sort: { asc: true, key: "createdStamp" }
207
207
  };
208
208
  try {
209
209
  const response = yield this.graphqlQuery(query, variables);
@@ -218,7 +218,7 @@ class CampaignService extends serviceSDK_1.Service {
218
218
  return __awaiter(this, void 0, void 0, function* () {
219
219
  const query = queries_1.GET_CAMPAIGN;
220
220
  const variables = {
221
- id,
221
+ id
222
222
  };
223
223
  try {
224
224
  const response = yield this.graphqlQuery(query, variables);
@@ -237,7 +237,7 @@ class CampaignService extends serviceSDK_1.Service {
237
237
  campaignId,
238
238
  campaignActionId,
239
239
  statusActive,
240
- sort: { asc: true, key: "productId" },
240
+ sort: { asc: true, key: "productId" }
241
241
  };
242
242
  try {
243
243
  const response = yield this.graphqlQuery(query, variables);
@@ -248,5 +248,57 @@ class CampaignService extends serviceSDK_1.Service {
248
248
  }
249
249
  });
250
250
  }
251
+ voucherForUserRequest(orderId_1) {
252
+ return __awaiter(this, arguments, void 0, function* (orderId, customerId = "", paymentMethodId, shippingCompanyId, pageNumber = 0, pageSize = 20, fields = [
253
+ `content {
254
+ id
255
+ voucherCode
256
+ voucherType
257
+ isBirthday
258
+ discountAmount
259
+ discountPercent
260
+ usageLimitPerVoucher
261
+ numberOfTimeUsed
262
+ maximumDiscount
263
+ memberLevel
264
+ affiliateId
265
+ description
266
+ usageLimitType
267
+ minimumSpend
268
+ maximumSpend
269
+ expiryDate
270
+ isUsable
271
+ unusableReasons
272
+ remainingAmount
273
+ }`,
274
+ "total",
275
+ "pageNumber",
276
+ "pageSize",
277
+ "totalPages",
278
+ "numberOfElements",
279
+ "first",
280
+ "last"
281
+ ]) {
282
+ const query = (0, queries_1.GET_VOUCHER_FOR_USER)(fields);
283
+ const variables = {
284
+ voucherForUserRequest: {
285
+ orderId,
286
+ customerId,
287
+ storeId: this.storeId,
288
+ paymentMethodId,
289
+ shippingCompanyId,
290
+ pageNumber,
291
+ pageSize
292
+ }
293
+ };
294
+ try {
295
+ const res = yield this.graphqlQuery(query, variables);
296
+ return res.getVouchersForUser;
297
+ }
298
+ catch (error) {
299
+ throw error;
300
+ }
301
+ });
302
+ }
251
303
  }
252
304
  exports.CampaignService = CampaignService;
@@ -48,4 +48,6 @@ export declare class CrmService extends Service {
48
48
  getResumesByFieldNameAndValue(orgId: string, fieldName: string, value: string, resumeTemplateId: string): Promise<any>;
49
49
  uploadImageResume(resumeId: string, fieldName: string, uploadImageInput: any, updatedBy: string): Promise<any>;
50
50
  createResume(resumeTemplateId: string, partyId: string, createdBy: string, name: string): Promise<any>;
51
+ createSupportRequest(title: string, content: string, fileUrl: string, source: string, userId: string, uri: string): Promise<any>;
52
+ getResumesByFieldNameAndValues(resumeTemplateId: string, orgId: string, fieldNameValues: any): Promise<any>;
51
53
  }
@@ -26,7 +26,7 @@ class CrmService extends serviceSDK_1.Service {
26
26
  const variables = {
27
27
  partyId: this.orgId,
28
28
  performerId,
29
- addOpportunityRequest,
29
+ addOpportunityRequest
30
30
  };
31
31
  try {
32
32
  const response = yield this.graphqlMutationV2(mutation, variables);
@@ -44,7 +44,7 @@ class CrmService extends serviceSDK_1.Service {
44
44
  const variables = {
45
45
  partyId: this.orgId,
46
46
  performerId,
47
- addOpportunityRequest,
47
+ addOpportunityRequest
48
48
  };
49
49
  try {
50
50
  const response = yield this.graphqlMutationV2(mutation, variables);
@@ -62,7 +62,7 @@ class CrmService extends serviceSDK_1.Service {
62
62
  const variables = {
63
63
  partyId,
64
64
  performerId,
65
- addOpportunityRequest,
65
+ addOpportunityRequest
66
66
  };
67
67
  try {
68
68
  const response = yield this.graphqlMutationV2(mutation, variables);
@@ -79,7 +79,7 @@ class CrmService extends serviceSDK_1.Service {
79
79
  const variables = {
80
80
  partyId: this.orgId,
81
81
  performerId,
82
- getOpportunityRequest,
82
+ getOpportunityRequest
83
83
  };
84
84
  try {
85
85
  const response = yield this.graphqlQueryV2(query, variables);
@@ -96,7 +96,7 @@ class CrmService extends serviceSDK_1.Service {
96
96
  const query = queries_1.GET_LIST_TODO;
97
97
  const variables = {
98
98
  partyId: this.orgId,
99
- workEffortId,
99
+ workEffortId
100
100
  };
101
101
  try {
102
102
  const response = yield this.graphqlQueryV2(query, variables);
@@ -113,7 +113,7 @@ class CrmService extends serviceSDK_1.Service {
113
113
  const query = queries_1.GET_LIST_WORK_EFFORT_TYPE;
114
114
  const variables = {
115
115
  partyId: this.orgId,
116
- id,
116
+ id
117
117
  };
118
118
  try {
119
119
  const response = yield this.graphqlQueryV2(query, variables);
@@ -131,7 +131,7 @@ class CrmService extends serviceSDK_1.Service {
131
131
  const variables = {
132
132
  performerId,
133
133
  attachmentId,
134
- status,
134
+ status
135
135
  };
136
136
  try {
137
137
  const response = yield this.graphqlMutationV2(mutation, variables);
@@ -149,7 +149,7 @@ class CrmService extends serviceSDK_1.Service {
149
149
  const variables = {
150
150
  performerId,
151
151
  workEffortId,
152
- description,
152
+ description
153
153
  };
154
154
  try {
155
155
  const response = yield this.graphqlMutationV2(mutation, variables);
@@ -168,7 +168,7 @@ class CrmService extends serviceSDK_1.Service {
168
168
  partyId: this.orgId,
169
169
  performerId,
170
170
  workEffortId,
171
- newName: name,
171
+ newName: name
172
172
  };
173
173
  try {
174
174
  const response = yield this.graphqlMutationV2(mutation, variables);
@@ -188,7 +188,7 @@ class CrmService extends serviceSDK_1.Service {
188
188
  performerId,
189
189
  workEffortId,
190
190
  group,
191
- status,
191
+ status
192
192
  };
193
193
  try {
194
194
  const response = yield this.graphqlMutationV2(mutation, variables);
@@ -207,7 +207,7 @@ class CrmService extends serviceSDK_1.Service {
207
207
  partyId: this.orgId,
208
208
  performerId,
209
209
  workEffortId,
210
- addAttachmentRequest,
210
+ addAttachmentRequest
211
211
  };
212
212
  try {
213
213
  const response = yield this.graphqlMutationV2(mutation, variables);
@@ -225,7 +225,7 @@ class CrmService extends serviceSDK_1.Service {
225
225
  const variables = {
226
226
  partyId: this.orgId,
227
227
  performerId,
228
- getTicketRequest,
228
+ getTicketRequest
229
229
  };
230
230
  try {
231
231
  const response = yield this.graphqlQueryV2(query, variables);
@@ -244,7 +244,7 @@ class CrmService extends serviceSDK_1.Service {
244
244
  partyId: this.orgId,
245
245
  performerId,
246
246
  addTicketRequest,
247
- addAttachmentRequest,
247
+ addAttachmentRequest
248
248
  };
249
249
  try {
250
250
  const response = yield this.graphqlMutationV2(mutation, variables);
@@ -260,7 +260,7 @@ class CrmService extends serviceSDK_1.Service {
260
260
  return __awaiter(this, void 0, void 0, function* () {
261
261
  const query = queries_1.GET_TICKET_BY_ID;
262
262
  const variables = {
263
- ticketId,
263
+ ticketId
264
264
  };
265
265
  try {
266
266
  const response = yield this.graphqlQueryV2(query, variables);
@@ -277,7 +277,7 @@ class CrmService extends serviceSDK_1.Service {
277
277
  const query = queries_1.GET_ATTACHMENT_BY_WORK_EFFORT_ID;
278
278
  const variables = {
279
279
  partyId: this.orgId,
280
- workEffortIds,
280
+ workEffortIds
281
281
  };
282
282
  try {
283
283
  const response = yield this.graphqlQueryV2(query, variables);
@@ -294,7 +294,7 @@ class CrmService extends serviceSDK_1.Service {
294
294
  const query = queries_1.GET_LIST_COMMENT;
295
295
  const variables = {
296
296
  partyId: this.orgId,
297
- getCommentRequest,
297
+ getCommentRequest
298
298
  };
299
299
  try {
300
300
  const response = yield this.graphqlQueryV2(query, variables);
@@ -315,7 +315,7 @@ class CrmService extends serviceSDK_1.Service {
315
315
  format: params.addAttachmentRequest ? "ATTACHMENT" : "TEXT",
316
316
  content: params.content,
317
317
  referId: params.referId,
318
- addAttachmentRequest: params.addAttachmentRequest,
318
+ addAttachmentRequest: params.addAttachmentRequest
319
319
  };
320
320
  try {
321
321
  const response = yield this.graphqlMutationV2(mutation, variables);
@@ -339,7 +339,7 @@ class CrmService extends serviceSDK_1.Service {
339
339
  group,
340
340
  attributes,
341
341
  addAttachmentRequest,
342
- parentId,
342
+ parentId
343
343
  };
344
344
  try {
345
345
  const response = yield this.graphqlMutationV2(query, variables);
@@ -359,7 +359,7 @@ class CrmService extends serviceSDK_1.Service {
359
359
  name,
360
360
  decription,
361
361
  workEffortTypeId,
362
- source,
362
+ source
363
363
  };
364
364
  try {
365
365
  const response = yield this.graphqlMutationV2(mutation, variables);
@@ -383,7 +383,7 @@ class CrmService extends serviceSDK_1.Service {
383
383
  sorts,
384
384
  attributes,
385
385
  fromDate,
386
- toDate,
386
+ toDate
387
387
  };
388
388
  try {
389
389
  const response = yield this.graphqlQueryV2(query, variables);
@@ -406,7 +406,7 @@ class CrmService extends serviceSDK_1.Service {
406
406
  pageSize,
407
407
  sorts,
408
408
  fromDate,
409
- toDate,
409
+ toDate
410
410
  };
411
411
  try {
412
412
  const response = yield this.graphqlQueryV2(query, variables);
@@ -424,7 +424,7 @@ class CrmService extends serviceSDK_1.Service {
424
424
  partnerId: this.orgId,
425
425
  performerId,
426
426
  workEffortTypeId,
427
- source,
427
+ source
428
428
  };
429
429
  try {
430
430
  const repsonse = yield this.graphqlQueryV2(query, variables);
@@ -439,7 +439,7 @@ class CrmService extends serviceSDK_1.Service {
439
439
  return __awaiter(this, void 0, void 0, function* () {
440
440
  const query = queries_1.GET_WORK_EFFORT_BY_ID;
441
441
  const variables = {
442
- id,
442
+ id
443
443
  };
444
444
  try {
445
445
  const response = yield this.graphqlMutationV2(query, variables);
@@ -454,7 +454,7 @@ class CrmService extends serviceSDK_1.Service {
454
454
  return __awaiter(this, void 0, void 0, function* () {
455
455
  const query = queries_1.GET_WORK_EFFORT_BY_ID_V2;
456
456
  const variables = {
457
- id,
457
+ id
458
458
  };
459
459
  try {
460
460
  const response = yield this.graphqlMutationV2(query, variables);
@@ -471,7 +471,7 @@ class CrmService extends serviceSDK_1.Service {
471
471
  const variables = {
472
472
  workEffortId,
473
473
  processStatus,
474
- performerId,
474
+ performerId
475
475
  };
476
476
  try {
477
477
  const response = yield this.graphqlMutationV2(mutation, variables);
@@ -489,7 +489,7 @@ class CrmService extends serviceSDK_1.Service {
489
489
  const variables = {
490
490
  resourceId,
491
491
  resourceType,
492
- type,
492
+ type
493
493
  };
494
494
  try {
495
495
  const response = yield this.graphqlQueryV2(query, variables);
@@ -508,7 +508,7 @@ class CrmService extends serviceSDK_1.Service {
508
508
  resourceType,
509
509
  description,
510
510
  type,
511
- createdBy,
511
+ createdBy
512
512
  };
513
513
  try {
514
514
  const response = yield this.graphqlMutationV2(mutation, variables);
@@ -526,7 +526,7 @@ class CrmService extends serviceSDK_1.Service {
526
526
  connectorId,
527
527
  tagTitle,
528
528
  tagId,
529
- addedBy,
529
+ addedBy
530
530
  };
531
531
  try {
532
532
  const response = yield this.graphqlMutationV2(mutation, variables);
@@ -543,7 +543,7 @@ class CrmService extends serviceSDK_1.Service {
543
543
  const variables = {
544
544
  connectorId,
545
545
  description,
546
- updatedBy,
546
+ updatedBy
547
547
  };
548
548
  try {
549
549
  const response = yield this.graphqlMutationV2(mutation, variables);
@@ -558,7 +558,7 @@ class CrmService extends serviceSDK_1.Service {
558
558
  return __awaiter(this, void 0, void 0, function* () {
559
559
  const queries = queries_1.GET_TAG;
560
560
  const variables = {
561
- connectorId,
561
+ connectorId
562
562
  };
563
563
  try {
564
564
  const response = yield this.graphqlQueryV2(queries, variables);
@@ -575,7 +575,7 @@ class CrmService extends serviceSDK_1.Service {
575
575
  const variables = {
576
576
  connectorId,
577
577
  tagId,
578
- removedBy,
578
+ removedBy
579
579
  };
580
580
  try {
581
581
  const response = yield this.graphqlMutationV2(mutation, variables);
@@ -593,7 +593,7 @@ class CrmService extends serviceSDK_1.Service {
593
593
  filterTopicRequest: filterTopicRequest,
594
594
  partnerId: this.orgId,
595
595
  pageSize,
596
- currentPage,
596
+ currentPage
597
597
  };
598
598
  try {
599
599
  const response = yield this.graphqlMutationV2(query, variables);
@@ -609,7 +609,7 @@ class CrmService extends serviceSDK_1.Service {
609
609
  const mutation = mutations_1.CLOSE_TOPIC;
610
610
  const variables = {
611
611
  id,
612
- updatedBy,
612
+ updatedBy
613
613
  };
614
614
  try {
615
615
  const response = yield this.graphqlMutationV2(mutation, variables);
@@ -626,7 +626,7 @@ class CrmService extends serviceSDK_1.Service {
626
626
  const variables = {
627
627
  socialAppId,
628
628
  customerId,
629
- message,
629
+ message
630
630
  };
631
631
  try {
632
632
  const response = yield this.graphqlMutationV2(mutation, variables);
@@ -644,7 +644,7 @@ class CrmService extends serviceSDK_1.Service {
644
644
  filterTopicRequest,
645
645
  partnerId: this.orgId,
646
646
  pageSize,
647
- currentPage,
647
+ currentPage
648
648
  };
649
649
  try {
650
650
  const response = yield this.graphqlMutationV2(mutation, variables);
@@ -661,7 +661,7 @@ class CrmService extends serviceSDK_1.Service {
661
661
  const variables = {
662
662
  partnerId: this.orgId,
663
663
  performerId,
664
- source,
664
+ source
665
665
  };
666
666
  try {
667
667
  const response = yield this.graphqlQuery(query, variables);
@@ -678,7 +678,7 @@ class CrmService extends serviceSDK_1.Service {
678
678
  const variables = {
679
679
  topicId,
680
680
  pageSize,
681
- pageNumber,
681
+ pageNumber
682
682
  };
683
683
  try {
684
684
  const response = yield this.graphqlQuery(query, variables);
@@ -694,7 +694,7 @@ class CrmService extends serviceSDK_1.Service {
694
694
  const query = queries_1.GET_RESOURCE_RELATED_TOPIC;
695
695
  const variables = {
696
696
  topicId,
697
- resourceType,
697
+ resourceType
698
698
  };
699
699
  try {
700
700
  const response = yield this.graphqlQuery(query, variables);
@@ -712,7 +712,7 @@ class CrmService extends serviceSDK_1.Service {
712
712
  topicId,
713
713
  resourceId,
714
714
  resourceType,
715
- createdBy,
715
+ createdBy
716
716
  };
717
717
  try {
718
718
  const response = yield this.graphqlMutation(mutation, variables);
@@ -729,7 +729,7 @@ class CrmService extends serviceSDK_1.Service {
729
729
  const variables = {
730
730
  partnerId: this.orgId,
731
731
  group,
732
- keyword,
732
+ keyword
733
733
  };
734
734
  try {
735
735
  const response = yield this.graphqlQuery(query, variables);
@@ -745,7 +745,7 @@ class CrmService extends serviceSDK_1.Service {
745
745
  const variables = {
746
746
  orgName,
747
747
  providerId,
748
- groupTenantId,
748
+ groupTenantId
749
749
  };
750
750
  try {
751
751
  const response = yield this.graphqlMutationV2(mutations_1.CREATE_ORG_MUTATION, variables);
@@ -763,7 +763,7 @@ class CrmService extends serviceSDK_1.Service {
763
763
  const variables = {
764
764
  resumeId,
765
765
  updateResumeRequests,
766
- updatedBy,
766
+ updatedBy
767
767
  };
768
768
  try {
769
769
  const response = yield this.graphqlMutation(mutation, variables);
@@ -781,7 +781,7 @@ class CrmService extends serviceSDK_1.Service {
781
781
  orgId,
782
782
  fieldName,
783
783
  value,
784
- resumeTemplateId,
784
+ resumeTemplateId
785
785
  };
786
786
  try {
787
787
  const response = yield this.graphqlQuery(query, variables);
@@ -799,7 +799,7 @@ class CrmService extends serviceSDK_1.Service {
799
799
  resumeId,
800
800
  fieldName,
801
801
  uploadImageInput,
802
- updatedBy,
802
+ updatedBy
803
803
  };
804
804
  try {
805
805
  const response = yield this.graphqlMutation(mutation, variables);
@@ -817,7 +817,7 @@ class CrmService extends serviceSDK_1.Service {
817
817
  resumeTemplateId,
818
818
  partyId,
819
819
  createdBy,
820
- name,
820
+ name
821
821
  };
822
822
  try {
823
823
  const response = yield this.graphqlMutation(mutation, variables);
@@ -828,5 +828,43 @@ class CrmService extends serviceSDK_1.Service {
828
828
  }
829
829
  });
830
830
  }
831
+ createSupportRequest(title, content, fileUrl, source, userId, uri) {
832
+ return __awaiter(this, void 0, void 0, function* () {
833
+ const mutation = mutations_1.CREATE_SUPPORT_REQUEST;
834
+ const variables = {
835
+ title,
836
+ content,
837
+ fileUrl,
838
+ source,
839
+ orgId: this.orgId,
840
+ userId,
841
+ uri
842
+ };
843
+ try {
844
+ const response = yield this.graphqlMutation(mutation, variables);
845
+ return response.createSupportRequest;
846
+ }
847
+ catch (error) {
848
+ throw error;
849
+ }
850
+ });
851
+ }
852
+ getResumesByFieldNameAndValues(resumeTemplateId, orgId, fieldNameValues) {
853
+ return __awaiter(this, void 0, void 0, function* () {
854
+ const queries = queries_1.GET_RESUMES_BY_FIELD_NAME_AND_VALUES;
855
+ const variables = {
856
+ resumeTemplateId,
857
+ orgId,
858
+ fieldNameValues
859
+ };
860
+ try {
861
+ const response = yield this.graphqlQuery(queries, variables);
862
+ return response.getResumesByFieldNameAndValues;
863
+ }
864
+ catch (error) {
865
+ throw error;
866
+ }
867
+ });
868
+ }
831
869
  }
832
870
  exports.CrmService = CrmService;
@@ -2,3 +2,5 @@ import { Endpoints } from "../lib/SDK";
2
2
  export declare function createToken(environment: string): string;
3
3
  export declare function decodeToken(token: string): string | null;
4
4
  export declare function validateStorefrontAccessToken(storefrontAccessToken: string): Endpoints;
5
+ export declare function joinField(fields?: string[]): string;
6
+ export declare function hasFields(fields?: string[]): boolean;
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.validateStorefrontAccessToken = exports.decodeToken = exports.createToken = void 0;
6
+ exports.hasFields = exports.joinField = exports.validateStorefrontAccessToken = exports.decodeToken = exports.createToken = void 0;
7
7
  const crypto_js_1 = __importDefault(require("crypto-js"));
8
8
  const config_1 = require("../../config/config");
9
9
  function createToken(environment) {
@@ -29,13 +29,19 @@ function validateStorefrontAccessToken(storefrontAccessToken) {
29
29
  console.log("🚀 ~ environment:", environment);
30
30
  const validEnvironments = {
31
31
  dev: "dev",
32
- live: "live",
32
+ live: "live"
33
33
  };
34
34
  if (!Object.keys(validEnvironments).includes(environment)) {
35
35
  throw new Error("Invalid storefrontAccessToken");
36
36
  }
37
- return environment == "dev"
38
- ? config_1.environmentEndpoints.dev
39
- : config_1.environmentEndpoints.live;
37
+ return environment == "dev" ? config_1.environmentEndpoints.dev : config_1.environmentEndpoints.live;
40
38
  }
41
39
  exports.validateStorefrontAccessToken = validateStorefrontAccessToken;
40
+ function joinField(fields = []) {
41
+ return fields.join("\n ");
42
+ }
43
+ exports.joinField = joinField;
44
+ function hasFields(fields = []) {
45
+ return fields.length > 0;
46
+ }
47
+ exports.hasFields = hasFields;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@longvansoftware/storefront-js-client",
3
- "version": "4.6.6",
3
+ "version": "4.6.8",
4
4
  "main": "dist/src/index.js",
5
5
  "types": "dist/src/index.d.ts",
6
6
  "files": [
@@ -1 +0,0 @@
1
- export declare const SEARCH_SERVICE: import("graphql").DocumentNode;