saasco-sdk 0.1.0 → 0.1.3

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,994 @@
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
+ let userId = null;
438
+ const PREF = 'saasco-sdk';
439
+ function storeData(key, value, ttl) {
440
+ const fullKey = `${PREF}-${key}`;
441
+ if (value === undefined) return window.localStorage.removeItem(fullKey);
442
+ const now = new Date();
443
+ const item = {
444
+ value,
445
+ expiry: now.getTime() + ttl
446
+ };
447
+ localStorage.setItem(fullKey, JSON.stringify(item));
448
+ }
449
+ function retrieveData(key) {
450
+ const fullKey = `${PREF}-${key}`;
451
+ const itemStr = localStorage.getItem(fullKey);
452
+ if (!itemStr) {
453
+ return null;
454
+ }
455
+ const item = JSON.parse(itemStr);
456
+ const now = new Date();
457
+ if (now.getTime() > item.expiry) {
458
+ localStorage.removeItem(fullKey);
459
+ return null;
460
+ }
461
+ return item.value;
462
+ }
463
+ function getSessionId() {
464
+ return retrieveData(`session-id`);
465
+ }
466
+ function setSessionId({
467
+ reset
468
+ } = {
469
+ reset: false
470
+ }) {
471
+ const sessionId = reset ? uuid.v4() : getSessionId() || uuid.v4();
472
+ storeData(`session-id`, sessionId, 1000 * 60 * 30);
473
+ }
474
+ function getAnonymousId() {
475
+ return retrieveData(`anonymous-id`);
476
+ }
477
+ function setAnonmousId({
478
+ reset
479
+ } = {
480
+ reset: false
481
+ }) {
482
+ const anonymousId = reset ? uuid.v4() : getAnonymousId() || uuid.v4();
483
+ storeData(`anonymous-id`, anonymousId, 1000 * 60 * 60 * 24 * 365);
484
+ return anonymousId;
485
+ }
486
+ class Saasco {
487
+ /**
488
+ * Creates an instance of Saasco SDK.
489
+ * @param config Configuration options.
490
+ * @param config.projectId The unique identifier for the project.
491
+ * @param config.proxy The URL of the proxy server to use, if any.
492
+ * @param config.autoPageTracking Whether to automatically track page views. Default is false.
493
+ * @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
494
+ * @param config.debug Whether to log debug information. Default is false.
495
+ */
496
+ constructor(config) {
497
+ this.config = config;
498
+ this.lastPageViewHref = '';
499
+ this.isInitialized = false;
500
+ // default enabled to true
501
+ this.config.enabled = this.config.enabled === undefined ? true : this.config.enabled;
502
+ }
503
+ init() {
504
+ if (this.isInitialized) {
505
+ this.log('Saasco is already initialized. Please check your code to ensure that init() is not being called multiple times.');
506
+ return;
507
+ }
508
+ this.initiAutoPageTracking();
509
+ this.log('Saasco initialized', this.config);
510
+ this.isInitialized = true;
511
+ }
512
+ debug(value) {
513
+ this.config.debug = value;
514
+ this.log(`Debug mode ${value ? 'activated' : 'deactivated'}.`);
515
+ }
516
+ /**
517
+ * The track method lets you record the actions your users perform.
518
+ * Its good to keep a conistent naming convention for your events.
519
+ * We like the Object Action Framework from segment:
520
+ * https://segment.com/academy/collecting-data/naming-conventions-for-clean-data/
521
+ *
522
+ * @param name The name of the event eg "Song Played"
523
+ * @param properties The properties of the event eg { genre: "Classics", song: "Never Gonna Give You Up" }
524
+ */
525
+ track(name,
526
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
527
+ properties) {
528
+ var _a;
529
+ // Prevent duplicate Page View tracking
530
+ if (name === 'Page View') {
531
+ const pageViewHref = window.location.href;
532
+ if (pageViewHref === this.lastPageViewHref) return;
533
+ this.lastPageViewHref = pageViewHref;
534
+ }
535
+ setSessionId();
536
+ setAnonmousId();
537
+ const customNavigator = navigator;
538
+ const locale = customNavigator.languages && customNavigator.languages.length ? customNavigator.languages[0] : customNavigator.userLanguage || customNavigator.language || customNavigator.browserLanguage || 'en';
539
+ // https://caniuse.com/?search=Intl.DateTimeFormat().resolvedOptions().timeZone
540
+ // Only has 96.63% global support, so we need to check for undefined
541
+ const timezone = Intl.DateTimeFormat().resolvedOptions().timeZone;
542
+ const location = timezones[timezone] || ((_a = locale === null || locale === void 0 ? void 0 : locale.split('-')) === null || _a === void 0 ? void 0 : _a[1]) || 'undefined';
543
+ const $screenHeight = screen.height;
544
+ const $screenWidth = screen.width;
545
+ const $screenDPI = window.devicePixelRatio;
546
+ const $referrer = document.referrer;
547
+ const $utm_source = this.getSearchParam('utm_source');
548
+ const $utm_medium = this.getSearchParam('utm_medium');
549
+ const $utm_campaign = this.getSearchParam('utm_campaign');
550
+ const $utm_content = this.getSearchParam('utm_content');
551
+ const $utm_term = this.getSearchParam('utm_term');
552
+ const $gclid = this.getSearchParam('gclid');
553
+ const $fbclid = this.getSearchParam('fbclid');
554
+ const data = {
555
+ id: uuid.v4(),
556
+ timestamp: new Date().toISOString(),
557
+ action: name,
558
+ version: '1',
559
+ sessionId: getSessionId(),
560
+ anonymousId: getAnonymousId(),
561
+ projectId: this.config.projectId,
562
+ payload: JSON.stringify({
563
+ 'user-agent': window.navigator.userAgent,
564
+ locale,
565
+ location,
566
+ title: document.title,
567
+ pathname: window.location.pathname,
568
+ href: window.location.href,
569
+ $screenHeight,
570
+ $screenWidth,
571
+ $screenDPI,
572
+ $referrer,
573
+ $utm_source,
574
+ $utm_medium,
575
+ $utm_campaign,
576
+ $utm_content,
577
+ $utm_term,
578
+ $gclid,
579
+ $fbclid,
580
+ properties: properties || {}
581
+ })
582
+ };
583
+ this.doRequest('events', data);
584
+ }
585
+ /**
586
+ * The page method lets you record page views on your website
587
+ * This records the page title and path and names the event useing the reserved property "Page Viewed"
588
+ *
589
+ * Before implementing this make sure you have disabled the autoPageTracking in the config or you will get duplicate page views
590
+ */
591
+ page() {
592
+ this.track('Page View');
593
+ }
594
+ identify(distinctIdOrProperties, propertiesOrOptions, optionsOrNothing) {
595
+ const hasId = typeof distinctIdOrProperties === 'string' || typeof distinctIdOrProperties === 'number' || distinctIdOrProperties === null;
596
+ const distinctId = hasId ? distinctIdOrProperties === null || distinctIdOrProperties === void 0 ? void 0 : distinctIdOrProperties.toString() : `soft_${uuid.v4()}`;
597
+ const properties = hasId ? propertiesOrOptions : distinctIdOrProperties;
598
+ const options = hasId ? optionsOrNothing : propertiesOrOptions;
599
+ // When the user gets identified as null this will reset the users session and anonymous id
600
+ // This should only be called when distinctId is null and there is an existing userId.
601
+ // This means the user has logged out and we should reset the session and anonymous IDs
602
+ const reset = !distinctId && !!userId;
603
+ if (reset) this.log('User logged out and session reset');
604
+ setSessionId({
605
+ reset
606
+ });
607
+ const anonymousId = setAnonmousId({
608
+ reset
609
+ });
610
+ // set the distinct Id to the userId
611
+ userId = distinctId;
612
+ // No distinctId provided so we don't track the user
613
+ if (!distinctId) return;
614
+ const data = {
615
+ id: uuid.v4(),
616
+ timestamp: new Date().toISOString(),
617
+ projectId: this.config.projectId,
618
+ distinctId,
619
+ anonymousId,
620
+ version: '1',
621
+ payload: properties || {},
622
+ options: options || {}
623
+ };
624
+ this.doRequest('identify', data);
625
+ }
626
+ /**
627
+ * Handles sending data to the Saasco API
628
+ * 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
629
+ * @param path
630
+ * @param data
631
+ */
632
+ doRequest(path, data) {
633
+ const base = this.config.proxy || 'https://www.saasco.com/api/';
634
+ const url = `${base}${path}`;
635
+ const logMessage = data.action === 'Page View' ? `Page View ${window.location.pathname}` // if its a page view, include pathname in console log
636
+ : data.action || path;
637
+ this.log(logMessage, data);
638
+ // If analytics is disabled, don't send the request
639
+ if (this.config.enabled === false) return;
640
+ fetch(url, {
641
+ method: 'POST',
642
+ headers: {
643
+ 'Content-Type': 'application/json'
644
+ },
645
+ body: JSON.stringify(data)
646
+ }).then(response => {
647
+ if (!response.ok) {
648
+ throw new Error(response.status.toString());
649
+ }
650
+ }).catch(e => {
651
+ console.error('Error with Saasco request: ' + e.message, path, data);
652
+ });
653
+ }
654
+ /**
655
+ * @param args Arguments to be logged
656
+ */
657
+ log(...args) {
658
+ if (!this.config.debug) return;
659
+ const message = '◍ Saasco Debug';
660
+ console.log(...[`\x1b[47m\x1b[30m ${message} \x1b[0m`,
661
+ // Message highlighted for easy finding
662
+ ...args]);
663
+ }
664
+ getSearchParam(param) {
665
+ return new URLSearchParams(window.location.search).get(param);
666
+ }
667
+ /**
668
+ * If autoPageTracking is enabled, this will automatically track page views
669
+ * It listens to url changes to track new pages every time the url changes
670
+ * @returns
671
+ */
672
+ initiAutoPageTracking() {
673
+ // Disable auto page tracking if the config is set to false
674
+ // Will run if undefined or true
675
+ if (this.config.autoPageTracking === false) return;
676
+ // Prevent running on the server
677
+ if (typeof window === 'undefined') return;
678
+ // Prevent intitializing auto page tracking more than once
679
+ if (window.saascoAutoPageTrackingActive) {
680
+ this.log('Auto Page Tracking already enabled');
681
+ return;
682
+ }
683
+ window.saascoAutoPageTrackingActive = true;
684
+ this.log('Auto Page Tracking enabled');
685
+ // Track initial page load
686
+ this.page();
687
+ // Listen for hash changes
688
+ window.addEventListener('hashchange', () => this.page());
689
+ // Listen to popstate for back and forward navigation
690
+ window.addEventListener('popstate', () => this.page());
691
+ // Wrap history push state to listen for URL changes
692
+ const historyPushState = history.pushState;
693
+ history.pushState = (...args) => {
694
+ const returnValue = historyPushState.apply(history, args);
695
+ this.page();
696
+ return returnValue;
697
+ };
698
+ // Wrap history replace state to listen for URL changes
699
+ const historyReplaceState = history.replaceState;
700
+ history.replaceState = (...args) => {
701
+ const returnValue = historyReplaceState.apply(history, args);
702
+ this.page();
703
+ return returnValue;
704
+ };
705
+ }
706
+ }
707
+
708
+ function coerceReservedProperties(properties) {
709
+ const coerce = [{
710
+ key: 'age',
711
+ 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'],
712
+ schema: zod.z.coerce.number().optional()
713
+ }, {
714
+ key: 'avatar',
715
+ 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'],
716
+ schema: zod.z.coerce.string().url().optional()
717
+ }, {
718
+ key: 'birthday',
719
+ coerceFrom: ['birthday', 'birth_date', 'birthDate', 'date_of_birth', 'dateOfBirth', 'dob', 'Dob', 'birth_day', 'birthDay']
720
+ }, {
721
+ key: 'createdAt',
722
+ coerceFrom: ['createdAt', 'created_at', 'created', 'createdDate', 'created_date', 'dateCreated', 'date_created', 'date_created_at', 'dateCreatedAt', 'date_created_at', 'dateCreated', 'date_created'],
723
+ schema: zod.z.coerce.date().optional()
724
+ }, {
725
+ key: 'description',
726
+ coerceFrom: ['description', 'bio', 'about', 'about_me', 'aboutMe', 'user_description', 'userDescription', 'profile_description', 'profileDescription']
727
+ }, {
728
+ key: 'email',
729
+ coerceFrom: ['email', 'user_email', 'userEmail', 'email_address', 'emailAddress', 'e_mail', 'E_Mail', 'mail', 'Mail', 'contact_email', 'contactEmail', 'primary_email', 'primaryEmail'],
730
+ schema: zod.z.coerce.string().email().optional()
731
+ }, {
732
+ key: 'firstName',
733
+ coerceFrom: ['first_name', 'firstName', 'firstname', 'given_name', 'givenName', 'user_first_name', 'userFirstName', 'name_first', 'nameFirst', 'f_name', 'fName']
734
+ }, {
735
+ key: 'gender',
736
+ coerceFrom: ['gender', 'user_gender', 'userGender', 'sex', 'user_sex', 'userSex']
737
+ }, {
738
+ key: 'lastName',
739
+ coerceFrom: ['last_name', 'lastName', 'lastname', 'surname', 'user_last_name', 'userLastName', 'name_last', 'nameLast', 'l_name', 'lName']
740
+ }, {
741
+ key: 'name',
742
+ coerceFrom: ['name', 'full_name', 'fullName', 'user_name', 'userName', 'complete_name', 'completeName']
743
+ }, {
744
+ key: 'phone',
745
+ coerceFrom: ['phone', 'phone_number', 'phoneNumber', 'mobile', 'mobile_number', 'mobileNumber', 'contact_number', 'contactNumber', 'tel', 'telephone']
746
+ }, {
747
+ key: 'title',
748
+ coerceFrom: ['title', 'user_title', 'userTitle', 'position', 'job_title', 'jobTitle']
749
+ }, {
750
+ key: 'username',
751
+ coerceFrom: ['username', 'user_name', 'userName', 'user_login', 'userLogin', 'account_name', 'accountName', 'screen_name', 'screenName', 'handle']
752
+ }, {
753
+ key: 'website',
754
+ coerceFrom: ['website', 'web_site', 'site', 'web', 'personal_website', 'personalWebsite', 'company_website', 'companyWebsite'],
755
+ schema: zod.z.coerce.string().url().optional()
756
+ }, {
757
+ key: 'displayName',
758
+ coerceFrom: ['display_name', 'displayName', 'user_display_name', 'userDisplayName', 'full_name', 'fullName', 'user_full_name', 'userFullName', 'complete_name', 'completeName', 'user_complete_name', 'userCompleteName', 'name', 'username'],
759
+ schema: zod.z.coerce.string().url().optional()
760
+ }];
761
+ return coerce.reduce((acc, {
762
+ key,
763
+ coerceFrom,
764
+ schema
765
+ }) => {
766
+ const coercedValue = coerceValue(properties, coerceFrom, schema);
767
+ if (coercedValue) acc[key] = coercedValue;
768
+ if (!coercedValue && key === 'displayName' && acc['firstName']) {
769
+ const displayName = `${acc['firstName'] || ''} ${acc['lastName'] || ''}`.trim();
770
+ if (displayName) acc[key] = displayName;
771
+ }
772
+ return acc;
773
+ }, properties);
774
+ }
775
+ /**
776
+ * Coerces the first non-null value from the properties object
777
+ * @param properties
778
+ * @param keys Provided in priority order, the first to match will return
779
+ * @returns
780
+ */
781
+ function coerceValue(properties, keys, schema) {
782
+ let coercedValue = null;
783
+ for (const key of keys) {
784
+ if (properties[key] !== undefined) {
785
+ if (!schema) {
786
+ coercedValue = properties[key];
787
+ break;
788
+ } else {
789
+ const result = schema.safeParse(properties[key]);
790
+ if (result.success) {
791
+ coercedValue = properties[key];
792
+ break;
793
+ }
794
+ }
795
+ }
796
+ }
797
+ return coercedValue;
798
+ }
799
+
800
+ const tbAny = zod.z.union([zod.z.string(), zod.z.number(), zod.z.array(zod.z.union([zod.z.string(), zod.z.number()]))]);
801
+ const tinyBirdBaseSchema = zod.z.object({
802
+ meta: zod.z.array(zod.z.object({
803
+ name: zod.z.string(),
804
+ type: zod.z.string()
805
+ })),
806
+ statistics: zod.z.object({
807
+ elapsed: zod.z.number(),
808
+ rows_read: zod.z.number(),
809
+ bytes_read: zod.z.number()
810
+ }),
811
+ rows: zod.z.number()
812
+ });
813
+ const kpisRequestSchema = zod.z.object({
814
+ projectId: zod.z.string(),
815
+ dateTo: zod.z.string().optional(),
816
+ dateFrom: zod.z.string().optional(),
817
+ referringDomain: zod.z.string().optional(),
818
+ location: zod.z.string().optional()
819
+ });
820
+ const kpisResponseSchema = tinyBirdBaseSchema.extend({
821
+ data: zod.z.array(zod.z.object({
822
+ date: zod.z.string(),
823
+ visits: zod.z.number(),
824
+ pageviews: zod.z.number(),
825
+ bounceRate: zod.z.nullable(zod.z.number()),
826
+ avgSessionSec: zod.z.number()
827
+ }))
828
+ });
829
+ const eventsKpisResponseSchema = tinyBirdBaseSchema.extend({
830
+ data: zod.z.array(zod.z.object({
831
+ unique: zod.z.number(),
832
+ total: zod.z.number()
833
+ }))
834
+ });
835
+ const baseTopRequestSchema = zod.z.object({
836
+ projectId: zod.z.string(),
837
+ dateTo: zod.z.string().optional(),
838
+ dateFrom: zod.z.string().optional(),
839
+ limit: zod.z.number().optional(),
840
+ skip: zod.z.number().optional(),
841
+ referringDomain: zod.z.string().optional(),
842
+ location: zod.z.string().optional()
843
+ });
844
+ const topPagesResponseSchema = tinyBirdBaseSchema.extend({
845
+ data: zod.z.array(zod.z.object({
846
+ pathname: zod.z.string(),
847
+ visits: zod.z.number(),
848
+ hits: zod.z.number()
849
+ }))
850
+ });
851
+ const topLocationsResponseSchema = tinyBirdBaseSchema.extend({
852
+ data: zod.z.array(zod.z.object({
853
+ location: zod.z.string(),
854
+ visits: zod.z.number(),
855
+ hits: zod.z.number(),
856
+ bounceRate: zod.z.nullable(zod.z.number()),
857
+ avgSessionSec: zod.z.number()
858
+ }))
859
+ });
860
+ const topDevicesResponseSchema = tinyBirdBaseSchema.extend({
861
+ data: zod.z.array(zod.z.object({
862
+ device: zod.z.string(),
863
+ visits: zod.z.number(),
864
+ hits: zod.z.number(),
865
+ bounceRate: zod.z.nullable(zod.z.number()),
866
+ avgSessionSec: zod.z.number()
867
+ }))
868
+ });
869
+ const topBrowsersResponseSchema = tinyBirdBaseSchema.extend({
870
+ data: zod.z.array(zod.z.object({
871
+ browser: zod.z.string(),
872
+ visits: zod.z.number(),
873
+ hits: zod.z.number(),
874
+ bounceRate: zod.z.nullable(zod.z.number()),
875
+ avgSessionSec: zod.z.number()
876
+ }))
877
+ });
878
+ const topSourcesSchema = zod.z.object({
879
+ referrer: zod.z.string(),
880
+ visits: zod.z.number(),
881
+ hits: zod.z.number(),
882
+ bounceRate: zod.z.nullable(zod.z.number()),
883
+ avgSessionSec: zod.z.number()
884
+ });
885
+ const topSourcesResponseSchema = tinyBirdBaseSchema.extend({
886
+ data: zod.z.array(topSourcesSchema)
887
+ });
888
+ const topActionsResponseSchema = tinyBirdBaseSchema.extend({
889
+ data: zod.z.array(zod.z.object({
890
+ action: zod.z.string(),
891
+ unique: zod.z.number(),
892
+ total: zod.z.number()
893
+ }))
894
+ });
895
+ const analyticsEventSchema = zod.z.object({
896
+ id: zod.z.string(),
897
+ timestamp: zod.z.string(),
898
+ projectId: zod.z.string(),
899
+ anonymousId: zod.z.string(),
900
+ sessionId: zod.z.string(),
901
+ version: zod.z.string(),
902
+ action: zod.z.string(),
903
+ payload: zod.z.string()
904
+ });
905
+ const userEventsResponseSchema = tinyBirdBaseSchema.extend({
906
+ data: zod.z.array(analyticsEventSchema)
907
+ });
908
+ const currentUsersRequestSchema = zod.z.object({
909
+ projectId: zod.z.string(),
910
+ minutes: zod.z.number().optional(),
911
+ referringDomain: zod.z.string().optional(),
912
+ location: zod.z.string().optional()
913
+ });
914
+ const currentUsersResponseSchema = tinyBirdBaseSchema.extend({
915
+ data: zod.z.array(zod.z.object({
916
+ visits: zod.z.number()
917
+ }))
918
+ });
919
+ const reservedPropertiesSchema = zod.z.object({
920
+ age: zod.z.number().nullish(),
921
+ avatar: zod.z.string().url().nullish(),
922
+ birthday: zod.z.string().nullish(),
923
+ createdAt: zod.z.string().nullish(),
924
+ description: zod.z.string().nullish(),
925
+ email: zod.z.string().email().or(zod.z.literal('')).nullish(),
926
+ firstName: zod.z.string().nullish(),
927
+ gender: zod.z.string().nullish(),
928
+ id: zod.z.string().nullish(),
929
+ lastName: zod.z.string().nullish(),
930
+ name: zod.z.string().nullish(),
931
+ phone: zod.z.string().nullish(),
932
+ title: zod.z.string().nullish(),
933
+ username: zod.z.string().nullish(),
934
+ website: zod.z.string().nullish()
935
+ });
936
+ 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()]))])));
937
+ const analyticsUserRawSchema = zod.z.object({
938
+ timestamp: zod.z.string(),
939
+ distinctId: zod.z.string(),
940
+ projectId: zod.z.string(),
941
+ payload: zod.z.string()
942
+ });
943
+ const analyticsUserSchema = analyticsUserRawSchema.omit({
944
+ payload: true
945
+ }).and(zod.z.object({
946
+ properties: userPropertiesSchema
947
+ }));
948
+ const listUsersParamsSchema = zod.z.object({
949
+ projectId: zod.z.string(),
950
+ limit: zod.z.number().optional()
951
+ });
952
+ const getAnalyticsUserParamsSchema = zod.z.object({
953
+ projectId: zod.z.string(),
954
+ distinctId: zod.z.string()
955
+ });
956
+ const idenfitySchema = zod.z.object({
957
+ id: zod.z.string(),
958
+ timestamp: zod.z.string(),
959
+ projectId: zod.z.string(),
960
+ distinctId: zod.z.string(),
961
+ anonymousId: zod.z.string(),
962
+ version: zod.z.string(),
963
+ payload: userPropertiesSchema,
964
+ options: zod.z.object({
965
+ active: zod.z.boolean().optional()
966
+ }).optional()
967
+ });
968
+
969
+ exports.Saasco = Saasco;
970
+ exports.analyticsEventSchema = analyticsEventSchema;
971
+ exports.analyticsUserRawSchema = analyticsUserRawSchema;
972
+ exports.analyticsUserSchema = analyticsUserSchema;
973
+ exports.baseTopRequestSchema = baseTopRequestSchema;
974
+ exports.coerceReservedProperties = coerceReservedProperties;
975
+ exports.currentUsersRequestSchema = currentUsersRequestSchema;
976
+ exports.currentUsersResponseSchema = currentUsersResponseSchema;
977
+ exports.eventsKpisResponseSchema = eventsKpisResponseSchema;
978
+ exports.getAnalyticsUserParamsSchema = getAnalyticsUserParamsSchema;
979
+ exports.idenfitySchema = idenfitySchema;
980
+ exports.kpisRequestSchema = kpisRequestSchema;
981
+ exports.kpisResponseSchema = kpisResponseSchema;
982
+ exports.listUsersParamsSchema = listUsersParamsSchema;
983
+ exports.reservedPropertiesSchema = reservedPropertiesSchema;
984
+ exports.tbAny = tbAny;
985
+ exports.tinyBirdBaseSchema = tinyBirdBaseSchema;
986
+ exports.topActionsResponseSchema = topActionsResponseSchema;
987
+ exports.topBrowsersResponseSchema = topBrowsersResponseSchema;
988
+ exports.topDevicesResponseSchema = topDevicesResponseSchema;
989
+ exports.topLocationsResponseSchema = topLocationsResponseSchema;
990
+ exports.topPagesResponseSchema = topPagesResponseSchema;
991
+ exports.topSourcesResponseSchema = topSourcesResponseSchema;
992
+ exports.topSourcesSchema = topSourcesSchema;
993
+ exports.userEventsResponseSchema = userEventsResponseSchema;
994
+ exports.userPropertiesSchema = userPropertiesSchema;