@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.
package/dist/index.d.cts CHANGED
@@ -1,473 +1,6 @@
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;
1
+ import { H as HttpAdapter, c as HttpLoggerOptions, A as AuthyonServerClient } from './authorization-Cwl7YFEZ.cjs';
2
+ export { d as AbilityConditions, e as AbilityEvent, f as AbilityListener, g as AbilityRequirement, h as AbilityRule, a as AbilitySubject, i as AcceptWorkspaceInviteInput, j as AccessTokenSource, k as AuditEvent, l as AuthorizationContext, b as AuthorizationError, m as AuthorizationOptions, n as AuthyonAbility, o as AuthyonAbilityBuilder, p as AuthyonAbilityOptions, q as AuthyonJwksDiscoveryOptions, r as AuthyonJwtClaims, s as AuthyonPermissionSource, t as AuthyonServerClientOptions, C as ClientCredentials, u as ClientRequestContext, v as CreateCredentialInput, w as CreateOrganizationInput, x as CreatePermissionInput, y as CreateTenantCredentialInput, z as CreateUserInput, B as CredentialCreator, D as CredentialDetail, E as CredentialListOptions, F as CredentialPermissionsInput, G as CredentialScope, I as EnvironmentUser, J as ExpressAuthorizationMiddlewareOptions, K as ExpressNext, L as ExpressRequestLike, M as ExpressResponseLike, N as FetchHttpAdapter, O as HttpAdapterRequest, P as HttpLogEvent, Q as HttpLogger, S as IntrospectResult, T as InviteTenantMemberInput, U as InviteWorkspaceMemberInput, V as JsonWebKeySet, W as JwksTokenVerifier, X as JwksTokenVerifierOptions, Y as LoggingHttpAdapter, Z as LoginActivity, _ as OpenIdConfiguration, $ as Organization, a0 as Paged, a1 as PaginationOptions, a2 as Permission, a3 as PermissionsByRole, a4 as PlatformScopedClient, R as RequestAuthorizationOptions, a5 as ReservedPermissions, a6 as Role, a7 as RoleGrant, a8 as RoleInput, a9 as RoleList, aa as RolePermissions, ab as SafeJwtAlgorithm, ac as TenantCredentialIssued, ad as TenantCredentialSummary, ae as TenantManagementScope, af as TenantMember, ag as TenantMemberPage, ah as TenantMembership, ai as TenantScopedClient, aj as TokenResult, ak as TokenVerificationError, al as TokenVerificationErrorCode, am as UpdateOrganizationInput, an as User, ao as UserScopedClient, ap as ValidateResult, aq as VerifiedAccessToken, ar as WorkspaceInvite, as as WorkspaceInviteAccepted, at as WorkspaceInviteIssued, au as WorkspaceInvitePreview, av as WorkspaceInvitesClient, aw as WorkspaceMember, ax as WorkspaceRole, ay as WorkspaceTeam, az as authorizeRequest, aA as authorizeToken, aB as createAuthorizationErrorResponse, aC as createAuthyonAbility, aD as createAuthyonRules, aE as createClient, aF as createExpressAuthorizationMiddleware, aG as hasPermission, aH as normalizeClientIp } from './authorization-Cwl7YFEZ.cjs';
3
+ import 'jose';
471
4
 
472
5
  declare const ErrorCodes: {
473
6
  readonly Unknown: "unknown";
@@ -521,396 +54,6 @@ declare class AuthyonError extends Error {
521
54
  toJSON(): Record<string, unknown>;
522
55
  }
523
56
 
524
- type HttpMethod = "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
525
- interface JsonRequestOptions {
526
- method?: HttpMethod;
527
- body?: unknown;
528
- query?: QueryParams;
529
- headers?: Record<string, string>;
530
- }
531
-
532
- type ManagementRequest = <T>(path: string, options?: JsonRequestOptions) => Promise<T>;
533
-
534
- /** Platform user administration. Never falls back to an environment machine token. */
535
- declare class PlatformScopedClient {
536
- #private;
537
- /** @hidden */
538
- constructor(request: ManagementRequest, token: AccessTokenSource);
539
- readonly credentials: {
540
- list: (scope: CredentialScope, options?: CredentialListOptions) => Promise<Paged<TenantCredentialSummary>>;
541
- get: (scope: CredentialScope, credentialId: string) => Promise<CredentialDetail>;
542
- create: (scope: CredentialScope, input: CreateCredentialInput) => Promise<TenantCredentialIssued>;
543
- updatePermissions: (scope: CredentialScope, credentialId: string, input: CredentialPermissionsInput) => Promise<void>;
544
- updateScopes: (scope: CredentialScope, credentialId: string, scopes: readonly string[]) => Promise<void>;
545
- /** Returns a new secret once. API may require an explicit step-up first. */
546
- rotate: (scope: CredentialScope, credentialId: string) => Promise<TenantCredentialIssued>;
547
- revoke: (scope: CredentialScope, credentialId: string) => Promise<void>;
548
- };
549
- readonly workspaces: {
550
- team: (workspaceId: string) => Promise<WorkspaceTeam>;
551
- members: {
552
- invite: (workspaceId: string, input: InviteWorkspaceMemberInput) => Promise<WorkspaceInviteIssued>;
553
- /** memberId comes from team.members; it is not the platform userId. */
554
- remove: (workspaceId: string, memberId: string) => Promise<void>;
555
- changeRole: (workspaceId: string, memberId: string, role: WorkspaceRole) => Promise<void>;
556
- };
557
- invites: {
558
- create: (workspaceId: string, input: InviteWorkspaceMemberInput) => Promise<WorkspaceInviteIssued>;
559
- revoke: (workspaceId: string, inviteId: string) => Promise<void>;
560
- };
561
- };
562
- readonly tenants: {
563
- members: {
564
- list: (scope: TenantManagementScope, options?: PaginationOptions) => Promise<EnvironmentUser[]>;
565
- add: (scope: TenantManagementScope, userId: string, roles?: string[]) => Promise<void>;
566
- remove: (scope: TenantManagementScope, userId: string) => Promise<void>;
567
- };
568
- };
569
- readonly auth: {
570
- /** Explicitly confirms the current platform session; passwords are not retained. */
571
- stepUp: (currentPassword: string) => Promise<void>;
572
- };
573
- }
574
- /** End-user operations require a user token and the environment publishable key. */
575
- declare class UserScopedClient {
576
- #private;
577
- /** @hidden */
578
- constructor(request: ManagementRequest, token: AccessTokenSource);
579
- readonly tenants: {
580
- members: {
581
- list: (tenantId: string, options?: PaginationOptions) => Promise<TenantMemberPage>;
582
- /** Adds an existing environment user by email; does not send an invitation email. */
583
- invite: (tenantId: string, input: InviteTenantMemberInput) => Promise<TenantMember>;
584
- remove: (tenantId: string, userId: string) => Promise<void>;
585
- };
586
- };
587
- }
588
- /** Anonymous invite endpoints: the invitation token itself authorizes these requests. */
589
- declare class WorkspaceInvitesClient {
590
- #private;
591
- /** @hidden */
592
- constructor(request: ManagementRequest);
593
- preview(token: string): Promise<WorkspaceInvitePreview>;
594
- accept(token: string, input?: AcceptWorkspaceInviteInput): Promise<WorkspaceInviteAccepted>;
595
- }
596
-
597
- interface ClientRequestContext {
598
- /** Real end-user IP, resolved only from infrastructure trusted by the application. */
599
- clientIp?: string;
600
- }
601
- /** Rejects header injection and values that are not a single IPv4 or IPv6 address. */
602
- declare function normalizeClientIp(value: string): string;
603
-
604
- type SafeJwtAlgorithm = "RS256" | "PS256" | "ES256" | "EdDSA";
605
- interface AuthyonJwtClaims extends JWTPayload {
606
- sub: string;
607
- iss: string;
608
- aud: string | string[];
609
- exp: number;
610
- iat: number;
611
- email?: string;
612
- username?: string;
613
- roles?: string[];
614
- permissions?: string[];
615
- scope?: string;
616
- }
617
- interface VerifiedAccessToken {
618
- claims: AuthyonJwtClaims;
619
- protectedHeader: JWSHeaderParameters;
620
- }
621
- interface JwksTokenVerifierOptions {
622
- /** Exact trusted issuer from Authyon OpenID discovery. */
623
- issuer: string;
624
- /** Audience assigned to the API consuming this token. */
625
- audience: string | string[];
626
- /** Trusted HTTPS JWKS endpoint. Never derive this value from the token header. */
627
- jwksUri?: string;
628
- /** Static trusted keys for pinned or offline verification. */
629
- jwks?: JSONWebKeySet;
630
- algorithms?: readonly SafeJwtAlgorithm[];
631
- acceptedTokenTypes?: readonly string[];
632
- clockToleranceSeconds?: number;
633
- maxTokenAgeSeconds?: number;
634
- jwksTimeoutMs?: number;
635
- jwksCacheMs?: number;
636
- jwksCooldownMs?: number;
637
- }
638
- interface AuthyonJwksDiscoveryOptions extends Omit<JwksTokenVerifierOptions, "issuer" | "jwksUri" | "jwks"> {
639
- /** Optional pin; discovery fails if Authyon advertises a different issuer. */
640
- issuer?: string;
641
- /** Override the client environment key used by the discovery endpoint. */
642
- publishableKey?: string;
643
- }
644
- type TokenVerificationErrorCode = "token.invalid" | "token.expired" | "token.not_active" | "token.invalid_claims" | "token.invalid_signature" | "token.key_unavailable";
645
- declare class TokenVerificationError extends Error {
646
- readonly code: TokenVerificationErrorCode;
647
- constructor(code: TokenVerificationErrorCode, options?: {
648
- cause?: unknown;
649
- });
650
- }
651
- /** Secure, cached JWT signature and claims verifier backed by a trusted remote JWKS. */
652
- declare class JwksTokenVerifier {
653
- private readonly options;
654
- private readonly verifyKey;
655
- private readonly algorithms;
656
- private readonly acceptedTokenTypes;
657
- constructor(options: JwksTokenVerifierOptions);
658
- verifyAccessToken(token: string): Promise<VerifiedAccessToken>;
659
- }
660
-
661
- /**
662
- * Server-side Authyon client: environment/tenant administration (OAuth
663
- * client-credentials) plus access-token verification (publishable key).
664
- * Never import this in browser code — client secrets must stay on your
665
- * server.
666
- */
667
- declare class AuthyonServerClient {
668
- #private;
669
- private readonly envKey?;
670
- private readonly clientId?;
671
- private readonly transport;
672
- private readonly http;
673
- private readonly environmentTokenProvider;
674
- constructor(options?: AuthyonServerClientOptions);
675
- private request;
676
- /** Mints (and caches) an environment access token from `clientId`/`clientSecret`. */
677
- private getEnvironmentAccessToken;
678
- readonly discovery: {
679
- /** GET /.well-known/jwks.json — the environment's public signing keys. */
680
- jwks: (publishableKey?: string) => Promise<JsonWebKeySet>;
681
- /** GET /.well-known/openid-configuration — OIDC discovery document. */
682
- openidConfiguration: (publishableKey?: string) => Promise<OpenIdConfiguration>;
683
- };
684
- /** Discovers Authyon's trusted issuer/JWKS and creates a cached local access-token verifier. */
685
- createJwksTokenVerifier(options: AuthyonJwksDiscoveryOptions): Promise<JwksTokenVerifier>;
686
- /** POST /auth/introspect — lightweight token introspection (RFC 7662). */
687
- introspect(token: string, context?: ClientRequestContext): Promise<IntrospectResult>;
688
- /** POST /auth/validate — recommended: cross-checks DB state, catches revocation immediately. */
689
- validate(token: string, context?: ClientRequestContext): Promise<ValidateResult>;
690
- readonly environmentAuth: {
691
- /** POST /env/oauth/token — exchanges environment client credentials for an access token. */
692
- token: (credentials: ClientCredentials) => Promise<TokenResult>;
693
- };
694
- readonly tenantAuth: {
695
- /** POST /tenant/oauth/token — exchanges a tenant's client credentials for a scoped access token. */
696
- token: (credentials: ClientCredentials) => Promise<TokenResult>;
697
- };
698
- /**
699
- * Scopes a client to a single tenant's OAuth credentials — mints and
700
- * caches its access token independently of the environment plane. Use
701
- * this for the `TenantManagement` endpoints (`/tenant/...`), which act on
702
- * "the token's tenant" rather than one you pass by id.
703
- */
704
- tenant(credentials: ClientCredentials): TenantScopedClient;
705
- /** Uses only the supplied platform-user access token. */
706
- platform(token: AccessTokenSource): PlatformScopedClient;
707
- /** Uses an end-user token; the configured environment key selects the environment. */
708
- user(token: AccessTokenSource): UserScopedClient;
709
- readonly workspaceInvites: WorkspaceInvitesClient;
710
- readonly environment: {
711
- users: {
712
- /** GET /env/users — paginated list of users in the environment. */
713
- list: (params?: {
714
- search?: string;
715
- } & PaginationOptions) => Promise<Paged<EnvironmentUser>>;
716
- /** POST /env/users — create a user in the environment; returns only the new id. */
717
- create: (input: CreateUserInput) => Promise<{
718
- id: string;
719
- }>;
720
- /** GET /env/users/{userId} — fetch an environment user by id. */
721
- get: (userId: string) => Promise<EnvironmentUser>;
722
- /** POST /env/users/{userId}/roles — grant a role to an environment user. */
723
- assignRole: (userId: string, role: string) => Promise<void>;
724
- /** DELETE /env/users/{userId}/roles/{role} — revoke a role from an environment user. */
725
- removeRole: (userId: string, role: string) => Promise<void>;
726
- /** POST /env/users/{userId}/permissions — grant a direct permission to an environment user. */
727
- grantPermission: (userId: string, permission: string) => Promise<void>;
728
- /** DELETE /env/users/{userId}/permissions/{permission} — revoke a direct permission. */
729
- revokePermission: (userId: string, permission: string) => Promise<void>;
730
- /** POST /env/users/{userId}/unlock — clears an environment user's lockout. */
731
- unlock: (userId: string, reason?: string) => Promise<void>;
732
- /** POST /env/users/{userId}/password — sets a new password for the user. */
733
- setPassword: (userId: string, newPassword: string, reason?: string) => Promise<void>;
734
- /** POST /env/users/{userId}/sessions/revoke-all — revokes every session the user has. */
735
- revokeSessions: (userId: string, reason?: string) => Promise<void>;
736
- /** DELETE /env/users/{userId}/sessions/{sessionId} — revokes a single session. */
737
- revokeSession: (userId: string, sessionId: string, reason?: string) => Promise<void>;
738
- /** POST /env/users/{userId}/disable — bans the user indefinitely; revokes live sessions. */
739
- disable: (userId: string, reason?: string) => Promise<void>;
740
- /** POST /env/users/{userId}/enable — lifts a ban. */
741
- enable: (userId: string, reason?: string) => Promise<void>;
742
- /** POST /env/users/{userId}/suspend — blocks the user temporarily; clears itself after `durationMinutes`. */
743
- suspend: (userId: string, durationMinutes: number, reason?: string) => Promise<void>;
744
- /** POST /env/users/{userId}/unsuspend — lifts a suspension early. */
745
- unsuspend: (userId: string, reason?: string) => Promise<void>;
746
- /** POST /env/users/{userId}/tenants — adds an environment user to a tenant. */
747
- assignTenant: (userId: string, tenantId: string, roles?: string[]) => Promise<void>;
748
- /** DELETE /env/users/{userId}/tenants/{tenantId} — removes an environment user from a tenant. */
749
- removeTenant: (userId: string, tenantId: string) => Promise<void>;
750
- };
751
- tenants: {
752
- credentials: {
753
- /** GET /env/tenants/{tenantId}/credentials. Returns metadata only, including revoked credentials. */
754
- list: (tenantId: string) => Promise<TenantCredentialSummary[]>;
755
- /** Paginated searchable listing. Prefer this over loading every credential. */
756
- listPage: (tenantId: string, options?: CredentialListOptions) => Promise<Paged<TenantCredentialSummary>>;
757
- get: (tenantId: string, credentialId: string) => Promise<CredentialDetail>;
758
- /** Explicit scopes/permissions; only issuance returns the client secret. */
759
- create: (tenantId: string, input: CreateTenantCredentialInput | CreateCredentialInput) => Promise<TenantCredentialIssued>;
760
- /** Returns a new secret once while keeping the same client id. */
761
- rotate: (tenantId: string, credentialId: string) => Promise<TenantCredentialIssued>;
762
- updatePermissions: (tenantId: string, credentialId: string, input: CredentialPermissionsInput) => Promise<void>;
763
- updateScopes: (tenantId: string, credentialId: string, scopes: readonly string[]) => Promise<void>;
764
- revoke: (tenantId: string, credentialId: string) => Promise<void>;
765
- };
766
- /** GET /env/tenants — paginated, searchable list of tenants in the environment. */
767
- list: (params?: {
768
- search?: string;
769
- } & PaginationOptions) => Promise<Paged<Organization>>;
770
- /** POST /env/tenants — create a tenant in the environment. */
771
- create: (input: CreateOrganizationInput) => Promise<Organization>;
772
- /** GET /env/tenants/{tenantId} — fetch a tenant by id. */
773
- get: (tenantId: string) => Promise<Organization>;
774
- /** PUT /env/tenants/{tenantId} — update a tenant. */
775
- update: (tenantId: string, input: UpdateOrganizationInput) => Promise<Organization>;
776
- /** DELETE /env/tenants/{tenantId} — delete a tenant. */
777
- delete: (tenantId: string) => Promise<void>;
778
- members: {
779
- /**
780
- * GET /env/tenants/{tenantId}/members — a tenant's members as full
781
- * user records. Confirmed live: a bare array (unlike
782
- * `environment.users.list()`, this one does NOT paginate despite
783
- * accepting `skip`/`take`), with the same shape
784
- * `environment.users.list()` items have.
785
- */
786
- list: (tenantId: string, params?: PaginationOptions) => Promise<EnvironmentUser[]>;
787
- /** POST /env/tenants/{tenantId}/members — add a member to a tenant. */
788
- add: (tenantId: string, userId: string, roles?: string[]) => Promise<void>;
789
- /** DELETE /env/tenants/{tenantId}/members/{userId} — remove a member from a tenant. */
790
- remove: (tenantId: string, userId: string) => Promise<void>;
791
- /** POST /env/tenants/{tenantId}/members/{userId}/roles — grant a tenant role to a member. */
792
- assignRole: (tenantId: string, userId: string, role: string) => Promise<void>;
793
- /** DELETE .../members/{userId}/roles/{role} — revoke a tenant role from a member. */
794
- removeRole: (tenantId: string, userId: string, role: string) => Promise<void>;
795
- /** POST .../members/{userId}/permissions — grant a permission to a tenant member. */
796
- grantPermission: (tenantId: string, userId: string, permission: string) => Promise<void>;
797
- /** DELETE .../members/{userId}/permissions/{permission} — revoke a permission from a tenant member. */
798
- revokePermission: (tenantId: string, userId: string, permission: string) => Promise<void>;
799
- };
800
- roles: {
801
- /** GET /env/tenants/{tenantId}/roles — list a tenant's roles. */
802
- list: (tenantId: string) => Promise<Role[]>;
803
- /** POST /env/tenants/{tenantId}/roles — create a tenant role. */
804
- create: (tenantId: string, input: RoleInput) => Promise<Role>;
805
- /** GET /env/tenants/{tenantId}/roles/{roleId} — fetch a tenant role by id. */
806
- get: (tenantId: string, roleId: string) => Promise<Role>;
807
- /** PUT /env/tenants/{tenantId}/roles/{roleId} — update a tenant role. */
808
- update: (tenantId: string, roleId: string, input: RoleInput) => Promise<Role>;
809
- /** DELETE /env/tenants/{tenantId}/roles/{roleId} — delete a tenant role. */
810
- delete: (tenantId: string, roleId: string) => Promise<void>;
811
- };
812
- };
813
- roles: {
814
- /** GET /env/roles — environment-level roles, grouped into custom and system-defined. */
815
- list: () => Promise<RoleList>;
816
- /** POST /env/roles — create an environment-level role. */
817
- create: (input: RoleInput) => Promise<Role>;
818
- /** PUT /env/roles/{roleId} — update an environment-level role. */
819
- update: (roleId: string, input: RoleInput) => Promise<Role>;
820
- /** DELETE /env/roles/{roleId} — delete an environment-level role. */
821
- delete: (roleId: string) => Promise<void>;
822
- };
823
- permissions: {
824
- /** GET /env/permissions — environment-level permissions, grouped by the role they're attached to. */
825
- list: () => Promise<PermissionsByRole>;
826
- /** POST /env/permissions — create an environment-level permission. */
827
- create: (input: CreatePermissionInput) => Promise<Permission>;
828
- /** PUT /env/permissions/{permissionId} — update an environment-level permission. */
829
- update: (permissionId: string, description?: string) => Promise<Permission>;
830
- /** DELETE /env/permissions/{permissionId} — delete an environment-level permission. */
831
- delete: (permissionId: string) => Promise<void>;
832
- /** GET /permissions/reserved — reserved permission names you can't redefine. */
833
- reserved: () => Promise<ReservedPermissions>;
834
- };
835
- audit: {
836
- /** GET /env/audit — paginated list of the environment's audit events. */
837
- list: (params?: PaginationOptions) => Promise<Paged<AuditEvent>>;
838
- /** GET /env/audit/login-activity — paginated login activity in the environment. */
839
- loginActivity: (params?: PaginationOptions) => Promise<Paged<LoginActivity>>;
840
- };
841
- };
842
- readonly permissions: {
843
- /** POST /users/{userId}/permissions — grant a permission directly to a user. */
844
- grant: (userId: string, permission: string) => Promise<void>;
845
- /** DELETE /users/{userId}/permissions/{permission} — revoke a permission from a user. */
846
- revoke: (userId: string, permission: string) => Promise<void>;
847
- };
848
- /** @internal used by {@link TenantScopedClient} to share the base URL/fetch/error handling. */
849
- _requestAsTenant<T>(accessToken: string, path: string, options?: {
850
- method?: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
851
- body?: unknown;
852
- query?: object;
853
- headers?: Record<string, string>;
854
- }): Promise<T>;
855
- }
856
- /**
857
- * Client scoped to a single tenant's OAuth credentials — every call acts on
858
- * "the token's tenant" (`TenantManagement` endpoints), so there's no
859
- * `tenantId` parameter to pass.
860
- */
861
- declare class TenantScopedClient {
862
- private readonly server;
863
- private readonly tokenProvider;
864
- constructor(server: AuthyonServerClient, credentials: ClientCredentials);
865
- private getAccessToken;
866
- private request;
867
- readonly members: {
868
- /**
869
- * GET /tenant/members — members of the token's tenant.
870
- *
871
- * ⚠️ Inferred, not confirmed live (no tenant client credentials
872
- * available to exchange for a scoped token) — assumed to share
873
- * `/env/tenants/{id}/members`'s confirmed shape (bare array of full
874
- * user records), since both are the "admin" member listing as opposed
875
- * to `/auth/tenants/{id}/members`'s paginated, lightweight one.
876
- */
877
- list: (params?: PaginationOptions) => Promise<EnvironmentUser[]>;
878
- /** POST /tenant/members — add a member to the token's tenant. */
879
- add: (userId: string, roles?: string[]) => Promise<void>;
880
- /** DELETE /tenant/members/{userId} — remove a member from the token's tenant. */
881
- remove: (userId: string) => Promise<void>;
882
- /** POST /tenant/members/{userId}/roles — grant a role to a member of the tenant. */
883
- assignRole: (userId: string, role: string) => Promise<void>;
884
- /** DELETE /tenant/members/{userId}/roles/{role} — revoke a role from a member of the tenant. */
885
- removeRole: (userId: string, role: string) => Promise<void>;
886
- /** POST /tenant/members/{userId}/permissions — grant a permission to a member of the tenant. */
887
- grantPermission: (userId: string, permission: string) => Promise<void>;
888
- /** DELETE .../permissions/{permission} — revoke a permission from a member of the tenant. */
889
- revokePermission: (userId: string, permission: string) => Promise<void>;
890
- };
891
- readonly roles: {
892
- /**
893
- * GET /tenant/roles — roles in the token's tenant, grouped into custom
894
- * and system-defined.
895
- *
896
- * ⚠️ Inferred, not confirmed live (the test environment had no tenants
897
- * to exchange a scoped token for) — assumed to share `/env/roles`'
898
- * grouped shape, since both operate on the same underlying role model.
899
- */
900
- list: () => Promise<RoleList>;
901
- /** POST /tenant/roles — create a role in the tenant. */
902
- create: (input: RoleInput) => Promise<Role>;
903
- /** GET /tenant/roles/{roleId} — fetch a tenant role by id. */
904
- get: (roleId: string) => Promise<Role>;
905
- /** PUT /tenant/roles/{roleId} — update a role in the tenant. */
906
- update: (roleId: string, input: RoleInput) => Promise<Role>;
907
- /** DELETE /tenant/roles/{roleId} — delete a role in the tenant. */
908
- delete: (roleId: string) => Promise<void>;
909
- };
910
- }
911
- /** Convenience factory: `const authyon = createClient({ clientId, clientSecret })`. */
912
- declare function createClient(options?: AuthyonServerClientOptions): AuthyonServerClient;
913
-
914
57
  /** Builds a server client while keeping environment credentials grouped. */
915
58
  declare class AuthyonServerClientBuilder {
916
59
  #private;
@@ -923,118 +66,4 @@ declare class AuthyonServerClientBuilder {
923
66
  build(): AuthyonServerClient;
924
67
  }
925
68
 
926
- type AbilitySubject = string | Record<string, unknown>;
927
- type AbilityConditions = Record<string, unknown>;
928
- interface AbilityRule {
929
- action: string | string[];
930
- subject: string | string[];
931
- inverted?: boolean;
932
- conditions?: AbilityConditions;
933
- fields?: string[];
934
- reason?: string;
935
- }
936
- interface AuthyonPermissionSource {
937
- permissions?: readonly string[] | null;
938
- roles?: readonly string[] | null;
939
- /** OAuth scopes are also accepted and interpreted as Authyon permissions. */
940
- scope?: string | null;
941
- }
942
- interface AuthyonAbilityOptions {
943
- rules?: readonly AbilityRule[];
944
- /** Rules added when the source contains a matching Authyon role. */
945
- roleRules?: Readonly<Record<string, readonly AbilityRule[]>>;
946
- roles?: readonly string[] | null;
947
- detectSubjectType?: (subject: Record<string, unknown>) => string;
948
- }
949
- type AbilityEvent = "updated";
950
- type AbilityListener = (rules: readonly AbilityRule[]) => void;
951
- /** Isomorphic, deny-by-default authorization engine backed by Authyon permissions. */
952
- declare class AuthyonAbility {
953
- private readonly detectSubjectType;
954
- private currentRules;
955
- private readonly listeners;
956
- constructor(rules?: readonly AbilityRule[], detectSubjectType?: (subject: Record<string, unknown>) => string);
957
- get rules(): readonly AbilityRule[];
958
- can(action: string, subject: AbilitySubject, field?: string): boolean;
959
- cannot(action: string, subject: AbilitySubject, field?: string): boolean;
960
- rulesFor(action: string, subject: string): readonly AbilityRule[];
961
- update(rules: readonly AbilityRule[]): void;
962
- on(event: AbilityEvent, listener: AbilityListener): () => void;
963
- }
964
- /** Fluent rule builder with CASL-like `can` and `cannot` methods. */
965
- declare class AuthyonAbilityBuilder {
966
- readonly rules: AbilityRule[];
967
- can(action: string | string[], subject: string | string[], conditions?: AbilityConditions, fields?: string[]): this;
968
- cannot(action: string | string[], subject: string | string[], conditions?: AbilityConditions, fields?: string[], reason?: string): this;
969
- build(options?: Pick<AuthyonAbilityOptions, "detectSubjectType">): AuthyonAbility;
970
- }
971
- /** Creates an ability from Authyon permissions, OAuth scope and optional role rules. */
972
- declare function createAuthyonAbility(source?: AuthyonPermissionSource, options?: AuthyonAbilityOptions): AuthyonAbility;
973
- /** Checks an Authyon permission string using the same wildcard rules as an ability. */
974
- declare function hasPermission(source: AuthyonPermissionSource | readonly string[], requiredPermission: string): boolean;
975
- /** Converts Authyon's `subject:action` permission strings to authorization rules. */
976
- declare function createAuthyonRules(source?: AuthyonPermissionSource, options?: AuthyonAbilityOptions): AbilityRule[];
977
-
978
- interface AbilityRequirement {
979
- action: string;
980
- subject: AbilitySubject;
981
- field?: string;
982
- }
983
- interface AuthorizationContext {
984
- token: string;
985
- userId?: string;
986
- ability: AuthyonAbility;
987
- permissions: readonly string[];
988
- roles: readonly string[];
989
- }
990
- interface AuthorizationOptions extends AuthyonAbilityOptions {
991
- requirement?: AbilityRequirement;
992
- /** Uses database-backed validation by default; introspection can be selected when desired. */
993
- verification?: "validate" | "introspect" | "jwks";
994
- /** Required for local JWKS verification. Create once and reuse its key cache. */
995
- jwksVerifier?: JwksTokenVerifier;
996
- /** Real end-user IP, obtained from trusted application infrastructure. */
997
- clientIp?: string;
998
- }
999
- declare class AuthorizationError extends Error {
1000
- readonly status: 401 | 403 | 503;
1001
- readonly code: "authorization.unauthenticated" | "authorization.forbidden" | "authorization.unavailable";
1002
- constructor(status: 401 | 403 | 503, code: "authorization.unauthenticated" | "authorization.forbidden" | "authorization.unavailable", message: string);
1003
- }
1004
- /** Validates a bearer token and creates an Authyon-backed ability for server runtimes. */
1005
- declare function authorizeToken(client: AuthyonServerClient, token: string, options?: AuthorizationOptions): Promise<AuthorizationContext>;
1006
- /** Works with Web Request objects used by Next.js Route Handlers and other Fetch runtimes. */
1007
- declare function authorizeRequest(client: AuthyonServerClient, request: Pick<Request, "headers">, options?: RequestAuthorizationOptions): Promise<AuthorizationContext>;
1008
- interface RequestAuthorizationOptions extends AuthorizationOptions {
1009
- /** Platform-aware resolver. Only read headers that your trusted proxy overwrites. */
1010
- resolveClientIp?: (request: Pick<Request, "headers">) => string | undefined;
1011
- }
1012
- interface ExpressRequestLike {
1013
- headers: Record<string, string | string[] | undefined>;
1014
- ip?: string;
1015
- socket?: {
1016
- remoteAddress?: string;
1017
- };
1018
- authyon?: AuthorizationContext;
1019
- }
1020
- interface ExpressResponseLike {
1021
- status(code: number): ExpressResponseLike;
1022
- json(body: unknown): unknown;
1023
- }
1024
- type ExpressNext = (error?: unknown) => void;
1025
- interface ExpressAuthorizationMiddlewareOptions extends AuthorizationOptions {
1026
- /** Property assigned to the request. Defaults to `authyon`. */
1027
- requestProperty?: string;
1028
- /** Pass authorization errors to Express error middleware instead of writing a JSON response. */
1029
- passErrorsToNext?: boolean;
1030
- /** Trust Express's proxy-aware `request.ip`. Disabled by default. */
1031
- trustProxy?: boolean;
1032
- /** Overrides all built-in IP resolution; return only a trusted, single client IP. */
1033
- resolveClientIp?: (request: ExpressRequestLike) => string | undefined;
1034
- }
1035
- /** Dependency-free middleware compatible with Express and similar Connect frameworks. */
1036
- declare function createExpressAuthorizationMiddleware(client: AuthyonServerClient, options?: ExpressAuthorizationMiddlewareOptions): (request: ExpressRequestLike & Record<string, unknown>, response: ExpressResponseLike, next: ExpressNext) => Promise<void>;
1037
- /** Converts an authorization error into a Fetch Response suitable for Next.js. */
1038
- declare function createAuthorizationErrorResponse(error: unknown): Response;
1039
-
1040
- export { type AbilityConditions, type AbilityEvent, type AbilityListener, type AbilityRequirement, type AbilityRule, type AbilitySubject, type AcceptWorkspaceInviteInput, type AccessTokenSource, type AuditEvent, type AuthorizationContext, AuthorizationError, type AuthorizationOptions, AuthyonAbility, AuthyonAbilityBuilder, type AuthyonAbilityOptions, AuthyonError, type AuthyonErrorAction, type AuthyonErrorCategory, type AuthyonErrorInterpretation, type AuthyonJwksDiscoveryOptions, type AuthyonJwtClaims, type AuthyonPermissionSource, AuthyonServerClient, AuthyonServerClientBuilder, type AuthyonServerClientOptions, type ClientCredentials, type ClientRequestContext, type CreateCredentialInput, type CreateOrganizationInput, type CreatePermissionInput, type CreateTenantCredentialInput, type CreateUserInput, type CredentialCreator, type CredentialDetail, type CredentialListOptions, type CredentialPermissionsInput, type CredentialScope, type EnvironmentUser, ErrorCodes, type ExpressAuthorizationMiddlewareOptions, type ExpressNext, type ExpressRequestLike, type ExpressResponseLike, FetchHttpAdapter, type HttpAdapter, type HttpAdapterRequest, type HttpLogEvent, type HttpLogger, type HttpLoggerOptions, type IntrospectResult, type InviteTenantMemberInput, type InviteWorkspaceMemberInput, type JsonWebKeySet, JwksTokenVerifier, type JwksTokenVerifierOptions, type KnownErrorCode, LoggingHttpAdapter, type LoginActivity, type OpenIdConfiguration, type Organization, type Paged, type PaginationOptions, type Permission, type PermissionsByRole, PlatformScopedClient, type RequestAuthorizationOptions, type ReservedPermissions, type Role, type RoleGrant, type RoleInput, type RoleList, type RolePermissions, type SafeJwtAlgorithm, type TenantCredentialIssued, type TenantCredentialSummary, type TenantManagementScope, type TenantMember, type TenantMemberPage, type TenantMembership, TenantScopedClient, type TokenResult, TokenVerificationError, type TokenVerificationErrorCode, type UpdateOrganizationInput, type User, UserScopedClient, type ValidateResult, type VerifiedAccessToken, type WorkspaceInvite, type WorkspaceInviteAccepted, type WorkspaceInviteIssued, type WorkspaceInvitePreview, WorkspaceInvitesClient, type WorkspaceMember, type WorkspaceRole, type WorkspaceTeam, authorizeRequest, authorizeToken, createAuthorizationErrorResponse, createAuthyonAbility, createAuthyonRules, createClient, createExpressAuthorizationMiddleware, hasPermission, normalizeClientIp };
69
+ export { AuthyonError, type AuthyonErrorAction, type AuthyonErrorCategory, type AuthyonErrorInterpretation, AuthyonServerClient, AuthyonServerClientBuilder, ErrorCodes, HttpAdapter, HttpLoggerOptions, type KnownErrorCode };