import { z } from "zod"; export declare const API_KEY_ACTIONS: readonly ["read", "write", "delete", "trigger", "relay", "search"]; export type ApiKeyAction = (typeof API_KEY_ACTIONS)[number]; export declare const API_KEY_RESOURCES: readonly ["availability", "bookings", "catalog", "crm", "cruises", "departures", "finance", "ground", "accommodations", "itineraries", "legal", "notifications", "pricing", "products", "resources", "storefront", "suppliers", "transactions", "webhooks", "workflows"]; export type ApiKeyResource = (typeof API_KEY_RESOURCES)[number]; export type ApiKeyPermissions = Record; export type ApiKeyPermissionString = "*" | "*:*" | `${string}:*` | `*:${string}` | `${string}:${string}`; export interface ApiKeyPermissionDescriptor { resource: string; action: string; label: string; description: string; } export interface ApiKeyPermissionGroup { resource: string; label: string; description: string; permissions: ApiKeyPermissionDescriptor[]; } export declare const API_KEY_PERMISSION_GROUPS: readonly [{ readonly resource: "catalog"; readonly label: "Catalog"; readonly description: "Search and read unified catalog content."; readonly permissions: [{ resource: string; action: string; label: string; description: string; }, { resource: string; action: string; label: string; description: string; }]; }, { readonly resource: "products"; readonly label: "Products"; readonly description: "Read and manage products, options, content, and media."; readonly permissions: [{ resource: string; action: string; label: string; description: string; }, { resource: string; action: string; label: string; description: string; }, { resource: string; action: string; label: string; description: string; }]; }, { readonly resource: "departures"; readonly label: "Departures"; readonly description: "Read and manage scheduled departures."; readonly permissions: [{ resource: string; action: string; label: string; description: string; }, { resource: string; action: string; label: string; description: string; }]; }, { readonly resource: "itineraries"; readonly label: "Itineraries"; readonly description: "Read and manage day-by-day itinerary content."; readonly permissions: [{ resource: string; action: string; label: string; description: string; }, { resource: string; action: string; label: string; description: string; }]; }, { readonly resource: "bookings"; readonly label: "Bookings"; readonly description: "Read and manage booking records and booking workflows."; readonly permissions: [{ resource: string; action: string; label: string; description: string; }, { resource: string; action: string; label: string; description: string; }, { resource: string; action: string; label: string; description: string; }]; }, { readonly resource: "availability"; readonly label: "Availability"; readonly description: "Read and manage availability rules, slots, and closeouts."; readonly permissions: [{ resource: string; action: string; label: string; description: string; }, { resource: string; action: string; label: string; description: string; }]; }, { readonly resource: "accommodations"; readonly label: "Accommodations"; readonly description: "Read and manage lodging catalog content, room options, and rate plans."; readonly permissions: [{ resource: string; action: string; label: string; description: string; }, { resource: string; action: string; label: string; description: string; }]; }, { readonly resource: "ground"; readonly label: "Ground"; readonly description: "Read and manage ground transport operations."; readonly permissions: [{ resource: string; action: string; label: string; description: string; }, { resource: string; action: string; label: string; description: string; }]; }, { readonly resource: "cruises"; readonly label: "Cruises"; readonly description: "Read and manage cruise products and sailing data."; readonly permissions: [{ resource: string; action: string; label: string; description: string; }, { resource: string; action: string; label: string; description: string; }]; }, { readonly resource: "workflows"; readonly label: "Workflows"; readonly description: "Trigger workflow automation from external systems."; readonly permissions: [{ resource: string; action: string; label: string; description: string; }]; }, { readonly resource: "webhooks"; readonly label: "Webhooks"; readonly description: "Relay webhook events into Voyant runtimes."; readonly permissions: [{ resource: string; action: string; label: string; description: string; }]; }]; export declare const API_KEY_PERMISSION_PRESETS: { readonly "catalog-read": { readonly label: "Catalog read"; readonly description: "Read/search catalog, product, departure, and itinerary content."; readonly permissions: { readonly catalog: ["read", "search"]; readonly products: ["read"]; readonly departures: ["read"]; readonly itineraries: ["read"]; }; }; readonly "commerce-read": { readonly label: "Commerce read"; readonly description: "Read bookings, availability, products, pricing, and suppliers."; readonly permissions: { readonly bookings: ["read"]; readonly availability: ["read"]; readonly products: ["read"]; readonly pricing: ["read"]; readonly suppliers: ["read"]; }; }; readonly automation: { readonly label: "Automation"; readonly description: "Trigger workflows and relay webhooks."; readonly permissions: { readonly workflows: ["trigger"]; readonly webhooks: ["relay"]; }; }; readonly "read-only": { readonly label: "Read only"; readonly description: "Read across every resource that accepts API tokens."; readonly permissions: { readonly "*": ["read"]; }; }; readonly "full-access": { readonly label: "Full access"; readonly description: "All resources and all actions. Use only for trusted automation."; readonly permissions: { readonly "*": ["*"]; }; }; }; export type ApiKeyPermissionPresetKey = keyof typeof API_KEY_PERMISSION_PRESETS; export declare const apiKeyPermissionStringSchema: z.ZodString & z.ZodType>; export declare const apiKeyPermissionsSchema: z.ZodPipe>, z.ZodTransform>>; export declare function normalizeApiKeyPermissions(permissions: string | ApiKeyPermissions | null | undefined): ApiKeyPermissions; export declare function permissionStringsToPermissions(permissions: readonly string[]): ApiKeyPermissions; export declare function permissionsToStrings(permissions: string | ApiKeyPermissions | null | undefined): ApiKeyPermissionString[]; export declare function hasApiKeyPermission(permissions: string | ApiKeyPermissions | null | undefined, resource: string, action: string): boolean; export declare function hasApiKeyPermissions(permissions: string | ApiKeyPermissions | null | undefined, required: ApiKeyPermissions): boolean; export declare function describePermissions(permissions: string | ApiKeyPermissions | null | undefined): string; export declare const EXPIRATION_PRESETS: { readonly never: { readonly label: "Never"; readonly days: null; }; readonly "7days": { readonly label: "7 days"; readonly days: 7; }; readonly "30days": { readonly label: "30 days"; readonly days: 30; }; readonly "90days": { readonly label: "90 days"; readonly days: 90; }; readonly "180days": { readonly label: "6 months"; readonly days: 180; }; readonly "365days": { readonly label: "1 year"; readonly days: 365; }; readonly custom: { readonly label: "Custom date"; readonly days: null; }; }; export type ExpirationPresetKey = keyof typeof EXPIRATION_PRESETS; export declare function calculateExpirationDate(preset: ExpirationPresetKey, customDate?: Date): Date | null; /** @deprecated Use ApiKeyPermissionString. */ export type ApiKeyScope = ApiKeyPermissionString; /** @deprecated Use ApiKeyPermissionDescriptor. */ export type ApiKeyScopeDescriptor = ApiKeyPermissionDescriptor & { scope: ApiKeyPermissionString; }; /** @deprecated Use API_KEY_PERMISSION_GROUPS. */ export declare const API_KEY_SCOPE_GROUPS: ({ scopes: { scope: ApiKeyPermissionString; resource: string; action: string; label: string; description: string; }[]; resource: "catalog"; label: "Catalog"; description: "Search and read unified catalog content."; permissions: [{ resource: string; action: string; label: string; description: string; }, { resource: string; action: string; label: string; description: string; }]; } | { scopes: { scope: ApiKeyPermissionString; resource: string; action: string; label: string; description: string; }[]; resource: "products"; label: "Products"; description: "Read and manage products, options, content, and media."; permissions: [{ resource: string; action: string; label: string; description: string; }, { resource: string; action: string; label: string; description: string; }, { resource: string; action: string; label: string; description: string; }]; } | { scopes: { scope: ApiKeyPermissionString; resource: string; action: string; label: string; description: string; }[]; resource: "departures"; label: "Departures"; description: "Read and manage scheduled departures."; permissions: [{ resource: string; action: string; label: string; description: string; }, { resource: string; action: string; label: string; description: string; }]; } | { scopes: { scope: ApiKeyPermissionString; resource: string; action: string; label: string; description: string; }[]; resource: "itineraries"; label: "Itineraries"; description: "Read and manage day-by-day itinerary content."; permissions: [{ resource: string; action: string; label: string; description: string; }, { resource: string; action: string; label: string; description: string; }]; } | { scopes: { scope: ApiKeyPermissionString; resource: string; action: string; label: string; description: string; }[]; resource: "bookings"; label: "Bookings"; description: "Read and manage booking records and booking workflows."; permissions: [{ resource: string; action: string; label: string; description: string; }, { resource: string; action: string; label: string; description: string; }, { resource: string; action: string; label: string; description: string; }]; } | { scopes: { scope: ApiKeyPermissionString; resource: string; action: string; label: string; description: string; }[]; resource: "availability"; label: "Availability"; description: "Read and manage availability rules, slots, and closeouts."; permissions: [{ resource: string; action: string; label: string; description: string; }, { resource: string; action: string; label: string; description: string; }]; } | { scopes: { scope: ApiKeyPermissionString; resource: string; action: string; label: string; description: string; }[]; resource: "accommodations"; label: "Accommodations"; description: "Read and manage lodging catalog content, room options, and rate plans."; permissions: [{ resource: string; action: string; label: string; description: string; }, { resource: string; action: string; label: string; description: string; }]; } | { scopes: { scope: ApiKeyPermissionString; resource: string; action: string; label: string; description: string; }[]; resource: "ground"; label: "Ground"; description: "Read and manage ground transport operations."; permissions: [{ resource: string; action: string; label: string; description: string; }, { resource: string; action: string; label: string; description: string; }]; } | { scopes: { scope: ApiKeyPermissionString; resource: string; action: string; label: string; description: string; }[]; resource: "cruises"; label: "Cruises"; description: "Read and manage cruise products and sailing data."; permissions: [{ resource: string; action: string; label: string; description: string; }, { resource: string; action: string; label: string; description: string; }]; } | { scopes: { scope: ApiKeyPermissionString; resource: string; action: string; label: string; description: string; }[]; resource: "workflows"; label: "Workflows"; description: "Trigger workflow automation from external systems."; permissions: [{ resource: string; action: string; label: string; description: string; }]; } | { scopes: { scope: ApiKeyPermissionString; resource: string; action: string; label: string; description: string; }[]; resource: "webhooks"; label: "Webhooks"; description: "Relay webhook events into Voyant runtimes."; permissions: [{ resource: string; action: string; label: string; description: string; }]; })[]; /** @deprecated Use API_KEY_PERMISSION_PRESETS. */ export declare const API_KEY_SCOPE_PRESETS: Record; /** @deprecated Use ApiKeyPermissionPresetKey. */ export type ApiKeyScopePresetKey = ApiKeyPermissionPresetKey; /** @deprecated Use apiKeyPermissionStringSchema. */ export declare const apiKeyScopeSchema: z.ZodString & z.ZodType>; /** @deprecated Use array of apiKeyPermissionStringSchema only for display strings. */ export declare const apiKeyScopesSchema: z.ZodDefault>>>; /** @deprecated Use permissionStringsToPermissions. */ export declare const scopesToPermissions: typeof permissionStringsToPermissions; /** @deprecated Use permissionsToStrings. */ export declare const permissionsToScopes: typeof permissionsToStrings; /** @deprecated Use permissionsToStrings. */ export declare const normalizeApiKeyScopes: typeof permissionsToStrings; /** @deprecated Use apiKeyPermissionStringSchema.parse. */ export declare function normalizeApiKeyScope(scope: string): ApiKeyPermissionString; /** @deprecated Use hasApiKeyPermission. */ export declare function scopeMatches(userScope: string, requiredScope: string): boolean; /** @deprecated Use hasApiKeyPermissions. */ export declare function hasScopes(userScopes: readonly string[], requiredScopes: readonly string[]): boolean; /** @deprecated Use describePermissions. */ export declare const describeScopes: typeof describePermissions; /** @deprecated Use describePermissions. */ export declare const describescopes: typeof describePermissions; //# sourceMappingURL=api-keys.d.ts.map