@jitsu/protocols 1.9.11 → 1.9.13-canary.1167.20250215132227

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 CHANGED
@@ -12,12 +12,19 @@ export type WithConfidence<T> = T & {
12
12
  export type Geo = {
13
13
  continent?: {
14
14
  code: "AF" | "AN" | "AS" | "EU" | "NA" | "OC" | "SA";
15
+ /**
16
+ * Localized name of the continent
17
+ */
18
+ name: string;
15
19
  };
16
20
  country?: {
17
21
  /**
18
22
  * Two-letter country code (ISO 3166-1 alpha-2): https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2
19
23
  */
20
24
  code: string;
25
+ /**
26
+ * Localized name of the country
27
+ */
21
28
  name: string;
22
29
  isEU: boolean;
23
30
  };
@@ -27,8 +34,15 @@ export type Geo = {
27
34
  * For USA it's two-letter capitaluzed state code (such as NY)
28
35
  */
29
36
  code: string;
37
+ /**
38
+ * Localized name of the region
39
+ */
40
+ name: string;
30
41
  }>;
31
42
  city?: WithConfidence<{
43
+ /**
44
+ * Localized name of the city
45
+ */
32
46
  name: string;
33
47
  }>;
34
48
 
@@ -332,12 +346,29 @@ export type JitsuOptions = {
332
346
  * To enable debug logging
333
347
  */
334
348
  debug?: boolean;
349
+ /**
350
+ * Default payload context to be included in all requests.
351
+ * These attributes are merged with the request-specific payload context,
352
+ * allowing common or global data (e.g., browser timezone, some extra user identifier)
353
+ * to be automatically included to every request.
354
+ *
355
+ * The context can be a nested structure.
356
+ */
357
+ defaultPayloadContext?: Record<string, JSONValue>;
335
358
  /**
336
359
  * Explicitly specify cookie domain. If not set, cookie domain will be set to top level
337
360
  * of the current domain. Example: if JS lives on "app.example.com", cookie domain will be
338
361
  * set to ".example.com". If it lives on "example.com", cookie domain will be set to ".example.com" too
339
362
  */
340
363
  cookieDomain?: string;
364
+ /**
365
+ * Additional cookies to capture, where the keys are cookie names and
366
+ * the values are the corresponding cookie values. By default, the following cookies are captured:
367
+ * - Facebook: `_fbc`, `_fbp`
368
+ * - Google Analytics 4: GA4 client ID
369
+ * This property allows you to capture additional cookies beyond the defaults.
370
+ */
371
+ cookieCapture?: Record<string, string>;
341
372
  /**
342
373
  * Provide fetch implementation. It is required if you want to use Jitsu in NodeJS
343
374
  */
@@ -18,6 +18,7 @@ export type IngestMessage = {
18
18
  baseUrl: string;
19
19
  slug?: string;
20
20
  domain?: string;
21
+ classic?: boolean;
21
22
  };
22
23
  httpHeaders: Record<string, string>;
23
24
  httpPayload: any;
package/functions.d.ts CHANGED
@@ -21,7 +21,7 @@ export interface Store {
21
21
  ttl(key: string): Promise<number>;
22
22
  }
23
23
 
24
- export interface Metrics {
24
+ export interface FunctionMetrics {
25
25
  counter(name: string): {
26
26
  //increment / decrement counter. Supports negative values
27
27
  inc: (value: number) => void;
@@ -70,7 +70,7 @@ export type FunctionContext<P extends AnyProps = AnyProps> = {
70
70
  log: FunctionLogger;
71
71
  fetch: FetchType;
72
72
  store: TTLStore;
73
- metrics?: Metrics;
73
+ metrics?: FunctionMetrics;
74
74
  props: P;
75
75
  };
76
76
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jitsu/protocols",
3
- "version": "1.9.11",
3
+ "version": "1.9.13-canary.1167.20250215132227",
4
4
  "description": "",
5
5
  "author": "Jitsu Dev Team <dev@jitsu.com>",
6
6
  "publishConfig": {
package/profile.d.ts CHANGED
@@ -2,6 +2,7 @@ import { FunctionContext } from "./functions";
2
2
  import { AnalyticsServerEvent } from "./analytics";
3
3
 
4
4
  export type ProfileResult = {
5
+ profile_id?: string;
5
6
  traits: Record<string, any>;
6
7
  };
7
8