saasco-sdk 0.1.1 → 0.1.4

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 ADDED
@@ -0,0 +1,1018 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var uuid = require('@lukeed/uuid');
6
+ var zod = require('zod');
7
+
8
+ const timezones = {
9
+ 'Asia/Barnaul': 'RU',
10
+ 'Africa/Nouakchott': 'MR',
11
+ 'Africa/Lusaka': 'ZM',
12
+ 'Asia/Pyongyang': 'KP',
13
+ 'Europe/Bratislava': 'SK',
14
+ 'America/Belize': 'BZ',
15
+ 'America/Maceio': 'BR',
16
+ 'Pacific/Chuuk': 'FM',
17
+ 'Indian/Comoro': 'KM',
18
+ 'Pacific/Palau': 'PW',
19
+ 'Asia/Jakarta': 'ID',
20
+ 'Africa/Windhoek': 'NA',
21
+ 'America/Chihuahua': 'MX',
22
+ 'America/Nome': 'US',
23
+ 'Africa/Mbabane': 'SZ',
24
+ 'Africa/Porto-Novo': 'BJ',
25
+ 'Europe/San_Marino': 'SM',
26
+ 'Pacific/Fakaofo': 'TK',
27
+ 'America/Denver': 'US',
28
+ 'Europe/Belgrade': 'RS',
29
+ 'America/Indiana/Tell_City': 'US',
30
+ 'America/Fortaleza': 'BR',
31
+ 'America/Halifax': 'CA',
32
+ 'Europe/Bucharest': 'RO',
33
+ 'America/Indiana/Petersburg': 'US',
34
+ 'Europe/Kirov': 'RU',
35
+ 'Europe/Athens': 'GR',
36
+ 'America/Argentina/Ushuaia': 'AR',
37
+ 'Europe/Monaco': 'MC',
38
+ 'Europe/Vilnius': 'LT',
39
+ 'Europe/Copenhagen': 'DK',
40
+ 'Pacific/Kanton': 'KI',
41
+ 'America/Caracas': 'VE',
42
+ 'Asia/Almaty': 'KZ',
43
+ 'Europe/Paris': 'FR',
44
+ 'Africa/Blantyre': 'MW',
45
+ 'Asia/Muscat': 'OM',
46
+ 'America/North_Dakota/Beulah': 'US',
47
+ 'America/Matamoros': 'MX',
48
+ 'Asia/Irkutsk': 'RU',
49
+ 'America/Costa_Rica': 'CR',
50
+ 'America/Araguaina': 'BR',
51
+ 'Atlantic/Canary': 'ES',
52
+ 'America/Santo_Domingo': 'DO',
53
+ 'America/Vancouver': 'CA',
54
+ 'Africa/Addis_Ababa': 'ET',
55
+ 'Africa/Accra': 'GH',
56
+ 'Pacific/Kwajalein': 'MH',
57
+ 'Asia/Baghdad': 'IQ',
58
+ 'Australia/Adelaide': 'AU',
59
+ 'Australia/Hobart': 'AU',
60
+ 'America/Guayaquil': 'EC',
61
+ 'America/Argentina/Tucuman': 'AR',
62
+ 'Australia/Lindeman': 'AU',
63
+ 'America/New_York': 'US',
64
+ 'Pacific/Fiji': 'FJ',
65
+ 'America/Antigua': 'AG',
66
+ 'Africa/Casablanca': 'MA',
67
+ 'America/Paramaribo': 'SR',
68
+ 'Africa/Cairo': 'EG',
69
+ 'America/Cayenne': 'GF',
70
+ 'America/Detroit': 'US',
71
+ 'Antarctica/Syowa': 'AQ',
72
+ 'Africa/Douala': 'CM',
73
+ 'America/Argentina/La_Rioja': 'AR',
74
+ 'Africa/Lagos': 'NG',
75
+ 'America/St_Barthelemy': 'BL',
76
+ 'Asia/Nicosia': 'CY',
77
+ 'Asia/Macau': 'MO',
78
+ 'Europe/Riga': 'LV',
79
+ 'Asia/Ashgabat': 'TM',
80
+ 'Indian/Antananarivo': 'MG',
81
+ 'America/Argentina/San_Juan': 'AR',
82
+ 'Asia/Aden': 'YE',
83
+ 'Asia/Tomsk': 'RU',
84
+ 'America/Asuncion': 'PY',
85
+ 'Pacific/Bougainville': 'PG',
86
+ 'Asia/Vientiane': 'LA',
87
+ 'America/Mazatlan': 'MX',
88
+ 'Africa/Luanda': 'AO',
89
+ 'Europe/Oslo': 'NO',
90
+ 'Africa/Kinshasa': 'CD',
91
+ 'Europe/Warsaw': 'PL',
92
+ 'America/Grand_Turk': 'TC',
93
+ 'Asia/Seoul': 'KR',
94
+ 'Africa/Tripoli': 'LY',
95
+ 'America/St_Thomas': 'VI',
96
+ 'Asia/Kathmandu': 'NP',
97
+ 'Pacific/Pitcairn': 'PN',
98
+ 'Pacific/Nauru': 'NR',
99
+ 'America/Curacao': 'CW',
100
+ 'Asia/Kabul': 'AF',
101
+ 'Pacific/Tongatapu': 'TO',
102
+ 'Europe/Simferopol': 'UA',
103
+ 'Asia/Ust-Nera': 'RU',
104
+ 'Africa/Mogadishu': 'SO',
105
+ 'Indian/Mayotte': 'YT',
106
+ 'Pacific/Niue': 'NU',
107
+ 'America/Thunder_Bay': 'CA',
108
+ 'Atlantic/Azores': 'PT',
109
+ 'Pacific/Gambier': 'PF',
110
+ 'Europe/Stockholm': 'SE',
111
+ 'Africa/Libreville': 'GA',
112
+ 'America/Punta_Arenas': 'CL',
113
+ 'America/Guatemala': 'GT',
114
+ 'America/Noronha': 'BR',
115
+ 'Europe/Helsinki': 'FI',
116
+ 'Asia/Gaza': 'PS',
117
+ 'Pacific/Kosrae': 'FM',
118
+ 'America/Aruba': 'AW',
119
+ 'America/Nassau': 'BS',
120
+ 'Asia/Choibalsan': 'MN',
121
+ 'America/Winnipeg': 'CA',
122
+ 'America/Anguilla': 'AI',
123
+ 'Asia/Thimphu': 'BT',
124
+ 'Asia/Beirut': 'LB',
125
+ 'Atlantic/Faroe': 'FO',
126
+ 'Europe/Berlin': 'DE',
127
+ 'Europe/Amsterdam': 'NL',
128
+ 'Pacific/Honolulu': 'US',
129
+ 'America/Regina': 'CA',
130
+ 'America/Scoresbysund': 'GL',
131
+ 'Europe/Vienna': 'AT',
132
+ 'Europe/Tirane': 'AL',
133
+ 'Africa/El_Aaiun': 'EH',
134
+ 'America/Creston': 'CA',
135
+ 'Asia/Qostanay': 'KZ',
136
+ 'Asia/Ho_Chi_Minh': 'VN',
137
+ 'Europe/Samara': 'RU',
138
+ 'Europe/Rome': 'IT',
139
+ 'Australia/Eucla': 'AU',
140
+ 'America/El_Salvador': 'SV',
141
+ 'America/Chicago': 'US',
142
+ 'Africa/Abidjan': 'CI',
143
+ 'Asia/Kamchatka': 'RU',
144
+ 'Pacific/Tarawa': 'KI',
145
+ 'America/Santiago': 'CL',
146
+ 'America/Bahia': 'BR',
147
+ 'Indian/Christmas': 'CX',
148
+ 'Asia/Atyrau': 'KZ',
149
+ 'Asia/Dushanbe': 'TJ',
150
+ 'Europe/Ulyanovsk': 'RU',
151
+ 'America/Yellowknife': 'CA',
152
+ 'America/Recife': 'BR',
153
+ 'Australia/Sydney': 'AU',
154
+ 'America/Fort_Nelson': 'CA',
155
+ 'Pacific/Efate': 'VU',
156
+ 'Europe/Saratov': 'RU',
157
+ 'Africa/Banjul': 'GM',
158
+ 'Asia/Omsk': 'RU',
159
+ 'Europe/Ljubljana': 'SI',
160
+ 'Europe/Budapest': 'HU',
161
+ 'Europe/Astrakhan': 'RU',
162
+ 'America/Argentina/Buenos_Aires': 'AR',
163
+ 'Pacific/Chatham': 'NZ',
164
+ 'America/Argentina/Salta': 'AR',
165
+ 'Africa/Niamey': 'NE',
166
+ 'Asia/Pontianak': 'ID',
167
+ 'Indian/Reunion': 'RE',
168
+ 'Asia/Hong_Kong': 'HK',
169
+ 'Antarctica/McMurdo': 'AQ',
170
+ 'Africa/Malabo': 'GQ',
171
+ 'America/Los_Angeles': 'US',
172
+ 'America/Argentina/Cordoba': 'AR',
173
+ 'Pacific/Pohnpei': 'FM',
174
+ 'America/Tijuana': 'MX',
175
+ 'America/Campo_Grande': 'BR',
176
+ 'America/Dawson_Creek': 'CA',
177
+ 'Asia/Novosibirsk': 'RU',
178
+ 'Pacific/Pago_Pago': 'AS',
179
+ 'Asia/Jerusalem': 'IL',
180
+ 'Europe/Sarajevo': 'BA',
181
+ 'Africa/Freetown': 'SL',
182
+ 'Asia/Yekaterinburg': 'RU',
183
+ 'America/Juneau': 'US',
184
+ 'Africa/Ouagadougou': 'BF',
185
+ 'Africa/Monrovia': 'LR',
186
+ 'Europe/Kiev': 'UA',
187
+ 'America/Argentina/San_Luis': 'AR',
188
+ 'Asia/Tokyo': 'JP',
189
+ 'Asia/Qatar': 'QA',
190
+ 'America/La_Paz': 'BO',
191
+ 'America/Bogota': 'CO',
192
+ 'America/Thule': 'GL',
193
+ 'Asia/Manila': 'PH',
194
+ 'Asia/Hovd': 'MN',
195
+ 'Asia/Tehran': 'IR',
196
+ 'Atlantic/Madeira': 'PT',
197
+ 'America/Metlakatla': 'US',
198
+ 'Europe/Vatican': 'VA',
199
+ 'Asia/Bishkek': 'KG',
200
+ 'Asia/Dili': 'TL',
201
+ 'Antarctica/Palmer': 'AQ',
202
+ 'Atlantic/Cape_Verde': 'CV',
203
+ 'Indian/Chagos': 'IO',
204
+ 'America/Kentucky/Monticello': 'US',
205
+ 'Africa/Algiers': 'DZ',
206
+ 'Africa/Maseru': 'LS',
207
+ 'Asia/Kuala_Lumpur': 'MY',
208
+ 'Africa/Khartoum': 'SD',
209
+ 'America/Argentina/Rio_Gallegos': 'AR',
210
+ 'America/Blanc-Sablon': 'CA',
211
+ 'Africa/Maputo': 'MZ',
212
+ 'America/Tortola': 'VG',
213
+ 'Atlantic/Bermuda': 'BM',
214
+ 'America/Argentina/Catamarca': 'AR',
215
+ 'America/Cayman': 'KY',
216
+ 'America/Puerto_Rico': 'PR',
217
+ 'Pacific/Majuro': 'MH',
218
+ 'Europe/Busingen': 'DE',
219
+ 'Pacific/Midway': 'UM',
220
+ 'Indian/Cocos': 'CC',
221
+ 'Asia/Singapore': 'SG',
222
+ 'America/Boise': 'US',
223
+ 'America/Nuuk': 'GL',
224
+ 'America/Goose_Bay': 'CA',
225
+ 'Australia/Broken_Hill': 'AU',
226
+ 'Africa/Dar_es_Salaam': 'TZ',
227
+ 'Africa/Asmara': 'ER',
228
+ 'Asia/Samarkand': 'UZ',
229
+ 'Asia/Tbilisi': 'GE',
230
+ 'America/Argentina/Jujuy': 'AR',
231
+ 'America/Indiana/Winamac': 'US',
232
+ 'America/Porto_Velho': 'BR',
233
+ 'Asia/Magadan': 'RU',
234
+ 'Europe/Zaporozhye': 'UA',
235
+ 'Antarctica/Casey': 'AQ',
236
+ 'Asia/Shanghai': 'CN',
237
+ 'Pacific/Norfolk': 'NF',
238
+ 'Europe/Guernsey': 'GG',
239
+ 'Australia/Brisbane': 'AU',
240
+ 'Antarctica/DumontDUrville': 'AQ',
241
+ 'America/Havana': 'CU',
242
+ 'America/Atikokan': 'CA',
243
+ 'America/Mexico_City': 'MX',
244
+ 'America/Rankin_Inlet': 'CA',
245
+ 'America/Cuiaba': 'BR',
246
+ 'America/Resolute': 'CA',
247
+ 'Africa/Ceuta': 'ES',
248
+ 'Arctic/Longyearbyen': 'SJ',
249
+ 'Pacific/Guam': 'GU',
250
+ 'Asia/Damascus': 'SY',
251
+ 'Asia/Colombo': 'LK',
252
+ 'Asia/Yerevan': 'AM',
253
+ 'America/Montserrat': 'MS',
254
+ 'America/Belem': 'BR',
255
+ 'Europe/Kaliningrad': 'RU',
256
+ 'Atlantic/South_Georgia': 'GS',
257
+ 'Asia/Tashkent': 'UZ',
258
+ 'Asia/Kolkata': 'IN',
259
+ 'America/St_Johns': 'CA',
260
+ 'Asia/Srednekolymsk': 'RU',
261
+ 'Asia/Yakutsk': 'RU',
262
+ 'Europe/Prague': 'CZ',
263
+ 'Africa/Djibouti': 'DJ',
264
+ 'Asia/Dubai': 'AE',
265
+ 'Europe/Uzhgorod': 'UA',
266
+ 'America/Edmonton': 'CA',
267
+ 'Asia/Famagusta': 'CY',
268
+ 'America/Indiana/Knox': 'US',
269
+ 'Asia/Hebron': 'PS',
270
+ 'Asia/Taipei': 'TW',
271
+ 'Europe/London': 'GB',
272
+ 'Africa/Dakar': 'SN',
273
+ 'Australia/Darwin': 'AU',
274
+ 'America/Glace_Bay': 'CA',
275
+ 'Antarctica/Vostok': 'AQ',
276
+ 'America/Indiana/Vincennes': 'US',
277
+ 'America/Nipigon': 'CA',
278
+ 'Asia/Kuwait': 'KW',
279
+ 'Pacific/Guadalcanal': 'SB',
280
+ 'America/Toronto': 'CA',
281
+ 'Africa/Gaborone': 'BW',
282
+ 'Africa/Bujumbura': 'BI',
283
+ 'Africa/Lubumbashi': 'CD',
284
+ 'America/Merida': 'MX',
285
+ 'America/Marigot': 'MF',
286
+ 'Europe/Zagreb': 'HR',
287
+ 'Pacific/Easter': 'CL',
288
+ 'America/Santarem': 'BR',
289
+ 'Pacific/Noumea': 'NC',
290
+ 'America/Sitka': 'US',
291
+ 'Atlantic/Stanley': 'FK',
292
+ 'Pacific/Funafuti': 'TV',
293
+ 'America/Iqaluit': 'CA',
294
+ 'America/Rainy_River': 'CA',
295
+ 'America/Anchorage': 'US',
296
+ 'America/Lima': 'PE',
297
+ 'Asia/Baku': 'AZ',
298
+ 'America/Indiana/Vevay': 'US',
299
+ 'Asia/Ulaanbaatar': 'MN',
300
+ 'America/Managua': 'NI',
301
+ 'Asia/Krasnoyarsk': 'RU',
302
+ 'Asia/Qyzylorda': 'KZ',
303
+ 'America/Eirunepe': 'BR',
304
+ 'Europe/Podgorica': 'ME',
305
+ 'Europe/Chisinau': 'MD',
306
+ 'Europe/Mariehamn': 'AX',
307
+ 'Europe/Volgograd': 'RU',
308
+ 'Africa/Nairobi': 'KE',
309
+ 'Europe/Isle_of_Man': 'IM',
310
+ 'America/Menominee': 'US',
311
+ 'Africa/Harare': 'ZW',
312
+ 'Asia/Anadyr': 'RU',
313
+ 'America/Moncton': 'CA',
314
+ 'Indian/Maldives': 'MV',
315
+ 'America/Whitehorse': 'CA',
316
+ 'Antarctica/Mawson': 'AQ',
317
+ 'Europe/Madrid': 'ES',
318
+ 'America/Argentina/Mendoza': 'AR',
319
+ 'America/Manaus': 'BR',
320
+ 'Africa/Bangui': 'CF',
321
+ 'Indian/Mauritius': 'MU',
322
+ 'Africa/Tunis': 'TN',
323
+ 'Australia/Lord_Howe': 'AU',
324
+ 'America/Kentucky/Louisville': 'US',
325
+ 'America/North_Dakota/Center': 'US',
326
+ 'Asia/Novokuznetsk': 'RU',
327
+ 'Asia/Makassar': 'ID',
328
+ 'America/Port_of_Spain': 'TT',
329
+ 'America/Bahia_Banderas': 'MX',
330
+ 'Pacific/Auckland': 'NZ',
331
+ 'America/Sao_Paulo': 'BR',
332
+ 'Asia/Dhaka': 'BD',
333
+ 'America/Pangnirtung': 'CA',
334
+ 'Europe/Dublin': 'IE',
335
+ 'Asia/Brunei': 'BN',
336
+ 'Africa/Brazzaville': 'CG',
337
+ 'America/Montevideo': 'UY',
338
+ 'America/Jamaica': 'JM',
339
+ 'America/Indiana/Indianapolis': 'US',
340
+ 'America/Kralendijk': 'BQ',
341
+ 'Europe/Gibraltar': 'GI',
342
+ 'Pacific/Marquesas': 'PF',
343
+ 'Pacific/Apia': 'WS',
344
+ 'Europe/Jersey': 'JE',
345
+ 'America/Phoenix': 'US',
346
+ 'Africa/Ndjamena': 'TD',
347
+ 'Asia/Karachi': 'PK',
348
+ 'Africa/Kampala': 'UG',
349
+ 'Asia/Sakhalin': 'RU',
350
+ 'America/Martinique': 'MQ',
351
+ 'Europe/Moscow': 'RU',
352
+ 'Africa/Conakry': 'GN',
353
+ 'America/Barbados': 'BB',
354
+ 'Africa/Lome': 'TG',
355
+ 'America/Ojinaga': 'MX',
356
+ 'America/Tegucigalpa': 'HN',
357
+ 'Asia/Bangkok': 'TH',
358
+ 'Africa/Johannesburg': 'ZA',
359
+ 'Europe/Vaduz': 'LI',
360
+ 'Africa/Sao_Tome': 'ST',
361
+ 'America/Cambridge_Bay': 'CA',
362
+ 'America/Lower_Princes': 'SX',
363
+ 'America/Miquelon': 'PM',
364
+ 'America/St_Kitts': 'KN',
365
+ 'Australia/Melbourne': 'AU',
366
+ 'Europe/Minsk': 'BY',
367
+ 'Asia/Vladivostok': 'RU',
368
+ 'Europe/Sofia': 'BG',
369
+ 'Antarctica/Davis': 'AQ',
370
+ 'Pacific/Galapagos': 'EC',
371
+ 'America/North_Dakota/New_Salem': 'US',
372
+ 'Asia/Amman': 'JO',
373
+ 'Pacific/Wallis': 'WF',
374
+ 'America/Hermosillo': 'MX',
375
+ 'Pacific/Kiritimati': 'KI',
376
+ 'Antarctica/Macquarie': 'AU',
377
+ 'America/Guyana': 'GY',
378
+ 'Asia/Riyadh': 'SA',
379
+ 'Pacific/Tahiti': 'PF',
380
+ 'America/St_Vincent': 'VC',
381
+ 'America/Cancun': 'MX',
382
+ 'America/Grenada': 'GD',
383
+ 'Pacific/Wake': 'UM',
384
+ 'America/Dawson': 'CA',
385
+ 'Europe/Brussels': 'BE',
386
+ 'Indian/Kerguelen': 'TF',
387
+ 'America/Yakutat': 'US',
388
+ 'Indian/Mahe': 'SC',
389
+ 'Atlantic/Reykjavik': 'IS',
390
+ 'America/Panama': 'PA',
391
+ 'America/Guadeloupe': 'GP',
392
+ 'Europe/Malta': 'MT',
393
+ 'Antarctica/Troll': 'AQ',
394
+ 'Asia/Jayapura': 'ID',
395
+ 'Asia/Bahrain': 'BH',
396
+ 'Asia/Chita': 'RU',
397
+ 'Europe/Tallinn': 'EE',
398
+ 'Asia/Khandyga': 'RU',
399
+ 'America/Rio_Branco': 'BR',
400
+ 'Atlantic/St_Helena': 'SH',
401
+ 'Africa/Juba': 'SS',
402
+ 'America/Adak': 'US',
403
+ 'Pacific/Saipan': 'MP',
404
+ 'America/St_Lucia': 'LC',
405
+ 'America/Inuvik': 'CA',
406
+ 'Europe/Luxembourg': 'LU',
407
+ 'Africa/Bissau': 'GW',
408
+ 'Asia/Oral': 'KZ',
409
+ 'America/Boa_Vista': 'BR',
410
+ 'Europe/Skopje': 'MK',
411
+ 'America/Port-au-Prince': 'HT',
412
+ 'Pacific/Port_Moresby': 'PG',
413
+ 'Europe/Andorra': 'AD',
414
+ 'America/Indiana/Marengo': 'US',
415
+ 'Africa/Kigali': 'RW',
416
+ 'Africa/Bamako': 'ML',
417
+ 'America/Dominica': 'DM',
418
+ 'Asia/Aqtobe': 'KZ',
419
+ 'Europe/Istanbul': 'TR',
420
+ 'Pacific/Rarotonga': 'CK',
421
+ 'America/Danmarkshavn': 'GL',
422
+ 'Europe/Zurich': 'CH',
423
+ 'Asia/Yangon': 'MM',
424
+ 'America/Monterrey': 'MX',
425
+ 'Europe/Lisbon': 'PT',
426
+ 'Asia/Kuching': 'MY',
427
+ 'Antarctica/Rothera': 'AQ',
428
+ 'Australia/Perth': 'AU',
429
+ 'Asia/Phnom_Penh': 'KH',
430
+ 'America/Swift_Current': 'CA',
431
+ 'Asia/Aqtau': 'KZ',
432
+ 'Asia/Urumqi': 'CN',
433
+ 'Asia/Calcutta': 'IN'
434
+ };
435
+
436
+ /* eslint-disable @typescript-eslint/no-explicit-any */
437
+ const isBrowser = typeof window !== 'undefined';
438
+ let userId = null;
439
+ const PREF = 'saasco-sdk';
440
+ const data = {};
441
+ function storeData(key, value, ttl) {
442
+ const item = {
443
+ value,
444
+ expiry: new Date().getTime() + ttl
445
+ };
446
+ if (!isBrowser) {
447
+ if (value === undefined) {
448
+ delete data[key];
449
+ return;
450
+ }
451
+ data[key] = item;
452
+ return;
453
+ }
454
+ const fullKey = `${PREF}-${key}`;
455
+ if (value === undefined) return window.localStorage.removeItem(fullKey);
456
+ localStorage.setItem(fullKey, JSON.stringify(item));
457
+ }
458
+ function retrieveData(key) {
459
+ if (!isBrowser) {
460
+ const item = data[key];
461
+ if (!item) return null;
462
+ if (Date.now() > item.expiry) {
463
+ delete data[key];
464
+ return null;
465
+ }
466
+ return item.value;
467
+ }
468
+ const fullKey = `${PREF}-${key}`;
469
+ const itemStr = localStorage.getItem(fullKey);
470
+ if (!itemStr) {
471
+ return null;
472
+ }
473
+ const item = JSON.parse(itemStr);
474
+ const now = new Date();
475
+ if (now.getTime() > item.expiry) {
476
+ localStorage.removeItem(fullKey);
477
+ return null;
478
+ }
479
+ return item.value;
480
+ }
481
+ function getSessionId() {
482
+ return retrieveData(`session-id`);
483
+ }
484
+ function setSessionId({
485
+ reset
486
+ } = {
487
+ reset: false
488
+ }) {
489
+ const sessionId = reset ? uuid.v4() : getSessionId() || uuid.v4();
490
+ storeData(`session-id`, sessionId, 1000 * 60 * 30);
491
+ }
492
+ function getAnonymousId() {
493
+ return retrieveData(`anonymous-id`);
494
+ }
495
+ function setAnonmousId({
496
+ reset
497
+ } = {
498
+ reset: false
499
+ }) {
500
+ const anonymousId = reset ? uuid.v4() : getAnonymousId() || uuid.v4();
501
+ storeData(`anonymous-id`, anonymousId, 1000 * 60 * 60 * 24 * 365);
502
+ return anonymousId;
503
+ }
504
+ class Saasco {
505
+ /**
506
+ * Creates an instance of Saasco SDK.
507
+ * @param config Configuration options.
508
+ * @param config.projectId The unique identifier for the project.
509
+ * @param config.proxy The URL of the proxy server to use, if any.
510
+ * @param config.autoPageTracking Whether to automatically track page views. Default is false.
511
+ * @param config.enabled Whether analytics is enabled. Default is true. Set to false for development and staging envioronments. Will still allow debug mode to be true, just no events will be sent
512
+ * @param config.debug Whether to log debug information. Default is false.
513
+ */
514
+ constructor(config) {
515
+ this.config = config;
516
+ this.lastPageViewHref = '';
517
+ this.isInitialized = false;
518
+ // default enabled to true
519
+ this.config.enabled = this.config.enabled === undefined ? true : this.config.enabled;
520
+ }
521
+ init() {
522
+ if (this.isInitialized) {
523
+ this.log('Saasco is already initialized. Please check your code to ensure that init() is not being called multiple times.');
524
+ return;
525
+ }
526
+ this.initiAutoPageTracking();
527
+ this.log('Saasco initialized', this.config);
528
+ this.isInitialized = true;
529
+ }
530
+ debug(value) {
531
+ this.config.debug = value;
532
+ this.log(`Debug mode ${value ? 'activated' : 'deactivated'}.`);
533
+ }
534
+ /**
535
+ * The track method lets you record the actions your users perform.
536
+ * Its good to keep a conistent naming convention for your events.
537
+ * We like the Object Action Framework from segment:
538
+ * https://segment.com/academy/collecting-data/naming-conventions-for-clean-data/
539
+ *
540
+ * @param name The name of the event eg "Song Played"
541
+ * @param properties The properties of the event eg { genre: "Classics", song: "Never Gonna Give You Up" }
542
+ */
543
+ track(name,
544
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
545
+ properties) {
546
+ var _a;
547
+ // Prevent duplicate Page View tracking
548
+ if (name === 'Page View') {
549
+ if (!isBrowser) return;
550
+ const pageViewHref = window.location.href;
551
+ if (pageViewHref === this.lastPageViewHref) return;
552
+ this.lastPageViewHref = pageViewHref;
553
+ }
554
+ setSessionId();
555
+ setAnonmousId();
556
+ const customNavigator = isBrowser ? navigator : undefined;
557
+ const locale = isBrowser ? (customNavigator === null || customNavigator === void 0 ? void 0 : customNavigator.languages) && (customNavigator === null || customNavigator === void 0 ? void 0 : customNavigator.languages.length) ? customNavigator === null || customNavigator === void 0 ? void 0 : customNavigator.languages[0] : (customNavigator === null || customNavigator === void 0 ? void 0 : customNavigator.userLanguage) || (customNavigator === null || customNavigator === void 0 ? void 0 : customNavigator.language) || (customNavigator === null || customNavigator === void 0 ? void 0 : customNavigator.browserLanguage) || 'en' : undefined;
558
+ // https://caniuse.com/?search=Intl.DateTimeFormat().resolvedOptions().timeZone
559
+ // Only has 96.63% global support, so we need to check for undefined
560
+ const timezone = Intl.DateTimeFormat().resolvedOptions().timeZone;
561
+ const location = isBrowser ? timezones[timezone] || ((_a = locale === null || locale === void 0 ? void 0 : locale.split('-')) === null || _a === void 0 ? void 0 : _a[1]) || 'undefined' : undefined;
562
+ const userAgent = isBrowser ? window.navigator.userAgent : undefined;
563
+ const title = isBrowser ? document.title : undefined;
564
+ const pathname = isBrowser ? window.location.pathname : undefined;
565
+ const href = isBrowser ? window.location.href : undefined;
566
+ const $screenHeight = isBrowser ? screen.height : undefined;
567
+ const $screenWidth = isBrowser ? screen.width : undefined;
568
+ const $screenDPI = isBrowser ? window.devicePixelRatio : undefined;
569
+ const $referrer = isBrowser ? document.referrer : undefined;
570
+ const $utm_source = this.getSearchParam('utm_source');
571
+ const $utm_medium = this.getSearchParam('utm_medium');
572
+ const $utm_campaign = this.getSearchParam('utm_campaign');
573
+ const $utm_content = this.getSearchParam('utm_content');
574
+ const $utm_term = this.getSearchParam('utm_term');
575
+ const $gclid = this.getSearchParam('gclid');
576
+ const $fbclid = this.getSearchParam('fbclid');
577
+ const data = {
578
+ id: uuid.v4(),
579
+ timestamp: new Date().toISOString(),
580
+ action: name,
581
+ version: '1',
582
+ sessionId: getSessionId(),
583
+ anonymousId: getAnonymousId(),
584
+ projectId: this.config.projectId,
585
+ payload: JSON.stringify({
586
+ 'user-agent': userAgent,
587
+ locale,
588
+ location,
589
+ title,
590
+ pathname,
591
+ href,
592
+ $screenHeight,
593
+ $screenWidth,
594
+ $screenDPI,
595
+ $referrer,
596
+ $utm_source,
597
+ $utm_medium,
598
+ $utm_campaign,
599
+ $utm_content,
600
+ $utm_term,
601
+ $gclid,
602
+ $fbclid,
603
+ properties: properties || {}
604
+ })
605
+ };
606
+ this.doRequest('events', data);
607
+ }
608
+ /**
609
+ * The page method lets you record page views on your website
610
+ * This records the page title and path and names the event useing the reserved property "Page Viewed"
611
+ *
612
+ * Before implementing this make sure you have disabled the autoPageTracking in the config or you will get duplicate page views
613
+ */
614
+ page() {
615
+ this.track('Page View');
616
+ }
617
+ identify(distinctIdOrProperties, propertiesOrOptions, optionsOrNothing) {
618
+ const hasId = typeof distinctIdOrProperties === 'string' || typeof distinctIdOrProperties === 'number' || distinctIdOrProperties === null;
619
+ const distinctId = hasId ? distinctIdOrProperties === null || distinctIdOrProperties === void 0 ? void 0 : distinctIdOrProperties.toString() : `soft_${uuid.v4()}`;
620
+ const properties = hasId ? propertiesOrOptions : distinctIdOrProperties;
621
+ const options = hasId ? optionsOrNothing : propertiesOrOptions;
622
+ // When the user gets identified as null this will reset the users session and anonymous id
623
+ // This should only be called when distinctId is null and there is an existing userId.
624
+ // This means the user has logged out and we should reset the session and anonymous IDs
625
+ const reset = !distinctId && !!userId;
626
+ if (reset) this.log('User logged out and session reset');
627
+ setSessionId({
628
+ reset
629
+ });
630
+ const anonymousId = setAnonmousId({
631
+ reset
632
+ });
633
+ // set the distinct Id to the userId
634
+ userId = distinctId;
635
+ // No distinctId provided so we don't track the user
636
+ if (!distinctId) return;
637
+ const data = {
638
+ id: uuid.v4(),
639
+ timestamp: new Date().toISOString(),
640
+ projectId: this.config.projectId,
641
+ distinctId,
642
+ anonymousId,
643
+ version: '1',
644
+ payload: properties || {},
645
+ options: options || {}
646
+ };
647
+ this.doRequest('identify', data);
648
+ }
649
+ /**
650
+ * Handles sending data to the Saasco API
651
+ * If you have a proxy set up, it will send the data to the proxy and you can handle forawrding the data to the Saasco events API
652
+ * @param path
653
+ * @param data
654
+ */
655
+ doRequest(path, data) {
656
+ const base = this.config.proxy || 'https://www.saasco.com/api/';
657
+ const url = `${base}${path}`;
658
+ const logMessage = data.action === 'Page View' ? `Page View ${window.location.pathname}` // if its a page view, include pathname in console log
659
+ : data.action || path;
660
+ this.log(logMessage, data);
661
+ // If analytics is disabled, don't send the request
662
+ if (this.config.enabled === false) return;
663
+ fetch(url, {
664
+ method: 'POST',
665
+ headers: {
666
+ 'Content-Type': 'application/json'
667
+ },
668
+ body: JSON.stringify(data)
669
+ }).then(response => {
670
+ if (!response.ok) {
671
+ throw new Error(response.status.toString());
672
+ }
673
+ }).catch(e => {
674
+ console.error('Error with Saasco request: ' + e.message, path, data);
675
+ });
676
+ }
677
+ /**
678
+ * @param args Arguments to be logged
679
+ */
680
+ log(...args) {
681
+ if (!this.config.debug) return;
682
+ const message = '◍ Saasco Debug';
683
+ console.log(...[`\x1b[47m\x1b[30m ${message} \x1b[0m`,
684
+ // Message highlighted for easy finding
685
+ ...args]);
686
+ }
687
+ getSearchParam(param) {
688
+ if (typeof window === 'undefined') return undefined;
689
+ return new URLSearchParams(window.location.search).get(param);
690
+ }
691
+ /**
692
+ * If autoPageTracking is enabled, this will automatically track page views
693
+ * It listens to url changes to track new pages every time the url changes
694
+ * @returns
695
+ */
696
+ initiAutoPageTracking() {
697
+ // Disable auto page tracking if the config is set to false
698
+ // Will run if undefined or true
699
+ if (this.config.autoPageTracking === false) return;
700
+ // Prevent running on the server
701
+ if (!isBrowser) return console.warn('Saasco auto page tracking is only available in the browser');
702
+ // Prevent intitializing auto page tracking more than once
703
+ if (window.saascoAutoPageTrackingActive) {
704
+ this.log('Auto Page Tracking already enabled');
705
+ return;
706
+ }
707
+ window.saascoAutoPageTrackingActive = true;
708
+ this.log('Auto Page Tracking enabled');
709
+ // Track initial page load
710
+ this.page();
711
+ // Listen for hash changes
712
+ window.addEventListener('hashchange', () => this.page());
713
+ // Listen to popstate for back and forward navigation
714
+ window.addEventListener('popstate', () => this.page());
715
+ // Wrap history push state to listen for URL changes
716
+ const historyPushState = history.pushState;
717
+ history.pushState = (...args) => {
718
+ const returnValue = historyPushState.apply(history, args);
719
+ this.page();
720
+ return returnValue;
721
+ };
722
+ // Wrap history replace state to listen for URL changes
723
+ const historyReplaceState = history.replaceState;
724
+ history.replaceState = (...args) => {
725
+ const returnValue = historyReplaceState.apply(history, args);
726
+ this.page();
727
+ return returnValue;
728
+ };
729
+ }
730
+ }
731
+
732
+ function coerceReservedProperties(properties) {
733
+ const coerce = [{
734
+ key: 'age',
735
+ coerceFrom: ['age', 'age_value', 'ageValue', 'user_age', 'userAge', 'user_age_value', 'userAgeValue', 'age_of_user', 'ageOfUser', 'age_in_years', 'ageInYears', 'years_old', 'yearsOld', 'age_years', 'ageYears'],
736
+ schema: zod.z.coerce.number().optional()
737
+ }, {
738
+ key: 'avatar',
739
+ coerceFrom: ['avatar', 'user_avatar', 'userAvatar', 'avatar_url', 'avatarUrl', 'profile_picture', 'profilePicture', 'picture', 'user_picture', 'userPicture', 'profile_pic', 'profilePic', 'pic', 'user_pic', 'userPic', 'image', 'user_image', 'userImage', 'profile_image', 'profileImage', 'profile_image_url', 'profileImageUrl', 'profile_pic_url', 'profilePicUrl', 'pic_url', 'picUrl', 'image_url', 'imageUrl', 'user_image_url', 'userImageUrl', 'user_pic_url', 'userPicUrl', 'profile_pic_url', 'profilePicUrl', 'pic_url', 'picUrl', 'image_url', 'imageUrl', 'user_image_url', 'userImageUrl', 'user_pic_url', 'userPicUrl'],
740
+ schema: zod.z.coerce.string().url().optional()
741
+ }, {
742
+ key: 'birthday',
743
+ coerceFrom: ['birthday', 'birth_date', 'birthDate', 'date_of_birth', 'dateOfBirth', 'dob', 'Dob', 'birth_day', 'birthDay']
744
+ }, {
745
+ key: 'createdAt',
746
+ coerceFrom: ['createdAt', 'created_at', 'created', 'createdDate', 'created_date', 'dateCreated', 'date_created', 'date_created_at', 'dateCreatedAt', 'date_created_at', 'dateCreated', 'date_created'],
747
+ schema: zod.z.coerce.date().optional()
748
+ }, {
749
+ key: 'description',
750
+ coerceFrom: ['description', 'bio', 'about', 'about_me', 'aboutMe', 'user_description', 'userDescription', 'profile_description', 'profileDescription']
751
+ }, {
752
+ key: 'email',
753
+ coerceFrom: ['email', 'user_email', 'userEmail', 'email_address', 'emailAddress', 'e_mail', 'E_Mail', 'mail', 'Mail', 'contact_email', 'contactEmail', 'primary_email', 'primaryEmail'],
754
+ schema: zod.z.coerce.string().email().optional()
755
+ }, {
756
+ key: 'firstName',
757
+ coerceFrom: ['first_name', 'firstName', 'firstname', 'given_name', 'givenName', 'user_first_name', 'userFirstName', 'name_first', 'nameFirst', 'f_name', 'fName']
758
+ }, {
759
+ key: 'gender',
760
+ coerceFrom: ['gender', 'user_gender', 'userGender', 'sex', 'user_sex', 'userSex']
761
+ }, {
762
+ key: 'lastName',
763
+ coerceFrom: ['last_name', 'lastName', 'lastname', 'surname', 'user_last_name', 'userLastName', 'name_last', 'nameLast', 'l_name', 'lName']
764
+ }, {
765
+ key: 'name',
766
+ coerceFrom: ['name', 'full_name', 'fullName', 'user_name', 'userName', 'complete_name', 'completeName']
767
+ }, {
768
+ key: 'phone',
769
+ coerceFrom: ['phone', 'phone_number', 'phoneNumber', 'mobile', 'mobile_number', 'mobileNumber', 'contact_number', 'contactNumber', 'tel', 'telephone']
770
+ }, {
771
+ key: 'title',
772
+ coerceFrom: ['title', 'user_title', 'userTitle', 'position', 'job_title', 'jobTitle']
773
+ }, {
774
+ key: 'username',
775
+ coerceFrom: ['username', 'user_name', 'userName', 'user_login', 'userLogin', 'account_name', 'accountName', 'screen_name', 'screenName', 'handle']
776
+ }, {
777
+ key: 'website',
778
+ coerceFrom: ['website', 'web_site', 'site', 'web', 'personal_website', 'personalWebsite', 'company_website', 'companyWebsite'],
779
+ schema: zod.z.coerce.string().url().optional()
780
+ }, {
781
+ key: 'displayName',
782
+ coerceFrom: ['display_name', 'displayName', 'user_display_name', 'userDisplayName', 'full_name', 'fullName', 'user_full_name', 'userFullName', 'complete_name', 'completeName', 'user_complete_name', 'userCompleteName', 'name', 'username'],
783
+ schema: zod.z.coerce.string().url().optional()
784
+ }];
785
+ return coerce.reduce((acc, {
786
+ key,
787
+ coerceFrom,
788
+ schema
789
+ }) => {
790
+ const coercedValue = coerceValue(properties, coerceFrom, schema);
791
+ if (coercedValue) acc[key] = coercedValue;
792
+ if (!coercedValue && key === 'displayName' && acc['firstName']) {
793
+ const displayName = `${acc['firstName'] || ''} ${acc['lastName'] || ''}`.trim();
794
+ if (displayName) acc[key] = displayName;
795
+ }
796
+ return acc;
797
+ }, properties);
798
+ }
799
+ /**
800
+ * Coerces the first non-null value from the properties object
801
+ * @param properties
802
+ * @param keys Provided in priority order, the first to match will return
803
+ * @returns
804
+ */
805
+ function coerceValue(properties, keys, schema) {
806
+ let coercedValue = null;
807
+ for (const key of keys) {
808
+ if (properties[key] !== undefined) {
809
+ if (!schema) {
810
+ coercedValue = properties[key];
811
+ break;
812
+ } else {
813
+ const result = schema.safeParse(properties[key]);
814
+ if (result.success) {
815
+ coercedValue = properties[key];
816
+ break;
817
+ }
818
+ }
819
+ }
820
+ }
821
+ return coercedValue;
822
+ }
823
+
824
+ const tbAny = zod.z.union([zod.z.string(), zod.z.number(), zod.z.array(zod.z.union([zod.z.string(), zod.z.number()]))]);
825
+ const tinyBirdBaseSchema = zod.z.object({
826
+ meta: zod.z.array(zod.z.object({
827
+ name: zod.z.string(),
828
+ type: zod.z.string()
829
+ })),
830
+ statistics: zod.z.object({
831
+ elapsed: zod.z.number(),
832
+ rows_read: zod.z.number(),
833
+ bytes_read: zod.z.number()
834
+ }),
835
+ rows: zod.z.number()
836
+ });
837
+ const kpisRequestSchema = zod.z.object({
838
+ projectId: zod.z.string(),
839
+ dateTo: zod.z.string().optional(),
840
+ dateFrom: zod.z.string().optional(),
841
+ referringDomain: zod.z.string().optional(),
842
+ location: zod.z.string().optional()
843
+ });
844
+ const kpisResponseSchema = tinyBirdBaseSchema.extend({
845
+ data: zod.z.array(zod.z.object({
846
+ date: zod.z.string(),
847
+ visits: zod.z.number(),
848
+ pageviews: zod.z.number(),
849
+ bounceRate: zod.z.nullable(zod.z.number()),
850
+ avgSessionSec: zod.z.number()
851
+ }))
852
+ });
853
+ const eventsKpisResponseSchema = tinyBirdBaseSchema.extend({
854
+ data: zod.z.array(zod.z.object({
855
+ unique: zod.z.number(),
856
+ total: zod.z.number()
857
+ }))
858
+ });
859
+ const baseTopRequestSchema = zod.z.object({
860
+ projectId: zod.z.string(),
861
+ dateTo: zod.z.string().optional(),
862
+ dateFrom: zod.z.string().optional(),
863
+ limit: zod.z.number().optional(),
864
+ skip: zod.z.number().optional(),
865
+ referringDomain: zod.z.string().optional(),
866
+ location: zod.z.string().optional()
867
+ });
868
+ const topPagesResponseSchema = tinyBirdBaseSchema.extend({
869
+ data: zod.z.array(zod.z.object({
870
+ pathname: zod.z.string(),
871
+ visits: zod.z.number(),
872
+ hits: zod.z.number()
873
+ }))
874
+ });
875
+ const topLocationsResponseSchema = tinyBirdBaseSchema.extend({
876
+ data: zod.z.array(zod.z.object({
877
+ location: zod.z.string(),
878
+ visits: zod.z.number(),
879
+ hits: zod.z.number(),
880
+ bounceRate: zod.z.nullable(zod.z.number()),
881
+ avgSessionSec: zod.z.number()
882
+ }))
883
+ });
884
+ const topDevicesResponseSchema = tinyBirdBaseSchema.extend({
885
+ data: zod.z.array(zod.z.object({
886
+ device: zod.z.string(),
887
+ visits: zod.z.number(),
888
+ hits: zod.z.number(),
889
+ bounceRate: zod.z.nullable(zod.z.number()),
890
+ avgSessionSec: zod.z.number()
891
+ }))
892
+ });
893
+ const topBrowsersResponseSchema = tinyBirdBaseSchema.extend({
894
+ data: zod.z.array(zod.z.object({
895
+ browser: zod.z.string(),
896
+ visits: zod.z.number(),
897
+ hits: zod.z.number(),
898
+ bounceRate: zod.z.nullable(zod.z.number()),
899
+ avgSessionSec: zod.z.number()
900
+ }))
901
+ });
902
+ const topSourcesSchema = zod.z.object({
903
+ referrer: zod.z.string(),
904
+ visits: zod.z.number(),
905
+ hits: zod.z.number(),
906
+ bounceRate: zod.z.nullable(zod.z.number()),
907
+ avgSessionSec: zod.z.number()
908
+ });
909
+ const topSourcesResponseSchema = tinyBirdBaseSchema.extend({
910
+ data: zod.z.array(topSourcesSchema)
911
+ });
912
+ const topActionsResponseSchema = tinyBirdBaseSchema.extend({
913
+ data: zod.z.array(zod.z.object({
914
+ action: zod.z.string(),
915
+ unique: zod.z.number(),
916
+ total: zod.z.number()
917
+ }))
918
+ });
919
+ const analyticsEventSchema = zod.z.object({
920
+ id: zod.z.string(),
921
+ timestamp: zod.z.string(),
922
+ projectId: zod.z.string(),
923
+ anonymousId: zod.z.string(),
924
+ sessionId: zod.z.string(),
925
+ version: zod.z.string(),
926
+ action: zod.z.string(),
927
+ payload: zod.z.string()
928
+ });
929
+ const userEventsResponseSchema = tinyBirdBaseSchema.extend({
930
+ data: zod.z.array(analyticsEventSchema)
931
+ });
932
+ const currentUsersRequestSchema = zod.z.object({
933
+ projectId: zod.z.string(),
934
+ minutes: zod.z.number().optional(),
935
+ referringDomain: zod.z.string().optional(),
936
+ location: zod.z.string().optional()
937
+ });
938
+ const currentUsersResponseSchema = tinyBirdBaseSchema.extend({
939
+ data: zod.z.array(zod.z.object({
940
+ visits: zod.z.number()
941
+ }))
942
+ });
943
+ const reservedPropertiesSchema = zod.z.object({
944
+ age: zod.z.number().nullish(),
945
+ avatar: zod.z.string().url().nullish(),
946
+ birthday: zod.z.string().nullish(),
947
+ createdAt: zod.z.string().nullish(),
948
+ description: zod.z.string().nullish(),
949
+ email: zod.z.string().email().or(zod.z.literal('')).nullish(),
950
+ firstName: zod.z.string().nullish(),
951
+ gender: zod.z.string().nullish(),
952
+ id: zod.z.string().nullish(),
953
+ lastName: zod.z.string().nullish(),
954
+ name: zod.z.string().nullish(),
955
+ phone: zod.z.string().nullish(),
956
+ title: zod.z.string().nullish(),
957
+ username: zod.z.string().nullish(),
958
+ website: zod.z.string().nullish()
959
+ });
960
+ const userPropertiesSchema = reservedPropertiesSchema.and(zod.z.record(zod.z.union([zod.z.string(), zod.z.number(), zod.z.boolean(), zod.z.date(), zod.z.null(), zod.z.array(zod.z.union([zod.z.string(), zod.z.number(), zod.z.boolean(), zod.z.date(), zod.z.null()]))])));
961
+ const analyticsUserRawSchema = zod.z.object({
962
+ timestamp: zod.z.string(),
963
+ distinctId: zod.z.string(),
964
+ projectId: zod.z.string(),
965
+ payload: zod.z.string()
966
+ });
967
+ const analyticsUserSchema = analyticsUserRawSchema.omit({
968
+ payload: true
969
+ }).and(zod.z.object({
970
+ properties: userPropertiesSchema
971
+ }));
972
+ const listUsersParamsSchema = zod.z.object({
973
+ projectId: zod.z.string(),
974
+ limit: zod.z.number().optional()
975
+ });
976
+ const getAnalyticsUserParamsSchema = zod.z.object({
977
+ projectId: zod.z.string(),
978
+ distinctId: zod.z.string()
979
+ });
980
+ const idenfitySchema = zod.z.object({
981
+ id: zod.z.string(),
982
+ timestamp: zod.z.string(),
983
+ projectId: zod.z.string(),
984
+ distinctId: zod.z.string(),
985
+ anonymousId: zod.z.string(),
986
+ version: zod.z.string(),
987
+ payload: userPropertiesSchema,
988
+ options: zod.z.object({
989
+ active: zod.z.boolean().optional()
990
+ }).optional()
991
+ });
992
+
993
+ exports.Saasco = Saasco;
994
+ exports.analyticsEventSchema = analyticsEventSchema;
995
+ exports.analyticsUserRawSchema = analyticsUserRawSchema;
996
+ exports.analyticsUserSchema = analyticsUserSchema;
997
+ exports.baseTopRequestSchema = baseTopRequestSchema;
998
+ exports.coerceReservedProperties = coerceReservedProperties;
999
+ exports.currentUsersRequestSchema = currentUsersRequestSchema;
1000
+ exports.currentUsersResponseSchema = currentUsersResponseSchema;
1001
+ exports.eventsKpisResponseSchema = eventsKpisResponseSchema;
1002
+ exports.getAnalyticsUserParamsSchema = getAnalyticsUserParamsSchema;
1003
+ exports.idenfitySchema = idenfitySchema;
1004
+ exports.kpisRequestSchema = kpisRequestSchema;
1005
+ exports.kpisResponseSchema = kpisResponseSchema;
1006
+ exports.listUsersParamsSchema = listUsersParamsSchema;
1007
+ exports.reservedPropertiesSchema = reservedPropertiesSchema;
1008
+ exports.tbAny = tbAny;
1009
+ exports.tinyBirdBaseSchema = tinyBirdBaseSchema;
1010
+ exports.topActionsResponseSchema = topActionsResponseSchema;
1011
+ exports.topBrowsersResponseSchema = topBrowsersResponseSchema;
1012
+ exports.topDevicesResponseSchema = topDevicesResponseSchema;
1013
+ exports.topLocationsResponseSchema = topLocationsResponseSchema;
1014
+ exports.topPagesResponseSchema = topPagesResponseSchema;
1015
+ exports.topSourcesResponseSchema = topSourcesResponseSchema;
1016
+ exports.topSourcesSchema = topSourcesSchema;
1017
+ exports.userEventsResponseSchema = userEventsResponseSchema;
1018
+ exports.userPropertiesSchema = userPropertiesSchema;