@gofynd/fdk-client-javascript 1.1.1 → 1.1.2

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.
Files changed (51) hide show
  1. package/package.json +1 -1
  2. package/sdk/application/Cart/CartApplicationClient.d.ts +11 -0
  3. package/sdk/application/Cart/CartApplicationClient.js +65 -0
  4. package/sdk/application/Cart/CartApplicationModel.d.ts +6 -0
  5. package/sdk/application/Cart/CartApplicationModel.js +72 -0
  6. package/sdk/application/Cart/CartApplicationValidator.d.ts +1 -0
  7. package/sdk/application/Cart/CartApplicationValidator.js +6 -0
  8. package/sdk/application/Catalog/CatalogApplicationClient.d.ts +14 -4
  9. package/sdk/application/Catalog/CatalogApplicationClient.js +18 -6
  10. package/sdk/application/Catalog/CatalogApplicationValidator.js +2 -0
  11. package/sdk/application/Content/ContentApplicationModel.js +1 -0
  12. package/sdk/application/FileStorage/FileStorageApplicationClient.d.ts +8 -2
  13. package/sdk/application/FileStorage/FileStorageApplicationClient.js +8 -2
  14. package/sdk/application/FileStorage/FileStorageApplicationModel.js +2 -2
  15. package/sdk/application/Order/OrderApplicationClient.d.ts +15 -0
  16. package/sdk/application/Order/OrderApplicationClient.js +68 -0
  17. package/sdk/application/Order/OrderApplicationModel.d.ts +17 -0
  18. package/sdk/application/Order/OrderApplicationModel.js +111 -0
  19. package/sdk/application/Order/OrderApplicationValidator.d.ts +1 -0
  20. package/sdk/application/Order/OrderApplicationValidator.js +7 -0
  21. package/sdk/application/PosCart/PosCartApplicationModel.d.ts +4 -0
  22. package/sdk/application/PosCart/PosCartApplicationModel.js +50 -0
  23. package/sdk/application/Rewards/RewardsApplicationClient.d.ts +8 -8
  24. package/sdk/application/Rewards/RewardsApplicationClient.js +8 -8
  25. package/sdk/common/AxiosHelper.js +1 -1
  26. package/sdk/platform/Cart/CartPlatformApplicationClient.d.ts +22 -0
  27. package/sdk/platform/Cart/CartPlatformApplicationClient.js +127 -0
  28. package/sdk/platform/Cart/CartPlatformApplicationValidator.d.ts +2 -0
  29. package/sdk/platform/Cart/CartPlatformApplicationValidator.js +13 -0
  30. package/sdk/platform/Cart/CartPlatformModel.d.ts +9 -0
  31. package/sdk/platform/Cart/CartPlatformModel.js +117 -0
  32. package/sdk/platform/Content/ContentPlatformModel.js +1 -0
  33. package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.d.ts +10 -4
  34. package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.js +15 -9
  35. package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.d.ts +1 -1
  36. package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.js +1 -1
  37. package/sdk/platform/FileStorage/FileStoragePlatformClient.d.ts +8 -2
  38. package/sdk/platform/FileStorage/FileStoragePlatformClient.js +8 -2
  39. package/sdk/platform/FileStorage/FileStoragePlatformModel.js +2 -2
  40. package/sdk/platform/Order/OrderPlatformClient.d.ts +3 -3
  41. package/sdk/platform/Order/OrderPlatformClient.js +5 -5
  42. package/sdk/platform/Order/OrderPlatformModel.js +2 -0
  43. package/sdk/platform/Order/OrderPlatformValidator.js +1 -1
  44. package/sdk/platform/PlatformApplicationClient.d.ts +9 -1
  45. package/sdk/platform/PlatformApplicationClient.js +9 -0
  46. package/sdk/platform/PlatformClient.d.ts +101 -3
  47. package/sdk/platform/PlatformClient.js +113 -2
  48. package/sdk/platform/Rewards/RewardsPlatformApplicationClient.d.ts +14 -26
  49. package/sdk/platform/Rewards/RewardsPlatformApplicationClient.js +14 -74
  50. package/sdk/platform/Rewards/RewardsPlatformApplicationValidator.d.ts +0 -1
  51. package/sdk/platform/Rewards/RewardsPlatformApplicationValidator.js +0 -7
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gofynd/fdk-client-javascript",
3
- "version": "1.1.1",
3
+ "version": "1.1.2",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -8,6 +8,7 @@ declare class Cart {
8
8
  applyCoupon: string;
9
9
  applyRewardPoints: string;
10
10
  checkoutCart: string;
11
+ deleteCart: string;
11
12
  getAddressById: string;
12
13
  getAddresses: string;
13
14
  getBulkDiscountOffers: string;
@@ -110,6 +111,16 @@ declare class Cart {
110
111
  buyNow?: boolean;
111
112
  body: CartCheckoutDetailRequest;
112
113
  }): Promise<CartCheckoutResponse>;
114
+ /**
115
+ * @param {Object} arg - Arg object.
116
+ * @param {number} [arg.id] - The unique identifier of the cart.
117
+ * @returns {Promise<DeleteCartDetailResponse>} - Success response
118
+ * @summary: Delete cart once user made successful checkout
119
+ * @description: Use this API to delete the cart.
120
+ */
121
+ deleteCart({ id }?: {
122
+ id?: number;
123
+ }): Promise<DeleteCartDetailResponse>;
113
124
  /**
114
125
  * @param {Object} arg - Arg object.
115
126
  * @param {string} arg.id -
@@ -16,6 +16,7 @@ class Cart {
16
16
  applyCoupon: "/service/application/cart/v1.0/coupon",
17
17
  applyRewardPoints: "/service/application/cart/v1.0/redeem/points/",
18
18
  checkoutCart: "/service/application/cart/v1.0/checkout",
19
+ deleteCart: "/service/application/cart/v1.0/cart_archive",
19
20
  getAddressById: "/service/application/cart/v1.0/address/{id}",
20
21
  getAddresses: "/service/application/cart/v1.0/address",
21
22
  getBulkDiscountOffers: "/service/application/cart/v1.0/bulk-price",
@@ -399,6 +400,70 @@ class Cart {
399
400
  return response;
400
401
  }
401
402
 
403
+ /**
404
+ * @param {Object} arg - Arg object.
405
+ * @param {number} [arg.id] - The unique identifier of the cart.
406
+ * @returns {Promise<DeleteCartDetailResponse>} - Success response
407
+ * @summary: Delete cart once user made successful checkout
408
+ * @description: Use this API to delete the cart.
409
+ */
410
+ async deleteCart({ id } = {}) {
411
+ const { error } = CartValidator.deleteCart().validate(
412
+ { id },
413
+ { abortEarly: false, allowUnknown: true }
414
+ );
415
+ if (error) {
416
+ return Promise.reject(new FDKClientValidationError(error));
417
+ }
418
+
419
+ // Showing warrnings if extra unknown parameters are found
420
+ const { error: warrning } = CartValidator.deleteCart().validate(
421
+ { id },
422
+ { abortEarly: false, allowUnknown: false }
423
+ );
424
+ if (warrning) {
425
+ Logger({
426
+ level: "WARN",
427
+ message: "Parameter Validation warrnings for deleteCart",
428
+ });
429
+ Logger({ level: "WARN", message: warrning });
430
+ }
431
+
432
+ const query_params = {};
433
+ query_params["id"] = id;
434
+
435
+ const xHeaders = {};
436
+
437
+ const response = await ApplicationAPIClient.execute(
438
+ this._conf,
439
+ "put",
440
+ constructUrl({
441
+ url: this._urls["deleteCart"],
442
+ params: {},
443
+ }),
444
+ query_params,
445
+ undefined,
446
+ xHeaders
447
+ );
448
+
449
+ const {
450
+ error: res_error,
451
+ } = CartModel.DeleteCartDetailResponse().validate(response, {
452
+ abortEarly: false,
453
+ allowUnknown: false,
454
+ });
455
+
456
+ if (res_error) {
457
+ Logger({
458
+ level: "WARN",
459
+ message: "Response Validation Warnnings for deleteCart",
460
+ });
461
+ Logger({ level: "WARN", message: res_error });
462
+ }
463
+
464
+ return response;
465
+ }
466
+
402
467
  /**
403
468
  * @param {Object} arg - Arg object.
404
469
  * @param {string} arg.id -
@@ -5,6 +5,7 @@ declare class CartModel {
5
5
  static AddCartRequest(): any;
6
6
  static AddProductCart(): any;
7
7
  static Address(): any;
8
+ static AppliedFreeArticles(): any;
8
9
  static AppliedPromotion(): any;
9
10
  static ApplyCouponRequest(): any;
10
11
  static ArticlePriceInfo(): any;
@@ -12,6 +13,7 @@ declare class CartModel {
12
13
  static BasePrice(): any;
13
14
  static BulkPriceOffer(): any;
14
15
  static BulkPriceResponse(): any;
16
+ static BuyRules(): any;
15
17
  static CartBreakup(): any;
16
18
  static CartCheckoutCustomMeta(): any;
17
19
  static CartCheckoutDetailRequest(): any;
@@ -33,7 +35,11 @@ declare class CartModel {
33
35
  static CouponValidity(): any;
34
36
  static CurrencyInfo(): any;
35
37
  static DeleteAddressResponse(): any;
38
+ static DeleteCartDetailResponse(): any;
39
+ static DiscountRulesApp(): any;
36
40
  static DisplayBreakup(): any;
41
+ static FreeGiftItem(): any;
42
+ static FreeGiftItems(): any;
37
43
  static GeoLocation(): any;
38
44
  static GetAddressesResponse(): any;
39
45
  static GetCouponResponse(): any;
@@ -66,14 +66,27 @@ class CartModel {
66
66
  user_id: Joi.string().allow(""),
67
67
  });
68
68
  }
69
+ static AppliedFreeArticles() {
70
+ return Joi.object({
71
+ article_id: Joi.string().allow(""),
72
+ free_gift_item_details: CartModel.FreeGiftItem(),
73
+ parent_item_identifier: Joi.string().allow(""),
74
+ quantity: Joi.number(),
75
+ });
76
+ }
69
77
  static AppliedPromotion() {
70
78
  return Joi.object({
71
79
  amount: Joi.number(),
80
+ applied_free_articles: Joi.array().items(CartModel.AppliedFreeArticles()),
72
81
  article_quantity: Joi.number(),
82
+ buy_rules: Joi.array().items(CartModel.BuyRules()),
83
+ discount_rules: Joi.array().items(CartModel.DiscountRulesApp()),
73
84
  mrp_promotion: Joi.boolean(),
74
85
  offer_text: Joi.string().allow(""),
75
86
  ownership: CartModel.Ownership(),
76
87
  promo_id: Joi.string().allow(""),
88
+ promotion_group: Joi.string().allow(""),
89
+ promotion_name: Joi.string().allow(""),
77
90
  promotion_type: Joi.string().allow(""),
78
91
  });
79
92
  }
@@ -113,6 +126,12 @@ class CartModel {
113
126
  data: Joi.array().items(CartModel.BulkPriceOffer()),
114
127
  });
115
128
  }
129
+ static BuyRules() {
130
+ return Joi.object({
131
+ cart_conditions: Joi.any(),
132
+ item_criteria: Joi.any(),
133
+ });
134
+ }
116
135
  static CartBreakup() {
117
136
  return Joi.object({
118
137
  coupon: CartModel.CouponBreakup(),
@@ -139,6 +158,7 @@ class CartModel {
139
158
  extra_meta: Joi.any(),
140
159
  merchant_code: Joi.string().allow(""),
141
160
  meta: Joi.any(),
161
+ order_type: Joi.string().allow(""),
142
162
  ordering_store: Joi.number().allow(null),
143
163
  payment_auto_confirm: Joi.boolean(),
144
164
  payment_identifier: Joi.string().allow("").allow(null),
@@ -313,7 +333,9 @@ class CartModel {
313
333
  static Coupon() {
314
334
  return Joi.object({
315
335
  coupon_code: Joi.string().allow(""),
336
+ coupon_type: Joi.string().allow("").allow(null),
316
337
  coupon_value: Joi.number(),
338
+ description: Joi.string().allow("").allow(null),
317
339
  expires_on: Joi.string().allow(""),
318
340
  is_applicable: Joi.boolean(),
319
341
  is_applied: Joi.boolean(),
@@ -327,8 +349,15 @@ class CartModel {
327
349
  static CouponBreakup() {
328
350
  return Joi.object({
329
351
  code: Joi.string().allow(""),
352
+ coupon_type: Joi.string().allow("").allow(null),
353
+ coupon_value: Joi.number(),
354
+ description: Joi.string().allow("").allow(null),
330
355
  is_applied: Joi.boolean(),
356
+ max_discount_value: Joi.number(),
331
357
  message: Joi.string().allow(""),
358
+ minimum_cart_value: Joi.number(),
359
+ sub_title: Joi.string().allow("").allow(null),
360
+ title: Joi.string().allow("").allow(null),
332
361
  type: Joi.string().allow(""),
333
362
  uid: Joi.string().allow(""),
334
363
  value: Joi.number(),
@@ -355,6 +384,20 @@ class CartModel {
355
384
  is_deleted: Joi.boolean(),
356
385
  });
357
386
  }
387
+ static DeleteCartDetailResponse() {
388
+ return Joi.object({
389
+ message: Joi.string().allow(""),
390
+ success: Joi.boolean(),
391
+ });
392
+ }
393
+ static DiscountRulesApp() {
394
+ return Joi.object({
395
+ item_criteria: Joi.any(),
396
+ matched_buy_rules: Joi.array().items(Joi.string().allow("")),
397
+ offer: Joi.any(),
398
+ raw_offer: Joi.any(),
399
+ });
400
+ }
358
401
  static DisplayBreakup() {
359
402
  return Joi.object({
360
403
  currency_code: Joi.string().allow(""),
@@ -365,6 +408,26 @@ class CartModel {
365
408
  value: Joi.number(),
366
409
  });
367
410
  }
411
+ static FreeGiftItem() {
412
+ return Joi.object({
413
+ item_brand_name: Joi.string().allow(""),
414
+ item_id: Joi.number(),
415
+ item_images_url: Joi.array().items(Joi.string().allow("")),
416
+ item_name: Joi.string().allow(""),
417
+ item_price_details: Joi.any(),
418
+ item_slug: Joi.string().allow(""),
419
+ });
420
+ }
421
+ static FreeGiftItems() {
422
+ return Joi.object({
423
+ item_brand_name: Joi.string().allow(""),
424
+ item_id: Joi.number(),
425
+ item_images_url: Joi.array().items(Joi.string().allow("")),
426
+ item_name: Joi.string().allow(""),
427
+ item_price_details: Joi.any(),
428
+ item_slug: Joi.string().allow(""),
429
+ });
430
+ }
368
431
  static GeoLocation() {
369
432
  return Joi.object({
370
433
  latitude: Joi.number(),
@@ -415,7 +478,11 @@ class CartModel {
415
478
  }
416
479
  static LadderPriceOffer() {
417
480
  return Joi.object({
481
+ buy_rules: Joi.any(),
482
+ calculate_on: Joi.string().allow(""),
418
483
  description: Joi.string().allow(""),
484
+ discount_rules: Joi.array().items(Joi.any()),
485
+ free_gift_items: Joi.array().items(CartModel.FreeGiftItems()),
419
486
  id: Joi.string().allow(""),
420
487
  offer_prices: Joi.array().items(CartModel.LadderOfferItem()),
421
488
  offer_text: Joi.string().allow(""),
@@ -509,11 +576,13 @@ class CartModel {
509
576
  return Joi.object({
510
577
  _custom_json: Joi.any(),
511
578
  extra_meta: Joi.any(),
579
+ identifier: Joi.any(),
512
580
  parent_item_identifiers: Joi.any(),
513
581
  price: CartModel.ArticlePriceInfo(),
514
582
  product_group_tags: Joi.array().items(Joi.string().allow("")),
515
583
  quantity: Joi.number(),
516
584
  seller: CartModel.BaseInfo(),
585
+ seller_identifier: Joi.string().allow(""),
517
586
  size: Joi.string().allow(""),
518
587
  store: CartModel.BaseInfo(),
519
588
  type: Joi.string().allow(""),
@@ -579,7 +648,10 @@ class CartModel {
579
648
  }
580
649
  static PromotionOffer() {
581
650
  return Joi.object({
651
+ buy_rules: Joi.any(),
582
652
  description: Joi.string().allow(""),
653
+ discount_rules: Joi.array().items(Joi.any()),
654
+ free_gift_items: Joi.array().items(CartModel.FreeGiftItems()),
583
655
  id: Joi.string().allow(""),
584
656
  offer_text: Joi.string().allow(""),
585
657
  promotion_group: Joi.string().allow(""),
@@ -5,6 +5,7 @@ declare class CartValidator {
5
5
  static applyCoupon(): any;
6
6
  static applyRewardPoints(): any;
7
7
  static checkoutCart(): any;
8
+ static deleteCart(): any;
8
9
  static getAddressById(): any;
9
10
  static getAddresses(): any;
10
11
  static getBulkDiscountOffers(): any;
@@ -46,6 +46,12 @@ class CartValidator {
46
46
  }).required();
47
47
  }
48
48
 
49
+ static deleteCart() {
50
+ return Joi.object({
51
+ id: Joi.number(),
52
+ });
53
+ }
54
+
49
55
  static getAddressById() {
50
56
  return Joi.object({
51
57
  id: Joi.string().allow("").required(),
@@ -139,6 +139,8 @@ declare class Catalog {
139
139
  * will be passed in f parameter as shown in the example below. Double
140
140
  * Pipe (||) denotes the OR condition, whereas Triple-colon (:::)
141
141
  * indicates a new filter paramater applied as an AND condition.
142
+ * @param {string} [arg.q] - The search query for entering partial or full
143
+ * name of product, brand, category, or collection.
142
144
  * @param {boolean} [arg.filters] - This is a boolean value, True for
143
145
  * fetching all filter parameters and False for disabling the filter parameters.
144
146
  * @param {string} [arg.sortOn] - The order in which the list of products
@@ -153,9 +155,10 @@ declare class Catalog {
153
155
  * @summary: Get the items in a collection
154
156
  * @description: Get items in a collection specified by its `slug`.
155
157
  */
156
- getCollectionItemsBySlug({ slug, f, filters, sortOn, pageId, pageSize, pageNo, pageType, }?: {
158
+ getCollectionItemsBySlug({ slug, f, q, filters, sortOn, pageId, pageSize, pageNo, pageType, }?: {
157
159
  slug: string;
158
160
  f?: string;
161
+ q?: string;
159
162
  filters?: boolean;
160
163
  sortOn?: string;
161
164
  pageId?: string;
@@ -172,6 +175,8 @@ declare class Catalog {
172
175
  * will be passed in f parameter as shown in the example below. Double
173
176
  * Pipe (||) denotes the OR condition, whereas Triple-colon (:::)
174
177
  * indicates a new filter paramater applied as an AND condition.
178
+ * @param {string} [arg.q] - The search query for entering partial or full
179
+ * name of product, brand, category, or collection.
175
180
  * @param {boolean} [arg.filters] - This is a boolean value, True for
176
181
  * fetching all filter parameters and False for disabling the filter parameters.
177
182
  * @param {string} [arg.sortOn] - The order in which the list of products
@@ -181,9 +186,10 @@ declare class Catalog {
181
186
  * @summary: Get the items in a collection
182
187
  * @description: Get items in a collection specified by its `slug`.
183
188
  */
184
- getCollectionItemsBySlugPaginator({ slug, f, filters, sortOn, pageSize, }?: {
189
+ getCollectionItemsBySlugPaginator({ slug, f, q, filters, sortOn, pageSize, }?: {
185
190
  slug: string;
186
191
  f?: string;
192
+ q?: string;
187
193
  filters?: boolean;
188
194
  sortOn?: string;
189
195
  pageSize?: number;
@@ -194,25 +200,29 @@ declare class Catalog {
194
200
  * given set of results.
195
201
  * @param {number} [arg.pageSize] - The number of items to retrieve in each page.
196
202
  * @param {string[]} [arg.tag] - List of tags to filter collections
203
+ * @param {string} [arg.q] - Name of the collection to filter collection
197
204
  * @returns {Promise<GetCollectionListingResponse>} - Success response
198
205
  * @summary: List all the collections
199
206
  * @description: Collections are a great way to organize your products and can improve the ability for customers to find items quickly and efficiently.
200
207
  */
201
- getCollections({ pageNo, pageSize, tag }?: {
208
+ getCollections({ pageNo, pageSize, tag, q }?: {
202
209
  pageNo?: number;
203
210
  pageSize?: number;
204
211
  tag?: string[];
212
+ q?: string;
205
213
  }): Promise<GetCollectionListingResponse>;
206
214
  /**
207
215
  * @param {Object} arg - Arg object.
208
216
  * @param {number} [arg.pageSize] - The number of items to retrieve in each page.
209
217
  * @param {string[]} [arg.tag] - List of tags to filter collections
218
+ * @param {string} [arg.q] - Name of the collection to filter collection
210
219
  * @summary: List all the collections
211
220
  * @description: Collections are a great way to organize your products and can improve the ability for customers to find items quickly and efficiently.
212
221
  */
213
- getCollectionsPaginator({ pageSize, tag }?: {
222
+ getCollectionsPaginator({ pageSize, tag, q }?: {
214
223
  pageSize?: number;
215
224
  tag?: string[];
225
+ q?: string;
216
226
  }): Paginator;
217
227
  /**
218
228
  * @param {Object} arg - Arg object.
@@ -523,6 +523,8 @@ class Catalog {
523
523
  * will be passed in f parameter as shown in the example below. Double
524
524
  * Pipe (||) denotes the OR condition, whereas Triple-colon (:::)
525
525
  * indicates a new filter paramater applied as an AND condition.
526
+ * @param {string} [arg.q] - The search query for entering partial or full
527
+ * name of product, brand, category, or collection.
526
528
  * @param {boolean} [arg.filters] - This is a boolean value, True for
527
529
  * fetching all filter parameters and False for disabling the filter parameters.
528
530
  * @param {string} [arg.sortOn] - The order in which the list of products
@@ -540,6 +542,7 @@ class Catalog {
540
542
  async getCollectionItemsBySlug({
541
543
  slug,
542
544
  f,
545
+ q,
543
546
  filters,
544
547
  sortOn,
545
548
  pageId,
@@ -548,7 +551,7 @@ class Catalog {
548
551
  pageType,
549
552
  } = {}) {
550
553
  const { error } = CatalogValidator.getCollectionItemsBySlug().validate(
551
- { slug, f, filters, sortOn, pageId, pageSize, pageNo, pageType },
554
+ { slug, f, q, filters, sortOn, pageId, pageSize, pageNo, pageType },
552
555
  { abortEarly: false, allowUnknown: true }
553
556
  );
554
557
  if (error) {
@@ -559,7 +562,7 @@ class Catalog {
559
562
  const {
560
563
  error: warrning,
561
564
  } = CatalogValidator.getCollectionItemsBySlug().validate(
562
- { slug, f, filters, sortOn, pageId, pageSize, pageNo, pageType },
565
+ { slug, f, q, filters, sortOn, pageId, pageSize, pageNo, pageType },
563
566
  { abortEarly: false, allowUnknown: false }
564
567
  );
565
568
  if (warrning) {
@@ -572,6 +575,7 @@ class Catalog {
572
575
 
573
576
  const query_params = {};
574
577
  query_params["f"] = f;
578
+ query_params["q"] = q;
575
579
  query_params["filters"] = filters;
576
580
  query_params["sort_on"] = sortOn;
577
581
  query_params["page_id"] = pageId;
@@ -620,6 +624,8 @@ class Catalog {
620
624
  * will be passed in f parameter as shown in the example below. Double
621
625
  * Pipe (||) denotes the OR condition, whereas Triple-colon (:::)
622
626
  * indicates a new filter paramater applied as an AND condition.
627
+ * @param {string} [arg.q] - The search query for entering partial or full
628
+ * name of product, brand, category, or collection.
623
629
  * @param {boolean} [arg.filters] - This is a boolean value, True for
624
630
  * fetching all filter parameters and False for disabling the filter parameters.
625
631
  * @param {string} [arg.sortOn] - The order in which the list of products
@@ -632,6 +638,7 @@ class Catalog {
632
638
  getCollectionItemsBySlugPaginator({
633
639
  slug,
634
640
  f,
641
+ q,
635
642
  filters,
636
643
  sortOn,
637
644
  pageSize,
@@ -644,6 +651,7 @@ class Catalog {
644
651
  const data = await this.getCollectionItemsBySlug({
645
652
  slug: slug,
646
653
  f: f,
654
+ q: q,
647
655
  filters: filters,
648
656
  sortOn: sortOn,
649
657
  pageId: pageId,
@@ -667,13 +675,14 @@ class Catalog {
667
675
  * given set of results.
668
676
  * @param {number} [arg.pageSize] - The number of items to retrieve in each page.
669
677
  * @param {string[]} [arg.tag] - List of tags to filter collections
678
+ * @param {string} [arg.q] - Name of the collection to filter collection
670
679
  * @returns {Promise<GetCollectionListingResponse>} - Success response
671
680
  * @summary: List all the collections
672
681
  * @description: Collections are a great way to organize your products and can improve the ability for customers to find items quickly and efficiently.
673
682
  */
674
- async getCollections({ pageNo, pageSize, tag } = {}) {
683
+ async getCollections({ pageNo, pageSize, tag, q } = {}) {
675
684
  const { error } = CatalogValidator.getCollections().validate(
676
- { pageNo, pageSize, tag },
685
+ { pageNo, pageSize, tag, q },
677
686
  { abortEarly: false, allowUnknown: true }
678
687
  );
679
688
  if (error) {
@@ -682,7 +691,7 @@ class Catalog {
682
691
 
683
692
  // Showing warrnings if extra unknown parameters are found
684
693
  const { error: warrning } = CatalogValidator.getCollections().validate(
685
- { pageNo, pageSize, tag },
694
+ { pageNo, pageSize, tag, q },
686
695
  { abortEarly: false, allowUnknown: false }
687
696
  );
688
697
  if (warrning) {
@@ -697,6 +706,7 @@ class Catalog {
697
706
  query_params["page_no"] = pageNo;
698
707
  query_params["page_size"] = pageSize;
699
708
  query_params["tag"] = tag;
709
+ query_params["q"] = q;
700
710
 
701
711
  const xHeaders = {};
702
712
 
@@ -734,10 +744,11 @@ class Catalog {
734
744
  * @param {Object} arg - Arg object.
735
745
  * @param {number} [arg.pageSize] - The number of items to retrieve in each page.
736
746
  * @param {string[]} [arg.tag] - List of tags to filter collections
747
+ * @param {string} [arg.q] - Name of the collection to filter collection
737
748
  * @summary: List all the collections
738
749
  * @description: Collections are a great way to organize your products and can improve the ability for customers to find items quickly and efficiently.
739
750
  */
740
- getCollectionsPaginator({ pageSize, tag } = {}) {
751
+ getCollectionsPaginator({ pageSize, tag, q } = {}) {
741
752
  const paginator = new Paginator();
742
753
  const callback = async () => {
743
754
  const pageId = paginator.nextId;
@@ -747,6 +758,7 @@ class Catalog {
747
758
  pageNo: pageNo,
748
759
  pageSize: pageSize,
749
760
  tag: tag,
761
+ q: q,
750
762
  });
751
763
  paginator.setPaginator({
752
764
  hasNext: data.page.has_next ? true : false,
@@ -45,6 +45,7 @@ class CatalogValidator {
45
45
  return Joi.object({
46
46
  slug: Joi.string().allow("").required(),
47
47
  f: Joi.string().allow(""),
48
+ q: Joi.string().allow(""),
48
49
  filters: Joi.boolean(),
49
50
  sortOn: Joi.string().allow(""),
50
51
  pageId: Joi.string().allow(""),
@@ -59,6 +60,7 @@ class CatalogValidator {
59
60
  pageNo: Joi.number(),
60
61
  pageSize: Joi.number(),
61
62
  tag: Joi.array().items(Joi.string().allow("")),
63
+ q: Joi.string().allow(""),
62
64
  });
63
65
  }
64
66
 
@@ -347,6 +347,7 @@ class ContentModel {
347
347
  static Detail() {
348
348
  return Joi.object({
349
349
  description: Joi.string().allow(""),
350
+ image_url: Joi.string().allow(""),
350
351
  title: Joi.string().allow(""),
351
352
  });
352
353
  }
@@ -11,7 +11,10 @@ declare class FileStorage {
11
11
  updateUrls(urls: any): void;
12
12
  /**
13
13
  * @param {Object} arg - Arg object.
14
- * @param {string} arg.namespace - Name of the bucket created for storing objects.
14
+ * @param {string} arg.namespace - Segregation of different types of
15
+ * files(products, orders, logistics etc), Required for validating the
16
+ * data of the file being uploaded, decides where exactly the file will be
17
+ * stored inside the storage bucket.
15
18
  * @param {StartResponse} arg.body
16
19
  * @returns {Promise<CompleteResponse>} - Success response
17
20
  * @summary: Completes the upload process. After successfully uploading a file, call this API to finish the upload process.
@@ -50,7 +53,10 @@ declare class FileStorage {
50
53
  }): Promise<SignUrlResponse>;
51
54
  /**
52
55
  * @param {Object} arg - Arg object.
53
- * @param {string} arg.namespace - Name of the bucket created for storing objects.
56
+ * @param {string} arg.namespace - Segregation of different types of
57
+ * files(products, orders, logistics etc), Required for validating the
58
+ * data of the file being uploaded, decides where exactly the file will be
59
+ * stored inside the storage bucket.
54
60
  * @param {StartRequest} arg.body
55
61
  * @returns {Promise<StartResponse>} - Success response
56
62
  * @summary: Initiates an upload and returns a storage link that is valid for 30 minutes. You can use the storage link to make subsequent upload request with file buffer or blob.
@@ -36,7 +36,10 @@ class FileStorage {
36
36
 
37
37
  /**
38
38
  * @param {Object} arg - Arg object.
39
- * @param {string} arg.namespace - Name of the bucket created for storing objects.
39
+ * @param {string} arg.namespace - Segregation of different types of
40
+ * files(products, orders, logistics etc), Required for validating the
41
+ * data of the file being uploaded, decides where exactly the file will be
42
+ * stored inside the storage bucket.
40
43
  * @param {StartResponse} arg.body
41
44
  * @returns {Promise<CompleteResponse>} - Success response
42
45
  * @summary: Completes the upload process. After successfully uploading a file, call this API to finish the upload process.
@@ -180,7 +183,10 @@ class FileStorage {
180
183
 
181
184
  /**
182
185
  * @param {Object} arg - Arg object.
183
- * @param {string} arg.namespace - Name of the bucket created for storing objects.
186
+ * @param {string} arg.namespace - Segregation of different types of
187
+ * files(products, orders, logistics etc), Required for validating the
188
+ * data of the file being uploaded, decides where exactly the file will be
189
+ * stored inside the storage bucket.
184
190
  * @param {StartRequest} arg.body
185
191
  * @returns {Promise<StartResponse>} - Success response
186
192
  * @summary: Initiates an upload and returns a storage link that is valid for 30 minutes. You can use the storage link to make subsequent upload request with file buffer or blob.
@@ -22,8 +22,8 @@ class FileStorageModel {
22
22
  }
23
23
  static CDN() {
24
24
  return Joi.object({
25
- absolute_url: Joi.string().allow(""),
26
- relative_url: Joi.string().allow(""),
25
+ absolute_url: Joi.string().allow("").required(),
26
+ relative_url: Joi.string().allow("").required(),
27
27
  url: Joi.string().allow("").required(),
28
28
  });
29
29
  }
@@ -13,6 +13,7 @@ declare class Order {
13
13
  getShipmentReasons: string;
14
14
  sendOtpToShipmentCustomer: string;
15
15
  trackShipment: string;
16
+ updateShipmentStatus: string;
16
17
  verifyOtpShipmentCustomer: string;
17
18
  };
18
19
  _urls: {};
@@ -155,6 +156,20 @@ declare class Order {
155
156
  trackShipment({ shipmentId }?: {
156
157
  shipmentId: string;
157
158
  }): Promise<ShipmentTrack>;
159
+ /**
160
+ * @param {Object} arg - Arg object.
161
+ * @param {string} arg.shipmentId - ID of the shipment. An order may contain
162
+ * multiple items and may get divided into one or more shipment, each
163
+ * having its own ID.
164
+ * @param {UpdateShipmentStatusRequest} arg.body
165
+ * @returns {Promise<ShipmentApplicationStatusResponse>} - Success response
166
+ * @summary: Update the shipment status
167
+ * @description: Use this API to update the status of a shipment using its shipment ID.
168
+ */
169
+ updateShipmentStatus({ shipmentId, body }?: {
170
+ shipmentId: string;
171
+ body: UpdateShipmentStatusRequest;
172
+ }): Promise<ShipmentApplicationStatusResponse>;
158
173
  /**
159
174
  * @param {Object} arg - Arg object.
160
175
  * @param {string} arg.orderId - A unique number used for identifying and