@poweredbysous/storefront-admin-sdk 4.0.2 → 4.2.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
@@ -2150,7 +2150,13 @@ interface paths {
2150
2150
  * @description Return the authenticated merchant's information.
2151
2151
  *
2152
2152
  * Uses the default StoreAuthentication and IsStore permission.
2153
- * Useful for testing merchant authentication.
2153
+ *
2154
+ * With ``?include=location`` the payload also carries the store's pickup
2155
+ * address and position, so the ExploreSOUS directory can pin it. That costs
2156
+ * a (cached) geocode, so it is opt-in: the store and product pages read this
2157
+ * endpoint without it and never pay for one. ``address`` is null without an
2158
+ * active pickup location; the coordinates are null when the address cannot
2159
+ * be placed.
2154
2160
  */
2155
2161
  get: operations["merchant_me_retrieve"];
2156
2162
  put?: never;
@@ -2784,6 +2790,31 @@ interface paths {
2784
2790
  patch?: never;
2785
2791
  trace?: never;
2786
2792
  };
2793
+ "/api/v1/products/deliverability/": {
2794
+ parameters: {
2795
+ query?: never;
2796
+ header?: never;
2797
+ path?: never;
2798
+ cookie?: never;
2799
+ };
2800
+ get?: never;
2801
+ put?: never;
2802
+ /**
2803
+ * @description Which products reach a position, and how: the address-aware list, body-borne.
2804
+ *
2805
+ * The same filter and badges as ``GET /products/?latitude=&longitude=``,
2806
+ * but the position and postcode travel in the body, because a URL is
2807
+ * written to every access log between the shopper and here. Returns every
2808
+ * reachable product (ids and badges only), so there is no page to run off
2809
+ * the end of.
2810
+ */
2811
+ post: operations["products_deliverability_create"];
2812
+ delete?: never;
2813
+ options?: never;
2814
+ head?: never;
2815
+ patch?: never;
2816
+ trace?: never;
2817
+ };
2787
2818
  "/api/v1/products/search/": {
2788
2819
  parameters: {
2789
2820
  query?: never;
@@ -5243,6 +5274,40 @@ interface components {
5243
5274
  pre_order_lead_time?: number | null;
5244
5275
  readonly variant_overrides: components["schemas"]["VariantPriceOverride"][];
5245
5276
  };
5277
+ /** @description Which products reach the address, and the badges each carries there. */
5278
+ ProductDeliverability: {
5279
+ results: components["schemas"]["ProductDeliverabilityItem"][];
5280
+ delivery_metadata: components["schemas"]["ProductDeliveryMetadata"];
5281
+ };
5282
+ ProductDeliverabilityItem: {
5283
+ id: number;
5284
+ address_fulfillment_types: string[];
5285
+ };
5286
+ /**
5287
+ * @description Body of ``POST /products/deliverability/``: where the shopper is.
5288
+ *
5289
+ * A body, not a query string, because a position and a postcode are personal
5290
+ * data and a URL is written to every access log on the way here. ``latitude``
5291
+ * and ``longitude`` are ``RegexField`` rather than ``DecimalField`` because
5292
+ * ``DecimalField`` bounds are runtime-only in OpenAPI: generated clients see
5293
+ * a bare string. The pattern restates the ±90 / ±180 bounds where the client
5294
+ * can read them, and the view still converts to ``Decimal``.
5295
+ */
5296
+ ProductDeliverabilityRequest: {
5297
+ /** @description Latitude, within ±90 degrees. */
5298
+ latitude: string;
5299
+ /** @description Longitude, within ±180 degrees. */
5300
+ longitude: string;
5301
+ postal_code?: string;
5302
+ /** @description ISO 3166-1 alpha-2. A nationwide carrier that declares per-country service areas only offers its products once the country is known. */
5303
+ country?: string;
5304
+ };
5305
+ ProductDeliveryMetadata: {
5306
+ delivery_unavailable: boolean;
5307
+ near_delivery_zone: boolean;
5308
+ /** @description Closest pickup location; present only when delivery is unavailable. */
5309
+ nearest_pickup?: components["schemas"]["ProductNearestPickup"];
5310
+ };
5246
5311
  /** @description Resolve tags from ProductTranslation, falling back to Product.tags. */
5247
5312
  ProductDetail: {
5248
5313
  readonly id: number;
@@ -5394,6 +5459,13 @@ interface components {
5394
5459
  position?: number;
5395
5460
  readonly modifiers: components["schemas"]["ProductModifier"][];
5396
5461
  };
5462
+ /** @description The closest pickup location: the same shape ``address-check`` returns. */
5463
+ ProductNearestPickup: {
5464
+ id: number;
5465
+ name: string;
5466
+ /** Format: double */
5467
+ distance_km: number;
5468
+ };
5397
5469
  /**
5398
5470
  * @description Display-only promotion badge attached to a product.
5399
5471
  *
@@ -5799,11 +5871,23 @@ interface components {
5799
5871
  store_public_id: string;
5800
5872
  methods: components["schemas"]["DeliveryMethodState"][];
5801
5873
  };
5874
+ StoreMeAddress: {
5875
+ address_1: string;
5876
+ address_2: string;
5877
+ city: string;
5878
+ postal_code: string;
5879
+ country: string;
5880
+ };
5802
5881
  StoreMeResponse: {
5803
5882
  id: number;
5804
5883
  public_id: string;
5805
5884
  name: string;
5806
5885
  currency: string;
5886
+ address?: components["schemas"]["StoreMeAddress"] | null;
5887
+ /** Format: double */
5888
+ latitude?: number | null;
5889
+ /** Format: double */
5890
+ longitude?: number | null;
5807
5891
  };
5808
5892
  /**
5809
5893
  * @description Read/write serializer for the store-onboarding wizard.
@@ -15888,7 +15972,10 @@ interface operations {
15888
15972
  };
15889
15973
  merchant_me_retrieve: {
15890
15974
  parameters: {
15891
- query?: never;
15975
+ query?: {
15976
+ /** @description `location` adds `address`, `latitude` and `longitude`. Omit it and those keys are absent and nothing is geocoded. */
15977
+ include?: "location";
15978
+ };
15892
15979
  header?: never;
15893
15980
  path?: never;
15894
15981
  cookie?: never;
@@ -19554,6 +19641,85 @@ interface operations {
19554
19641
  };
19555
19642
  };
19556
19643
  };
19644
+ products_deliverability_create: {
19645
+ parameters: {
19646
+ query?: never;
19647
+ header?: never;
19648
+ path?: never;
19649
+ cookie?: never;
19650
+ };
19651
+ requestBody: {
19652
+ content: {
19653
+ "application/json": components["schemas"]["ProductDeliverabilityRequest"];
19654
+ "application/x-www-form-urlencoded": components["schemas"]["ProductDeliverabilityRequest"];
19655
+ "multipart/form-data": components["schemas"]["ProductDeliverabilityRequest"];
19656
+ };
19657
+ };
19658
+ responses: {
19659
+ 200: {
19660
+ headers: {
19661
+ [name: string]: unknown;
19662
+ };
19663
+ content: {
19664
+ "application/json": components["schemas"]["ProductDeliverability"];
19665
+ };
19666
+ };
19667
+ /** @description Possible error codes include `VALIDATION_ERROR`. Use `x-error-codes` for machine-readable retryability metadata. */
19668
+ 400: {
19669
+ headers: {
19670
+ [name: string]: unknown;
19671
+ };
19672
+ content: {
19673
+ "application/json": components["schemas"]["APIErrorEnvelope"];
19674
+ };
19675
+ };
19676
+ /** @description Possible error codes include `UNAUTHORIZED`. Use `x-error-codes` for machine-readable retryability metadata. */
19677
+ 401: {
19678
+ headers: {
19679
+ [name: string]: unknown;
19680
+ };
19681
+ content: {
19682
+ "application/json": components["schemas"]["APIErrorEnvelope"];
19683
+ };
19684
+ };
19685
+ /** @description Possible error codes include `FORBIDDEN`. Use `x-error-codes` for machine-readable retryability metadata. */
19686
+ 403: {
19687
+ headers: {
19688
+ [name: string]: unknown;
19689
+ };
19690
+ content: {
19691
+ "application/json": components["schemas"]["APIErrorEnvelope"];
19692
+ };
19693
+ };
19694
+ /** @description 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. */
19695
+ 404: {
19696
+ headers: {
19697
+ [name: string]: unknown;
19698
+ };
19699
+ content: {
19700
+ "application/json": components["schemas"]["APIErrorEnvelope"];
19701
+ };
19702
+ };
19703
+ /** @description Possible error codes include `RATE_LIMITED`. Use `x-error-codes` for machine-readable retryability metadata. */
19704
+ 429: {
19705
+ headers: {
19706
+ [name: string]: unknown;
19707
+ };
19708
+ content: {
19709
+ "application/json": components["schemas"]["APIErrorEnvelope"];
19710
+ };
19711
+ };
19712
+ /** @description Possible error codes include `INTERNAL_ERROR`. Use `x-error-codes` for machine-readable retryability metadata. */
19713
+ 500: {
19714
+ headers: {
19715
+ [name: string]: unknown;
19716
+ };
19717
+ content: {
19718
+ "application/json": components["schemas"]["APIErrorEnvelope"];
19719
+ };
19720
+ };
19721
+ };
19722
+ };
19557
19723
  products_search_retrieve: {
19558
19724
  parameters: {
19559
19725
  query?: {
package/dist/index.d.ts CHANGED
@@ -2150,7 +2150,13 @@ interface paths {
2150
2150
  * @description Return the authenticated merchant's information.
2151
2151
  *
2152
2152
  * Uses the default StoreAuthentication and IsStore permission.
2153
- * Useful for testing merchant authentication.
2153
+ *
2154
+ * With ``?include=location`` the payload also carries the store's pickup
2155
+ * address and position, so the ExploreSOUS directory can pin it. That costs
2156
+ * a (cached) geocode, so it is opt-in: the store and product pages read this
2157
+ * endpoint without it and never pay for one. ``address`` is null without an
2158
+ * active pickup location; the coordinates are null when the address cannot
2159
+ * be placed.
2154
2160
  */
2155
2161
  get: operations["merchant_me_retrieve"];
2156
2162
  put?: never;
@@ -2784,6 +2790,31 @@ interface paths {
2784
2790
  patch?: never;
2785
2791
  trace?: never;
2786
2792
  };
2793
+ "/api/v1/products/deliverability/": {
2794
+ parameters: {
2795
+ query?: never;
2796
+ header?: never;
2797
+ path?: never;
2798
+ cookie?: never;
2799
+ };
2800
+ get?: never;
2801
+ put?: never;
2802
+ /**
2803
+ * @description Which products reach a position, and how: the address-aware list, body-borne.
2804
+ *
2805
+ * The same filter and badges as ``GET /products/?latitude=&longitude=``,
2806
+ * but the position and postcode travel in the body, because a URL is
2807
+ * written to every access log between the shopper and here. Returns every
2808
+ * reachable product (ids and badges only), so there is no page to run off
2809
+ * the end of.
2810
+ */
2811
+ post: operations["products_deliverability_create"];
2812
+ delete?: never;
2813
+ options?: never;
2814
+ head?: never;
2815
+ patch?: never;
2816
+ trace?: never;
2817
+ };
2787
2818
  "/api/v1/products/search/": {
2788
2819
  parameters: {
2789
2820
  query?: never;
@@ -5243,6 +5274,40 @@ interface components {
5243
5274
  pre_order_lead_time?: number | null;
5244
5275
  readonly variant_overrides: components["schemas"]["VariantPriceOverride"][];
5245
5276
  };
5277
+ /** @description Which products reach the address, and the badges each carries there. */
5278
+ ProductDeliverability: {
5279
+ results: components["schemas"]["ProductDeliverabilityItem"][];
5280
+ delivery_metadata: components["schemas"]["ProductDeliveryMetadata"];
5281
+ };
5282
+ ProductDeliverabilityItem: {
5283
+ id: number;
5284
+ address_fulfillment_types: string[];
5285
+ };
5286
+ /**
5287
+ * @description Body of ``POST /products/deliverability/``: where the shopper is.
5288
+ *
5289
+ * A body, not a query string, because a position and a postcode are personal
5290
+ * data and a URL is written to every access log on the way here. ``latitude``
5291
+ * and ``longitude`` are ``RegexField`` rather than ``DecimalField`` because
5292
+ * ``DecimalField`` bounds are runtime-only in OpenAPI: generated clients see
5293
+ * a bare string. The pattern restates the ±90 / ±180 bounds where the client
5294
+ * can read them, and the view still converts to ``Decimal``.
5295
+ */
5296
+ ProductDeliverabilityRequest: {
5297
+ /** @description Latitude, within ±90 degrees. */
5298
+ latitude: string;
5299
+ /** @description Longitude, within ±180 degrees. */
5300
+ longitude: string;
5301
+ postal_code?: string;
5302
+ /** @description ISO 3166-1 alpha-2. A nationwide carrier that declares per-country service areas only offers its products once the country is known. */
5303
+ country?: string;
5304
+ };
5305
+ ProductDeliveryMetadata: {
5306
+ delivery_unavailable: boolean;
5307
+ near_delivery_zone: boolean;
5308
+ /** @description Closest pickup location; present only when delivery is unavailable. */
5309
+ nearest_pickup?: components["schemas"]["ProductNearestPickup"];
5310
+ };
5246
5311
  /** @description Resolve tags from ProductTranslation, falling back to Product.tags. */
5247
5312
  ProductDetail: {
5248
5313
  readonly id: number;
@@ -5394,6 +5459,13 @@ interface components {
5394
5459
  position?: number;
5395
5460
  readonly modifiers: components["schemas"]["ProductModifier"][];
5396
5461
  };
5462
+ /** @description The closest pickup location: the same shape ``address-check`` returns. */
5463
+ ProductNearestPickup: {
5464
+ id: number;
5465
+ name: string;
5466
+ /** Format: double */
5467
+ distance_km: number;
5468
+ };
5397
5469
  /**
5398
5470
  * @description Display-only promotion badge attached to a product.
5399
5471
  *
@@ -5799,11 +5871,23 @@ interface components {
5799
5871
  store_public_id: string;
5800
5872
  methods: components["schemas"]["DeliveryMethodState"][];
5801
5873
  };
5874
+ StoreMeAddress: {
5875
+ address_1: string;
5876
+ address_2: string;
5877
+ city: string;
5878
+ postal_code: string;
5879
+ country: string;
5880
+ };
5802
5881
  StoreMeResponse: {
5803
5882
  id: number;
5804
5883
  public_id: string;
5805
5884
  name: string;
5806
5885
  currency: string;
5886
+ address?: components["schemas"]["StoreMeAddress"] | null;
5887
+ /** Format: double */
5888
+ latitude?: number | null;
5889
+ /** Format: double */
5890
+ longitude?: number | null;
5807
5891
  };
5808
5892
  /**
5809
5893
  * @description Read/write serializer for the store-onboarding wizard.
@@ -15888,7 +15972,10 @@ interface operations {
15888
15972
  };
15889
15973
  merchant_me_retrieve: {
15890
15974
  parameters: {
15891
- query?: never;
15975
+ query?: {
15976
+ /** @description `location` adds `address`, `latitude` and `longitude`. Omit it and those keys are absent and nothing is geocoded. */
15977
+ include?: "location";
15978
+ };
15892
15979
  header?: never;
15893
15980
  path?: never;
15894
15981
  cookie?: never;
@@ -19554,6 +19641,85 @@ interface operations {
19554
19641
  };
19555
19642
  };
19556
19643
  };
19644
+ products_deliverability_create: {
19645
+ parameters: {
19646
+ query?: never;
19647
+ header?: never;
19648
+ path?: never;
19649
+ cookie?: never;
19650
+ };
19651
+ requestBody: {
19652
+ content: {
19653
+ "application/json": components["schemas"]["ProductDeliverabilityRequest"];
19654
+ "application/x-www-form-urlencoded": components["schemas"]["ProductDeliverabilityRequest"];
19655
+ "multipart/form-data": components["schemas"]["ProductDeliverabilityRequest"];
19656
+ };
19657
+ };
19658
+ responses: {
19659
+ 200: {
19660
+ headers: {
19661
+ [name: string]: unknown;
19662
+ };
19663
+ content: {
19664
+ "application/json": components["schemas"]["ProductDeliverability"];
19665
+ };
19666
+ };
19667
+ /** @description Possible error codes include `VALIDATION_ERROR`. Use `x-error-codes` for machine-readable retryability metadata. */
19668
+ 400: {
19669
+ headers: {
19670
+ [name: string]: unknown;
19671
+ };
19672
+ content: {
19673
+ "application/json": components["schemas"]["APIErrorEnvelope"];
19674
+ };
19675
+ };
19676
+ /** @description Possible error codes include `UNAUTHORIZED`. Use `x-error-codes` for machine-readable retryability metadata. */
19677
+ 401: {
19678
+ headers: {
19679
+ [name: string]: unknown;
19680
+ };
19681
+ content: {
19682
+ "application/json": components["schemas"]["APIErrorEnvelope"];
19683
+ };
19684
+ };
19685
+ /** @description Possible error codes include `FORBIDDEN`. Use `x-error-codes` for machine-readable retryability metadata. */
19686
+ 403: {
19687
+ headers: {
19688
+ [name: string]: unknown;
19689
+ };
19690
+ content: {
19691
+ "application/json": components["schemas"]["APIErrorEnvelope"];
19692
+ };
19693
+ };
19694
+ /** @description 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. */
19695
+ 404: {
19696
+ headers: {
19697
+ [name: string]: unknown;
19698
+ };
19699
+ content: {
19700
+ "application/json": components["schemas"]["APIErrorEnvelope"];
19701
+ };
19702
+ };
19703
+ /** @description Possible error codes include `RATE_LIMITED`. Use `x-error-codes` for machine-readable retryability metadata. */
19704
+ 429: {
19705
+ headers: {
19706
+ [name: string]: unknown;
19707
+ };
19708
+ content: {
19709
+ "application/json": components["schemas"]["APIErrorEnvelope"];
19710
+ };
19711
+ };
19712
+ /** @description Possible error codes include `INTERNAL_ERROR`. Use `x-error-codes` for machine-readable retryability metadata. */
19713
+ 500: {
19714
+ headers: {
19715
+ [name: string]: unknown;
19716
+ };
19717
+ content: {
19718
+ "application/json": components["schemas"]["APIErrorEnvelope"];
19719
+ };
19720
+ };
19721
+ };
19722
+ };
19557
19723
  products_search_retrieve: {
19558
19724
  parameters: {
19559
19725
  query?: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@poweredbysous/storefront-admin-sdk",
3
- "version": "4.0.2",
3
+ "version": "4.2.0",
4
4
  "description": "Type-safe TypeScript SDK for SOUS Storefront Backend admin endpoints",
5
5
  "license": "UNLICENSED",
6
6
  "private": false,