@xylabs/pixel 7.0.8 → 8.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1417
- package/dist/browser/index.d.ts +1 -14
- package/dist/browser/index.d.ts.map +1 -1
- package/dist/browser/index.mjs +2 -534
- package/dist/browser/index.mjs.map +3 -3
- package/dist/browser/model.d.ts +1 -8
- package/dist/browser/model.d.ts.map +1 -1
- package/dist/browser/model.mjs +2 -0
- package/dist/browser/model.mjs.map +3 -3
- package/package.json +10 -7
- package/dist/browser/Api/Api.d.ts +0 -13
- package/dist/browser/Api/Api.d.ts.map +0 -1
- package/dist/browser/Api/UserEvent.d.ts +0 -26
- package/dist/browser/Api/UserEvent.d.ts.map +0 -1
- package/dist/browser/Api/UserEventSystem.d.ts +0 -26
- package/dist/browser/Api/UserEventSystem.d.ts.map +0 -1
- package/dist/browser/Api/index.d.ts +0 -4
- package/dist/browser/Api/index.d.ts.map +0 -1
- package/dist/browser/CommonFields.d.ts +0 -6
- package/dist/browser/CommonFields.d.ts.map +0 -1
- package/dist/browser/ExIds.d.ts +0 -11
- package/dist/browser/ExIds.d.ts.map +0 -1
- package/dist/browser/FunnelStartedFields.d.ts +0 -6
- package/dist/browser/FunnelStartedFields.d.ts.map +0 -1
- package/dist/browser/Pixel.d.ts +0 -47
- package/dist/browser/Pixel.d.ts.map +0 -1
- package/dist/browser/PurchaseFields.d.ts +0 -9
- package/dist/browser/PurchaseFields.d.ts.map +0 -1
- package/dist/browser/Referrer.d.ts +0 -18
- package/dist/browser/Referrer.d.ts.map +0 -1
- package/dist/browser/TestStartedFields.d.ts +0 -6
- package/dist/browser/TestStartedFields.d.ts.map +0 -1
- package/dist/browser/UniqueUserId.d.ts +0 -10
- package/dist/browser/UniqueUserId.d.ts.map +0 -1
- package/dist/browser/UserClickFields.d.ts +0 -9
- package/dist/browser/UserClickFields.d.ts.map +0 -1
- package/dist/browser/UserEventHandler.d.ts +0 -18
- package/dist/browser/UserEventHandler.d.ts.map +0 -1
- package/dist/browser/UtmFields.d.ts +0 -19
- package/dist/browser/UtmFields.d.ts.map +0 -1
- package/dist/browser/ViewContentFields.d.ts +0 -7
- package/dist/browser/ViewContentFields.d.ts.map +0 -1
- package/dist/browser/XyLabsTrackingEventJson.d.ts +0 -22
- package/dist/browser/XyLabsTrackingEventJson.d.ts.map +0 -1
- package/dist/browser/XyUserEventHandler.d.ts +0 -22
- package/dist/browser/XyUserEventHandler.d.ts.map +0 -1
- package/dist/browser/getSystemInfo.d.ts +0 -8
- package/dist/browser/getSystemInfo.d.ts.map +0 -1
- package/dist/browser/md5Raw.d.ts +0 -3
- package/dist/browser/md5Raw.d.ts.map +0 -1
package/package.json
CHANGED
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xylabs/pixel",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "8.0.1",
|
|
4
|
+
"description": "DEPRECATED — use @ariestools/pixel. Backward-compatibility re-export shim.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"xylabs",
|
|
7
|
+
"deprecated",
|
|
8
|
+
"shim"
|
|
9
|
+
],
|
|
5
10
|
"homepage": "https://xylabs.com",
|
|
6
11
|
"bugs": {
|
|
7
12
|
"url": "git+https://github.com/xylabs/sdk-pixel-js/issues",
|
|
@@ -38,21 +43,18 @@
|
|
|
38
43
|
"README.md"
|
|
39
44
|
],
|
|
40
45
|
"dependencies": {
|
|
41
|
-
"@
|
|
46
|
+
"@ariestools/pixel": "~8.0.1"
|
|
42
47
|
},
|
|
43
48
|
"devDependencies": {
|
|
44
49
|
"@opentelemetry/api": "~1.9.1",
|
|
45
50
|
"@opentelemetry/sdk-trace-base": "~2.9.0",
|
|
46
51
|
"@xylabs/toolchain": "~8.6.2",
|
|
47
52
|
"@xylabs/tsconfig": "~8.6.2",
|
|
48
|
-
"@xylabs/tsconfig-dom": "~8.6.2",
|
|
49
53
|
"async-mutex": "~0.5.0",
|
|
50
54
|
"browserslist": "~4.28.4",
|
|
51
55
|
"eslint": "~10.6.0",
|
|
52
56
|
"eslint-import-resolver-typescript": "~4.4.5",
|
|
53
57
|
"typescript": "~6.0.3",
|
|
54
|
-
"vite": "~8.1.3",
|
|
55
|
-
"vitest": "~4.1.9",
|
|
56
58
|
"zod": "~4.4.3"
|
|
57
59
|
},
|
|
58
60
|
"peerDependencies": {
|
|
@@ -66,5 +68,6 @@
|
|
|
66
68
|
},
|
|
67
69
|
"publishConfig": {
|
|
68
70
|
"access": "public"
|
|
69
|
-
}
|
|
71
|
+
},
|
|
72
|
+
"deprecated": "Use @ariestools/pixel instead. @xylabs/pixel is a compatibility shim only and will not receive further updates."
|
|
70
73
|
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { UserEvent } from './UserEvent.ts';
|
|
2
|
-
/** HTTP client for sending tracking events to the XY Labs pixel API. */
|
|
3
|
-
export declare class PixelApi {
|
|
4
|
-
private endPoint;
|
|
5
|
-
constructor(baseUri?: string);
|
|
6
|
-
/**
|
|
7
|
-
* Sends an array of user events to the tracking API.
|
|
8
|
-
* @param events - The events to submit
|
|
9
|
-
* @returns The response data from the API
|
|
10
|
-
*/
|
|
11
|
-
trackEvents(events: UserEvent[]): Promise<unknown>;
|
|
12
|
-
}
|
|
13
|
-
//# sourceMappingURL=Api.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Api.d.ts","sourceRoot":"","sources":["../../../src/Api/Api.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAQ/C,wEAAwE;AACxE,qBAAa,QAAQ;IACnB,OAAO,CAAC,QAAQ,CAAQ;gBAGZ,OAAO,SAAS;IAI5B;;;;OAIG;IACG,WAAW,CAAC,MAAM,EAAE,SAAS,EAAE;CAItC"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import type { ExIds } from '../ExIds.ts';
|
|
2
|
-
import type { UserEventSystem } from './UserEventSystem.ts';
|
|
3
|
-
/** Represents a single user tracking event to be sent to the pixel API. */
|
|
4
|
-
export interface UserEvent {
|
|
5
|
-
cid: string;
|
|
6
|
-
create_time?: number;
|
|
7
|
-
email?: string;
|
|
8
|
-
email_hash?: string;
|
|
9
|
-
event?: string;
|
|
10
|
-
event_id?: string;
|
|
11
|
-
exids?: ExIds;
|
|
12
|
-
fields?: Record<string, unknown>;
|
|
13
|
-
host?: string;
|
|
14
|
-
pathname?: string;
|
|
15
|
-
pixel?: string;
|
|
16
|
-
receive_time?: number;
|
|
17
|
-
referrer?: {
|
|
18
|
-
local: string;
|
|
19
|
-
session: string;
|
|
20
|
-
};
|
|
21
|
-
rid?: string;
|
|
22
|
-
system?: UserEventSystem;
|
|
23
|
-
uid?: string;
|
|
24
|
-
utm?: Record<string, string>[] | Record<string, string[]>;
|
|
25
|
-
}
|
|
26
|
-
//# sourceMappingURL=UserEvent.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"UserEvent.d.ts","sourceRoot":"","sources":["../../../src/Api/UserEvent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AACxC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAE3D,2EAA2E;AAC3E,MAAM,WAAW,SAAS;IACxB,GAAG,EAAE,MAAM,CAAA;IACX,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,KAAK,CAAC,EAAE,KAAK,CAAA;IACb,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAChC,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAA;IAC7C,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,MAAM,CAAC,EAAE,eAAe,CAAA;IACxB,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAA;CAC1D"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
export interface UserEventSystemBrowser {
|
|
2
|
-
name?: string;
|
|
3
|
-
version?: string;
|
|
4
|
-
}
|
|
5
|
-
export interface UserEventSystemEngine {
|
|
6
|
-
name?: string;
|
|
7
|
-
version?: string;
|
|
8
|
-
}
|
|
9
|
-
export interface UserEventSystemOS {
|
|
10
|
-
name?: string;
|
|
11
|
-
version?: string;
|
|
12
|
-
versionName?: string;
|
|
13
|
-
}
|
|
14
|
-
export interface UserEventSystemPlatform {
|
|
15
|
-
model?: string;
|
|
16
|
-
type?: string;
|
|
17
|
-
vendor?: string;
|
|
18
|
-
}
|
|
19
|
-
/** Parsed browser/OS/engine information from the user agent string. */
|
|
20
|
-
export interface UserEventSystem {
|
|
21
|
-
browser?: UserEventSystemBrowser;
|
|
22
|
-
engine?: UserEventSystemEngine;
|
|
23
|
-
os?: UserEventSystemOS;
|
|
24
|
-
platform?: UserEventSystemPlatform;
|
|
25
|
-
}
|
|
26
|
-
//# sourceMappingURL=UserEventSystem.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"UserEventSystem.d.ts","sourceRoot":"","sources":["../../../src/Api/UserEventSystem.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,sBAAsB;IACrC,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AAED,MAAM,WAAW,qBAAqB;IACpC,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AAED,MAAM,WAAW,iBAAiB;IAChC,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB;AAED,MAAM,WAAW,uBAAuB;IACtC,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAED,uEAAuE;AACvE,MAAM,WAAW,eAAe;IAC9B,OAAO,CAAC,EAAE,sBAAsB,CAAA;IAChC,MAAM,CAAC,EAAE,qBAAqB,CAAA;IAC9B,EAAE,CAAC,EAAE,iBAAiB,CAAA;IACtB,QAAQ,CAAC,EAAE,uBAAuB,CAAA;CACnC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Api/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA;AACxB,cAAc,gBAAgB,CAAA;AAC9B,cAAc,sBAAsB,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CommonFields.d.ts","sourceRoot":"","sources":["../../src/CommonFields.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,MAAM,WAAW,YAAY;IAC3B,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB"}
|
package/dist/browser/ExIds.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/** External tracking identifiers from third-party cookies and sessions (Facebook, Google, TikTok, etc.). */
|
|
2
|
-
export interface ExIds {
|
|
3
|
-
fbc?: string;
|
|
4
|
-
fbp?: string;
|
|
5
|
-
ga?: string;
|
|
6
|
-
gclid?: string;
|
|
7
|
-
rdt_uid?: string;
|
|
8
|
-
scid?: string;
|
|
9
|
-
tt_sessionId?: string;
|
|
10
|
-
}
|
|
11
|
-
//# sourceMappingURL=ExIds.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ExIds.d.ts","sourceRoot":"","sources":["../../src/ExIds.ts"],"names":[],"mappings":"AAAA,4GAA4G;AAC5G,MAAM,WAAW,KAAK;IACpB,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FunnelStartedFields.d.ts","sourceRoot":"","sources":["../../src/FunnelStartedFields.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAErD,kDAAkD;AAClD,MAAM,WAAW,mBAAoB,SAAQ,YAAY;IACvD,IAAI,EAAE,MAAM,CAAA;CACb"}
|
package/dist/browser/Pixel.d.ts
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import type { JsonObject } from '@xylabs/sdk/object';
|
|
2
|
-
import type { UserEvent } from './Api/index.ts';
|
|
3
|
-
import { PixelApi } from './Api/index.ts';
|
|
4
|
-
import type { ExIds } from './ExIds.ts';
|
|
5
|
-
/** Singleton pixel tracker that queues and sends user events to the XY Labs tracking API. */
|
|
6
|
-
export declare class XyPixel {
|
|
7
|
-
static api: PixelApi;
|
|
8
|
-
private static _instance?;
|
|
9
|
-
private static utmFieldsObj;
|
|
10
|
-
cid: string;
|
|
11
|
-
email?: string;
|
|
12
|
-
email_hash?: string | null;
|
|
13
|
-
exids?: ExIds;
|
|
14
|
-
pixelId?: string;
|
|
15
|
-
queue: UserEvent[];
|
|
16
|
-
private queueMutex;
|
|
17
|
-
private constructor();
|
|
18
|
-
/** Returns the singleton XyPixel instance, throwing if not yet initialized. */
|
|
19
|
-
static get instance(): XyPixel;
|
|
20
|
-
/**
|
|
21
|
-
* Initializes the XyPixel singleton with the given pixel ID.
|
|
22
|
-
* @param pixelId - The pixel identifier for this tracking instance
|
|
23
|
-
* @returns The newly created XyPixel instance
|
|
24
|
-
*/
|
|
25
|
-
static init(pixelId: string): XyPixel;
|
|
26
|
-
/**
|
|
27
|
-
* Replaces the default PixelApi instance used for sending events.
|
|
28
|
-
* @param API - The PixelApi instance to use
|
|
29
|
-
*/
|
|
30
|
-
static selectApi(api: PixelApi): void;
|
|
31
|
-
private static utmFields;
|
|
32
|
-
/**
|
|
33
|
-
* Associates an email address with this pixel instance, hashing it for privacy.
|
|
34
|
-
* @param email - The email address to identify the user with
|
|
35
|
-
*/
|
|
36
|
-
identify(email?: string): void;
|
|
37
|
-
/**
|
|
38
|
-
* Queues a tracking event and attempts to flush the queue to the API.
|
|
39
|
-
* @param event - The event name
|
|
40
|
-
* @param fields - Optional event-specific fields
|
|
41
|
-
* @param eventId - Optional unique event identifier
|
|
42
|
-
*/
|
|
43
|
-
send<T extends JsonObject>(event: string, fields?: T, eventId?: string): Promise<void>;
|
|
44
|
-
private tryFlushQueue;
|
|
45
|
-
private updateFbId;
|
|
46
|
-
}
|
|
47
|
-
//# sourceMappingURL=Pixel.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Pixel.d.ts","sourceRoot":"","sources":["../../src/Pixel.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAGpD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACzC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAwBvC,6FAA6F;AAC7F,qBAAa,OAAO;IAClB,MAAM,CAAC,GAAG,WAAiB;IAE3B,OAAO,CAAC,MAAM,CAAC,SAAS,CAAC,CAAS;IAClC,OAAO,CAAC,MAAM,CAAC,YAAY,CAAW;IAEtC,GAAG,EAAE,MAAM,CAAA;IACX,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC1B,KAAK,CAAC,EAAE,KAAK,CAAA;IACb,OAAO,CAAC,EAAE,MAAM,CAAA;IAEhB,KAAK,EAAE,SAAS,EAAE,CAAK;IAEvB,OAAO,CAAC,UAAU,CAAc;IAEhC,OAAO;IAOP,+EAA+E;IAC/E,MAAM,KAAK,QAAQ,IAAI,OAAO,CAE7B;IAED;;;;OAIG;IACH,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM;IAK3B;;;OAGG;IACH,MAAM,CAAC,SAAS,CAAC,GAAG,EAAE,QAAQ;IAI9B,OAAO,CAAC,MAAM,CAAC,SAAS,CAGvB;IAED;;;OAGG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM;IAQvB;;;;;OAKG;IACG,IAAI,CAAC,CAAC,SAAS,UAAU,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC,EAAE,OAAO,CAAC,EAAE,MAAM;YAsB9D,aAAa;IAqB3B,OAAO,CAAC,UAAU;CAWnB"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { CommonFields } from './CommonFields.ts';
|
|
2
|
-
/** Fields for a purchase tracking event. */
|
|
3
|
-
export interface PurchaseFields extends CommonFields {
|
|
4
|
-
id: string;
|
|
5
|
-
name?: string;
|
|
6
|
-
price?: number;
|
|
7
|
-
value?: number;
|
|
8
|
-
}
|
|
9
|
-
//# sourceMappingURL=PurchaseFields.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PurchaseFields.d.ts","sourceRoot":"","sources":["../../src/PurchaseFields.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAErD,4CAA4C;AAC5C,MAAM,WAAW,cAAe,SAAQ,YAAY;IAClD,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,KAAK,CAAC,EAAE,MAAM,CAAA;CACf"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/** Tracks and persists the document referrer in both session and local storage. */
|
|
2
|
-
export declare class Referrer {
|
|
3
|
-
private static storageId;
|
|
4
|
-
local: string;
|
|
5
|
-
session: string;
|
|
6
|
-
constructor();
|
|
7
|
-
/**
|
|
8
|
-
* Returns the referrer data as a JSON object, or undefined if both values are empty.
|
|
9
|
-
* @returns An object with local and session referrer strings, or undefined
|
|
10
|
-
*/
|
|
11
|
-
toJson(): {
|
|
12
|
-
local: string;
|
|
13
|
-
session: string;
|
|
14
|
-
} | undefined;
|
|
15
|
-
private getFromLocal;
|
|
16
|
-
private getFromSession;
|
|
17
|
-
}
|
|
18
|
-
//# sourceMappingURL=Referrer.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Referrer.d.ts","sourceRoot":"","sources":["../../src/Referrer.ts"],"names":[],"mappings":"AAAA,mFAAmF;AACnF,qBAAa,QAAQ;IACnB,OAAO,CAAC,MAAM,CAAC,SAAS,CAAmB;IAC3C,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,EAAE,MAAM,CAAA;;IAQf;;;OAGG;IACH,MAAM;;;;IASN,OAAO,CAAC,YAAY;IAOpB,OAAO,CAAC,cAAc;CAMvB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TestStartedFields.d.ts","sourceRoot":"","sources":["../../src/TestStartedFields.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAErD,gEAAgE;AAChE,MAAM,WAAW,iBAAkB,SAAQ,YAAY;IACrD,IAAI,EAAE,MAAM,CAAA;CACb"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/** Generates and persists a unique user identifier in localStorage. */
|
|
2
|
-
export declare class UniqueUserId {
|
|
3
|
-
private static localStorageId;
|
|
4
|
-
id: string;
|
|
5
|
-
constructor();
|
|
6
|
-
/** Returns the unique user ID as a string. */
|
|
7
|
-
toString(): string;
|
|
8
|
-
private generateId;
|
|
9
|
-
}
|
|
10
|
-
//# sourceMappingURL=UniqueUserId.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"UniqueUserId.d.ts","sourceRoot":"","sources":["../../src/UniqueUserId.ts"],"names":[],"mappings":"AAAA,uEAAuE;AACvE,qBAAa,YAAY;IACvB,OAAO,CAAC,MAAM,CAAC,cAAc,CAAc;IAC3C,EAAE,EAAE,MAAM,CAAA;;IAOV,8CAA8C;IAC9C,QAAQ;IAIR,OAAO,CAAC,UAAU;CAGnB"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { CommonFields } from './CommonFields.ts';
|
|
2
|
-
/** Fields for a user click tracking event. */
|
|
3
|
-
export interface UserClickFields extends CommonFields {
|
|
4
|
-
elementName: string;
|
|
5
|
-
elementType: string;
|
|
6
|
-
intent?: string;
|
|
7
|
-
placement?: string;
|
|
8
|
-
}
|
|
9
|
-
//# sourceMappingURL=UserClickFields.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"UserClickFields.d.ts","sourceRoot":"","sources":["../../src/UserClickFields.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAErD,8CAA8C;AAC9C,MAAM,WAAW,eAAgB,SAAQ,YAAY;IACnD,WAAW,EAAE,MAAM,CAAA;IACnB,WAAW,EAAE,MAAM,CAAA;IACnB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type { EmptyObject } from '@xylabs/sdk/object';
|
|
2
|
-
import type { Promisable } from '@xylabs/sdk/promise';
|
|
3
|
-
import type { FunnelStartedFields } from './FunnelStartedFields.ts';
|
|
4
|
-
import type { TestStartedFields } from './TestStartedFields.ts';
|
|
5
|
-
import type { UserClickFields } from './UserClickFields.ts';
|
|
6
|
-
import type { ViewContentFields } from './ViewContentFields.ts';
|
|
7
|
-
/** Abstract base class for handling user tracking events. */
|
|
8
|
-
export declare abstract class UserEventHandler<TData extends EmptyObject> {
|
|
9
|
-
/** Tracks a funnel-started event. */
|
|
10
|
-
abstract funnelStarted<T extends TData>(fields: T | FunnelStartedFields): Promisable<void>;
|
|
11
|
-
/** Tracks a test-started event. */
|
|
12
|
-
abstract testStarted<T extends TData>(fields: T | TestStartedFields): Promisable<void>;
|
|
13
|
-
/** Tracks a user click event. */
|
|
14
|
-
abstract userClick<T extends TData>(fields: T | UserClickFields): Promisable<void>;
|
|
15
|
-
/** Tracks a view-content event. */
|
|
16
|
-
abstract viewContent<T extends TData>(fields: T | ViewContentFields): Promisable<void>;
|
|
17
|
-
}
|
|
18
|
-
//# sourceMappingURL=UserEventHandler.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"UserEventHandler.d.ts","sourceRoot":"","sources":["../../src/UserEventHandler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AACrD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA;AAErD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AACnE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAA;AAC/D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAC3D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAA;AAE/D,6DAA6D;AAC7D,8BAAsB,gBAAgB,CAAC,KAAK,SAAS,WAAW;IAC9D,qCAAqC;IACrC,QAAQ,CAAC,aAAa,CAAC,CAAC,SAAS,KAAK,EAAE,MAAM,EAAE,CAAC,GAAG,mBAAmB,GAAG,UAAU,CAAC,IAAI,CAAC;IAC1F,mCAAmC;IACnC,QAAQ,CAAC,WAAW,CAAC,CAAC,SAAS,KAAK,EAAE,MAAM,EAAE,CAAC,GAAG,iBAAiB,GAAG,UAAU,CAAC,IAAI,CAAC;IACtF,iCAAiC;IACjC,QAAQ,CAAC,SAAS,CAAC,CAAC,SAAS,KAAK,EAAE,MAAM,EAAE,CAAC,GAAG,eAAe,GAAG,UAAU,CAAC,IAAI,CAAC;IAClF,mCAAmC;IACnC,QAAQ,CAAC,WAAW,CAAC,CAAC,SAAS,KAAK,EAAE,MAAM,EAAE,CAAC,GAAG,iBAAiB,GAAG,UAAU,CAAC,IAAI,CAAC;CACvF"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/** Tracks UTM campaign parameters from query strings, persisting history in localStorage. */
|
|
2
|
-
export declare class UtmFields {
|
|
3
|
-
private static localStorageId;
|
|
4
|
-
fields: Record<string, string>[];
|
|
5
|
-
constructor();
|
|
6
|
-
/**
|
|
7
|
-
* Parses UTM parameters from the current URL query string.
|
|
8
|
-
* @returns A record of UTM key-value pairs, or null if none are present
|
|
9
|
-
*/
|
|
10
|
-
getUtmRecord: () => Record<string, string> | null;
|
|
11
|
-
/** Returns the UTM fields history as a JSON string. */
|
|
12
|
-
toString(): string;
|
|
13
|
-
/**
|
|
14
|
-
* Checks the query string for new UTM values and appends them to the history if changed.
|
|
15
|
-
* @returns The current UTM fields array, or undefined if empty
|
|
16
|
-
*/
|
|
17
|
-
update(): Record<string, string>[];
|
|
18
|
-
}
|
|
19
|
-
//# sourceMappingURL=UtmFields.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"UtmFields.d.ts","sourceRoot":"","sources":["../../src/UtmFields.ts"],"names":[],"mappings":"AAaA,6FAA6F;AAC7F,qBAAa,SAAS;IACpB,OAAO,CAAC,MAAM,CAAC,cAAc,CAAc;IAC3C,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,CAAK;;IAarC;;;OAGG;IACH,YAAY,sCAWX;IAED,uDAAuD;IACvD,QAAQ;IAIR;;;OAGG;IAEH,MAAM;CAOP"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ViewContentFields.d.ts","sourceRoot":"","sources":["../../src/ViewContentFields.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAErD,gDAAgD;AAChD,MAAM,WAAW,iBAAkB,SAAQ,YAAY;IACrD,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;CACb"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/** JSON structure for an XY Labs tracking event as stored or transmitted. */
|
|
2
|
-
export interface XyLabsTrackingEventJson {
|
|
3
|
-
cid: string;
|
|
4
|
-
create_time?: number;
|
|
5
|
-
email?: string;
|
|
6
|
-
email_hash?: string;
|
|
7
|
-
event?: string;
|
|
8
|
-
event_id?: string;
|
|
9
|
-
exids?: Record<string, string>;
|
|
10
|
-
fields?: Record<string, unknown>;
|
|
11
|
-
host?: string;
|
|
12
|
-
ip?: string;
|
|
13
|
-
pathname?: string;
|
|
14
|
-
pixel?: string;
|
|
15
|
-
receive_time?: number;
|
|
16
|
-
rid?: string;
|
|
17
|
-
system?: unknown;
|
|
18
|
-
ua?: string;
|
|
19
|
-
uid?: string;
|
|
20
|
-
utm?: Record<string, string>[] | Record<string, string[]>;
|
|
21
|
-
}
|
|
22
|
-
//# sourceMappingURL=XyLabsTrackingEventJson.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"XyLabsTrackingEventJson.d.ts","sourceRoot":"","sources":["../../src/XyLabsTrackingEventJson.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAC7E,MAAM,WAAW,uBAAuB;IACtC,GAAG,EAAE,MAAM,CAAA;IACX,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC9B,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAChC,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAA;CAC1D"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { type EmptyObject } from '@xylabs/sdk/object';
|
|
2
|
-
import type { FunnelStartedFields } from './FunnelStartedFields.ts';
|
|
3
|
-
import type { PurchaseFields } from './PurchaseFields.ts';
|
|
4
|
-
import type { TestStartedFields } from './TestStartedFields.ts';
|
|
5
|
-
import type { UserClickFields } from './UserClickFields.ts';
|
|
6
|
-
import { UserEventHandler } from './UserEventHandler.ts';
|
|
7
|
-
import type { ViewContentFields } from './ViewContentFields.ts';
|
|
8
|
-
/** Concrete event handler that sends tracking events through the XyPixel singleton. */
|
|
9
|
-
export declare class XyUserEventHandler<T extends EmptyObject = EmptyObject> extends UserEventHandler<T> {
|
|
10
|
-
constructor();
|
|
11
|
-
/** Sends a funnel-started event via the pixel API. */
|
|
12
|
-
funnelStarted(fields: T | FunnelStartedFields): Promise<void>;
|
|
13
|
-
/** Sends a purchase event via the pixel API. */
|
|
14
|
-
purchase(fields: T | PurchaseFields): Promise<void>;
|
|
15
|
-
/** Sends a test-started event via the pixel API. */
|
|
16
|
-
testStarted(fields: T | TestStartedFields): Promise<void>;
|
|
17
|
-
/** Sends a user click event via the pixel API. */
|
|
18
|
-
userClick(fields: T | UserClickFields): Promise<void>;
|
|
19
|
-
/** Sends a view-content event via the pixel API. */
|
|
20
|
-
viewContent(fields: T | ViewContentFields): Promise<void>;
|
|
21
|
-
}
|
|
22
|
-
//# sourceMappingURL=XyUserEventHandler.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"XyUserEventHandler.d.ts","sourceRoot":"","sources":["../../src/XyUserEventHandler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,WAAW,EAAoB,MAAM,oBAAoB,CAAA;AAEvE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AAEnE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AACzD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAA;AAC/D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AACxD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAA;AAE/D,uFAAuF;AACvF,qBAAa,kBAAkB,CAAC,CAAC,SAAS,WAAW,GAAG,WAAW,CAAE,SAAQ,gBAAgB,CAAC,CAAC,CAAC;;IAK9F,sDAAsD;IAChD,aAAa,CAAC,MAAM,EAAE,CAAC,GAAG,mBAAmB;IAInD,gDAAgD;IAC1C,QAAQ,CAAC,MAAM,EAAE,CAAC,GAAG,cAAc;IAIzC,oDAAoD;IAC9C,WAAW,CAAC,MAAM,EAAE,CAAC,GAAG,iBAAiB;IAI/C,kDAAkD;IAC5C,SAAS,CAAC,MAAM,EAAE,CAAC,GAAG,eAAe;IAI3C,oDAAoD;IAC9C,WAAW,CAAC,MAAM,EAAE,CAAC,GAAG,iBAAiB;CAGhD"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { UserEventSystem } from './Api/index.ts';
|
|
2
|
-
/**
|
|
3
|
-
* Returns parsed browser, OS, and engine information from the user agent string.
|
|
4
|
-
* Results are cached after the first call.
|
|
5
|
-
* @returns The parsed system info, or undefined if parsing fails
|
|
6
|
-
*/
|
|
7
|
-
export declare const getSystemInfo: () => UserEventSystem | undefined;
|
|
8
|
-
//# sourceMappingURL=getSystemInfo.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getSystemInfo.d.ts","sourceRoot":"","sources":["../../src/getSystemInfo.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AA8GrD;;;;GAIG;AACH,eAAO,MAAM,aAAa,mCAOzB,CAAA"}
|
package/dist/browser/md5Raw.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"md5Raw.d.ts","sourceRoot":"","sources":["../../src/md5Raw.ts"],"names":[],"mappings":"AAsJA,qEAAqE;AACrE,eAAO,MAAM,MAAM,GAAI,OAAO,MAAM,WAOnC,CAAA"}
|