@bacano/sdk 1.2.2 → 1.2.3

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.
@@ -52,6 +52,8 @@ aplicar obligatoriamente `STOREFRONT_CONTENT_LOCATOR.md`; añadir
52
52
  `AUTHENTICATION.md`, `STOREFRONT_LEADS.md`, `STOREFRONT_CLARITY.md` y
53
53
  otros contratos únicamente cuando esas capacidades existan. Leer
54
54
  `STOREFRONT_CONSTRUCTION.md` cuando el website permita ocultarse temporalmente.
55
+ Si la tienda acepta pagos, leer obligatoriamente `STOREFRONT_PAYMENTS.md` antes
56
+ de implementar, depurar o auditar checkout, retorno, reintentos o webhooks.
55
57
  Si existen formularios administrados desde Bacano, leer obligatoriamente
56
58
  `STOREFRONT_FORMS.md` y
57
59
  [references/forms.md](references/forms.md) antes de auditarlos o modificarlos.
@@ -54,6 +54,8 @@ Aplicar además de los controles comunes.
54
54
 
55
55
  ## Pagos y pedidos
56
56
 
57
+ - Leer y aplicar `STOREFRONT_PAYMENTS.md`; no reconstruir en la tienda URLs,
58
+ credenciales ni payloads privados de Wompi, Mercado Pago o Addi.
57
59
  - Ejecutar al menos un happy path real o sandbox por cada método crítico
58
60
  publicado. Probar pago inmediato, transferencia, Wompi y contraentrega solo
59
61
  si están activos; los estados alternos de cada proveedor quedan en su matriz
@@ -33,7 +33,7 @@ export declare const VALIDATE_COUPON = "\n mutation ValidateCoupon(\n $order
33
33
  export declare const APPLY_COUPON = "\n mutation ApplyCoupon($orderId: uuid!, $cartToken: String!, $code: String!) {\n websiteApplyCoupon(\n order_id: $orderId\n cart_token: $cartToken\n code: $code\n ) {\n success\n order_id\n coupon_id\n code\n name\n coupon_type\n discount_amount\n eligible_subtotal\n message\n cart {\n id\n status\n discount\n total_without_tax\n tax\n total_with_tax\n total_with_discount\n created_at\n updated_at\n items {\n id\n product_variant_id\n quantity\n product_variant {\n id\n sku\n product {\n id\n name\n }\n prices {\n id\n price\n price_type\n chain_id\n }\n }\n }\n }\n errors\n }\n }\n";
34
34
  export declare const REMOVE_COUPON = "\n mutation RemoveCoupon(\n $orderId: uuid!\n $cartToken: String!\n $couponId: uuid!\n ) {\n websiteRemoveCoupon(\n order_id: $orderId\n cart_token: $cartToken\n coupon_id: $couponId\n ) {\n success\n order_id\n coupon_id\n code\n name\n coupon_type\n discount_amount\n eligible_subtotal\n message\n cart {\n id\n status\n discount\n total_without_tax\n tax\n total_with_tax\n total_with_discount\n created_at\n updated_at\n items {\n id\n product_variant_id\n quantity\n product_variant {\n id\n sku\n product {\n id\n name\n }\n prices {\n id\n price\n price_type\n chain_id\n }\n }\n }\n }\n errors\n }\n }\n";
35
35
  export declare const CREATE_PAYMENT_SESSION = "\n mutation CreatePaymentSession(\n $orderId: uuid!\n $cartToken: String\n $publicOrderToken: String\n $paymentMethodId: uuid!\n $returnUrl: String!\n ) {\n websiteCreatePaymentSession(\n order_id: $orderId\n cart_token: $cartToken\n public_order_token: $publicOrderToken\n payment_method_id: $paymentMethodId\n return_url: $returnUrl\n ) {\n success\n order_id\n payment_method_id\n payment_session_id\n gateway_code\n integration_mode\n status\n redirect_url\n public_payload\n errors\n }\n }\n";
36
- export declare const RECONCILE_PAYMENT_SESSION = "\n mutation ReconcilePaymentSession(\n $orderId: uuid!\n $publicOrderToken: String!\n $paymentSessionId: uuid!\n $gatewayTransactionId: String!\n ) {\n websiteReconcilePaymentSession(\n order_id: $orderId\n public_order_token: $publicOrderToken\n payment_session_id: $paymentSessionId\n gateway_transaction_id: $gatewayTransactionId\n ) {\n success\n order_id\n payment_method_id\n payment_session_id\n gateway_code\n integration_mode\n status\n redirect_url\n public_payload\n errors\n }\n }\n";
36
+ export declare const RECONCILE_PAYMENT_SESSION = "\n mutation ReconcilePaymentSession(\n $orderId: uuid!\n $publicOrderToken: String!\n $paymentSessionId: uuid!\n $gatewayTransactionId: String\n ) {\n websiteReconcilePaymentSession(\n order_id: $orderId\n public_order_token: $publicOrderToken\n payment_session_id: $paymentSessionId\n gateway_transaction_id: $gatewayTransactionId\n ) {\n success\n order_id\n payment_method_id\n payment_session_id\n gateway_code\n integration_mode\n status\n redirect_url\n public_payload\n errors\n }\n }\n";
37
37
  export declare const GET_ORDERS = "\n query GetOrders($limit: Int = 20, $offset: Int = 0) {\n orders(\n where: { order_number: { _is_null: false } }\n order_by: { created_at: desc }\n limit: $limit\n offset: $offset\n ) {\n id\n order_number\n status\n fulfillment_family\n discount\n tax\n total_without_tax\n total_with_tax\n total_with_discount\n created_at\n updated_at\n order_product_variants {\n id\n product_variant_id\n quantity\n product_variant {\n sku\n product {\n id\n name\n }\n }\n }\n }\n }\n";
38
38
  export declare const GET_ORDER_BY_PK = "\n query GetOrderByPk($orderId: uuid!) {\n orders(where: { id: { _eq: $orderId } }) {\n id\n order_number\n status\n fulfillment_family\n discount\n tax\n total_without_tax\n total_with_tax\n total_with_discount\n created_at\n updated_at\n order_product_variants {\n id\n product_variant_id\n quantity\n product_variant {\n sku\n product {\n id\n name\n }\n }\n }\n }\n }\n";
39
39
  export declare const GET_PUBLIC_ORDER = "\n mutation GetPublicOrder($websiteId: uuid!, $orderId: uuid!, $token: String!) {\n websiteGetPublicOrder(\n website_id: $websiteId\n order_id: $orderId\n token: $token\n ) {\n success\n order {\n order_id\n order_number\n status\n payment_status\n fulfillment_family\n delivery {\n fulfillment_family\n shipping {\n label\n amount\n method_type\n collection_mode\n total_policy\n address\n }\n pickup {\n label\n }\n }\n payment {\n mode\n label\n method {\n id\n label\n payment_method_type\n gateway_code\n requires_payment_session\n }\n initial_payment {\n amount\n payment_method_id\n method_label\n payment_method_type\n gateway_code\n requires_payment_session\n }\n requires_payment_session\n next_action\n session {\n id\n gateway_code\n integration_mode\n status\n reference\n amount\n currency\n gateway_transaction_id\n error_message\n expires_at\n created_at\n updated_at\n }\n }\n totals {\n subtotal\n tax\n discount\n total\n total_with_discount\n }\n items {\n id\n product_variant_id\n sku\n name\n image_file_id\n quantity\n unit_price\n line_total\n }\n next_steps\n created_at\n updated_at\n }\n errors\n }\n }\n";
package/types.d.ts CHANGED
@@ -151,7 +151,7 @@ export interface WebsiteCampaignCaptureResult {
151
151
  }
152
152
  export type WebsiteFormAction = "STORE_RESPONSE" | "CAPTURE_LEAD";
153
153
  export type WebsiteFormStatus = "ACTIVE" | "PAUSED";
154
- export type WebsiteFormFieldType = "text" | "textarea" | "email" | "phone" | "number" | "date" | "select" | "radio" | "multi_select" | "checkbox";
154
+ export type WebsiteFormFieldType = "text" | "textarea" | "email" | "phone" | "number" | "scale" | "date" | "select" | "radio" | "multi_select" | "checkbox";
155
155
  export interface WebsiteFormOption {
156
156
  value: string;
157
157
  label: string;
@@ -164,10 +164,23 @@ export type WebsiteFormOptionSource = {
164
164
  listKey: string;
165
165
  };
166
166
  export interface WebsiteFormField {
167
+ /** A single-choice question may reveal one branch, recursively. */
168
+ branches?: Array<{
169
+ value: string;
170
+ fields: WebsiteFormField[];
171
+ }>;
167
172
  key: string;
168
173
  label: string;
169
174
  type: WebsiteFormFieldType;
170
175
  required: boolean;
176
+ /** Discrete integer scale; submitted as a string, stored as a number. */
177
+ scale?: {
178
+ min: number;
179
+ max: number;
180
+ display: "numbers" | "stars";
181
+ minLabel?: string;
182
+ maxLabel?: string;
183
+ };
171
184
  placeholder?: string | null;
172
185
  helpText?: string | null;
173
186
  optionSource?: WebsiteFormOptionSource | null;