@jitsu/js 1.11.0-beta.1 → 1.11.0-beta.10

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2021 Jitsu Labs, Inc
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,29 @@
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 function createInMemoryStorage(debug?: boolean): PersistentStorage;
7
+ export declare const emptyRuntime: (config: JitsuOptions) => RuntimeFacade;
8
+ export declare function isInBrowser(): boolean;
9
+ export type DestinationDescriptor = {
10
+ id: string;
11
+ destinationType: string;
12
+ credentials: any;
13
+ options: any;
14
+ newEvents?: any[];
15
+ deviceOptions: DeviceOptions;
16
+ };
17
+ export type AnalyticsPluginDescriptor = {
18
+ type: "analytics-plugin";
19
+ packageCdn: string;
20
+ moduleVarName: string;
21
+ };
22
+ export type InternalPluginDescriptor = {
23
+ type: "internal-plugin";
24
+ name: string;
25
+ };
26
+ export type DeviceOptions = AnalyticsPluginDescriptor | InternalPluginDescriptor;
27
+ export declare const jitsuAnalyticsPlugin: (jitsuOptions: JitsuOptions | undefined, storage: PersistentStorage) => AnalyticsPlugin;
28
+ export declare function randomId(hashString?: string | undefined): string;
29
+ export declare function uuid(): string;
@@ -0,0 +1,10 @@
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
+ };
@@ -0,0 +1,8 @@
1
+ import { CommonDestinationCredentials, InternalPlugin } from "./index";
2
+ export type Ga4DestinationCredentials = {
3
+ debug?: boolean;
4
+ measurementIds?: string;
5
+ autoPageView?: boolean;
6
+ dataLayerName?: string;
7
+ } & CommonDestinationCredentials;
8
+ export declare const ga4Plugin: InternalPlugin<Ga4DestinationCredentials>;
@@ -0,0 +1,6 @@
1
+ import { CommonDestinationCredentials, InternalPlugin } from "./index";
2
+ export type GtmDestinationCredentials = {
3
+ containerId?: string;
4
+ dataLayerName?: string;
5
+ } & CommonDestinationCredentials;
6
+ export declare const gtmPlugin: InternalPlugin<GtmDestinationCredentials>;
@@ -0,0 +1,15 @@
1
+ import { AnalyticsClientEvent } from "@jitsu/protocols/analytics";
2
+ export type InternalPlugin<T> = {
3
+ id: string;
4
+ handle(config: T & {
5
+ debug?: boolean;
6
+ }, payload: AnalyticsClientEvent): Promise<void>;
7
+ };
8
+ export type CommonDestinationCredentials = {
9
+ hosts?: string;
10
+ events?: string;
11
+ };
12
+ export declare function satisfyFilter(filter: string, subject: string | undefined): boolean;
13
+ export declare function satisfyDomainFilter(filter: string, subject: string | undefined): boolean;
14
+ export declare function applyFilters(event: AnalyticsClientEvent, creds: CommonDestinationCredentials): boolean;
15
+ export declare const internalDestinationPlugins: Record<string, InternalPlugin<any>>;
@@ -0,0 +1,6 @@
1
+ import { CommonDestinationCredentials, InternalPlugin } from "./index";
2
+ export type LogRocketDestinationCredentials = {
3
+ appId: string;
4
+ } & CommonDestinationCredentials;
5
+ export declare const logrocketPlugin: InternalPlugin<LogRocketDestinationCredentials>;
6
+ export type LogRocket = any;
@@ -0,0 +1,8 @@
1
+ import { AnalyticsClientEvent } from "@jitsu/protocols/analytics";
2
+ export type InternalPlugin<T> = {
3
+ id: string;
4
+ handle(config: T & {
5
+ debug?: boolean;
6
+ }, payload: AnalyticsClientEvent): Promise<void>;
7
+ };
8
+ export declare const internalDestinationPlugins: Record<string, InternalPlugin<any>>;
@@ -0,0 +1,5 @@
1
+ import { CommonDestinationCredentials, InternalPlugin } from "./index";
2
+ export type TagDestinationCredentials = {
3
+ code: string;
4
+ } & CommonDestinationCredentials;
5
+ export declare const tagPlugin: InternalPlugin<TagDestinationCredentials>;
@@ -0,0 +1,6 @@
1
+ import { Callback, DispatchedEvent, ID, JSONObject, Options, AnalyticsInterface, JitsuOptions, PersistentStorage, RuntimeFacade, DynamicJitsuOptions } from "@jitsu/protocols/analytics";
2
+ export default function parse(input: any): any;
3
+ export declare const emptyAnalytics: AnalyticsInterface;
4
+ export declare function jitsuAnalytics(_opts: JitsuOptions): AnalyticsInterface;
5
+ export type { Callback, DispatchedEvent, ID, JSONObject, Options, AnalyticsInterface, JitsuOptions, PersistentStorage, RuntimeFacade, DynamicJitsuOptions, };
6
+ export * from "./analytics-plugin";