@vrplatform/log 2.0.0-alpha.11 → 2.0.0-alpha.12
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/build/main/tracking/index.d.ts +4 -2
- package/build/main/tracking/index.js +8 -4
- package/build/main/tracking/index.js.map +1 -1
- package/build/module/tracking/index.d.ts +4 -2
- package/build/module/tracking/index.js +8 -4
- package/build/module/tracking/index.js.map +1 -1
- package/package.json +1 -1
- package/src/tracking/index.ts +40 -37
|
@@ -36,14 +36,16 @@ export declare const useTracking: ({ dataset, env, name }: TrackingProps, isDev?
|
|
|
36
36
|
event: TrackingEvent;
|
|
37
37
|
properties: Record<string, string | number | boolean | null | undefined>;
|
|
38
38
|
}) => Promise<void>;
|
|
39
|
-
identify: ({ traits, userId, disableGeoip, }: {
|
|
39
|
+
identify: ({ traits, userId, disableGeoip, timestamp, }: {
|
|
40
40
|
userId: string;
|
|
41
41
|
traits: Record<string, any>;
|
|
42
42
|
disableGeoip?: boolean;
|
|
43
|
+
timestamp?: Date;
|
|
43
44
|
}) => void;
|
|
44
|
-
group: ({ traits, groupId, userId, anonymousId, }: OptionalUser<{
|
|
45
|
+
group: ({ traits, groupId, userId, anonymousId, timestamp, }: OptionalUser<{
|
|
45
46
|
groupId: string;
|
|
46
47
|
traits?: Record<string, any>;
|
|
48
|
+
timestamp?: Date;
|
|
47
49
|
}>) => void;
|
|
48
50
|
shutdown: () => Promise<[void | undefined, void | undefined, void]>;
|
|
49
51
|
alias: ((data: {
|
|
@@ -61,7 +61,7 @@ const useTracking = ({ dataset, env, name }, isDev) => {
|
|
|
61
61
|
console.error(error);
|
|
62
62
|
}
|
|
63
63
|
},
|
|
64
|
-
identify: ({ traits, userId, disableGeoip, }) => {
|
|
64
|
+
identify: ({ traits, userId, disableGeoip, timestamp, }) => {
|
|
65
65
|
if (isDev || isTest(userId))
|
|
66
66
|
return;
|
|
67
67
|
posthog?.identify({
|
|
@@ -72,12 +72,13 @@ const useTracking = ({ dataset, env, name }, isDev) => {
|
|
|
72
72
|
juneso?.identify({
|
|
73
73
|
userId,
|
|
74
74
|
traits,
|
|
75
|
+
timestamp,
|
|
75
76
|
}, (err) => {
|
|
76
77
|
if (err)
|
|
77
78
|
console.error(err);
|
|
78
79
|
});
|
|
79
80
|
},
|
|
80
|
-
group: ({ traits, groupId, userId, anonymousId, }) => {
|
|
81
|
+
group: ({ traits, groupId, userId, anonymousId, timestamp, }) => {
|
|
81
82
|
if (isDev || isTest(userId || anonymousId || '', groupId))
|
|
82
83
|
return;
|
|
83
84
|
posthog?.groupIdentify({
|
|
@@ -87,9 +88,12 @@ const useTracking = ({ dataset, env, name }, isDev) => {
|
|
|
87
88
|
distinctId: userId,
|
|
88
89
|
});
|
|
89
90
|
if (anonymousId)
|
|
90
|
-
juneso?.group({ anonymousId, groupId, traits }, (err) =>
|
|
91
|
+
juneso?.group({ anonymousId, groupId, traits, timestamp }, (err) => {
|
|
92
|
+
if (err)
|
|
93
|
+
console.error(err);
|
|
94
|
+
});
|
|
91
95
|
else if (userId)
|
|
92
|
-
juneso?.group({ userId, groupId, traits }, (err) => {
|
|
96
|
+
juneso?.group({ userId, groupId, traits, timestamp }, (err) => {
|
|
93
97
|
if (err)
|
|
94
98
|
console.error(err);
|
|
95
99
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"src/","sources":["tracking/index.ts"],"names":[],"mappings":";;;AAAA,4DAAoD;AACpD,+CAAuC;AACvC,gCAAgC;AAChC,yCAAyC;AAEzC,MAAM,cAAc,GAAG;IACrB,sCAAsC,EAAE,4BAA4B;IACpE,sCAAsC,EAAE,iCAAiC;IACzE,sCAAsC,EAAE,gCAAgC;IACxE,sCAAsC,EAAE,2BAA2B;CACpE,CAAC;AACF,MAAM,cAAc,GAAG;IACrB,sCAAsC,EAAE,wBAAwB;IAChE,sCAAsC,EAAE,oBAAoB;CAC7D,CAAC;AAEF,MAAM,MAAM,GAAG,C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OAAO,EAAE,gBAAgB;QAC3C,4BAA4B;QAC5B,QAAQ;QACR,OAAO;QACP,IAAI,EAAE,MAAM;QACZ,GAAG,EAAE,KAAK;KACX,CAAC;AACJ,CAAC,CAAC;AApIW,QAAA,WAAW,eAoItB"}
|
|
@@ -36,14 +36,16 @@ export declare const useTracking: ({ dataset, env, name }: TrackingProps, isDev?
|
|
|
36
36
|
event: TrackingEvent;
|
|
37
37
|
properties: Record<string, string | number | boolean | null | undefined>;
|
|
38
38
|
}) => Promise<void>;
|
|
39
|
-
identify: ({ traits, userId, disableGeoip, }: {
|
|
39
|
+
identify: ({ traits, userId, disableGeoip, timestamp, }: {
|
|
40
40
|
userId: string;
|
|
41
41
|
traits: Record<string, any>;
|
|
42
42
|
disableGeoip?: boolean;
|
|
43
|
+
timestamp?: Date;
|
|
43
44
|
}) => void;
|
|
44
|
-
group: ({ traits, groupId, userId, anonymousId, }: OptionalUser<{
|
|
45
|
+
group: ({ traits, groupId, userId, anonymousId, timestamp, }: OptionalUser<{
|
|
45
46
|
groupId: string;
|
|
46
47
|
traits?: Record<string, any>;
|
|
48
|
+
timestamp?: Date;
|
|
47
49
|
}>) => void;
|
|
48
50
|
shutdown: () => Promise<[void | undefined, void | undefined, void]>;
|
|
49
51
|
alias: ((data: {
|
|
@@ -58,7 +58,7 @@ export const useTracking = ({ dataset, env, name }, isDev) => {
|
|
|
58
58
|
console.error(error);
|
|
59
59
|
}
|
|
60
60
|
},
|
|
61
|
-
identify: ({ traits, userId, disableGeoip, }) => {
|
|
61
|
+
identify: ({ traits, userId, disableGeoip, timestamp, }) => {
|
|
62
62
|
if (isDev || isTest(userId))
|
|
63
63
|
return;
|
|
64
64
|
posthog?.identify({
|
|
@@ -69,12 +69,13 @@ export const useTracking = ({ dataset, env, name }, isDev) => {
|
|
|
69
69
|
juneso?.identify({
|
|
70
70
|
userId,
|
|
71
71
|
traits,
|
|
72
|
+
timestamp,
|
|
72
73
|
}, (err) => {
|
|
73
74
|
if (err)
|
|
74
75
|
console.error(err);
|
|
75
76
|
});
|
|
76
77
|
},
|
|
77
|
-
group: ({ traits, groupId, userId, anonymousId, }) => {
|
|
78
|
+
group: ({ traits, groupId, userId, anonymousId, timestamp, }) => {
|
|
78
79
|
if (isDev || isTest(userId || anonymousId || '', groupId))
|
|
79
80
|
return;
|
|
80
81
|
posthog?.groupIdentify({
|
|
@@ -84,9 +85,12 @@ export const useTracking = ({ dataset, env, name }, isDev) => {
|
|
|
84
85
|
distinctId: userId,
|
|
85
86
|
});
|
|
86
87
|
if (anonymousId)
|
|
87
|
-
juneso?.group({ anonymousId, groupId, traits }, (err) =>
|
|
88
|
+
juneso?.group({ anonymousId, groupId, traits, timestamp }, (err) => {
|
|
89
|
+
if (err)
|
|
90
|
+
console.error(err);
|
|
91
|
+
});
|
|
88
92
|
else if (userId)
|
|
89
|
-
juneso?.group({ userId, groupId, traits }, (err) => {
|
|
93
|
+
juneso?.group({ userId, groupId, traits, timestamp }, (err) => {
|
|
90
94
|
if (err)
|
|
91
95
|
console.error(err);
|
|
92
96
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"src/","sources":["tracking/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAEzC,MAAM,cAAc,GAAG;IACrB,sCAAsC,EAAE,4BAA4B;IACpE,sCAAsC,EAAE,iCAAiC;IACzE,sCAAsC,EAAE,gCAAgC;IACxE,sCAAsC,EAAE,2BAA2B;CACpE,CAAC;AACF,MAAM,cAAc,GAAG;IACrB,sCAAsC,EAAE,wBAAwB;IAChE,sCAAsC,EAAE,oBAAoB;CAC7D,CAAC;AAEF,MAAM,MAAM,GAAG,CAAC,MAAc,E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a,EAAE;YACvB,KAAK,EAAE,KAAK,EAAE;SACf,CAAC;QACJ,mBAAmB;QACnB,KAAK,EAAE,OAAO,EAAE,KAAK;QACrB,gBAAgB,EAAE,OAAO,EAAE,gBAAgB;QAC3C,4BAA4B;QAC5B,QAAQ;QACR,OAAO;QACP,IAAI,EAAE,MAAM;QACZ,GAAG,EAAE,KAAK;KACX,CAAC;AACJ,CAAC,CAAC"}
|
package/package.json
CHANGED
package/src/tracking/index.ts
CHANGED
|
@@ -23,18 +23,18 @@ type AuthEvent =
|
|
|
23
23
|
| 'account_signup_code_requested'
|
|
24
24
|
| 'account_signup_code_completed'
|
|
25
25
|
| 'account_signup_code_failed'
|
|
26
|
-
| 'account_signup_completed'
|
|
26
|
+
| 'account_signup_completed'
|
|
27
27
|
| 'account_password_reset_requested'
|
|
28
28
|
| 'account_password_reset_failed'
|
|
29
29
|
| 'account_password_reset_completed'
|
|
30
|
-
| 'account_invitation_accepted'
|
|
31
|
-
| 'account_signed_out';
|
|
30
|
+
| 'account_invitation_accepted'
|
|
31
|
+
| 'account_signed_out';
|
|
32
32
|
|
|
33
33
|
type TeamEvent =
|
|
34
34
|
| 'team_added'
|
|
35
35
|
| 'team_info_updated'
|
|
36
36
|
| 'team_deleted'
|
|
37
|
-
| 'team_member_removed';
|
|
37
|
+
| 'team_member_removed';
|
|
38
38
|
|
|
39
39
|
type ConnectionEvent =
|
|
40
40
|
| 'connection_created'
|
|
@@ -51,19 +51,19 @@ type OwnerEvent =
|
|
|
51
51
|
| 'owner_created'
|
|
52
52
|
| 'owner_updated'
|
|
53
53
|
| 'owner_deleted'
|
|
54
|
-
| 'owner_tax_info_modal_opened'
|
|
55
|
-
| 'owner_tax_info_modal_submitted';
|
|
54
|
+
| 'owner_tax_info_modal_opened'
|
|
55
|
+
| 'owner_tax_info_modal_submitted';
|
|
56
56
|
|
|
57
57
|
type SetupEvent =
|
|
58
|
-
| 'setup_classes_set'
|
|
59
|
-
| 'setup_accounting_version_completed'
|
|
60
|
-
| 'setup_accounting_config_completed'
|
|
61
|
-
| 'setup_owner_imported'
|
|
62
|
-
| 'setup_listing_imported';
|
|
58
|
+
| 'setup_classes_set'
|
|
59
|
+
| 'setup_accounting_version_completed'
|
|
60
|
+
| 'setup_accounting_config_completed'
|
|
61
|
+
| 'setup_owner_imported'
|
|
62
|
+
| 'setup_listing_imported';
|
|
63
63
|
|
|
64
64
|
type AutomationEvent =
|
|
65
65
|
| 'automation_created'
|
|
66
|
-
| 'automation_updated'
|
|
66
|
+
| 'automation_updated'
|
|
67
67
|
| 'automation_deleted';
|
|
68
68
|
|
|
69
69
|
type TaxStatementEvent =
|
|
@@ -71,30 +71,28 @@ type TaxStatementEvent =
|
|
|
71
71
|
| 'tax_statement_downloaded';
|
|
72
72
|
|
|
73
73
|
type GLOwnerStatementEvent =
|
|
74
|
-
| 'gl_owner_statement_preview_opened'
|
|
75
|
-
| 'gl_owner_statement_downloaded';
|
|
74
|
+
| 'gl_owner_statement_preview_opened'
|
|
75
|
+
| 'gl_owner_statement_downloaded';
|
|
76
76
|
|
|
77
77
|
type HyperlineEvent =
|
|
78
|
-
| 'hyperline_invoice_ready'
|
|
79
|
-
| 'hyperline_invoice_settled'
|
|
80
|
-
| 'hyperline_trial_started'
|
|
81
|
-
| 'hyperline_trial_ended'
|
|
82
|
-
| 'hyperline_subscription_activated'
|
|
83
|
-
| 'hyperline_subscription_cancelled'
|
|
84
|
-
| 'hyperline_subscription_created'
|
|
85
|
-
| 'hyperline_subscription_errored'
|
|
86
|
-
| 'hyperline_subscription_paused'
|
|
87
|
-
| 'hyperline_subscription_voided'
|
|
88
|
-
| 'hyperline_subscription_charged'
|
|
89
|
-
| 'hyperline_customer_created'
|
|
90
|
-
| 'hyperline_customer_updated'
|
|
91
|
-
| 'hyperline_payment_method_created'
|
|
92
|
-
| 'hyperline_payment_method_errored'
|
|
93
|
-
| 'hyperline_payment_method_deleted';
|
|
78
|
+
| 'hyperline_invoice_ready'
|
|
79
|
+
| 'hyperline_invoice_settled'
|
|
80
|
+
| 'hyperline_trial_started'
|
|
81
|
+
| 'hyperline_trial_ended'
|
|
82
|
+
| 'hyperline_subscription_activated'
|
|
83
|
+
| 'hyperline_subscription_cancelled'
|
|
84
|
+
| 'hyperline_subscription_created'
|
|
85
|
+
| 'hyperline_subscription_errored'
|
|
86
|
+
| 'hyperline_subscription_paused'
|
|
87
|
+
| 'hyperline_subscription_voided'
|
|
88
|
+
| 'hyperline_subscription_charged'
|
|
89
|
+
| 'hyperline_customer_created'
|
|
90
|
+
| 'hyperline_customer_updated'
|
|
91
|
+
| 'hyperline_payment_method_created'
|
|
92
|
+
| 'hyperline_payment_method_errored'
|
|
93
|
+
| 'hyperline_payment_method_deleted';
|
|
94
94
|
|
|
95
|
-
type TestEvent =
|
|
96
|
-
| 'test_event' // missing in list
|
|
97
|
-
| 'test_error'; // missing in list
|
|
95
|
+
type TestEvent = 'test_event' | 'test_error';
|
|
98
96
|
|
|
99
97
|
export type TrackingEvent =
|
|
100
98
|
| AuthEvent
|
|
@@ -193,10 +191,12 @@ export const useTracking = (
|
|
|
193
191
|
traits,
|
|
194
192
|
userId,
|
|
195
193
|
disableGeoip,
|
|
194
|
+
timestamp,
|
|
196
195
|
}: {
|
|
197
196
|
userId: string;
|
|
198
197
|
traits: Record<string, any>;
|
|
199
198
|
disableGeoip?: boolean;
|
|
199
|
+
timestamp?: Date;
|
|
200
200
|
}) => {
|
|
201
201
|
if (isDev || isTest(userId)) return;
|
|
202
202
|
|
|
@@ -209,6 +209,7 @@ export const useTracking = (
|
|
|
209
209
|
{
|
|
210
210
|
userId,
|
|
211
211
|
traits,
|
|
212
|
+
timestamp,
|
|
212
213
|
},
|
|
213
214
|
(err) => {
|
|
214
215
|
if (err) console.error(err);
|
|
@@ -220,9 +221,11 @@ export const useTracking = (
|
|
|
220
221
|
groupId,
|
|
221
222
|
userId,
|
|
222
223
|
anonymousId,
|
|
224
|
+
timestamp,
|
|
223
225
|
}: OptionalUser<{
|
|
224
226
|
groupId: string;
|
|
225
227
|
traits?: Record<string, any>;
|
|
228
|
+
timestamp?: Date;
|
|
226
229
|
}>) => {
|
|
227
230
|
if (isDev || isTest(userId || anonymousId || '', groupId)) return;
|
|
228
231
|
|
|
@@ -233,11 +236,11 @@ export const useTracking = (
|
|
|
233
236
|
distinctId: userId,
|
|
234
237
|
});
|
|
235
238
|
if (anonymousId)
|
|
236
|
-
juneso?.group({ anonymousId, groupId, traits }, (err) =>
|
|
237
|
-
console.error(err)
|
|
238
|
-
);
|
|
239
|
+
juneso?.group({ anonymousId, groupId, traits, timestamp }, (err) => {
|
|
240
|
+
if (err) console.error(err);
|
|
241
|
+
});
|
|
239
242
|
else if (userId)
|
|
240
|
-
juneso?.group({ userId, groupId, traits }, (err) => {
|
|
243
|
+
juneso?.group({ userId, groupId, traits, timestamp }, (err) => {
|
|
241
244
|
if (err) console.error(err);
|
|
242
245
|
});
|
|
243
246
|
},
|