import { z } from 'zod';

/**
 * Identity & User Model Specification
 *
 * Defines the standard user, account, and session data models for ObjectStack.
 * These schemas represent "who is logged in" and their associated data.
 *
 * This is separate from authentication configuration (auth.zod.ts) which
 * defines "how to login".
 */
/**
 * User Schema
 * Core user identity data model
 */
declare const UserSchema: z.ZodObject<{
    id: z.ZodString;
    email: z.ZodString;
    emailVerified: z.ZodDefault<z.ZodBoolean>;
    name: z.ZodOptional<z.ZodString>;
    image: z.ZodOptional<z.ZodString>;
    createdAt: z.ZodString;
    updatedAt: z.ZodString;
}, z.core.$strip>;
type User = z.infer<typeof UserSchema>;
/**
 * Account Schema
 * Links external OAuth/OIDC/SAML accounts to a user
 */
declare const AccountSchema: z.ZodObject<{
    id: z.ZodString;
    userId: z.ZodString;
    type: z.ZodEnum<{
        credentials: "credentials";
        email: "email";
        oauth: "oauth";
        oidc: "oidc";
        saml: "saml";
        ldap: "ldap";
    }>;
    provider: z.ZodString;
    providerAccountId: z.ZodString;
    refreshToken: z.ZodOptional<z.ZodString>;
    accessToken: z.ZodOptional<z.ZodString>;
    expiresAt: z.ZodOptional<z.ZodNumber>;
    tokenType: z.ZodOptional<z.ZodString>;
    scope: z.ZodOptional<z.ZodString>;
    idToken: z.ZodOptional<z.ZodString>;
    sessionState: z.ZodOptional<z.ZodString>;
    createdAt: z.ZodString;
    updatedAt: z.ZodString;
}, z.core.$strip>;
type Account = z.infer<typeof AccountSchema>;
/**
 * Session Schema
 * User session data model
 */
declare const SessionSchema: z.ZodObject<{
    id: z.ZodString;
    sessionToken: z.ZodString;
    userId: z.ZodString;
    activeOrganizationId: z.ZodOptional<z.ZodString>;
    expires: z.ZodString;
    createdAt: z.ZodString;
    updatedAt: z.ZodString;
    ipAddress: z.ZodOptional<z.ZodString>;
    userAgent: z.ZodOptional<z.ZodString>;
    fingerprint: z.ZodOptional<z.ZodString>;
}, z.core.$strip>;
type Session = z.infer<typeof SessionSchema>;
/**
 * Verification Token Schema
 * Email verification and password reset tokens
 */
declare const VerificationTokenSchema: z.ZodObject<{
    identifier: z.ZodString;
    token: z.ZodString;
    expires: z.ZodString;
    createdAt: z.ZodString;
}, z.core.$strip>;
type VerificationToken = z.infer<typeof VerificationTokenSchema>;
/**
 * API Key Schema
 *
 * Aligns with better-auth's API key plugin capabilities.
 * Provides programmatic access to ObjectStack APIs (CI/CD, service-to-service, CLI).
 *
 * @see https://www.better-auth.com/docs/plugins/api-key
 */
declare const ApiKeySchema: z.ZodObject<{
    id: z.ZodString;
    name: z.ZodString;
    start: z.ZodOptional<z.ZodString>;
    prefix: z.ZodOptional<z.ZodString>;
    userId: z.ZodString;
    organizationId: z.ZodOptional<z.ZodString>;
    expiresAt: z.ZodOptional<z.ZodString>;
    createdAt: z.ZodString;
    updatedAt: z.ZodString;
    lastUsedAt: z.ZodOptional<z.ZodString>;
    lastRefetchAt: z.ZodOptional<z.ZodString>;
    enabled: z.ZodDefault<z.ZodBoolean>;
    rateLimitEnabled: z.ZodOptional<z.ZodBoolean>;
    rateLimitTimeWindow: z.ZodOptional<z.ZodNumber>;
    rateLimitMax: z.ZodOptional<z.ZodNumber>;
    remaining: z.ZodOptional<z.ZodNumber>;
    permissions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodBoolean>>;
    scopes: z.ZodOptional<z.ZodArray<z.ZodString>>;
    metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
}, z.core.$strip>;
type ApiKey = z.infer<typeof ApiKeySchema>;

/**
 * Authentication Wire Protocol & Constants
 *
 * Defines the API contract and constants for authentication communication.
 * These constants ensure consistent behavior across all ObjectStack implementations.
 */
/**
 * Authentication Constants
 * Standard headers, prefixes, and identifiers for auth communication
 */
declare const AUTH_CONSTANTS: {
    /**
     * HTTP header key for authentication tokens
     */
    readonly HEADER_KEY: "Authorization";
    /**
     * Token prefix for Bearer authentication
     */
    readonly TOKEN_PREFIX: "Bearer ";
    /**
     * Cookie prefix for ObjectStack auth cookies
     */
    readonly COOKIE_PREFIX: "os_";
    /**
     * CSRF token header name
     */
    readonly CSRF_HEADER: "x-os-csrf-token";
    /**
     * Default session cookie name
     */
    readonly SESSION_COOKIE: "os_session_token";
    /**
     * Default CSRF cookie name
     */
    readonly CSRF_COOKIE: "os_csrf_token";
    /**
     * Refresh token cookie name
     */
    readonly REFRESH_TOKEN_COOKIE: "os_refresh_token";
};
/**
 * Authentication Headers Interface
 * Standard headers used in authenticated requests
 */
interface AuthHeaders {
    /**
     * Authorization header with Bearer token
     * @example "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
     */
    Authorization?: string;
    /**
     * CSRF token header
     * @example "x-os-csrf-token: abc123def456..."
     */
    'x-os-csrf-token'?: string;
    /**
     * Session ID header (alternative to cookie)
     * @example "x-os-session-id: session_abc123..."
     */
    'x-os-session-id'?: string;
    /**
     * API key header (for service-to-service auth)
     * @example "x-os-api-key: sk_live_abc123..."
     */
    'x-os-api-key'?: string;
}
/**
 * Authentication Response Interface
 * Standard response format for authentication operations
 */
interface AuthResponse {
    /**
     * Access token (JWT or opaque token)
     */
    accessToken: string;
    /**
     * Refresh token (for token renewal)
     */
    refreshToken?: string;
    /**
     * Token type (usually "Bearer")
     */
    tokenType: string;
    /**
     * Token expiry in seconds
     */
    expiresIn: number;
    /**
     * User information
     */
    user: {
        id: string;
        email: string;
        name?: string;
        image?: string;
    };
    /**
     * Session ID
     */
    sessionId?: string;
}
/**
 * Authentication Error Codes
 * Standard error codes for authentication failures
 */
declare const AUTH_ERROR_CODES: {
    readonly INVALID_CREDENTIALS: "invalid_credentials";
    readonly INVALID_TOKEN: "invalid_token";
    readonly TOKEN_EXPIRED: "token_expired";
    readonly INSUFFICIENT_PERMISSIONS: "insufficient_permissions";
    readonly ACCOUNT_LOCKED: "account_locked";
    readonly ACCOUNT_NOT_VERIFIED: "account_not_verified";
    readonly TOO_MANY_REQUESTS: "too_many_requests";
    readonly INVALID_CSRF_TOKEN: "invalid_csrf_token";
    readonly SESSION_EXPIRED: "session_expired";
    readonly OAUTH_ERROR: "oauth_error";
    readonly PROVIDER_ERROR: "provider_error";
};
/**
 * Authentication Error Interface
 * Standard error response format
 */
interface AuthError {
    /**
     * Error code from AUTH_ERROR_CODES
     */
    code: typeof AUTH_ERROR_CODES[keyof typeof AUTH_ERROR_CODES];
    /**
     * Human-readable error message
     */
    message: string;
    /**
     * Additional error details
     */
    details?: Record<string, any>;
}
/**
 * Token Payload Interface
 * Standard JWT payload structure
 */
interface TokenPayload {
    /**
     * Subject (user ID)
     */
    sub: string;
    /**
     * Issued at timestamp
     */
    iat: number;
    /**
     * Expiration timestamp
     */
    exp: number;
    /**
     * Session ID
     */
    sid?: string;
    /**
     * User email
     */
    email?: string;
    /**
     * User roles
     */
    roles?: string[];
    /**
     * User permissions
     */
    permissions?: string[];
    /**
     * Additional custom claims
     */
    [key: string]: any;
}

/**
 * Role Schema (aka Business Unit / Org Unit)
 * Defines the organizational hierarchy (Reporting Structure).
 *
 * COMPARISON:
 * - Salesforce: "Role" (Hierarchy for visibility rollup)
 * - Microsoft: "Business Unit" (Structural container for data)
 * - Kubernetes/AWS: "Role" usually refers to Permissions (we use PermissionSet for that)
 *
 * ROLES IN OBJECTSTACK:
 * Used primarily for "Reporting Structure" - Managers see subordinates' data.
 *
 * **NAMING CONVENTION:**
 * Role names MUST be lowercase snake_case to prevent security issues.
 *
 * @example Good role names
 * - 'sales_manager'
 * - 'ceo'
 * - 'region_east_vp'
 * - 'engineering_lead'
 *
 * @example Bad role names (will be rejected)
 * - 'SalesManager' (camelCase)
 * - 'CEO' (uppercase)
 * - 'Region East VP' (spaces and uppercase)
 */
declare const RoleSchema: z.ZodObject<{
    name: z.ZodString;
    label: z.ZodString;
    parent: z.ZodOptional<z.ZodString>;
    description: z.ZodOptional<z.ZodString>;
}, z.core.$strip>;
type Role = z.infer<typeof RoleSchema>;

/**
 * Organization Schema (Multi-Tenant Architecture)
 *
 * Defines the standard organization/workspace model for ObjectStack.
 * Supports B2B SaaS scenarios where users belong to multiple teams/workspaces.
 *
 * This aligns with better-auth's organization plugin capabilities.
 */
/**
 * Organization Schema
 * Represents a team, workspace, or tenant in a multi-tenant application
 */
declare const OrganizationSchema: z.ZodObject<{
    id: z.ZodString;
    name: z.ZodString;
    slug: z.ZodString;
    logo: z.ZodOptional<z.ZodString>;
    metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
    createdAt: z.ZodString;
    updatedAt: z.ZodString;
}, z.core.$strip>;
type Organization = z.infer<typeof OrganizationSchema>;
/**
 * Organization Member Schema
 * Links users to organizations with specific roles
 */
declare const MemberSchema: z.ZodObject<{
    id: z.ZodString;
    organizationId: z.ZodString;
    userId: z.ZodString;
    role: z.ZodString;
    createdAt: z.ZodString;
    updatedAt: z.ZodString;
}, z.core.$strip>;
type Member = z.infer<typeof MemberSchema>;
/**
 * Invitation Status Enum
 */
declare const InvitationStatus: z.ZodEnum<{
    pending: "pending";
    expired: "expired";
    rejected: "rejected";
    accepted: "accepted";
}>;
type InvitationStatus = z.infer<typeof InvitationStatus>;
/**
 * Organization Invitation Schema
 * Represents an invitation to join an organization
 */
declare const InvitationSchema: z.ZodObject<{
    id: z.ZodString;
    organizationId: z.ZodString;
    email: z.ZodString;
    role: z.ZodString;
    status: z.ZodDefault<z.ZodEnum<{
        pending: "pending";
        expired: "expired";
        rejected: "rejected";
        accepted: "accepted";
    }>>;
    expiresAt: z.ZodString;
    inviterId: z.ZodString;
    createdAt: z.ZodString;
    updatedAt: z.ZodString;
}, z.core.$strip>;
type Invitation = z.infer<typeof InvitationSchema>;

/**
 * # SCIM 2.0 Protocol Implementation
 *
 * System for Cross-domain Identity Management (SCIM) 2.0 specification
 * implementation for ObjectStack.
 *
 * ## Overview
 *
 * SCIM 2.0 is an HTTP-based protocol for managing user and group identities
 * across domains. It provides a standardized REST API for user provisioning,
 * de-provisioning, and synchronization.
 *
 * ## Use Cases
 *
 * 1. **Enterprise SSO Integration**
 *    - Integrate with Okta, Azure AD, OneLogin
 *    - Automatic user provisioning from corporate directory
 *    - Just-in-Time (JIT) user creation on first login
 *
 * 2. **User Lifecycle Management**
 *    - Automatically create users when they join organization
 *    - Update user attributes when they change roles
 *    - Deactivate users when they leave organization
 *
 * 3. **Group/Department Synchronization**
 *    - Sync organizational structure from AD/LDAP
 *    - Maintain group memberships automatically
 *    - Map corporate roles to application permissions
 *
 * 4. **Compliance & Audit**
 *    - Maintain accurate user directory
 *    - Track all identity changes
 *    - Meet SOX/HIPAA requirements for user management
 *
 * ## Specification References
 *
 * - **RFC 7643**: SCIM Core Schema
 * - **RFC 7644**: SCIM Protocol
 * - **RFC 7642**: SCIM Requirements
 *
 * ## Industry Implementations
 *
 * - **Okta**: Leading SCIM provider
 * - **Azure AD**: Microsoft's identity platform
 * - **OneLogin**: Enterprise SSO provider
 * - **Google Workspace**: Google's identity management
 *
 * @see https://datatracker.ietf.org/doc/html/rfc7643
 * @see https://datatracker.ietf.org/doc/html/rfc7644
 */
/**
 * SCIM Schema URIs
 * Standard schema identifiers defined in RFC 7643
 */
declare const SCIM_SCHEMAS: {
    readonly USER: "urn:ietf:params:scim:schemas:core:2.0:User";
    readonly GROUP: "urn:ietf:params:scim:schemas:core:2.0:Group";
    readonly ENTERPRISE_USER: "urn:ietf:params:scim:schemas:extension:enterprise:2.0:User";
    readonly RESOURCE_TYPE: "urn:ietf:params:scim:schemas:core:2.0:ResourceType";
    readonly SERVICE_PROVIDER_CONFIG: "urn:ietf:params:scim:schemas:core:2.0:ServiceProviderConfig";
    readonly SCHEMA: "urn:ietf:params:scim:schemas:core:2.0:Schema";
    readonly LIST_RESPONSE: "urn:ietf:params:scim:api:messages:2.0:ListResponse";
    readonly PATCH_OP: "urn:ietf:params:scim:api:messages:2.0:PatchOp";
    readonly BULK_REQUEST: "urn:ietf:params:scim:api:messages:2.0:BulkRequest";
    readonly BULK_RESPONSE: "urn:ietf:params:scim:api:messages:2.0:BulkResponse";
    readonly ERROR: "urn:ietf:params:scim:api:messages:2.0:Error";
};
/**
 * SCIM Meta Schema
 * Common metadata for all SCIM resources
 */
declare const SCIMMetaSchema: z.ZodObject<{
    resourceType: z.ZodOptional<z.ZodString>;
    created: z.ZodOptional<z.ZodString>;
    lastModified: z.ZodOptional<z.ZodString>;
    location: z.ZodOptional<z.ZodString>;
    version: z.ZodOptional<z.ZodString>;
}, z.core.$strip>;
type SCIMMeta = z.infer<typeof SCIMMetaSchema>;
/**
 * SCIM Name Schema
 * Structured name components
 */
declare const SCIMNameSchema: z.ZodObject<{
    formatted: z.ZodOptional<z.ZodString>;
    familyName: z.ZodOptional<z.ZodString>;
    givenName: z.ZodOptional<z.ZodString>;
    middleName: z.ZodOptional<z.ZodString>;
    honorificPrefix: z.ZodOptional<z.ZodString>;
    honorificSuffix: z.ZodOptional<z.ZodString>;
}, z.core.$strip>;
type SCIMName = z.infer<typeof SCIMNameSchema>;
/**
 * SCIM Email Schema
 * Multi-valued email address
 */
declare const SCIMEmailSchema: z.ZodObject<{
    value: z.ZodString;
    type: z.ZodOptional<z.ZodEnum<{
        other: "other";
        home: "home";
        work: "work";
    }>>;
    display: z.ZodOptional<z.ZodString>;
    primary: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
}, z.core.$strip>;
type SCIMEmail = z.infer<typeof SCIMEmailSchema>;
/**
 * SCIM Phone Number Schema
 * Multi-valued phone number
 */
declare const SCIMPhoneNumberSchema: z.ZodObject<{
    value: z.ZodString;
    type: z.ZodOptional<z.ZodEnum<{
        other: "other";
        home: "home";
        mobile: "mobile";
        work: "work";
        fax: "fax";
        pager: "pager";
    }>>;
    display: z.ZodOptional<z.ZodString>;
    primary: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
}, z.core.$strip>;
type SCIMPhoneNumber = z.infer<typeof SCIMPhoneNumberSchema>;
/**
 * SCIM Address Schema
 * Multi-valued physical mailing address
 */
declare const SCIMAddressSchema: z.ZodObject<{
    formatted: z.ZodOptional<z.ZodString>;
    streetAddress: z.ZodOptional<z.ZodString>;
    locality: z.ZodOptional<z.ZodString>;
    region: z.ZodOptional<z.ZodString>;
    postalCode: z.ZodOptional<z.ZodString>;
    country: z.ZodOptional<z.ZodString>;
    type: z.ZodOptional<z.ZodEnum<{
        other: "other";
        home: "home";
        work: "work";
    }>>;
    primary: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
}, z.core.$strip>;
type SCIMAddress = z.infer<typeof SCIMAddressSchema>;
/**
 * SCIM Group Reference
 * Reference to a group the user belongs to
 */
declare const SCIMGroupReferenceSchema: z.ZodObject<{
    value: z.ZodString;
    $ref: z.ZodOptional<z.ZodString>;
    display: z.ZodOptional<z.ZodString>;
    type: z.ZodOptional<z.ZodEnum<{
        direct: "direct";
        indirect: "indirect";
    }>>;
}, z.core.$strip>;
type SCIMGroupReference = z.infer<typeof SCIMGroupReferenceSchema>;
/**
 * SCIM Enterprise User Extension
 * Enterprise-specific user attributes
 */
declare const SCIMEnterpriseUserSchema: z.ZodObject<{
    employeeNumber: z.ZodOptional<z.ZodString>;
    costCenter: z.ZodOptional<z.ZodString>;
    organization: z.ZodOptional<z.ZodString>;
    division: z.ZodOptional<z.ZodString>;
    department: z.ZodOptional<z.ZodString>;
    manager: z.ZodOptional<z.ZodObject<{
        value: z.ZodString;
        $ref: z.ZodOptional<z.ZodString>;
        displayName: z.ZodOptional<z.ZodString>;
    }, z.core.$strip>>;
}, z.core.$strip>;
type SCIMEnterpriseUser = z.infer<typeof SCIMEnterpriseUserSchema>;
/**
 * SCIM User Schema (Core)
 * Complete SCIM 2.0 User resource
 */
declare const SCIMUserSchema: z.ZodObject<{
    schemas: z.ZodDefault<z.ZodArray<z.ZodString>>;
    id: z.ZodOptional<z.ZodString>;
    externalId: z.ZodOptional<z.ZodString>;
    userName: z.ZodString;
    name: z.ZodOptional<z.ZodObject<{
        formatted: z.ZodOptional<z.ZodString>;
        familyName: z.ZodOptional<z.ZodString>;
        givenName: z.ZodOptional<z.ZodString>;
        middleName: z.ZodOptional<z.ZodString>;
        honorificPrefix: z.ZodOptional<z.ZodString>;
        honorificSuffix: z.ZodOptional<z.ZodString>;
    }, z.core.$strip>>;
    displayName: z.ZodOptional<z.ZodString>;
    nickName: z.ZodOptional<z.ZodString>;
    profileUrl: z.ZodOptional<z.ZodString>;
    title: z.ZodOptional<z.ZodString>;
    userType: z.ZodOptional<z.ZodString>;
    preferredLanguage: z.ZodOptional<z.ZodString>;
    locale: z.ZodOptional<z.ZodString>;
    timezone: z.ZodOptional<z.ZodString>;
    active: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
    password: z.ZodOptional<z.ZodString>;
    emails: z.ZodOptional<z.ZodArray<z.ZodObject<{
        value: z.ZodString;
        type: z.ZodOptional<z.ZodEnum<{
            other: "other";
            home: "home";
            work: "work";
        }>>;
        display: z.ZodOptional<z.ZodString>;
        primary: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
    }, z.core.$strip>>>;
    phoneNumbers: z.ZodOptional<z.ZodArray<z.ZodObject<{
        value: z.ZodString;
        type: z.ZodOptional<z.ZodEnum<{
            other: "other";
            home: "home";
            mobile: "mobile";
            work: "work";
            fax: "fax";
            pager: "pager";
        }>>;
        display: z.ZodOptional<z.ZodString>;
        primary: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
    }, z.core.$strip>>>;
    ims: z.ZodOptional<z.ZodArray<z.ZodObject<{
        value: z.ZodString;
        type: z.ZodOptional<z.ZodString>;
        primary: z.ZodOptional<z.ZodBoolean>;
    }, z.core.$strip>>>;
    photos: z.ZodOptional<z.ZodArray<z.ZodObject<{
        value: z.ZodString;
        type: z.ZodOptional<z.ZodEnum<{
            photo: "photo";
            thumbnail: "thumbnail";
        }>>;
        primary: z.ZodOptional<z.ZodBoolean>;
    }, z.core.$strip>>>;
    addresses: z.ZodOptional<z.ZodArray<z.ZodObject<{
        formatted: z.ZodOptional<z.ZodString>;
        streetAddress: z.ZodOptional<z.ZodString>;
        locality: z.ZodOptional<z.ZodString>;
        region: z.ZodOptional<z.ZodString>;
        postalCode: z.ZodOptional<z.ZodString>;
        country: z.ZodOptional<z.ZodString>;
        type: z.ZodOptional<z.ZodEnum<{
            other: "other";
            home: "home";
            work: "work";
        }>>;
        primary: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
    }, z.core.$strip>>>;
    groups: z.ZodOptional<z.ZodArray<z.ZodObject<{
        value: z.ZodString;
        $ref: z.ZodOptional<z.ZodString>;
        display: z.ZodOptional<z.ZodString>;
        type: z.ZodOptional<z.ZodEnum<{
            direct: "direct";
            indirect: "indirect";
        }>>;
    }, z.core.$strip>>>;
    entitlements: z.ZodOptional<z.ZodArray<z.ZodObject<{
        value: z.ZodString;
        type: z.ZodOptional<z.ZodString>;
        primary: z.ZodOptional<z.ZodBoolean>;
    }, z.core.$strip>>>;
    roles: z.ZodOptional<z.ZodArray<z.ZodObject<{
        value: z.ZodString;
        type: z.ZodOptional<z.ZodString>;
        primary: z.ZodOptional<z.ZodBoolean>;
    }, z.core.$strip>>>;
    x509Certificates: z.ZodOptional<z.ZodArray<z.ZodObject<{
        value: z.ZodString;
        type: z.ZodOptional<z.ZodString>;
        primary: z.ZodOptional<z.ZodBoolean>;
    }, z.core.$strip>>>;
    meta: z.ZodOptional<z.ZodObject<{
        resourceType: z.ZodOptional<z.ZodString>;
        created: z.ZodOptional<z.ZodString>;
        lastModified: z.ZodOptional<z.ZodString>;
        location: z.ZodOptional<z.ZodString>;
        version: z.ZodOptional<z.ZodString>;
    }, z.core.$strip>>;
    "urn:ietf:params:scim:schemas:extension:enterprise:2.0:User": z.ZodOptional<z.ZodObject<{
        employeeNumber: z.ZodOptional<z.ZodString>;
        costCenter: z.ZodOptional<z.ZodString>;
        organization: z.ZodOptional<z.ZodString>;
        division: z.ZodOptional<z.ZodString>;
        department: z.ZodOptional<z.ZodString>;
        manager: z.ZodOptional<z.ZodObject<{
            value: z.ZodString;
            $ref: z.ZodOptional<z.ZodString>;
            displayName: z.ZodOptional<z.ZodString>;
        }, z.core.$strip>>;
    }, z.core.$strip>>;
}, z.core.$strip>;
type SCIMUser = z.infer<typeof SCIMUserSchema>;
/**
 * SCIM Member Reference
 * Reference to a member in a group
 */
declare const SCIMMemberReferenceSchema: z.ZodObject<{
    value: z.ZodString;
    $ref: z.ZodOptional<z.ZodString>;
    type: z.ZodOptional<z.ZodEnum<{
        User: "User";
        Group: "Group";
    }>>;
    display: z.ZodOptional<z.ZodString>;
}, z.core.$strip>;
type SCIMMemberReference = z.infer<typeof SCIMMemberReferenceSchema>;
/**
 * SCIM Group Schema
 * Complete SCIM 2.0 Group resource
 */
declare const SCIMGroupSchema: z.ZodObject<{
    schemas: z.ZodDefault<z.ZodArray<z.ZodString>>;
    id: z.ZodOptional<z.ZodString>;
    externalId: z.ZodOptional<z.ZodString>;
    displayName: z.ZodString;
    members: z.ZodOptional<z.ZodArray<z.ZodObject<{
        value: z.ZodString;
        $ref: z.ZodOptional<z.ZodString>;
        type: z.ZodOptional<z.ZodEnum<{
            User: "User";
            Group: "Group";
        }>>;
        display: z.ZodOptional<z.ZodString>;
    }, z.core.$strip>>>;
    meta: z.ZodOptional<z.ZodObject<{
        resourceType: z.ZodOptional<z.ZodString>;
        created: z.ZodOptional<z.ZodString>;
        lastModified: z.ZodOptional<z.ZodString>;
        location: z.ZodOptional<z.ZodString>;
        version: z.ZodOptional<z.ZodString>;
    }, z.core.$strip>>;
}, z.core.$strip>;
type SCIMGroup = z.infer<typeof SCIMGroupSchema>;
/**
 * SCIM Resource Union Type
 * Known SCIM resource types for type-safe list responses
 */
type SCIMResource = SCIMUser | SCIMGroup;
/**
 * SCIM List Response
 * Paginated list of resources
 *
 * Generic type T allows for type-safe responses when the resource type is known.
 * For mixed resource types, use SCIMResource union.
 */
declare const SCIMListResponseSchema: z.ZodObject<{
    schemas: z.ZodDefault<z.ZodArray<z.ZodString>>;
    totalResults: z.ZodNumber;
    Resources: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
        schemas: z.ZodDefault<z.ZodArray<z.ZodString>>;
        id: z.ZodOptional<z.ZodString>;
        externalId: z.ZodOptional<z.ZodString>;
        userName: z.ZodString;
        name: z.ZodOptional<z.ZodObject<{
            formatted: z.ZodOptional<z.ZodString>;
            familyName: z.ZodOptional<z.ZodString>;
            givenName: z.ZodOptional<z.ZodString>;
            middleName: z.ZodOptional<z.ZodString>;
            honorificPrefix: z.ZodOptional<z.ZodString>;
            honorificSuffix: z.ZodOptional<z.ZodString>;
        }, z.core.$strip>>;
        displayName: z.ZodOptional<z.ZodString>;
        nickName: z.ZodOptional<z.ZodString>;
        profileUrl: z.ZodOptional<z.ZodString>;
        title: z.ZodOptional<z.ZodString>;
        userType: z.ZodOptional<z.ZodString>;
        preferredLanguage: z.ZodOptional<z.ZodString>;
        locale: z.ZodOptional<z.ZodString>;
        timezone: z.ZodOptional<z.ZodString>;
        active: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
        password: z.ZodOptional<z.ZodString>;
        emails: z.ZodOptional<z.ZodArray<z.ZodObject<{
            value: z.ZodString;
            type: z.ZodOptional<z.ZodEnum<{
                other: "other";
                home: "home";
                work: "work";
            }>>;
            display: z.ZodOptional<z.ZodString>;
            primary: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
        }, z.core.$strip>>>;
        phoneNumbers: z.ZodOptional<z.ZodArray<z.ZodObject<{
            value: z.ZodString;
            type: z.ZodOptional<z.ZodEnum<{
                other: "other";
                home: "home";
                mobile: "mobile";
                work: "work";
                fax: "fax";
                pager: "pager";
            }>>;
            display: z.ZodOptional<z.ZodString>;
            primary: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
        }, z.core.$strip>>>;
        ims: z.ZodOptional<z.ZodArray<z.ZodObject<{
            value: z.ZodString;
            type: z.ZodOptional<z.ZodString>;
            primary: z.ZodOptional<z.ZodBoolean>;
        }, z.core.$strip>>>;
        photos: z.ZodOptional<z.ZodArray<z.ZodObject<{
            value: z.ZodString;
            type: z.ZodOptional<z.ZodEnum<{
                photo: "photo";
                thumbnail: "thumbnail";
            }>>;
            primary: z.ZodOptional<z.ZodBoolean>;
        }, z.core.$strip>>>;
        addresses: z.ZodOptional<z.ZodArray<z.ZodObject<{
            formatted: z.ZodOptional<z.ZodString>;
            streetAddress: z.ZodOptional<z.ZodString>;
            locality: z.ZodOptional<z.ZodString>;
            region: z.ZodOptional<z.ZodString>;
            postalCode: z.ZodOptional<z.ZodString>;
            country: z.ZodOptional<z.ZodString>;
            type: z.ZodOptional<z.ZodEnum<{
                other: "other";
                home: "home";
                work: "work";
            }>>;
            primary: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
        }, z.core.$strip>>>;
        groups: z.ZodOptional<z.ZodArray<z.ZodObject<{
            value: z.ZodString;
            $ref: z.ZodOptional<z.ZodString>;
            display: z.ZodOptional<z.ZodString>;
            type: z.ZodOptional<z.ZodEnum<{
                direct: "direct";
                indirect: "indirect";
            }>>;
        }, z.core.$strip>>>;
        entitlements: z.ZodOptional<z.ZodArray<z.ZodObject<{
            value: z.ZodString;
            type: z.ZodOptional<z.ZodString>;
            primary: z.ZodOptional<z.ZodBoolean>;
        }, z.core.$strip>>>;
        roles: z.ZodOptional<z.ZodArray<z.ZodObject<{
            value: z.ZodString;
            type: z.ZodOptional<z.ZodString>;
            primary: z.ZodOptional<z.ZodBoolean>;
        }, z.core.$strip>>>;
        x509Certificates: z.ZodOptional<z.ZodArray<z.ZodObject<{
            value: z.ZodString;
            type: z.ZodOptional<z.ZodString>;
            primary: z.ZodOptional<z.ZodBoolean>;
        }, z.core.$strip>>>;
        meta: z.ZodOptional<z.ZodObject<{
            resourceType: z.ZodOptional<z.ZodString>;
            created: z.ZodOptional<z.ZodString>;
            lastModified: z.ZodOptional<z.ZodString>;
            location: z.ZodOptional<z.ZodString>;
            version: z.ZodOptional<z.ZodString>;
        }, z.core.$strip>>;
        "urn:ietf:params:scim:schemas:extension:enterprise:2.0:User": z.ZodOptional<z.ZodObject<{
            employeeNumber: z.ZodOptional<z.ZodString>;
            costCenter: z.ZodOptional<z.ZodString>;
            organization: z.ZodOptional<z.ZodString>;
            division: z.ZodOptional<z.ZodString>;
            department: z.ZodOptional<z.ZodString>;
            manager: z.ZodOptional<z.ZodObject<{
                value: z.ZodString;
                $ref: z.ZodOptional<z.ZodString>;
                displayName: z.ZodOptional<z.ZodString>;
            }, z.core.$strip>>;
        }, z.core.$strip>>;
    }, z.core.$strip>, z.ZodObject<{
        schemas: z.ZodDefault<z.ZodArray<z.ZodString>>;
        id: z.ZodOptional<z.ZodString>;
        externalId: z.ZodOptional<z.ZodString>;
        displayName: z.ZodString;
        members: z.ZodOptional<z.ZodArray<z.ZodObject<{
            value: z.ZodString;
            $ref: z.ZodOptional<z.ZodString>;
            type: z.ZodOptional<z.ZodEnum<{
                User: "User";
                Group: "Group";
            }>>;
            display: z.ZodOptional<z.ZodString>;
        }, z.core.$strip>>>;
        meta: z.ZodOptional<z.ZodObject<{
            resourceType: z.ZodOptional<z.ZodString>;
            created: z.ZodOptional<z.ZodString>;
            lastModified: z.ZodOptional<z.ZodString>;
            location: z.ZodOptional<z.ZodString>;
            version: z.ZodOptional<z.ZodString>;
        }, z.core.$strip>>;
    }, z.core.$strip>, z.ZodRecord<z.ZodString, z.ZodUnknown>]>>;
    startIndex: z.ZodOptional<z.ZodNumber>;
    itemsPerPage: z.ZodOptional<z.ZodNumber>;
}, z.core.$strip>;
type SCIMListResponse = z.infer<typeof SCIMListResponseSchema>;
/**
 * SCIM Error Response
 * Error response format
 */
declare const SCIMErrorSchema: z.ZodObject<{
    schemas: z.ZodDefault<z.ZodArray<z.ZodString>>;
    status: z.ZodNumber;
    scimType: z.ZodOptional<z.ZodEnum<{
        uniqueness: "uniqueness";
        invalidFilter: "invalidFilter";
        tooMany: "tooMany";
        mutability: "mutability";
        invalidSyntax: "invalidSyntax";
        invalidPath: "invalidPath";
        noTarget: "noTarget";
        invalidValue: "invalidValue";
        invalidVers: "invalidVers";
        sensitive: "sensitive";
    }>>;
    detail: z.ZodOptional<z.ZodString>;
}, z.core.$strip>;
type SCIMError = z.infer<typeof SCIMErrorSchema>;
/**
 * SCIM Patch Operation
 * For PATCH requests
 */
declare const SCIMPatchOperationSchema: z.ZodObject<{
    op: z.ZodEnum<{
        replace: "replace";
        add: "add";
        remove: "remove";
    }>;
    path: z.ZodOptional<z.ZodString>;
    value: z.ZodOptional<z.ZodUnknown>;
}, z.core.$strip>;
type SCIMPatchOperation = z.infer<typeof SCIMPatchOperationSchema>;
/**
 * SCIM Patch Request
 */
declare const SCIMPatchRequestSchema: z.ZodObject<{
    schemas: z.ZodDefault<z.ZodArray<z.ZodString>>;
    Operations: z.ZodArray<z.ZodObject<{
        op: z.ZodEnum<{
            replace: "replace";
            add: "add";
            remove: "remove";
        }>;
        path: z.ZodOptional<z.ZodString>;
        value: z.ZodOptional<z.ZodUnknown>;
    }, z.core.$strip>>;
}, z.core.$strip>;
type SCIMPatchRequest = z.infer<typeof SCIMPatchRequestSchema>;
/**
 * Helper factory for creating SCIM resources
 */
declare const SCIM: {
    /**
     * Create a basic SCIM user
     */
    readonly user: (userName: string, email: string, givenName?: string, familyName?: string) => SCIMUser;
    /**
     * Create a SCIM group
     */
    readonly group: (displayName: string, members?: SCIMMemberReference[]) => SCIMGroup;
    /**
     * Create a list response
     */
    readonly listResponse: <T>(resources: T[], totalResults?: number) => SCIMListResponse;
    /**
     * Create an error response
     */
    readonly error: (status: number, detail: string, scimType?: "invalidFilter" | "tooMany" | "uniqueness" | "mutability" | "invalidSyntax" | "invalidPath" | "noTarget" | "invalidValue" | "invalidVers" | "sensitive") => SCIMError;
};
/**
 * SCIM Bulk Operation Schema
 * A single operation within a bulk request
 */
declare const SCIMBulkOperationSchema: z.ZodObject<{
    method: z.ZodEnum<{
        POST: "POST";
        PUT: "PUT";
        DELETE: "DELETE";
        PATCH: "PATCH";
    }>;
    path: z.ZodString;
    bulkId: z.ZodOptional<z.ZodString>;
    data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
    version: z.ZodOptional<z.ZodString>;
}, z.core.$strip>;
type SCIMBulkOperation = z.infer<typeof SCIMBulkOperationSchema>;
/**
 * SCIM Bulk Request Schema
 * Batch multiple SCIM operations into a single HTTP request
 */
declare const SCIMBulkRequestSchema: z.ZodObject<{
    schemas: z.ZodDefault<z.ZodArray<z.ZodLiteral<"urn:ietf:params:scim:api:messages:2.0:BulkRequest">>>;
    operations: z.ZodArray<z.ZodObject<{
        method: z.ZodEnum<{
            POST: "POST";
            PUT: "PUT";
            DELETE: "DELETE";
            PATCH: "PATCH";
        }>;
        path: z.ZodString;
        bulkId: z.ZodOptional<z.ZodString>;
        data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
        version: z.ZodOptional<z.ZodString>;
    }, z.core.$strip>>;
    failOnErrors: z.ZodOptional<z.ZodNumber>;
}, z.core.$strip>;
type SCIMBulkRequest = z.infer<typeof SCIMBulkRequestSchema>;
/**
 * SCIM Bulk Response Operation Schema
 * Result of a single operation within a bulk response
 */
declare const SCIMBulkResponseOperationSchema: z.ZodObject<{
    method: z.ZodEnum<{
        POST: "POST";
        PUT: "PUT";
        DELETE: "DELETE";
        PATCH: "PATCH";
    }>;
    bulkId: z.ZodOptional<z.ZodString>;
    location: z.ZodOptional<z.ZodString>;
    status: z.ZodString;
    response: z.ZodOptional<z.ZodUnknown>;
}, z.core.$strip>;
type SCIMBulkResponseOperation = z.infer<typeof SCIMBulkResponseOperationSchema>;
/**
 * SCIM Bulk Response Schema
 * Response to a bulk request containing results for each operation
 */
declare const SCIMBulkResponseSchema: z.ZodObject<{
    schemas: z.ZodDefault<z.ZodArray<z.ZodLiteral<"urn:ietf:params:scim:api:messages:2.0:BulkResponse">>>;
    operations: z.ZodArray<z.ZodObject<{
        method: z.ZodEnum<{
            POST: "POST";
            PUT: "PUT";
            DELETE: "DELETE";
            PATCH: "PATCH";
        }>;
        bulkId: z.ZodOptional<z.ZodString>;
        location: z.ZodOptional<z.ZodString>;
        status: z.ZodString;
        response: z.ZodOptional<z.ZodUnknown>;
    }, z.core.$strip>>;
}, z.core.$strip>;
type SCIMBulkResponse = z.infer<typeof SCIMBulkResponseSchema>;

declare const index_AUTH_CONSTANTS: typeof AUTH_CONSTANTS;
declare const index_AUTH_ERROR_CODES: typeof AUTH_ERROR_CODES;
type index_Account = Account;
declare const index_AccountSchema: typeof AccountSchema;
type index_ApiKey = ApiKey;
declare const index_ApiKeySchema: typeof ApiKeySchema;
type index_AuthError = AuthError;
type index_AuthHeaders = AuthHeaders;
type index_AuthResponse = AuthResponse;
type index_Invitation = Invitation;
declare const index_InvitationSchema: typeof InvitationSchema;
type index_InvitationStatus = InvitationStatus;
type index_Member = Member;
declare const index_MemberSchema: typeof MemberSchema;
type index_Organization = Organization;
declare const index_OrganizationSchema: typeof OrganizationSchema;
type index_Role = Role;
declare const index_RoleSchema: typeof RoleSchema;
declare const index_SCIM: typeof SCIM;
type index_SCIMAddress = SCIMAddress;
declare const index_SCIMAddressSchema: typeof SCIMAddressSchema;
type index_SCIMBulkOperation = SCIMBulkOperation;
declare const index_SCIMBulkOperationSchema: typeof SCIMBulkOperationSchema;
type index_SCIMBulkRequest = SCIMBulkRequest;
declare const index_SCIMBulkRequestSchema: typeof SCIMBulkRequestSchema;
type index_SCIMBulkResponse = SCIMBulkResponse;
type index_SCIMBulkResponseOperation = SCIMBulkResponseOperation;
declare const index_SCIMBulkResponseOperationSchema: typeof SCIMBulkResponseOperationSchema;
declare const index_SCIMBulkResponseSchema: typeof SCIMBulkResponseSchema;
type index_SCIMEmail = SCIMEmail;
declare const index_SCIMEmailSchema: typeof SCIMEmailSchema;
type index_SCIMEnterpriseUser = SCIMEnterpriseUser;
declare const index_SCIMEnterpriseUserSchema: typeof SCIMEnterpriseUserSchema;
type index_SCIMError = SCIMError;
declare const index_SCIMErrorSchema: typeof SCIMErrorSchema;
type index_SCIMGroup = SCIMGroup;
type index_SCIMGroupReference = SCIMGroupReference;
declare const index_SCIMGroupReferenceSchema: typeof SCIMGroupReferenceSchema;
declare const index_SCIMGroupSchema: typeof SCIMGroupSchema;
type index_SCIMListResponse = SCIMListResponse;
declare const index_SCIMListResponseSchema: typeof SCIMListResponseSchema;
type index_SCIMMemberReference = SCIMMemberReference;
declare const index_SCIMMemberReferenceSchema: typeof SCIMMemberReferenceSchema;
type index_SCIMMeta = SCIMMeta;
declare const index_SCIMMetaSchema: typeof SCIMMetaSchema;
type index_SCIMName = SCIMName;
declare const index_SCIMNameSchema: typeof SCIMNameSchema;
type index_SCIMPatchOperation = SCIMPatchOperation;
declare const index_SCIMPatchOperationSchema: typeof SCIMPatchOperationSchema;
type index_SCIMPatchRequest = SCIMPatchRequest;
declare const index_SCIMPatchRequestSchema: typeof SCIMPatchRequestSchema;
type index_SCIMPhoneNumber = SCIMPhoneNumber;
declare const index_SCIMPhoneNumberSchema: typeof SCIMPhoneNumberSchema;
type index_SCIMResource = SCIMResource;
type index_SCIMUser = SCIMUser;
declare const index_SCIMUserSchema: typeof SCIMUserSchema;
declare const index_SCIM_SCHEMAS: typeof SCIM_SCHEMAS;
type index_Session = Session;
declare const index_SessionSchema: typeof SessionSchema;
type index_TokenPayload = TokenPayload;
type index_User = User;
declare const index_UserSchema: typeof UserSchema;
type index_VerificationToken = VerificationToken;
declare const index_VerificationTokenSchema: typeof VerificationTokenSchema;
declare namespace index {
  export { index_AUTH_CONSTANTS as AUTH_CONSTANTS, index_AUTH_ERROR_CODES as AUTH_ERROR_CODES, type index_Account as Account, index_AccountSchema as AccountSchema, type index_ApiKey as ApiKey, index_ApiKeySchema as ApiKeySchema, type index_AuthError as AuthError, type index_AuthHeaders as AuthHeaders, type index_AuthResponse as AuthResponse, type index_Invitation as Invitation, index_InvitationSchema as InvitationSchema, type index_InvitationStatus as InvitationStatus, type index_Member as Member, index_MemberSchema as MemberSchema, type index_Organization as Organization, index_OrganizationSchema as OrganizationSchema, type index_Role as Role, index_RoleSchema as RoleSchema, index_SCIM as SCIM, type index_SCIMAddress as SCIMAddress, index_SCIMAddressSchema as SCIMAddressSchema, type index_SCIMBulkOperation as SCIMBulkOperation, index_SCIMBulkOperationSchema as SCIMBulkOperationSchema, type index_SCIMBulkRequest as SCIMBulkRequest, index_SCIMBulkRequestSchema as SCIMBulkRequestSchema, type index_SCIMBulkResponse as SCIMBulkResponse, type index_SCIMBulkResponseOperation as SCIMBulkResponseOperation, index_SCIMBulkResponseOperationSchema as SCIMBulkResponseOperationSchema, index_SCIMBulkResponseSchema as SCIMBulkResponseSchema, type index_SCIMEmail as SCIMEmail, index_SCIMEmailSchema as SCIMEmailSchema, type index_SCIMEnterpriseUser as SCIMEnterpriseUser, index_SCIMEnterpriseUserSchema as SCIMEnterpriseUserSchema, type index_SCIMError as SCIMError, index_SCIMErrorSchema as SCIMErrorSchema, type index_SCIMGroup as SCIMGroup, type index_SCIMGroupReference as SCIMGroupReference, index_SCIMGroupReferenceSchema as SCIMGroupReferenceSchema, index_SCIMGroupSchema as SCIMGroupSchema, type index_SCIMListResponse as SCIMListResponse, index_SCIMListResponseSchema as SCIMListResponseSchema, type index_SCIMMemberReference as SCIMMemberReference, index_SCIMMemberReferenceSchema as SCIMMemberReferenceSchema, type index_SCIMMeta as SCIMMeta, index_SCIMMetaSchema as SCIMMetaSchema, type index_SCIMName as SCIMName, index_SCIMNameSchema as SCIMNameSchema, type index_SCIMPatchOperation as SCIMPatchOperation, index_SCIMPatchOperationSchema as SCIMPatchOperationSchema, type index_SCIMPatchRequest as SCIMPatchRequest, index_SCIMPatchRequestSchema as SCIMPatchRequestSchema, type index_SCIMPhoneNumber as SCIMPhoneNumber, index_SCIMPhoneNumberSchema as SCIMPhoneNumberSchema, type index_SCIMResource as SCIMResource, type index_SCIMUser as SCIMUser, index_SCIMUserSchema as SCIMUserSchema, index_SCIM_SCHEMAS as SCIM_SCHEMAS, type index_Session as Session, index_SessionSchema as SessionSchema, type index_TokenPayload as TokenPayload, type index_User as User, index_UserSchema as UserSchema, type index_VerificationToken as VerificationToken, index_VerificationTokenSchema as VerificationTokenSchema };
}

export { type SCIMPatchOperation as $, AccountSchema as A, SCIMAddressSchema as B, type SCIMAddress as C, SCIMGroupReferenceSchema as D, type SCIMGroupReference as E, SCIMEnterpriseUserSchema as F, type SCIMEnterpriseUser as G, SCIMUserSchema as H, InvitationStatus as I, type SCIMUser as J, SCIMMemberReferenceSchema as K, type SCIMMemberReference as L, MemberSchema as M, SCIMGroupSchema as N, OrganizationSchema as O, type SCIMGroup as P, type SCIMResource as Q, RoleSchema as R, SessionSchema as S, type TokenPayload as T, UserSchema as U, VerificationTokenSchema as V, SCIMListResponseSchema as W, type SCIMListResponse as X, SCIMErrorSchema as Y, type SCIMError as Z, SCIMPatchOperationSchema as _, type User as a, SCIMPatchRequestSchema as a0, type SCIMPatchRequest as a1, SCIM as a2, SCIMBulkOperationSchema as a3, type SCIMBulkOperation as a4, SCIMBulkRequestSchema as a5, type SCIMBulkRequest as a6, SCIMBulkResponseOperationSchema as a7, type SCIMBulkResponseOperation as a8, SCIMBulkResponseSchema as a9, type SCIMBulkResponse as aa, type Account as b, type Session as c, type VerificationToken as d, ApiKeySchema as e, type ApiKey as f, AUTH_CONSTANTS as g, type AuthHeaders as h, index as i, type AuthResponse as j, AUTH_ERROR_CODES as k, type AuthError as l, type Role as m, type Organization as n, type Member as o, InvitationSchema as p, type Invitation as q, SCIM_SCHEMAS as r, SCIMMetaSchema as s, type SCIMMeta as t, SCIMNameSchema as u, type SCIMName as v, SCIMEmailSchema as w, type SCIMEmail as x, SCIMPhoneNumberSchema as y, type SCIMPhoneNumber as z };
