saasco-sdk 0.1.24 → 0.1.25

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/index.cjs.js CHANGED
@@ -6,7 +6,7 @@ var tslib = require('tslib');
6
6
  var uuid = require('@lukeed/uuid');
7
7
  var zod = require('zod');
8
8
 
9
- var version = "0.1.24";
9
+ var version = "0.1.25";
10
10
 
11
11
  const timezones = {
12
12
  'Asia/Barnaul': 'RU',
package/index.esm.js CHANGED
@@ -2,7 +2,7 @@ import { __awaiter } from 'tslib';
2
2
  import { v4 } from '@lukeed/uuid';
3
3
  import { z } from 'zod';
4
4
 
5
- var version = "0.1.24";
5
+ var version = "0.1.25";
6
6
 
7
7
  const timezones = {
8
8
  'Asia/Barnaul': 'RU',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "saasco-sdk",
3
- "version": "0.1.24",
3
+ "version": "0.1.25",
4
4
  "dependencies": {
5
5
  "tslib": "^2.3.0",
6
6
  "@lukeed/uuid": "^2.0.1",
@@ -11,11 +11,14 @@ type Identity = {
11
11
  anonymousId: string | number;
12
12
  userId?: string | number;
13
13
  };
14
+ type Context = {
15
+ active?: boolean;
16
+ };
14
17
  type TrackPayload = Identity & {
15
18
  event: string;
16
19
  sessionId?: string;
17
20
  properties?: Record<string, any>;
18
- context?: Record<string, any>;
21
+ context?: Context;
19
22
  };
20
23
  type DoRequestResponse = {
21
24
  success: boolean;
@@ -55,9 +58,7 @@ export declare class Saasco {
55
58
  * Client: track('User Signed Up', { plan: 'Pro' }, { source: 'client' })
56
59
  * Server: track({ event: 'User Signed Up', userId: 'user_123', properties: { plan: 'Pro' } })
57
60
  */
58
- track(action: string, properties?: Record<string, any>, context?: {
59
- active?: boolean;
60
- }): Promise<DoRequestResponse>;
61
+ track(action: string, properties?: Record<string, any>, context?: Context): Promise<DoRequestResponse>;
61
62
  track(payload: TrackPayload): Promise<DoRequestResponse>;
62
63
  /**
63
64
  * The page method lets you record page views on your website
@@ -75,12 +76,8 @@ export declare class Saasco {
75
76
  * @param properties A dictionary of traits you know about the user like their email, name, plan etc.
76
77
  * @param context Context for the identify call such as whether the user is active.
77
78
  */
78
- identify(properties: Record<string, any>, context?: {
79
- active?: boolean;
80
- }): Promise<DoRequestResponse>;
81
- identify(distinctId: string | number | null, properties?: Record<string, any>, context?: {
82
- active?: boolean;
83
- }): Promise<DoRequestResponse>;
79
+ identify(properties: Record<string, any>, context?: Context): Promise<DoRequestResponse>;
80
+ identify(distinctId: string | number | null, properties?: Record<string, any>, context?: Context): Promise<DoRequestResponse>;
84
81
  /**
85
82
  * This should only be called when the user logs out
86
83
  * It will reset the session, anonymous id, and user id