@jitsu/js 1.9.18-canary.1288.20250415191203 → 1.9.18-canary.1288.20250415193648

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 (48) hide show
  1. package/package.json +8 -3
  2. package/.turbo/turbo-build.log +0 -67
  3. package/.turbo/turbo-clean.log +0 -5
  4. package/.turbo/turbo-test.log +0 -2884
  5. package/__tests__/node/method-queue.test.ts +0 -66
  6. package/__tests__/node/nodejs.test.ts +0 -306
  7. package/__tests__/playwright/cases/anonymous-id-bug.html +0 -26
  8. package/__tests__/playwright/cases/basic.html +0 -32
  9. package/__tests__/playwright/cases/callbacks.html +0 -21
  10. package/__tests__/playwright/cases/cookie-names.html +0 -22
  11. package/__tests__/playwright/cases/disable-user-ids.html +0 -23
  12. package/__tests__/playwright/cases/dont-send.html +0 -22
  13. package/__tests__/playwright/cases/ip-policy.html +0 -22
  14. package/__tests__/playwright/cases/reset.html +0 -32
  15. package/__tests__/playwright/cases/segment-reference.html +0 -64
  16. package/__tests__/playwright/cases/url-bug.html +0 -20
  17. package/__tests__/playwright/integration.test.ts +0 -640
  18. package/__tests__/simple-syrup.ts +0 -136
  19. package/jest.config.js +0 -13
  20. package/package/README.md +0 -9
  21. package/package/dist/analytics-plugin.d.ts +0 -28
  22. package/package/dist/browser.d.ts +0 -10
  23. package/package/dist/index.d.ts +0 -28
  24. package/package/dist/jitsu.cjs.js +0 -2100
  25. package/package/dist/jitsu.d.ts +0 -78
  26. package/package/dist/jitsu.es.js +0 -2090
  27. package/package/dist/method-queue.d.ts +0 -19
  28. package/package/dist/script-loader.d.ts +0 -8
  29. package/package/dist/tlds.d.ts +0 -3
  30. package/package/dist/version.d.ts +0 -3
  31. package/package/dist/web/p.js.txt +0 -2219
  32. package/package/package.json +0 -56
  33. package/playwrite.config.ts +0 -91
  34. package/rollup.config.js +0 -32
  35. package/src/analytics-plugin.ts +0 -989
  36. package/src/browser.ts +0 -163
  37. package/src/destination-plugins/ga4.ts +0 -138
  38. package/src/destination-plugins/gtm.ts +0 -142
  39. package/src/destination-plugins/index.ts +0 -61
  40. package/src/destination-plugins/logrocket.ts +0 -85
  41. package/src/destination-plugins/tag.ts +0 -85
  42. package/src/index.ts +0 -255
  43. package/src/method-queue.ts +0 -70
  44. package/src/script-loader.ts +0 -76
  45. package/src/tlds.ts +0 -27
  46. package/src/version.ts +0 -6
  47. package/tsconfig.json +0 -23
  48. package/tsconfig.test.json +0 -15
@@ -1,136 +0,0 @@
1
- import type { Application, RequestHandler } from "express";
2
- import http from "http";
3
- import https from "https";
4
-
5
- const express = require("express");
6
-
7
- const forge = require("node-forge");
8
-
9
- export type SimpleSyrupOpts = {
10
- port?: number;
11
- https?: boolean;
12
- handlers?: Record<string, RequestHandler>;
13
- };
14
-
15
- export type SimpleSyrup = {
16
- app: Application;
17
- server: http.Server;
18
- port: number;
19
- baseUrl: string;
20
- close: () => Promise<void>;
21
- };
22
-
23
- function getNextAvailablePort(port: number) {
24
- return new Promise<number>(resolve => {
25
- const server = http.createServer();
26
- server.on("error", () => {
27
- resolve(getNextAvailablePort(port + 1));
28
- });
29
- server.on("listening", () => {
30
- server.close(() => {
31
- resolve(port);
32
- });
33
- });
34
- server.listen(port);
35
- });
36
- }
37
-
38
- function generateX509Certificate(altNames: { type: number; value: string }[]) {
39
- const issuer = [
40
- { name: "commonName", value: "localhost" },
41
- { name: "organizationName", value: "ACME Corp" },
42
- { name: "organizationalUnitName", value: "XYZ Department" },
43
- ];
44
- const certificateExtensions = [
45
- { name: "basicConstraints", cA: true },
46
- {
47
- name: "keyUsage",
48
- keyCertSign: true,
49
- digitalSignature: true,
50
- nonRepudiation: true,
51
- keyEncipherment: true,
52
- dataEncipherment: true,
53
- },
54
- {
55
- name: "extKeyUsage",
56
- serverAuth: true,
57
- clientAuth: true,
58
- codeSigning: true,
59
- emailProtection: true,
60
- timeStamping: true,
61
- },
62
- {
63
- name: "nsCertType",
64
- client: true,
65
- server: true,
66
- email: true,
67
- objsign: true,
68
- sslCA: true,
69
- emailCA: true,
70
- objCA: true,
71
- },
72
- { name: "subjectAltName", altNames },
73
- { name: "subjectKeyIdentifier" },
74
- ];
75
- const keys = forge.pki.rsa.generateKeyPair(2048);
76
- const cert = forge.pki.createCertificate();
77
- cert.validity.notBefore = new Date();
78
- cert.validity.notAfter = new Date();
79
- cert.validity.notAfter.setFullYear(cert.validity.notBefore.getFullYear() + 1);
80
- cert.publicKey = keys.publicKey;
81
- cert.setSubject(issuer);
82
- cert.setIssuer(issuer);
83
- cert.setExtensions(certificateExtensions);
84
- cert.sign(keys.privateKey);
85
- return {
86
- key: forge.pki.privateKeyToPem(keys.privateKey),
87
- cert: forge.pki.certificateToPem(cert),
88
- };
89
- }
90
-
91
- function shutdownFunction(server): Promise<void> {
92
- return new Promise<void>(resolve => {
93
- let resolved = false;
94
- const resolveIfNeeded = () => {
95
- if (!resolved) {
96
- resolved = true;
97
- resolve();
98
- }
99
- };
100
- setTimeout(resolveIfNeeded, 5000);
101
- server.close(resolveIfNeeded);
102
- });
103
- }
104
-
105
- export function createServer(opts: SimpleSyrupOpts = {}): Promise<SimpleSyrup> {
106
- return new Promise<SimpleSyrup>(async (resolve, reject) => {
107
- const app: Application = express();
108
- app.use(express.json());
109
- const server = opts?.https ? https.createServer(generateX509Certificate([]), app) : http.createServer(app);
110
- const port = opts?.port ? await getNextAvailablePort(opts.port) : 0;
111
- server.listen(port, () => {
112
- const address = server.address();
113
- if (!address) {
114
- reject(new Error(`Unable to get server address`));
115
- return;
116
- }
117
- if (typeof address === "string") {
118
- reject(new Error(`Address is not an of network. This is not supported: ${address} `));
119
- return;
120
- }
121
- const port = address.port;
122
- if (opts?.handlers) {
123
- for (const [path, handler] of Object.entries(opts?.handlers)) {
124
- app.all(path, handler);
125
- }
126
- }
127
- resolve({
128
- app: app,
129
- port,
130
- close: () => shutdownFunction(server),
131
- baseUrl: `${opts.https ? "https" : "http"}://localhost:${port}`,
132
- server: server,
133
- });
134
- });
135
- });
136
- }
package/jest.config.js DELETED
@@ -1,13 +0,0 @@
1
- /** @type {import("ts-jest").JestConfigWithTsJest} */
2
- module.exports = {
3
- //preset: "ts-jest",
4
- preset: "ts-jest",
5
- testEnvironment: "node",
6
- runner: "jest-runner",
7
- rootDir: "./__tests__/node/",
8
- globals: {
9
- 'ts-jest': {
10
- tsConfig: 'tsconfig.test.json'
11
- }
12
- }
13
- };
package/package/README.md DELETED
@@ -1,9 +0,0 @@
1
- ## Install
2
-
3
- ```bash
4
- npm install --save @jitsu/jitsu-js
5
- ```
6
-
7
- ## Usage
8
-
9
- **Please read a documentation on [Jitsu Docs](https://docs.jitsu.com/sending-data/npm)**
@@ -1,28 +0,0 @@
1
- import { JitsuOptions, PersistentStorage, RuntimeFacade } from "@jitsu/protocols/analytics";
2
- import { AnalyticsPlugin } from "analytics";
3
- export declare const parseQuery: (qs?: string) => Record<string, string>;
4
- export type StorageFactory = (cookieDomain: string, key2Cookie: (key: string) => string) => PersistentStorage;
5
- export declare function windowRuntime(opts: JitsuOptions): RuntimeFacade;
6
- export declare const emptyRuntime: (config: JitsuOptions) => RuntimeFacade;
7
- export declare function isInBrowser(): boolean;
8
- export type DestinationDescriptor = {
9
- id: string;
10
- destinationType: string;
11
- credentials: any;
12
- options: any;
13
- newEvents?: any[];
14
- deviceOptions: DeviceOptions;
15
- };
16
- export type AnalyticsPluginDescriptor = {
17
- type: "analytics-plugin";
18
- packageCdn: string;
19
- moduleVarName: string;
20
- };
21
- export type InternalPluginDescriptor = {
22
- type: "internal-plugin";
23
- name: string;
24
- };
25
- export type DeviceOptions = AnalyticsPluginDescriptor | InternalPluginDescriptor;
26
- export declare const jitsuAnalyticsPlugin: (jitsuOptions: JitsuOptions, storage: PersistentStorage) => AnalyticsPlugin;
27
- export declare function randomId(hashString?: string | undefined): string;
28
- export declare function uuid(): string;
@@ -1,10 +0,0 @@
1
- import type { JitsuOptions } from "@jitsu/protocols/analytics";
2
- export type JitsuBrowserOptions = {
3
- namespace?: string;
4
- onload?: string;
5
- initOnly?: boolean;
6
- } & JitsuOptions;
7
- export type Parser = {
8
- path?: (name: string) => string[];
9
- parse: (arg: string) => any;
10
- };
@@ -1,28 +0,0 @@
1
- import {
2
- Callback,
3
- DispatchedEvent,
4
- ID,
5
- JSONObject,
6
- Options,
7
- AnalyticsInterface,
8
- JitsuOptions,
9
- PersistentStorage,
10
- RuntimeFacade,
11
- DynamicJitsuOptions,
12
- } from "@jitsu/protocols/analytics";
13
- export default function parse(input: any): any;
14
- export declare const emptyAnalytics: AnalyticsInterface;
15
- export declare function jitsuAnalytics(_opts: JitsuOptions): AnalyticsInterface;
16
- export {
17
- Callback,
18
- DispatchedEvent,
19
- ID,
20
- JSONObject,
21
- Options,
22
- AnalyticsInterface,
23
- JitsuOptions,
24
- PersistentStorage,
25
- RuntimeFacade,
26
- DynamicJitsuOptions,
27
- };
28
- export * from "./analytics-plugin";