@xylabs/pixel 4.13.15 → 4.13.17

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.
Files changed (45) hide show
  1. package/README.md +31 -44
  2. package/dist/browser/index.d.ts +15 -168
  3. package/dist/browser/spec/Pixel.spec.d.ts +5 -0
  4. package/dist/browser/spec/Pixel.spec.d.ts.map +1 -0
  5. package/package.json +8 -8
  6. package/build/browser/index.d.ts +0 -15
  7. /package/{build → dist}/browser/Api/Api.d.ts +0 -0
  8. /package/{build → dist}/browser/Api/Api.d.ts.map +0 -0
  9. /package/{build → dist}/browser/Api/UserEvent.d.ts +0 -0
  10. /package/{build → dist}/browser/Api/UserEvent.d.ts.map +0 -0
  11. /package/{build → dist}/browser/Api/UserEventSystem.d.ts +0 -0
  12. /package/{build → dist}/browser/Api/UserEventSystem.d.ts.map +0 -0
  13. /package/{build → dist}/browser/Api/index.d.ts +0 -0
  14. /package/{build → dist}/browser/Api/index.d.ts.map +0 -0
  15. /package/{build → dist}/browser/CommonFields.d.ts +0 -0
  16. /package/{build → dist}/browser/CommonFields.d.ts.map +0 -0
  17. /package/{build → dist}/browser/ExIds.d.ts +0 -0
  18. /package/{build → dist}/browser/ExIds.d.ts.map +0 -0
  19. /package/{build → dist}/browser/FunnelStartedFields.d.ts +0 -0
  20. /package/{build → dist}/browser/FunnelStartedFields.d.ts.map +0 -0
  21. /package/{build → dist}/browser/Pixel.d.ts +0 -0
  22. /package/{build → dist}/browser/Pixel.d.ts.map +0 -0
  23. /package/{build → dist}/browser/PurchaseFields.d.ts +0 -0
  24. /package/{build → dist}/browser/PurchaseFields.d.ts.map +0 -0
  25. /package/{build → dist}/browser/Referrer.d.ts +0 -0
  26. /package/{build → dist}/browser/Referrer.d.ts.map +0 -0
  27. /package/{build → dist}/browser/TestStartedFields.d.ts +0 -0
  28. /package/{build → dist}/browser/TestStartedFields.d.ts.map +0 -0
  29. /package/{build → dist}/browser/UniqueUserId.d.ts +0 -0
  30. /package/{build → dist}/browser/UniqueUserId.d.ts.map +0 -0
  31. /package/{build → dist}/browser/UserClickFields.d.ts +0 -0
  32. /package/{build → dist}/browser/UserClickFields.d.ts.map +0 -0
  33. /package/{build → dist}/browser/UserEventHandler.d.ts +0 -0
  34. /package/{build → dist}/browser/UserEventHandler.d.ts.map +0 -0
  35. /package/{build → dist}/browser/UtmFields.d.ts +0 -0
  36. /package/{build → dist}/browser/UtmFields.d.ts.map +0 -0
  37. /package/{build → dist}/browser/ViewContentFields.d.ts +0 -0
  38. /package/{build → dist}/browser/ViewContentFields.d.ts.map +0 -0
  39. /package/{build → dist}/browser/XyLabsTrackingEventJson.d.ts +0 -0
  40. /package/{build → dist}/browser/XyLabsTrackingEventJson.d.ts.map +0 -0
  41. /package/{build → dist}/browser/XyUserEventHandler.d.ts +0 -0
  42. /package/{build → dist}/browser/XyUserEventHandler.d.ts.map +0 -0
  43. /package/{build → dist}/browser/getSystemInfo.d.ts +0 -0
  44. /package/{build → dist}/browser/getSystemInfo.d.ts.map +0 -0
  45. /package/{build → dist}/browser/index.d.ts.map +0 -0
package/README.md CHANGED
@@ -1,73 +1,60 @@
1
- [![logo][]](https://xylabs.com)
1
+ # @xylabs/pixel
2
2
 
3
- # sdk-pixel-js
3
+ [![logo][]](https://xylabs.com)
4
4
 
5
5
  [![main-build][]][main-build-link]
6
6
  [![npm-badge][]][npm-link]
7
+ [![npm-downloads-badge][]][npm-link]
8
+ [![jsdelivr-badge][]][jsdelivr-link]
9
+ [![npm-license-badge][]](LICENSE)
7
10
  [![codacy-badge][]][codacy-link]
8
11
  [![codeclimate-badge][]][codeclimate-link]
9
12
  [![snyk-badge][]][snyk-link]
13
+ [![socket-badge][]][socket-link]
10
14
 
11
- > This library is made public by XY Labs
12
-
13
- ## Table of Contents
14
-
15
- - [Title](#sdk-pixel-js)
16
- - [Description](#description)
17
- - [Install](#install)
18
- - [Scripts](#scripts)
19
- - [Maintainers](#maintainers)
20
- - [License](#license)
21
- - [Credits](#credits)
22
-
23
- ## Description
15
+ Version: 4.13.15
24
16
 
25
- SDK for User Event Reporting
17
+ Event Client for xylabs ESB
26
18
 
27
- ## Install
19
+ ## Documentation
28
20
 
29
- Using npm:
21
+ Coming Soon!
30
22
 
31
- ```sh
32
- npm i --save @xylabs/sdk-js
33
- ```
34
-
35
- Using yarn:
36
-
37
- ```sh
38
- yarn add @xylabs/sdk-js
39
- ```
40
-
41
- ## Scripts
42
-
43
- See [ts-scripts](https://github.com/xylabs/ts-scripts/blob/main/README.md) for
44
- list of shared scripts.
23
+ Part of [sdk-js](https://www.npmjs.com/package/@xyo-network/sdk-js)
45
24
 
46
25
  ## Maintainers
47
26
 
48
- - [Arie Trouw](https://github.com/arietrouw) (<https://arietrouw.com>)
27
+ - [Arie Trouw](https://github.com/arietrouw) ([arietrouw.com](https://arietrouw.com))
28
+ - [Matt Jones](https://github.com/jonesmac)
29
+ - [Joel Carter](https://github.com/JoelBCarter)
30
+ - [Jordan Trouw](https://github.com/jordantrouw)
49
31
 
50
32
  ## License
51
33
 
52
- See the [LICENSE](LICENSE) file for license details
34
+ > See the [LICENSE](LICENSE) file for license details
53
35
 
54
36
  ## Credits
55
37
 
56
- Made with 🔥and ❄️ by [XY Labs](https://xylabs.com)
38
+ [Made with 🔥 and ❄️ by XYLabs](https://xylabs.com)
57
39
 
58
40
  [logo]: https://cdn.xy.company/img/brand/XYPersistentCompany_Logo_Icon_Colored.svg
59
41
 
60
- [main-build]: https://github.com/xylabs/sdk-pixel-js/actions/workflows/build.yml/badge.svg
61
- [main-build-link]: https://github.com/xylabs/sdk-pixel-js/actions/workflows/build.yml
62
-
42
+ [main-build]: https://github.com/xylabs/sdk-js/actions/workflows/build.yml/badge.svg
43
+ [main-build-link]: https://github.com/xylabs/sdk-js/actions/workflows/build.yml
63
44
  [npm-badge]: https://img.shields.io/npm/v/@xylabs/pixel.svg
64
45
  [npm-link]: https://www.npmjs.com/package/@xylabs/pixel
46
+ [codacy-badge]: https://app.codacy.com/project/badge/Grade/c8e15e14f37741c18cfb47ac7245c698
47
+ [codacy-link]: https://www.codacy.com/gh/xylabs/sdk-js/dashboard?utm_source=github.com&utm_medium=referral&utm_content=xylabs/sdk-js&utm_campaign=Badge_Grade
48
+ [codeclimate-badge]: https://api.codeclimate.com/v1/badges/c5eb068f806f0b047ea7/maintainability
49
+ [codeclimate-link]: https://codeclimate.com/github/xylabs/sdk-js/maintainability
50
+ [snyk-badge]: https://snyk.io/test/github/xylabs/sdk-js/badge.svg?targetFile=package.json
51
+ [snyk-link]: https://snyk.io/test/github/xylabs/sdk-js?targetFile=package.json
65
52
 
66
- [codacy-badge]: https://app.codacy.com/project/badge/Grade/c5405a253a0d489a98b2aa711c3c0824
67
- [codacy-link]: https://www.codacy.com/gh/xylabs/sdk-pixel-js/dashboard?utm_source=github.com&utm_medium=referral&utm_content=xylabs/sdk-pixel-js&utm_campaign=Badge_Grade
53
+ [npm-downloads-badge]: https://img.shields.io/npm/dw/@xylabs/pixel
54
+ [npm-license-badge]: https://img.shields.io/npm/l/@xylabs/pixel
68
55
 
69
- [codeclimate-badge]: https://api.codeclimate.com/v1/badges/c926665bade6b2493e32/maintainability
70
- [codeclimate-link]: https://codeclimate.com/github/xylabs/sdk-pixel-js/maintainability
56
+ [jsdelivr-badge]: https://data.jsdelivr.com/v1/package/npm/@xylabs/pixel/badge
57
+ [jsdelivr-link]: https://www.jsdelivr.com/package/npm/@xylabs/pixel
71
58
 
72
- [snyk-badge]: https://snyk.io/test/github/xylabs/sdk-pixel-js/badge.svg?targetFile=package.json
73
- [snyk-link]: https://snyk.io/test/github/xylabs/sdk-pixel-js?targetFile=package.json
59
+ [socket-badge]: https://socket.dev/api/badge/npm/package/@xylabs/pixel
60
+ [socket-link]: https://socket.dev/npm/package/@xylabs/pixel
@@ -1,168 +1,15 @@
1
- import Bowser from 'bowser';
2
- import { JsonObject, EmptyObject } from '@xylabs/object';
3
- import { Promisable } from '@xylabs/promise';
4
-
5
- interface ExIds {
6
- fbc?: string;
7
- fbp?: string;
8
- ga?: string;
9
- gclid?: string;
10
- rdt_uid?: string;
11
- scid?: string;
12
- tt_sessionId?: string;
13
- }
14
-
15
- type UserEventSystem = Bowser.Parser.ParsedResult;
16
-
17
- interface UserEvent {
18
- cid: string;
19
- create_time?: number;
20
- email?: string;
21
- email_hash?: string;
22
- event?: string;
23
- event_id?: string;
24
- exids?: ExIds;
25
- fields?: Record<string, unknown>;
26
- host?: string;
27
- pathname?: string;
28
- pixel?: string;
29
- receive_time?: number;
30
- referrer?: {
31
- local: string;
32
- session: string;
33
- };
34
- rid?: string;
35
- system?: UserEventSystem;
36
- uid?: string;
37
- utm?: Record<string, string>[] | Record<string, string[]>;
38
- }
39
-
40
- declare class PixelApi {
41
- private endPoint;
42
- constructor(baseUri?: string);
43
- trackEvents(events: UserEvent[]): Promise<any>;
44
- }
45
-
46
- interface CommonFields {
47
- funnel?: string;
48
- testData?: string;
49
- }
50
-
51
- interface FunnelStartedFields extends CommonFields {
52
- name: string;
53
- }
54
-
55
- declare class XyPixel {
56
- static api: PixelApi;
57
- private static _instance?;
58
- private static utmFieldsObj;
59
- cid: string;
60
- email?: string;
61
- email_hash?: string | null;
62
- exids?: ExIds;
63
- pixelId?: string;
64
- queue: UserEvent[];
65
- private queueMutex;
66
- private constructor();
67
- static get instance(): XyPixel;
68
- static init(pixelId: string): XyPixel;
69
- static selectApi(api: PixelApi): void;
70
- private static utmFields;
71
- identify(email?: string): void;
72
- send<T extends JsonObject>(event: string, fields?: T, eventId?: string): Promise<void>;
73
- private tryFlushQueue;
74
- private updateFbId;
75
- }
76
-
77
- interface PurchaseFields extends CommonFields {
78
- id: string;
79
- name?: string;
80
- price?: number;
81
- value?: number;
82
- }
83
-
84
- declare class Referrer {
85
- private static storageId;
86
- local: string;
87
- session: string;
88
- constructor();
89
- toJson(): {
90
- local: string;
91
- session: string;
92
- } | undefined;
93
- private getFromLocal;
94
- private getFromSession;
95
- }
96
-
97
- interface TestStartedFields extends CommonFields {
98
- name: string;
99
- }
100
-
101
- declare class UniqueUserId {
102
- private static localStorageId;
103
- id: string;
104
- constructor();
105
- toString(): string;
106
- private generateId;
107
- }
108
-
109
- interface UserClickFields extends CommonFields {
110
- elementName: string;
111
- elementType: string;
112
- intent?: string;
113
- placement?: string;
114
- }
115
-
116
- interface ViewContentFields extends CommonFields {
117
- name: string;
118
- path: string;
119
- }
120
-
121
- declare abstract class UserEventHandler<TData extends EmptyObject> {
122
- abstract funnelStarted<T extends TData>(fields: T | FunnelStartedFields): Promisable<void>;
123
- abstract testStarted<T extends TData>(fields: T | TestStartedFields): Promisable<void>;
124
- abstract userClick<T extends TData>(fields: T | UserClickFields): Promisable<void>;
125
- abstract viewContent<T extends TData>(fields: T | ViewContentFields): Promisable<void>;
126
- }
127
-
128
- declare class UtmFields {
129
- private static localStorageId;
130
- fields: Record<string, string>[];
131
- constructor();
132
- getUtmRecord: () => Record<string, string> | null;
133
- toString(): string;
134
- update(): Record<string, string>[];
135
- }
136
-
137
- interface XyLabsTrackingEventJson {
138
- cid: string;
139
- create_time?: number;
140
- email?: string;
141
- email_hash?: string;
142
- event?: string;
143
- event_id?: string;
144
- exids?: Record<string, string>;
145
- fields?: Record<string, unknown>;
146
- host?: string;
147
- ip?: string;
148
- pathname?: string;
149
- pixel?: string;
150
- receive_time?: number;
151
- rid?: string;
152
- system?: unknown;
153
- ua?: string;
154
- uid?: string;
155
- utm?: Record<string, string>[] | Record<string, string[]>;
156
- }
157
-
158
- declare class XyUserEventHandler<T extends EmptyObject = EmptyObject> extends UserEventHandler<T> {
159
- constructor();
160
- funnelStarted(fields: T | FunnelStartedFields): Promise<void>;
161
- purchase(fields: T | PurchaseFields): Promise<void>;
162
- testStarted(fields: T | TestStartedFields): Promise<void>;
163
- userClick(fields: T | UserClickFields): Promise<void>;
164
- viewContent(fields: T | ViewContentFields): Promise<void>;
165
- }
166
-
167
- export { PixelApi, Referrer, UniqueUserId, UserEventHandler, UtmFields, XyPixel, XyUserEventHandler };
168
- export type { CommonFields, FunnelStartedFields, PurchaseFields, TestStartedFields, UserClickFields, UserEvent, UserEventSystem, ViewContentFields, XyLabsTrackingEventJson };
1
+ export * from './Api/index.ts';
2
+ export * from './CommonFields.ts';
3
+ export * from './FunnelStartedFields.ts';
4
+ export * from './Pixel.ts';
5
+ export * from './PurchaseFields.ts';
6
+ export * from './Referrer.ts';
7
+ export * from './TestStartedFields.ts';
8
+ export * from './UniqueUserId.ts';
9
+ export * from './UserClickFields.ts';
10
+ export * from './UserEventHandler.ts';
11
+ export * from './UtmFields.ts';
12
+ export * from './ViewContentFields.ts';
13
+ export * from './XyLabsTrackingEventJson.ts';
14
+ export * from './XyUserEventHandler.ts';
15
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,5 @@
1
+ /**
2
+ * @vitest-environment jsdom
3
+ */
4
+ export {};
5
+ //# sourceMappingURL=Pixel.spec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Pixel.spec.d.ts","sourceRoot":"","sources":["../../../src/spec/Pixel.spec.ts"],"names":[],"mappings":"AAAA;;GAEG"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xylabs/pixel",
3
- "version": "4.13.15",
3
+ "version": "4.13.17",
4
4
  "description": "Event Client for xylabs ESB",
5
5
  "homepage": "https://xylabs.com",
6
6
  "bugs": {
@@ -29,10 +29,10 @@
29
29
  "module": "dist/browser/index.mjs",
30
30
  "types": "dist/browser/index.d.ts",
31
31
  "dependencies": {
32
- "@xylabs/assert": "^4.13.15",
33
- "@xylabs/object": "^4.13.15",
34
- "@xylabs/promise": "^4.13.15",
35
- "@xylabs/typeof": "^4.13.15",
32
+ "@xylabs/assert": "^4.13.17",
33
+ "@xylabs/object": "^4.13.17",
34
+ "@xylabs/promise": "^4.13.17",
35
+ "@xylabs/typeof": "^4.13.17",
36
36
  "async-mutex": "^0.5.0",
37
37
  "axios": "^1.10.0",
38
38
  "bowser": "^2.11.0",
@@ -42,10 +42,10 @@
42
42
  },
43
43
  "devDependencies": {
44
44
  "@types/js-cookie": "^3.0.6",
45
- "@types/node": "^24.0.13",
45
+ "@types/node": "^24.0.14",
46
46
  "@types/spark-md5": "^3.0.5",
47
- "@xylabs/ts-scripts-yarn3": "^7.0.0-rc.20",
48
- "@xylabs/tsconfig-dom": "^7.0.0-rc.20",
47
+ "@xylabs/ts-scripts-yarn3": "^7.0.0-rc.27",
48
+ "@xylabs/tsconfig-dom": "^7.0.0-rc.27",
49
49
  "axios": "^1.10.0",
50
50
  "typescript": "^5.8.3",
51
51
  "vitest": "^3.2.4"
@@ -1,15 +0,0 @@
1
- export * from './Api/index.ts';
2
- export * from './CommonFields.ts';
3
- export * from './FunnelStartedFields.ts';
4
- export * from './Pixel.ts';
5
- export * from './PurchaseFields.ts';
6
- export * from './Referrer.ts';
7
- export * from './TestStartedFields.ts';
8
- export * from './UniqueUserId.ts';
9
- export * from './UserClickFields.ts';
10
- export * from './UserEventHandler.ts';
11
- export * from './UtmFields.ts';
12
- export * from './ViewContentFields.ts';
13
- export * from './XyLabsTrackingEventJson.ts';
14
- export * from './XyUserEventHandler.ts';
15
- //# sourceMappingURL=index.d.ts.map
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes