@vitrina/api 15.13.0 → 15.14.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
@@ -215581,6 +215581,155 @@ interface paths {
215581
215581
  patch?: never;
215582
215582
  trace?: never;
215583
215583
  };
215584
+ "/shipping/estimates": {
215585
+ parameters: {
215586
+ query?: never;
215587
+ header?: never;
215588
+ path?: never;
215589
+ cookie?: never;
215590
+ };
215591
+ get?: never;
215592
+ put?: never;
215593
+ /**
215594
+ * Estimate a delivery to where a buyer said
215595
+ * @description Prices a Chilexpress delivery from the store’s connection (its origin, the services it offers, its default box times `quantity`) to a destination as a buyer wrote it: a commune («Ñuñoa», «Stgo centro»), an address («Av. Alemania 0450, Temuco») and/or a region. Stores nothing: there is no quote id, and a checkout still needs `POST /orders/checkout/shipping-quotes`. Never creates a shipment. `status`: `quoted` (destination + options), `needs_commune` (`reason` missing / ambiguous / region_mismatch / not_found, with `candidates` to ask about; send the chosen `coverage_code` back), `not_covered` (no offered service reaches it), `unknown_item`. The same answer the AI agent’s `quote_shipping` tool gives. 409 `shipping_not_connected` without a courier. Requires `orders:read`.
215596
+ */
215597
+ post: {
215598
+ parameters: {
215599
+ query?: never;
215600
+ header?: {
215601
+ /** @description Replay-safe retries: resending the SAME key with the SAME body returns the original response (`X-Idempotent-Replay: 1`) instead of creating a second copy — safe to send whenever a response might not have arrived. The same key with a DIFFERENT body answers `409 IDEMPOTENCY_KEY_CONFLICT`; use a fresh key per operation. */
215602
+ "Idempotency-Key"?: string;
215603
+ };
215604
+ path?: never;
215605
+ cookie?: never;
215606
+ };
215607
+ requestBody?: {
215608
+ content: {
215609
+ /**
215610
+ * @example {
215611
+ * "address": "Av. Alemania 0450, Temuco"
215612
+ * }
215613
+ */
215614
+ "application/json": {
215615
+ /** @description The commune as the buyer wrote it («Ñuñoa», «Stgo centro»). Accents and case are ignored. */
215616
+ commune?: string;
215617
+ /** @description The address as the buyer wrote it («Av. Alemania 0450, Temuco»); the commune is found in it. */
215618
+ address?: string;
215619
+ /** @description The region as the buyer wrote it («Araucanía», «RM», «IX»); narrows the commune. */
215620
+ region?: string;
215621
+ /** @description A `coverage_code` from an earlier answer’s `candidates`, once the buyer picked one. */
215622
+ coverage_code?: string;
215623
+ /** @description Optional: a variant id or product id from the catalog, or a SKU. Its catalog price is the declared value; omitted = one standard box, nothing declared. */
215624
+ item?: string;
215625
+ quantity?: number;
215626
+ };
215627
+ };
215628
+ };
215629
+ responses: {
215630
+ /** @description The estimate, or what is missing to make one */
215631
+ 200: {
215632
+ headers: {
215633
+ [name: string]: unknown;
215634
+ };
215635
+ content: {
215636
+ /**
215637
+ * @example {
215638
+ * "data": {
215639
+ * "status": "quoted",
215640
+ * "carrier": "chilexpress",
215641
+ * "destination": {
215642
+ * "coverage_code": "TEMU",
215643
+ * "commune": "Temuco",
215644
+ * "region_code": "R9",
215645
+ * "region": "Araucania"
215646
+ * },
215647
+ * "options": [
215648
+ * {
215649
+ * "service_code": 3,
215650
+ * "service_name": "Express",
215651
+ * "price_clp": 6965,
215652
+ * "estimated_business_days": 2
215653
+ * }
215654
+ * ],
215655
+ * "item": null,
215656
+ * "package": {
215657
+ * "weight_kg": 0.6,
215658
+ * "height_cm": 8,
215659
+ * "width_cm": 12,
215660
+ * "length_cm": 20
215661
+ * },
215662
+ * "units": 1
215663
+ * }
215664
+ * }
215665
+ */
215666
+ "application/json": {
215667
+ data: components["schemas"]["ShippingEstimate"];
215668
+ };
215669
+ };
215670
+ };
215671
+ /** @description Validation error */
215672
+ 400: {
215673
+ headers: {
215674
+ [name: string]: unknown;
215675
+ };
215676
+ content: {
215677
+ "application/json": components["schemas"]["Error"];
215678
+ };
215679
+ };
215680
+ /** @description Unauthorized */
215681
+ 401: {
215682
+ headers: {
215683
+ [name: string]: unknown;
215684
+ };
215685
+ content: {
215686
+ "application/json": components["schemas"]["Error"];
215687
+ };
215688
+ };
215689
+ /** @description Forbidden */
215690
+ 403: {
215691
+ headers: {
215692
+ [name: string]: unknown;
215693
+ };
215694
+ content: {
215695
+ "application/json": components["schemas"]["Error"];
215696
+ };
215697
+ };
215698
+ /** @description Not found */
215699
+ 404: {
215700
+ headers: {
215701
+ [name: string]: unknown;
215702
+ };
215703
+ content: {
215704
+ "application/json": components["schemas"]["Error"];
215705
+ };
215706
+ };
215707
+ /** @description Conflict (incl. Idempotency-Key reuse with different body) */
215708
+ 409: {
215709
+ headers: {
215710
+ [name: string]: unknown;
215711
+ };
215712
+ content: {
215713
+ "application/json": components["schemas"]["Error"];
215714
+ };
215715
+ };
215716
+ /** @description Rate limited */
215717
+ 429: {
215718
+ headers: {
215719
+ [name: string]: unknown;
215720
+ };
215721
+ content: {
215722
+ "application/json": components["schemas"]["Error"];
215723
+ };
215724
+ };
215725
+ };
215726
+ };
215727
+ delete?: never;
215728
+ options?: never;
215729
+ head?: never;
215730
+ patch?: never;
215731
+ trace?: never;
215732
+ };
215584
215733
  "/store-setup": {
215585
215734
  parameters: {
215586
215735
  query?: never;
@@ -248446,6 +248595,50 @@ interface components {
248446
248595
  seller_rut: string | null;
248447
248596
  connected_at: string | null;
248448
248597
  };
248598
+ ShippingEstimate: {
248599
+ /** @enum {string} */
248600
+ status: "quoted" | "needs_commune" | "not_covered" | "unknown_item";
248601
+ /** @enum {string} */
248602
+ carrier?: "chilexpress";
248603
+ destination?: {
248604
+ coverage_code: string;
248605
+ commune: string;
248606
+ region_code: string;
248607
+ region: string | null;
248608
+ };
248609
+ /** @description `quoted`: cheapest first. */
248610
+ options?: {
248611
+ /** @description Chilexpress service type: 2 Prioritario, 3 Express (día hábil siguiente), 4 Extendido, 5 Extremos, 41/42 encomiendas grandes. */
248612
+ service_code: number;
248613
+ service_name: string;
248614
+ price_clp: number;
248615
+ estimated_business_days: number | null;
248616
+ }[];
248617
+ item?: {
248618
+ title: string | null;
248619
+ quantity: number;
248620
+ declared_value_clp: number | null;
248621
+ } | null;
248622
+ package?: {
248623
+ weight_kg: number;
248624
+ height_cm: number;
248625
+ width_cm: number;
248626
+ length_cm: number;
248627
+ };
248628
+ units?: number;
248629
+ /**
248630
+ * @description `needs_commune`: why no commune was chosen.
248631
+ * @enum {string}
248632
+ */
248633
+ reason?: "missing" | "ambiguous" | "region_mismatch" | "not_found";
248634
+ /** @description `needs_commune`: the areas that fit (or close names); ask the buyer, then send the chosen `coverage_code`. */
248635
+ candidates?: {
248636
+ coverage_code: string;
248637
+ commune: string;
248638
+ region_code: string;
248639
+ region: string | null;
248640
+ }[];
248641
+ };
248449
248642
  WhatsappTemplateAnalytics: {
248450
248643
  template: {
248451
248644
  /** Format: uuid */
package/dist/index.d.ts CHANGED
@@ -215581,6 +215581,155 @@ interface paths {
215581
215581
  patch?: never;
215582
215582
  trace?: never;
215583
215583
  };
215584
+ "/shipping/estimates": {
215585
+ parameters: {
215586
+ query?: never;
215587
+ header?: never;
215588
+ path?: never;
215589
+ cookie?: never;
215590
+ };
215591
+ get?: never;
215592
+ put?: never;
215593
+ /**
215594
+ * Estimate a delivery to where a buyer said
215595
+ * @description Prices a Chilexpress delivery from the store’s connection (its origin, the services it offers, its default box times `quantity`) to a destination as a buyer wrote it: a commune («Ñuñoa», «Stgo centro»), an address («Av. Alemania 0450, Temuco») and/or a region. Stores nothing: there is no quote id, and a checkout still needs `POST /orders/checkout/shipping-quotes`. Never creates a shipment. `status`: `quoted` (destination + options), `needs_commune` (`reason` missing / ambiguous / region_mismatch / not_found, with `candidates` to ask about; send the chosen `coverage_code` back), `not_covered` (no offered service reaches it), `unknown_item`. The same answer the AI agent’s `quote_shipping` tool gives. 409 `shipping_not_connected` without a courier. Requires `orders:read`.
215596
+ */
215597
+ post: {
215598
+ parameters: {
215599
+ query?: never;
215600
+ header?: {
215601
+ /** @description Replay-safe retries: resending the SAME key with the SAME body returns the original response (`X-Idempotent-Replay: 1`) instead of creating a second copy — safe to send whenever a response might not have arrived. The same key with a DIFFERENT body answers `409 IDEMPOTENCY_KEY_CONFLICT`; use a fresh key per operation. */
215602
+ "Idempotency-Key"?: string;
215603
+ };
215604
+ path?: never;
215605
+ cookie?: never;
215606
+ };
215607
+ requestBody?: {
215608
+ content: {
215609
+ /**
215610
+ * @example {
215611
+ * "address": "Av. Alemania 0450, Temuco"
215612
+ * }
215613
+ */
215614
+ "application/json": {
215615
+ /** @description The commune as the buyer wrote it («Ñuñoa», «Stgo centro»). Accents and case are ignored. */
215616
+ commune?: string;
215617
+ /** @description The address as the buyer wrote it («Av. Alemania 0450, Temuco»); the commune is found in it. */
215618
+ address?: string;
215619
+ /** @description The region as the buyer wrote it («Araucanía», «RM», «IX»); narrows the commune. */
215620
+ region?: string;
215621
+ /** @description A `coverage_code` from an earlier answer’s `candidates`, once the buyer picked one. */
215622
+ coverage_code?: string;
215623
+ /** @description Optional: a variant id or product id from the catalog, or a SKU. Its catalog price is the declared value; omitted = one standard box, nothing declared. */
215624
+ item?: string;
215625
+ quantity?: number;
215626
+ };
215627
+ };
215628
+ };
215629
+ responses: {
215630
+ /** @description The estimate, or what is missing to make one */
215631
+ 200: {
215632
+ headers: {
215633
+ [name: string]: unknown;
215634
+ };
215635
+ content: {
215636
+ /**
215637
+ * @example {
215638
+ * "data": {
215639
+ * "status": "quoted",
215640
+ * "carrier": "chilexpress",
215641
+ * "destination": {
215642
+ * "coverage_code": "TEMU",
215643
+ * "commune": "Temuco",
215644
+ * "region_code": "R9",
215645
+ * "region": "Araucania"
215646
+ * },
215647
+ * "options": [
215648
+ * {
215649
+ * "service_code": 3,
215650
+ * "service_name": "Express",
215651
+ * "price_clp": 6965,
215652
+ * "estimated_business_days": 2
215653
+ * }
215654
+ * ],
215655
+ * "item": null,
215656
+ * "package": {
215657
+ * "weight_kg": 0.6,
215658
+ * "height_cm": 8,
215659
+ * "width_cm": 12,
215660
+ * "length_cm": 20
215661
+ * },
215662
+ * "units": 1
215663
+ * }
215664
+ * }
215665
+ */
215666
+ "application/json": {
215667
+ data: components["schemas"]["ShippingEstimate"];
215668
+ };
215669
+ };
215670
+ };
215671
+ /** @description Validation error */
215672
+ 400: {
215673
+ headers: {
215674
+ [name: string]: unknown;
215675
+ };
215676
+ content: {
215677
+ "application/json": components["schemas"]["Error"];
215678
+ };
215679
+ };
215680
+ /** @description Unauthorized */
215681
+ 401: {
215682
+ headers: {
215683
+ [name: string]: unknown;
215684
+ };
215685
+ content: {
215686
+ "application/json": components["schemas"]["Error"];
215687
+ };
215688
+ };
215689
+ /** @description Forbidden */
215690
+ 403: {
215691
+ headers: {
215692
+ [name: string]: unknown;
215693
+ };
215694
+ content: {
215695
+ "application/json": components["schemas"]["Error"];
215696
+ };
215697
+ };
215698
+ /** @description Not found */
215699
+ 404: {
215700
+ headers: {
215701
+ [name: string]: unknown;
215702
+ };
215703
+ content: {
215704
+ "application/json": components["schemas"]["Error"];
215705
+ };
215706
+ };
215707
+ /** @description Conflict (incl. Idempotency-Key reuse with different body) */
215708
+ 409: {
215709
+ headers: {
215710
+ [name: string]: unknown;
215711
+ };
215712
+ content: {
215713
+ "application/json": components["schemas"]["Error"];
215714
+ };
215715
+ };
215716
+ /** @description Rate limited */
215717
+ 429: {
215718
+ headers: {
215719
+ [name: string]: unknown;
215720
+ };
215721
+ content: {
215722
+ "application/json": components["schemas"]["Error"];
215723
+ };
215724
+ };
215725
+ };
215726
+ };
215727
+ delete?: never;
215728
+ options?: never;
215729
+ head?: never;
215730
+ patch?: never;
215731
+ trace?: never;
215732
+ };
215584
215733
  "/store-setup": {
215585
215734
  parameters: {
215586
215735
  query?: never;
@@ -248446,6 +248595,50 @@ interface components {
248446
248595
  seller_rut: string | null;
248447
248596
  connected_at: string | null;
248448
248597
  };
248598
+ ShippingEstimate: {
248599
+ /** @enum {string} */
248600
+ status: "quoted" | "needs_commune" | "not_covered" | "unknown_item";
248601
+ /** @enum {string} */
248602
+ carrier?: "chilexpress";
248603
+ destination?: {
248604
+ coverage_code: string;
248605
+ commune: string;
248606
+ region_code: string;
248607
+ region: string | null;
248608
+ };
248609
+ /** @description `quoted`: cheapest first. */
248610
+ options?: {
248611
+ /** @description Chilexpress service type: 2 Prioritario, 3 Express (día hábil siguiente), 4 Extendido, 5 Extremos, 41/42 encomiendas grandes. */
248612
+ service_code: number;
248613
+ service_name: string;
248614
+ price_clp: number;
248615
+ estimated_business_days: number | null;
248616
+ }[];
248617
+ item?: {
248618
+ title: string | null;
248619
+ quantity: number;
248620
+ declared_value_clp: number | null;
248621
+ } | null;
248622
+ package?: {
248623
+ weight_kg: number;
248624
+ height_cm: number;
248625
+ width_cm: number;
248626
+ length_cm: number;
248627
+ };
248628
+ units?: number;
248629
+ /**
248630
+ * @description `needs_commune`: why no commune was chosen.
248631
+ * @enum {string}
248632
+ */
248633
+ reason?: "missing" | "ambiguous" | "region_mismatch" | "not_found";
248634
+ /** @description `needs_commune`: the areas that fit (or close names); ask the buyer, then send the chosen `coverage_code`. */
248635
+ candidates?: {
248636
+ coverage_code: string;
248637
+ commune: string;
248638
+ region_code: string;
248639
+ region: string | null;
248640
+ }[];
248641
+ };
248449
248642
  WhatsappTemplateAnalytics: {
248450
248643
  template: {
248451
248644
  /** Format: uuid */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vitrina/api",
3
- "version": "15.13.0",
3
+ "version": "15.14.0",
4
4
  "description": "Typed TypeScript SDK for the Vitrina API pública — generated from the committed openapi.public.json (ADR 0106).",
5
5
  "type": "module",
6
6
  "license": "MIT",