@prodantix/sdk 0.7.0-beta.438 → 0.7.0-beta.440

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 (43) hide show
  1. package/dist/chat.cjs +5 -107
  2. package/dist/chat.d.cts +93 -8
  3. package/dist/chat.d.ts +93 -8
  4. package/dist/chat.js +5 -107
  5. package/dist/chunk-L4P6GMBC.js +2 -0
  6. package/dist/client-Cz7M6XJC.d.ts +477 -0
  7. package/dist/client-vogZuHfD.d.cts +477 -0
  8. package/dist/{config-C9Njc6-j.d.ts → config-Dmk59mPh.d.ts} +40 -2
  9. package/dist/{config-CpfUyEw8.d.cts → config-Dxf1vAMu.d.cts} +40 -2
  10. package/dist/consent.iife.js +20 -0
  11. package/dist/ctas.iife.js +37 -0
  12. package/dist/forms.iife.js +16 -0
  13. package/dist/guides.iife.js +3 -0
  14. package/dist/index.cjs +1 -1
  15. package/dist/index.d.cts +5 -4
  16. package/dist/index.d.ts +5 -4
  17. package/dist/index.js +1 -1
  18. package/dist/messenger-help.iife.js +1 -1
  19. package/dist/messenger-tickets.iife.js +3 -0
  20. package/dist/messenger.cjs +1 -1
  21. package/dist/messenger.d.cts +1 -1
  22. package/dist/messenger.d.ts +1 -1
  23. package/dist/messenger.iife.js +5 -107
  24. package/dist/messenger.js +1 -1
  25. package/dist/node.cjs +1 -1
  26. package/dist/node.d.cts +3 -2
  27. package/dist/node.d.ts +3 -2
  28. package/dist/node.js +1 -1
  29. package/dist/pages.iife.js +2 -0
  30. package/dist/prodantix-push-sw.js +3 -0
  31. package/dist/surveys.iife.js +2 -0
  32. package/dist/{transport-DKFvkfX4.d.ts → transport-C4mkCaix.d.ts} +1 -1
  33. package/dist/{transport-DN9pXyrX.d.cts → transport-C9C4hqlF.d.cts} +1 -1
  34. package/dist/{types-Q2VNlJbG.d.cts → types-BUXFV_aE.d.cts} +11 -0
  35. package/dist/{types-Q2VNlJbG.d.ts → types-BUXFV_aE.d.ts} +11 -0
  36. package/dist/web.cjs +36 -1
  37. package/dist/web.d.cts +185 -4
  38. package/dist/web.d.ts +185 -4
  39. package/dist/web.js +36 -1
  40. package/package.json +1 -1
  41. package/dist/chunk-D6PMLUYA.js +0 -2
  42. package/dist/client-CL6Xvhay.d.cts +0 -135
  43. package/dist/client-QyKW0LFW.d.ts +0 -135
@@ -1,135 +0,0 @@
1
- import { e as EventProperties, P as ProdantixConfig, b as Consent, f as FlagVariant, I as InboxMessage } from './types-Q2VNlJbG.cjs';
2
-
3
- interface LocalFlagContext {
4
- attributes?: EventProperties;
5
- /** The cohorts the current distinct id belongs to. When omitted and the
6
- * snapshot names a cohort, the client fetches them once per distinct id. */
7
- cohorts?: string[];
8
- properties?: EventProperties;
9
- }
10
- interface CaptureOptions {
11
- /** Speak for someone other than this client's own identity. A server has no
12
- * visitor of its own to lend an event, so an event it sends on a browser's
13
- * behalf names the person directly. */
14
- distinctId?: string;
15
- element?: unknown;
16
- properties?: EventProperties;
17
- sessionId?: string;
18
- timestamp?: Date;
19
- }
20
- /**
21
- * The profile keys the platform itself understands.
22
- *
23
- * They are ordinary properties on the wire; the only thing that makes them
24
- * special is the `$` prefix, which is how this platform marks a name it owns
25
- * rather than one the caller chose. Passing them through `traits` means never
26
- * having to remember whether the console reads `email` or `$email`: an
27
- * unprefixed `email` is a property of your own and stays one, and would never
28
- * reach the Email column.
29
- */
30
- interface PersonTraits {
31
- avatar?: string;
32
- email?: string;
33
- name?: string;
34
- phone?: string;
35
- }
36
- interface IdentifyOptions {
37
- /** Arbitrary profile properties your own code defines. */
38
- set?: EventProperties;
39
- /** The reserved traits the console renders as fields. */
40
- traits?: PersonTraits;
41
- }
42
- declare class ProdantixClient {
43
- private readonly config;
44
- private readonly identity;
45
- private readonly session?;
46
- private readonly queue;
47
- private readonly transport;
48
- private readonly flagsClient;
49
- private readonly messagesClient;
50
- private readonly context;
51
- private flushTimer?;
52
- private flushing;
53
- private cachedFlags?;
54
- private cachedSnapshot?;
55
- private membershipCache?;
56
- private stream?;
57
- private shutDown;
58
- /** One `$feature_flag_called` per (distinct id, flag, response) per client
59
- * lifetime: the experiment engine attributes on the FIRST exposure, so a
60
- * second event for the same answer would only cost the project an event. */
61
- private readonly exposures;
62
- constructor(config: ProdantixConfig);
63
- get distinctId(): string;
64
- get anonymousId(): string;
65
- /** Whether this client still holds a person, from the persisted distinct id,
66
- * so a fresh page load answers the same as the load that identified them.
67
- * Public because a surface that has resolved to nobody must reset the client
68
- * only when there is someone to reset: a sign-out is a hard navigation on a
69
- * BFF surface, so no value-to-null transition ever renders. */
70
- get isIdentified(): boolean;
71
- get sessionId(): string | undefined;
72
- get sessionStartedAt(): number | undefined;
73
- capture(eventName: string, options?: CaptureOptions): void;
74
- identify(distinctId: string, options?: IdentifyOptions): void;
75
- /**
76
- * Join a browser's anonymous trail to a person from a server. A sign-in that
77
- * completes in a redirect renders no page, so the browser's own `identify`
78
- * never runs there; this sends the one `$identify` it would have sent, for
79
- * the ids given, and leaves this client's own identity as it was.
80
- */
81
- link(distinctId: string, anonymousId: string, traits?: PersonTraits): void;
82
- /**
83
- * Record the visitor's answer about the join. It rides the shared store, so
84
- * every subdomain and the login's server read the same one, and it takes
85
- * effect on the next identify and the next decorated click; nothing already
86
- * joined is unjoined.
87
- */
88
- setConsent(consent: Consent): void;
89
- /** The visitor's answer, or null when they have not been asked. */
90
- consent(): Consent | null;
91
- alias(alias: string): void;
92
- group(groupType: string, groupKey: string, properties?: EventProperties): void;
93
- setPersonProperties(set?: EventProperties, setOnce?: EventProperties): void;
94
- /**
95
- * Attach the reserved traits to whoever is current, without an identify.
96
- *
97
- * This does NOT make the person identified: only `identify()` does that, so a
98
- * trait set on an anonymous visitor leaves them anonymous and carrying an
99
- * address, which is exactly what a newsletter signup before login looks like.
100
- */
101
- setPersonTraits(traits: PersonTraits): void;
102
- getAllFlags(): Promise<Record<string, boolean>>;
103
- isFeatureEnabled(key: string): Promise<boolean>;
104
- /** The assigned variation for one flag, or null when the flag is unknown or
105
- * carries no variations. Records the exposure either way. */
106
- getVariant(key: string): Promise<FlagVariant | null>;
107
- getVariantLocal(key: string, context?: LocalFlagContext): Promise<FlagVariant | null>;
108
- private recordExposure;
109
- getCachedFlag(key: string): boolean | undefined;
110
- getLocalFlags(context?: LocalFlagContext): Promise<Record<string, boolean>>;
111
- isFeatureEnabledLocal(key: string, context?: LocalFlagContext): Promise<boolean>;
112
- /** The evaluation context for a local read. Memberships come from the caller
113
- * when supplied, else from the server once per distinct id per snapshot
114
- * TTL, and only when the snapshot names a cohort at all. */
115
- private localContext;
116
- private flagSnapshot;
117
- /** Opens the flag stream once, when streaming was asked for and the snapshot
118
- * names a gateway. A pushed change drops the cached snapshot and refetches
119
- * it; a refused handshake stays closed, a dropped one reopens. */
120
- private maybeStream;
121
- getInbox(): Promise<InboxMessage[]>;
122
- markMessageRead(messageId: string): Promise<void>;
123
- flush(): Promise<void>;
124
- reset(): void;
125
- shutdown(): Promise<void>;
126
- private enqueue;
127
- private persistQueue;
128
- private restoreQueue;
129
- private startTimer;
130
- private stopTimer;
131
- private persistKey;
132
- }
133
- declare function createClient(config: ProdantixConfig): ProdantixClient;
134
-
135
- export { type CaptureOptions as C, type IdentifyOptions as I, type LocalFlagContext as L, ProdantixClient as P, createClient as c };
@@ -1,135 +0,0 @@
1
- import { e as EventProperties, P as ProdantixConfig, b as Consent, f as FlagVariant, I as InboxMessage } from './types-Q2VNlJbG.js';
2
-
3
- interface LocalFlagContext {
4
- attributes?: EventProperties;
5
- /** The cohorts the current distinct id belongs to. When omitted and the
6
- * snapshot names a cohort, the client fetches them once per distinct id. */
7
- cohorts?: string[];
8
- properties?: EventProperties;
9
- }
10
- interface CaptureOptions {
11
- /** Speak for someone other than this client's own identity. A server has no
12
- * visitor of its own to lend an event, so an event it sends on a browser's
13
- * behalf names the person directly. */
14
- distinctId?: string;
15
- element?: unknown;
16
- properties?: EventProperties;
17
- sessionId?: string;
18
- timestamp?: Date;
19
- }
20
- /**
21
- * The profile keys the platform itself understands.
22
- *
23
- * They are ordinary properties on the wire; the only thing that makes them
24
- * special is the `$` prefix, which is how this platform marks a name it owns
25
- * rather than one the caller chose. Passing them through `traits` means never
26
- * having to remember whether the console reads `email` or `$email`: an
27
- * unprefixed `email` is a property of your own and stays one, and would never
28
- * reach the Email column.
29
- */
30
- interface PersonTraits {
31
- avatar?: string;
32
- email?: string;
33
- name?: string;
34
- phone?: string;
35
- }
36
- interface IdentifyOptions {
37
- /** Arbitrary profile properties your own code defines. */
38
- set?: EventProperties;
39
- /** The reserved traits the console renders as fields. */
40
- traits?: PersonTraits;
41
- }
42
- declare class ProdantixClient {
43
- private readonly config;
44
- private readonly identity;
45
- private readonly session?;
46
- private readonly queue;
47
- private readonly transport;
48
- private readonly flagsClient;
49
- private readonly messagesClient;
50
- private readonly context;
51
- private flushTimer?;
52
- private flushing;
53
- private cachedFlags?;
54
- private cachedSnapshot?;
55
- private membershipCache?;
56
- private stream?;
57
- private shutDown;
58
- /** One `$feature_flag_called` per (distinct id, flag, response) per client
59
- * lifetime: the experiment engine attributes on the FIRST exposure, so a
60
- * second event for the same answer would only cost the project an event. */
61
- private readonly exposures;
62
- constructor(config: ProdantixConfig);
63
- get distinctId(): string;
64
- get anonymousId(): string;
65
- /** Whether this client still holds a person, from the persisted distinct id,
66
- * so a fresh page load answers the same as the load that identified them.
67
- * Public because a surface that has resolved to nobody must reset the client
68
- * only when there is someone to reset: a sign-out is a hard navigation on a
69
- * BFF surface, so no value-to-null transition ever renders. */
70
- get isIdentified(): boolean;
71
- get sessionId(): string | undefined;
72
- get sessionStartedAt(): number | undefined;
73
- capture(eventName: string, options?: CaptureOptions): void;
74
- identify(distinctId: string, options?: IdentifyOptions): void;
75
- /**
76
- * Join a browser's anonymous trail to a person from a server. A sign-in that
77
- * completes in a redirect renders no page, so the browser's own `identify`
78
- * never runs there; this sends the one `$identify` it would have sent, for
79
- * the ids given, and leaves this client's own identity as it was.
80
- */
81
- link(distinctId: string, anonymousId: string, traits?: PersonTraits): void;
82
- /**
83
- * Record the visitor's answer about the join. It rides the shared store, so
84
- * every subdomain and the login's server read the same one, and it takes
85
- * effect on the next identify and the next decorated click; nothing already
86
- * joined is unjoined.
87
- */
88
- setConsent(consent: Consent): void;
89
- /** The visitor's answer, or null when they have not been asked. */
90
- consent(): Consent | null;
91
- alias(alias: string): void;
92
- group(groupType: string, groupKey: string, properties?: EventProperties): void;
93
- setPersonProperties(set?: EventProperties, setOnce?: EventProperties): void;
94
- /**
95
- * Attach the reserved traits to whoever is current, without an identify.
96
- *
97
- * This does NOT make the person identified: only `identify()` does that, so a
98
- * trait set on an anonymous visitor leaves them anonymous and carrying an
99
- * address, which is exactly what a newsletter signup before login looks like.
100
- */
101
- setPersonTraits(traits: PersonTraits): void;
102
- getAllFlags(): Promise<Record<string, boolean>>;
103
- isFeatureEnabled(key: string): Promise<boolean>;
104
- /** The assigned variation for one flag, or null when the flag is unknown or
105
- * carries no variations. Records the exposure either way. */
106
- getVariant(key: string): Promise<FlagVariant | null>;
107
- getVariantLocal(key: string, context?: LocalFlagContext): Promise<FlagVariant | null>;
108
- private recordExposure;
109
- getCachedFlag(key: string): boolean | undefined;
110
- getLocalFlags(context?: LocalFlagContext): Promise<Record<string, boolean>>;
111
- isFeatureEnabledLocal(key: string, context?: LocalFlagContext): Promise<boolean>;
112
- /** The evaluation context for a local read. Memberships come from the caller
113
- * when supplied, else from the server once per distinct id per snapshot
114
- * TTL, and only when the snapshot names a cohort at all. */
115
- private localContext;
116
- private flagSnapshot;
117
- /** Opens the flag stream once, when streaming was asked for and the snapshot
118
- * names a gateway. A pushed change drops the cached snapshot and refetches
119
- * it; a refused handshake stays closed, a dropped one reopens. */
120
- private maybeStream;
121
- getInbox(): Promise<InboxMessage[]>;
122
- markMessageRead(messageId: string): Promise<void>;
123
- flush(): Promise<void>;
124
- reset(): void;
125
- shutdown(): Promise<void>;
126
- private enqueue;
127
- private persistQueue;
128
- private restoreQueue;
129
- private startTimer;
130
- private stopTimer;
131
- private persistKey;
132
- }
133
- declare function createClient(config: ProdantixConfig): ProdantixClient;
134
-
135
- export { type CaptureOptions as C, type IdentifyOptions as I, type LocalFlagContext as L, ProdantixClient as P, createClient as c };