@poweredbysous/storefront-sdk 3.3.3 → 3.4.0

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.
package/dist/index.d.cts CHANGED
@@ -2125,6 +2125,28 @@ interface paths {
2125
2125
  patch?: never;
2126
2126
  trace?: never;
2127
2127
  };
2128
+ "/api/v1/products/{id}/orderable-dates/": {
2129
+ parameters: {
2130
+ query?: never;
2131
+ header?: never;
2132
+ path?: never;
2133
+ cookie?: never;
2134
+ };
2135
+ /**
2136
+ * @description The dates this product can be ordered for, within the location's
2137
+ * pre-order horizon, as the cart's ``fulfilment-dates`` lists them for
2138
+ * a basket holding only this product's line, so the storefront can tell
2139
+ * a customer when a product it hides for their date is available.
2140
+ */
2141
+ get: operations["products_orderable_dates_retrieve"];
2142
+ put?: never;
2143
+ post?: never;
2144
+ delete?: never;
2145
+ options?: never;
2146
+ head?: never;
2147
+ patch?: never;
2148
+ trace?: never;
2149
+ };
2128
2150
  "/api/v1/products/{id}/suggestions/": {
2129
2151
  parameters: {
2130
2152
  query?: never;
@@ -2498,6 +2520,11 @@ interface components {
2498
2520
  fulfillment_type?: string;
2499
2521
  /** Format: date */
2500
2522
  fulfillment_date?: string;
2523
+ /**
2524
+ * Format: date
2525
+ * @description The customer's chosen handover date. The product is refused when its own dates (weekly days, included and excluded dates, order-until) do not accept it; the line is not dated by it.
2526
+ */
2527
+ handover_date?: string;
2501
2528
  /** @default */
2502
2529
  fulfillment_time_slot: string;
2503
2530
  options?: components["schemas"]["OptionInput"][];
@@ -2722,6 +2749,7 @@ interface components {
2722
2749
  readonly promotion: {
2723
2750
  [key: string]: unknown;
2724
2751
  } | null;
2752
+ readonly pending_auto_discount: components["schemas"]["CartPendingAutoDiscount"] | null;
2725
2753
  readonly shipping_estimate: components["schemas"]["ShippingEstimate"] | null;
2726
2754
  /**
2727
2755
  * Format: decimal
@@ -2806,6 +2834,7 @@ interface components {
2806
2834
  [key: string]: unknown;
2807
2835
  } | null;
2808
2836
  readonly note: string;
2837
+ readonly order_dates: components["schemas"]["CartLineOrderDates"] | null;
2809
2838
  };
2810
2839
  CartLineItemOption: {
2811
2840
  option_id: number;
@@ -2861,6 +2890,54 @@ interface components {
2861
2890
  /** @description 'product' or 'modifier' */
2862
2891
  source: string;
2863
2892
  };
2893
+ /**
2894
+ * @description The product's own dates. An excluded date closes it, an included date
2895
+ * opens it on a day ``weekly_days`` does not cover, and ``order_until`` closes
2896
+ * it once passed. Checkout refuses a handover date outside them with
2897
+ * ``PRODUCT_NOT_ORDERABLE_FOR_DATE``.
2898
+ */
2899
+ CartLineOrderDates: {
2900
+ /** @description Lower-case weekday names, or null to follow the store's schedule. */
2901
+ weekly_days: string[] | null;
2902
+ included_dates: string[];
2903
+ excluded_dates: string[];
2904
+ /** Format: date */
2905
+ order_until: string | null;
2906
+ };
2907
+ /**
2908
+ * @description A codeless discount the cart holds products for but does not get yet.
2909
+ *
2910
+ * Documentation only: the payload is built by
2911
+ * ``CartSerializer.get_pending_auto_discount``. Null whenever a discount is
2912
+ * on the cart, a typed code included.
2913
+ */
2914
+ CartPendingAutoDiscount: {
2915
+ /** Format: uuid */
2916
+ discount_id: string;
2917
+ name: string;
2918
+ /**
2919
+ * @description min_order_not_met: the cart subtotal is below min_order_amount; amount_needed says by how much. fulfillment_type_not_allowed: no line the discount covers uses one of allowed_fulfillment_types. Reported before the minimum, since adding to the basket cannot lift it.
2920
+ *
2921
+ * * `min_order_not_met` - min_order_not_met
2922
+ * * `fulfillment_type_not_allowed` - fulfillment_type_not_allowed
2923
+ */
2924
+ reason: components["schemas"]["CartPendingAutoDiscountReasonEnum"];
2925
+ /** Format: decimal */
2926
+ min_order_amount: string | null;
2927
+ /**
2928
+ * Format: decimal
2929
+ * @description What the subtotal still needs. Null unless min_order_not_met.
2930
+ */
2931
+ amount_needed: string | null;
2932
+ allowed_fulfillment_types: string[];
2933
+ currency: string;
2934
+ };
2935
+ /**
2936
+ * @description * `min_order_not_met` - min_order_not_met
2937
+ * * `fulfillment_type_not_allowed` - fulfillment_type_not_allowed
2938
+ * @enum {string}
2939
+ */
2940
+ CartPendingAutoDiscountReasonEnum: "min_order_not_met" | "fulfillment_type_not_allowed";
2864
2941
  Category: {
2865
2942
  readonly id: number;
2866
2943
  slug: string;
@@ -4202,6 +4279,19 @@ interface components {
4202
4279
  /** Format: date-time */
4203
4280
  readonly updated_at: string;
4204
4281
  };
4282
+ /**
4283
+ * @description The dates one product can be ordered for, within the location's
4284
+ * pre-order horizon (``ProductViewSet.orderable_dates``).
4285
+ */
4286
+ ProductFulfilmentDates: {
4287
+ dates: string[];
4288
+ reason: (components["schemas"]["ProductFulfilmentDatesReasonEnum"] | components["schemas"]["NullEnum"]) | null;
4289
+ };
4290
+ /**
4291
+ * @description * `no_dates` - no_dates
4292
+ * @enum {string}
4293
+ */
4294
+ ProductFulfilmentDatesReasonEnum: "no_dates";
4205
4295
  ProductImage: {
4206
4296
  readonly id: number;
4207
4297
  /** Format: uri */
@@ -16002,6 +16092,8 @@ interface operations {
16002
16092
  query?: {
16003
16093
  /** @description Delivery destination country as ISO 3166-1 alpha-2 (e.g. NL, BE), used with latitude and longitude. A nationwide carrier that declares per-country service areas only offers its products once the country is known. Case-insensitive; any other value is treated as no country. */
16004
16094
  country?: string;
16095
+ /** @description The pickup or delivery date the customer has chosen (YYYY-MM-DD). Lists only the products that can be ordered today for that date by their own dates: weekly days, included and excluded dates, and order-until. Whether the store is open that day is the time-slots endpoint's answer, not this filter's. An unreadable value is ignored. */
16096
+ handover_date?: string;
16005
16097
  /** @description Sort order for products. Use '-popularity' for most popular first. */
16006
16098
  ordering?: "-popularity" | "-position" | "position";
16007
16099
  /** @description A page number within the paginated result set. */
@@ -16238,6 +16330,91 @@ interface operations {
16238
16330
  };
16239
16331
  };
16240
16332
  };
16333
+ products_orderable_dates_retrieve: {
16334
+ parameters: {
16335
+ query: {
16336
+ /** @description For type=delivery: the customer's delivery types in order of preference, comma-separated (local_delivery, nationwide_delivery). The product's schedule follows the first of them it offers, the type its cart line would get; without one it follows the delivery types the product offers. */
16337
+ fulfillment_types?: string;
16338
+ /** @description Pickup location id, as the pickup time-slots endpoint takes it. Defaults to the store's active pickup location. */
16339
+ location?: number;
16340
+ /** @description Fulfilment type the dates are for. */
16341
+ type: "delivery" | "pickup";
16342
+ /** @description Language override for translated content. The primary mechanism is the `Accept-Language` header; this query parameter is an override for widget embedding where merchants cannot control browser headers. Defaults to `en`. */
16343
+ lang?: string;
16344
+ };
16345
+ header?: never;
16346
+ path: {
16347
+ /** @description A unique integer value identifying this product. */
16348
+ id: number;
16349
+ };
16350
+ cookie?: never;
16351
+ };
16352
+ requestBody?: never;
16353
+ responses: {
16354
+ 200: {
16355
+ headers: {
16356
+ [name: string]: unknown;
16357
+ };
16358
+ content: {
16359
+ "application/json": components["schemas"]["ProductFulfilmentDates"];
16360
+ };
16361
+ };
16362
+ /** @description Possible error codes: `VALIDATION_ERROR`. Retryable: no. Possible error codes include `VALIDATION_ERROR`. Use `x-error-codes` for machine-readable retryability metadata. */
16363
+ 400: {
16364
+ headers: {
16365
+ [name: string]: unknown;
16366
+ };
16367
+ content: {
16368
+ "application/json": components["schemas"]["APIErrorEnvelope"];
16369
+ };
16370
+ };
16371
+ /** @description Possible error codes include `UNAUTHORIZED`. Use `x-error-codes` for machine-readable retryability metadata. */
16372
+ 401: {
16373
+ headers: {
16374
+ [name: string]: unknown;
16375
+ };
16376
+ content: {
16377
+ "application/json": components["schemas"]["APIErrorEnvelope"];
16378
+ };
16379
+ };
16380
+ /** @description Possible error codes include `FORBIDDEN`. Use `x-error-codes` for machine-readable retryability metadata. */
16381
+ 403: {
16382
+ headers: {
16383
+ [name: string]: unknown;
16384
+ };
16385
+ content: {
16386
+ "application/json": components["schemas"]["APIErrorEnvelope"];
16387
+ };
16388
+ };
16389
+ /** @description Possible error codes: `NOT_FOUND`, `LOCATION_NOT_FOUND`. Retryable: no. Possible error codes include `NOT_FOUND`. Use `x-error-codes` for machine-readable retryability metadata. Possible error codes include `PRODUCT_NOT_FOUND`. Use `x-error-codes` for machine-readable retryability metadata. Possible error codes include `LOCATION_NOT_FOUND`. Use `x-error-codes` for machine-readable retryability metadata. */
16390
+ 404: {
16391
+ headers: {
16392
+ [name: string]: unknown;
16393
+ };
16394
+ content: {
16395
+ "application/json": components["schemas"]["APIErrorEnvelope"];
16396
+ };
16397
+ };
16398
+ /** @description Possible error codes include `RATE_LIMITED`. Use `x-error-codes` for machine-readable retryability metadata. */
16399
+ 429: {
16400
+ headers: {
16401
+ [name: string]: unknown;
16402
+ };
16403
+ content: {
16404
+ "application/json": components["schemas"]["APIErrorEnvelope"];
16405
+ };
16406
+ };
16407
+ /** @description Possible error codes include `INTERNAL_ERROR`. Use `x-error-codes` for machine-readable retryability metadata. */
16408
+ 500: {
16409
+ headers: {
16410
+ [name: string]: unknown;
16411
+ };
16412
+ content: {
16413
+ "application/json": components["schemas"]["APIErrorEnvelope"];
16414
+ };
16415
+ };
16416
+ };
16417
+ };
16241
16418
  products_suggestions_list: {
16242
16419
  parameters: {
16243
16420
  query?: {
package/dist/index.d.ts CHANGED
@@ -2125,6 +2125,28 @@ interface paths {
2125
2125
  patch?: never;
2126
2126
  trace?: never;
2127
2127
  };
2128
+ "/api/v1/products/{id}/orderable-dates/": {
2129
+ parameters: {
2130
+ query?: never;
2131
+ header?: never;
2132
+ path?: never;
2133
+ cookie?: never;
2134
+ };
2135
+ /**
2136
+ * @description The dates this product can be ordered for, within the location's
2137
+ * pre-order horizon, as the cart's ``fulfilment-dates`` lists them for
2138
+ * a basket holding only this product's line, so the storefront can tell
2139
+ * a customer when a product it hides for their date is available.
2140
+ */
2141
+ get: operations["products_orderable_dates_retrieve"];
2142
+ put?: never;
2143
+ post?: never;
2144
+ delete?: never;
2145
+ options?: never;
2146
+ head?: never;
2147
+ patch?: never;
2148
+ trace?: never;
2149
+ };
2128
2150
  "/api/v1/products/{id}/suggestions/": {
2129
2151
  parameters: {
2130
2152
  query?: never;
@@ -2498,6 +2520,11 @@ interface components {
2498
2520
  fulfillment_type?: string;
2499
2521
  /** Format: date */
2500
2522
  fulfillment_date?: string;
2523
+ /**
2524
+ * Format: date
2525
+ * @description The customer's chosen handover date. The product is refused when its own dates (weekly days, included and excluded dates, order-until) do not accept it; the line is not dated by it.
2526
+ */
2527
+ handover_date?: string;
2501
2528
  /** @default */
2502
2529
  fulfillment_time_slot: string;
2503
2530
  options?: components["schemas"]["OptionInput"][];
@@ -2722,6 +2749,7 @@ interface components {
2722
2749
  readonly promotion: {
2723
2750
  [key: string]: unknown;
2724
2751
  } | null;
2752
+ readonly pending_auto_discount: components["schemas"]["CartPendingAutoDiscount"] | null;
2725
2753
  readonly shipping_estimate: components["schemas"]["ShippingEstimate"] | null;
2726
2754
  /**
2727
2755
  * Format: decimal
@@ -2806,6 +2834,7 @@ interface components {
2806
2834
  [key: string]: unknown;
2807
2835
  } | null;
2808
2836
  readonly note: string;
2837
+ readonly order_dates: components["schemas"]["CartLineOrderDates"] | null;
2809
2838
  };
2810
2839
  CartLineItemOption: {
2811
2840
  option_id: number;
@@ -2861,6 +2890,54 @@ interface components {
2861
2890
  /** @description 'product' or 'modifier' */
2862
2891
  source: string;
2863
2892
  };
2893
+ /**
2894
+ * @description The product's own dates. An excluded date closes it, an included date
2895
+ * opens it on a day ``weekly_days`` does not cover, and ``order_until`` closes
2896
+ * it once passed. Checkout refuses a handover date outside them with
2897
+ * ``PRODUCT_NOT_ORDERABLE_FOR_DATE``.
2898
+ */
2899
+ CartLineOrderDates: {
2900
+ /** @description Lower-case weekday names, or null to follow the store's schedule. */
2901
+ weekly_days: string[] | null;
2902
+ included_dates: string[];
2903
+ excluded_dates: string[];
2904
+ /** Format: date */
2905
+ order_until: string | null;
2906
+ };
2907
+ /**
2908
+ * @description A codeless discount the cart holds products for but does not get yet.
2909
+ *
2910
+ * Documentation only: the payload is built by
2911
+ * ``CartSerializer.get_pending_auto_discount``. Null whenever a discount is
2912
+ * on the cart, a typed code included.
2913
+ */
2914
+ CartPendingAutoDiscount: {
2915
+ /** Format: uuid */
2916
+ discount_id: string;
2917
+ name: string;
2918
+ /**
2919
+ * @description min_order_not_met: the cart subtotal is below min_order_amount; amount_needed says by how much. fulfillment_type_not_allowed: no line the discount covers uses one of allowed_fulfillment_types. Reported before the minimum, since adding to the basket cannot lift it.
2920
+ *
2921
+ * * `min_order_not_met` - min_order_not_met
2922
+ * * `fulfillment_type_not_allowed` - fulfillment_type_not_allowed
2923
+ */
2924
+ reason: components["schemas"]["CartPendingAutoDiscountReasonEnum"];
2925
+ /** Format: decimal */
2926
+ min_order_amount: string | null;
2927
+ /**
2928
+ * Format: decimal
2929
+ * @description What the subtotal still needs. Null unless min_order_not_met.
2930
+ */
2931
+ amount_needed: string | null;
2932
+ allowed_fulfillment_types: string[];
2933
+ currency: string;
2934
+ };
2935
+ /**
2936
+ * @description * `min_order_not_met` - min_order_not_met
2937
+ * * `fulfillment_type_not_allowed` - fulfillment_type_not_allowed
2938
+ * @enum {string}
2939
+ */
2940
+ CartPendingAutoDiscountReasonEnum: "min_order_not_met" | "fulfillment_type_not_allowed";
2864
2941
  Category: {
2865
2942
  readonly id: number;
2866
2943
  slug: string;
@@ -4202,6 +4279,19 @@ interface components {
4202
4279
  /** Format: date-time */
4203
4280
  readonly updated_at: string;
4204
4281
  };
4282
+ /**
4283
+ * @description The dates one product can be ordered for, within the location's
4284
+ * pre-order horizon (``ProductViewSet.orderable_dates``).
4285
+ */
4286
+ ProductFulfilmentDates: {
4287
+ dates: string[];
4288
+ reason: (components["schemas"]["ProductFulfilmentDatesReasonEnum"] | components["schemas"]["NullEnum"]) | null;
4289
+ };
4290
+ /**
4291
+ * @description * `no_dates` - no_dates
4292
+ * @enum {string}
4293
+ */
4294
+ ProductFulfilmentDatesReasonEnum: "no_dates";
4205
4295
  ProductImage: {
4206
4296
  readonly id: number;
4207
4297
  /** Format: uri */
@@ -16002,6 +16092,8 @@ interface operations {
16002
16092
  query?: {
16003
16093
  /** @description Delivery destination country as ISO 3166-1 alpha-2 (e.g. NL, BE), used with latitude and longitude. A nationwide carrier that declares per-country service areas only offers its products once the country is known. Case-insensitive; any other value is treated as no country. */
16004
16094
  country?: string;
16095
+ /** @description The pickup or delivery date the customer has chosen (YYYY-MM-DD). Lists only the products that can be ordered today for that date by their own dates: weekly days, included and excluded dates, and order-until. Whether the store is open that day is the time-slots endpoint's answer, not this filter's. An unreadable value is ignored. */
16096
+ handover_date?: string;
16005
16097
  /** @description Sort order for products. Use '-popularity' for most popular first. */
16006
16098
  ordering?: "-popularity" | "-position" | "position";
16007
16099
  /** @description A page number within the paginated result set. */
@@ -16238,6 +16330,91 @@ interface operations {
16238
16330
  };
16239
16331
  };
16240
16332
  };
16333
+ products_orderable_dates_retrieve: {
16334
+ parameters: {
16335
+ query: {
16336
+ /** @description For type=delivery: the customer's delivery types in order of preference, comma-separated (local_delivery, nationwide_delivery). The product's schedule follows the first of them it offers, the type its cart line would get; without one it follows the delivery types the product offers. */
16337
+ fulfillment_types?: string;
16338
+ /** @description Pickup location id, as the pickup time-slots endpoint takes it. Defaults to the store's active pickup location. */
16339
+ location?: number;
16340
+ /** @description Fulfilment type the dates are for. */
16341
+ type: "delivery" | "pickup";
16342
+ /** @description Language override for translated content. The primary mechanism is the `Accept-Language` header; this query parameter is an override for widget embedding where merchants cannot control browser headers. Defaults to `en`. */
16343
+ lang?: string;
16344
+ };
16345
+ header?: never;
16346
+ path: {
16347
+ /** @description A unique integer value identifying this product. */
16348
+ id: number;
16349
+ };
16350
+ cookie?: never;
16351
+ };
16352
+ requestBody?: never;
16353
+ responses: {
16354
+ 200: {
16355
+ headers: {
16356
+ [name: string]: unknown;
16357
+ };
16358
+ content: {
16359
+ "application/json": components["schemas"]["ProductFulfilmentDates"];
16360
+ };
16361
+ };
16362
+ /** @description Possible error codes: `VALIDATION_ERROR`. Retryable: no. Possible error codes include `VALIDATION_ERROR`. Use `x-error-codes` for machine-readable retryability metadata. */
16363
+ 400: {
16364
+ headers: {
16365
+ [name: string]: unknown;
16366
+ };
16367
+ content: {
16368
+ "application/json": components["schemas"]["APIErrorEnvelope"];
16369
+ };
16370
+ };
16371
+ /** @description Possible error codes include `UNAUTHORIZED`. Use `x-error-codes` for machine-readable retryability metadata. */
16372
+ 401: {
16373
+ headers: {
16374
+ [name: string]: unknown;
16375
+ };
16376
+ content: {
16377
+ "application/json": components["schemas"]["APIErrorEnvelope"];
16378
+ };
16379
+ };
16380
+ /** @description Possible error codes include `FORBIDDEN`. Use `x-error-codes` for machine-readable retryability metadata. */
16381
+ 403: {
16382
+ headers: {
16383
+ [name: string]: unknown;
16384
+ };
16385
+ content: {
16386
+ "application/json": components["schemas"]["APIErrorEnvelope"];
16387
+ };
16388
+ };
16389
+ /** @description Possible error codes: `NOT_FOUND`, `LOCATION_NOT_FOUND`. Retryable: no. Possible error codes include `NOT_FOUND`. Use `x-error-codes` for machine-readable retryability metadata. Possible error codes include `PRODUCT_NOT_FOUND`. Use `x-error-codes` for machine-readable retryability metadata. Possible error codes include `LOCATION_NOT_FOUND`. Use `x-error-codes` for machine-readable retryability metadata. */
16390
+ 404: {
16391
+ headers: {
16392
+ [name: string]: unknown;
16393
+ };
16394
+ content: {
16395
+ "application/json": components["schemas"]["APIErrorEnvelope"];
16396
+ };
16397
+ };
16398
+ /** @description Possible error codes include `RATE_LIMITED`. Use `x-error-codes` for machine-readable retryability metadata. */
16399
+ 429: {
16400
+ headers: {
16401
+ [name: string]: unknown;
16402
+ };
16403
+ content: {
16404
+ "application/json": components["schemas"]["APIErrorEnvelope"];
16405
+ };
16406
+ };
16407
+ /** @description Possible error codes include `INTERNAL_ERROR`. Use `x-error-codes` for machine-readable retryability metadata. */
16408
+ 500: {
16409
+ headers: {
16410
+ [name: string]: unknown;
16411
+ };
16412
+ content: {
16413
+ "application/json": components["schemas"]["APIErrorEnvelope"];
16414
+ };
16415
+ };
16416
+ };
16417
+ };
16241
16418
  products_suggestions_list: {
16242
16419
  parameters: {
16243
16420
  query?: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@poweredbysous/storefront-sdk",
3
- "version": "3.3.3",
3
+ "version": "3.4.0",
4
4
  "description": "Type-safe TypeScript SDK for SOUS Storefront Backend",
5
5
  "license": "UNLICENSED",
6
6
  "private": false,