@burdenoff/microfe-auth 2026.718.3 → 2026.725.1

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.
Files changed (79) hide show
  1. package/dist/auth/AuthRoot.d.ts +29 -0
  2. package/dist/auth/AuthRoutes.d.ts +27 -0
  3. package/dist/auth/components/AuthIcons.d.ts +16 -0
  4. package/dist/auth/components/AuthLayout.d.ts +16 -0
  5. package/dist/auth/components/CaptchaV2.d.ts +25 -0
  6. package/dist/auth/components/ConfirmActionDialog.d.ts +15 -0
  7. package/dist/auth/components/index.d.ts +3 -0
  8. package/dist/auth/components/profile/UserProfileMenu.d.ts +41 -0
  9. package/dist/auth/components/workspace/WorkspaceSelector.d.ts +49 -0
  10. package/dist/auth/constants/permissions.d.ts +29 -0
  11. package/dist/auth/constants/sessionKeys.d.ts +17 -0
  12. package/dist/auth/hooks/index.d.ts +19 -0
  13. package/dist/auth/hooks/useAccountOperations.d.ts +18 -0
  14. package/dist/auth/hooks/useActiveContextBootstrapMirror.d.ts +91 -0
  15. package/dist/auth/hooks/useApiKeyOperations.d.ts +28 -0
  16. package/dist/auth/hooks/useAppOperations.d.ts +32 -0
  17. package/dist/auth/hooks/useAuthOperations.d.ts +59 -0
  18. package/dist/auth/hooks/useAuthPermissions.d.ts +19 -0
  19. package/dist/auth/hooks/useCaptchaV3.d.ts +12 -0
  20. package/dist/auth/hooks/useContextSwitcherData.d.ts +91 -0
  21. package/dist/auth/hooks/useDelegationOperations.d.ts +38 -0
  22. package/dist/auth/hooks/useMfaOperations.d.ts +17 -0
  23. package/dist/auth/hooks/useMyWorkspaces.d.ts +47 -0
  24. package/dist/auth/hooks/useOAuthOperations.d.ts +18 -0
  25. package/dist/auth/hooks/usePasswordOperations.d.ts +12 -0
  26. package/dist/auth/hooks/useSessionOperations.d.ts +57 -0
  27. package/dist/auth/hooks/useSignupCaptcha.d.ts +22 -0
  28. package/dist/auth/hooks/useSsoOperations.d.ts +67 -0
  29. package/dist/auth/hooks/useTokenRefresh.d.ts +55 -0
  30. package/dist/auth/hooks/useUserOperations.d.ts +32 -0
  31. package/dist/auth/hooks/useWorkspaceOperations.d.ts +34 -0
  32. package/dist/auth/hooks/useWorkspaceToken.d.ts +55 -0
  33. package/dist/auth/index.d.ts +63 -0
  34. package/dist/auth/pages/AuditLogPage.d.ts +11 -0
  35. package/dist/auth/pages/EmailVerifyPage.d.ts +4 -0
  36. package/dist/auth/pages/LoginPage.d.ts +5 -0
  37. package/dist/auth/pages/MagicLinkPage.d.ts +5 -0
  38. package/dist/auth/pages/MfaSetupPage.d.ts +4 -0
  39. package/dist/auth/pages/MfaVerifyPage.d.ts +6 -0
  40. package/dist/auth/pages/OAuthCallbackPage.d.ts +6 -0
  41. package/dist/auth/pages/PasswordResetPage.d.ts +5 -0
  42. package/dist/auth/pages/ReactivatePage.d.ts +5 -0
  43. package/dist/auth/pages/RegisterPage.d.ts +4 -0
  44. package/dist/auth/pages/SSOClearPage.d.ts +21 -0
  45. package/dist/auth/pages/SSODepositPage.d.ts +23 -0
  46. package/dist/auth/pages/SSORelayCallbackPage.d.ts +7 -0
  47. package/dist/auth/pages/SSORelayPage.d.ts +17 -0
  48. package/dist/auth/pages/SecurityPage.d.ts +6 -0
  49. package/dist/auth/pages/SessionBridgePage.d.ts +13 -0
  50. package/dist/auth/pages/SessionsPage.d.ts +7 -0
  51. package/dist/auth/pages/SsoCallbackPage.d.ts +7 -0
  52. package/dist/auth/pages/SsoConfigPage.d.ts +12 -0
  53. package/dist/auth/pages/SsoLoginPage.d.ts +6 -0
  54. package/dist/auth/pages/UserDetailsPage.d.ts +10 -0
  55. package/dist/auth/pages/UserDetailsPage.js.map +1 -1
  56. package/dist/auth/pages/UserProfilePage.d.ts +4 -0
  57. package/dist/auth/pages/UsersPage.d.ts +4 -0
  58. package/dist/auth/providers/AuthProvider.d.ts +17 -0
  59. package/dist/auth/providers/CaptchaProvider.d.ts +12 -0
  60. package/dist/auth/store/authStore.d.ts +110 -0
  61. package/dist/auth/types/index.d.ts +678 -0
  62. package/dist/auth/utils/captchaConfig.d.ts +3 -0
  63. package/dist/auth/utils/formatters.d.ts +36 -0
  64. package/dist/auth/utils/gatewayBaseUrls.d.ts +5 -0
  65. package/dist/auth/utils/index.d.ts +2 -0
  66. package/dist/auth/utils/ssoOrigins.d.ts +28 -0
  67. package/dist/auth/utils/validation.d.ts +29 -0
  68. package/dist/dev/main.d.ts +1 -0
  69. package/dist/generated/global-operations.d.ts +3095 -0
  70. package/dist/generated/global-types.d.ts +23528 -0
  71. package/dist/generated/wspace-operations.d.ts +123 -0
  72. package/dist/generated/wspace-types.d.ts +57850 -0
  73. package/dist/index.d.ts +3 -0
  74. package/dist/shared/hooks/index.d.ts +6 -0
  75. package/dist/shared/index.d.ts +5 -0
  76. package/dist/shared/types/index.d.ts +108 -0
  77. package/dist/translations/en.d.ts +320 -0
  78. package/dist/utils/nativeBridge.d.ts +2 -0
  79. package/package.json +5 -3
@@ -0,0 +1,678 @@
1
+ import { MicrofrontendRootProps, NavItem, FooterItem } from '../../shared/types';
2
+
3
+ export type { MicrofrontendRootProps, NavItem, FooterItem };
4
+ /**
5
+ * Props for the AuthRoot component
6
+ */
7
+ export interface AuthRootProps extends MicrofrontendRootProps {
8
+ /**
9
+ * Callback when authentication is successful
10
+ * @param user - The authenticated user
11
+ * @param accessToken - The access token (optional, for shell integration)
12
+ * @param refreshToken - The refresh token (optional, for shell integration)
13
+ */
14
+ onAuthSuccess?: (user: User, accessToken?: string, refreshToken?: string) => void;
15
+ /**
16
+ * Callback when user logs out
17
+ */
18
+ onLogout?: () => void;
19
+ /**
20
+ * Optional function to register navigation items with the shell
21
+ * Injected by the shell app
22
+ */
23
+ registerNavItems?: (items: NavItem | NavItem[]) => () => void;
24
+ /**
25
+ * Optional function to register footer items with the shell
26
+ * Injected by the shell app
27
+ */
28
+ registerFooterItems?: (items: FooterItem | FooterItem[]) => () => void;
29
+ /**
30
+ * Whether tenant/platform administration routes should be mounted by this
31
+ * auth surface. Product app shells should leave this disabled and route
32
+ * administrators to admin-app instead.
33
+ */
34
+ enableAdminRoutes?: boolean;
35
+ /**
36
+ * When true, the enterprise-plan gate on the SSO configuration page is
37
+ * bypassed so that the full SSO config UI is always rendered.
38
+ * Intended for admin-app surfaces where platform admins must be able to
39
+ * configure SSO regardless of the workspace's billing plan.
40
+ */
41
+ bypassEnterprisePlanGate?: boolean;
42
+ /**
43
+ * Path to redirect to after a successful login when no `returnTo` is set.
44
+ * Defaults to `/dashboard` to preserve existing host behavior (workspaces-app).
45
+ * Product shells whose home route is not `/dashboard` (e.g. vibecontrols-app's
46
+ * `/vibecontrols`) should pass this explicitly.
47
+ */
48
+ defaultPostLoginPath?: string;
49
+ /**
50
+ * OAuth provider client IDs, resolved by the HOST app shell from its own
51
+ * build-time env (`import.meta.env.VITE_*_CLIENT_ID`).
52
+ *
53
+ * This MUST be injected by the host: build-time MFE composition compiles
54
+ * this package into its own npm dist BEFORE the vars exist, and Vite bakes
55
+ * `import.meta.env` into a frozen object literal at that point — so a client
56
+ * ID read from `import.meta.env` inside this package is permanently
57
+ * `undefined` in published builds, and the social-login buttons render
58
+ * disabled. The host's build DOES inline these correctly, so it passes them
59
+ * down here. (When this package is consumed from source in local dev, the
60
+ * `import.meta.env` fallback in `useOAuthOperations` still works.)
61
+ */
62
+ oauthClientIds?: {
63
+ google?: string;
64
+ microsoft?: string;
65
+ github?: string;
66
+ };
67
+ /**
68
+ * Product slug of the host app shell (e.g. `"vibecontrols"`, `"workspaces"`).
69
+ *
70
+ * Used to look up the product's reCAPTCHA site key via the public
71
+ * `publicProduct(slug)` query so the signup page can render the reCAPTCHA v2
72
+ * checkbox ONLY for products that have keys configured in the platform
73
+ * product catalog. A product opts into signup captcha simply by having its
74
+ * `recaptchaSiteKey` (+ server-side `recaptchaSecretKey`) set — there is no
75
+ * separate flag. When omitted, the signup captcha stays disabled.
76
+ */
77
+ productSlug?: string;
78
+ }
79
+ /**
80
+ * User entity (matches backend schema)
81
+ */
82
+ export interface User {
83
+ id: string;
84
+ email: string;
85
+ username: string;
86
+ firstName?: string;
87
+ lastName?: string;
88
+ name?: string;
89
+ avatar?: string;
90
+ phoneNumber?: string;
91
+ role: UserRole;
92
+ status: UserStatus;
93
+ emailVerified: boolean;
94
+ mfaEnabled: boolean;
95
+ defaultWorkspaceId?: string;
96
+ tenantId?: string;
97
+ lastLoginAt?: string;
98
+ createdAt: string;
99
+ updatedAt: string;
100
+ }
101
+ /**
102
+ * User roles
103
+ */
104
+ export type UserRole = "SUPER_ADMIN" | "TENANT_ADMIN" | "ORG_ADMIN" | "WORKSPACE_ADMIN" | "MEMBER" | "GUEST";
105
+ /**
106
+ * User status
107
+ */
108
+ export type UserStatus = "ACTIVE" | "INACTIVE" | "SUSPENDED" | "DELETED";
109
+ /**
110
+ * User connection for pagination
111
+ */
112
+ export interface UserConnection {
113
+ users: User[];
114
+ totalCount: number;
115
+ hasMore: boolean;
116
+ }
117
+ /**
118
+ * User filter input
119
+ */
120
+ export interface UserFilterInput {
121
+ email?: string;
122
+ username?: string;
123
+ role?: UserRole;
124
+ status?: UserStatus;
125
+ tenantId?: string;
126
+ search?: string;
127
+ }
128
+ /**
129
+ * Pagination input
130
+ */
131
+ export interface PaginationInput {
132
+ offset?: number;
133
+ limit?: number;
134
+ sortBy?: string;
135
+ sortOrder?: "ASC" | "DESC";
136
+ }
137
+ /**
138
+ * Auth types supported
139
+ */
140
+ export type AuthType = "JWT" | "OAUTH" | "SAML" | "OIDC" | "API_KEY" | "MAGIC_LINK" | "MFA";
141
+ /**
142
+ * Auth method
143
+ */
144
+ export interface AuthMethod {
145
+ type: AuthType;
146
+ name: string;
147
+ enabled: boolean;
148
+ requiresMFA?: boolean;
149
+ }
150
+ /**
151
+ * Auth method config
152
+ */
153
+ export interface AuthMethodConfig {
154
+ type: AuthType;
155
+ enabled: boolean;
156
+ config?: Record<string, unknown>;
157
+ }
158
+ /**
159
+ * Auth strategy health
160
+ */
161
+ export interface AuthStrategyHealth {
162
+ name: string;
163
+ type: AuthType;
164
+ healthy: boolean;
165
+ }
166
+ /**
167
+ * Auth payload (from signIn/signUp)
168
+ * When MFA is required, user and tokens will be null
169
+ */
170
+ export interface AuthPayload {
171
+ user: User | null;
172
+ accessToken: string | null;
173
+ refreshToken: string | null;
174
+ expiresIn: number | null;
175
+ requiresMFA?: boolean;
176
+ mfaChallengeId?: string;
177
+ mfaMethod?: MFAMethod;
178
+ }
179
+ /**
180
+ * Auth result (from strategy-based auth)
181
+ */
182
+ export interface AuthResult {
183
+ success: boolean;
184
+ user?: User;
185
+ token?: string;
186
+ refreshToken?: string;
187
+ expiresIn?: number;
188
+ requiresMFA?: boolean;
189
+ mfaChallengeId?: string;
190
+ sessionId?: string;
191
+ error?: string;
192
+ metadata?: Record<string, unknown>;
193
+ redirectPath?: string;
194
+ }
195
+ /**
196
+ * Sign in input
197
+ */
198
+ export interface SignInInput {
199
+ email?: string;
200
+ username?: string;
201
+ password: string;
202
+ /** Hint to the server to issue a longer-lived session */
203
+ rememberMe?: boolean;
204
+ /** reCAPTCHA token (required when captcha is enabled in prod) */
205
+ recaptchaToken?: string;
206
+ }
207
+ /**
208
+ * Sign up input
209
+ */
210
+ export interface SignUpInput {
211
+ email: string;
212
+ username: string;
213
+ password: string;
214
+ firstName?: string;
215
+ lastName?: string;
216
+ name?: string;
217
+ phoneNumber?: string;
218
+ /** reCAPTCHA token (required when captcha is enabled in prod) */
219
+ recaptchaToken?: string;
220
+ }
221
+ /**
222
+ * Change password input
223
+ */
224
+ export interface ChangePasswordInput {
225
+ currentPassword: string;
226
+ newPassword: string;
227
+ }
228
+ /**
229
+ * MFA methods
230
+ */
231
+ export type MFAMethod = "TOTP" | "SMS" | "EMAIL" | "WEBAUTHN";
232
+ /**
233
+ * MFA setup result
234
+ */
235
+ export interface MFASetupResult {
236
+ secret?: string;
237
+ qrCode?: string;
238
+ backupCodes?: string[];
239
+ method: MFAMethod;
240
+ }
241
+ /**
242
+ * MFA verify input
243
+ */
244
+ export interface MFAVerifyInput {
245
+ challengeId: string;
246
+ code: string;
247
+ method: MFAMethod;
248
+ }
249
+ /**
250
+ * OAuth input
251
+ */
252
+ export interface OAuthInput {
253
+ provider: string;
254
+ code: string;
255
+ redirectUri?: string;
256
+ }
257
+ /**
258
+ * SAML input
259
+ */
260
+ export interface SAMLInput {
261
+ samlResponse: string;
262
+ relayState?: string;
263
+ }
264
+ /**
265
+ * SAML request result
266
+ */
267
+ export interface SAMLRequestResult {
268
+ requestId: string;
269
+ ssoUrl: string;
270
+ samlRequest: string;
271
+ }
272
+ /**
273
+ * Auth context for magic link
274
+ */
275
+ export interface AuthContext {
276
+ ipAddress?: string;
277
+ userAgent?: string;
278
+ deviceId?: string;
279
+ }
280
+ /**
281
+ * Magic link send result
282
+ */
283
+ export interface MagicLinkSendResult {
284
+ success: boolean;
285
+ message: string;
286
+ expiresIn?: number;
287
+ }
288
+ /**
289
+ * Organization entity (for context switcher)
290
+ */
291
+ export interface Organization {
292
+ id: string;
293
+ name: string;
294
+ slug?: string;
295
+ tenantId?: string;
296
+ description?: string;
297
+ logo?: string;
298
+ website?: string;
299
+ status?: string;
300
+ type?: string;
301
+ createdAt?: string;
302
+ updatedAt?: string;
303
+ }
304
+ /**
305
+ * Organization connection for pagination
306
+ */
307
+ export interface OrganizationConnection {
308
+ total: number;
309
+ items: Organization[];
310
+ }
311
+ /**
312
+ * Workspace entity
313
+ */
314
+ export interface Workspace {
315
+ id: string;
316
+ name: string;
317
+ slug: string;
318
+ tenantId: string;
319
+ organizationId: string;
320
+ type?: string;
321
+ status?: string;
322
+ region?: string;
323
+ createdAt?: string;
324
+ updatedAt?: string;
325
+ }
326
+ /**
327
+ * Workspace secret status
328
+ */
329
+ export type WorkspaceSecretStatus = "ACTIVE" | "INACTIVE" | "REVOKED" | "ROTATED";
330
+ /**
331
+ * Workspace secret info
332
+ */
333
+ export interface WorkspaceSecretInfo {
334
+ workspaceId: string;
335
+ status: WorkspaceSecretStatus;
336
+ algorithm: string;
337
+ createdAt: string;
338
+ updatedAt: string;
339
+ lastRotatedAt?: string;
340
+ isInGracePeriod: boolean;
341
+ gracePeriodEndsAt?: string;
342
+ rotationSchedule?: string;
343
+ }
344
+ /**
345
+ * Workspace token response
346
+ */
347
+ export interface WorkspaceTokenResponse {
348
+ workspaceToken: string;
349
+ tokenType: string;
350
+ expiresIn: number;
351
+ }
352
+ /**
353
+ * Generate workspace token input
354
+ */
355
+ export interface GenerateWorkspaceTokenInput {
356
+ workspaceId: string;
357
+ }
358
+ /**
359
+ * Rotate workspace secret input
360
+ */
361
+ export interface RotateWorkspaceSecretInput {
362
+ workspaceId: string;
363
+ gracePeriodDays?: number;
364
+ }
365
+ /**
366
+ * Secret rotation response
367
+ */
368
+ export interface SecretRotationResponse {
369
+ success: boolean;
370
+ message: string;
371
+ rotationStartedAt: string;
372
+ gracePeriodEndsAt: string;
373
+ }
374
+ /**
375
+ * Project entity (for context switcher)
376
+ */
377
+ export interface Project {
378
+ id: string;
379
+ name: string;
380
+ key?: string;
381
+ workspaceId: string;
382
+ status?: ProjectStatus;
383
+ archived?: boolean;
384
+ createdAt?: string;
385
+ updatedAt?: string;
386
+ }
387
+ /**
388
+ * Project status
389
+ */
390
+ export type ProjectStatus = "ACTIVE" | "ARCHIVED" | "INACTIVE";
391
+ /**
392
+ * Project connection for pagination
393
+ */
394
+ export interface ProjectConnection {
395
+ total: number;
396
+ items: Project[];
397
+ }
398
+ /**
399
+ * Token validation error
400
+ */
401
+ export interface TokenValidationError {
402
+ code: string;
403
+ message: string;
404
+ }
405
+ /**
406
+ * Token validation response
407
+ */
408
+ export interface TokenValidationResponse {
409
+ valid: boolean;
410
+ userId?: string;
411
+ email?: string;
412
+ role?: string;
413
+ tenantId?: string;
414
+ workspaceId?: string;
415
+ appId?: string;
416
+ delegationId?: string;
417
+ scopes?: string[];
418
+ tokenType?: string;
419
+ expiresAt?: number;
420
+ error?: TokenValidationError;
421
+ }
422
+ /**
423
+ * Validate tokens input
424
+ */
425
+ export interface ValidateTokensInput {
426
+ authToken: string;
427
+ workspaceToken?: string;
428
+ }
429
+ /**
430
+ * Email verification result
431
+ */
432
+ export interface EmailVerificationResult {
433
+ success: boolean;
434
+ message: string;
435
+ }
436
+ /**
437
+ * Resend verification result
438
+ */
439
+ export interface ResendVerificationResult {
440
+ success: boolean;
441
+ message: string;
442
+ }
443
+ /**
444
+ * Password reset request result
445
+ */
446
+ export interface PasswordResetRequestResult {
447
+ success: boolean;
448
+ message: string;
449
+ }
450
+ /**
451
+ * Delete user result
452
+ */
453
+ export interface DeleteUserResult {
454
+ success: boolean;
455
+ message: string;
456
+ }
457
+ /**
458
+ * MFA device (legacy)
459
+ */
460
+ export interface MfaDevice {
461
+ id: string;
462
+ type: MFAMethod;
463
+ name: string;
464
+ verified: boolean;
465
+ lastUsedAt: string | null;
466
+ createdAt: string;
467
+ }
468
+ /**
469
+ * Session entity
470
+ */
471
+ export interface Session {
472
+ id: string;
473
+ status: string;
474
+ ipAddress: string | null;
475
+ userAgent: string | null;
476
+ location: string | null;
477
+ lastActivityAt: string;
478
+ expiresAt: string;
479
+ createdAt: string;
480
+ isCurrent: boolean;
481
+ }
482
+ /**
483
+ * OAuth account (legacy)
484
+ */
485
+ export interface OAuthAccount {
486
+ id: string;
487
+ provider: string;
488
+ providerEmail: string;
489
+ providerUsername: string | null;
490
+ createdAt: string;
491
+ }
492
+ /**
493
+ * OAuth providers (legacy)
494
+ */
495
+ export type OAuthProvider = "google" | "github" | "microsoft" | "apple" | "linkedin" | "facebook";
496
+ /**
497
+ * Trusted device (legacy)
498
+ */
499
+ export interface TrustedDevice {
500
+ id: string;
501
+ deviceName: string;
502
+ ipAddress: string;
503
+ trustedAt: string;
504
+ expiresAt: string;
505
+ }
506
+ /**
507
+ * Security audit event (legacy)
508
+ */
509
+ export interface SecurityAudit {
510
+ id: string;
511
+ eventType: SecurityEventType;
512
+ ipAddress: string;
513
+ userAgent: string;
514
+ location: string | null;
515
+ metadata: Record<string, unknown>;
516
+ timestamp: string;
517
+ success: boolean;
518
+ }
519
+ /**
520
+ * Security event types (legacy)
521
+ */
522
+ export type SecurityEventType = "LOGIN" | "LOGIN_FAILED" | "LOGOUT" | "PASSWORD_CHANGED" | "PASSWORD_RESET_REQUESTED" | "PASSWORD_RESET_COMPLETED" | "MFA_ENABLED" | "MFA_DISABLED" | "MFA_VERIFIED" | "MFA_FAILED" | "OAUTH_LINKED" | "OAUTH_UNLINKED" | "SESSION_REVOKED" | "API_KEY_CREATED" | "API_KEY_REVOKED" | "DEVICE_TRUSTED" | "DEVICE_REVOKED" | "ANOMALY_DETECTED";
523
+ /**
524
+ * Password strength
525
+ */
526
+ export interface PasswordStrength {
527
+ score: 0 | 1 | 2 | 3 | 4;
528
+ feedback: string[];
529
+ crackTime: string;
530
+ }
531
+ /**
532
+ * SSO configuration
533
+ */
534
+ export interface SSOConfig {
535
+ id: string;
536
+ tenantId: string;
537
+ type?: "SAML" | "OIDC";
538
+ enabled: boolean;
539
+ entityId: string;
540
+ ssoUrl: string;
541
+ sloUrl?: string;
542
+ certificate: string;
543
+ domains?: string[];
544
+ metadata?: Record<string, unknown>;
545
+ createdAt: string;
546
+ updatedAt: string;
547
+ }
548
+ /**
549
+ * API key entity (matches myApiKeys query response)
550
+ */
551
+ export interface ApiKey {
552
+ id: string;
553
+ name: string;
554
+ prefix: string;
555
+ scopes: string[];
556
+ appId?: string;
557
+ appName?: string;
558
+ createdAt: string;
559
+ expiresAt?: string;
560
+ lastUsedAt?: string;
561
+ }
562
+ /**
563
+ * Input for generating a new API key
564
+ */
565
+ export interface GenerateAPIKeyInput {
566
+ appId: string;
567
+ name: string;
568
+ scope: string[];
569
+ expiresInDays?: number;
570
+ recaptchaToken?: string;
571
+ }
572
+ /**
573
+ * Result of API key generation (matches generateAPIKey mutation response)
574
+ * Fields: apiKey, apiSecret, keyId
575
+ */
576
+ export interface APIKeyResult {
577
+ keyId: string;
578
+ apiKey: string;
579
+ apiSecret: string;
580
+ }
581
+ /**
582
+ * Result of API key rotation (matches rotateAPIKey mutation response)
583
+ * Fields: apiSecret
584
+ */
585
+ export interface APIKeyRotateResult {
586
+ apiSecret: string;
587
+ }
588
+ /**
589
+ * App type enum
590
+ */
591
+ export type AppType = "SERVICE" | "INTEGRATION" | "BOT";
592
+ /**
593
+ * OAuth application entity (matches backend schema)
594
+ */
595
+ export interface App {
596
+ id: string;
597
+ name: string;
598
+ description?: string;
599
+ type: AppType;
600
+ clientId: string;
601
+ status: string;
602
+ scopes: string[];
603
+ redirectUris: string[];
604
+ ownerId: string;
605
+ createdAt: string;
606
+ updatedAt: string;
607
+ }
608
+ /**
609
+ * Input for creating an OAuth application
610
+ */
611
+ export interface CreateAppInput {
612
+ name: string;
613
+ description?: string;
614
+ type: AppType;
615
+ scopes?: string[];
616
+ redirectUris?: string[];
617
+ }
618
+ /**
619
+ * Input for updating an OAuth application
620
+ */
621
+ export interface UpdateAppInput {
622
+ name?: string;
623
+ description?: string;
624
+ scopes?: string[];
625
+ redirectUris?: string[];
626
+ }
627
+ /**
628
+ * Response from creating an app (includes client secret, shown only once)
629
+ */
630
+ export interface AppCreateResponse {
631
+ app: App;
632
+ clientSecret: string;
633
+ }
634
+ /**
635
+ * Response from authenticating an app or generating an app token
636
+ */
637
+ export interface AppTokenResponse {
638
+ accessToken: string;
639
+ tokenType: string;
640
+ expiresIn: number;
641
+ scopes: string[];
642
+ }
643
+ /**
644
+ * Response from generating an app-as-user token or token exchange
645
+ */
646
+ export interface AppAsUserTokenResponse {
647
+ accessToken: string;
648
+ tokenType: string;
649
+ expiresIn: number;
650
+ scopes: string[];
651
+ actingAs: string;
652
+ }
653
+ /**
654
+ * App-user delegation entity (matches backend schema)
655
+ */
656
+ export interface AppUserDelegation {
657
+ id: string;
658
+ appId: string;
659
+ userId: string;
660
+ scopes: string[];
661
+ workspaceIds: string[];
662
+ status: "ACTIVE" | "REVOKED" | "EXPIRED";
663
+ grantedAt: string;
664
+ expiresAt?: string;
665
+ revokedAt?: string;
666
+ revokeReason?: string;
667
+ app?: App;
668
+ }
669
+ /**
670
+ * Input for granting delegation to an app
671
+ */
672
+ export interface GrantDelegationInput {
673
+ appId: string;
674
+ userId: string;
675
+ scopes: string[];
676
+ workspaceIds?: string[];
677
+ expiresInDays?: number;
678
+ }
@@ -0,0 +1,3 @@
1
+ export declare function isCaptchaEnabled(): boolean;
2
+ export declare function getRecaptchaSiteKey(): string | undefined;
3
+ export declare function requireRecaptchaSiteKey(): string;
@@ -0,0 +1,36 @@
1
+ /**
2
+ * Format date relative to now (e.g., "2 minutes ago", "3 days ago")
3
+ */
4
+ export declare function formatRelativeTime(dateString: string): string;
5
+ /**
6
+ * Format date to human-readable string
7
+ */
8
+ export declare function formatDate(dateString: string): string;
9
+ /**
10
+ * Format date and time
11
+ */
12
+ export declare function formatDateTime(dateString: string): string;
13
+ /**
14
+ * Mask API key (show only prefix and last 4 characters)
15
+ */
16
+ export declare function maskApiKey(key: string, prefix: string): string;
17
+ /**
18
+ * Format IP address with location
19
+ */
20
+ export declare function formatLocationString(ipAddress: string, location: string | null): string;
21
+ /**
22
+ * Get device icon based on user agent
23
+ */
24
+ export declare function getDeviceIcon(userAgent: string): string;
25
+ /**
26
+ * Parse device name from user agent
27
+ */
28
+ export declare function parseDeviceName(userAgent: string | null | undefined): string;
29
+ /**
30
+ * Parse browser name from user agent
31
+ */
32
+ export declare function parseBrowserName(userAgent: string | null | undefined): string;
33
+ /**
34
+ * Format OAuth provider name
35
+ */
36
+ export declare function formatOAuthProvider(provider: string): string;
@@ -0,0 +1,5 @@
1
+ export interface GatewayBaseUrls {
2
+ globalBaseUrl: string;
3
+ workspaceBaseUrl: string;
4
+ }
5
+ export declare function resolveGatewayBaseUrls(): GatewayBaseUrls;
@@ -0,0 +1,2 @@
1
+ export * from './validation';
2
+ export * from './formatters';