@tagadapay/headless-sdk 1.14.1 → 1.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core/client.d.ts +12 -0
- package/dist/core/client.d.ts.map +1 -1
- package/dist/core/client.js +16 -4
- package/dist/core/client.js.map +1 -1
- package/dist/core/http.d.ts +2 -0
- package/dist/core/http.d.ts.map +1 -1
- package/dist/core/http.js +21 -5
- package/dist/core/http.js.map +1 -1
- package/dist/core/index.d.ts +7 -1
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +3 -0
- package/dist/core/index.js.map +1 -1
- package/dist/core/modules/checkout.d.ts +5 -1
- package/dist/core/modules/checkout.d.ts.map +1 -1
- package/dist/core/modules/checkout.js +22 -1
- package/dist/core/modules/checkout.js.map +1 -1
- package/dist/core/modules/commerce.d.ts +4 -0
- package/dist/core/modules/commerce.d.ts.map +1 -0
- package/dist/core/modules/commerce.js +5 -0
- package/dist/core/modules/commerce.js.map +1 -0
- package/dist/core/modules/customer.d.ts +47 -1
- package/dist/core/modules/customer.d.ts.map +1 -1
- package/dist/core/modules/customer.js +60 -3
- package/dist/core/modules/customer.js.map +1 -1
- package/dist/core/modules/experiments.d.ts +21 -0
- package/dist/core/modules/experiments.d.ts.map +1 -0
- package/dist/core/modules/experiments.js +85 -0
- package/dist/core/modules/experiments.js.map +1 -0
- package/dist/core/modules/funnel.d.ts +2 -1
- package/dist/core/modules/funnel.d.ts.map +1 -1
- package/dist/core/modules/funnel.js +6 -1
- package/dist/core/modules/funnel.js.map +1 -1
- package/dist/core/modules/lazyCommerce.d.ts +16 -0
- package/dist/core/modules/lazyCommerce.d.ts.map +1 -0
- package/dist/core/modules/lazyCommerce.js +20 -0
- package/dist/core/modules/lazyCommerce.js.map +1 -0
- package/dist/core/modules/offers.d.ts +30 -5
- package/dist/core/modules/offers.d.ts.map +1 -1
- package/dist/core/modules/offers.js +66 -7
- package/dist/core/modules/offers.js.map +1 -1
- package/dist/core/modules/payment.d.ts +19 -1
- package/dist/core/modules/payment.d.ts.map +1 -1
- package/dist/core/modules/payment.js +42 -3
- package/dist/core/modules/payment.js.map +1 -1
- package/dist/core/modules/portal/index.d.ts +102 -0
- package/dist/core/modules/portal/index.d.ts.map +1 -0
- package/dist/core/modules/portal/index.js +166 -0
- package/dist/core/modules/portal/index.js.map +1 -0
- package/dist/core/modules/portal/types.d.ts +617 -0
- package/dist/core/modules/portal/types.d.ts.map +1 -0
- package/dist/core/modules/portal/types.js +11 -0
- package/dist/core/modules/portal/types.js.map +1 -0
- package/dist/core/modules/rx.d.ts +32 -1
- package/dist/core/modules/rx.d.ts.map +1 -1
- package/dist/core/modules/rx.js +17 -1
- package/dist/core/modules/rx.js.map +1 -1
- package/dist/core/modules/track.d.ts +135 -0
- package/dist/core/modules/track.d.ts.map +1 -0
- package/dist/core/modules/track.js +412 -0
- package/dist/core/modules/track.js.map +1 -0
- package/dist/core/types.d.ts +13 -0
- package/dist/core/types.d.ts.map +1 -1
- package/dist/core/types.js +0 -3
- package/dist/core/types.js.map +1 -1
- package/dist/core/version.d.ts +4 -0
- package/dist/core/version.d.ts.map +1 -0
- package/dist/core/version.js +4 -0
- package/dist/core/version.js.map +1 -0
- package/dist/pixels/engine.d.ts +56 -0
- package/dist/pixels/engine.d.ts.map +1 -0
- package/dist/pixels/engine.js +263 -0
- package/dist/pixels/engine.js.map +1 -0
- package/dist/pixels/index.d.ts +10 -0
- package/dist/pixels/index.d.ts.map +1 -0
- package/dist/pixels/index.js +5 -0
- package/dist/pixels/index.js.map +1 -0
- package/dist/pixels/metaEventId.d.ts +15 -0
- package/dist/pixels/metaEventId.d.ts.map +1 -0
- package/dist/pixels/metaEventId.js +17 -0
- package/dist/pixels/metaEventId.js.map +1 -0
- package/dist/pixels/pixelIdentity.d.ts +34 -0
- package/dist/pixels/pixelIdentity.d.ts.map +1 -0
- package/dist/pixels/pixelIdentity.js +65 -0
- package/dist/pixels/pixelIdentity.js.map +1 -0
- package/dist/pixels/pixelMapping.d.ts +172 -0
- package/dist/pixels/pixelMapping.d.ts.map +1 -0
- package/dist/pixels/pixelMapping.js +574 -0
- package/dist/pixels/pixelMapping.js.map +1 -0
- package/dist/pixels/pixelTracker.d.ts +81 -0
- package/dist/pixels/pixelTracker.d.ts.map +1 -0
- package/dist/pixels/pixelTracker.js +797 -0
- package/dist/pixels/pixelTracker.js.map +1 -0
- package/dist/pixels/types.d.ts +103 -0
- package/dist/pixels/types.d.ts.map +1 -0
- package/dist/pixels/types.js +14 -0
- package/dist/pixels/types.js.map +1 -0
- package/dist/react/hooks/useStep.d.ts +7 -0
- package/dist/react/hooks/useStep.d.ts.map +1 -0
- package/dist/react/hooks/useStep.js +14 -0
- package/dist/react/hooks/useStep.js.map +1 -0
- package/dist/react/index.d.ts +1 -0
- package/dist/react/index.d.ts.map +1 -1
- package/dist/react/index.js +1 -0
- package/dist/react/index.js.map +1 -1
- package/dist/stripe/index.d.ts +3 -1
- package/dist/stripe/index.d.ts.map +1 -1
- package/dist/stripe/index.js +13 -6
- package/dist/stripe/index.js.map +1 -1
- package/dist/stripe/useStripeExpress.d.ts.map +1 -1
- package/dist/stripe/useStripeExpress.js +15 -1
- package/dist/stripe/useStripeExpress.js.map +1 -1
- package/dist/tagada-headless-commerce.min.js +8 -0
- package/dist/tagada-headless-commerce.min.js.map +7 -0
- package/dist/tagada-headless-react.min.js +2 -2
- package/dist/tagada-headless-react.min.js.map +4 -4
- package/dist/tagada-headless.js +722 -288
- package/dist/tagada-headless.min.js +2 -2
- package/dist/tagada-headless.min.js.map +4 -4
- package/dist/tagada-pixels.min.js +7 -0
- package/dist/tagada-pixels.min.js.map +7 -0
- package/dist/tgd/contract/attribution.d.ts +28 -0
- package/dist/tgd/contract/attribution.d.ts.map +1 -0
- package/dist/tgd/contract/attribution.js +44 -0
- package/dist/tgd/contract/attribution.js.map +1 -0
- package/dist/tgd/contract/browser-api.d.ts +57 -0
- package/dist/tgd/contract/browser-api.d.ts.map +1 -0
- package/dist/tgd/contract/browser-api.js +2 -0
- package/dist/tgd/contract/browser-api.js.map +1 -0
- package/dist/tgd/contract/canvas.d.ts +120 -0
- package/dist/tgd/contract/canvas.d.ts.map +1 -0
- package/dist/tgd/contract/canvas.js +12 -0
- package/dist/tgd/contract/canvas.js.map +1 -0
- package/dist/tgd/contract/dedup-keys.d.ts +24 -0
- package/dist/tgd/contract/dedup-keys.d.ts.map +1 -0
- package/dist/tgd/contract/dedup-keys.js +23 -0
- package/dist/tgd/contract/dedup-keys.js.map +1 -0
- package/dist/tgd/contract/destination-names.d.ts +4 -0
- package/dist/tgd/contract/destination-names.d.ts.map +1 -0
- package/dist/tgd/contract/destination-names.js +66 -0
- package/dist/tgd/contract/destination-names.js.map +1 -0
- package/dist/tgd/contract/destinations.d.ts +124 -0
- package/dist/tgd/contract/destinations.d.ts.map +1 -0
- package/dist/tgd/contract/destinations.js +63 -0
- package/dist/tgd/contract/destinations.js.map +1 -0
- package/dist/tgd/contract/envelope.d.ts +203 -0
- package/dist/tgd/contract/envelope.d.ts.map +1 -0
- package/dist/tgd/contract/envelope.js +103 -0
- package/dist/tgd/contract/envelope.js.map +1 -0
- package/dist/tgd/contract/experiments.d.ts +87 -0
- package/dist/tgd/contract/experiments.d.ts.map +1 -0
- package/dist/tgd/contract/experiments.js +2 -0
- package/dist/tgd/contract/experiments.js.map +1 -0
- package/dist/tgd/contract/index.d.ts +20 -0
- package/dist/tgd/contract/index.d.ts.map +1 -0
- package/dist/tgd/contract/index.js +20 -0
- package/dist/tgd/contract/index.js.map +1 -0
- package/dist/tgd/contract/is-test.d.ts +2 -0
- package/dist/tgd/contract/is-test.d.ts.map +1 -0
- package/dist/tgd/contract/is-test.js +3 -0
- package/dist/tgd/contract/is-test.js.map +1 -0
- package/dist/tgd/contract/junk-ids.d.ts +4 -0
- package/dist/tgd/contract/junk-ids.d.ts.map +1 -0
- package/dist/tgd/contract/junk-ids.js +7 -0
- package/dist/tgd/contract/junk-ids.js.map +1 -0
- package/dist/tgd/contract/limits.d.ts +19 -0
- package/dist/tgd/contract/limits.d.ts.map +1 -0
- package/dist/tgd/contract/limits.js +20 -0
- package/dist/tgd/contract/limits.js.map +1 -0
- package/dist/tgd/contract/names.d.ts +13 -0
- package/dist/tgd/contract/names.d.ts.map +1 -0
- package/dist/tgd/contract/names.js +15 -0
- package/dist/tgd/contract/names.js.map +1 -0
- package/dist/tgd/contract/registry.d.ts +116 -0
- package/dist/tgd/contract/registry.d.ts.map +1 -0
- package/dist/tgd/contract/registry.js +59 -0
- package/dist/tgd/contract/registry.js.map +1 -0
- package/dist/tgd/contract/signed-ids.d.ts +33 -0
- package/dist/tgd/contract/signed-ids.d.ts.map +1 -0
- package/dist/tgd/contract/signed-ids.js +26 -0
- package/dist/tgd/contract/signed-ids.js.map +1 -0
- package/dist/tgd/contract/snapshots.d.ts +69 -0
- package/dist/tgd/contract/snapshots.d.ts.map +1 -0
- package/dist/tgd/contract/snapshots.js +2 -0
- package/dist/tgd/contract/snapshots.js.map +1 -0
- package/dist/tgd/contract/time.d.ts +9 -0
- package/dist/tgd/contract/time.d.ts.map +1 -0
- package/dist/tgd/contract/time.js +9 -0
- package/dist/tgd/contract/time.js.map +1 -0
- package/dist/tgd/contract/unions.d.ts +21 -0
- package/dist/tgd/contract/unions.d.ts.map +1 -0
- package/dist/tgd/contract/unions.js +17 -0
- package/dist/tgd/contract/unions.js.map +1 -0
- package/dist/tgd/contract/unit.d.ts +12 -0
- package/dist/tgd/contract/unit.d.ts.map +1 -0
- package/dist/tgd/contract/unit.js +18 -0
- package/dist/tgd/contract/unit.js.map +1 -0
- package/dist/tgd/contract/wire.d.ts +59 -0
- package/dist/tgd/contract/wire.d.ts.map +1 -0
- package/dist/tgd/contract/wire.js +2 -0
- package/dist/tgd/contract/wire.js.map +1 -0
- package/package.json +8 -1
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
import type { Source, IdKind, SessionOrigin, EventClass, SdkName, TrafficClass, BotCategory, UnitType } from './unions.js';
|
|
2
|
+
import type { EventName } from './registry.js';
|
|
3
|
+
export type JsonScalar = string | number | boolean | null;
|
|
4
|
+
/** props values: scalars, arrays of scalars, or one level of nested objects of scalars. Depth ≤ 3. */
|
|
5
|
+
export type JsonValue = JsonScalar | JsonScalar[] | {
|
|
6
|
+
[k: string]: JsonScalar | JsonScalar[] | {
|
|
7
|
+
[k: string]: JsonScalar;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
/** Browser ids and click ids read at send time (A33). Every key optional, every value a string ≤ 512 chars. */
|
|
11
|
+
export interface TgdBrowserIds {
|
|
12
|
+
fbp?: string;
|
|
13
|
+
fbc?: string;
|
|
14
|
+
fbclid?: string;
|
|
15
|
+
ttp?: string;
|
|
16
|
+
ttclid?: string;
|
|
17
|
+
scid?: string;
|
|
18
|
+
sccid?: string;
|
|
19
|
+
ga_client_id?: string;
|
|
20
|
+
gcl_aw?: string;
|
|
21
|
+
gclid?: string;
|
|
22
|
+
gbraid?: string;
|
|
23
|
+
wbraid?: string;
|
|
24
|
+
epik?: string;
|
|
25
|
+
rdt_uuid?: string;
|
|
26
|
+
rdt_cid?: string;
|
|
27
|
+
msclkid?: string;
|
|
28
|
+
li_fat_id?: string;
|
|
29
|
+
twclid?: string;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* One event. The same type is used on the wire (client -> collector), by emitFact (server facts)
|
|
33
|
+
* and in golden fixtures. Fields marked "server-set" are deleted by the collector from client input
|
|
34
|
+
* (SERVER_SET_FIELDS) and filled by the writer.
|
|
35
|
+
*/
|
|
36
|
+
export interface TgdEventV1 {
|
|
37
|
+
event_id: string;
|
|
38
|
+
event_name: EventName;
|
|
39
|
+
class?: EventClass;
|
|
40
|
+
custom_name?: string;
|
|
41
|
+
source: Source;
|
|
42
|
+
created_at: number;
|
|
43
|
+
store_id: string;
|
|
44
|
+
account_id?: string;
|
|
45
|
+
visitor_id?: string;
|
|
46
|
+
id_kind?: IdKind;
|
|
47
|
+
session_id: string;
|
|
48
|
+
session_origin?: SessionOrigin;
|
|
49
|
+
page_view_id?: string;
|
|
50
|
+
funnel_session_id?: string;
|
|
51
|
+
customer_id?: string;
|
|
52
|
+
external_id?: string;
|
|
53
|
+
funnel_id?: string;
|
|
54
|
+
step_id?: string;
|
|
55
|
+
step_type?: string;
|
|
56
|
+
url?: string;
|
|
57
|
+
title?: string;
|
|
58
|
+
referrer?: string;
|
|
59
|
+
screen_width?: number;
|
|
60
|
+
screen_height?: number;
|
|
61
|
+
language?: string;
|
|
62
|
+
checkout_session_id?: string;
|
|
63
|
+
order_id?: string;
|
|
64
|
+
payment_id?: string;
|
|
65
|
+
subscription_id?: string;
|
|
66
|
+
value_minor?: number;
|
|
67
|
+
currency?: string;
|
|
68
|
+
exp_id?: string;
|
|
69
|
+
exp_phase?: number;
|
|
70
|
+
arm?: string;
|
|
71
|
+
unit_type?: UnitType;
|
|
72
|
+
unit_id?: string;
|
|
73
|
+
exp_forced?: 0 | 1;
|
|
74
|
+
props?: Record<string, JsonValue>;
|
|
75
|
+
sdk_name?: SdkName;
|
|
76
|
+
sdk_version?: string;
|
|
77
|
+
sent_at?: number;
|
|
78
|
+
received_at?: number;
|
|
79
|
+
ts?: number;
|
|
80
|
+
is_late?: 0 | 1;
|
|
81
|
+
is_test?: 0 | 1;
|
|
82
|
+
hostname?: string;
|
|
83
|
+
path?: string;
|
|
84
|
+
referrer_domain?: string;
|
|
85
|
+
utm_source?: string;
|
|
86
|
+
utm_medium?: string;
|
|
87
|
+
utm_campaign?: string;
|
|
88
|
+
utm_content?: string;
|
|
89
|
+
utm_term?: string;
|
|
90
|
+
gad_source?: string;
|
|
91
|
+
click_ids?: Record<string, string>;
|
|
92
|
+
channel?: string;
|
|
93
|
+
user_agent?: string;
|
|
94
|
+
browser?: string;
|
|
95
|
+
browser_version?: string;
|
|
96
|
+
os?: string;
|
|
97
|
+
os_version?: string;
|
|
98
|
+
device?: 'desktop' | 'mobile' | 'tablet' | '';
|
|
99
|
+
in_app?: string;
|
|
100
|
+
country?: string;
|
|
101
|
+
region?: string;
|
|
102
|
+
city?: string;
|
|
103
|
+
ip_hash?: string;
|
|
104
|
+
traffic_class?: TrafficClass;
|
|
105
|
+
bot_category?: BotCategory;
|
|
106
|
+
batch_id?: string;
|
|
107
|
+
}
|
|
108
|
+
/** Keys the collector deletes from every client event before enrichment. */
|
|
109
|
+
export declare const SERVER_SET_FIELDS: readonly ["class", "account_id", "visitor_id", "id_kind", "session_origin", "customer_id", "step_type", "checkout_session_id", "order_id", "payment_id", "subscription_id", "value_minor", "currency", "unit_id", "exp_forced", "sdk_name", "sdk_version", "sent_at", "received_at", "ts", "is_late", "is_test", "hostname", "path", "referrer_domain", "utm_source", "utm_medium", "utm_campaign", "utm_content", "utm_term", "gad_source", "click_ids", "channel", "user_agent", "browser", "browser_version", "os", "os_version", "device", "in_app", "country", "region", "city", "ip_hash", "traffic_class", "bot_category", "batch_id"];
|
|
110
|
+
/** One batch on the wire. Immutable once built: a retry changes sent_at only. */
|
|
111
|
+
export interface TgdBatchV1 {
|
|
112
|
+
v: 1;
|
|
113
|
+
batch_id: string;
|
|
114
|
+
sent_at: number;
|
|
115
|
+
store_id: string;
|
|
116
|
+
sdk: {
|
|
117
|
+
name: 'tgd' | 'headless' | 'node' | 'loadgen';
|
|
118
|
+
version: string;
|
|
119
|
+
};
|
|
120
|
+
vid?: string;
|
|
121
|
+
cid?: string;
|
|
122
|
+
events: TgdEventV1[];
|
|
123
|
+
}
|
|
124
|
+
/** The insert row of av2_events. Every key is a column, in the column order of clickhouse-ddl.md §4.1 (70 keys). Built by toEventRow(). */
|
|
125
|
+
export interface Av2EventRow {
|
|
126
|
+
account_id: string;
|
|
127
|
+
store_id: string;
|
|
128
|
+
event_id: string;
|
|
129
|
+
batch_id: string;
|
|
130
|
+
event_name: string;
|
|
131
|
+
event_class: EventClass;
|
|
132
|
+
custom_name: string;
|
|
133
|
+
source: Source;
|
|
134
|
+
sdk_name: string;
|
|
135
|
+
sdk_version: string;
|
|
136
|
+
ts: string;
|
|
137
|
+
created_at: string;
|
|
138
|
+
sent_at: string;
|
|
139
|
+
received_at: string;
|
|
140
|
+
is_late: 0 | 1;
|
|
141
|
+
is_test: 0 | 1;
|
|
142
|
+
visitor_id: string;
|
|
143
|
+
id_kind: IdKind;
|
|
144
|
+
session_id: string;
|
|
145
|
+
session_origin: SessionOrigin;
|
|
146
|
+
page_view_id: string;
|
|
147
|
+
funnel_session_id: string;
|
|
148
|
+
customer_id: string;
|
|
149
|
+
external_id: string;
|
|
150
|
+
funnel_id: string;
|
|
151
|
+
step_id: string;
|
|
152
|
+
step_type: string;
|
|
153
|
+
url: string;
|
|
154
|
+
hostname: string;
|
|
155
|
+
path: string;
|
|
156
|
+
title: string;
|
|
157
|
+
referrer: string;
|
|
158
|
+
referrer_domain: string;
|
|
159
|
+
utm_source: string;
|
|
160
|
+
utm_medium: string;
|
|
161
|
+
utm_campaign: string;
|
|
162
|
+
utm_content: string;
|
|
163
|
+
utm_term: string;
|
|
164
|
+
gad_source: string;
|
|
165
|
+
click_ids: Record<string, string>;
|
|
166
|
+
channel: string;
|
|
167
|
+
user_agent: string;
|
|
168
|
+
browser: string;
|
|
169
|
+
browser_version: string;
|
|
170
|
+
os: string;
|
|
171
|
+
os_version: string;
|
|
172
|
+
device: string;
|
|
173
|
+
in_app: string;
|
|
174
|
+
screen_width: number;
|
|
175
|
+
screen_height: number;
|
|
176
|
+
language: string;
|
|
177
|
+
country: string;
|
|
178
|
+
region: string;
|
|
179
|
+
city: string;
|
|
180
|
+
ip_hash: string;
|
|
181
|
+
traffic_class: TrafficClass;
|
|
182
|
+
bot_category: BotCategory;
|
|
183
|
+
checkout_session_id: string;
|
|
184
|
+
order_id: string;
|
|
185
|
+
payment_id: string;
|
|
186
|
+
subscription_id: string;
|
|
187
|
+
value_minor: number;
|
|
188
|
+
currency: string;
|
|
189
|
+
exp_id: string;
|
|
190
|
+
exp_phase: number;
|
|
191
|
+
arm: string;
|
|
192
|
+
unit_type: UnitType | '';
|
|
193
|
+
unit_id: string;
|
|
194
|
+
exp_forced: 0 | 1;
|
|
195
|
+
props: string;
|
|
196
|
+
}
|
|
197
|
+
/** The 70 keys of Av2EventRow in declaration order (= the column order of clickhouse-ddl.md §4.1). toEventRow builds its object in this order. */
|
|
198
|
+
export declare const AV2_EVENT_ROW_KEYS: readonly ["account_id", "store_id", "event_id", "batch_id", "event_name", "event_class", "custom_name", "source", "sdk_name", "sdk_version", "ts", "created_at", "sent_at", "received_at", "is_late", "is_test", "visitor_id", "id_kind", "session_id", "session_origin", "page_view_id", "funnel_session_id", "customer_id", "external_id", "funnel_id", "step_id", "step_type", "url", "hostname", "path", "title", "referrer", "referrer_domain", "utm_source", "utm_medium", "utm_campaign", "utm_content", "utm_term", "gad_source", "click_ids", "channel", "user_agent", "browser", "browser_version", "os", "os_version", "device", "in_app", "screen_width", "screen_height", "language", "country", "region", "city", "ip_hash", "traffic_class", "bot_category", "checkout_session_id", "order_id", "payment_id", "subscription_id", "value_minor", "currency", "exp_id", "exp_phase", "arm", "unit_type", "unit_id", "exp_forced", "props"];
|
|
199
|
+
/** Pure mapping, no default guessing: absent optional -> '' / 0 / NIL_UUID / '{}' / {}. */
|
|
200
|
+
export declare function toEventRow(ev: Required<Pick<TgdEventV1, 'account_id' | 'class' | 'sdk_name' | 'sdk_version' | 'sent_at' | 'received_at' | 'ts' | 'is_late' | 'is_test' | 'visitor_id' | 'id_kind' | 'session_origin' | 'batch_id' | 'traffic_class' | 'bot_category'>> & TgdEventV1): Av2EventRow;
|
|
201
|
+
/** 'YYYY-MM-DD hh:mm:ss.SSS' UTC. Byte-identical to toClickHouseDateTime64 (src/lib/analytics-reports/scope.ts:14-16). */
|
|
202
|
+
export declare function toChDateTime64(ms: number): string;
|
|
203
|
+
//# sourceMappingURL=envelope.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"envelope.d.ts","sourceRoot":"","sources":["../../../src/tgd/contract/env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AAE,WAAW,CAAC;IACvD,mBAAmB,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAC;IAAC,eAAe,EAAE,MAAM,CAAC;IAC3F,WAAW,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IACtC,MAAM,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,QAAQ,GAAG,EAAE,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,CAAC,GAAG,CAAC,CAAC;IAC7G,KAAK,EAAE,MAAM,CAAC;CACf;AAED,kJAAkJ;AAClJ,eAAO,MAAM,kBAAkB,y5BAUoB,CAAC;AAEpD,2FAA2F;AAC3F,wBAAgB,UAAU,CAAC,EAAE,EAAE,QAAQ,CAAC,IAAI,CAAC,UAAU,EACrD,YAAY,GAAG,OAAO,GAAG,UAAU,GAAG,aAAa,GAAG,SAAS,GAAG,aAAa,GAAG,IAAI,GAAG,SAAS,GAClG,SAAS,GAAG,YAAY,GAAG,SAAS,GAAG,gBAAgB,GAAG,UAAU,GAAG,eAAe,GAAG,cAAc,CAAC,CAAC,GACzG,UAAU,GAAG,WAAW,CAyEzB;AAED,0HAA0H;AAC1H,wBAAgB,cAAc,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAEjD"}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { NIL_UUID } from './limits.js';
|
|
2
|
+
/** Keys the collector deletes from every client event before enrichment. */
|
|
3
|
+
export const SERVER_SET_FIELDS = [
|
|
4
|
+
'class', 'account_id', 'visitor_id', 'id_kind', 'session_origin', 'customer_id', 'step_type',
|
|
5
|
+
'checkout_session_id', 'order_id', 'payment_id', 'subscription_id', 'value_minor', 'currency',
|
|
6
|
+
'unit_id', 'exp_forced', 'sdk_name', 'sdk_version', 'sent_at', 'received_at', 'ts', 'is_late',
|
|
7
|
+
'is_test', 'hostname', 'path', 'referrer_domain', 'utm_source', 'utm_medium', 'utm_campaign',
|
|
8
|
+
'utm_content', 'utm_term', 'gad_source', 'click_ids', 'channel', 'user_agent', 'browser',
|
|
9
|
+
'browser_version', 'os', 'os_version', 'device', 'in_app', 'country', 'region', 'city', 'ip_hash',
|
|
10
|
+
'traffic_class', 'bot_category', 'batch_id',
|
|
11
|
+
];
|
|
12
|
+
/** The 70 keys of Av2EventRow in declaration order (= the column order of clickhouse-ddl.md §4.1). toEventRow builds its object in this order. */
|
|
13
|
+
export const AV2_EVENT_ROW_KEYS = [
|
|
14
|
+
'account_id', 'store_id', 'event_id', 'batch_id', 'event_name', 'event_class', 'custom_name', 'source',
|
|
15
|
+
'sdk_name', 'sdk_version', 'ts', 'created_at', 'sent_at', 'received_at', 'is_late', 'is_test',
|
|
16
|
+
'visitor_id', 'id_kind', 'session_id', 'session_origin', 'page_view_id', 'funnel_session_id', 'customer_id',
|
|
17
|
+
'external_id', 'funnel_id', 'step_id', 'step_type', 'url', 'hostname', 'path', 'title', 'referrer',
|
|
18
|
+
'referrer_domain', 'utm_source', 'utm_medium', 'utm_campaign', 'utm_content', 'utm_term', 'gad_source',
|
|
19
|
+
'click_ids', 'channel', 'user_agent', 'browser', 'browser_version', 'os', 'os_version', 'device', 'in_app',
|
|
20
|
+
'screen_width', 'screen_height', 'language', 'country', 'region', 'city', 'ip_hash', 'traffic_class',
|
|
21
|
+
'bot_category', 'checkout_session_id', 'order_id', 'payment_id', 'subscription_id', 'value_minor', 'currency',
|
|
22
|
+
'exp_id', 'exp_phase', 'arm', 'unit_type', 'unit_id', 'exp_forced', 'props',
|
|
23
|
+
];
|
|
24
|
+
/** Pure mapping, no default guessing: absent optional -> '' / 0 / NIL_UUID / '{}' / {}. */
|
|
25
|
+
export function toEventRow(ev) {
|
|
26
|
+
return {
|
|
27
|
+
account_id: ev.account_id,
|
|
28
|
+
store_id: ev.store_id,
|
|
29
|
+
event_id: ev.event_id,
|
|
30
|
+
batch_id: ev.batch_id,
|
|
31
|
+
event_name: ev.event_name,
|
|
32
|
+
event_class: ev.class,
|
|
33
|
+
custom_name: ev.custom_name ?? '',
|
|
34
|
+
source: ev.source,
|
|
35
|
+
sdk_name: ev.sdk_name,
|
|
36
|
+
sdk_version: ev.sdk_version,
|
|
37
|
+
ts: toChDateTime64(ev.ts),
|
|
38
|
+
created_at: toChDateTime64(ev.created_at),
|
|
39
|
+
sent_at: toChDateTime64(ev.sent_at),
|
|
40
|
+
received_at: toChDateTime64(ev.received_at),
|
|
41
|
+
is_late: ev.is_late,
|
|
42
|
+
is_test: ev.is_test,
|
|
43
|
+
visitor_id: ev.visitor_id,
|
|
44
|
+
id_kind: ev.id_kind,
|
|
45
|
+
session_id: ev.session_id ?? NIL_UUID,
|
|
46
|
+
session_origin: ev.session_origin,
|
|
47
|
+
page_view_id: ev.page_view_id ?? NIL_UUID,
|
|
48
|
+
funnel_session_id: ev.funnel_session_id ?? '',
|
|
49
|
+
customer_id: ev.customer_id ?? '',
|
|
50
|
+
external_id: ev.external_id ?? '',
|
|
51
|
+
funnel_id: ev.funnel_id ?? '',
|
|
52
|
+
step_id: ev.step_id ?? '',
|
|
53
|
+
step_type: ev.step_type ?? '',
|
|
54
|
+
url: ev.url ?? '',
|
|
55
|
+
hostname: ev.hostname ?? '',
|
|
56
|
+
path: ev.path ?? '',
|
|
57
|
+
title: ev.title ?? '',
|
|
58
|
+
referrer: ev.referrer ?? '',
|
|
59
|
+
referrer_domain: ev.referrer_domain ?? '$direct',
|
|
60
|
+
utm_source: ev.utm_source ?? '',
|
|
61
|
+
utm_medium: ev.utm_medium ?? '',
|
|
62
|
+
utm_campaign: ev.utm_campaign ?? '',
|
|
63
|
+
utm_content: ev.utm_content ?? '',
|
|
64
|
+
utm_term: ev.utm_term ?? '',
|
|
65
|
+
gad_source: ev.gad_source ?? '',
|
|
66
|
+
click_ids: ev.click_ids ?? {},
|
|
67
|
+
channel: ev.channel ?? '',
|
|
68
|
+
user_agent: ev.user_agent ?? '',
|
|
69
|
+
browser: ev.browser ?? '',
|
|
70
|
+
browser_version: ev.browser_version ?? '',
|
|
71
|
+
os: ev.os ?? '',
|
|
72
|
+
os_version: ev.os_version ?? '',
|
|
73
|
+
device: ev.device ?? '',
|
|
74
|
+
in_app: ev.in_app ?? '',
|
|
75
|
+
screen_width: ev.screen_width ?? 0,
|
|
76
|
+
screen_height: ev.screen_height ?? 0,
|
|
77
|
+
language: ev.language ?? '',
|
|
78
|
+
country: ev.country ?? '',
|
|
79
|
+
region: ev.region ?? '',
|
|
80
|
+
city: ev.city ?? '',
|
|
81
|
+
ip_hash: ev.ip_hash ?? '',
|
|
82
|
+
traffic_class: ev.traffic_class,
|
|
83
|
+
bot_category: ev.bot_category,
|
|
84
|
+
checkout_session_id: ev.checkout_session_id ?? '',
|
|
85
|
+
order_id: ev.order_id ?? '',
|
|
86
|
+
payment_id: ev.payment_id ?? '',
|
|
87
|
+
subscription_id: ev.subscription_id ?? '',
|
|
88
|
+
value_minor: ev.value_minor ?? 0,
|
|
89
|
+
currency: ev.currency ?? '',
|
|
90
|
+
exp_id: ev.exp_id ?? '',
|
|
91
|
+
exp_phase: ev.exp_phase ?? 0,
|
|
92
|
+
arm: ev.arm ?? '',
|
|
93
|
+
unit_type: ev.unit_type ?? '',
|
|
94
|
+
unit_id: ev.unit_id ?? '',
|
|
95
|
+
exp_forced: ev.exp_forced ?? 0,
|
|
96
|
+
props: JSON.stringify(ev.props ?? {}),
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
/** 'YYYY-MM-DD hh:mm:ss.SSS' UTC. Byte-identical to toClickHouseDateTime64 (src/lib/analytics-reports/scope.ts:14-16). */
|
|
100
|
+
export function toChDateTime64(ms) {
|
|
101
|
+
return new Date(ms).toISOString().slice(0, 23).replace('T', ' ');
|
|
102
|
+
}
|
|
103
|
+
//# sourceMappingURL=envelope.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"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IAAI,EAAE;QACzB,UAAU,EAAE,EAAE,CAAC,UAAU,IAAI,CAAC;QAC9B,KAAK,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC,KAAK,IAAI,EAAE,CAAC;KACtC,CAAC;AACJ,CAAC;AAED,0HAA0H;AAC1H,MAAM,UAAU,cAAc,CAAC,EAAU;IACvC,OAAO,IAAI,IAAI,CAAC,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;AACnE,CAAC"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import type { JsonValue } from './envelope.js';
|
|
2
|
+
export type AssignReason = 'assigned' | 'not_running' | 'shipped' | 'no_unit' | 'invalid_config' | 'targeting_miss' | 'namespace_miss' | 'holdout';
|
|
3
|
+
export type AssignResult = {
|
|
4
|
+
inExperiment: true;
|
|
5
|
+
arm: string;
|
|
6
|
+
armIndex: number;
|
|
7
|
+
reason: 'assigned';
|
|
8
|
+
} | {
|
|
9
|
+
inExperiment: false;
|
|
10
|
+
arm: string | null;
|
|
11
|
+
reason: Exclude<AssignReason, 'assigned'>;
|
|
12
|
+
};
|
|
13
|
+
export type TargetingAttribute = 'country' | 'device' | 'utm_source' | 'utm_medium' | 'utm_campaign' | 'utm_content' | 'utm_term' | 'url' | 'path' | 'property';
|
|
14
|
+
export type TargetingOperator = 'eq' | 'neq' | 'in' | 'nin' | 'contains' | 'regex';
|
|
15
|
+
export interface TargetingCondition {
|
|
16
|
+
attribute: TargetingAttribute;
|
|
17
|
+
property: string | null;
|
|
18
|
+
operator: TargetingOperator;
|
|
19
|
+
value: string | number | boolean | string[];
|
|
20
|
+
}
|
|
21
|
+
export interface TargetingAttributes {
|
|
22
|
+
country?: string;
|
|
23
|
+
device?: 'desktop' | 'mobile' | 'tablet';
|
|
24
|
+
utm_source?: string;
|
|
25
|
+
utm_medium?: string;
|
|
26
|
+
utm_campaign?: string;
|
|
27
|
+
utm_content?: string;
|
|
28
|
+
utm_term?: string;
|
|
29
|
+
url?: string;
|
|
30
|
+
path?: string;
|
|
31
|
+
custom?: Record<string, string | number | boolean>;
|
|
32
|
+
}
|
|
33
|
+
export type Goal = {
|
|
34
|
+
kind: 'paid_order';
|
|
35
|
+
} | {
|
|
36
|
+
kind: 'next_step_reached';
|
|
37
|
+
} | {
|
|
38
|
+
kind: 'step_reached';
|
|
39
|
+
stepId: string;
|
|
40
|
+
} | {
|
|
41
|
+
kind: 'revenue';
|
|
42
|
+
} | {
|
|
43
|
+
kind: 'upsell_accepted';
|
|
44
|
+
} | {
|
|
45
|
+
kind: 'event_count';
|
|
46
|
+
eventName: string;
|
|
47
|
+
measure: 'count' | 'conversion';
|
|
48
|
+
propertyFilter: {
|
|
49
|
+
property: string;
|
|
50
|
+
operator: 'is' | 'is_not' | 'contains' | 'not_contains';
|
|
51
|
+
value: string;
|
|
52
|
+
} | null;
|
|
53
|
+
} | {
|
|
54
|
+
kind: 'event_value_sum';
|
|
55
|
+
eventName: string;
|
|
56
|
+
property: string;
|
|
57
|
+
};
|
|
58
|
+
export type Guardrail = 'payment_failure_rate' | 'refund_rate' | 'dispute_rate' | 'bounce_rate' | 'complaint_rate' | 'unsubscribe_rate';
|
|
59
|
+
export type ExperimentKind = 'sdk' | 'split' | 'page_test' | 'email';
|
|
60
|
+
export type ExperimentStatus = 'draft' | 'running' | 'paused' | 'stopped' | 'shipped';
|
|
61
|
+
export interface ExperimentArm {
|
|
62
|
+
key: string;
|
|
63
|
+
label: string;
|
|
64
|
+
weightBp: number;
|
|
65
|
+
nodeId: string | null;
|
|
66
|
+
payload: JsonValue | null;
|
|
67
|
+
}
|
|
68
|
+
export interface AssignableExperiment {
|
|
69
|
+
id: string;
|
|
70
|
+
seed: string;
|
|
71
|
+
status: ExperimentStatus;
|
|
72
|
+
phase: number;
|
|
73
|
+
controlArm: string;
|
|
74
|
+
shippedArm: string | null;
|
|
75
|
+
arms: {
|
|
76
|
+
key: string;
|
|
77
|
+
weightBp: number;
|
|
78
|
+
}[];
|
|
79
|
+
holdoutBp: number;
|
|
80
|
+
targeting: TargetingCondition[];
|
|
81
|
+
namespace: {
|
|
82
|
+
name: string;
|
|
83
|
+
startBp: number;
|
|
84
|
+
endBp: number;
|
|
85
|
+
} | null;
|
|
86
|
+
}
|
|
87
|
+
//# sourceMappingURL=experiments.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"experiments.d.ts","sourceRoot":"","sources":["../../../src/tgd/contract/experiments.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC/C,MAAM,MAAM,YAAY,GACpB,UAAU,GAAG,aAAa,GAAG,SAAS,GAAG,SAAS,GAAG,gBAAgB,GACrE,gBAAgB,GAAG,gBAAgB,GAAG,SAAS,CAAC;AACpD,MAAM,MAAM,YAAY,GACpB;IAAE,YAAY,EAAE,IAAI,CAAC;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,UAAU,CAAA;CAAE,GAC1E;IAAE,YAAY,EAAE,KAAK,CAAC;IAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,MAAM,EAAE,OAAO,CAAC,YAAY,EAAE,UAAU,CAAC,CAAA;CAAE,CAAC;AAG3F,MAAM,MAAM,kBAAkB,GAC1B,SAAS,GAAG,QAAQ,GAAG,YAAY,GAAG,YAAY,GAAG,cAAc,GAAG,aAAa,GAAG,UAAU,GAChG,KAAK,GAAG,MAAM,GAAG,UAAU,CAAC;AAChC,MAAM,MAAM,iBAAiB,GAAG,IAAI,GAAG,KAAK,GAAG,IAAI,GAAG,KAAK,GAAG,UAAU,GAAG,OAAO,CAAC;AACnF,MAAM,WAAW,kBAAkB;IACjC,SAAS,EAAE,kBAAkB,CAAC;IAC9B,QAAQ,EAAE,MAAM,GAAG,IAAI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Q,EAAE,MAAM,CAAA;CAAE,CAAC;AACrE,MAAM,MAAM,SAAS,GAAG,sBAAsB,GAAG,aAAa,GAAG,cAAc,GAAG,aAAa,GAAG,gBAAgB,GAAG,kBAAkB,CAAC;AAExI,MAAM,MAAM,cAAc,GAAG,KAAK,GAAG,OAAO,GAAG,WAAW,GAAG,OAAO,CAAC;AACrE,MAAM,MAAM,gBAAgB,GAAG,OAAO,GAAG,SAAS,GAAG,QAAQ,GAAG,SAAS,GAAG,SAAS,CAAC;AACtF,MAAM,WAAW,aAAa;IAAG,GAAG,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,OAAO,EAAE,SAAS,GAAG,IAAI,CAAA;CAAE;AACjI,MAAM,WAAW,oBAAoB;IACpC,EAAE,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,gBAAgB,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IACjH,IAAI,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,kBAAkB,EAAE,CAAC;IAC9F,SAAS,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;CACnE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"experiments.js","sourceRoot":"","sources":["../../../src/tgd/contract/experiments.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export * from './unions.js';
|
|
2
|
+
export * from './limits.js';
|
|
3
|
+
export * from './envelope.js';
|
|
4
|
+
export * from './registry.js';
|
|
5
|
+
export * from './time.js';
|
|
6
|
+
export * from './dedup-keys.js';
|
|
7
|
+
export * from './signed-ids.js';
|
|
8
|
+
export * from './names.js';
|
|
9
|
+
export * from './destination-names.js';
|
|
10
|
+
export * from './is-test.js';
|
|
11
|
+
export * from './junk-ids.js';
|
|
12
|
+
export * from './unit.js';
|
|
13
|
+
export * from './experiments.js';
|
|
14
|
+
export * from './canvas.js';
|
|
15
|
+
export * from './snapshots.js';
|
|
16
|
+
export * from './wire.js';
|
|
17
|
+
export * from './browser-api.js';
|
|
18
|
+
export * from './destinations.js';
|
|
19
|
+
export * from './attribution.js';
|
|
20
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tgd/contract/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,wBAAwB,CAAC;AACvC,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,kBAAkB,CAAC;AACjC,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,WAAW,CAAC;AAC1B,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export * from './unions.js';
|
|
2
|
+
export * from './limits.js';
|
|
3
|
+
export * from './envelope.js';
|
|
4
|
+
export * from './registry.js';
|
|
5
|
+
export * from './time.js';
|
|
6
|
+
export * from './dedup-keys.js';
|
|
7
|
+
export * from './signed-ids.js';
|
|
8
|
+
export * from './names.js';
|
|
9
|
+
export * from './destination-names.js';
|
|
10
|
+
export * from './is-test.js';
|
|
11
|
+
export * from './junk-ids.js';
|
|
12
|
+
export * from './unit.js';
|
|
13
|
+
export * from './experiments.js';
|
|
14
|
+
export * from './canvas.js';
|
|
15
|
+
export * from './snapshots.js';
|
|
16
|
+
export * from './wire.js';
|
|
17
|
+
export * from './browser-api.js';
|
|
18
|
+
export * from './destinations.js';
|
|
19
|
+
export * from './attribution.js';
|
|
20
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/tgd/contract/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,wBAAwB,CAAC;AACvC,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,kBAAkB,CAAC;AACjC,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,WAAW,CAAC;AAC1B,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-test.d.ts","sourceRoot":"","sources":["../../../src/tgd/contract/is-test.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,iBAAiB,iCAAkC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-test.js","sourceRoot":"","sources":["../../../src/tgd/contract/is-test.ts"],"names":[],"mappings":"AAAA,4CAA4C;AAC5C,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,oBAAoB,CAAU,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const JUNK_IDS: readonly ["", "null", "undefined", "guest", "anonymous", "anon_placeholder"];
|
|
2
|
+
/** true for '', whitespace, and any JUNK_IDS value after trim + lowercase. */
|
|
3
|
+
export declare function isJunkId(v: string | null | undefined): boolean;
|
|
4
|
+
//# sourceMappingURL=junk-ids.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"junk-ids.d.ts","sourceRoot":"","sources":["../../../src/tgd/contract/junk-ids.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,QAAQ,8EAA+E,CAAC;AACrG,8EAA8E;AAC9E,wBAAgB,QAAQ,CAAC,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,OAAO,CAE9D"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
// packages/tgd-core/src/contract/junk-ids.ts (new — P1-L1 kernel)
|
|
2
|
+
export const JUNK_IDS = ['', 'null', 'undefined', 'guest', 'anonymous', 'anon_placeholder'];
|
|
3
|
+
/** true for '', whitespace, and any JUNK_IDS value after trim + lowercase. */
|
|
4
|
+
export function isJunkId(v) {
|
|
5
|
+
return v == null || JUNK_IDS.includes(v.trim().toLowerCase());
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=junk-ids.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"junk-ids.js","sourceRoot":"","sources":["../../../src/tgd/contract/junk-ids.ts"],"names":[],"mappings":"AAAA,mEAAmE;AACnE,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,EAAE,EAAE,MAAM,EAAE,WAAW,EAAE,OAAO,EAAE,WAAW,EAAE,kBAAkB,CAAU,CAAC;AACrG,8EAA8E;AAC9E,MAAM,UAAU,QAAQ,CAAC,CAA4B;IACnD,OAAO,CAAC,IAAI,IAAI,IAAI,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,WAAW,EAAW,CAAC,CAAC;AACzE,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export declare const CONTRACT_VERSION: 1;
|
|
2
|
+
export declare const COLLECT_PATH: "/api/public/v2/e";
|
|
3
|
+
export declare const MAX_BATCH_EVENTS = 50;
|
|
4
|
+
export declare const MAX_CLIENT_BATCH_BYTES: number;
|
|
5
|
+
export declare const MAX_SERVER_BODY_BYTES: number;
|
|
6
|
+
export declare const MAX_PROPS_BYTES = 8192;
|
|
7
|
+
export declare const MAX_PROPS_KEYS = 64;
|
|
8
|
+
export declare const MAX_PROP_KEY_CHARS = 64;
|
|
9
|
+
export declare const MAX_PROP_STRING_CHARS = 1024;
|
|
10
|
+
export declare const MAX_URL_CHARS = 2048;
|
|
11
|
+
export declare const MAX_TITLE_CHARS = 512;
|
|
12
|
+
export declare const MAX_CUSTOM_NAME_CHARS = 120;
|
|
13
|
+
export declare const MAX_EXTERNAL_ID_CHARS = 200;
|
|
14
|
+
export declare const MAX_ID_VALUE_CHARS = 512;
|
|
15
|
+
export declare const LATE_AFTER_MS: number;
|
|
16
|
+
export declare const SKEW_DEADBAND_MS = 5000;
|
|
17
|
+
export declare const FUTURE_ID_TOLERANCE_MS = 60000;
|
|
18
|
+
export declare const NIL_UUID = "00000000-0000-0000-0000-000000000000";
|
|
19
|
+
//# sourceMappingURL=limits.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"limits.d.ts","sourceRoot":"","sources":["../../../src/tgd/contract/limits.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,gBAAgB,EAAG,CAAU,CAAC;AAC3C,eAAO,MAAM,YAAY,EAAG,kBAA2B,CAAC;AACxD,eAAO,MAAM,gBAAgB,KAAK,CAAC;AACnC,eAAO,MAAM,sBAAsB,QAAY,CAAC;AAChD,eAAO,MAAM,qBAAqB,QAAY,CAAC;AAC/C,eAAO,MAAM,eAAe,OAAO,CAAC;AACpC,eAAO,MAAM,cAAc,KAAK,CAAC;AACjC,eAAO,MAAM,kBAAkB,KAAK,CAAC;AACrC,eAAO,MAAM,qBAAqB,OAAO,CAAC;AAC1C,eAAO,MAAM,aAAa,OAAO,CAAC;AAClC,eAAO,MAAM,eAAe,MAAM,CAAC;AACnC,eAAO,MAAM,qBAAqB,MAAM,CAAC;AACzC,eAAO,MAAM,qBAAqB,MAAM,CAAC;AACzC,eAAO,MAAM,kBAAkB,MAAM,CAAC;AACtC,eAAO,MAAM,aAAa,QAAmB,CAAC;AAC9C,eAAO,MAAM,gBAAgB,OAAO,CAAC;AACrC,eAAO,MAAM,sBAAsB,QAAS,CAAC;AAC7C,eAAO,MAAM,QAAQ,yCAAyC,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// packages/tgd-core/src/contract/limits.ts
|
|
2
|
+
export const CONTRACT_VERSION = 1;
|
|
3
|
+
export const COLLECT_PATH = '/api/public/v2/e';
|
|
4
|
+
export const MAX_BATCH_EVENTS = 50;
|
|
5
|
+
export const MAX_CLIENT_BATCH_BYTES = 48 * 1024; // tgd.js splits a batch before it reaches this size
|
|
6
|
+
export const MAX_SERVER_BODY_BYTES = 64 * 1024; // collector answers 413 above this, before JSON.parse
|
|
7
|
+
export const MAX_PROPS_BYTES = 8192; // JSON.stringify(props) in UTF-8 bytes
|
|
8
|
+
export const MAX_PROPS_KEYS = 64; // top-level keys
|
|
9
|
+
export const MAX_PROP_KEY_CHARS = 64;
|
|
10
|
+
export const MAX_PROP_STRING_CHARS = 1024;
|
|
11
|
+
export const MAX_URL_CHARS = 2048;
|
|
12
|
+
export const MAX_TITLE_CHARS = 512;
|
|
13
|
+
export const MAX_CUSTOM_NAME_CHARS = 120;
|
|
14
|
+
export const MAX_EXTERNAL_ID_CHARS = 200;
|
|
15
|
+
export const MAX_ID_VALUE_CHARS = 512; // each TgdBrowserIds value
|
|
16
|
+
export const LATE_AFTER_MS = 72 * 3600 * 1000;
|
|
17
|
+
export const SKEW_DEADBAND_MS = 5000;
|
|
18
|
+
export const FUTURE_ID_TOLERANCE_MS = 60000; // a UUIDv7 id may be at most 60 s in the future
|
|
19
|
+
export const NIL_UUID = '00000000-0000-0000-0000-000000000000';
|
|
20
|
+
//# sourceMappingURL=limits.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"limits.js","sourceRoot":"","sources":["../../../src/tgd/contract/limits.ts"],"names":[],"mappings":"AAAA,2CAA2C;AAC3C,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAU,CAAC;AAC3C,MAAM,CAAC,MAAM,YAAY,GAAG,kBAA2B,CAAC;AACxD,MAAM,CAAC,MAAM,gBAAgB,GAAG,EAAE,CAAC;AACnC,MAAM,CAAC,MAAM,sBAAsB,GAAG,EAAE,GAAG,IAAI,CAAC,CAAG,oDAAoD;AACvG,MAAM,CAAC,MAAM,qBAAqB,GAAG,EAAE,GAAG,IAAI,CAAC,CAAI,sDAAsD;AACzG,MAAM,CAAC,MAAM,eAAe,GAAG,IAAI,CAAC,CAAe,uCAAuC;AAC1F,MAAM,CAAC,MAAM,cAAc,GAAG,EAAE,CAAC,CAAkB,iBAAiB;AACpE,MAAM,CAAC,MAAM,kBAAkB,GAAG,EAAE,CAAC;AACrC,MAAM,CAAC,MAAM,qBAAqB,GAAG,IAAI,CAAC;AAC1C,MAAM,CAAC,MAAM,aAAa,GAAG,IAAI,CAAC;AAClC,MAAM,CAAC,MAAM,eAAe,GAAG,GAAG,CAAC;AACnC,MAAM,CAAC,MAAM,qBAAqB,GAAG,GAAG,CAAC;AACzC,MAAM,CAAC,MAAM,qBAAqB,GAAG,GAAG,CAAC;AACzC,MAAM,CAAC,MAAM,kBAAkB,GAAG,GAAG,CAAC,CAAa,2BAA2B;AAC9E,MAAM,CAAC,MAAM,aAAa,GAAG,EAAE,GAAG,IAAI,GAAG,IAAI,CAAC;AAC9C,MAAM,CAAC,MAAM,gBAAgB,GAAG,IAAI,CAAC;AACrC,MAAM,CAAC,MAAM,sBAAsB,GAAG,KAAM,CAAC,CAAM,gDAAgD;AACnG,MAAM,CAAC,MAAM,QAAQ,GAAG,sCAAsC,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare const COOKIE_VID = "tgd_vid";
|
|
2
|
+
export declare const COOKIE_VID_REFRESH = "tgd_vr";
|
|
3
|
+
export declare const COOKIE_SDK_BOOTSTRAP = "tgd_xb";
|
|
4
|
+
export declare const STORAGE_CID = "tgd_cid";
|
|
5
|
+
export declare const QUERY_ENTRY_TEST = "_tgx";
|
|
6
|
+
export declare const QUERY_VID_HANDOFF = "_tgv";
|
|
7
|
+
export declare const QUERY_DEBUG = "tgd_debug";
|
|
8
|
+
export declare const FUNNEL_SESSION_COOKIE = "tgd-funnel-session-id";
|
|
9
|
+
export declare const ptSnapshotKey: (funnelId: string, stepId: string) => string;
|
|
10
|
+
export declare const sdkSnapshotKey: (storeId: string) => string;
|
|
11
|
+
export declare const fsVidKey: (funnelSessionId: string) => string;
|
|
12
|
+
export declare const kvFsVid: (funnelSessionId: string) => string;
|
|
13
|
+
//# sourceMappingURL=names.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"names.d.ts","sourceRoot":"","sources":["../../../src/tgd/contract/names.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,UAAU,YAAY,CAAC;AACpC,eAAO,MAAM,kBAAkB,WAAW,CAAC;AAC3C,eAAO,MAAM,oBAAoB,WAAW,CAAC;AAC7C,eAAO,MAAM,WAAW,YAAY,CAAC;AACrC,eAAO,MAAM,gBAAgB,SAAS,CAAC;AACvC,eAAO,MAAM,iBAAiB,SAAS,CAAC;AACxC,eAAO,MAAM,WAAW,cAAc,CAAC;AACvC,eAAO,MAAM,qBAAqB,0BAA0B,CAAC;AAE7D,eAAO,MAAM,aAAa,GAAI,UAAU,MAAM,EAAE,QAAQ,MAAM,WAAuC,CAAC;AACtG,eAAO,MAAM,cAAc,GAAI,SAAS,MAAM,WAA6B,CAAC;AAC5E,eAAO,MAAM,QAAQ,GAAI,iBAAiB,MAAM,WAAmC,CAAC;AACpF,eAAO,MAAM,OAAO,oBADsB,MAAM,WACjB,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// packages/tgd-core/src/contract/names.ts
|
|
2
|
+
export const COOKIE_VID = 'tgd_vid'; // host-only, 400 days, set by the edge only (A9)
|
|
3
|
+
export const COOKIE_VID_REFRESH = 'tgd_vr'; // daily re-issue marker
|
|
4
|
+
export const COOKIE_SDK_BOOTSTRAP = 'tgd_xb'; // base64url(JSON) of XbCookieV1 (sdk-api.md §4.3, A17)
|
|
5
|
+
export const STORAGE_CID = 'tgd_cid'; // localStorage UUIDv7 on hosts Tagada does not serve
|
|
6
|
+
export const QUERY_ENTRY_TEST = '_tgx';
|
|
7
|
+
export const QUERY_VID_HANDOFF = '_tgv';
|
|
8
|
+
export const QUERY_DEBUG = 'tgd_debug';
|
|
9
|
+
export const FUNNEL_SESSION_COOKIE = 'tgd-funnel-session-id'; // plugin-sdk cookie, read-only
|
|
10
|
+
// (packages/plugin-sdk/src/v2/core/utils/sessionStorage.ts:6)
|
|
11
|
+
export const ptSnapshotKey = (funnelId, stepId) => `av2:exp:pt:${funnelId}:${stepId}`; // ab-engine.md §1.5
|
|
12
|
+
export const sdkSnapshotKey = (storeId) => `av2:exp:sdk:${storeId}`; // ab-engine.md §1.5, sdk-api.md
|
|
13
|
+
export const fsVidKey = (funnelSessionId) => `av2:fsvid:${funnelSessionId}`; // identity-sessions.md §10.3
|
|
14
|
+
export const kvFsVid = fsVidKey; // spelling of identity-sessions.md §1.1; code imports fsVidKey
|
|
15
|
+
//# sourceMappingURL=names.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"names.js","sourceRoot":"","sources":["../../../src/tgd/contract/names.ts"],"names":[],"mappings":"AAAA,0CAA0C;AAC1C,MAAM,CAAC,MAAM,UAAU,GAAG,SAAS,CAAC,CAAY,iDAAiD;AACjG,MAAM,CAAC,MAAM,kBAAkB,GAAG,QAAQ,CAAC,CAAK,wBAAwB;AACxE,MAAM,CAAC,MAAM,oBAAoB,GAAG,QAAQ,CAAC,CAAG,uDAAuD;AACvG,MAAM,CAAC,MAAM,WAAW,GAAG,SAAS,CAAC,CAAW,qDAAqD;AACrG,MAAM,CAAC,MAAM,gBAAgB,GAAG,MAAM,CAAC;AACvC,MAAM,CAAC,MAAM,iBAAiB,GAAG,MAAM,CAAC;AACxC,MAAM,CAAC,MAAM,WAAW,GAAG,WAAW,CAAC;AACvC,MAAM,CAAC,MAAM,qBAAqB,GAAG,uBAAuB,CAAC,CAAC,+BAA+B;AAC9B,8DAA8D;AAC7H,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,QAAgB,EAAE,MAAc,EAAE,EAAE,CAAC,cAAc,QAAQ,IAAI,MAAM,EAAE,CAAC,CAAC,oBAAoB;AAC3H,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,OAAe,EAAE,EAAE,CAAC,eAAe,OAAO,EAAE,CAAC,CAA8B,gCAAgC;AAC1I,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,eAAuB,EAAE,EAAE,CAAC,aAAa,eAAe,EAAE,CAAC,CAAqB,6BAA6B;AACtI,MAAM,CAAC,MAAM,OAAO,GAAG,QAAQ,CAAC,CAAC,+DAA+D"}
|