@authyon/server 0.2.0-beta.3 → 0.2.0-beta.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,976 @@
1
+ import { JSONWebKeySet, JWTPayload, JWSHeaderParameters } from 'jose';
2
+
3
+ interface HttpAdapterRequest {
4
+ url: string;
5
+ method: string;
6
+ headers: Record<string, string>;
7
+ body?: BodyInit | null;
8
+ signal: AbortSignal;
9
+ }
10
+ /** Transport contract accepted by both Authyon clients. */
11
+ interface HttpAdapter {
12
+ request(request: HttpAdapterRequest): Promise<Response>;
13
+ }
14
+ type HttpLogEvent = {
15
+ type: "request";
16
+ method: string;
17
+ url: string;
18
+ timestamp: number;
19
+ } | {
20
+ type: "response";
21
+ method: string;
22
+ url: string;
23
+ status: number;
24
+ durationMs: number;
25
+ requestId?: string;
26
+ timestamp: number;
27
+ } | {
28
+ type: "error";
29
+ method: string;
30
+ url: string;
31
+ errorName: string;
32
+ durationMs: number;
33
+ timestamp: number;
34
+ };
35
+ /** Receives sanitized HTTP lifecycle events. Headers, bodies and query values are never exposed. */
36
+ type HttpLogger = (event: HttpLogEvent) => void;
37
+ /**
38
+ * Mutable logging configuration. Change `enabled` at runtime to enable or disable logging
39
+ * without recreating the Authyon client.
40
+ */
41
+ interface HttpLoggerOptions {
42
+ enabled: boolean;
43
+ logger?: HttpLogger;
44
+ }
45
+ /** Default adapter backed by the platform's Fetch API. */
46
+ declare class FetchHttpAdapter implements HttpAdapter {
47
+ private readonly fetchImpl;
48
+ constructor(fetchImpl?: typeof fetch);
49
+ request(request: HttpAdapterRequest): Promise<Response>;
50
+ }
51
+ /** Adds safe, configurable lifecycle logging to any HTTP adapter. */
52
+ declare class LoggingHttpAdapter implements HttpAdapter {
53
+ private readonly adapter;
54
+ private readonly options;
55
+ constructor(adapter: HttpAdapter, options: HttpLoggerOptions);
56
+ request(request: HttpAdapterRequest): Promise<Response>;
57
+ private log;
58
+ }
59
+
60
+ interface PaginationOptions {
61
+ skip?: number;
62
+ take?: number;
63
+ }
64
+ interface Paged<T> {
65
+ data: T[];
66
+ perPage?: number;
67
+ pageSize: number;
68
+ total: number;
69
+ pages: number;
70
+ hasNext: boolean;
71
+ hasPrev: boolean;
72
+ }
73
+ interface IntrospectResult {
74
+ active: boolean;
75
+ sub?: string;
76
+ username?: string | null;
77
+ email?: string | null;
78
+ roles?: string[] | null;
79
+ permissions?: string[];
80
+ client_id?: string;
81
+ scope?: string;
82
+ exp?: number;
83
+ iat?: number;
84
+ jti?: string;
85
+ token_type?: string;
86
+ }
87
+
88
+ /** GET/POST /env/tenants — confirmed against the live API. */
89
+ interface Organization {
90
+ id: string;
91
+ slug: string;
92
+ name?: string;
93
+ description?: string | null;
94
+ environmentId?: string;
95
+ workspaceId?: string;
96
+ isDisabled?: boolean;
97
+ memberCount?: number;
98
+ createdAt?: string;
99
+ updatedAt?: string;
100
+ }
101
+ /** One of a user's tenant memberships, as embedded in `EnvironmentUser.tenantMemberships`. */
102
+ interface TenantMembership {
103
+ tenantId: string;
104
+ tenantSlug: string;
105
+ tenantName: string;
106
+ tenantDisabled: boolean;
107
+ roles: string[];
108
+ }
109
+ /** Lightweight user shape returned by `introspect()`/`validate()`. */
110
+ interface User {
111
+ id: string;
112
+ email: string;
113
+ username?: string;
114
+ /** Environment-level roles from the database-validated user profile. */
115
+ roles?: string[];
116
+ permissions?: string[];
117
+ }
118
+ interface RoleGrant {
119
+ role: string;
120
+ expiresAt?: string | null;
121
+ }
122
+ /**
123
+ * Full user record from the EnvironmentManagement plane
124
+ * (`environment.users.get()` / `.list()`), confirmed against the live API.
125
+ * `get()` returns every field below; `list()` returns a subset (no
126
+ * `failedLoginAttempts`, `lockedOutUntil`, `roleGrants`,
127
+ * `directPermissions`, `effectivePermissions`, `refreshTokens`,
128
+ * `tenantMemberships`, `totpConfirmedAt`, `emailOtpEnabledAt`,
129
+ * `remainingRecoveryCodes`, `disableReason`, `suspension`, `deleteReason`,
130
+ * `customFields` — and `suspendedUntil` instead of `suspension`).
131
+ */
132
+ interface EnvironmentUser {
133
+ id: string;
134
+ email: string;
135
+ username?: string;
136
+ firstName?: string | null;
137
+ lastName?: string | null;
138
+ emailConfirmed: boolean;
139
+ isDisabled: boolean;
140
+ createdAt: string;
141
+ lastLoginAt?: string | null;
142
+ failedLoginAttempts?: number;
143
+ lockedOutUntil?: string | null;
144
+ roles: string[];
145
+ roleGrants?: RoleGrant[];
146
+ directPermissions?: string[];
147
+ effectivePermissions?: string[];
148
+ /** Confirmed shape unknown — empty in every response seen so far. */
149
+ refreshTokens?: unknown[];
150
+ tenantIds: string[];
151
+ tenantMemberships?: TenantMembership[];
152
+ /** Flattened role names across all tenant memberships (list() only). */
153
+ tenantRoles?: string[];
154
+ twoFactorMethods: string[];
155
+ totpConfirmedAt?: string | null;
156
+ emailOtpEnabledAt?: string | null;
157
+ remainingRecoveryCodes?: number;
158
+ disableReason?: string | null;
159
+ suspension?: unknown | null;
160
+ suspendedUntil?: string | null;
161
+ deletedAt?: string | null;
162
+ deleteReason?: string | null;
163
+ /** JSON-encoded string. */
164
+ customFields?: string;
165
+ }
166
+ /**
167
+ * POST /auth/validate — confirmed against the live API. The wire shape is
168
+ * `{ valid, reason, profile }`, not `{ user, organization }` as the
169
+ * OpenAPI schema (which didn't document response bodies) suggested.
170
+ * `profile` is `null` for machine tokens (there's no user behind them) and
171
+ * for tokens that fail validation.
172
+ */
173
+ interface ValidateResult {
174
+ valid: boolean;
175
+ reason?: string | null;
176
+ user: User | null;
177
+ }
178
+ /**
179
+ * A role available within an environment or one of its tenants. Confirmed
180
+ * live: system roles carry no `id`/`description` (only `name` +
181
+ * `permissions`) — both are only populated for custom roles you create.
182
+ */
183
+ interface Role {
184
+ id?: string | null;
185
+ name: string;
186
+ description?: string | null;
187
+ permissions: string[];
188
+ }
189
+ interface RoleInput {
190
+ name: string;
191
+ description?: string;
192
+ permissions?: string[];
193
+ }
194
+ /**
195
+ * GET /env/roles and GET /tenant/roles group results by origin instead of
196
+ * returning a flat array — confirmed live for the environment endpoint.
197
+ */
198
+ interface RoleList {
199
+ custom: Role[];
200
+ system: Role[];
201
+ }
202
+ /** A permission entry as it appears nested under a role in `PermissionsByRole`. */
203
+ interface Permission {
204
+ value: string;
205
+ description?: string | null;
206
+ /** Confirmed live: `null` for the built-in catalog: no separate id per entry. */
207
+ catalogId?: string | null;
208
+ }
209
+ /** A role entry as returned by GET /env/permissions, with its permissions nested. */
210
+ interface RolePermissions {
211
+ roleId: string | null;
212
+ name: string;
213
+ description?: string | null;
214
+ isSystem: boolean;
215
+ permissions: Permission[];
216
+ }
217
+ /** GET /env/permissions — confirmed live: grouped by role, plus any orphaned entries. */
218
+ interface PermissionsByRole {
219
+ roles: RolePermissions[];
220
+ orphans: Permission[];
221
+ }
222
+ /** GET /permissions/reserved — confirmed live: wrapped, not a bare string array. */
223
+ interface ReservedPermissions {
224
+ namespace: string;
225
+ items: string[];
226
+ }
227
+ interface CreatePermissionInput {
228
+ value: string;
229
+ description?: string;
230
+ /** Attach the new permission to this role immediately. */
231
+ attachToRoleId?: string;
232
+ }
233
+ interface CreateOrganizationInput {
234
+ name: string;
235
+ slug: string;
236
+ description?: string;
237
+ }
238
+ interface UpdateOrganizationInput {
239
+ name: string;
240
+ description?: string;
241
+ }
242
+ interface CreateUserInput {
243
+ email: string;
244
+ username: string;
245
+ password: string;
246
+ emailConfirmed?: boolean;
247
+ roles?: string[];
248
+ /** Tenants (organizations) to add the user to on creation. */
249
+ tenantIds?: string[];
250
+ }
251
+ /** GET /env/audit — one audit-trail entry, confirmed against the live API. */
252
+ interface AuditEvent {
253
+ id: string;
254
+ occurredAt: string;
255
+ eventType: string;
256
+ /** JSON-encoded string — `JSON.parse` it for the event-specific payload. */
257
+ payloadJson?: string;
258
+ workspaceId?: string;
259
+ environmentId?: string;
260
+ actorUserId?: string | null;
261
+ actorType?: string;
262
+ actorIp?: string;
263
+ userAgent?: string;
264
+ tenantId?: string | null;
265
+ }
266
+ /**
267
+ * GET /env/audit/login-activity. Not confirmed with a populated example
268
+ * live (the test environment had none) — assumed to share `AuditEvent`'s
269
+ * shape, since login activity is the same underlying audit-event stream
270
+ * filtered to sign-in events.
271
+ */
272
+ type LoginActivity = AuditEvent;
273
+ /**
274
+ * Envelope every `skip`/`take`-paginated list endpoint returns, confirmed
275
+ * live for `/env/users`, `/env/audit` and `/env/audit/login-activity`.
276
+ * Endpoints without `skip`/`take` params return a bare array instead.
277
+ */
278
+ /** Tenant credential metadata. Listing never returns the secret. */
279
+ interface TenantCredentialSummary {
280
+ id: string;
281
+ clientId: string;
282
+ description: string | null;
283
+ createdAt: string;
284
+ lastUsedAt: string | null;
285
+ revokedAt: string | null;
286
+ expiresAt: string | null;
287
+ isActive: boolean;
288
+ permissions: string[];
289
+ }
290
+ /** Input for a tenant machine credential. Requires at least one explicit permission. */
291
+ interface CreateTenantCredentialInput {
292
+ description: string;
293
+ /** Number of days until the tenant credential expires. Omit for no automatic expiration. */
294
+ lifetimeDays?: number | null;
295
+ permissions: string[];
296
+ }
297
+ /** The plaintext secret is returned only when the credential is issued. */
298
+ interface TenantCredentialIssued {
299
+ credentialId: string;
300
+ clientId: string;
301
+ clientSecret: string;
302
+ createdAt: string;
303
+ expiresAt: string | null;
304
+ permissions: string[];
305
+ }
306
+ /** OAuth 2.0 client-credentials pair minted in the Authyon console. */
307
+ interface ClientCredentials {
308
+ clientId: string;
309
+ clientSecret: string;
310
+ }
311
+ /** Standard OAuth 2.0 client-credentials token response. */
312
+ interface TokenResult {
313
+ access_token: string;
314
+ token_type: string;
315
+ expires_in: number;
316
+ scope?: string;
317
+ }
318
+ interface JsonWebKeySet {
319
+ keys: Record<string, unknown>[];
320
+ }
321
+ interface OpenIdConfiguration {
322
+ issuer: string;
323
+ jwks_uri: string;
324
+ authorization_endpoint?: string;
325
+ token_endpoint?: string;
326
+ [key: string]: unknown;
327
+ }
328
+ interface AuthyonServerClientOptions {
329
+ /**
330
+ * Publishable environment key (`pk_live_...` / `pk_test_...`), sent as
331
+ * `X-Authyon-Environment`. Required on **every** call — it selects the
332
+ * environment (Test / Live) that a request applies to, independently of
333
+ * whichever bearer token authenticates it.
334
+ */
335
+ envKey?: string;
336
+ /**
337
+ * Environment-level OAuth client credentials (`ec_...` / secret), minted
338
+ * in the console. Required for everything under `environment.*` and
339
+ * `permissions.*` — the SDK exchanges them for a short-lived access token
340
+ * via `POST /env/oauth/token` and refreshes it transparently.
341
+ */
342
+ clientId?: string;
343
+ clientSecret?: string;
344
+ /** API origin. Defaults to `https://api.authyon.com`. */
345
+ baseUrl?: string;
346
+ /** Allow an HTTP `baseUrl`. Intended only for explicitly trusted local development. */
347
+ allowInsecureHttp?: boolean;
348
+ /** Maximum duration of each HTTP request. Defaults to 15 seconds; set to `0` to disable. */
349
+ timeoutMs?: number;
350
+ /** Custom HTTP adapter for tracing, mocks or an alternative HTTP stack. */
351
+ httpAdapter?: HttpAdapter;
352
+ /** Safe HTTP lifecycle logging. Disabled unless this option is provided with `enabled: true`. */
353
+ httpLogger?: HttpLoggerOptions;
354
+ /** @deprecated Prefer `httpAdapter: new FetchHttpAdapter(customFetch)`. */
355
+ fetch?: typeof fetch;
356
+ }
357
+
358
+ /** A token of the requested authentication plane, or a provider called for each request. */
359
+ type AccessTokenSource = string | (() => string | Promise<string>);
360
+ interface CredentialListOptions extends PaginationOptions {
361
+ search?: string;
362
+ }
363
+ /** scopes is an alias for permissions. Always supply an explicit, nonempty set. */
364
+ type CredentialPermissionsInput = {
365
+ permissions: readonly string[];
366
+ scopes?: never;
367
+ } | {
368
+ scopes: readonly string[];
369
+ permissions?: never;
370
+ };
371
+ type CreateCredentialInput = CredentialPermissionsInput & {
372
+ description?: string;
373
+ lifetimeDays?: number | null;
374
+ };
375
+ interface CredentialScope {
376
+ workspaceId: string;
377
+ environmentId: string;
378
+ tenantId?: string;
379
+ }
380
+ interface TenantManagementScope extends CredentialScope {
381
+ tenantId: string;
382
+ }
383
+ interface CredentialCreator {
384
+ id: string | null;
385
+ type: string;
386
+ displayName: string | null;
387
+ }
388
+ interface CredentialDetail extends TenantCredentialSummary {
389
+ createdBy: CredentialCreator | null;
390
+ updatedAt: string | null;
391
+ secretRotatedAt: string | null;
392
+ expiresAt: string | null;
393
+ ageSeconds: number;
394
+ /** Null while active; elapsed lifetime at revocation otherwise. */
395
+ lifetimeSeconds: number | null;
396
+ accessTokenLifetimeSeconds: number;
397
+ }
398
+ type WorkspaceRole = "admin" | "auditor";
399
+ interface WorkspaceMember {
400
+ memberId: string | null;
401
+ userId: string;
402
+ email: string;
403
+ name: string;
404
+ role: string;
405
+ isOwner: boolean;
406
+ isSelf: boolean;
407
+ invitedByName: string | null;
408
+ joinedAt: string;
409
+ lastLoginAt: string | null;
410
+ }
411
+ interface WorkspaceInvite {
412
+ id: string;
413
+ email: string;
414
+ role: string;
415
+ invitedByName: string | null;
416
+ createdAt: string;
417
+ expiresAt: string;
418
+ }
419
+ interface WorkspaceTeam {
420
+ workspaceId: string;
421
+ workspaceName: string;
422
+ callerRole: string;
423
+ canManage: boolean;
424
+ members: WorkspaceMember[];
425
+ pendingInvites: WorkspaceInvite[];
426
+ }
427
+ interface InviteWorkspaceMemberInput {
428
+ email: string;
429
+ role: WorkspaceRole;
430
+ }
431
+ interface WorkspaceInviteIssued {
432
+ inviteId: string;
433
+ email: string;
434
+ role: string;
435
+ /** Sensitive bearer link returned at issuance. Do not log or persist in public storage. */
436
+ acceptUrl: string;
437
+ expiresAt: string;
438
+ }
439
+ interface WorkspaceInvitePreview {
440
+ workspaceName: string;
441
+ email: string;
442
+ role: string;
443
+ expiresAt: string;
444
+ requiresRegistration: boolean;
445
+ }
446
+ interface WorkspaceInviteAccepted {
447
+ workspaceId: string;
448
+ workspaceName: string;
449
+ role: string;
450
+ accountCreated: boolean;
451
+ }
452
+ interface AcceptWorkspaceInviteInput {
453
+ name?: string;
454
+ password?: string;
455
+ }
456
+ interface InviteTenantMemberInput {
457
+ email: string;
458
+ roles?: string[];
459
+ }
460
+ interface TenantMember {
461
+ userId: string;
462
+ email: string;
463
+ username: string;
464
+ roles: string[];
465
+ createdAt: string;
466
+ lastLoginAt: string | null;
467
+ }
468
+ type TenantMemberPage = Paged<TenantMember>;
469
+
470
+ type QueryParams = object;
471
+
472
+ type HttpMethod = "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
473
+ interface JsonRequestOptions {
474
+ method?: HttpMethod;
475
+ body?: unknown;
476
+ query?: QueryParams;
477
+ headers?: Record<string, string>;
478
+ }
479
+
480
+ type ManagementRequest = <T>(path: string, options?: JsonRequestOptions) => Promise<T>;
481
+
482
+ /** Platform user administration. Never falls back to an environment machine token. */
483
+ declare class PlatformScopedClient {
484
+ #private;
485
+ /** @hidden */
486
+ constructor(request: ManagementRequest, token: AccessTokenSource);
487
+ readonly credentials: {
488
+ list: (scope: CredentialScope, options?: CredentialListOptions) => Promise<Paged<TenantCredentialSummary>>;
489
+ get: (scope: CredentialScope, credentialId: string) => Promise<CredentialDetail>;
490
+ create: (scope: CredentialScope, input: CreateCredentialInput) => Promise<TenantCredentialIssued>;
491
+ updatePermissions: (scope: CredentialScope, credentialId: string, input: CredentialPermissionsInput) => Promise<void>;
492
+ updateScopes: (scope: CredentialScope, credentialId: string, scopes: readonly string[]) => Promise<void>;
493
+ /** Returns a new secret once. API may require an explicit step-up first. */
494
+ rotate: (scope: CredentialScope, credentialId: string) => Promise<TenantCredentialIssued>;
495
+ revoke: (scope: CredentialScope, credentialId: string) => Promise<void>;
496
+ };
497
+ readonly workspaces: {
498
+ team: (workspaceId: string) => Promise<WorkspaceTeam>;
499
+ members: {
500
+ invite: (workspaceId: string, input: InviteWorkspaceMemberInput) => Promise<WorkspaceInviteIssued>;
501
+ /** memberId comes from team.members; it is not the platform userId. */
502
+ remove: (workspaceId: string, memberId: string) => Promise<void>;
503
+ changeRole: (workspaceId: string, memberId: string, role: WorkspaceRole) => Promise<void>;
504
+ };
505
+ invites: {
506
+ create: (workspaceId: string, input: InviteWorkspaceMemberInput) => Promise<WorkspaceInviteIssued>;
507
+ revoke: (workspaceId: string, inviteId: string) => Promise<void>;
508
+ };
509
+ };
510
+ readonly tenants: {
511
+ members: {
512
+ list: (scope: TenantManagementScope, options?: PaginationOptions) => Promise<EnvironmentUser[]>;
513
+ add: (scope: TenantManagementScope, userId: string, roles?: string[]) => Promise<void>;
514
+ remove: (scope: TenantManagementScope, userId: string) => Promise<void>;
515
+ };
516
+ };
517
+ readonly auth: {
518
+ /** Explicitly confirms the current platform session; passwords are not retained. */
519
+ stepUp: (currentPassword: string) => Promise<void>;
520
+ };
521
+ }
522
+ /** End-user operations require a user token and the environment publishable key. */
523
+ declare class UserScopedClient {
524
+ #private;
525
+ /** @hidden */
526
+ constructor(request: ManagementRequest, token: AccessTokenSource);
527
+ readonly tenants: {
528
+ members: {
529
+ list: (tenantId: string, options?: PaginationOptions) => Promise<TenantMemberPage>;
530
+ /** Adds an existing environment user by email; does not send an invitation email. */
531
+ invite: (tenantId: string, input: InviteTenantMemberInput) => Promise<TenantMember>;
532
+ remove: (tenantId: string, userId: string) => Promise<void>;
533
+ };
534
+ };
535
+ }
536
+ /** Anonymous invite endpoints: the invitation token itself authorizes these requests. */
537
+ declare class WorkspaceInvitesClient {
538
+ #private;
539
+ /** @hidden */
540
+ constructor(request: ManagementRequest);
541
+ preview(token: string): Promise<WorkspaceInvitePreview>;
542
+ accept(token: string, input?: AcceptWorkspaceInviteInput): Promise<WorkspaceInviteAccepted>;
543
+ }
544
+
545
+ interface ClientRequestContext {
546
+ /** Real end-user IP, resolved only from infrastructure trusted by the application. */
547
+ clientIp?: string;
548
+ }
549
+ /** Rejects header injection and values that are not a single IPv4 or IPv6 address. */
550
+ declare function normalizeClientIp(value: string): string;
551
+
552
+ type SafeJwtAlgorithm = "RS256" | "PS256" | "ES256" | "EdDSA";
553
+ interface AuthyonJwtClaims extends JWTPayload {
554
+ sub: string;
555
+ iss: string;
556
+ aud: string | string[];
557
+ exp: number;
558
+ iat: number;
559
+ email?: string;
560
+ username?: string;
561
+ roles?: string[];
562
+ permissions?: string[];
563
+ scope?: string;
564
+ }
565
+ interface VerifiedAccessToken {
566
+ claims: AuthyonJwtClaims;
567
+ protectedHeader: JWSHeaderParameters;
568
+ }
569
+ interface JwksTokenVerifierOptions {
570
+ /** Exact trusted issuer from Authyon OpenID discovery. */
571
+ issuer: string;
572
+ /** Audience assigned to the API consuming this token. */
573
+ audience: string | string[];
574
+ /** Trusted HTTPS JWKS endpoint. Never derive this value from the token header. */
575
+ jwksUri?: string;
576
+ /** Static trusted keys for pinned or offline verification. */
577
+ jwks?: JSONWebKeySet;
578
+ algorithms?: readonly SafeJwtAlgorithm[];
579
+ acceptedTokenTypes?: readonly string[];
580
+ clockToleranceSeconds?: number;
581
+ maxTokenAgeSeconds?: number;
582
+ jwksTimeoutMs?: number;
583
+ jwksCacheMs?: number;
584
+ jwksCooldownMs?: number;
585
+ }
586
+ interface AuthyonJwksDiscoveryOptions extends Omit<JwksTokenVerifierOptions, "issuer" | "jwksUri" | "jwks"> {
587
+ /** Optional pin; discovery fails if Authyon advertises a different issuer. */
588
+ issuer?: string;
589
+ /** Override the client environment key used by the discovery endpoint. */
590
+ publishableKey?: string;
591
+ }
592
+ type TokenVerificationErrorCode = "token.invalid" | "token.expired" | "token.not_active" | "token.invalid_claims" | "token.invalid_signature" | "token.key_unavailable";
593
+ declare class TokenVerificationError extends Error {
594
+ readonly code: TokenVerificationErrorCode;
595
+ constructor(code: TokenVerificationErrorCode, options?: {
596
+ cause?: unknown;
597
+ });
598
+ }
599
+ /** Secure, cached JWT signature and claims verifier backed by a trusted remote JWKS. */
600
+ declare class JwksTokenVerifier {
601
+ private readonly options;
602
+ private readonly verifyKey;
603
+ private readonly algorithms;
604
+ private readonly acceptedTokenTypes;
605
+ constructor(options: JwksTokenVerifierOptions);
606
+ verifyAccessToken(token: string): Promise<VerifiedAccessToken>;
607
+ }
608
+
609
+ /**
610
+ * Server-side Authyon client: environment/tenant administration (OAuth
611
+ * client-credentials) plus access-token verification (publishable key).
612
+ * Never import this in browser code — client secrets must stay on your
613
+ * server.
614
+ */
615
+ declare class AuthyonServerClient {
616
+ #private;
617
+ private readonly envKey?;
618
+ private readonly clientId?;
619
+ private readonly transport;
620
+ private readonly http;
621
+ private readonly environmentTokenProvider;
622
+ constructor(options?: AuthyonServerClientOptions);
623
+ private request;
624
+ /** Mints (and caches) an environment access token from `clientId`/`clientSecret`. */
625
+ private getEnvironmentAccessToken;
626
+ readonly discovery: {
627
+ /** GET /.well-known/jwks.json — the environment's public signing keys. */
628
+ jwks: (publishableKey?: string) => Promise<JsonWebKeySet>;
629
+ /** GET /.well-known/openid-configuration — OIDC discovery document. */
630
+ openidConfiguration: (publishableKey?: string) => Promise<OpenIdConfiguration>;
631
+ };
632
+ /** Discovers Authyon's trusted issuer/JWKS and creates a cached local access-token verifier. */
633
+ createJwksTokenVerifier(options: AuthyonJwksDiscoveryOptions): Promise<JwksTokenVerifier>;
634
+ /** POST /auth/introspect — lightweight token introspection (RFC 7662). */
635
+ introspect(token: string, context?: ClientRequestContext): Promise<IntrospectResult>;
636
+ /** POST /auth/validate — recommended: cross-checks DB state, catches revocation immediately. */
637
+ validate(token: string, context?: ClientRequestContext): Promise<ValidateResult>;
638
+ readonly environmentAuth: {
639
+ /** POST /env/oauth/token — exchanges environment client credentials for an access token. */
640
+ token: (credentials: ClientCredentials) => Promise<TokenResult>;
641
+ };
642
+ readonly tenantAuth: {
643
+ /** POST /tenant/oauth/token — exchanges a tenant's client credentials for a scoped access token. */
644
+ token: (credentials: ClientCredentials) => Promise<TokenResult>;
645
+ };
646
+ /**
647
+ * Scopes a client to a single tenant's OAuth credentials — mints and
648
+ * caches its access token independently of the environment plane. Use
649
+ * this for the `TenantManagement` endpoints (`/tenant/...`), which act on
650
+ * "the token's tenant" rather than one you pass by id.
651
+ */
652
+ tenant(credentials: ClientCredentials): TenantScopedClient;
653
+ /** Uses only the supplied platform-user access token. */
654
+ platform(token: AccessTokenSource): PlatformScopedClient;
655
+ /** Uses an end-user token; the configured environment key selects the environment. */
656
+ user(token: AccessTokenSource): UserScopedClient;
657
+ readonly workspaceInvites: WorkspaceInvitesClient;
658
+ readonly environment: {
659
+ users: {
660
+ /** GET /env/users — paginated list of users in the environment. */
661
+ list: (params?: {
662
+ search?: string;
663
+ } & PaginationOptions) => Promise<Paged<EnvironmentUser>>;
664
+ /** POST /env/users — create a user in the environment; returns only the new id. */
665
+ create: (input: CreateUserInput) => Promise<{
666
+ id: string;
667
+ }>;
668
+ /** GET /env/users/{userId} — fetch an environment user by id. */
669
+ get: (userId: string) => Promise<EnvironmentUser>;
670
+ /** POST /env/users/{userId}/roles — grant a role to an environment user. */
671
+ assignRole: (userId: string, role: string) => Promise<void>;
672
+ /** DELETE /env/users/{userId}/roles/{role} — revoke a role from an environment user. */
673
+ removeRole: (userId: string, role: string) => Promise<void>;
674
+ /** POST /env/users/{userId}/permissions — grant a direct permission to an environment user. */
675
+ grantPermission: (userId: string, permission: string) => Promise<void>;
676
+ /** DELETE /env/users/{userId}/permissions/{permission} — revoke a direct permission. */
677
+ revokePermission: (userId: string, permission: string) => Promise<void>;
678
+ /** POST /env/users/{userId}/unlock — clears an environment user's lockout. */
679
+ unlock: (userId: string, reason?: string) => Promise<void>;
680
+ /** POST /env/users/{userId}/password — sets a new password for the user. */
681
+ setPassword: (userId: string, newPassword: string, reason?: string) => Promise<void>;
682
+ /** POST /env/users/{userId}/sessions/revoke-all — revokes every session the user has. */
683
+ revokeSessions: (userId: string, reason?: string) => Promise<void>;
684
+ /** DELETE /env/users/{userId}/sessions/{sessionId} — revokes a single session. */
685
+ revokeSession: (userId: string, sessionId: string, reason?: string) => Promise<void>;
686
+ /** POST /env/users/{userId}/disable — bans the user indefinitely; revokes live sessions. */
687
+ disable: (userId: string, reason?: string) => Promise<void>;
688
+ /** POST /env/users/{userId}/enable — lifts a ban. */
689
+ enable: (userId: string, reason?: string) => Promise<void>;
690
+ /** POST /env/users/{userId}/suspend — blocks the user temporarily; clears itself after `durationMinutes`. */
691
+ suspend: (userId: string, durationMinutes: number, reason?: string) => Promise<void>;
692
+ /** POST /env/users/{userId}/unsuspend — lifts a suspension early. */
693
+ unsuspend: (userId: string, reason?: string) => Promise<void>;
694
+ /** POST /env/users/{userId}/tenants — adds an environment user to a tenant. */
695
+ assignTenant: (userId: string, tenantId: string, roles?: string[]) => Promise<void>;
696
+ /** DELETE /env/users/{userId}/tenants/{tenantId} — removes an environment user from a tenant. */
697
+ removeTenant: (userId: string, tenantId: string) => Promise<void>;
698
+ };
699
+ tenants: {
700
+ credentials: {
701
+ /** GET /env/tenants/{tenantId}/credentials. Returns metadata only, including revoked credentials. */
702
+ list: (tenantId: string) => Promise<TenantCredentialSummary[]>;
703
+ /** Paginated searchable listing. Prefer this over loading every credential. */
704
+ listPage: (tenantId: string, options?: CredentialListOptions) => Promise<Paged<TenantCredentialSummary>>;
705
+ get: (tenantId: string, credentialId: string) => Promise<CredentialDetail>;
706
+ /** Explicit scopes/permissions; only issuance returns the client secret. */
707
+ create: (tenantId: string, input: CreateTenantCredentialInput | CreateCredentialInput) => Promise<TenantCredentialIssued>;
708
+ /** Returns a new secret once while keeping the same client id. */
709
+ rotate: (tenantId: string, credentialId: string) => Promise<TenantCredentialIssued>;
710
+ updatePermissions: (tenantId: string, credentialId: string, input: CredentialPermissionsInput) => Promise<void>;
711
+ updateScopes: (tenantId: string, credentialId: string, scopes: readonly string[]) => Promise<void>;
712
+ revoke: (tenantId: string, credentialId: string) => Promise<void>;
713
+ };
714
+ /** GET /env/tenants — paginated, searchable list of tenants in the environment. */
715
+ list: (params?: {
716
+ search?: string;
717
+ } & PaginationOptions) => Promise<Paged<Organization>>;
718
+ /** POST /env/tenants — create a tenant in the environment. */
719
+ create: (input: CreateOrganizationInput) => Promise<Organization>;
720
+ /** GET /env/tenants/{tenantId} — fetch a tenant by id. */
721
+ get: (tenantId: string) => Promise<Organization>;
722
+ /** PUT /env/tenants/{tenantId} — update a tenant. */
723
+ update: (tenantId: string, input: UpdateOrganizationInput) => Promise<Organization>;
724
+ /** DELETE /env/tenants/{tenantId} — delete a tenant. */
725
+ delete: (tenantId: string) => Promise<void>;
726
+ members: {
727
+ /**
728
+ * GET /env/tenants/{tenantId}/members — a tenant's members as full
729
+ * user records. Confirmed live: a bare array (unlike
730
+ * `environment.users.list()`, this one does NOT paginate despite
731
+ * accepting `skip`/`take`), with the same shape
732
+ * `environment.users.list()` items have.
733
+ */
734
+ list: (tenantId: string, params?: PaginationOptions) => Promise<EnvironmentUser[]>;
735
+ /** POST /env/tenants/{tenantId}/members — add a member to a tenant. */
736
+ add: (tenantId: string, userId: string, roles?: string[]) => Promise<void>;
737
+ /** DELETE /env/tenants/{tenantId}/members/{userId} — remove a member from a tenant. */
738
+ remove: (tenantId: string, userId: string) => Promise<void>;
739
+ /** POST /env/tenants/{tenantId}/members/{userId}/roles — grant a tenant role to a member. */
740
+ assignRole: (tenantId: string, userId: string, role: string) => Promise<void>;
741
+ /** DELETE .../members/{userId}/roles/{role} — revoke a tenant role from a member. */
742
+ removeRole: (tenantId: string, userId: string, role: string) => Promise<void>;
743
+ /** POST .../members/{userId}/permissions — grant a permission to a tenant member. */
744
+ grantPermission: (tenantId: string, userId: string, permission: string) => Promise<void>;
745
+ /** DELETE .../members/{userId}/permissions/{permission} — revoke a permission from a tenant member. */
746
+ revokePermission: (tenantId: string, userId: string, permission: string) => Promise<void>;
747
+ };
748
+ roles: {
749
+ /** GET /env/tenants/{tenantId}/roles — list a tenant's roles. */
750
+ list: (tenantId: string) => Promise<Role[]>;
751
+ /** POST /env/tenants/{tenantId}/roles — create a tenant role. */
752
+ create: (tenantId: string, input: RoleInput) => Promise<Role>;
753
+ /** GET /env/tenants/{tenantId}/roles/{roleId} — fetch a tenant role by id. */
754
+ get: (tenantId: string, roleId: string) => Promise<Role>;
755
+ /** PUT /env/tenants/{tenantId}/roles/{roleId} — update a tenant role. */
756
+ update: (tenantId: string, roleId: string, input: RoleInput) => Promise<Role>;
757
+ /** DELETE /env/tenants/{tenantId}/roles/{roleId} — delete a tenant role. */
758
+ delete: (tenantId: string, roleId: string) => Promise<void>;
759
+ };
760
+ };
761
+ roles: {
762
+ /** GET /env/roles — environment-level roles, grouped into custom and system-defined. */
763
+ list: () => Promise<RoleList>;
764
+ /** POST /env/roles — create an environment-level role. */
765
+ create: (input: RoleInput) => Promise<Role>;
766
+ /** PUT /env/roles/{roleId} — update an environment-level role. */
767
+ update: (roleId: string, input: RoleInput) => Promise<Role>;
768
+ /** DELETE /env/roles/{roleId} — delete an environment-level role. */
769
+ delete: (roleId: string) => Promise<void>;
770
+ };
771
+ permissions: {
772
+ /** GET /env/permissions — environment-level permissions, grouped by the role they're attached to. */
773
+ list: () => Promise<PermissionsByRole>;
774
+ /** POST /env/permissions — create an environment-level permission. */
775
+ create: (input: CreatePermissionInput) => Promise<Permission>;
776
+ /** PUT /env/permissions/{permissionId} — update an environment-level permission. */
777
+ update: (permissionId: string, description?: string) => Promise<Permission>;
778
+ /** DELETE /env/permissions/{permissionId} — delete an environment-level permission. */
779
+ delete: (permissionId: string) => Promise<void>;
780
+ /** GET /permissions/reserved — reserved permission names you can't redefine. */
781
+ reserved: () => Promise<ReservedPermissions>;
782
+ };
783
+ audit: {
784
+ /** GET /env/audit — paginated list of the environment's audit events. */
785
+ list: (params?: PaginationOptions) => Promise<Paged<AuditEvent>>;
786
+ /** GET /env/audit/login-activity — paginated login activity in the environment. */
787
+ loginActivity: (params?: PaginationOptions) => Promise<Paged<LoginActivity>>;
788
+ };
789
+ };
790
+ readonly permissions: {
791
+ /** POST /users/{userId}/permissions — grant a permission directly to a user. */
792
+ grant: (userId: string, permission: string) => Promise<void>;
793
+ /** DELETE /users/{userId}/permissions/{permission} — revoke a permission from a user. */
794
+ revoke: (userId: string, permission: string) => Promise<void>;
795
+ };
796
+ /** @internal used by {@link TenantScopedClient} to share the base URL/fetch/error handling. */
797
+ _requestAsTenant<T>(accessToken: string, path: string, options?: {
798
+ method?: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
799
+ body?: unknown;
800
+ query?: object;
801
+ headers?: Record<string, string>;
802
+ }): Promise<T>;
803
+ }
804
+ /**
805
+ * Client scoped to a single tenant's OAuth credentials — every call acts on
806
+ * "the token's tenant" (`TenantManagement` endpoints), so there's no
807
+ * `tenantId` parameter to pass.
808
+ */
809
+ declare class TenantScopedClient {
810
+ private readonly server;
811
+ private readonly tokenProvider;
812
+ constructor(server: AuthyonServerClient, credentials: ClientCredentials);
813
+ private getAccessToken;
814
+ private request;
815
+ readonly members: {
816
+ /**
817
+ * GET /tenant/members — members of the token's tenant.
818
+ *
819
+ * ⚠️ Inferred, not confirmed live (no tenant client credentials
820
+ * available to exchange for a scoped token) — assumed to share
821
+ * `/env/tenants/{id}/members`'s confirmed shape (bare array of full
822
+ * user records), since both are the "admin" member listing as opposed
823
+ * to `/auth/tenants/{id}/members`'s paginated, lightweight one.
824
+ */
825
+ list: (params?: PaginationOptions) => Promise<EnvironmentUser[]>;
826
+ /** POST /tenant/members — add a member to the token's tenant. */
827
+ add: (userId: string, roles?: string[]) => Promise<void>;
828
+ /** DELETE /tenant/members/{userId} — remove a member from the token's tenant. */
829
+ remove: (userId: string) => Promise<void>;
830
+ /** POST /tenant/members/{userId}/roles — grant a role to a member of the tenant. */
831
+ assignRole: (userId: string, role: string) => Promise<void>;
832
+ /** DELETE /tenant/members/{userId}/roles/{role} — revoke a role from a member of the tenant. */
833
+ removeRole: (userId: string, role: string) => Promise<void>;
834
+ /** POST /tenant/members/{userId}/permissions — grant a permission to a member of the tenant. */
835
+ grantPermission: (userId: string, permission: string) => Promise<void>;
836
+ /** DELETE .../permissions/{permission} — revoke a permission from a member of the tenant. */
837
+ revokePermission: (userId: string, permission: string) => Promise<void>;
838
+ };
839
+ readonly roles: {
840
+ /**
841
+ * GET /tenant/roles — roles in the token's tenant, grouped into custom
842
+ * and system-defined.
843
+ *
844
+ * ⚠️ Inferred, not confirmed live (the test environment had no tenants
845
+ * to exchange a scoped token for) — assumed to share `/env/roles`'
846
+ * grouped shape, since both operate on the same underlying role model.
847
+ */
848
+ list: () => Promise<RoleList>;
849
+ /** POST /tenant/roles — create a role in the tenant. */
850
+ create: (input: RoleInput) => Promise<Role>;
851
+ /** GET /tenant/roles/{roleId} — fetch a tenant role by id. */
852
+ get: (roleId: string) => Promise<Role>;
853
+ /** PUT /tenant/roles/{roleId} — update a role in the tenant. */
854
+ update: (roleId: string, input: RoleInput) => Promise<Role>;
855
+ /** DELETE /tenant/roles/{roleId} — delete a role in the tenant. */
856
+ delete: (roleId: string) => Promise<void>;
857
+ };
858
+ }
859
+ /** Convenience factory: `const authyon = createClient({ clientId, clientSecret })`. */
860
+ declare function createClient(options?: AuthyonServerClientOptions): AuthyonServerClient;
861
+
862
+ type AbilitySubject = string | Record<string, unknown>;
863
+ type AbilityConditions = Record<string, unknown>;
864
+ interface AbilityRule {
865
+ action: string | string[];
866
+ subject: string | string[];
867
+ inverted?: boolean;
868
+ conditions?: AbilityConditions;
869
+ fields?: string[];
870
+ reason?: string;
871
+ }
872
+ interface AuthyonPermissionSource {
873
+ permissions?: readonly string[] | null;
874
+ roles?: readonly string[] | null;
875
+ /** OAuth scopes are also accepted and interpreted as Authyon permissions. */
876
+ scope?: string | null;
877
+ }
878
+ interface AuthyonAbilityOptions {
879
+ rules?: readonly AbilityRule[];
880
+ /** Rules added when the source contains a matching Authyon role. */
881
+ roleRules?: Readonly<Record<string, readonly AbilityRule[]>>;
882
+ roles?: readonly string[] | null;
883
+ detectSubjectType?: (subject: Record<string, unknown>) => string;
884
+ }
885
+ type AbilityEvent = "updated";
886
+ type AbilityListener = (rules: readonly AbilityRule[]) => void;
887
+ /** Isomorphic, deny-by-default authorization engine backed by Authyon permissions. */
888
+ declare class AuthyonAbility {
889
+ private readonly detectSubjectType;
890
+ private currentRules;
891
+ private readonly listeners;
892
+ constructor(rules?: readonly AbilityRule[], detectSubjectType?: (subject: Record<string, unknown>) => string);
893
+ get rules(): readonly AbilityRule[];
894
+ can(action: string, subject: AbilitySubject, field?: string): boolean;
895
+ cannot(action: string, subject: AbilitySubject, field?: string): boolean;
896
+ rulesFor(action: string, subject: string): readonly AbilityRule[];
897
+ update(rules: readonly AbilityRule[]): void;
898
+ on(event: AbilityEvent, listener: AbilityListener): () => void;
899
+ }
900
+ /** Fluent rule builder with CASL-like `can` and `cannot` methods. */
901
+ declare class AuthyonAbilityBuilder {
902
+ readonly rules: AbilityRule[];
903
+ can(action: string | string[], subject: string | string[], conditions?: AbilityConditions, fields?: string[]): this;
904
+ cannot(action: string | string[], subject: string | string[], conditions?: AbilityConditions, fields?: string[], reason?: string): this;
905
+ build(options?: Pick<AuthyonAbilityOptions, "detectSubjectType">): AuthyonAbility;
906
+ }
907
+ /** Creates an ability from Authyon permissions, OAuth scope and optional role rules. */
908
+ declare function createAuthyonAbility(source?: AuthyonPermissionSource, options?: AuthyonAbilityOptions): AuthyonAbility;
909
+ /** Checks an Authyon permission string using the same wildcard rules as an ability. */
910
+ declare function hasPermission(source: AuthyonPermissionSource | readonly string[], requiredPermission: string): boolean;
911
+ /** Converts Authyon's `subject:action` permission strings to authorization rules. */
912
+ declare function createAuthyonRules(source?: AuthyonPermissionSource, options?: AuthyonAbilityOptions): AbilityRule[];
913
+
914
+ interface AbilityRequirement {
915
+ action: string;
916
+ subject: AbilitySubject;
917
+ field?: string;
918
+ }
919
+ interface AuthorizationContext {
920
+ token: string;
921
+ userId?: string;
922
+ ability: AuthyonAbility;
923
+ permissions: readonly string[];
924
+ roles: readonly string[];
925
+ }
926
+ interface AuthorizationOptions extends AuthyonAbilityOptions {
927
+ requirement?: AbilityRequirement;
928
+ /** Uses database-backed validation by default; introspection can be selected when desired. */
929
+ verification?: "validate" | "introspect" | "jwks";
930
+ /** Required for local JWKS verification. Create once and reuse its key cache. */
931
+ jwksVerifier?: JwksTokenVerifier;
932
+ /** Real end-user IP, obtained from trusted application infrastructure. */
933
+ clientIp?: string;
934
+ }
935
+ declare class AuthorizationError extends Error {
936
+ readonly status: 401 | 403 | 503;
937
+ readonly code: "authorization.unauthenticated" | "authorization.forbidden" | "authorization.unavailable";
938
+ constructor(status: 401 | 403 | 503, code: "authorization.unauthenticated" | "authorization.forbidden" | "authorization.unavailable", message: string);
939
+ }
940
+ /** Validates a bearer token and creates an Authyon-backed ability for server runtimes. */
941
+ declare function authorizeToken(client: AuthyonServerClient, token: string, options?: AuthorizationOptions): Promise<AuthorizationContext>;
942
+ /** Works with Web Request objects used by Next.js Route Handlers and other Fetch runtimes. */
943
+ declare function authorizeRequest(client: AuthyonServerClient, request: Pick<Request, "headers">, options?: RequestAuthorizationOptions): Promise<AuthorizationContext>;
944
+ interface RequestAuthorizationOptions extends AuthorizationOptions {
945
+ /** Platform-aware resolver. Only read headers that your trusted proxy overwrites. */
946
+ resolveClientIp?: (request: Pick<Request, "headers">) => string | undefined;
947
+ }
948
+ interface ExpressRequestLike {
949
+ headers: Record<string, string | string[] | undefined>;
950
+ ip?: string;
951
+ socket?: {
952
+ remoteAddress?: string;
953
+ };
954
+ authyon?: AuthorizationContext;
955
+ }
956
+ interface ExpressResponseLike {
957
+ status(code: number): ExpressResponseLike;
958
+ json(body: unknown): unknown;
959
+ }
960
+ type ExpressNext = (error?: unknown) => void;
961
+ interface ExpressAuthorizationMiddlewareOptions extends AuthorizationOptions {
962
+ /** Property assigned to the request. Defaults to `authyon`. */
963
+ requestProperty?: string;
964
+ /** Pass authorization errors to Express error middleware instead of writing a JSON response. */
965
+ passErrorsToNext?: boolean;
966
+ /** Trust Express's proxy-aware `request.ip`. Disabled by default. */
967
+ trustProxy?: boolean;
968
+ /** Overrides all built-in IP resolution; return only a trusted, single client IP. */
969
+ resolveClientIp?: (request: ExpressRequestLike) => string | undefined;
970
+ }
971
+ /** Dependency-free middleware compatible with Express and similar Connect frameworks. */
972
+ declare function createExpressAuthorizationMiddleware(client: AuthyonServerClient, options?: ExpressAuthorizationMiddlewareOptions): (request: ExpressRequestLike & Record<string, unknown>, response: ExpressResponseLike, next: ExpressNext) => Promise<void>;
973
+ /** Converts an authorization error into a Fetch Response suitable for Next.js. */
974
+ declare function createAuthorizationErrorResponse(error: unknown): Response;
975
+
976
+ export { type Organization as $, AuthyonServerClient as A, type CredentialCreator as B, type ClientCredentials as C, type CredentialDetail as D, type CredentialListOptions as E, type CredentialPermissionsInput as F, type CredentialScope as G, type HttpAdapter as H, type EnvironmentUser as I, type ExpressAuthorizationMiddlewareOptions as J, type ExpressNext as K, type ExpressRequestLike as L, type ExpressResponseLike as M, FetchHttpAdapter as N, type HttpAdapterRequest as O, type HttpLogEvent as P, type HttpLogger as Q, type RequestAuthorizationOptions as R, type IntrospectResult as S, type InviteTenantMemberInput as T, type InviteWorkspaceMemberInput as U, type JsonWebKeySet as V, JwksTokenVerifier as W, type JwksTokenVerifierOptions as X, LoggingHttpAdapter as Y, type LoginActivity as Z, type OpenIdConfiguration as _, type AbilitySubject as a, type Paged as a0, type PaginationOptions as a1, type Permission as a2, type PermissionsByRole as a3, PlatformScopedClient as a4, type ReservedPermissions as a5, type Role as a6, type RoleGrant as a7, type RoleInput as a8, type RoleList as a9, authorizeToken as aA, createAuthorizationErrorResponse as aB, createAuthyonAbility as aC, createAuthyonRules as aD, createClient as aE, createExpressAuthorizationMiddleware as aF, hasPermission as aG, normalizeClientIp as aH, type RolePermissions as aa, type SafeJwtAlgorithm as ab, type TenantCredentialIssued as ac, type TenantCredentialSummary as ad, type TenantManagementScope as ae, type TenantMember as af, type TenantMemberPage as ag, type TenantMembership as ah, TenantScopedClient as ai, type TokenResult as aj, TokenVerificationError as ak, type TokenVerificationErrorCode as al, type UpdateOrganizationInput as am, type User as an, UserScopedClient as ao, type ValidateResult as ap, type VerifiedAccessToken as aq, type WorkspaceInvite as ar, type WorkspaceInviteAccepted as as, type WorkspaceInviteIssued as at, type WorkspaceInvitePreview as au, WorkspaceInvitesClient as av, type WorkspaceMember as aw, type WorkspaceRole as ax, type WorkspaceTeam as ay, authorizeRequest as az, AuthorizationError as b, type HttpLoggerOptions as c, type AbilityConditions as d, type AbilityEvent as e, type AbilityListener as f, type AbilityRequirement as g, type AbilityRule as h, type AcceptWorkspaceInviteInput as i, type AccessTokenSource as j, type AuditEvent as k, type AuthorizationContext as l, type AuthorizationOptions as m, AuthyonAbility as n, AuthyonAbilityBuilder as o, type AuthyonAbilityOptions as p, type AuthyonJwksDiscoveryOptions as q, type AuthyonJwtClaims as r, type AuthyonPermissionSource as s, type AuthyonServerClientOptions as t, type ClientRequestContext as u, type CreateCredentialInput as v, type CreateOrganizationInput as w, type CreatePermissionInput as x, type CreateTenantCredentialInput as y, type CreateUserInput as z };