@jitsu/protocols 1.9.15 → 1.9.18-canary.1269.20250403142744

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
@@ -328,6 +328,7 @@ export type RuntimeFacade = {
328
328
  | undefined;
329
329
  referrer(): string | undefined;
330
330
  pageTitle(): string | undefined;
331
+ ip?(): string | undefined;
331
332
  };
332
333
 
333
334
  export type ErrorHandler = (message: string, ...args: any[]) => void;
@@ -440,18 +441,33 @@ export type Traits = {
440
441
  */
441
442
  $doNotSend?: boolean;
442
443
  };
444
+ /**
445
+ * If context is passed along with properties, it gets a special treatment. It is merged with
446
+ * default payload context and with properties. This type works as a type hint for TypeScript
447
+ */
448
+ export type PropertiesWithContext = {
449
+ context?: AnalyticsContext;
450
+ } & JSONObject;
451
+
452
+ /**
453
+ * If context is passed along with properties, it gets a special treatment. It is merged with
454
+ * default payload context and with properties. This type works as a type hint for TypeScript
455
+ */
456
+ export type TraitsWithContext = {
457
+ context?: AnalyticsContext;
458
+ } & Traits;
443
459
 
444
460
  export interface AnalyticsInterface {
445
461
  track(
446
462
  eventName: string | JSONObject,
447
- properties?: JSONObject | Callback,
463
+ properties?: JSONObject | Callback | PropertiesWithContext,
448
464
  options?: Options | Callback,
449
465
  callback?: Callback
450
466
  ): Promise<DispatchedEvent>;
451
467
 
452
468
  page(
453
- category?: string | object,
454
- name?: string | object | Callback,
469
+ category?: string | object | PropertiesWithContext,
470
+ name?: string | object | Callback | PropertiesWithContext,
455
471
  properties?: object | Options | Callback | null,
456
472
  options?: Options | Callback,
457
473
  callback?: Callback
@@ -459,12 +475,16 @@ export interface AnalyticsInterface {
459
475
 
460
476
  group(
461
477
  groupId?: ID | object,
462
- traits?: Traits | null,
478
+ traits?: Traits | TraitsWithContext | null,
463
479
  options?: Options,
464
480
  callback?: Callback
465
481
  ): Promise<DispatchedEvent>;
466
482
 
467
- identify(id?: ID | Traits, traits?: Traits | Callback | null, callback?: Callback): Promise<DispatchedEvent>;
483
+ identify(
484
+ id?: ID | Traits | TraitsWithContext,
485
+ traits?: Traits | TraitsWithContext | Callback | null,
486
+ callback?: Callback
487
+ ): Promise<DispatchedEvent>;
468
488
 
469
489
  reset(callback?: (...params: any[]) => any): Promise<any>;
470
490
 
package/functions.d.ts CHANGED
@@ -176,6 +176,8 @@ export type EventContext = {
176
176
  workspace: {
177
177
  id: string;
178
178
  };
179
+ // original receivedAt as it stamped by the ingest service;
180
+ receivedAt: Date;
179
181
  // number of retries attempted
180
182
  retries?: number;
181
183
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jitsu/protocols",
3
- "version": "1.9.15",
3
+ "version": "1.9.18-canary.1269.20250403142744",
4
4
  "description": "",
5
5
  "author": "Jitsu Dev Team <dev@jitsu.com>",
6
6
  "publishConfig": {