@vrplatform/log 2.0.61 → 2.0.63
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.js +2 -2
- package/build/main/tracking/index.js.map +1 -1
- package/build/main/tracking/mixpanel.d.ts +1 -1
- package/build/main/tracking/mixpanel.js +2 -2
- package/build/main/tracking/mixpanel.js.map +1 -1
- package/build/main/tracking/types.d.ts +78 -71
- package/build/module/tracking/index.js +2 -2
- package/build/module/tracking/index.js.map +1 -1
- package/build/module/tracking/mixpanel.d.ts +1 -1
- package/build/module/tracking/mixpanel.js +2 -2
- package/build/module/tracking/mixpanel.js.map +1 -1
- package/build/module/tracking/types.d.ts +78 -71
- package/package.json +2 -1
- package/src/tracking/index.ts +22 -15
- package/src/tracking/mixpanel.ts +10 -6
- package/src/tracking/types.ts +79 -71
|
@@ -6,7 +6,7 @@ export class MixpanelClient {
|
|
|
6
6
|
this.token = token;
|
|
7
7
|
this.baseUrl = 'https://api-eu.mixpanel.com';
|
|
8
8
|
}
|
|
9
|
-
async track(event, properties) {
|
|
9
|
+
async track(event, properties, _import = false) {
|
|
10
10
|
const data = {
|
|
11
11
|
event: event,
|
|
12
12
|
properties: {
|
|
@@ -15,7 +15,7 @@ export class MixpanelClient {
|
|
|
15
15
|
distinct_id: this.distinctId,
|
|
16
16
|
},
|
|
17
17
|
};
|
|
18
|
-
const response = await fetch(`${this.baseUrl}/track`, {
|
|
18
|
+
const response = await fetch(_import ? `${this.baseUrl}/import` : `${this.baseUrl}/track`, {
|
|
19
19
|
method: 'POST',
|
|
20
20
|
headers: { accept: 'text/plain', 'Content-Type': 'application/json' },
|
|
21
21
|
body: JSON.stringify([data]),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mixpanel.js","sourceRoot":"src/","sources":["tracking/mixpanel.ts"],"names":[],"mappings":"AAEA,MAAM,OAAO,cAAc;IACjB,KAAK,CAAS;IACd,OAAO,CAAS;IAChB,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IAAI,KAAK,CAAC,gCAAgC,CAAC,CAAC;YAEpE,OAAO,QAAQ,CAAC,EAAE,CAAC;QACrB,CAAC;KACF,CAAC;IAEF,KAAK;QACH,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;IAC9B,CAAC;CACF"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { Maybe } from '@finalytic/utils';
|
|
1
2
|
export type TrackProps<T extends TrackingEvent> = OptionalUser<{
|
|
2
3
|
groupId: string;
|
|
3
4
|
packageName: string;
|
|
@@ -5,6 +6,9 @@ export type TrackProps<T extends TrackingEvent> = OptionalUser<{
|
|
|
5
6
|
event: T;
|
|
6
7
|
properties: TrackingEventProps[T];
|
|
7
8
|
}>;
|
|
9
|
+
type MaybePartial<T> = {
|
|
10
|
+
[P in keyof T]?: Maybe<T[P]>;
|
|
11
|
+
};
|
|
8
12
|
export type IdentifyProps = {
|
|
9
13
|
userId: string;
|
|
10
14
|
traits?: {
|
|
@@ -136,45 +140,45 @@ export type TenantType = 'admin' | 'partner' | 'propertyManager';
|
|
|
136
140
|
export type TenantStatus = 'active' | 'inactive';
|
|
137
141
|
export type SubscriptionStatus = 'active' | 'cancelled' | 'draft' | 'errored' | 'paused' | 'pending' | 'voided';
|
|
138
142
|
export type OwnerStatementStatus = 'preview' | 'draft' | 'inReview' | 'void' | 'published' | 'posted';
|
|
139
|
-
export type TaxStatementStatus = 'draft' | 'ignored' | 'inReview' | 'ready' | 'submitted';
|
|
143
|
+
export type TaxStatementStatus = 'draft' | 'ignored' | 'inReview' | 'ready' | 'submitted' | 'error';
|
|
140
144
|
export type PaymentMethodType = 'card' | 'direct_debit' | 'direct_debit_ach' | 'direct_debit_bacs' | 'transfer' | 'transfer_automated' | 'external';
|
|
141
|
-
type AccountInvitationAcceptedProps =
|
|
145
|
+
type AccountInvitationAcceptedProps = MaybePartial<{
|
|
142
146
|
userId: string;
|
|
143
147
|
userEmail: string;
|
|
144
148
|
userRole: 'owner' | 'user' | 'admin';
|
|
145
149
|
tenantId: string;
|
|
146
150
|
isNewUser: boolean;
|
|
147
151
|
}>;
|
|
148
|
-
type AccountPasswordResetCompletedProps =
|
|
152
|
+
type AccountPasswordResetCompletedProps = MaybePartial<{
|
|
149
153
|
userEmail: string;
|
|
150
154
|
}>;
|
|
151
|
-
type AccountPasswordResetFailedProps =
|
|
155
|
+
type AccountPasswordResetFailedProps = MaybePartial<{
|
|
152
156
|
userEmail: string;
|
|
153
157
|
status: 'needs_second_factor' | 'needs_identifier' | 'needs_first_factor' | 'needs_new_password' | null | any;
|
|
154
158
|
}>;
|
|
155
|
-
type AccountPasswordResetRequestedProps =
|
|
159
|
+
type AccountPasswordResetRequestedProps = MaybePartial<{
|
|
156
160
|
userEmail: string;
|
|
157
161
|
}>;
|
|
158
|
-
type AccountSignedOutProps =
|
|
162
|
+
type AccountSignedOutProps = MaybePartial<{
|
|
159
163
|
userId: string;
|
|
160
164
|
userEmail: string;
|
|
161
165
|
tenantId: string;
|
|
162
166
|
firstName: string;
|
|
163
167
|
lastName: string;
|
|
164
168
|
}>;
|
|
165
|
-
type AccountSigninCompletedProps =
|
|
169
|
+
type AccountSigninCompletedProps = MaybePartial<{
|
|
166
170
|
firstName: string;
|
|
167
171
|
lastName: string;
|
|
168
172
|
userEmail: string;
|
|
169
173
|
}>;
|
|
170
|
-
type AccountSignupCodeCompletedProps =
|
|
174
|
+
type AccountSignupCodeCompletedProps = MaybePartial<{
|
|
171
175
|
firstName: string;
|
|
172
176
|
lastName: string;
|
|
173
177
|
userEmail: string;
|
|
174
178
|
companyName: string;
|
|
175
179
|
type: 'property_manager' | 'partner';
|
|
176
180
|
}>;
|
|
177
|
-
type AccountSignupCodeFailedProps =
|
|
181
|
+
type AccountSignupCodeFailedProps = MaybePartial<{
|
|
178
182
|
firstName: string;
|
|
179
183
|
lastName: string;
|
|
180
184
|
userEmail: string;
|
|
@@ -182,21 +186,21 @@ type AccountSignupCodeFailedProps = Partial<{
|
|
|
182
186
|
type: 'property_manager' | 'partner';
|
|
183
187
|
status: 'missing_requirements' | 'abandoned' | null | any;
|
|
184
188
|
}>;
|
|
185
|
-
type AccountSignupCodeRequestedProps =
|
|
189
|
+
type AccountSignupCodeRequestedProps = MaybePartial<{
|
|
186
190
|
firstName: string;
|
|
187
191
|
lastName: string;
|
|
188
192
|
userEmail: string;
|
|
189
193
|
companyName: string;
|
|
190
194
|
type: 'property_manager' | 'partner';
|
|
191
195
|
}>;
|
|
192
|
-
type AccountSignupCompletedProps =
|
|
196
|
+
type AccountSignupCompletedProps = MaybePartial<{
|
|
193
197
|
tenantId: string;
|
|
194
198
|
userEmail: string;
|
|
195
199
|
firstName: string;
|
|
196
200
|
lastName: string;
|
|
197
201
|
userId: string;
|
|
198
202
|
}>;
|
|
199
|
-
type AutomationCreatedProps =
|
|
203
|
+
type AutomationCreatedProps = MaybePartial<{
|
|
200
204
|
automationId: string;
|
|
201
205
|
templateId: string;
|
|
202
206
|
type?: string | null;
|
|
@@ -205,7 +209,7 @@ type AutomationCreatedProps = Partial<{
|
|
|
205
209
|
userEmail: string;
|
|
206
210
|
tenantId: string;
|
|
207
211
|
}>;
|
|
208
|
-
type AutomationDeletedProps =
|
|
212
|
+
type AutomationDeletedProps = MaybePartial<{
|
|
209
213
|
automationId: string;
|
|
210
214
|
templateId: string;
|
|
211
215
|
type?: string | null;
|
|
@@ -215,7 +219,7 @@ type AutomationDeletedProps = Partial<{
|
|
|
215
219
|
tenantId: string;
|
|
216
220
|
}>;
|
|
217
221
|
type AutomationUpdatedProps = any;
|
|
218
|
-
type ConnectionCreatedProps =
|
|
222
|
+
type ConnectionCreatedProps = MaybePartial<{
|
|
219
223
|
connectionId: string;
|
|
220
224
|
tenantId: string;
|
|
221
225
|
userId: string;
|
|
@@ -223,7 +227,7 @@ type ConnectionCreatedProps = Partial<{
|
|
|
223
227
|
appId: string;
|
|
224
228
|
type?: string;
|
|
225
229
|
}>;
|
|
226
|
-
type ConnectionDeletedProps =
|
|
230
|
+
type ConnectionDeletedProps = MaybePartial<{
|
|
227
231
|
connectionId: string;
|
|
228
232
|
tenantId: string;
|
|
229
233
|
type?: string;
|
|
@@ -231,32 +235,32 @@ type ConnectionDeletedProps = Partial<{
|
|
|
231
235
|
appId: string;
|
|
232
236
|
userEmail: string;
|
|
233
237
|
}>;
|
|
234
|
-
type ConnectionReconnectedProps =
|
|
238
|
+
type ConnectionReconnectedProps = MaybePartial<{
|
|
235
239
|
connectionId: string;
|
|
236
240
|
tenantId: string;
|
|
237
241
|
userId: string;
|
|
238
242
|
userEmail: string;
|
|
239
243
|
appId: string;
|
|
240
244
|
}>;
|
|
241
|
-
type ConnectionRequestedProps =
|
|
245
|
+
type ConnectionRequestedProps = MaybePartial<{
|
|
242
246
|
type: 'PMS' | 'Accounting';
|
|
243
247
|
website: string;
|
|
244
248
|
userId: string;
|
|
245
249
|
userEmail: string;
|
|
246
250
|
tenantId: string;
|
|
247
251
|
}>;
|
|
248
|
-
type GlOwnerStatementDownloadedProps =
|
|
252
|
+
type GlOwnerStatementDownloadedProps = MaybePartial<{
|
|
249
253
|
ownerStatementId: string;
|
|
250
254
|
ownerStatementUrls: string[];
|
|
251
255
|
userType: 'owner' | 'property_manager';
|
|
252
256
|
}>;
|
|
253
|
-
type GlOwnerStatementPreviewOpenedProps =
|
|
257
|
+
type GlOwnerStatementPreviewOpenedProps = MaybePartial<{
|
|
254
258
|
ownerStatementStatus: string;
|
|
255
259
|
ownerStatementId: string;
|
|
256
260
|
ownerStatementUrls: string[];
|
|
257
261
|
userType: 'owner' | 'property_manager';
|
|
258
262
|
}>;
|
|
259
|
-
type HyperlineCustomerCreatedProps =
|
|
263
|
+
type HyperlineCustomerCreatedProps = MaybePartial<{
|
|
260
264
|
tenantId: string;
|
|
261
265
|
customerId: string;
|
|
262
266
|
billingEmail: string;
|
|
@@ -264,9 +268,8 @@ type HyperlineCustomerCreatedProps = Partial<{
|
|
|
264
268
|
externalId: string;
|
|
265
269
|
name: string;
|
|
266
270
|
vatNumber: string;
|
|
267
|
-
webhookEventType: 'customer.created';
|
|
268
271
|
}>;
|
|
269
|
-
type HyperlineCustomerUpdatedProps =
|
|
272
|
+
type HyperlineCustomerUpdatedProps = MaybePartial<{
|
|
270
273
|
tenantId: string;
|
|
271
274
|
customerId: string;
|
|
272
275
|
billingEmail: string;
|
|
@@ -274,9 +277,8 @@ type HyperlineCustomerUpdatedProps = Partial<{
|
|
|
274
277
|
externalId: string;
|
|
275
278
|
name: string;
|
|
276
279
|
vatNumber: string;
|
|
277
|
-
webhookEventType: 'customer.updated';
|
|
278
280
|
}>;
|
|
279
|
-
type HyperlineInvoiceErroredProps =
|
|
281
|
+
type HyperlineInvoiceErroredProps = MaybePartial<{
|
|
280
282
|
status: 'errored';
|
|
281
283
|
paymentMethodType: string;
|
|
282
284
|
invoiceId: string;
|
|
@@ -285,7 +287,7 @@ type HyperlineInvoiceErroredProps = Partial<{
|
|
|
285
287
|
customerId: string;
|
|
286
288
|
erroredAt: string;
|
|
287
289
|
}>;
|
|
288
|
-
type HyperlineInvoiceReadyProps =
|
|
290
|
+
type HyperlineInvoiceReadyProps = MaybePartial<{
|
|
289
291
|
status: 'ready';
|
|
290
292
|
paymentMethodType: string;
|
|
291
293
|
invoiceId: string;
|
|
@@ -296,7 +298,7 @@ type HyperlineInvoiceReadyProps = Partial<{
|
|
|
296
298
|
taxAmount: number;
|
|
297
299
|
readyAt: string;
|
|
298
300
|
}>;
|
|
299
|
-
type HyperlineInvoiceSettledProps =
|
|
301
|
+
type HyperlineInvoiceSettledProps = MaybePartial<{
|
|
300
302
|
status: 'settled';
|
|
301
303
|
paymentMethodType: string;
|
|
302
304
|
invoiceId: string;
|
|
@@ -307,7 +309,7 @@ type HyperlineInvoiceSettledProps = Partial<{
|
|
|
307
309
|
taxAmount: number;
|
|
308
310
|
settledAt: string;
|
|
309
311
|
}>;
|
|
310
|
-
type HyperlineInvoiceVoidedProps =
|
|
312
|
+
type HyperlineInvoiceVoidedProps = MaybePartial<{
|
|
311
313
|
status: 'voided';
|
|
312
314
|
paymentMethodType: string;
|
|
313
315
|
invoiceId: string;
|
|
@@ -316,43 +318,39 @@ type HyperlineInvoiceVoidedProps = Partial<{
|
|
|
316
318
|
customerId: string;
|
|
317
319
|
voidedAt: string;
|
|
318
320
|
}>;
|
|
319
|
-
type HyperlinePaymentMethodCreatedProps =
|
|
321
|
+
type HyperlinePaymentMethodCreatedProps = MaybePartial<{
|
|
320
322
|
tenantId: string;
|
|
321
323
|
subscriptionStartDate: string;
|
|
322
324
|
paymentMethodType: PaymentMethodType;
|
|
323
325
|
subscriptionStatus: SubscriptionStatus;
|
|
324
326
|
subscriptionId: string;
|
|
325
327
|
customerId: string;
|
|
326
|
-
webhookEventType: 'payment_method.created';
|
|
327
328
|
}>;
|
|
328
|
-
type HyperlinePaymentMethodDeletedProps =
|
|
329
|
+
type HyperlinePaymentMethodDeletedProps = MaybePartial<{
|
|
329
330
|
tenantId: string;
|
|
330
331
|
subscriptionStartDate: string;
|
|
331
332
|
paymentMethodType: PaymentMethodType;
|
|
332
333
|
subscriptionStatus: SubscriptionStatus;
|
|
333
334
|
subscriptionId: string;
|
|
334
335
|
customerId: string;
|
|
335
|
-
webhookEventType: 'payment_method.deleted';
|
|
336
336
|
}>;
|
|
337
|
-
type HyperlinePaymentMethodErroredProps =
|
|
337
|
+
type HyperlinePaymentMethodErroredProps = MaybePartial<{
|
|
338
338
|
tenantId: string;
|
|
339
339
|
subscriptionStartDate: string;
|
|
340
340
|
paymentMethodType: PaymentMethodType;
|
|
341
341
|
subscriptionStatus: SubscriptionStatus;
|
|
342
342
|
subscriptionId: string;
|
|
343
343
|
customerId: string;
|
|
344
|
-
webhookEventType: 'payment_method.errored';
|
|
345
344
|
}>;
|
|
346
|
-
type HyperlineSubscriptionCancellationScheduledProps =
|
|
345
|
+
type HyperlineSubscriptionCancellationScheduledProps = MaybePartial<{
|
|
347
346
|
subscriptionId: string;
|
|
348
347
|
cancellationStrategy: 'charge_prorata' | 'charge_custom' | 'refund_prorata' | 'refund_custom' | 'end_of_period' | 'do_nothing';
|
|
349
348
|
cancelledAt: string;
|
|
350
349
|
mrr: number;
|
|
351
350
|
customerId: string;
|
|
352
351
|
tenantId: string;
|
|
353
|
-
webhookEventType: 'subscription.cancellation_scheduled';
|
|
354
352
|
}>;
|
|
355
|
-
type HyperlineSubscriptionChargedProps =
|
|
353
|
+
type HyperlineSubscriptionChargedProps = MaybePartial<{
|
|
356
354
|
plan: string;
|
|
357
355
|
subscriptionId: string;
|
|
358
356
|
subscriptionStartDate: string;
|
|
@@ -360,7 +358,7 @@ type HyperlineSubscriptionChargedProps = Partial<{
|
|
|
360
358
|
paymentMethodType: string;
|
|
361
359
|
customerId: string;
|
|
362
360
|
}>;
|
|
363
|
-
type HyperlineSubscriptionCreatedProps =
|
|
361
|
+
type HyperlineSubscriptionCreatedProps = MaybePartial<{
|
|
364
362
|
trialStartDate: string;
|
|
365
363
|
plan: string;
|
|
366
364
|
subscriptionId: string;
|
|
@@ -369,7 +367,7 @@ type HyperlineSubscriptionCreatedProps = Partial<{
|
|
|
369
367
|
paymentMethodType: string;
|
|
370
368
|
customerId: string;
|
|
371
369
|
}>;
|
|
372
|
-
type HyperlineSubscriptionStatusChangedProps =
|
|
370
|
+
type HyperlineSubscriptionStatusChangedProps = MaybePartial<{
|
|
373
371
|
subscriptionId: string;
|
|
374
372
|
plan: string;
|
|
375
373
|
tenantId: string;
|
|
@@ -380,7 +378,7 @@ type HyperlineSubscriptionStatusChangedProps = Partial<{
|
|
|
380
378
|
mrr: number;
|
|
381
379
|
customerId: string;
|
|
382
380
|
}>;
|
|
383
|
-
type HyperlineTrialEndedProps =
|
|
381
|
+
type HyperlineTrialEndedProps = MaybePartial<{
|
|
384
382
|
trialStartDate: string;
|
|
385
383
|
trialEndDate: string;
|
|
386
384
|
plan: string;
|
|
@@ -389,13 +387,12 @@ type HyperlineTrialEndedProps = Partial<{
|
|
|
389
387
|
subscriptionStatus: SubscriptionStatus;
|
|
390
388
|
paymentMethodType: PaymentMethodType;
|
|
391
389
|
}>;
|
|
392
|
-
type HyperlineTrialStartedProps =
|
|
390
|
+
type HyperlineTrialStartedProps = MaybePartial<{
|
|
393
391
|
tenantId: string;
|
|
394
392
|
subscriptionStatus: SubscriptionStatus;
|
|
395
393
|
trialUntil: string;
|
|
396
|
-
webhookEventType: 'payment_method.created';
|
|
397
394
|
}>;
|
|
398
|
-
type OwnerCreatedProps =
|
|
395
|
+
type OwnerCreatedProps = MaybePartial<{
|
|
399
396
|
userId: string;
|
|
400
397
|
tenantId: string;
|
|
401
398
|
ownerId: string;
|
|
@@ -403,7 +400,7 @@ type OwnerCreatedProps = Partial<{
|
|
|
403
400
|
withUserInvite: boolean;
|
|
404
401
|
userEmail: string;
|
|
405
402
|
}>;
|
|
406
|
-
type OwnerDeletedProps =
|
|
403
|
+
type OwnerDeletedProps = MaybePartial<{
|
|
407
404
|
userId: string;
|
|
408
405
|
tenantId: string;
|
|
409
406
|
ownerId: string;
|
|
@@ -411,18 +408,18 @@ type OwnerDeletedProps = Partial<{
|
|
|
411
408
|
listingId: string;
|
|
412
409
|
ownershipId: string;
|
|
413
410
|
}>;
|
|
414
|
-
type OwnerTaxInfoModalOpenedProps =
|
|
411
|
+
type OwnerTaxInfoModalOpenedProps = MaybePartial<{
|
|
415
412
|
flag: string;
|
|
416
413
|
}>;
|
|
417
|
-
type OwnerTaxInfoModalSubmittedProps =
|
|
414
|
+
type OwnerTaxInfoModalSubmittedProps = MaybePartial<{
|
|
418
415
|
flag: string;
|
|
419
416
|
}>;
|
|
420
|
-
type OwnerUpdatedProps =
|
|
417
|
+
type OwnerUpdatedProps = MaybePartial<{
|
|
421
418
|
userId: string;
|
|
422
419
|
tenantId: string;
|
|
423
420
|
ownerId: string;
|
|
424
421
|
}>;
|
|
425
|
-
type OwnershipCreatedProps =
|
|
422
|
+
type OwnershipCreatedProps = MaybePartial<{
|
|
426
423
|
ownershipId: string;
|
|
427
424
|
ownerId: string;
|
|
428
425
|
listingId: string;
|
|
@@ -430,7 +427,7 @@ type OwnershipCreatedProps = Partial<{
|
|
|
430
427
|
userEmail: string;
|
|
431
428
|
tenantId: string;
|
|
432
429
|
}>;
|
|
433
|
-
type OwnershipDeletedProps =
|
|
430
|
+
type OwnershipDeletedProps = MaybePartial<{
|
|
434
431
|
ownershipId: string;
|
|
435
432
|
ownerId: string;
|
|
436
433
|
listingId: string;
|
|
@@ -438,7 +435,7 @@ type OwnershipDeletedProps = Partial<{
|
|
|
438
435
|
userEmail: string;
|
|
439
436
|
tenantId: string;
|
|
440
437
|
}>;
|
|
441
|
-
type OwnershipUpdatedProps =
|
|
438
|
+
type OwnershipUpdatedProps = MaybePartial<{
|
|
442
439
|
ownershipId: string;
|
|
443
440
|
ownerId: string;
|
|
444
441
|
listingId: string;
|
|
@@ -450,17 +447,17 @@ type SetupAccountingConfigCompletedProps = any;
|
|
|
450
447
|
type SetupAccountingVersionCompletedProps = any;
|
|
451
448
|
type SetupClassesSetProps = any;
|
|
452
449
|
type SetupEntitiesSetProps = any;
|
|
453
|
-
type SetupListingImportedProps =
|
|
450
|
+
type SetupListingImportedProps = MaybePartial<{
|
|
454
451
|
appId: string;
|
|
455
452
|
}>;
|
|
456
|
-
type SetupOwnerImportedProps =
|
|
453
|
+
type SetupOwnerImportedProps = MaybePartial<{
|
|
457
454
|
appId: string;
|
|
458
455
|
}>;
|
|
459
|
-
type SetupReservationImportedProps =
|
|
456
|
+
type SetupReservationImportedProps = MaybePartial<{
|
|
460
457
|
appId: string;
|
|
461
458
|
}>;
|
|
462
459
|
type SetupVendorsSetProps = any;
|
|
463
|
-
type TaxStatementDownloadedProps =
|
|
460
|
+
type TaxStatementDownloadedProps = MaybePartial<{
|
|
464
461
|
taxStatementStatus?: TaxStatementStatus;
|
|
465
462
|
taxStatementId: string;
|
|
466
463
|
taxStatementUrl: string;
|
|
@@ -469,7 +466,7 @@ type TaxStatementDownloadedProps = Partial<{
|
|
|
469
466
|
userEmail: string;
|
|
470
467
|
tenantId: string;
|
|
471
468
|
}>;
|
|
472
|
-
type TaxStatementPreviewOpenedProps =
|
|
469
|
+
type TaxStatementPreviewOpenedProps = MaybePartial<{
|
|
473
470
|
taxStatementStatus?: TaxStatementStatus;
|
|
474
471
|
taxStatementId: string;
|
|
475
472
|
taxStatementUrl: string;
|
|
@@ -478,7 +475,7 @@ type TaxStatementPreviewOpenedProps = Partial<{
|
|
|
478
475
|
userEmail: string;
|
|
479
476
|
tenantId: string;
|
|
480
477
|
}>;
|
|
481
|
-
type TeamAddedProps =
|
|
478
|
+
type TeamAddedProps = MaybePartial<{
|
|
482
479
|
tenantId: string;
|
|
483
480
|
tenantName: string;
|
|
484
481
|
partnerId: string;
|
|
@@ -486,46 +483,46 @@ type TeamAddedProps = Partial<{
|
|
|
486
483
|
userId: string;
|
|
487
484
|
userEmail: string;
|
|
488
485
|
}>;
|
|
489
|
-
type TeamCanceledProps =
|
|
486
|
+
type TeamCanceledProps = MaybePartial<{
|
|
490
487
|
tenantId: string;
|
|
491
488
|
customerId: string;
|
|
492
489
|
subscriptionId: string;
|
|
493
490
|
feedback: string;
|
|
494
491
|
reason: string;
|
|
495
492
|
}>;
|
|
496
|
-
type TeamDeletedProps =
|
|
493
|
+
type TeamDeletedProps = MaybePartial<{
|
|
497
494
|
tenantId: string;
|
|
498
495
|
userId: string;
|
|
499
496
|
userEmail: string;
|
|
500
497
|
}>;
|
|
501
|
-
type TeamInfoUpdatedProps =
|
|
498
|
+
type TeamInfoUpdatedProps = MaybePartial<{
|
|
502
499
|
userId: string;
|
|
503
500
|
tenantId: string;
|
|
504
501
|
userEmail: string;
|
|
505
502
|
}>;
|
|
506
|
-
type TeamMemberRemovedProps =
|
|
503
|
+
type TeamMemberRemovedProps = MaybePartial<{
|
|
507
504
|
userId: string;
|
|
508
505
|
removedUserId: string;
|
|
509
506
|
tenantId: string;
|
|
510
507
|
userEmail: string;
|
|
511
508
|
}>;
|
|
512
|
-
type TeamReinstatedProps =
|
|
509
|
+
type TeamReinstatedProps = MaybePartial<{
|
|
513
510
|
tenantId: string;
|
|
514
511
|
subscriptionId: string;
|
|
515
512
|
}>;
|
|
516
|
-
type TestErrorProps =
|
|
513
|
+
type TestErrorProps = MaybePartial<{
|
|
517
514
|
userId: string;
|
|
518
515
|
tenantId: string;
|
|
519
516
|
[key: string]: any;
|
|
520
517
|
}>;
|
|
521
|
-
type TestEventProps =
|
|
518
|
+
type TestEventProps = MaybePartial<{
|
|
522
519
|
success: boolean;
|
|
523
520
|
[key: string]: any;
|
|
524
521
|
}>;
|
|
525
|
-
type UpdateRefreshAcceptedProps =
|
|
522
|
+
type UpdateRefreshAcceptedProps = MaybePartial<{
|
|
526
523
|
appName: string;
|
|
527
524
|
}>;
|
|
528
|
-
type OwnerStatementStatusChangedProps =
|
|
525
|
+
type OwnerStatementStatusChangedProps = MaybePartial<{
|
|
529
526
|
userId: string;
|
|
530
527
|
tenantId: string;
|
|
531
528
|
userEmail: string;
|
|
@@ -535,10 +532,20 @@ type OwnerStatementStatusChangedProps = Partial<{
|
|
|
535
532
|
startAt: string;
|
|
536
533
|
status: OwnerStatementStatus;
|
|
537
534
|
}>;
|
|
538
|
-
type ListingActivatedProps =
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
535
|
+
type ListingActivatedProps = MaybePartial<{
|
|
536
|
+
tenantId: string;
|
|
537
|
+
billingStatus: 'active' | 'inactive';
|
|
538
|
+
name: string;
|
|
539
|
+
vrpStatus: 'active' | 'disabled' | 'enabled' | 'inactive';
|
|
540
|
+
pmsStatus: string;
|
|
541
|
+
}>;
|
|
542
|
+
type ListingDeactivatedProps = ListingActivatedProps;
|
|
543
|
+
type ListingsReportedProps = MaybePartial<{
|
|
544
|
+
userId: string;
|
|
545
|
+
tenantId: string;
|
|
546
|
+
activeListings: number;
|
|
547
|
+
}>;
|
|
548
|
+
type IntercomConversationCreated = MaybePartial<{
|
|
542
549
|
userId: string;
|
|
543
550
|
tenantId: string;
|
|
544
551
|
userEmail: string;
|
|
@@ -550,14 +557,14 @@ type IntercomConversationCreated = Partial<{
|
|
|
550
557
|
submittedFrom: 'user' | 'admin';
|
|
551
558
|
}>;
|
|
552
559
|
type IntercomConversationReplied = IntercomConversationCreated;
|
|
553
|
-
type IntercomConversationClosed =
|
|
560
|
+
type IntercomConversationClosed = MaybePartial<{
|
|
554
561
|
userId: string;
|
|
555
562
|
tenantId: string;
|
|
556
563
|
userEmail: string;
|
|
557
564
|
conversationId: string;
|
|
558
565
|
createdAt: string;
|
|
559
566
|
}>;
|
|
560
|
-
type IntercomConversationRated =
|
|
567
|
+
type IntercomConversationRated = MaybePartial<{
|
|
561
568
|
userId: string;
|
|
562
569
|
tenantId: string;
|
|
563
570
|
userEmail: string;
|
|
@@ -566,7 +573,7 @@ type IntercomConversationRated = Partial<{
|
|
|
566
573
|
remark: string;
|
|
567
574
|
createdAt: string;
|
|
568
575
|
}>;
|
|
569
|
-
type MrrReportedProps =
|
|
576
|
+
type MrrReportedProps = MaybePartial<{
|
|
570
577
|
mrr: number;
|
|
571
578
|
subscriptionStatus: SubscriptionStatus;
|
|
572
579
|
}>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vrplatform/log",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.63",
|
|
4
4
|
"main": "build/main/index.js",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -23,6 +23,7 @@
|
|
|
23
23
|
"serialize-error": "11.0.3"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
|
+
"@finalytic/utils": "4.9.30",
|
|
26
27
|
"@biomejs/biome": "^1.9.4",
|
|
27
28
|
"@types/bun": "^1.1.14",
|
|
28
29
|
"typescript": "5.7.2"
|
package/src/tracking/index.ts
CHANGED
|
@@ -155,14 +155,17 @@ export const useTracking = (
|
|
|
155
155
|
|
|
156
156
|
return {
|
|
157
157
|
// General
|
|
158
|
-
track: async <T extends TrackingEvent>(
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
158
|
+
track: async <T extends TrackingEvent>(
|
|
159
|
+
{
|
|
160
|
+
userId,
|
|
161
|
+
anonymousId,
|
|
162
|
+
groupId,
|
|
163
|
+
event,
|
|
164
|
+
packageName,
|
|
165
|
+
properties,
|
|
166
|
+
}: TrackProps<T>,
|
|
167
|
+
_import = false
|
|
168
|
+
) => {
|
|
166
169
|
if (isDev || isTest(userId || anonymousId || '', groupId)) return;
|
|
167
170
|
|
|
168
171
|
const id = await client?.mutate(
|
|
@@ -180,13 +183,17 @@ export const useTracking = (
|
|
|
180
183
|
|
|
181
184
|
// track mixpanel event
|
|
182
185
|
if (mixpanel)
|
|
183
|
-
mixpanel.track(
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
186
|
+
mixpanel.track(
|
|
187
|
+
event,
|
|
188
|
+
{
|
|
189
|
+
$distinct_id: id,
|
|
190
|
+
tenant: [groupId], // assign to group
|
|
191
|
+
tenantId: groupId,
|
|
192
|
+
userId: userId,
|
|
193
|
+
...properties,
|
|
194
|
+
},
|
|
195
|
+
_import
|
|
196
|
+
);
|
|
190
197
|
|
|
191
198
|
if (userId) {
|
|
192
199
|
try {
|
package/src/tracking/mixpanel.ts
CHANGED
|
@@ -12,7 +12,8 @@ export class MixpanelClient {
|
|
|
12
12
|
|
|
13
13
|
async track<T extends keyof TrackingEventProps>(
|
|
14
14
|
event: T,
|
|
15
|
-
properties: TrackingEventProps[T]
|
|
15
|
+
properties: TrackingEventProps[T],
|
|
16
|
+
_import = false
|
|
16
17
|
) {
|
|
17
18
|
const data = {
|
|
18
19
|
event: event,
|
|
@@ -23,11 +24,14 @@ export class MixpanelClient {
|
|
|
23
24
|
},
|
|
24
25
|
};
|
|
25
26
|
|
|
26
|
-
const response = await fetch(
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
27
|
+
const response = await fetch(
|
|
28
|
+
_import ? `${this.baseUrl}/import` : `${this.baseUrl}/track`,
|
|
29
|
+
{
|
|
30
|
+
method: 'POST',
|
|
31
|
+
headers: { accept: 'text/plain', 'Content-Type': 'application/json' },
|
|
32
|
+
body: JSON.stringify([data]),
|
|
33
|
+
}
|
|
34
|
+
);
|
|
31
35
|
|
|
32
36
|
if (!response.ok) throw new Error('Failed to track event');
|
|
33
37
|
|