@vrplatform/log 2.0.0 → 2.0.2
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/log/index.spec.d.ts +0 -0
- package/build/main/log/index.spec.js +2 -0
- package/build/main/log/index.spec.js.map +1 -0
- package/build/main/log/type.d.ts +3 -1
- package/build/main/tracking/_intercom.d.ts +109 -0
- package/build/main/tracking/_intercom.js +139 -0
- package/build/main/tracking/_intercom.js.map +1 -0
- package/build/main/tracking/eventTypes.d.ts +16 -0
- package/build/main/tracking/eventTypes.js +3 -0
- package/build/main/tracking/eventTypes.js.map +1 -0
- package/build/main/tracking/index.d.ts +96 -33
- package/build/main/tracking/index.js +105 -68
- package/build/main/tracking/index.js.map +1 -1
- package/build/main/tracking/types.d.ts +508 -15
- package/build/main/utils/convertKeysToSnakeCase.d.ts +1 -0
- package/build/main/utils/convertKeysToSnakeCase.js +23 -0
- package/build/main/utils/convertKeysToSnakeCase.js.map +1 -0
- package/build/main/utils/convertValuesToString.d.ts +5 -0
- package/build/main/utils/convertValuesToString.js +11 -0
- package/build/main/utils/convertValuesToString.js.map +1 -0
- package/build/main/utils/index.d.ts +3 -0
- package/build/main/utils/index.js +20 -0
- package/build/main/utils/index.js.map +1 -0
- package/build/main/utils/isTest.d.ts +1 -0
- package/build/main/utils/isTest.js +18 -0
- package/build/main/utils/isTest.js.map +1 -0
- package/build/module/log/index.spec.d.ts +0 -0
- package/build/module/log/index.spec.js +2 -0
- package/build/module/log/index.spec.js.map +1 -0
- package/build/module/log/type.d.ts +3 -1
- package/build/module/tracking/_intercom.d.ts +109 -0
- package/build/module/tracking/_intercom.js +136 -0
- package/build/module/tracking/_intercom.js.map +1 -0
- package/build/module/tracking/eventTypes.d.ts +16 -0
- package/build/module/tracking/eventTypes.js +2 -0
- package/build/module/tracking/eventTypes.js.map +1 -0
- package/build/module/tracking/index.d.ts +96 -33
- package/build/module/tracking/index.js +96 -57
- package/build/module/tracking/index.js.map +1 -1
- package/build/module/tracking/types.d.ts +508 -15
- package/build/module/utils/convertKeysToSnakeCase.d.ts +1 -0
- package/build/module/utils/convertKeysToSnakeCase.js +19 -0
- package/build/module/utils/convertKeysToSnakeCase.js.map +1 -0
- package/build/module/utils/convertValuesToString.d.ts +5 -0
- package/build/module/utils/convertValuesToString.js +8 -0
- package/build/module/utils/convertValuesToString.js.map +1 -0
- package/build/module/utils/index.d.ts +3 -0
- package/build/module/utils/index.js +4 -0
- package/build/module/utils/index.js.map +1 -0
- package/build/module/utils/isTest.d.ts +1 -0
- package/build/module/utils/isTest.js +14 -0
- package/build/module/utils/isTest.js.map +1 -0
- package/package.json +24 -26
- package/src/log/type.ts +5 -1
- package/src/tracking/index.ts +230 -97
- package/src/tracking/types.ts +622 -97
- package/src/utils/convertKeysToSnakeCase.ts +21 -0
- package/src/utils/convertValuesToString.ts +10 -0
- package/src/utils/index.ts +3 -0
- package/src/utils/isTest.ts +16 -0
- package/src/tracking/intercom.ts +0 -258
|
@@ -1,16 +1,509 @@
|
|
|
1
|
-
type
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
type
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
1
|
+
export type TrackProps<T extends TrackingEvent> = OptionalUser<{
|
|
2
|
+
groupId: string;
|
|
3
|
+
timestamp?: Date;
|
|
4
|
+
event: T;
|
|
5
|
+
properties: TrackingEventProps[T];
|
|
6
|
+
}>;
|
|
7
|
+
export type IdentifyProps = {
|
|
8
|
+
userId: string;
|
|
9
|
+
traits?: {
|
|
10
|
+
id?: string;
|
|
11
|
+
email?: string;
|
|
12
|
+
avatar?: string;
|
|
13
|
+
name?: string;
|
|
14
|
+
firstName?: string;
|
|
15
|
+
lastName?: string;
|
|
16
|
+
createdAt?: string;
|
|
17
|
+
country?: string;
|
|
18
|
+
isSuperAdmin?: boolean;
|
|
19
|
+
isVrpAdmin?: boolean;
|
|
20
|
+
isPartnerAdmin?: boolean;
|
|
21
|
+
isTeamAdmin?: boolean;
|
|
22
|
+
role?: UserRole;
|
|
23
|
+
[key: string]: string | number | boolean | null | undefined;
|
|
24
|
+
};
|
|
25
|
+
disableGeoip?: boolean;
|
|
26
|
+
timestamp?: Date;
|
|
27
|
+
};
|
|
28
|
+
export type GroupProps = OptionalUser<{
|
|
29
|
+
groupId: string;
|
|
30
|
+
traits?: {
|
|
31
|
+
name?: string;
|
|
32
|
+
type?: TenantType;
|
|
33
|
+
avatar?: string;
|
|
34
|
+
createdAt?: string;
|
|
35
|
+
partner?: string;
|
|
36
|
+
partnerId?: string;
|
|
37
|
+
billingCustomerId?: string;
|
|
38
|
+
billingSubscriptionStatus?: string;
|
|
39
|
+
status?: TenantStatus;
|
|
40
|
+
isOnboarding?: boolean;
|
|
41
|
+
accountingPartner?: string;
|
|
42
|
+
billingPartner?: string;
|
|
43
|
+
pms?: string;
|
|
44
|
+
apps?: string;
|
|
45
|
+
accountingSoftware?: string;
|
|
46
|
+
activeListings?: number;
|
|
47
|
+
mrr?: number;
|
|
48
|
+
plan?: string;
|
|
49
|
+
paymentMethodType?: string;
|
|
50
|
+
[key: string]: string | number | boolean | null | undefined;
|
|
51
|
+
};
|
|
52
|
+
timestamp?: Date;
|
|
53
|
+
}>;
|
|
54
|
+
type TrackingEventProps = {
|
|
55
|
+
account_invitation_accepted: AccountInvitationAcceptedProps;
|
|
56
|
+
account_signed_out: AccountSignedOutProps;
|
|
57
|
+
account_signin_completed: AccountSigninCompletedProps;
|
|
58
|
+
account_signup_code_requested: AccountSignupCodeRequestedProps;
|
|
59
|
+
account_signup_code_completed: AccountSignupCodeCompletedProps;
|
|
60
|
+
account_signup_code_failed: AccountSignupCodeFailedProps;
|
|
61
|
+
account_signup_completed: AccountSignupCompletedProps;
|
|
62
|
+
account_password_reset_requested: AccountPasswordResetRequestedProps;
|
|
63
|
+
account_password_reset_failed: AccountPasswordResetFailedProps;
|
|
64
|
+
account_password_reset_completed: AccountPasswordResetCompletedProps;
|
|
65
|
+
connection_created: ConnectionCreatedProps;
|
|
66
|
+
connection_reconnected: ConnectionReconnectedProps;
|
|
67
|
+
connection_deleted: ConnectionDeletedProps;
|
|
68
|
+
connection_requested: ConnectionRequestedProps;
|
|
69
|
+
ownership_created: OwnershipCreatedProps;
|
|
70
|
+
ownership_updated: OwnershipUpdatedProps;
|
|
71
|
+
ownership_deleted: OwnershipDeletedProps;
|
|
72
|
+
owner_created: OwnerCreatedProps;
|
|
73
|
+
owner_updated: OwnerUpdatedProps;
|
|
74
|
+
owner_deleted: OwnerDeletedProps;
|
|
75
|
+
owner_tax_info_modal_opened: OwnerTaxInfoModalOpenedProps;
|
|
76
|
+
owner_tax_info_modal_submitted: OwnerTaxInfoModalSubmittedProps;
|
|
77
|
+
setup_classes_set: SetupClassesSetProps;
|
|
78
|
+
setup_entities_set: SetupEntitiesSetProps;
|
|
79
|
+
setup_reservation_imported: SetupReservationImportedProps;
|
|
80
|
+
setup_vendors_set: SetupVendorsSetProps;
|
|
81
|
+
setup_accounting_version_completed: SetupAccountingVersionCompletedProps;
|
|
82
|
+
setup_accounting_config_completed: SetupAccountingConfigCompletedProps;
|
|
83
|
+
setup_owner_imported: SetupOwnerImportedProps;
|
|
84
|
+
setup_listing_imported: SetupListingImportedProps;
|
|
85
|
+
automation_created: AutomationCreatedProps;
|
|
86
|
+
automation_updated: AutomationUpdatedProps;
|
|
87
|
+
automation_deleted: AutomationDeletedProps;
|
|
88
|
+
tax_statement_preview_opened: TaxStatementPreviewOpenedProps;
|
|
89
|
+
tax_statement_downloaded: TaxStatementDownloadedProps;
|
|
90
|
+
team_added: TeamAddedProps;
|
|
91
|
+
team_deleted: TeamDeletedProps;
|
|
92
|
+
team_info_updated: TeamInfoUpdatedProps;
|
|
93
|
+
team_member_removed: TeamMemberRemovedProps;
|
|
94
|
+
gl_owner_statement_preview_opened: GlOwnerStatementPreviewOpenedProps;
|
|
95
|
+
gl_owner_statement_downloaded: GlOwnerStatementDownloadedProps;
|
|
96
|
+
hyperline_invoice_ready: HyperlineInvoiceReadyProps;
|
|
97
|
+
hyperline_invoice_settled: HyperlineInvoiceSettledProps;
|
|
98
|
+
hyperline_trial_started: HyperlineTrialStartedProps;
|
|
99
|
+
hyperline_trial_ended: HyperlineTrialEndedProps;
|
|
100
|
+
hyperline_subscription_activated: HyperlineSubscriptionActivatedProps;
|
|
101
|
+
hyperline_subscription_cancelled: HyperlineSubscriptionCancelledProps;
|
|
102
|
+
hyperline_subscription_created: HyperlineSubscriptionCreatedProps;
|
|
103
|
+
hyperline_subscription_errored: HyperlineSubscriptionErroredProps;
|
|
104
|
+
hyperline_subscription_paused: HyperlineSubscriptionPausedProps;
|
|
105
|
+
hyperline_subscription_voided: HyperlineSubscriptionVoidedProps;
|
|
106
|
+
hyperline_subscription_charged: HyperlineSubscriptionChargedProps;
|
|
107
|
+
hyperline_customer_created: HyperlineCustomerCreatedProps;
|
|
108
|
+
hyperline_customer_updated: HyperlineCustomerUpdatedProps;
|
|
109
|
+
hyperline_payment_method_created: HyperlinePaymentMethodCreatedProps;
|
|
110
|
+
hyperline_payment_method_errored: HyperlinePaymentMethodErroredProps;
|
|
111
|
+
hyperline_payment_method_deleted: HyperlinePaymentMethodDeletedProps;
|
|
112
|
+
listing_activated: ListingActivatedProps;
|
|
113
|
+
listing_deactivated: ListingDeactivatedProps;
|
|
114
|
+
listings_reported: ListingsReportedProps;
|
|
115
|
+
update_refresh_accepted: UpdateRefreshAcceptedProps;
|
|
116
|
+
owner_statement_opened: OwnerStatementOpenedProps;
|
|
117
|
+
test_event: TestEventProps;
|
|
118
|
+
test_error: TestErrorProps;
|
|
119
|
+
};
|
|
120
|
+
export type TrackingEvent = keyof TrackingEventProps;
|
|
121
|
+
type OptionalUser<T> = T & ({
|
|
122
|
+
userId: string;
|
|
123
|
+
anonymousId?: string;
|
|
124
|
+
} | {
|
|
125
|
+
userId?: string;
|
|
126
|
+
anonymousId: string;
|
|
127
|
+
});
|
|
128
|
+
export type UserRole = 'super-admin' | 'vrp-admin' | 'partner-admin' | 'team-admin' | 'admin' | 'owner' | 'user';
|
|
129
|
+
export type TenantType = 'admin' | 'partner' | 'propertyManager';
|
|
130
|
+
export type TenantStatus = 'active' | 'inactive';
|
|
131
|
+
export type WebhookEventType = 'customer.created' | 'customer.updated' | 'subscription.activated' | 'subscription.cancelled' | 'subscription.created' | 'subscription.errored' | 'subscription.paused' | 'subscription.voided' | 'subscription.charged' | 'payment_method.created' | 'payment_method.errored' | 'payment_method.deleted';
|
|
132
|
+
type AccountInvitationAcceptedProps = Partial<{
|
|
133
|
+
userId: string;
|
|
134
|
+
userEmail: string;
|
|
135
|
+
userRole: 'owner' | 'user' | 'admin';
|
|
136
|
+
tenantId: string;
|
|
137
|
+
isNewUser: boolean;
|
|
138
|
+
}>;
|
|
139
|
+
type AccountPasswordResetCompletedProps = Partial<{
|
|
140
|
+
userEmail: string;
|
|
141
|
+
}>;
|
|
142
|
+
type AccountPasswordResetFailedProps = Partial<{
|
|
143
|
+
userEmail: string;
|
|
144
|
+
status: 'needs_second_factor' | 'needs_identifier' | 'needs_first_factor' | 'needs_new_password' | null | any;
|
|
145
|
+
}>;
|
|
146
|
+
type AccountPasswordResetRequestedProps = Partial<{
|
|
147
|
+
userEmail: string;
|
|
148
|
+
}>;
|
|
149
|
+
type AccountSignedOutProps = Partial<{
|
|
150
|
+
userId: string;
|
|
151
|
+
userEmail: string;
|
|
152
|
+
tenantId: string;
|
|
153
|
+
firstName: string;
|
|
154
|
+
lastName: string;
|
|
155
|
+
}>;
|
|
156
|
+
type AccountSigninCompletedProps = Partial<{
|
|
157
|
+
firstName: string;
|
|
158
|
+
lastName: string;
|
|
159
|
+
userEmail: string;
|
|
160
|
+
}>;
|
|
161
|
+
type AccountSignupCodeCompletedProps = Partial<{
|
|
162
|
+
firstName: string;
|
|
163
|
+
lastName: string;
|
|
164
|
+
userEmail: string;
|
|
165
|
+
companyName: string;
|
|
166
|
+
type: 'property_manager' | 'partner';
|
|
167
|
+
}>;
|
|
168
|
+
type AccountSignupCodeFailedProps = Partial<{
|
|
169
|
+
firstName: string;
|
|
170
|
+
lastName: string;
|
|
171
|
+
userEmail: string;
|
|
172
|
+
companyName: string;
|
|
173
|
+
type: 'property_manager' | 'partner';
|
|
174
|
+
status: 'missing_requirements' | 'abandoned' | null | any;
|
|
175
|
+
}>;
|
|
176
|
+
type AccountSignupCodeRequestedProps = Partial<{
|
|
177
|
+
firstName: string;
|
|
178
|
+
lastName: string;
|
|
179
|
+
userEmail: string;
|
|
180
|
+
companyName: string;
|
|
181
|
+
type: 'property_manager' | 'partner';
|
|
182
|
+
}>;
|
|
183
|
+
type AccountSignupCompletedProps = Partial<{
|
|
184
|
+
tenantId: string;
|
|
185
|
+
userEmail: string;
|
|
186
|
+
firstName: string;
|
|
187
|
+
lastName: string;
|
|
188
|
+
userId: string;
|
|
189
|
+
}>;
|
|
190
|
+
type AutomationCreatedProps = Partial<{
|
|
191
|
+
automationId: string;
|
|
192
|
+
templateId: string;
|
|
193
|
+
type?: string | null;
|
|
194
|
+
uniqueRef: string;
|
|
195
|
+
userId: string;
|
|
196
|
+
userEmail: string;
|
|
197
|
+
tenantId: string;
|
|
198
|
+
}>;
|
|
199
|
+
type AutomationDeletedProps = Partial<{
|
|
200
|
+
automationId: string;
|
|
201
|
+
templateId: string;
|
|
202
|
+
type?: string | null;
|
|
203
|
+
uniqueRef: string;
|
|
204
|
+
userId: string;
|
|
205
|
+
userEmail: string;
|
|
206
|
+
tenantId: string;
|
|
207
|
+
}>;
|
|
208
|
+
type AutomationUpdatedProps = any;
|
|
209
|
+
type ConnectionCreatedProps = Partial<{
|
|
210
|
+
connectionId: string;
|
|
211
|
+
tenantId: string;
|
|
212
|
+
userId: string;
|
|
213
|
+
userEmail: string;
|
|
214
|
+
appId: string;
|
|
215
|
+
type?: string;
|
|
216
|
+
}>;
|
|
217
|
+
type ConnectionDeletedProps = Partial<{
|
|
218
|
+
connectionId: string;
|
|
219
|
+
tenantId: string;
|
|
220
|
+
type?: string;
|
|
221
|
+
userId: string;
|
|
222
|
+
appId: string;
|
|
223
|
+
userEmail: string;
|
|
224
|
+
}>;
|
|
225
|
+
type ConnectionReconnectedProps = Partial<{
|
|
226
|
+
connectionId: string;
|
|
227
|
+
tenantId: string;
|
|
228
|
+
userId: string;
|
|
229
|
+
userEmail: string;
|
|
230
|
+
appId: string;
|
|
231
|
+
}>;
|
|
232
|
+
type ConnectionRequestedProps = Partial<{
|
|
233
|
+
type: 'PMS' | 'Accounting';
|
|
234
|
+
website: string;
|
|
235
|
+
userId: string;
|
|
236
|
+
userEmail: string;
|
|
237
|
+
tenantId: string;
|
|
238
|
+
}>;
|
|
239
|
+
type GlOwnerStatementDownloadedProps = Partial<{
|
|
240
|
+
ownerStatementId: string;
|
|
241
|
+
ownerStatementUrls: string[];
|
|
242
|
+
userType: 'owner' | 'property_manager';
|
|
243
|
+
}>;
|
|
244
|
+
type GlOwnerStatementPreviewOpenedProps = Partial<{
|
|
245
|
+
ownerStatementStatus: string;
|
|
246
|
+
ownerStatementId: string;
|
|
247
|
+
ownerStatementUrls: string[];
|
|
248
|
+
userType: 'owner' | 'property_manager';
|
|
249
|
+
}>;
|
|
250
|
+
type HyperlineCustomerCreatedProps = Partial<{
|
|
251
|
+
userId: string;
|
|
252
|
+
tenantId: string;
|
|
253
|
+
customerId: string;
|
|
254
|
+
billingEmail: string;
|
|
255
|
+
billingAddress: string;
|
|
256
|
+
externalId: string;
|
|
257
|
+
name: string;
|
|
258
|
+
vatNumber: string;
|
|
259
|
+
}>;
|
|
260
|
+
type HyperlineCustomerUpdatedProps = HyperlineCustomerCreatedProps;
|
|
261
|
+
type HyperlineInvoiceReadyProps = Partial<{
|
|
262
|
+
status: 'ready';
|
|
263
|
+
paymentMethodType: string;
|
|
264
|
+
invoiceId: string;
|
|
265
|
+
amount: number;
|
|
266
|
+
amountOrigin: number;
|
|
267
|
+
currency: string;
|
|
268
|
+
customerId: string;
|
|
269
|
+
taxAmount: number;
|
|
270
|
+
readyAt: string;
|
|
271
|
+
}>;
|
|
272
|
+
type HyperlineInvoiceSettledProps = Partial<{
|
|
273
|
+
status: 'settled';
|
|
274
|
+
paymentMethodType: string;
|
|
275
|
+
invoiceId: string;
|
|
276
|
+
amount: number;
|
|
277
|
+
amountOrigin: number;
|
|
278
|
+
currency: string;
|
|
279
|
+
customerId: string;
|
|
280
|
+
taxAmount: number;
|
|
281
|
+
settledAt: string;
|
|
282
|
+
}>;
|
|
283
|
+
type HyperlinePaymentMethodCreatedProps = Partial<{
|
|
284
|
+
userId: string;
|
|
285
|
+
tenantId: string;
|
|
286
|
+
payloadCreatedAt: string;
|
|
287
|
+
payloadType: 'card' | 'direct_debit_sepa' | 'direct_debit_ach' | 'direct_debit_bacs';
|
|
288
|
+
payloadState: 'active' | 'pending';
|
|
289
|
+
payloadId: string;
|
|
290
|
+
payloadCustomerId: string;
|
|
291
|
+
webhookEventType: 'payment_method.created';
|
|
292
|
+
}>;
|
|
293
|
+
type HyperlinePaymentMethodDeletedProps = Partial<{
|
|
294
|
+
userId: string;
|
|
295
|
+
tenantId: string;
|
|
296
|
+
payloadCreatedAt: string;
|
|
297
|
+
payloadType: 'card' | 'direct_debit_sepa' | 'direct_debit_ach' | 'direct_debit_bacs';
|
|
298
|
+
payloadState: 'active' | 'pending';
|
|
299
|
+
payloadId: string;
|
|
300
|
+
payloadCustomerId: string;
|
|
301
|
+
webhookEventType: 'payment_method.deleted';
|
|
302
|
+
}>;
|
|
303
|
+
type HyperlinePaymentMethodErroredProps = Partial<{
|
|
304
|
+
userId: string;
|
|
305
|
+
tenantId: string;
|
|
306
|
+
payloadCreatedAt: string;
|
|
307
|
+
payloadType: 'card' | 'direct_debit_sepa' | 'direct_debit_ach' | 'direct_debit_bacs';
|
|
308
|
+
payloadState: 'active' | 'pending';
|
|
309
|
+
payloadId: string;
|
|
310
|
+
payloadCustomerId: string;
|
|
311
|
+
webhookEventType: 'payment_method.errored';
|
|
312
|
+
}>;
|
|
313
|
+
type HyperlineSubscriptionActivatedProps = Partial<{
|
|
314
|
+
userId: string;
|
|
315
|
+
tenantId: string;
|
|
316
|
+
tenantBillingStatus: 'pending' | 'active' | 'canceled';
|
|
317
|
+
webhookEventType: 'subscription.activated';
|
|
318
|
+
}>;
|
|
319
|
+
type HyperlineSubscriptionCancelledProps = Partial<{
|
|
320
|
+
trialEndAt: string;
|
|
321
|
+
plan: string;
|
|
322
|
+
subscriptionId: string;
|
|
323
|
+
subscriptionStartDate: string;
|
|
324
|
+
subscriptionStatus: string;
|
|
325
|
+
paymentMethodType: string;
|
|
326
|
+
customerId: string;
|
|
327
|
+
userId: string;
|
|
328
|
+
tenantId: string;
|
|
329
|
+
webhookEventType: 'subscription.cancelled';
|
|
330
|
+
tenantBillingStatus: 'pending' | 'active' | 'canceled';
|
|
331
|
+
}>;
|
|
332
|
+
type HyperlineSubscriptionChargedProps = Partial<{
|
|
333
|
+
plan: string;
|
|
334
|
+
subscriptionId: string;
|
|
335
|
+
subscriptionStartDate: string;
|
|
336
|
+
subscriptionStatus: string;
|
|
337
|
+
paymentMethodType: string;
|
|
338
|
+
customerId: string;
|
|
339
|
+
}>;
|
|
340
|
+
type HyperlineSubscriptionCreatedProps = Partial<{
|
|
341
|
+
trialStartDate: string;
|
|
342
|
+
plan: string;
|
|
343
|
+
subscriptionId: string;
|
|
344
|
+
subscriptionStartDate: string;
|
|
345
|
+
subscriptionStatus: string;
|
|
346
|
+
paymentMethodType: string;
|
|
347
|
+
customerId: string;
|
|
348
|
+
}>;
|
|
349
|
+
type HyperlineSubscriptionErroredProps = Partial<{
|
|
350
|
+
userId: string;
|
|
351
|
+
tenantId: string;
|
|
352
|
+
tenantBillingStatus: 'pending' | 'active' | 'canceled';
|
|
353
|
+
webhookEventType: 'subscription.errored';
|
|
354
|
+
}>;
|
|
355
|
+
type HyperlineSubscriptionPausedProps = Partial<{
|
|
356
|
+
userId: string;
|
|
357
|
+
tenantId: string;
|
|
358
|
+
tenantBillingStatus: 'pending' | 'active' | 'canceled';
|
|
359
|
+
webhookEventType: 'subscription.paused';
|
|
360
|
+
}>;
|
|
361
|
+
type HyperlineSubscriptionVoidedProps = Partial<{
|
|
362
|
+
userId: string;
|
|
363
|
+
tenantId: string;
|
|
364
|
+
tenantBillingStatus: 'pending' | 'active' | 'canceled';
|
|
365
|
+
webhookEventType: 'subscription.voided';
|
|
366
|
+
}>;
|
|
367
|
+
type HyperlineTrialEndedProps = Partial<{
|
|
368
|
+
trialStartDate: string;
|
|
369
|
+
trialEndDate: string;
|
|
370
|
+
plan: string;
|
|
371
|
+
subscriptionId: string;
|
|
372
|
+
subscriptionStartDate: string;
|
|
373
|
+
subscriptionStatus: string;
|
|
374
|
+
paymentMethodType: 'card';
|
|
375
|
+
}>;
|
|
376
|
+
type HyperlineTrialStartedProps = Partial<{
|
|
377
|
+
tenantId: string;
|
|
378
|
+
userId: string;
|
|
379
|
+
tenantBillingStatus: 'pending' | 'active' | 'canceled';
|
|
380
|
+
webhookEventType: 'payment_method.created';
|
|
381
|
+
}>;
|
|
382
|
+
type OwnerCreatedProps = Partial<{
|
|
383
|
+
userId: string;
|
|
384
|
+
tenantId: string;
|
|
385
|
+
ownerId: string;
|
|
386
|
+
type: 'individual' | 'company' | 'c_corporation' | 's_corporation' | 'partnership' | 'trust_estate' | 'limited_liability_company';
|
|
387
|
+
withUserInvite: boolean;
|
|
388
|
+
userEmail: string;
|
|
389
|
+
}>;
|
|
390
|
+
type OwnerDeletedProps = Partial<{
|
|
391
|
+
userId: string;
|
|
392
|
+
tenantId: string;
|
|
393
|
+
ownerId: string;
|
|
394
|
+
userEmail: string;
|
|
395
|
+
listingId: string;
|
|
396
|
+
ownershipId: string;
|
|
397
|
+
}>;
|
|
398
|
+
type OwnerTaxInfoModalOpenedProps = Partial<{
|
|
399
|
+
flag: string;
|
|
400
|
+
}>;
|
|
401
|
+
type OwnerTaxInfoModalSubmittedProps = Partial<{
|
|
402
|
+
flag: string;
|
|
403
|
+
}>;
|
|
404
|
+
type OwnerUpdatedProps = Partial<{
|
|
405
|
+
userId: string;
|
|
406
|
+
tenantId: string;
|
|
407
|
+
ownerId: string;
|
|
408
|
+
}>;
|
|
409
|
+
type OwnershipCreatedProps = Partial<{
|
|
410
|
+
ownershipId: string;
|
|
411
|
+
ownerId: string;
|
|
412
|
+
listingId: string;
|
|
413
|
+
userId: string;
|
|
414
|
+
userEmail: string;
|
|
415
|
+
tenantId: string;
|
|
416
|
+
}>;
|
|
417
|
+
type OwnershipDeletedProps = Partial<{
|
|
418
|
+
ownershipId: string;
|
|
419
|
+
ownerId: string;
|
|
420
|
+
listingId: string;
|
|
421
|
+
userId: string;
|
|
422
|
+
userEmail: string;
|
|
423
|
+
tenantId: string;
|
|
424
|
+
}>;
|
|
425
|
+
type OwnershipUpdatedProps = Partial<{
|
|
426
|
+
ownershipId: string;
|
|
427
|
+
ownerId: string;
|
|
428
|
+
listingId: string;
|
|
429
|
+
userId: string;
|
|
430
|
+
userEmail: string;
|
|
431
|
+
tenantId: string;
|
|
432
|
+
}>;
|
|
433
|
+
type SetupAccountingConfigCompletedProps = any;
|
|
434
|
+
type SetupAccountingVersionCompletedProps = any;
|
|
435
|
+
type SetupClassesSetProps = any;
|
|
436
|
+
type SetupEntitiesSetProps = any;
|
|
437
|
+
type SetupListingImportedProps = Partial<{
|
|
438
|
+
appId: string;
|
|
439
|
+
}>;
|
|
440
|
+
type SetupOwnerImportedProps = Partial<{
|
|
441
|
+
appId: string;
|
|
442
|
+
}>;
|
|
443
|
+
type SetupReservationImportedProps = Partial<{
|
|
444
|
+
appId: string;
|
|
445
|
+
}>;
|
|
446
|
+
type SetupVendorsSetProps = any;
|
|
447
|
+
type TaxStatementDownloadedProps = Partial<{
|
|
448
|
+
taxStatementStatus?: 'draft' | 'ignored' | 'inReview' | 'ready' | 'submitted';
|
|
449
|
+
taxStatementId: string;
|
|
450
|
+
taxStatementUrl: string;
|
|
451
|
+
userType: string;
|
|
452
|
+
userId: string;
|
|
453
|
+
userEmail: string;
|
|
454
|
+
tenantId: string;
|
|
455
|
+
}>;
|
|
456
|
+
type TaxStatementPreviewOpenedProps = Partial<{
|
|
457
|
+
taxStatementStatus?: 'draft' | 'ignored' | 'inReview' | 'ready' | 'submitted';
|
|
458
|
+
taxStatementId: string;
|
|
459
|
+
taxStatementUrl: string;
|
|
460
|
+
userType: string;
|
|
461
|
+
userId: string;
|
|
462
|
+
userEmail: string;
|
|
463
|
+
tenantId: string;
|
|
464
|
+
}>;
|
|
465
|
+
type TeamAddedProps = Partial<{
|
|
466
|
+
tenantId: string;
|
|
467
|
+
tenantName: string;
|
|
468
|
+
partnerId: string;
|
|
469
|
+
userType: string;
|
|
470
|
+
userId: string;
|
|
471
|
+
userEmail: string;
|
|
472
|
+
}>;
|
|
473
|
+
type TeamDeletedProps = Partial<{
|
|
474
|
+
tenantId: string;
|
|
475
|
+
userId: string;
|
|
476
|
+
userEmail: string;
|
|
477
|
+
}>;
|
|
478
|
+
type TeamInfoUpdatedProps = Partial<{
|
|
479
|
+
userId: string;
|
|
480
|
+
tenantId: string;
|
|
481
|
+
userEmail: string;
|
|
482
|
+
}>;
|
|
483
|
+
type TeamMemberRemovedProps = Partial<{
|
|
484
|
+
userId: string;
|
|
485
|
+
removedUserId: string;
|
|
486
|
+
tenantId: string;
|
|
487
|
+
userEmail: string;
|
|
488
|
+
}>;
|
|
489
|
+
type TestErrorProps = Partial<{
|
|
490
|
+
userId: string;
|
|
491
|
+
tenantId: string;
|
|
492
|
+
}>;
|
|
493
|
+
type TestEventProps = Partial<{
|
|
494
|
+
success: boolean;
|
|
495
|
+
}>;
|
|
496
|
+
type UpdateRefreshAcceptedProps = Partial<{
|
|
497
|
+
appName: string;
|
|
498
|
+
}>;
|
|
499
|
+
type OwnerStatementOpenedProps = Partial<{
|
|
500
|
+
userId: string;
|
|
501
|
+
tenantId: string;
|
|
502
|
+
userEmail: string;
|
|
503
|
+
listingId: string;
|
|
504
|
+
startAt: string;
|
|
505
|
+
}>;
|
|
506
|
+
type ListingActivatedProps = any;
|
|
507
|
+
type ListingDeactivatedProps = any;
|
|
508
|
+
type ListingsReportedProps = any;
|
|
16
509
|
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const convertKeysToSnakeCase: (obj?: Record<string, any>) => Record<string, any>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.convertKeysToSnakeCase = void 0;
|
|
4
|
+
const convertKeysToSnakeCase = (obj) => {
|
|
5
|
+
const result = {};
|
|
6
|
+
const hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
7
|
+
for (const key in obj) {
|
|
8
|
+
if (hasOwnProperty.call(obj, key)) {
|
|
9
|
+
const snakeKey = key.replace(/([a-z])([A-Z])/g, '$1_$2').toLowerCase();
|
|
10
|
+
if (typeof obj[key] === 'object' &&
|
|
11
|
+
!Array.isArray(obj[key]) &&
|
|
12
|
+
obj[key] !== null) {
|
|
13
|
+
result[snakeKey] = (0, exports.convertKeysToSnakeCase)(obj[key]);
|
|
14
|
+
}
|
|
15
|
+
else {
|
|
16
|
+
result[snakeKey] = obj[key];
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
return result;
|
|
21
|
+
};
|
|
22
|
+
exports.convertKeysToSnakeCase = convertKeysToSnakeCase;
|
|
23
|
+
//# sourceMappingURL=convertKeysToSnakeCase.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"convertKeysToSnakeCase.js","sourceRoot":"src/","sources":["utils/convertKeysToSnakeCase.ts"],"names":[],"mappings":";;;AAAO,MAAM,sBAAsB,GAAG,CAAC,GAAyB,EAAE,EAAE;IAClE,MAAM,MAAM,GAAwB,EAAE,CAAC;IACvC,MAAM,cAAc,GAAG,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC;IAEvD,KAAK,MAAM,GAAG,IAAI,GAAG,EAAE,CAAC;QACtB,IAAI,cAAc,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,CAAC;YAClC,MAAM,QAAQ,GAAG,GAAG,CAAC,OAAO,CAAC,iBAAiB,EAAE,OAAO,CAAC,CAAC,WAAW,EAAE,CAAC;YACvE,IACE,OAAO,GAAG,CAAC,GAAG,CAAC,KAAK,QAAQ;gBAC5B,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;gBACxB,GAAG,CAAC,GAAG,CAAC,KAAK,IAAI,EACjB,CAAC;gBACD,MAAM,CAAC,QAAQ,CAAC,GAAG,IAAA,8BAAsB,EAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;YACtD,CAAC;iBAAM,CAAC;gBACN,MAAM,CAAC,QAAQ,CAAC,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC;YAC9B,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC;AApBW,QAAA,sBAAsB,0BAoBjC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.convertValuesToString = convertValuesToString;
|
|
4
|
+
function convertValuesToString(obj) {
|
|
5
|
+
const result = {};
|
|
6
|
+
for (const key of Object.keys(obj))
|
|
7
|
+
if (obj[key] !== undefined)
|
|
8
|
+
result[key] = obj[key].toString();
|
|
9
|
+
return result;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=convertValuesToString.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"convertValuesToString.js","sourceRoot":"src/","sources":["utils/convertValuesToString.ts"],"names":[],"mappings":";;AAAA,sDASC;AATD,SAAgB,qBAAqB,CAAC,GAA2B;IAG/D,MAAM,MAAM,GAA8B,EAAE,CAAC;IAE7C,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC;QAChC,IAAI,GAAG,CAAC,GAAG,CAAC,KAAK,SAAS;YAAE,MAAM,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,CAAC;IAEhE,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./convertKeysToSnakeCase"), exports);
|
|
18
|
+
__exportStar(require("./convertValuesToString"), exports);
|
|
19
|
+
__exportStar(require("./isTest"), exports);
|
|
20
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"src/","sources":["utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2DAAyC;AACzC,0DAAwC;AACxC,2CAAyB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const isTest: (userId: string, groupId?: string, userEmail?: string) => boolean | "" | undefined;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isTest = void 0;
|
|
4
|
+
const E2E_TEST_USERS = {
|
|
5
|
+
'e2e-invite-member@finalytic.io': '113d73d8-ee21-46b7-a12a-a74f632401ca',
|
|
6
|
+
'e2e-invite-owner@finalytic.io': '917b7c4e-cb03-491c-9e94-d33a5bdeca05',
|
|
7
|
+
'e2e-sign-up@finalytic.io': 'ec8e5572-74d0-4ae6-af73-bca8db9a27e9',
|
|
8
|
+
'lars+checkly@finalytic.co': '9e7dfc88-503c-4222-9905-9116169d2203',
|
|
9
|
+
};
|
|
10
|
+
const E2E_TEST_TEAMS = {
|
|
11
|
+
'VRP Automated Testing': 'c4fd21b4-8447-43a2-bdcb-f06a85a935ad',
|
|
12
|
+
test_company_xxxx: '8f21060e-afe6-410a-b2f4-00a3caa20786',
|
|
13
|
+
};
|
|
14
|
+
const isTest = (userId, groupId, userEmail) => Object.values(E2E_TEST_USERS).includes(userId) ||
|
|
15
|
+
(groupId && Object.values(E2E_TEST_TEAMS).includes(groupId)) ||
|
|
16
|
+
(userEmail && Object.keys(E2E_TEST_USERS).includes(userEmail));
|
|
17
|
+
exports.isTest = isTest;
|
|
18
|
+
//# sourceMappingURL=isTest.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isTest.js","sourceRoot":"src/","sources":["utils/isTest.ts"],"names":[],"mappings":";;;AAAA,MAAM,cAAc,GAAG;IACrB,gCAAgC,EAAE,sCAAsC;IACxE,+BAA+B,EAAE,sCAAsC;IACvE,0BAA0B,EAAE,sCAAsC;IAClE,2BAA2B,EAAE,sCAAsC;CACpE,CAAC;AAEF,MAAM,cAAc,GAAG;IACrB,uBAAuB,EAAE,sCAAsC;IAC/D,iBAAiB,EAAE,sCAAsC;CAC1D,CAAC;AAEK,MAAM,MAAM,GAAG,CAAC,MAAc,EAAE,OAAgB,EAAE,SAAkB,EAAE,EAAE,CAC7E,MAAM,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC;IAC9C,CAAC,OAAO,IAAI,MAAM,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;IAC5D,CAAC,SAAS,IAAI,MAAM,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC;AAHpD,QAAA,MAAM,UAG8C"}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.spec.js","sourceRoot":"src/","sources":["log/index.spec.ts"],"names":[],"mappings":""}
|
|
@@ -17,11 +17,13 @@ export type LogBindings = {
|
|
|
17
17
|
MACHINE_NAME?: string;
|
|
18
18
|
};
|
|
19
19
|
export type LogFn = (message: any, additionalContext?: Record<string, any>) => void;
|
|
20
|
-
export type
|
|
20
|
+
export type LogFns = {
|
|
21
21
|
error: LogFn;
|
|
22
22
|
info: LogFn;
|
|
23
23
|
debug: LogFn;
|
|
24
24
|
warn: LogFn;
|
|
25
|
+
};
|
|
26
|
+
export type Log = LogFns & {
|
|
25
27
|
child: (data: ChildLogOptions) => Log;
|
|
26
28
|
addContext: (data: Record<string, any>) => void;
|
|
27
29
|
};
|