@authyon/server 0.2.0-beta.26 → 0.2.0-beta.27

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -483,7 +483,15 @@ const invite = await authyon.environment.tenants.invites.create(tenantId, {
483
483
  });
484
484
  invite.acceptUrl; // só aparece aqui — a API guarda apenas o hash do token
485
485
 
486
- await authyon.environment.tenants.invites.list(tenantId);
486
+ // Paginado, sempre do mais recente para o mais antigo. `search` procura no
487
+ // e-mail; `status` aceita pending, accepted, revoked e expired.
488
+ const page = await authyon.environment.tenants.invites.list(tenantId, {
489
+ search: "acme.com",
490
+ status: ["pending", "expired"],
491
+ take: 25,
492
+ });
493
+ page.data; // TenantInvite[]
494
+ page.total; // total com os filtros aplicados
487
495
  await authyon.environment.tenants.invites.resend(tenantId, invite.id, { sendEmail: true });
488
496
  await authyon.environment.tenants.invites.revoke(tenantId, invite.id);
489
497
 
@@ -1,4 +1,4 @@
1
- import { J as JwksTokenVerifier, A as AuthyonServerClient } from './authyonServerClient-6ezHxvwa.cjs';
1
+ import { J as JwksTokenVerifier, A as AuthyonServerClient } from './authyonServerClient-D7mSUfe5.cjs';
2
2
 
3
3
  type AbilitySubject = string | Record<string, unknown>;
4
4
  type AbilityConditions = Record<string, unknown>;
@@ -1,4 +1,4 @@
1
- import { J as JwksTokenVerifier, A as AuthyonServerClient } from './authyonServerClient-6ezHxvwa.js';
1
+ import { J as JwksTokenVerifier, A as AuthyonServerClient } from './authyonServerClient-D7mSUfe5.js';
2
2
 
3
3
  type AbilitySubject = string | Record<string, unknown>;
4
4
  type AbilityConditions = Record<string, unknown>;
@@ -746,6 +746,15 @@ interface TenantInviteIssued {
746
746
  redirectUri: string | null;
747
747
  }
748
748
  type TenantInviteStatus = "pending" | "accepted" | "revoked" | "expired";
749
+ /**
750
+ * Options for an invite listing. The API always orders newest first.
751
+ * `status` keeps only invites in any of the given states; omitted, every state.
752
+ */
753
+ interface TenantInviteListOptions extends PaginationOptions {
754
+ /** Case-insensitive substring of the invited address. */
755
+ search?: string;
756
+ status?: TenantInviteStatus[];
757
+ }
749
758
  interface TenantInvite {
750
759
  id: string;
751
760
  tenantId: string;
@@ -1332,8 +1341,13 @@ declare class AuthyonServerClient {
1332
1341
  * credential's `authyon:users:write` scope (listing, `authyon:tenants:read`).
1333
1342
  */
1334
1343
  invites: {
1335
- /** GET /env/tenants/{tenantId}/invites — every invite with its status, newest first. */
1336
- list: (tenantId: string) => Promise<TenantInvite[]>;
1344
+ /**
1345
+ * GET /env/tenants/{tenantId}/invites — one page of the tenant's
1346
+ * invites, newest first, optionally narrowed by address (`search`)
1347
+ * and by `status`. Up to 0.2.0-beta.26 this returned every invite as
1348
+ * a plain array.
1349
+ */
1350
+ list: (tenantId: string, options?: TenantInviteListOptions) => Promise<Paged<TenantInvite>>;
1337
1351
  /**
1338
1352
  * POST /env/tenants/{tenantId}/invites — invite an address. Always
1339
1353
  * returns `acceptUrl`; with `sendEmail: false` Authyon does not mail
@@ -1468,8 +1482,12 @@ declare class TenantScopedClient {
1468
1482
  validate(context?: ClientRequestContext): Promise<TenantClientValidationResult>;
1469
1483
  /** Invites to the token's tenant, by e-mail or by link. */
1470
1484
  readonly invites: {
1471
- /** GET /tenant/invites — every invite with its status, newest first. */
1472
- list: () => Promise<TenantInvite[]>;
1485
+ /**
1486
+ * GET /tenant/invites — one page of the tenant's invites, newest first,
1487
+ * optionally narrowed by address (`search`) and by `status`. Up to
1488
+ * 0.2.0-beta.26 this returned every invite as a plain array.
1489
+ */
1490
+ list: (options?: TenantInviteListOptions) => Promise<Paged<TenantInvite>>;
1473
1491
  /** POST /tenant/invites — always returns `acceptUrl`; `sendEmail: false` skips the e-mail. */
1474
1492
  create: (input: TenantInviteInput) => Promise<TenantInviteIssued>;
1475
1493
  /** POST /tenant/invites/{inviteId}/resend — new link (the previous one stops working), mailed unless `sendEmail` is `false`. */
@@ -1525,4 +1543,4 @@ declare class TenantScopedClient {
1525
1543
  /** Convenience factory: `const authyon = createClient({ clientId, clientSecret })`. */
1526
1544
  declare function createClient(options?: AuthyonServerClientOptions): AuthyonServerClient;
1527
1545
 
1528
- export { type ReservedPermissions as $, AuthyonServerClient as A, type CredentialPermissionsInput as B, CLIENT_IP_HEADER as C, type HttpAdapterRequest as D, type EnvironmentUser as E, FetchHttpAdapter as F, type HttpLogEvent as G, type HttpAdapter as H, type HttpLogger as I, JwksTokenVerifier as J, type IntrospectResult as K, type InviteTenantMemberInput as L, type IssuePasswordResetInput as M, type JsonWebKeySet as N, type JwksTokenVerifierOptions as O, LoggingHttpAdapter as P, type LoginActivity as Q, type OpenIdConfiguration as R, type Organization as S, type OtpCheckResult as T, type Paged as U, type PaginationOptions as V, type PasswordResetCompleted as W, type PasswordResetIssued as X, type PasswordResetPreview as Y, type Permission as Z, type PermissionsByRole as _, type HttpLoggerOptions as a, type Role as a0, type RoleGrant as a1, type RoleInput as a2, type RoleList as a3, type RolePermissions as a4, type SafeJwtAlgorithm as a5, type SecurityMethods as a6, type SubjectApprovals as a7, type SubjectSecurity as a8, TENANT_FILTER_MAX_DEPTH as a9, type ValidateResult as aA, type VerifiedAccessToken as aB, createClient as aC, normalizeClientIp as aD, tenantFilter as aE, TENANT_FILTER_MAX_VALUES as aa, TENANT_FILTER_MAX_VALUE_LENGTH as ab, type TenantAncestor as ac, type TenantClientValidationResult as ad, type TenantCredentialIssued as ae, type TenantCredentialSummary as af, type TenantFilterExpression as ag, type TenantFilterValue as ah, type TenantInvite as ai, type TenantInviteAccepted as aj, type TenantInviteInput as ak, type TenantInviteIssued as al, type TenantInvitePreview as am, type TenantInviteStatus as an, type TenantListOptions as ao, type TenantMember as ap, type TenantMemberPage as aq, type TenantMembership as ar, type TenantOrderField as as, TenantScopedClient as at, type TokenResult as au, TokenVerificationError as av, type TokenVerificationErrorCode as aw, type UpdateOrganizationInput as ax, type User as ay, UserScopedClient as az, type AcceptTenantInviteInput as b, type AccessTokenSource as c, type Approval as d, type ApprovalAssurance as e, type ApprovalPayload as f, type ApprovalStatus as g, type ApprovalWebAuthnOptions as h, type AuditEvent as i, type AuthyonJwksDiscoveryOptions as j, type AuthyonJwtClaims as k, type AuthyonServerClientOptions as l, type AuthyonTenantClaim as m, type ClientCredentials as n, type ClientRequestContext as o, type ConfirmApprovalInput as p, type ConsumedApproval as q, type CreateApprovalInput as r, type CreateCredentialInput as s, type CreateOrganizationInput as t, type CreatePermissionInput as u, type CreateTenantCredentialInput as v, type CreateUserInput as w, type CredentialCreator as x, type CredentialDetail as y, type CredentialListOptions as z };
1546
+ export { type ReservedPermissions as $, AuthyonServerClient as A, type CredentialPermissionsInput as B, CLIENT_IP_HEADER as C, type HttpAdapterRequest as D, type EnvironmentUser as E, FetchHttpAdapter as F, type HttpLogEvent as G, type HttpAdapter as H, type HttpLogger as I, JwksTokenVerifier as J, type IntrospectResult as K, type InviteTenantMemberInput as L, type IssuePasswordResetInput as M, type JsonWebKeySet as N, type JwksTokenVerifierOptions as O, LoggingHttpAdapter as P, type LoginActivity as Q, type OpenIdConfiguration as R, type Organization as S, type OtpCheckResult as T, type Paged as U, type PaginationOptions as V, type PasswordResetCompleted as W, type PasswordResetIssued as X, type PasswordResetPreview as Y, type Permission as Z, type PermissionsByRole as _, type HttpLoggerOptions as a, type Role as a0, type RoleGrant as a1, type RoleInput as a2, type RoleList as a3, type RolePermissions as a4, type SafeJwtAlgorithm as a5, type SecurityMethods as a6, type SubjectApprovals as a7, type SubjectSecurity as a8, TENANT_FILTER_MAX_DEPTH as a9, UserScopedClient as aA, type ValidateResult as aB, type VerifiedAccessToken as aC, createClient as aD, normalizeClientIp as aE, tenantFilter as aF, TENANT_FILTER_MAX_VALUES as aa, TENANT_FILTER_MAX_VALUE_LENGTH as ab, type TenantAncestor as ac, type TenantClientValidationResult as ad, type TenantCredentialIssued as ae, type TenantCredentialSummary as af, type TenantFilterExpression as ag, type TenantFilterValue as ah, type TenantInvite as ai, type TenantInviteAccepted as aj, type TenantInviteInput as ak, type TenantInviteIssued as al, type TenantInviteListOptions as am, type TenantInvitePreview as an, type TenantInviteStatus as ao, type TenantListOptions as ap, type TenantMember as aq, type TenantMemberPage as ar, type TenantMembership as as, type TenantOrderField as at, TenantScopedClient as au, type TokenResult as av, TokenVerificationError as aw, type TokenVerificationErrorCode as ax, type UpdateOrganizationInput as ay, type User as az, type AcceptTenantInviteInput as b, type AccessTokenSource as c, type Approval as d, type ApprovalAssurance as e, type ApprovalPayload as f, type ApprovalStatus as g, type ApprovalWebAuthnOptions as h, type AuditEvent as i, type AuthyonJwksDiscoveryOptions as j, type AuthyonJwtClaims as k, type AuthyonServerClientOptions as l, type AuthyonTenantClaim as m, type ClientCredentials as n, type ClientRequestContext as o, type ConfirmApprovalInput as p, type ConsumedApproval as q, type CreateApprovalInput as r, type CreateCredentialInput as s, type CreateOrganizationInput as t, type CreatePermissionInput as u, type CreateTenantCredentialInput as v, type CreateUserInput as w, type CredentialCreator as x, type CredentialDetail as y, type CredentialListOptions as z };
@@ -746,6 +746,15 @@ interface TenantInviteIssued {
746
746
  redirectUri: string | null;
747
747
  }
748
748
  type TenantInviteStatus = "pending" | "accepted" | "revoked" | "expired";
749
+ /**
750
+ * Options for an invite listing. The API always orders newest first.
751
+ * `status` keeps only invites in any of the given states; omitted, every state.
752
+ */
753
+ interface TenantInviteListOptions extends PaginationOptions {
754
+ /** Case-insensitive substring of the invited address. */
755
+ search?: string;
756
+ status?: TenantInviteStatus[];
757
+ }
749
758
  interface TenantInvite {
750
759
  id: string;
751
760
  tenantId: string;
@@ -1332,8 +1341,13 @@ declare class AuthyonServerClient {
1332
1341
  * credential's `authyon:users:write` scope (listing, `authyon:tenants:read`).
1333
1342
  */
1334
1343
  invites: {
1335
- /** GET /env/tenants/{tenantId}/invites — every invite with its status, newest first. */
1336
- list: (tenantId: string) => Promise<TenantInvite[]>;
1344
+ /**
1345
+ * GET /env/tenants/{tenantId}/invites — one page of the tenant's
1346
+ * invites, newest first, optionally narrowed by address (`search`)
1347
+ * and by `status`. Up to 0.2.0-beta.26 this returned every invite as
1348
+ * a plain array.
1349
+ */
1350
+ list: (tenantId: string, options?: TenantInviteListOptions) => Promise<Paged<TenantInvite>>;
1337
1351
  /**
1338
1352
  * POST /env/tenants/{tenantId}/invites — invite an address. Always
1339
1353
  * returns `acceptUrl`; with `sendEmail: false` Authyon does not mail
@@ -1468,8 +1482,12 @@ declare class TenantScopedClient {
1468
1482
  validate(context?: ClientRequestContext): Promise<TenantClientValidationResult>;
1469
1483
  /** Invites to the token's tenant, by e-mail or by link. */
1470
1484
  readonly invites: {
1471
- /** GET /tenant/invites — every invite with its status, newest first. */
1472
- list: () => Promise<TenantInvite[]>;
1485
+ /**
1486
+ * GET /tenant/invites — one page of the tenant's invites, newest first,
1487
+ * optionally narrowed by address (`search`) and by `status`. Up to
1488
+ * 0.2.0-beta.26 this returned every invite as a plain array.
1489
+ */
1490
+ list: (options?: TenantInviteListOptions) => Promise<Paged<TenantInvite>>;
1473
1491
  /** POST /tenant/invites — always returns `acceptUrl`; `sendEmail: false` skips the e-mail. */
1474
1492
  create: (input: TenantInviteInput) => Promise<TenantInviteIssued>;
1475
1493
  /** POST /tenant/invites/{inviteId}/resend — new link (the previous one stops working), mailed unless `sendEmail` is `false`. */
@@ -1525,4 +1543,4 @@ declare class TenantScopedClient {
1525
1543
  /** Convenience factory: `const authyon = createClient({ clientId, clientSecret })`. */
1526
1544
  declare function createClient(options?: AuthyonServerClientOptions): AuthyonServerClient;
1527
1545
 
1528
- export { type ReservedPermissions as $, AuthyonServerClient as A, type CredentialPermissionsInput as B, CLIENT_IP_HEADER as C, type HttpAdapterRequest as D, type EnvironmentUser as E, FetchHttpAdapter as F, type HttpLogEvent as G, type HttpAdapter as H, type HttpLogger as I, JwksTokenVerifier as J, type IntrospectResult as K, type InviteTenantMemberInput as L, type IssuePasswordResetInput as M, type JsonWebKeySet as N, type JwksTokenVerifierOptions as O, LoggingHttpAdapter as P, type LoginActivity as Q, type OpenIdConfiguration as R, type Organization as S, type OtpCheckResult as T, type Paged as U, type PaginationOptions as V, type PasswordResetCompleted as W, type PasswordResetIssued as X, type PasswordResetPreview as Y, type Permission as Z, type PermissionsByRole as _, type HttpLoggerOptions as a, type Role as a0, type RoleGrant as a1, type RoleInput as a2, type RoleList as a3, type RolePermissions as a4, type SafeJwtAlgorithm as a5, type SecurityMethods as a6, type SubjectApprovals as a7, type SubjectSecurity as a8, TENANT_FILTER_MAX_DEPTH as a9, type ValidateResult as aA, type VerifiedAccessToken as aB, createClient as aC, normalizeClientIp as aD, tenantFilter as aE, TENANT_FILTER_MAX_VALUES as aa, TENANT_FILTER_MAX_VALUE_LENGTH as ab, type TenantAncestor as ac, type TenantClientValidationResult as ad, type TenantCredentialIssued as ae, type TenantCredentialSummary as af, type TenantFilterExpression as ag, type TenantFilterValue as ah, type TenantInvite as ai, type TenantInviteAccepted as aj, type TenantInviteInput as ak, type TenantInviteIssued as al, type TenantInvitePreview as am, type TenantInviteStatus as an, type TenantListOptions as ao, type TenantMember as ap, type TenantMemberPage as aq, type TenantMembership as ar, type TenantOrderField as as, TenantScopedClient as at, type TokenResult as au, TokenVerificationError as av, type TokenVerificationErrorCode as aw, type UpdateOrganizationInput as ax, type User as ay, UserScopedClient as az, type AcceptTenantInviteInput as b, type AccessTokenSource as c, type Approval as d, type ApprovalAssurance as e, type ApprovalPayload as f, type ApprovalStatus as g, type ApprovalWebAuthnOptions as h, type AuditEvent as i, type AuthyonJwksDiscoveryOptions as j, type AuthyonJwtClaims as k, type AuthyonServerClientOptions as l, type AuthyonTenantClaim as m, type ClientCredentials as n, type ClientRequestContext as o, type ConfirmApprovalInput as p, type ConsumedApproval as q, type CreateApprovalInput as r, type CreateCredentialInput as s, type CreateOrganizationInput as t, type CreatePermissionInput as u, type CreateTenantCredentialInput as v, type CreateUserInput as w, type CredentialCreator as x, type CredentialDetail as y, type CredentialListOptions as z };
1546
+ export { type ReservedPermissions as $, AuthyonServerClient as A, type CredentialPermissionsInput as B, CLIENT_IP_HEADER as C, type HttpAdapterRequest as D, type EnvironmentUser as E, FetchHttpAdapter as F, type HttpLogEvent as G, type HttpAdapter as H, type HttpLogger as I, JwksTokenVerifier as J, type IntrospectResult as K, type InviteTenantMemberInput as L, type IssuePasswordResetInput as M, type JsonWebKeySet as N, type JwksTokenVerifierOptions as O, LoggingHttpAdapter as P, type LoginActivity as Q, type OpenIdConfiguration as R, type Organization as S, type OtpCheckResult as T, type Paged as U, type PaginationOptions as V, type PasswordResetCompleted as W, type PasswordResetIssued as X, type PasswordResetPreview as Y, type Permission as Z, type PermissionsByRole as _, type HttpLoggerOptions as a, type Role as a0, type RoleGrant as a1, type RoleInput as a2, type RoleList as a3, type RolePermissions as a4, type SafeJwtAlgorithm as a5, type SecurityMethods as a6, type SubjectApprovals as a7, type SubjectSecurity as a8, TENANT_FILTER_MAX_DEPTH as a9, UserScopedClient as aA, type ValidateResult as aB, type VerifiedAccessToken as aC, createClient as aD, normalizeClientIp as aE, tenantFilter as aF, TENANT_FILTER_MAX_VALUES as aa, TENANT_FILTER_MAX_VALUE_LENGTH as ab, type TenantAncestor as ac, type TenantClientValidationResult as ad, type TenantCredentialIssued as ae, type TenantCredentialSummary as af, type TenantFilterExpression as ag, type TenantFilterValue as ah, type TenantInvite as ai, type TenantInviteAccepted as aj, type TenantInviteInput as ak, type TenantInviteIssued as al, type TenantInviteListOptions as am, type TenantInvitePreview as an, type TenantInviteStatus as ao, type TenantListOptions as ap, type TenantMember as aq, type TenantMemberPage as ar, type TenantMembership as as, type TenantOrderField as at, TenantScopedClient as au, type TokenResult as av, TokenVerificationError as aw, type TokenVerificationErrorCode as ax, type UpdateOrganizationInput as ay, type User as az, type AcceptTenantInviteInput as b, type AccessTokenSource as c, type Approval as d, type ApprovalAssurance as e, type ApprovalPayload as f, type ApprovalStatus as g, type ApprovalWebAuthnOptions as h, type AuditEvent as i, type AuthyonJwksDiscoveryOptions as j, type AuthyonJwtClaims as k, type AuthyonServerClientOptions as l, type AuthyonTenantClaim as m, type ClientCredentials as n, type ClientRequestContext as o, type ConfirmApprovalInput as p, type ConsumedApproval as q, type CreateApprovalInput as r, type CreateCredentialInput as s, type CreateOrganizationInput as t, type CreatePermissionInput as u, type CreateTenantCredentialInput as v, type CreateUserInput as w, type CredentialCreator as x, type CredentialDetail as y, type CredentialListOptions as z };
package/dist/bff.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import { H as HttpAdapter, a as HttpLoggerOptions, A as AuthyonServerClient } from './authyonServerClient-6ezHxvwa.cjs';
1
+ import { H as HttpAdapter, a as HttpLoggerOptions, A as AuthyonServerClient } from './authyonServerClient-D7mSUfe5.cjs';
2
2
  import 'jose';
3
3
 
4
4
  interface BffLoginInput {
package/dist/bff.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { H as HttpAdapter, a as HttpLoggerOptions, A as AuthyonServerClient } from './authyonServerClient-6ezHxvwa.js';
1
+ import { H as HttpAdapter, a as HttpLoggerOptions, A as AuthyonServerClient } from './authyonServerClient-D7mSUfe5.js';
2
2
  import 'jose';
3
3
 
4
4
  interface BffLoginInput {
package/dist/index.cjs CHANGED
@@ -287,6 +287,33 @@ var UserScopedClient = class {
287
287
  };
288
288
  _request = new WeakMap();
289
289
 
290
+ // src/client/inviteQuery.ts
291
+ var STATUSES = /* @__PURE__ */ new Set([
292
+ "pending",
293
+ "accepted",
294
+ "revoked",
295
+ "expired"
296
+ ]);
297
+ function inviteQuery(options = {}) {
298
+ const { skip, take, search, status } = options;
299
+ if (skip !== void 0 && (!Number.isInteger(skip) || skip < 0 || skip > 2147483647))
300
+ throw new RangeError("Authyon: invalid skip.");
301
+ if (take !== void 0 && (!Number.isInteger(take) || take < 1 || take > 100))
302
+ throw new RangeError("Authyon: take must be between 1 and 100.");
303
+ if (search !== void 0 && (typeof search !== "string" || search.trim().length > 254))
304
+ throw new RangeError("Authyon: search must contain at most 254 characters.");
305
+ let statuses;
306
+ if (status !== void 0) {
307
+ if (!Array.isArray(status)) throw new TypeError("Authyon: status must be an array.");
308
+ const normalized = status.map((s) => String(s).trim().toLowerCase()).filter((s) => s.length > 0);
309
+ const unknown = normalized.find((s) => !STATUSES.has(s));
310
+ if (unknown) throw new RangeError(`Authyon: unknown invite status "${unknown}".`);
311
+ statuses = [...new Set(normalized)];
312
+ if (statuses.length === 0) statuses = void 0;
313
+ }
314
+ return { search: search?.trim() || void 0, skip, take, status: statuses };
315
+ }
316
+
290
317
  // ../../internal/core/config/defaults.ts
291
318
  var DEFAULT_BASE_URL = "https://api.authyon.com";
292
319
  var DEFAULT_EXPIRY_SKEW_MS = 3e4;
@@ -1257,8 +1284,16 @@ var AuthyonServerClient = class {
1257
1284
  * credential's `authyon:users:write` scope (listing, `authyon:tenants:read`).
1258
1285
  */
1259
1286
  invites: {
1260
- /** GET /env/tenants/{tenantId}/invites — every invite with its status, newest first. */
1261
- list: (tenantId) => this.request(`/env/tenants/${encodeURIComponent(tenantId)}/invites`, { envBearer: true }),
1287
+ /**
1288
+ * GET /env/tenants/{tenantId}/invites — one page of the tenant's
1289
+ * invites, newest first, optionally narrowed by address (`search`)
1290
+ * and by `status`. Up to 0.2.0-beta.26 this returned every invite as
1291
+ * a plain array.
1292
+ */
1293
+ list: (tenantId, options = {}) => this.request(`/env/tenants/${encodeURIComponent(tenantId)}/invites`, {
1294
+ envBearer: true,
1295
+ query: inviteQuery(options)
1296
+ }),
1262
1297
  /**
1263
1298
  * POST /env/tenants/{tenantId}/invites — invite an address. Always
1264
1299
  * returns `acceptUrl`; with `sendEmail: false` Authyon does not mail
@@ -1554,8 +1589,12 @@ var TenantScopedClient = class {
1554
1589
  constructor(server, credentials) {
1555
1590
  /** Invites to the token's tenant, by e-mail or by link. */
1556
1591
  this.invites = {
1557
- /** GET /tenant/invites — every invite with its status, newest first. */
1558
- list: () => this.request("/tenant/invites"),
1592
+ /**
1593
+ * GET /tenant/invites — one page of the tenant's invites, newest first,
1594
+ * optionally narrowed by address (`search`) and by `status`. Up to
1595
+ * 0.2.0-beta.26 this returned every invite as a plain array.
1596
+ */
1597
+ list: (options = {}) => this.request("/tenant/invites", { query: inviteQuery(options) }),
1559
1598
  /** POST /tenant/invites — always returns `acceptUrl`; `sendEmail: false` skips the e-mail. */
1560
1599
  create: (input) => this.request("/tenant/invites", {
1561
1600
  method: "POST",
package/dist/index.d.cts CHANGED
@@ -1,6 +1,6 @@
1
- import { H as HttpAdapter, a as HttpLoggerOptions, A as AuthyonServerClient } from './authyonServerClient-6ezHxvwa.cjs';
2
- export { b as AcceptTenantInviteInput, c as AccessTokenSource, d as Approval, e as ApprovalAssurance, f as ApprovalPayload, g as ApprovalStatus, h as ApprovalWebAuthnOptions, i as AuditEvent, j as AuthyonJwksDiscoveryOptions, k as AuthyonJwtClaims, l as AuthyonServerClientOptions, m as AuthyonTenantClaim, C as CLIENT_IP_HEADER, n as ClientCredentials, o as ClientRequestContext, p as ConfirmApprovalInput, q as ConsumedApproval, r as CreateApprovalInput, s as CreateCredentialInput, t as CreateOrganizationInput, u as CreatePermissionInput, v as CreateTenantCredentialInput, w as CreateUserInput, x as CredentialCreator, y as CredentialDetail, z as CredentialListOptions, B as CredentialPermissionsInput, E as EnvironmentUser, F as FetchHttpAdapter, D as HttpAdapterRequest, G as HttpLogEvent, I as HttpLogger, K as IntrospectResult, L as InviteTenantMemberInput, M as IssuePasswordResetInput, N as JsonWebKeySet, J as JwksTokenVerifier, O as JwksTokenVerifierOptions, P as LoggingHttpAdapter, Q as LoginActivity, R as OpenIdConfiguration, S as Organization, T as OtpCheckResult, U as Paged, V as PaginationOptions, W as PasswordResetCompleted, X as PasswordResetIssued, Y as PasswordResetPreview, Z as Permission, _ as PermissionsByRole, $ as ReservedPermissions, a0 as Role, a1 as RoleGrant, a2 as RoleInput, a3 as RoleList, a4 as RolePermissions, a5 as SafeJwtAlgorithm, a6 as SecurityMethods, a7 as SubjectApprovals, a8 as SubjectSecurity, a9 as TENANT_FILTER_MAX_DEPTH, aa as TENANT_FILTER_MAX_VALUES, ab as TENANT_FILTER_MAX_VALUE_LENGTH, ac as TenantAncestor, ad as TenantClientValidationResult, ae as TenantCredentialIssued, af as TenantCredentialSummary, ag as TenantFilterExpression, ah as TenantFilterValue, ai as TenantInvite, aj as TenantInviteAccepted, ak as TenantInviteInput, al as TenantInviteIssued, am as TenantInvitePreview, an as TenantInviteStatus, ao as TenantListOptions, ap as TenantMember, aq as TenantMemberPage, ar as TenantMembership, as as TenantOrderField, at as TenantScopedClient, au as TokenResult, av as TokenVerificationError, aw as TokenVerificationErrorCode, ax as UpdateOrganizationInput, ay as User, az as UserScopedClient, aA as ValidateResult, aB as VerifiedAccessToken, aC as createClient, aD as normalizeClientIp, aE as tenantFilter } from './authyonServerClient-6ezHxvwa.cjs';
3
- export { b as AbilityConditions, c as AbilityEvent, d as AbilityListener, e as AbilityRequirement, f as AbilityRule, A as AbilitySubject, g as AuthorizationContext, a as AuthorizationError, h as AuthorizationOptions, i as AuthyonAbility, j as AuthyonAbilityBuilder, k as AuthyonAbilityOptions, l as AuthyonPermissionSource, E as ExpressAuthorizationMiddlewareOptions, m as ExpressNext, n as ExpressRequestLike, o as ExpressResponseLike, P as PermissionGroup, R as RequestAuthorizationOptions, p as authorizeRequest, q as authorizeToken, r as createAuthorizationErrorResponse, s as createAuthyonAbility, t as createAuthyonRules, u as createExpressAuthorizationMiddleware, v as hasPermission, w as hasPermissionGroup } from './authorization-CDHWMYT7.cjs';
1
+ import { H as HttpAdapter, a as HttpLoggerOptions, A as AuthyonServerClient } from './authyonServerClient-D7mSUfe5.cjs';
2
+ export { b as AcceptTenantInviteInput, c as AccessTokenSource, d as Approval, e as ApprovalAssurance, f as ApprovalPayload, g as ApprovalStatus, h as ApprovalWebAuthnOptions, i as AuditEvent, j as AuthyonJwksDiscoveryOptions, k as AuthyonJwtClaims, l as AuthyonServerClientOptions, m as AuthyonTenantClaim, C as CLIENT_IP_HEADER, n as ClientCredentials, o as ClientRequestContext, p as ConfirmApprovalInput, q as ConsumedApproval, r as CreateApprovalInput, s as CreateCredentialInput, t as CreateOrganizationInput, u as CreatePermissionInput, v as CreateTenantCredentialInput, w as CreateUserInput, x as CredentialCreator, y as CredentialDetail, z as CredentialListOptions, B as CredentialPermissionsInput, E as EnvironmentUser, F as FetchHttpAdapter, D as HttpAdapterRequest, G as HttpLogEvent, I as HttpLogger, K as IntrospectResult, L as InviteTenantMemberInput, M as IssuePasswordResetInput, N as JsonWebKeySet, J as JwksTokenVerifier, O as JwksTokenVerifierOptions, P as LoggingHttpAdapter, Q as LoginActivity, R as OpenIdConfiguration, S as Organization, T as OtpCheckResult, U as Paged, V as PaginationOptions, W as PasswordResetCompleted, X as PasswordResetIssued, Y as PasswordResetPreview, Z as Permission, _ as PermissionsByRole, $ as ReservedPermissions, a0 as Role, a1 as RoleGrant, a2 as RoleInput, a3 as RoleList, a4 as RolePermissions, a5 as SafeJwtAlgorithm, a6 as SecurityMethods, a7 as SubjectApprovals, a8 as SubjectSecurity, a9 as TENANT_FILTER_MAX_DEPTH, aa as TENANT_FILTER_MAX_VALUES, ab as TENANT_FILTER_MAX_VALUE_LENGTH, ac as TenantAncestor, ad as TenantClientValidationResult, ae as TenantCredentialIssued, af as TenantCredentialSummary, ag as TenantFilterExpression, ah as TenantFilterValue, ai as TenantInvite, aj as TenantInviteAccepted, ak as TenantInviteInput, al as TenantInviteIssued, am as TenantInviteListOptions, an as TenantInvitePreview, ao as TenantInviteStatus, ap as TenantListOptions, aq as TenantMember, ar as TenantMemberPage, as as TenantMembership, at as TenantOrderField, au as TenantScopedClient, av as TokenResult, aw as TokenVerificationError, ax as TokenVerificationErrorCode, ay as UpdateOrganizationInput, az as User, aA as UserScopedClient, aB as ValidateResult, aC as VerifiedAccessToken, aD as createClient, aE as normalizeClientIp, aF as tenantFilter } from './authyonServerClient-D7mSUfe5.cjs';
3
+ export { b as AbilityConditions, c as AbilityEvent, d as AbilityListener, e as AbilityRequirement, f as AbilityRule, A as AbilitySubject, g as AuthorizationContext, a as AuthorizationError, h as AuthorizationOptions, i as AuthyonAbility, j as AuthyonAbilityBuilder, k as AuthyonAbilityOptions, l as AuthyonPermissionSource, E as ExpressAuthorizationMiddlewareOptions, m as ExpressNext, n as ExpressRequestLike, o as ExpressResponseLike, P as PermissionGroup, R as RequestAuthorizationOptions, p as authorizeRequest, q as authorizeToken, r as createAuthorizationErrorResponse, s as createAuthyonAbility, t as createAuthyonRules, u as createExpressAuthorizationMiddleware, v as hasPermission, w as hasPermissionGroup } from './authorization-RHojgDKD.cjs';
4
4
  import 'jose';
5
5
 
6
6
  declare const ErrorCodes: {
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- import { H as HttpAdapter, a as HttpLoggerOptions, A as AuthyonServerClient } from './authyonServerClient-6ezHxvwa.js';
2
- export { b as AcceptTenantInviteInput, c as AccessTokenSource, d as Approval, e as ApprovalAssurance, f as ApprovalPayload, g as ApprovalStatus, h as ApprovalWebAuthnOptions, i as AuditEvent, j as AuthyonJwksDiscoveryOptions, k as AuthyonJwtClaims, l as AuthyonServerClientOptions, m as AuthyonTenantClaim, C as CLIENT_IP_HEADER, n as ClientCredentials, o as ClientRequestContext, p as ConfirmApprovalInput, q as ConsumedApproval, r as CreateApprovalInput, s as CreateCredentialInput, t as CreateOrganizationInput, u as CreatePermissionInput, v as CreateTenantCredentialInput, w as CreateUserInput, x as CredentialCreator, y as CredentialDetail, z as CredentialListOptions, B as CredentialPermissionsInput, E as EnvironmentUser, F as FetchHttpAdapter, D as HttpAdapterRequest, G as HttpLogEvent, I as HttpLogger, K as IntrospectResult, L as InviteTenantMemberInput, M as IssuePasswordResetInput, N as JsonWebKeySet, J as JwksTokenVerifier, O as JwksTokenVerifierOptions, P as LoggingHttpAdapter, Q as LoginActivity, R as OpenIdConfiguration, S as Organization, T as OtpCheckResult, U as Paged, V as PaginationOptions, W as PasswordResetCompleted, X as PasswordResetIssued, Y as PasswordResetPreview, Z as Permission, _ as PermissionsByRole, $ as ReservedPermissions, a0 as Role, a1 as RoleGrant, a2 as RoleInput, a3 as RoleList, a4 as RolePermissions, a5 as SafeJwtAlgorithm, a6 as SecurityMethods, a7 as SubjectApprovals, a8 as SubjectSecurity, a9 as TENANT_FILTER_MAX_DEPTH, aa as TENANT_FILTER_MAX_VALUES, ab as TENANT_FILTER_MAX_VALUE_LENGTH, ac as TenantAncestor, ad as TenantClientValidationResult, ae as TenantCredentialIssued, af as TenantCredentialSummary, ag as TenantFilterExpression, ah as TenantFilterValue, ai as TenantInvite, aj as TenantInviteAccepted, ak as TenantInviteInput, al as TenantInviteIssued, am as TenantInvitePreview, an as TenantInviteStatus, ao as TenantListOptions, ap as TenantMember, aq as TenantMemberPage, ar as TenantMembership, as as TenantOrderField, at as TenantScopedClient, au as TokenResult, av as TokenVerificationError, aw as TokenVerificationErrorCode, ax as UpdateOrganizationInput, ay as User, az as UserScopedClient, aA as ValidateResult, aB as VerifiedAccessToken, aC as createClient, aD as normalizeClientIp, aE as tenantFilter } from './authyonServerClient-6ezHxvwa.js';
3
- export { b as AbilityConditions, c as AbilityEvent, d as AbilityListener, e as AbilityRequirement, f as AbilityRule, A as AbilitySubject, g as AuthorizationContext, a as AuthorizationError, h as AuthorizationOptions, i as AuthyonAbility, j as AuthyonAbilityBuilder, k as AuthyonAbilityOptions, l as AuthyonPermissionSource, E as ExpressAuthorizationMiddlewareOptions, m as ExpressNext, n as ExpressRequestLike, o as ExpressResponseLike, P as PermissionGroup, R as RequestAuthorizationOptions, p as authorizeRequest, q as authorizeToken, r as createAuthorizationErrorResponse, s as createAuthyonAbility, t as createAuthyonRules, u as createExpressAuthorizationMiddleware, v as hasPermission, w as hasPermissionGroup } from './authorization-BBwAqaR4.js';
1
+ import { H as HttpAdapter, a as HttpLoggerOptions, A as AuthyonServerClient } from './authyonServerClient-D7mSUfe5.js';
2
+ export { b as AcceptTenantInviteInput, c as AccessTokenSource, d as Approval, e as ApprovalAssurance, f as ApprovalPayload, g as ApprovalStatus, h as ApprovalWebAuthnOptions, i as AuditEvent, j as AuthyonJwksDiscoveryOptions, k as AuthyonJwtClaims, l as AuthyonServerClientOptions, m as AuthyonTenantClaim, C as CLIENT_IP_HEADER, n as ClientCredentials, o as ClientRequestContext, p as ConfirmApprovalInput, q as ConsumedApproval, r as CreateApprovalInput, s as CreateCredentialInput, t as CreateOrganizationInput, u as CreatePermissionInput, v as CreateTenantCredentialInput, w as CreateUserInput, x as CredentialCreator, y as CredentialDetail, z as CredentialListOptions, B as CredentialPermissionsInput, E as EnvironmentUser, F as FetchHttpAdapter, D as HttpAdapterRequest, G as HttpLogEvent, I as HttpLogger, K as IntrospectResult, L as InviteTenantMemberInput, M as IssuePasswordResetInput, N as JsonWebKeySet, J as JwksTokenVerifier, O as JwksTokenVerifierOptions, P as LoggingHttpAdapter, Q as LoginActivity, R as OpenIdConfiguration, S as Organization, T as OtpCheckResult, U as Paged, V as PaginationOptions, W as PasswordResetCompleted, X as PasswordResetIssued, Y as PasswordResetPreview, Z as Permission, _ as PermissionsByRole, $ as ReservedPermissions, a0 as Role, a1 as RoleGrant, a2 as RoleInput, a3 as RoleList, a4 as RolePermissions, a5 as SafeJwtAlgorithm, a6 as SecurityMethods, a7 as SubjectApprovals, a8 as SubjectSecurity, a9 as TENANT_FILTER_MAX_DEPTH, aa as TENANT_FILTER_MAX_VALUES, ab as TENANT_FILTER_MAX_VALUE_LENGTH, ac as TenantAncestor, ad as TenantClientValidationResult, ae as TenantCredentialIssued, af as TenantCredentialSummary, ag as TenantFilterExpression, ah as TenantFilterValue, ai as TenantInvite, aj as TenantInviteAccepted, ak as TenantInviteInput, al as TenantInviteIssued, am as TenantInviteListOptions, an as TenantInvitePreview, ao as TenantInviteStatus, ap as TenantListOptions, aq as TenantMember, ar as TenantMemberPage, as as TenantMembership, at as TenantOrderField, au as TenantScopedClient, av as TokenResult, aw as TokenVerificationError, ax as TokenVerificationErrorCode, ay as UpdateOrganizationInput, az as User, aA as UserScopedClient, aB as ValidateResult, aC as VerifiedAccessToken, aD as createClient, aE as normalizeClientIp, aF as tenantFilter } from './authyonServerClient-D7mSUfe5.js';
3
+ export { b as AbilityConditions, c as AbilityEvent, d as AbilityListener, e as AbilityRequirement, f as AbilityRule, A as AbilitySubject, g as AuthorizationContext, a as AuthorizationError, h as AuthorizationOptions, i as AuthyonAbility, j as AuthyonAbilityBuilder, k as AuthyonAbilityOptions, l as AuthyonPermissionSource, E as ExpressAuthorizationMiddlewareOptions, m as ExpressNext, n as ExpressRequestLike, o as ExpressResponseLike, P as PermissionGroup, R as RequestAuthorizationOptions, p as authorizeRequest, q as authorizeToken, r as createAuthorizationErrorResponse, s as createAuthyonAbility, t as createAuthyonRules, u as createExpressAuthorizationMiddleware, v as hasPermission, w as hasPermissionGroup } from './authorization-gJv_i_p5.js';
4
4
  import 'jose';
5
5
 
6
6
  declare const ErrorCodes: {
package/dist/index.js CHANGED
@@ -259,6 +259,33 @@ var UserScopedClient = class {
259
259
  };
260
260
  _request = new WeakMap();
261
261
 
262
+ // src/client/inviteQuery.ts
263
+ var STATUSES = /* @__PURE__ */ new Set([
264
+ "pending",
265
+ "accepted",
266
+ "revoked",
267
+ "expired"
268
+ ]);
269
+ function inviteQuery(options = {}) {
270
+ const { skip, take, search, status } = options;
271
+ if (skip !== void 0 && (!Number.isInteger(skip) || skip < 0 || skip > 2147483647))
272
+ throw new RangeError("Authyon: invalid skip.");
273
+ if (take !== void 0 && (!Number.isInteger(take) || take < 1 || take > 100))
274
+ throw new RangeError("Authyon: take must be between 1 and 100.");
275
+ if (search !== void 0 && (typeof search !== "string" || search.trim().length > 254))
276
+ throw new RangeError("Authyon: search must contain at most 254 characters.");
277
+ let statuses;
278
+ if (status !== void 0) {
279
+ if (!Array.isArray(status)) throw new TypeError("Authyon: status must be an array.");
280
+ const normalized = status.map((s) => String(s).trim().toLowerCase()).filter((s) => s.length > 0);
281
+ const unknown = normalized.find((s) => !STATUSES.has(s));
282
+ if (unknown) throw new RangeError(`Authyon: unknown invite status "${unknown}".`);
283
+ statuses = [...new Set(normalized)];
284
+ if (statuses.length === 0) statuses = void 0;
285
+ }
286
+ return { search: search?.trim() || void 0, skip, take, status: statuses };
287
+ }
288
+
262
289
  // ../../internal/core/auth/expiringTokenProvider.ts
263
290
  var _token, _inFlight;
264
291
  var ExpiringTokenProvider = class {
@@ -719,8 +746,16 @@ var AuthyonServerClient = class {
719
746
  * credential's `authyon:users:write` scope (listing, `authyon:tenants:read`).
720
747
  */
721
748
  invites: {
722
- /** GET /env/tenants/{tenantId}/invites — every invite with its status, newest first. */
723
- list: (tenantId) => this.request(`/env/tenants/${encodeURIComponent(tenantId)}/invites`, { envBearer: true }),
749
+ /**
750
+ * GET /env/tenants/{tenantId}/invites — one page of the tenant's
751
+ * invites, newest first, optionally narrowed by address (`search`)
752
+ * and by `status`. Up to 0.2.0-beta.26 this returned every invite as
753
+ * a plain array.
754
+ */
755
+ list: (tenantId, options = {}) => this.request(`/env/tenants/${encodeURIComponent(tenantId)}/invites`, {
756
+ envBearer: true,
757
+ query: inviteQuery(options)
758
+ }),
724
759
  /**
725
760
  * POST /env/tenants/{tenantId}/invites — invite an address. Always
726
761
  * returns `acceptUrl`; with `sendEmail: false` Authyon does not mail
@@ -1016,8 +1051,12 @@ var TenantScopedClient = class {
1016
1051
  constructor(server, credentials) {
1017
1052
  /** Invites to the token's tenant, by e-mail or by link. */
1018
1053
  this.invites = {
1019
- /** GET /tenant/invites — every invite with its status, newest first. */
1020
- list: () => this.request("/tenant/invites"),
1054
+ /**
1055
+ * GET /tenant/invites — one page of the tenant's invites, newest first,
1056
+ * optionally narrowed by address (`search`) and by `status`. Up to
1057
+ * 0.2.0-beta.26 this returned every invite as a plain array.
1058
+ */
1059
+ list: (options = {}) => this.request("/tenant/invites", { query: inviteQuery(options) }),
1021
1060
  /** POST /tenant/invites — always returns `acceptUrl`; `sendEmail: false` skips the e-mail. */
1022
1061
  create: (input) => this.request("/tenant/invites", {
1023
1062
  method: "POST",
package/dist/next.d.cts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { ReactNode } from 'react';
2
- import { R as RequestAuthorizationOptions, A as AbilitySubject, a as AuthorizationError } from './authorization-CDHWMYT7.cjs';
3
- import { A as AuthyonServerClient } from './authyonServerClient-6ezHxvwa.cjs';
2
+ import { R as RequestAuthorizationOptions, A as AbilitySubject, a as AuthorizationError } from './authorization-RHojgDKD.cjs';
3
+ import { A as AuthyonServerClient } from './authyonServerClient-D7mSUfe5.cjs';
4
4
  import 'jose';
5
5
 
6
6
  interface ServerPermissionGuardFallbackContext {
package/dist/next.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { ReactNode } from 'react';
2
- import { R as RequestAuthorizationOptions, A as AbilitySubject, a as AuthorizationError } from './authorization-BBwAqaR4.js';
3
- import { A as AuthyonServerClient } from './authyonServerClient-6ezHxvwa.js';
2
+ import { R as RequestAuthorizationOptions, A as AbilitySubject, a as AuthorizationError } from './authorization-gJv_i_p5.js';
3
+ import { A as AuthyonServerClient } from './authyonServerClient-D7mSUfe5.js';
4
4
  import 'jose';
5
5
 
6
6
  interface ServerPermissionGuardFallbackContext {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@authyon/server",
3
- "version": "0.2.0-beta.26",
3
+ "version": "0.2.0-beta.27",
4
4
  "description": "Authyon SDK for backends — server-to-server organization/member management and access-token verification.",
5
5
  "license": "MIT",
6
6
  "type": "module",