saasco-sdk 0.2.5 → 0.2.6

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/dist/index.d.cts CHANGED
@@ -39,7 +39,7 @@ type Integration = {
39
39
  /**
40
40
  * The function to track an event
41
41
  */
42
- track?: (name: string, properties?: Record<string, unknown>, context?: AnalyticsContext) => void;
42
+ track?: (name: string, properties?: Record<string, unknown>, context?: AnalyticsContext) => void | Promise<void>;
43
43
  /**
44
44
  * The function to identify a user
45
45
  */
@@ -51,6 +51,7 @@ type IntegrationState = {
51
51
  status: IntegrationStatus;
52
52
  };
53
53
  type ManagerConfig = {
54
+ deduplicationNamespace?: string;
54
55
  /**
55
56
  * Enable logger level
56
57
  */
@@ -60,7 +61,7 @@ type ManagerConfig = {
60
61
  */
61
62
  maxQueueSize?: number;
62
63
  /**
63
- * Max integration wait time, this is how long we will wait for an integration to be ready before flushing the queue. If an integration is not ready after this time it will miss any previous events.
64
+ * Max integration wait time, this is how long we will wait for an integration to be ready before flushing the queue. Unsent events expire after this time without consuming their delivery guard, so an explicit retry or page refresh can retry them.
64
65
  */
65
66
  maxIntegrationWaitTime?: number;
66
67
  /**
@@ -74,7 +75,6 @@ declare class IntegrationManager {
74
75
  private globalQueue;
75
76
  private config;
76
77
  private logger;
77
- private initTime;
78
78
  private currentEnvironment;
79
79
  private flushTimer?;
80
80
  private unloadHandler?;
@@ -96,12 +96,10 @@ declare class IntegrationManager {
96
96
  */
97
97
  private send;
98
98
  private deliver;
99
- /**
100
- * Flush queued events FIFO once at least one integration is ready.
101
- */
99
+ /** Each ready destination drains its own copy; a slow/blocked pixel cannot
100
+ * discard another pixel's queued events or hold up the ready destinations. */
102
101
  private flush;
103
102
  private readyCount;
104
- private isReady;
105
103
  /**
106
104
  * Setup periodic flushing if enabled
107
105
  */
@@ -139,6 +137,8 @@ declare global {
139
137
  }
140
138
  interface Fbq {
141
139
  (...args: unknown[]): void;
140
+ callMethod?: (...args: unknown[]) => void;
141
+ push?: (...args: unknown[]) => void;
142
142
  queue?: unknown[];
143
143
  loaded?: boolean;
144
144
  version?: string;
@@ -217,13 +217,16 @@ declare global {
217
217
  }
218
218
  interface Ttq {
219
219
  (...args: unknown[]): void;
220
+ ready?: (callback: () => void) => void;
220
221
  methods?: string[];
221
222
  _i?: Record<string, unknown>;
222
223
  _t?: Record<string, number>;
223
224
  _o?: Record<string, unknown>;
224
225
  load?: (pixelId: string, options?: Record<string, unknown>) => void;
225
226
  page?: () => void;
226
- track?: (eventName: string, properties?: Record<string, unknown>) => void;
227
+ track?: (eventName: string, properties?: Record<string, unknown>, options?: {
228
+ event_id: string;
229
+ }) => void;
227
230
  identify?: (properties?: Record<string, unknown>) => void;
228
231
  setAndDefer?: (obj: Record<string, unknown>, method: string) => void;
229
232
  instance?: (pixelId: string) => Ttq;
@@ -354,6 +357,7 @@ declare class Saasco {
354
357
  private integrationManager;
355
358
  private logger;
356
359
  private lastSupportIdentity;
360
+ private ingestFailureKeys;
357
361
  /**
358
362
  * Creates an instance of the Saasco SDK.
359
363
  * @param config Configuration options.
package/dist/index.d.ts CHANGED
@@ -39,7 +39,7 @@ type Integration = {
39
39
  /**
40
40
  * The function to track an event
41
41
  */
42
- track?: (name: string, properties?: Record<string, unknown>, context?: AnalyticsContext) => void;
42
+ track?: (name: string, properties?: Record<string, unknown>, context?: AnalyticsContext) => void | Promise<void>;
43
43
  /**
44
44
  * The function to identify a user
45
45
  */
@@ -51,6 +51,7 @@ type IntegrationState = {
51
51
  status: IntegrationStatus;
52
52
  };
53
53
  type ManagerConfig = {
54
+ deduplicationNamespace?: string;
54
55
  /**
55
56
  * Enable logger level
56
57
  */
@@ -60,7 +61,7 @@ type ManagerConfig = {
60
61
  */
61
62
  maxQueueSize?: number;
62
63
  /**
63
- * Max integration wait time, this is how long we will wait for an integration to be ready before flushing the queue. If an integration is not ready after this time it will miss any previous events.
64
+ * Max integration wait time, this is how long we will wait for an integration to be ready before flushing the queue. Unsent events expire after this time without consuming their delivery guard, so an explicit retry or page refresh can retry them.
64
65
  */
65
66
  maxIntegrationWaitTime?: number;
66
67
  /**
@@ -74,7 +75,6 @@ declare class IntegrationManager {
74
75
  private globalQueue;
75
76
  private config;
76
77
  private logger;
77
- private initTime;
78
78
  private currentEnvironment;
79
79
  private flushTimer?;
80
80
  private unloadHandler?;
@@ -96,12 +96,10 @@ declare class IntegrationManager {
96
96
  */
97
97
  private send;
98
98
  private deliver;
99
- /**
100
- * Flush queued events FIFO once at least one integration is ready.
101
- */
99
+ /** Each ready destination drains its own copy; a slow/blocked pixel cannot
100
+ * discard another pixel's queued events or hold up the ready destinations. */
102
101
  private flush;
103
102
  private readyCount;
104
- private isReady;
105
103
  /**
106
104
  * Setup periodic flushing if enabled
107
105
  */
@@ -139,6 +137,8 @@ declare global {
139
137
  }
140
138
  interface Fbq {
141
139
  (...args: unknown[]): void;
140
+ callMethod?: (...args: unknown[]) => void;
141
+ push?: (...args: unknown[]) => void;
142
142
  queue?: unknown[];
143
143
  loaded?: boolean;
144
144
  version?: string;
@@ -217,13 +217,16 @@ declare global {
217
217
  }
218
218
  interface Ttq {
219
219
  (...args: unknown[]): void;
220
+ ready?: (callback: () => void) => void;
220
221
  methods?: string[];
221
222
  _i?: Record<string, unknown>;
222
223
  _t?: Record<string, number>;
223
224
  _o?: Record<string, unknown>;
224
225
  load?: (pixelId: string, options?: Record<string, unknown>) => void;
225
226
  page?: () => void;
226
- track?: (eventName: string, properties?: Record<string, unknown>) => void;
227
+ track?: (eventName: string, properties?: Record<string, unknown>, options?: {
228
+ event_id: string;
229
+ }) => void;
227
230
  identify?: (properties?: Record<string, unknown>) => void;
228
231
  setAndDefer?: (obj: Record<string, unknown>, method: string) => void;
229
232
  instance?: (pixelId: string) => Ttq;
@@ -354,6 +357,7 @@ declare class Saasco {
354
357
  private integrationManager;
355
358
  private logger;
356
359
  private lastSupportIdentity;
360
+ private ingestFailureKeys;
357
361
  /**
358
362
  * Creates an instance of the Saasco SDK.
359
363
  * @param config Configuration options.