@mudrichenkoevgeny/shared-foundation 0.0.46 → 0.0.48
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/README.md +35 -0
- package/index.d.ts +520 -59
- package/index.js +442 -16
- package/index.mjs +442 -16
- package/package.json +1 -1
package/README.md
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# @mudrichenkoevgeny/shared-foundation
|
|
2
|
+
|
|
3
|
+
TypeScript & Zod contracts, API routes, error codes, permission models, runtime enums, and branded types generated directly from the [shared-foundation](https://github.com/mudrichenkoevgeny/shared-foundation) Kotlin Multiplatform (KMP) repository.
|
|
4
|
+
|
|
5
|
+
Provides a single source of truth (SSOT) between Kotlin Backend/KMP services and TypeScript/React web applications.
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
# pnpm
|
|
11
|
+
pnpm add @mudrichenkoevgeny/shared-foundation zod
|
|
12
|
+
|
|
13
|
+
# npm
|
|
14
|
+
npm install @mudrichenkoevgeny/shared-foundation zod
|
|
15
|
+
|
|
16
|
+
# yarn
|
|
17
|
+
yarn add @mudrichenkoevgeny/shared-foundation zod
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Features
|
|
21
|
+
|
|
22
|
+
- **Zod Schemas**: Auto-generated `z.ZodType` validation schemas for all Request payloads and Response DTOs.
|
|
23
|
+
- **Runtime Enums**: TS types & runtime JS objects for all enums and string unions (`UserAuthProvider`, `UserRole`, `UserAccountStatus`, `AccountLockoutType`, `ClientType`, `SortOrder`, `UserSortValues`, etc.).
|
|
24
|
+
- **Route Constants**: Strongly typed API endpoint routes.
|
|
25
|
+
- **Error & Permission Codes**: Literal string definitions for all application error codes and permission strings.
|
|
26
|
+
- **Branded Types & Helpers**: Type-safe domain identifiers with converter helpers.
|
|
27
|
+
|
|
28
|
+
## Source Code & Repository
|
|
29
|
+
|
|
30
|
+
The source code for this library and generator is maintained in the main GitHub repository:
|
|
31
|
+
**[GitHub Repository: mudrichenkoevgeny/shared-foundation](https://github.com/mudrichenkoevgeny/shared-foundation)**
|
|
32
|
+
|
|
33
|
+
## License
|
|
34
|
+
|
|
35
|
+
Apache License 2.0. See [LICENSE](https://github.com/mudrichenkoevgeny/shared-foundation/blob/main/LICENSE) for details.
|
package/index.d.ts
CHANGED
|
@@ -228,6 +228,212 @@ readonly UPDATE_MANAGEMENT_AUTH_SETTINGS: "/management/auth/settings";
|
|
|
228
228
|
readonly RESET_MANAGEMENT_AUTH_SETTINGS: "/management/auth/settings/reset";
|
|
229
229
|
};
|
|
230
230
|
|
|
231
|
+
export declare const CommonApiFields: {
|
|
232
|
+
readonly ITEMS: "items";
|
|
233
|
+
readonly TOTAL_COUNT: "total_count";
|
|
234
|
+
readonly TOTAL_PAGES: "total_pages";
|
|
235
|
+
readonly ID: "id";
|
|
236
|
+
readonly CREATED_AT: "created_at";
|
|
237
|
+
readonly UPDATED_AT: "updated_at";
|
|
238
|
+
readonly CODE: "code";
|
|
239
|
+
readonly MESSAGE: "message";
|
|
240
|
+
readonly ARGS: "args";
|
|
241
|
+
readonly TYPE: "type";
|
|
242
|
+
readonly PAYLOAD: "payload";
|
|
243
|
+
readonly METADATA: "metadata";
|
|
244
|
+
readonly TIMESTAMP: "timestamp";
|
|
245
|
+
readonly CLIENT_TYPE: "client_type";
|
|
246
|
+
readonly CLIENT_DEVICE_INFO: "client_device_info";
|
|
247
|
+
readonly CLIENT_INFO: "client_info";
|
|
248
|
+
readonly USER_AGENT: "user_agent";
|
|
249
|
+
readonly IP_ADDRESS: "ip_address";
|
|
250
|
+
readonly MASKED_IP_ADDRESS: "masked_ip_address";
|
|
251
|
+
readonly LANGUAGE: "language";
|
|
252
|
+
readonly DEVICE_ID: "device_id";
|
|
253
|
+
readonly DEVICE_NAME: "device_name";
|
|
254
|
+
readonly APP_VERSION: "app_version";
|
|
255
|
+
readonly OPERATION_SYSTEM_VERSION: "operation_system_version";
|
|
256
|
+
readonly API_VERSION: "api_version";
|
|
257
|
+
readonly IS_SENSITIVE_VALUES_MASKED: "is_sensitive_values_masked";
|
|
258
|
+
};
|
|
259
|
+
|
|
260
|
+
export declare const SecurityApiFields: {
|
|
261
|
+
readonly RECENT_AUTHENTICATION_VALIDITY_SECONDS_FOR_OPEN_USER: "recent_authentication_validity_seconds_for_open_user";
|
|
262
|
+
readonly RECENT_AUTHENTICATION_VALIDITY_SECONDS_FOR_MANAGEMENT_USER: "recent_authentication_validity_seconds_for_management_user";
|
|
263
|
+
readonly MFA_TOKEN: "mfa_token";
|
|
264
|
+
readonly TOTP_CODE: "totp_code";
|
|
265
|
+
readonly TOTP_SECRET_KEY: "totp_secret_key";
|
|
266
|
+
readonly TOTP_OTP_AUTH_URL: "totp_otp_auth_url";
|
|
267
|
+
readonly TOTP_RECOVERY_CODES: "totp_recovery_codes";
|
|
268
|
+
readonly OPEN_PASSWORD_POLICY: "open_password_policy";
|
|
269
|
+
readonly MANAGEMENT_PASSWORD_POLICY: "management_password_policy";
|
|
270
|
+
readonly MIN_LENGTH: "min_length";
|
|
271
|
+
readonly REQUIRE_LETTER: "require_letter";
|
|
272
|
+
readonly REQUIRE_UPPER_CASE: "require_upper_case";
|
|
273
|
+
readonly REQUIRE_LOWER_CASE: "require_lower_case";
|
|
274
|
+
readonly REQUIRE_DIGIT: "require_digit";
|
|
275
|
+
readonly REQUIRE_SPECIAL_CHAR: "require_special_char";
|
|
276
|
+
readonly COMMON_PASSWORDS: "common_passwords";
|
|
277
|
+
readonly OTP_CONFIRMATION: "otp_confirmation";
|
|
278
|
+
readonly RETRY_AFTER_SECONDS: "retry_after_seconds";
|
|
279
|
+
readonly NUMBER_OF_SYMBOLS: "number_of_symbols";
|
|
280
|
+
readonly EXPIRATION_SECONDS: "expiration_seconds";
|
|
281
|
+
readonly MAX_REQUESTS_PER_PERIOD: "max_requests_per_period";
|
|
282
|
+
readonly RATE_LIMIT_PERIOD_SECONDS: "rate_limit_period_seconds";
|
|
283
|
+
readonly REFRESH_TOKEN_ROTATION_GRACE_PERIOD_SECONDS: "refresh_token_rotation_grace_period_seconds";
|
|
284
|
+
readonly ACCOUNT_LOCKOUT_POLICY: "account_lockout_policy";
|
|
285
|
+
readonly ACCOUNT_LOCKOUT_CHECK_INTERVAL_SECONDS: "account_lockout_check_interval_seconds";
|
|
286
|
+
readonly MAX_FAILED_PASSWORD_ATTEMPTS: "max_failed_password_attempts";
|
|
287
|
+
readonly MAX_FAILED_OTP_ATTEMPTS: "max_failed_otp_attempts";
|
|
288
|
+
readonly MAX_FAILED_TOTP_ATTEMPTS: "max_failed_totp_attempts";
|
|
289
|
+
readonly FAILED_ATTEMPTS_WINDOW_SECONDS: "failed_attempts_window_seconds";
|
|
290
|
+
readonly LOCKOUT_DURATION_SECONDS: "lockout_duration_seconds";
|
|
291
|
+
readonly INDEFINITE_LOCKOUT_THRESHOLD: "indefinite_lockout_threshold";
|
|
292
|
+
readonly IS_SELF_SERVICE_UNLOCK_ENABLED: "is_self_service_unlock_enabled";
|
|
293
|
+
readonly OPEN_IP_RESTRICTION_POLICY: "open_ip_restriction_policy";
|
|
294
|
+
readonly MANAGEMENT_IP_RESTRICTION_POLICY: "management_ip_restriction_policy";
|
|
295
|
+
readonly IS_BLACKLIST_ENABLED: "is_blacklist_enabled";
|
|
296
|
+
readonly BLACKLIST: "blacklist";
|
|
297
|
+
readonly IS_WHITELIST_ENABLED: "is_whitelist_enabled";
|
|
298
|
+
readonly WHITELIST: "whitelist";
|
|
299
|
+
};
|
|
300
|
+
|
|
301
|
+
export declare const GlobalSettingsApiFields: {
|
|
302
|
+
readonly PRIVACY_POLICY_URL: "privacy_policy_url";
|
|
303
|
+
readonly TERMS_OF_SERVICE_URL: "terms_of_service_url";
|
|
304
|
+
readonly CONTACT_SUPPORT_EMAIL: "contact_support_email";
|
|
305
|
+
readonly IS_TRACING_ENABLED: "is_tracing_enabled";
|
|
306
|
+
readonly IS_METRICS_ENABLED: "is_metrics_enabled";
|
|
307
|
+
readonly IS_VERBOSE_LOGGING_ENABLED: "is_verbose_logging_enabled";
|
|
308
|
+
readonly MIN_SUPPORTED_APP_VERSIONS: "min_supported_app_versions";
|
|
309
|
+
};
|
|
310
|
+
|
|
311
|
+
export declare const UserApiFields: {
|
|
312
|
+
readonly EXTERNAL_PROVIDER_TOKEN: "external_provider_token";
|
|
313
|
+
readonly TOKEN_TYPE: "token_type";
|
|
314
|
+
readonly SESSION_ID: "session_id";
|
|
315
|
+
readonly ACCESS_TOKEN: "access_token";
|
|
316
|
+
readonly REFRESH_TOKEN: "refresh_token";
|
|
317
|
+
readonly SESSION_TOKEN: "session_token";
|
|
318
|
+
readonly EXPIRES_AT: "expires_at";
|
|
319
|
+
readonly EMAIL: "email";
|
|
320
|
+
readonly PHONE_NUMBER: "phone_number";
|
|
321
|
+
readonly PASSWORD: "password";
|
|
322
|
+
readonly OLD_PASSWORD: "old_password";
|
|
323
|
+
readonly NEW_PASSWORD: "new_password";
|
|
324
|
+
readonly CONFIRMATION_CODE: "confirmation_code";
|
|
325
|
+
readonly AUTH_PROVIDER: "auth_provider";
|
|
326
|
+
readonly USER: "user";
|
|
327
|
+
readonly USER_ID: "user_id";
|
|
328
|
+
readonly ROLE: "role";
|
|
329
|
+
readonly USER_ROLE: "user_role";
|
|
330
|
+
readonly ACCOUNT_STATUS: "account_status";
|
|
331
|
+
readonly ACCOUNT_STATUS_ON_RESTORE: "account_status_on_restore";
|
|
332
|
+
readonly AUTHORITY_LEVEL: "authority_level";
|
|
333
|
+
readonly PERMISSION_CODES: "permission_codes";
|
|
334
|
+
readonly IS_TOTP_ENABLED: "is_totp_enabled";
|
|
335
|
+
readonly LAST_LOGIN_AT: "last_login_at";
|
|
336
|
+
readonly LAST_ACTIVE_AT: "last_active_at";
|
|
337
|
+
readonly SCHEDULED_PERMANENT_DELETION_AT: "scheduled_permanent_deletion_at";
|
|
338
|
+
readonly ACCOUNT_LOCKOUT_TYPE: "account_lockout_type";
|
|
339
|
+
readonly TEMPORARY_LOCKOUT_UNTIL: "temporary_lockout_until";
|
|
340
|
+
readonly IDENTIFIER: "identifier";
|
|
341
|
+
readonly EXTERNAL_PROVIDER_EMAIL: "external_provider_email";
|
|
342
|
+
readonly USER_AUTH_PROVIDER: "user_auth_provider";
|
|
343
|
+
readonly IDENTIFIER_ID: "identifier_id";
|
|
344
|
+
readonly DISPLAY_NAME: "display_name";
|
|
345
|
+
readonly IDENTIFIER_DISPLAY_NAME: "identifier_display_name";
|
|
346
|
+
readonly IDENTIFIER_AUTH_PROVIDER: "identifier_auth_provider";
|
|
347
|
+
readonly LAST_ACCESSED_AT: "last_accessed_at";
|
|
348
|
+
readonly LAST_REAUTHENTICATED_AT: "last_reauthenticated_at";
|
|
349
|
+
readonly DELETED_SESSION_IDS: "deleted_session_ids";
|
|
350
|
+
readonly DELETED_IDENTIFIER_IDS: "deleted_identifier_ids";
|
|
351
|
+
readonly MAX_TOTAL_IDENTIFIERS: "max_total_identifiers";
|
|
352
|
+
readonly MAX_EMAIL_IDENTIFIERS: "max_email_identifiers";
|
|
353
|
+
readonly MAX_PHONE_IDENTIFIERS: "max_phone_identifiers";
|
|
354
|
+
readonly MAX_IDENTIFIERS_PER_EXTERNAL_PROVIDER: "max_identifiers_per_external_provider";
|
|
355
|
+
readonly MAX_ACTIVE_SESSIONS_FOR_OPEN_USER: "max_active_sessions_for_open_user";
|
|
356
|
+
readonly MAX_ACTIVE_SESSIONS_FOR_MANAGEMENT_USER: "max_active_sessions_for_management_user";
|
|
357
|
+
readonly AVAILABLE_AUTH_PROVIDERS: "available_auth_providers";
|
|
358
|
+
readonly ACCESS_TOKEN_VALIDITY_SECONDS: "access_token_validity_seconds";
|
|
359
|
+
readonly REFRESH_TOKEN_VALIDITY_SECONDS: "refresh_token_validity_seconds";
|
|
360
|
+
readonly ACCOUNT_DELETION_GRACE_PERIOD_SECONDS: "account_deletion_grace_period_seconds";
|
|
361
|
+
readonly ACCOUNT_DELETION_CHECK_INTERVAL_SECONDS: "account_deletion_check_interval_seconds";
|
|
362
|
+
readonly IS_REGISTRATION_ENABLED: "is_registration_enabled";
|
|
363
|
+
readonly EMAIL_RESTRICTION_POLICY: "email_restriction_policy";
|
|
364
|
+
readonly OPEN_EMAIL_RESTRICTION_POLICY: "open_email_restriction_policy";
|
|
365
|
+
readonly MANAGEMENT_EMAIL_RESTRICTION_POLICY: "management_email_restriction_policy";
|
|
366
|
+
readonly PRIMARY: "primary";
|
|
367
|
+
readonly SECONDARY: "secondary";
|
|
368
|
+
readonly OPEN_GLOBAL_SETTINGS: "open_global_settings";
|
|
369
|
+
readonly MANAGEMENT_GLOBAL_SETTINGS: "management_global_settings";
|
|
370
|
+
readonly OPEN_SECURITY_SETTINGS: "open_security_settings";
|
|
371
|
+
readonly MANAGEMENT_SECURITY_SETTINGS: "management_security_settings";
|
|
372
|
+
readonly OPEN_AUTH_SETTINGS: "open_auth_settings";
|
|
373
|
+
readonly MANAGEMENT_AUTH_SETTINGS: "management_auth_settings";
|
|
374
|
+
};
|
|
375
|
+
|
|
376
|
+
export declare const AuditEventFields: {
|
|
377
|
+
readonly ACTOR_ID: "actor_id";
|
|
378
|
+
readonly ACTOR_TYPE: "actor_type";
|
|
379
|
+
readonly ACTOR_USER_ROLE: "actor_user_role";
|
|
380
|
+
readonly ACTION: "action";
|
|
381
|
+
readonly RESOURCE: "resource";
|
|
382
|
+
readonly RESOURCE_ID: "resource_id";
|
|
383
|
+
readonly STATUS: "status";
|
|
384
|
+
readonly METADATA_KEY: "key";
|
|
385
|
+
readonly METADATA_VALUE: "value";
|
|
386
|
+
readonly METADATA_VALUE_SENSITIVITY: "value_sensitivity";
|
|
387
|
+
};
|
|
388
|
+
|
|
389
|
+
export declare const CommonHttpHeaders: {
|
|
390
|
+
readonly TRACE_HEADER_NAME: "X-Trace-Id";
|
|
391
|
+
readonly CLIENT_TYPE_HEADER_NAME: "X-Client-Type";
|
|
392
|
+
readonly DEVICE_ID_HEADER_NAME: "X-Device-Id";
|
|
393
|
+
readonly DEVICE_NAME_HEADER_NAME: "X-Device-Name";
|
|
394
|
+
readonly APP_VERSION_HEADER_NAME: "X-App-Version";
|
|
395
|
+
readonly OPERATION_SYSTEM_VERSION_HEADER_NAME: "X-OS-Version";
|
|
396
|
+
readonly API_VERSION_HEADER_NAME: "X-Api-Version";
|
|
397
|
+
};
|
|
398
|
+
|
|
399
|
+
export declare const CommonWebSocketCloseReasons: {
|
|
400
|
+
readonly NORMAL: "Normal";
|
|
401
|
+
readonly SERVER_RESTART: "Server restart";
|
|
402
|
+
readonly INTERNAL_SERVER_ERROR: "Internal server error";
|
|
403
|
+
};
|
|
404
|
+
|
|
405
|
+
export declare const CommonWebSocketEventTypes: {
|
|
406
|
+
readonly PING: "PING";
|
|
407
|
+
readonly PONG: "PONG";
|
|
408
|
+
readonly INITIALIZE: "INITIALIZE";
|
|
409
|
+
readonly INITIALIZED_SUCCESS: "INITIALIZED_SUCCESS";
|
|
410
|
+
};
|
|
411
|
+
|
|
412
|
+
export declare const SecurityWebSocketEventTypes: {
|
|
413
|
+
readonly OPEN_SECURITY_SETTINGS_UPDATED: "OPEN_SECURITY_SETTINGS_UPDATED";
|
|
414
|
+
readonly MANAGEMENT_SECURITY_SETTINGS_UPDATED: "MANAGEMENT_SECURITY_SETTINGS_UPDATED";
|
|
415
|
+
};
|
|
416
|
+
|
|
417
|
+
export declare const SettingsWebSocketEventTypes: {
|
|
418
|
+
readonly OPEN_GLOBAL_SETTINGS_UPDATED: "OPEN_GLOBAL_SETTINGS_UPDATED";
|
|
419
|
+
readonly MANAGEMENT_GLOBAL_SETTINGS_UPDATED: "MANAGEMENT_GLOBAL_SETTINGS_UPDATED";
|
|
420
|
+
};
|
|
421
|
+
|
|
422
|
+
export declare const ListingParamNames: {
|
|
423
|
+
readonly PAGE_NUMBER: "page_number";
|
|
424
|
+
readonly PAGE_SIZE: "page_size";
|
|
425
|
+
readonly SORT_BY: "sort_by";
|
|
426
|
+
readonly SORT_ORDER: "sort_order";
|
|
427
|
+
readonly Pagination: {
|
|
428
|
+
readonly PAGE_NUMBER: "page_number";
|
|
429
|
+
readonly PAGE_SIZE: "page_size";
|
|
430
|
+
};
|
|
431
|
+
readonly Sort: {
|
|
432
|
+
readonly SORT_BY: "sort_by";
|
|
433
|
+
readonly SORT_ORDER: "sort_order";
|
|
434
|
+
};
|
|
435
|
+
};
|
|
436
|
+
|
|
231
437
|
export declare const CommonErrorCodes: {
|
|
232
438
|
readonly UNKNOWN: "UNKNOWN";
|
|
233
439
|
readonly INTERNAL: "INTERNAL";
|
|
@@ -320,87 +526,322 @@ readonly ACCOUNT_LOCKOUT_TYPE: "accountLockoutType";
|
|
|
320
526
|
readonly TEMPORARY_LOCKOUT_UNTIL: "temporaryLockoutUntil";
|
|
321
527
|
};
|
|
322
528
|
|
|
323
|
-
export
|
|
529
|
+
export const AuditPermissionCode: {
|
|
324
530
|
|
|
325
531
|
};
|
|
326
532
|
|
|
327
|
-
export
|
|
533
|
+
export const SecurityPermissionCode: {
|
|
328
534
|
|
|
329
535
|
};
|
|
330
536
|
|
|
331
|
-
export
|
|
537
|
+
export const SettingsPermissionCode: {
|
|
332
538
|
|
|
333
539
|
};
|
|
334
540
|
|
|
335
|
-
export
|
|
541
|
+
export const AuthSettingsPermissionCode: {
|
|
336
542
|
|
|
337
543
|
};
|
|
338
544
|
|
|
339
|
-
export
|
|
545
|
+
export const IdentifierPermissionCode: {
|
|
340
546
|
|
|
341
547
|
};
|
|
342
548
|
|
|
343
|
-
export
|
|
549
|
+
export const SessionPermissionCode: {
|
|
344
550
|
|
|
345
551
|
};
|
|
346
552
|
|
|
347
|
-
export
|
|
553
|
+
export const UserPermissionCode: {
|
|
348
554
|
|
|
349
555
|
};
|
|
350
556
|
|
|
351
|
-
|
|
352
|
-
export
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
export
|
|
359
|
-
|
|
360
|
-
export
|
|
361
|
-
export
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
export type
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
export type
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
export type
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
export
|
|
395
|
-
|
|
396
|
-
export
|
|
397
|
-
export
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
557
|
+
export type ClientType = 'web' | 'android' | 'ios' | 'desktop';
|
|
558
|
+
export const ClientType: {
|
|
559
|
+
readonly WEB: 'web';
|
|
560
|
+
readonly ANDROID: 'android';
|
|
561
|
+
readonly IOS: 'ios';
|
|
562
|
+
readonly DESKTOP: 'desktop';
|
|
563
|
+
};
|
|
564
|
+
export const clientTypeSchema: z.ZodType<ClientType>;
|
|
565
|
+
|
|
566
|
+
export type SortOrder = 'asc' | 'desc';
|
|
567
|
+
export const SortOrder: {
|
|
568
|
+
readonly ASC: 'asc';
|
|
569
|
+
readonly DESC: 'desc';
|
|
570
|
+
};
|
|
571
|
+
export const sortOrderSchema: z.ZodType<SortOrder>;
|
|
572
|
+
|
|
573
|
+
export type AccountLockoutType = 'none' | 'indefinite' | 'temporary';
|
|
574
|
+
export const AccountLockoutType: {
|
|
575
|
+
readonly NONE: 'none';
|
|
576
|
+
readonly INDEFINITE: 'indefinite';
|
|
577
|
+
readonly TEMPORARY: 'temporary';
|
|
578
|
+
readonly PERMANENT: 'indefinite';
|
|
579
|
+
};
|
|
580
|
+
export const accountLockoutTypeSchema: z.ZodType<AccountLockoutType>;
|
|
581
|
+
|
|
582
|
+
export type PasswordPolicyFailReason = 'too_short' | 'no_letter' | 'no_uppercase' | 'no_lowercase' | 'no_digit' | 'no_special_char' | 'too_common';
|
|
583
|
+
export const PasswordPolicyFailReason: {
|
|
584
|
+
readonly TOO_SHORT: 'too_short';
|
|
585
|
+
readonly NO_LETTER: 'no_letter';
|
|
586
|
+
readonly NO_UPPERCASE: 'no_uppercase';
|
|
587
|
+
readonly NO_LOWERCASE: 'no_lowercase';
|
|
588
|
+
readonly NO_DIGIT: 'no_digit';
|
|
589
|
+
readonly NO_SPECIAL_CHAR: 'no_special_char';
|
|
590
|
+
readonly TOO_COMMON: 'too_common';
|
|
591
|
+
};
|
|
592
|
+
export const passwordPolicyFailReasonSchema: z.ZodType<PasswordPolicyFailReason>;
|
|
593
|
+
|
|
594
|
+
export type AuditActorType = 'user' | 'system' | 'service';
|
|
595
|
+
export const AuditActorType: {
|
|
596
|
+
readonly USER: 'user';
|
|
597
|
+
readonly SYSTEM: 'system';
|
|
598
|
+
readonly SERVICE: 'service';
|
|
599
|
+
};
|
|
600
|
+
export const auditActorTypeSchema: z.ZodType<AuditActorType>;
|
|
601
|
+
|
|
602
|
+
export type AuditValueSensitivity = 'non_sensitive' | 'email' | 'phone_number' | 'ip_address' | 'partial_value_mask' | 'full_value_mask';
|
|
603
|
+
export const AuditValueSensitivity: {
|
|
604
|
+
readonly NON_SENSITIVE: 'non_sensitive';
|
|
605
|
+
readonly EMAIL: 'email';
|
|
606
|
+
readonly PHONE_NUMBER: 'phone_number';
|
|
607
|
+
readonly IP_ADDRESS: 'ip_address';
|
|
608
|
+
readonly PARTIAL_VALUE_MASK: 'partial_value_mask';
|
|
609
|
+
readonly FULL_VALUE_MASK: 'full_value_mask';
|
|
610
|
+
};
|
|
611
|
+
export const auditValueSensitivitySchema: z.ZodType<AuditValueSensitivity>;
|
|
612
|
+
|
|
613
|
+
export type AuditStatus = 'success' | 'failed' | 'denied';
|
|
614
|
+
export const AuditStatus: {
|
|
615
|
+
readonly SUCCESS: 'success';
|
|
616
|
+
readonly FAILED: 'failed';
|
|
617
|
+
readonly DENIED: 'denied';
|
|
618
|
+
};
|
|
619
|
+
export const auditStatusSchema: z.ZodType<AuditStatus>;
|
|
620
|
+
|
|
621
|
+
export type CommonAuditResourceType = 'audit_event' | 'audit_events';
|
|
622
|
+
export const CommonAuditResourceType: {
|
|
623
|
+
readonly AUDIT_EVENT: 'audit_event';
|
|
624
|
+
readonly AUDIT_EVENTS: 'audit_events';
|
|
625
|
+
};
|
|
626
|
+
export const commonAuditResourceTypeSchema: z.ZodType<CommonAuditResourceType>;
|
|
627
|
+
|
|
628
|
+
export type SecurityAuditResourceType = 'security_settings';
|
|
629
|
+
export const SecurityAuditResourceType: {
|
|
630
|
+
readonly SECURITY_SETTINGS: 'security_settings';
|
|
631
|
+
};
|
|
632
|
+
export const securityAuditResourceTypeSchema: z.ZodType<SecurityAuditResourceType>;
|
|
401
633
|
|
|
402
|
-
export
|
|
403
|
-
export
|
|
634
|
+
export type SettingsAuditResourceType = 'global_settings';
|
|
635
|
+
export const SettingsAuditResourceType: {
|
|
636
|
+
readonly GLOBAL_SETTINGS: 'global_settings';
|
|
637
|
+
};
|
|
638
|
+
export const settingsAuditResourceTypeSchema: z.ZodType<SettingsAuditResourceType>;
|
|
639
|
+
|
|
640
|
+
export type UserAuditResourceType = 'auth_settings' | 'user' | 'email_address' | 'phone_number' | 'identifier' | 'session';
|
|
641
|
+
export const UserAuditResourceType: {
|
|
642
|
+
readonly AUTH_SETTINGS: 'auth_settings';
|
|
643
|
+
readonly USER: 'user';
|
|
644
|
+
readonly EMAIL_ADDRESS: 'email_address';
|
|
645
|
+
readonly PHONE_NUMBER: 'phone_number';
|
|
646
|
+
readonly IDENTIFIER: 'identifier';
|
|
647
|
+
readonly SESSION: 'session';
|
|
648
|
+
};
|
|
649
|
+
export const userAuditResourceTypeSchema: z.ZodType<UserAuditResourceType>;
|
|
650
|
+
|
|
651
|
+
export type SecurityAuditActionType = 'management_update_security_settings' | 'management_reset_security_settings';
|
|
652
|
+
export const SecurityAuditActionType: {
|
|
653
|
+
readonly MANAGEMENT_UPDATE_SECURITY_SETTINGS: 'management_update_security_settings';
|
|
654
|
+
readonly MANAGEMENT_RESET_SECURITY_SETTINGS: 'management_reset_security_settings';
|
|
655
|
+
};
|
|
656
|
+
export const securityAuditActionTypeSchema: z.ZodType<SecurityAuditActionType>;
|
|
657
|
+
|
|
658
|
+
export type SettingsAuditActionType = 'management_update_global_settings' | 'management_reset_global_settings';
|
|
659
|
+
export const SettingsAuditActionType: {
|
|
660
|
+
readonly MANAGEMENT_UPDATE_GLOBAL_SETTINGS: 'management_update_global_settings';
|
|
661
|
+
readonly MANAGEMENT_RESET_GLOBAL_SETTINGS: 'management_reset_global_settings';
|
|
662
|
+
};
|
|
663
|
+
export const settingsAuditActionTypeSchema: z.ZodType<SettingsAuditActionType>;
|
|
664
|
+
|
|
665
|
+
export type UserAuditActionType = 'management_update_auth_settings' | 'management_reset_auth_settings' | 'management_delete_identifier' | 'management_delete_identifier_password' | 'management_delete_session' | 'management_delete_all_user_sessions' | 'management_update_user' | 'management_delete_user' | 'management_create_user' | 'management_disable_user_totp' | 'login_by_email' | 'login_by_phone' | 'login_by_external_auth_provider' | 'login_by_totp' | 'login_by_totp_recovery_code' | 'new_device_detected' | 'register_by_email' | 'reset_password' | 'self_unlock_account' | 'logout' | 'self_delete_session' | 'self_delete_other_sessions' | 'reauthenticate_session' | 'self_delete_identifier' | 'add_identifier_email' | 'add_identifier_phone' | 'add_identifier_external_auth_provider' | 'change_password' | 'self_schedule_user_deletion' | 'self_restore_user' | 'self_setup_totp_initiated' | 'self_enable_totp' | 'self_disable_totp' | 'self_get_recovery_codes' | 'self_regenerate_recovery_codes' | 'refresh_token_reuse_detected';
|
|
666
|
+
export const UserAuditActionType: {
|
|
667
|
+
readonly MANAGEMENT_UPDATE_AUTH_SETTINGS: 'management_update_auth_settings';
|
|
668
|
+
readonly MANAGEMENT_RESET_AUTH_SETTINGS: 'management_reset_auth_settings';
|
|
669
|
+
readonly MANAGEMENT_DELETE_IDENTIFIER: 'management_delete_identifier';
|
|
670
|
+
readonly MANAGEMENT_DELETE_IDENTIFIER_PASSWORD: 'management_delete_identifier_password';
|
|
671
|
+
readonly MANAGEMENT_DELETE_SESSION: 'management_delete_session';
|
|
672
|
+
readonly MANAGEMENT_DELETE_ALL_USER_SESSIONS: 'management_delete_all_user_sessions';
|
|
673
|
+
readonly MANAGEMENT_UPDATE_USER: 'management_update_user';
|
|
674
|
+
readonly MANAGEMENT_DELETE_USER: 'management_delete_user';
|
|
675
|
+
readonly MANAGEMENT_CREATE_USER: 'management_create_user';
|
|
676
|
+
readonly MANAGEMENT_DISABLE_USER_TOTP: 'management_disable_user_totp';
|
|
677
|
+
readonly LOGIN_BY_EMAIL: 'login_by_email';
|
|
678
|
+
readonly LOGIN_BY_PHONE: 'login_by_phone';
|
|
679
|
+
readonly LOGIN_BY_EXTERNAL_AUTH_PROVIDER: 'login_by_external_auth_provider';
|
|
680
|
+
readonly LOGIN_BY_TOTP: 'login_by_totp';
|
|
681
|
+
readonly LOGIN_BY_TOTP_RECOVERY_CODE: 'login_by_totp_recovery_code';
|
|
682
|
+
readonly NEW_DEVICE_DETECTED: 'new_device_detected';
|
|
683
|
+
readonly REGISTER_BY_EMAIL: 'register_by_email';
|
|
684
|
+
readonly RESET_PASSWORD: 'reset_password';
|
|
685
|
+
readonly SELF_UNLOCK_ACCOUNT: 'self_unlock_account';
|
|
686
|
+
readonly LOGOUT: 'logout';
|
|
687
|
+
readonly SELF_DELETE_SESSION: 'self_delete_session';
|
|
688
|
+
readonly SELF_DELETE_OTHER_SESSIONS: 'self_delete_other_sessions';
|
|
689
|
+
readonly REAUTHENTICATE_SESSION: 'reauthenticate_session';
|
|
690
|
+
readonly SELF_DELETE_IDENTIFIER: 'self_delete_identifier';
|
|
691
|
+
readonly ADD_IDENTIFIER_EMAIL: 'add_identifier_email';
|
|
692
|
+
readonly ADD_IDENTIFIER_PHONE: 'add_identifier_phone';
|
|
693
|
+
readonly ADD_IDENTIFIER_EXTERNAL_AUTH_PROVIDER: 'add_identifier_external_auth_provider';
|
|
694
|
+
readonly CHANGE_PASSWORD: 'change_password';
|
|
695
|
+
readonly SELF_SCHEDULE_USER_DELETION: 'self_schedule_user_deletion';
|
|
696
|
+
readonly SELF_RESTORE_USER: 'self_restore_user';
|
|
697
|
+
readonly SELF_SETUP_TOTP_INITIATED: 'self_setup_totp_initiated';
|
|
698
|
+
readonly SELF_ENABLE_TOTP: 'self_enable_totp';
|
|
699
|
+
readonly SELF_DISABLE_TOTP: 'self_disable_totp';
|
|
700
|
+
readonly SELF_GET_RECOVERY_CODES: 'self_get_recovery_codes';
|
|
701
|
+
readonly SELF_REGENERATE_RECOVERY_CODES: 'self_regenerate_recovery_codes';
|
|
702
|
+
readonly REFRESH_TOKEN_REUSE_DETECTED: 'refresh_token_reuse_detected';
|
|
703
|
+
};
|
|
704
|
+
export const userAuditActionTypeSchema: z.ZodType<UserAuditActionType>;
|
|
705
|
+
|
|
706
|
+
export type UserAccountStatus = 'active' | 'read_only' | 'banned' | 'security_hold' | 'pending_deletion';
|
|
707
|
+
export const UserAccountStatus: {
|
|
708
|
+
readonly ACTIVE: 'active';
|
|
709
|
+
readonly READ_ONLY: 'read_only';
|
|
710
|
+
readonly BANNED: 'banned';
|
|
711
|
+
readonly SECURITY_HOLD: 'security_hold';
|
|
712
|
+
readonly PENDING_DELETION: 'pending_deletion';
|
|
713
|
+
};
|
|
714
|
+
export const userAccountStatusSchema: z.ZodType<UserAccountStatus>;
|
|
715
|
+
|
|
716
|
+
export type UserRole = 'user' | 'staff' | 'admin';
|
|
717
|
+
export const UserRole: {
|
|
718
|
+
readonly USER: 'user';
|
|
719
|
+
readonly STAFF: 'staff';
|
|
720
|
+
readonly ADMIN: 'admin';
|
|
721
|
+
readonly CLIENT_USER: 'user';
|
|
722
|
+
readonly MANAGEMENT_USER: 'admin';
|
|
723
|
+
};
|
|
724
|
+
export const userRoleSchema: z.ZodType<UserRole>;
|
|
725
|
+
|
|
726
|
+
export type UserAuthProvider = 'email' | 'phone' | 'google' | 'apple';
|
|
727
|
+
export const UserAuthProvider: {
|
|
728
|
+
readonly EMAIL: 'email';
|
|
729
|
+
readonly PHONE: 'phone';
|
|
730
|
+
readonly GOOGLE: 'google';
|
|
731
|
+
readonly APPLE: 'apple';
|
|
732
|
+
};
|
|
733
|
+
export const userAuthProviderSchema: z.ZodType<UserAuthProvider>;
|
|
734
|
+
|
|
735
|
+
export type ExternalAuthProvider = 'google' | 'apple';
|
|
736
|
+
export const ExternalAuthProvider: {
|
|
737
|
+
readonly GOOGLE: 'google';
|
|
738
|
+
readonly APPLE: 'apple';
|
|
739
|
+
};
|
|
740
|
+
export const externalAuthProviderSchema: z.ZodType<ExternalAuthProvider>;
|
|
741
|
+
|
|
742
|
+
export type UserSortBy = 'last_login_at' | 'last_active_at' | 'scheduled_permanent_deletion_at' | 'account_lockout_type' | 'temporary_lockout_until' | 'created_at' | 'updated_at';
|
|
743
|
+
export const UserSortBy: {
|
|
744
|
+
readonly LAST_LOGIN_AT: 'last_login_at';
|
|
745
|
+
readonly LAST_ACTIVE_AT: 'last_active_at';
|
|
746
|
+
readonly SCHEDULED_PERMANENT_DELETION_AT: 'scheduled_permanent_deletion_at';
|
|
747
|
+
readonly ACCOUNT_LOCKOUT_TYPE: 'account_lockout_type';
|
|
748
|
+
readonly TEMPORARY_LOCKOUT_UNTIL: 'temporary_lockout_until';
|
|
749
|
+
readonly CREATED_AT: 'created_at';
|
|
750
|
+
readonly UPDATED_AT: 'updated_at';
|
|
751
|
+
};
|
|
752
|
+
export const userSortBySchema: z.ZodType<UserSortBy>;
|
|
753
|
+
|
|
754
|
+
export type UserIdentifierSortBy = 'created_at' | 'updated_at';
|
|
755
|
+
export const UserIdentifierSortBy: {
|
|
756
|
+
readonly CREATED_AT: 'created_at';
|
|
757
|
+
readonly UPDATED_AT: 'updated_at';
|
|
758
|
+
};
|
|
759
|
+
export const userIdentifierSortBySchema: z.ZodType<UserIdentifierSortBy>;
|
|
760
|
+
|
|
761
|
+
export type UserSessionSortBy = 'expires_at' | 'last_accessed_at' | 'last_reauthenticated_at' | 'created_at' | 'updated_at';
|
|
762
|
+
export const UserSessionSortBy: {
|
|
763
|
+
readonly EXPIRES_AT: 'expires_at';
|
|
764
|
+
readonly LAST_ACCESSED_AT: 'last_accessed_at';
|
|
765
|
+
readonly LAST_REAUTHENTICATED_AT: 'last_reauthenticated_at';
|
|
766
|
+
readonly CREATED_AT: 'created_at';
|
|
767
|
+
readonly UPDATED_AT: 'updated_at';
|
|
768
|
+
};
|
|
769
|
+
export const userSessionSortBySchema: z.ZodType<UserSessionSortBy>;
|
|
770
|
+
|
|
771
|
+
export type AuditEventSortBy = 'created_at';
|
|
772
|
+
export const AuditEventSortBy: {
|
|
773
|
+
readonly CREATED_AT: 'created_at';
|
|
774
|
+
};
|
|
775
|
+
export const auditEventSortBySchema: z.ZodType<AuditEventSortBy>;
|
|
776
|
+
|
|
777
|
+
export type TimestampSortBy = 'created_at' | 'updated_at';
|
|
778
|
+
export const TimestampSortBy: {
|
|
779
|
+
readonly CREATED_AT: 'created_at';
|
|
780
|
+
readonly UPDATED_AT: 'updated_at';
|
|
781
|
+
};
|
|
782
|
+
export const timestampSortBySchema: z.ZodType<TimestampSortBy>;
|
|
783
|
+
|
|
784
|
+
export type UnlockMethod = 'EMAIL' | 'PHONE';
|
|
785
|
+
export const UnlockMethod: {
|
|
786
|
+
readonly EMAIL: 'EMAIL';
|
|
787
|
+
readonly PHONE: 'PHONE';
|
|
788
|
+
};
|
|
789
|
+
export const unlockMethodSchema: z.ZodType<UnlockMethod>;
|
|
790
|
+
|
|
791
|
+
export type ConfirmationType = 'REGISTRATION_EMAIL' | 'ADD_EMAIL' | 'PASSWORD_RESET_EMAIL' | 'LOGIN_PHONE' | 'ADD_PHONE' | 'UNLOCK_EMAIL' | 'UNLOCK_PHONE';
|
|
792
|
+
export const ConfirmationType: {
|
|
793
|
+
readonly REGISTRATION_EMAIL: 'REGISTRATION_EMAIL';
|
|
794
|
+
readonly ADD_EMAIL: 'ADD_EMAIL';
|
|
795
|
+
readonly PASSWORD_RESET_EMAIL: 'PASSWORD_RESET_EMAIL';
|
|
796
|
+
readonly LOGIN_PHONE: 'LOGIN_PHONE';
|
|
797
|
+
readonly ADD_PHONE: 'ADD_PHONE';
|
|
798
|
+
readonly UNLOCK_EMAIL: 'UNLOCK_EMAIL';
|
|
799
|
+
readonly UNLOCK_PHONE: 'UNLOCK_PHONE';
|
|
800
|
+
};
|
|
801
|
+
export const confirmationTypeSchema: z.ZodType<ConfirmationType>;
|
|
802
|
+
|
|
803
|
+
export type AppType = 'CLIENT' | 'MANAGEMENT';
|
|
804
|
+
export const AppType: {
|
|
805
|
+
readonly CLIENT: 'CLIENT';
|
|
806
|
+
readonly MANAGEMENT: 'MANAGEMENT';
|
|
807
|
+
};
|
|
808
|
+
export const appTypeSchema: z.ZodType<AppType>;
|
|
809
|
+
|
|
810
|
+
export interface ConfirmationKey {
|
|
811
|
+
readonly type: ConfirmationType;
|
|
812
|
+
readonly identifier: string;
|
|
813
|
+
}
|
|
814
|
+
export const confirmationKeySchema: z.ZodType<ConfirmationKey>;
|
|
815
|
+
|
|
816
|
+
export type UserSortValues = 'created_at' | 'updated_at' | 'last_accessed_at' | 'last_reauthenticated_at' | 'expires_at';
|
|
817
|
+
|
|
818
|
+
export namespace UserSortValues {
|
|
819
|
+
export type UserSortBy = 'last_login_at' | 'last_active_at' | 'scheduled_permanent_deletion_at' | 'account_lockout_type' | 'temporary_lockout_until' | 'created_at' | 'updated_at';
|
|
820
|
+
export const UserSortBy: {
|
|
821
|
+
readonly LAST_LOGIN_AT: 'last_login_at';
|
|
822
|
+
readonly LAST_ACTIVE_AT: 'last_active_at';
|
|
823
|
+
readonly SCHEDULED_PERMANENT_DELETION_AT: 'scheduled_permanent_deletion_at';
|
|
824
|
+
readonly ACCOUNT_LOCKOUT_TYPE: 'account_lockout_type';
|
|
825
|
+
readonly TEMPORARY_LOCKOUT_UNTIL: 'temporary_lockout_until';
|
|
826
|
+
readonly CREATED_AT: 'created_at';
|
|
827
|
+
readonly UPDATED_AT: 'updated_at';
|
|
828
|
+
};
|
|
829
|
+
|
|
830
|
+
export type UserIdentifierSortBy = 'created_at' | 'updated_at';
|
|
831
|
+
export const UserIdentifierSortBy: {
|
|
832
|
+
readonly CREATED_AT: 'created_at';
|
|
833
|
+
readonly UPDATED_AT: 'updated_at';
|
|
834
|
+
};
|
|
835
|
+
|
|
836
|
+
export type UserSessionSortBy = 'expires_at' | 'last_accessed_at' | 'last_reauthenticated_at' | 'created_at' | 'updated_at';
|
|
837
|
+
export const UserSessionSortBy: {
|
|
838
|
+
readonly EXPIRES_AT: 'expires_at';
|
|
839
|
+
readonly LAST_ACCESSED_AT: 'last_accessed_at';
|
|
840
|
+
readonly LAST_REAUTHENTICATED_AT: 'last_reauthenticated_at';
|
|
841
|
+
readonly CREATED_AT: 'created_at';
|
|
842
|
+
readonly UPDATED_AT: 'updated_at';
|
|
843
|
+
};
|
|
844
|
+
}
|
|
404
845
|
|
|
405
846
|
export function pagedResultSchema<T extends z.ZodTypeAny>(itemSchema: T): z.ZodObject<{
|
|
406
847
|
items: z.ZodArray<T>;
|
|
@@ -712,6 +1153,26 @@ account_status: UserAccountStatus;
|
|
|
712
1153
|
}
|
|
713
1154
|
export const userPublicPayloadSchema: z.ZodType<UserPublicPayload>;
|
|
714
1155
|
|
|
1156
|
+
export interface SocketFrame {
|
|
1157
|
+
id: UserId;
|
|
1158
|
+
type: string;
|
|
1159
|
+
payload: unknown | null;
|
|
1160
|
+
metadata: Record<string, string>;
|
|
1161
|
+
timestamp: number;
|
|
1162
|
+
}
|
|
1163
|
+
export const socketFrameSchema: z.ZodType<SocketFrame>;
|
|
1164
|
+
|
|
1165
|
+
export interface WebSocketInitializePayload {
|
|
1166
|
+
client_type: ClientType | null;
|
|
1167
|
+
language: string | null;
|
|
1168
|
+
device_id: ClientDeviceId | null;
|
|
1169
|
+
device_name: string | null;
|
|
1170
|
+
app_version: string | null;
|
|
1171
|
+
operation_system_version: string | null;
|
|
1172
|
+
api_version: string | null;
|
|
1173
|
+
}
|
|
1174
|
+
export const webSocketInitializePayloadSchema: z.ZodType<WebSocketInitializePayload>;
|
|
1175
|
+
|
|
715
1176
|
export interface CreateByEmailRequest {
|
|
716
1177
|
email: string;
|
|
717
1178
|
password: string | null;
|