@beworke/pixel 0.1.0-rc.1
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/CHANGELOG.md +194 -0
- package/README.md +163 -0
- package/RELEASE_CANDIDATE.md +256 -0
- package/dist/PixelLogger-B21lEjep.d.mts +8 -0
- package/dist/PixelLogger-B21lEjep.d.ts +8 -0
- package/dist/StorageFactory-BhpbB6Jj.d.mts +8 -0
- package/dist/StorageFactory-CAkJJqVD.d.ts +8 -0
- package/dist/config/index.cjs.js +3 -0
- package/dist/config/index.cjs.js.map +1 -0
- package/dist/config/index.d.mts +19 -0
- package/dist/config/index.d.ts +19 -0
- package/dist/config/index.esm.js +3 -0
- package/dist/config/index.esm.js.map +1 -0
- package/dist/events/index.cjs.js +3 -0
- package/dist/events/index.cjs.js.map +1 -0
- package/dist/events/index.d.mts +1 -0
- package/dist/events/index.d.ts +1 -0
- package/dist/events/index.esm.js +3 -0
- package/dist/events/index.esm.js.map +1 -0
- package/dist/examples/html-script/README.md +71 -0
- package/dist/examples/html-script/RELEASE_CANDIDATE.md +121 -0
- package/dist/examples/html-script/add-payment-info/README.md +46 -0
- package/dist/examples/html-script/add-payment-info/example-add-payment-info-card-autocomplete.html +494 -0
- package/dist/examples/html-script/add-payment-info/example-add-payment-info-card-disabled.html +478 -0
- package/dist/examples/html-script/add-payment-info/example-add-payment-info-card-fields.html +486 -0
- package/dist/examples/html-script/add-payment-info/example-add-payment-info-data-track.html +479 -0
- package/dist/examples/html-script/add-payment-info/example-add-payment-info-dedupe.html +492 -0
- package/dist/examples/html-script/add-payment-info/example-add-payment-info-manual.html +495 -0
- package/dist/examples/html-script/add-payment-info/example-add-payment-info-rules-card.html +469 -0
- package/dist/examples/html-script/add-payment-info/example-add-payment-info-security.html +489 -0
- package/dist/examples/html-script/add-to-cart/README.md +36 -0
- package/dist/examples/html-script/add-to-cart/example-add-to-cart-attribute.html +517 -0
- package/dist/examples/html-script/add-to-cart/example-add-to-cart-auto.html +512 -0
- package/dist/examples/html-script/add-to-cart/example-add-to-cart-click.html +519 -0
- package/dist/examples/html-script/add-to-cart/example-add-to-cart-dedupe.html +514 -0
- package/dist/examples/html-script/add-to-cart/example-add-to-cart-manual.html +517 -0
- package/dist/examples/html-script/add-to-cart/example-add-to-cart-order-bump.html +527 -0
- package/dist/examples/html-script/add-to-cart/example-add-to-cart-text.html +524 -0
- package/dist/examples/html-script/example-basic.html +350 -0
- package/dist/examples/html-script/example-behavior.html +435 -0
- package/dist/examples/html-script/example-conversion.html +479 -0
- package/dist/examples/html-script/example-integration.html +709 -0
- package/dist/examples/html-script/example-transport.html +748 -0
- package/dist/examples/html-script/initiate-checkout/README.md +38 -0
- package/dist/examples/html-script/initiate-checkout/example-initiate-checkout-attribute.html +485 -0
- package/dist/examples/html-script/initiate-checkout/example-initiate-checkout-auto.html +491 -0
- package/dist/examples/html-script/initiate-checkout/example-initiate-checkout-click.html +493 -0
- package/dist/examples/html-script/initiate-checkout/example-initiate-checkout-manual.html +494 -0
- package/dist/examples/html-script/initiate-checkout/example-initiate-checkout-snapshot.html +497 -0
- package/dist/examples/html-script/initiate-checkout/example-initiate-checkout-submit.html +502 -0
- package/dist/examples/html-script/initiate-checkout/example-initiate-checkout-text.html +496 -0
- package/dist/examples/html-script/lead/README.md +25 -0
- package/dist/examples/html-script/lead/example-lead-trigger-attribute.html +594 -0
- package/dist/examples/html-script/lead/example-lead-trigger-auto.html +431 -0
- package/dist/examples/html-script/lead/example-lead-trigger-click.html +587 -0
- package/dist/examples/html-script/release-candidate.html +726 -0
- package/dist/examples/html-script/remove-from-cart/README.md +36 -0
- package/dist/examples/html-script/remove-from-cart/example-remove-from-cart-attribute.html +532 -0
- package/dist/examples/html-script/remove-from-cart/example-remove-from-cart-css.html +524 -0
- package/dist/examples/html-script/remove-from-cart/example-remove-from-cart-dedupe.html +540 -0
- package/dist/examples/html-script/remove-from-cart/example-remove-from-cart-manual.html +533 -0
- package/dist/examples/html-script/remove-from-cart/example-remove-from-cart-multi.html +557 -0
- package/dist/examples/html-script/remove-from-cart/example-remove-from-cart-state.html +539 -0
- package/dist/examples/html-script/remove-from-cart/example-remove-from-cart-text.html +524 -0
- package/dist/examples/html-script/search/README.md +41 -0
- package/dist/examples/html-script/search/example-search-attribute.html +454 -0
- package/dist/examples/html-script/search/example-search-button-sync.html +455 -0
- package/dist/examples/html-script/search/example-search-dedupe.html +466 -0
- package/dist/examples/html-script/search/example-search-input.html +456 -0
- package/dist/examples/html-script/search/example-search-manual.html +473 -0
- package/dist/examples/html-script/search/example-search-submit.html +450 -0
- package/dist/examples/html-script/search/example-search-text.html +441 -0
- package/dist/examples/html-script/view-content/README.md +48 -0
- package/dist/examples/html-script/view-content/example-view-content-attribute.html +488 -0
- package/dist/examples/html-script/view-content/example-view-content-css.html +467 -0
- package/dist/examples/html-script/view-content/example-view-content-dedupe.html +485 -0
- package/dist/examples/html-script/view-content/example-view-content-empty.html +469 -0
- package/dist/examples/html-script/view-content/example-view-content-manual.html +496 -0
- package/dist/examples/html-script/view-content/example-view-content-product-card.html +478 -0
- package/dist/examples/html-script/view-content/example-view-content-text.html +473 -0
- package/dist/examples/release-candidate/README.md +14 -0
- package/dist/examples/v2/README.md +33 -0
- package/dist/index-DUfFzniE.d.mts +274 -0
- package/dist/index-DUfFzniE.d.ts +274 -0
- package/dist/index.cjs.js +3 -0
- package/dist/index.cjs.js.map +1 -0
- package/dist/index.d.mts +364 -0
- package/dist/index.d.ts +364 -0
- package/dist/index.esm.js +3 -0
- package/dist/index.esm.js.map +1 -0
- package/dist/logger/index.cjs.js +3 -0
- package/dist/logger/index.cjs.js.map +1 -0
- package/dist/logger/index.d.mts +12 -0
- package/dist/logger/index.d.ts +12 -0
- package/dist/logger/index.esm.js +3 -0
- package/dist/logger/index.esm.js.map +1 -0
- package/dist/pixel-CbeF25mD.d.mts +555 -0
- package/dist/pixel-CbeF25mD.d.ts +555 -0
- package/dist/pixel-default-config-1VgLFOiL.d.mts +5 -0
- package/dist/pixel-default-config-Bxb-Vdd8.d.ts +5 -0
- package/dist/runtime/index.cjs.js +3 -0
- package/dist/runtime/index.cjs.js.map +1 -0
- package/dist/runtime/index.d.mts +48 -0
- package/dist/runtime/index.d.ts +48 -0
- package/dist/runtime/index.esm.js +3 -0
- package/dist/runtime/index.esm.js.map +1 -0
- package/dist/services/index.cjs.js +3 -0
- package/dist/services/index.cjs.js.map +1 -0
- package/dist/services/index.d.mts +169 -0
- package/dist/services/index.d.ts +169 -0
- package/dist/services/index.esm.js +3 -0
- package/dist/services/index.esm.js.map +1 -0
- package/dist/types-CTpRvFKZ.d.ts +71 -0
- package/dist/types-DGlBdsAy.d.mts +71 -0
- package/dist/v2/global.global.js +3 -0
- package/dist/v2/global.global.js.map +1 -0
- package/dist/v2/index.cjs.js +3 -0
- package/dist/v2/index.cjs.js.map +1 -0
- package/dist/v2/index.d.mts +7 -0
- package/dist/v2/index.d.ts +7 -0
- package/dist/v2/index.esm.js +3 -0
- package/dist/v2/index.esm.js.map +1 -0
- package/package.json +101 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/config/index.ts","../../src/config/shared/selector.ts","../../src/config/shared/commerce.ts","../../src/config/defaults/attribution.ts","../../src/config/defaults/modules/behavior.ts","../../src/config/defaults/modules/conversion.ts","../../src/config/defaults/modules/core.ts","../../src/config/defaults/modules/integrations.ts","../../src/config/defaults/modules/privacy.ts","../../src/config/defaults/modules/transport.ts","../../src/config/defaults/pixel-default-config.ts"],"sourcesContent":["export type {\n AppConfig,\n PixelEnvironment,\n PixelSource,\n PixelTarget,\n} from './types/app';\nexport type { IdentityConfig } from './types/identity';\nexport type { AttributionConfig } from './types/attribution';\nexport type { TransportConfig } from './types/transport';\nexport type {\n AttributionStoragePersistence,\n QueueStoragePersistence,\n SessionStoragePersistence,\n StorageConfig,\n StorageKeysConfig,\n VisitorStoragePersistence,\n} from './types/storage';\nexport type {\n EngagementThresholds,\n EngagementWeights,\n FingerprintMode,\n PaymentMethod,\n SelectorConfig,\n SelectorDescriptor,\n SelectorInput,\n SelectorType,\n SelectorFormConfig,\n SelectorFormMode,\n SelectorFormTrigger,\n CommerceCalculateValueFrom,\n CommerceCheckoutMode,\n CommerceConfig,\n CommerceItem,\n CommerceProduct,\n ProductType,\n} from './shared';\nexport {\n DEFAULT_SELECTOR_TYPE,\n DEFAULT_COMMERCE_CONFIG,\n getPrimarySelectorValue,\n resolveSelectorTypeFallback,\n} from './shared';\nexport type {\n AddPaymentInfoAutoDetectorConfig,\n AddToCartAutoDetectorConfig,\n AnonymizationConfig,\n AutoConversionConfig,\n BehaviorModuleConfig,\n ClickBehaviorConfig,\n ConfiguredAutoDetectorConfig,\n ConsentConfig,\n ConversionModuleConfig,\n ConversionRulesConfig,\n CoordinationConfig,\n CoreModuleConfig,\n DedupeConfig,\n EngagementBehaviorConfig,\n ExitIntentBehaviorConfig,\n FingerprintConfig,\n FormCapableAutoDetectorConfig,\n GoogleBrowserDestinationConfig,\n GoogleIntegrationConfig,\n HeartbeatBehaviorConfig,\n IdleBehaviorConfig,\n InitiateCheckoutAutoDetectorConfig,\n IntegrationTestDestinationConfig,\n IntegrationsModuleConfig,\n LeadAutoDetectorConfig,\n ManualConversionConfig,\n ManualEventConfig,\n MetaBrowserDestinationConfig,\n MetaIntegrationConfig,\n ModulesConfig,\n TikTokBrowserDestinationConfig,\n OrderingConfig,\n PageViewConfig,\n PiiConfig,\n PrivacyConsentConfig,\n PrivacyModuleConfig,\n PurchaseAutoDetectorConfig,\n RemoveFromCartAutoDetectorConfig,\n ScrollBehaviorConfig,\n SearchAutoDetectorConfig,\n SessionConfig,\n TransportModuleConfig,\n TransportBatchConfig,\n TransportFlushConfig,\n TransportOfflineConfig,\n TransportRetryConfig,\n TransportTimeoutConfig,\n ViewContentAutoDetectorConfig,\n ViewportBehaviorConfig,\n VisibilityBehaviorConfig,\n VisitorConfig,\n} from './types/modules';\nexport type { PixelConfig } from './types/pixel';\n\nexport { DEFAULT_PIXEL_CONFIG } from './defaults/pixel-default-config';\nexport { DEFAULT_ATTRIBUTION_CONFIG } from './defaults/attribution';\nexport { DEFAULT_BEHAVIOR_MODULE_CONFIG } from './defaults/modules/behavior';\nexport { DEFAULT_CONVERSION_MODULE_CONFIG } from './defaults/modules/conversion';\nexport { DEFAULT_CORE_MODULE_CONFIG } from './defaults/modules/core';\nexport { DEFAULT_INTEGRATIONS_MODULE_CONFIG } from './defaults/modules/integrations';\nexport { DEFAULT_PRIVACY_MODULE_CONFIG } from './defaults/modules/privacy';\nexport { DEFAULT_TRANSPORT_MODULE_CONFIG } from './defaults/modules/transport';\n","/**\n * Tipo padrão/fallback para interpretar selectors string sem prefixo.\n *\n * Ordem de resolução (`SelectorResolver`):\n * 1. Objeto → selector.type\n * 2. String com prefixo (css:, id:, class:, attr:, attribute:, text:) → prefixo\n * 3. String sem prefixo → selectorType\n * 4. Sem selectorType → css (DEFAULT_SELECTOR_TYPE)\n */\nexport type SelectorType = 'css' | 'id' | 'class' | 'attribute' | 'text';\n\n/** Fallback quando `selectorType` é omitido. */\nexport const DEFAULT_SELECTOR_TYPE: SelectorType = 'css';\n\n/**\n * Forma avançada de um seletor individual.\n * `exact` / `caseSensitive` aplicam-se principalmente a `type: 'text'`.\n * `closest` restringe a busca a um ancestral CSS (resolvido na etapa do Resolver).\n */\nexport type SelectorDescriptor = {\n type: SelectorType;\n value: string;\n exact?: boolean;\n caseSensitive?: boolean;\n closest?: string;\n};\n\n/** Um seletor: string simples/prefixada ou descritor tipado. */\nexport type SelectorInput = string | SelectorDescriptor;\n\n/** Um ou vários seletores (OR — qualquer match dispara). */\nexport type SelectorConfig = SelectorInput | SelectorInput[];\n\n/**\n * Extrai o valor primário de um `SelectorConfig` (utilitário de config).\n * Para match/query no DOM, use `SelectorResolver`.\n */\nexport function getPrimarySelectorValue(\n selector: SelectorConfig | undefined\n): string | null {\n if (selector == null) return null;\n\n if (typeof selector === 'string') {\n const trimmed = selector.trim();\n return trimmed.length > 0 ? trimmed : null;\n }\n\n if (Array.isArray(selector)) {\n for (const item of selector) {\n const value = getPrimarySelectorValue(item);\n if (value) return value;\n }\n return null;\n }\n\n const value = selector.value?.trim();\n return value && value.length > 0 ? value : null;\n}\n\n/**\n * Resolve o `selectorType` efetivo: config explícita → tipo do descriptor → css.\n */\nexport function resolveSelectorTypeFallback(\n selector: SelectorConfig | undefined,\n selectorType?: SelectorType\n): SelectorType {\n if (selectorType) return selectorType;\n\n if (selector != null && typeof selector !== 'string') {\n if (Array.isArray(selector)) {\n for (const item of selector) {\n if (typeof item !== 'string') return item.type;\n }\n } else {\n return selector.type;\n }\n }\n\n return DEFAULT_SELECTOR_TYPE;\n}","/**\n * Contratos globais de commerce (catálogo, checkout inicial, mappings).\n * Vivem em `conversion.commerce`, fora de `auto`.\n * Runtime: ProductCatalog + CommerceState + Extractors +\n * CommerceResolver + OrderCalculator (Etapas 12C–12F).\n */\n\nexport type ProductType =\n | 'main'\n | 'order_bump'\n | 'upsell'\n | 'downsell'\n | 'cross_sell'\n | 'addon'\n | 'subscription'\n | 'custom';\n\nexport type CommerceProduct = {\n id: string;\n name?: string;\n sku?: string;\n type?: ProductType;\n price?: number;\n currency?: string;\n quantity?: number;\n category?: string;\n variant?: string;\n brand?: string;\n metadata?: Record<string, unknown>;\n};\n\nexport type CommerceItem = {\n productId: string;\n quantity?: number;\n price?: number;\n currency?: string;\n selected?: boolean;\n metadata?: Record<string, unknown>;\n};\n\nexport type CommerceCheckoutMode =\n | 'single_product'\n | 'multi_product'\n | 'cart'\n | 'funnel';\n\nexport type CommerceCalculateValueFrom =\n | 'selected_items'\n | 'event_items'\n | 'manual';\n\nexport type CommerceConfig = {\n currency?: string;\n\n catalog?: {\n products?: CommerceProduct[];\n };\n\n checkout?: {\n mode?: CommerceCheckoutMode;\n selectedItems?: CommerceItem[];\n calculateValueFrom?: CommerceCalculateValueFrom;\n allowDynamicItems?: boolean;\n };\n\n mappings?: {\n attributes?: Record<string, string[]>;\n fields?: Record<string, string[]>;\n };\n};\n\n/** Default seguro: sem produtos, sem itens, sem auto-disparo implícito. */\nexport const DEFAULT_COMMERCE_CONFIG: CommerceConfig = {\n catalog: {\n products: [],\n },\n checkout: {\n selectedItems: [],\n allowDynamicItems: true,\n calculateValueFrom: 'selected_items',\n },\n mappings: {\n attributes: {},\n fields: {},\n },\n};\n","import type { AttributionConfig } from '../types/attribution';\n\nexport const DEFAULT_ATTRIBUTION_CONFIG: AttributionConfig = {\n enabled: true,\n ttlDays: 90,\n persist: true,\n captureUrlParams: true,\n captureCookies: true,\n customClickIdParams: [],\n};\n","import type { BehaviorModuleConfig } from '../../types/modules/behavior';\n\nexport const DEFAULT_BEHAVIOR_MODULE_CONFIG: BehaviorModuleConfig = {\n enabled: false,\n\n trackers: {\n scroll: {\n enabled: false,\n thresholds: [25, 50, 75, 100],\n debounceMs: 100,\n },\n\n click: {\n enabled: false,\n rageClick: {\n enabled: true,\n threshold: 3,\n windowMs: 500,\n },\n },\n\n idle: {\n enabled: false,\n thresholdMs: 60_000,\n },\n\n visibility: {\n enabled: false,\n },\n\n exitIntent: {\n enabled: false,\n },\n\n viewport: {\n enabled: false,\n selector: '',\n selectorType: 'attribute',\n visibilityThreshold: 0.5,\n },\n\n heartbeat: {\n enabled: false,\n intervalMs: 5_000,\n hiddenIntervalMs: 30_000,\n },\n\n engagement: {\n enabled: false,\n weights: {\n scroll: 0.3,\n click: 0.3,\n time: 0.25,\n },\n thresholds: {\n low: 30,\n medium: 70,\n },\n },\n },\n};\n","import type { ConversionModuleConfig } from '../../types/modules/conversion';\n\nexport const DEFAULT_CONVERSION_MODULE_CONFIG: ConversionModuleConfig = {\n enabled: false,\n\n commerce: {\n catalog: {\n products: [],\n },\n checkout: {\n selectedItems: [],\n allowDynamicItems: true,\n calculateValueFrom: 'selected_items',\n },\n mappings: {\n attributes: {},\n fields: {},\n },\n },\n\n manual: {\n pageView: {\n enabled: false,\n },\n purchase: {\n enabled: false,\n },\n lead: {\n enabled: false,\n },\n addToCart: {\n enabled: false,\n },\n removeFromCart: {\n enabled: false,\n },\n initiateCheckout: {\n enabled: false,\n },\n addPaymentInfo: {\n enabled: false,\n },\n search: {\n enabled: false,\n },\n viewContent: {\n enabled: false,\n },\n },\n\n auto: {\n enabled: false,\n\n detectors: {\n lead: {\n enabled: false,\n },\n purchase: {\n enabled: false,\n },\n addToCart: {\n enabled: false,\n },\n removeFromCart: {\n enabled: false,\n },\n initiateCheckout: {\n enabled: false,\n },\n addPaymentInfo: {\n enabled: false,\n paymentMethod: 'CREDIT_CARD',\n cardDetection: true,\n autoDispatch: true,\n },\n search: {\n enabled: false,\n },\n viewContent: {\n enabled: false,\n },\n },\n },\n\n rules: {\n enabled: false,\n selectors: ['[data-track]'],\n texts: ['Comprar', 'Comprar Agora', 'Finalizar Compra', 'Checkout'],\n urlPatterns: ['thank-you', 'purchase', 'success', 'order', 'checkout'],\n checkout: {\n enabled: false,\n },\n card: {\n enabled: false,\n },\n },\n};\n","import type { CoreModuleConfig } from '../../types/modules/core';\n\nexport const DEFAULT_CORE_MODULE_CONFIG: CoreModuleConfig = {\n enabled: true,\n\n pageView: {\n enabled: true,\n trackInitialPageView: true,\n spa: true,\n dedupeMs: 2000,\n },\n\n visitor: {\n enabled: true,\n persistence: 'cookie_localStorage',\n renew: false,\n },\n\n session: {\n enabled: true,\n ttlMs: 10800000,\n renewOnActivity: true,\n renewOnPageView: true,\n },\n\n fingerprint: {\n enabled: true,\n mode: 'light',\n cache: true,\n },\n\n consent: {\n enabled: false,\n required: false,\n waitForConsent: false,\n },\n\n dedupe: {\n enabled: true,\n windowMs: 2000,\n },\n\n coordination: {\n enabled: true,\n leaderElection: true,\n broadcastChannel: true,\n },\n\n ordering: {\n enabled: true,\n preserveOrder: true,\n },\n};\n","import type { IntegrationsModuleConfig } from '../../types/modules/integrations';\n\nexport const DEFAULT_INTEGRATIONS_MODULE_CONFIG: IntegrationsModuleConfig = {\n enabled: false,\n debug: false,\n concurrency: 3,\n timeoutMs: 5000,\n continueOnError: true,\n\n destinations: {\n console: { enabled: false },\n memory: { enabled: false },\n mock: { enabled: false },\n meta: {\n enabled: false,\n pixelIds: [],\n autoPageView: true,\n loadScript: true,\n },\n google: {\n enabled: false,\n tagIds: [],\n autoPageView: true,\n loadScript: true,\n },\n tiktok: {\n enabled: false,\n pixelIds: [],\n autoPageView: true,\n loadScript: true,\n },\n },\n};\n","import type { PrivacyModuleConfig } from '../../types/modules/privacy';\n\nexport const DEFAULT_PRIVACY_MODULE_CONFIG: PrivacyModuleConfig = {\n enabled: false,\n\n consent: {\n enabled: false,\n required: false,\n },\n\n pii: {\n enabled: false,\n hashEmail: true,\n hashPhone: true,\n },\n\n anonymization: {\n enabled: false,\n anonymizeIp: true,\n },\n};\n","import type { TransportModuleConfig } from '../../types/modules/transport';\n\nexport const DEFAULT_TRANSPORT_MODULE_CONFIG: TransportModuleConfig = {\n enabled: false,\n\n mockSender: {\n enabled: true,\n },\n\n sender: {\n mode: 'mock',\n },\n\n persistence: {\n enabled: true,\n },\n\n replay: {\n enabled: true,\n },\n\n ordering: {\n enabled: true,\n },\n\n coordination: {\n enabled: true,\n },\n\n circuitBreaker: {\n enabled: true,\n failureThreshold: 5,\n resetTimeoutMs: 30_000,\n halfOpenMaxAttempts: 2,\n },\n\n backpressure: {\n enabled: true,\n maxQueueSize: 500,\n policy: 'drop_oldest',\n sampleRate: 0.5,\n },\n\n deadLetter: {\n enabled: true,\n maxEntries: 200,\n },\n\n compression: {\n enabled: true,\n strategy: 'identity',\n },\n\n retry: {\n enabled: true,\n maxAttempts: 4,\n baseDelayMs: 500,\n maxDelayMs: 4000,\n multiplier: 2,\n },\n\n batch: {\n enabled: true,\n batchSize: 10,\n flushIntervalMs: 2000,\n maxWaitMs: 5000,\n },\n\n timeout: {\n enabled: true,\n timeoutMs: 10000,\n },\n\n offline: {\n enabled: true,\n },\n\n flush: {\n enabled: true,\n flushIntervalMs: 2000,\n flushOnDestroy: true,\n prepareUnloadHooks: true,\n },\n};\n","import type { PixelConfig } from '../types/pixel';\nimport { DEFAULT_ATTRIBUTION_CONFIG } from './attribution';\nimport { DEFAULT_BEHAVIOR_MODULE_CONFIG } from './modules/behavior';\nimport { DEFAULT_CONVERSION_MODULE_CONFIG } from './modules/conversion';\nimport { DEFAULT_CORE_MODULE_CONFIG } from './modules/core';\nimport { DEFAULT_INTEGRATIONS_MODULE_CONFIG } from './modules/integrations';\nimport { DEFAULT_PRIVACY_MODULE_CONFIG } from './modules/privacy';\nimport { DEFAULT_TRANSPORT_MODULE_CONFIG } from './modules/transport';\n\nexport const DEFAULT_PIXEL_CONFIG: PixelConfig = {\n app: {\n source: 'custom',\n target: 'custom',\n environment: 'production',\n debug: false,\n },\n\n identity: {\n pixelId: '',\n },\n\n transport: {\n apiEndpoint: '',\n timeoutMs: 10000,\n },\n\n storage: {\n prefix: '__gmk',\n namespace: 'pixel',\n\n queue: {\n enabled: true,\n persistence: 'memory',\n index: true,\n },\n },\n\n attribution: { ...DEFAULT_ATTRIBUTION_CONFIG },\n\n modules: {\n core: DEFAULT_CORE_MODULE_CONFIG,\n behavior: DEFAULT_BEHAVIOR_MODULE_CONFIG,\n conversion: DEFAULT_CONVERSION_MODULE_CONFIG,\n transport: DEFAULT_TRANSPORT_MODULE_CONFIG,\n integrations: DEFAULT_INTEGRATIONS_MODULE_CONFIG,\n privacy: DEFAULT_PRIVACY_MODULE_CONFIG,\n },\n};\n"],"mappings":";yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,gCAAAE,EAAA,mCAAAC,EAAA,4BAAAC,EAAA,qCAAAC,EAAA,+BAAAC,EAAA,uCAAAC,EAAA,yBAAAC,EAAA,kCAAAC,EAAA,0BAAAC,EAAA,oCAAAC,EAAA,4BAAAC,EAAA,gCAAAC,IAAA,eAAAC,EAAAd,GCYO,IAAMe,EAAsC,MAyB5C,SAASC,EACdC,EACe,CACf,GAAIA,GAAY,KAAM,OAAO,KAE7B,GAAI,OAAOA,GAAa,SAAU,CAChC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EAEA,WAAY,CACV,QAAS,GACT,WAAY,GACd,EAEA,YAAa,CACX,QAAS,GACT,SAAU,UACZ,EAEA,MAAO,CACL,QAAS,GACT,YAAa,EACb,YAAa,IACb,WAAY,IACZ,WAAY,CACd,EAEA,MAAO,CACL,QAAS,GACT,UAAW,GACX,gBAAiB,IACjB,UAAW,GACb,EAEA,QAAS,CACP,QAAS,GACT,UAAW,GACb,EAEA,QAAS,CACP,QAAS,EACX,EAEA,MAAO,CACL,QAAS,GACT,gBAAiB,IACjB,eAAgB,GAChB,mBAAoB,EACtB,CACF,EC1EO,IAAMC,EAAoC,CAC/C,IAAK,CACH,OAAQ,SACR,OAAQ,SACR,YAAa,aACb,MAAO,EACT,EAEA,SAAU,CACR,QAAS,EACX,EAEA,UAAW,CACT,YAAa,GACb,UAAW,GACb,EAEA,QAAS,CACP,OAAQ,QACR,UAAW,QAEX,MAAO,CACL,QAAS,GACT,YAAa,SACb,MAAO,EACT,CACF,EAEA,YAAa,CAAE,GAAGC,CAA2B,EAE7C,QAAS,CACP,KAAMC,EACN,SAAUC,EACV,WAAYC,EACZ,UAAWC,EACX,aAAcC,EACd,QAASC,CACX,CACF","names":["config_exports","__export","DEFAULT_ATTRIBUTION_CONFIG","DEFAULT_BEHAVIOR_MODULE_CONFIG","DEFAULT_COMMERCE_CONFIG","DEFAULT_CONVERSION_MODULE_CONFIG","DEFAULT_CORE_MODULE_CONFIG","DEFAULT_INTEGRATIONS_MODULE_CONFIG","DEFAULT_PIXEL_CONFIG","DEFAULT_PRIVACY_MODULE_CONFIG","DEFAULT_SELECTOR_TYPE","DEFAULT_TRANSPORT_MODULE_CONFIG","getPrimarySelectorValue","resolveSelectorTypeFallback","__toCommonJS","DEFAULT_SELECTOR_TYPE","getPrimarySelectorValue","selector","trimmed","item","value","resolveSelectorTypeFallback","selectorType","DEFAULT_COMMERCE_CONFIG","DEFAULT_ATTRIBUTION_CONFIG","DEFAULT_BEHAVIOR_MODULE_CONFIG","DEFAULT_CONVERSION_MODULE_CONFIG","DEFAULT_CORE_MODULE_CONFIG","DEFAULT_INTEGRATIONS_MODULE_CONFIG","DEFAULT_PRIVACY_MODULE_CONFIG","DEFAULT_TRANSPORT_MODULE_CONFIG","DEFAULT_PIXEL_CONFIG","DEFAULT_ATTRIBUTION_CONFIG","DEFAULT_CORE_MODULE_CONFIG","DEFAULT_BEHAVIOR_MODULE_CONFIG","DEFAULT_CONVERSION_MODULE_CONFIG","DEFAULT_TRANSPORT_MODULE_CONFIG","DEFAULT_INTEGRATIONS_MODULE_CONFIG","DEFAULT_PRIVACY_MODULE_CONFIG"]}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { a as AttributionConfig, B as BehaviorModuleConfig, C as ConversionModuleConfig, b as CoreModuleConfig, I as IntegrationsModuleConfig, c as PrivacyModuleConfig, T as TransportModuleConfig } from '../pixel-CbeF25mD.mjs';
|
|
2
|
+
export { K as AddPaymentInfoAutoDetectorConfig, L as AddToCartAutoDetectorConfig, M as AnonymizationConfig, d as AppConfig, A as AttributionStoragePersistence, N as AutoConversionConfig, O as ClickBehaviorConfig, u as CommerceCalculateValueFrom, v as CommerceCheckoutMode, w as CommerceConfig, x as CommerceItem, y as CommerceProduct, R as ConfiguredAutoDetectorConfig, U as ConsentConfig, W as ConversionRulesConfig, X as CoordinationConfig, G as DEFAULT_COMMERCE_CONFIG, D as DEFAULT_SELECTOR_TYPE, Y as DedupeConfig, Z as EngagementBehaviorConfig, E as EngagementThresholds, l as EngagementWeights, _ as ExitIntentBehaviorConfig, $ as FingerprintConfig, F as FingerprintMode, a0 as FormCapableAutoDetectorConfig, a1 as GoogleBrowserDestinationConfig, a2 as GoogleIntegrationConfig, a3 as HeartbeatBehaviorConfig, h as IdentityConfig, a4 as IdleBehaviorConfig, a5 as InitiateCheckoutAutoDetectorConfig, a6 as IntegrationTestDestinationConfig, a7 as LeadAutoDetectorConfig, a8 as ManualConversionConfig, a9 as ManualEventConfig, aa as MetaBrowserDestinationConfig, ab as MetaIntegrationConfig, ac as ModulesConfig, ae as OrderingConfig, af as PageViewConfig, m as PaymentMethod, ag as PiiConfig, P as PixelConfig, e as PixelEnvironment, f as PixelSource, g as PixelTarget, ah as PrivacyConsentConfig, z as ProductType, ai as PurchaseAutoDetectorConfig, Q as QueueStoragePersistence, aj as RemoveFromCartAutoDetectorConfig, ak as ScrollBehaviorConfig, al as SearchAutoDetectorConfig, n as SelectorConfig, o as SelectorDescriptor, r as SelectorFormConfig, s as SelectorFormMode, t as SelectorFormTrigger, p as SelectorInput, q as SelectorType, am as SessionConfig, S as SessionStoragePersistence, j as StorageConfig, k as StorageKeysConfig, ad as TikTokBrowserDestinationConfig, an as TransportBatchConfig, i as TransportConfig, ao as TransportFlushConfig, ap as TransportOfflineConfig, aq as TransportRetryConfig, ar as TransportTimeoutConfig, as as ViewContentAutoDetectorConfig, at as ViewportBehaviorConfig, au as VisibilityBehaviorConfig, av as VisitorConfig, V as VisitorStoragePersistence, H as getPrimarySelectorValue, J as resolveSelectorTypeFallback } from '../pixel-CbeF25mD.mjs';
|
|
3
|
+
export { D as DEFAULT_PIXEL_CONFIG } from '../pixel-default-config-1VgLFOiL.mjs';
|
|
4
|
+
|
|
5
|
+
declare const DEFAULT_ATTRIBUTION_CONFIG: AttributionConfig;
|
|
6
|
+
|
|
7
|
+
declare const DEFAULT_BEHAVIOR_MODULE_CONFIG: BehaviorModuleConfig;
|
|
8
|
+
|
|
9
|
+
declare const DEFAULT_CONVERSION_MODULE_CONFIG: ConversionModuleConfig;
|
|
10
|
+
|
|
11
|
+
declare const DEFAULT_CORE_MODULE_CONFIG: CoreModuleConfig;
|
|
12
|
+
|
|
13
|
+
declare const DEFAULT_INTEGRATIONS_MODULE_CONFIG: IntegrationsModuleConfig;
|
|
14
|
+
|
|
15
|
+
declare const DEFAULT_PRIVACY_MODULE_CONFIG: PrivacyModuleConfig;
|
|
16
|
+
|
|
17
|
+
declare const DEFAULT_TRANSPORT_MODULE_CONFIG: TransportModuleConfig;
|
|
18
|
+
|
|
19
|
+
export { AttributionConfig, BehaviorModuleConfig, ConversionModuleConfig, CoreModuleConfig, DEFAULT_ATTRIBUTION_CONFIG, DEFAULT_BEHAVIOR_MODULE_CONFIG, DEFAULT_CONVERSION_MODULE_CONFIG, DEFAULT_CORE_MODULE_CONFIG, DEFAULT_INTEGRATIONS_MODULE_CONFIG, DEFAULT_PRIVACY_MODULE_CONFIG, DEFAULT_TRANSPORT_MODULE_CONFIG, IntegrationsModuleConfig, PrivacyModuleConfig, TransportModuleConfig };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { a as AttributionConfig, B as BehaviorModuleConfig, C as ConversionModuleConfig, b as CoreModuleConfig, I as IntegrationsModuleConfig, c as PrivacyModuleConfig, T as TransportModuleConfig } from '../pixel-CbeF25mD.js';
|
|
2
|
+
export { K as AddPaymentInfoAutoDetectorConfig, L as AddToCartAutoDetectorConfig, M as AnonymizationConfig, d as AppConfig, A as AttributionStoragePersistence, N as AutoConversionConfig, O as ClickBehaviorConfig, u as CommerceCalculateValueFrom, v as CommerceCheckoutMode, w as CommerceConfig, x as CommerceItem, y as CommerceProduct, R as ConfiguredAutoDetectorConfig, U as ConsentConfig, W as ConversionRulesConfig, X as CoordinationConfig, G as DEFAULT_COMMERCE_CONFIG, D as DEFAULT_SELECTOR_TYPE, Y as DedupeConfig, Z as EngagementBehaviorConfig, E as EngagementThresholds, l as EngagementWeights, _ as ExitIntentBehaviorConfig, $ as FingerprintConfig, F as FingerprintMode, a0 as FormCapableAutoDetectorConfig, a1 as GoogleBrowserDestinationConfig, a2 as GoogleIntegrationConfig, a3 as HeartbeatBehaviorConfig, h as IdentityConfig, a4 as IdleBehaviorConfig, a5 as InitiateCheckoutAutoDetectorConfig, a6 as IntegrationTestDestinationConfig, a7 as LeadAutoDetectorConfig, a8 as ManualConversionConfig, a9 as ManualEventConfig, aa as MetaBrowserDestinationConfig, ab as MetaIntegrationConfig, ac as ModulesConfig, ae as OrderingConfig, af as PageViewConfig, m as PaymentMethod, ag as PiiConfig, P as PixelConfig, e as PixelEnvironment, f as PixelSource, g as PixelTarget, ah as PrivacyConsentConfig, z as ProductType, ai as PurchaseAutoDetectorConfig, Q as QueueStoragePersistence, aj as RemoveFromCartAutoDetectorConfig, ak as ScrollBehaviorConfig, al as SearchAutoDetectorConfig, n as SelectorConfig, o as SelectorDescriptor, r as SelectorFormConfig, s as SelectorFormMode, t as SelectorFormTrigger, p as SelectorInput, q as SelectorType, am as SessionConfig, S as SessionStoragePersistence, j as StorageConfig, k as StorageKeysConfig, ad as TikTokBrowserDestinationConfig, an as TransportBatchConfig, i as TransportConfig, ao as TransportFlushConfig, ap as TransportOfflineConfig, aq as TransportRetryConfig, ar as TransportTimeoutConfig, as as ViewContentAutoDetectorConfig, at as ViewportBehaviorConfig, au as VisibilityBehaviorConfig, av as VisitorConfig, V as VisitorStoragePersistence, H as getPrimarySelectorValue, J as resolveSelectorTypeFallback } from '../pixel-CbeF25mD.js';
|
|
3
|
+
export { D as DEFAULT_PIXEL_CONFIG } from '../pixel-default-config-Bxb-Vdd8.js';
|
|
4
|
+
|
|
5
|
+
declare const DEFAULT_ATTRIBUTION_CONFIG: AttributionConfig;
|
|
6
|
+
|
|
7
|
+
declare const DEFAULT_BEHAVIOR_MODULE_CONFIG: BehaviorModuleConfig;
|
|
8
|
+
|
|
9
|
+
declare const DEFAULT_CONVERSION_MODULE_CONFIG: ConversionModuleConfig;
|
|
10
|
+
|
|
11
|
+
declare const DEFAULT_CORE_MODULE_CONFIG: CoreModuleConfig;
|
|
12
|
+
|
|
13
|
+
declare const DEFAULT_INTEGRATIONS_MODULE_CONFIG: IntegrationsModuleConfig;
|
|
14
|
+
|
|
15
|
+
declare const DEFAULT_PRIVACY_MODULE_CONFIG: PrivacyModuleConfig;
|
|
16
|
+
|
|
17
|
+
declare const DEFAULT_TRANSPORT_MODULE_CONFIG: TransportModuleConfig;
|
|
18
|
+
|
|
19
|
+
export { AttributionConfig, BehaviorModuleConfig, ConversionModuleConfig, CoreModuleConfig, DEFAULT_ATTRIBUTION_CONFIG, DEFAULT_BEHAVIOR_MODULE_CONFIG, DEFAULT_CONVERSION_MODULE_CONFIG, DEFAULT_CORE_MODULE_CONFIG, DEFAULT_INTEGRATIONS_MODULE_CONFIG, DEFAULT_PRIVACY_MODULE_CONFIG, DEFAULT_TRANSPORT_MODULE_CONFIG, IntegrationsModuleConfig, PrivacyModuleConfig, TransportModuleConfig };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
/* Pixel v2 — SDK de analytics e conversão */
|
|
2
|
+
var d="css";function r(e){if(e==null)return null;if(typeof e=="string"){let t=e.trim();return t.length>0?t:null}if(Array.isArray(e)){for(let t of e){let p=r(t);if(p)return p}return null}let o=e.value?.trim();return o&&o.length>0?o:null}function m(e,o){if(o)return o;if(e!=null&&typeof e!="string")if(Array.isArray(e)){for(let t of e)if(typeof t!="string")return t.type}else return e.type;return"css"}var f={catalog:{products:[]},checkout:{selectedItems:[],allowDynamicItems:!0,calculateValueFrom:"selected_items"},mappings:{attributes:{},fields:{}}};var n={enabled:!0,ttlDays:90,persist:!0,captureUrlParams:!0,captureCookies:!0,customClickIdParams:[]};var i={enabled:!1,trackers:{scroll:{enabled:!1,thresholds:[25,50,75,100],debounceMs:100},click:{enabled:!1,rageClick:{enabled:!0,threshold:3,windowMs:500}},idle:{enabled:!1,thresholdMs:6e4},visibility:{enabled:!1},exitIntent:{enabled:!1},viewport:{enabled:!1,selector:"",selectorType:"attribute",visibilityThreshold:.5},heartbeat:{enabled:!1,intervalMs:5e3,hiddenIntervalMs:3e4},engagement:{enabled:!1,weights:{scroll:.3,click:.3,time:.25},thresholds:{low:30,medium:70}}}};var a={enabled:!1,commerce:{catalog:{products:[]},checkout:{selectedItems:[],allowDynamicItems:!0,calculateValueFrom:"selected_items"},mappings:{attributes:{},fields:{}}},manual:{pageView:{enabled:!1},purchase:{enabled:!1},lead:{enabled:!1},addToCart:{enabled:!1},removeFromCart:{enabled:!1},initiateCheckout:{enabled:!1},addPaymentInfo:{enabled:!1},search:{enabled:!1},viewContent:{enabled:!1}},auto:{enabled:!1,detectors:{lead:{enabled:!1},purchase:{enabled:!1},addToCart:{enabled:!1},removeFromCart:{enabled:!1},initiateCheckout:{enabled:!1},addPaymentInfo:{enabled:!1,paymentMethod:"CREDIT_CARD",cardDetection:!0,autoDispatch:!0},search:{enabled:!1},viewContent:{enabled:!1}}},rules:{enabled:!1,selectors:["[data-track]"],texts:["Comprar","Comprar Agora","Finalizar Compra","Checkout"],urlPatterns:["thank-you","purchase","success","order","checkout"],checkout:{enabled:!1},card:{enabled:!1}}};var l={enabled:!0,pageView:{enabled:!0,trackInitialPageView:!0,spa:!0,dedupeMs:2e3},visitor:{enabled:!0,persistence:"cookie_localStorage",renew:!1},session:{enabled:!0,ttlMs:108e5,renewOnActivity:!0,renewOnPageView:!0},fingerprint:{enabled:!0,mode:"light",cache:!0},consent:{enabled:!1,required:!1,waitForConsent:!1},dedupe:{enabled:!0,windowMs:2e3},coordination:{enabled:!0,leaderElection:!0,broadcastChannel:!0},ordering:{enabled:!0,preserveOrder:!0}};var s={enabled:!1,debug:!1,concurrency:3,timeoutMs:5e3,continueOnError:!0,destinations:{console:{enabled:!1},memory:{enabled:!1},mock:{enabled:!1},meta:{enabled:!1,pixelIds:[],autoPageView:!0,loadScript:!0},google:{enabled:!1,tagIds:[],autoPageView:!0,loadScript:!0},tiktok:{enabled:!1,pixelIds:[],autoPageView:!0,loadScript:!0}}};var u={enabled:!1,consent:{enabled:!1,required:!1},pii:{enabled:!1,hashEmail:!0,hashPhone:!0},anonymization:{enabled:!1,anonymizeIp:!0}};var c={enabled:!1,mockSender:{enabled:!0},sender:{mode:"mock"},persistence:{enabled:!0},replay:{enabled:!0},ordering:{enabled:!0},coordination:{enabled:!0},circuitBreaker:{enabled:!0,failureThreshold:5,resetTimeoutMs:3e4,halfOpenMaxAttempts:2},backpressure:{enabled:!0,maxQueueSize:500,policy:"drop_oldest",sampleRate:.5},deadLetter:{enabled:!0,maxEntries:200},compression:{enabled:!0,strategy:"identity"},retry:{enabled:!0,maxAttempts:4,baseDelayMs:500,maxDelayMs:4e3,multiplier:2},batch:{enabled:!0,batchSize:10,flushIntervalMs:2e3,maxWaitMs:5e3},timeout:{enabled:!0,timeoutMs:1e4},offline:{enabled:!0},flush:{enabled:!0,flushIntervalMs:2e3,flushOnDestroy:!0,prepareUnloadHooks:!0}};var C={app:{source:"custom",target:"custom",environment:"production",debug:!1},identity:{pixelId:""},transport:{apiEndpoint:"",timeoutMs:1e4},storage:{prefix:"__gmk",namespace:"pixel",queue:{enabled:!0,persistence:"memory",index:!0}},attribution:{...n},modules:{core:l,behavior:i,conversion:a,transport:c,integrations:s,privacy:u}};export{n as DEFAULT_ATTRIBUTION_CONFIG,i as DEFAULT_BEHAVIOR_MODULE_CONFIG,f as DEFAULT_COMMERCE_CONFIG,a as DEFAULT_CONVERSION_MODULE_CONFIG,l as DEFAULT_CORE_MODULE_CONFIG,s as DEFAULT_INTEGRATIONS_MODULE_CONFIG,C as DEFAULT_PIXEL_CONFIG,u as DEFAULT_PRIVACY_MODULE_CONFIG,d as DEFAULT_SELECTOR_TYPE,c as DEFAULT_TRANSPORT_MODULE_CONFIG,r as getPrimarySelectorValue,m as resolveSelectorTypeFallback};
|
|
3
|
+
//# sourceMappingURL=index.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/config/shared/selector.ts","../../src/config/shared/commerce.ts","../../src/config/defaults/attribution.ts","../../src/config/defaults/modules/behavior.ts","../../src/config/defaults/modules/conversion.ts","../../src/config/defaults/modules/core.ts","../../src/config/defaults/modules/integrations.ts","../../src/config/defaults/modules/privacy.ts","../../src/config/defaults/modules/transport.ts","../../src/config/defaults/pixel-default-config.ts"],"sourcesContent":["/**\n * Tipo padrão/fallback para interpretar selectors string sem prefixo.\n *\n * Ordem de resolução (`SelectorResolver`):\n * 1. Objeto → selector.type\n * 2. String com prefixo (css:, id:, class:, attr:, attribute:, text:) → prefixo\n * 3. String sem prefixo → selectorType\n * 4. Sem selectorType → css (DEFAULT_SELECTOR_TYPE)\n */\nexport type SelectorType = 'css' | 'id' | 'class' | 'attribute' | 'text';\n\n/** Fallback quando `selectorType` é omitido. */\nexport const DEFAULT_SELECTOR_TYPE: SelectorType = 'css';\n\n/**\n * Forma avançada de um seletor individual.\n * `exact` / `caseSensitive` aplicam-se principalmente a `type: 'text'`.\n * `closest` restringe a busca a um ancestral CSS (resolvido na etapa do Resolver).\n */\nexport type SelectorDescriptor = {\n type: SelectorType;\n value: string;\n exact?: boolean;\n caseSensitive?: boolean;\n closest?: string;\n};\n\n/** Um seletor: string simples/prefixada ou descritor tipado. */\nexport type SelectorInput = string | SelectorDescriptor;\n\n/** Um ou vários seletores (OR — qualquer match dispara). */\nexport type SelectorConfig = SelectorInput | SelectorInput[];\n\n/**\n * Extrai o valor primário de um `SelectorConfig` (utilitário de config).\n * Para match/query no DOM, use `SelectorResolver`.\n */\nexport function getPrimarySelectorValue(\n selector: SelectorConfig | undefined\n): string | null {\n if (selector == null) return null;\n\n if (typeof selector === 'string') {\n const trimmed = selector.trim();\n return trimmed.length > 0 ? trimmed : null;\n }\n\n if (Array.isArray(selector)) {\n for (const item of selector) {\n const value = getPrimarySelectorValue(item);\n if (value) return value;\n }\n return null;\n }\n\n const value = selector.value?.trim();\n return value && value.length > 0 ? value : null;\n}\n\n/**\n * Resolve o `selectorType` efetivo: config explícita → tipo do descriptor → css.\n */\nexport function resolveSelectorTypeFallback(\n selector: SelectorConfig | undefined,\n selectorType?: SelectorType\n): SelectorType {\n if (selectorType) return selectorType;\n\n if (selector != null && typeof selector !== 'string') {\n if (Array.isArray(selector)) {\n for (const item of selector) {\n if (typeof item !== 'string') return item.type;\n }\n } else {\n return selector.type;\n }\n }\n\n return DEFAULT_SELECTOR_TYPE;\n}","/**\n * Contratos globais de commerce (catálogo, checkout inicial, mappings).\n * Vivem em `conversion.commerce`, fora de `auto`.\n * Runtime: ProductCatalog + CommerceState + Extractors +\n * CommerceResolver + OrderCalculator (Etapas 12C–12F).\n */\n\nexport type ProductType =\n | 'main'\n | 'order_bump'\n | 'upsell'\n | 'downsell'\n | 'cross_sell'\n | 'addon'\n | 'subscription'\n | 'custom';\n\nexport type CommerceProduct = {\n id: string;\n name?: string;\n sku?: string;\n type?: ProductType;\n price?: number;\n currency?: string;\n quantity?: number;\n category?: string;\n variant?: string;\n brand?: string;\n metadata?: Record<string, unknown>;\n};\n\nexport type CommerceItem = {\n productId: string;\n quantity?: number;\n price?: number;\n currency?: string;\n selected?: boolean;\n metadata?: Record<string, unknown>;\n};\n\nexport type CommerceCheckoutMode =\n | 'single_product'\n | 'multi_product'\n | 'cart'\n | 'funnel';\n\nexport type CommerceCalculateValueFrom =\n | 'selected_items'\n | 'event_items'\n | 'manual';\n\nexport type CommerceConfig = {\n currency?: string;\n\n catalog?: {\n products?: CommerceProduct[];\n };\n\n checkout?: {\n mode?: CommerceCheckoutMode;\n selectedItems?: CommerceItem[];\n calculateValueFrom?: CommerceCalculateValueFrom;\n allowDynamicItems?: boolean;\n };\n\n mappings?: {\n attributes?: Record<string, string[]>;\n fields?: Record<string, string[]>;\n };\n};\n\n/** Default seguro: sem produtos, sem itens, sem auto-disparo implícito. */\nexport const DEFAULT_COMMERCE_CONFIG: CommerceConfig = {\n catalog: {\n products: [],\n },\n checkout: {\n selectedItems: [],\n allowDynamicItems: true,\n calculateValueFrom: 'selected_items',\n },\n mappings: {\n attributes: {},\n fields: {},\n },\n};\n","import type { AttributionConfig } from '../types/attribution';\n\nexport const DEFAULT_ATTRIBUTION_CONFIG: AttributionConfig = {\n enabled: true,\n ttlDays: 90,\n persist: true,\n captureUrlParams: true,\n captureCookies: true,\n customClickIdParams: [],\n};\n","import type { BehaviorModuleConfig } from '../../types/modules/behavior';\n\nexport const DEFAULT_BEHAVIOR_MODULE_CONFIG: BehaviorModuleConfig = {\n enabled: false,\n\n trackers: {\n scroll: {\n enabled: false,\n thresholds: [25, 50, 75, 100],\n debounceMs: 100,\n },\n\n click: {\n enabled: false,\n rageClick: {\n enabled: true,\n threshold: 3,\n windowMs: 500,\n },\n },\n\n idle: {\n enabled: false,\n thresholdMs: 60_000,\n },\n\n visibility: {\n enabled: false,\n },\n\n exitIntent: {\n enabled: false,\n },\n\n viewport: {\n enabled: false,\n selector: '',\n selectorType: 'attribute',\n visibilityThreshold: 0.5,\n },\n\n heartbeat: {\n enabled: false,\n intervalMs: 5_000,\n hiddenIntervalMs: 30_000,\n },\n\n engagement: {\n enabled: false,\n weights: {\n scroll: 0.3,\n click: 0.3,\n time: 0.25,\n },\n thresholds: {\n low: 30,\n medium: 70,\n },\n },\n },\n};\n","import type { ConversionModuleConfig } from '../../types/modules/conversion';\n\nexport const DEFAULT_CONVERSION_MODULE_CONFIG: ConversionModuleConfig = {\n enabled: false,\n\n commerce: {\n catalog: {\n products: [],\n },\n checkout: {\n selectedItems: [],\n allowDynamicItems: true,\n calculateValueFrom: 'selected_items',\n },\n mappings: {\n attributes: {},\n fields: {},\n },\n },\n\n manual: {\n pageView: {\n enabled: false,\n },\n purchase: {\n enabled: false,\n },\n lead: {\n enabled: false,\n },\n addToCart: {\n enabled: false,\n },\n removeFromCart: {\n enabled: false,\n },\n initiateCheckout: {\n enabled: false,\n },\n addPaymentInfo: {\n enabled: false,\n },\n search: {\n enabled: false,\n },\n viewContent: {\n enabled: false,\n },\n },\n\n auto: {\n enabled: false,\n\n detectors: {\n lead: {\n enabled: false,\n },\n purchase: {\n enabled: false,\n },\n addToCart: {\n enabled: false,\n },\n removeFromCart: {\n enabled: false,\n },\n initiateCheckout: {\n enabled: false,\n },\n addPaymentInfo: {\n enabled: false,\n paymentMethod: 'CREDIT_CARD',\n cardDetection: true,\n autoDispatch: true,\n },\n search: {\n enabled: false,\n },\n viewContent: {\n enabled: false,\n },\n },\n },\n\n rules: {\n enabled: false,\n selectors: ['[data-track]'],\n texts: ['Comprar', 'Comprar Agora', 'Finalizar Compra', 'Checkout'],\n urlPatterns: ['thank-you', 'purchase', 'success', 'order', 'checkout'],\n checkout: {\n enabled: false,\n },\n card: {\n enabled: false,\n },\n },\n};\n","import type { CoreModuleConfig } from '../../types/modules/core';\n\nexport const DEFAULT_CORE_MODULE_CONFIG: CoreModuleConfig = {\n enabled: true,\n\n pageView: {\n enabled: true,\n trackInitialPageView: true,\n spa: true,\n dedupeMs: 2000,\n },\n\n visitor: {\n enabled: true,\n persistence: 'cookie_localStorage',\n renew: false,\n },\n\n session: {\n enabled: true,\n ttlMs: 10800000,\n renewOnActivity: true,\n renewOnPageView: true,\n },\n\n fingerprint: {\n enabled: true,\n mode: 'light',\n cache: true,\n },\n\n consent: {\n enabled: false,\n required: false,\n waitForConsent: false,\n },\n\n dedupe: {\n enabled: true,\n windowMs: 2000,\n },\n\n coordination: {\n enabled: true,\n leaderElection: true,\n broadcastChannel: true,\n },\n\n ordering: {\n enabled: true,\n preserveOrder: true,\n },\n};\n","import type { IntegrationsModuleConfig } from '../../types/modules/integrations';\n\nexport const DEFAULT_INTEGRATIONS_MODULE_CONFIG: IntegrationsModuleConfig = {\n enabled: false,\n debug: false,\n concurrency: 3,\n timeoutMs: 5000,\n continueOnError: true,\n\n destinations: {\n console: { enabled: false },\n memory: { enabled: false },\n mock: { enabled: false },\n meta: {\n enabled: false,\n pixelIds: [],\n autoPageView: true,\n loadScript: true,\n },\n google: {\n enabled: false,\n tagIds: [],\n autoPageView: true,\n loadScript: true,\n },\n tiktok: {\n enabled: false,\n pixelIds: [],\n autoPageView: true,\n loadScript: true,\n },\n },\n};\n","import type { PrivacyModuleConfig } from '../../types/modules/privacy';\n\nexport const DEFAULT_PRIVACY_MODULE_CONFIG: PrivacyModuleConfig = {\n enabled: false,\n\n consent: {\n enabled: false,\n required: false,\n },\n\n pii: {\n enabled: false,\n hashEmail: true,\n hashPhone: true,\n },\n\n anonymization: {\n enabled: false,\n anonymizeIp: true,\n },\n};\n","import type { TransportModuleConfig } from '../../types/modules/transport';\n\nexport const DEFAULT_TRANSPORT_MODULE_CONFIG: TransportModuleConfig = {\n enabled: false,\n\n mockSender: {\n enabled: true,\n },\n\n sender: {\n mode: 'mock',\n },\n\n persistence: {\n enabled: true,\n },\n\n replay: {\n enabled: true,\n },\n\n ordering: {\n enabled: true,\n },\n\n coordination: {\n enabled: true,\n },\n\n circuitBreaker: {\n enabled: true,\n failureThreshold: 5,\n resetTimeoutMs: 30_000,\n halfOpenMaxAttempts: 2,\n },\n\n backpressure: {\n enabled: true,\n maxQueueSize: 500,\n policy: 'drop_oldest',\n sampleRate: 0.5,\n },\n\n deadLetter: {\n enabled: true,\n maxEntries: 200,\n },\n\n compression: {\n enabled: true,\n strategy: 'identity',\n },\n\n retry: {\n enabled: true,\n maxAttempts: 4,\n baseDelayMs: 500,\n maxDelayMs: 4000,\n multiplier: 2,\n },\n\n batch: {\n enabled: true,\n batchSize: 10,\n flushIntervalMs: 2000,\n maxWaitMs: 5000,\n },\n\n timeout: {\n enabled: true,\n timeoutMs: 10000,\n },\n\n offline: {\n enabled: true,\n },\n\n flush: {\n enabled: true,\n flushIntervalMs: 2000,\n flushOnDestroy: true,\n prepareUnloadHooks: true,\n },\n};\n","import type { PixelConfig } from '../types/pixel';\nimport { DEFAULT_ATTRIBUTION_CONFIG } from './attribution';\nimport { DEFAULT_BEHAVIOR_MODULE_CONFIG } from './modules/behavior';\nimport { DEFAULT_CONVERSION_MODULE_CONFIG } from './modules/conversion';\nimport { DEFAULT_CORE_MODULE_CONFIG } from './modules/core';\nimport { DEFAULT_INTEGRATIONS_MODULE_CONFIG } from './modules/integrations';\nimport { DEFAULT_PRIVACY_MODULE_CONFIG } from './modules/privacy';\nimport { DEFAULT_TRANSPORT_MODULE_CONFIG } from './modules/transport';\n\nexport const DEFAULT_PIXEL_CONFIG: PixelConfig = {\n app: {\n source: 'custom',\n target: 'custom',\n environment: 'production',\n debug: false,\n },\n\n identity: {\n pixelId: '',\n },\n\n transport: {\n apiEndpoint: '',\n timeoutMs: 10000,\n },\n\n storage: {\n prefix: '__gmk',\n namespace: 'pixel',\n\n queue: {\n enabled: true,\n persistence: 'memory',\n index: true,\n },\n },\n\n attribution: { ...DEFAULT_ATTRIBUTION_CONFIG },\n\n modules: {\n core: DEFAULT_CORE_MODULE_CONFIG,\n behavior: DEFAULT_BEHAVIOR_MODULE_CONFIG,\n conversion: DEFAULT_CONVERSION_MODULE_CONFIG,\n transport: DEFAULT_TRANSPORT_MODULE_CONFIG,\n integrations: DEFAULT_INTEGRATIONS_MODULE_CONFIG,\n privacy: DEFAULT_PRIVACY_MODULE_CONFIG,\n },\n};\n"],"mappings":";AAYO,IAAMA,EAAsC,MAyB5C,SAASC,EACdC,EACe,CACf,GAAIA,GAAY,KAAM,OAAO,KAE7B,GAAI,OAAOA,GAAa,SAAU,CAChC,IAAMC,EAAUD,EAAS,KAAK,EAC9B,OAAOC,EAAQ,OAAS,EAAIA,EAAU,IACxC,CAEA,GAAI,MAAM,QAAQD,CAAQ,EAAG,CAC3B,QAAWE,KAAQF,EAAU,CAC3B,IAAMG,EAAQJ,EAAwBG,CAAI,EAC1C,GAAIC,EAAO,OAAOA,CACpB,CACA,OAAO,IACT,CAEA,IAAMA,EAAQH,EAAS,OAAO,KAAK,EACnC,OAAOG,GAASA,EAAM,OAAS,EAAIA,EAAQ,IAC7C,CAKO,SAASC,EACdJ,EACAK,EACc,CACd,GAAIA,EAAc,OAAOA,EAEzB,GAAIL,GAAY,MAAQ,OAAOA,GAAa,SAC1C,GAAI,MAAM,QAAQA,CAAQ,GACxB,QAAWE,KAAQF,EACjB,GAAI,OAAOE,GAAS,SAAU,OAAOA,EAAK,SAG5C,QAAOF,EAAS,KAIpB,MAAO,KACT,CCPO,IAAMM,EAA0C,CACrD,QAAS,CACP,SAAU,CAAC,CACb,EACA,SAAU,CACR,cAAe,CAAC,EAChB,kBAAmB,GACnB,mBAAoB,gBACtB,EACA,SAAU,CACR,WAAY,CAAC,EACb,OAAQ,CAAC,CACX,CACF,ECnFO,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T_SELECTOR_TYPE","getPrimarySelectorValue","selector","trimmed","item","value","resolveSelectorTypeFallback","selectorType","DEFAULT_COMMERCE_CONFIG","DEFAULT_ATTRIBUTION_CONFIG","DEFAULT_BEHAVIOR_MODULE_CONFIG","DEFAULT_CONVERSION_MODULE_CONFIG","DEFAULT_CORE_MODULE_CONFIG","DEFAULT_INTEGRATIONS_MODULE_CONFIG","DEFAULT_PRIVACY_MODULE_CONFIG","DEFAULT_TRANSPORT_MODULE_CONFIG","DEFAULT_PIXEL_CONFIG","DEFAULT_ATTRIBUTION_CONFIG","DEFAULT_CORE_MODULE_CONFIG","DEFAULT_BEHAVIOR_MODULE_CONFIG","DEFAULT_CONVERSION_MODULE_CONFIG","DEFAULT_TRANSPORT_MODULE_CONFIG","DEFAULT_INTEGRATIONS_MODULE_CONFIG","DEFAULT_PRIVACY_MODULE_CONFIG"]}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
/* Pixel v2 — SDK de analytics e conversão */
|
|
2
|
+
"use strict";var s=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var m=Object.getOwnPropertyNames;var d=Object.prototype.hasOwnProperty;var c=(a,e)=>{for(var t in e)s(a,t,{get:e[t],enumerable:!0})},l=(a,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of m(e))!d.call(a,n)&&n!==t&&s(a,n,{get:()=>e[n],enumerable:!(r=p(e,n))||r.enumerable});return a};var E=a=>l(s({},"__esModule",{value:!0}),a);var u={};c(u,{BaseEventBuilder:()=>o});module.exports=E(u);var o=class{constructor(e,t){this.metadataService=e,this.attribution=t??null}build(e){let t=this.metadataService.getMetadata(),r=this.attribution?.getSnapshot(),n=r!==void 0&&Object.keys(r).some(v=>{let i=r[v];return i!=null&&i!==""});return{...e,timestamp:Date.now(),path:t.path,url:t.url,hostname:t.hostname,language:t.language,timezone:t.timezone,...n?{identifiers:r}:{}}}};0&&(module.exports={BaseEventBuilder});
|
|
3
|
+
//# sourceMappingURL=index.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/events/index.ts","../../src/events/builder/BaseEventBuilder.ts"],"sourcesContent":["export type { BasePixelEvent } from './base';\nexport type { PageViewEvent } from './page-view';\nexport type {\n ScrollEvent,\n PageClickEvent,\n RageClickEvent,\n VisibilityChangeEvent,\n UserIdleEvent,\n UserActiveEvent,\n ExitIntentEvent,\n} from './behavior';\nexport type { SessionRenewedEvent, SessionExpiredEvent } from './session';\nexport type {\n PurchaseEvent,\n LeadEvent,\n AddToCartEvent,\n RemoveFromCartEvent,\n InitiateCheckoutEvent,\n AddPaymentInfoEvent,\n ViewContentEvent,\n SearchEvent,\n PurchaseData,\n LeadData,\n AddToCartData,\n RemoveFromCartData,\n InitiateCheckoutData,\n AddPaymentInfoData,\n ViewContentData,\n SearchData,\n PixelItem,\n ConversionEventData,\n} from './conversion';\nexport type { PixelEventCategory, EngagementEventCategory, ConversionEventCategory } from './shared/category';\nexport type { ElementDescriptor } from './shared/ElementDescriptor';\nexport type { PixelEvent } from './types';\nexport { BaseEventBuilder } from './builder';\n","import type { AttributionService } from '@/services/attribution/types';\nimport type { BrowserMetadataService } from '@/services/browser-metadata';\n\nimport type { BasePixelEvent } from '../base';\n\nexport class BaseEventBuilder {\n private readonly metadataService: BrowserMetadataService;\n\n private readonly attribution: AttributionService | null;\n\n constructor(\n metadataService: BrowserMetadataService,\n attribution?: AttributionService | null\n ) {\n this.metadataService = metadataService;\n this.attribution = attribution ?? null;\n }\n\n build<T extends { type: string }>(event: T): T & BasePixelEvent {\n const metadata = this.metadataService.getMetadata();\n const identifiers = this.attribution?.getSnapshot();\n const hasIdentifiers =\n identifiers !== undefined &&\n Object.keys(identifiers).some(key => {\n const value = identifiers[key as keyof typeof identifiers];\n return value !== undefined && value !== null && value !== '';\n });\n\n return {\n ...event,\n timestamp: Date.now(),\n path: metadata.path,\n url: metadata.url,\n hostname: metadata.hostname,\n language: metadata.language,\n timezone: metadata.timezone,\n ...(hasIdentifiers ? { identifiers } : {}),\n };\n }\n}\n"],"mappings":";yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,sBAAAE,IAAA,eAAAC,EAAAH,GCKO,IAAMI,EAAN,KAAuB,CAK5B,YACEC,EACAC,EACA,CACA,KAAK,gBAAkBD,EACvB,KAAK,YAAcC,GAAe,IACpC,CAEA,MAAkCC,EAA8B,CAC9D,IAAMC,EAAW,KAAK,gBAAgB,YAAY,EAC5CC,EAAc,KAAK,aAAa,YAAY,EAC5CC,EACJD,IAAgB,QAChB,OAAO,KAAKA,CAAW,EAAE,KAAKE,GAAO,CACnC,IAAMC,EAAQH,EAAYE,CAA+B,EACzD,OAA8BC,GAAU,MAAQA,IAAU,EAC5D,CAAC,EAEH,MAAO,CACL,GAAGL,EACH,UAAW,KAAK,IAAI,EACpB,KAAMC,EAAS,KACf,IAAKA,EAAS,IACd,SAAUA,EAAS,SACnB,SAAUA,EAAS,SACnB,SAAUA,EAAS,SACnB,GAAIE,EAAiB,CAAE,YAAAD,CAAY,EAAI,CAAC,CAC1C,CACF,CACF","names":["events_exports","__export","BaseEventBuilder","__toCommonJS","BaseEventBuilder","metadataService","attribution","event","metadata","identifiers","hasIdentifiers","key","value"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { k as AddPaymentInfoData, w as AddPaymentInfoEvent, j as AddToCartData, t as AddToCartEvent, a as BaseEventBuilder, e as BasePixelEvent, H as ConversionEventCategory, C as ConversionEventData, J as ElementDescriptor, G as EngagementEventCategory, E as ExitIntentEvent, I as InitiateCheckoutData, v as InitiateCheckoutEvent, L as LeadData, s as LeadEvent, n as PageClickEvent, f as PageViewEvent, P as PixelEvent, F as PixelEventCategory, z as PixelItem, i as PurchaseData, r as PurchaseEvent, o as RageClickEvent, R as RemoveFromCartData, u as RemoveFromCartEvent, m as ScrollEvent, l as SearchData, y as SearchEvent, g as SessionExpiredEvent, S as SessionRenewedEvent, q as UserActiveEvent, U as UserIdleEvent, V as ViewContentData, x as ViewContentEvent, p as VisibilityChangeEvent } from '../index-DUfFzniE.mjs';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { k as AddPaymentInfoData, w as AddPaymentInfoEvent, j as AddToCartData, t as AddToCartEvent, a as BaseEventBuilder, e as BasePixelEvent, H as ConversionEventCategory, C as ConversionEventData, J as ElementDescriptor, G as EngagementEventCategory, E as ExitIntentEvent, I as InitiateCheckoutData, v as InitiateCheckoutEvent, L as LeadData, s as LeadEvent, n as PageClickEvent, f as PageViewEvent, P as PixelEvent, F as PixelEventCategory, z as PixelItem, i as PurchaseData, r as PurchaseEvent, o as RageClickEvent, R as RemoveFromCartData, u as RemoveFromCartEvent, m as ScrollEvent, l as SearchData, y as SearchEvent, g as SessionExpiredEvent, S as SessionRenewedEvent, q as UserActiveEvent, U as UserIdleEvent, V as ViewContentData, x as ViewContentEvent, p as VisibilityChangeEvent } from '../index-DUfFzniE.js';
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
/* Pixel v2 — SDK de analytics e conversão */
|
|
2
|
+
var a=class{constructor(r,e){this.metadataService=r,this.attribution=e??null}build(r){let e=this.metadataService.getMetadata(),t=this.attribution?.getSnapshot(),o=t!==void 0&&Object.keys(t).some(i=>{let n=t[i];return n!=null&&n!==""});return{...r,timestamp:Date.now(),path:e.path,url:e.url,hostname:e.hostname,language:e.language,timezone:e.timezone,...o?{identifiers:t}:{}}}};export{a as BaseEventBuilder};
|
|
3
|
+
//# sourceMappingURL=index.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/events/builder/BaseEventBuilder.ts"],"sourcesContent":["import type { AttributionService } from '@/services/attribution/types';\nimport type { BrowserMetadataService } from '@/services/browser-metadata';\n\nimport type { BasePixelEvent } from '../base';\n\nexport class BaseEventBuilder {\n private readonly metadataService: BrowserMetadataService;\n\n private readonly attribution: AttributionService | null;\n\n constructor(\n metadataService: BrowserMetadataService,\n attribution?: AttributionService | null\n ) {\n this.metadataService = metadataService;\n this.attribution = attribution ?? null;\n }\n\n build<T extends { type: string }>(event: T): T & BasePixelEvent {\n const metadata = this.metadataService.getMetadata();\n const identifiers = this.attribution?.getSnapshot();\n const hasIdentifiers =\n identifiers !== undefined &&\n Object.keys(identifiers).some(key => {\n const value = identifiers[key as keyof typeof identifiers];\n return value !== undefined && value !== null && value !== '';\n });\n\n return {\n ...event,\n timestamp: Date.now(),\n path: metadata.path,\n url: metadata.url,\n hostname: metadata.hostname,\n language: metadata.language,\n timezone: metadata.timezone,\n ...(hasIdentifiers ? { identifiers } : {}),\n };\n }\n}\n"],"mappings":";AAKO,IAAMA,EAAN,KAAuB,CAK5B,YACEC,EACAC,EACA,CACA,KAAK,gBAAkBD,EACvB,KAAK,YAAcC,GAAe,IACpC,CAEA,MAAkCC,EAA8B,CAC9D,IAAMC,EAAW,KAAK,gBAAgB,YAAY,EAC5CC,EAAc,KAAK,aAAa,YAAY,EAC5CC,EACJD,IAAgB,QAChB,OAAO,KAAKA,CAAW,EAAE,KAAKE,GAAO,CACnC,IAAMC,EAAQH,EAAYE,CAA+B,EACzD,OAA8BC,GAAU,MAAQA,IAAU,EAC5D,CAAC,EAEH,MAAO,CACL,GAAGL,EACH,UAAW,KAAK,IAAI,EACpB,KAAMC,EAAS,KACf,IAAKA,EAAS,IACd,SAAUA,EAAS,SACnB,SAAUA,EAAS,SACnB,SAAUA,EAAS,SACnB,GAAIE,EAAiB,CAAE,YAAAD,CAAY,EAAI,CAAC,CAC1C,CACF,CACF","names":["BaseEventBuilder","metadataService","attribution","event","metadata","identifiers","hasIdentifiers","key","value"]}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# Pixel v2 — Playgrounds HTML (Commerce + AutoTrack)
|
|
2
|
+
|
|
3
|
+
Playgrounds oficiais da frente **Commerce + AutoTrack Avançado** (Etapas 12L–12N).
|
|
4
|
+
|
|
5
|
+
Após `npm run build`, os mesmos arquivos ficam em:
|
|
6
|
+
|
|
7
|
+
```txt
|
|
8
|
+
dist/examples/html-script/
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
O bundle global usado pelos exemplos:
|
|
12
|
+
|
|
13
|
+
```txt
|
|
14
|
+
../../../dist/v2/global.global.js
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Nome global IIFE: **`PixelV2`** (`Pixel`, `DEFAULT_PIXEL_CONFIG`, …).
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## Eventos (pastas)
|
|
22
|
+
|
|
23
|
+
| Evento | Pasta | Cenários típicos |
|
|
24
|
+
|--------|-------|------------------|
|
|
25
|
+
| LEAD | `lead/` | click, auto, attribute |
|
|
26
|
+
| ADD_TO_CART | `add-to-cart/` | attribute, click, auto, text, manual, dedupe, order-bump |
|
|
27
|
+
| REMOVE_FROM_CART | `remove-from-cart/` | attribute, text, css, manual, state, dedupe, multi |
|
|
28
|
+
| INITIATE_CHECKOUT | `initiate-checkout/` | attribute, click, submit, auto, text, manual, snapshot |
|
|
29
|
+
| ADD_PAYMENT_INFO | `add-payment-info/` | autocomplete, fields, disabled, manual, dedupe, security, rules, data-track |
|
|
30
|
+
| SEARCH | `search/` | attribute, button, input, submit, text, manual, dedupe |
|
|
31
|
+
| VIEW_CONTENT | `view-content/` | attribute, product-card, text, css, manual, empty, dedupe |
|
|
32
|
+
|
|
33
|
+
Cada pasta tem um `README.md` com o mapa dos cenários.
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
## Exemplos gerais (raiz)
|
|
38
|
+
|
|
39
|
+
```txt
|
|
40
|
+
release-candidate.html # Etapa 13A — consumidor real (script tag + API)
|
|
41
|
+
RELEASE_CANDIDATE.md # como consumir / testar o RC
|
|
42
|
+
example-basic.html
|
|
43
|
+
example-behavior.html
|
|
44
|
+
example-conversion.html
|
|
45
|
+
example-transport.html
|
|
46
|
+
example-integration.html
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
---
|
|
50
|
+
|
|
51
|
+
## Smoke real (opcional)
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
# sem .env → skip seguro
|
|
55
|
+
npm run test:smoke:real
|
|
56
|
+
|
|
57
|
+
# com .env (não commitar):
|
|
58
|
+
# PIXEL_REAL_API_SMOKE=true
|
|
59
|
+
# PIXEL_API_ENDPOINT=https://...
|
|
60
|
+
# PIXEL_ID=pix_...
|
|
61
|
+
npm run test:smoke:real
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
Cobre os 8 eventos de conversão em modo Event (1 POST cada) e Batch (1 POST com N eventos).
|
|
65
|
+
|
|
66
|
+
---
|
|
67
|
+
|
|
68
|
+
## Nota sobre `examples/v2/`
|
|
69
|
+
|
|
70
|
+
O caminho histórico `examples/v2/` foi consolidado em `examples/html-script/`.
|
|
71
|
+
Um README em `examples/v2/` aponta para cá para compatibilidade documental.
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
# Pixel v2 — Release Candidate (Etapa 13A)
|
|
2
|
+
|
|
3
|
+
Validação do pacote como **consumidor real** (script tag + bundle global + Transport).
|
|
4
|
+
|
|
5
|
+
## Pré-requisitos
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm run build
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Artefatos esperados:
|
|
12
|
+
|
|
13
|
+
```txt
|
|
14
|
+
dist/v2/global.global.js # IIFE → window.PixelV2
|
|
15
|
+
dist/examples/html-script/ # playgrounds + esta página
|
|
16
|
+
dist/index.esm.js / index.cjs.js # ESM/CJS
|
|
17
|
+
dist/index.d.ts # types
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Abrir a página RC
|
|
21
|
+
|
|
22
|
+
```txt
|
|
23
|
+
examples/html-script/release-candidate.html
|
|
24
|
+
# ou pós-build:
|
|
25
|
+
dist/examples/html-script/release-candidate.html
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Abra no navegador (file:// ou servidor estático).
|
|
29
|
+
|
|
30
|
+
### Conexão API
|
|
31
|
+
|
|
32
|
+
1. Preencha `PIXEL_API_ENDPOINT` e `PIXEL_ID` (mesmos valores do `.env` local, se houver).
|
|
33
|
+
2. Ou use query string:
|
|
34
|
+
|
|
35
|
+
```txt
|
|
36
|
+
?endpoint=https://sua-api.example.com&pixelId=pix_xxx
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
Valores ficam em `localStorage` (`pixel_rc_conn`) — **não commitar `.env`**.
|
|
40
|
+
|
|
41
|
+
3. Escolha **Event** (`batchSize=1`) ou **Batch** (`batchSize=10`).
|
|
42
|
+
4. Sender **HTTP** (API real) ou **Mock**.
|
|
43
|
+
5. Clique **Init**.
|
|
44
|
+
|
|
45
|
+
## O que a página valida
|
|
46
|
+
|
|
47
|
+
| Área | Como |
|
|
48
|
+
|------|------|
|
|
49
|
+
| `window.PixelV2` | Pill no topo |
|
|
50
|
+
| PAGE_VIEW | Core `trackInitialPageView` no init — painel conta via Transport `sentCount` (subscribe é pós-init) |
|
|
51
|
+
| LEAD / ATC / IC / PURCHASE manuais | Botões Manual |
|
|
52
|
+
| LEAD auto | Campos email/phone (selectorForm auto) |
|
|
53
|
+
| ADD_TO_CART data-track / text | `ConfiguredSelectorDetector` (sem selectorForm no ATC) |
|
|
54
|
+
| INITIATE_CHECKOUT submit | Form `#checkout-form` + selectorForm |
|
|
55
|
+
| Dedupe 500ms | Cliques rápidos em ATC |
|
|
56
|
+
| Transport ACK | Painel Transport debug + Flush |
|
|
57
|
+
| destroy / reinit | Botões Lifecycle |
|
|
58
|
+
|
|
59
|
+
Checklist visual está no rodapé da página.
|
|
60
|
+
|
|
61
|
+
## Consumo CDN / script tag
|
|
62
|
+
|
|
63
|
+
```html
|
|
64
|
+
<script src="./dist/v2/global.global.js"></script>
|
|
65
|
+
<script>
|
|
66
|
+
const { Pixel, DEFAULT_PIXEL_CONFIG } = window.PixelV2;
|
|
67
|
+
const pixel = new Pixel({
|
|
68
|
+
...DEFAULT_PIXEL_CONFIG,
|
|
69
|
+
identity: { ...DEFAULT_PIXEL_CONFIG.identity, pixelId: 'pix_xxx' },
|
|
70
|
+
transport: {
|
|
71
|
+
...DEFAULT_PIXEL_CONFIG.transport,
|
|
72
|
+
apiEndpoint: 'https://sua-api.example.com',
|
|
73
|
+
},
|
|
74
|
+
modules: {
|
|
75
|
+
...DEFAULT_PIXEL_CONFIG.modules,
|
|
76
|
+
conversion: { ...DEFAULT_PIXEL_CONFIG.modules.conversion, enabled: true },
|
|
77
|
+
transport: {
|
|
78
|
+
...DEFAULT_PIXEL_CONFIG.modules.transport,
|
|
79
|
+
enabled: true,
|
|
80
|
+
mockSender: { enabled: false },
|
|
81
|
+
sender: { mode: 'http' },
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
});
|
|
85
|
+
await pixel.init();
|
|
86
|
+
</script>
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
## Consumo ESM / CJS (pacote)
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
pnpm add @agenus-io/pixel
|
|
93
|
+
# ou validar tarball local:
|
|
94
|
+
npm pack
|
|
95
|
+
# npm install ./agenus-io-pixel-0.0.15.tgz
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
```ts
|
|
99
|
+
import { Pixel, DEFAULT_PIXEL_CONFIG } from '@agenus-io/pixel';
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
Exports: ver `package.json` → `exports` (`.` / `./global` / `./v2` / `./config` …).
|
|
103
|
+
|
|
104
|
+
## Smoke automatizado (complementar)
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
npm run test:smoke:real # skip seguro sem .env
|
|
108
|
+
# com .env: Event 8× ACK + Batch 8 eventos
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
## Veredito 13A
|
|
112
|
+
|
|
113
|
+
A etapa 13A está **pronta para RC** quando:
|
|
114
|
+
|
|
115
|
+
1. Build/pack/types/examples OK
|
|
116
|
+
2. Página RC carrega `PixelV2`
|
|
117
|
+
3. Manuais + autos + commerce + dedupe OK no browser
|
|
118
|
+
4. HTTP Event/Batch com ACK (se endpoint disponível)
|
|
119
|
+
5. destroy/reinit sem duplicar listeners
|
|
120
|
+
|
|
121
|
+
Pendências futuras: `PIXEL_V2_BACKLOG_PENDENCIAS_ISOLADO.md` (P1/P2).
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# Pixel v2 — ADD_PAYMENT_INFO (cenários isolados)
|
|
2
|
+
|
|
3
|
+
Cada HTML valida **um** comportamento. Abra um de cada vez.
|
|
4
|
+
|
|
5
|
+
## Como a SDK funciona (importante)
|
|
6
|
+
|
|
7
|
+
`addPaymentInfo` **não** tem `selector` / `selectorForm` no contrato.
|
|
8
|
+
|
|
9
|
+
| Caminho | Como ativa |
|
|
10
|
+
|---------|------------|
|
|
11
|
+
| **CardDetector** | `auto.detectors.addPaymentInfo.cardDetection: true` **ou** `rules.card.enabled` |
|
|
12
|
+
| **Manual** | `pixel.addPaymentInfo({ paymentMethod })` |
|
|
13
|
+
| **data-track** | só via `rules.selectors` + `SelectorDetector` legado |
|
|
14
|
+
|
|
15
|
+
CardDetector dispara no **início** do preenchimento (input/change/focusin, debounce 300ms) quando encontra:
|
|
16
|
+
|
|
17
|
+
- `autocomplete`: `cc-number`, `cc-exp`, `cc-exp-month`, `cc-exp-year`, `cc-csc`
|
|
18
|
+
- `id`/`name`: `card_number`, `cardNumber`, `cvv`, `cvc`, …
|
|
19
|
+
|
|
20
|
+
Payload auto: sempre `{ paymentMethod: "CREDIT_CARD" }` (ignora `config.paymentMethod` hoje).
|
|
21
|
+
**Nenhum** número/CVV é lido para o evento.
|
|
22
|
+
|
|
23
|
+
Dedupe: `ADD_PAYMENT_INFO:session:{sessionId}` (1x por sessão).
|
|
24
|
+
|
|
25
|
+
| # | Arquivo | O que valida |
|
|
26
|
+
|---|---------|--------------|
|
|
27
|
+
| 1 | [`example-add-payment-info-card-autocomplete.html`](./example-add-payment-info-card-autocomplete.html) | CardDetector + autocomplete |
|
|
28
|
+
| 2 | [`example-add-payment-info-card-fields.html`](./example-add-payment-info-card-fields.html) | id/name/CVV |
|
|
29
|
+
| 3 | [`example-add-payment-info-card-disabled.html`](./example-add-payment-info-card-disabled.html) | `cardDetection: false` |
|
|
30
|
+
| 4 | [`example-add-payment-info-manual.html`](./example-add-payment-info-manual.html) | API (CREDIT_CARD/PIX/BOLETO/…) |
|
|
31
|
+
| 5 | [`example-add-payment-info-dedupe.html`](./example-add-payment-info-dedupe.html) | Dedupe de sessão |
|
|
32
|
+
| 6 | [`example-add-payment-info-security.html`](./example-add-payment-info-security.html) | Sem vazamento de PAN/CVV |
|
|
33
|
+
| 7 | [`example-add-payment-info-rules-card.html`](./example-add-payment-info-rules-card.html) | `rules.card.enabled` |
|
|
34
|
+
| 8 | [`example-add-payment-info-data-track.html`](./example-add-payment-info-data-track.html) | `data-track` via rules |
|
|
35
|
+
|
|
36
|
+
## Como abrir
|
|
37
|
+
|
|
38
|
+
1. Na raiz: `npm run build`
|
|
39
|
+
2. Abra o HTML (live server)
|
|
40
|
+
3. Script: `../../../dist/v2/global.global.js`
|
|
41
|
+
|
|
42
|
+
## Ordem sugerida
|
|
43
|
+
|
|
44
|
+
`autocomplete → id/name → detection off → manual → dedupe → security → rules.card → data-track`
|
|
45
|
+
|
|
46
|
+
Referências: [`../initiate-checkout/`](../initiate-checkout/) · [`../add-to-cart/`](../add-to-cart/)
|