@beworke/pixel 0.1.0-rc.1 → 0.1.0-rc.5
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 +251 -4
- package/README.md +89 -111
- package/RELEASE_CANDIDATE.md +181 -36
- package/dist/{StorageFactory-BhpbB6Jj.d.mts → StorageFactory-CPghDPBj.d.mts} +2 -2
- package/dist/{StorageFactory-CAkJJqVD.d.ts → StorageFactory-tjfzk57c.d.ts} +2 -2
- package/dist/config/index.cjs.js +1 -1
- package/dist/config/index.cjs.js.map +1 -1
- package/dist/config/index.d.mts +4 -3
- package/dist/config/index.d.ts +4 -3
- package/dist/config/index.esm.js +1 -1
- package/dist/config/index.esm.js.map +1 -1
- package/dist/events/index.cjs.js +1 -1
- package/dist/events/index.cjs.js.map +1 -1
- package/dist/events/index.d.mts +2 -1
- package/dist/events/index.d.ts +2 -1
- package/dist/events/index.esm.js +1 -1
- package/dist/events/index.esm.js.map +1 -1
- package/dist/examples/html-script/README.md +24 -2
- package/dist/examples/html-script/RELEASE_CANDIDATE.md +20 -6
- package/dist/examples/html-script/add-payment-info/README.md +3 -3
- package/dist/examples/html-script/add-payment-info/example-add-payment-info-card-autocomplete.html +66 -48
- package/dist/examples/html-script/add-payment-info/example-add-payment-info-card-disabled.html +66 -48
- package/dist/examples/html-script/add-payment-info/example-add-payment-info-card-fields.html +65 -47
- package/dist/examples/html-script/add-payment-info/example-add-payment-info-data-track.html +73 -47
- package/dist/examples/html-script/add-payment-info/example-add-payment-info-dedupe.html +65 -47
- package/dist/examples/html-script/add-payment-info/example-add-payment-info-manual.html +56 -47
- package/dist/examples/html-script/add-payment-info/example-add-payment-info-rules-card.html +65 -47
- package/dist/examples/html-script/add-payment-info/example-add-payment-info-security.html +65 -47
- package/dist/examples/html-script/add-to-cart/README.md +3 -3
- package/dist/examples/html-script/add-to-cart/example-add-to-cart-attribute.html +90 -70
- package/dist/examples/html-script/add-to-cart/example-add-to-cart-auto.html +103 -81
- package/dist/examples/html-script/add-to-cart/example-add-to-cart-click.html +101 -78
- package/dist/examples/html-script/add-to-cart/example-add-to-cart-dedupe.html +90 -70
- package/dist/examples/html-script/add-to-cart/example-add-to-cart-manual.html +81 -67
- package/dist/examples/html-script/add-to-cart/example-add-to-cart-order-bump.html +90 -70
- package/dist/examples/html-script/add-to-cart/example-add-to-cart-text.html +104 -81
- package/dist/examples/html-script/behavior/example-behavior-engagement.html +489 -0
- package/dist/examples/html-script/behavior/example-behavior-heartbeat.html +350 -0
- package/dist/examples/html-script/behavior/example-behavior-runtime-intelligence.html +433 -0
- package/dist/examples/html-script/behavior/example-behavior-viewport.html +397 -0
- package/dist/examples/html-script/{example-behavior.html → behavior/example-behavior.html} +23 -17
- package/dist/examples/html-script/example-checkout-commerce.html +825 -0
- package/dist/examples/html-script/example-integration.html +5 -5
- package/dist/examples/html-script/example-landing-commerce.html +380 -0
- package/dist/examples/html-script/example-runtime-diagnostics.html +108 -0
- package/dist/examples/html-script/example-transport.html +5 -5
- package/dist/examples/html-script/full-funnel/README.md +64 -0
- package/dist/examples/html-script/full-funnel/checkout.html +116 -0
- package/dist/examples/html-script/full-funnel/downsell.html +58 -0
- package/dist/examples/html-script/full-funnel/landing.html +99 -0
- package/dist/examples/html-script/full-funnel/thank-you.html +85 -0
- package/dist/examples/html-script/full-funnel/upsell.html +64 -0
- package/dist/examples/html-script/initiate-checkout/README.md +6 -6
- package/dist/examples/html-script/initiate-checkout/example-initiate-checkout-attribute.html +94 -74
- package/dist/examples/html-script/initiate-checkout/example-initiate-checkout-auto.html +102 -80
- package/dist/examples/html-script/initiate-checkout/example-initiate-checkout-click.html +103 -80
- package/dist/examples/html-script/initiate-checkout/example-initiate-checkout-manual.html +86 -72
- package/dist/examples/html-script/initiate-checkout/example-initiate-checkout-snapshot.html +95 -75
- package/dist/examples/html-script/initiate-checkout/example-initiate-checkout-submit.html +103 -83
- package/dist/examples/html-script/initiate-checkout/example-initiate-checkout-text.html +105 -82
- package/dist/examples/html-script/lead/README.md +9 -7
- package/dist/examples/html-script/lead/example-lead-trigger-attribute.html +67 -47
- package/dist/examples/html-script/lead/example-lead-trigger-auto.html +78 -56
- package/dist/examples/html-script/lead/example-lead-trigger-click.html +78 -55
- package/dist/examples/html-script/release-candidate.html +187 -76
- package/dist/examples/html-script/remove-from-cart/README.md +1 -1
- package/dist/examples/html-script/remove-from-cart/example-remove-from-cart-attribute.html +93 -73
- package/dist/examples/html-script/remove-from-cart/example-remove-from-cart-css.html +93 -73
- package/dist/examples/html-script/remove-from-cart/example-remove-from-cart-dedupe.html +93 -73
- package/dist/examples/html-script/remove-from-cart/example-remove-from-cart-manual.html +84 -70
- package/dist/examples/html-script/remove-from-cart/example-remove-from-cart-multi.html +94 -74
- package/dist/examples/html-script/remove-from-cart/example-remove-from-cart-state.html +95 -75
- package/dist/examples/html-script/remove-from-cart/example-remove-from-cart-text.html +98 -76
- package/dist/examples/html-script/search/README.md +1 -1
- package/dist/examples/html-script/search/example-search-attribute.html +66 -51
- package/dist/examples/html-script/search/example-search-button-sync.html +66 -51
- package/dist/examples/html-script/search/example-search-dedupe.html +66 -51
- package/dist/examples/html-script/search/example-search-input.html +67 -51
- package/dist/examples/html-script/search/example-search-manual.html +57 -48
- package/dist/examples/html-script/search/example-search-submit.html +66 -51
- package/dist/examples/html-script/search/example-search-text.html +71 -51
- package/dist/examples/html-script/url-context/example-url-context-allowed-domains.html +63 -0
- package/dist/examples/html-script/url-context/example-url-context-landing.html +70 -0
- package/dist/examples/html-script/url-context/example-url-context-upsell.html +67 -0
- package/dist/examples/html-script/url-context/example-url-context.html +171 -0
- package/dist/examples/html-script/view-content/README.md +1 -1
- package/dist/examples/html-script/view-content/example-view-content-attribute.html +85 -70
- package/dist/examples/html-script/view-content/example-view-content-css.html +85 -70
- package/dist/examples/html-script/view-content/example-view-content-dedupe.html +85 -70
- package/dist/examples/html-script/view-content/example-view-content-empty.html +85 -70
- package/dist/examples/html-script/view-content/example-view-content-manual.html +76 -67
- package/dist/examples/html-script/view-content/example-view-content-product-card.html +85 -70
- package/dist/examples/html-script/view-content/example-view-content-text.html +90 -73
- package/dist/examples/v2/README.md +4 -1
- package/dist/{index-DUfFzniE.d.ts → index-CQAyT5Od.d.ts} +170 -3
- package/dist/{index-DUfFzniE.d.mts → index-JlKPz4pp.d.mts} +170 -3
- package/dist/index.cjs.js +1 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.mts +435 -12
- package/dist/index.d.ts +435 -12
- package/dist/index.esm.js +1 -1
- package/dist/index.esm.js.map +1 -1
- package/dist/{pixel-CbeF25mD.d.mts → pixel-BxZZx8l5.d.ts} +248 -72
- package/dist/{pixel-CbeF25mD.d.ts → pixel-CKc4OQUx.d.mts} +248 -72
- package/dist/{pixel-default-config-1VgLFOiL.d.mts → pixel-default-config-CJl-eypl.d.mts} +1 -1
- package/dist/{pixel-default-config-Bxb-Vdd8.d.ts → pixel-default-config-aAOujzwp.d.ts} +1 -1
- package/dist/runtime/index.cjs.js +1 -1
- package/dist/runtime/index.cjs.js.map +1 -1
- package/dist/runtime/index.d.mts +19 -26
- package/dist/runtime/index.d.ts +19 -26
- 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 +14 -6
- package/dist/services/index.d.ts +14 -6
- package/dist/services/index.esm.js +1 -1
- package/dist/services/index.esm.js.map +1 -1
- package/dist/types-BP8dz1gP.d.mts +19 -0
- package/dist/types-C75pQP31.d.ts +19 -0
- package/dist/types-DMhzHSVC.d.mts +293 -0
- package/dist/types-D_SsCur9.d.ts +293 -0
- package/dist/url-context-BjAsQoVl.d.mts +85 -0
- package/dist/url-context-BjAsQoVl.d.ts +85 -0
- 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 +8 -6
- package/dist/v2/index.d.ts +8 -6
- package/dist/v2/index.esm.js +1 -1
- package/dist/v2/index.esm.js.map +1 -1
- package/package.json +12 -1
- package/dist/types-CTpRvFKZ.d.ts +0 -71
- package/dist/types-DGlBdsAy.d.mts +0 -71
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@beworke/pixel",
|
|
3
|
-
"version": "0.1.0-rc.
|
|
3
|
+
"version": "0.1.0-rc.5",
|
|
4
4
|
"description": "Pixel v2 — SDK de analytics e conversão para API própria e destinos browser",
|
|
5
5
|
"main": "./dist/index.cjs.js",
|
|
6
6
|
"module": "./dist/index.esm.js",
|
|
@@ -58,6 +58,14 @@
|
|
|
58
58
|
"test:watch": "vitest",
|
|
59
59
|
"test:smoke:real": "node ./scripts/run-smoke-real.mjs",
|
|
60
60
|
"validate:rc-package": "node ./scripts/validate-rc-package.mjs",
|
|
61
|
+
"validate:public-docs": "node ./scripts/validate-public-docs.mjs",
|
|
62
|
+
"validate:public-examples": "node ./scripts/validate-public-examples.mjs",
|
|
63
|
+
"publish:rc": "npm publish --tag rc",
|
|
64
|
+
"validate:15b": "node ./scripts/validate-15b.mjs",
|
|
65
|
+
"test:integration": "vitest run src/integration",
|
|
66
|
+
"test:transport": "vitest run src/transport",
|
|
67
|
+
"test:full-funnel": "vitest run src/modules/core/url-context src/integration/stage-15b-module-matrix.test.ts",
|
|
68
|
+
"test:chaos": "vitest run src/transport/transport.resilience.test.ts src/transport/transport.advanced.test.ts",
|
|
61
69
|
"lint": "eslint src --ext .ts,.tsx",
|
|
62
70
|
"lint:fix": "eslint src --ext .ts,.tsx --fix",
|
|
63
71
|
"format": "prettier --write src/**/*.{ts,tsx,js,jsx,json,css,md}",
|
|
@@ -80,6 +88,9 @@
|
|
|
80
88
|
],
|
|
81
89
|
"author": "",
|
|
82
90
|
"license": "ISC",
|
|
91
|
+
"publishConfig": {
|
|
92
|
+
"access": "public"
|
|
93
|
+
},
|
|
83
94
|
"packageManager": "pnpm@10.7.1",
|
|
84
95
|
"devDependencies": {
|
|
85
96
|
"@changesets/cli": "^2.29.7",
|
package/dist/types-CTpRvFKZ.d.ts
DELETED
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import { P as PixelEvent, B as BrowserMetadataService, a as BaseEventBuilder, A as AttributionService } from './index-DUfFzniE.js';
|
|
2
|
-
|
|
3
|
-
interface StorageAdapter {
|
|
4
|
-
get(key: string): string | null;
|
|
5
|
-
set(key: string, value: string): void;
|
|
6
|
-
remove(key: string): void;
|
|
7
|
-
clear(): void;
|
|
8
|
-
}
|
|
9
|
-
interface StorageService {
|
|
10
|
-
get<T>(key: string): T | null;
|
|
11
|
-
set<T>(key: string, value: T): void;
|
|
12
|
-
remove(key: string): void;
|
|
13
|
-
has(key: string): boolean;
|
|
14
|
-
clear(): void;
|
|
15
|
-
createKey(key: string): string;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
interface DispatcherService {
|
|
19
|
-
dispatch(event: PixelEvent): void;
|
|
20
|
-
subscribe(listener: (event: PixelEvent) => void): () => void;
|
|
21
|
-
clear(): void;
|
|
22
|
-
getListenerCount(): number;
|
|
23
|
-
getLastEvent(): PixelEvent | null;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
interface FingerprintService {
|
|
27
|
-
getFingerprint(): string | null;
|
|
28
|
-
ensureFingerprint(): string;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
interface SessionData {
|
|
32
|
-
readonly sessionId: string;
|
|
33
|
-
readonly lastActivityAt: number;
|
|
34
|
-
readonly createdAt: number;
|
|
35
|
-
}
|
|
36
|
-
type EnsureSessionResult = {
|
|
37
|
-
readonly sessionId: string;
|
|
38
|
-
readonly expired: boolean;
|
|
39
|
-
readonly previousSessionId?: string;
|
|
40
|
-
readonly created: boolean;
|
|
41
|
-
};
|
|
42
|
-
interface SessionService {
|
|
43
|
-
getSessionId(): string | null;
|
|
44
|
-
getSessionData(): SessionData | null;
|
|
45
|
-
getLastActivityAt(): number | null;
|
|
46
|
-
isExpired(ttlMs: number): boolean;
|
|
47
|
-
ensureSession(ttlMs: number): EnsureSessionResult;
|
|
48
|
-
ensureSessionId(): string;
|
|
49
|
-
touchActivity(): void;
|
|
50
|
-
renew(): string;
|
|
51
|
-
clear(): void;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
interface VisitorService {
|
|
55
|
-
getVisitorId(): string | null;
|
|
56
|
-
ensureVisitorId(): string;
|
|
57
|
-
clearVisitorId(): void;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
type PixelRuntimeServices = {
|
|
61
|
-
readonly storage: StorageService;
|
|
62
|
-
readonly visitor: VisitorService;
|
|
63
|
-
readonly session: SessionService;
|
|
64
|
-
readonly fingerprint: FingerprintService;
|
|
65
|
-
readonly dispatcher: DispatcherService;
|
|
66
|
-
readonly browserMetadata: BrowserMetadataService;
|
|
67
|
-
readonly eventBuilder: BaseEventBuilder;
|
|
68
|
-
readonly attribution: AttributionService;
|
|
69
|
-
};
|
|
70
|
-
|
|
71
|
-
export type { DispatcherService as D, EnsureSessionResult as E, FingerprintService as F, PixelRuntimeServices as P, StorageAdapter as S, VisitorService as V, StorageService as a, SessionService as b, SessionData as c };
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import { P as PixelEvent, B as BrowserMetadataService, a as BaseEventBuilder, A as AttributionService } from './index-DUfFzniE.mjs';
|
|
2
|
-
|
|
3
|
-
interface StorageAdapter {
|
|
4
|
-
get(key: string): string | null;
|
|
5
|
-
set(key: string, value: string): void;
|
|
6
|
-
remove(key: string): void;
|
|
7
|
-
clear(): void;
|
|
8
|
-
}
|
|
9
|
-
interface StorageService {
|
|
10
|
-
get<T>(key: string): T | null;
|
|
11
|
-
set<T>(key: string, value: T): void;
|
|
12
|
-
remove(key: string): void;
|
|
13
|
-
has(key: string): boolean;
|
|
14
|
-
clear(): void;
|
|
15
|
-
createKey(key: string): string;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
interface DispatcherService {
|
|
19
|
-
dispatch(event: PixelEvent): void;
|
|
20
|
-
subscribe(listener: (event: PixelEvent) => void): () => void;
|
|
21
|
-
clear(): void;
|
|
22
|
-
getListenerCount(): number;
|
|
23
|
-
getLastEvent(): PixelEvent | null;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
interface FingerprintService {
|
|
27
|
-
getFingerprint(): string | null;
|
|
28
|
-
ensureFingerprint(): string;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
interface SessionData {
|
|
32
|
-
readonly sessionId: string;
|
|
33
|
-
readonly lastActivityAt: number;
|
|
34
|
-
readonly createdAt: number;
|
|
35
|
-
}
|
|
36
|
-
type EnsureSessionResult = {
|
|
37
|
-
readonly sessionId: string;
|
|
38
|
-
readonly expired: boolean;
|
|
39
|
-
readonly previousSessionId?: string;
|
|
40
|
-
readonly created: boolean;
|
|
41
|
-
};
|
|
42
|
-
interface SessionService {
|
|
43
|
-
getSessionId(): string | null;
|
|
44
|
-
getSessionData(): SessionData | null;
|
|
45
|
-
getLastActivityAt(): number | null;
|
|
46
|
-
isExpired(ttlMs: number): boolean;
|
|
47
|
-
ensureSession(ttlMs: number): EnsureSessionResult;
|
|
48
|
-
ensureSessionId(): string;
|
|
49
|
-
touchActivity(): void;
|
|
50
|
-
renew(): string;
|
|
51
|
-
clear(): void;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
interface VisitorService {
|
|
55
|
-
getVisitorId(): string | null;
|
|
56
|
-
ensureVisitorId(): string;
|
|
57
|
-
clearVisitorId(): void;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
type PixelRuntimeServices = {
|
|
61
|
-
readonly storage: StorageService;
|
|
62
|
-
readonly visitor: VisitorService;
|
|
63
|
-
readonly session: SessionService;
|
|
64
|
-
readonly fingerprint: FingerprintService;
|
|
65
|
-
readonly dispatcher: DispatcherService;
|
|
66
|
-
readonly browserMetadata: BrowserMetadataService;
|
|
67
|
-
readonly eventBuilder: BaseEventBuilder;
|
|
68
|
-
readonly attribution: AttributionService;
|
|
69
|
-
};
|
|
70
|
-
|
|
71
|
-
export type { DispatcherService as D, EnsureSessionResult as E, FingerprintService as F, PixelRuntimeServices as P, StorageAdapter as S, VisitorService as V, StorageService as a, SessionService as b, SessionData as c };
|