@jitsu/protocols 1.9.9-canary.990.20241015090416 → 1.9.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/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 & FunctionConfigContext<P>;
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jitsu/protocols",
3
- "version": "1.9.9-canary.990.20241015090416",
3
+ "version": "1.9.10",
4
4
  "description": "",
5
5
  "author": "Jitsu Dev Team <dev@jitsu.com>",
6
6
  "publishConfig": {
package/profile.d.ts CHANGED
@@ -2,15 +2,24 @@ import { FunctionContext } from "./functions";
2
2
  import { AnalyticsServerEvent } from "./analytics";
3
3
 
4
4
  export type ProfileResult = {
5
- properties: Record<string, any>;
5
+ traits: Record<string, any>;
6
6
  };
7
7
 
8
- export type ProfileFunction = (params: {
9
- context: FunctionContext;
10
- events: Iterable<AnalyticsServerEvent>;
11
- user: {
12
- id?: string;
13
- anonymousId?: string;
14
- traits: Record<string, any>;
8
+ export type ProfileUser = {
9
+ id?: string;
10
+ anonymousId?: string;
11
+ traits: Record<string, any>;
12
+ };
13
+
14
+ export type ProfileBuilderContext = {
15
+ profileBuilder: {
16
+ id: string;
17
+ version: number;
15
18
  };
16
- }) => Promise<ProfileResult | undefined>;
19
+ };
20
+
21
+ export type ProfileFunction = (
22
+ events: Iterable<AnalyticsServerEvent>,
23
+ user: ProfileUser,
24
+ context: FunctionContext & ProfileBuilderContext
25
+ ) => Promise<ProfileResult | undefined>;