Practic Passkey - v1.0.0
    Preparing search index...

    Function adminActionsFor

    • The admin actions of one app. Each is allowed to a request carrying one of the server's admin keys, or signed in to an account the host's isAdmin accepts, or, without it, that the app's admins setting covers; the apps themselves only to admin keys, since they span every app.

      Parameters

      Returns (
          request:
              | { action: "admin-settings-get"; app: string; protocol?: number }
              | {
                  action: "admin-settings-set";
                  app: string;
                  protocol?: number;
                  settings: Record<string, Json>;
              }
              | { action: "admin-access-list"; app: string; protocol?: number }
              | {
                  action: "admin-access-set";
                  app: string;
                  pattern: string;
                  protocol?: number;
                  rule: "allowed" | "denied";
              }
              | {
                  action: "admin-access-remove";
                  app: string;
                  pattern: string;
                  protocol?: number;
              }
              | {
                  action: "admin-accounts-list";
                  after?: string;
                  app: string;
                  limit: number;
                  protocol?: number;
                  status?: "active"
                  | "disabled";
              }
              | {
                  action: "admin-account-get";
                  address: PasskeyAddress;
                  app: string;
                  protocol?: number;
              }
              | {
                  action: "admin-account-create";
                  address: PasskeyAddress;
                  app: string;
                  displayName?: string;
                  protocol?: number;
              }
              | {
                  action: "admin-account-update";
                  address: PasskeyAddress;
                  app: string;
                  displayName?: string
                  | null;
                  protocol?: number;
                  status?: "active" | "disabled";
              }
              | {
                  action: "admin-account-delete";
                  address: PasskeyAddress;
                  app: string;
                  protocol?: number;
              }
              | {
                  action: "admin-passkey-remove";
                  app: string;
                  id: string;
                  protocol?: number;
              }
              | {
                  action: "admin-sessions-end";
                  address: PasskeyAddress;
                  app: string;
                  id?: string;
                  protocol?: number;
              }
              | { action: "admin-apps-list"; app: string; protocol?: number }
              | {
                  action: "admin-app-set";
                  app: string;
                  id: string;
                  protocol?: number;
                  record: {
                      channels: { email?: string; phone?: string };
                      config?: { engine: string; namespace: string };
                      data?: { engine: string; namespace: string };
                      origins: string[];
                  };
              }
              | {
                  action: "admin-app-remove";
                  app: string;
                  id: string;
                  protocol?: number;
              },
          context: PasskeyContext,
          reply: Reply,
          trusted?: boolean,
      ) => Promise<
          | Record<string, never>
          | {
              adminsByHost: boolean;
              settings: {
                  admins: string[];
                  limits: {
                      codesPerAddress: LimiterRule;
                      failuresPerAddress: LimiterRule;
                      failuresPerIp: LimiterRule;
                      requestsPerIp: LimiterRule;
                  };
                  session: { idleHours: number; lifetimeHours: number };
                  signup: "invited" | "open" | "closed";
              };
          }
          | {
              adminsByHost: boolean;
              settings: {
                  admins: string[];
                  limits: {
                      codesPerAddress: LimiterRule;
                      failuresPerAddress: LimiterRule;
                      failuresPerIp: LimiterRule;
                      requestsPerIp: LimiterRule;
                  };
                  session: { idleHours: number; lifetimeHours: number };
                  signup: "invited" | "open" | "closed";
              };
          }
          | { entries: { pattern: string; rule: "allowed"
          | "denied" }[] }
          | { entry: { pattern: string; rule: "allowed" | "denied" } }
          | {
              accounts: {
                  address: string;
                  createdAt: string;
                  createdVia: "signup" | "invited";
                  displayName?: string;
                  kind: PasskeyAddressKind;
                  status: "active" | "disabled";
                  userId: string;
              }[];
              next?: string;
          }
          | {
              account: {
                  address: string;
                  createdAt: string;
                  createdVia: "signup"
                  | "invited";
                  displayName?: string;
                  kind: PasskeyAddressKind;
                  status: "active" | "disabled";
                  userId: string;
              };
              passkeys: {
                  address: string;
                  authenticatorName: string;
                  createdAt: string;
                  displayName: string;
                  id: string;
                  kind: PasskeyAddressKind;
                  label: string;
                  lastUsedAt?: string;
                  synced: boolean;
                  transports: ExtendedAuthenticatorTransport[];
              }[];
              sessions: {
                  createdAt: string;
                  credentialId: string;
                  expiresAt: string;
                  id: string;
                  lastSeenAt: string;
              }[];
          }
          | {
              account: {
                  address: string;
                  createdAt: string;
                  createdVia: "signup"
                  | "invited";
                  displayName?: string;
                  kind: PasskeyAddressKind;
                  status: "active" | "disabled";
                  userId: string;
              };
          }
          | {
              account: {
                  address: string;
                  createdAt: string;
                  createdVia: "signup"
                  | "invited";
                  displayName?: string;
                  kind: PasskeyAddressKind;
                  status: "active" | "disabled";
                  userId: string;
              };
          }
          | { passkeys: number; sessions: number }
          | { ended: number }
          | {
              apps: {
                  channels: { email?: string; phone?: string };
                  config?: { engine: string; namespace: string };
                  data?: { engine: string; namespace: string };
                  id: string;
                  origins: string[];
              }[];
          }
          | {
              id: string;
              record: {
                  channels: { email?: string; phone?: string };
                  config?: { engine: string; namespace: string };
                  data?: { engine: string; namespace: string };
                  origins: string[];
              };
          },
      >