@jitsu/js 1.9.18-canary.1288.20250415192732 → 1.9.18-canary.1288.20250415194526

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 (52) hide show
  1. package/dist/analytics-plugin.d.ts +1 -0
  2. package/dist/jitsu.cjs.js +36 -31
  3. package/dist/jitsu.es.js +36 -32
  4. package/dist/web/p.js.txt +35 -31
  5. package/package.json +6 -3
  6. package/.turbo/turbo-build.log +0 -67
  7. package/.turbo/turbo-clean.log +0 -5
  8. package/.turbo/turbo-test.log +0 -2884
  9. package/__tests__/node/method-queue.test.ts +0 -66
  10. package/__tests__/node/nodejs.test.ts +0 -306
  11. package/__tests__/playwright/cases/anonymous-id-bug.html +0 -26
  12. package/__tests__/playwright/cases/basic.html +0 -32
  13. package/__tests__/playwright/cases/callbacks.html +0 -21
  14. package/__tests__/playwright/cases/cookie-names.html +0 -22
  15. package/__tests__/playwright/cases/disable-user-ids.html +0 -23
  16. package/__tests__/playwright/cases/dont-send.html +0 -22
  17. package/__tests__/playwright/cases/ip-policy.html +0 -22
  18. package/__tests__/playwright/cases/reset.html +0 -32
  19. package/__tests__/playwright/cases/segment-reference.html +0 -64
  20. package/__tests__/playwright/cases/url-bug.html +0 -20
  21. package/__tests__/playwright/integration.test.ts +0 -640
  22. package/__tests__/simple-syrup.ts +0 -136
  23. package/jest.config.js +0 -13
  24. package/package/README.md +0 -9
  25. package/package/dist/analytics-plugin.d.ts +0 -28
  26. package/package/dist/browser.d.ts +0 -10
  27. package/package/dist/index.d.ts +0 -28
  28. package/package/dist/jitsu.cjs.js +0 -2100
  29. package/package/dist/jitsu.d.ts +0 -78
  30. package/package/dist/jitsu.es.js +0 -2090
  31. package/package/dist/method-queue.d.ts +0 -19
  32. package/package/dist/script-loader.d.ts +0 -8
  33. package/package/dist/tlds.d.ts +0 -3
  34. package/package/dist/version.d.ts +0 -3
  35. package/package/dist/web/p.js.txt +0 -2219
  36. package/package/package.json +0 -56
  37. package/playwrite.config.ts +0 -91
  38. package/rollup.config.js +0 -32
  39. package/src/analytics-plugin.ts +0 -989
  40. package/src/browser.ts +0 -163
  41. package/src/destination-plugins/ga4.ts +0 -138
  42. package/src/destination-plugins/gtm.ts +0 -142
  43. package/src/destination-plugins/index.ts +0 -61
  44. package/src/destination-plugins/logrocket.ts +0 -85
  45. package/src/destination-plugins/tag.ts +0 -85
  46. package/src/index.ts +0 -255
  47. package/src/method-queue.ts +0 -70
  48. package/src/script-loader.ts +0 -76
  49. package/src/tlds.ts +0 -27
  50. package/src/version.ts +0 -6
  51. package/tsconfig.json +0 -23
  52. 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";