@vio-live/web-sdk 0.10.0 → 0.11.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.
@@ -1250,7 +1250,7 @@ declare class CheckoutManager extends EventTarget {
1250
1250
  * the publisher-facing feature; NOT part of the Vio pipeline)
1251
1251
  * 3. `vio:analytics` DOM event — always when started (inspector/bridges)
1252
1252
  */
1253
- declare const ANALYTICS_EVENT_NAMES: readonly ["view_item_list", "select_item", "view_item", "add_to_cart", "view_cart", "begin_checkout", "purchase", "component_impression", "component_click", "ad_impression", "ad_click", "poll_impression", "contest_impression", "session_start", "session_end"];
1253
+ declare const ANALYTICS_EVENT_NAMES: readonly ["view_item_list", "select_item", "view_item", "add_to_cart", "remove_from_cart", "view_cart", "begin_checkout", "purchase", "component_impression", "component_click", "ad_impression", "ad_click", "poll_impression", "contest_impression", "session_start", "session_end", "checkout_error", "sdk_error"];
1254
1254
  type AnalyticsEventName = (typeof ANALYTICS_EVENT_NAMES)[number];
1255
1255
  /** Camel-case for DX; mapped to the snake_case wire format at build time. */
1256
1256
  interface AnalyticsContext {
@@ -1272,6 +1272,8 @@ interface AnalyticsContext {
1272
1272
  contentId?: string | number;
1273
1273
  /** Human-readable content snapshot; auto-filled from document.title. */
1274
1274
  contentTitle?: string;
1275
+ /** Código corto del fallo (`sdk_error` / `checkout_error`). */
1276
+ errorCode?: string;
1275
1277
  variant?: string;
1276
1278
  }
1277
1279
  interface AnalyticsItemInput {
@@ -1297,6 +1299,13 @@ interface TrackOptions {
1297
1299
  interface AnalyticsStartOptions {
1298
1300
  /** Where the SDK is embedded: 'vev' | 'replit' | 'custom' | … Default 'custom'. */
1299
1301
  host?: string;
1302
+ /**
1303
+ * Arrancar en modo cookieless hasta que el host llame `setConsent(true)`.
1304
+ * Default false: el SDK asume que el CMP del publisher ya decidió si nos
1305
+ * carga. Los publishers EU que necesitan medir antes del consentimiento
1306
+ * (o no pueden persistir sin él) ponen true.
1307
+ */
1308
+ requireConsent?: boolean;
1300
1309
  /**
1301
1310
  * Install the automatic funnel listeners (vio:added-to-cart,
1302
1311
  * vio:checkout-open, vio:open-cart, vio:payment-success). Default true.
@@ -1330,6 +1339,9 @@ declare class AnalyticsManager extends EventTarget {
1330
1339
  private retryNotBefore;
1331
1340
  private externalUserId;
1332
1341
  private sessionId;
1342
+ private requireConsent;
1343
+ private consentGranted;
1344
+ private anonIdCache;
1333
1345
  /** Set via start({ sessionId }) — the host owns the session, we follow. */
1334
1346
  private externalSessionId;
1335
1347
  private sessionStartedAt;
@@ -1343,6 +1355,16 @@ declare class AnalyticsManager extends EventTarget {
1343
1355
  * Install listeners + begin flushing. Explicit on purpose (no module
1344
1356
  * side-effects). Safe to call twice (second call only updates options).
1345
1357
  */
1358
+ /**
1359
+ * Consentimiento (ePrivacy/GDPR). Por defecto el SDK asume que el host ya
1360
+ * lo gestionó — su CMP decide si nos carga. Con `requireConsent: true`
1361
+ * arranca en modo **cookieless**: mide la visita con ids efímeros en
1362
+ * memoria y NO escribe nada en localStorage hasta que el host llame
1363
+ * `setConsent(true)`. Retirarlo borra lo persistido.
1364
+ */
1365
+ setConsent(granted: boolean): void;
1366
+ /** ¿Podemos escribir en el dispositivo? */
1367
+ private get canPersist();
1346
1368
  start(options?: AnalyticsStartOptions): void;
1347
1369
  /** Stop timers + listeners (tests / SPA unmount). Queue survives. */
1348
1370
  stop(): void;
@@ -1368,6 +1390,8 @@ declare class AnalyticsManager extends EventTarget {
1368
1390
  /** Force a flush (mostly for tests). */
1369
1391
  flush(): Promise<void>;
1370
1392
  private buildEvent;
1393
+ /** Guarda la sesión solo si podemos escribir en el dispositivo. */
1394
+ private persistSession;
1371
1395
  private anonId;
1372
1396
  /** Rolling session: renewed by activity, rotated after 30 min idle. */
1373
1397
  private ensureSession;
@@ -1432,6 +1456,6 @@ declare const Vio: VioFacade;
1432
1456
  *
1433
1457
  * RELEASE CHECKLIST: bump together with package.json (see CONTRIBUTING).
1434
1458
  */
1435
- declare const SDK_VERSION = "0.9.1";
1459
+ declare const SDK_VERSION = "0.11.0";
1436
1460
 
1437
1461
  export { ADD_ITEM_MUTATION, type AddManualOptions, type AddProductOptions, type AnalyticsCommerce, type AnalyticsContext, type AnalyticsEventName, type AnalyticsItemInput, AnalyticsManager, type AnalyticsStartOptions, type ApplePayConfig, type ApplePayResult, type BootstrapResponse, CREATE_CART_MUTATION, CREATE_CHECKOUT_MUTATION, CREATE_PAYMENT_STRIPE_MUTATION, CREATE_PAYMENT_VIPPS_MUTATION, type CartChangeDetail, type CartLineItem, CartManager, type CartQueryOptions, type CheckoutAddress, type CheckoutChangeDetail, CheckoutManager, type CheckoutState, CommerceClient, Configuration, type CreatePaymentVippsResponse, type CreatePaymentVippsVariables, DELETE_ITEM_MUTATION, type Environment, GET_AVAILABLE_PAYMENT_METHODS_QUERY, GET_CART_QUERY, GET_CHECKOUT_QUERY, GET_LINE_ITEMS_BY_SUPPLIER_QUERY, GET_VIPPS_STATUS_QUERY, type GetVippsStatusVariables, type ImageSize, type PaymentCompleteDetail, type PaymentMethod, type PaymentSelectDetail, type PlacementComponent, type Product, type ProductCategory, type ProductImage, type ProductOption, type ProductPrice, type ProductVariant, type ResolvedConfig, SDK_VERSION, type Sponsor, type SponsorCartState, type SponsorCommerceBlock, type TrackOptions, UPDATE_CHECKOUT_MUTATION, UPDATE_ITEM_MUTATION, UPDATE_SHIPPINGS_BY_SUPPLIER_MUTATION, Vio, VioApi, VioApiError, type VioConfig, type VippsPaymentState, type VippsStatusResult, addItem, checkApplePayAvailability, createCart, createCheckout, createCommerceClient, createPaymentStripe, createPaymentVipps, createVioApi, deleteItem, displayPrice, executeCartGraphQL, formatPrice, getAvailablePaymentMethods, getCart, getCartGraphQLOptions, getCheckout, getCustomerSessionId, getGlobalCurrency, getLineItemsBySupplier, getVippsStatus, primaryImageUrl, showApplePaySheet, updateCheckout, updateItem, updateShippingsBySupplier };
@@ -1,4 +1,4 @@
1
1
  import '../chunk-QYQQ5J6E.js';
2
- export { ADD_ITEM_MUTATION, AnalyticsManager, CREATE_CART_MUTATION, CREATE_CHECKOUT_MUTATION, CREATE_PAYMENT_STRIPE_MUTATION, CREATE_PAYMENT_VIPPS_MUTATION, CartManager, CheckoutManager, CommerceClient, Configuration, DELETE_ITEM_MUTATION, GET_AVAILABLE_PAYMENT_METHODS_QUERY, GET_CART_QUERY, GET_CHECKOUT_QUERY, GET_LINE_ITEMS_BY_SUPPLIER_QUERY, GET_VIPPS_STATUS_QUERY, SDK_VERSION, UPDATE_CHECKOUT_MUTATION, UPDATE_ITEM_MUTATION, UPDATE_SHIPPINGS_BY_SUPPLIER_MUTATION, Vio, VioApi, VioApiError, addItem, checkApplePayAvailability, createCart, createCheckout, createCommerceClient, createPaymentStripe, createPaymentVipps, createVioApi, deleteItem, displayPrice, executeCartGraphQL, formatPrice, getAvailablePaymentMethods, getCart, getCartGraphQLOptions, getCheckout, getCustomerSessionId, getGlobalCurrency, getLineItemsBySupplier, getVippsStatus, primaryImageUrl, showApplePaySheet, updateCheckout, updateItem, updateShippingsBySupplier } from '../chunk-PX27CQGX.js';
2
+ export { ADD_ITEM_MUTATION, AnalyticsManager, CREATE_CART_MUTATION, CREATE_CHECKOUT_MUTATION, CREATE_PAYMENT_STRIPE_MUTATION, CREATE_PAYMENT_VIPPS_MUTATION, CartManager, CheckoutManager, CommerceClient, Configuration, DELETE_ITEM_MUTATION, GET_AVAILABLE_PAYMENT_METHODS_QUERY, GET_CART_QUERY, GET_CHECKOUT_QUERY, GET_LINE_ITEMS_BY_SUPPLIER_QUERY, GET_VIPPS_STATUS_QUERY, SDK_VERSION, UPDATE_CHECKOUT_MUTATION, UPDATE_ITEM_MUTATION, UPDATE_SHIPPINGS_BY_SUPPLIER_MUTATION, Vio, VioApi, VioApiError, addItem, checkApplePayAvailability, createCart, createCheckout, createCommerceClient, createPaymentStripe, createPaymentVipps, createVioApi, deleteItem, displayPrice, executeCartGraphQL, formatPrice, getAvailablePaymentMethods, getCart, getCartGraphQLOptions, getCheckout, getCustomerSessionId, getGlobalCurrency, getLineItemsBySupplier, getVippsStatus, primaryImageUrl, showApplePaySheet, updateCheckout, updateItem, updateShippingsBySupplier } from '../chunk-U2QG4IVJ.js';
3
3
  //# sourceMappingURL=index.js.map
4
4
  //# sourceMappingURL=index.js.map
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
1
  import './chunk-QYQQ5J6E.js';
2
- export { ADD_ITEM_MUTATION, AnalyticsManager, CREATE_CART_MUTATION, CREATE_CHECKOUT_MUTATION, CREATE_PAYMENT_STRIPE_MUTATION, CREATE_PAYMENT_VIPPS_MUTATION, CartManager, CheckoutManager, CommerceClient, Configuration, DELETE_ITEM_MUTATION, GET_AVAILABLE_PAYMENT_METHODS_QUERY, GET_CART_QUERY, GET_CHECKOUT_QUERY, GET_LINE_ITEMS_BY_SUPPLIER_QUERY, GET_VIPPS_STATUS_QUERY, SDK_VERSION, UPDATE_CHECKOUT_MUTATION, UPDATE_ITEM_MUTATION, UPDATE_SHIPPINGS_BY_SUPPLIER_MUTATION, Vio, VioApi, VioApiError, addItem, checkApplePayAvailability, createCart, createCheckout, createCommerceClient, createPaymentStripe, createPaymentVipps, createVioApi, deleteItem, displayPrice, executeCartGraphQL, formatPrice, getAvailablePaymentMethods, getCart, getCartGraphQLOptions, getCheckout, getCustomerSessionId, getGlobalCurrency, getLineItemsBySupplier, getVippsStatus, primaryImageUrl, showApplePaySheet, updateCheckout, updateItem, updateShippingsBySupplier } from './chunk-PX27CQGX.js';
2
+ export { ADD_ITEM_MUTATION, AnalyticsManager, CREATE_CART_MUTATION, CREATE_CHECKOUT_MUTATION, CREATE_PAYMENT_STRIPE_MUTATION, CREATE_PAYMENT_VIPPS_MUTATION, CartManager, CheckoutManager, CommerceClient, Configuration, DELETE_ITEM_MUTATION, GET_AVAILABLE_PAYMENT_METHODS_QUERY, GET_CART_QUERY, GET_CHECKOUT_QUERY, GET_LINE_ITEMS_BY_SUPPLIER_QUERY, GET_VIPPS_STATUS_QUERY, SDK_VERSION, UPDATE_CHECKOUT_MUTATION, UPDATE_ITEM_MUTATION, UPDATE_SHIPPINGS_BY_SUPPLIER_MUTATION, Vio, VioApi, VioApiError, addItem, checkApplePayAvailability, createCart, createCheckout, createCommerceClient, createPaymentStripe, createPaymentVipps, createVioApi, deleteItem, displayPrice, executeCartGraphQL, formatPrice, getAvailablePaymentMethods, getCart, getCartGraphQLOptions, getCheckout, getCustomerSessionId, getGlobalCurrency, getLineItemsBySupplier, getVippsStatus, primaryImageUrl, showApplePaySheet, updateCheckout, updateItem, updateShippingsBySupplier } from './chunk-U2QG4IVJ.js';
3
3
  //# sourceMappingURL=index.js.map
4
4
  //# sourceMappingURL=index.js.map
@@ -1,6 +1,6 @@
1
- import { registerVioElements, VioProduct, VioProductCarousel, VioProductDetail, VioCart, VioCheckout } from '../chunk-WIQ53CCM.js';
2
- export { VioTokens, applyVioTheme } from '../chunk-WIQ53CCM.js';
3
- import '../chunk-PX27CQGX.js';
1
+ import { registerVioElements, VioProduct, VioProductCarousel, VioProductDetail, VioCart, VioCheckout } from '../chunk-XU5LGUBU.js';
2
+ export { VioTokens, applyVioTheme } from '../chunk-XU5LGUBU.js';
3
+ import '../chunk-U2QG4IVJ.js';
4
4
  import * as React from 'react';
5
5
 
6
6
  // node_modules/@lit/react/node/create-component.js
package/dist/ui/index.js CHANGED
@@ -1,6 +1,6 @@
1
- import { registerVioElements } from '../chunk-WIQ53CCM.js';
2
- export { VioCart, VioCheckout, VioProduct, VioProductCarousel, VioProductDetail, VioTokens, applyVioTheme, registerVioElements } from '../chunk-WIQ53CCM.js';
3
- import '../chunk-PX27CQGX.js';
1
+ import { registerVioElements } from '../chunk-XU5LGUBU.js';
2
+ export { VioCart, VioCheckout, VioProduct, VioProductCarousel, VioProductDetail, VioTokens, applyVioTheme, registerVioElements } from '../chunk-XU5LGUBU.js';
3
+ import '../chunk-U2QG4IVJ.js';
4
4
 
5
5
  // src/ui/index.ts
6
6
  registerVioElements();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vio-live/web-sdk",
3
- "version": "0.10.0",
3
+ "version": "0.11.0",
4
4
  "description": "Vio Web SDK — in-site shoppable + native checkout, designed for editorial commerce sites",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",