@jitsu/protocols 1.9.7 → 1.9.9-canary.1019.20241028095115
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/analytics.d.ts +0 -1
- package/functions.d.ts +3 -6
- package/package.json +1 -1
- package/profile.d.ts +16 -0
- package/tsconfig.json +3 -0
package/analytics.d.ts
CHANGED
|
@@ -357,7 +357,6 @@ export type JitsuOptions = {
|
|
|
357
357
|
/**
|
|
358
358
|
* If true, events will go to s2s endpoints like ${host}/api/s/s2s/{type}. Otherwise, they'll go to ${host}/api/s/{type}.
|
|
359
359
|
*
|
|
360
|
-
* If not set at all, it will be detected automatically by presence of `window` object
|
|
361
360
|
*/
|
|
362
361
|
s2s?: boolean;
|
|
363
362
|
|
package/functions.d.ts
CHANGED
|
@@ -66,11 +66,12 @@ export type FunctionLogger<Sync extends boolean = false> = {
|
|
|
66
66
|
debug: (message: string, ...args: any[]) => void | Promise<void>;
|
|
67
67
|
error: (message: string, ...args: any[]) => void | Promise<void>;
|
|
68
68
|
};
|
|
69
|
-
export type FunctionContext = {
|
|
69
|
+
export type FunctionContext<P extends AnyProps = AnyProps> = {
|
|
70
70
|
log: FunctionLogger;
|
|
71
71
|
fetch: FetchType;
|
|
72
72
|
store: TTLStore;
|
|
73
73
|
metrics?: Metrics;
|
|
74
|
+
props: P;
|
|
74
75
|
};
|
|
75
76
|
|
|
76
77
|
export type PrivacyOpts = {
|
|
@@ -165,14 +166,10 @@ export type EventContext = {
|
|
|
165
166
|
retries?: number;
|
|
166
167
|
};
|
|
167
168
|
|
|
168
|
-
export type FunctionConfigContext<P extends AnyProps = AnyProps> = {
|
|
169
|
-
props: P;
|
|
170
|
-
};
|
|
171
|
-
|
|
172
169
|
/**
|
|
173
170
|
* Parameters for a function
|
|
174
171
|
*/
|
|
175
|
-
export type FullContext<P extends AnyProps = AnyProps> = EventContext & FunctionContext
|
|
172
|
+
export type FullContext<P extends AnyProps = AnyProps> = EventContext & FunctionContext<P>;
|
|
176
173
|
|
|
177
174
|
//equivalent to returning [] from a function
|
|
178
175
|
export type FunctionCommand = "drop";
|
package/package.json
CHANGED
package/profile.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { FunctionContext } from "./functions";
|
|
2
|
+
import { AnalyticsServerEvent } from "./analytics";
|
|
3
|
+
|
|
4
|
+
export type ProfileResult = {
|
|
5
|
+
properties: Record<string, any>;
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
export type ProfileFunction = (
|
|
9
|
+
events: Iterable<AnalyticsServerEvent>,
|
|
10
|
+
user: {
|
|
11
|
+
id?: string;
|
|
12
|
+
anonymousId?: string;
|
|
13
|
+
traits: Record<string, any>;
|
|
14
|
+
},
|
|
15
|
+
context: FunctionContext
|
|
16
|
+
) => Promise<ProfileResult | undefined>;
|
package/tsconfig.json
ADDED