@longvansoftware/storefront-js-client 4.0.3 → 4.0.5

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.
@@ -7,3 +7,4 @@ export declare const GET_VOUCHER_AVAILABLE_FOR_CUSTOMER: import("graphql").Docum
7
7
  export declare const SUGGEST_VOUCHER: import("graphql").DocumentNode;
8
8
  export declare const GET_CAMPAIGN_ACTION_BY_ID: import("graphql").DocumentNode;
9
9
  export declare const SEARCH_PRODUCT_GIFT_PROMOTION_RESPONSE: import("graphql").DocumentNode;
10
+ export declare const GET_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_CAMPAIGN_ACTION_BY_ID = exports.SUGGEST_VOUCHER = exports.GET_VOUCHER_AVAILABLE_FOR_CUSTOMER = exports.GET_PROMOTION_PRODUCT_PRICE = exports.GET_CAMPAIGN_ACTIVE_NOW = exports.CHECK_VALID_VOUCHER = exports.GET_VOUCHERS = exports.GET_CAMPAIGN_ACTION_ACTIVE_NOW = void 0;
3
+ exports.GET_CAMPAIGN = exports.SEARCH_PRODUCT_GIFT_PROMOTION_RESPONSE = exports.GET_CAMPAIGN_ACTION_BY_ID = exports.SUGGEST_VOUCHER = exports.GET_VOUCHER_AVAILABLE_FOR_CUSTOMER = exports.GET_PROMOTION_PRODUCT_PRICE = exports.GET_CAMPAIGN_ACTIVE_NOW = exports.CHECK_VALID_VOUCHER = exports.GET_VOUCHERS = exports.GET_CAMPAIGN_ACTION_ACTIVE_NOW = void 0;
4
4
  const graphql_tag_1 = require("graphql-tag");
5
5
  exports.GET_CAMPAIGN_ACTION_ACTIVE_NOW = (0, graphql_tag_1.gql) `
6
6
  query GetCampaignActionActiveNow(
@@ -425,3 +425,23 @@ exports.SEARCH_PRODUCT_GIFT_PROMOTION_RESPONSE = (0, graphql_tag_1.gql) `
425
425
  }
426
426
  }
427
427
  `;
428
+ exports.GET_CAMPAIGN = (0, graphql_tag_1.gql) `
429
+ query GetCampaign($id: String!) {
430
+ getCampaign(id: $id) {
431
+ id
432
+ createdStamp
433
+ updatedStamp
434
+ updatedBy
435
+ createdBy
436
+ useForAll
437
+ description
438
+ partyId
439
+ name
440
+ type
441
+ domain
442
+ fromDate
443
+ toDate
444
+ status
445
+ }
446
+ }
447
+ `;
@@ -194,6 +194,7 @@ exports.GET_PRODUCT_BY_SLUG_QUERY = (0, graphql_tag_1.gql) `
194
194
  ) {
195
195
  id
196
196
  title
197
+ subType
197
198
  description
198
199
  sku
199
200
  shortDescription
@@ -206,20 +207,56 @@ exports.GET_PRODUCT_BY_SLUG_QUERY = (0, graphql_tag_1.gql) `
206
207
  parentId
207
208
  handle
208
209
  price
210
+ displayPrice
211
+ hint
212
+ priceUnit
213
+ priceQuantity
214
+ priceType
215
+ salePolicy
216
+ priceTypeName
217
+ priceVaries
218
+ available
219
+ tags
209
220
  options
210
221
  optionsRelationship
211
222
  compareAtPrice
212
223
  featuredImage
224
+ version
213
225
  images
214
- productAttributes {
215
- attributeName
216
- attributeValue
226
+ brand {
227
+ id
228
+ createStamp
229
+ createdBy
230
+ name
231
+ image
232
+ imageIcon
233
+ }
234
+ unitDTO {
235
+ id
236
+ name
237
+ }
238
+ groups {
239
+ id
240
+ name
241
+ policy
242
+ image
243
+ }
244
+ categories {
245
+ id
246
+ title
247
+ image
248
+ icon
249
+ parentId
250
+ level
251
+ handle
252
+ description
217
253
  }
218
254
  variants {
219
255
  id
220
256
  handle
221
257
  title
222
258
  price
259
+ priceType
223
260
  compareAtPrice
224
261
  options
225
262
  optionsIds
@@ -229,22 +266,20 @@ exports.GET_PRODUCT_BY_SLUG_QUERY = (0, graphql_tag_1.gql) `
229
266
  featureTypes {
230
267
  id
231
268
  name
269
+ position
270
+ type
271
+ subType
272
+ fill
273
+ requireData
274
+ otherItem
232
275
  values
233
- }
234
- categories {
235
- id
236
- title
237
- handle
238
- }
239
- unitDTO {
240
- id
241
- name
242
- }
243
- groups {
244
- id
245
- name
246
- policy
247
- image
276
+ description
277
+ createStamp
278
+ createdBy
279
+ valuesFull {
280
+ id
281
+ name
282
+ }
248
283
  }
249
284
  }
250
285
  }
@@ -877,79 +912,13 @@ exports.GET_CATEGORY_BY_HANDLE = (0, graphql_tag_1.gql) `
877
912
  ) {
878
913
  id
879
914
  title
880
- subType
881
- description
882
- sku
883
- shortDescription
884
- weight
885
- width
886
- depth
887
- height
888
- vat
889
- qualify
915
+ image
916
+ icon
890
917
  parentId
918
+ level
891
919
  handle
892
- price
893
- displayPrice
894
- hint
895
- compareAtPrices
896
- priceUnit
897
- priceQuantity
898
- priceType
899
- salePolicy
900
- priceTypeName
901
- priceVaries
902
- available
903
- tags
904
- options
905
- optionsRelationship
906
- compareAtPrice
907
- featuredImage
908
- version
909
- images
910
- brand {
911
- id
912
- createStamp
913
- createdBy
914
- name
915
- image
916
- imageIcon
917
- }
918
- unitDTO {
919
- id
920
- name
921
- }
922
- variants {
923
- id
924
- handle
925
- title
926
- price
927
- priceType
928
- compareAtPrice
929
- options
930
- optionsIds
931
- featuredImage
932
- sku
933
- }
934
- featureTypes {
935
- id
936
- name
937
- position
938
- type
939
- subType
940
- fill
941
- requireData
942
- otherItem
943
- values
944
- description
945
- createStamp
946
- createdBy
947
- valuesFull {
948
- id
949
- name
950
- }
951
- }
952
- categories {
920
+ description
921
+ child {
953
922
  id
954
923
  title
955
924
  image
@@ -959,12 +928,6 @@ exports.GET_CATEGORY_BY_HANDLE = (0, graphql_tag_1.gql) `
959
928
  handle
960
929
  description
961
930
  }
962
- groups {
963
- id
964
- name
965
- policy
966
- image
967
- }
968
931
  }
969
932
  }
970
933
  `;
@@ -17,4 +17,5 @@ export declare class CampaignService extends Service {
17
17
  suggestVoucher(customerId: string, campaignId: string, campaignActionId: string, isBirthday: Boolean): Promise<any>;
18
18
  getCampaignActionById(id: string): Promise<any>;
19
19
  searchProductGiftPromotionResponse(productIds: string[], campaignActionId: string): Promise<any>;
20
+ getCampaign(id: string): Promise<any>;
20
21
  }
@@ -214,5 +214,20 @@ class CampaignService extends serviceSDK_1.Service {
214
214
  }
215
215
  });
216
216
  }
217
+ getCampaign(id) {
218
+ return __awaiter(this, void 0, void 0, function* () {
219
+ const query = queries_1.GET_CAMPAIGN;
220
+ const variables = {
221
+ id,
222
+ };
223
+ try {
224
+ const response = yield this.graphqlQuery(query, variables);
225
+ return response.getCampaign;
226
+ }
227
+ catch (error) {
228
+ throw error;
229
+ }
230
+ });
231
+ }
217
232
  }
218
233
  exports.CampaignService = CampaignService;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@longvansoftware/storefront-js-client",
3
- "version": "4.0.3",
3
+ "version": "4.0.5",
4
4
  "main": "dist/src/index.js",
5
5
  "types": "dist/src/index.d.ts",
6
6
  "files": [