@beworke/pixel 0.1.0-rc.7 → 0.1.0-rc.8
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 +20 -0
- package/README.md +71 -56
- package/RELEASE_CANDIDATE.md +28 -62
- package/dist/Pixel-CCgGk43j.d.ts +797 -0
- package/dist/Pixel-CqbgC_72.d.mts +797 -0
- package/dist/{StorageFactory-DeMaZ8wk.d.ts → StorageFactory-BRBsnnH7.d.ts} +1 -1
- package/dist/{StorageFactory-Cq29vF32.d.mts → StorageFactory-Dp19Wecr.d.mts} +1 -1
- package/dist/browser/index.cjs.js +3 -0
- package/dist/browser/index.cjs.js.map +1 -0
- package/dist/browser/index.d.mts +55 -0
- package/dist/browser/index.d.ts +55 -0
- package/dist/browser/index.esm.js +3 -0
- package/dist/browser/index.esm.js.map +1 -0
- package/dist/browser/pixel.global.js +4 -0
- package/dist/browser/pixel.global.js.map +1 -0
- package/dist/config/index.cjs.js +1 -1
- package/dist/config/index.cjs.js.map +1 -1
- package/dist/config/index.d.mts +15 -5
- package/dist/config/index.d.ts +15 -5
- package/dist/config/index.esm.js +1 -1
- package/dist/config/index.esm.js.map +1 -1
- package/dist/examples/html-script/RELEASE_CANDIDATE.md +6 -8
- package/dist/examples/html-script/add-payment-info/example-add-payment-info-card-autocomplete.html +40 -47
- package/dist/examples/html-script/add-payment-info/example-add-payment-info-card-disabled.html +40 -47
- package/dist/examples/html-script/add-payment-info/example-add-payment-info-card-fields.html +40 -47
- package/dist/examples/html-script/add-payment-info/example-add-payment-info-data-track.html +40 -47
- package/dist/examples/html-script/add-payment-info/example-add-payment-info-dedupe.html +40 -47
- package/dist/examples/html-script/add-payment-info/example-add-payment-info-manual.html +40 -47
- package/dist/examples/html-script/add-payment-info/example-add-payment-info-rules-card.html +40 -47
- package/dist/examples/html-script/add-payment-info/example-add-payment-info-security.html +40 -47
- package/dist/examples/html-script/add-to-cart/example-add-to-cart-attribute.html +40 -47
- package/dist/examples/html-script/add-to-cart/example-add-to-cart-auto.html +40 -47
- package/dist/examples/html-script/add-to-cart/example-add-to-cart-click.html +40 -47
- package/dist/examples/html-script/add-to-cart/example-add-to-cart-dedupe.html +40 -47
- package/dist/examples/html-script/add-to-cart/example-add-to-cart-link.html +40 -47
- package/dist/examples/html-script/add-to-cart/example-add-to-cart-manual.html +40 -47
- package/dist/examples/html-script/add-to-cart/example-add-to-cart-order-bump.html +40 -47
- package/dist/examples/html-script/add-to-cart/example-add-to-cart-text.html +40 -47
- package/dist/examples/html-script/behavior/example-behavior-engagement.html +4 -4
- package/dist/examples/html-script/behavior/example-behavior-heartbeat.html +4 -4
- package/dist/examples/html-script/behavior/example-behavior-runtime-intelligence.html +4 -4
- package/dist/examples/html-script/behavior/example-behavior-viewport.html +4 -4
- package/dist/examples/html-script/buygoods/example-buygoods-checkout.html +83 -0
- package/dist/examples/html-script/example-checkout-commerce.html +31 -30
- package/dist/examples/html-script/example-conversion.html +41 -48
- package/dist/examples/html-script/example-global-factory-classic.html +45 -0
- package/dist/examples/html-script/example-global-factory.html +40 -0
- package/dist/examples/html-script/example-integration.html +39 -45
- package/dist/examples/html-script/example-landing-commerce.html +3 -8
- package/dist/examples/html-script/example-runtime-diagnostics.html +4 -4
- package/dist/examples/html-script/example-transport.html +59 -57
- package/dist/examples/html-script/full-funnel/checkout.html +3 -1
- package/dist/examples/html-script/full-funnel/downsell.html +3 -1
- package/dist/examples/html-script/full-funnel/landing.html +3 -1
- package/dist/examples/html-script/full-funnel/thank-you.html +3 -1
- package/dist/examples/html-script/full-funnel/upsell.html +3 -1
- package/dist/examples/html-script/initiate-checkout/example-initiate-checkout-attribute.html +40 -47
- package/dist/examples/html-script/initiate-checkout/example-initiate-checkout-auto.html +40 -47
- package/dist/examples/html-script/initiate-checkout/example-initiate-checkout-click.html +40 -47
- package/dist/examples/html-script/initiate-checkout/example-initiate-checkout-manual.html +40 -47
- package/dist/examples/html-script/initiate-checkout/example-initiate-checkout-snapshot.html +40 -47
- package/dist/examples/html-script/initiate-checkout/example-initiate-checkout-submit.html +40 -47
- package/dist/examples/html-script/initiate-checkout/example-initiate-checkout-text.html +40 -47
- package/dist/examples/html-script/lead/example-lead-trigger-attribute.html +40 -47
- package/dist/examples/html-script/lead/example-lead-trigger-auto.html +40 -47
- package/dist/examples/html-script/lead/example-lead-trigger-click.html +40 -47
- package/dist/examples/html-script/release-candidate.html +31 -30
- package/dist/examples/html-script/remove-from-cart/README.md +3 -3
- package/dist/examples/html-script/remove-from-cart/example-remove-from-cart-attribute.html +40 -47
- package/dist/examples/html-script/remove-from-cart/example-remove-from-cart-css.html +40 -47
- package/dist/examples/html-script/remove-from-cart/example-remove-from-cart-dedupe.html +47 -54
- package/dist/examples/html-script/remove-from-cart/example-remove-from-cart-manual.html +40 -47
- package/dist/examples/html-script/remove-from-cart/example-remove-from-cart-multi.html +40 -47
- package/dist/examples/html-script/remove-from-cart/example-remove-from-cart-state.html +40 -47
- package/dist/examples/html-script/remove-from-cart/example-remove-from-cart-text.html +40 -47
- package/dist/examples/html-script/search/example-search-attribute.html +40 -47
- package/dist/examples/html-script/search/example-search-button-sync.html +40 -47
- package/dist/examples/html-script/search/example-search-dedupe.html +40 -47
- package/dist/examples/html-script/search/example-search-input.html +40 -47
- package/dist/examples/html-script/search/example-search-manual.html +40 -47
- package/dist/examples/html-script/search/example-search-submit.html +40 -47
- package/dist/examples/html-script/search/example-search-text.html +40 -47
- package/dist/examples/html-script/url-context/example-url-context-allowed-domains.html +4 -4
- package/dist/examples/html-script/url-context/example-url-context-landing.html +4 -4
- package/dist/examples/html-script/url-context/example-url-context-upsell.html +4 -4
- package/dist/examples/html-script/url-context/example-url-context.html +4 -4
- package/dist/examples/html-script/view-content/example-view-content-attribute.html +40 -47
- package/dist/examples/html-script/view-content/example-view-content-css.html +40 -47
- package/dist/examples/html-script/view-content/example-view-content-dedupe.html +40 -47
- package/dist/examples/html-script/view-content/example-view-content-empty.html +40 -47
- package/dist/examples/html-script/view-content/example-view-content-manual.html +40 -47
- package/dist/examples/html-script/view-content/example-view-content-product-card.html +40 -47
- package/dist/examples/html-script/view-content/example-view-content-text.html +40 -47
- package/dist/index.cjs.js +1 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.mts +8 -6
- package/dist/index.d.ts +8 -6
- package/dist/index.esm.js +1 -1
- package/dist/index.esm.js.map +1 -1
- package/dist/{pixel-DMwpppf_.d.mts → pixel-C93c-0M2.d.mts} +109 -97
- package/dist/{pixel-2uL4LSyC.d.ts → pixel-DVy4rzj8.d.ts} +109 -97
- package/dist/pixel-default-config-BkAjriVH.d.mts +21 -0
- package/dist/pixel-default-config-Co69vDP3.d.ts +21 -0
- package/dist/pixel-settings-BhfJqA92.d.mts +40 -0
- package/dist/pixel-settings-C0qPFTii.d.ts +40 -0
- package/dist/runtime/index.cjs.js +1 -1
- package/dist/runtime/index.cjs.js.map +1 -1
- package/dist/runtime/index.d.mts +4 -4
- package/dist/runtime/index.d.ts +4 -4
- package/dist/runtime/index.esm.js +1 -1
- package/dist/runtime/index.esm.js.map +1 -1
- package/dist/services/index.cjs.js +1 -1
- package/dist/services/index.cjs.js.map +1 -1
- package/dist/services/index.d.mts +4 -4
- package/dist/services/index.d.ts +4 -4
- package/dist/services/index.esm.js +1 -1
- package/dist/services/index.esm.js.map +1 -1
- package/dist/{types-BqUEoZo0.d.ts → types-B2aUNHb3.d.ts} +2 -2
- package/dist/{types-6HF3UlsL.d.mts → types-C0J9KUQg.d.mts} +2 -2
- package/dist/{types-CgrabttM.d.mts → types-C2dsBog1.d.mts} +1 -1
- package/dist/{types-fFcQ1apy.d.ts → types-DcaBYgVI.d.ts} +1 -1
- package/dist/v2/global.global.js +1 -1
- package/dist/v2/global.global.js.map +1 -1
- package/dist/v2/index.cjs.js +1 -1
- package/dist/v2/index.cjs.js.map +1 -1
- package/dist/v2/index.d.mts +21 -787
- package/dist/v2/index.d.ts +21 -787
- package/dist/v2/index.esm.js +1 -1
- package/dist/v2/index.esm.js.map +1 -1
- package/docs/public/README.md +7 -4
- package/docs/public/api/exports.md +12 -8
- package/docs/public/api/pixel.md +27 -6
- package/docs/public/configuration/commerce.md +2 -2
- package/docs/public/configuration/modules.md +11 -14
- package/docs/public/configuration/overview.md +41 -25
- package/docs/public/configuration/transport.md +127 -0
- package/docs/public/events/catalog.md +3 -1
- package/docs/public/getting-started/installation.md +14 -12
- package/docs/public/getting-started/quick-start.md +95 -30
- package/docs/public/getting-started/react-nextjs.md +57 -34
- package/docs/public/getting-started/script-tag.md +55 -32
- package/docs/public/guides/funnel-checkout.md +1 -1
- package/docs/public/guides/funnel-landing.md +9 -7
- package/docs/public/limitations.md +5 -4
- package/docs/public/privacy/limitations.md +6 -6
- package/docs/public/release-candidate/validation.md +4 -4
- package/docs/public/troubleshooting.md +7 -6
- package/package.json +8 -3
- package/dist/pixel-default-config-BDPUVHse.d.ts +0 -5
- package/dist/pixel-default-config-C5uLt52W.d.mts +0 -5
|
@@ -77,15 +77,104 @@ type AttributionConfig = {
|
|
|
77
77
|
readonly customClickIdParams?: string[];
|
|
78
78
|
};
|
|
79
79
|
|
|
80
|
-
type
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
80
|
+
type TransportTestSenderConfig = {
|
|
81
|
+
mode: 'test';
|
|
82
|
+
capture?: boolean;
|
|
83
|
+
response?: 'success' | 'failure';
|
|
84
|
+
delayMs?: number;
|
|
85
|
+
};
|
|
86
|
+
type TransportInternalSenderConfig = {
|
|
87
|
+
mode: 'internal';
|
|
88
|
+
baseUrl?: string;
|
|
89
|
+
};
|
|
90
|
+
type TransportExternalSenderConfig = {
|
|
91
|
+
mode: 'external';
|
|
92
|
+
endpoints: {
|
|
93
|
+
event: string;
|
|
94
|
+
batch?: string;
|
|
88
95
|
};
|
|
96
|
+
/**
|
|
97
|
+
* Public browser-visible headers only. Backend secrets must be proxied by a
|
|
98
|
+
* trusted server and must never be embedded in browser configuration.
|
|
99
|
+
*/
|
|
100
|
+
headers?: Readonly<Record<string, string>>;
|
|
101
|
+
batchFallback?: 'single' | 'error';
|
|
102
|
+
};
|
|
103
|
+
type TransportSenderConfig = TransportTestSenderConfig | TransportInternalSenderConfig | TransportExternalSenderConfig;
|
|
104
|
+
type TransportPersistenceConfig = {
|
|
105
|
+
enabled: boolean;
|
|
106
|
+
};
|
|
107
|
+
type TransportReplayConfig = {
|
|
108
|
+
enabled: boolean;
|
|
109
|
+
};
|
|
110
|
+
type TransportOrderingConfig = {
|
|
111
|
+
enabled: boolean;
|
|
112
|
+
};
|
|
113
|
+
type TransportCoordinationConfig = {
|
|
114
|
+
enabled: boolean;
|
|
115
|
+
};
|
|
116
|
+
type TransportCircuitBreakerConfig = {
|
|
117
|
+
enabled: boolean;
|
|
118
|
+
failureThreshold: number;
|
|
119
|
+
resetTimeoutMs: number;
|
|
120
|
+
halfOpenMaxAttempts: number;
|
|
121
|
+
};
|
|
122
|
+
type TransportBackpressurePolicy = 'drop_oldest' | 'drop_newest' | 'reject_new' | 'sample' | 'none';
|
|
123
|
+
type TransportBackpressureConfig = {
|
|
124
|
+
enabled: boolean;
|
|
125
|
+
maxQueueSize: number;
|
|
126
|
+
policy: TransportBackpressurePolicy;
|
|
127
|
+
sampleRate?: number;
|
|
128
|
+
};
|
|
129
|
+
type TransportDeadLetterConfig = {
|
|
130
|
+
enabled: boolean;
|
|
131
|
+
maxEntries: number;
|
|
132
|
+
};
|
|
133
|
+
type TransportCompressionConfig = {
|
|
134
|
+
enabled: boolean;
|
|
135
|
+
strategy: 'identity';
|
|
136
|
+
};
|
|
137
|
+
type TransportRetryConfig = {
|
|
138
|
+
enabled: boolean;
|
|
139
|
+
maxAttempts: number;
|
|
140
|
+
baseDelayMs: number;
|
|
141
|
+
maxDelayMs: number;
|
|
142
|
+
multiplier: number;
|
|
143
|
+
};
|
|
144
|
+
type TransportBatchConfig = {
|
|
145
|
+
enabled: boolean;
|
|
146
|
+
batchSize: number;
|
|
147
|
+
maxWaitMs: number;
|
|
148
|
+
};
|
|
149
|
+
type TransportTimeoutConfig = {
|
|
150
|
+
enabled: boolean;
|
|
151
|
+
timeoutMs: number;
|
|
152
|
+
};
|
|
153
|
+
type TransportOfflineConfig = {
|
|
154
|
+
enabled: boolean;
|
|
155
|
+
};
|
|
156
|
+
type TransportFlushConfig = {
|
|
157
|
+
enabled: boolean;
|
|
158
|
+
flushIntervalMs: number;
|
|
159
|
+
flushOnDestroy: boolean;
|
|
160
|
+
prepareUnloadHooks: boolean;
|
|
161
|
+
};
|
|
162
|
+
type TransportConfig = {
|
|
163
|
+
enabled: boolean;
|
|
164
|
+
sender: TransportSenderConfig;
|
|
165
|
+
persistence: TransportPersistenceConfig;
|
|
166
|
+
replay: TransportReplayConfig;
|
|
167
|
+
ordering: TransportOrderingConfig;
|
|
168
|
+
coordination: TransportCoordinationConfig;
|
|
169
|
+
circuitBreaker: TransportCircuitBreakerConfig;
|
|
170
|
+
backpressure: TransportBackpressureConfig;
|
|
171
|
+
deadLetter: TransportDeadLetterConfig;
|
|
172
|
+
compression: TransportCompressionConfig;
|
|
173
|
+
retry: TransportRetryConfig;
|
|
174
|
+
batch: TransportBatchConfig;
|
|
175
|
+
timeout: TransportTimeoutConfig;
|
|
176
|
+
offline: TransportOfflineConfig;
|
|
177
|
+
flush: TransportFlushConfig;
|
|
89
178
|
};
|
|
90
179
|
|
|
91
180
|
type VisitorStoragePersistence = 'memory' | 'cookie' | 'localStorage' | 'cookie_localStorage';
|
|
@@ -203,11 +292,17 @@ type AutoSourceBase = {
|
|
|
203
292
|
debounceMs?: number;
|
|
204
293
|
cooldownMs?: number;
|
|
205
294
|
};
|
|
295
|
+
type SelectorAutoTrigger = 'click' | 'submit' | 'hover' | 'visible';
|
|
206
296
|
type SelectorAutoSource = AutoSourceBase & {
|
|
207
297
|
type: 'selector';
|
|
208
298
|
selector: SelectorConfig;
|
|
209
299
|
selectorType?: SelectorType;
|
|
210
|
-
trigger?:
|
|
300
|
+
trigger?: SelectorAutoTrigger;
|
|
301
|
+
/**
|
|
302
|
+
* Só para `trigger: 'visible'`. Fração visível 0–1.
|
|
303
|
+
* Default `0` (qualquer parte na viewport).
|
|
304
|
+
*/
|
|
305
|
+
visibleThreshold?: number;
|
|
211
306
|
};
|
|
212
307
|
type FormAutoSource = AutoSourceBase & {
|
|
213
308
|
type: 'form';
|
|
@@ -417,7 +512,10 @@ type CommerceConfig = {
|
|
|
417
512
|
enrichment?: CommerceEnrichmentConfig;
|
|
418
513
|
};
|
|
419
514
|
declare const DEFAULT_COMMERCE_ENRICHMENT: Required<CommerceEnrichmentConfig>;
|
|
420
|
-
/**
|
|
515
|
+
/**
|
|
516
|
+
* Commerce on by default so catalog/cart enrichment runs when products exist.
|
|
517
|
+
* Empty catalog / empty cart is a no-op.
|
|
518
|
+
*/
|
|
421
519
|
declare const DEFAULT_COMMERCE_CONFIG: CommerceConfig;
|
|
422
520
|
/** Normaliza calculateValueFrom (inclui aliases legado em runtime). */
|
|
423
521
|
declare function normalizeCalculateValueFrom(value: CommerceCalculateValueFrom | string | undefined): 'cart' | 'event' | 'manual' | 'catalog';
|
|
@@ -744,96 +842,10 @@ type PrivacyModuleConfig = {
|
|
|
744
842
|
anonymization: AnonymizationConfig;
|
|
745
843
|
};
|
|
746
844
|
|
|
747
|
-
type TransportRetryConfig = {
|
|
748
|
-
enabled: boolean;
|
|
749
|
-
maxAttempts: number;
|
|
750
|
-
baseDelayMs: number;
|
|
751
|
-
maxDelayMs: number;
|
|
752
|
-
multiplier: number;
|
|
753
|
-
};
|
|
754
|
-
type TransportBatchConfig = {
|
|
755
|
-
enabled: boolean;
|
|
756
|
-
batchSize: number;
|
|
757
|
-
flushIntervalMs: number;
|
|
758
|
-
maxWaitMs: number;
|
|
759
|
-
};
|
|
760
|
-
type TransportTimeoutConfig = {
|
|
761
|
-
enabled: boolean;
|
|
762
|
-
timeoutMs: number;
|
|
763
|
-
};
|
|
764
|
-
type TransportOfflineConfig = {
|
|
765
|
-
enabled: boolean;
|
|
766
|
-
};
|
|
767
|
-
type TransportFlushConfig = {
|
|
768
|
-
enabled: boolean;
|
|
769
|
-
flushIntervalMs: number;
|
|
770
|
-
flushOnDestroy: boolean;
|
|
771
|
-
prepareUnloadHooks: boolean;
|
|
772
|
-
};
|
|
773
|
-
type TransportSenderMode = 'mock' | 'http';
|
|
774
|
-
type TransportSenderConfig = {
|
|
775
|
-
mode: TransportSenderMode;
|
|
776
|
-
};
|
|
777
|
-
type TransportPersistenceConfig = {
|
|
778
|
-
enabled: boolean;
|
|
779
|
-
};
|
|
780
|
-
type TransportReplayConfig = {
|
|
781
|
-
enabled: boolean;
|
|
782
|
-
};
|
|
783
|
-
type TransportOrderingConfig = {
|
|
784
|
-
enabled: boolean;
|
|
785
|
-
};
|
|
786
|
-
type TransportCoordinationConfig = {
|
|
787
|
-
enabled: boolean;
|
|
788
|
-
};
|
|
789
|
-
type TransportCircuitBreakerConfig = {
|
|
790
|
-
enabled: boolean;
|
|
791
|
-
failureThreshold: number;
|
|
792
|
-
resetTimeoutMs: number;
|
|
793
|
-
halfOpenMaxAttempts: number;
|
|
794
|
-
};
|
|
795
|
-
type TransportBackpressurePolicy = 'drop_oldest' | 'drop_newest' | 'reject_new' | 'sample' | 'none';
|
|
796
|
-
type TransportBackpressureConfig = {
|
|
797
|
-
enabled: boolean;
|
|
798
|
-
maxQueueSize: number;
|
|
799
|
-
policy: TransportBackpressurePolicy;
|
|
800
|
-
sampleRate?: number;
|
|
801
|
-
};
|
|
802
|
-
type TransportDeadLetterConfig = {
|
|
803
|
-
enabled: boolean;
|
|
804
|
-
maxEntries: number;
|
|
805
|
-
};
|
|
806
|
-
type TransportCompressionConfig = {
|
|
807
|
-
enabled: boolean;
|
|
808
|
-
strategy: 'identity';
|
|
809
|
-
};
|
|
810
|
-
type TransportModuleConfig = {
|
|
811
|
-
enabled: boolean;
|
|
812
|
-
/** @deprecated Use sender.mode instead */
|
|
813
|
-
mockSender: {
|
|
814
|
-
enabled: boolean;
|
|
815
|
-
};
|
|
816
|
-
sender: TransportSenderConfig;
|
|
817
|
-
persistence: TransportPersistenceConfig;
|
|
818
|
-
replay: TransportReplayConfig;
|
|
819
|
-
ordering: TransportOrderingConfig;
|
|
820
|
-
coordination: TransportCoordinationConfig;
|
|
821
|
-
circuitBreaker: TransportCircuitBreakerConfig;
|
|
822
|
-
backpressure: TransportBackpressureConfig;
|
|
823
|
-
deadLetter: TransportDeadLetterConfig;
|
|
824
|
-
compression: TransportCompressionConfig;
|
|
825
|
-
retry: TransportRetryConfig;
|
|
826
|
-
batch: TransportBatchConfig;
|
|
827
|
-
timeout: TransportTimeoutConfig;
|
|
828
|
-
offline: TransportOfflineConfig;
|
|
829
|
-
flush: TransportFlushConfig;
|
|
830
|
-
};
|
|
831
|
-
|
|
832
845
|
type ModulesConfig = {
|
|
833
846
|
core: CoreModuleConfig;
|
|
834
847
|
behavior: BehaviorModuleConfig;
|
|
835
848
|
conversion: ConversionModuleConfig;
|
|
836
|
-
transport: TransportModuleConfig;
|
|
837
849
|
integrations: IntegrationsModuleConfig;
|
|
838
850
|
privacy: PrivacyModuleConfig;
|
|
839
851
|
};
|
|
@@ -849,4 +861,4 @@ type PixelConfig = {
|
|
|
849
861
|
modules: ModulesConfig;
|
|
850
862
|
};
|
|
851
863
|
|
|
852
|
-
export { type
|
|
864
|
+
export { type LinkValueBinding as $, type AttributionStoragePersistence as A, type BehaviorModuleConfig as B, type CommerceConfig as C, type TransportTestSenderConfig as D, type TransportTimeoutConfig as E, type StorageKeysConfig as F, type AutoSourceBase as G, type AutoSourceType as H, type IdentityConfig as I, type AutoTrackSource as J, type EngagementThresholds as K, type EngagementWeights as L, type ModulesConfig as M, type EngagementPenalties as N, type FingerprintMode as O, type PixelConfig as P, type QueueStoragePersistence as Q, type FormAutoSource as R, type SessionStoragePersistence as S, type TransportConfig as T, type LifecycleAutoSource as U, type VisitorStoragePersistence as V, type LinkAutoSource as W, type LinkMatchProtocol as X, type LinkQueryCondition as Y, type LinkQueryMatch as Z, type LinkTargetMatch as _, type AppConfig as a, type ScrollBehaviorConfig as a$, type LinkValueResolver as a0, type LinkValueTransform as a1, type PaymentAutoSource as a2, type PaymentMethod as a3, type SelectorAutoSource as a4, type SelectorAutoTrigger as a5, type SelectorConfig as a6, type SelectorDescriptor as a7, type SelectorInput as a8, type SelectorType as a9, type ClickBehaviorConfig as aA, type ConsentConfig as aB, type ConversionAutoDetectorsConfig as aC, type ConversionRulesConfig as aD, type CoordinationConfig as aE, type DedupeConfig as aF, type EngagementBehaviorConfig as aG, type ExitIntentBehaviorConfig as aH, type FingerprintConfig as aI, type GoogleBrowserDestinationConfig as aJ, type GoogleIntegrationConfig as aK, type HeartbeatModuleConfig as aL, type IdleBehaviorConfig as aM, type InitiateCheckoutAutoDetectorConfig as aN, type IntegrationTestDestinationConfig as aO, type LeadAutoDetectorConfig as aP, type ManualConversionConfig as aQ, type ManualEventConfig as aR, type MetaBrowserDestinationConfig as aS, type MetaIntegrationConfig as aT, type TikTokBrowserDestinationConfig as aU, type OrderingConfig as aV, type PageViewConfig as aW, type PiiConfig as aX, type PrivacyConsentConfig as aY, type PurchaseAutoDetectorConfig as aZ, type RemoveFromCartAutoDetectorConfig as a_, type SelectorFormConfig as aa, type SelectorFormMode as ab, type SelectorFormTrigger as ac, type CommerceCalculateValueFrom as ad, type CommerceCartConfig as ae, type CommerceCartItem as af, type CommerceCartMode as ag, type CommerceEnrichmentConfig as ah, type CommerceEnrichmentSource as ai, type CommerceEventEnrichmentConfig as aj, type CommerceMappingsConfig as ak, type CommerceProduct as al, type ProductCatalogConfig as am, type ProductType as an, type UrlAutoSource as ao, DEFAULT_SELECTOR_TYPE as ap, DEFAULT_COMMERCE_CONFIG as aq, DEFAULT_COMMERCE_ENRICHMENT as ar, getPrimarySelectorValue as as, normalizeCalculateValueFrom as at, resolveSelectorTypeFallback as au, type AddPaymentInfoAutoDetectorConfig as av, type AddToCartAutoDetectorConfig as aw, type AnonymizationConfig as ax, type AutoConversionConfig as ay, type AutoDetectorConfig as az, type TransportSenderConfig as b, type SearchAutoDetectorConfig as b0, type SessionConfig as b1, type ViewContentAutoDetectorConfig as b2, type ViewportBehaviorConfig as b3, type ViewportTargetConfig as b4, type VisibilityBehaviorConfig as b5, type VisitorConfig as b6, type StorageConfig as c, type AttributionConfig as d, type ConversionModuleConfig as e, type CoreModuleConfig as f, type IntegrationsModuleConfig as g, type PrivacyModuleConfig as h, type PixelEnvironment as i, type PixelSource as j, type PixelTarget as k, type TransportBackpressureConfig as l, type TransportBackpressurePolicy as m, type TransportBatchConfig as n, type TransportCircuitBreakerConfig as o, type TransportCompressionConfig as p, type TransportCoordinationConfig as q, type TransportDeadLetterConfig as r, type TransportExternalSenderConfig as s, type TransportFlushConfig as t, type TransportInternalSenderConfig as u, type TransportOfflineConfig as v, type TransportOrderingConfig as w, type TransportPersistenceConfig as x, type TransportReplayConfig as y, type TransportRetryConfig as z };
|
|
@@ -77,15 +77,104 @@ type AttributionConfig = {
|
|
|
77
77
|
readonly customClickIdParams?: string[];
|
|
78
78
|
};
|
|
79
79
|
|
|
80
|
-
type
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
80
|
+
type TransportTestSenderConfig = {
|
|
81
|
+
mode: 'test';
|
|
82
|
+
capture?: boolean;
|
|
83
|
+
response?: 'success' | 'failure';
|
|
84
|
+
delayMs?: number;
|
|
85
|
+
};
|
|
86
|
+
type TransportInternalSenderConfig = {
|
|
87
|
+
mode: 'internal';
|
|
88
|
+
baseUrl?: string;
|
|
89
|
+
};
|
|
90
|
+
type TransportExternalSenderConfig = {
|
|
91
|
+
mode: 'external';
|
|
92
|
+
endpoints: {
|
|
93
|
+
event: string;
|
|
94
|
+
batch?: string;
|
|
88
95
|
};
|
|
96
|
+
/**
|
|
97
|
+
* Public browser-visible headers only. Backend secrets must be proxied by a
|
|
98
|
+
* trusted server and must never be embedded in browser configuration.
|
|
99
|
+
*/
|
|
100
|
+
headers?: Readonly<Record<string, string>>;
|
|
101
|
+
batchFallback?: 'single' | 'error';
|
|
102
|
+
};
|
|
103
|
+
type TransportSenderConfig = TransportTestSenderConfig | TransportInternalSenderConfig | TransportExternalSenderConfig;
|
|
104
|
+
type TransportPersistenceConfig = {
|
|
105
|
+
enabled: boolean;
|
|
106
|
+
};
|
|
107
|
+
type TransportReplayConfig = {
|
|
108
|
+
enabled: boolean;
|
|
109
|
+
};
|
|
110
|
+
type TransportOrderingConfig = {
|
|
111
|
+
enabled: boolean;
|
|
112
|
+
};
|
|
113
|
+
type TransportCoordinationConfig = {
|
|
114
|
+
enabled: boolean;
|
|
115
|
+
};
|
|
116
|
+
type TransportCircuitBreakerConfig = {
|
|
117
|
+
enabled: boolean;
|
|
118
|
+
failureThreshold: number;
|
|
119
|
+
resetTimeoutMs: number;
|
|
120
|
+
halfOpenMaxAttempts: number;
|
|
121
|
+
};
|
|
122
|
+
type TransportBackpressurePolicy = 'drop_oldest' | 'drop_newest' | 'reject_new' | 'sample' | 'none';
|
|
123
|
+
type TransportBackpressureConfig = {
|
|
124
|
+
enabled: boolean;
|
|
125
|
+
maxQueueSize: number;
|
|
126
|
+
policy: TransportBackpressurePolicy;
|
|
127
|
+
sampleRate?: number;
|
|
128
|
+
};
|
|
129
|
+
type TransportDeadLetterConfig = {
|
|
130
|
+
enabled: boolean;
|
|
131
|
+
maxEntries: number;
|
|
132
|
+
};
|
|
133
|
+
type TransportCompressionConfig = {
|
|
134
|
+
enabled: boolean;
|
|
135
|
+
strategy: 'identity';
|
|
136
|
+
};
|
|
137
|
+
type TransportRetryConfig = {
|
|
138
|
+
enabled: boolean;
|
|
139
|
+
maxAttempts: number;
|
|
140
|
+
baseDelayMs: number;
|
|
141
|
+
maxDelayMs: number;
|
|
142
|
+
multiplier: number;
|
|
143
|
+
};
|
|
144
|
+
type TransportBatchConfig = {
|
|
145
|
+
enabled: boolean;
|
|
146
|
+
batchSize: number;
|
|
147
|
+
maxWaitMs: number;
|
|
148
|
+
};
|
|
149
|
+
type TransportTimeoutConfig = {
|
|
150
|
+
enabled: boolean;
|
|
151
|
+
timeoutMs: number;
|
|
152
|
+
};
|
|
153
|
+
type TransportOfflineConfig = {
|
|
154
|
+
enabled: boolean;
|
|
155
|
+
};
|
|
156
|
+
type TransportFlushConfig = {
|
|
157
|
+
enabled: boolean;
|
|
158
|
+
flushIntervalMs: number;
|
|
159
|
+
flushOnDestroy: boolean;
|
|
160
|
+
prepareUnloadHooks: boolean;
|
|
161
|
+
};
|
|
162
|
+
type TransportConfig = {
|
|
163
|
+
enabled: boolean;
|
|
164
|
+
sender: TransportSenderConfig;
|
|
165
|
+
persistence: TransportPersistenceConfig;
|
|
166
|
+
replay: TransportReplayConfig;
|
|
167
|
+
ordering: TransportOrderingConfig;
|
|
168
|
+
coordination: TransportCoordinationConfig;
|
|
169
|
+
circuitBreaker: TransportCircuitBreakerConfig;
|
|
170
|
+
backpressure: TransportBackpressureConfig;
|
|
171
|
+
deadLetter: TransportDeadLetterConfig;
|
|
172
|
+
compression: TransportCompressionConfig;
|
|
173
|
+
retry: TransportRetryConfig;
|
|
174
|
+
batch: TransportBatchConfig;
|
|
175
|
+
timeout: TransportTimeoutConfig;
|
|
176
|
+
offline: TransportOfflineConfig;
|
|
177
|
+
flush: TransportFlushConfig;
|
|
89
178
|
};
|
|
90
179
|
|
|
91
180
|
type VisitorStoragePersistence = 'memory' | 'cookie' | 'localStorage' | 'cookie_localStorage';
|
|
@@ -203,11 +292,17 @@ type AutoSourceBase = {
|
|
|
203
292
|
debounceMs?: number;
|
|
204
293
|
cooldownMs?: number;
|
|
205
294
|
};
|
|
295
|
+
type SelectorAutoTrigger = 'click' | 'submit' | 'hover' | 'visible';
|
|
206
296
|
type SelectorAutoSource = AutoSourceBase & {
|
|
207
297
|
type: 'selector';
|
|
208
298
|
selector: SelectorConfig;
|
|
209
299
|
selectorType?: SelectorType;
|
|
210
|
-
trigger?:
|
|
300
|
+
trigger?: SelectorAutoTrigger;
|
|
301
|
+
/**
|
|
302
|
+
* Só para `trigger: 'visible'`. Fração visível 0–1.
|
|
303
|
+
* Default `0` (qualquer parte na viewport).
|
|
304
|
+
*/
|
|
305
|
+
visibleThreshold?: number;
|
|
211
306
|
};
|
|
212
307
|
type FormAutoSource = AutoSourceBase & {
|
|
213
308
|
type: 'form';
|
|
@@ -417,7 +512,10 @@ type CommerceConfig = {
|
|
|
417
512
|
enrichment?: CommerceEnrichmentConfig;
|
|
418
513
|
};
|
|
419
514
|
declare const DEFAULT_COMMERCE_ENRICHMENT: Required<CommerceEnrichmentConfig>;
|
|
420
|
-
/**
|
|
515
|
+
/**
|
|
516
|
+
* Commerce on by default so catalog/cart enrichment runs when products exist.
|
|
517
|
+
* Empty catalog / empty cart is a no-op.
|
|
518
|
+
*/
|
|
421
519
|
declare const DEFAULT_COMMERCE_CONFIG: CommerceConfig;
|
|
422
520
|
/** Normaliza calculateValueFrom (inclui aliases legado em runtime). */
|
|
423
521
|
declare function normalizeCalculateValueFrom(value: CommerceCalculateValueFrom | string | undefined): 'cart' | 'event' | 'manual' | 'catalog';
|
|
@@ -744,96 +842,10 @@ type PrivacyModuleConfig = {
|
|
|
744
842
|
anonymization: AnonymizationConfig;
|
|
745
843
|
};
|
|
746
844
|
|
|
747
|
-
type TransportRetryConfig = {
|
|
748
|
-
enabled: boolean;
|
|
749
|
-
maxAttempts: number;
|
|
750
|
-
baseDelayMs: number;
|
|
751
|
-
maxDelayMs: number;
|
|
752
|
-
multiplier: number;
|
|
753
|
-
};
|
|
754
|
-
type TransportBatchConfig = {
|
|
755
|
-
enabled: boolean;
|
|
756
|
-
batchSize: number;
|
|
757
|
-
flushIntervalMs: number;
|
|
758
|
-
maxWaitMs: number;
|
|
759
|
-
};
|
|
760
|
-
type TransportTimeoutConfig = {
|
|
761
|
-
enabled: boolean;
|
|
762
|
-
timeoutMs: number;
|
|
763
|
-
};
|
|
764
|
-
type TransportOfflineConfig = {
|
|
765
|
-
enabled: boolean;
|
|
766
|
-
};
|
|
767
|
-
type TransportFlushConfig = {
|
|
768
|
-
enabled: boolean;
|
|
769
|
-
flushIntervalMs: number;
|
|
770
|
-
flushOnDestroy: boolean;
|
|
771
|
-
prepareUnloadHooks: boolean;
|
|
772
|
-
};
|
|
773
|
-
type TransportSenderMode = 'mock' | 'http';
|
|
774
|
-
type TransportSenderConfig = {
|
|
775
|
-
mode: TransportSenderMode;
|
|
776
|
-
};
|
|
777
|
-
type TransportPersistenceConfig = {
|
|
778
|
-
enabled: boolean;
|
|
779
|
-
};
|
|
780
|
-
type TransportReplayConfig = {
|
|
781
|
-
enabled: boolean;
|
|
782
|
-
};
|
|
783
|
-
type TransportOrderingConfig = {
|
|
784
|
-
enabled: boolean;
|
|
785
|
-
};
|
|
786
|
-
type TransportCoordinationConfig = {
|
|
787
|
-
enabled: boolean;
|
|
788
|
-
};
|
|
789
|
-
type TransportCircuitBreakerConfig = {
|
|
790
|
-
enabled: boolean;
|
|
791
|
-
failureThreshold: number;
|
|
792
|
-
resetTimeoutMs: number;
|
|
793
|
-
halfOpenMaxAttempts: number;
|
|
794
|
-
};
|
|
795
|
-
type TransportBackpressurePolicy = 'drop_oldest' | 'drop_newest' | 'reject_new' | 'sample' | 'none';
|
|
796
|
-
type TransportBackpressureConfig = {
|
|
797
|
-
enabled: boolean;
|
|
798
|
-
maxQueueSize: number;
|
|
799
|
-
policy: TransportBackpressurePolicy;
|
|
800
|
-
sampleRate?: number;
|
|
801
|
-
};
|
|
802
|
-
type TransportDeadLetterConfig = {
|
|
803
|
-
enabled: boolean;
|
|
804
|
-
maxEntries: number;
|
|
805
|
-
};
|
|
806
|
-
type TransportCompressionConfig = {
|
|
807
|
-
enabled: boolean;
|
|
808
|
-
strategy: 'identity';
|
|
809
|
-
};
|
|
810
|
-
type TransportModuleConfig = {
|
|
811
|
-
enabled: boolean;
|
|
812
|
-
/** @deprecated Use sender.mode instead */
|
|
813
|
-
mockSender: {
|
|
814
|
-
enabled: boolean;
|
|
815
|
-
};
|
|
816
|
-
sender: TransportSenderConfig;
|
|
817
|
-
persistence: TransportPersistenceConfig;
|
|
818
|
-
replay: TransportReplayConfig;
|
|
819
|
-
ordering: TransportOrderingConfig;
|
|
820
|
-
coordination: TransportCoordinationConfig;
|
|
821
|
-
circuitBreaker: TransportCircuitBreakerConfig;
|
|
822
|
-
backpressure: TransportBackpressureConfig;
|
|
823
|
-
deadLetter: TransportDeadLetterConfig;
|
|
824
|
-
compression: TransportCompressionConfig;
|
|
825
|
-
retry: TransportRetryConfig;
|
|
826
|
-
batch: TransportBatchConfig;
|
|
827
|
-
timeout: TransportTimeoutConfig;
|
|
828
|
-
offline: TransportOfflineConfig;
|
|
829
|
-
flush: TransportFlushConfig;
|
|
830
|
-
};
|
|
831
|
-
|
|
832
845
|
type ModulesConfig = {
|
|
833
846
|
core: CoreModuleConfig;
|
|
834
847
|
behavior: BehaviorModuleConfig;
|
|
835
848
|
conversion: ConversionModuleConfig;
|
|
836
|
-
transport: TransportModuleConfig;
|
|
837
849
|
integrations: IntegrationsModuleConfig;
|
|
838
850
|
privacy: PrivacyModuleConfig;
|
|
839
851
|
};
|
|
@@ -849,4 +861,4 @@ type PixelConfig = {
|
|
|
849
861
|
modules: ModulesConfig;
|
|
850
862
|
};
|
|
851
863
|
|
|
852
|
-
export { type
|
|
864
|
+
export { type LinkValueBinding as $, type AttributionStoragePersistence as A, type BehaviorModuleConfig as B, type CommerceConfig as C, type TransportTestSenderConfig as D, type TransportTimeoutConfig as E, type StorageKeysConfig as F, type AutoSourceBase as G, type AutoSourceType as H, type IdentityConfig as I, type AutoTrackSource as J, type EngagementThresholds as K, type EngagementWeights as L, type ModulesConfig as M, type EngagementPenalties as N, type FingerprintMode as O, type PixelConfig as P, type QueueStoragePersistence as Q, type FormAutoSource as R, type SessionStoragePersistence as S, type TransportConfig as T, type LifecycleAutoSource as U, type VisitorStoragePersistence as V, type LinkAutoSource as W, type LinkMatchProtocol as X, type LinkQueryCondition as Y, type LinkQueryMatch as Z, type LinkTargetMatch as _, type AppConfig as a, type ScrollBehaviorConfig as a$, type LinkValueResolver as a0, type LinkValueTransform as a1, type PaymentAutoSource as a2, type PaymentMethod as a3, type SelectorAutoSource as a4, type SelectorAutoTrigger as a5, type SelectorConfig as a6, type SelectorDescriptor as a7, type SelectorInput as a8, type SelectorType as a9, type ClickBehaviorConfig as aA, type ConsentConfig as aB, type ConversionAutoDetectorsConfig as aC, type ConversionRulesConfig as aD, type CoordinationConfig as aE, type DedupeConfig as aF, type EngagementBehaviorConfig as aG, type ExitIntentBehaviorConfig as aH, type FingerprintConfig as aI, type GoogleBrowserDestinationConfig as aJ, type GoogleIntegrationConfig as aK, type HeartbeatModuleConfig as aL, type IdleBehaviorConfig as aM, type InitiateCheckoutAutoDetectorConfig as aN, type IntegrationTestDestinationConfig as aO, type LeadAutoDetectorConfig as aP, type ManualConversionConfig as aQ, type ManualEventConfig as aR, type MetaBrowserDestinationConfig as aS, type MetaIntegrationConfig as aT, type TikTokBrowserDestinationConfig as aU, type OrderingConfig as aV, type PageViewConfig as aW, type PiiConfig as aX, type PrivacyConsentConfig as aY, type PurchaseAutoDetectorConfig as aZ, type RemoveFromCartAutoDetectorConfig as a_, type SelectorFormConfig as aa, type SelectorFormMode as ab, type SelectorFormTrigger as ac, type CommerceCalculateValueFrom as ad, type CommerceCartConfig as ae, type CommerceCartItem as af, type CommerceCartMode as ag, type CommerceEnrichmentConfig as ah, type CommerceEnrichmentSource as ai, type CommerceEventEnrichmentConfig as aj, type CommerceMappingsConfig as ak, type CommerceProduct as al, type ProductCatalogConfig as am, type ProductType as an, type UrlAutoSource as ao, DEFAULT_SELECTOR_TYPE as ap, DEFAULT_COMMERCE_CONFIG as aq, DEFAULT_COMMERCE_ENRICHMENT as ar, getPrimarySelectorValue as as, normalizeCalculateValueFrom as at, resolveSelectorTypeFallback as au, type AddPaymentInfoAutoDetectorConfig as av, type AddToCartAutoDetectorConfig as aw, type AnonymizationConfig as ax, type AutoConversionConfig as ay, type AutoDetectorConfig as az, type TransportSenderConfig as b, type SearchAutoDetectorConfig as b0, type SessionConfig as b1, type ViewContentAutoDetectorConfig as b2, type ViewportBehaviorConfig as b3, type ViewportTargetConfig as b4, type VisibilityBehaviorConfig as b5, type VisitorConfig as b6, type StorageConfig as c, type AttributionConfig as d, type ConversionModuleConfig as e, type CoreModuleConfig as f, type IntegrationsModuleConfig as g, type PrivacyModuleConfig as h, type PixelEnvironment as i, type PixelSource as j, type PixelTarget as k, type TransportBackpressureConfig as l, type TransportBackpressurePolicy as m, type TransportBatchConfig as n, type TransportCircuitBreakerConfig as o, type TransportCompressionConfig as p, type TransportCoordinationConfig as q, type TransportDeadLetterConfig as r, type TransportExternalSenderConfig as s, type TransportFlushConfig as t, type TransportInternalSenderConfig as u, type TransportOfflineConfig as v, type TransportOrderingConfig as w, type TransportPersistenceConfig as x, type TransportReplayConfig as y, type TransportRetryConfig as z };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { P as PixelConfig } from './pixel-C93c-0M2.mjs';
|
|
2
|
+
import { P as PixelSettings } from './pixel-settings-BhfJqA92.mjs';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Resolve input público parcial em `PixelConfig` completo e isolado.
|
|
6
|
+
*
|
|
7
|
+
* Não muta `DEFAULT_PIXEL_CONFIG` nem o `settings` recebido.
|
|
8
|
+
* Cada chamada produz uma árvore nova (sem refs mutáveis compartilhadas).
|
|
9
|
+
*/
|
|
10
|
+
declare function resolvePixelConfig(settings: PixelSettings): PixelConfig;
|
|
11
|
+
|
|
12
|
+
type PixelConfigurationErrorCode = 'INVALID_PIXEL_ID' | 'INVALID_SETTINGS';
|
|
13
|
+
declare class PixelConfigurationError extends Error {
|
|
14
|
+
readonly code: PixelConfigurationErrorCode;
|
|
15
|
+
readonly cause?: unknown;
|
|
16
|
+
constructor(message: string, code: PixelConfigurationErrorCode, cause?: unknown);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
declare const DEFAULT_PIXEL_CONFIG: PixelConfig;
|
|
20
|
+
|
|
21
|
+
export { DEFAULT_PIXEL_CONFIG as D, PixelConfigurationError as P, type PixelConfigurationErrorCode as a, resolvePixelConfig as r };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { P as PixelConfig } from './pixel-DVy4rzj8.js';
|
|
2
|
+
import { P as PixelSettings } from './pixel-settings-C0qPFTii.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Resolve input público parcial em `PixelConfig` completo e isolado.
|
|
6
|
+
*
|
|
7
|
+
* Não muta `DEFAULT_PIXEL_CONFIG` nem o `settings` recebido.
|
|
8
|
+
* Cada chamada produz uma árvore nova (sem refs mutáveis compartilhadas).
|
|
9
|
+
*/
|
|
10
|
+
declare function resolvePixelConfig(settings: PixelSettings): PixelConfig;
|
|
11
|
+
|
|
12
|
+
type PixelConfigurationErrorCode = 'INVALID_PIXEL_ID' | 'INVALID_SETTINGS';
|
|
13
|
+
declare class PixelConfigurationError extends Error {
|
|
14
|
+
readonly code: PixelConfigurationErrorCode;
|
|
15
|
+
readonly cause?: unknown;
|
|
16
|
+
constructor(message: string, code: PixelConfigurationErrorCode, cause?: unknown);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
declare const DEFAULT_PIXEL_CONFIG: PixelConfig;
|
|
20
|
+
|
|
21
|
+
export { DEFAULT_PIXEL_CONFIG as D, PixelConfigurationError as P, type PixelConfigurationErrorCode as a, resolvePixelConfig as r };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { I as IdentityConfig, a as AppConfig, T as TransportConfig, b as TransportSenderConfig, c as StorageConfig, d as AttributionConfig, C as CommerceConfig, M as ModulesConfig } from './pixel-C93c-0M2.mjs';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Partial profundo seguro para input público.
|
|
5
|
+
*
|
|
6
|
+
* - funções são preservadas;
|
|
7
|
+
* - arrays são substituíveis por inteiro (itens não viram partial);
|
|
8
|
+
* - objetos têm propriedades recursivamente opcionais;
|
|
9
|
+
* - primitivos e unions permanecem.
|
|
10
|
+
*/
|
|
11
|
+
type DeepPartial<T> = T extends (...args: never[]) => unknown ? T : T extends readonly (infer Item)[] ? readonly Item[] : T extends object ? {
|
|
12
|
+
[Key in keyof T]?: DeepPartial<T[Key]>;
|
|
13
|
+
} : T;
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Override de transport no input público.
|
|
17
|
+
*
|
|
18
|
+
* `sender` permanece a union discriminada completa: `external` continua
|
|
19
|
+
* exigindo `endpoints.event` em TypeScript. Não é deep-partial irrestrito.
|
|
20
|
+
*/
|
|
21
|
+
type PixelTransportSettings = Omit<DeepPartial<TransportConfig>, 'sender'> & {
|
|
22
|
+
sender?: TransportSenderConfig;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Contrato público de entrada: somente `identity.pixelId` é obrigatório.
|
|
26
|
+
* Os demais blocos são parciais e mesclados com `DEFAULT_PIXEL_CONFIG`.
|
|
27
|
+
*
|
|
28
|
+
* Um `PixelConfig` completo continua atribuível a este tipo.
|
|
29
|
+
*/
|
|
30
|
+
type PixelSettings = {
|
|
31
|
+
identity: Pick<IdentityConfig, 'pixelId'> & Partial<Omit<IdentityConfig, 'pixelId'>>;
|
|
32
|
+
app?: DeepPartial<AppConfig>;
|
|
33
|
+
transport?: PixelTransportSettings;
|
|
34
|
+
storage?: DeepPartial<StorageConfig>;
|
|
35
|
+
attribution?: DeepPartial<AttributionConfig>;
|
|
36
|
+
commerce?: DeepPartial<CommerceConfig>;
|
|
37
|
+
modules?: DeepPartial<ModulesConfig>;
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
export type { DeepPartial as D, PixelSettings as P, PixelTransportSettings as a };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { I as IdentityConfig, a as AppConfig, T as TransportConfig, b as TransportSenderConfig, c as StorageConfig, d as AttributionConfig, C as CommerceConfig, M as ModulesConfig } from './pixel-DVy4rzj8.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Partial profundo seguro para input público.
|
|
5
|
+
*
|
|
6
|
+
* - funções são preservadas;
|
|
7
|
+
* - arrays são substituíveis por inteiro (itens não viram partial);
|
|
8
|
+
* - objetos têm propriedades recursivamente opcionais;
|
|
9
|
+
* - primitivos e unions permanecem.
|
|
10
|
+
*/
|
|
11
|
+
type DeepPartial<T> = T extends (...args: never[]) => unknown ? T : T extends readonly (infer Item)[] ? readonly Item[] : T extends object ? {
|
|
12
|
+
[Key in keyof T]?: DeepPartial<T[Key]>;
|
|
13
|
+
} : T;
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Override de transport no input público.
|
|
17
|
+
*
|
|
18
|
+
* `sender` permanece a union discriminada completa: `external` continua
|
|
19
|
+
* exigindo `endpoints.event` em TypeScript. Não é deep-partial irrestrito.
|
|
20
|
+
*/
|
|
21
|
+
type PixelTransportSettings = Omit<DeepPartial<TransportConfig>, 'sender'> & {
|
|
22
|
+
sender?: TransportSenderConfig;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Contrato público de entrada: somente `identity.pixelId` é obrigatório.
|
|
26
|
+
* Os demais blocos são parciais e mesclados com `DEFAULT_PIXEL_CONFIG`.
|
|
27
|
+
*
|
|
28
|
+
* Um `PixelConfig` completo continua atribuível a este tipo.
|
|
29
|
+
*/
|
|
30
|
+
type PixelSettings = {
|
|
31
|
+
identity: Pick<IdentityConfig, 'pixelId'> & Partial<Omit<IdentityConfig, 'pixelId'>>;
|
|
32
|
+
app?: DeepPartial<AppConfig>;
|
|
33
|
+
transport?: PixelTransportSettings;
|
|
34
|
+
storage?: DeepPartial<StorageConfig>;
|
|
35
|
+
attribution?: DeepPartial<AttributionConfig>;
|
|
36
|
+
commerce?: DeepPartial<CommerceConfig>;
|
|
37
|
+
modules?: DeepPartial<ModulesConfig>;
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
export type { DeepPartial as D, PixelSettings as P, PixelTransportSettings as a };
|