@ninetailed/experience.js 7.5.3 → 7.6.0-beta.2
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/index.cjs.d.ts +1 -0
- package/{index.cjs → index.cjs.js} +697 -375
- package/index.esm.js +1203 -0
- package/package.json +6 -9
- package/src/index.d.ts +1 -1
- package/src/lib/ElementSeenObserver.d.ts +1 -1
- package/src/lib/Ninetailed.d.ts +19 -5
- package/src/lib/NinetailedCorePlugin/NinetailedCorePlugin.d.ts +69 -0
- package/src/lib/{ninetailedCorePlugin → NinetailedCorePlugin}/index.d.ts +1 -1
- package/src/lib/constants.d.ts +1 -2
- package/src/lib/experience/makeExperienceSelectMiddleware.d.ts +9 -9
- package/src/lib/guards/hasComponentViewTrackingThreshold.d.ts +3 -0
- package/src/lib/guards/hasExperienceSelectionMiddleware.d.ts +1 -1
- package/src/lib/plugins/selectPluginsHavingExperienceSelectionMiddleware.d.ts +2 -2
- package/src/lib/plugins/selectPluginsHavingOnChangeEmitter.d.ts +1 -1
- package/src/lib/types/OnSelectVariant.d.ts +51 -0
- package/src/lib/types/index.d.ts +9 -9
- package/src/lib/types/interfaces/HasComponentViewTrackingThreshold.d.ts +3 -0
- package/src/lib/types/interfaces/HasExperienceSelectionMiddleware.d.ts +10 -10
- package/src/lib/types/interfaces/InterestedInHiddenPage.d.ts +1 -1
- package/src/lib/types/interfaces/InterestedInProfileChange.d.ts +1 -1
- package/src/lib/types/interfaces/InterestedInSeenElements.d.ts +1 -3
- package/src/lib/utils/EventBuilder.d.ts +221 -0
- package/src/lib/utils/noop.d.ts +1 -0
- package/index.js +0 -886
- package/src/lib/ninetailedCorePlugin/ninetailedCorePlugin.d.ts +0 -17
- package/src/lib/test-helpers/intersection-observer-test-helper.d.ts +0 -2
- package/src/lib/types/ElementSeenPayload.d.ts +0 -82
- package/src/lib/types/EventHandler.d.ts +0 -6
- package/src/lib/types/NinetailedPlugin.d.ts +0 -11
- package/src/lib/types/TrackingProperties.d.ts +0 -35
- /package/src/lib/{ninetailedCorePlugin → NinetailedCorePlugin}/Events/build-context.d.ts +0 -0
- /package/src/lib/{ninetailedCorePlugin → NinetailedCorePlugin}/Events/build-locale.d.ts +0 -0
- /package/src/lib/{ninetailedCorePlugin → NinetailedCorePlugin}/Events/index.d.ts +0 -0
- /package/src/lib/{ninetailedCorePlugin → NinetailedCorePlugin}/constants.d.ts +0 -0
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { Locale, NinetailedApiClient, NinetailedRequestContext } from '@ninetailed/experience.js-shared';
|
|
2
|
-
import { NinetailedInstance, FlushResult, NinetailedPlugin } from '../types';
|
|
3
|
-
export type OnInitProfileId = (profileId?: string) => Promise<string | undefined> | string | undefined;
|
|
4
|
-
type AnalyticsPluginNinetailedConfig = {
|
|
5
|
-
apiClient: NinetailedApiClient;
|
|
6
|
-
locale?: Locale;
|
|
7
|
-
requestTimeout?: number;
|
|
8
|
-
onInitProfileId?: OnInitProfileId;
|
|
9
|
-
buildClientContext?: () => NinetailedRequestContext;
|
|
10
|
-
ninetailed: NinetailedInstance;
|
|
11
|
-
};
|
|
12
|
-
export declare const PLUGIN_NAME = "ninetailed";
|
|
13
|
-
export interface NinetailedCorePlugin extends NinetailedPlugin {
|
|
14
|
-
flush: () => Promise<FlushResult>;
|
|
15
|
-
}
|
|
16
|
-
export declare const ninetailedCorePlugin: ({ apiClient, locale, ninetailed, onInitProfileId, buildClientContext, }: AnalyticsPluginNinetailedConfig) => NinetailedCorePlugin;
|
|
17
|
-
export {};
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
export declare const ElementSeenPayloadSchema: z.ZodObject<{
|
|
3
|
-
element: z.ZodAny;
|
|
4
|
-
experience: z.ZodNullable<z.ZodOptional<z.ZodObject<{
|
|
5
|
-
id: z.ZodString;
|
|
6
|
-
type: z.ZodUnion<[z.ZodLiteral<"nt_experiment">, z.ZodLiteral<"nt_personalization">]>;
|
|
7
|
-
name: z.ZodOptional<z.ZodString>;
|
|
8
|
-
description: z.ZodOptional<z.ZodString>;
|
|
9
|
-
}, "strip", z.ZodTypeAny, {
|
|
10
|
-
id: string;
|
|
11
|
-
type: "nt_experiment" | "nt_personalization";
|
|
12
|
-
name?: string | undefined;
|
|
13
|
-
description?: string | undefined;
|
|
14
|
-
}, {
|
|
15
|
-
id: string;
|
|
16
|
-
type: "nt_experiment" | "nt_personalization";
|
|
17
|
-
name?: string | undefined;
|
|
18
|
-
description?: string | undefined;
|
|
19
|
-
}>>>;
|
|
20
|
-
audience: z.ZodDefault<z.ZodNullable<z.ZodOptional<z.ZodObject<{
|
|
21
|
-
id: z.ZodString;
|
|
22
|
-
name: z.ZodOptional<z.ZodString>;
|
|
23
|
-
description: z.ZodOptional<z.ZodString>;
|
|
24
|
-
}, "strip", z.ZodTypeAny, {
|
|
25
|
-
id: string;
|
|
26
|
-
name?: string | undefined;
|
|
27
|
-
description?: string | undefined;
|
|
28
|
-
}, {
|
|
29
|
-
id: string;
|
|
30
|
-
name?: string | undefined;
|
|
31
|
-
description?: string | undefined;
|
|
32
|
-
}>>>>;
|
|
33
|
-
variant: z.ZodObject<{
|
|
34
|
-
id: z.ZodString;
|
|
35
|
-
}, "strip", z.ZodUnknown, z.objectOutputType<{
|
|
36
|
-
id: z.ZodString;
|
|
37
|
-
}, z.ZodUnknown, "strip">, z.objectInputType<{
|
|
38
|
-
id: z.ZodString;
|
|
39
|
-
}, z.ZodUnknown, "strip">>;
|
|
40
|
-
variantIndex: z.ZodNumber;
|
|
41
|
-
}, "strip", z.ZodTypeAny, {
|
|
42
|
-
audience: {
|
|
43
|
-
id: string;
|
|
44
|
-
name?: string | undefined;
|
|
45
|
-
description?: string | undefined;
|
|
46
|
-
} | null;
|
|
47
|
-
variant: {
|
|
48
|
-
id: string;
|
|
49
|
-
} & {
|
|
50
|
-
[k: string]: unknown;
|
|
51
|
-
};
|
|
52
|
-
variantIndex: number;
|
|
53
|
-
element?: any;
|
|
54
|
-
experience?: {
|
|
55
|
-
id: string;
|
|
56
|
-
type: "nt_experiment" | "nt_personalization";
|
|
57
|
-
name?: string | undefined;
|
|
58
|
-
description?: string | undefined;
|
|
59
|
-
} | null | undefined;
|
|
60
|
-
}, {
|
|
61
|
-
variant: {
|
|
62
|
-
id: string;
|
|
63
|
-
} & {
|
|
64
|
-
[k: string]: unknown;
|
|
65
|
-
};
|
|
66
|
-
variantIndex: number;
|
|
67
|
-
element?: any;
|
|
68
|
-
experience?: {
|
|
69
|
-
id: string;
|
|
70
|
-
type: "nt_experiment" | "nt_personalization";
|
|
71
|
-
name?: string | undefined;
|
|
72
|
-
description?: string | undefined;
|
|
73
|
-
} | null | undefined;
|
|
74
|
-
audience?: {
|
|
75
|
-
id: string;
|
|
76
|
-
name?: string | undefined;
|
|
77
|
-
description?: string | undefined;
|
|
78
|
-
} | null | undefined;
|
|
79
|
-
}>;
|
|
80
|
-
export type ElementSeenPayload = Omit<z.input<typeof ElementSeenPayloadSchema>, 'element'> & {
|
|
81
|
-
element: Element;
|
|
82
|
-
};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { AnalyticsPlugin } from 'analytics';
|
|
2
|
-
import { AnalyticsInstance } from './AnalyticsInstance';
|
|
3
|
-
export type EventHandlerParams<T = unknown> = {
|
|
4
|
-
payload: T;
|
|
5
|
-
instance: AnalyticsInstance;
|
|
6
|
-
};
|
|
7
|
-
export type EventHandler<T = unknown> = (params: EventHandlerParams<T>) => void;
|
|
8
|
-
export declare abstract class NinetailedPlugin implements AnalyticsPlugin {
|
|
9
|
-
[x: string]: unknown;
|
|
10
|
-
abstract readonly name: string;
|
|
11
|
-
}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
export declare const TrackComponentProperties: z.ZodObject<{
|
|
3
|
-
variant: z.ZodObject<{
|
|
4
|
-
id: z.ZodString;
|
|
5
|
-
}, "strip", z.ZodTypeAny, {
|
|
6
|
-
id: string;
|
|
7
|
-
}, {
|
|
8
|
-
id: string;
|
|
9
|
-
}>;
|
|
10
|
-
audience: z.ZodObject<{
|
|
11
|
-
id: z.ZodString;
|
|
12
|
-
}, "strip", z.ZodTypeAny, {
|
|
13
|
-
id: string;
|
|
14
|
-
}, {
|
|
15
|
-
id: string;
|
|
16
|
-
}>;
|
|
17
|
-
isPersonalized: z.ZodBoolean;
|
|
18
|
-
}, "strip", z.ZodTypeAny, {
|
|
19
|
-
variant: {
|
|
20
|
-
id: string;
|
|
21
|
-
};
|
|
22
|
-
audience: {
|
|
23
|
-
id: string;
|
|
24
|
-
};
|
|
25
|
-
isPersonalized: boolean;
|
|
26
|
-
}, {
|
|
27
|
-
variant: {
|
|
28
|
-
id: string;
|
|
29
|
-
};
|
|
30
|
-
audience: {
|
|
31
|
-
id: string;
|
|
32
|
-
};
|
|
33
|
-
isPersonalized: boolean;
|
|
34
|
-
}>;
|
|
35
|
-
export type TrackComponentProperties = z.infer<typeof TrackComponentProperties>;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|