andesine 0.4.0 → 0.5.0
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/CHANGELOG.md +23 -0
- package/README.md +66 -0
- package/dist/cli.js +2533 -49
- package/dist/cli.js.map +1 -1
- package/dist/templates/extension/.env.example +5 -0
- package/dist/templates/extension/LICENSE +21 -0
- package/dist/templates/extension/README.md +33 -0
- package/dist/templates/extension/andesine.config.ts +79 -0
- package/dist/templates/extension/andesine.keys.json +4 -0
- package/dist/templates/extension/gitignore +4 -0
- package/dist/templates/extension/package.template.json +27 -0
- package/dist/templates/extension/src/backend/server.ts +85 -0
- package/dist/templates/extension/src/frontend/about-section.tsx +47 -0
- package/dist/templates/extension/src/frontend/bookmarks-panel.tsx +67 -0
- package/dist/templates/extension/src/frontend/hello-panel.tsx +61 -0
- package/dist/templates/extension/src/frontend/index.tsx +6 -0
- package/dist/templates/extension/src/frontend/note-view.tsx +54 -0
- package/dist/templates/extension/src/frontend/shout-action.tsx +57 -0
- package/dist/templates/extension/tsconfig.json +16 -0
- package/package.json +18 -7
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","names":[],"sources":["../src/errors.ts","../package.json","../src/config/files.ts","../src/config/schema.ts","../src/config/resolve.ts","../src/output.ts","../src/prompts.ts","../src/context.ts","../src/auth/schema.ts","../src/storage/files.ts","../src/storage/credentials.ts","../src/storage/lock.ts","../src/storage/profiles.ts","../src/auth/oauth.ts","../src/auth/client.ts","../src/auth/login.ts","../src/auth/logout.ts","../src/auth/status.ts","../src/content/collections.ts","../src/types/options.ts","../src/init/choices.ts","../src/init/write-config.ts","../src/api/errors.ts","../src/types/source.ts","../src/types/schema.ts","../src/types/tree.ts","../src/types/generate.ts","../src/types/file.ts","../src/types/metadata.ts","../src/types/execute.ts","../src/init/index.ts","../src/pages/init.ts","../src/api/manifest.ts","../src/api/input.ts","../src/api/bindings.ts","../src/api/binary.ts","../src/api/execute.ts","../src/api/register.ts","../src/types/register.ts","../src/program.ts","../src/run.ts","../src/cli.ts"],"sourcesContent":["/** Process exit codes shared by commands and the executable. */\nconst exitCodes = { success: 0, failure: 1, usage: 2, stale: 3, cancelled: 130 } as const;\n\nclass CLIError extends Error {\n constructor(\n message: string,\n readonly exitCode: number = exitCodes.failure\n ) {\n super(message);\n this.name = \"CLIError\";\n }\n}\n\nclass CancelledError extends CLIError {\n constructor() {\n super(\"Cancelled.\", exitCodes.cancelled);\n this.name = \"CancelledError\";\n }\n}\n\nexport { CLIError, CancelledError, exitCodes };\n","","import { CLIError, exitCodes } from \"../errors\";\nimport { readFile } from \"node:fs/promises\";\nimport path from \"node:path\";\nimport type * as z from \"zod\";\n\n/** Read declarative JSON only. Missing optional files are distinct from invalid files. */\nconst readConfigFile = async <Schema extends z.ZodType>(\n filePath: string,\n schema: Schema,\n optional = false\n): Promise<z.output<Schema> | undefined> => {\n let content: string;\n let value: unknown;\n\n try {\n content = await readFile(filePath, \"utf8\");\n } catch (error) {\n const code = (error as NodeJS.ErrnoException).code;\n\n if (optional && code === \"ENOENT\") return undefined;\n\n throw new CLIError(`Cannot read ${filePath} (${code ?? \"filesystem error\"}).`, exitCodes.usage);\n }\n\n try {\n value = JSON.parse(content);\n } catch {\n throw new CLIError(`Invalid JSON in ${filePath}.`, exitCodes.usage);\n }\n\n const result = schema.safeParse(value);\n\n if (!result.success) {\n // Report field locations without echoing values that could contain a pasted secret.\n const fields = [...new Set(result.error.issues.map((issue) => issue.path.join(\".\") || \"root\"))];\n\n throw new CLIError(\n `Invalid configuration in ${filePath}. Check: ${fields.join(\", \")}.`,\n exitCodes.usage\n );\n }\n\n return result.data;\n};\n\n/** Find the nearest andesine.json. Only init can select a missing explicit file. */\nconst findProjectConfig = async <Schema extends z.ZodType>(\n cwd: string,\n schema: Schema,\n explicitPath?: string,\n allowMissingExplicit = false\n): Promise<{ path: string; value: z.output<Schema> } | undefined> => {\n let directory = path.resolve(cwd);\n\n if (explicitPath !== undefined) {\n const filePath = path.resolve(directory, explicitPath);\n const value = await readConfigFile(filePath, schema, allowMissingExplicit);\n\n return value === undefined ? undefined : { path: filePath, value };\n }\n\n while (true) {\n const filePath = path.join(directory, \"andesine.json\");\n const value = await readConfigFile(filePath, schema, true);\n const parent = path.dirname(directory);\n\n if (value !== undefined) return { path: filePath, value };\n if (parent === directory) return undefined;\n\n directory = parent;\n }\n};\n\nexport { readConfigFile, findProjectConfig };\n","import * as z from \"zod\";\n\nconst nonemptyString = z.string().trim().min(1);\nconst workspaceIDSchema = z\n .string()\n .regex(/^ws_[A-Za-z\\d]{1,22}$/, \"Expected a workspace ID (ws_…).\");\nconst sourceSchema = z.union([\n z.strictObject({\n kind: z.literal(\"published\"),\n channel: nonemptyString.max(50).default(\"published\")\n }),\n z.strictObject({\n kind: z.literal(\"published\"),\n snapshotID: z.string().regex(/^snp_[A-Za-z\\d]{1,22}$/)\n }),\n z.strictObject({ kind: z.literal(\"current\") })\n]);\nconst typesConfigSchema = z.strictObject({\n source: sourceSchema.default({ kind: \"published\", channel: \"published\" }),\n collections: z\n .array(z.union([nonemptyString, z.strictObject({ collectionSlugPath: nonemptyString })]))\n .default([])\n .describe(\n \"Collection IDs, name paths, or objects with collectionSlugPath; empty selects all accessible collections.\"\n ),\n output: nonemptyString\n .default(\"src/andesine.generated.ts\")\n .describe(\n \"Output path relative to andesine.json, or the working directory when no config is present.\"\n ),\n includeEntryIDs: z.boolean().default(false),\n includeEntryPaths: z.boolean().default(false),\n includeTree: z.boolean().default(false)\n});\nconst projectConfigSchema = z.strictObject({\n $schema: z.string().optional(),\n version: z.literal(1),\n baseURL: z\n .url()\n .optional()\n .describe(\n \"HTTP(S) API root, optionally including a deployment prefix. No credentials, query, or fragment.\"\n ),\n workspaceID: workspaceIDSchema.optional(),\n profile: nonemptyString.optional(),\n types: typesConfigSchema.optional()\n});\nconst profileSchema = z.strictObject({\n baseURL: z.url(),\n workspaceID: workspaceIDSchema.optional(),\n accountID: nonemptyString.optional(),\n credentialRef: nonemptyString.optional()\n});\nconst userConfigSchema = z.strictObject({\n version: z.literal(1),\n defaultProfile: nonemptyString.optional(),\n profiles: z.record(nonemptyString, profileSchema)\n});\n\ntype ProjectConfig = z.output<typeof projectConfigSchema>;\ntype TypesConfig = z.output<typeof typesConfigSchema>;\ntype UserProfile = z.output<typeof profileSchema>;\n\nexport { projectConfigSchema, typesConfigSchema, userConfigSchema, workspaceIDSchema };\nexport type { ProjectConfig, TypesConfig, UserProfile };\n","import { CLIError, exitCodes } from \"../errors\";\nimport { findProjectConfig, readConfigFile } from \"./files\";\nimport {\n projectConfigSchema,\n typesConfigSchema,\n userConfigSchema,\n workspaceIDSchema,\n type TypesConfig,\n type UserProfile\n} from \"./schema\";\nimport { homedir } from \"node:os\";\nimport path from \"node:path\";\n\ninterface GlobalOptions {\n config?: string;\n profile?: string;\n baseUrl?: string;\n workspace?: string;\n interactive?: boolean;\n}\n\ninterface ResolveConfigOptions {\n flags?: GlobalOptions;\n cwd?: string;\n env?: NodeJS.ProcessEnv;\n userConfigPath?: string;\n allowNewProfile?: boolean;\n allowMissingConfig?: boolean;\n}\n\ninterface ResolvedConfig {\n baseURL: string;\n workspaceID?: string;\n configPath?: string;\n profileName?: string;\n /** Only present when the selected profile belongs to the resolved API root. */\n profile?: UserProfile;\n types: TypesConfig;\n}\n\n/** Canonical instance identity includes the deployment prefix, not just its origin. */\nconst normalizeBaseURL = (value: string): string => {\n const message = \"baseURL must be an HTTP(S) URL without credentials, query, or fragment.\";\n let url: URL;\n\n try {\n url = new URL(value);\n } catch {\n throw new CLIError(message, exitCodes.usage);\n }\n\n const hasUnsupportedParts = url.username || url.password || url.search || url.hash;\n const isHTTP = url.protocol === \"http:\" || url.protocol === \"https:\";\n\n if (!isHTTP || hasUnsupportedParts) throw new CLIError(message, exitCodes.usage);\n\n return url.href.replace(/\\/+$/, \"\");\n};\n\n/** User metadata stays outside the project. This file must never contain tokens. */\nconst getUserConfigPath = (env: NodeJS.ProcessEnv): string => {\n const home = homedir();\n const defaultDirectory =\n process.platform === \"win32\"\n ? env.APPDATA || path.join(home, \"AppData\", \"Roaming\")\n : process.platform === \"darwin\"\n ? path.join(home, \"Library\", \"Application Support\")\n : path.join(home, \".config\");\n const directory = env.XDG_CONFIG_HOME || defaultDirectory;\n\n if (!path.isAbsolute(directory)) {\n throw new CLIError(\n \"The user configuration directory must be an absolute path.\",\n exitCodes.usage\n );\n }\n\n return path.join(directory, \"andesine\", \"profiles.json\");\n};\n\n/** Resolve flags > environment > project > selected profile > defaults, without credentials or I/O writes. */\nconst resolveConfig = async ({\n flags = {},\n cwd = process.cwd(),\n env = process.env,\n userConfigPath = getUserConfigPath(env),\n allowNewProfile = false,\n allowMissingConfig = false\n}: ResolveConfigOptions = {}): Promise<ResolvedConfig> => {\n const project = await findProjectConfig(\n cwd,\n projectConfigSchema,\n flags.config ?? env.ANDESINE_CONFIG,\n allowMissingConfig\n );\n const userConfig = await readConfigFile(userConfigPath, userConfigSchema, true);\n const profileName =\n flags.profile ?? env.ANDESINE_PROFILE ?? project?.value.profile ?? userConfig?.defaultProfile;\n const selectedProfile =\n profileName && userConfig && Object.hasOwn(userConfig.profiles, profileName)\n ? userConfig.profiles[profileName]\n : undefined;\n\n if (profileName !== undefined && !selectedProfile && !allowNewProfile) {\n throw new CLIError(\n \"The selected profile does not exist in the user configuration.\",\n exitCodes.usage\n );\n }\n\n const profileBaseURL = selectedProfile ? normalizeBaseURL(selectedProfile.baseURL) : undefined;\n const baseURL = normalizeBaseURL(\n flags.baseUrl ??\n env.ANDESINE_BASE_URL ??\n project?.value.baseURL ??\n profileBaseURL ??\n \"https://api.andesine.app\"\n );\n const profile =\n selectedProfile && profileBaseURL === baseURL ? { ...selectedProfile, baseURL } : undefined;\n const workspaceID =\n flags.workspace ??\n env.ANDESINE_WORKSPACE_ID ??\n project?.value.workspaceID ??\n profile?.workspaceID;\n const types = project?.value.types ?? typesConfigSchema.parse({});\n const outputDirectory = project ? path.dirname(project.path) : path.resolve(cwd);\n\n if (workspaceID !== undefined && !workspaceIDSchema.safeParse(workspaceID).success) {\n throw new CLIError(\"workspaceID must be a workspace ID (ws_…).\", exitCodes.usage);\n }\n\n return {\n baseURL,\n workspaceID,\n configPath: project?.path,\n profileName,\n profile,\n types: { ...types, output: path.resolve(outputDirectory, types.output) }\n };\n};\n\nexport { resolveConfig, normalizeBaseURL, getUserConfigPath };\nexport type { GlobalOptions, ResolvedConfig, ResolveConfigOptions };\n","import type { Writable } from \"node:stream\";\nimport { styleText } from \"node:util\";\nimport { intro, log, note, spinner } from \"@clack/prompts\";\nimport { CLIError } from \"./errors\";\n\n/** Wait for each write so commands can stream results without an unbounded queue. */\nconst writeOutput = (stream: Writable, text: string | Uint8Array): Promise<void> => {\n return new Promise((resolve, reject) => {\n // Writes with a callback can also emit an error event on the stream.\n stream.once(\"error\", reject);\n stream.write(text, (error) => {\n if (error) reject(error);\n else {\n stream.removeListener(\"error\", reject);\n resolve();\n }\n });\n });\n};\n\nconst serializeJSON = (value: unknown): string => {\n const serialized = JSON.stringify(value);\n\n if (serialized === undefined) throw new CLIError(\"The result is not a JSON value.\");\n\n return `${serialized}\\n`;\n};\n\n/** Data goes to stdout; prompts and diagnostics go to stderr. */\nconst createOutput = (interactive = true, signal?: AbortSignal) => {\n const terminal = Boolean(\n interactive && process.stderr.isTTY && !process.env.CI && process.env.TERM !== \"dumb\"\n );\n const options = { output: process.stderr, withGuide: true };\n const diagnostic = async (\n message: string,\n level: \"info\" | \"success\" | \"warn\" | \"error\" = \"info\"\n ) => {\n if (terminal) log[level](message, options);\n else await writeOutput(process.stderr, `${message}\\n`);\n };\n\n return {\n json: (value: unknown) => writeOutput(process.stdout, serializeJSON(value)),\n text: (value: string) => writeOutput(process.stdout, value),\n diagnostic: (message: string) => diagnostic(message),\n success: (message: string) => diagnostic(message, \"success\"),\n warning: (message: string) => diagnostic(message, \"warn\"),\n error: (message: string) => diagnostic(message, \"error\"),\n heading: async (title: string) => {\n if (terminal) intro(styleText([\"bold\", \"cyan\"], title, { stream: process.stderr }), options);\n else await writeOutput(process.stderr, `${title}\\n`);\n },\n note: async (title: string, fields: Record<string, string | undefined>) => {\n const lines = Object.entries(fields).flatMap(([label, value]) => {\n if (value === undefined) return [];\n\n if (!terminal) return [`${label}: ${value}`];\n\n return [\n `${styleText(\"bold\", `${label}:`, { stream: process.stderr })} ${styleText(\"cyan\", value, { stream: process.stderr })}`\n ];\n });\n\n if (terminal) note(lines.join(\"\\n\"), title, options);\n else await writeOutput(process.stderr, `${title}\\n${lines.join(\"\\n\")}\\n`);\n },\n /** Always release the spinner and its listeners before errors or later output. */\n progress: async <Value>(\n message: string,\n action: () => Promise<Value>,\n complete: string\n ): Promise<Value> => {\n const loader = terminal\n ? spinner({ ...options, signal, cancelMessage: \"Cancelled.\" })\n : undefined;\n\n signal?.throwIfAborted();\n\n if (loader) loader.start(message);\n else await diagnostic(message);\n\n try {\n const result = await action();\n\n loader?.stop(complete);\n return result;\n } finally {\n loader?.clear();\n }\n }\n };\n};\n\nexport { createOutput, writeOutput };\n","import { CancelledError, CLIError, exitCodes } from \"./errors\";\nimport { isCancel } from \"@clack/prompts\";\nimport type { Readable, Writable } from \"node:stream\";\n\ninterface PromptOptions {\n input: Readable;\n output: Writable;\n signal: AbortSignal;\n}\n\n/** Keep Clack on stderr and prevent prompts in CI, pipes, and explicit non-interactive mode. */\nconst canPrompt = (interactive = true) => {\n return Boolean(interactive && process.stdin.isTTY && process.stderr.isTTY && !process.env.CI);\n};\nconst createPrompt = (signal: AbortSignal, interactive = true) => {\n const enabled = canPrompt(interactive);\n\n return async <Value>(\n run: (options: PromptOptions) => Promise<Value | symbol>\n ): Promise<Value> => {\n signal.throwIfAborted();\n\n if (!enabled) {\n throw new CLIError(\n \"Input is required. Supply the command flags or run in an interactive terminal.\",\n exitCodes.usage\n );\n }\n\n const value = await run({ input: process.stdin, output: process.stderr, signal });\n\n signal.throwIfAborted();\n\n if (isCancel(value)) throw new CancelledError();\n\n return value as Value;\n };\n};\n\nexport { canPrompt, createPrompt };\n","import {\n resolveConfig,\n type GlobalOptions,\n type ResolvedConfig,\n type ResolveConfigOptions\n} from \"./config/resolve\";\nimport { createOutput } from \"./output\";\nimport { createPrompt } from \"./prompts\";\n\ninterface CommandContext {\n config: ResolvedConfig;\n signal: AbortSignal;\n output: ReturnType<typeof createOutput>;\n prompt: ReturnType<typeof createPrompt>;\n}\n\n/** Create context inside command actions so help and version never read configuration. */\nconst createCommandContext = async (\n flags: GlobalOptions,\n signal: AbortSignal,\n options: Pick<ResolveConfigOptions, \"allowNewProfile\" | \"allowMissingConfig\"> = {}\n): Promise<CommandContext> => {\n signal.throwIfAborted();\n\n const config = await resolveConfig({ flags, ...options });\n\n signal.throwIfAborted();\n\n return {\n config,\n signal,\n output: createOutput(flags.interactive, signal),\n prompt: createPrompt(signal, flags.interactive)\n };\n};\n\nexport { createCommandContext };\nexport type { CommandContext };\n","import * as z from \"zod\";\n\nconst credentialsSchema = z.object({\n version: z.literal(1),\n baseURL: z.string(),\n accountID: z.string(),\n accessToken: z.string().min(1),\n refreshToken: z.string().min(1),\n expiresAt: z.number().finite(),\n refreshPending: z.boolean().default(false)\n});\nconst tokenResponseSchema = z.object({\n access_token: z.string().min(1),\n refresh_token: z.string().min(1),\n token_type: z.string().refine((value) => value.toLowerCase() === \"bearer\"),\n expires_in: z.number().int().positive(),\n scope: z.string().optional()\n});\nconst deviceResponseSchema = z.object({\n device_code: z.string().min(1),\n user_code: z.string().regex(/^[A-HJ-NP-Z2-9]{8}$/),\n verification_uri: z.url(),\n verification_uri_complete: z.url().optional(),\n expires_in: z.number().int().positive(),\n interval: z.number().int().positive().default(5)\n});\n\ntype Credentials = z.output<typeof credentialsSchema>;\ntype TokenResponse = z.output<typeof tokenResponseSchema>;\ntype DeviceResponse = z.output<typeof deviceResponseSchema>;\ntype StorageKind = \"keyring\" | \"file\";\n\nexport { credentialsSchema, tokenResponseSchema, deviceResponseSchema };\nexport type { Credentials, TokenResponse, DeviceResponse, StorageKind };\n","import { CLIError } from \"../errors\";\nimport { getUserConfigPath } from \"../config/resolve\";\nimport { chmod, lstat, mkdir, open, rename, unlink } from \"node:fs/promises\";\nimport { randomUUID } from \"node:crypto\";\nimport { execFile } from \"node:child_process\";\nimport { promisify } from \"node:util\";\nimport path from \"node:path\";\n\nconst stateDirectory = () => path.dirname(getUserConfigPath(process.env));\nconst isMissing = (error: unknown) => (error as NodeJS.ErrnoException)?.code === \"ENOENT\";\n\n/** Create private CLI storage. Windows uses a protected ACL inherited by new files. */\nconst ensurePrivateDirectory = async (directory: string): Promise<void> => {\n await mkdir(directory, { recursive: true, mode: 0o700 });\n\n const info = await lstat(directory);\n\n if (!info.isDirectory() || info.isSymbolicLink()) {\n throw new CLIError(\"CLI storage must be a real directory.\");\n }\n\n if (process.platform !== \"win32\") {\n if (info.uid !== process.getuid?.()) {\n throw new CLIError(\"CLI storage must belong to the current user.\");\n }\n\n await chmod(directory, 0o700);\n return;\n }\n\n try {\n await promisify(execFile)(\n \"powershell.exe\",\n [\n \"-NoProfile\",\n \"-NonInteractive\",\n \"-Command\",\n `\n $ErrorActionPreference = 'Stop'\n $sid = [System.Security.Principal.WindowsIdentity]::GetCurrent().User\n $acl = New-Object System.Security.AccessControl.DirectorySecurity\n $acl.SetOwner($sid)\n $acl.SetAccessRuleProtection($true, $false)\n $rule = New-Object System.Security.AccessControl.FileSystemAccessRule($sid, 'FullControl', 'ContainerInherit,ObjectInherit', 'None', 'Allow')\n $acl.AddAccessRule($rule)\n Set-Acl -LiteralPath $env:ANDESINE_STORAGE_PATH -AclObject $acl\n `\n ],\n {\n env: { ...process.env, ANDESINE_STORAGE_PATH: directory },\n timeout: 10_000,\n windowsHide: true\n }\n );\n } catch {\n throw new CLIError(\"Cannot restrict CLI storage to the current Windows account.\");\n }\n};\n\n/** Write and sync a private temporary file before replacing the destination. */\nconst writePrivateJSON = async (file: string, value: unknown): Promise<void> => {\n const temporary = `${file}.${randomUUID()}.tmp`;\n\n await ensurePrivateDirectory(path.dirname(file));\n\n const handle = await open(temporary, \"wx\", 0o600);\n\n try {\n await handle.writeFile(`${JSON.stringify(value, null, 2)}\\n`, \"utf8\");\n await handle.sync();\n await handle.close();\n await rename(temporary, file);\n\n if (process.platform !== \"win32\") {\n const directory = await open(path.dirname(file), \"r\");\n try {\n await directory.sync();\n } finally {\n await directory.close();\n }\n }\n } finally {\n await handle.close();\n await unlink(temporary).catch((error: unknown) => {\n if (!isMissing(error)) throw error;\n });\n }\n};\n\nexport { stateDirectory, isMissing, ensurePrivateDirectory, writePrivateJSON };\n","import { credentialsSchema, type Credentials, type StorageKind } from \"../auth/schema\";\nimport { CLIError } from \"../errors\";\nimport { ensurePrivateDirectory, isMissing, stateDirectory, writePrivateJSON } from \"./files\";\nimport { constants } from \"node:fs\";\nimport { open, unlink } from \"node:fs/promises\";\nimport path from \"node:path\";\n\ninterface CredentialStore {\n get(): Promise<Credentials | undefined>;\n set(value: Credentials): Promise<void>;\n delete(): Promise<void>;\n}\n\nconst parseCredentials = (value: string): Credentials => {\n try {\n return credentialsSchema.parse(JSON.parse(value));\n } catch {\n throw new CLIError(\"Stored credentials are invalid. Run auth login again.\");\n }\n};\nconst credentialStore = async (\n reference: string,\n signal?: AbortSignal\n): Promise<CredentialStore> => {\n const match = /^(keyring|file):([a-f0-9-]{36})$/.exec(reference);\n\n if (!match) throw new CLIError(\"Invalid credential reference. Run auth login again.\");\n\n const kind = match[1] as StorageKind;\n const id = match[2];\n\n if (kind === \"keyring\") {\n try {\n const { AsyncEntry } = await import(\"@napi-rs/keyring\");\n const entry = new AsyncEntry(\"app.andesine.cli\", id, { linux: { store: \"secret-service\" } });\n const safely = async <Value>(\n run: (signal: AbortSignal) => Promise<Value>\n ): Promise<Value> => {\n try {\n return await run(\n AbortSignal.any([AbortSignal.timeout(15_000), ...(signal ? [signal] : [])])\n );\n } catch {\n throw new CLIError(\n \"The OS credential store is unavailable. Unlock it and try again, or use auth login --credential-store file.\"\n );\n }\n };\n\n return {\n get: async () => {\n const value = await safely((signal) => entry.getPassword(signal));\n return value === undefined ? undefined : parseCredentials(value);\n },\n set: (value) => safely((signal) => entry.setPassword(JSON.stringify(value), signal)),\n delete: async () => {\n await safely((signal) => entry.deletePassword(signal));\n }\n };\n } catch {\n throw new CLIError(\n \"The OS credential store is unavailable. Use auth login --credential-store file for explicit file storage.\"\n );\n }\n }\n\n const directory = path.join(stateDirectory(), \"credentials\");\n const file = path.join(directory, `${id}.json`);\n\n return {\n get: async () => {\n await ensurePrivateDirectory(directory);\n\n let handle;\n\n try {\n handle = await open(file, constants.O_RDONLY | (constants.O_NOFOLLOW || 0));\n const info = await handle.stat();\n const privateFile =\n process.platform === \"win32\" ||\n ((info.mode & 0o077) === 0 && info.uid === process.getuid?.());\n\n if (!info.isFile() || !privateFile) {\n throw new CLIError(\n \"Credential file permissions must allow only the current user (0600).\"\n );\n }\n\n return parseCredentials(await handle.readFile(\"utf8\"));\n } catch (error) {\n if (isMissing(error)) return undefined;\n\n if (error instanceof CLIError) throw error;\n throw new CLIError(\"Cannot read the credential file.\");\n } finally {\n await handle?.close();\n }\n },\n set: (value) => writePrivateJSON(file, value),\n delete: async () => {\n await unlink(file).catch((error: unknown) => {\n if (!isMissing(error)) throw new CLIError(\"Cannot remove the credential file.\");\n });\n }\n };\n};\n\nexport { credentialStore };\nexport type { CredentialStore };\n","import { CLIError } from \"../errors\";\nimport { ensurePrivateDirectory, stateDirectory } from \"./files\";\nimport { createHash } from \"node:crypto\";\nimport { setTimeout } from \"node:timers/promises\";\nimport path from \"node:path\";\nimport lockfile from \"proper-lockfile\";\n\n/** Serialize metadata updates and token rotation across CLI processes. */\nconst withStateLock = async <Value>(\n name: string,\n signal: AbortSignal,\n run: (assertOwned: () => void) => Promise<Value>\n): Promise<Value> => {\n const directory = path.join(stateDirectory(), \"locks\");\n const target = path.join(directory, createHash(\"sha256\").update(name).digest(\"hex\"));\n const deadline = Date.now() + 150_000;\n let compromised = false;\n let release: (() => Promise<void>) | undefined;\n\n await ensurePrivateDirectory(directory);\n\n while (!release) {\n signal.throwIfAborted();\n\n try {\n release = await lockfile.lock(target, {\n realpath: false,\n stale: 120_000,\n update: 10_000,\n onCompromised: () => {\n compromised = true;\n }\n });\n } catch (error) {\n if ((error as NodeJS.ErrnoException).code !== \"ELOCKED\") {\n throw new CLIError(\"Cannot lock CLI storage.\");\n }\n\n if (Date.now() >= deadline) {\n throw new CLIError(\"Another CLI process is using these credentials. Try again later.\");\n }\n\n await setTimeout(100, undefined, { signal });\n }\n }\n\n const assertOwned = () => {\n signal.throwIfAborted();\n if (compromised) {\n throw new CLIError(\"The credential lock was lost. Run auth status before retrying.\");\n }\n };\n\n try {\n assertOwned();\n return await run(assertOwned);\n } finally {\n await release().catch(() => {\n /* A compromised lock belongs to another process. */\n });\n }\n};\n\nexport { withStateLock };\n","import { readConfigFile } from \"../config/files\";\nimport { getUserConfigPath } from \"../config/resolve\";\nimport { userConfigSchema, type UserProfile } from \"../config/schema\";\nimport { CLIError } from \"../errors\";\nimport { writePrivateJSON } from \"./files\";\nimport { withStateLock } from \"./lock\";\n\n/** Compare before writing, so a concurrent login cannot replace an unseen profile. */\nconst saveProfile = async (\n name: string,\n profile: UserProfile,\n expected: UserProfile | undefined,\n signal: AbortSignal\n): Promise<void> => {\n await withStateLock(\"profiles\", signal, async (assertOwned) => {\n const file = getUserConfigPath(process.env);\n const config = (await readConfigFile(file, userConfigSchema, true)) || {\n version: 1 as const,\n profiles: {}\n };\n const previous = Object.hasOwn(config.profiles, name) ? config.profiles[name] : undefined;\n\n if (JSON.stringify(previous) !== JSON.stringify(expected)) {\n throw new CLIError(\n \"This profile changed during login. Retry with a different --profile name.\"\n );\n }\n\n assertOwned();\n await writePrivateJSON(file, {\n ...config,\n defaultProfile: config.defaultProfile || name,\n profiles: { ...config.profiles, [name]: profile }\n });\n });\n};\nconst clearProfileCredential = async (\n name: string,\n reference: string,\n signal: AbortSignal\n): Promise<void> => {\n await withStateLock(\"profiles\", signal, async (assertOwned) => {\n const file = getUserConfigPath(process.env);\n const config = await readConfigFile(file, userConfigSchema, true);\n const profile =\n config && Object.hasOwn(config.profiles, name) ? config.profiles[name] : undefined;\n\n if (!config || profile?.credentialRef !== reference) return;\n\n const { credentialRef: _, ...remaining } = profile;\n\n assertOwned();\n await writePrivateJSON(file, {\n ...config,\n profiles: { ...config.profiles, [name]: remaining }\n });\n });\n};\n\nexport { saveProfile, clearProfileCredential };\n","import { CLIError } from \"../errors\";\nimport { deviceResponseSchema, tokenResponseSchema, type TokenResponse } from \"./schema\";\nimport { setTimeout } from \"node:timers/promises\";\nimport type * as z from \"zod\";\n\nconst CLIENT_ID = \"andesine-cli\";\nconst SCOPES = \"andesine:api offline_access\";\nconst DEVICE_GRANT = \"urn:ietf:params:oauth:grant-type:device_code\";\n\nclass OAuthError extends CLIError {\n constructor(\n readonly code: string,\n readonly retryAfter = 0\n ) {\n super(\"The authorization request failed. Run auth login again.\");\n }\n}\n\n/** Send credentials only to this instance, in a form body, without redirects or retries. */\nconst oauthRequest = async (\n baseURL: string,\n endpoint: string,\n fields: Record<string, string>,\n signal: AbortSignal\n): Promise<unknown> => {\n let response: Response;\n\n try {\n response = await fetch(`${baseURL}/auth/${endpoint}`, {\n method: \"POST\",\n redirect: \"error\",\n headers: {\n \"content-type\": \"application/x-www-form-urlencoded\",\n \"accept\": \"application/json\"\n },\n body: new URLSearchParams({ client_id: CLIENT_ID, ...fields }),\n signal: AbortSignal.any([signal, AbortSignal.timeout(30_000)])\n });\n } catch {\n signal.throwIfAborted();\n throw new OAuthError(\"network_error\");\n }\n\n const body: unknown = await response.json().catch(() => undefined);\n\n if (!response.ok) {\n const code =\n body && typeof body === \"object\" && \"error\" in body && typeof body.error === \"string\"\n ? body.error\n : \"server_error\";\n const retryAfter = Number(response.headers.get(\"retry-after\"));\n\n throw new OAuthError(\n response.status === 429 ? \"slow_down\" : code,\n Number.isFinite(retryAfter) ? Math.max(retryAfter, 0) : 0\n );\n }\n\n return body;\n};\nconst parseResponse = <Schema extends z.ZodType>(\n schema: Schema,\n value: unknown\n): z.output<Schema> => {\n const result = schema.safeParse(value);\n\n if (!result.success) {\n throw new CLIError(\"The instance returned an invalid authorization response.\");\n }\n\n return result.data;\n};\nconst startDeviceLogin = async (baseURL: string, signal: AbortSignal) => {\n const device = parseResponse(\n deviceResponseSchema,\n await oauthRequest(baseURL, \"device/code\", { scope: SCOPES, resource: baseURL }, signal)\n );\n const verification = new URL(device.verification_uri);\n const complete = new URL(device.verification_uri_complete || device.verification_uri);\n const validProtocol =\n verification.protocol === \"https:\" ||\n (new URL(baseURL).protocol === \"http:\" && verification.protocol === \"http:\");\n const validDestination =\n validProtocol &&\n !verification.username &&\n !verification.password &&\n complete.origin === verification.origin &&\n complete.pathname === verification.pathname &&\n !complete.username &&\n !complete.password &&\n !complete.hash &&\n (!device.verification_uri_complete ||\n complete.searchParams.get(\"user_code\") === device.user_code);\n\n if (!validDestination) {\n throw new CLIError(\"The instance returned an invalid browser authorization URL.\");\n }\n\n return device;\n};\nconst pollDeviceLogin = async (\n baseURL: string,\n device: Awaited<ReturnType<typeof startDeviceLogin>>,\n expiresAt: number,\n signal: AbortSignal\n): Promise<TokenResponse> => {\n let interval = device.interval * 1000;\n\n while (Date.now() < expiresAt) {\n await setTimeout(Math.min(interval, Math.max(expiresAt - Date.now(), 0)), undefined, {\n signal\n });\n if (Date.now() >= expiresAt) break;\n\n try {\n return parseResponse(\n tokenResponseSchema,\n await oauthRequest(\n baseURL,\n \"oauth2/token\",\n {\n grant_type: DEVICE_GRANT,\n device_code: device.device_code,\n resource: baseURL\n },\n signal\n )\n );\n } catch (error) {\n if (!(error instanceof OAuthError)) throw error;\n\n if (error.code === \"authorization_pending\") continue;\n\n if (error.code === \"slow_down\") {\n interval = Math.max(interval + 5000, error.retryAfter * 1000);\n continue;\n }\n\n if (error.code === \"network_error\" || error.code === \"server_error\") {\n interval = Math.max(interval * 2, 5000);\n continue;\n }\n\n if (error.code === \"access_denied\") throw new CLIError(\"Login was denied in the browser.\");\n\n if (error.code === \"expired_token\") break;\n\n throw new CLIError(\"The login request is no longer valid. Run auth login again.\");\n }\n }\n\n throw new CLIError(\"The login code expired. Run auth login again.\");\n};\nconst refreshAccess = async (baseURL: string, refreshToken: string, signal: AbortSignal) => {\n return parseResponse(\n tokenResponseSchema,\n await oauthRequest(\n baseURL,\n \"oauth2/token\",\n {\n grant_type: \"refresh_token\",\n refresh_token: refreshToken,\n resource: baseURL\n },\n signal\n )\n );\n};\nconst revokeAccess = async (\n baseURL: string,\n refreshToken: string,\n signal: AbortSignal\n): Promise<void> => {\n await oauthRequest(\n baseURL,\n \"oauth2/revoke\",\n { token: refreshToken, token_type_hint: \"refresh_token\" },\n signal\n );\n};\n\nexport { startDeviceLogin, pollDeviceLogin, refreshAccess, revokeAccess };\n","import { createClient, AndesineAPIError } from \"@andesine/sdk\";\nimport type { CommandContext } from \"../context\";\nimport { CLIError } from \"../errors\";\nimport { credentialStore } from \"../storage/credentials\";\nimport { withStateLock } from \"../storage/lock\";\nimport { refreshAccess } from \"./oauth\";\n\n/** Select one credential source explicitly; never fall back after an authentication error. */\nconst authenticatedClient = async (context: CommandContext) => {\n const { config, signal } = context;\n const apiKey = process.env.ANDESINE_API_KEY;\n const headers = config.workspaceID ? { \"x-workspace-id\": config.workspaceID } : undefined;\n const fetcher: typeof fetch = (input, init) =>\n fetch(input, {\n ...init,\n redirect: \"error\",\n signal: AbortSignal.any([\n signal,\n ...(init?.signal ? [init.signal] : []),\n ...(input instanceof Request ? [input.signal] : [])\n ])\n });\n\n if (apiKey !== undefined) {\n if (!apiKey.trim()) {\n throw new CLIError(\n \"ANDESINE_API_KEY is empty. Set it or remove it before using saved credentials.\"\n );\n }\n\n return {\n client: createClient({ baseURL: config.baseURL, apiKey, headers, fetch: fetcher }),\n source: \"environment\" as const\n };\n }\n\n const reference = config.profile?.credentialRef;\n\n if (!reference) {\n throw new CLIError(\n \"No credentials for this instance. Run andesine auth login or set ANDESINE_API_KEY.\"\n );\n }\n\n const accessToken = await withStateLock(reference, signal, async (assertOwned) => {\n const store = await credentialStore(reference, signal);\n const credentials = await store.get();\n\n if (!credentials) throw new CLIError(\"Saved credentials were not found. Run auth login again.\");\n\n if (\n credentials.baseURL !== config.baseURL ||\n credentials.accountID !== config.profile?.accountID\n ) {\n throw new CLIError(\n \"Saved credentials do not match this instance and account. Run auth login again.\"\n );\n }\n\n if (credentials.refreshPending) {\n throw new CLIError(\n \"The previous token exchange was interrupted. Run auth login again; the old refresh token will not be reused.\"\n );\n }\n\n if (credentials.expiresAt > Date.now() + 60_000) return credentials.accessToken;\n\n assertOwned();\n\n await store.set({ ...credentials, refreshPending: true });\n\n assertOwned();\n\n try {\n const startedAt = Date.now();\n const tokens = await refreshAccess(config.baseURL, credentials.refreshToken, signal);\n\n assertOwned();\n\n await store.set({\n ...credentials,\n accessToken: tokens.access_token,\n refreshToken: tokens.refresh_token,\n expiresAt: startedAt + tokens.expires_in * 1000,\n refreshPending: false\n });\n return tokens.access_token;\n } catch {\n signal.throwIfAborted();\n throw new CLIError(\n \"Could not complete the token exchange. Run auth login again; the previous refresh token will not be reused.\"\n );\n }\n });\n\n return {\n client: createClient({ baseURL: config.baseURL, accessToken, headers, fetch: fetcher }),\n source: reference.startsWith(\"file:\") ? (\"file\" as const) : (\"keyring\" as const)\n };\n};\n\n/** Do not expose server error bodies or retry a dispatched request during auth recovery. */\nconst identity = async (client: ReturnType<typeof createClient>, signal: AbortSignal) => {\n try {\n return await client.auth.getIdentity(undefined, { signal });\n } catch (error) {\n signal.throwIfAborted();\n if (error instanceof AndesineAPIError && (error.status === 401 || error.status === 403)) {\n throw new CLIError(\n \"The credential is not authorized. Check ANDESINE_API_KEY or run auth login again.\"\n );\n }\n throw new CLIError(\n \"Cannot verify this credential with the instance. Check the connection and base URL.\"\n );\n }\n};\n\nexport { authenticatedClient, identity };\n","import type { CommandContext } from \"../context\";\nimport { CLIError, CancelledError } from \"../errors\";\nimport { credentialStore, type CredentialStore } from \"../storage/credentials\";\nimport { readConfigFile } from \"../config/files\";\nimport { getUserConfigPath, normalizeBaseURL } from \"../config/resolve\";\nimport { userConfigSchema } from \"../config/schema\";\nimport { saveProfile } from \"../storage/profiles\";\nimport { withStateLock } from \"../storage/lock\";\nimport { startDeviceLogin, pollDeviceLogin, revokeAccess } from \"./oauth\";\nimport { identity } from \"./client\";\nimport type { Credentials, StorageKind } from \"./schema\";\nimport { createClient } from \"@andesine/sdk\";\nimport { confirm } from \"@clack/prompts\";\nimport { randomUUID } from \"node:crypto\";\nimport openBrowser from \"open\";\n\ninterface LoginOptions {\n browser: boolean;\n credentialStore?: StorageKind;\n}\ninterface LoginStore {\n reference: string;\n store: CredentialStore;\n}\n\nconst prepareStore = async (context: CommandContext, kind: StorageKind): Promise<LoginStore> => {\n const reference = `${kind}:${randomUUID()}`;\n const store = await credentialStore(reference, context.signal);\n\n // Check write access before the user grants access in the browser.\n await store.set({\n version: 1,\n baseURL: context.config.baseURL,\n accountID: \"probe\",\n accessToken: \"probe\",\n refreshToken: \"probe\",\n expiresAt: 0,\n refreshPending: false\n });\n await store.delete();\n context.signal.throwIfAborted();\n return { reference, store };\n};\nconst selectStore = async (\n context: CommandContext,\n selected?: StorageKind\n): Promise<LoginStore> => {\n try {\n return await prepareStore(context, selected || \"keyring\");\n } catch (error) {\n context.signal.throwIfAborted();\n if (selected) throw error;\n\n await context.output.warning(\n \"The OS credential store is unavailable. File storage keeps unencrypted tokens in a file restricted to your user. Use --credential-store file to select it explicitly.\"\n );\n const accepted = await context.prompt((options) =>\n confirm({\n ...options,\n message: \"Use private file storage for this login?\",\n initialValue: false\n })\n );\n\n if (!accepted) throw new CancelledError();\n return prepareStore(context, \"file\");\n }\n};\n\n/** Grant approval stays in the browser; the CLI only polls the provider and saves its tokens. */\nconst login = async (\n context: CommandContext,\n options: LoginOptions,\n reportResult = true\n): Promise<void> => {\n const { config, signal, output } = context;\n const name = config.profileName || \"default\";\n const profiles = await readConfigFile(getUserConfigPath(process.env), userConfigSchema, true);\n const existing =\n profiles && Object.hasOwn(profiles.profiles, name) ? profiles.profiles[name] : undefined;\n\n if (existing && normalizeBaseURL(existing.baseURL) !== config.baseURL) {\n throw new CLIError(\n \"This profile belongs to another instance. Use --profile with a new name for this login.\"\n );\n }\n\n await output.heading(\"Andesine · Sign in\");\n await output.note(\"Login\", { Instance: config.baseURL, Profile: name });\n\n const storage = await selectStore(context, options.credentialStore);\n const device = await output.progress(\n \"Requesting a login code\",\n () => startDeviceLogin(config.baseURL, signal),\n \"Login code ready\"\n );\n const expiresAt = Date.now() + device.expires_in * 1000;\n\n await output.note(\"Authorize in your browser\", {\n Open: device.verification_uri,\n Code: device.user_code\n });\n await output.diagnostic(\"Approve access in your browser. Press Ctrl+C to cancel.\");\n\n if (options.browser) {\n try {\n signal.throwIfAborted();\n await openBrowser(device.verification_uri_complete || device.verification_uri, {\n wait: false\n });\n } catch {\n signal.throwIfAborted();\n await output.warning(\"Could not open a browser. Open the URL above and enter the code.\");\n }\n }\n\n const tokens = await output.progress(\n \"Waiting for browser approval\",\n () => pollDeviceLogin(config.baseURL, device, expiresAt, signal),\n \"Browser approval received\"\n );\n const tokenReceivedAt = Date.now();\n let saved = false;\n\n try {\n const client = createClient({\n baseURL: config.baseURL,\n accessToken: tokens.access_token,\n fetch: (input, init) => fetch(input, { ...init, redirect: \"error\" })\n });\n const account = await output.progress(\n \"Verifying your account\",\n () => identity(client, signal),\n \"Account verified\"\n );\n\n if (account.type !== \"oauth\") {\n throw new CLIError(\"The instance did not return an OAuth user identity.\");\n }\n\n const credentials: Credentials = {\n version: 1,\n baseURL: config.baseURL,\n accountID: account.user.id,\n accessToken: tokens.access_token,\n refreshToken: tokens.refresh_token,\n expiresAt: tokenReceivedAt + tokens.expires_in * 1000,\n refreshPending: false\n };\n const commit = async () => {\n signal.throwIfAborted();\n await storage.store.set(credentials);\n await saveProfile(\n name,\n {\n baseURL: config.baseURL,\n accountID: account.user.id,\n credentialRef: storage.reference,\n ...(config.workspaceID ? { workspaceID: config.workspaceID } : {})\n },\n config.profile,\n signal\n );\n saved = true;\n };\n const previousRef = config.profile?.credentialRef;\n\n if (previousRef) {\n await withStateLock(previousRef, signal, async (assertOwned) => {\n assertOwned();\n await commit();\n try {\n const previousStore = await credentialStore(previousRef, signal);\n const previous = await previousStore.get();\n\n if (previous?.refreshPending) {\n await output.warning(\n \"The previous token exchange was interrupted; its server grant may remain active.\"\n );\n } else if (previous) {\n if (\n previous.baseURL !== config.baseURL ||\n previous.accountID !== config.profile?.accountID\n ) {\n throw new CLIError(\"The previous credential does not match this account.\");\n }\n await revokeAccess(config.baseURL, previous.refreshToken, signal);\n }\n await previousStore.delete();\n } catch {\n await output.warning(\n \"New login saved. Could not fully remove the previous login; its server credentials may remain active.\"\n );\n }\n });\n } else {\n await commit();\n }\n\n await output.success(`Signed in as ${account.user.email}. Saved profile: ${name}.`);\n if (process.env.ANDESINE_API_KEY !== undefined) {\n await output.warning(\n \"ANDESINE_API_KEY is set and will still take precedence for API requests.\"\n );\n }\n\n if (reportResult) {\n await output.json({\n authenticated: true,\n profile: name,\n baseURL: config.baseURL,\n account: account.user,\n workspaceID: config.workspaceID ?? null,\n credentialSource: storage.reference.split(\":\")[0]\n });\n }\n } finally {\n if (!saved) {\n await revokeAccess(config.baseURL, tokens.refresh_token, AbortSignal.timeout(10_000)).catch(\n async () => {\n await output.warning(\n \"Login was not saved, and token revocation could not be confirmed. The server grant may remain active.\"\n );\n }\n );\n await credentialStore(storage.reference)\n .then((store) => store.delete())\n .catch(async () => {\n await output.warning(\"Could not remove the incomplete login from credential storage.\");\n });\n }\n }\n};\n\nexport { login };\nexport type { LoginOptions };\n","import type { CommandContext } from \"../context\";\nimport { CLIError } from \"../errors\";\nimport { credentialStore } from \"../storage/credentials\";\nimport { clearProfileCredential } from \"../storage/profiles\";\nimport { withStateLock } from \"../storage/lock\";\nimport { revokeAccess } from \"./oauth\";\n\n/** Remove this profile's credentials and report remote revocation separately. */\nconst logout = async (context: CommandContext): Promise<void> => {\n const { config, signal, output } = context;\n const reference = config.profile?.credentialRef;\n\n await output.heading(\"Andesine · Sign out\");\n\n if (process.env.ANDESINE_API_KEY !== undefined) {\n await output.warning(\n \"ANDESINE_API_KEY is unchanged. Remove it from your environment to stop using that API key.\"\n );\n }\n\n if (!reference || !config.profileName) {\n await output.diagnostic(\"No saved login for this profile.\");\n await output.json({ loggedOut: true, localRemoved: false, revocation: \"not-applicable\" });\n return;\n }\n\n const revoked = await output.progress(\n \"Signing out\",\n () =>\n withStateLock(reference, signal, async (assertOwned) => {\n const store = await credentialStore(reference, signal);\n const credentials = await store.get();\n let revoked = false;\n\n if (\n credentials &&\n (credentials.baseURL !== config.baseURL ||\n credentials.accountID !== config.profile?.accountID)\n ) {\n throw new CLIError(\"Stored credentials do not match the selected instance and account.\");\n }\n\n if (credentials && !credentials.refreshPending) {\n try {\n await revokeAccess(config.baseURL, credentials.refreshToken, signal);\n revoked = true;\n } catch {\n signal.throwIfAborted();\n }\n }\n\n assertOwned();\n await store.delete();\n await clearProfileCredential(config.profileName!, reference, signal);\n return revoked;\n }),\n \"Local credentials removed\"\n );\n\n await output.json({\n loggedOut: true,\n localRemoved: true,\n revocation: revoked ? \"confirmed\" : \"unconfirmed\"\n });\n await output.diagnostic(\n \"Local credentials removed. Access tokens from earlier rotations may remain valid for up to 15 minutes.\"\n );\n\n if (!revoked) {\n throw new CLIError(\n \"Server revocation could not be confirmed. The server grant may remain active.\"\n );\n }\n\n await output.success(\"Signed out. Server revocation confirmed.\");\n};\n\nexport { logout };\n","import type { CommandContext } from \"../context\";\nimport { authenticatedClient, identity } from \"./client\";\n\n/** Verify the selected credential online; output identity metadata only. */\nconst status = async (context: CommandContext): Promise<void> => {\n const { output } = context;\n\n await output.heading(\"Andesine · Authentication\");\n\n const { account, source } = await output.progress(\n \"Checking authentication\",\n async () => {\n const { client, source } = await authenticatedClient(context);\n const account = await identity(client, context.signal);\n\n return { account, source };\n },\n \"Authentication verified\"\n );\n\n await output.note(\"Authenticated\", {\n \"Instance\": context.config.baseURL,\n \"Account\": account.type === \"key\" ? undefined : account.user.email,\n \"API key\": account.type === \"key\" ? account.keyID : undefined,\n \"Profile\": source === \"environment\" ? undefined : context.config.profileName,\n \"Credentials\": source,\n \"Workspace\": account.type === \"key\" ? account.workspaceID : context.config.workspaceID\n });\n\n await context.output.json({\n authenticated: true,\n baseURL: context.config.baseURL,\n profile: source === \"environment\" ? null : context.config.profileName,\n credentialSource: source,\n account: account.type === \"key\" ? null : account.user,\n keyID: account.type === \"key\" ? account.keyID : undefined,\n workspaceID: account.type === \"key\" ? account.workspaceID : (context.config.workspaceID ?? null)\n });\n};\n\nexport { status };\n","import { paginate, type AndesineClient } from \"@andesine/sdk\";\nimport type { TypesConfig } from \"../config/schema\";\n\ninterface CollectionChoice {\n id: string;\n path: string;\n slugPath: string;\n}\n\n/** Read selectable collections from one published snapshot, or the current tree. */\nconst listCollections = async (\n client: AndesineClient,\n source: TypesConfig[\"source\"],\n signal: AbortSignal\n): Promise<CollectionChoice[]> => {\n const collections: CollectionChoice[] = [];\n\n if (source.kind === \"published\") {\n const { kind: _, ...selector } = source;\n\n for await (const collection of client.content.paginateCollections(selector, { signal })) {\n collections.push(collection);\n }\n } else {\n const queue: Array<string | undefined> = [undefined];\n const seen = new Set<string>();\n\n for (const collectionID of queue) {\n const scope = collectionID ? { collectionID } : {};\n\n for await (const collection of paginate((cursor) =>\n client.collections.list({ ...scope, cursor, limit: 100 }, { signal })\n )) {\n if (seen.has(collection.id)) continue;\n\n seen.add(collection.id);\n collections.push(collection);\n queue.push(collection.id);\n }\n }\n }\n\n return collections.sort((a, b) => a.path.localeCompare(b.path));\n};\n\n/** Let the public API resolve IDs and paths, including collection-ID anchors. */\nconst validateCollections = async (\n client: AndesineClient,\n source: TypesConfig[\"source\"],\n selectors: TypesConfig[\"collections\"],\n signal: AbortSignal\n): Promise<void> => {\n let snapshotID =\n source.kind === \"published\" && \"snapshotID\" in source ? source.snapshotID : undefined;\n\n for (const selector of selectors.length ? selectors : [undefined]) {\n const scope =\n selector === undefined\n ? {}\n : typeof selector !== \"string\"\n ? selector\n : /^coll_[A-Za-z\\d]+$/.test(selector)\n ? { collectionID: selector }\n : { collectionPath: selector };\n\n if (source.kind === \"current\") {\n await client.collections.list({ ...scope, limit: 1 }, { signal });\n } else {\n const publication = snapshotID\n ? { snapshotID }\n : { channel: \"channel\" in source ? source.channel : undefined };\n const page = await client.content.listCollections(\n { ...scope, ...publication, limit: 1 },\n { signal }\n );\n\n snapshotID = page.snapshotID;\n }\n }\n};\n\nexport { listCollections, validateCollections };\nexport type { CollectionChoice };\n","import type { ResolvedConfig } from \"../config/resolve\";\nimport { typesConfigSchema, type TypesConfig } from \"../config/schema\";\nimport { CLIError, exitCodes } from \"../errors\";\nimport path from \"node:path\";\n\ninterface TypeOptions {\n source?: \"published\" | \"current\";\n channel?: string;\n snapshot?: string;\n collection?: string[];\n collectionSlugPath?: string[];\n allCollections?: boolean;\n output?: string;\n includeEntryIds?: boolean;\n includeEntryPaths?: boolean;\n includeTree?: boolean;\n}\ninterface GenerateOptions extends TypeOptions {\n check?: boolean;\n watch?: boolean;\n force?: boolean;\n interval?: string;\n}\n\nconst validateTypeOptions = (options: TypeOptions): void => {\n const invalidSource =\n (options.channel !== undefined && options.snapshot !== undefined) ||\n (options.source === \"current\" &&\n (options.channel !== undefined || options.snapshot !== undefined));\n\n if (invalidSource) {\n throw new CLIError(\n \"Use --channel or --snapshot for published content; neither can be used with --source current.\",\n exitCodes.usage\n );\n }\n\n if (options.allCollections && (options.collection || options.collectionSlugPath)) {\n throw new CLIError(\"Use collection selectors or --all-collections, not both.\", exitCodes.usage);\n }\n};\n\n/** Apply command overrides without changing the saved configuration. */\nconst collectionSelectors = (\n options: TypeOptions,\n initial: TypesConfig[\"collections\"]\n): TypesConfig[\"collections\"] => {\n if (options.allCollections) return [];\n if (options.collection === undefined && options.collectionSlugPath === undefined) return initial;\n\n return [\n ...(options.collection ?? []),\n ...(options.collectionSlugPath ?? []).map((collectionSlugPath) => ({ collectionSlugPath }))\n ];\n};\nconst resolveTypes = (config: ResolvedConfig, options: TypeOptions): TypesConfig => {\n const initial = config.types;\n const directory = config.configPath ? path.dirname(config.configPath) : process.cwd();\n let source = initial.source;\n\n validateTypeOptions(options);\n\n if (options.source === \"current\") {\n source = { kind: \"current\" };\n } else if (options.snapshot !== undefined) {\n source = { kind: \"published\", snapshotID: options.snapshot };\n } else if (options.source === \"published\" || options.channel !== undefined) {\n const previousChannel =\n initial.source.kind === \"published\" && \"channel\" in initial.source\n ? initial.source.channel\n : \"published\";\n\n source = { kind: \"published\", channel: options.channel ?? previousChannel };\n }\n\n const parsed = typesConfigSchema.safeParse({\n ...initial,\n source,\n collections: collectionSelectors(options, initial.collections),\n output: options.output ?? initial.output,\n includeEntryIDs: options.includeEntryIds ?? initial.includeEntryIDs,\n includeEntryPaths: options.includeEntryPaths ?? initial.includeEntryPaths,\n includeTree: options.includeTree ?? initial.includeTree\n });\n\n if (!parsed.success) {\n throw new CLIError(\n \"Invalid type options. Check the source, collection selectors, and output path.\",\n exitCodes.usage\n );\n }\n\n const output = path.resolve(directory, parsed.data.output);\n\n if (!/\\.(?:ts|mts|cts)$/.test(output) || output === config.configPath) {\n throw new CLIError(\n \"The types output must be a TypeScript file, separate from the configuration.\",\n exitCodes.usage\n );\n }\n\n return { ...parsed.data, collections: [...new Set(parsed.data.collections)], output };\n};\n\nexport { resolveTypes, validateTypeOptions, collectionSelectors };\nexport type { TypeOptions, GenerateOptions };\n","import { collectionSelectors } from \"../types/options\";\nimport { multiselect, select, text, confirm } from \"@clack/prompts\";\nimport type { AndesineClient } from \"@andesine/sdk\";\nimport type { CommandContext } from \"../context\";\nimport type { TypesConfig } from \"../config/schema\";\nimport { typesConfigSchema } from \"../config/schema\";\nimport { canPrompt } from \"../prompts\";\nimport { CLIError, exitCodes } from \"../errors\";\nimport { listCollections } from \"../content/collections\";\nimport type { InitOptions } from \"./options\";\n\ntype SourceMode = \"published\" | \"current\" | \"snapshot\";\n\nconst selectSource = async (\n context: CommandContext,\n client: AndesineClient,\n options: InitOptions,\n initial: TypesConfig[\"source\"]\n): Promise<TypesConfig[\"source\"]> => {\n const interactive = canPrompt(options.interactive);\n const initialMode =\n initial.kind === \"current\" ? \"current\" : \"snapshotID\" in initial ? \"snapshot\" : \"published\";\n const explicit =\n options.source !== undefined || options.channel !== undefined || options.snapshot !== undefined;\n let mode: SourceMode = initialMode;\n\n if (explicit) {\n mode = options.snapshot !== undefined ? \"snapshot\" : (options.source ?? \"published\");\n } else if (interactive) {\n mode = await context.prompt((prompt) =>\n select({\n ...prompt,\n message: \"Which content should types describe?\",\n initialValue: initialMode,\n options: [\n {\n value: \"published\",\n label: \"Published channel\",\n hint: \"Default; follows each publication\"\n },\n {\n value: \"current\",\n label: \"Current content\",\n hint: \"Includes unpublished schema changes\"\n },\n { value: \"snapshot\", label: \"Fixed published snapshot\" }\n ]\n })\n );\n }\n\n if (mode === \"current\") return { kind: \"current\" };\n\n if (mode === \"snapshot\") {\n const initialSnapshot =\n initial.kind === \"published\" && \"snapshotID\" in initial ? initial.snapshotID : \"\";\n const snapshotID =\n options.snapshot ??\n (interactive\n ? await context.prompt((prompt) =>\n text({\n ...prompt,\n message: \"Snapshot ID\",\n initialValue: initialSnapshot,\n validate: (value) =>\n /^snp_[A-Za-z\\d]{1,22}$/.test(value ?? \"\")\n ? undefined\n : \"Enter a snapshot ID (snp_…).\"\n })\n )\n : initialSnapshot);\n\n return { kind: \"published\", snapshotID };\n }\n\n const initialChannel =\n initial.kind === \"published\" && \"channel\" in initial ? initial.channel : \"published\";\n\n if (options.channel !== undefined || !interactive) {\n return { kind: \"published\", channel: options.channel ?? initialChannel };\n }\n\n const channels = await context.output.progress(\n \"Loading publishing channels\",\n () => client.publishing.listChannels({}, { signal: context.signal }),\n \"Publishing channels loaded\"\n );\n\n if (!channels.length) {\n throw new CLIError(\n \"No publishing channels are available. Select --source current or create a channel in Andesine.\"\n );\n }\n\n const channel = await context.prompt((prompt) =>\n select({\n ...prompt,\n message: \"Publishing channel\",\n initialValue: channels.some((item) => item.code === initialChannel)\n ? initialChannel\n : undefined,\n options: channels.map((item) => ({ value: item.code, label: item.name, hint: item.code }))\n })\n );\n\n return { kind: \"published\", channel };\n};\n\nconst selectTypes = async (\n context: CommandContext,\n client: AndesineClient,\n options: InitOptions,\n initial: TypesConfig\n): Promise<TypesConfig> => {\n const interactive = canPrompt(options.interactive);\n const source = await selectSource(context, client, options, initial.source);\n let collections = collectionSelectors(options, initial.collections);\n let output = options.output ?? initial.output;\n let includeEntryIDs = options.includeEntryIds ?? initial.includeEntryIDs;\n let includeEntryPaths = options.includeEntryPaths ?? initial.includeEntryPaths;\n let includeTree = options.includeTree ?? initial.includeTree;\n\n if (\n interactive &&\n options.collection === undefined &&\n options.collectionSlugPath === undefined &&\n !options.allCollections\n ) {\n const change =\n !collections.length ||\n (await context.prompt((prompt) =>\n confirm({\n ...prompt,\n message: \"Change the saved collection selection?\",\n initialValue: false\n })\n ));\n\n if (change) {\n const available = await context.output.progress(\n \"Loading collections\",\n () => listCollections(client, source, context.signal),\n \"Collections loaded\"\n );\n\n if (available.length) {\n const format = await context.prompt((prompt) =>\n select({\n ...prompt,\n message: \"How should collections be saved?\",\n options: [\n { value: \"id\", label: \"IDs\", hint: \"Stable when collections are renamed\" },\n { value: \"path\", label: \"Paths\", hint: \"Readable names from the explorer\" },\n { value: \"slug\", label: \"Slug paths\", hint: \"URL paths derived from names\" }\n ]\n })\n );\n const selected = await context.prompt((prompt) =>\n multiselect({\n ...prompt,\n message: \"Collections (leave empty for all)\",\n required: false,\n initialValues: available\n .filter((item) =>\n collections.some((selector) =>\n typeof selector === \"string\"\n ? selector === item.id || selector === item.path\n : selector.collectionSlugPath === item.slugPath\n )\n )\n .map((item) => item.id),\n options: available.map((item) => ({ value: item.id, label: item.path, hint: item.id }))\n })\n );\n\n collections = available\n .filter((item) => selected.includes(item.id))\n .map((item) =>\n format === \"id\"\n ? item.id\n : format === \"slug\"\n ? { collectionSlugPath: item.slugPath }\n : item.path\n );\n } else {\n collections = [];\n await context.output.diagnostic(\n \"No collections yet. The configuration will include all collections as they become available.\"\n );\n }\n }\n }\n\n if (interactive && options.output === undefined) {\n output = await context.prompt((prompt) =>\n text({\n ...prompt,\n message: \"Generated types file (relative to the configuration)\",\n initialValue: output,\n validate: (value) => (value?.trim() ? undefined : \"Enter an output path.\")\n })\n );\n }\n\n const explicitIncludes =\n options.includeEntryIds !== undefined ||\n options.includeEntryPaths !== undefined ||\n options.includeTree !== undefined;\n\n if (interactive && !explicitIncludes) {\n const extras = await context.prompt((prompt) =>\n multiselect({\n ...prompt,\n message: \"Optional generated types\",\n required: false,\n initialValues: [\n includeEntryIDs ? \"ids\" : \"\",\n includeEntryPaths ? \"paths\" : \"\",\n includeTree ? \"tree\" : \"\"\n ].filter(Boolean),\n options: [\n { value: \"ids\", label: \"Entry IDs\" },\n { value: \"paths\", label: \"Entry paths\" },\n { value: \"tree\", label: \"Exact tree structure\" }\n ]\n })\n );\n\n includeEntryIDs = extras.includes(\"ids\");\n includeEntryPaths = extras.includes(\"paths\");\n includeTree = extras.includes(\"tree\");\n }\n\n const parsed = typesConfigSchema.safeParse({\n source,\n collections: [...new Set(collections)],\n output,\n includeEntryIDs,\n includeEntryPaths,\n includeTree\n });\n\n if (!parsed.success) {\n throw new CLIError(\n \"Invalid type configuration. Check the source, collection selectors, and output path.\",\n exitCodes.usage\n );\n }\n\n return parsed.data;\n};\n\nexport { selectTypes };\n","import { CLIError, exitCodes } from \"../errors\";\nimport type { ProjectConfig } from \"../config/schema\";\nimport { randomUUID } from \"node:crypto\";\nimport { link, lstat, mkdir, readFile, rename, unlink, writeFile } from \"node:fs/promises\";\nimport path from \"node:path\";\nimport lockfile from \"proper-lockfile\";\n\nconst readProjectFile = async (file: string): Promise<string | undefined> => {\n try {\n const info = await lstat(file);\n\n if (!info.isFile() || info.isSymbolicLink()) {\n throw new CLIError(\n \"The project configuration must be a regular file, not a link.\",\n exitCodes.usage\n );\n }\n\n return await readFile(file, \"utf8\");\n } catch (error) {\n if ((error as NodeJS.ErrnoException).code === \"ENOENT\") return undefined;\n\n throw error;\n }\n};\n\n/** Recheck the reviewed file under a lock, then replace it with complete JSON. */\nconst writeProjectConfig = async (\n file: string,\n config: ProjectConfig,\n expected: string | undefined,\n signal: AbortSignal\n): Promise<void> => {\n const temporary = `${file}.${randomUUID()}.tmp`;\n let compromised = false;\n\n signal.throwIfAborted();\n await mkdir(path.dirname(file), { recursive: true });\n\n const release = await lockfile.lock(file, {\n realpath: false,\n onCompromised: () => {\n compromised = true;\n }\n });\n\n try {\n if ((await readProjectFile(file)) !== expected) {\n throw new CLIError(\"The project configuration changed during setup. Run init again.\");\n }\n\n const info = expected === undefined ? undefined : await lstat(file);\n\n await writeFile(temporary, `${JSON.stringify(config, null, 2)}\\n`, {\n flag: \"wx\",\n mode: info?.mode ?? 0o644\n });\n signal.throwIfAborted();\n\n if (compromised) throw new CLIError(\"The configuration lock was lost. Run init again.\");\n\n if (expected === undefined) {\n await link(temporary, file);\n } else {\n if ((await readProjectFile(file)) !== expected) {\n throw new CLIError(\"The project configuration changed during setup. Run init again.\");\n }\n\n await rename(temporary, file);\n }\n } finally {\n try {\n await unlink(temporary).catch((error: NodeJS.ErrnoException) => {\n if (error.code !== \"ENOENT\") throw error;\n });\n } finally {\n await release().catch((error: unknown) => {\n if (!compromised) throw error;\n });\n }\n }\n};\n\nexport { readProjectFile, writeProjectConfig };\n","import { AndesineAPIError, AndesineStreamProtocolError } from \"@andesine/sdk\";\nimport type { CommandContext } from \"../context\";\nimport { CLIError } from \"../errors\";\n\n/** Keep structured API failures on stderr without exposing response bodies or credentials. */\nconst reportAPIError = async (context: CommandContext, error: unknown): Promise<never> => {\n context.signal.throwIfAborted();\n\n if (error instanceof AndesineAPIError || error instanceof AndesineStreamProtocolError) {\n const response = error.response;\n const details =\n error instanceof AndesineAPIError\n ? {\n status: error.status,\n data: error.defined ? error.data : undefined,\n hints: error.hints\n }\n : {};\n\n await context.output.diagnostic(\n JSON.stringify({\n error: {\n code: error.code,\n message: error.message,\n ...details,\n requestID: response.headers.get(\"x-request-id\") ?? undefined,\n retryAfter: response.headers.get(\"retry-after\") ?? undefined\n }\n })\n );\n\n const missingCapability = error instanceof AndesineAPIError && error.status === 501;\n\n throw new CLIError(\n missingCapability\n ? `${error.message} This server may not support the operation. Check its capabilities and version.`\n : error.message\n );\n }\n\n throw error;\n};\n\nexport { reportAPIError };\n","import { createHash } from \"node:crypto\";\n\ninterface NamedItem {\n key: string;\n label: string;\n}\n\nconst compare = (left: string, right: string): number => (left < right ? -1 : left > right ? 1 : 0);\nconst json = (value: unknown): string =>\n JSON.stringify(value)\n .replace(/\\u2028/g, \"\\\\u2028\")\n .replace(/\\u2029/g, \"\\\\u2029\");\nconst literal = (value: string | null): string => json(value);\nconst union = (values: string[]): string =>\n [...new Set(values)].sort(compare).join(\" | \") || \"never\";\nconst tuple = (values: string[]): string => `[${values.join(\", \")}]`;\nconst hash = (value: string): string => createHash(\"sha256\").update(value).digest(\"hex\");\nconst identifier = (label: string): string => {\n const words = label.normalize(\"NFKC\").match(/[\\p{L}\\p{N}\\p{M}]+/gu) ?? [];\n const name = words\n .map((word) => {\n const [first, ...rest] = Array.from(word);\n\n return first.toUpperCase() + rest.join(\"\");\n })\n .join(\"\")\n .replace(/[^\\p{ID_Continue}]/gu, \"\");\n\n return /^[\\p{ID_Start}]/u.test(name) ? name : `_${name || \"Unnamed\"}`;\n};\n\n/** Allocate stable identifiers without using remote text as TypeScript syntax. */\nconst names = (items: NamedItem[], suffix: string): Map<string, string> => {\n const counts = new Map<string, number>();\n const result = new Map<string, string>();\n const used = new Set<string>();\n const sorted = [...items].sort((a, b) => compare(a.key, b.key));\n\n for (const item of sorted) {\n const base = `${identifier(item.label)}${suffix}`;\n\n counts.set(base, (counts.get(base) ?? 0) + 1);\n }\n\n for (const item of sorted) {\n const base = `${identifier(item.label)}${suffix}`;\n const digest = hash(item.key);\n\n let name = counts.get(base) === 1 ? base : `${base}_${digest.slice(0, 8)}`;\n let length = 8;\n\n while (used.has(name)) {\n length += 4;\n name = `${base}_${digest.slice(0, length)}`;\n }\n\n used.add(name);\n result.set(item.key, name);\n }\n\n return result;\n};\n\nexport { compare, json, literal, union, tuple, hash, names };\n","import type { SchemaField, SchemaProperty, SchemaRevision } from \"@andesine/sdk\";\nimport { compare, literal, union } from \"./source\";\n\n/** Match the API's derived field keys, including Unicode and empty-label fallbacks. */\nconst fieldKey = (field: SchemaField): string => {\n const fallback = field.kind === \"fragment\" ? \"content\" : \"property\";\n const source = Array.from(field.label.normalize(\"NFC\").trim()).slice(0, 50).join(\"\");\n const words = (source || fallback)\n .normalize(\"NFKC\")\n .replace(/([\\p{Ll}\\p{N}])(\\p{Lu})/gu, \"$1 $2\")\n .match(/[\\p{L}\\p{N}\\p{M}]+/gu);\n\n return (\n words\n ?.map((word, index) => {\n const [first = \"\", ...rest] = Array.from(word.toLowerCase());\n\n return `${index ? first.toUpperCase() : first}${rest.join(\"\")}`;\n })\n .join(\"\") || fallback\n );\n};\nconst propertyValue = (field: SchemaProperty): string => {\n switch (field.type) {\n case \"checkbox\":\n return \"boolean\";\n case \"number\":\n return \"number | null\";\n case \"select\":\n return union([literal(\"\"), ...field.options.map(literal)]);\n case \"multi-select\":\n return `Array<${union(field.options.map(literal))}>`;\n case \"text\":\n case \"date\":\n case \"url\":\n return \"string\";\n default:\n throw new Error(`Unsupported schema property type: ${String(field.type)}`);\n }\n};\nconst fieldMap = (fields: Map<string, string>): string => {\n const sorted = [...fields].sort(([a], [b]) => compare(a, b));\n\n return sorted.length\n ? `{\\n${sorted.map(([key, value]) => ` ${literal(key)}: ${value};`).join(\"\\n\")}\\n }`\n : \"Record<never, never>\";\n};\n\n/** Render effective fields only. Defaults are content, not constraints on field values. */\nconst schemaFields = (revision: SchemaRevision): string => {\n const groups = { property: new Map<string, string>(), fragment: new Map<string, string>() };\n\n if (revision.definition.formatVersion !== 1)\n throw new Error(\"Unsupported schema format version.\");\n\n for (const field of revision.definition.fields) {\n const key = fieldKey(field);\n const group = groups[field.kind];\n\n if (group.has(key)) throw new Error(`Duplicate ${field.kind} key ${literal(key)}.`);\n\n group.set(\n key,\n field.kind === \"property\"\n ? `{ name: string; type: ${literal(field.type)}; value: ${propertyValue(field)} }`\n : `{ name: string; content: FragmentDocument<${union(field.allowedBlocks.map(literal))}> }`\n );\n }\n\n return ` properties: ${fieldMap(groups.property)};\\n fragments: ${fieldMap(groups.fragment)};`;\n};\n\n// Only block kinds are constrained by schemas. Element names, props, marks, and\n// attributes remain general; default content must never become a schema for them.\nconst fragmentTypes = `type FragmentNode<Block extends string> = Omit<SDK.ContentNode, \"type\" | \"content\"> & {\n type: Block | \"paragraph\" | \"listItem\" | \"taskItem\" | \"tableRow\" | \"tableCell\" | \"tableHeader\" | \"text\" | \"hardBreak\";\n content?: Array<FragmentNode<Block>>;\n};\n\ntype FragmentDocument<Block extends string> = Omit<SDK.ContentNode, \"type\" | \"content\"> & {\n type: \"doc\";\n content: Array<Omit<FragmentNode<Block>, \"type\"> & { type: Block | \"paragraph\" }>;\n};`;\n\nexport { schemaFields, fragmentTypes };\n","import type { TypeMetadata, TypeMetadataCollection } from \"@andesine/sdk\";\nimport { literal, tuple } from \"./source\";\n\ninterface MetadataHierarchy {\n collections: Map<string | null, TypeMetadataCollection>;\n descendants: Map<string | null, string[]>;\n}\n\n/** Build selected subtrees. Missing parents are valid for a selected or restricted subtree. */\nconst hierarchy = (metadata: TypeMetadata): MetadataHierarchy => {\n const collections = new Map(\n metadata.collections.map((collection) => [collection.id, collection])\n );\n const children = new Map<string | null, TypeMetadataCollection[]>();\n const descendants = new Map<string | null, string[]>();\n const visiting = new Set<string | null>();\n const visit = (id: string | null): string[] => {\n if (visiting.has(id)) throw new Error(\"Type metadata contains a collection cycle.\");\n if (descendants.has(id)) return descendants.get(id)!;\n\n visiting.add(id);\n\n const result = (children.get(id) ?? []).flatMap((child) => [child.id!, ...visit(child.id)]);\n\n visiting.delete(id);\n descendants.set(id, result);\n\n return result;\n };\n\n if (collections.size !== metadata.collections.length) {\n throw new Error(\"Type metadata contains duplicate collection IDs.\");\n }\n\n for (const collection of metadata.collections) {\n if (collection.id === null) continue;\n\n const siblings = children.get(collection.parentID) ?? [];\n\n siblings.push(collection);\n children.set(collection.parentID, siblings);\n }\n\n for (const collection of metadata.collections) visit(collection.id);\n\n return { collections, descendants };\n};\n\n/** Emit ordered tree tuples without content bodies or runtime values. */\nconst treeTypes = (metadata: TypeMetadata, collectionNames: Map<string, string>): string[] => {\n const entries = new Map(metadata.entries!.map((entry) => [entry.id, entry]));\n const collections = new Map(\n metadata.collections.map((collection) => [collection.id, collection])\n );\n const rows = new Map(metadata.tree!.map((row) => [row.collectionID, row]));\n\n return metadata.collections.map((collection) => {\n const name = `${collectionNames.get(collection.id ?? \"/\")}Tree`;\n const row = rows.get(collection.id);\n\n if (!row) throw new Error(`Missing tree metadata for ${literal(collection.path)}.`);\n\n const childTrees = row.collectionIDs.map((id) => {\n const child = collections.get(id);\n\n if (!child || child.parentID !== collection.id) {\n throw new Error(`Invalid tree collection reference ${literal(id)}.`);\n }\n\n return `${collectionNames.get(id)}Tree`;\n });\n const childEntries = row.entryIDs.map((id) => {\n const entry = entries.get(id);\n\n if (!entry || entry.collectionID !== collection.id) {\n throw new Error(`Invalid tree entry reference ${literal(id)}.`);\n }\n\n return `Omit<SDK.PublishedEntry, \"id\" | \"name\" | \"path\" | \"slugPath\"> & { id: ${literal(id)}; name: ${literal(entry.name)}; path: ${literal(entry.path)}; slugPath: ${literal(entry.slugPath)} }`;\n });\n\n if (metadata.source.kind === \"current\") {\n return `export interface ${name} {\n collectionID: ${literal(collection.id)};\n collectionIDs: ${tuple(row.collectionIDs.map(literal))};\n entryIDs: ${tuple(row.entryIDs.map(literal))};\n}`;\n }\n\n return `export interface ${name} extends SDK.PublishedCollection {\n id: ${literal(collection.id)};\n name: ${literal(collection.name)};\n path: ${literal(collection.path)};\n slugPath: ${literal(collection.slugPath)};\n entries: ${tuple(childEntries)};\n collections: ${tuple(childTrees)};\n}`;\n });\n};\n\nexport { hierarchy, treeTypes };\n","import type { TypeMetadata } from \"@andesine/sdk\";\nimport type { TypesConfig } from \"../config/schema\";\nimport { compare, hash, json, literal, names, tuple, union } from \"./source\";\nimport { fragmentTypes, schemaFields } from \"./schema\";\nimport { hierarchy, treeTypes } from \"./tree\";\n\ninterface TypeGenerationOptions {\n /** Requested source. Omit to follow the metadata's channel or current source. */\n source?: TypesConfig[\"source\"];\n /** Requested collection selectors, recorded as provenance. Metadata is already scoped. */\n collections?: TypesConfig[\"collections\"];\n /** Emit exact ID bindings and per-collection entry ID unions. Defaults to false. */\n includeEntryIDs?: boolean;\n /** Emit exact path bindings and per-collection entry path unions. Defaults to false. */\n includeEntryPaths?: boolean;\n /** Emit ordered trees, including their entry identities. Defaults to false. */\n includeTree?: boolean;\n}\n\nconst GENERATED_TYPES_MARKER = \"// Generated by Andesine. Do not edit.\";\n\n/**\n * Convert public type metadata into deterministic, type-only TypeScript source.\n *\n * @param metadata - One complete current or published metadata response.\n * @param options - Source provenance and optional entry/tree exports. These do not filter\n * metadata; request the selected collections and optional metadata before calling this function.\n * @returns Source text with Workspace, collection, and revision types. No files are written.\n * @throws Error for unsupported metadata, inconsistent references, or missing requested extras.\n * No network, credentials, project config loading, or executable remote input is involved.\n */\nconst generateTypes = (metadata: TypeMetadata, options: TypeGenerationOptions = {}): string => {\n const includeEntries = Boolean(options.includeEntryIDs || options.includeEntryPaths);\n const requestedSource =\n options.source ??\n (metadata.source.kind === \"published\"\n ? { kind: \"published\", channel: metadata.source.channel }\n : { kind: \"current\" });\n const source: TypesConfig[\"source\"] =\n requestedSource.kind === \"current\"\n ? { kind: \"current\" }\n : \"snapshotID\" in requestedSource\n ? { kind: \"published\", snapshotID: requestedSource.snapshotID }\n : { kind: \"published\", channel: requestedSource.channel };\n const sourceMismatch =\n source.kind !== metadata.source.kind ||\n (source.kind === \"published\" &&\n metadata.source.kind === \"published\" &&\n ((\"channel\" in source && source.channel !== metadata.source.channel) ||\n (\"snapshotID\" in source && source.snapshotID !== metadata.source.snapshotID)));\n\n if (metadata.formatVersion !== 1) throw new Error(\"Unsupported type metadata format version.\");\n if (sourceMismatch) throw new Error(\"Type metadata does not match the requested source.\");\n\n if ((includeEntries || options.includeTree) && !metadata.entries) {\n throw new Error(\"Request entry metadata before generating entry or tree types.\");\n }\n\n if (options.includeTree && !metadata.tree) {\n throw new Error(\"Request tree metadata before generating tree types.\");\n }\n\n const collections = [...metadata.collections].sort((a, b) => compare(a.id ?? \"\", b.id ?? \"\"));\n const selected = { ...metadata, collections };\n const { descendants } = hierarchy(selected);\n const collectionNames = names(\n collections.map((row) => ({ key: row.id ?? \"/\", label: row.name || \"Root\" })),\n \"Collection\"\n );\n const revisions = new Map(metadata.revisions.map((revision) => [revision.revisionID, revision]));\n const usedRevisions = new Set(\n collections.flatMap((row) => row.schemaRevisionIDs).filter((id) => id !== null)\n );\n const entries =\n includeEntries || options.includeTree\n ? [...metadata.entries!].sort((a, b) => compare(a.id, b.id))\n : [];\n const collectionBindings = new Map<string, string>();\n const entryBindings = new Map<string, string>();\n const shapes = new Map<string, string>();\n const interfaces: string[] = [];\n const types: string[] = [];\n const schemaBindings: string[] = [];\n const treeBindings: string[] = [];\n const base = metadata.source.kind === \"published\" ? \"SDK.PublishedEntryContent\" : \"SDK.Entry\";\n const contentBase = `Omit<${base}, \"schema\" | \"properties\" | \"fragments\">`;\n const bind = (map: Map<string, string>, key: string, value: string) => {\n if (map.has(key) && map.get(key) !== value) {\n throw new Error(`Duplicate metadata selector ${literal(key)}.`);\n }\n\n map.set(key, value);\n };\n\n for (const collection of collections) {\n const name = collectionNames.get(collection.id ?? \"/\")!;\n\n bind(collectionBindings, collection.path, name);\n if (collection.slugPath !== collection.path) {\n bind(collectionBindings, collection.slugPath, name);\n }\n\n if (collection.id !== null) bind(collectionBindings, collection.id, name);\n }\n\n for (const entry of entries) {\n const collection = collectionBindings.get(entry.collectionID ?? \"/\");\n\n if (!collection) throw new Error(`Missing collection for entry ${literal(entry.id)}.`);\n if (entry.schemaRevisionID !== null) usedRevisions.add(entry.schemaRevisionID);\n\n const binding = `{ collection: ${literal(entry.collectionID ?? \"/\")}; schemaRevisionID: ${literal(entry.schemaRevisionID)} }`;\n\n if (options.includeEntryIDs) bind(entryBindings, entry.id, binding);\n\n if (options.includeEntryPaths) {\n bind(entryBindings, entry.path, binding);\n\n if (entry.slugPath !== entry.path) {\n bind(entryBindings, entry.slugPath, binding);\n }\n }\n }\n\n const revisionNames = names(\n [...usedRevisions].map((id) => ({ key: id, label: `Revision_${id}` })),\n \"Schema\"\n );\n\n for (const id of [...usedRevisions].sort(compare)) {\n const revision = revisions.get(id);\n\n if (!revision) throw new Error(`Missing schema revision ${literal(id)}.`);\n\n const fields = schemaFields(revision);\n const shapeName = `SchemaFields_${hash(fields)}`;\n const revisionName = revisionNames.get(id)!;\n\n shapes.set(shapeName, fields);\n interfaces.push(`export interface ${revisionName} extends ${shapeName} {\n hash: ${literal(revision.hash)};\n}`);\n types.push(\n `export type ${revisionName}Content = ${contentBase} & SDK.SchemaContent<Workspace, ${literal(id)}>;`\n );\n schemaBindings.push(` ${literal(id)}: ${revisionName};`);\n }\n\n for (const collection of collections) {\n const name = collectionNames.get(collection.id ?? \"/\")!;\n const ids = [...new Set(collection.schemaRevisionIDs)].sort((a, b) =>\n compare(a ?? \"\", b ?? \"\")\n );\n const childIDs = [...descendants.get(collection.id)!].sort(compare);\n const identity =\n metadata.source.kind === \"published\" ? ` & { collectionID: ${literal(collection.id)} }` : \"\";\n\n interfaces.push(`export interface ${name} extends SDK.WorkspaceCollection {\n id: ${literal(collection.id)};\n path: ${literal(collection.path)};\n slugPath: ${literal(collection.slugPath)};\n schemaRevisionIDs: readonly ${tuple(ids.map(literal))};\n descendants: readonly ${tuple(childIDs.map(literal))};\n}`);\n types.push(\n `export type ${name}Content = ${contentBase} & SDK.SchemaContent<Workspace, ${union(ids.map(literal))}>${identity};`\n );\n types.push(`export type ${name}StructuredContent = SDK.StructuredContent<${name}Content>;`);\n\n const collectionEntries = entries.filter((entry) => entry.collectionID === collection.id);\n\n if (options.includeEntryIDs) {\n types.push(\n `export type ${name}EntryID = ${union(collectionEntries.map((entry) => literal(entry.id)))};`\n );\n }\n\n if (options.includeEntryPaths) {\n types.push(\n `export type ${name}EntryPath = ${union(collectionEntries.map((entry) => literal(entry.path)))};`,\n `export type ${name}EntrySlugPath = ${union(collectionEntries.map((entry) => literal(entry.slugPath)))};`\n );\n }\n\n if (options.includeTree) {\n treeBindings.push(` ${literal(collection.path)}: ${name}Tree;`);\n if (collection.slugPath !== collection.path) {\n treeBindings.push(` ${literal(collection.slugPath)}: ${name}Tree;`);\n }\n if (collection.id !== null) treeBindings.push(` ${literal(collection.id)}: ${name}Tree;`);\n }\n }\n\n if (options.includeTree) {\n interfaces.push(...treeTypes(selected, collectionNames));\n types.push(`export type WorkspaceTree = {\\n${treeBindings.join(\"\\n\")}\\n};`);\n }\n\n const mapFields = [\n ` workspaceID: ${literal(metadata.workspaceID)};`,\n ` source: ${\n source.kind === \"current\"\n ? '{ kind: \"current\" }'\n : `{\n kind: \"published\";\n ${\"snapshotID\" in source ? `snapshotID: ${literal(source.snapshotID)};` : `channel: ${literal(source.channel)};`}\n }`\n };`,\n ` collections: {\\n${[...collectionBindings]\n .sort(([a], [b]) => compare(a, b))\n .map(([key, value]) => ` ${literal(key)}: ${value};`)\n .join(\"\\n\")}\\n };`,\n ` schemas: {\\n${schemaBindings.join(\"\\n\")}\\n };`\n ];\n\n if (includeEntries) {\n mapFields.push(\n ` entries: {\\n${[...entryBindings]\n .sort(([a], [b]) => compare(a, b))\n .map(([key, value]) => ` ${literal(key)}: ${value};`)\n .join(\"\\n\")}\\n };`\n );\n }\n\n if (options.includeTree && metadata.source.kind === \"published\") {\n mapFields.push(\" tree: WorkspaceTree;\");\n }\n\n return [\n [\n GENERATED_TYPES_MARKER,\n `// Workspace: ${literal(metadata.workspaceID)}; source: ${json(source)}.`,\n `// Collections: ${json([...(options.collections ?? [])].sort((a, b) => compare(json(a), json(b))))}; entry IDs: ${Boolean(options.includeEntryIDs)}; entry paths: ${Boolean(options.includeEntryPaths)}; tree: ${Boolean(options.includeTree)}.`,\n \"// Types only. Configure the runtime client for the same workspace and source.\"\n ].join(\"\\n\"),\n 'import type * as SDK from \"@andesine/sdk\";',\n `export interface Workspace extends SDK.WorkspaceTypeMap {\\n${mapFields.join(\"\\n\")}\\n}`,\n ...[...shapes]\n .sort(([a], [b]) => compare(a, b))\n .map(([name, fields]) => `interface ${name} {\\n${fields}\\n}`),\n ...interfaces,\n ...([...shapes.values()].some((fields) => fields.includes(\"FragmentDocument<\"))\n ? [fragmentTypes]\n : []),\n ...types,\n \"\"\n ].join(\"\\n\\n\");\n};\n\nexport { generateTypes, GENERATED_TYPES_MARKER };\nexport type { TypeGenerationOptions };\n","import { randomUUID } from \"node:crypto\";\nimport { link, lstat, mkdir, readFile, rename, unlink, writeFile } from \"node:fs/promises\";\nimport path from \"node:path\";\nimport lockfile from \"proper-lockfile\";\nimport { CLIError, exitCodes } from \"../errors\";\nimport { GENERATED_TYPES_MARKER } from \"./generate\";\n\n/** Read without creating files, directories, or locks. Reject links and non-regular files. */\nconst readTypesFile = async (file: string): Promise<string | undefined> => {\n try {\n const info = await lstat(file);\n\n if (!info.isFile() || info.isSymbolicLink()) {\n throw new CLIError(\"The types output must be a regular file, not a link.\", exitCodes.usage);\n }\n\n return await readFile(file, \"utf8\");\n } catch (error) {\n if ((error as NodeJS.ErrnoException).code === \"ENOENT\") return undefined;\n\n throw error;\n }\n};\n\n/** Replace only a reviewed file, atomically, and leave identical output untouched. */\nconst writeTypesFile = async (\n file: string,\n source: string,\n expected: string | undefined,\n signal: AbortSignal,\n force = false\n): Promise<boolean> => {\n const temporary = `${file}.${randomUUID()}.tmp`;\n const generated = expected?.split(/\\r?\\n/, 1)[0] === GENERATED_TYPES_MARKER;\n\n let compromised = false;\n\n signal.throwIfAborted();\n\n if (expected !== undefined && !generated && !force) {\n throw new CLIError(\n `Refusing to replace ${file}: it is not an Andesine generated file. Choose another --output or use --force to replace it.`,\n exitCodes.usage\n );\n }\n\n if (expected === source && (await readTypesFile(file)) === source) return false;\n\n await mkdir(path.dirname(file), { recursive: true });\n\n const release = await lockfile.lock(file, {\n realpath: false,\n onCompromised: () => {\n compromised = true;\n }\n });\n const assertUnchanged = async () => {\n signal.throwIfAborted();\n\n if (compromised) throw new CLIError(\"The types file lock was lost. Run generation again.\");\n\n if ((await readTypesFile(file)) !== expected) {\n throw new CLIError(\"The types file changed during generation. Run generation again.\");\n }\n };\n\n try {\n await assertUnchanged();\n if (expected === source) return false;\n\n const info = expected === undefined ? undefined : await lstat(file);\n\n await writeFile(temporary, source, { flag: \"wx\", mode: info?.mode ?? 0o644 });\n await assertUnchanged();\n\n if (expected === undefined) await link(temporary, file);\n else await rename(temporary, file);\n\n return true;\n } finally {\n try {\n await unlink(temporary).catch((error: NodeJS.ErrnoException) => {\n if (error.code !== \"ENOENT\") throw error;\n });\n } finally {\n await release().catch((error: unknown) => {\n if (!compromised) throw error;\n });\n }\n }\n};\n\nexport { readTypesFile, writeTypesFile };\n","import { AndesineAPIError, type TypeMetadata } from \"@andesine/sdk\";\nimport { authenticatedClient } from \"../auth/client\";\nimport type { CommandContext } from \"../context\";\nimport type { TypesConfig } from \"../config/schema\";\nimport { CLIError, exitCodes } from \"../errors\";\n\n/** Only metadata read failures can be retried by watch; writes and auth exchanges cannot. */\nclass RetryableMetadataError extends Error {\n constructor(\n readonly failure: unknown,\n readonly retryAfter = 0\n ) {\n super(\"Could not read type metadata.\", { cause: failure });\n }\n}\n\nconst retryDelay = (error: AndesineAPIError): number => {\n const header = error.response.headers.get(\"retry-after\");\n\n if (!header) return 0;\n\n const seconds = Number(header);\n const delay = Number.isFinite(seconds) ? seconds * 1000 : Date.parse(header) - Date.now();\n\n return Number.isFinite(delay) ? Math.max(0, delay) : 0;\n};\n\n/** Refresh credentials between polls and read the selected public metadata endpoint. */\nconst readMetadata = async (context: CommandContext, types: TypesConfig): Promise<TypeMetadata> => {\n const { config, signal } = context;\n\n if (process.env.ANDESINE_API_KEY === undefined && !config.workspaceID) {\n throw new CLIError(\n \"No workspace selected. Run andesine init, pass --workspace <id>, or set ANDESINE_WORKSPACE_ID.\",\n exitCodes.usage\n );\n }\n\n const { client } = await authenticatedClient(context);\n const input = {\n collections: types.collections,\n includeEntries: types.includeEntryIDs || types.includeEntryPaths || types.includeTree,\n includeTree: types.includeTree\n };\n const request = { signal, retries: 0 };\n\n let metadata: TypeMetadata;\n\n try {\n metadata =\n types.source.kind === \"current\"\n ? await client.typeMetadata.getCurrent(input, request)\n : await client.typeMetadata.getPublished(\n {\n ...input,\n ...(\"snapshotID\" in types.source\n ? { snapshotID: types.source.snapshotID }\n : { channel: types.source.channel })\n },\n request\n );\n } catch (error) {\n signal.throwIfAborted();\n\n const transientAPIError =\n error instanceof AndesineAPIError &&\n (error.status === 408 ||\n error.status === 429 ||\n (error.status >= 500 && error.status !== 501) ||\n error.code === \"SCHEMA_MIGRATION_IN_PROGRESS\");\n const networkError =\n error instanceof TypeError ||\n (error instanceof DOMException && error.name === \"TimeoutError\");\n\n if (transientAPIError || networkError) {\n throw new RetryableMetadataError(\n error,\n error instanceof AndesineAPIError ? retryDelay(error) : 0\n );\n }\n\n throw error;\n }\n\n if (config.workspaceID && config.workspaceID !== metadata.workspaceID) {\n throw new CLIError(\n \"The API credential returned another workspace. Check --workspace and ANDESINE_API_KEY.\"\n );\n }\n\n return metadata;\n};\n\nexport { readMetadata, RetryableMetadataError };\n","import { setTimeout } from \"node:timers/promises\";\nimport type { TypeMetadata } from \"@andesine/sdk\";\nimport type { CommandContext } from \"../context\";\nimport { CLIError, exitCodes } from \"../errors\";\nimport { reportAPIError } from \"../api/errors\";\nimport { generateTypes } from \"./generate\";\nimport { readTypesFile, writeTypesFile } from \"./file\";\nimport { readMetadata, RetryableMetadataError } from \"./metadata\";\nimport { resolveTypes, type GenerateOptions } from \"./options\";\n\ninterface GenerationResult {\n outputPath: string;\n workspaceID: string;\n source: TypeMetadata[\"source\"];\n fingerprint: string;\n status: \"generated\" | \"unchanged\" | \"current\" | \"stale\";\n}\ninterface GenerationCache {\n fingerprint: string;\n source: string;\n}\n\n/** Generate, check, or watch using the same metadata and output comparison. */\nconst executeTypes = async (\n context: CommandContext,\n options: GenerateOptions = {},\n emitResult = true\n): Promise<GenerationResult> => {\n const { output, signal } = context;\n const types = resolveTypes(context.config, options);\n const interval = Number(options.interval ?? \"10\") * 1000;\n\n if (options.check && (options.watch || options.force)) {\n throw new CLIError(\"--check cannot be combined with --watch or --force.\", exitCodes.usage);\n }\n\n if (options.interval !== undefined && !options.watch) {\n throw new CLIError(\"--interval requires --watch.\", exitCodes.usage);\n }\n\n if (!Number.isFinite(interval) || interval < 1000 || interval > 300_000) {\n throw new CLIError(\"--interval must be between 1 and 300 seconds.\", exitCodes.usage);\n }\n\n let cache: GenerationCache | undefined;\n let first = true;\n let failures = 0;\n let previousFailure: string | undefined;\n let force = options.force;\n\n const run = async (): Promise<GenerationResult> => {\n const expected = await readTypesFile(types.output);\n const metadata = await readMetadata(context, types);\n const source =\n cache?.fingerprint === metadata.fingerprint ? cache.source : generateTypes(metadata, types);\n const changed = options.check\n ? (await readTypesFile(types.output)) !== source\n : await writeTypesFile(types.output, source, expected, signal, force);\n\n signal.throwIfAborted();\n cache = { fingerprint: metadata.fingerprint, source };\n force = false;\n\n return {\n outputPath: types.output,\n workspaceID: metadata.workspaceID,\n source: metadata.source,\n fingerprint: metadata.fingerprint,\n status: options.check ? (changed ? \"stale\" : \"current\") : changed ? \"generated\" : \"unchanged\"\n };\n };\n\n await output.heading(\n `Andesine · ${options.check ? \"Check\" : options.watch ? \"Watch\" : \"Generate\"} content types`\n );\n await output.note(\"Type generation\", {\n Source: JSON.stringify(types.source),\n Collections:\n types.collections\n .map((selector) => (typeof selector === \"string\" ? selector : selector.collectionSlugPath))\n .join(\", \") || \"All accessible collections\",\n Output: types.output\n });\n\n if (options.watch) {\n await output.diagnostic(`Watching every ${interval / 1000}s. Press Ctrl+C to stop.`);\n }\n\n while (true) {\n let delay = interval;\n\n signal.throwIfAborted();\n\n try {\n const result = first\n ? await output.progress(\"Reading metadata and generating types\", run, \"Types checked\")\n : await run();\n const recovered = failures > 0;\n\n if (first || recovered || result.status === \"generated\") {\n if (recovered) await output.success(\"Metadata access restored.\");\n\n if (result.status === \"stale\") {\n await output.warning(\"Generated types are missing or out of date.\");\n } else {\n await output.success(\n result.status === \"generated\" ? \"Types generated.\" : \"Types are up to date.\"\n );\n }\n\n if (emitResult) await output.json(result);\n }\n\n if (result.status === \"stale\") {\n throw new CLIError(\n \"Run andesine types generate to update the types file.\",\n exitCodes.stale\n );\n }\n\n if (!options.watch) return result;\n\n first = false;\n failures = 0;\n previousFailure = undefined;\n } catch (error) {\n signal.throwIfAborted();\n\n if (!options.watch || !(error instanceof RetryableMetadataError)) {\n return reportAPIError(\n context,\n error instanceof RetryableMetadataError ? error.failure : error\n );\n }\n\n failures += 1;\n delay = Math.max(\n Math.min(interval * 2 ** Math.min(failures, 10), 60_000),\n interval,\n error.retryAfter\n );\n\n // Report the first failure and each changed error, then stay quiet until recovery.\n try {\n const message =\n error.failure instanceof Error ? error.failure.message : \"Metadata read failed.\";\n\n if (message !== previousFailure) {\n previousFailure = message;\n await reportAPIError(context, error.failure);\n }\n } catch (failure) {\n signal.throwIfAborted();\n\n const message = failure instanceof Error ? failure.message : \"Metadata read failed.\";\n\n await output.warning(\n `${message} Keeping the last types file. Retrying in ${Math.ceil(delay / 1000)}s.`\n );\n }\n\n first = false;\n }\n\n await setTimeout(Math.min(delay, 2_147_483_647), undefined, { signal });\n }\n};\n\nexport { executeTypes };\nexport type { GenerationResult };\n","import { confirm, select } from \"@clack/prompts\";\nimport { createCommandContext, type CommandContext } from \"../context\";\nimport { authenticatedClient, identity } from \"../auth/client\";\nimport { login } from \"../auth/login\";\nimport { readConfigFile } from \"../config/files\";\nimport { projectConfigSchema, typesConfigSchema, type ProjectConfig } from \"../config/schema\";\nimport { CancelledError, CLIError, exitCodes } from \"../errors\";\nimport { canPrompt } from \"../prompts\";\nimport { validateCollections } from \"../content/collections\";\nimport { selectTypes } from \"./choices\";\nimport { readProjectFile, writeProjectConfig } from \"./write-config\";\nimport type { InitOptions } from \"./options\";\nimport { validateTypeOptions } from \"../types/options\";\nimport { executeTypes } from \"../types/execute\";\nimport path from \"node:path\";\n\nconst selectWorkspace = async (context: CommandContext, interactive: boolean): Promise<string> => {\n const { client } = await authenticatedClient(context);\n const account = await context.output.progress(\n \"Checking your account\",\n () => identity(client, context.signal),\n \"Account verified\"\n );\n const configured = context.config.workspaceID;\n\n if (account.type === \"key\") {\n if (configured && configured !== account.workspaceID) {\n throw new CLIError(\n \"This API key belongs to another workspace. Change --workspace or ANDESINE_API_KEY.\"\n );\n }\n\n await context.output.note(\"API key\", {\n Instance: context.config.baseURL,\n Workspace: account.workspaceID\n });\n return account.workspaceID;\n }\n\n await context.output.note(\"Account\", {\n Instance: context.config.baseURL,\n Email: account.user.email,\n Profile: context.config.profileName\n });\n\n const workspaces = await context.output.progress(\n \"Loading workspaces\",\n () => client.workspaces.list(undefined, { signal: context.signal }),\n \"Workspaces loaded\"\n );\n\n if (configured && !workspaces.some((workspace) => workspace.id === configured)) {\n throw new CLIError(\n \"The selected workspace is not available to this account. Use --workspace with an accessible workspace ID.\",\n exitCodes.usage\n );\n }\n\n if (!workspaces.length) {\n throw new CLIError(\"No workspaces are available. Create a workspace in Andesine first.\");\n }\n if (!interactive && configured) return configured;\n if (workspaces.length === 1) return workspaces[0].id;\n\n if (!interactive) {\n throw new CLIError(\n \"Several workspaces are available. Supply --workspace <id> or run init in an interactive terminal.\",\n exitCodes.usage\n );\n }\n\n return context.prompt((prompt) =>\n select({\n ...prompt,\n message: \"Workspace\",\n initialValue: configured,\n options: workspaces.map((workspace) => ({\n value: workspace.id,\n label: workspace.name,\n hint: workspace.id\n }))\n })\n );\n};\n\nconst describeConfig = (config: ProjectConfig): Record<string, string | undefined> => ({\n \"Instance\": config.baseURL,\n \"Workspace\": config.workspaceID,\n \"Profile\": config.profile,\n \"Source\": config.types ? JSON.stringify(config.types.source) : undefined,\n \"Collections\": config.types\n ? config.types.collections\n .map((selector) => (typeof selector === \"string\" ? selector : selector.collectionSlugPath))\n .join(\", \") || \"All accessible collections\"\n : undefined,\n \"Output\": config.types?.output,\n \"Entry IDs\": config.types ? String(config.types.includeEntryIDs) : undefined,\n \"Entry paths\": config.types ? String(config.types.includeEntryPaths) : undefined,\n \"Exact tree\": config.types ? String(config.types.includeTree) : undefined\n});\n\n/** Configure a project through the public API; never save credentials in the project. */\nconst init = async (options: InitOptions, signal: AbortSignal): Promise<void> => {\n const interactive = canPrompt(options.interactive);\n\n validateTypeOptions(options);\n\n let context = await createCommandContext(options, signal, {\n allowNewProfile: true,\n allowMissingConfig: true\n });\n\n const explicitPath = options.config ?? process.env.ANDESINE_CONFIG;\n const explicitProfile = options.profile ?? process.env.ANDESINE_PROFILE;\n const file = path.resolve(explicitPath ?? context.config.configPath ?? \"andesine.json\");\n const original = await readProjectFile(file);\n const previous = await readConfigFile(file, projectConfigSchema, true);\n\n await context.output.heading(\"Andesine · Initialize project\");\n\n const needsLogin =\n process.env.ANDESINE_API_KEY === undefined && !context.config.profile?.credentialRef;\n\n if (needsLogin) {\n if (!interactive) {\n throw new CLIError(\n \"Sign in with andesine auth login or set ANDESINE_API_KEY before running init non-interactively.\",\n exitCodes.usage\n );\n }\n\n const approved = await context.prompt((prompt) =>\n confirm({ ...prompt, message: `Sign in to ${context.config.baseURL}?`, initialValue: true })\n );\n\n if (!approved) throw new CancelledError();\n\n await login(context, options, false);\n context = await createCommandContext(options, signal, { allowMissingConfig: true });\n }\n\n const workspaceID = await selectWorkspace(\n context,\n interactive && options.workspace === undefined\n );\n const scopedContext = { ...context, config: { ...context.config, workspaceID } };\n const { client } = await authenticatedClient(scopedContext);\n const types = await selectTypes(\n scopedContext,\n client,\n options,\n previous?.types ?? typesConfigSchema.parse({})\n );\n\n await context.output.progress(\n \"Validating the selected content\",\n () => validateCollections(client, types.source, types.collections, signal),\n \"Content selection verified\"\n );\n\n const config: ProjectConfig = {\n ...previous,\n $schema:\n previous?.$schema ??\n path\n .relative(path.dirname(file), path.resolve(\"node_modules/andesine/dist/config.schema.json\"))\n .split(path.sep)\n .join(\"/\"),\n version: 1,\n baseURL: context.config.baseURL,\n workspaceID,\n ...(explicitProfile !== undefined ? { profile: explicitProfile } : {}),\n types\n };\n const details = describeConfig(config);\n const previousDetails = previous ? describeConfig(previous) : undefined;\n const changes = Object.fromEntries(\n Object.entries(details)\n .filter(([label, value]) => !previousDetails || previousDetails[label] !== value)\n .map(([label, value]) => [\n label,\n previousDetails ? `${previousDetails[label] ?? \"Not set\"} → ${value ?? \"Not set\"}` : value\n ])\n );\n const unchanged = previous && JSON.stringify(previous) === JSON.stringify(config);\n\n await context.output.note(\n unchanged\n ? \"Configuration unchanged\"\n : previous\n ? \"Update configuration\"\n : \"Create configuration\",\n { File: file, ...changes }\n );\n\n if (!unchanged) {\n if (interactive && !options.yes) {\n const approved = await context.prompt((prompt) =>\n confirm({\n ...prompt,\n message: previous ? \"Save these changes?\" : \"Create this configuration?\",\n initialValue: true\n })\n );\n\n if (!approved) throw new CancelledError();\n } else if (previous && !options.yes) {\n throw new CLIError(\n \"The configuration already exists. Review the changes above and rerun with --yes to save them.\",\n exitCodes.usage\n );\n }\n\n await context.output.progress(\n \"Saving project configuration\",\n () => writeProjectConfig(file, config, original, signal),\n \"Project configuration saved\"\n );\n }\n\n await context.output.success(\n unchanged ? \"Project configuration is up to date.\" : \"Project initialized.\"\n );\n\n const generate =\n options.generate ??\n (interactive &&\n (await context.prompt((prompt) =>\n confirm({\n ...prompt,\n message: \"Generate the configured types file now?\",\n initialValue: false\n })\n )));\n const generation = generate\n ? await executeTypes(\n {\n ...scopedContext,\n config: {\n ...scopedContext.config,\n configPath: file,\n types: { ...types, output: path.resolve(path.dirname(file), types.output) }\n }\n },\n {},\n false\n )\n : undefined;\n\n await context.output.json({\n configured: true,\n changed: !unchanged,\n configPath: file,\n baseURL: config.baseURL,\n workspaceID,\n ...(generation ? { generation } : {})\n });\n};\n\nexport { init };\n","import { cp, readdir, readFile, rename, rm, writeFile } from \"node:fs/promises\";\nimport path from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\nimport { CLIError, exitCodes } from \"../errors\";\nimport type { createOutput } from \"../output\";\n\n// The build copies the template next to the bundled CLI; see `scripts/pages-template.ts`.\nconst templateDirectory = fileURLToPath(new URL(\"./templates/pages/\", import.meta.url));\n\nconst isEmptyDirectory = async (directory: string): Promise<boolean> => {\n try {\n return (await readdir(directory)).length === 0;\n } catch (error) {\n if ((error as NodeJS.ErrnoException).code === \"ENOENT\") return true;\n\n throw error;\n }\n};\n/** Package names allow lowercase letters, digits, and `-._~` only. */\nconst toPackageName = (directory: string): string => {\n const name = path\n .basename(directory)\n .toLowerCase()\n .replace(/[^a-z\\d._~-]+/g, \"-\");\n\n return name.replace(/^[._-]+|[-]+$/g, \"\") || \"andesine-pages-site\";\n};\n\n/** Creates an Andesine Pages site from the template in an empty directory. */\nconst initPages = async (\n directory: string,\n output: ReturnType<typeof createOutput>\n): Promise<void> => {\n const target = path.resolve(directory);\n const manifestPath = path.join(target, \"package.json\");\n\n if (!(await isEmptyDirectory(target))) {\n throw new CLIError(\n `${directory} is not empty. Choose a new or empty directory.`,\n exitCodes.usage\n );\n }\n\n await output.progress(\n \"Copying the template\",\n async () => {\n const manifest = JSON.parse(\n await readFile(path.join(templateDirectory, \"package.template.json\"), \"utf8\")\n );\n\n await cp(templateDirectory, target, { recursive: true });\n await rename(path.join(target, \"gitignore\"), path.join(target, \".gitignore\"));\n await rm(path.join(target, \"package.template.json\"));\n await writeFile(\n manifestPath,\n `${JSON.stringify({ ...manifest, name: toPackageName(target) }, null, 2)}\\n`\n );\n },\n \"Template copied\"\n );\n await output.note(\"Next steps\", {\n \"Open the site\": `cd ${path.relative(process.cwd(), target) || \".\"}`,\n \"Install\": \"npm install\",\n \"Start\": \"npm run dev\"\n });\n};\n\nexport { initPages };\n","/* eslint-disable max-lines */\n// Generated from SDK openapi.json. Do not edit.\nimport type { APICommand, JSONSchema } from \"./types\";\n\nconst commands: APICommand[] = [\n {\n id: \"assets.attach\",\n group: \"assets\",\n command: \"attach\",\n method: \"post\",\n path: \"/assets/{assetID}/attachments\",\n summary: \"Attach an asset\",\n description:\n \"Attaches a ready image to an entry. This does not insert an image node into the document.\\n\\nRequired API key permissions: entries. Write permissions also grant read access for the same resource.\",\n example: {\n assetID: \"ast_example\",\n entryID: \"ent_example\"\n },\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"assetID\",\n location: \"path\",\n required: true,\n schema: {\n type: \"string\",\n pattern: \"^ast_[A-Za-z\\\\d]{1,22}$\"\n },\n flag: \"asset-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"entryID\",\n location: \"body\",\n required: true,\n schema: {\n type: \"string\",\n pattern: \"^ent_[A-Za-z\\\\d]{1,22}$\"\n },\n flag: \"entry-id\",\n kind: \"string\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"empty\"\n },\n {\n id: \"assets.get\",\n group: \"assets\",\n command: \"get\",\n method: \"get\",\n path: \"/assets/{assetID}\",\n summary: \"Get asset status and details\",\n description:\n \"Returns image metadata, processing status, and available files. Supply entryID when checking access through an entry.\",\n example: {\n assetID: \"ast_example\",\n entryID: \"ent_example\"\n },\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"assetID\",\n location: \"path\",\n required: true,\n schema: {\n type: \"string\",\n pattern: \"^ast_[A-Za-z\\\\d]{1,22}$\"\n },\n flag: \"asset-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"entryID\",\n location: \"query\",\n required: false,\n schema: {\n type: \"string\",\n pattern: \"^ent_[A-Za-z\\\\d]{1,22}$\"\n },\n flag: \"entry-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"json\"\n },\n {\n id: \"assets.importURL\",\n group: \"assets\",\n command: \"import-url\",\n method: \"post\",\n path: \"/assets/imports\",\n summary: \"Import an image URL\",\n description:\n \"Downloads a remote image and starts processing it for the entry. With checkDuplicates, can return an existing image instead. Use assets.get to check processing status.\\n\\nRequired API key permissions: entries. Write permissions also grant read access for the same resource.\",\n example: {\n assetID: \"ast_example\",\n entryID: \"ent_example\",\n url: \"https://example.com/image.png\",\n checkDuplicates: true\n },\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"assetID\",\n location: \"body\",\n required: true,\n schema: {\n type: \"string\",\n pattern: \"^ast_[A-Za-z\\\\d]{1,22}$\"\n },\n flag: \"asset-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"entryID\",\n location: \"body\",\n required: true,\n schema: {\n type: \"string\",\n pattern: \"^ent_[A-Za-z\\\\d]{1,22}$\"\n },\n flag: \"entry-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"url\",\n location: \"body\",\n required: true,\n schema: {\n type: \"string\",\n maxLength: 4096,\n format: \"uri\"\n },\n flag: \"url\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"checkDuplicates\",\n location: \"body\",\n required: false,\n schema: {\n type: \"boolean\",\n default: false\n },\n flag: \"check-duplicates\",\n kind: \"boolean\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"json\"\n },\n {\n id: \"assets.register\",\n group: \"assets\",\n command: \"register\",\n method: \"post\",\n path: \"/assets/uploads\",\n summary: \"Register an image upload\",\n description:\n \"Reserves an image upload for an entry. Supply the byte count and lowercase SHA-256 checksum of the file. Call assets.upload before expiresAt, then use assets.get to check processing status.\\n\\nRequired API key permissions: entries. Write permissions also grant read access for the same resource.\",\n example: {\n assetID: \"ast_example\",\n entryID: \"ent_example\",\n filename: \"image.png\",\n byteSize: 1024,\n checksum: \"0000000000000000000000000000000000000000000000000000000000000000\"\n },\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"assetID\",\n location: \"body\",\n required: true,\n schema: {\n type: \"string\",\n pattern: \"^ast_[A-Za-z\\\\d]{1,22}$\"\n },\n flag: \"asset-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"entryID\",\n location: \"body\",\n required: true,\n schema: {\n type: \"string\",\n pattern: \"^ent_[A-Za-z\\\\d]{1,22}$\"\n },\n flag: \"entry-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"filename\",\n location: \"body\",\n required: true,\n schema: {\n type: \"string\",\n minLength: 1,\n maxLength: 255\n },\n flag: \"filename\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"byteSize\",\n location: \"body\",\n required: true,\n schema: {\n type: \"integer\",\n minimum: 1,\n maximum: 10485760\n },\n flag: \"byte-size\",\n kind: \"number\",\n nullable: false\n },\n {\n name: \"checksum\",\n location: \"body\",\n required: true,\n schema: {\n type: \"string\",\n pattern: \"^[a-f0-9]{64}$\",\n description: \"SHA-256 of the file bytes, verified by the backend and worker\"\n },\n flag: \"checksum\",\n kind: \"string\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"json\"\n },\n {\n id: \"assets.search\",\n group: \"assets\",\n command: \"search\",\n method: \"get\",\n path: \"/assets/search\",\n summary: \"Search assets\",\n description:\n \"Finds workspace images by text or SHA-256 checksum. Semantic search defaults to true and uses 1 AI credit for a text query. Returns up to 50 results.\\n\\nRequired API key permissions: read:entries, read:collections. Write permissions also grant read access for the same resource.\",\n example: {\n query: \"mountains\",\n limit: 10\n },\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"query\",\n location: \"query\",\n required: false,\n schema: {\n type: \"string\",\n maxLength: 500,\n default: \"\"\n },\n flag: \"query\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"checksum\",\n location: \"query\",\n required: false,\n schema: {\n type: \"string\",\n pattern: \"^[a-f0-9]{64}$\"\n },\n flag: \"checksum\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"semantic\",\n location: \"query\",\n required: false,\n schema: {\n type: \"boolean\",\n default: true\n },\n flag: \"semantic\",\n kind: \"boolean\",\n nullable: false\n },\n {\n name: \"limit\",\n location: \"query\",\n required: false,\n schema: {\n type: \"integer\",\n minimum: 1,\n maximum: 50,\n default: 24\n },\n flag: \"limit\",\n kind: \"number\",\n nullable: false\n },\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"json\"\n },\n {\n id: \"assets.upload\",\n group: \"assets\",\n command: \"upload\",\n method: \"put\",\n path: \"/assets/{assetID}/upload\",\n summary: \"Upload registered image bytes\",\n description:\n \"Uploads a file for a registered asset with multipart/form-data. The bytes must match the registered size and checksum. Processing continues after the upload; use assets.get to check status.\\n\\nRequired API key permissions: entries. Write permissions also grant read access for the same resource.\",\n example: {\n assetID: \"ast_example\",\n file: \"<binary file>\"\n },\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"assetID\",\n location: \"path\",\n required: true,\n schema: {\n type: \"string\",\n pattern: \"^ast_[A-Za-z\\\\d]{1,22}$\"\n },\n flag: \"asset-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"file\",\n location: \"body\",\n required: true,\n schema: {\n type: \"string\",\n contentMediaType: \"*/*\"\n },\n flag: \"file\",\n kind: \"file\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"empty\"\n },\n {\n id: \"auth.getIdentity\",\n group: \"auth\",\n command: \"get-identity\",\n method: \"get\",\n path: \"/identity\",\n summary: \"Get credential identity\",\n description:\n \"Returns the authenticated user for OAuth or browser credentials, or the key and workspace IDs for an API key. Does not require a workspace selection and does not count toward API usage.\",\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [],\n conditional: false,\n response: \"json\"\n },\n {\n id: \"collections.bulkDelete\",\n group: \"collections\",\n command: \"bulk-delete\",\n method: \"post\",\n path: \"/collections/bulk/delete\",\n summary: \"Delete collection trees\",\n description:\n \"Soft-deletes the selected collections, their descendants, and their entries. The workspace root cannot be deleted. An active schema migration can block this action.\\n\\nRequired API key permissions: collections. Write permissions also grant read access for the same resource.\",\n example: {\n ids: [\"coll_example\"]\n },\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"ids\",\n location: \"body\",\n required: true,\n schema: {\n type: \"array\",\n minItems: 1,\n maxItems: 100,\n items: {\n type: \"string\",\n pattern: \"^(?:\\\\w+?_[A-Za-z\\\\d]{1,22})$\"\n },\n description: \"IDs of the collections to delete\"\n },\n flag: \"ids\",\n kind: \"json\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"empty\"\n },\n {\n id: \"collections.create\",\n group: \"collections\",\n command: \"create\",\n method: \"post\",\n path: \"/collections\",\n summary: \"Create a collection\",\n description:\n \"Creates a child collection. Without parentID, uses the workspace root. The name defaults to Untitled. Creation selects an available sibling name with a numeric suffix when needed. Names are trimmed and NFC-normalized. Derived URL slugs must be unique across sibling entries and collections, including case and punctuation variants. Names cannot contain a slash or equal a single dot or two dots. Restricted collections require a session with restricted_collections permission and the Pro plan; API keys cannot create them.\\n\\nRequired API key permissions: collections. Write permissions also grant read access for the same resource.\",\n example: {\n name: \"Documentation\",\n parentID: \"coll_example\"\n },\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"id\",\n location: \"body\",\n required: false,\n schema: {\n type: \"string\",\n pattern: \"^(?:\\\\w+?_[A-Za-z\\\\d]{1,22})$\",\n description: \"ID of the collection\"\n },\n flag: \"id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"name\",\n location: \"body\",\n required: false,\n schema: {\n type: \"string\",\n minLength: 1,\n maxLength: 300,\n description: \"Name of the collection\"\n },\n flag: \"name\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"parentID\",\n location: \"body\",\n required: false,\n schema: {\n type: \"string\",\n pattern: \"^(?:\\\\w+?_[A-Za-z\\\\d]{1,22})$\",\n description: \"ID of the parent collection,\"\n },\n flag: \"parent-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"restricted\",\n location: \"body\",\n required: false,\n schema: {\n type: \"boolean\",\n description: \"Whether to restrict access to the collection tree\"\n },\n flag: \"restricted\",\n kind: \"boolean\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"json\"\n },\n {\n id: \"collections.delete\",\n group: \"collections\",\n command: \"delete\",\n method: \"delete\",\n path: \"/collections/{id}\",\n summary: \"Delete a collection tree\",\n description:\n \"Soft-deletes the collection, its descendants, and their entries. The workspace root cannot be deleted. An active schema migration can block this action.\\n\\nRequired API key permissions: collections. Write permissions also grant read access for the same resource.\",\n example: {\n id: \"coll_example\"\n },\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"id\",\n location: \"path\",\n required: true,\n schema: {\n type: \"string\",\n pattern: \"^(?:\\\\w+?_[A-Za-z\\\\d]{1,22})$\",\n description: \"ID of the collection to delete\"\n },\n flag: \"id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"empty\"\n },\n {\n id: \"collections.list\",\n group: \"collections\",\n command: \"list\",\n method: \"get\",\n path: \"/collections/list\",\n summary: \"List collections\",\n description:\n \"Lists collections under the selected ancestor. Pass pagination.nextCursor to the next request while pagination.hasMore is true. The limit is 1 to 100.\\n\\nRequired API key permissions: read:collections. Write permissions also grant read access for the same resource.\",\n example: {\n collectionID: \"coll_example\",\n limit: 20\n },\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"collectionID\",\n location: \"query\",\n required: false,\n schema: {\n type: \"string\",\n pattern: \"^coll_[A-Za-z\\\\d]{1,22}$\"\n },\n flag: \"collection-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"collectionPath\",\n location: \"query\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Decoded content path, such as /Docs/Page or coll_ID/Page. Names are case-sensitive. Do not URL-encode names before passing them to the SDK.\"\n },\n flag: \"collection-path\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"collectionSlugPath\",\n location: \"query\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Decoded derived slug path, such as /docs/getting-started or coll_ID/getting-started. Use the returned slugPath without URL encoding.\"\n },\n flag: \"collection-slug-path\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"cursor\",\n location: \"query\",\n required: false,\n schema: {\n type: \"string\",\n pattern: \"^(?:\\\\w+?_[A-Za-z\\\\d]{1,22})$\",\n description: \"Cursor from the previous page\"\n },\n flag: \"cursor\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"limit\",\n location: \"query\",\n required: false,\n schema: {\n type: \"integer\",\n minimum: 1,\n maximum: 100,\n description: \"Maximum collections to return\"\n },\n flag: \"limit\",\n kind: \"number\",\n nullable: false\n },\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"json\",\n pagination: \"cursor\"\n },\n {\n id: \"collections.update\",\n group: \"collections\",\n command: \"update\",\n method: \"put\",\n path: \"/collections/{id}\",\n summary: \"Rename a collection\",\n description:\n \"Updates the collection name. Rejects names already used by a sibling entry or collection. An active schema migration can block this action.\\n\\nRequired API key permissions: collections. Write permissions also grant read access for the same resource.\",\n example: {\n id: \"coll_example\",\n name: \"Guides\"\n },\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"id\",\n location: \"path\",\n required: true,\n schema: {\n type: \"string\",\n pattern: \"^(?:\\\\w+?_[A-Za-z\\\\d]{1,22})$\",\n description: \"ID of the collection to be updated\"\n },\n flag: \"id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"name\",\n location: \"body\",\n required: false,\n schema: {\n type: \"string\",\n minLength: 1,\n maxLength: 300,\n description: \"New name of the collection\"\n },\n flag: \"name\",\n kind: \"string\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"empty\"\n },\n {\n id: \"content.get\",\n group: \"content\",\n command: \"get\",\n method: \"get\",\n path: \"/content/entries/get\",\n summary: \"Get published entry content\",\n description:\n \"Returns content from a publishing channel or a specific available snapshot. Use channel or snapshotID, never both. The default channel is published. Validates saved content against its recorded schema and returns schema metadata. expectedSchemaHash must match that revision; schema-less content cannot match it. Validation and hash checks run before ETag handling. Supports ETag and If-None-Match; a match returns 304 without a body.\\n\\nRequired API key permissions: read:publishing. Write permissions also grant read access for the same resource.\",\n example: {\n entryID: \"ent_example\",\n channel: \"published\"\n },\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"entryID\",\n location: \"query\",\n required: false,\n schema: {\n type: \"string\",\n pattern: \"^ent_[A-Za-z\\\\d]{1,22}$\"\n },\n flag: \"entry-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"path\",\n location: \"query\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Decoded content path, such as /Docs/Page or coll_ID/Page. Names are case-sensitive. Do not URL-encode names before passing them to the SDK.\"\n },\n flag: \"path\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"slugPath\",\n location: \"query\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Decoded derived slug path, such as /docs/getting-started or coll_ID/getting-started. Use the returned slugPath without URL encoding.\"\n },\n flag: \"slug-path\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"expectedSchemaHash\",\n location: \"query\",\n required: false,\n schema: {\n type: \"string\",\n pattern: \"^[a-f\\\\d]{64}$\",\n description: \"Hash of the effective schema definition\"\n },\n flag: \"expected-schema-hash\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"channel\",\n location: \"query\",\n required: false,\n schema: {\n type: \"string\",\n minLength: 1,\n maxLength: 50,\n description: \"Publishing channel, defaults to published\"\n },\n flag: \"channel\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"snapshotID\",\n location: \"query\",\n required: false,\n schema: {\n type: \"string\",\n pattern: \"^snp_[A-Za-z\\\\d]{1,22}$\",\n description: \"Historical publication snapshot to read\"\n },\n flag: \"snapshot-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n }\n ],\n conditional: true,\n response: \"json\"\n },\n {\n id: \"content.getAsset\",\n group: \"content\",\n command: \"get-asset\",\n method: \"get\",\n path: \"/content/assets/{workspaceID}/{snapshotID}/{entryID}/{assetID}/{variant}\",\n summary: \"Download a published asset\",\n description:\n \"Returns binary image data from a publication snapshot. No API key is required. The asset must belong to the entry in that available snapshot. Use the asset URLs returned with published content.\",\n example: {\n workspaceID: \"ws_example\",\n snapshotID: \"snp_example\",\n entryID: \"ent_example\",\n assetID: \"ast_example\",\n variant: \"display\"\n },\n security: [],\n fields: [\n {\n name: \"workspaceID\",\n location: \"path\",\n required: true,\n schema: {\n type: \"string\",\n pattern: \"^ws_[A-Za-z\\\\d]{1,22}$\"\n },\n flag: \"workspace-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"snapshotID\",\n location: \"path\",\n required: true,\n schema: {\n type: \"string\",\n pattern: \"^snp_[A-Za-z\\\\d]{1,22}$\"\n },\n flag: \"snapshot-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"entryID\",\n location: \"path\",\n required: true,\n schema: {\n type: \"string\",\n pattern: \"^(?:\\\\w+?_[A-Za-z\\\\d]{1,22})$\"\n },\n flag: \"entry-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"assetID\",\n location: \"path\",\n required: true,\n schema: {\n type: \"string\",\n pattern: \"^ast_[A-Za-z\\\\d]{1,22}$\"\n },\n flag: \"asset-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"variant\",\n location: \"path\",\n required: true,\n schema: {\n enum: [\"thumbnail\", \"display\"],\n type: \"string\"\n },\n flag: \"variant\",\n kind: \"string\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"binary\"\n },\n {\n id: \"content.getSchema\",\n group: \"content\",\n command: \"get-schema\",\n method: \"get\",\n path: \"/content/entries/schema\",\n summary: \"Get a published entry schema\",\n description:\n \"Returns the exact recorded effective schema, or null for schema-less content. Uses the same publication access as content.get. Pass its snapshotID for a consistent read; use channel or snapshotID, not both.\\n\\nRequired API key permissions: read:publishing. Write permissions also grant read access for the same resource.\",\n example: {\n entryID: \"ent_example\",\n channel: \"published\"\n },\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"entryID\",\n location: \"query\",\n required: false,\n schema: {\n type: \"string\",\n pattern: \"^ent_[A-Za-z\\\\d]{1,22}$\"\n },\n flag: \"entry-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"path\",\n location: \"query\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Decoded content path, such as /Docs/Page or coll_ID/Page. Names are case-sensitive. Do not URL-encode names before passing them to the SDK.\"\n },\n flag: \"path\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"slugPath\",\n location: \"query\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Decoded derived slug path, such as /docs/getting-started or coll_ID/getting-started. Use the returned slugPath without URL encoding.\"\n },\n flag: \"slug-path\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"channel\",\n location: \"query\",\n required: false,\n schema: {\n type: \"string\",\n minLength: 1,\n maxLength: 50\n },\n flag: \"channel\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"snapshotID\",\n location: \"query\",\n required: false,\n schema: {\n type: \"string\",\n pattern: \"^snp_[A-Za-z\\\\d]{1,22}$\"\n },\n flag: \"snapshot-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"json\"\n },\n {\n id: \"content.getTree\",\n group: \"content\",\n command: \"get-tree\",\n method: \"get\",\n path: \"/content/tree\",\n summary: \"Get a published collection tree\",\n description:\n \"Returns a published collection tree and its snapshot ID. Use channel or snapshotID, never both. The default channel is published. Reuse the snapshot ID for consistent content reads. Supports ETag and If-None-Match; a match returns 304 without a body.\\n\\nRequired API key permissions: read:publishing. Write permissions also grant read access for the same resource.\",\n example: {\n collectionID: \"coll_example\",\n channel: \"published\"\n },\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"collectionID\",\n location: \"query\",\n required: false,\n schema: {\n type: \"string\",\n pattern: \"^coll_[A-Za-z\\\\d]{1,22}$\"\n },\n flag: \"collection-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"collectionPath\",\n location: \"query\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Decoded content path, such as /Docs/Page or coll_ID/Page. Names are case-sensitive. Do not URL-encode names before passing them to the SDK.\"\n },\n flag: \"collection-path\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"collectionSlugPath\",\n location: \"query\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Decoded derived slug path, such as /docs/getting-started or coll_ID/getting-started. Use the returned slugPath without URL encoding.\"\n },\n flag: \"collection-slug-path\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"channel\",\n location: \"query\",\n required: false,\n schema: {\n type: \"string\",\n minLength: 1,\n maxLength: 50,\n description: \"Publishing channel, defaults to published\"\n },\n flag: \"channel\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"snapshotID\",\n location: \"query\",\n required: false,\n schema: {\n type: \"string\",\n pattern: \"^snp_[A-Za-z\\\\d]{1,22}$\",\n description: \"Historical publication snapshot to read\"\n },\n flag: \"snapshot-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n }\n ],\n conditional: true,\n response: \"json\"\n },\n {\n id: \"content.listCollections\",\n group: \"content\",\n command: \"list-collections\",\n method: \"get\",\n path: \"/content/collections\",\n summary: \"List published collections\",\n description:\n \"Returns a flat page of collections from a publication snapshot. The default channel is published. On later pages, pass the returned snapshotID and pagination.nextCursor, and omit channel. Optionally select direct children using collectionID, collectionPath, or collectionSlugPath. Results are ordered by ID, not display order.\\n\\nRequired API key permissions: read:publishing. Write permissions also grant read access for the same resource.\",\n example: {\n channel: \"published\",\n limit: 20\n },\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"cursor\",\n location: \"query\",\n required: false,\n schema: {\n type: \"string\",\n pattern: \"^(?:\\\\w+?_[A-Za-z\\\\d]{1,22})$\",\n description: \"Cursor from the previous page; keep the same filters\"\n },\n flag: \"cursor\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"limit\",\n location: \"query\",\n required: false,\n schema: {\n type: \"integer\",\n minimum: 1,\n maximum: 100,\n default: 50\n },\n flag: \"limit\",\n kind: \"number\",\n nullable: false\n },\n {\n name: \"collectionID\",\n location: \"query\",\n required: false,\n schema: {\n type: \"string\",\n pattern: \"^coll_[A-Za-z\\\\d]{1,22}$\"\n },\n flag: \"collection-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"collectionPath\",\n location: \"query\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Decoded content path, such as /Docs/Page or coll_ID/Page. Names are case-sensitive. Do not URL-encode names before passing them to the SDK.\"\n },\n flag: \"collection-path\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"collectionSlugPath\",\n location: \"query\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Decoded derived slug path, such as /docs/getting-started or coll_ID/getting-started. Use the returned slugPath without URL encoding.\"\n },\n flag: \"collection-slug-path\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"channel\",\n location: \"query\",\n required: false,\n schema: {\n type: \"string\",\n minLength: 1,\n maxLength: 50\n },\n flag: \"channel\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"snapshotID\",\n location: \"query\",\n required: false,\n schema: {\n type: \"string\",\n pattern: \"^snp_[A-Za-z\\\\d]{1,22}$\"\n },\n flag: \"snapshot-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"json\",\n pagination: \"snapshot\"\n },\n {\n id: \"content.listEntries\",\n group: \"content\",\n command: \"list-entries\",\n method: \"get\",\n path: \"/content/entries\",\n summary: \"List published entries\",\n description:\n \"Returns a flat page of entries from a publication snapshot. The default channel is published. On later pages, pass the returned snapshotID and pagination.nextCursor, and omit channel. Select direct children using collectionID, collectionPath, or collectionSlugPath, or include nested entries with descendants: true. descendants requires a collection scope. All property filters must match the assigned version. includeContent: true returns validated full content, properties, fragments, assets, and recorded schema metadata. An invalid full item fails the page. Keep the same scope and filters across pages. Results are ordered by ID, not display order.\\n\\nRequired API key permissions: read:publishing. Write permissions also grant read access for the same resource.\",\n example: {\n channel: \"published\",\n limit: 20\n },\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"cursor\",\n location: \"query\",\n required: false,\n schema: {\n type: \"string\",\n pattern: \"^(?:\\\\w+?_[A-Za-z\\\\d]{1,22})$\",\n description: \"Cursor from the previous page; keep the same filters\"\n },\n flag: \"cursor\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"limit\",\n location: \"query\",\n required: false,\n schema: {\n type: \"integer\",\n minimum: 1,\n maximum: 100,\n default: 50\n },\n flag: \"limit\",\n kind: \"number\",\n nullable: false\n },\n {\n name: \"collectionID\",\n location: \"query\",\n required: false,\n schema: {\n type: \"string\",\n pattern: \"^coll_[A-Za-z\\\\d]{1,22}$\"\n },\n flag: \"collection-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"collectionPath\",\n location: \"query\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Decoded content path, such as /Docs/Page or coll_ID/Page. Names are case-sensitive. Do not URL-encode names before passing them to the SDK.\"\n },\n flag: \"collection-path\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"collectionSlugPath\",\n location: \"query\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Decoded derived slug path, such as /docs/getting-started or coll_ID/getting-started. Use the returned slugPath without URL encoding.\"\n },\n flag: \"collection-slug-path\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"channel\",\n location: \"query\",\n required: false,\n schema: {\n type: \"string\",\n minLength: 1,\n maxLength: 50\n },\n flag: \"channel\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"snapshotID\",\n location: \"query\",\n required: false,\n schema: {\n type: \"string\",\n pattern: \"^snp_[A-Za-z\\\\d]{1,22}$\"\n },\n flag: \"snapshot-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"descendants\",\n location: \"query\",\n required: false,\n schema: {\n type: \"boolean\",\n default: false\n },\n flag: \"descendants\",\n kind: \"boolean\",\n nullable: false\n },\n {\n name: \"includeContent\",\n location: \"query\",\n required: false,\n schema: {\n type: \"boolean\",\n default: false\n },\n flag: \"include-content\",\n kind: \"boolean\",\n nullable: false\n },\n {\n name: \"filters\",\n location: \"query\",\n required: false,\n schema: {\n type: \"array\",\n maxItems: 20,\n items: {\n $ref: \"#/components/schemas/PropertyFilter\"\n },\n default: []\n },\n flag: \"filters\",\n kind: \"json\",\n nullable: false\n },\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"json\",\n pagination: \"snapshot\"\n },\n {\n id: \"entries.bulkDelete\",\n group: \"entries\",\n command: \"bulk-delete\",\n method: \"post\",\n path: \"/entries/bulk/delete\",\n summary: \"Delete entries\",\n description:\n \"Soft-deletes the selected entries and clears current-entry selections for affected members. An active schema migration can block this action.\\n\\nRequired API key permissions: entries. Write permissions also grant read access for the same resource.\",\n example: {\n ids: [\"ent_example\"]\n },\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"ids\",\n location: \"body\",\n required: true,\n schema: {\n type: \"array\",\n minItems: 1,\n maxItems: 100,\n items: {\n type: \"string\",\n pattern: \"^(?:\\\\w+?_[A-Za-z\\\\d]{1,22})$\"\n },\n description: \"IDs of the entries to delete\"\n },\n flag: \"ids\",\n kind: \"json\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"empty\"\n },\n {\n id: \"entries.create\",\n group: \"entries\",\n command: \"create\",\n method: \"post\",\n path: \"/entries\",\n summary: \"Create an entry\",\n description:\n \"Creates an entry and its initial document. The name defaults to Untitled. Creation selects an available sibling name with a numeric suffix when needed. Names are trimmed and NFC-normalized. Derived URL slugs must be unique across sibling entries and collections, including case and punctuation variants. Names cannot contain a slash or equal a single dot or two dots. A collection schema can set the initial content.\\n\\nRequired API key permissions: entries. Write permissions also grant read access for the same resource.\",\n example: {\n name: \"Getting started\",\n collectionID: \"coll_example\"\n },\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"id\",\n location: \"body\",\n required: false,\n schema: {\n type: \"string\",\n pattern: \"^(?:\\\\w+?_[A-Za-z\\\\d]{1,22})$\",\n description: \"ID of the entry\"\n },\n flag: \"id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"name\",\n location: \"body\",\n required: false,\n schema: {\n type: \"string\",\n maxLength: 300,\n description: \"Name of the entry\"\n },\n flag: \"name\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"collectionID\",\n location: \"body\",\n required: false,\n schema: {\n type: \"string\",\n pattern: \"^(?:\\\\w+?_[A-Za-z\\\\d]{1,22})$\",\n description: \"ID of the collection this entry belongs to\"\n },\n flag: \"collection-id\",\n kind: \"string\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"json\"\n },\n {\n id: \"entries.delete\",\n group: \"entries\",\n command: \"delete\",\n method: \"delete\",\n path: \"/entries/{id}\",\n summary: \"Delete an entry\",\n description:\n \"Soft-deletes the entry and clears current-entry selections for affected members. An active schema migration can block this action.\\n\\nRequired API key permissions: entries. Write permissions also grant read access for the same resource.\",\n example: {\n id: \"ent_example\"\n },\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"id\",\n location: \"path\",\n required: true,\n schema: {\n type: \"string\",\n pattern: \"^(?:\\\\w+?_[A-Za-z\\\\d]{1,22})$\",\n description: \"ID of the entry to delete\"\n },\n flag: \"id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"empty\"\n },\n {\n id: \"entries.get\",\n group: \"entries\",\n command: \"get\",\n method: \"get\",\n path: \"/entries/get\",\n summary: \"Get an entry\",\n description:\n \"Returns current entry details, fragments, properties, and recorded schema metadata. Validates content without changing it. expectedSchemaHash must match the recorded schema; schema-less content cannot match it. Use content.get to read published content.\\n\\nRequired API key permissions: read:entries. Write permissions also grant read access for the same resource.\",\n example: {\n id: \"ent_example\"\n },\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"id\",\n location: \"query\",\n required: false,\n schema: {\n type: \"string\",\n pattern: \"^ent_[A-Za-z\\\\d]{1,22}$\"\n },\n flag: \"id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"path\",\n location: \"query\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Decoded content path, such as /Docs/Page or coll_ID/Page. Names are case-sensitive. Do not URL-encode names before passing them to the SDK.\"\n },\n flag: \"path\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"slugPath\",\n location: \"query\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Decoded derived slug path, such as /docs/getting-started or coll_ID/getting-started. Use the returned slugPath without URL encoding.\"\n },\n flag: \"slug-path\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"expectedSchemaHash\",\n location: \"query\",\n required: false,\n schema: {\n type: \"string\",\n pattern: \"^[a-f\\\\d]{64}$\",\n description: \"Hash of the effective schema definition\"\n },\n flag: \"expected-schema-hash\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"json\"\n },\n {\n id: \"entries.list\",\n group: \"entries\",\n command: \"list\",\n method: \"get\",\n path: \"/entries/list\",\n summary: \"List entries\",\n description:\n \"Lists entries in the selected collection, or all accessible entries when collectionID is omitted. Pass pagination.nextCursor to the next request while pagination.hasMore is true. The limit is 1 to 100 and defaults to 50.\\n\\nRequired API key permissions: read:entries. Write permissions also grant read access for the same resource.\",\n example: {\n collectionID: \"coll_example\",\n limit: 20\n },\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"collectionID\",\n location: \"query\",\n required: false,\n schema: {\n type: \"string\",\n pattern: \"^coll_[A-Za-z\\\\d]{1,22}$\"\n },\n flag: \"collection-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"collectionPath\",\n location: \"query\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Decoded content path, such as /Docs/Page or coll_ID/Page. Names are case-sensitive. Do not URL-encode names before passing them to the SDK.\"\n },\n flag: \"collection-path\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"collectionSlugPath\",\n location: \"query\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Decoded derived slug path, such as /docs/getting-started or coll_ID/getting-started. Use the returned slugPath without URL encoding.\"\n },\n flag: \"collection-slug-path\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"cursor\",\n location: \"query\",\n required: false,\n schema: {\n type: \"string\",\n pattern: \"^(?:\\\\w+?_[A-Za-z\\\\d]{1,22})$\",\n description: \"Cursor from the previous page\"\n },\n flag: \"cursor\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"limit\",\n location: \"query\",\n required: false,\n schema: {\n type: \"integer\",\n minimum: 1,\n maximum: 100,\n description: \"Maximum entries to return\"\n },\n flag: \"limit\",\n kind: \"number\",\n nullable: false\n },\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"json\",\n pagination: \"cursor\"\n },\n {\n id: \"entries.update\",\n group: \"entries\",\n command: \"update\",\n method: \"put\",\n path: \"/entries/{id}\",\n summary: \"Rename an entry\",\n description:\n \"Updates the entry name. Rejects names already used by a sibling entry or collection. An active schema migration can block this action.\\n\\nRequired API key permissions: entries. Write permissions also grant read access for the same resource.\",\n example: {\n id: \"ent_example\",\n name: \"Installation\"\n },\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"id\",\n location: \"path\",\n required: true,\n schema: {\n type: \"string\",\n pattern: \"^(?:\\\\w+?_[A-Za-z\\\\d]{1,22})$\",\n description: \"ID of the entry to be updated\"\n },\n flag: \"id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"name\",\n location: \"body\",\n required: false,\n schema: {\n type: \"string\",\n maxLength: 300,\n description: \"New name of the entry\"\n },\n flag: \"name\",\n kind: \"string\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"empty\"\n },\n {\n id: \"instance.get\",\n group: \"instance\",\n command: \"get\",\n method: \"get\",\n path: \"/instance\",\n summary: \"Get instance capabilities and limits\",\n description:\n \"Returns configured features and effective limits for the authenticated workspace. These values do not grant permissions or report live service health. No discovery request is made automatically by the SDK.\",\n example: {},\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"json\"\n },\n {\n id: \"memberships.invite\",\n group: \"memberships\",\n command: \"invite\",\n method: \"post\",\n path: \"/memberships\",\n summary: \"Invite a workspace member\",\n description:\n \"Creates an invitation and attempts email delivery. Check emailDelivery in the result. Requires the Pro plan and permission to delegate the selected role. Existing membership or pending invitation returns a conflict.\\n\\nRequired API key permissions: memberships. Write permissions also grant read access for the same resource.\",\n example: {\n email: \"editor@example.com\",\n roleID: \"rl_example\"\n },\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"email\",\n location: \"body\",\n required: true,\n schema: {\n type: \"string\",\n format: \"email\",\n description: \"Email address of the user to invite\"\n },\n flag: \"email\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"roleID\",\n location: \"body\",\n required: true,\n schema: {\n type: \"string\",\n pattern: \"^(?:\\\\w+?_[A-Za-z\\\\d]{1,22})$\",\n description: \"ID of the role to assign\"\n },\n flag: \"role-id\",\n kind: \"string\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"json\"\n },\n {\n id: \"memberships.list\",\n group: \"memberships\",\n command: \"list\",\n method: \"get\",\n path: \"/memberships\",\n summary: \"List workspace members\",\n description:\n \"Lists workspace memberships with role and user details. Use pagination.nextCursor to continue with the same filters; concurrent changes can affect later pages.\\n\\nRequired API key permissions: read:memberships. Write permissions also grant read access for the same resource.\",\n example: {},\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"cursor\",\n location: \"query\",\n required: false,\n schema: {\n type: \"string\",\n pattern: \"^(?:\\\\w+?_[A-Za-z\\\\d]{1,22})$\",\n description: \"Cursor from the previous page; keep the same filters\"\n },\n flag: \"cursor\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"limit\",\n location: \"query\",\n required: false,\n schema: {\n type: \"integer\",\n minimum: 1,\n maximum: 100,\n default: 50\n },\n flag: \"limit\",\n kind: \"number\",\n nullable: false\n },\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"json\",\n pagination: \"cursor\"\n },\n {\n id: \"memberships.listInvites\",\n group: \"memberships\",\n command: \"list-invites\",\n method: \"get\",\n path: \"/memberships/invites\",\n summary: \"List invitations\",\n description:\n \"Lists pending, unexpired workspace invitations. Use pagination.nextCursor to continue. Requires the Pro plan.\\n\\nRequired API key permissions: memberships. Write permissions also grant read access for the same resource.\",\n example: {},\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"cursor\",\n location: \"query\",\n required: false,\n schema: {\n type: \"string\",\n pattern: \"^(?:\\\\w+?_[A-Za-z\\\\d]{1,22})$\",\n description: \"Cursor from the previous page; keep the same filters\"\n },\n flag: \"cursor\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"limit\",\n location: \"query\",\n required: false,\n schema: {\n type: \"integer\",\n minimum: 1,\n maximum: 100,\n default: 50\n },\n flag: \"limit\",\n kind: \"number\",\n nullable: false\n },\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"json\",\n pagination: \"cursor\"\n },\n {\n id: \"memberships.remove\",\n group: \"memberships\",\n command: \"remove\",\n method: \"delete\",\n path: \"/memberships/{id}\",\n summary: \"Remove a workspace member\",\n description:\n \"Removes the membership and its workspace access. Administrator memberships have additional restrictions.\\n\\nRequired API key permissions: memberships. Write permissions also grant read access for the same resource.\",\n example: {\n id: \"ms_example\"\n },\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"id\",\n location: \"path\",\n required: true,\n schema: {\n type: \"string\",\n pattern: \"^(?:\\\\w+?_[A-Za-z\\\\d]{1,22})$\",\n description: \"ID of the membership to remove\"\n },\n flag: \"id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"empty\"\n },\n {\n id: \"memberships.resendInvite\",\n group: \"memberships\",\n command: \"resend-invite\",\n method: \"post\",\n path: \"/memberships/invites/{id}/resend\",\n summary: \"Resend an invitation\",\n description:\n \"Attempts email delivery again for a pending invitation. Check emailDelivery in the result. Requires the Pro plan.\\n\\nRequired API key permissions: memberships. Write permissions also grant read access for the same resource.\",\n example: {\n id: \"inv_example\"\n },\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"id\",\n location: \"path\",\n required: true,\n schema: {\n type: \"string\",\n pattern: \"^(?:\\\\w+?_[A-Za-z\\\\d]{1,22})$\",\n description: \"ID of the pending invitation\"\n },\n flag: \"id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"json\"\n },\n {\n id: \"memberships.revokeInvite\",\n group: \"memberships\",\n command: \"revoke-invite\",\n method: \"delete\",\n path: \"/memberships/invites/{id}\",\n summary: \"Revoke an invitation\",\n description:\n \"Revokes a pending invitation so it can no longer be accepted. Requires the Pro plan.\\n\\nRequired API key permissions: memberships. Write permissions also grant read access for the same resource.\",\n example: {\n id: \"inv_example\"\n },\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"id\",\n location: \"path\",\n required: true,\n schema: {\n type: \"string\",\n pattern: \"^(?:\\\\w+?_[A-Za-z\\\\d]{1,22})$\",\n description: \"ID of the invite to revoke\"\n },\n flag: \"id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"empty\"\n },\n {\n id: \"memberships.update\",\n group: \"memberships\",\n command: \"update\",\n method: \"patch\",\n path: \"/memberships/{id}\",\n summary: \"Change a member role\",\n description:\n \"Assigns a new role to a member. Requires the Pro plan and permission to delegate that role. Administrator assignments have additional restrictions.\\n\\nRequired API key permissions: memberships. Write permissions also grant read access for the same resource.\",\n example: {\n id: \"ms_example\",\n roleID: \"rl_example\"\n },\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"id\",\n location: \"path\",\n required: true,\n schema: {\n type: \"string\",\n pattern: \"^(?:\\\\w+?_[A-Za-z\\\\d]{1,22})$\",\n description: \"ID of the membership to update\"\n },\n flag: \"id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"roleID\",\n location: \"body\",\n required: true,\n schema: {\n type: \"string\",\n pattern: \"^(?:\\\\w+?_[A-Za-z\\\\d]{1,22})$\",\n description: \"New role ID\"\n },\n flag: \"role-id\",\n kind: \"string\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"empty\"\n },\n {\n id: \"publishing.bulkPublishCollections\",\n group: \"publishing\",\n command: \"bulk-publish-collections\",\n method: \"post\",\n path: \"/publishing/collections/bulk/publish\",\n summary: \"Publish collection trees\",\n description:\n \"Publishes the latest entry versions in the selected publishing-enabled collection trees. At least one ID is required. The default channel is published. Supply expectedSnapshotID from a prior channel read to reject concurrent publication changes.\\n\\nRequired API key permissions: publishing. Write permissions also grant read access for the same resource.\",\n example: {\n ids: [\"coll_example\"],\n channel: \"published\"\n },\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"channel\",\n location: \"body\",\n required: false,\n schema: {\n type: \"string\",\n minLength: 1,\n maxLength: 50,\n default: \"published\",\n description: \"Publishing channel, defaults to published\"\n },\n flag: \"channel\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"expectedSnapshotID\",\n location: \"body\",\n required: false,\n schema: {\n type: \"string\",\n pattern: \"^snp_[A-Za-z\\\\d]{1,22}$\",\n description:\n \"Reject the mutation if the channel no longer points to this reviewed snapshot\"\n },\n flag: \"expected-snapshot-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"ids\",\n location: \"body\",\n required: true,\n schema: {\n type: \"array\",\n minItems: 1,\n maxItems: 100,\n items: {\n type: \"string\",\n pattern: \"^(?:\\\\w+?_[A-Za-z\\\\d]{1,22})$\"\n },\n description: \"IDs of the collection trees to publish\"\n },\n flag: \"ids\",\n kind: \"json\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"json\"\n },\n {\n id: \"publishing.bulkPublishEntries\",\n group: \"publishing\",\n command: \"bulk-publish-entries\",\n method: \"post\",\n path: \"/publishing/entries/bulk/publish\",\n summary: \"Publish entries\",\n description:\n \"Publishes the selected entries with optional version IDs. Entries must be in publishing-enabled collections. At least one entry is required. The default channel is published. Supply expectedSnapshotID from a prior channel read to reject concurrent publication changes.\\n\\nRequired API key permissions: publishing. Write permissions also grant read access for the same resource.\",\n example: {\n entries: [\n {\n entryID: \"ent_example\"\n }\n ],\n channel: \"published\"\n },\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"channel\",\n location: \"body\",\n required: false,\n schema: {\n type: \"string\",\n minLength: 1,\n maxLength: 50,\n default: \"published\",\n description: \"Publishing channel, defaults to published\"\n },\n flag: \"channel\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"expectedSnapshotID\",\n location: \"body\",\n required: false,\n schema: {\n type: \"string\",\n pattern: \"^snp_[A-Za-z\\\\d]{1,22}$\",\n description:\n \"Reject the mutation if the channel no longer points to this reviewed snapshot\"\n },\n flag: \"expected-snapshot-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"entries\",\n location: \"body\",\n required: true,\n schema: {\n type: \"array\",\n minItems: 1,\n maxItems: 100,\n items: {\n $ref: \"#/components/schemas/PublishEntryTarget\"\n },\n description: \"Entries and versions to publish\"\n },\n flag: \"entries\",\n kind: \"json\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"empty\"\n },\n {\n id: \"publishing.bulkSetCollections\",\n group: \"publishing\",\n command: \"bulk-set-collections\",\n method: \"post\",\n path: \"/publishing/collections/bulk/set\",\n summary: \"Configure publishing for collections\",\n description:\n \"Enables publishing for the selected collections, or disables it and unpublishes their trees from all channels. When enabling, publish can also publish the latest entry versions.\\n\\nRequired API key permissions: publishing. Write permissions also grant read access for the same resource.\",\n example: {\n ids: [\"coll_example\"],\n enabled: true,\n publish: false\n },\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"ids\",\n location: \"body\",\n required: true,\n schema: {\n type: \"array\",\n minItems: 1,\n maxItems: 100,\n items: {\n type: \"string\",\n pattern: \"^(?:\\\\w+?_[A-Za-z\\\\d]{1,22})$\"\n },\n description: \"IDs of the collections to configure\"\n },\n flag: \"ids\",\n kind: \"json\",\n nullable: false\n },\n {\n name: \"expectedSnapshots\",\n location: \"body\",\n required: false,\n schema: {\n type: \"object\",\n propertyNames: {\n type: \"string\",\n minLength: 1,\n maxLength: 50\n },\n additionalProperties: {\n type: \"string\",\n pattern: \"^snp_[A-Za-z\\\\d]{1,22}$\"\n },\n description:\n \"Optional snapshot checks for supplied channels before changing collection publishing. Omitted channels are not checked.\"\n },\n flag: \"expected-snapshots\",\n kind: \"json\",\n nullable: false\n },\n {\n name: \"enabled\",\n location: \"body\",\n required: true,\n schema: {\n type: \"boolean\",\n description:\n \"Enable publishing, or disable and unpublish the collection trees from all channels\"\n },\n flag: \"enabled\",\n kind: \"boolean\",\n nullable: false\n },\n {\n name: \"publish\",\n location: \"body\",\n required: false,\n schema: {\n type: \"boolean\",\n description: \"Whether to publish latest entry versions when enabling publishing\"\n },\n flag: \"publish\",\n kind: \"boolean\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"json\"\n },\n {\n id: \"publishing.bulkUnpublishCollections\",\n group: \"publishing\",\n command: \"bulk-unpublish-collections\",\n method: \"post\",\n path: \"/publishing/collections/bulk/unpublish\",\n summary: \"Unpublish collection trees\",\n description:\n \"Removes publication assignments for the selected collection trees from the channel. At least one ID is required. The default channel is published. Supply expectedSnapshotID from a prior channel read to reject concurrent publication changes.\\n\\nRequired API key permissions: publishing. Write permissions also grant read access for the same resource.\",\n example: {\n ids: [\"coll_example\"],\n channel: \"published\"\n },\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"channel\",\n location: \"body\",\n required: false,\n schema: {\n type: \"string\",\n minLength: 1,\n maxLength: 50,\n default: \"published\",\n description: \"Publishing channel, defaults to published\"\n },\n flag: \"channel\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"expectedSnapshotID\",\n location: \"body\",\n required: false,\n schema: {\n type: \"string\",\n pattern: \"^snp_[A-Za-z\\\\d]{1,22}$\",\n description:\n \"Reject the mutation if the channel no longer points to this reviewed snapshot\"\n },\n flag: \"expected-snapshot-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"ids\",\n location: \"body\",\n required: true,\n schema: {\n type: \"array\",\n minItems: 1,\n maxItems: 100,\n items: {\n type: \"string\",\n pattern: \"^(?:\\\\w+?_[A-Za-z\\\\d]{1,22})$\"\n },\n description: \"IDs of the collection trees to unpublish\"\n },\n flag: \"ids\",\n kind: \"json\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"json\"\n },\n {\n id: \"publishing.bulkUnpublishEntries\",\n group: \"publishing\",\n command: \"bulk-unpublish-entries\",\n method: \"post\",\n path: \"/publishing/entries/bulk/unpublish\",\n summary: \"Unpublish entries\",\n description:\n \"Removes publication assignments for the selected entries from the channel. At least one ID is required. The default channel is published. Supply expectedSnapshotID from a prior channel read to reject concurrent publication changes.\\n\\nRequired API key permissions: publishing. Write permissions also grant read access for the same resource.\",\n example: {\n ids: [\"ent_example\"],\n channel: \"published\"\n },\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"channel\",\n location: \"body\",\n required: false,\n schema: {\n type: \"string\",\n minLength: 1,\n maxLength: 50,\n default: \"published\",\n description: \"Publishing channel, defaults to published\"\n },\n flag: \"channel\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"expectedSnapshotID\",\n location: \"body\",\n required: false,\n schema: {\n type: \"string\",\n pattern: \"^snp_[A-Za-z\\\\d]{1,22}$\",\n description:\n \"Reject the mutation if the channel no longer points to this reviewed snapshot\"\n },\n flag: \"expected-snapshot-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"ids\",\n location: \"body\",\n required: true,\n schema: {\n type: \"array\",\n minItems: 1,\n maxItems: 100,\n items: {\n type: \"string\",\n pattern: \"^(?:\\\\w+?_[A-Za-z\\\\d]{1,22})$\"\n },\n description: \"IDs of the entries to unpublish\"\n },\n flag: \"ids\",\n kind: \"json\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"empty\"\n },\n {\n id: \"publishing.createChannel\",\n group: \"publishing\",\n command: \"create-channel\",\n method: \"post\",\n path: \"/publishing/channels\",\n summary: \"Create a publishing channel\",\n description:\n \"Creates a publishing channel from its display name and returns the generated channel code.\\n\\nRequired API key permissions: publishing. Write permissions also grant read access for the same resource.\",\n example: {\n name: \"Preview\"\n },\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"name\",\n location: \"body\",\n required: true,\n schema: {\n type: \"string\",\n minLength: 1,\n maxLength: 50,\n description: \"Publishing channel label\"\n },\n flag: \"name\",\n kind: \"string\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"json\"\n },\n {\n id: \"publishing.deleteChannel\",\n group: \"publishing\",\n command: \"delete-channel\",\n method: \"delete\",\n path: \"/publishing/channels/{code}\",\n summary: \"Delete a publishing channel\",\n description:\n \"Deletes a custom channel and its publication assignments. The default published channel cannot be deleted.\\n\\nRequired API key permissions: publishing. Write permissions also grant read access for the same resource.\",\n example: {\n code: \"preview\"\n },\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"code\",\n location: \"path\",\n required: true,\n schema: {\n type: \"string\",\n minLength: 1,\n maxLength: 50,\n description: \"Publishing channel identifier\"\n },\n flag: \"code\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"expectedSnapshotID\",\n location: \"body\",\n required: false,\n schema: {\n type: \"string\",\n pattern: \"^snp_[A-Za-z\\\\d]{1,22}$\",\n description: \"Reject deletion if the channel snapshot changed\"\n },\n flag: \"expected-snapshot-id\",\n kind: \"string\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"empty\"\n },\n {\n id: \"publishing.getChannelContent\",\n group: \"publishing\",\n command: \"get-channel-content\",\n method: \"get\",\n path: \"/publishing/channels/{channel}/content\",\n summary: \"Get channel content and pending changes\",\n description:\n \"Returns publication state and pending changes for a publishing root, with the snapshot ID needed to review and revert changes.\\n\\nRequired API key permissions: read:publishing. Write permissions also grant read access for the same resource.\",\n example: {\n channel: \"published\",\n collectionID: \"coll_example\"\n },\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"channel\",\n location: \"path\",\n required: true,\n schema: {\n type: \"string\",\n minLength: 1,\n maxLength: 50\n },\n flag: \"channel\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"collectionID\",\n location: \"query\",\n required: true,\n schema: {\n type: \"string\",\n pattern: \"^(?:\\\\w+?_[A-Za-z\\\\d]{1,22})$\",\n description: \"Publishing root collection whose content to list\"\n },\n flag: \"collection-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"json\"\n },\n {\n id: \"publishing.getEntryVersion\",\n group: \"publishing\",\n command: \"get-entry-version\",\n method: \"get\",\n path: \"/publishing/entries/{entryID}/version\",\n summary: \"Get a published entry version\",\n description:\n \"Returns the entry version assigned to a channel, or to an explicit available snapshot, with its recorded schema metadata. Validates content against that revision. expectedSchemaHash must match it; schema-less content cannot match it. The default channel is published.\\n\\nRequired API key permissions: read:publishing. Write permissions also grant read access for the same resource.\",\n example: {\n entryID: \"ent_example\",\n channel: \"published\"\n },\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"entryID\",\n location: \"path\",\n required: true,\n schema: {\n type: \"string\",\n pattern: \"^(?:\\\\w+?_[A-Za-z\\\\d]{1,22})$\",\n description: \"Entry whose published version to get\"\n },\n flag: \"entry-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"channel\",\n location: \"query\",\n required: false,\n schema: {\n type: \"string\",\n minLength: 1,\n maxLength: 50,\n default: \"published\",\n description: \"Publishing channel, defaults to published\"\n },\n flag: \"channel\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"expectedSchemaHash\",\n location: \"query\",\n required: false,\n schema: {\n type: \"string\",\n pattern: \"^[a-f\\\\d]{64}$\",\n description: \"Hash of the effective schema definition\"\n },\n flag: \"expected-schema-hash\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"snapshotID\",\n location: \"query\",\n required: false,\n schema: {\n type: \"string\",\n pattern: \"^snp_[A-Za-z\\\\d]{1,22}$\",\n description: \"Exact publication snapshot to read\"\n },\n flag: \"snapshot-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"json\"\n },\n {\n id: \"publishing.listChannels\",\n group: \"publishing\",\n command: \"list-channels\",\n method: \"get\",\n path: \"/publishing/channels\",\n summary: \"List publishing channels\",\n description:\n \"Returns workspace publishing channels. Set includeAssignmentCount to include entry assignment counts.\\n\\nRequired API key permissions: read:publishing. Write permissions also grant read access for the same resource.\",\n example: {\n includeAssignmentCount: true\n },\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"includeAssignmentCount\",\n location: \"query\",\n required: false,\n schema: {\n type: \"boolean\",\n description: \"Whether to include the number of assigned entries\"\n },\n flag: \"include-assignment-count\",\n kind: \"boolean\",\n nullable: false\n },\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"json\"\n },\n {\n id: \"publishing.listEntryPublications\",\n group: \"publishing\",\n command: \"list-entry-publications\",\n method: \"get\",\n path: \"/publishing/entries/{entryID}/publications\",\n summary: \"List entry publications\",\n description:\n \"Returns the entry publication assignments across channels.\\n\\nRequired API key permissions: read:publishing. Write permissions also grant read access for the same resource.\",\n example: {\n entryID: \"ent_example\"\n },\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"entryID\",\n location: \"path\",\n required: true,\n schema: {\n type: \"string\",\n pattern: \"^(?:\\\\w+?_[A-Za-z\\\\d]{1,22})$\",\n description: \"Entry whose publications to list\"\n },\n flag: \"entry-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"json\"\n },\n {\n id: \"publishing.publishCollection\",\n group: \"publishing\",\n command: \"publish-collection\",\n method: \"post\",\n path: \"/publishing/collections/{collectionID}\",\n summary: \"Publish a collection tree\",\n description:\n \"Publishes the latest entry versions in a publishing-enabled collection tree to the channel. The default channel is published. Supply expectedSnapshotID from a prior channel read to reject concurrent publication changes.\\n\\nRequired API key permissions: publishing. Write permissions also grant read access for the same resource.\",\n example: {\n collectionID: \"coll_example\",\n channel: \"published\"\n },\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"collectionID\",\n location: \"path\",\n required: true,\n schema: {\n type: \"string\",\n pattern: \"^(?:\\\\w+?_[A-Za-z\\\\d]{1,22})$\",\n description: \"Collection tree to publish\"\n },\n flag: \"collection-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"channel\",\n location: \"body\",\n required: false,\n schema: {\n type: \"string\",\n minLength: 1,\n maxLength: 50,\n default: \"published\",\n description: \"Publishing channel, defaults to published\"\n },\n flag: \"channel\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"expectedSnapshotID\",\n location: \"body\",\n required: false,\n schema: {\n type: \"string\",\n pattern: \"^snp_[A-Za-z\\\\d]{1,22}$\",\n description:\n \"Reject the mutation if the channel no longer points to this reviewed snapshot\"\n },\n flag: \"expected-snapshot-id\",\n kind: \"string\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"json\"\n },\n {\n id: \"publishing.publishEntry\",\n group: \"publishing\",\n command: \"publish-entry\",\n method: \"post\",\n path: \"/publishing/entries/{entryID}\",\n summary: \"Publish an entry\",\n description:\n \"Publishes an existing version, or the latest entry content if versionID is omitted. The entry must be in a publishing-enabled collection. The default channel is published. Supply expectedSnapshotID from a prior channel read to reject concurrent publication changes.\\n\\nRequired API key permissions: publishing. Write permissions also grant read access for the same resource.\",\n example: {\n entryID: \"ent_example\",\n channel: \"published\"\n },\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"entryID\",\n location: \"path\",\n required: true,\n schema: {\n type: \"string\",\n pattern: \"^(?:\\\\w+?_[A-Za-z\\\\d]{1,22})$\",\n description: \"Entry to publish\"\n },\n flag: \"entry-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"channel\",\n location: \"body\",\n required: false,\n schema: {\n type: \"string\",\n minLength: 1,\n maxLength: 50,\n default: \"published\",\n description: \"Publishing channel, defaults to published\"\n },\n flag: \"channel\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"expectedSnapshotID\",\n location: \"body\",\n required: false,\n schema: {\n type: \"string\",\n pattern: \"^snp_[A-Za-z\\\\d]{1,22}$\",\n description:\n \"Reject the mutation if the channel no longer points to this reviewed snapshot\"\n },\n flag: \"expected-snapshot-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"versionID\",\n location: \"body\",\n required: false,\n schema: {\n type: \"string\",\n pattern: \"^(?:\\\\w+?_[A-Za-z\\\\d]{1,22})$\",\n description: \"Existing version to publish\"\n },\n flag: \"version-id\",\n kind: \"string\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"empty\"\n },\n {\n id: \"publishing.revertChanges\",\n group: \"publishing\",\n command: \"revert-changes\",\n method: \"post\",\n path: \"/publishing/changes/revert\",\n summary: \"Revert pending publishing changes\",\n description:\n \"Restores selected drafts to the reviewed publication snapshot. This can remove unpublished items and replace draft content. First review publishing.getChannelContent and pass its snapshotID. Use all: true or specific collectionIDs/entryIDs, never both. Requires write access to affected resources in addition to read:publishing.\\n\\nRequired API key permissions: read:publishing. Write permissions also grant read access for the same resource.\",\n example: {\n collectionID: \"coll_example\",\n snapshotID: \"snp_example\",\n entryIDs: [\"ent_example\"],\n channel: \"published\"\n },\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"channel\",\n location: \"body\",\n required: false,\n schema: {\n type: \"string\",\n minLength: 1,\n maxLength: 50,\n default: \"published\",\n description: \"Publishing channel, defaults to published\"\n },\n flag: \"channel\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"all\",\n location: \"body\",\n required: false,\n schema: {\n type: \"boolean\",\n description: \"Whether to revert all pending changes\"\n },\n flag: \"all\",\n kind: \"boolean\",\n nullable: false\n },\n {\n name: \"collectionID\",\n location: \"body\",\n required: true,\n schema: {\n type: \"string\",\n pattern: \"^(?:\\\\w+?_[A-Za-z\\\\d]{1,22})$\",\n description: \"Publishing root collection\"\n },\n flag: \"collection-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"collectionIDs\",\n location: \"body\",\n required: false,\n schema: {\n type: \"array\",\n maxItems: 100,\n items: {\n type: \"string\",\n pattern: \"^(?:\\\\w+?_[A-Za-z\\\\d]{1,22})$\"\n },\n description: \"Collections whose changes to revert\"\n },\n flag: \"collection-ids\",\n kind: \"json\",\n nullable: false\n },\n {\n name: \"entryIDs\",\n location: \"body\",\n required: false,\n schema: {\n type: \"array\",\n maxItems: 100,\n items: {\n type: \"string\",\n pattern: \"^(?:\\\\w+?_[A-Za-z\\\\d]{1,22})$\"\n },\n description: \"Entries whose changes to revert\"\n },\n flag: \"entry-ids\",\n kind: \"json\",\n nullable: false\n },\n {\n name: \"snapshotID\",\n location: \"body\",\n required: true,\n schema: {\n type: \"string\",\n pattern: \"^snp_[A-Za-z\\\\d]{1,22}$\",\n description: \"Snapshot used to review the changes\"\n },\n flag: \"snapshot-id\",\n kind: \"string\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"json\"\n },\n {\n id: \"publishing.setCollection\",\n group: \"publishing\",\n command: \"set-collection\",\n method: \"put\",\n path: \"/publishing/collections/{collectionID}\",\n summary: \"Configure collection publishing\",\n description:\n \"Enables publishing for a collection, or disables it and unpublishes its tree from all channels. When enabling, publish can also publish the latest entry versions.\\n\\nRequired API key permissions: publishing. Write permissions also grant read access for the same resource.\",\n example: {\n collectionID: \"coll_example\",\n enabled: true,\n publish: false\n },\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"collectionID\",\n location: \"path\",\n required: true,\n schema: {\n type: \"string\",\n pattern: \"^(?:\\\\w+?_[A-Za-z\\\\d]{1,22})$\",\n description: \"Collection to configure\"\n },\n flag: \"collection-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"expectedSnapshots\",\n location: \"body\",\n required: false,\n schema: {\n type: \"object\",\n propertyNames: {\n type: \"string\",\n minLength: 1,\n maxLength: 50\n },\n additionalProperties: {\n type: \"string\",\n pattern: \"^snp_[A-Za-z\\\\d]{1,22}$\"\n },\n description:\n \"Optional snapshot checks for supplied channels before changing collection publishing. Omitted channels are not checked.\"\n },\n flag: \"expected-snapshots\",\n kind: \"json\",\n nullable: false\n },\n {\n name: \"enabled\",\n location: \"body\",\n required: true,\n schema: {\n type: \"boolean\",\n description:\n \"Enable publishing, or disable and unpublish the collection tree from all channels\"\n },\n flag: \"enabled\",\n kind: \"boolean\",\n nullable: false\n },\n {\n name: \"publish\",\n location: \"body\",\n required: false,\n schema: {\n type: \"boolean\",\n description: \"Whether to publish latest entry versions when enabling publishing\"\n },\n flag: \"publish\",\n kind: \"boolean\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"json\"\n },\n {\n id: \"publishing.unpublishCollection\",\n group: \"publishing\",\n command: \"unpublish-collection\",\n method: \"delete\",\n path: \"/publishing/collections/{collectionID}\",\n summary: \"Unpublish a collection tree\",\n description:\n \"Removes publication assignments for a collection tree from the channel. The default channel is published. Supply expectedSnapshotID from a prior channel read to reject concurrent publication changes.\\n\\nRequired API key permissions: publishing. Write permissions also grant read access for the same resource.\",\n example: {\n collectionID: \"coll_example\",\n channel: \"published\"\n },\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"collectionID\",\n location: \"path\",\n required: true,\n schema: {\n type: \"string\",\n pattern: \"^(?:\\\\w+?_[A-Za-z\\\\d]{1,22})$\",\n description: \"Collection tree to unpublish\"\n },\n flag: \"collection-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"channel\",\n location: \"body\",\n required: false,\n schema: {\n type: \"string\",\n minLength: 1,\n maxLength: 50,\n default: \"published\",\n description: \"Publishing channel, defaults to published\"\n },\n flag: \"channel\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"expectedSnapshotID\",\n location: \"body\",\n required: false,\n schema: {\n type: \"string\",\n pattern: \"^snp_[A-Za-z\\\\d]{1,22}$\",\n description:\n \"Reject the mutation if the channel no longer points to this reviewed snapshot\"\n },\n flag: \"expected-snapshot-id\",\n kind: \"string\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"json\"\n },\n {\n id: \"publishing.unpublishEntry\",\n group: \"publishing\",\n command: \"unpublish-entry\",\n method: \"delete\",\n path: \"/publishing/entries/{entryID}\",\n summary: \"Unpublish an entry\",\n description:\n \"Removes the entry publication from the channel. Supply versionID to require that version to be assigned; a changed assignment returns a conflict. The default channel is published. Supply expectedSnapshotID from a prior channel read to reject concurrent publication changes.\\n\\nRequired API key permissions: publishing. Write permissions also grant read access for the same resource.\",\n example: {\n entryID: \"ent_example\",\n channel: \"published\",\n versionID: \"ver_example\"\n },\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"entryID\",\n location: \"path\",\n required: true,\n schema: {\n type: \"string\",\n pattern: \"^(?:\\\\w+?_[A-Za-z\\\\d]{1,22})$\",\n description: \"Entry to unpublish\"\n },\n flag: \"entry-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"channel\",\n location: \"body\",\n required: false,\n schema: {\n type: \"string\",\n minLength: 1,\n maxLength: 50,\n default: \"published\",\n description: \"Publishing channel, defaults to published\"\n },\n flag: \"channel\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"expectedSnapshotID\",\n location: \"body\",\n required: false,\n schema: {\n type: \"string\",\n pattern: \"^snp_[A-Za-z\\\\d]{1,22}$\",\n description:\n \"Reject the mutation if the channel no longer points to this reviewed snapshot\"\n },\n flag: \"expected-snapshot-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"versionID\",\n location: \"body\",\n required: false,\n schema: {\n type: \"string\",\n pattern: \"^(?:\\\\w+?_[A-Za-z\\\\d]{1,22})$\",\n description: \"Version expected to be assigned\"\n },\n flag: \"version-id\",\n kind: \"string\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"empty\"\n },\n {\n id: \"roles.create\",\n group: \"roles\",\n command: \"create\",\n method: \"post\",\n path: \"/roles\",\n summary: \"Create a role\",\n description:\n \"Creates a workspace role. Names are unique without regard to case and must contain 1 to 50 characters after trimming. Requires the Pro plan and permission to delegate the selected permissions.\\n\\nRequired API key permissions: roles. Write permissions also grant read access for the same resource.\",\n example: {\n name: \"Editor\",\n permissions: [\"content\"]\n },\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"name\",\n location: \"body\",\n required: true,\n schema: {\n type: \"string\",\n minLength: 1,\n maxLength: 50,\n description: \"Name of the role\"\n },\n flag: \"name\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"permissions\",\n location: \"body\",\n required: true,\n schema: {\n type: \"array\",\n items: {\n $ref: \"#/components/schemas/Permission\"\n },\n description: \"Permissions to grant to the role\"\n },\n flag: \"permissions\",\n kind: \"json\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"json\"\n },\n {\n id: \"roles.delete\",\n group: \"roles\",\n command: \"delete\",\n method: \"delete\",\n path: \"/roles/{id}\",\n summary: \"Delete a role\",\n description:\n \"Deletes a custom role and updates its assignments. Built-in roles cannot be deleted. Requires the Pro plan.\\n\\nRequired API key permissions: roles. Write permissions also grant read access for the same resource.\",\n example: {\n id: \"rl_example\"\n },\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"id\",\n location: \"path\",\n required: true,\n schema: {\n type: \"string\",\n pattern: \"^(?:\\\\w+?_[A-Za-z\\\\d]{1,22})$\",\n description: \"ID of the role to delete\"\n },\n flag: \"id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"empty\"\n },\n {\n id: \"roles.list\",\n group: \"roles\",\n command: \"list\",\n method: \"get\",\n path: \"/roles\",\n summary: \"List roles\",\n description:\n \"Returns workspace roles and their permissions.\\n\\nRequired API key permissions: read:roles. Write permissions also grant read access for the same resource.\",\n example: {},\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"json\"\n },\n {\n id: \"roles.update\",\n group: \"roles\",\n command: \"update\",\n method: \"put\",\n path: \"/roles/{id}\",\n summary: \"Update a role\",\n description:\n \"Changes a role name or permissions. Names are unique without regard to case. Requires the Pro plan and permission to delegate the selected permissions. Built-in roles have additional restrictions.\\n\\nRequired API key permissions: roles. Write permissions also grant read access for the same resource.\",\n example: {\n id: \"rl_example\",\n name: \"Content editor\"\n },\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"id\",\n location: \"path\",\n required: true,\n schema: {\n type: \"string\",\n pattern: \"^(?:\\\\w+?_[A-Za-z\\\\d]{1,22})$\",\n description: \"ID of the role to update\"\n },\n flag: \"id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"name\",\n location: \"body\",\n required: false,\n schema: {\n type: \"string\",\n minLength: 1,\n maxLength: 50,\n description: \"New name for the role\"\n },\n flag: \"name\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"permissions\",\n location: \"body\",\n required: false,\n schema: {\n type: \"array\",\n items: {\n $ref: \"#/components/schemas/Permission\"\n },\n description: \"New permissions for the role\"\n },\n flag: \"permissions\",\n kind: \"json\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"empty\"\n },\n {\n id: \"schemaMigrations.get\",\n group: \"schema-migrations\",\n command: \"get\",\n method: \"get\",\n path: \"/schema-migrations/{id}\",\n summary: \"Get schema migration status\",\n description:\n \"Returns bounded migration progress and status. Use schemaMigrations.listContentLossEntries for per-entry content loss details. Check status before repeating an operation blocked by this migration.\\n\\nRequired API key permissions: read:collections. Write permissions also grant read access for the same resource.\",\n example: {\n id: \"smg_example\"\n },\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"id\",\n location: \"path\",\n required: true,\n schema: {\n type: \"string\",\n pattern: \"^(?:\\\\w+?_[A-Za-z\\\\d]{1,22})$\",\n description: \"ID of the schema migration\"\n },\n flag: \"id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"json\"\n },\n {\n id: \"schemaMigrations.getActive\",\n group: \"schema-migrations\",\n command: \"get-active\",\n method: \"get\",\n path: \"/collections/{collectionID}/schema-migration\",\n summary: \"Get the active schema migration\",\n description:\n \"Returns the active migration for a collection, or null when none is active.\\n\\nRequired API key permissions: read:collections. Write permissions also grant read access for the same resource.\",\n example: {\n collectionID: \"coll_example\"\n },\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"collectionID\",\n location: \"path\",\n required: true,\n schema: {\n type: \"string\",\n pattern: \"^(?:\\\\w+?_[A-Za-z\\\\d]{1,22})$\",\n description: \"ID of the affected collection\"\n },\n flag: \"collection-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"json\"\n },\n {\n id: \"schemaMigrations.listContentLossEntries\",\n group: \"schema-migrations\",\n command: \"list-content-loss-entries\",\n method: \"get\",\n path: \"/schema-migrations/{id}/content-loss-entries\",\n summary: \"List entries with migration content loss\",\n description:\n \"Lists accessible, non-deleted entries that lost content in a completed migration. Returns an empty page until completion. Use pagination.nextCursor to continue.\\n\\nRequired API key permissions: read:collections. Write permissions also grant read access for the same resource.\",\n example: {\n id: \"smg_example\",\n limit: 20\n },\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"id\",\n location: \"path\",\n required: true,\n schema: {\n type: \"string\",\n pattern: \"^(?:\\\\w+?_[A-Za-z\\\\d]{1,22})$\"\n },\n flag: \"id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"cursor\",\n location: \"query\",\n required: false,\n schema: {\n type: \"string\",\n pattern: \"^(?:\\\\w+?_[A-Za-z\\\\d]{1,22})$\",\n description: \"Cursor from the previous page; keep the same filters\"\n },\n flag: \"cursor\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"limit\",\n location: \"query\",\n required: false,\n schema: {\n type: \"integer\",\n minimum: 1,\n maximum: 100,\n default: 50\n },\n flag: \"limit\",\n kind: \"number\",\n nullable: false\n },\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"json\",\n pagination: \"cursor\"\n },\n {\n id: \"schemas.apply\",\n group: \"schemas\",\n command: \"apply\",\n method: \"post\",\n path: \"/schemas/{schemaID}/apply\",\n summary: \"Apply a schema draft\",\n description:\n \"Creates a schema version from the draft and starts any required migration of affected entry content. Review possible content removal before calling: confirmedDataLoss must be true. Use schemaMigrations.get to follow a returned migrationID.\\n\\nRequired API key permissions: collections. Write permissions also grant read access for the same resource.\",\n example: {\n schemaID: \"sch_example\",\n confirmedDataLoss: true,\n name: \"Reviewed schema\"\n },\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"schemaID\",\n location: \"path\",\n required: true,\n schema: {\n type: \"string\",\n pattern: \"^(?:\\\\w+?_[A-Za-z\\\\d]{1,22})$\",\n description: \"ID of the local collection schema\"\n },\n flag: \"schema-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"confirmedDataLoss\",\n location: \"body\",\n required: true,\n schema: {\n const: true,\n description: \"Confirmation that the migration can remove entry content\"\n },\n flag: \"confirmed-data-loss\",\n kind: \"boolean\",\n nullable: false\n },\n {\n name: \"name\",\n location: \"body\",\n required: false,\n schema: {\n type: \"string\",\n minLength: 1,\n maxLength: 100,\n description: \"Optional version name\"\n },\n flag: \"name\",\n kind: \"string\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"json\"\n },\n {\n id: \"schemas.create\",\n group: \"schemas\",\n command: \"create\",\n method: \"post\",\n path: \"/collections/{collectionID}/schema\",\n summary: \"Create a local collection schema\",\n description:\n \"Creates a local schema draft for the collection. Use schemas.get to inspect local and effective schemas.\\n\\nRequired API key permissions: collections. Write permissions also grant read access for the same resource.\",\n example: {\n collectionID: \"coll_example\"\n },\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"collectionID\",\n location: \"path\",\n required: true,\n schema: {\n type: \"string\",\n pattern: \"^(?:\\\\w+?_[A-Za-z\\\\d]{1,22})$\",\n description: \"ID of the collection\"\n },\n flag: \"collection-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"json\"\n },\n {\n id: \"schemas.delete\",\n group: \"schemas\",\n command: \"delete\",\n method: \"delete\",\n path: \"/schemas/{schemaID}\",\n summary: \"Delete a local schema\",\n description:\n \"Removes the local schema and recalculates inherited schemas. This can start a content migration. Review possible content removal before setting confirmedDataLoss. Use schemaMigrations.get with a returned migrationID.\\n\\nRequired API key permissions: collections. Write permissions also grant read access for the same resource.\",\n example: {\n schemaID: \"sch_example\",\n confirmedDataLoss: false\n },\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"schemaID\",\n location: \"path\",\n required: true,\n schema: {\n type: \"string\",\n pattern: \"^(?:\\\\w+?_[A-Za-z\\\\d]{1,22})$\",\n description: \"ID of the local collection schema\"\n },\n flag: \"schema-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"confirmedDataLoss\",\n location: \"body\",\n required: false,\n schema: {\n type: \"boolean\",\n default: false,\n description: \"Confirmation that an inherited-schema migration can remove entry content\"\n },\n flag: \"confirmed-data-loss\",\n kind: \"boolean\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"json\"\n },\n {\n id: \"schemas.get\",\n group: \"schemas\",\n command: \"get\",\n method: \"get\",\n path: \"/schemas/collection\",\n summary: \"Get collection schemas\",\n description:\n \"Returns local and effective schema details for the collection, including inheritance.\\n\\nRequired API key permissions: read:collections. Write permissions also grant read access for the same resource.\",\n example: {\n collectionID: \"coll_example\"\n },\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"collectionID\",\n location: \"query\",\n required: false,\n schema: {\n type: \"string\",\n pattern: \"^coll_[A-Za-z\\\\d]{1,22}$\"\n },\n flag: \"collection-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"collectionPath\",\n location: \"query\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Decoded content path, such as /Docs/Page or coll_ID/Page. Names are case-sensitive. Do not URL-encode names before passing them to the SDK.\"\n },\n flag: \"collection-path\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"collectionSlugPath\",\n location: \"query\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Decoded derived slug path, such as /docs/getting-started or coll_ID/getting-started. Use the returned slugPath without URL encoding.\"\n },\n flag: \"collection-slug-path\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"json\"\n },\n {\n id: \"schemas.getRevision\",\n group: \"schemas\",\n command: \"get-revision\",\n method: \"get\",\n path: \"/schema-revisions/{revisionID}\",\n summary: \"Get an exact schema revision\",\n description:\n \"Returns the recorded effective definition, including inherited fields. Requires read access to the revision's collection. The definition is independent of the currently active schema.\\n\\nRequired API key permissions: read:collections. Write permissions also grant read access for the same resource.\",\n example: {\n revisionID: \"schr_example\"\n },\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"revisionID\",\n location: \"path\",\n required: true,\n schema: {\n type: \"string\",\n pattern: \"^schr_[A-Za-z\\\\d]{1,22}$\"\n },\n flag: \"revision-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"json\"\n },\n {\n id: \"schemaVersions.get\",\n group: \"schema-versions\",\n command: \"get\",\n method: \"get\",\n path: \"/schema-versions/{id}\",\n summary: \"Get a schema version\",\n description:\n \"Returns a saved schema version and its definition.\\n\\nRequired API key permissions: read:collections. Write permissions also grant read access for the same resource.\",\n example: {\n id: \"schv_example\"\n },\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"id\",\n location: \"path\",\n required: true,\n schema: {\n type: \"string\",\n pattern: \"^(?:\\\\w+?_[A-Za-z\\\\d]{1,22})$\",\n description: \"ID of the schema version\"\n },\n flag: \"id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"json\"\n },\n {\n id: \"schemaVersions.list\",\n group: \"schema-versions\",\n command: \"list\",\n method: \"get\",\n path: \"/schemas/{schemaID}/versions\",\n summary: \"List schema versions\",\n description:\n \"Lists versions of a local collection schema. Pass pagination.nextCursor to the next request while pagination.hasMore is true. The limit is 1 to 100.\\n\\nRequired API key permissions: read:collections. Write permissions also grant read access for the same resource.\",\n example: {\n schemaID: \"sch_example\",\n limit: 20\n },\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"schemaID\",\n location: \"path\",\n required: true,\n schema: {\n type: \"string\",\n pattern: \"^(?:\\\\w+?_[A-Za-z\\\\d]{1,22})$\",\n description: \"ID of the local collection schema\"\n },\n flag: \"schema-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"cursor\",\n location: \"query\",\n required: false,\n schema: {\n type: \"string\",\n pattern: \"^(?:\\\\w+?_[A-Za-z\\\\d]{1,22})$\",\n description: \"Cursor from the previous page\"\n },\n flag: \"cursor\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"limit\",\n location: \"query\",\n required: false,\n schema: {\n type: \"integer\",\n minimum: 1,\n maximum: 100,\n description: \"Maximum versions to return\"\n },\n flag: \"limit\",\n kind: \"number\",\n nullable: false\n },\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"json\",\n pagination: \"cursor\"\n },\n {\n id: \"schemaVersions.revert\",\n group: \"schema-versions\",\n command: \"revert\",\n method: \"post\",\n path: \"/schema-versions/{id}/revert\",\n summary: \"Restore a schema version\",\n description:\n \"Restores the selected definition and starts any required content migration. Review possible content removal before calling: confirmedDataLoss must be true. Use schemaMigrations.get to follow a returned migrationID.\\n\\nRequired API key permissions: collections. Write permissions also grant read access for the same resource.\",\n example: {\n id: \"schv_example\",\n confirmedDataLoss: true\n },\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"id\",\n location: \"path\",\n required: true,\n schema: {\n type: \"string\",\n pattern: \"^(?:\\\\w+?_[A-Za-z\\\\d]{1,22})$\",\n description: \"ID of the schema version to restore\"\n },\n flag: \"id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"confirmedDataLoss\",\n location: \"body\",\n required: true,\n schema: {\n const: true,\n description: \"Confirmation that the migration can remove entry content\"\n },\n flag: \"confirmed-data-loss\",\n kind: \"boolean\",\n nullable: false\n },\n {\n name: \"name\",\n location: \"body\",\n required: false,\n schema: {\n type: \"string\",\n minLength: 1,\n maxLength: 100,\n description: \"Optional version name\"\n },\n flag: \"name\",\n kind: \"string\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"json\"\n },\n {\n id: \"schemaVersions.update\",\n group: \"schema-versions\",\n command: \"update\",\n method: \"patch\",\n path: \"/schema-versions/{id}\",\n summary: \"Rename a schema version\",\n description:\n \"Changes the saved version name. Set name to null to remove the name.\\n\\nRequired API key permissions: collections. Write permissions also grant read access for the same resource.\",\n example: {\n id: \"schv_example\",\n name: \"Reviewed schema\"\n },\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"id\",\n location: \"path\",\n required: true,\n schema: {\n type: \"string\",\n pattern: \"^(?:\\\\w+?_[A-Za-z\\\\d]{1,22})$\",\n description: \"ID of the schema version\"\n },\n flag: \"id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"name\",\n location: \"body\",\n required: true,\n schema: {\n anyOf: [\n {\n type: \"string\",\n minLength: 1,\n maxLength: 100\n },\n {\n type: \"null\"\n }\n ],\n description: \"New version name, or null to remove it\"\n },\n flag: \"name\",\n kind: \"string\",\n nullable: true\n }\n ],\n conditional: false,\n response: \"empty\"\n },\n {\n id: \"search.askCurrent\",\n group: \"search\",\n command: \"ask-current\",\n method: \"post\",\n path: \"/search/current/ask\",\n summary: \"Ask AI about current content\",\n description:\n \"Returns a complete answer with numbered sources. Requires explicit ai-answers permission in addition to content read permissions. Accepts up to 1,000 question characters, 10 history messages of up to 4,000 characters each, and 20 property filters. Uses 3 AI credits and the Ask AI rate limit. Use a secret key on your server, or a publishable key for published content.\\n\\nRequired API key permissions: ai-answers, read:entries, read:collections. Write permissions also grant read access for the same resource.\",\n example: {\n question: \"How do I install Andesine?\"\n },\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"question\",\n location: \"body\",\n required: true,\n schema: {\n type: \"string\",\n minLength: 1,\n maxLength: 1000\n },\n flag: \"question\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"collectionID\",\n location: \"body\",\n required: false,\n schema: {\n type: \"string\",\n pattern: \"^coll_[A-Za-z\\\\d]{1,22}$\"\n },\n flag: \"collection-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"collectionPath\",\n location: \"body\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Decoded content path, such as /Docs/Page or coll_ID/Page. Names are case-sensitive. Do not URL-encode names before passing them to the SDK.\"\n },\n flag: \"collection-path\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"collectionSlugPath\",\n location: \"body\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Decoded derived slug path, such as /docs/getting-started or coll_ID/getting-started. Use the returned slugPath without URL encoding.\"\n },\n flag: \"collection-slug-path\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"filters\",\n location: \"body\",\n required: false,\n schema: {\n type: \"array\",\n maxItems: 20,\n items: {\n $ref: \"#/components/schemas/PropertyFilter\"\n },\n default: []\n },\n flag: \"filters\",\n kind: \"json\",\n nullable: false\n },\n {\n name: \"history\",\n location: \"body\",\n required: false,\n schema: {\n type: \"array\",\n maxItems: 10,\n items: {\n $ref: \"#/components/schemas/AnswerHistoryMessage\"\n },\n default: []\n },\n flag: \"history\",\n kind: \"json\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"json\"\n },\n {\n id: \"search.askCurrentStream\",\n group: \"search\",\n command: \"ask-current-stream\",\n method: \"post\",\n path: \"/search/current/ask/stream\",\n summary: \"Stream an AI answer about current content\",\n description:\n \"Emits sources, textDelta, and completed events over SSE. Uses the same inputs, permissions, AI credits, and rate limit as complete answers. Stream errors use SSE error frames. Never reconnect automatically.\\n\\nRequired API key permissions: ai-answers, read:entries, read:collections. Write permissions also grant read access for the same resource.\",\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"question\",\n location: \"body\",\n required: true,\n schema: {\n type: \"string\",\n minLength: 1,\n maxLength: 1000\n },\n flag: \"question\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"collectionID\",\n location: \"body\",\n required: false,\n schema: {\n type: \"string\",\n pattern: \"^coll_[A-Za-z\\\\d]{1,22}$\"\n },\n flag: \"collection-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"collectionPath\",\n location: \"body\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Decoded content path, such as /Docs/Page or coll_ID/Page. Names are case-sensitive. Do not URL-encode names before passing them to the SDK.\"\n },\n flag: \"collection-path\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"collectionSlugPath\",\n location: \"body\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Decoded derived slug path, such as /docs/getting-started or coll_ID/getting-started. Use the returned slugPath without URL encoding.\"\n },\n flag: \"collection-slug-path\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"filters\",\n location: \"body\",\n required: false,\n schema: {\n type: \"array\",\n maxItems: 20,\n items: {\n $ref: \"#/components/schemas/PropertyFilter\"\n },\n default: []\n },\n flag: \"filters\",\n kind: \"json\",\n nullable: false\n },\n {\n name: \"history\",\n location: \"body\",\n required: false,\n schema: {\n type: \"array\",\n maxItems: 10,\n items: {\n $ref: \"#/components/schemas/AnswerHistoryMessage\"\n },\n default: []\n },\n flag: \"history\",\n kind: \"json\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"stream\"\n },\n {\n id: \"search.askPublished\",\n group: \"search\",\n command: \"ask-published\",\n method: \"post\",\n path: \"/search/published/ask\",\n summary: \"Ask AI about published content\",\n description:\n \"Returns a complete answer with numbered sources. Requires explicit ai-answers permission in addition to content read permissions. Accepts up to 1,000 question characters, 10 history messages of up to 4,000 characters each, and 20 property filters. Uses 3 AI credits and the Ask AI rate limit. Use a secret key on your server, or a publishable key for published content.\\n\\nRequired API key permissions: ai-answers, read:publishing. Write permissions also grant read access for the same resource.\",\n example: {\n question: \"How do I install Andesine?\",\n channel: \"published\"\n },\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"question\",\n location: \"body\",\n required: true,\n schema: {\n type: \"string\",\n minLength: 1,\n maxLength: 1000\n },\n flag: \"question\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"collectionID\",\n location: \"body\",\n required: false,\n schema: {\n type: \"string\",\n pattern: \"^coll_[A-Za-z\\\\d]{1,22}$\"\n },\n flag: \"collection-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"collectionPath\",\n location: \"body\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Decoded content path, such as /Docs/Page or coll_ID/Page. Names are case-sensitive. Do not URL-encode names before passing them to the SDK.\"\n },\n flag: \"collection-path\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"collectionSlugPath\",\n location: \"body\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Decoded derived slug path, such as /docs/getting-started or coll_ID/getting-started. Use the returned slugPath without URL encoding.\"\n },\n flag: \"collection-slug-path\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"filters\",\n location: \"body\",\n required: false,\n schema: {\n type: \"array\",\n maxItems: 20,\n items: {\n $ref: \"#/components/schemas/PropertyFilter\"\n },\n default: []\n },\n flag: \"filters\",\n kind: \"json\",\n nullable: false\n },\n {\n name: \"history\",\n location: \"body\",\n required: false,\n schema: {\n type: \"array\",\n maxItems: 10,\n items: {\n $ref: \"#/components/schemas/AnswerHistoryMessage\"\n },\n default: []\n },\n flag: \"history\",\n kind: \"json\",\n nullable: false\n },\n {\n name: \"channel\",\n location: \"body\",\n required: true,\n schema: {\n type: \"string\",\n minLength: 1,\n maxLength: 50,\n description: \"Publishing channel to search\"\n },\n flag: \"channel\",\n kind: \"string\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"json\"\n },\n {\n id: \"search.askPublishedStream\",\n group: \"search\",\n command: \"ask-published-stream\",\n method: \"post\",\n path: \"/search/published/ask/stream\",\n summary: \"Stream an AI answer about published content\",\n description:\n \"Emits sources, textDelta, and completed events over SSE. Uses the same inputs, permissions, AI credits, and rate limit as complete answers. Stream errors use SSE error frames. Never reconnect automatically.\\n\\nRequired API key permissions: ai-answers, read:publishing. Write permissions also grant read access for the same resource.\",\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"question\",\n location: \"body\",\n required: true,\n schema: {\n type: \"string\",\n minLength: 1,\n maxLength: 1000\n },\n flag: \"question\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"collectionID\",\n location: \"body\",\n required: false,\n schema: {\n type: \"string\",\n pattern: \"^coll_[A-Za-z\\\\d]{1,22}$\"\n },\n flag: \"collection-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"collectionPath\",\n location: \"body\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Decoded content path, such as /Docs/Page or coll_ID/Page. Names are case-sensitive. Do not URL-encode names before passing them to the SDK.\"\n },\n flag: \"collection-path\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"collectionSlugPath\",\n location: \"body\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Decoded derived slug path, such as /docs/getting-started or coll_ID/getting-started. Use the returned slugPath without URL encoding.\"\n },\n flag: \"collection-slug-path\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"filters\",\n location: \"body\",\n required: false,\n schema: {\n type: \"array\",\n maxItems: 20,\n items: {\n $ref: \"#/components/schemas/PropertyFilter\"\n },\n default: []\n },\n flag: \"filters\",\n kind: \"json\",\n nullable: false\n },\n {\n name: \"history\",\n location: \"body\",\n required: false,\n schema: {\n type: \"array\",\n maxItems: 10,\n items: {\n $ref: \"#/components/schemas/AnswerHistoryMessage\"\n },\n default: []\n },\n flag: \"history\",\n kind: \"json\",\n nullable: false\n },\n {\n name: \"channel\",\n location: \"body\",\n required: true,\n schema: {\n type: \"string\",\n minLength: 1,\n maxLength: 50,\n description: \"Publishing channel to search\"\n },\n flag: \"channel\",\n kind: \"string\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"stream\"\n },\n {\n id: \"search.current\",\n group: \"search\",\n command: \"current\",\n method: \"post\",\n path: \"/search/current\",\n summary: \"Search current content\",\n description:\n \"Searches current entry content by text and optional property filters. Up to 20 filters and 50 results are allowed. Semantic search is optional, uses 1 AI credit, and has a separate rate limit.\\n\\nRequired API key permissions: read:entries, read:collections. Write permissions also grant read access for the same resource.\",\n example: {\n query: \"installation\",\n limit: 10\n },\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"query\",\n location: \"body\",\n required: true,\n schema: {\n type: \"string\",\n maxLength: 500\n },\n flag: \"query\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"collectionID\",\n location: \"body\",\n required: false,\n schema: {\n type: \"string\",\n pattern: \"^coll_[A-Za-z\\\\d]{1,22}$\"\n },\n flag: \"collection-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"collectionPath\",\n location: \"body\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Decoded content path, such as /Docs/Page or coll_ID/Page. Names are case-sensitive. Do not URL-encode names before passing them to the SDK.\"\n },\n flag: \"collection-path\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"collectionSlugPath\",\n location: \"body\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Decoded derived slug path, such as /docs/getting-started or coll_ID/getting-started. Use the returned slugPath without URL encoding.\"\n },\n flag: \"collection-slug-path\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"filters\",\n location: \"body\",\n required: false,\n schema: {\n type: \"array\",\n maxItems: 20,\n items: {\n $ref: \"#/components/schemas/PropertyFilter\"\n },\n default: []\n },\n flag: \"filters\",\n kind: \"json\",\n nullable: false\n },\n {\n name: \"limit\",\n location: \"body\",\n required: false,\n schema: {\n type: \"integer\",\n minimum: 1,\n maximum: 50,\n default: 20\n },\n flag: \"limit\",\n kind: \"number\",\n nullable: false\n },\n {\n name: \"semantic\",\n location: \"body\",\n required: false,\n schema: {\n type: \"boolean\",\n default: false,\n description: \"Whether to combine keyword and vector search\"\n },\n flag: \"semantic\",\n kind: \"boolean\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"json\"\n },\n {\n id: \"search.published\",\n group: \"search\",\n command: \"published\",\n method: \"post\",\n path: \"/search/published\",\n summary: \"Search published content\",\n description:\n \"Searches content published to the required channel. Up to 20 filters and 50 results are allowed. Semantic search is optional, uses 1 AI credit, and has a separate rate limit.\\n\\nRequired API key permissions: read:publishing. Write permissions also grant read access for the same resource.\",\n example: {\n query: \"installation\",\n channel: \"published\",\n limit: 10\n },\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"query\",\n location: \"body\",\n required: true,\n schema: {\n type: \"string\",\n maxLength: 500\n },\n flag: \"query\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"collectionID\",\n location: \"body\",\n required: false,\n schema: {\n type: \"string\",\n pattern: \"^coll_[A-Za-z\\\\d]{1,22}$\"\n },\n flag: \"collection-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"collectionPath\",\n location: \"body\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Decoded content path, such as /Docs/Page or coll_ID/Page. Names are case-sensitive. Do not URL-encode names before passing them to the SDK.\"\n },\n flag: \"collection-path\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"collectionSlugPath\",\n location: \"body\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Decoded derived slug path, such as /docs/getting-started or coll_ID/getting-started. Use the returned slugPath without URL encoding.\"\n },\n flag: \"collection-slug-path\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"filters\",\n location: \"body\",\n required: false,\n schema: {\n type: \"array\",\n maxItems: 20,\n items: {\n $ref: \"#/components/schemas/PropertyFilter\"\n },\n default: []\n },\n flag: \"filters\",\n kind: \"json\",\n nullable: false\n },\n {\n name: \"limit\",\n location: \"body\",\n required: false,\n schema: {\n type: \"integer\",\n minimum: 1,\n maximum: 50,\n default: 20\n },\n flag: \"limit\",\n kind: \"number\",\n nullable: false\n },\n {\n name: \"semantic\",\n location: \"body\",\n required: false,\n schema: {\n type: \"boolean\",\n default: false,\n description: \"Whether to combine keyword and vector search\"\n },\n flag: \"semantic\",\n kind: \"boolean\",\n nullable: false\n },\n {\n name: \"channel\",\n location: \"body\",\n required: true,\n schema: {\n type: \"string\",\n minLength: 1,\n maxLength: 50,\n description: \"Publishing channel to search\"\n },\n flag: \"channel\",\n kind: \"string\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"json\"\n },\n {\n id: \"typeMetadata.getCurrent\",\n group: \"type-metadata\",\n command: \"get-current\",\n method: \"post\",\n path: \"/type-metadata/current\",\n summary: \"Get current content type metadata\",\n description:\n \"Read-only bulk metadata for type generation. Returns one consistent database snapshot of accessible collections and their active effective schemas, including inheritance. Optional entry/tree data requires read:entries in addition to read:collections. Explicit unavailable collection selectors fail. Active schema migrations in the selected collections return a conflict. No entry content is loaded. Schema-free collections use general types without warnings.\\n\\nRequired API key permissions: read:collections. Write permissions also grant read access for the same resource.\",\n example: {\n collections: [\"/Tutorials\"],\n includeEntries: false\n },\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"collections\",\n location: \"body\",\n required: false,\n schema: {\n type: \"array\",\n maxItems: 100,\n items: {\n anyOf: [\n {\n type: \"string\",\n pattern: \"^coll_[A-Za-z\\\\d]{1,22}$\"\n },\n {\n type: \"string\",\n description:\n \"Decoded content path, such as /Docs/Page or coll_ID/Page. Names are case-sensitive. Do not URL-encode names before passing them to the SDK.\"\n },\n {\n type: \"object\",\n properties: {\n collectionSlugPath: {\n type: \"string\",\n description:\n \"Decoded derived slug path, such as /docs/getting-started or coll_ID/getting-started. Use the returned slugPath without URL encoding.\"\n }\n },\n required: [\"collectionSlugPath\"]\n }\n ]\n },\n default: [],\n description:\n \"Collection IDs, name paths, or objects with collectionSlugPath. Includes selected subtrees; empty selects all accessible collections.\"\n },\n flag: \"collections\",\n kind: \"json\",\n nullable: false\n },\n {\n name: \"includeEntries\",\n location: \"body\",\n required: false,\n schema: {\n type: \"boolean\",\n default: false,\n description: \"Include entry IDs, names, paths, and schema associations.\"\n },\n flag: \"include-entries\",\n kind: \"boolean\",\n nullable: false\n },\n {\n name: \"includeTree\",\n location: \"body\",\n required: false,\n schema: {\n type: \"boolean\",\n default: false,\n description:\n \"Include ordered child IDs for each collection. Also includes entry metadata.\"\n },\n flag: \"include-tree\",\n kind: \"boolean\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"json\"\n },\n {\n id: \"typeMetadata.getPublished\",\n group: \"type-metadata\",\n command: \"get-published\",\n method: \"post\",\n path: \"/type-metadata/published\",\n summary: \"Get published content type metadata\",\n description:\n \"Read-only bulk metadata for type generation. Resolves a channel once (published by default), or reads a retained snapshot. Uses publication paths, names, and exact entry-version schema revisions; never substitutes current schemas. Supports mixed revisions and schema-free entries. Empty collections use general types without warnings. Includes selected subtrees; no selectors means all published collections and root entries. Publication-access rules match content.get. No entry content is loaded. Reuse source.snapshotID for related reads. The fingerprint changes only when returned type metadata changes, not when content-only publication creates a new snapshot.\\n\\nRequired API key permissions: read:publishing. Write permissions also grant read access for the same resource.\",\n example: {\n channel: \"published\",\n collections: [\"/Tutorials\"]\n },\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"collections\",\n location: \"body\",\n required: false,\n schema: {\n type: \"array\",\n maxItems: 100,\n items: {\n anyOf: [\n {\n type: \"string\",\n pattern: \"^coll_[A-Za-z\\\\d]{1,22}$\"\n },\n {\n type: \"string\",\n description:\n \"Decoded content path, such as /Docs/Page or coll_ID/Page. Names are case-sensitive. Do not URL-encode names before passing them to the SDK.\"\n },\n {\n type: \"object\",\n properties: {\n collectionSlugPath: {\n type: \"string\",\n description:\n \"Decoded derived slug path, such as /docs/getting-started or coll_ID/getting-started. Use the returned slugPath without URL encoding.\"\n }\n },\n required: [\"collectionSlugPath\"]\n }\n ]\n },\n default: [],\n description:\n \"Collection IDs, name paths, or objects with collectionSlugPath. Includes selected subtrees; empty selects all accessible collections.\"\n },\n flag: \"collections\",\n kind: \"json\",\n nullable: false\n },\n {\n name: \"includeEntries\",\n location: \"body\",\n required: false,\n schema: {\n type: \"boolean\",\n default: false,\n description: \"Include entry IDs, names, paths, and schema associations.\"\n },\n flag: \"include-entries\",\n kind: \"boolean\",\n nullable: false\n },\n {\n name: \"includeTree\",\n location: \"body\",\n required: false,\n schema: {\n type: \"boolean\",\n default: false,\n description:\n \"Include ordered child IDs for each collection. Also includes entry metadata.\"\n },\n flag: \"include-tree\",\n kind: \"boolean\",\n nullable: false\n },\n {\n name: \"channel\",\n location: \"body\",\n required: false,\n schema: {\n type: \"string\",\n minLength: 1,\n maxLength: 50\n },\n flag: \"channel\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"snapshotID\",\n location: \"body\",\n required: false,\n schema: {\n type: \"string\",\n pattern: \"^snp_[A-Za-z\\\\d]{1,22}$\"\n },\n flag: \"snapshot-id\",\n kind: \"string\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"json\"\n },\n {\n id: \"versions.create\",\n group: \"versions\",\n command: \"create\",\n method: \"post\",\n path: \"/entries/{entryID}/versions\",\n summary: \"Create an entry version\",\n description:\n \"Saves a version of the current entry content. Optionally assigns a name.\\n\\nRequired API key permissions: versions. Write permissions also grant read access for the same resource.\",\n example: {\n entryID: \"ent_example\",\n name: \"Before release\"\n },\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"entryID\",\n location: \"path\",\n required: true,\n schema: {\n type: \"string\",\n pattern: \"^(?:\\\\w+?_[A-Za-z\\\\d]{1,22})$\",\n description: \"ID of the entry to version\"\n },\n flag: \"entry-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"name\",\n location: \"body\",\n required: false,\n schema: {\n type: \"string\",\n minLength: 1,\n maxLength: 100,\n description: \"Optional version name\"\n },\n flag: \"name\",\n kind: \"string\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"json\"\n },\n {\n id: \"versions.get\",\n group: \"versions\",\n command: \"get\",\n method: \"get\",\n path: \"/versions/{id}\",\n summary: \"Get an entry version\",\n description:\n \"Returns the saved content and recorded schema metadata of an entry version. Validates against its recorded revision, including historical versions. expectedSchemaHash must match that revision; schema-less content cannot match it.\\n\\nRequired API key permissions: read:versions. Write permissions also grant read access for the same resource.\",\n example: {\n id: \"ver_example\"\n },\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"id\",\n location: \"path\",\n required: true,\n schema: {\n type: \"string\",\n pattern: \"^(?:\\\\w+?_[A-Za-z\\\\d]{1,22})$\",\n description: \"ID of the version to get\"\n },\n flag: \"id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"expectedSchemaHash\",\n location: \"query\",\n required: false,\n schema: {\n type: \"string\",\n pattern: \"^[a-f\\\\d]{64}$\",\n description: \"Hash of the effective schema definition\"\n },\n flag: \"expected-schema-hash\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"json\"\n },\n {\n id: \"versions.list\",\n group: \"versions\",\n command: \"list\",\n method: \"get\",\n path: \"/entries/{entryID}/versions\",\n summary: \"List entry versions\",\n description:\n \"Lists saved entry versions. Pass pagination.nextCursor to the next request while pagination.hasMore is true. The limit is 1 to 100.\\n\\nRequired API key permissions: read:versions. Write permissions also grant read access for the same resource.\",\n example: {\n entryID: \"ent_example\",\n limit: 20\n },\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"entryID\",\n location: \"path\",\n required: true,\n schema: {\n type: \"string\",\n pattern: \"^(?:\\\\w+?_[A-Za-z\\\\d]{1,22})$\",\n description: \"ID of the entry whose versions to list\"\n },\n flag: \"entry-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"cursor\",\n location: \"query\",\n required: false,\n schema: {\n type: \"string\",\n pattern: \"^(?:\\\\w+?_[A-Za-z\\\\d]{1,22})$\",\n description: \"Cursor from the previous page\"\n },\n flag: \"cursor\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"limit\",\n location: \"query\",\n required: false,\n schema: {\n type: \"integer\",\n minimum: 1,\n maximum: 100,\n description: \"Maximum versions to return\"\n },\n flag: \"limit\",\n kind: \"number\",\n nullable: false\n },\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"json\",\n pagination: \"cursor\"\n },\n {\n id: \"versions.revert\",\n group: \"versions\",\n command: \"revert\",\n method: \"post\",\n path: \"/versions/{id}/revert\",\n summary: \"Restore an entry version\",\n description:\n \"Restores saved content to the current entry and returns the resulting version. An active schema migration can block this action.\\n\\nRequired API key permissions: versions. Write permissions also grant read access for the same resource.\",\n example: {\n id: \"ver_example\"\n },\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"id\",\n location: \"path\",\n required: true,\n schema: {\n type: \"string\",\n pattern: \"^(?:\\\\w+?_[A-Za-z\\\\d]{1,22})$\",\n description: \"ID of the version to restore\"\n },\n flag: \"id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"json\"\n },\n {\n id: \"versions.update\",\n group: \"versions\",\n command: \"update\",\n method: \"patch\",\n path: \"/versions/{id}\",\n summary: \"Rename an entry version\",\n description:\n \"Changes the saved version name. Set name to null to remove the name.\\n\\nRequired API key permissions: versions. Write permissions also grant read access for the same resource.\",\n example: {\n id: \"ver_example\",\n name: \"Release candidate\"\n },\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"id\",\n location: \"path\",\n required: true,\n schema: {\n type: \"string\",\n pattern: \"^(?:\\\\w+?_[A-Za-z\\\\d]{1,22})$\",\n description: \"ID of the version to update\"\n },\n flag: \"id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"name\",\n location: \"body\",\n required: true,\n schema: {\n anyOf: [\n {\n type: \"string\",\n minLength: 1,\n maxLength: 100\n },\n {\n type: \"null\"\n }\n ],\n description: \"New version name, or null to remove it\"\n },\n flag: \"name\",\n kind: \"string\",\n nullable: true\n }\n ],\n conditional: false,\n response: \"empty\"\n },\n {\n id: \"webhooks.bulkDelete\",\n group: \"webhooks\",\n command: \"bulk-delete\",\n method: \"post\",\n path: \"/webhooks/bulk/delete\",\n summary: \"Delete webhooks\",\n description:\n \"Deletes every listed webhook in one transaction, checking each expectedRevision. Each deletion cancels pending deliveries and destroys signing keys; history stays until its original expiry.\\n\\nRequired API key permissions: webhooks. Write permissions also grant read access for the same resource.\",\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"webhooks\",\n location: \"body\",\n required: true,\n schema: {\n type: \"array\",\n minItems: 1,\n maxItems: 10,\n items: {\n type: \"object\",\n properties: {\n id: {\n type: \"string\",\n pattern: \"^wh_[A-Za-z\\\\d]{1,22}$\"\n },\n expectedRevision: {\n type: \"integer\",\n minimum: -9007199254740991,\n maximum: 9007199254740991,\n exclusiveMinimum: 0\n }\n },\n required: [\"id\", \"expectedRevision\"],\n additionalProperties: false\n }\n },\n flag: \"webhooks\",\n kind: \"json\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"empty\"\n },\n {\n id: \"webhooks.bulkRedeliver\",\n group: \"webhooks\",\n command: \"bulk-redeliver\",\n method: \"post\",\n path: \"/webhooks/{id}/deliveries/bulk/redeliver\",\n summary: \"Redeliver webhook events\",\n description:\n \"Replays every listed delivery in one transaction with the same checks as a single redelivery. Any ineligible delivery fails the whole request. Counts as one request for rate limiting.\\n\\nRequired API key permissions: webhooks. Write permissions also grant read access for the same resource.\",\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"id\",\n location: \"path\",\n required: true,\n schema: {\n type: \"string\",\n pattern: \"^wh_[A-Za-z\\\\d]{1,22}$\"\n },\n flag: \"id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"expectedDestinationRevision\",\n location: \"body\",\n required: true,\n schema: {\n type: \"integer\",\n minimum: -9007199254740991,\n maximum: 9007199254740991,\n exclusiveMinimum: 0\n },\n flag: \"expected-destination-revision\",\n kind: \"number\",\n nullable: false\n },\n {\n name: \"deliveryIDs\",\n location: \"body\",\n required: true,\n schema: {\n type: \"array\",\n minItems: 1,\n maxItems: 25,\n items: {\n type: \"string\",\n pattern: \"^whdel_[A-Za-z\\\\d]{1,22}$\"\n }\n },\n flag: \"delivery-ids\",\n kind: \"json\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"json\"\n },\n {\n id: \"webhooks.bulkSetEnabled\",\n group: \"webhooks\",\n command: \"bulk-set-enabled\",\n method: \"post\",\n path: \"/webhooks/bulk/set-enabled\",\n summary: \"Enable or disable webhooks\",\n description:\n \"Applies the state to every listed webhook in one transaction, checking each expectedRevision. Enabling checks the scope authority and destination of each webhook. Webhooks already in the state are unchanged.\\n\\nRequired API key permissions: webhooks. Write permissions also grant read access for the same resource.\",\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"webhooks\",\n location: \"body\",\n required: true,\n schema: {\n type: \"array\",\n minItems: 1,\n maxItems: 10,\n items: {\n type: \"object\",\n properties: {\n id: {\n type: \"string\",\n pattern: \"^wh_[A-Za-z\\\\d]{1,22}$\"\n },\n expectedRevision: {\n type: \"integer\",\n minimum: -9007199254740991,\n maximum: 9007199254740991,\n exclusiveMinimum: 0\n }\n },\n required: [\"id\", \"expectedRevision\"],\n additionalProperties: false\n }\n },\n flag: \"webhooks\",\n kind: \"json\",\n nullable: false\n },\n {\n name: \"enabled\",\n location: \"body\",\n required: true,\n schema: {\n type: \"boolean\"\n },\n flag: \"enabled\",\n kind: \"boolean\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"json\"\n },\n {\n id: \"webhooks.create\",\n group: \"webhooks\",\n command: \"create\",\n method: \"post\",\n path: \"/webhooks\",\n summary: \"Create a webhook\",\n description:\n \"Creates an enabled webhook unless `enabled` is false and returns the signing secret once. The caller must be able to read every resource type its events send, and restricted content when included.\\n\\nRequired API key permissions: webhooks. Write permissions also grant read access for the same resource.\",\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"name\",\n location: \"body\",\n required: true,\n schema: {\n type: \"string\",\n minLength: 1,\n maxLength: 100\n },\n flag: \"name\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"url\",\n location: \"body\",\n required: true,\n schema: {\n type: \"string\",\n maxLength: 2048,\n format: \"uri\"\n },\n flag: \"url\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"enabled\",\n location: \"body\",\n required: false,\n schema: {\n type: \"boolean\",\n default: true\n },\n flag: \"enabled\",\n kind: \"boolean\",\n nullable: false\n },\n {\n name: \"eventTypes\",\n location: \"body\",\n required: true,\n schema: {\n type: \"array\",\n minItems: 1,\n maxItems: 14,\n items: {\n $ref: \"#/components/schemas/WebhookEventName\"\n }\n },\n flag: \"event-types\",\n kind: \"json\",\n nullable: false\n },\n {\n name: \"schemaVersion\",\n location: \"body\",\n required: true,\n schema: {\n const: 1\n },\n flag: \"schema-version\",\n kind: \"number\",\n nullable: false\n },\n {\n name: \"collections\",\n location: \"body\",\n required: true,\n schema: {\n anyOf: [\n {\n type: \"object\",\n properties: {\n mode: {\n const: \"all\"\n }\n },\n required: [\"mode\"],\n additionalProperties: false\n },\n {\n type: \"object\",\n properties: {\n mode: {\n const: \"selected\"\n },\n roots: {\n type: \"array\",\n minItems: 1,\n maxItems: 100,\n items: {\n type: \"string\",\n pattern: \"^coll_[A-Za-z\\\\d]{1,22}$\"\n }\n }\n },\n required: [\"mode\", \"roots\"],\n additionalProperties: false\n }\n ]\n },\n flag: \"collections\",\n kind: \"json\",\n nullable: false\n },\n {\n name: \"channels\",\n location: \"body\",\n required: true,\n schema: {\n anyOf: [\n {\n type: \"object\",\n properties: {\n mode: {\n const: \"all\"\n }\n },\n required: [\"mode\"],\n additionalProperties: false\n },\n {\n type: \"object\",\n properties: {\n mode: {\n const: \"selected\"\n },\n codes: {\n type: \"array\",\n minItems: 1,\n maxItems: 100,\n items: {\n type: \"string\",\n minLength: 1,\n maxLength: 50\n }\n }\n },\n required: [\"mode\", \"codes\"],\n additionalProperties: false\n }\n ]\n },\n flag: \"channels\",\n kind: \"json\",\n nullable: false\n },\n {\n name: \"restrictedContent\",\n location: \"body\",\n required: true,\n schema: {\n type: \"boolean\",\n description: \"Include restricted collections, including ones restricted later\"\n },\n flag: \"restricted-content\",\n kind: \"boolean\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"json\"\n },\n {\n id: \"webhooks.delete\",\n group: \"webhooks\",\n command: \"delete\",\n method: \"delete\",\n path: \"/webhooks/{id}\",\n summary: \"Delete a webhook\",\n description:\n \"Cancels pending deliveries and destroys signing keys. Retains history until its original expiry; a deleted endpoint cannot be replayed.\\n\\nRequired API key permissions: webhooks. Write permissions also grant read access for the same resource.\",\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"id\",\n location: \"path\",\n required: true,\n schema: {\n type: \"string\",\n pattern: \"^wh_[A-Za-z\\\\d]{1,22}$\"\n },\n flag: \"id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"expectedRevision\",\n location: \"body\",\n required: true,\n schema: {\n type: \"integer\",\n minimum: -9007199254740991,\n maximum: 9007199254740991,\n exclusiveMinimum: 0\n },\n flag: \"expected-revision\",\n kind: \"number\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"empty\"\n },\n {\n id: \"webhooks.get\",\n group: \"webhooks\",\n command: \"get\",\n method: \"get\",\n path: \"/webhooks/{id}\",\n summary: \"Get a webhook\",\n description:\n \"Required API key permissions: read:webhooks. Write permissions also grant read access for the same resource.\",\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"id\",\n location: \"path\",\n required: true,\n schema: {\n type: \"string\",\n pattern: \"^wh_[A-Za-z\\\\d]{1,22}$\"\n },\n flag: \"id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"json\"\n },\n {\n id: \"webhooks.getDelivery\",\n group: \"webhooks\",\n command: \"get-delivery\",\n method: \"get\",\n path: \"/webhooks/{id}/deliveries/{deliveryID}\",\n summary: \"Get a webhook delivery\",\n description:\n \"Returns retained delivery metadata and, with content authority, the immutable event payload. Expired deliveries return not found even before physical cleanup.\\n\\nRequired API key permissions: read:webhooks. Write permissions also grant read access for the same resource.\",\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"id\",\n location: \"path\",\n required: true,\n schema: {\n type: \"string\",\n pattern: \"^wh_[A-Za-z\\\\d]{1,22}$\"\n },\n flag: \"id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"deliveryID\",\n location: \"path\",\n required: true,\n schema: {\n type: \"string\",\n pattern: \"^whdel_[A-Za-z\\\\d]{1,22}$\"\n },\n flag: \"delivery-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"json\"\n },\n {\n id: \"webhooks.list\",\n group: \"webhooks\",\n command: \"list\",\n method: \"get\",\n path: \"/webhooks\",\n summary: \"List webhooks\",\n description:\n \"Required API key permissions: read:webhooks. Write permissions also grant read access for the same resource.\",\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"cursor\",\n location: \"query\",\n required: false,\n schema: {\n type: \"string\",\n pattern: \"^(?:\\\\w+?_[A-Za-z\\\\d]{1,22})$\",\n description: \"Cursor from the previous page; keep the same filters\"\n },\n flag: \"cursor\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"limit\",\n location: \"query\",\n required: false,\n schema: {\n type: \"integer\",\n minimum: 1,\n maximum: 100,\n default: 50\n },\n flag: \"limit\",\n kind: \"number\",\n nullable: false\n },\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"json\",\n pagination: \"cursor\"\n },\n {\n id: \"webhooks.listAttempts\",\n group: \"webhooks\",\n command: \"list-attempts\",\n method: \"get\",\n path: \"/webhooks/{id}/deliveries/{deliveryID}/runs/{runID}/attempts\",\n summary: \"List delivery attempts\",\n description:\n \"Required API key permissions: read:webhooks. Write permissions also grant read access for the same resource.\",\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"id\",\n location: \"path\",\n required: true,\n schema: {\n type: \"string\",\n pattern: \"^wh_[A-Za-z\\\\d]{1,22}$\"\n },\n flag: \"id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"deliveryID\",\n location: \"path\",\n required: true,\n schema: {\n type: \"string\",\n pattern: \"^whdel_[A-Za-z\\\\d]{1,22}$\"\n },\n flag: \"delivery-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"runID\",\n location: \"path\",\n required: true,\n schema: {\n type: \"string\",\n pattern: \"^whrun_[A-Za-z\\\\d]{1,22}$\"\n },\n flag: \"run-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"cursor\",\n location: \"query\",\n required: false,\n schema: {\n type: \"string\",\n pattern: \"^whatt_[A-Za-z\\\\d]{1,22}$\"\n },\n flag: \"cursor\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"limit\",\n location: \"query\",\n required: false,\n schema: {\n type: \"integer\",\n minimum: 1,\n maximum: 100,\n default: 50\n },\n flag: \"limit\",\n kind: \"number\",\n nullable: false\n },\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"json\",\n pagination: \"cursor\"\n },\n {\n id: \"webhooks.listDeliveries\",\n group: \"webhooks\",\n command: \"list-deliveries\",\n method: \"get\",\n path: \"/webhooks/{id}/deliveries\",\n summary: \"List webhook deliveries\",\n description:\n \"Returns unexpired history, including for a deleted endpoint. Metadata does not include event payloads.\\n\\nRequired API key permissions: read:webhooks. Write permissions also grant read access for the same resource.\",\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"id\",\n location: \"path\",\n required: true,\n schema: {\n type: \"string\",\n pattern: \"^wh_[A-Za-z\\\\d]{1,22}$\"\n },\n flag: \"id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"cursor\",\n location: \"query\",\n required: false,\n schema: {\n type: \"string\",\n pattern: \"^whdel_[A-Za-z\\\\d]{1,22}$\"\n },\n flag: \"cursor\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"limit\",\n location: \"query\",\n required: false,\n schema: {\n type: \"integer\",\n minimum: 1,\n maximum: 100,\n default: 50\n },\n flag: \"limit\",\n kind: \"number\",\n nullable: false\n },\n {\n name: \"type\",\n location: \"query\",\n required: false,\n schema: {\n $ref: \"#/components/schemas/WebhookEventName\"\n },\n flag: \"type\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"state\",\n location: \"query\",\n required: false,\n schema: {\n enum: [\"pending\", \"in_flight\", \"succeeded\", \"failed\", \"cancelled\"],\n type: \"string\"\n },\n flag: \"state\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"createdAfter\",\n location: \"query\",\n required: false,\n schema: {\n type: \"string\",\n format: \"date-time\"\n },\n flag: \"created-after\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"createdBefore\",\n location: \"query\",\n required: false,\n schema: {\n type: \"string\",\n format: \"date-time\"\n },\n flag: \"created-before\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"json\",\n pagination: \"cursor\"\n },\n {\n id: \"webhooks.listRuns\",\n group: \"webhooks\",\n command: \"list-runs\",\n method: \"get\",\n path: \"/webhooks/{id}/deliveries/{deliveryID}/runs\",\n summary: \"List delivery runs\",\n description:\n \"Required API key permissions: read:webhooks. Write permissions also grant read access for the same resource.\",\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"id\",\n location: \"path\",\n required: true,\n schema: {\n type: \"string\",\n pattern: \"^wh_[A-Za-z\\\\d]{1,22}$\"\n },\n flag: \"id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"deliveryID\",\n location: \"path\",\n required: true,\n schema: {\n type: \"string\",\n pattern: \"^whdel_[A-Za-z\\\\d]{1,22}$\"\n },\n flag: \"delivery-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"cursor\",\n location: \"query\",\n required: false,\n schema: {\n type: \"string\",\n pattern: \"^whrun_[A-Za-z\\\\d]{1,22}$\"\n },\n flag: \"cursor\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"limit\",\n location: \"query\",\n required: false,\n schema: {\n type: \"integer\",\n minimum: 1,\n maximum: 100,\n default: 50\n },\n flag: \"limit\",\n kind: \"number\",\n nullable: false\n },\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"json\",\n pagination: \"cursor\"\n },\n {\n id: \"webhooks.redeliver\",\n group: \"webhooks\",\n command: \"redeliver\",\n method: \"post\",\n path: \"/webhooks/{id}/deliveries/{deliveryID}/redeliver\",\n summary: \"Redeliver a webhook event\",\n description:\n \"Checks the reviewed destination revision and current scope authority. Reuses the original event ID, payload, and expiry. Returns a conflict if a run is active, or the endpoint is disabled or deleted.\\n\\nRequired API key permissions: webhooks. Write permissions also grant read access for the same resource.\",\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"id\",\n location: \"path\",\n required: true,\n schema: {\n type: \"string\",\n pattern: \"^wh_[A-Za-z\\\\d]{1,22}$\"\n },\n flag: \"id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"deliveryID\",\n location: \"path\",\n required: true,\n schema: {\n type: \"string\",\n pattern: \"^whdel_[A-Za-z\\\\d]{1,22}$\"\n },\n flag: \"delivery-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"expectedDestinationRevision\",\n location: \"body\",\n required: true,\n schema: {\n type: \"integer\",\n minimum: -9007199254740991,\n maximum: 9007199254740991,\n exclusiveMinimum: 0\n },\n flag: \"expected-destination-revision\",\n kind: \"number\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"json\"\n },\n {\n id: \"webhooks.rotateSecret\",\n group: \"webhooks\",\n command: \"rotate-secret\",\n method: \"post\",\n path: \"/webhooks/{id}/rotate-secret\",\n summary: \"Rotate a webhook secret\",\n description:\n \"Returns a new secret once. Overlap keeps the old secret valid for 24 hours. Immediate rotation retires it at once. Normal rotation conflicts while a previous overlap remains active.\\n\\nRequired API key permissions: webhooks. Write permissions also grant read access for the same resource.\",\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"id\",\n location: \"path\",\n required: true,\n schema: {\n type: \"string\",\n pattern: \"^wh_[A-Za-z\\\\d]{1,22}$\"\n },\n flag: \"id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"expectedRevision\",\n location: \"body\",\n required: true,\n schema: {\n type: \"integer\",\n minimum: -9007199254740991,\n maximum: 9007199254740991,\n exclusiveMinimum: 0\n },\n flag: \"expected-revision\",\n kind: \"number\",\n nullable: false\n },\n {\n name: \"mode\",\n location: \"body\",\n required: true,\n schema: {\n enum: [\"overlap\", \"immediate\"],\n type: \"string\"\n },\n flag: \"mode\",\n kind: \"string\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"json\"\n },\n {\n id: \"webhooks.sendTest\",\n group: \"webhooks\",\n command: \"send-test\",\n method: \"post\",\n path: \"/webhooks/{id}/test\",\n summary: \"Send a webhook test\",\n description:\n \"Schedules one signed synthetic attempt for this endpoint, including when disabled. The event must be selected by the endpoint. It does not enable the endpoint or change content.\\n\\nRequired API key permissions: webhooks. Write permissions also grant read access for the same resource.\",\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"id\",\n location: \"path\",\n required: true,\n schema: {\n type: \"string\",\n pattern: \"^wh_[A-Za-z\\\\d]{1,22}$\"\n },\n flag: \"id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"expectedRevision\",\n location: \"body\",\n required: true,\n schema: {\n type: \"integer\",\n minimum: -9007199254740991,\n maximum: 9007199254740991,\n exclusiveMinimum: 0\n },\n flag: \"expected-revision\",\n kind: \"number\",\n nullable: false\n },\n {\n name: \"type\",\n location: \"body\",\n required: true,\n schema: {\n $ref: \"#/components/schemas/WebhookEventName\"\n },\n flag: \"type\",\n kind: \"string\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"json\"\n },\n {\n id: \"webhooks.update\",\n group: \"webhooks\",\n command: \"update\",\n method: \"put\",\n path: \"/webhooks/{id}\",\n summary: \"Update a webhook\",\n description:\n \"Checks expectedRevision and validates the merged configuration. A URL change cancels pending deliveries and returns a replacement secret once. Scope changes require authority over the previous and new scope.\\n\\nRequired API key permissions: webhooks. Write permissions also grant read access for the same resource.\",\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"id\",\n location: \"path\",\n required: true,\n schema: {\n type: \"string\",\n pattern: \"^wh_[A-Za-z\\\\d]{1,22}$\"\n },\n flag: \"id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"name\",\n location: \"body\",\n required: false,\n schema: {\n type: \"string\",\n minLength: 1,\n maxLength: 100\n },\n flag: \"name\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"url\",\n location: \"body\",\n required: false,\n schema: {\n type: \"string\",\n maxLength: 2048,\n format: \"uri\"\n },\n flag: \"url\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"enabled\",\n location: \"body\",\n required: false,\n schema: {\n type: \"boolean\"\n },\n flag: \"enabled\",\n kind: \"boolean\",\n nullable: false\n },\n {\n name: \"eventTypes\",\n location: \"body\",\n required: false,\n schema: {\n type: \"array\",\n minItems: 1,\n maxItems: 14,\n items: {\n $ref: \"#/components/schemas/WebhookEventName\"\n }\n },\n flag: \"event-types\",\n kind: \"json\",\n nullable: false\n },\n {\n name: \"schemaVersion\",\n location: \"body\",\n required: false,\n schema: {\n const: 1\n },\n flag: \"schema-version\",\n kind: \"number\",\n nullable: false\n },\n {\n name: \"collections\",\n location: \"body\",\n required: false,\n schema: {\n anyOf: [\n {\n type: \"object\",\n properties: {\n mode: {\n const: \"all\"\n }\n },\n required: [\"mode\"],\n additionalProperties: false\n },\n {\n type: \"object\",\n properties: {\n mode: {\n const: \"selected\"\n },\n roots: {\n type: \"array\",\n minItems: 1,\n maxItems: 100,\n items: {\n type: \"string\",\n pattern: \"^coll_[A-Za-z\\\\d]{1,22}$\"\n }\n }\n },\n required: [\"mode\", \"roots\"],\n additionalProperties: false\n }\n ]\n },\n flag: \"collections\",\n kind: \"json\",\n nullable: false\n },\n {\n name: \"channels\",\n location: \"body\",\n required: false,\n schema: {\n anyOf: [\n {\n type: \"object\",\n properties: {\n mode: {\n const: \"all\"\n }\n },\n required: [\"mode\"],\n additionalProperties: false\n },\n {\n type: \"object\",\n properties: {\n mode: {\n const: \"selected\"\n },\n codes: {\n type: \"array\",\n minItems: 1,\n maxItems: 100,\n items: {\n type: \"string\",\n minLength: 1,\n maxLength: 50\n }\n }\n },\n required: [\"mode\", \"codes\"],\n additionalProperties: false\n }\n ]\n },\n flag: \"channels\",\n kind: \"json\",\n nullable: false\n },\n {\n name: \"restrictedContent\",\n location: \"body\",\n required: false,\n schema: {\n type: \"boolean\",\n description: \"Include restricted collections, including ones restricted later\"\n },\n flag: \"restricted-content\",\n kind: \"boolean\",\n nullable: false\n },\n {\n name: \"expectedRevision\",\n location: \"body\",\n required: true,\n schema: {\n type: \"integer\",\n minimum: -9007199254740991,\n maximum: 9007199254740991,\n exclusiveMinimum: 0\n },\n flag: \"expected-revision\",\n kind: \"number\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"json\"\n },\n {\n id: \"workspaces.list\",\n group: \"workspaces\",\n command: \"list\",\n method: \"get\",\n path: \"/workspaces\",\n summary: \"List available workspaces\",\n description:\n \"Lists workspaces available to the OAuth user, with current role permissions and plan access. Browser sessions can list workspaces across signed-in accounts. Does not require workspace selection and does not count toward API usage.\",\n security: [\n {\n oauth: []\n }\n ],\n fields: [],\n conditional: false,\n response: \"json\"\n }\n];\nconst schemas: Record<string, JSONSchema> = {\n PropertyFilter: {\n anyOf: [\n {\n $ref: \"#/components/schemas/TextPropertyFilter\"\n },\n {\n $ref: \"#/components/schemas/NumberPropertyFilter\"\n },\n {\n $ref: \"#/components/schemas/BooleanPropertyFilter\"\n },\n {\n $ref: \"#/components/schemas/DatePropertyFilter\"\n }\n ]\n },\n TextPropertyFilter: {\n type: \"object\",\n properties: {\n kind: {\n const: \"text\"\n },\n key: {\n type: \"string\",\n minLength: 1,\n maxLength: 100,\n description: \"Property identifier\"\n },\n operator: {\n enum: [\"any\", \"all\", \"none\"],\n type: \"string\",\n default: \"any\"\n },\n values: {\n type: \"array\",\n minItems: 1,\n maxItems: 20,\n items: {\n type: \"string\",\n maxLength: 500\n }\n }\n },\n required: [\"kind\", \"key\", \"values\"]\n },\n NumberPropertyFilter: {\n type: \"object\",\n properties: {\n kind: {\n const: \"number\"\n },\n key: {\n type: \"string\",\n minLength: 1,\n maxLength: 100,\n description: \"Property identifier\"\n },\n operator: {\n $ref: \"#/components/schemas/ComparisonOperator\"\n },\n value: {\n type: \"number\"\n }\n },\n required: [\"kind\", \"key\", \"operator\", \"value\"]\n },\n ComparisonOperator: {\n enum: [\n \"equals\",\n \"notEquals\",\n \"greaterThan\",\n \"greaterThanOrEqual\",\n \"lessThan\",\n \"lessThanOrEqual\"\n ],\n type: \"string\"\n },\n BooleanPropertyFilter: {\n type: \"object\",\n properties: {\n kind: {\n const: \"boolean\"\n },\n key: {\n type: \"string\",\n minLength: 1,\n maxLength: 100,\n description: \"Property identifier\"\n },\n value: {\n type: \"boolean\"\n }\n },\n required: [\"kind\", \"key\", \"value\"]\n },\n DatePropertyFilter: {\n type: \"object\",\n properties: {\n kind: {\n const: \"date\"\n },\n key: {\n type: \"string\",\n minLength: 1,\n maxLength: 100,\n description: \"Property identifier\"\n },\n operator: {\n $ref: \"#/components/schemas/ComparisonOperator\"\n },\n value: {\n type: \"string\"\n }\n },\n required: [\"kind\", \"key\", \"operator\", \"value\"]\n },\n WebhookEventName: {\n enum: [\n \"entry.created\",\n \"entry.updated\",\n \"entry.content_saved\",\n \"entry.moved\",\n \"entry.deleted\",\n \"entry.restored\",\n \"collection.created\",\n \"collection.updated\",\n \"collection.moved\",\n \"collection.deleted\",\n \"collection.restored\",\n \"publishing.channel_advanced\",\n \"publishing.channel_created\",\n \"publishing.channel_deleted\"\n ],\n type: \"string\"\n },\n Permission: {\n enum: [\n \"content\",\n \"publishing\",\n \"api_keys\",\n \"read:api_keys\",\n \"billing\",\n \"read:billing\",\n \"restricted_collections\",\n \"read:restricted_collections\",\n \"memberships\",\n \"roles\",\n \"webhooks\",\n \"read:webhooks\",\n \"workspace\"\n ],\n type: \"string\"\n },\n AnswerHistoryMessage: {\n type: \"object\",\n properties: {\n role: {\n enum: [\"user\", \"assistant\"],\n type: \"string\"\n },\n content: {\n type: \"string\",\n minLength: 1,\n maxLength: 4000\n }\n },\n required: [\"role\", \"content\"]\n },\n PublishEntryTarget: {\n type: \"object\",\n properties: {\n entryID: {\n type: \"string\",\n pattern: \"^(?:\\\\w+?_[A-Za-z\\\\d]{1,22})$\",\n description: \"Entry to publish\"\n },\n versionID: {\n type: \"string\",\n pattern: \"^(?:\\\\w+?_[A-Za-z\\\\d]{1,22})$\",\n description: \"Existing version to publish\"\n }\n },\n required: [\"entryID\"]\n }\n};\nexport { commands, schemas };\n","import { readFile } from \"node:fs/promises\";\nimport path from \"node:path\";\nimport { CLIError, exitCodes } from \"../errors\";\nimport type { APICommand, APIField, APIOptions } from \"./types\";\n\nconst readStdin = async (signal: AbortSignal): Promise<Buffer> => {\n const chunks: Buffer[] = [];\n const abort = () =>\n process.stdin.destroy(signal.reason instanceof Error ? signal.reason : new Error(\"Cancelled.\"));\n\n signal.throwIfAborted();\n signal.addEventListener(\"abort\", abort, { once: true });\n\n try {\n for await (const chunk of process.stdin) chunks.push(Buffer.from(chunk));\n signal.throwIfAborted();\n return Buffer.concat(chunks);\n } finally {\n signal.removeEventListener(\"abort\", abort);\n }\n};\nconst optionKey = (flag: string): string =>\n flag.replace(/-([a-z])/g, (_match, letter: string) => letter.toUpperCase());\n\nconst parseFlag = (field: APIField, value: string): unknown => {\n if (field.nullable && value === \"null\") return null;\n if (field.kind === \"string\" || field.kind === \"file\") return value;\n if (field.kind === \"boolean\") {\n if (value === \"true\") return true;\n if (value === \"false\") return false;\n throw new CLIError(`--${field.flag} expects true or false.`, exitCodes.usage);\n }\n\n try {\n const parsed: unknown = JSON.parse(value);\n\n if (field.kind === \"number\" && (typeof parsed !== \"number\" || !Number.isFinite(parsed))) {\n throw new Error();\n }\n\n return parsed;\n } catch {\n throw new CLIError(\n `--${field.flag} expects ${field.kind === \"number\" ? \"a number\" : \"valid JSON\"}.`,\n exitCodes.usage\n );\n }\n};\n\n/** Flat flags replace matching JSON fields; omitted flags never introduce defaults. */\nconst readInput = async (\n command: APICommand,\n options: APIOptions,\n signal: AbortSignal\n): Promise<Record<string, unknown>> => {\n let input: Record<string, unknown> = {};\n let stdinUsed = options.input === \"-\";\n\n if (options.input !== undefined) {\n if (options.input !== \"-\" && !options.input.startsWith(\"@\")) {\n throw new CLIError(\n \"Use --input @file.json or --input - for JSON from stdin.\",\n exitCodes.usage\n );\n }\n\n const source =\n options.input === \"-\"\n ? await readStdin(signal)\n : await readFile(options.input.slice(1), { signal });\n let parsed: unknown;\n\n try {\n parsed = JSON.parse(source.toString(\"utf8\"));\n } catch {\n throw new CLIError(\"Input is not valid JSON.\", exitCodes.usage);\n }\n\n if (!parsed || typeof parsed !== \"object\" || Array.isArray(parsed)) {\n throw new CLIError(\"Input must be a JSON object.\", exitCodes.usage);\n }\n\n input = { ...parsed };\n }\n\n const fields = new Set(command.fields.map((field) => field.name));\n\n for (const name of Object.keys(input)) {\n if (!fields.has(name)) {\n throw new CLIError(`Unknown input field: ${name}. See --help or --schema.`, exitCodes.usage);\n }\n }\n\n for (const field of command.fields) {\n const value = options[optionKey(field.flag)];\n\n if (typeof value === \"string\") input[field.name] = parseFlag(field, value);\n\n const supplied = Object.hasOwn(input, field.name);\n\n if (field.required && !supplied) {\n throw new CLIError(`Missing ${field.name}. Use --${field.flag} or --input.`, exitCodes.usage);\n }\n\n if (!supplied) continue;\n\n const current = input[field.name];\n\n if (current === null && field.nullable) continue;\n if (typeof current === \"number\" && !Number.isFinite(current)) {\n throw new CLIError(`Invalid number for ${field.name}.`, exitCodes.usage);\n }\n\n if (\n field.kind !== \"json\" &&\n typeof current !== (field.kind === \"file\" ? \"string\" : field.kind)\n ) {\n throw new CLIError(\n `Invalid type for ${field.name}; expected ${field.kind}.`,\n exitCodes.usage\n );\n }\n\n if (field.kind === \"file\") {\n const file = current as string;\n\n if (file === \"-\" && stdinUsed) {\n throw new CLIError(\n \"Stdin can supply either JSON or one upload file, not both.\",\n exitCodes.usage\n );\n }\n\n const bytes = file === \"-\" ? await readStdin(signal) : await readFile(file, { signal });\n\n stdinUsed ||= file === \"-\";\n input[field.name] = new File(\n [new Uint8Array(bytes)],\n file === \"-\" ? \"stdin\" : path.basename(file),\n { type: \"application/octet-stream\" }\n );\n }\n }\n\n return input;\n};\n\nexport { readInput, optionKey };\n","// Generated from SDK openapi.json. Do not edit.\nimport type { operations, OperationInput } from \"@andesine/sdk\";\nimport type { SDKOperation } from \"./types\";\n\nconst bindings: Record<keyof operations, SDKOperation> = {\n \"assets.attach\": (client, input, options) =>\n client.assets.attach(input as OperationInput<\"assets.attach\">, options),\n \"assets.get\": (client, input, options) =>\n client.assets.get(input as OperationInput<\"assets.get\">, options),\n \"assets.importURL\": (client, input, options) =>\n client.assets.importURL(input as OperationInput<\"assets.importURL\">, options),\n \"assets.register\": (client, input, options) =>\n client.assets.register(input as OperationInput<\"assets.register\">, options),\n \"assets.search\": (client, input, options) =>\n client.assets.search(input as OperationInput<\"assets.search\">, options),\n \"assets.upload\": (client, input, options) =>\n client.assets.upload(input as OperationInput<\"assets.upload\">, options),\n \"auth.getIdentity\": (client, input, options) =>\n client.auth.getIdentity(input as OperationInput<\"auth.getIdentity\">, options),\n \"collections.bulkDelete\": (client, input, options) =>\n client.collections.bulkDelete(input as OperationInput<\"collections.bulkDelete\">, options),\n \"collections.create\": (client, input, options) =>\n client.collections.create(input as OperationInput<\"collections.create\">, options),\n \"collections.delete\": (client, input, options) =>\n client.collections.delete(input as OperationInput<\"collections.delete\">, options),\n \"collections.list\": (client, input, options) =>\n client.collections.list(input as OperationInput<\"collections.list\">, options),\n \"collections.update\": (client, input, options) =>\n client.collections.update(input as OperationInput<\"collections.update\">, options),\n \"content.get\": (client, input, options) =>\n client.content.get(input as OperationInput<\"content.get\">, options),\n \"content.getAsset\": (client, input, options) =>\n client.content.getAsset(input as OperationInput<\"content.getAsset\">, options),\n \"content.getSchema\": (client, input, options) =>\n client.content.getSchema(input as OperationInput<\"content.getSchema\">, options),\n \"content.getTree\": (client, input, options) =>\n client.content.getTree(input as OperationInput<\"content.getTree\">, options),\n \"content.listCollections\": (client, input, options) =>\n client.content.listCollections(input as OperationInput<\"content.listCollections\">, options),\n \"content.listEntries\": (client, input, options) =>\n client.content.listEntries(input as OperationInput<\"content.listEntries\">, options),\n \"entries.bulkDelete\": (client, input, options) =>\n client.entries.bulkDelete(input as OperationInput<\"entries.bulkDelete\">, options),\n \"entries.create\": (client, input, options) =>\n client.entries.create(input as OperationInput<\"entries.create\">, options),\n \"entries.delete\": (client, input, options) =>\n client.entries.delete(input as OperationInput<\"entries.delete\">, options),\n \"entries.get\": (client, input, options) =>\n client.entries.get(input as OperationInput<\"entries.get\">, options),\n \"entries.list\": (client, input, options) =>\n client.entries.list(input as OperationInput<\"entries.list\">, options),\n \"entries.update\": (client, input, options) =>\n client.entries.update(input as OperationInput<\"entries.update\">, options),\n \"instance.get\": (client, input, options) =>\n client.instance.get(input as OperationInput<\"instance.get\">, options),\n \"memberships.invite\": (client, input, options) =>\n client.memberships.invite(input as OperationInput<\"memberships.invite\">, options),\n \"memberships.list\": (client, input, options) =>\n client.memberships.list(input as OperationInput<\"memberships.list\">, options),\n \"memberships.listInvites\": (client, input, options) =>\n client.memberships.listInvites(input as OperationInput<\"memberships.listInvites\">, options),\n \"memberships.remove\": (client, input, options) =>\n client.memberships.remove(input as OperationInput<\"memberships.remove\">, options),\n \"memberships.resendInvite\": (client, input, options) =>\n client.memberships.resendInvite(input as OperationInput<\"memberships.resendInvite\">, options),\n \"memberships.revokeInvite\": (client, input, options) =>\n client.memberships.revokeInvite(input as OperationInput<\"memberships.revokeInvite\">, options),\n \"memberships.update\": (client, input, options) =>\n client.memberships.update(input as OperationInput<\"memberships.update\">, options),\n \"publishing.bulkPublishCollections\": (client, input, options) =>\n client.publishing.bulkPublishCollections(\n input as OperationInput<\"publishing.bulkPublishCollections\">,\n options\n ),\n \"publishing.bulkPublishEntries\": (client, input, options) =>\n client.publishing.bulkPublishEntries(\n input as OperationInput<\"publishing.bulkPublishEntries\">,\n options\n ),\n \"publishing.bulkSetCollections\": (client, input, options) =>\n client.publishing.bulkSetCollections(\n input as OperationInput<\"publishing.bulkSetCollections\">,\n options\n ),\n \"publishing.bulkUnpublishCollections\": (client, input, options) =>\n client.publishing.bulkUnpublishCollections(\n input as OperationInput<\"publishing.bulkUnpublishCollections\">,\n options\n ),\n \"publishing.bulkUnpublishEntries\": (client, input, options) =>\n client.publishing.bulkUnpublishEntries(\n input as OperationInput<\"publishing.bulkUnpublishEntries\">,\n options\n ),\n \"publishing.createChannel\": (client, input, options) =>\n client.publishing.createChannel(input as OperationInput<\"publishing.createChannel\">, options),\n \"publishing.deleteChannel\": (client, input, options) =>\n client.publishing.deleteChannel(input as OperationInput<\"publishing.deleteChannel\">, options),\n \"publishing.getChannelContent\": (client, input, options) =>\n client.publishing.getChannelContent(\n input as OperationInput<\"publishing.getChannelContent\">,\n options\n ),\n \"publishing.getEntryVersion\": (client, input, options) =>\n client.publishing.getEntryVersion(\n input as OperationInput<\"publishing.getEntryVersion\">,\n options\n ),\n \"publishing.listChannels\": (client, input, options) =>\n client.publishing.listChannels(input as OperationInput<\"publishing.listChannels\">, options),\n \"publishing.listEntryPublications\": (client, input, options) =>\n client.publishing.listEntryPublications(\n input as OperationInput<\"publishing.listEntryPublications\">,\n options\n ),\n \"publishing.publishCollection\": (client, input, options) =>\n client.publishing.publishCollection(\n input as OperationInput<\"publishing.publishCollection\">,\n options\n ),\n \"publishing.publishEntry\": (client, input, options) =>\n client.publishing.publishEntry(input as OperationInput<\"publishing.publishEntry\">, options),\n \"publishing.revertChanges\": (client, input, options) =>\n client.publishing.revertChanges(input as OperationInput<\"publishing.revertChanges\">, options),\n \"publishing.setCollection\": (client, input, options) =>\n client.publishing.setCollection(input as OperationInput<\"publishing.setCollection\">, options),\n \"publishing.unpublishCollection\": (client, input, options) =>\n client.publishing.unpublishCollection(\n input as OperationInput<\"publishing.unpublishCollection\">,\n options\n ),\n \"publishing.unpublishEntry\": (client, input, options) =>\n client.publishing.unpublishEntry(input as OperationInput<\"publishing.unpublishEntry\">, options),\n \"roles.create\": (client, input, options) =>\n client.roles.create(input as OperationInput<\"roles.create\">, options),\n \"roles.delete\": (client, input, options) =>\n client.roles.delete(input as OperationInput<\"roles.delete\">, options),\n \"roles.list\": (client, input, options) =>\n client.roles.list(input as OperationInput<\"roles.list\">, options),\n \"roles.update\": (client, input, options) =>\n client.roles.update(input as OperationInput<\"roles.update\">, options),\n \"schemaMigrations.get\": (client, input, options) =>\n client.schemaMigrations.get(input as OperationInput<\"schemaMigrations.get\">, options),\n \"schemaMigrations.getActive\": (client, input, options) =>\n client.schemaMigrations.getActive(\n input as OperationInput<\"schemaMigrations.getActive\">,\n options\n ),\n \"schemaMigrations.listContentLossEntries\": (client, input, options) =>\n client.schemaMigrations.listContentLossEntries(\n input as OperationInput<\"schemaMigrations.listContentLossEntries\">,\n options\n ),\n \"schemas.apply\": (client, input, options) =>\n client.schemas.apply(input as OperationInput<\"schemas.apply\">, options),\n \"schemas.create\": (client, input, options) =>\n client.schemas.create(input as OperationInput<\"schemas.create\">, options),\n \"schemas.delete\": (client, input, options) =>\n client.schemas.delete(input as OperationInput<\"schemas.delete\">, options),\n \"schemas.get\": (client, input, options) =>\n client.schemas.get(input as OperationInput<\"schemas.get\">, options),\n \"schemas.getRevision\": (client, input, options) =>\n client.schemas.getRevision(input as OperationInput<\"schemas.getRevision\">, options),\n \"schemaVersions.get\": (client, input, options) =>\n client.schemaVersions.get(input as OperationInput<\"schemaVersions.get\">, options),\n \"schemaVersions.list\": (client, input, options) =>\n client.schemaVersions.list(input as OperationInput<\"schemaVersions.list\">, options),\n \"schemaVersions.revert\": (client, input, options) =>\n client.schemaVersions.revert(input as OperationInput<\"schemaVersions.revert\">, options),\n \"schemaVersions.update\": (client, input, options) =>\n client.schemaVersions.update(input as OperationInput<\"schemaVersions.update\">, options),\n \"search.askCurrent\": (client, input, options) =>\n client.search.askCurrent(input as OperationInput<\"search.askCurrent\">, options),\n \"search.askCurrentStream\": (client, input, options) =>\n client.search.askCurrentStream(input as OperationInput<\"search.askCurrentStream\">, options),\n \"search.askPublished\": (client, input, options) =>\n client.search.askPublished(input as OperationInput<\"search.askPublished\">, options),\n \"search.askPublishedStream\": (client, input, options) =>\n client.search.askPublishedStream(input as OperationInput<\"search.askPublishedStream\">, options),\n \"search.current\": (client, input, options) =>\n client.search.current(input as OperationInput<\"search.current\">, options),\n \"search.published\": (client, input, options) =>\n client.search.published(input as OperationInput<\"search.published\">, options),\n \"typeMetadata.getCurrent\": (client, input, options) =>\n client.typeMetadata.getCurrent(input as OperationInput<\"typeMetadata.getCurrent\">, options),\n \"typeMetadata.getPublished\": (client, input, options) =>\n client.typeMetadata.getPublished(input as OperationInput<\"typeMetadata.getPublished\">, options),\n \"versions.create\": (client, input, options) =>\n client.versions.create(input as OperationInput<\"versions.create\">, options),\n \"versions.get\": (client, input, options) =>\n client.versions.get(input as OperationInput<\"versions.get\">, options),\n \"versions.list\": (client, input, options) =>\n client.versions.list(input as OperationInput<\"versions.list\">, options),\n \"versions.revert\": (client, input, options) =>\n client.versions.revert(input as OperationInput<\"versions.revert\">, options),\n \"versions.update\": (client, input, options) =>\n client.versions.update(input as OperationInput<\"versions.update\">, options),\n \"webhooks.bulkDelete\": (client, input, options) =>\n client.webhooks.bulkDelete(input as OperationInput<\"webhooks.bulkDelete\">, options),\n \"webhooks.bulkRedeliver\": (client, input, options) =>\n client.webhooks.bulkRedeliver(input as OperationInput<\"webhooks.bulkRedeliver\">, options),\n \"webhooks.bulkSetEnabled\": (client, input, options) =>\n client.webhooks.bulkSetEnabled(input as OperationInput<\"webhooks.bulkSetEnabled\">, options),\n \"webhooks.create\": (client, input, options) =>\n client.webhooks.create(input as OperationInput<\"webhooks.create\">, options),\n \"webhooks.delete\": (client, input, options) =>\n client.webhooks.delete(input as OperationInput<\"webhooks.delete\">, options),\n \"webhooks.get\": (client, input, options) =>\n client.webhooks.get(input as OperationInput<\"webhooks.get\">, options),\n \"webhooks.getDelivery\": (client, input, options) =>\n client.webhooks.getDelivery(input as OperationInput<\"webhooks.getDelivery\">, options),\n \"webhooks.list\": (client, input, options) =>\n client.webhooks.list(input as OperationInput<\"webhooks.list\">, options),\n \"webhooks.listAttempts\": (client, input, options) =>\n client.webhooks.listAttempts(input as OperationInput<\"webhooks.listAttempts\">, options),\n \"webhooks.listDeliveries\": (client, input, options) =>\n client.webhooks.listDeliveries(input as OperationInput<\"webhooks.listDeliveries\">, options),\n \"webhooks.listRuns\": (client, input, options) =>\n client.webhooks.listRuns(input as OperationInput<\"webhooks.listRuns\">, options),\n \"webhooks.redeliver\": (client, input, options) =>\n client.webhooks.redeliver(input as OperationInput<\"webhooks.redeliver\">, options),\n \"webhooks.rotateSecret\": (client, input, options) =>\n client.webhooks.rotateSecret(input as OperationInput<\"webhooks.rotateSecret\">, options),\n \"webhooks.sendTest\": (client, input, options) =>\n client.webhooks.sendTest(input as OperationInput<\"webhooks.sendTest\">, options),\n \"webhooks.update\": (client, input, options) =>\n client.webhooks.update(input as OperationInput<\"webhooks.update\">, options),\n \"workspaces.list\": (client, input, options) =>\n client.workspaces.list(input as OperationInput<\"workspaces.list\">, options)\n};\nexport { bindings };\n","import { open, unlink } from \"node:fs/promises\";\nimport { Readable } from \"node:stream\";\nimport { pipeline } from \"node:stream/promises\";\nimport { CLIError } from \"../errors\";\nimport { writeOutput } from \"../output\";\n\n/** Write bytes only to an explicit destination; never overwrite an existing file. */\nconst writeBinary = async (\n value: unknown,\n destination: string,\n signal: AbortSignal\n): Promise<void> => {\n if (!(value instanceof Blob)) throw new CLIError(\"Expected binary data from this API operation.\");\n\n if (destination === \"-\") {\n for await (const chunk of value.stream()) {\n signal.throwIfAborted();\n await writeOutput(process.stdout, Buffer.from(chunk));\n }\n return;\n }\n\n const file = await open(destination, \"wx\");\n let completed = false;\n\n try {\n await pipeline(Readable.fromWeb(value.stream()), file.createWriteStream(), { signal });\n completed = true;\n } finally {\n await file.close();\n if (!completed) await unlink(destination);\n }\n};\n\nexport { writeBinary };\n","import {\n createClient,\n paginatePages,\n type AndesineClient,\n type OperationInput,\n type RequestOptions,\n type AnswerEvent\n} from \"@andesine/sdk\";\nimport { authenticatedClient } from \"../auth/client\";\nimport type { CommandContext } from \"../context\";\nimport { CLIError, exitCodes } from \"../errors\";\nimport { workspaceIDSchema } from \"../config/schema\";\nimport { readInput } from \"./input\";\nimport { bindings } from \"./bindings\";\nimport { reportAPIError } from \"./errors\";\nimport { writeBinary } from \"./binary\";\nimport type { APICommand, APIOptions } from \"./types\";\n\ninterface CursorPage {\n data: unknown[];\n pagination: { hasMore: boolean; nextCursor: string | null };\n}\n\nconst isPage = (value: unknown): value is CursorPage => {\n if (\n !value ||\n typeof value !== \"object\" ||\n !(\"data\" in value) ||\n !Array.isArray(value.data) ||\n !(\"pagination\" in value)\n ) {\n return false;\n }\n\n const pagination = value.pagination;\n\n return Boolean(\n pagination &&\n typeof pagination === \"object\" &&\n \"hasMore\" in pagination &&\n typeof pagination.hasMore === \"boolean\" &&\n \"nextCursor\" in pagination &&\n (pagination.nextCursor === null || typeof pagination.nextCursor === \"string\")\n );\n};\n\nconst pages = async function* (\n command: APICommand,\n client: AndesineClient,\n input: Record<string, unknown>,\n options: RequestOptions\n): AsyncGenerator<unknown> {\n if (command.id === \"content.listCollections\") {\n yield* client.content.paginateCollectionPages(\n input as OperationInput<\"content.listCollections\">,\n { ...options, response: \"data\" }\n );\n return;\n }\n\n if (command.id === \"content.listEntries\") {\n yield* client.content.paginateEntryPages(input as OperationInput<\"content.listEntries\">, {\n ...options,\n response: \"data\"\n });\n return;\n }\n\n const invoke = bindings[command.id as keyof typeof bindings];\n\n yield* paginatePages(\n async (cursor) => {\n const result = await invoke(client, { ...input, cursor }, { ...options, response: \"full\" });\n\n if (!isPage(result.data)) {\n throw new CLIError(\"The server returned an invalid paginated response.\");\n }\n\n return result.data;\n },\n { cursor: typeof input.cursor === \"string\" ? input.cursor : undefined }\n );\n};\n\n/** Use the SDK for all transport; command metadata and execution bindings are bundled locally. */\nconst executeAPI = async (\n command: APICommand,\n options: APIOptions,\n context: CommandContext\n): Promise<void> => {\n const { output, signal } = context;\n const timeout = options.timeout === undefined ? 30_000 : Number(options.timeout);\n\n if (!Number.isFinite(timeout) || timeout < 0 || options.timeout?.trim() === \"\") {\n throw new CLIError(\n \"--timeout must be a nonnegative number of milliseconds; 0 disables it.\",\n exitCodes.usage\n );\n }\n\n if (options.paginate && !command.pagination) {\n throw new CLIError(\"This operation does not support cursor pagination.\", exitCodes.usage);\n }\n\n if (options.paginate && options.ifNoneMatch !== undefined) {\n throw new CLIError(\"Conditional headers cannot be combined with --paginate.\", exitCodes.usage);\n }\n\n if (options.paginate && options.full) {\n throw new CLIError(\n \"--full cannot be combined with --paginate; pages already retain pagination and snapshot metadata.\",\n exitCodes.usage\n );\n }\n\n if (command.response === \"binary\" && !options.output) {\n throw new CLIError(\"Specify --output <file> or --output - for binary data.\", exitCodes.usage);\n }\n\n if (options.output && command.response !== \"binary\") {\n throw new CLIError(\"Use shell redirection for JSON and text output.\", exitCodes.usage);\n }\n\n if (options.format === \"text\" && command.response !== \"stream\") {\n throw new CLIError(\"--format text is only available for AI answer streams.\", exitCodes.usage);\n }\n\n const input = await readInput(command, options, signal);\n const headers = new Headers();\n\n for (const field of command.fields) {\n if (field.location !== \"header\" || !Object.hasOwn(input, field.name)) continue;\n\n headers.set(field.name, String(input[field.name]));\n delete input[field.name];\n }\n\n if (options.ifNoneMatch !== undefined) headers.set(\"If-None-Match\", options.ifNoneMatch);\n\n const request: RequestOptions = { signal, timeout, retries: 0, headers };\n\n await output.heading(`Andesine · ${command.summary}`);\n\n try {\n const anonymous =\n command.security.length === 0 ||\n command.security.some((requirement) => !Object.keys(requirement).length);\n const auth = anonymous\n ? {\n client: createClient({\n baseURL: context.config.baseURL,\n fetch: (input, init) => fetch(input, { ...init, redirect: \"error\" })\n }),\n source: \"anonymous\"\n }\n : await authenticatedClient(context);\n const acceptsAPIKey = command.security.some((requirement) =>\n Object.hasOwn(requirement, \"apiKey\")\n );\n\n if (auth.source === \"environment\" && !acceptsAPIKey) {\n throw new CLIError(\n \"This operation requires OAuth login. Unset ANDESINE_API_KEY and run andesine auth login.\"\n );\n }\n\n const requiresWorkspace =\n (auth.source === \"file\" || auth.source === \"keyring\") &&\n command.fields.some(\n (field) => field.location === \"header\" && field.name === \"x-workspace-id\"\n );\n\n if (requiresWorkspace) {\n const workspaceID = headers.get(\"x-workspace-id\") ?? context.config.workspaceID;\n\n if (workspaceID === undefined) {\n throw new CLIError(\n \"No workspace selected. Run andesine init, pass --workspace <id>, or set ANDESINE_WORKSPACE_ID. Use andesine api workspaces list to find a workspace ID.\",\n exitCodes.usage\n );\n }\n\n if (!workspaceIDSchema.safeParse(workspaceID).success) {\n throw new CLIError(\"The workspace must be a workspace ID (ws_…).\", exitCodes.usage);\n }\n\n headers.set(\"x-workspace-id\", workspaceID);\n }\n\n if (options.paginate) {\n let count = 0;\n\n for await (const page of pages(command, auth.client, input, request)) {\n signal.throwIfAborted();\n await output.json(page);\n count += 1;\n }\n\n await output.success(`Received ${count} page${count === 1 ? \"\" : \"s\"}.`);\n return;\n }\n\n const invoke = bindings[command.id as keyof typeof bindings];\n const response = await output.progress(\n \"Sending request\",\n () => invoke(auth.client, input, { ...request, response: \"full\" }),\n \"Response received\"\n );\n\n if (response.notModified) {\n await output.json({\n status: 304,\n notModified: true,\n etag: response.headers.get(\"etag\"),\n ...(options.full ? { headers: Object.fromEntries(response.headers), data: null } : {})\n });\n return;\n }\n\n if (options.full) {\n await output.json({\n status: response.status,\n headers: Object.fromEntries(response.headers),\n data: response.data ?? null,\n notModified: false\n });\n return;\n }\n\n if (command.response === \"stream\") {\n const events = response.data as AsyncIterable<AnswerEvent>;\n\n for await (const event of events) {\n signal.throwIfAborted();\n if (options.format !== \"text\") await output.json(event);\n else if (event.type === \"textDelta\") await output.text(event.text);\n }\n\n await output.success(\"Answer complete.\");\n } else if (command.response === \"binary\") {\n await writeBinary(response.data, options.output!, signal);\n await output.success(\n options.output === \"-\" ? \"Download complete.\" : `Saved ${options.output}.`\n );\n } else if (command.response === \"empty\" || response.data === undefined) {\n await output.success(`Request completed (${response.status}).`);\n } else {\n await output.json(response.data);\n }\n } catch (error) {\n await reportAPIError(context, error);\n }\n};\n\nexport { executeAPI };\n","import { Option, type CommandUnknownOpts } from \"@commander-js/extra-typings\";\nimport { createCommandContext } from \"../context\";\nimport { createOutput } from \"../output\";\nimport type { GlobalOptions } from \"../config/resolve\";\nimport { commands, schemas } from \"./manifest\";\nimport { executeAPI } from \"./execute\";\nimport type { APIOptions } from \"./types\";\n\n/** Register the public spec without reading user config or credentials for help. */\nconst registerAPI = (program: CommandUnknownOpts, signal: AbortSignal): void => {\n const api = program\n .command(\"api\")\n .description(\"Call the public API; browser-only endpoints are not exposed\");\n const groups = new Map<string, CommandUnknownOpts>();\n\n for (const operation of commands) {\n let group = groups.get(operation.group);\n\n if (!group) {\n group = api.command(operation.group).description(`${operation.group} operations`);\n group.action(() => group?.outputHelp());\n groups.set(operation.group, group);\n }\n\n const command = group\n .command(operation.command)\n .description(operation.summary)\n .option(\n \"--input <source>\",\n \"JSON object from @file or - (stdin); flags override matching fields\"\n )\n .option(\"--timeout <ms>\", \"Request timeout in milliseconds (default: 30000; 0 disables it)\")\n .option(\"--schema\", \"Print the bundled input JSON Schema without making a request\");\n\n if (operation.conditional) {\n command.option(\"--if-none-match <etag>\", \"Read only if the published content has changed\");\n }\n\n if (operation.response === \"json\" || operation.response === \"empty\") {\n command.option(\"--full\", \"Include HTTP status and headers with the response data\");\n }\n\n if (operation.pagination) {\n command.option(\"--paginate\", \"Emit every page as one JSON line, retaining snapshot metadata\");\n }\n\n if (operation.response === \"binary\") {\n command.option(\"--output <file>\", \"Save bytes to a new file, or use - for raw stdout\");\n }\n\n if (operation.response === \"stream\") {\n command.addOption(\n new Option(\"--format <format>\", \"NDJSON events or answer text deltas\")\n .choices([\"json\", \"text\"])\n .default(\"json\")\n );\n }\n\n for (const field of operation.fields) {\n const argument = field.kind === \"file\" ? \"file\" : field.kind === \"json\" ? \"json\" : \"value\";\n const description = [\n field.schema.description,\n field.required ? \"Required\" : undefined,\n field.kind === \"file\"\n ? \"File path or - for stdin\"\n : field.kind === \"boolean\"\n ? \"true or false\"\n : field.kind === \"json\"\n ? \"JSON value\"\n : undefined,\n field.nullable ? \"Use null to clear\" : undefined\n ]\n .filter(Boolean)\n .join(\". \");\n\n command.option(`--${field.flag} <${argument}>`, description || field.name);\n }\n\n const authentication = operation.security.length\n ? operation.security.map((requirement) => Object.keys(requirement).join(\" + \")).join(\" or \")\n : \"Anonymous\";\n\n command.addHelpText(\n \"after\",\n `\\n${operation.description}\\n\\n${operation.method.toUpperCase()} ${operation.path}\\nAuthentication: ${authentication}\\nUse --workspace for OAuth workspace selection. JSON keys use API names, such as collectionID.\\n${operation.example ? `\\nExample input (pass through --input @request.json):\\n${JSON.stringify(operation.example, null, 2)}\\n` : \"\"}`\n );\n command.action(async (...args) => {\n const action = args.at(-1) as CommandUnknownOpts;\n const options = action.opts() as APIOptions;\n if (options.schema) {\n await createOutput(false).json({\n $schema: \"https://json-schema.org/draft/2020-12/schema\",\n type: \"object\",\n properties: Object.fromEntries(\n operation.fields.map((field) => [field.name, field.schema])\n ),\n required: operation.fields.filter((field) => field.required).map((field) => field.name),\n additionalProperties: false,\n components: { schemas }\n });\n return;\n }\n\n const context = await createCommandContext(action.optsWithGlobals() as GlobalOptions, signal);\n\n await executeAPI(operation, options, context);\n });\n }\n\n api.action(() => api.outputHelp());\n};\n\nexport { registerAPI };\n","import { type Command, Option } from \"@commander-js/extra-typings\";\nimport { createCommandContext } from \"../context\";\nimport { executeTypes } from \"./execute\";\nimport type { GlobalOptions } from \"../config/resolve\";\nimport type { GenerateOptions } from \"./options\";\n\nconst registerTypes = (program: Command, signal: AbortSignal): void => {\n const types = program\n .command(\"types\")\n .description(\"Generate TypeScript types for workspace content\");\n\n types\n .command(\"generate\")\n .description(\"Generate a types file, check it for CI, or watch for metadata changes\")\n .addOption(\n new Option(\n \"--source <source>\",\n \"Content source (default: saved source or published)\"\n ).choices([\"published\", \"current\"] as const)\n )\n .option(\"--channel <code>\", \"Follow a publishing channel\")\n .option(\"--snapshot <id>\", \"Use a fixed published snapshot\")\n .option(\"--collection <selectors...>\", \"Collection IDs or decoded paths, including descendants\")\n .option(\n \"--collection-slug-path <paths...>\",\n \"Decoded collection slug paths, including descendants\"\n )\n .option(\"--all-collections\", \"Include all accessible collections\")\n .option(\n \"--output <file>\",\n \"Types file relative to config, or the working directory without config\"\n )\n .option(\"--include-entry-ids\", \"Include entry ID types\")\n .option(\"--no-include-entry-ids\", \"Omit entry ID types\")\n .option(\"--include-entry-paths\", \"Include entry path types\")\n .option(\"--no-include-entry-paths\", \"Omit entry path types\")\n .option(\"--include-tree\", \"Include exact tree types\")\n .option(\"--no-include-tree\", \"Omit exact tree types\")\n .option(\"--check\", \"Compare against live metadata without writes; exit 3 if missing or stale\")\n .option(\"--watch\", \"Poll in the foreground; no daemon or overlapping requests\")\n .option(\"--interval <seconds>\", \"Watch polling interval, 1–300 seconds (default: 10)\")\n .option(\n \"--force\",\n \"Replace an unrelated output file; with watch, applies only until the first successful generation\"\n )\n .addHelpText(\n \"after\",\n \"\\nCommit the generated file and use --check in CI. Channel/current sources follow live changes;\\n--snapshot fixes the source while that snapshot is retained. Options override saved config.\\nWatch holds configuration fixed; restart it after config changes. Nothing runs at install time.\"\n )\n .action(async (options, command) => {\n const globals = command.optsWithGlobals() as GlobalOptions & GenerateOptions;\n\n await executeTypes(await createCommandContext(globals, signal), options);\n });\n};\n\nexport { registerTypes };\n","import { version } from \"../package.json\";\nimport { Command, Option } from \"@commander-js/extra-typings\";\nimport { createCommandContext } from \"./context\";\nimport { login } from \"./auth/login\";\nimport { logout } from \"./auth/logout\";\nimport { status } from \"./auth/status\";\nimport { init } from \"./init\";\nimport { createOutput } from \"./output\";\nimport { initPages } from \"./pages/init\";\nimport { registerAPI } from \"./api/register\";\nimport { registerTypes } from \"./types/register\";\n\n/** Register custom commands and the generated public API group. */\nconst createProgram = (signal: AbortSignal) => {\n const program = new Command()\n .name(\"andesine\")\n .description(\"Command-line tools for Andesine\")\n .version(version)\n .option(\"--config <file>\", \"Use a project configuration file (ANDESINE_CONFIG)\")\n .option(\"--profile <name>\", \"Select a saved user profile (ANDESINE_PROFILE)\")\n .option(\"--base-url <url>\", \"Set the API root (ANDESINE_BASE_URL)\")\n .option(\"--workspace <id>\", \"Select a workspace (ANDESINE_WORKSPACE_ID)\")\n .option(\"--no-interactive\", \"Disable interactive prompts\")\n .showHelpAfterError()\n .exitOverride();\n\n const auth = program.command(\"auth\").description(\"Manage CLI authentication\");\n\n program\n .command(\"init\")\n .description(\"Configure this project for Andesine content and type generation\")\n .addOption(\n new Option(\"--source <source>\", \"Type source: published (default) or current\").choices([\n \"published\",\n \"current\"\n ] as const)\n )\n .option(\"--channel <code>\", \"Publishing channel (default: published)\")\n .option(\"--snapshot <id>\", \"Use a fixed published snapshot instead of a channel\")\n .option(\n \"--collection <selectors...>\",\n \"Collection IDs or decoded paths, including collection-ID anchors\"\n )\n .option(\n \"--collection-slug-path <paths...>\",\n \"Decoded collection slug paths, including descendants\"\n )\n .option(\"--all-collections\", \"Include all accessible collections\")\n .option(\"--output <file>\", \"Types file relative to config (default: src/andesine.generated.ts)\")\n .option(\"--include-entry-ids\", \"Include entry ID types\")\n .option(\"--no-include-entry-ids\", \"Omit entry ID types\")\n .option(\"--include-entry-paths\", \"Include entry path types\")\n .option(\"--no-include-entry-paths\", \"Omit entry path types\")\n .option(\"--include-tree\", \"Include exact tree types\")\n .option(\"--no-include-tree\", \"Omit exact tree types\")\n .option(\"--yes\", \"Save without confirmation, including updates to an existing config\")\n .option(\"--generate\", \"Generate the configured types file after saving\")\n .option(\"--no-generate\", \"Save configuration without generating types\")\n .option(\"--no-browser\", \"Do not open a browser if login is needed\")\n .addOption(\n new Option(\"--credential-store <store>\", \"Credential store for a new login\").choices([\n \"keyring\",\n \"file\"\n ] as const)\n )\n .action(async (_options, command) => {\n await init(command.optsWithGlobals(), signal);\n });\n\n program\n .command(\"pages\")\n .description(\"Create Andesine Pages documentation sites\")\n .command(\"init\")\n .description(\"Create an Andesine Pages site from the template in a new or empty directory\")\n .argument(\"[directory]\", \"Directory of the new site\", \"docs\")\n .action(async (directory, _options, command) => {\n await initPages(directory, createOutput(command.optsWithGlobals().interactive, signal));\n });\n\n auth\n .command(\"login\")\n .description(\"Sign in through browser device approval\")\n .option(\"--no-browser\", \"Display the URL and code without opening a browser\")\n .addOption(\n new Option(\n \"--credential-store <store>\",\n \"Store credentials in the OS keyring or an unencrypted private file\"\n ).choices([\"keyring\", \"file\"] as const)\n )\n .action(async (options, command) => {\n const context = await createCommandContext(command.optsWithGlobals(), signal, {\n allowNewProfile: true\n });\n\n await login(context, options);\n });\n auth\n .command(\"status\")\n .description(\"Verify the selected credential and show its identity as JSON\")\n .action(async (_options, command) => {\n await status(await createCommandContext(command.optsWithGlobals(), signal));\n });\n auth\n .command(\"logout\")\n .description(\n \"Revoke and remove the selected profile's credentials; leave API-key environment variables unchanged\"\n )\n .action(async (_options, command) => {\n await logout(await createCommandContext(command.optsWithGlobals(), signal));\n });\n\n program.addHelpText(\n \"after\",\n \"\\nConfiguration precedence: flags > environment > project > profile > defaults.\\nDefault API root: https://api.andesine.app\\nAPI keys are read from ANDESINE_API_KEY by authenticated commands.\"\n );\n program.hook(\"preAction\", () => {\n signal.throwIfAborted();\n });\n registerAPI(program, signal);\n registerTypes(program, signal);\n program.action(() => {\n program.outputHelp();\n });\n\n return program;\n};\n\nexport { createProgram };\n","import { CLIError, CancelledError, exitCodes } from \"./errors\";\nimport { createProgram } from \"./program\";\nimport { createOutput, writeOutput } from \"./output\";\nimport { CommanderError } from \"commander\";\n\n/** Run the executable and release signal listeners when it finishes. */\nconst runCLI = async (argv = process.argv): Promise<number> => {\n const controller = new AbortController();\n const program = createProgram(controller.signal);\n const cancel = () => {\n controller.abort(new CancelledError());\n };\n const handleOutputError = (error: NodeJS.ErrnoException) => {\n const isBrokenPipe = error.code === \"EPIPE\";\n\n controller.abort(\n new CLIError(\n isBrokenPipe ? \"Output pipe closed.\" : \"Cannot write output.\",\n isBrokenPipe ? exitCodes.success : exitCodes.failure\n )\n );\n };\n\n let exitCode: number = exitCodes.success;\n\n process.once(\"SIGINT\", cancel);\n process.once(\"SIGTERM\", cancel);\n process.stdout.on(\"error\", handleOutputError);\n process.stderr.on(\"error\", handleOutputError);\n\n try {\n await program.parseAsync(argv);\n controller.signal.throwIfAborted();\n } catch (error) {\n if (error instanceof CommanderError) {\n exitCode = error.exitCode === 0 ? exitCodes.success : exitCodes.usage;\n } else {\n const failure: unknown = controller.signal.aborted ? controller.signal.reason : error;\n const message = failure instanceof Error ? failure.message : \"Command failed.\";\n\n exitCode = failure instanceof CLIError ? failure.exitCode : exitCodes.failure;\n\n if (exitCode !== exitCodes.success && !process.stderr.destroyed) {\n await createOutput(program.opts().interactive)\n .error(message)\n .catch(() => {});\n }\n }\n } finally {\n // Commander writes synchronously. Drain its queued output before releasing error handlers.\n await Promise.allSettled([writeOutput(process.stdout, \"\"), writeOutput(process.stderr, \"\")]);\n process.removeListener(\"SIGINT\", cancel);\n process.removeListener(\"SIGTERM\", cancel);\n process.stdout.removeListener(\"error\", handleOutputError);\n process.stderr.removeListener(\"error\", handleOutputError);\n }\n\n if (controller.signal.aborted) {\n const reason: unknown = controller.signal.reason;\n\n return reason instanceof CLIError ? reason.exitCode : exitCodes.failure;\n }\n\n return exitCode;\n};\n\nexport { runCLI };\n","#!/us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EACA,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ;GACN;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;IACX;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;IACX;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;EACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,SAAS;GACP,SAAS;GACT,SAAS;EACX;EACA,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ;GACN;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;IACX;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;IACX;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;EACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,SAAS;GACP,SAAS;GACT,SAAS;GACT,KAAK;GACL,iBAAiB;EACnB;EACA,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ;GACN;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;IACX;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;IACX;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,WAAW;KACX,QAAQ;IACV;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;IACX;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;EACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,SAAS;GACP,SAAS;GACT,SAAS;GACT,UAAU;GACV,UAAU;GACV,UAAU;EACZ;EACA,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ;GACN;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;IACX;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;IACX;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,WAAW;KACX,WAAW;IACb;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,SAAS;IACX;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;EACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,SAAS;GACP,OAAO;GACP,OAAO;EACT;EACA,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ;GACN;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,WAAW;KACX,SAAS;IACX;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;IACX;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;IACX;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,SAAS;KACT,SAAS;IACX;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;EACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,SAAS;GACP,SAAS;GACT,MAAM;EACR;EACA,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ;GACN;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;IACX;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,kBAAkB;IACpB;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;EACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ,CAAC;EACT,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,SAAS,EACP,KAAK,CAAC,cAAc,EACtB;EACA,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ,CACN;GACE,MAAM;GACN,UAAU;GACV,UAAU;GACV,QAAQ;IACN,MAAM;IACN,aACE;GACJ;GACA,MAAM;GACN,MAAM;GACN,UAAU;EACZ,GACA;GACE,MAAM;GACN,UAAU;GACV,UAAU;GACV,QAAQ;IACN,MAAM;IACN,UAAU;IACV,UAAU;IACV,OAAO;KACL,MAAM;KACN,SAAS;IACX;IACA,aAAa;GACf;GACA,MAAM;GACN,MAAM;GACN,UAAU;EACZ,CACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,SAAS;GACP,MAAM;GACN,UAAU;EACZ;EACA,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ;GACN;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,WAAW;KACX,WAAW;KACX,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;EACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,SAAS,EACP,IAAI,eACN;EACA,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ,CACN;GACE,MAAM;GACN,UAAU;GACV,UAAU;GACV,QAAQ;IACN,MAAM;IACN,SAAS;IACT,aAAa;GACf;GACA,MAAM;GACN,MAAM;GACN,UAAU;EACZ,GACA;GACE,MAAM;GACN,UAAU;GACV,UAAU;GACV,QAAQ;IACN,MAAM;IACN,aACE;GACJ;GACA,MAAM;GACN,MAAM;GACN,UAAU;EACZ,CACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,SAAS;GACP,cAAc;GACd,OAAO;EACT;EACA,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ;GACN;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;IACX;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,SAAS;KACT,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;EACF;EACA,aAAa;EACb,UAAU;EACV,YAAY;CACd;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,SAAS;GACP,IAAI;GACJ,MAAM;EACR;EACA,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ;GACN;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,WAAW;KACX,WAAW;KACX,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;EACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,SAAS;GACP,SAAS;GACT,SAAS;EACX;EACA,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ;GACN;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;IACX;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,WAAW;KACX,WAAW;KACX,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;EACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,SAAS;GACP,aAAa;GACb,YAAY;GACZ,SAAS;GACT,SAAS;GACT,SAAS;EACX;EACA,UAAU,CAAC;EACX,QAAQ;GACN;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;IACX;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;IACX;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;IACX;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;IACX;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM,CAAC,aAAa,SAAS;KAC7B,MAAM;IACR;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;EACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,SAAS;GACP,SAAS;GACT,SAAS;EACX;EACA,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ;GACN;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;IACX;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,WAAW;KACX,WAAW;IACb;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;IACX;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;EACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,SAAS;GACP,cAAc;GACd,SAAS;EACX;EACA,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ;GACN;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;IACX;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,WAAW;KACX,WAAW;KACX,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;EACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,SAAS;GACP,SAAS;GACT,OAAO;EACT;EACA,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ;GACN;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,SAAS;KACT,SAAS;IACX;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;IACX;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,WAAW;KACX,WAAW;IACb;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;IACX;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;EACF;EACA,aAAa;EACb,UAAU;EACV,YAAY;CACd;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,SAAS;GACP,SAAS;GACT,OAAO;EACT;EACA,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ;GACN;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,SAAS;KACT,SAAS;IACX;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;IACX;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,WAAW;KACX,WAAW;IACb;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;IACX;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;IACX;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;IACX;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,UAAU;KACV,OAAO,EACL,MAAM,sCACR;KACA,SAAS,CAAC;IACZ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;EACF;EACA,aAAa;EACb,UAAU;EACV,YAAY;CACd;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,SAAS,EACP,KAAK,CAAC,aAAa,EACrB;EACA,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ,CACN;GACE,MAAM;GACN,UAAU;GACV,UAAU;GACV,QAAQ;IACN,MAAM;IACN,aACE;GACJ;GACA,MAAM;GACN,MAAM;GACN,UAAU;EACZ,GACA;GACE,MAAM;GACN,UAAU;GACV,UAAU;GACV,QAAQ;IACN,MAAM;IACN,UAAU;IACV,UAAU;IACV,OAAO;KACL,MAAM;KACN,SAAS;IACX;IACA,aAAa;GACf;GACA,MAAM;GACN,MAAM;GACN,UAAU;EACZ,CACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,SAAS;GACP,MAAM;GACN,cAAc;EAChB;EACA,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ;GACN;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,WAAW;KACX,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;EACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,SAAS,EACP,IAAI,cACN;EACA,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ,CACN;GACE,MAAM;GACN,UAAU;GACV,UAAU;GACV,QAAQ;IACN,MAAM;IACN,SAAS;IACT,aAAa;GACf;GACA,MAAM;GACN,MAAM;GACN,UAAU;EACZ,GACA;GACE,MAAM;GACN,UAAU;GACV,UAAU;GACV,QAAQ;IACN,MAAM;IACN,aACE;GACJ;GACA,MAAM;GACN,MAAM;GACN,UAAU;EACZ,CACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,SAAS,EACP,IAAI,cACN;EACA,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ;GACN;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;IACX;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;EACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,SAAS;GACP,cAAc;GACd,OAAO;EACT;EACA,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ;GACN;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;IACX;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,SAAS;KACT,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;EACF;EACA,aAAa;EACb,UAAU;EACV,YAAY;CACd;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,SAAS;GACP,IAAI;GACJ,MAAM;EACR;EACA,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ;GACN;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,WAAW;KACX,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;EACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,SAAS,CAAC;EACV,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ,CACN;GACE,MAAM;GACN,UAAU;GACV,UAAU;GACV,QAAQ;IACN,MAAM;IACN,aACE;GACJ;GACA,MAAM;GACN,MAAM;GACN,UAAU;EACZ,CACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,SAAS;GACP,OAAO;GACP,QAAQ;EACV;EACA,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ;GACN;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,QAAQ;KACR,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;EACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,SAAS,CAAC;EACV,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ;GACN;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,SAAS;KACT,SAAS;IACX;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;EACF;EACA,aAAa;EACb,UAAU;EACV,YAAY;CACd;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,SAAS,CAAC;EACV,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ;GACN;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,SAAS;KACT,SAAS;IACX;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;EACF;EACA,aAAa;EACb,UAAU;EACV,YAAY;CACd;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,SAAS,EACP,IAAI,aACN;EACA,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ,CACN;GACE,MAAM;GACN,UAAU;GACV,UAAU;GACV,QAAQ;IACN,MAAM;IACN,SAAS;IACT,aAAa;GACf;GACA,MAAM;GACN,MAAM;GACN,UAAU;EACZ,GACA;GACE,MAAM;GACN,UAAU;GACV,UAAU;GACV,QAAQ;IACN,MAAM;IACN,aACE;GACJ;GACA,MAAM;GACN,MAAM;GACN,UAAU;EACZ,CACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,SAAS,EACP,IAAI,cACN;EACA,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ,CACN;GACE,MAAM;GACN,UAAU;GACV,UAAU;GACV,QAAQ;IACN,MAAM;IACN,SAAS;IACT,aAAa;GACf;GACA,MAAM;GACN,MAAM;GACN,UAAU;EACZ,GACA;GACE,MAAM;GACN,UAAU;GACV,UAAU;GACV,QAAQ;IACN,MAAM;IACN,aACE;GACJ;GACA,MAAM;GACN,MAAM;GACN,UAAU;EACZ,CACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,SAAS,EACP,IAAI,cACN;EACA,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ,CACN;GACE,MAAM;GACN,UAAU;GACV,UAAU;GACV,QAAQ;IACN,MAAM;IACN,SAAS;IACT,aAAa;GACf;GACA,MAAM;GACN,MAAM;GACN,UAAU;EACZ,GACA;GACE,MAAM;GACN,UAAU;GACV,UAAU;GACV,QAAQ;IACN,MAAM;IACN,aACE;GACJ;GACA,MAAM;GACN,MAAM;GACN,UAAU;EACZ,CACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,SAAS;GACP,IAAI;GACJ,QAAQ;EACV;EACA,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ;GACN;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;EACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,SAAS;GACP,KAAK,CAAC,cAAc;GACpB,SAAS;EACX;EACA,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ;GACN;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,WAAW;KACX,WAAW;KACX,SAAS;KACT,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,UAAU;KACV,UAAU;KACV,OAAO;MACL,MAAM;MACN,SAAS;KACX;KACA,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;EACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,SAAS;GACP,SAAS,CACP,EACE,SAAS,cACX,CACF;GACA,SAAS;EACX;EACA,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ;GACN;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,WAAW;KACX,WAAW;KACX,SAAS;KACT,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,UAAU;KACV,UAAU;KACV,OAAO,EACL,MAAM,0CACR;KACA,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;EACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,SAAS;GACP,KAAK,CAAC,cAAc;GACpB,SAAS;GACT,SAAS;EACX;EACA,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ;GACN;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,UAAU;KACV,UAAU;KACV,OAAO;MACL,MAAM;MACN,SAAS;KACX;KACA,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,eAAe;MACb,MAAM;MACN,WAAW;MACX,WAAW;KACb;KACA,sBAAsB;MACpB,MAAM;MACN,SAAS;KACX;KACA,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;EACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,SAAS;GACP,KAAK,CAAC,cAAc;GACpB,SAAS;EACX;EACA,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ;GACN;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,WAAW;KACX,WAAW;KACX,SAAS;KACT,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,UAAU;KACV,UAAU;KACV,OAAO;MACL,MAAM;MACN,SAAS;KACX;KACA,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;EACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,SAAS;GACP,KAAK,CAAC,aAAa;GACnB,SAAS;EACX;EACA,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ;GACN;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,WAAW;KACX,WAAW;KACX,SAAS;KACT,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,UAAU;KACV,UAAU;KACV,OAAO;MACL,MAAM;MACN,SAAS;KACX;KACA,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;EACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,SAAS,EACP,MAAM,UACR;EACA,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ,CACN;GACE,MAAM;GACN,UAAU;GACV,UAAU;GACV,QAAQ;IACN,MAAM;IACN,aACE;GACJ;GACA,MAAM;GACN,MAAM;GACN,UAAU;EACZ,GACA;GACE,MAAM;GACN,UAAU;GACV,UAAU;GACV,QAAQ;IACN,MAAM;IACN,WAAW;IACX,WAAW;IACX,aAAa;GACf;GACA,MAAM;GACN,MAAM;GACN,UAAU;EACZ,CACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,SAAS,EACP,MAAM,UACR;EACA,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ;GACN;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,WAAW;KACX,WAAW;KACX,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;EACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,SAAS;GACP,SAAS;GACT,cAAc;EAChB;EACA,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ;GACN;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,WAAW;KACX,WAAW;IACb;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;EACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,SAAS;GACP,SAAS;GACT,SAAS;EACX;EACA,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ;GACN;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,WAAW;KACX,WAAW;KACX,SAAS;KACT,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;EACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,SAAS,EACP,wBAAwB,KAC1B;EACA,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ,CACN;GACE,MAAM;GACN,UAAU;GACV,UAAU;GACV,QAAQ;IACN,MAAM;IACN,aAAa;GACf;GACA,MAAM;GACN,MAAM;GACN,UAAU;EACZ,GACA;GACE,MAAM;GACN,UAAU;GACV,UAAU;GACV,QAAQ;IACN,MAAM;IACN,aACE;GACJ;GACA,MAAM;GACN,MAAM;GACN,UAAU;EACZ,CACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,SAAS,EACP,SAAS,cACX;EACA,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ,CACN;GACE,MAAM;GACN,UAAU;GACV,UAAU;GACV,QAAQ;IACN,MAAM;IACN,SAAS;IACT,aAAa;GACf;GACA,MAAM;GACN,MAAM;GACN,UAAU;EACZ,GACA;GACE,MAAM;GACN,UAAU;GACV,UAAU;GACV,QAAQ;IACN,MAAM;IACN,aACE;GACJ;GACA,MAAM;GACN,MAAM;GACN,UAAU;EACZ,CACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,SAAS;GACP,cAAc;GACd,SAAS;EACX;EACA,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ;GACN;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,WAAW;KACX,WAAW;KACX,SAAS;KACT,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;EACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,SAAS;GACP,SAAS;GACT,SAAS;EACX;EACA,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ;GACN;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,WAAW;KACX,WAAW;KACX,SAAS;KACT,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;EACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,SAAS;GACP,cAAc;GACd,YAAY;GACZ,UAAU,CAAC,aAAa;GACxB,SAAS;EACX;EACA,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ;GACN;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,WAAW;KACX,WAAW;KACX,SAAS;KACT,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,UAAU;KACV,OAAO;MACL,MAAM;MACN,SAAS;KACX;KACA,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,UAAU;KACV,OAAO;MACL,MAAM;MACN,SAAS;KACX;KACA,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;EACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,SAAS;GACP,cAAc;GACd,SAAS;GACT,SAAS;EACX;EACA,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ;GACN;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,eAAe;MACb,MAAM;MACN,WAAW;MACX,WAAW;KACb;KACA,sBAAsB;MACpB,MAAM;MACN,SAAS;KACX;KACA,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;EACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,SAAS;GACP,cAAc;GACd,SAAS;EACX;EACA,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ;GACN;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,WAAW;KACX,WAAW;KACX,SAAS;KACT,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;EACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,SAAS;GACP,SAAS;GACT,SAAS;GACT,WAAW;EACb;EACA,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ;GACN;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,WAAW;KACX,WAAW;KACX,SAAS;KACT,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;EACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,SAAS;GACP,MAAM;GACN,aAAa,CAAC,SAAS;EACzB;EACA,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ;GACN;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,WAAW;KACX,WAAW;KACX,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,OAAO,EACL,MAAM,kCACR;KACA,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;EACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,SAAS,EACP,IAAI,aACN;EACA,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ,CACN;GACE,MAAM;GACN,UAAU;GACV,UAAU;GACV,QAAQ;IACN,MAAM;IACN,SAAS;IACT,aAAa;GACf;GACA,MAAM;GACN,MAAM;GACN,UAAU;EACZ,GACA;GACE,MAAM;GACN,UAAU;GACV,UAAU;GACV,QAAQ;IACN,MAAM;IACN,aACE;GACJ;GACA,MAAM;GACN,MAAM;GACN,UAAU;EACZ,CACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,SAAS,CAAC;EACV,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ,CACN;GACE,MAAM;GACN,UAAU;GACV,UAAU;GACV,QAAQ;IACN,MAAM;IACN,aACE;GACJ;GACA,MAAM;GACN,MAAM;GACN,UAAU;EACZ,CACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,SAAS;GACP,IAAI;GACJ,MAAM;EACR;EACA,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ;GACN;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,WAAW;KACX,WAAW;KACX,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,OAAO,EACL,MAAM,kCACR;KACA,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;EACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,SAAS,EACP,IAAI,cACN;EACA,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ,CACN;GACE,MAAM;GACN,UAAU;GACV,UAAU;GACV,QAAQ;IACN,MAAM;IACN,SAAS;IACT,aAAa;GACf;GACA,MAAM;GACN,MAAM;GACN,UAAU;EACZ,GACA;GACE,MAAM;GACN,UAAU;GACV,UAAU;GACV,QAAQ;IACN,MAAM;IACN,aACE;GACJ;GACA,MAAM;GACN,MAAM;GACN,UAAU;EACZ,CACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,SAAS,EACP,cAAc,eAChB;EACA,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ,CACN;GACE,MAAM;GACN,UAAU;GACV,UAAU;GACV,QAAQ;IACN,MAAM;IACN,SAAS;IACT,aAAa;GACf;GACA,MAAM;GACN,MAAM;GACN,UAAU;EACZ,GACA;GACE,MAAM;GACN,UAAU;GACV,UAAU;GACV,QAAQ;IACN,MAAM;IACN,aACE;GACJ;GACA,MAAM;GACN,MAAM;GACN,UAAU;EACZ,CACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,SAAS;GACP,IAAI;GACJ,OAAO;EACT;EACA,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ;GACN;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;IACX;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,SAAS;KACT,SAAS;IACX;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;EACF;EACA,aAAa;EACb,UAAU;EACV,YAAY;CACd;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,SAAS;GACP,UAAU;GACV,mBAAmB;GACnB,MAAM;EACR;EACA,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ;GACN;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,OAAO;KACP,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,WAAW;KACX,WAAW;KACX,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;EACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,SAAS,EACP,cAAc,eAChB;EACA,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ,CACN;GACE,MAAM;GACN,UAAU;GACV,UAAU;GACV,QAAQ;IACN,MAAM;IACN,SAAS;IACT,aAAa;GACf;GACA,MAAM;GACN,MAAM;GACN,UAAU;EACZ,GACA;GACE,MAAM;GACN,UAAU;GACV,UAAU;GACV,QAAQ;IACN,MAAM;IACN,aACE;GACJ;GACA,MAAM;GACN,MAAM;GACN,UAAU;EACZ,CACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,SAAS;GACP,UAAU;GACV,mBAAmB;EACrB;EACA,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ;GACN;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;EACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,SAAS,EACP,cAAc,eAChB;EACA,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ;GACN;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;IACX;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;EACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,SAAS,EACP,YAAY,eACd;EACA,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ,CACN;GACE,MAAM;GACN,UAAU;GACV,UAAU;GACV,QAAQ;IACN,MAAM;IACN,SAAS;GACX;GACA,MAAM;GACN,MAAM;GACN,UAAU;EACZ,GACA;GACE,MAAM;GACN,UAAU;GACV,UAAU;GACV,QAAQ;IACN,MAAM;IACN,aACE;GACJ;GACA,MAAM;GACN,MAAM;GACN,UAAU;EACZ,CACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,SAAS,EACP,IAAI,eACN;EACA,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ,CACN;GACE,MAAM;GACN,UAAU;GACV,UAAU;GACV,QAAQ;IACN,MAAM;IACN,SAAS;IACT,aAAa;GACf;GACA,MAAM;GACN,MAAM;GACN,UAAU;EACZ,GACA;GACE,MAAM;GACN,UAAU;GACV,UAAU;GACV,QAAQ;IACN,MAAM;IACN,aACE;GACJ;GACA,MAAM;GACN,MAAM;GACN,UAAU;EACZ,CACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,SAAS;GACP,UAAU;GACV,OAAO;EACT;EACA,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ;GACN;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,SAAS;KACT,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;EACF;EACA,aAAa;EACb,UAAU;EACV,YAAY;CACd;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,SAAS;GACP,IAAI;GACJ,mBAAmB;EACrB;EACA,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ;GACN;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,OAAO;KACP,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,WAAW;KACX,WAAW;KACX,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;EACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,SAAS;GACP,IAAI;GACJ,MAAM;EACR;EACA,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ;GACN;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,OAAO,CACL;MACE,MAAM;MACN,WAAW;MACX,WAAW;KACb,GACA,EACE,MAAM,OACR,CACF;KACA,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;EACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,SAAS,EACP,UAAU,6BACZ;EACA,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ;GACN;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,WAAW;KACX,WAAW;IACb;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;IACX;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,UAAU;KACV,OAAO,EACL,MAAM,sCACR;KACA,SAAS,CAAC;IACZ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,UAAU;KACV,OAAO,EACL,MAAM,4CACR;KACA,SAAS,CAAC;IACZ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;EACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ;GACN;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,WAAW;KACX,WAAW;IACb;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;IACX;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,UAAU;KACV,OAAO,EACL,MAAM,sCACR;KACA,SAAS,CAAC;IACZ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,UAAU;KACV,OAAO,EACL,MAAM,4CACR;KACA,SAAS,CAAC;IACZ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;EACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,SAAS;GACP,UAAU;GACV,SAAS;EACX;EACA,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ;GACN;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,WAAW;KACX,WAAW;IACb;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;IACX;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,UAAU;KACV,OAAO,EACL,MAAM,sCACR;KACA,SAAS,CAAC;IACZ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,UAAU;KACV,OAAO,EACL,MAAM,4CACR;KACA,SAAS,CAAC;IACZ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,WAAW;KACX,WAAW;KACX,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;EACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ;GACN;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,WAAW;KACX,WAAW;IACb;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;IACX;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,UAAU;KACV,OAAO,EACL,MAAM,sCACR;KACA,SAAS,CAAC;IACZ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,UAAU;KACV,OAAO,EACL,MAAM,4CACR;KACA,SAAS,CAAC;IACZ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,WAAW;KACX,WAAW;KACX,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;EACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,SAAS;GACP,OAAO;GACP,OAAO;EACT;EACA,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ;GACN;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,WAAW;IACb;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;IACX;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,UAAU;KACV,OAAO,EACL,MAAM,sCACR;KACA,SAAS,CAAC;IACZ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,SAAS;KACT,SAAS;IACX;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;EACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,SAAS;GACP,OAAO;GACP,SAAS;GACT,OAAO;EACT;EACA,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ;GACN;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,WAAW;IACb;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;IACX;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,UAAU;KACV,OAAO,EACL,MAAM,sCACR;KACA,SAAS,CAAC;IACZ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,SAAS;KACT,SAAS;IACX;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,WAAW;KACX,WAAW;KACX,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;EACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,SAAS;GACP,aAAa,CAAC,YAAY;GAC1B,gBAAgB;EAClB;EACA,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ;GACN;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,UAAU;KACV,OAAO,EACL,OAAO;MACL;OACE,MAAM;OACN,SAAS;MACX;MACA;OACE,MAAM;OACN,aACE;MACJ;MACA;OACE,MAAM;OACN,YAAY,EACV,oBAAoB;QAClB,MAAM;QACN,aACE;OACJ,EACF;OACA,UAAU,CAAC,oBAAoB;MACjC;KACF,EACF;KACA,SAAS,CAAC;KACV,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;EACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,SAAS;GACP,SAAS;GACT,aAAa,CAAC,YAAY;EAC5B;EACA,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ;GACN;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,UAAU;KACV,OAAO,EACL,OAAO;MACL;OACE,MAAM;OACN,SAAS;MACX;MACA;OACE,MAAM;OACN,aACE;MACJ;MACA;OACE,MAAM;OACN,YAAY,EACV,oBAAoB;QAClB,MAAM;QACN,aACE;OACJ,EACF;OACA,UAAU,CAAC,oBAAoB;MACjC;KACF,EACF;KACA,SAAS,CAAC;KACV,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,WAAW;KACX,WAAW;IACb;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;IACX;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;EACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,SAAS;GACP,SAAS;GACT,MAAM;EACR;EACA,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ;GACN;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,WAAW;KACX,WAAW;KACX,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;EACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,SAAS,EACP,IAAI,cACN;EACA,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ;GACN;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;EACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,SAAS;GACP,SAAS;GACT,OAAO;EACT;EACA,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ;GACN;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,SAAS;KACT,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;EACF;EACA,aAAa;EACb,UAAU;EACV,YAAY;CACd;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,SAAS,EACP,IAAI,cACN;EACA,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ,CACN;GACE,MAAM;GACN,UAAU;GACV,UAAU;GACV,QAAQ;IACN,MAAM;IACN,SAAS;IACT,aAAa;GACf;GACA,MAAM;GACN,MAAM;GACN,UAAU;EACZ,GACA;GACE,MAAM;GACN,UAAU;GACV,UAAU;GACV,QAAQ;IACN,MAAM;IACN,aACE;GACJ;GACA,MAAM;GACN,MAAM;GACN,UAAU;EACZ,CACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,SAAS;GACP,IAAI;GACJ,MAAM;EACR;EACA,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ;GACN;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,OAAO,CACL;MACE,MAAM;MACN,WAAW;MACX,WAAW;KACb,GACA,EACE,MAAM,OACR,CACF;KACA,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;EACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ,CACN;GACE,MAAM;GACN,UAAU;GACV,UAAU;GACV,QAAQ;IACN,MAAM;IACN,aACE;GACJ;GACA,MAAM;GACN,MAAM;GACN,UAAU;EACZ,GACA;GACE,MAAM;GACN,UAAU;GACV,UAAU;GACV,QAAQ;IACN,MAAM;IACN,UAAU;IACV,UAAU;IACV,OAAO;KACL,MAAM;KACN,YAAY;MACV,IAAI;OACF,MAAM;OACN,SAAS;MACX;MACA,kBAAkB;OAChB,MAAM;OACN,SAAS;OACT,SAAS;OACT,kBAAkB;MACpB;KACF;KACA,UAAU,CAAC,MAAM,kBAAkB;KACnC,sBAAsB;IACxB;GACF;GACA,MAAM;GACN,MAAM;GACN,UAAU;EACZ,CACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ;GACN;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;IACX;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,SAAS;KACT,kBAAkB;IACpB;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,UAAU;KACV,UAAU;KACV,OAAO;MACL,MAAM;MACN,SAAS;KACX;IACF;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;EACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ;GACN;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,UAAU;KACV,UAAU;KACV,OAAO;MACL,MAAM;MACN,YAAY;OACV,IAAI;QACF,MAAM;QACN,SAAS;OACX;OACA,kBAAkB;QAChB,MAAM;QACN,SAAS;QACT,SAAS;QACT,kBAAkB;OACpB;MACF;MACA,UAAU,CAAC,MAAM,kBAAkB;MACnC,sBAAsB;KACxB;IACF;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ,EACN,MAAM,UACR;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;EACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ;GACN;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,WAAW;KACX,WAAW;IACb;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,WAAW;KACX,QAAQ;IACV;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;IACX;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,UAAU;KACV,UAAU;KACV,OAAO,EACL,MAAM,wCACR;IACF;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ,EACN,OAAO,EACT;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ,EACN,OAAO,CACL;KACE,MAAM;KACN,YAAY,EACV,MAAM,EACJ,OAAO,MACT,EACF;KACA,UAAU,CAAC,MAAM;KACjB,sBAAsB;IACxB,GACA;KACE,MAAM;KACN,YAAY;MACV,MAAM,EACJ,OAAO,WACT;MACA,OAAO;OACL,MAAM;OACN,UAAU;OACV,UAAU;OACV,OAAO;QACL,MAAM;QACN,SAAS;OACX;MACF;KACF;KACA,UAAU,CAAC,QAAQ,OAAO;KAC1B,sBAAsB;IACxB,CACF,EACF;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ,EACN,OAAO,CACL;KACE,MAAM;KACN,YAAY,EACV,MAAM,EACJ,OAAO,MACT,EACF;KACA,UAAU,CAAC,MAAM;KACjB,sBAAsB;IACxB,GACA;KACE,MAAM;KACN,YAAY;MACV,MAAM,EACJ,OAAO,WACT;MACA,OAAO;OACL,MAAM;OACN,UAAU;OACV,UAAU;OACV,OAAO;QACL,MAAM;QACN,WAAW;QACX,WAAW;OACb;MACF;KACF;KACA,UAAU,CAAC,QAAQ,OAAO;KAC1B,sBAAsB;IACxB,CACF,EACF;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;EACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ;GACN;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;IACX;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,SAAS;KACT,kBAAkB;IACpB;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;EACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ,CACN;GACE,MAAM;GACN,UAAU;GACV,UAAU;GACV,QAAQ;IACN,MAAM;IACN,SAAS;GACX;GACA,MAAM;GACN,MAAM;GACN,UAAU;EACZ,GACA;GACE,MAAM;GACN,UAAU;GACV,UAAU;GACV,QAAQ;IACN,MAAM;IACN,aACE;GACJ;GACA,MAAM;GACN,MAAM;GACN,UAAU;EACZ,CACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ;GACN;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;IACX;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;IACX;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;EACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ;GACN;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,SAAS;KACT,SAAS;IACX;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;EACF;EACA,aAAa;EACb,UAAU;EACV,YAAY;CACd;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ;GACN;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;IACX;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;IACX;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;IACX;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;IACX;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,SAAS;KACT,SAAS;IACX;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;EACF;EACA,aAAa;EACb,UAAU;EACV,YAAY;CACd;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ;GACN;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;IACX;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;IACX;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,SAAS;KACT,SAAS;IACX;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ,EACN,MAAM,wCACR;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;MAAC;MAAW;MAAa;MAAa;MAAU;KAAW;KACjE,MAAM;IACR;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,QAAQ;IACV;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,QAAQ;IACV;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;EACF;EACA,aAAa;EACb,UAAU;EACV,YAAY;CACd;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ;GACN;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;IACX;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;IACX;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;IACX;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,SAAS;KACT,SAAS;IACX;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;EACF;EACA,aAAa;EACb,UAAU;EACV,YAAY;CACd;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ;GACN;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;IACX;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;IACX;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,SAAS;KACT,kBAAkB;IACpB;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;EACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ;GACN;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;IACX;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,SAAS;KACT,kBAAkB;IACpB;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM,CAAC,WAAW,WAAW;KAC7B,MAAM;IACR;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;EACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ;GACN;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;IACX;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,SAAS;KACT,kBAAkB;IACpB;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ,EACN,MAAM,wCACR;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;EACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ;GACN;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;IACX;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,WAAW;KACX,WAAW;IACb;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,WAAW;KACX,QAAQ;IACV;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ,EACN,MAAM,UACR;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,UAAU;KACV,UAAU;KACV,OAAO,EACL,MAAM,wCACR;IACF;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ,EACN,OAAO,EACT;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ,EACN,OAAO,CACL;KACE,MAAM;KACN,YAAY,EACV,MAAM,EACJ,OAAO,MACT,EACF;KACA,UAAU,CAAC,MAAM;KACjB,sBAAsB;IACxB,GACA;KACE,MAAM;KACN,YAAY;MACV,MAAM,EACJ,OAAO,WACT;MACA,OAAO;OACL,MAAM;OACN,UAAU;OACV,UAAU;OACV,OAAO;QACL,MAAM;QACN,SAAS;OACX;MACF;KACF;KACA,UAAU,CAAC,QAAQ,OAAO;KAC1B,sBAAsB;IACxB,CACF,EACF;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ,EACN,OAAO,CACL;KACE,MAAM;KACN,YAAY,EACV,MAAM,EACJ,OAAO,MACT,EACF;KACA,UAAU,CAAC,MAAM;KACjB,sBAAsB;IACxB,GACA;KACE,MAAM;KACN,YAAY;MACV,MAAM,EACJ,OAAO,WACT;MACA,OAAO;OACL,MAAM;OACN,UAAU;OACV,UAAU;OACV,OAAO;QACL,MAAM;QACN,WAAW;QACX,WAAW;OACb;MACF;KACF;KACA,UAAU,CAAC,QAAQ,OAAO;KAC1B,sBAAsB;IACxB,CACF,EACF;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,SAAS;KACT,kBAAkB;IACpB;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;EACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,UAAU,CACR,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ,CAAC;EACT,aAAa;EACb,UAAU;CACZ;AACF;AACA,MAAM,UAAsC;CAC1C,gBAAgB,EACd,OAAO;EACL,EACE,MAAM,0CACR;EACA,EACE,MAAM,4CACR;EACA,EACE,MAAM,6CACR;EACA,EACE,MAAM,0CACR;CACF,EACF;CACA,oBAAoB;EAClB,MAAM;EACN,YAAY;GACV,MAAM,EACJ,OAAO,OACT;GACA,KAAK;IACH,MAAM;IACN,WAAW;IACX,WAAW;IACX,aAAa;GACf;GACA,UAAU;IACR,MAAM;KAAC;KAAO;KAAO;IAAM;IAC3B,MAAM;IACN,SAAS;GACX;GACA,QAAQ;IACN,MAAM;IACN,UAAU;IACV,UAAU;IACV,OAAO;KACL,MAAM;KACN,WAAW;IACb;GACF;EACF;EACA,UAAU;GAAC;GAAQ;GAAO;EAAQ;CACpC;CACA,sBAAsB;EACpB,MAAM;EACN,YAAY;GACV,MAAM,EACJ,OAAO,SACT;GACA,KAAK;IACH,MAAM;IACN,WAAW;IACX,WAAW;IACX,aAAa;GACf;GACA,UAAU,EACR,MAAM,0CACR;GACA,OAAO,EACL,MAAM,SACR;EACF;EACA,UAAU;GAAC;GAAQ;GAAO;GAAY;EAAO;CAC/C;CACA,oBAAoB;EAClB,MAAM;GACJ;GACA;GACA;GACA;GACA;GACA;EACF;EACA,MAAM;CACR;CACA,uBAAuB;EACrB,MAAM;EACN,YAAY;GACV,MAAM,EACJ,OAAO,UACT;GACA,KAAK;IACH,MAAM;IACN,WAAW;IACX,WAAW;IACX,aAAa;GACf;GACA,OAAO,EACL,MAAM,UACR;EACF;EACA,UAAU;GAAC;GAAQ;GAAO;EAAO;CACnC;CACA,oBAAoB;EAClB,MAAM;EACN,YAAY;GACV,MAAM,EACJ,OAAO,OACT;GACA,KAAK;IACH,MAAM;IACN,WAAW;IACX,WAAW;IACX,aAAa;GACf;GACA,UAAU,EACR,MAAM,0CACR;GACA,OAAO,EACL,MAAM,SACR;EACF;EACA,UAAU;GAAC;GAAQ;GAAO;GAAY;EAAO;CAC/C;CACA,kBAAkB;EAChB,MAAM;GACJ;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACF;EACA,MAAM;CACR;CACA,YAAY;EACV,MAAM;GACJ;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACF;EACA,MAAM;CACR;CACA,sBAAsB;EACpB,MAAM;EACN,YAAY;GACV,MAAM;IACJ,MAAM,CAAC,QAAQ,WAAW;IAC1B,MAAM;GACR;GACA,SAAS;IACP,MAAM;IACN,WAAW;IACX,WAAW;GACb;EACF;EACA,UAAU,CAAC,QAAQ,SAAS;CAC9B;CACA,oBAAoB;EAClB,MAAM;EACN,YAAY;GACV,SAAS;IACP,MAAM;IACN,SAAS;IACT,aAAa;GACf;GACA,WAAW;IACT,MAAM;IACN,SAAS;IACT,aAAa;GACf;EACF;EACA,UAAU,CAAC,SAAS;CACtB;AACF;;;ACzpPA,MAAM,YAAY,OAAO,WAAyC;CAChE,MAAM,SAAmB,CAAC;CA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AAQ,OAAO,eAAe,SAAS,iBAAiB;EACxD,QAAQ,OAAO,eAAe,SAAS,iBAAiB;CAC1D;CAEA,IAAI,WAAW,OAAO,SAAS;EAC7B,MAAM,SAAkB,WAAW,OAAO;EAE1C,OAAO,kBAAkB,WAAW,OAAO,WAAW,UAAU;CAClE;CAEA,OAAO;AACT;;;AC7DA,QAAQ,WAAW,MAAM,OAAO"}
|
|
1
|
+
{"version":3,"file":"cli.js","names":["setTimeout","setTimeout","hash","hash","setTimeout","webhookEnvelopeType","readJSON","runFile","isIgnored","describeKey","sleep","rename"],"sources":["../src/errors.ts","../package.json","../src/config/files.ts","../src/config/schema.ts","../src/config/resolve.ts","../src/output.ts","../src/prompts.ts","../src/context.ts","../src/auth/schema.ts","../src/storage/files.ts","../src/storage/credentials.ts","../src/storage/lock.ts","../src/storage/profiles.ts","../src/auth/oauth.ts","../src/auth/client.ts","../src/auth/login.ts","../src/auth/logout.ts","../src/auth/status.ts","../src/content/collections.ts","../src/types/options.ts","../src/init/choices.ts","../src/init/write-config.ts","../src/api/errors.ts","../src/types/source.ts","../src/types/schema.ts","../src/types/tree.ts","../src/types/generate.ts","../src/types/file.ts","../src/types/metadata.ts","../src/types/execute.ts","../src/init/index.ts","../src/pages/init.ts","../src/api/manifest.ts","../src/api/input.ts","../src/api/bindings.ts","../src/api/binary.ts","../src/api/execute.ts","../src/api/register.ts","../src/types/register.ts","../../../private/contracts/src/primitives/encoding.ts","../../../private/contracts/src/primitives/id.ts","../../../private/contracts/src/primitives/unique.ts","../../../private/contracts/src/webhooks/catalog-definitions.ts","../../../private/contracts/src/webhooks/events.ts","../../../private/contracts/src/entities/keys.ts","../../../private/contracts/src/permissions/requirements.ts","../../../private/contracts/src/extensions/configuration.ts","../../../private/document/src/element.ts","../../../private/document/src/elements.ts","../../../private/document/src/validation.ts","../../../private/contracts/src/extensions/contributions.ts","../../../private/contracts/src/api/schemas/webhooks.ts","../../../private/contracts/src/webhooks/outbound.ts","../../../private/contracts/src/extensions/webhooks.ts","../../../private/contracts/src/extensions/manifest.ts","../../../private/contracts/src/extensions/registry.ts","../src/extensions/frontend.ts","../src/extensions/project.ts","../../../private/contracts/src/extensions/styles.ts","../../../private/uno-preset/src/index.ts","../../../private/uno-preset/src/extensions.ts","../src/extensions/styles.ts","../src/extensions/build.ts","../src/extensions/dev/client.ts","../src/extensions/dev/state.ts","../src/extensions/dev/remove.ts","../src/extensions/keys.ts","../src/extensions/dev/environment.ts","../src/extensions/dev/watch.ts","../src/extensions/dev/run.ts","../src/extensions/dev/test-event.ts","../src/extensions/registry/repository.ts","../src/extensions/registry/check.ts","../src/extensions/registry/build.ts","../src/extensions/init.ts","../src/extensions/register.ts","../src/program.ts","../src/run.ts","../src/cli.ts"],"sourcesContent":["/** Process exit codes shared by commands and the executable. */\nconst exitCodes = { success: 0, failure: 1, usage: 2, stale: 3, cancelled: 130 } as const;\n\nclass CLIError extends Error {\n constructor(\n message: string,\n readonly exitCode: number = exitCodes.failure\n ) {\n super(message);\n this.name = \"CLIError\";\n }\n}\n\nclass CancelledError extends CLIError {\n constructor() {\n super(\"Cancelled.\", exitCodes.cancelled);\n this.name = \"CancelledError\";\n }\n}\n\nexport { CLIError, CancelledError, exitCodes };\n","","import { CLIError, exitCodes } from \"../errors\";\nimport { readFile } from \"node:fs/promises\";\nimport path from \"node:path\";\nimport type * as z from \"zod\";\n\n/** Read declarative JSON only. Missing optional files are distinct from invalid files. */\nconst readConfigFile = async <Schema extends z.ZodType>(\n filePath: string,\n schema: Schema,\n optional = false\n): Promise<z.output<Schema> | undefined> => {\n let content: string;\n let value: unknown;\n\n try {\n content = await readFile(filePath, \"utf8\");\n } catch (error) {\n const code = (error as NodeJS.ErrnoException).code;\n\n if (optional && code === \"ENOENT\") return undefined;\n\n throw new CLIError(`Cannot read ${filePath} (${code ?? \"filesystem error\"}).`, exitCodes.usage);\n }\n\n try {\n value = JSON.parse(content);\n } catch {\n throw new CLIError(`Invalid JSON in ${filePath}.`, exitCodes.usage);\n }\n\n const result = schema.safeParse(value);\n\n if (!result.success) {\n // Report field locations without echoing values that could contain a pasted secret.\n const fields = [...new Set(result.error.issues.map((issue) => issue.path.join(\".\") || \"root\"))];\n\n throw new CLIError(\n `Invalid configuration in ${filePath}. Check: ${fields.join(\", \")}.`,\n exitCodes.usage\n );\n }\n\n return result.data;\n};\n\n/** Find the nearest andesine.json. Only init can select a missing explicit file. */\nconst findProjectConfig = async <Schema extends z.ZodType>(\n cwd: string,\n schema: Schema,\n explicitPath?: string,\n allowMissingExplicit = false\n): Promise<{ path: string; value: z.output<Schema> } | undefined> => {\n let directory = path.resolve(cwd);\n\n if (explicitPath !== undefined) {\n const filePath = path.resolve(directory, explicitPath);\n const value = await readConfigFile(filePath, schema, allowMissingExplicit);\n\n return value === undefined ? undefined : { path: filePath, value };\n }\n\n while (true) {\n const filePath = path.join(directory, \"andesine.json\");\n const value = await readConfigFile(filePath, schema, true);\n const parent = path.dirname(directory);\n\n if (value !== undefined) return { path: filePath, value };\n if (parent === directory) return undefined;\n\n directory = parent;\n }\n};\n\nexport { readConfigFile, findProjectConfig };\n","import * as z from \"zod\";\n\nconst nonemptyString = z.string().trim().min(1);\nconst workspaceIDSchema = z\n .string()\n .regex(/^ws_[A-Za-z\\d]{1,22}$/, \"Expected a workspace ID (ws_…).\");\nconst sourceSchema = z.union([\n z.strictObject({\n kind: z.literal(\"published\"),\n channel: nonemptyString.max(50).default(\"published\")\n }),\n z.strictObject({\n kind: z.literal(\"published\"),\n snapshotID: z.string().regex(/^snp_[A-Za-z\\d]{1,22}$/)\n }),\n z.strictObject({ kind: z.literal(\"current\") })\n]);\nconst typesConfigSchema = z.strictObject({\n source: sourceSchema.default({ kind: \"published\", channel: \"published\" }),\n collections: z\n .array(z.union([nonemptyString, z.strictObject({ collectionSlugPath: nonemptyString })]))\n .default([])\n .describe(\n \"Collection IDs, name paths, or objects with collectionSlugPath; empty selects all accessible collections.\"\n ),\n output: nonemptyString\n .default(\"src/andesine.generated.ts\")\n .describe(\n \"Output path relative to andesine.json, or the working directory when no config is present.\"\n ),\n includeEntryIDs: z.boolean().default(false),\n includeEntryPaths: z.boolean().default(false),\n includeTree: z.boolean().default(false)\n});\nconst projectConfigSchema = z.strictObject({\n $schema: z.string().optional(),\n version: z.literal(1),\n baseURL: z\n .url()\n .optional()\n .describe(\n \"HTTP(S) API root, optionally including a deployment prefix. No credentials, query, or fragment.\"\n ),\n workspaceID: workspaceIDSchema.optional(),\n profile: nonemptyString.optional(),\n types: typesConfigSchema.optional()\n});\nconst profileSchema = z.strictObject({\n baseURL: z.url(),\n workspaceID: workspaceIDSchema.optional(),\n accountID: nonemptyString.optional(),\n credentialRef: nonemptyString.optional()\n});\nconst userConfigSchema = z.strictObject({\n version: z.literal(1),\n defaultProfile: nonemptyString.optional(),\n profiles: z.record(nonemptyString, profileSchema)\n});\n\ntype ProjectConfig = z.output<typeof projectConfigSchema>;\ntype TypesConfig = z.output<typeof typesConfigSchema>;\ntype UserProfile = z.output<typeof profileSchema>;\n\nexport { projectConfigSchema, typesConfigSchema, userConfigSchema, workspaceIDSchema };\nexport type { ProjectConfig, TypesConfig, UserProfile };\n","import { CLIError, exitCodes } from \"../errors\";\nimport { findProjectConfig, readConfigFile } from \"./files\";\nimport {\n projectConfigSchema,\n typesConfigSchema,\n userConfigSchema,\n workspaceIDSchema,\n type TypesConfig,\n type UserProfile\n} from \"./schema\";\nimport { homedir } from \"node:os\";\nimport path from \"node:path\";\n\ninterface GlobalOptions {\n config?: string;\n profile?: string;\n baseUrl?: string;\n workspace?: string;\n interactive?: boolean;\n}\n\ninterface ResolveConfigOptions {\n flags?: GlobalOptions;\n cwd?: string;\n env?: NodeJS.ProcessEnv;\n userConfigPath?: string;\n allowNewProfile?: boolean;\n allowMissingConfig?: boolean;\n}\n\ninterface ResolvedConfig {\n baseURL: string;\n workspaceID?: string;\n configPath?: string;\n profileName?: string;\n /** Only present when the selected profile belongs to the resolved API root. */\n profile?: UserProfile;\n types: TypesConfig;\n}\n\n/** Canonical instance identity includes the deployment prefix, not just its origin. */\nconst normalizeBaseURL = (value: string): string => {\n const message = \"baseURL must be an HTTP(S) URL without credentials, query, or fragment.\";\n let url: URL;\n\n try {\n url = new URL(value);\n } catch {\n throw new CLIError(message, exitCodes.usage);\n }\n\n const hasUnsupportedParts = url.username || url.password || url.search || url.hash;\n const isHTTP = url.protocol === \"http:\" || url.protocol === \"https:\";\n\n if (!isHTTP || hasUnsupportedParts) throw new CLIError(message, exitCodes.usage);\n\n return url.href.replace(/\\/+$/, \"\");\n};\n\n/** User metadata stays outside the project. This file must never contain tokens. */\nconst getUserConfigPath = (env: NodeJS.ProcessEnv): string => {\n const home = homedir();\n const defaultDirectory =\n process.platform === \"win32\"\n ? env.APPDATA || path.join(home, \"AppData\", \"Roaming\")\n : process.platform === \"darwin\"\n ? path.join(home, \"Library\", \"Application Support\")\n : path.join(home, \".config\");\n const directory = env.XDG_CONFIG_HOME || defaultDirectory;\n\n if (!path.isAbsolute(directory)) {\n throw new CLIError(\n \"The user configuration directory must be an absolute path.\",\n exitCodes.usage\n );\n }\n\n return path.join(directory, \"andesine\", \"profiles.json\");\n};\n\n/** Resolve flags > environment > project > selected profile > defaults, without credentials or I/O writes. */\nconst resolveConfig = async ({\n flags = {},\n cwd = process.cwd(),\n env = process.env,\n userConfigPath = getUserConfigPath(env),\n allowNewProfile = false,\n allowMissingConfig = false\n}: ResolveConfigOptions = {}): Promise<ResolvedConfig> => {\n const project = await findProjectConfig(\n cwd,\n projectConfigSchema,\n flags.config ?? env.ANDESINE_CONFIG,\n allowMissingConfig\n );\n const userConfig = await readConfigFile(userConfigPath, userConfigSchema, true);\n const profileName =\n flags.profile ?? env.ANDESINE_PROFILE ?? project?.value.profile ?? userConfig?.defaultProfile;\n const selectedProfile =\n profileName && userConfig && Object.hasOwn(userConfig.profiles, profileName)\n ? userConfig.profiles[profileName]\n : undefined;\n\n if (profileName !== undefined && !selectedProfile && !allowNewProfile) {\n throw new CLIError(\n \"The selected profile does not exist in the user configuration.\",\n exitCodes.usage\n );\n }\n\n const profileBaseURL = selectedProfile ? normalizeBaseURL(selectedProfile.baseURL) : undefined;\n const baseURL = normalizeBaseURL(\n flags.baseUrl ??\n env.ANDESINE_BASE_URL ??\n project?.value.baseURL ??\n profileBaseURL ??\n \"https://api.andesine.app\"\n );\n const profile =\n selectedProfile && profileBaseURL === baseURL ? { ...selectedProfile, baseURL } : undefined;\n const workspaceID =\n flags.workspace ??\n env.ANDESINE_WORKSPACE_ID ??\n project?.value.workspaceID ??\n profile?.workspaceID;\n const types = project?.value.types ?? typesConfigSchema.parse({});\n const outputDirectory = project ? path.dirname(project.path) : path.resolve(cwd);\n\n if (workspaceID !== undefined && !workspaceIDSchema.safeParse(workspaceID).success) {\n throw new CLIError(\"workspaceID must be a workspace ID (ws_…).\", exitCodes.usage);\n }\n\n return {\n baseURL,\n workspaceID,\n configPath: project?.path,\n profileName,\n profile,\n types: { ...types, output: path.resolve(outputDirectory, types.output) }\n };\n};\n\nexport { resolveConfig, normalizeBaseURL, getUserConfigPath };\nexport type { GlobalOptions, ResolvedConfig, ResolveConfigOptions };\n","import type { Writable } from \"node:stream\";\nimport { styleText } from \"node:util\";\nimport { intro, log, note, spinner } from \"@clack/prompts\";\nimport { CLIError } from \"./errors\";\n\n/** Wait for each write so commands can stream results without an unbounded queue. */\nconst writeOutput = (stream: Writable, text: string | Uint8Array): Promise<void> => {\n return new Promise((resolve, reject) => {\n // Writes with a callback can also emit an error event on the stream.\n stream.once(\"error\", reject);\n stream.write(text, (error) => {\n if (error) reject(error);\n else {\n stream.removeListener(\"error\", reject);\n resolve();\n }\n });\n });\n};\n\nconst serializeJSON = (value: unknown): string => {\n const serialized = JSON.stringify(value);\n\n if (serialized === undefined) throw new CLIError(\"The result is not a JSON value.\");\n\n return `${serialized}\\n`;\n};\n\n/** Data goes to stdout; prompts and diagnostics go to stderr. */\nconst createOutput = (interactive = true, signal?: AbortSignal) => {\n const terminal = Boolean(\n interactive && process.stderr.isTTY && !process.env.CI && process.env.TERM !== \"dumb\"\n );\n const options = { output: process.stderr, withGuide: true };\n const diagnostic = async (\n message: string,\n level: \"info\" | \"success\" | \"warn\" | \"error\" = \"info\"\n ) => {\n if (terminal) log[level](message, options);\n else await writeOutput(process.stderr, `${message}\\n`);\n };\n\n return {\n json: (value: unknown) => writeOutput(process.stdout, serializeJSON(value)),\n text: (value: string) => writeOutput(process.stdout, value),\n diagnostic: (message: string) => diagnostic(message),\n success: (message: string) => diagnostic(message, \"success\"),\n warning: (message: string) => diagnostic(message, \"warn\"),\n error: (message: string) => diagnostic(message, \"error\"),\n heading: async (title: string) => {\n if (terminal) intro(styleText([\"bold\", \"cyan\"], title, { stream: process.stderr }), options);\n else await writeOutput(process.stderr, `${title}\\n`);\n },\n note: async (title: string, fields: Record<string, string | undefined>) => {\n const lines = Object.entries(fields).flatMap(([label, value]) => {\n if (value === undefined) return [];\n\n if (!terminal) return [`${label}: ${value}`];\n\n return [\n `${styleText(\"bold\", `${label}:`, { stream: process.stderr })} ${styleText(\"cyan\", value, { stream: process.stderr })}`\n ];\n });\n\n if (terminal) note(lines.join(\"\\n\"), title, options);\n else await writeOutput(process.stderr, `${title}\\n${lines.join(\"\\n\")}\\n`);\n },\n /** Always release the spinner and its listeners before errors or later output. */\n progress: async <Value>(\n message: string,\n action: () => Promise<Value>,\n complete: string\n ): Promise<Value> => {\n const loader = terminal\n ? spinner({ ...options, signal, cancelMessage: \"Cancelled.\" })\n : undefined;\n\n signal?.throwIfAborted();\n\n if (loader) loader.start(message);\n else await diagnostic(message);\n\n try {\n const result = await action();\n\n loader?.stop(complete);\n return result;\n } finally {\n loader?.clear();\n }\n }\n };\n};\n\nexport { createOutput, writeOutput };\n","import { CancelledError, CLIError, exitCodes } from \"./errors\";\nimport { isCancel } from \"@clack/prompts\";\nimport type { Readable, Writable } from \"node:stream\";\n\ninterface PromptOptions {\n input: Readable;\n output: Writable;\n signal: AbortSignal;\n}\n\n/** Keep Clack on stderr and prevent prompts in CI, pipes, and explicit non-interactive mode. */\nconst canPrompt = (interactive = true) => {\n return Boolean(interactive && process.stdin.isTTY && process.stderr.isTTY && !process.env.CI);\n};\nconst createPrompt = (signal: AbortSignal, interactive = true) => {\n const enabled = canPrompt(interactive);\n\n return async <Value>(\n run: (options: PromptOptions) => Promise<Value | symbol>\n ): Promise<Value> => {\n signal.throwIfAborted();\n\n if (!enabled) {\n throw new CLIError(\n \"Input is required. Supply the command flags or run in an interactive terminal.\",\n exitCodes.usage\n );\n }\n\n const value = await run({ input: process.stdin, output: process.stderr, signal });\n\n signal.throwIfAborted();\n\n if (isCancel(value)) throw new CancelledError();\n\n return value as Value;\n };\n};\n\nexport { canPrompt, createPrompt };\n","import {\n resolveConfig,\n type GlobalOptions,\n type ResolvedConfig,\n type ResolveConfigOptions\n} from \"./config/resolve\";\nimport { createOutput } from \"./output\";\nimport { createPrompt } from \"./prompts\";\n\ninterface CommandContext {\n config: ResolvedConfig;\n signal: AbortSignal;\n output: ReturnType<typeof createOutput>;\n prompt: ReturnType<typeof createPrompt>;\n}\n\n/** Create context inside command actions so help and version never read configuration. */\nconst createCommandContext = async (\n flags: GlobalOptions,\n signal: AbortSignal,\n options: Pick<ResolveConfigOptions, \"allowNewProfile\" | \"allowMissingConfig\"> = {}\n): Promise<CommandContext> => {\n signal.throwIfAborted();\n\n const config = await resolveConfig({ flags, ...options });\n\n signal.throwIfAborted();\n\n return {\n config,\n signal,\n output: createOutput(flags.interactive, signal),\n prompt: createPrompt(signal, flags.interactive)\n };\n};\n\nexport { createCommandContext };\nexport type { CommandContext };\n","import * as z from \"zod\";\n\nconst credentialsSchema = z.object({\n version: z.literal(1),\n baseURL: z.string(),\n accountID: z.string(),\n accessToken: z.string().min(1),\n refreshToken: z.string().min(1),\n expiresAt: z.number().finite(),\n refreshPending: z.boolean().default(false)\n});\nconst tokenResponseSchema = z.object({\n access_token: z.string().min(1),\n refresh_token: z.string().min(1),\n token_type: z.string().refine((value) => value.toLowerCase() === \"bearer\"),\n expires_in: z.number().int().positive(),\n scope: z.string().optional()\n});\nconst deviceResponseSchema = z.object({\n device_code: z.string().min(1),\n user_code: z.string().regex(/^[A-HJ-NP-Z2-9]{8}$/),\n verification_uri: z.url(),\n verification_uri_complete: z.url().optional(),\n expires_in: z.number().int().positive(),\n interval: z.number().int().positive().default(5)\n});\n\ntype Credentials = z.output<typeof credentialsSchema>;\ntype TokenResponse = z.output<typeof tokenResponseSchema>;\ntype DeviceResponse = z.output<typeof deviceResponseSchema>;\ntype StorageKind = \"keyring\" | \"file\";\n\nexport { credentialsSchema, tokenResponseSchema, deviceResponseSchema };\nexport type { Credentials, TokenResponse, DeviceResponse, StorageKind };\n","import { CLIError } from \"../errors\";\nimport { getUserConfigPath } from \"../config/resolve\";\nimport { chmod, lstat, mkdir, open, rename, unlink } from \"node:fs/promises\";\nimport { randomUUID } from \"node:crypto\";\nimport { execFile } from \"node:child_process\";\nimport { promisify } from \"node:util\";\nimport path from \"node:path\";\n\nconst stateDirectory = () => path.dirname(getUserConfigPath(process.env));\nconst isMissing = (error: unknown) => (error as NodeJS.ErrnoException)?.code === \"ENOENT\";\n\n/** Create private CLI storage. Windows uses a protected ACL inherited by new files. */\nconst ensurePrivateDirectory = async (directory: string): Promise<void> => {\n await mkdir(directory, { recursive: true, mode: 0o700 });\n\n const info = await lstat(directory);\n\n if (!info.isDirectory() || info.isSymbolicLink()) {\n throw new CLIError(\"CLI storage must be a real directory.\");\n }\n\n if (process.platform !== \"win32\") {\n if (info.uid !== process.getuid?.()) {\n throw new CLIError(\"CLI storage must belong to the current user.\");\n }\n\n await chmod(directory, 0o700);\n return;\n }\n\n try {\n await promisify(execFile)(\n \"powershell.exe\",\n [\n \"-NoProfile\",\n \"-NonInteractive\",\n \"-Command\",\n `\n $ErrorActionPreference = 'Stop'\n $sid = [System.Security.Principal.WindowsIdentity]::GetCurrent().User\n $acl = New-Object System.Security.AccessControl.DirectorySecurity\n $acl.SetOwner($sid)\n $acl.SetAccessRuleProtection($true, $false)\n $rule = New-Object System.Security.AccessControl.FileSystemAccessRule($sid, 'FullControl', 'ContainerInherit,ObjectInherit', 'None', 'Allow')\n $acl.AddAccessRule($rule)\n Set-Acl -LiteralPath $env:ANDESINE_STORAGE_PATH -AclObject $acl\n `\n ],\n {\n env: { ...process.env, ANDESINE_STORAGE_PATH: directory },\n timeout: 10_000,\n windowsHide: true\n }\n );\n } catch {\n throw new CLIError(\"Cannot restrict CLI storage to the current Windows account.\");\n }\n};\n\n/** Write and sync a private temporary file before replacing the destination. */\nconst writePrivateJSON = async (file: string, value: unknown): Promise<void> => {\n const temporary = `${file}.${randomUUID()}.tmp`;\n\n await ensurePrivateDirectory(path.dirname(file));\n\n const handle = await open(temporary, \"wx\", 0o600);\n\n try {\n await handle.writeFile(`${JSON.stringify(value, null, 2)}\\n`, \"utf8\");\n await handle.sync();\n await handle.close();\n await rename(temporary, file);\n\n if (process.platform !== \"win32\") {\n const directory = await open(path.dirname(file), \"r\");\n try {\n await directory.sync();\n } finally {\n await directory.close();\n }\n }\n } finally {\n await handle.close();\n await unlink(temporary).catch((error: unknown) => {\n if (!isMissing(error)) throw error;\n });\n }\n};\n\nexport { stateDirectory, isMissing, ensurePrivateDirectory, writePrivateJSON };\n","import { credentialsSchema, type Credentials, type StorageKind } from \"../auth/schema\";\nimport { CLIError } from \"../errors\";\nimport { ensurePrivateDirectory, isMissing, stateDirectory, writePrivateJSON } from \"./files\";\nimport { constants } from \"node:fs\";\nimport { open, unlink } from \"node:fs/promises\";\nimport path from \"node:path\";\n\ninterface CredentialStore {\n get(): Promise<Credentials | undefined>;\n set(value: Credentials): Promise<void>;\n delete(): Promise<void>;\n}\n\nconst parseCredentials = (value: string): Credentials => {\n try {\n return credentialsSchema.parse(JSON.parse(value));\n } catch {\n throw new CLIError(\"Stored credentials are invalid. Run auth login again.\");\n }\n};\nconst credentialStore = async (\n reference: string,\n signal?: AbortSignal\n): Promise<CredentialStore> => {\n const match = /^(keyring|file):([a-f0-9-]{36})$/.exec(reference);\n\n if (!match) throw new CLIError(\"Invalid credential reference. Run auth login again.\");\n\n const kind = match[1] as StorageKind;\n const id = match[2];\n\n if (kind === \"keyring\") {\n try {\n const { AsyncEntry } = await import(\"@napi-rs/keyring\");\n const entry = new AsyncEntry(\"app.andesine.cli\", id, { linux: { store: \"secret-service\" } });\n const safely = async <Value>(\n run: (signal: AbortSignal) => Promise<Value>\n ): Promise<Value> => {\n try {\n return await run(\n AbortSignal.any([AbortSignal.timeout(15_000), ...(signal ? [signal] : [])])\n );\n } catch {\n throw new CLIError(\n \"The OS credential store is unavailable. Unlock it and try again, or use auth login --credential-store file.\"\n );\n }\n };\n\n return {\n get: async () => {\n const value = await safely((signal) => entry.getPassword(signal));\n return value === undefined ? undefined : parseCredentials(value);\n },\n set: (value) => safely((signal) => entry.setPassword(JSON.stringify(value), signal)),\n delete: async () => {\n await safely((signal) => entry.deletePassword(signal));\n }\n };\n } catch {\n throw new CLIError(\n \"The OS credential store is unavailable. Use auth login --credential-store file for explicit file storage.\"\n );\n }\n }\n\n const directory = path.join(stateDirectory(), \"credentials\");\n const file = path.join(directory, `${id}.json`);\n\n return {\n get: async () => {\n await ensurePrivateDirectory(directory);\n\n let handle;\n\n try {\n handle = await open(file, constants.O_RDONLY | (constants.O_NOFOLLOW || 0));\n const info = await handle.stat();\n const privateFile =\n process.platform === \"win32\" ||\n ((info.mode & 0o077) === 0 && info.uid === process.getuid?.());\n\n if (!info.isFile() || !privateFile) {\n throw new CLIError(\n \"Credential file permissions must allow only the current user (0600).\"\n );\n }\n\n return parseCredentials(await handle.readFile(\"utf8\"));\n } catch (error) {\n if (isMissing(error)) return undefined;\n\n if (error instanceof CLIError) throw error;\n throw new CLIError(\"Cannot read the credential file.\");\n } finally {\n await handle?.close();\n }\n },\n set: (value) => writePrivateJSON(file, value),\n delete: async () => {\n await unlink(file).catch((error: unknown) => {\n if (!isMissing(error)) throw new CLIError(\"Cannot remove the credential file.\");\n });\n }\n };\n};\n\nexport { credentialStore };\nexport type { CredentialStore };\n","import { CLIError } from \"../errors\";\nimport { ensurePrivateDirectory, stateDirectory } from \"./files\";\nimport { createHash } from \"node:crypto\";\nimport { setTimeout } from \"node:timers/promises\";\nimport path from \"node:path\";\nimport lockfile from \"proper-lockfile\";\n\n/** Serialize metadata updates and token rotation across CLI processes. */\nconst withStateLock = async <Value>(\n name: string,\n signal: AbortSignal,\n run: (assertOwned: () => void) => Promise<Value>\n): Promise<Value> => {\n const directory = path.join(stateDirectory(), \"locks\");\n const target = path.join(directory, createHash(\"sha256\").update(name).digest(\"hex\"));\n const deadline = Date.now() + 150_000;\n let compromised = false;\n let release: (() => Promise<void>) | undefined;\n\n await ensurePrivateDirectory(directory);\n\n while (!release) {\n signal.throwIfAborted();\n\n try {\n release = await lockfile.lock(target, {\n realpath: false,\n stale: 120_000,\n update: 10_000,\n onCompromised: () => {\n compromised = true;\n }\n });\n } catch (error) {\n if ((error as NodeJS.ErrnoException).code !== \"ELOCKED\") {\n throw new CLIError(\"Cannot lock CLI storage.\");\n }\n\n if (Date.now() >= deadline) {\n throw new CLIError(\"Another CLI process is using these credentials. Try again later.\");\n }\n\n await setTimeout(100, undefined, { signal });\n }\n }\n\n const assertOwned = () => {\n signal.throwIfAborted();\n if (compromised) {\n throw new CLIError(\"The credential lock was lost. Run auth status before retrying.\");\n }\n };\n\n try {\n assertOwned();\n return await run(assertOwned);\n } finally {\n await release().catch(() => {\n /* A compromised lock belongs to another process. */\n });\n }\n};\n\nexport { withStateLock };\n","import { readConfigFile } from \"../config/files\";\nimport { getUserConfigPath } from \"../config/resolve\";\nimport { userConfigSchema, type UserProfile } from \"../config/schema\";\nimport { CLIError } from \"../errors\";\nimport { writePrivateJSON } from \"./files\";\nimport { withStateLock } from \"./lock\";\n\n/** Compare before writing, so a concurrent login cannot replace an unseen profile. */\nconst saveProfile = async (\n name: string,\n profile: UserProfile,\n expected: UserProfile | undefined,\n signal: AbortSignal\n): Promise<void> => {\n await withStateLock(\"profiles\", signal, async (assertOwned) => {\n const file = getUserConfigPath(process.env);\n const config = (await readConfigFile(file, userConfigSchema, true)) || {\n version: 1 as const,\n profiles: {}\n };\n const previous = Object.hasOwn(config.profiles, name) ? config.profiles[name] : undefined;\n\n if (JSON.stringify(previous) !== JSON.stringify(expected)) {\n throw new CLIError(\n \"This profile changed during login. Retry with a different --profile name.\"\n );\n }\n\n assertOwned();\n await writePrivateJSON(file, {\n ...config,\n defaultProfile: config.defaultProfile || name,\n profiles: { ...config.profiles, [name]: profile }\n });\n });\n};\nconst clearProfileCredential = async (\n name: string,\n reference: string,\n signal: AbortSignal\n): Promise<void> => {\n await withStateLock(\"profiles\", signal, async (assertOwned) => {\n const file = getUserConfigPath(process.env);\n const config = await readConfigFile(file, userConfigSchema, true);\n const profile =\n config && Object.hasOwn(config.profiles, name) ? config.profiles[name] : undefined;\n\n if (!config || profile?.credentialRef !== reference) return;\n\n const { credentialRef: _, ...remaining } = profile;\n\n assertOwned();\n await writePrivateJSON(file, {\n ...config,\n profiles: { ...config.profiles, [name]: remaining }\n });\n });\n};\n\nexport { saveProfile, clearProfileCredential };\n","import { CLIError } from \"../errors\";\nimport { deviceResponseSchema, tokenResponseSchema, type TokenResponse } from \"./schema\";\nimport { setTimeout } from \"node:timers/promises\";\nimport type * as z from \"zod\";\n\nconst CLIENT_ID = \"andesine-cli\";\nconst SCOPES = \"andesine:api offline_access\";\nconst DEVICE_GRANT = \"urn:ietf:params:oauth:grant-type:device_code\";\n\nclass OAuthError extends CLIError {\n constructor(\n readonly code: string,\n readonly retryAfter = 0\n ) {\n super(\"The authorization request failed. Run auth login again.\");\n }\n}\n\n/** Send credentials only to this instance, in a form body, without redirects or retries. */\nconst oauthRequest = async (\n baseURL: string,\n endpoint: string,\n fields: Record<string, string>,\n signal: AbortSignal\n): Promise<unknown> => {\n let response: Response;\n\n try {\n response = await fetch(`${baseURL}/auth/${endpoint}`, {\n method: \"POST\",\n redirect: \"error\",\n headers: {\n \"content-type\": \"application/x-www-form-urlencoded\",\n \"accept\": \"application/json\"\n },\n body: new URLSearchParams({ client_id: CLIENT_ID, ...fields }),\n signal: AbortSignal.any([signal, AbortSignal.timeout(30_000)])\n });\n } catch {\n signal.throwIfAborted();\n throw new OAuthError(\"network_error\");\n }\n\n const body: unknown = await response.json().catch(() => undefined);\n\n if (!response.ok) {\n const code =\n body && typeof body === \"object\" && \"error\" in body && typeof body.error === \"string\"\n ? body.error\n : \"server_error\";\n const retryAfter = Number(response.headers.get(\"retry-after\"));\n\n throw new OAuthError(\n response.status === 429 ? \"slow_down\" : code,\n Number.isFinite(retryAfter) ? Math.max(retryAfter, 0) : 0\n );\n }\n\n return body;\n};\nconst parseResponse = <Schema extends z.ZodType>(\n schema: Schema,\n value: unknown\n): z.output<Schema> => {\n const result = schema.safeParse(value);\n\n if (!result.success) {\n throw new CLIError(\"The instance returned an invalid authorization response.\");\n }\n\n return result.data;\n};\nconst startDeviceLogin = async (baseURL: string, signal: AbortSignal) => {\n const device = parseResponse(\n deviceResponseSchema,\n await oauthRequest(baseURL, \"device/code\", { scope: SCOPES, resource: baseURL }, signal)\n );\n const verification = new URL(device.verification_uri);\n const complete = new URL(device.verification_uri_complete || device.verification_uri);\n const validProtocol =\n verification.protocol === \"https:\" ||\n (new URL(baseURL).protocol === \"http:\" && verification.protocol === \"http:\");\n const validDestination =\n validProtocol &&\n !verification.username &&\n !verification.password &&\n complete.origin === verification.origin &&\n complete.pathname === verification.pathname &&\n !complete.username &&\n !complete.password &&\n !complete.hash &&\n (!device.verification_uri_complete ||\n complete.searchParams.get(\"user_code\") === device.user_code);\n\n if (!validDestination) {\n throw new CLIError(\"The instance returned an invalid browser authorization URL.\");\n }\n\n return device;\n};\nconst pollDeviceLogin = async (\n baseURL: string,\n device: Awaited<ReturnType<typeof startDeviceLogin>>,\n expiresAt: number,\n signal: AbortSignal\n): Promise<TokenResponse> => {\n let interval = device.interval * 1000;\n\n while (Date.now() < expiresAt) {\n await setTimeout(Math.min(interval, Math.max(expiresAt - Date.now(), 0)), undefined, {\n signal\n });\n if (Date.now() >= expiresAt) break;\n\n try {\n return parseResponse(\n tokenResponseSchema,\n await oauthRequest(\n baseURL,\n \"oauth2/token\",\n {\n grant_type: DEVICE_GRANT,\n device_code: device.device_code,\n resource: baseURL\n },\n signal\n )\n );\n } catch (error) {\n if (!(error instanceof OAuthError)) throw error;\n\n if (error.code === \"authorization_pending\") continue;\n\n if (error.code === \"slow_down\") {\n interval = Math.max(interval + 5000, error.retryAfter * 1000);\n continue;\n }\n\n if (error.code === \"network_error\" || error.code === \"server_error\") {\n interval = Math.max(interval * 2, 5000);\n continue;\n }\n\n if (error.code === \"access_denied\") throw new CLIError(\"Login was denied in the browser.\");\n\n if (error.code === \"expired_token\") break;\n\n throw new CLIError(\"The login request is no longer valid. Run auth login again.\");\n }\n }\n\n throw new CLIError(\"The login code expired. Run auth login again.\");\n};\nconst refreshAccess = async (baseURL: string, refreshToken: string, signal: AbortSignal) => {\n return parseResponse(\n tokenResponseSchema,\n await oauthRequest(\n baseURL,\n \"oauth2/token\",\n {\n grant_type: \"refresh_token\",\n refresh_token: refreshToken,\n resource: baseURL\n },\n signal\n )\n );\n};\nconst revokeAccess = async (\n baseURL: string,\n refreshToken: string,\n signal: AbortSignal\n): Promise<void> => {\n await oauthRequest(\n baseURL,\n \"oauth2/revoke\",\n { token: refreshToken, token_type_hint: \"refresh_token\" },\n signal\n );\n};\n\nexport { startDeviceLogin, pollDeviceLogin, refreshAccess, revokeAccess };\n","import { createClient, AndesineAPIError } from \"@andesine/sdk\";\nimport type { CommandContext } from \"../context\";\nimport { CLIError } from \"../errors\";\nimport { credentialStore } from \"../storage/credentials\";\nimport { withStateLock } from \"../storage/lock\";\nimport { refreshAccess } from \"./oauth\";\n\n/** The saved OAuth access token of the selected profile, refreshed when it expires soon. */\nconst getAccessToken = async (context: CommandContext): Promise<string> => {\n const { config, signal } = context;\n const reference = config.profile?.credentialRef;\n\n if (!reference) {\n throw new CLIError(\n \"No credentials for this instance. Run andesine auth login or set ANDESINE_API_KEY.\"\n );\n }\n\n return withStateLock(reference, signal, async (assertOwned) => {\n const store = await credentialStore(reference, signal);\n const credentials = await store.get();\n\n if (!credentials) throw new CLIError(\"Saved credentials were not found. Run auth login again.\");\n\n if (\n credentials.baseURL !== config.baseURL ||\n credentials.accountID !== config.profile?.accountID\n ) {\n throw new CLIError(\n \"Saved credentials do not match this instance and account. Run auth login again.\"\n );\n }\n\n if (credentials.refreshPending) {\n throw new CLIError(\n \"The previous token exchange was interrupted. Run auth login again; the old refresh token will not be reused.\"\n );\n }\n\n if (credentials.expiresAt > Date.now() + 60_000) return credentials.accessToken;\n\n assertOwned();\n\n await store.set({ ...credentials, refreshPending: true });\n\n assertOwned();\n\n try {\n const startedAt = Date.now();\n const tokens = await refreshAccess(config.baseURL, credentials.refreshToken, signal);\n\n assertOwned();\n\n await store.set({\n ...credentials,\n accessToken: tokens.access_token,\n refreshToken: tokens.refresh_token,\n expiresAt: startedAt + tokens.expires_in * 1000,\n refreshPending: false\n });\n return tokens.access_token;\n } catch {\n signal.throwIfAborted();\n throw new CLIError(\n \"Could not complete the token exchange. Run auth login again; the previous refresh token will not be reused.\"\n );\n }\n });\n};\n/** Select one credential source explicitly; never fall back after an authentication error. */\nconst authenticatedClient = async (context: CommandContext) => {\n const { config, signal } = context;\n const apiKey = process.env.ANDESINE_API_KEY;\n const headers = config.workspaceID ? { \"x-workspace-id\": config.workspaceID } : undefined;\n const fetcher: typeof fetch = (input, init) =>\n fetch(input, {\n ...init,\n redirect: \"error\",\n signal: AbortSignal.any([\n signal,\n ...(init?.signal ? [init.signal] : []),\n ...(input instanceof Request ? [input.signal] : [])\n ])\n });\n\n if (apiKey !== undefined) {\n if (!apiKey.trim()) {\n throw new CLIError(\n \"ANDESINE_API_KEY is empty. Set it or remove it before using saved credentials.\"\n );\n }\n\n return {\n client: createClient({ baseURL: config.baseURL, apiKey, headers, fetch: fetcher }),\n source: \"environment\" as const\n };\n }\n\n const accessToken = await getAccessToken(context);\n const reference = config.profile!.credentialRef!;\n\n return {\n client: createClient({ baseURL: config.baseURL, accessToken, headers, fetch: fetcher }),\n source: reference.startsWith(\"file:\") ? (\"file\" as const) : (\"keyring\" as const)\n };\n};\n\n/** Do not expose server error bodies or retry a dispatched request during auth recovery. */\nconst identity = async (client: ReturnType<typeof createClient>, signal: AbortSignal) => {\n try {\n return await client.auth.getIdentity(undefined, { signal });\n } catch (error) {\n signal.throwIfAborted();\n if (error instanceof AndesineAPIError && (error.status === 401 || error.status === 403)) {\n throw new CLIError(\n \"The credential is not authorized. Check ANDESINE_API_KEY or run auth login again.\"\n );\n }\n throw new CLIError(\n \"Cannot verify this credential with the instance. Check the connection and base URL.\"\n );\n }\n};\n\nexport { authenticatedClient, getAccessToken, identity };\n","import type { CommandContext } from \"../context\";\nimport { CLIError, CancelledError } from \"../errors\";\nimport { credentialStore, type CredentialStore } from \"../storage/credentials\";\nimport { readConfigFile } from \"../config/files\";\nimport { getUserConfigPath, normalizeBaseURL } from \"../config/resolve\";\nimport { userConfigSchema } from \"../config/schema\";\nimport { saveProfile } from \"../storage/profiles\";\nimport { withStateLock } from \"../storage/lock\";\nimport { startDeviceLogin, pollDeviceLogin, revokeAccess } from \"./oauth\";\nimport { identity } from \"./client\";\nimport type { Credentials, StorageKind } from \"./schema\";\nimport { createClient } from \"@andesine/sdk\";\nimport { confirm } from \"@clack/prompts\";\nimport { randomUUID } from \"node:crypto\";\nimport openBrowser from \"open\";\n\ninterface LoginOptions {\n browser: boolean;\n credentialStore?: StorageKind;\n}\ninterface LoginStore {\n reference: string;\n store: CredentialStore;\n}\n\nconst prepareStore = async (context: CommandContext, kind: StorageKind): Promise<LoginStore> => {\n const reference = `${kind}:${randomUUID()}`;\n const store = await credentialStore(reference, context.signal);\n\n // Check write access before the user grants access in the browser.\n await store.set({\n version: 1,\n baseURL: context.config.baseURL,\n accountID: \"probe\",\n accessToken: \"probe\",\n refreshToken: \"probe\",\n expiresAt: 0,\n refreshPending: false\n });\n await store.delete();\n context.signal.throwIfAborted();\n return { reference, store };\n};\nconst selectStore = async (\n context: CommandContext,\n selected?: StorageKind\n): Promise<LoginStore> => {\n try {\n return await prepareStore(context, selected || \"keyring\");\n } catch (error) {\n context.signal.throwIfAborted();\n if (selected) throw error;\n\n await context.output.warning(\n \"The OS credential store is unavailable. File storage keeps unencrypted tokens in a file restricted to your user. Use --credential-store file to select it explicitly.\"\n );\n const accepted = await context.prompt((options) =>\n confirm({\n ...options,\n message: \"Use private file storage for this login?\",\n initialValue: false\n })\n );\n\n if (!accepted) throw new CancelledError();\n return prepareStore(context, \"file\");\n }\n};\n\n/** Grant approval stays in the browser; the CLI only polls the provider and saves its tokens. */\nconst login = async (\n context: CommandContext,\n options: LoginOptions,\n reportResult = true\n): Promise<void> => {\n const { config, signal, output } = context;\n const name = config.profileName || \"default\";\n const profiles = await readConfigFile(getUserConfigPath(process.env), userConfigSchema, true);\n const existing =\n profiles && Object.hasOwn(profiles.profiles, name) ? profiles.profiles[name] : undefined;\n\n if (existing && normalizeBaseURL(existing.baseURL) !== config.baseURL) {\n throw new CLIError(\n \"This profile belongs to another instance. Use --profile with a new name for this login.\"\n );\n }\n\n await output.heading(\"Andesine · Sign in\");\n await output.note(\"Login\", { Instance: config.baseURL, Profile: name });\n\n const storage = await selectStore(context, options.credentialStore);\n const device = await output.progress(\n \"Requesting a login code\",\n () => startDeviceLogin(config.baseURL, signal),\n \"Login code ready\"\n );\n const expiresAt = Date.now() + device.expires_in * 1000;\n\n await output.note(\"Authorize in your browser\", {\n Open: device.verification_uri,\n Code: device.user_code\n });\n await output.diagnostic(\"Approve access in your browser. Press Ctrl+C to cancel.\");\n\n if (options.browser) {\n try {\n signal.throwIfAborted();\n await openBrowser(device.verification_uri_complete || device.verification_uri, {\n wait: false\n });\n } catch {\n signal.throwIfAborted();\n await output.warning(\"Could not open a browser. Open the URL above and enter the code.\");\n }\n }\n\n const tokens = await output.progress(\n \"Waiting for browser approval\",\n () => pollDeviceLogin(config.baseURL, device, expiresAt, signal),\n \"Browser approval received\"\n );\n const tokenReceivedAt = Date.now();\n let saved = false;\n\n try {\n const client = createClient({\n baseURL: config.baseURL,\n accessToken: tokens.access_token,\n fetch: (input, init) => fetch(input, { ...init, redirect: \"error\" })\n });\n const account = await output.progress(\n \"Verifying your account\",\n () => identity(client, signal),\n \"Account verified\"\n );\n\n if (account.type !== \"oauth\") {\n throw new CLIError(\"The instance did not return an OAuth user identity.\");\n }\n\n const credentials: Credentials = {\n version: 1,\n baseURL: config.baseURL,\n accountID: account.user.id,\n accessToken: tokens.access_token,\n refreshToken: tokens.refresh_token,\n expiresAt: tokenReceivedAt + tokens.expires_in * 1000,\n refreshPending: false\n };\n const commit = async () => {\n signal.throwIfAborted();\n await storage.store.set(credentials);\n await saveProfile(\n name,\n {\n baseURL: config.baseURL,\n accountID: account.user.id,\n credentialRef: storage.reference,\n ...(config.workspaceID ? { workspaceID: config.workspaceID } : {})\n },\n config.profile,\n signal\n );\n saved = true;\n };\n const previousRef = config.profile?.credentialRef;\n\n if (previousRef) {\n await withStateLock(previousRef, signal, async (assertOwned) => {\n assertOwned();\n await commit();\n try {\n const previousStore = await credentialStore(previousRef, signal);\n const previous = await previousStore.get();\n\n if (previous?.refreshPending) {\n await output.warning(\n \"The previous token exchange was interrupted; its server grant may remain active.\"\n );\n } else if (previous) {\n if (\n previous.baseURL !== config.baseURL ||\n previous.accountID !== config.profile?.accountID\n ) {\n throw new CLIError(\"The previous credential does not match this account.\");\n }\n await revokeAccess(config.baseURL, previous.refreshToken, signal);\n }\n await previousStore.delete();\n } catch {\n await output.warning(\n \"New login saved. Could not fully remove the previous login; its server credentials may remain active.\"\n );\n }\n });\n } else {\n await commit();\n }\n\n await output.success(`Signed in as ${account.user.email}. Saved profile: ${name}.`);\n if (process.env.ANDESINE_API_KEY !== undefined) {\n await output.warning(\n \"ANDESINE_API_KEY is set and will still take precedence for API requests.\"\n );\n }\n\n if (reportResult) {\n await output.json({\n authenticated: true,\n profile: name,\n baseURL: config.baseURL,\n account: account.user,\n workspaceID: config.workspaceID ?? null,\n credentialSource: storage.reference.split(\":\")[0]\n });\n }\n } finally {\n if (!saved) {\n await revokeAccess(config.baseURL, tokens.refresh_token, AbortSignal.timeout(10_000)).catch(\n async () => {\n await output.warning(\n \"Login was not saved, and token revocation could not be confirmed. The server grant may remain active.\"\n );\n }\n );\n await credentialStore(storage.reference)\n .then((store) => store.delete())\n .catch(async () => {\n await output.warning(\"Could not remove the incomplete login from credential storage.\");\n });\n }\n }\n};\n\nexport { login };\nexport type { LoginOptions };\n","import type { CommandContext } from \"../context\";\nimport { CLIError } from \"../errors\";\nimport { credentialStore } from \"../storage/credentials\";\nimport { clearProfileCredential } from \"../storage/profiles\";\nimport { withStateLock } from \"../storage/lock\";\nimport { revokeAccess } from \"./oauth\";\n\n/** Remove this profile's credentials and report remote revocation separately. */\nconst logout = async (context: CommandContext): Promise<void> => {\n const { config, signal, output } = context;\n const reference = config.profile?.credentialRef;\n\n await output.heading(\"Andesine · Sign out\");\n\n if (process.env.ANDESINE_API_KEY !== undefined) {\n await output.warning(\n \"ANDESINE_API_KEY is unchanged. Remove it from your environment to stop using that API key.\"\n );\n }\n\n if (!reference || !config.profileName) {\n await output.diagnostic(\"No saved login for this profile.\");\n await output.json({ loggedOut: true, localRemoved: false, revocation: \"not-applicable\" });\n return;\n }\n\n const revoked = await output.progress(\n \"Signing out\",\n () =>\n withStateLock(reference, signal, async (assertOwned) => {\n const store = await credentialStore(reference, signal);\n const credentials = await store.get();\n let revoked = false;\n\n if (\n credentials &&\n (credentials.baseURL !== config.baseURL ||\n credentials.accountID !== config.profile?.accountID)\n ) {\n throw new CLIError(\"Stored credentials do not match the selected instance and account.\");\n }\n\n if (credentials && !credentials.refreshPending) {\n try {\n await revokeAccess(config.baseURL, credentials.refreshToken, signal);\n revoked = true;\n } catch {\n signal.throwIfAborted();\n }\n }\n\n assertOwned();\n await store.delete();\n await clearProfileCredential(config.profileName!, reference, signal);\n return revoked;\n }),\n \"Local credentials removed\"\n );\n\n await output.json({\n loggedOut: true,\n localRemoved: true,\n revocation: revoked ? \"confirmed\" : \"unconfirmed\"\n });\n await output.diagnostic(\n \"Local credentials removed. Access tokens from earlier rotations may remain valid for up to 15 minutes.\"\n );\n\n if (!revoked) {\n throw new CLIError(\n \"Server revocation could not be confirmed. The server grant may remain active.\"\n );\n }\n\n await output.success(\"Signed out. Server revocation confirmed.\");\n};\n\nexport { logout };\n","import type { CommandContext } from \"../context\";\nimport { authenticatedClient, identity } from \"./client\";\n\n/** Verify the selected credential online; output identity metadata only. */\nconst status = async (context: CommandContext): Promise<void> => {\n const { output } = context;\n\n await output.heading(\"Andesine · Authentication\");\n\n const { account, source } = await output.progress(\n \"Checking authentication\",\n async () => {\n const { client, source } = await authenticatedClient(context);\n const account = await identity(client, context.signal);\n\n return { account, source };\n },\n \"Authentication verified\"\n );\n\n await output.note(\"Authenticated\", {\n \"Instance\": context.config.baseURL,\n \"Account\": account.type === \"key\" ? undefined : account.user.email,\n \"API key\": account.type === \"key\" ? account.keyID : undefined,\n \"Profile\": source === \"environment\" ? undefined : context.config.profileName,\n \"Credentials\": source,\n \"Workspace\": account.type === \"key\" ? account.workspaceID : context.config.workspaceID\n });\n\n await context.output.json({\n authenticated: true,\n baseURL: context.config.baseURL,\n profile: source === \"environment\" ? null : context.config.profileName,\n credentialSource: source,\n account: account.type === \"key\" ? null : account.user,\n keyID: account.type === \"key\" ? account.keyID : undefined,\n workspaceID: account.type === \"key\" ? account.workspaceID : (context.config.workspaceID ?? null)\n });\n};\n\nexport { status };\n","import { paginate, type AndesineClient } from \"@andesine/sdk\";\nimport type { TypesConfig } from \"../config/schema\";\n\ninterface CollectionChoice {\n id: string;\n path: string;\n slugPath: string;\n}\n\n/** Read selectable collections from one published snapshot, or the current tree. */\nconst listCollections = async (\n client: AndesineClient,\n source: TypesConfig[\"source\"],\n signal: AbortSignal\n): Promise<CollectionChoice[]> => {\n const collections: CollectionChoice[] = [];\n\n if (source.kind === \"published\") {\n const { kind: _, ...selector } = source;\n\n for await (const collection of client.content.paginateCollections(selector, { signal })) {\n collections.push(collection);\n }\n } else {\n const queue: Array<string | undefined> = [undefined];\n const seen = new Set<string>();\n\n for (const collectionID of queue) {\n const scope = collectionID ? { collectionID } : {};\n\n for await (const collection of paginate((cursor) =>\n client.collections.list({ ...scope, cursor, limit: 100 }, { signal })\n )) {\n if (seen.has(collection.id)) continue;\n\n seen.add(collection.id);\n collections.push(collection);\n queue.push(collection.id);\n }\n }\n }\n\n return collections.sort((a, b) => a.path.localeCompare(b.path));\n};\n\n/** Let the public API resolve IDs and paths, including collection-ID anchors. */\nconst validateCollections = async (\n client: AndesineClient,\n source: TypesConfig[\"source\"],\n selectors: TypesConfig[\"collections\"],\n signal: AbortSignal\n): Promise<void> => {\n let snapshotID =\n source.kind === \"published\" && \"snapshotID\" in source ? source.snapshotID : undefined;\n\n for (const selector of selectors.length ? selectors : [undefined]) {\n const scope =\n selector === undefined\n ? {}\n : typeof selector !== \"string\"\n ? selector\n : /^coll_[A-Za-z\\d]+$/.test(selector)\n ? { collectionID: selector }\n : { collectionPath: selector };\n\n if (source.kind === \"current\") {\n await client.collections.list({ ...scope, limit: 1 }, { signal });\n } else {\n const publication = snapshotID\n ? { snapshotID }\n : { channel: \"channel\" in source ? source.channel : undefined };\n const page = await client.content.listCollections(\n { ...scope, ...publication, limit: 1 },\n { signal }\n );\n\n snapshotID = page.snapshotID;\n }\n }\n};\n\nexport { listCollections, validateCollections };\nexport type { CollectionChoice };\n","import type { ResolvedConfig } from \"../config/resolve\";\nimport { typesConfigSchema, type TypesConfig } from \"../config/schema\";\nimport { CLIError, exitCodes } from \"../errors\";\nimport path from \"node:path\";\n\ninterface TypeOptions {\n source?: \"published\" | \"current\";\n channel?: string;\n snapshot?: string;\n collection?: string[];\n collectionSlugPath?: string[];\n allCollections?: boolean;\n output?: string;\n includeEntryIds?: boolean;\n includeEntryPaths?: boolean;\n includeTree?: boolean;\n}\ninterface GenerateOptions extends TypeOptions {\n check?: boolean;\n watch?: boolean;\n force?: boolean;\n interval?: string;\n}\n\nconst validateTypeOptions = (options: TypeOptions): void => {\n const invalidSource =\n (options.channel !== undefined && options.snapshot !== undefined) ||\n (options.source === \"current\" &&\n (options.channel !== undefined || options.snapshot !== undefined));\n\n if (invalidSource) {\n throw new CLIError(\n \"Use --channel or --snapshot for published content; neither can be used with --source current.\",\n exitCodes.usage\n );\n }\n\n if (options.allCollections && (options.collection || options.collectionSlugPath)) {\n throw new CLIError(\"Use collection selectors or --all-collections, not both.\", exitCodes.usage);\n }\n};\n\n/** Apply command overrides without changing the saved configuration. */\nconst collectionSelectors = (\n options: TypeOptions,\n initial: TypesConfig[\"collections\"]\n): TypesConfig[\"collections\"] => {\n if (options.allCollections) return [];\n if (options.collection === undefined && options.collectionSlugPath === undefined) return initial;\n\n return [\n ...(options.collection ?? []),\n ...(options.collectionSlugPath ?? []).map((collectionSlugPath) => ({ collectionSlugPath }))\n ];\n};\nconst resolveTypes = (config: ResolvedConfig, options: TypeOptions): TypesConfig => {\n const initial = config.types;\n const directory = config.configPath ? path.dirname(config.configPath) : process.cwd();\n let source = initial.source;\n\n validateTypeOptions(options);\n\n if (options.source === \"current\") {\n source = { kind: \"current\" };\n } else if (options.snapshot !== undefined) {\n source = { kind: \"published\", snapshotID: options.snapshot };\n } else if (options.source === \"published\" || options.channel !== undefined) {\n const previousChannel =\n initial.source.kind === \"published\" && \"channel\" in initial.source\n ? initial.source.channel\n : \"published\";\n\n source = { kind: \"published\", channel: options.channel ?? previousChannel };\n }\n\n const parsed = typesConfigSchema.safeParse({\n ...initial,\n source,\n collections: collectionSelectors(options, initial.collections),\n output: options.output ?? initial.output,\n includeEntryIDs: options.includeEntryIds ?? initial.includeEntryIDs,\n includeEntryPaths: options.includeEntryPaths ?? initial.includeEntryPaths,\n includeTree: options.includeTree ?? initial.includeTree\n });\n\n if (!parsed.success) {\n throw new CLIError(\n \"Invalid type options. Check the source, collection selectors, and output path.\",\n exitCodes.usage\n );\n }\n\n const output = path.resolve(directory, parsed.data.output);\n\n if (!/\\.(?:ts|mts|cts)$/.test(output) || output === config.configPath) {\n throw new CLIError(\n \"The types output must be a TypeScript file, separate from the configuration.\",\n exitCodes.usage\n );\n }\n\n return { ...parsed.data, collections: [...new Set(parsed.data.collections)], output };\n};\n\nexport { resolveTypes, validateTypeOptions, collectionSelectors };\nexport type { TypeOptions, GenerateOptions };\n","import { collectionSelectors } from \"../types/options\";\nimport { multiselect, select, text, confirm } from \"@clack/prompts\";\nimport type { AndesineClient } from \"@andesine/sdk\";\nimport type { CommandContext } from \"../context\";\nimport type { TypesConfig } from \"../config/schema\";\nimport { typesConfigSchema } from \"../config/schema\";\nimport { canPrompt } from \"../prompts\";\nimport { CLIError, exitCodes } from \"../errors\";\nimport { listCollections } from \"../content/collections\";\nimport type { InitOptions } from \"./options\";\n\ntype SourceMode = \"published\" | \"current\" | \"snapshot\";\n\nconst selectSource = async (\n context: CommandContext,\n client: AndesineClient,\n options: InitOptions,\n initial: TypesConfig[\"source\"]\n): Promise<TypesConfig[\"source\"]> => {\n const interactive = canPrompt(options.interactive);\n const initialMode =\n initial.kind === \"current\" ? \"current\" : \"snapshotID\" in initial ? \"snapshot\" : \"published\";\n const explicit =\n options.source !== undefined || options.channel !== undefined || options.snapshot !== undefined;\n let mode: SourceMode = initialMode;\n\n if (explicit) {\n mode = options.snapshot !== undefined ? \"snapshot\" : (options.source ?? \"published\");\n } else if (interactive) {\n mode = await context.prompt((prompt) =>\n select({\n ...prompt,\n message: \"Which content should types describe?\",\n initialValue: initialMode,\n options: [\n {\n value: \"published\",\n label: \"Published channel\",\n hint: \"Default; follows each publication\"\n },\n {\n value: \"current\",\n label: \"Current content\",\n hint: \"Includes unpublished schema changes\"\n },\n { value: \"snapshot\", label: \"Fixed published snapshot\" }\n ]\n })\n );\n }\n\n if (mode === \"current\") return { kind: \"current\" };\n\n if (mode === \"snapshot\") {\n const initialSnapshot =\n initial.kind === \"published\" && \"snapshotID\" in initial ? initial.snapshotID : \"\";\n const snapshotID =\n options.snapshot ??\n (interactive\n ? await context.prompt((prompt) =>\n text({\n ...prompt,\n message: \"Snapshot ID\",\n initialValue: initialSnapshot,\n validate: (value) =>\n /^snp_[A-Za-z\\d]{1,22}$/.test(value ?? \"\")\n ? undefined\n : \"Enter a snapshot ID (snp_…).\"\n })\n )\n : initialSnapshot);\n\n return { kind: \"published\", snapshotID };\n }\n\n const initialChannel =\n initial.kind === \"published\" && \"channel\" in initial ? initial.channel : \"published\";\n\n if (options.channel !== undefined || !interactive) {\n return { kind: \"published\", channel: options.channel ?? initialChannel };\n }\n\n const channels = await context.output.progress(\n \"Loading publishing channels\",\n () => client.publishing.listChannels({}, { signal: context.signal }),\n \"Publishing channels loaded\"\n );\n\n if (!channels.length) {\n throw new CLIError(\n \"No publishing channels are available. Select --source current or create a channel in Andesine.\"\n );\n }\n\n const channel = await context.prompt((prompt) =>\n select({\n ...prompt,\n message: \"Publishing channel\",\n initialValue: channels.some((item) => item.code === initialChannel)\n ? initialChannel\n : undefined,\n options: channels.map((item) => ({ value: item.code, label: item.name, hint: item.code }))\n })\n );\n\n return { kind: \"published\", channel };\n};\n\nconst selectTypes = async (\n context: CommandContext,\n client: AndesineClient,\n options: InitOptions,\n initial: TypesConfig\n): Promise<TypesConfig> => {\n const interactive = canPrompt(options.interactive);\n const source = await selectSource(context, client, options, initial.source);\n let collections = collectionSelectors(options, initial.collections);\n let output = options.output ?? initial.output;\n let includeEntryIDs = options.includeEntryIds ?? initial.includeEntryIDs;\n let includeEntryPaths = options.includeEntryPaths ?? initial.includeEntryPaths;\n let includeTree = options.includeTree ?? initial.includeTree;\n\n if (\n interactive &&\n options.collection === undefined &&\n options.collectionSlugPath === undefined &&\n !options.allCollections\n ) {\n const change =\n !collections.length ||\n (await context.prompt((prompt) =>\n confirm({\n ...prompt,\n message: \"Change the saved collection selection?\",\n initialValue: false\n })\n ));\n\n if (change) {\n const available = await context.output.progress(\n \"Loading collections\",\n () => listCollections(client, source, context.signal),\n \"Collections loaded\"\n );\n\n if (available.length) {\n const format = await context.prompt((prompt) =>\n select({\n ...prompt,\n message: \"How should collections be saved?\",\n options: [\n { value: \"id\", label: \"IDs\", hint: \"Stable when collections are renamed\" },\n { value: \"path\", label: \"Paths\", hint: \"Readable names from the explorer\" },\n { value: \"slug\", label: \"Slug paths\", hint: \"URL paths derived from names\" }\n ]\n })\n );\n const selected = await context.prompt((prompt) =>\n multiselect({\n ...prompt,\n message: \"Collections (leave empty for all)\",\n required: false,\n initialValues: available\n .filter((item) =>\n collections.some((selector) =>\n typeof selector === \"string\"\n ? selector === item.id || selector === item.path\n : selector.collectionSlugPath === item.slugPath\n )\n )\n .map((item) => item.id),\n options: available.map((item) => ({ value: item.id, label: item.path, hint: item.id }))\n })\n );\n\n collections = available\n .filter((item) => selected.includes(item.id))\n .map((item) =>\n format === \"id\"\n ? item.id\n : format === \"slug\"\n ? { collectionSlugPath: item.slugPath }\n : item.path\n );\n } else {\n collections = [];\n await context.output.diagnostic(\n \"No collections yet. The configuration will include all collections as they become available.\"\n );\n }\n }\n }\n\n if (interactive && options.output === undefined) {\n output = await context.prompt((prompt) =>\n text({\n ...prompt,\n message: \"Generated types file (relative to the configuration)\",\n initialValue: output,\n validate: (value) => (value?.trim() ? undefined : \"Enter an output path.\")\n })\n );\n }\n\n const explicitIncludes =\n options.includeEntryIds !== undefined ||\n options.includeEntryPaths !== undefined ||\n options.includeTree !== undefined;\n\n if (interactive && !explicitIncludes) {\n const extras = await context.prompt((prompt) =>\n multiselect({\n ...prompt,\n message: \"Optional generated types\",\n required: false,\n initialValues: [\n includeEntryIDs ? \"ids\" : \"\",\n includeEntryPaths ? \"paths\" : \"\",\n includeTree ? \"tree\" : \"\"\n ].filter(Boolean),\n options: [\n { value: \"ids\", label: \"Entry IDs\" },\n { value: \"paths\", label: \"Entry paths\" },\n { value: \"tree\", label: \"Exact tree structure\" }\n ]\n })\n );\n\n includeEntryIDs = extras.includes(\"ids\");\n includeEntryPaths = extras.includes(\"paths\");\n includeTree = extras.includes(\"tree\");\n }\n\n const parsed = typesConfigSchema.safeParse({\n source,\n collections: [...new Set(collections)],\n output,\n includeEntryIDs,\n includeEntryPaths,\n includeTree\n });\n\n if (!parsed.success) {\n throw new CLIError(\n \"Invalid type configuration. Check the source, collection selectors, and output path.\",\n exitCodes.usage\n );\n }\n\n return parsed.data;\n};\n\nexport { selectTypes };\n","import { CLIError, exitCodes } from \"../errors\";\nimport type { ProjectConfig } from \"../config/schema\";\nimport { randomUUID } from \"node:crypto\";\nimport { link, lstat, mkdir, readFile, rename, unlink, writeFile } from \"node:fs/promises\";\nimport path from \"node:path\";\nimport lockfile from \"proper-lockfile\";\n\nconst readProjectFile = async (file: string): Promise<string | undefined> => {\n try {\n const info = await lstat(file);\n\n if (!info.isFile() || info.isSymbolicLink()) {\n throw new CLIError(\n \"The project configuration must be a regular file, not a link.\",\n exitCodes.usage\n );\n }\n\n return await readFile(file, \"utf8\");\n } catch (error) {\n if ((error as NodeJS.ErrnoException).code === \"ENOENT\") return undefined;\n\n throw error;\n }\n};\n\n/** Recheck the reviewed file under a lock, then replace it with complete JSON. */\nconst writeProjectConfig = async (\n file: string,\n config: ProjectConfig,\n expected: string | undefined,\n signal: AbortSignal\n): Promise<void> => {\n const temporary = `${file}.${randomUUID()}.tmp`;\n let compromised = false;\n\n signal.throwIfAborted();\n await mkdir(path.dirname(file), { recursive: true });\n\n const release = await lockfile.lock(file, {\n realpath: false,\n onCompromised: () => {\n compromised = true;\n }\n });\n\n try {\n if ((await readProjectFile(file)) !== expected) {\n throw new CLIError(\"The project configuration changed during setup. Run init again.\");\n }\n\n const info = expected === undefined ? undefined : await lstat(file);\n\n await writeFile(temporary, `${JSON.stringify(config, null, 2)}\\n`, {\n flag: \"wx\",\n mode: info?.mode ?? 0o644\n });\n signal.throwIfAborted();\n\n if (compromised) throw new CLIError(\"The configuration lock was lost. Run init again.\");\n\n if (expected === undefined) {\n await link(temporary, file);\n } else {\n if ((await readProjectFile(file)) !== expected) {\n throw new CLIError(\"The project configuration changed during setup. Run init again.\");\n }\n\n await rename(temporary, file);\n }\n } finally {\n try {\n await unlink(temporary).catch((error: NodeJS.ErrnoException) => {\n if (error.code !== \"ENOENT\") throw error;\n });\n } finally {\n await release().catch((error: unknown) => {\n if (!compromised) throw error;\n });\n }\n }\n};\n\nexport { readProjectFile, writeProjectConfig };\n","import { AndesineAPIError, AndesineStreamProtocolError } from \"@andesine/sdk\";\nimport type { CommandContext } from \"../context\";\nimport { CLIError } from \"../errors\";\n\n/** Keep structured API failures on stderr without exposing response bodies or credentials. */\nconst reportAPIError = async (context: CommandContext, error: unknown): Promise<never> => {\n context.signal.throwIfAborted();\n\n if (error instanceof AndesineAPIError || error instanceof AndesineStreamProtocolError) {\n const response = error.response;\n const details =\n error instanceof AndesineAPIError\n ? {\n status: error.status,\n data: error.defined ? error.data : undefined,\n hints: error.hints\n }\n : {};\n\n await context.output.diagnostic(\n JSON.stringify({\n error: {\n code: error.code,\n message: error.message,\n ...details,\n requestID: response.headers.get(\"x-request-id\") ?? undefined,\n retryAfter: response.headers.get(\"retry-after\") ?? undefined\n }\n })\n );\n\n const missingCapability = error instanceof AndesineAPIError && error.status === 501;\n\n throw new CLIError(\n missingCapability\n ? `${error.message} This server may not support the operation. Check its capabilities and version.`\n : error.message\n );\n }\n\n throw error;\n};\n\nexport { reportAPIError };\n","import { createHash } from \"node:crypto\";\n\ninterface NamedItem {\n key: string;\n label: string;\n}\n\nconst compare = (left: string, right: string): number => (left < right ? -1 : left > right ? 1 : 0);\nconst json = (value: unknown): string =>\n JSON.stringify(value)\n .replace(/\\u2028/g, \"\\\\u2028\")\n .replace(/\\u2029/g, \"\\\\u2029\");\nconst literal = (value: string | null): string => json(value);\nconst union = (values: string[]): string =>\n [...new Set(values)].sort(compare).join(\" | \") || \"never\";\nconst tuple = (values: string[]): string => `[${values.join(\", \")}]`;\nconst hash = (value: string): string => createHash(\"sha256\").update(value).digest(\"hex\");\nconst identifier = (label: string): string => {\n const words = label.normalize(\"NFKC\").match(/[\\p{L}\\p{N}\\p{M}]+/gu) ?? [];\n const name = words\n .map((word) => {\n const [first, ...rest] = Array.from(word);\n\n return first.toUpperCase() + rest.join(\"\");\n })\n .join(\"\")\n .replace(/[^\\p{ID_Continue}]/gu, \"\");\n\n return /^[\\p{ID_Start}]/u.test(name) ? name : `_${name || \"Unnamed\"}`;\n};\n\n/** Allocate stable identifiers without using remote text as TypeScript syntax. */\nconst names = (items: NamedItem[], suffix: string): Map<string, string> => {\n const counts = new Map<string, number>();\n const result = new Map<string, string>();\n const used = new Set<string>();\n const sorted = [...items].sort((a, b) => compare(a.key, b.key));\n\n for (const item of sorted) {\n const base = `${identifier(item.label)}${suffix}`;\n\n counts.set(base, (counts.get(base) ?? 0) + 1);\n }\n\n for (const item of sorted) {\n const base = `${identifier(item.label)}${suffix}`;\n const digest = hash(item.key);\n\n let name = counts.get(base) === 1 ? base : `${base}_${digest.slice(0, 8)}`;\n let length = 8;\n\n while (used.has(name)) {\n length += 4;\n name = `${base}_${digest.slice(0, length)}`;\n }\n\n used.add(name);\n result.set(item.key, name);\n }\n\n return result;\n};\n\nexport { compare, json, literal, union, tuple, hash, names };\n","import type { SchemaField, SchemaProperty, SchemaRevision } from \"@andesine/sdk\";\nimport { compare, literal, union } from \"./source\";\n\n/** Match the API's derived field keys, including Unicode and empty-label fallbacks. */\nconst fieldKey = (field: SchemaField): string => {\n const fallback = field.kind === \"fragment\" ? \"content\" : \"property\";\n const source = Array.from(field.label.normalize(\"NFC\").trim()).slice(0, 50).join(\"\");\n const words = (source || fallback)\n .normalize(\"NFKC\")\n .replace(/([\\p{Ll}\\p{N}])(\\p{Lu})/gu, \"$1 $2\")\n .match(/[\\p{L}\\p{N}\\p{M}]+/gu);\n\n return (\n words\n ?.map((word, index) => {\n const [first = \"\", ...rest] = Array.from(word.toLowerCase());\n\n return `${index ? first.toUpperCase() : first}${rest.join(\"\")}`;\n })\n .join(\"\") || fallback\n );\n};\nconst propertyValue = (field: SchemaProperty): string => {\n switch (field.type) {\n case \"checkbox\":\n return \"boolean\";\n case \"number\":\n return \"number | null\";\n case \"select\":\n return union([literal(\"\"), ...field.options.map(literal)]);\n case \"multi-select\":\n return `Array<${union(field.options.map(literal))}>`;\n case \"text\":\n case \"date\":\n case \"url\":\n return \"string\";\n default:\n throw new Error(`Unsupported schema property type: ${String(field.type)}`);\n }\n};\nconst fieldMap = (fields: Map<string, string>): string => {\n const sorted = [...fields].sort(([a], [b]) => compare(a, b));\n\n return sorted.length\n ? `{\\n${sorted.map(([key, value]) => ` ${literal(key)}: ${value};`).join(\"\\n\")}\\n }`\n : \"Record<never, never>\";\n};\n\n/** Render effective fields only. Defaults are content, not constraints on field values. */\nconst schemaFields = (revision: SchemaRevision): string => {\n const groups = { property: new Map<string, string>(), fragment: new Map<string, string>() };\n\n if (revision.definition.formatVersion !== 1)\n throw new Error(\"Unsupported schema format version.\");\n\n for (const field of revision.definition.fields) {\n const key = fieldKey(field);\n const group = groups[field.kind];\n\n if (group.has(key)) throw new Error(`Duplicate ${field.kind} key ${literal(key)}.`);\n\n group.set(\n key,\n field.kind === \"property\"\n ? `{ name: string; type: ${literal(field.type)}; value: ${propertyValue(field)} }`\n : `{ name: string; content: FragmentDocument<${union(field.allowedBlocks.map(literal))}> }`\n );\n }\n\n return ` properties: ${fieldMap(groups.property)};\\n fragments: ${fieldMap(groups.fragment)};`;\n};\n\n// Only block kinds are constrained by schemas. Element names, props, marks, and\n// attributes remain general; default content must never become a schema for them.\nconst fragmentTypes = `type FragmentNode<Block extends string> = Omit<SDK.ContentNode, \"type\" | \"content\"> & {\n type: Block | \"paragraph\" | \"listItem\" | \"taskItem\" | \"tableRow\" | \"tableCell\" | \"tableHeader\" | \"text\" | \"hardBreak\";\n content?: Array<FragmentNode<Block>>;\n};\n\ntype FragmentDocument<Block extends string> = Omit<SDK.ContentNode, \"type\" | \"content\"> & {\n type: \"doc\";\n content: Array<Omit<FragmentNode<Block>, \"type\"> & { type: Block | \"paragraph\" }>;\n};`;\n\nexport { schemaFields, fragmentTypes };\n","import type { TypeMetadata, TypeMetadataCollection } from \"@andesine/sdk\";\nimport { literal, tuple } from \"./source\";\n\ninterface MetadataHierarchy {\n collections: Map<string | null, TypeMetadataCollection>;\n descendants: Map<string | null, string[]>;\n}\n\n/** Build selected subtrees. Missing parents are valid for a selected or restricted subtree. */\nconst hierarchy = (metadata: TypeMetadata): MetadataHierarchy => {\n const collections = new Map(\n metadata.collections.map((collection) => [collection.id, collection])\n );\n const children = new Map<string | null, TypeMetadataCollection[]>();\n const descendants = new Map<string | null, string[]>();\n const visiting = new Set<string | null>();\n const visit = (id: string | null): string[] => {\n if (visiting.has(id)) throw new Error(\"Type metadata contains a collection cycle.\");\n if (descendants.has(id)) return descendants.get(id)!;\n\n visiting.add(id);\n\n const result = (children.get(id) ?? []).flatMap((child) => [child.id!, ...visit(child.id)]);\n\n visiting.delete(id);\n descendants.set(id, result);\n\n return result;\n };\n\n if (collections.size !== metadata.collections.length) {\n throw new Error(\"Type metadata contains duplicate collection IDs.\");\n }\n\n for (const collection of metadata.collections) {\n if (collection.id === null) continue;\n\n const siblings = children.get(collection.parentID) ?? [];\n\n siblings.push(collection);\n children.set(collection.parentID, siblings);\n }\n\n for (const collection of metadata.collections) visit(collection.id);\n\n return { collections, descendants };\n};\n\n/** Emit ordered tree tuples without content bodies or runtime values. */\nconst treeTypes = (metadata: TypeMetadata, collectionNames: Map<string, string>): string[] => {\n const entries = new Map(metadata.entries!.map((entry) => [entry.id, entry]));\n const collections = new Map(\n metadata.collections.map((collection) => [collection.id, collection])\n );\n const rows = new Map(metadata.tree!.map((row) => [row.collectionID, row]));\n\n return metadata.collections.map((collection) => {\n const name = `${collectionNames.get(collection.id ?? \"/\")}Tree`;\n const row = rows.get(collection.id);\n\n if (!row) throw new Error(`Missing tree metadata for ${literal(collection.path)}.`);\n\n const childTrees = row.collectionIDs.map((id) => {\n const child = collections.get(id);\n\n if (!child || child.parentID !== collection.id) {\n throw new Error(`Invalid tree collection reference ${literal(id)}.`);\n }\n\n return `${collectionNames.get(id)}Tree`;\n });\n const childEntries = row.entryIDs.map((id) => {\n const entry = entries.get(id);\n\n if (!entry || entry.collectionID !== collection.id) {\n throw new Error(`Invalid tree entry reference ${literal(id)}.`);\n }\n\n return `Omit<SDK.PublishedEntry, \"id\" | \"name\" | \"path\" | \"slugPath\"> & { id: ${literal(id)}; name: ${literal(entry.name)}; path: ${literal(entry.path)}; slugPath: ${literal(entry.slugPath)} }`;\n });\n\n if (metadata.source.kind === \"current\") {\n return `export interface ${name} {\n collectionID: ${literal(collection.id)};\n collectionIDs: ${tuple(row.collectionIDs.map(literal))};\n entryIDs: ${tuple(row.entryIDs.map(literal))};\n}`;\n }\n\n return `export interface ${name} extends SDK.PublishedCollection {\n id: ${literal(collection.id)};\n name: ${literal(collection.name)};\n path: ${literal(collection.path)};\n slugPath: ${literal(collection.slugPath)};\n entries: ${tuple(childEntries)};\n collections: ${tuple(childTrees)};\n}`;\n });\n};\n\nexport { hierarchy, treeTypes };\n","import type { TypeMetadata } from \"@andesine/sdk\";\nimport type { TypesConfig } from \"../config/schema\";\nimport { compare, hash, json, literal, names, tuple, union } from \"./source\";\nimport { fragmentTypes, schemaFields } from \"./schema\";\nimport { hierarchy, treeTypes } from \"./tree\";\n\ninterface TypeGenerationOptions {\n /** Requested source. Omit to follow the metadata's channel or current source. */\n source?: TypesConfig[\"source\"];\n /** Requested collection selectors, recorded as provenance. Metadata is already scoped. */\n collections?: TypesConfig[\"collections\"];\n /** Emit exact ID bindings and per-collection entry ID unions. Defaults to false. */\n includeEntryIDs?: boolean;\n /** Emit exact path bindings and per-collection entry path unions. Defaults to false. */\n includeEntryPaths?: boolean;\n /** Emit ordered trees, including their entry identities. Defaults to false. */\n includeTree?: boolean;\n}\n\nconst GENERATED_TYPES_MARKER = \"// Generated by Andesine. Do not edit.\";\n\n/**\n * Convert public type metadata into deterministic, type-only TypeScript source.\n *\n * @param metadata - One complete current or published metadata response.\n * @param options - Source provenance and optional entry/tree exports. These do not filter\n * metadata; request the selected collections and optional metadata before calling this function.\n * @returns Source text with Workspace, collection, and revision types. No files are written.\n * @throws Error for unsupported metadata, inconsistent references, or missing requested extras.\n * No network, credentials, project config loading, or executable remote input is involved.\n */\nconst generateTypes = (metadata: TypeMetadata, options: TypeGenerationOptions = {}): string => {\n const includeEntries = Boolean(options.includeEntryIDs || options.includeEntryPaths);\n const requestedSource =\n options.source ??\n (metadata.source.kind === \"published\"\n ? { kind: \"published\", channel: metadata.source.channel }\n : { kind: \"current\" });\n const source: TypesConfig[\"source\"] =\n requestedSource.kind === \"current\"\n ? { kind: \"current\" }\n : \"snapshotID\" in requestedSource\n ? { kind: \"published\", snapshotID: requestedSource.snapshotID }\n : { kind: \"published\", channel: requestedSource.channel };\n const sourceMismatch =\n source.kind !== metadata.source.kind ||\n (source.kind === \"published\" &&\n metadata.source.kind === \"published\" &&\n ((\"channel\" in source && source.channel !== metadata.source.channel) ||\n (\"snapshotID\" in source && source.snapshotID !== metadata.source.snapshotID)));\n\n if (metadata.formatVersion !== 1) throw new Error(\"Unsupported type metadata format version.\");\n if (sourceMismatch) throw new Error(\"Type metadata does not match the requested source.\");\n\n if ((includeEntries || options.includeTree) && !metadata.entries) {\n throw new Error(\"Request entry metadata before generating entry or tree types.\");\n }\n\n if (options.includeTree && !metadata.tree) {\n throw new Error(\"Request tree metadata before generating tree types.\");\n }\n\n const collections = [...metadata.collections].sort((a, b) => compare(a.id ?? \"\", b.id ?? \"\"));\n const selected = { ...metadata, collections };\n const { descendants } = hierarchy(selected);\n const collectionNames = names(\n collections.map((row) => ({ key: row.id ?? \"/\", label: row.name || \"Root\" })),\n \"Collection\"\n );\n const revisions = new Map(metadata.revisions.map((revision) => [revision.revisionID, revision]));\n const usedRevisions = new Set(\n collections.flatMap((row) => row.schemaRevisionIDs).filter((id) => id !== null)\n );\n const entries =\n includeEntries || options.includeTree\n ? [...metadata.entries!].sort((a, b) => compare(a.id, b.id))\n : [];\n const collectionBindings = new Map<string, string>();\n const entryBindings = new Map<string, string>();\n const shapes = new Map<string, string>();\n const interfaces: string[] = [];\n const types: string[] = [];\n const schemaBindings: string[] = [];\n const treeBindings: string[] = [];\n const base = metadata.source.kind === \"published\" ? \"SDK.PublishedEntryContent\" : \"SDK.Entry\";\n const contentBase = `Omit<${base}, \"schema\" | \"properties\" | \"fragments\">`;\n const bind = (map: Map<string, string>, key: string, value: string) => {\n if (map.has(key) && map.get(key) !== value) {\n throw new Error(`Duplicate metadata selector ${literal(key)}.`);\n }\n\n map.set(key, value);\n };\n\n for (const collection of collections) {\n const name = collectionNames.get(collection.id ?? \"/\")!;\n\n bind(collectionBindings, collection.path, name);\n if (collection.slugPath !== collection.path) {\n bind(collectionBindings, collection.slugPath, name);\n }\n\n if (collection.id !== null) bind(collectionBindings, collection.id, name);\n }\n\n for (const entry of entries) {\n const collection = collectionBindings.get(entry.collectionID ?? \"/\");\n\n if (!collection) throw new Error(`Missing collection for entry ${literal(entry.id)}.`);\n if (entry.schemaRevisionID !== null) usedRevisions.add(entry.schemaRevisionID);\n\n const binding = `{ collection: ${literal(entry.collectionID ?? \"/\")}; schemaRevisionID: ${literal(entry.schemaRevisionID)} }`;\n\n if (options.includeEntryIDs) bind(entryBindings, entry.id, binding);\n\n if (options.includeEntryPaths) {\n bind(entryBindings, entry.path, binding);\n\n if (entry.slugPath !== entry.path) {\n bind(entryBindings, entry.slugPath, binding);\n }\n }\n }\n\n const revisionNames = names(\n [...usedRevisions].map((id) => ({ key: id, label: `Revision_${id}` })),\n \"Schema\"\n );\n\n for (const id of [...usedRevisions].sort(compare)) {\n const revision = revisions.get(id);\n\n if (!revision) throw new Error(`Missing schema revision ${literal(id)}.`);\n\n const fields = schemaFields(revision);\n const shapeName = `SchemaFields_${hash(fields)}`;\n const revisionName = revisionNames.get(id)!;\n\n shapes.set(shapeName, fields);\n interfaces.push(`export interface ${revisionName} extends ${shapeName} {\n hash: ${literal(revision.hash)};\n}`);\n types.push(\n `export type ${revisionName}Content = ${contentBase} & SDK.SchemaContent<Workspace, ${literal(id)}>;`\n );\n schemaBindings.push(` ${literal(id)}: ${revisionName};`);\n }\n\n for (const collection of collections) {\n const name = collectionNames.get(collection.id ?? \"/\")!;\n const ids = [...new Set(collection.schemaRevisionIDs)].sort((a, b) =>\n compare(a ?? \"\", b ?? \"\")\n );\n const childIDs = [...descendants.get(collection.id)!].sort(compare);\n const identity =\n metadata.source.kind === \"published\" ? ` & { collectionID: ${literal(collection.id)} }` : \"\";\n\n interfaces.push(`export interface ${name} extends SDK.WorkspaceCollection {\n id: ${literal(collection.id)};\n path: ${literal(collection.path)};\n slugPath: ${literal(collection.slugPath)};\n schemaRevisionIDs: readonly ${tuple(ids.map(literal))};\n descendants: readonly ${tuple(childIDs.map(literal))};\n}`);\n types.push(\n `export type ${name}Content = ${contentBase} & SDK.SchemaContent<Workspace, ${union(ids.map(literal))}>${identity};`\n );\n types.push(`export type ${name}StructuredContent = SDK.StructuredContent<${name}Content>;`);\n\n const collectionEntries = entries.filter((entry) => entry.collectionID === collection.id);\n\n if (options.includeEntryIDs) {\n types.push(\n `export type ${name}EntryID = ${union(collectionEntries.map((entry) => literal(entry.id)))};`\n );\n }\n\n if (options.includeEntryPaths) {\n types.push(\n `export type ${name}EntryPath = ${union(collectionEntries.map((entry) => literal(entry.path)))};`,\n `export type ${name}EntrySlugPath = ${union(collectionEntries.map((entry) => literal(entry.slugPath)))};`\n );\n }\n\n if (options.includeTree) {\n treeBindings.push(` ${literal(collection.path)}: ${name}Tree;`);\n if (collection.slugPath !== collection.path) {\n treeBindings.push(` ${literal(collection.slugPath)}: ${name}Tree;`);\n }\n if (collection.id !== null) treeBindings.push(` ${literal(collection.id)}: ${name}Tree;`);\n }\n }\n\n if (options.includeTree) {\n interfaces.push(...treeTypes(selected, collectionNames));\n types.push(`export type WorkspaceTree = {\\n${treeBindings.join(\"\\n\")}\\n};`);\n }\n\n const mapFields = [\n ` workspaceID: ${literal(metadata.workspaceID)};`,\n ` source: ${\n source.kind === \"current\"\n ? '{ kind: \"current\" }'\n : `{\n kind: \"published\";\n ${\"snapshotID\" in source ? `snapshotID: ${literal(source.snapshotID)};` : `channel: ${literal(source.channel)};`}\n }`\n };`,\n ` collections: {\\n${[...collectionBindings]\n .sort(([a], [b]) => compare(a, b))\n .map(([key, value]) => ` ${literal(key)}: ${value};`)\n .join(\"\\n\")}\\n };`,\n ` schemas: {\\n${schemaBindings.join(\"\\n\")}\\n };`\n ];\n\n if (includeEntries) {\n mapFields.push(\n ` entries: {\\n${[...entryBindings]\n .sort(([a], [b]) => compare(a, b))\n .map(([key, value]) => ` ${literal(key)}: ${value};`)\n .join(\"\\n\")}\\n };`\n );\n }\n\n if (options.includeTree && metadata.source.kind === \"published\") {\n mapFields.push(\" tree: WorkspaceTree;\");\n }\n\n return [\n [\n GENERATED_TYPES_MARKER,\n `// Workspace: ${literal(metadata.workspaceID)}; source: ${json(source)}.`,\n `// Collections: ${json([...(options.collections ?? [])].sort((a, b) => compare(json(a), json(b))))}; entry IDs: ${Boolean(options.includeEntryIDs)}; entry paths: ${Boolean(options.includeEntryPaths)}; tree: ${Boolean(options.includeTree)}.`,\n \"// Types only. Configure the runtime client for the same workspace and source.\"\n ].join(\"\\n\"),\n 'import type * as SDK from \"@andesine/sdk\";',\n `export interface Workspace extends SDK.WorkspaceTypeMap {\\n${mapFields.join(\"\\n\")}\\n}`,\n ...[...shapes]\n .sort(([a], [b]) => compare(a, b))\n .map(([name, fields]) => `interface ${name} {\\n${fields}\\n}`),\n ...interfaces,\n ...([...shapes.values()].some((fields) => fields.includes(\"FragmentDocument<\"))\n ? [fragmentTypes]\n : []),\n ...types,\n \"\"\n ].join(\"\\n\\n\");\n};\n\nexport { generateTypes, GENERATED_TYPES_MARKER };\nexport type { TypeGenerationOptions };\n","import { randomUUID } from \"node:crypto\";\nimport { link, lstat, mkdir, readFile, rename, unlink, writeFile } from \"node:fs/promises\";\nimport path from \"node:path\";\nimport lockfile from \"proper-lockfile\";\nimport { CLIError, exitCodes } from \"../errors\";\nimport { GENERATED_TYPES_MARKER } from \"./generate\";\n\n/** Read without creating files, directories, or locks. Reject links and non-regular files. */\nconst readTypesFile = async (file: string): Promise<string | undefined> => {\n try {\n const info = await lstat(file);\n\n if (!info.isFile() || info.isSymbolicLink()) {\n throw new CLIError(\"The types output must be a regular file, not a link.\", exitCodes.usage);\n }\n\n return await readFile(file, \"utf8\");\n } catch (error) {\n if ((error as NodeJS.ErrnoException).code === \"ENOENT\") return undefined;\n\n throw error;\n }\n};\n\n/** Replace only a reviewed file, atomically, and leave identical output untouched. */\nconst writeTypesFile = async (\n file: string,\n source: string,\n expected: string | undefined,\n signal: AbortSignal,\n force = false\n): Promise<boolean> => {\n const temporary = `${file}.${randomUUID()}.tmp`;\n const generated = expected?.split(/\\r?\\n/, 1)[0] === GENERATED_TYPES_MARKER;\n\n let compromised = false;\n\n signal.throwIfAborted();\n\n if (expected !== undefined && !generated && !force) {\n throw new CLIError(\n `Refusing to replace ${file}: it is not an Andesine generated file. Choose another --output or use --force to replace it.`,\n exitCodes.usage\n );\n }\n\n if (expected === source && (await readTypesFile(file)) === source) return false;\n\n await mkdir(path.dirname(file), { recursive: true });\n\n const release = await lockfile.lock(file, {\n realpath: false,\n onCompromised: () => {\n compromised = true;\n }\n });\n const assertUnchanged = async () => {\n signal.throwIfAborted();\n\n if (compromised) throw new CLIError(\"The types file lock was lost. Run generation again.\");\n\n if ((await readTypesFile(file)) !== expected) {\n throw new CLIError(\"The types file changed during generation. Run generation again.\");\n }\n };\n\n try {\n await assertUnchanged();\n if (expected === source) return false;\n\n const info = expected === undefined ? undefined : await lstat(file);\n\n await writeFile(temporary, source, { flag: \"wx\", mode: info?.mode ?? 0o644 });\n await assertUnchanged();\n\n if (expected === undefined) await link(temporary, file);\n else await rename(temporary, file);\n\n return true;\n } finally {\n try {\n await unlink(temporary).catch((error: NodeJS.ErrnoException) => {\n if (error.code !== \"ENOENT\") throw error;\n });\n } finally {\n await release().catch((error: unknown) => {\n if (!compromised) throw error;\n });\n }\n }\n};\n\nexport { readTypesFile, writeTypesFile };\n","import { AndesineAPIError, type TypeMetadata } from \"@andesine/sdk\";\nimport { authenticatedClient } from \"../auth/client\";\nimport type { CommandContext } from \"../context\";\nimport type { TypesConfig } from \"../config/schema\";\nimport { CLIError, exitCodes } from \"../errors\";\n\n/** Only metadata read failures can be retried by watch; writes and auth exchanges cannot. */\nclass RetryableMetadataError extends Error {\n constructor(\n readonly failure: unknown,\n readonly retryAfter = 0\n ) {\n super(\"Could not read type metadata.\", { cause: failure });\n }\n}\n\nconst retryDelay = (error: AndesineAPIError): number => {\n const header = error.response.headers.get(\"retry-after\");\n\n if (!header) return 0;\n\n const seconds = Number(header);\n const delay = Number.isFinite(seconds) ? seconds * 1000 : Date.parse(header) - Date.now();\n\n return Number.isFinite(delay) ? Math.max(0, delay) : 0;\n};\n\n/** Refresh credentials between polls and read the selected public metadata endpoint. */\nconst readMetadata = async (context: CommandContext, types: TypesConfig): Promise<TypeMetadata> => {\n const { config, signal } = context;\n\n if (process.env.ANDESINE_API_KEY === undefined && !config.workspaceID) {\n throw new CLIError(\n \"No workspace selected. Run andesine init, pass --workspace <id>, or set ANDESINE_WORKSPACE_ID.\",\n exitCodes.usage\n );\n }\n\n const { client } = await authenticatedClient(context);\n const input = {\n collections: types.collections,\n includeEntries: types.includeEntryIDs || types.includeEntryPaths || types.includeTree,\n includeTree: types.includeTree\n };\n const request = { signal, retries: 0 };\n\n let metadata: TypeMetadata;\n\n try {\n metadata =\n types.source.kind === \"current\"\n ? await client.typeMetadata.getCurrent(input, request)\n : await client.typeMetadata.getPublished(\n {\n ...input,\n ...(\"snapshotID\" in types.source\n ? { snapshotID: types.source.snapshotID }\n : { channel: types.source.channel })\n },\n request\n );\n } catch (error) {\n signal.throwIfAborted();\n\n const transientAPIError =\n error instanceof AndesineAPIError &&\n (error.status === 408 ||\n error.status === 429 ||\n (error.status >= 500 && error.status !== 501) ||\n error.code === \"SCHEMA_MIGRATION_IN_PROGRESS\");\n const networkError =\n error instanceof TypeError ||\n (error instanceof DOMException && error.name === \"TimeoutError\");\n\n if (transientAPIError || networkError) {\n throw new RetryableMetadataError(\n error,\n error instanceof AndesineAPIError ? retryDelay(error) : 0\n );\n }\n\n throw error;\n }\n\n if (config.workspaceID && config.workspaceID !== metadata.workspaceID) {\n throw new CLIError(\n \"The API credential returned another workspace. Check --workspace and ANDESINE_API_KEY.\"\n );\n }\n\n return metadata;\n};\n\nexport { readMetadata, RetryableMetadataError };\n","import { setTimeout } from \"node:timers/promises\";\nimport type { TypeMetadata } from \"@andesine/sdk\";\nimport type { CommandContext } from \"../context\";\nimport { CLIError, exitCodes } from \"../errors\";\nimport { reportAPIError } from \"../api/errors\";\nimport { generateTypes } from \"./generate\";\nimport { readTypesFile, writeTypesFile } from \"./file\";\nimport { readMetadata, RetryableMetadataError } from \"./metadata\";\nimport { resolveTypes, type GenerateOptions } from \"./options\";\n\ninterface GenerationResult {\n outputPath: string;\n workspaceID: string;\n source: TypeMetadata[\"source\"];\n fingerprint: string;\n status: \"generated\" | \"unchanged\" | \"current\" | \"stale\";\n}\ninterface GenerationCache {\n fingerprint: string;\n source: string;\n}\n\n/** Generate, check, or watch using the same metadata and output comparison. */\nconst executeTypes = async (\n context: CommandContext,\n options: GenerateOptions = {},\n emitResult = true\n): Promise<GenerationResult> => {\n const { output, signal } = context;\n const types = resolveTypes(context.config, options);\n const interval = Number(options.interval ?? \"10\") * 1000;\n\n if (options.check && (options.watch || options.force)) {\n throw new CLIError(\"--check cannot be combined with --watch or --force.\", exitCodes.usage);\n }\n\n if (options.interval !== undefined && !options.watch) {\n throw new CLIError(\"--interval requires --watch.\", exitCodes.usage);\n }\n\n if (!Number.isFinite(interval) || interval < 1000 || interval > 300_000) {\n throw new CLIError(\"--interval must be between 1 and 300 seconds.\", exitCodes.usage);\n }\n\n let cache: GenerationCache | undefined;\n let first = true;\n let failures = 0;\n let previousFailure: string | undefined;\n let force = options.force;\n\n const run = async (): Promise<GenerationResult> => {\n const expected = await readTypesFile(types.output);\n const metadata = await readMetadata(context, types);\n const source =\n cache?.fingerprint === metadata.fingerprint ? cache.source : generateTypes(metadata, types);\n const changed = options.check\n ? (await readTypesFile(types.output)) !== source\n : await writeTypesFile(types.output, source, expected, signal, force);\n\n signal.throwIfAborted();\n cache = { fingerprint: metadata.fingerprint, source };\n force = false;\n\n return {\n outputPath: types.output,\n workspaceID: metadata.workspaceID,\n source: metadata.source,\n fingerprint: metadata.fingerprint,\n status: options.check ? (changed ? \"stale\" : \"current\") : changed ? \"generated\" : \"unchanged\"\n };\n };\n\n await output.heading(\n `Andesine · ${options.check ? \"Check\" : options.watch ? \"Watch\" : \"Generate\"} content types`\n );\n await output.note(\"Type generation\", {\n Source: JSON.stringify(types.source),\n Collections:\n types.collections\n .map((selector) => (typeof selector === \"string\" ? selector : selector.collectionSlugPath))\n .join(\", \") || \"All accessible collections\",\n Output: types.output\n });\n\n if (options.watch) {\n await output.diagnostic(`Watching every ${interval / 1000}s. Press Ctrl+C to stop.`);\n }\n\n while (true) {\n let delay = interval;\n\n signal.throwIfAborted();\n\n try {\n const result = first\n ? await output.progress(\"Reading metadata and generating types\", run, \"Types checked\")\n : await run();\n const recovered = failures > 0;\n\n if (first || recovered || result.status === \"generated\") {\n if (recovered) await output.success(\"Metadata access restored.\");\n\n if (result.status === \"stale\") {\n await output.warning(\"Generated types are missing or out of date.\");\n } else {\n await output.success(\n result.status === \"generated\" ? \"Types generated.\" : \"Types are up to date.\"\n );\n }\n\n if (emitResult) await output.json(result);\n }\n\n if (result.status === \"stale\") {\n throw new CLIError(\n \"Run andesine types generate to update the types file.\",\n exitCodes.stale\n );\n }\n\n if (!options.watch) return result;\n\n first = false;\n failures = 0;\n previousFailure = undefined;\n } catch (error) {\n signal.throwIfAborted();\n\n if (!options.watch || !(error instanceof RetryableMetadataError)) {\n return reportAPIError(\n context,\n error instanceof RetryableMetadataError ? error.failure : error\n );\n }\n\n failures += 1;\n delay = Math.max(\n Math.min(interval * 2 ** Math.min(failures, 10), 60_000),\n interval,\n error.retryAfter\n );\n\n // Report the first failure and each changed error, then stay quiet until recovery.\n try {\n const message =\n error.failure instanceof Error ? error.failure.message : \"Metadata read failed.\";\n\n if (message !== previousFailure) {\n previousFailure = message;\n await reportAPIError(context, error.failure);\n }\n } catch (failure) {\n signal.throwIfAborted();\n\n const message = failure instanceof Error ? failure.message : \"Metadata read failed.\";\n\n await output.warning(\n `${message} Keeping the last types file. Retrying in ${Math.ceil(delay / 1000)}s.`\n );\n }\n\n first = false;\n }\n\n await setTimeout(Math.min(delay, 2_147_483_647), undefined, { signal });\n }\n};\n\nexport { executeTypes };\nexport type { GenerationResult };\n","import { confirm, select } from \"@clack/prompts\";\nimport { createCommandContext, type CommandContext } from \"../context\";\nimport { authenticatedClient, identity } from \"../auth/client\";\nimport { login } from \"../auth/login\";\nimport { readConfigFile } from \"../config/files\";\nimport { projectConfigSchema, typesConfigSchema, type ProjectConfig } from \"../config/schema\";\nimport { CancelledError, CLIError, exitCodes } from \"../errors\";\nimport { canPrompt } from \"../prompts\";\nimport { validateCollections } from \"../content/collections\";\nimport { selectTypes } from \"./choices\";\nimport { readProjectFile, writeProjectConfig } from \"./write-config\";\nimport type { InitOptions } from \"./options\";\nimport { validateTypeOptions } from \"../types/options\";\nimport { executeTypes } from \"../types/execute\";\nimport path from \"node:path\";\n\nconst selectWorkspace = async (context: CommandContext, interactive: boolean): Promise<string> => {\n const { client } = await authenticatedClient(context);\n const account = await context.output.progress(\n \"Checking your account\",\n () => identity(client, context.signal),\n \"Account verified\"\n );\n const configured = context.config.workspaceID;\n\n if (account.type === \"key\") {\n if (configured && configured !== account.workspaceID) {\n throw new CLIError(\n \"This API key belongs to another workspace. Change --workspace or ANDESINE_API_KEY.\"\n );\n }\n\n await context.output.note(\"API key\", {\n Instance: context.config.baseURL,\n Workspace: account.workspaceID\n });\n return account.workspaceID;\n }\n\n await context.output.note(\"Account\", {\n Instance: context.config.baseURL,\n Email: account.user.email,\n Profile: context.config.profileName\n });\n\n const workspaces = await context.output.progress(\n \"Loading workspaces\",\n () => client.workspaces.list(undefined, { signal: context.signal }),\n \"Workspaces loaded\"\n );\n\n if (configured && !workspaces.some((workspace) => workspace.id === configured)) {\n throw new CLIError(\n \"The selected workspace is not available to this account. Use --workspace with an accessible workspace ID.\",\n exitCodes.usage\n );\n }\n\n if (!workspaces.length) {\n throw new CLIError(\"No workspaces are available. Create a workspace in Andesine first.\");\n }\n if (!interactive && configured) return configured;\n if (workspaces.length === 1) return workspaces[0].id;\n\n if (!interactive) {\n throw new CLIError(\n \"Several workspaces are available. Supply --workspace <id> or run init in an interactive terminal.\",\n exitCodes.usage\n );\n }\n\n return context.prompt((prompt) =>\n select({\n ...prompt,\n message: \"Workspace\",\n initialValue: configured,\n options: workspaces.map((workspace) => ({\n value: workspace.id,\n label: workspace.name,\n hint: workspace.id\n }))\n })\n );\n};\n\nconst describeConfig = (config: ProjectConfig): Record<string, string | undefined> => ({\n \"Instance\": config.baseURL,\n \"Workspace\": config.workspaceID,\n \"Profile\": config.profile,\n \"Source\": config.types ? JSON.stringify(config.types.source) : undefined,\n \"Collections\": config.types\n ? config.types.collections\n .map((selector) => (typeof selector === \"string\" ? selector : selector.collectionSlugPath))\n .join(\", \") || \"All accessible collections\"\n : undefined,\n \"Output\": config.types?.output,\n \"Entry IDs\": config.types ? String(config.types.includeEntryIDs) : undefined,\n \"Entry paths\": config.types ? String(config.types.includeEntryPaths) : undefined,\n \"Exact tree\": config.types ? String(config.types.includeTree) : undefined\n});\n\n/** Configure a project through the public API; never save credentials in the project. */\nconst init = async (options: InitOptions, signal: AbortSignal): Promise<void> => {\n const interactive = canPrompt(options.interactive);\n\n validateTypeOptions(options);\n\n let context = await createCommandContext(options, signal, {\n allowNewProfile: true,\n allowMissingConfig: true\n });\n\n const explicitPath = options.config ?? process.env.ANDESINE_CONFIG;\n const explicitProfile = options.profile ?? process.env.ANDESINE_PROFILE;\n const file = path.resolve(explicitPath ?? context.config.configPath ?? \"andesine.json\");\n const original = await readProjectFile(file);\n const previous = await readConfigFile(file, projectConfigSchema, true);\n\n await context.output.heading(\"Andesine · Initialize project\");\n\n const needsLogin =\n process.env.ANDESINE_API_KEY === undefined && !context.config.profile?.credentialRef;\n\n if (needsLogin) {\n if (!interactive) {\n throw new CLIError(\n \"Sign in with andesine auth login or set ANDESINE_API_KEY before running init non-interactively.\",\n exitCodes.usage\n );\n }\n\n const approved = await context.prompt((prompt) =>\n confirm({ ...prompt, message: `Sign in to ${context.config.baseURL}?`, initialValue: true })\n );\n\n if (!approved) throw new CancelledError();\n\n await login(context, options, false);\n context = await createCommandContext(options, signal, { allowMissingConfig: true });\n }\n\n const workspaceID = await selectWorkspace(\n context,\n interactive && options.workspace === undefined\n );\n const scopedContext = { ...context, config: { ...context.config, workspaceID } };\n const { client } = await authenticatedClient(scopedContext);\n const types = await selectTypes(\n scopedContext,\n client,\n options,\n previous?.types ?? typesConfigSchema.parse({})\n );\n\n await context.output.progress(\n \"Validating the selected content\",\n () => validateCollections(client, types.source, types.collections, signal),\n \"Content selection verified\"\n );\n\n const config: ProjectConfig = {\n ...previous,\n $schema:\n previous?.$schema ??\n path\n .relative(path.dirname(file), path.resolve(\"node_modules/andesine/dist/config.schema.json\"))\n .split(path.sep)\n .join(\"/\"),\n version: 1,\n baseURL: context.config.baseURL,\n workspaceID,\n ...(explicitProfile !== undefined ? { profile: explicitProfile } : {}),\n types\n };\n const details = describeConfig(config);\n const previousDetails = previous ? describeConfig(previous) : undefined;\n const changes = Object.fromEntries(\n Object.entries(details)\n .filter(([label, value]) => !previousDetails || previousDetails[label] !== value)\n .map(([label, value]) => [\n label,\n previousDetails ? `${previousDetails[label] ?? \"Not set\"} → ${value ?? \"Not set\"}` : value\n ])\n );\n const unchanged = previous && JSON.stringify(previous) === JSON.stringify(config);\n\n await context.output.note(\n unchanged\n ? \"Configuration unchanged\"\n : previous\n ? \"Update configuration\"\n : \"Create configuration\",\n { File: file, ...changes }\n );\n\n if (!unchanged) {\n if (interactive && !options.yes) {\n const approved = await context.prompt((prompt) =>\n confirm({\n ...prompt,\n message: previous ? \"Save these changes?\" : \"Create this configuration?\",\n initialValue: true\n })\n );\n\n if (!approved) throw new CancelledError();\n } else if (previous && !options.yes) {\n throw new CLIError(\n \"The configuration already exists. Review the changes above and rerun with --yes to save them.\",\n exitCodes.usage\n );\n }\n\n await context.output.progress(\n \"Saving project configuration\",\n () => writeProjectConfig(file, config, original, signal),\n \"Project configuration saved\"\n );\n }\n\n await context.output.success(\n unchanged ? \"Project configuration is up to date.\" : \"Project initialized.\"\n );\n\n const generate =\n options.generate ??\n (interactive &&\n (await context.prompt((prompt) =>\n confirm({\n ...prompt,\n message: \"Generate the configured types file now?\",\n initialValue: false\n })\n )));\n const generation = generate\n ? await executeTypes(\n {\n ...scopedContext,\n config: {\n ...scopedContext.config,\n configPath: file,\n types: { ...types, output: path.resolve(path.dirname(file), types.output) }\n }\n },\n {},\n false\n )\n : undefined;\n\n await context.output.json({\n configured: true,\n changed: !unchanged,\n configPath: file,\n baseURL: config.baseURL,\n workspaceID,\n ...(generation ? { generation } : {})\n });\n};\n\nexport { init };\n","import { cp, readdir, readFile, rename, rm, writeFile } from \"node:fs/promises\";\nimport path from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\nimport { CLIError, exitCodes } from \"../errors\";\nimport type { createOutput } from \"../output\";\n\nconst isEmptyDirectory = async (directory: string): Promise<boolean> => {\n try {\n return (await readdir(directory)).length === 0;\n } catch (error) {\n if ((error as NodeJS.ErrnoException).code === \"ENOENT\") return true;\n\n throw error;\n }\n};\n/** Package names allow lowercase letters, digits, and `-._~` only. */\nconst toPackageName = (directory: string, fallback: string): string => {\n const name = path\n .basename(directory)\n .toLowerCase()\n .replace(/[^a-z\\d._~-]+/g, \"-\");\n\n return name.replace(/^[._-]+|[-]+$/g, \"\") || fallback;\n};\n/**\n * Copies a template that the build places next to the bundled CLI (see `scripts/templates.ts`)\n * into a new or empty directory, named after the directory.\n */\nconst copyTemplate = async (\n template: \"pages\" | \"extension\",\n directory: string,\n output: ReturnType<typeof createOutput>\n): Promise<string> => {\n const source = fileURLToPath(new URL(`./templates/${template}/`, import.meta.url));\n const target = path.resolve(directory);\n\n if (!(await isEmptyDirectory(target))) {\n throw new CLIError(\n `${directory} is not empty. Choose a new or empty directory.`,\n exitCodes.usage\n );\n }\n\n await output.progress(\n \"Copying the template\",\n async () => {\n const manifest = JSON.parse(\n await readFile(path.join(source, \"package.template.json\"), \"utf8\")\n );\n const name = toPackageName(target, manifest.name);\n\n await cp(source, target, { recursive: true });\n await rename(path.join(target, \"gitignore\"), path.join(target, \".gitignore\"));\n await rm(path.join(target, \"package.template.json\"));\n await writeFile(\n path.join(target, \"package.json\"),\n `${JSON.stringify({ ...manifest, name }, null, 2)}\\n`\n );\n },\n \"Template copied\"\n );\n\n return target;\n};\n\n/** Creates an Andesine Pages site from the template in an empty directory. */\nconst initPages = async (\n directory: string,\n output: ReturnType<typeof createOutput>\n): Promise<void> => {\n const target = await copyTemplate(\"pages\", directory, output);\n\n await output.note(\"Next steps\", {\n \"Open the site\": `cd ${path.relative(process.cwd(), target) || \".\"}`,\n \"Install\": \"npm install\",\n \"Start\": \"npm run dev\"\n });\n};\n\nexport { copyTemplate, initPages };\n","/* eslint-disable max-lines */\n// Generated from SDK openapi.json. Do not edit.\nimport type { APICommand, JSONSchema } from \"./types\";\n\nconst commands: APICommand[] = [\n {\n id: \"assets.attach\",\n group: \"assets\",\n command: \"attach\",\n method: \"post\",\n path: \"/assets/{assetID}/attachments\",\n summary: \"Attach an asset\",\n description:\n \"Attaches a ready image to an entry. This does not insert an image node into the document.\\n\\nRequired API key permissions: entries. Write permissions also grant read access for the same resource.\",\n example: {\n assetID: \"ast_example\",\n entryID: \"ent_example\"\n },\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"assetID\",\n location: \"path\",\n required: true,\n schema: {\n type: \"string\",\n pattern: \"^ast_[A-Za-z\\\\d]{1,22}$\"\n },\n flag: \"asset-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"entryID\",\n location: \"body\",\n required: true,\n schema: {\n type: \"string\",\n pattern: \"^ent_[A-Za-z\\\\d]{1,22}$\"\n },\n flag: \"entry-id\",\n kind: \"string\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"empty\"\n },\n {\n id: \"assets.get\",\n group: \"assets\",\n command: \"get\",\n method: \"get\",\n path: \"/assets/{assetID}\",\n summary: \"Get asset status and details\",\n description:\n \"Returns image metadata, processing status, and available files. Supply entryID when checking access through an entry.\",\n example: {\n assetID: \"ast_example\",\n entryID: \"ent_example\"\n },\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"assetID\",\n location: \"path\",\n required: true,\n schema: {\n type: \"string\",\n pattern: \"^ast_[A-Za-z\\\\d]{1,22}$\"\n },\n flag: \"asset-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"entryID\",\n location: \"query\",\n required: false,\n schema: {\n type: \"string\",\n pattern: \"^ent_[A-Za-z\\\\d]{1,22}$\"\n },\n flag: \"entry-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"json\"\n },\n {\n id: \"assets.importURL\",\n group: \"assets\",\n command: \"import-url\",\n method: \"post\",\n path: \"/assets/imports\",\n summary: \"Import an image URL\",\n description:\n \"Downloads a remote image and starts processing it for the entry. With checkDuplicates, can return an existing image instead. Use assets.get to check processing status.\\n\\nRequired API key permissions: entries. Write permissions also grant read access for the same resource.\",\n example: {\n assetID: \"ast_example\",\n entryID: \"ent_example\",\n url: \"https://example.com/image.png\",\n checkDuplicates: true\n },\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"assetID\",\n location: \"body\",\n required: true,\n schema: {\n type: \"string\",\n pattern: \"^ast_[A-Za-z\\\\d]{1,22}$\"\n },\n flag: \"asset-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"entryID\",\n location: \"body\",\n required: true,\n schema: {\n type: \"string\",\n pattern: \"^ent_[A-Za-z\\\\d]{1,22}$\"\n },\n flag: \"entry-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"url\",\n location: \"body\",\n required: true,\n schema: {\n type: \"string\",\n maxLength: 4096,\n format: \"uri\"\n },\n flag: \"url\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"checkDuplicates\",\n location: \"body\",\n required: false,\n schema: {\n type: \"boolean\",\n default: false\n },\n flag: \"check-duplicates\",\n kind: \"boolean\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"json\"\n },\n {\n id: \"assets.register\",\n group: \"assets\",\n command: \"register\",\n method: \"post\",\n path: \"/assets/uploads\",\n summary: \"Register an image upload\",\n description:\n \"Reserves an image upload for an entry. Supply the byte count and lowercase SHA-256 checksum of the file. Call assets.upload before expiresAt, then use assets.get to check processing status.\\n\\nRequired API key permissions: entries. Write permissions also grant read access for the same resource.\",\n example: {\n assetID: \"ast_example\",\n entryID: \"ent_example\",\n filename: \"image.png\",\n byteSize: 1024,\n checksum: \"0000000000000000000000000000000000000000000000000000000000000000\"\n },\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"assetID\",\n location: \"body\",\n required: true,\n schema: {\n type: \"string\",\n pattern: \"^ast_[A-Za-z\\\\d]{1,22}$\"\n },\n flag: \"asset-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"entryID\",\n location: \"body\",\n required: true,\n schema: {\n type: \"string\",\n pattern: \"^ent_[A-Za-z\\\\d]{1,22}$\"\n },\n flag: \"entry-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"filename\",\n location: \"body\",\n required: true,\n schema: {\n type: \"string\",\n minLength: 1,\n maxLength: 255\n },\n flag: \"filename\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"byteSize\",\n location: \"body\",\n required: true,\n schema: {\n type: \"integer\",\n minimum: 1,\n maximum: 10485760\n },\n flag: \"byte-size\",\n kind: \"number\",\n nullable: false\n },\n {\n name: \"checksum\",\n location: \"body\",\n required: true,\n schema: {\n type: \"string\",\n pattern: \"^[a-f0-9]{64}$\",\n description: \"SHA-256 of the file bytes, verified by the backend and worker\"\n },\n flag: \"checksum\",\n kind: \"string\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"json\"\n },\n {\n id: \"assets.search\",\n group: \"assets\",\n command: \"search\",\n method: \"get\",\n path: \"/assets/search\",\n summary: \"Search assets\",\n description:\n \"Finds workspace images by text or SHA-256 checksum. Semantic search defaults to true and uses 1 AI credit for a text query. Returns up to 50 results.\\n\\nRequired API key permissions: read:entries, read:collections. Write permissions also grant read access for the same resource.\",\n example: {\n query: \"mountains\",\n limit: 10\n },\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"query\",\n location: \"query\",\n required: false,\n schema: {\n type: \"string\",\n maxLength: 500,\n default: \"\"\n },\n flag: \"query\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"checksum\",\n location: \"query\",\n required: false,\n schema: {\n type: \"string\",\n pattern: \"^[a-f0-9]{64}$\"\n },\n flag: \"checksum\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"semantic\",\n location: \"query\",\n required: false,\n schema: {\n type: \"boolean\",\n default: true\n },\n flag: \"semantic\",\n kind: \"boolean\",\n nullable: false\n },\n {\n name: \"limit\",\n location: \"query\",\n required: false,\n schema: {\n type: \"integer\",\n minimum: 1,\n maximum: 50,\n default: 24\n },\n flag: \"limit\",\n kind: \"number\",\n nullable: false\n },\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"json\"\n },\n {\n id: \"assets.upload\",\n group: \"assets\",\n command: \"upload\",\n method: \"put\",\n path: \"/assets/{assetID}/upload\",\n summary: \"Upload registered image bytes\",\n description:\n \"Uploads a file for a registered asset with multipart/form-data. The bytes must match the registered size and checksum. Processing continues after the upload; use assets.get to check status.\\n\\nRequired API key permissions: entries. Write permissions also grant read access for the same resource.\",\n example: {\n assetID: \"ast_example\",\n file: \"<binary file>\"\n },\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"assetID\",\n location: \"path\",\n required: true,\n schema: {\n type: \"string\",\n pattern: \"^ast_[A-Za-z\\\\d]{1,22}$\"\n },\n flag: \"asset-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"file\",\n location: \"body\",\n required: true,\n schema: {\n type: \"string\",\n contentMediaType: \"*/*\"\n },\n flag: \"file\",\n kind: \"file\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"empty\"\n },\n {\n id: \"auth.getIdentity\",\n group: \"auth\",\n command: \"get-identity\",\n method: \"get\",\n path: \"/identity\",\n summary: \"Get credential identity\",\n description:\n \"Returns the authenticated user for OAuth or browser credentials, or the key and workspace IDs for an API key. Does not require a workspace selection and does not count toward API usage.\",\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [],\n conditional: false,\n response: \"json\"\n },\n {\n id: \"collections.bulkDelete\",\n group: \"collections\",\n command: \"bulk-delete\",\n method: \"post\",\n path: \"/collections/bulk/delete\",\n summary: \"Delete collection trees\",\n description:\n \"Soft-deletes the selected collections, their descendants, and their entries. The workspace root cannot be deleted. An active schema migration can block this action.\\n\\nRequired API key permissions: collections. Write permissions also grant read access for the same resource.\",\n example: {\n ids: [\"coll_example\"]\n },\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"ids\",\n location: \"body\",\n required: true,\n schema: {\n type: \"array\",\n minItems: 1,\n maxItems: 100,\n items: {\n type: \"string\",\n pattern: \"^(?:\\\\w+?_[A-Za-z\\\\d]{1,22})$\"\n },\n description: \"IDs of the collections to delete\"\n },\n flag: \"ids\",\n kind: \"json\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"empty\"\n },\n {\n id: \"collections.create\",\n group: \"collections\",\n command: \"create\",\n method: \"post\",\n path: \"/collections\",\n summary: \"Create a collection\",\n description:\n \"Creates a child collection. Without parentID, uses the workspace root. The name defaults to Untitled. Creation selects an available sibling name with a numeric suffix when needed. Names are trimmed and NFC-normalized. Derived URL slugs must be unique across sibling entries and collections, including case and punctuation variants. Names cannot contain a slash or equal a single dot or two dots. Restricted collections require a session with restricted_collections permission and the Pro plan; API keys cannot create them.\\n\\nRequired API key permissions: collections. Write permissions also grant read access for the same resource.\",\n example: {\n name: \"Documentation\",\n parentID: \"coll_example\"\n },\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"id\",\n location: \"body\",\n required: false,\n schema: {\n type: \"string\",\n pattern: \"^(?:\\\\w+?_[A-Za-z\\\\d]{1,22})$\",\n description: \"ID of the collection\"\n },\n flag: \"id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"name\",\n location: \"body\",\n required: false,\n schema: {\n type: \"string\",\n minLength: 1,\n maxLength: 300,\n description: \"Name of the collection\"\n },\n flag: \"name\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"parentID\",\n location: \"body\",\n required: false,\n schema: {\n type: \"string\",\n pattern: \"^(?:\\\\w+?_[A-Za-z\\\\d]{1,22})$\",\n description: \"ID of the parent collection,\"\n },\n flag: \"parent-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"restricted\",\n location: \"body\",\n required: false,\n schema: {\n type: \"boolean\",\n description: \"Whether to restrict access to the collection tree\"\n },\n flag: \"restricted\",\n kind: \"boolean\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"json\"\n },\n {\n id: \"collections.delete\",\n group: \"collections\",\n command: \"delete\",\n method: \"delete\",\n path: \"/collections/{id}\",\n summary: \"Delete a collection tree\",\n description:\n \"Soft-deletes the collection, its descendants, and their entries. The workspace root cannot be deleted. An active schema migration can block this action.\\n\\nRequired API key permissions: collections. Write permissions also grant read access for the same resource.\",\n example: {\n id: \"coll_example\"\n },\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"id\",\n location: \"path\",\n required: true,\n schema: {\n type: \"string\",\n pattern: \"^(?:\\\\w+?_[A-Za-z\\\\d]{1,22})$\",\n description: \"ID of the collection to delete\"\n },\n flag: \"id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"empty\"\n },\n {\n id: \"collections.list\",\n group: \"collections\",\n command: \"list\",\n method: \"get\",\n path: \"/collections/list\",\n summary: \"List collections\",\n description:\n \"Lists collections under the selected ancestor. Pass pagination.nextCursor to the next request while pagination.hasMore is true. The limit is 1 to 100.\\n\\nRequired API key permissions: read:collections. Write permissions also grant read access for the same resource.\",\n example: {\n collectionID: \"coll_example\",\n limit: 20\n },\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"collectionID\",\n location: \"query\",\n required: false,\n schema: {\n type: \"string\",\n pattern: \"^coll_[A-Za-z\\\\d]{1,22}$\"\n },\n flag: \"collection-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"collectionPath\",\n location: \"query\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Decoded content path, such as /Docs/Page or coll_ID/Page. Names are case-sensitive. Do not URL-encode names before passing them to the SDK.\"\n },\n flag: \"collection-path\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"collectionSlugPath\",\n location: \"query\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Decoded derived slug path, such as /docs/getting-started or coll_ID/getting-started. Use the returned slugPath without URL encoding.\"\n },\n flag: \"collection-slug-path\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"cursor\",\n location: \"query\",\n required: false,\n schema: {\n type: \"string\",\n pattern: \"^(?:\\\\w+?_[A-Za-z\\\\d]{1,22})$\",\n description: \"Cursor from the previous page\"\n },\n flag: \"cursor\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"limit\",\n location: \"query\",\n required: false,\n schema: {\n type: \"integer\",\n minimum: 1,\n maximum: 100,\n description: \"Maximum collections to return\"\n },\n flag: \"limit\",\n kind: \"number\",\n nullable: false\n },\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"json\",\n pagination: \"cursor\"\n },\n {\n id: \"collections.update\",\n group: \"collections\",\n command: \"update\",\n method: \"put\",\n path: \"/collections/{id}\",\n summary: \"Rename a collection\",\n description:\n \"Updates the collection name. Rejects names already used by a sibling entry or collection. An active schema migration can block this action.\\n\\nRequired API key permissions: collections. Write permissions also grant read access for the same resource.\",\n example: {\n id: \"coll_example\",\n name: \"Guides\"\n },\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"id\",\n location: \"path\",\n required: true,\n schema: {\n type: \"string\",\n pattern: \"^(?:\\\\w+?_[A-Za-z\\\\d]{1,22})$\",\n description: \"ID of the collection to be updated\"\n },\n flag: \"id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"name\",\n location: \"body\",\n required: false,\n schema: {\n type: \"string\",\n minLength: 1,\n maxLength: 300,\n description: \"New name of the collection\"\n },\n flag: \"name\",\n kind: \"string\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"empty\"\n },\n {\n id: \"content.get\",\n group: \"content\",\n command: \"get\",\n method: \"get\",\n path: \"/content/entries/get\",\n summary: \"Get published entry content\",\n description:\n \"Returns content from a publishing channel or a specific available snapshot. Use channel or snapshotID, never both. The default channel is published. Validates saved content against its recorded schema and returns schema metadata. expectedSchemaHash must match that revision; schema-less content cannot match it. Validation and hash checks run before ETag handling. Supports ETag and If-None-Match; a match returns 304 without a body.\\n\\nRequired API key permissions: read:publishing. Write permissions also grant read access for the same resource.\",\n example: {\n entryID: \"ent_example\",\n channel: \"published\"\n },\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"entryID\",\n location: \"query\",\n required: false,\n schema: {\n type: \"string\",\n pattern: \"^ent_[A-Za-z\\\\d]{1,22}$\"\n },\n flag: \"entry-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"path\",\n location: \"query\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Decoded content path, such as /Docs/Page or coll_ID/Page. Names are case-sensitive. Do not URL-encode names before passing them to the SDK.\"\n },\n flag: \"path\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"slugPath\",\n location: \"query\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Decoded derived slug path, such as /docs/getting-started or coll_ID/getting-started. Use the returned slugPath without URL encoding.\"\n },\n flag: \"slug-path\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"expectedSchemaHash\",\n location: \"query\",\n required: false,\n schema: {\n type: \"string\",\n pattern: \"^[a-f\\\\d]{64}$\",\n description: \"Hash of the effective schema definition\"\n },\n flag: \"expected-schema-hash\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"channel\",\n location: \"query\",\n required: false,\n schema: {\n type: \"string\",\n minLength: 1,\n maxLength: 50,\n description: \"Publishing channel, defaults to published\"\n },\n flag: \"channel\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"snapshotID\",\n location: \"query\",\n required: false,\n schema: {\n type: \"string\",\n pattern: \"^snp_[A-Za-z\\\\d]{1,22}$\",\n description: \"Historical publication snapshot to read\"\n },\n flag: \"snapshot-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n }\n ],\n conditional: true,\n response: \"json\"\n },\n {\n id: \"content.getAsset\",\n group: \"content\",\n command: \"get-asset\",\n method: \"get\",\n path: \"/content/assets/{workspaceID}/{snapshotID}/{entryID}/{assetID}/{variant}\",\n summary: \"Download a published asset\",\n description:\n \"Returns binary image data from a publication snapshot. No API key is required. The asset must belong to the entry in that available snapshot. Use the asset URLs returned with published content.\",\n example: {\n workspaceID: \"ws_example\",\n snapshotID: \"snp_example\",\n entryID: \"ent_example\",\n assetID: \"ast_example\",\n variant: \"display\"\n },\n security: [],\n fields: [\n {\n name: \"workspaceID\",\n location: \"path\",\n required: true,\n schema: {\n type: \"string\",\n pattern: \"^ws_[A-Za-z\\\\d]{1,22}$\"\n },\n flag: \"workspace-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"snapshotID\",\n location: \"path\",\n required: true,\n schema: {\n type: \"string\",\n pattern: \"^snp_[A-Za-z\\\\d]{1,22}$\"\n },\n flag: \"snapshot-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"entryID\",\n location: \"path\",\n required: true,\n schema: {\n type: \"string\",\n pattern: \"^(?:\\\\w+?_[A-Za-z\\\\d]{1,22})$\"\n },\n flag: \"entry-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"assetID\",\n location: \"path\",\n required: true,\n schema: {\n type: \"string\",\n pattern: \"^ast_[A-Za-z\\\\d]{1,22}$\"\n },\n flag: \"asset-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"variant\",\n location: \"path\",\n required: true,\n schema: {\n enum: [\"thumbnail\", \"display\"],\n type: \"string\"\n },\n flag: \"variant\",\n kind: \"string\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"binary\"\n },\n {\n id: \"content.getSchema\",\n group: \"content\",\n command: \"get-schema\",\n method: \"get\",\n path: \"/content/entries/schema\",\n summary: \"Get a published entry schema\",\n description:\n \"Returns the exact recorded effective schema, or null for schema-less content. Uses the same publication access as content.get. Pass its snapshotID for a consistent read; use channel or snapshotID, not both.\\n\\nRequired API key permissions: read:publishing. Write permissions also grant read access for the same resource.\",\n example: {\n entryID: \"ent_example\",\n channel: \"published\"\n },\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"entryID\",\n location: \"query\",\n required: false,\n schema: {\n type: \"string\",\n pattern: \"^ent_[A-Za-z\\\\d]{1,22}$\"\n },\n flag: \"entry-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"path\",\n location: \"query\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Decoded content path, such as /Docs/Page or coll_ID/Page. Names are case-sensitive. Do not URL-encode names before passing them to the SDK.\"\n },\n flag: \"path\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"slugPath\",\n location: \"query\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Decoded derived slug path, such as /docs/getting-started or coll_ID/getting-started. Use the returned slugPath without URL encoding.\"\n },\n flag: \"slug-path\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"channel\",\n location: \"query\",\n required: false,\n schema: {\n type: \"string\",\n minLength: 1,\n maxLength: 50\n },\n flag: \"channel\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"snapshotID\",\n location: \"query\",\n required: false,\n schema: {\n type: \"string\",\n pattern: \"^snp_[A-Za-z\\\\d]{1,22}$\"\n },\n flag: \"snapshot-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"json\"\n },\n {\n id: \"content.getTree\",\n group: \"content\",\n command: \"get-tree\",\n method: \"get\",\n path: \"/content/tree\",\n summary: \"Get a published collection tree\",\n description:\n \"Returns a published collection tree and its snapshot ID. Use channel or snapshotID, never both. The default channel is published. Reuse the snapshot ID for consistent content reads. Supports ETag and If-None-Match; a match returns 304 without a body.\\n\\nRequired API key permissions: read:publishing. Write permissions also grant read access for the same resource.\",\n example: {\n collectionID: \"coll_example\",\n channel: \"published\"\n },\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"collectionID\",\n location: \"query\",\n required: false,\n schema: {\n type: \"string\",\n pattern: \"^coll_[A-Za-z\\\\d]{1,22}$\"\n },\n flag: \"collection-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"collectionPath\",\n location: \"query\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Decoded content path, such as /Docs/Page or coll_ID/Page. Names are case-sensitive. Do not URL-encode names before passing them to the SDK.\"\n },\n flag: \"collection-path\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"collectionSlugPath\",\n location: \"query\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Decoded derived slug path, such as /docs/getting-started or coll_ID/getting-started. Use the returned slugPath without URL encoding.\"\n },\n flag: \"collection-slug-path\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"channel\",\n location: \"query\",\n required: false,\n schema: {\n type: \"string\",\n minLength: 1,\n maxLength: 50,\n description: \"Publishing channel, defaults to published\"\n },\n flag: \"channel\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"snapshotID\",\n location: \"query\",\n required: false,\n schema: {\n type: \"string\",\n pattern: \"^snp_[A-Za-z\\\\d]{1,22}$\",\n description: \"Historical publication snapshot to read\"\n },\n flag: \"snapshot-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n }\n ],\n conditional: true,\n response: \"json\"\n },\n {\n id: \"content.listCollections\",\n group: \"content\",\n command: \"list-collections\",\n method: \"get\",\n path: \"/content/collections\",\n summary: \"List published collections\",\n description:\n \"Returns a flat page of collections from a publication snapshot. The default channel is published. On later pages, pass the returned snapshotID and pagination.nextCursor, and omit channel. Optionally select direct children using collectionID, collectionPath, or collectionSlugPath. Results are ordered by ID, not display order.\\n\\nRequired API key permissions: read:publishing. Write permissions also grant read access for the same resource.\",\n example: {\n channel: \"published\",\n limit: 20\n },\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"cursor\",\n location: \"query\",\n required: false,\n schema: {\n type: \"string\",\n pattern: \"^(?:\\\\w+?_[A-Za-z\\\\d]{1,22})$\",\n description: \"Cursor from the previous page; keep the same filters\"\n },\n flag: \"cursor\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"limit\",\n location: \"query\",\n required: false,\n schema: {\n type: \"integer\",\n minimum: 1,\n maximum: 100,\n default: 50\n },\n flag: \"limit\",\n kind: \"number\",\n nullable: false\n },\n {\n name: \"collectionID\",\n location: \"query\",\n required: false,\n schema: {\n type: \"string\",\n pattern: \"^coll_[A-Za-z\\\\d]{1,22}$\"\n },\n flag: \"collection-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"collectionPath\",\n location: \"query\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Decoded content path, such as /Docs/Page or coll_ID/Page. Names are case-sensitive. Do not URL-encode names before passing them to the SDK.\"\n },\n flag: \"collection-path\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"collectionSlugPath\",\n location: \"query\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Decoded derived slug path, such as /docs/getting-started or coll_ID/getting-started. Use the returned slugPath without URL encoding.\"\n },\n flag: \"collection-slug-path\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"channel\",\n location: \"query\",\n required: false,\n schema: {\n type: \"string\",\n minLength: 1,\n maxLength: 50\n },\n flag: \"channel\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"snapshotID\",\n location: \"query\",\n required: false,\n schema: {\n type: \"string\",\n pattern: \"^snp_[A-Za-z\\\\d]{1,22}$\"\n },\n flag: \"snapshot-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"json\",\n pagination: \"snapshot\"\n },\n {\n id: \"content.listEntries\",\n group: \"content\",\n command: \"list-entries\",\n method: \"get\",\n path: \"/content/entries\",\n summary: \"List published entries\",\n description:\n \"Returns a flat page of entries from a publication snapshot. The default channel is published. On later pages, pass the returned snapshotID and pagination.nextCursor, and omit channel. Select direct children using collectionID, collectionPath, or collectionSlugPath, or include nested entries with descendants: true. descendants requires a collection scope. All property filters must match the assigned version. includeContent: true returns validated full content, properties, fragments, assets, and recorded schema metadata. An invalid full item fails the page. Keep the same scope and filters across pages. Results are ordered by ID, not display order.\\n\\nRequired API key permissions: read:publishing. Write permissions also grant read access for the same resource.\",\n example: {\n channel: \"published\",\n limit: 20\n },\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"cursor\",\n location: \"query\",\n required: false,\n schema: {\n type: \"string\",\n pattern: \"^(?:\\\\w+?_[A-Za-z\\\\d]{1,22})$\",\n description: \"Cursor from the previous page; keep the same filters\"\n },\n flag: \"cursor\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"limit\",\n location: \"query\",\n required: false,\n schema: {\n type: \"integer\",\n minimum: 1,\n maximum: 100,\n default: 50\n },\n flag: \"limit\",\n kind: \"number\",\n nullable: false\n },\n {\n name: \"collectionID\",\n location: \"query\",\n required: false,\n schema: {\n type: \"string\",\n pattern: \"^coll_[A-Za-z\\\\d]{1,22}$\"\n },\n flag: \"collection-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"collectionPath\",\n location: \"query\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Decoded content path, such as /Docs/Page or coll_ID/Page. Names are case-sensitive. Do not URL-encode names before passing them to the SDK.\"\n },\n flag: \"collection-path\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"collectionSlugPath\",\n location: \"query\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Decoded derived slug path, such as /docs/getting-started or coll_ID/getting-started. Use the returned slugPath without URL encoding.\"\n },\n flag: \"collection-slug-path\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"channel\",\n location: \"query\",\n required: false,\n schema: {\n type: \"string\",\n minLength: 1,\n maxLength: 50\n },\n flag: \"channel\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"snapshotID\",\n location: \"query\",\n required: false,\n schema: {\n type: \"string\",\n pattern: \"^snp_[A-Za-z\\\\d]{1,22}$\"\n },\n flag: \"snapshot-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"descendants\",\n location: \"query\",\n required: false,\n schema: {\n type: \"boolean\",\n default: false\n },\n flag: \"descendants\",\n kind: \"boolean\",\n nullable: false\n },\n {\n name: \"includeContent\",\n location: \"query\",\n required: false,\n schema: {\n type: \"boolean\",\n default: false\n },\n flag: \"include-content\",\n kind: \"boolean\",\n nullable: false\n },\n {\n name: \"filters\",\n location: \"query\",\n required: false,\n schema: {\n type: \"array\",\n maxItems: 20,\n items: {\n $ref: \"#/components/schemas/PropertyFilter\"\n },\n default: []\n },\n flag: \"filters\",\n kind: \"json\",\n nullable: false\n },\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"json\",\n pagination: \"snapshot\"\n },\n {\n id: \"entries.bulkDelete\",\n group: \"entries\",\n command: \"bulk-delete\",\n method: \"post\",\n path: \"/entries/bulk/delete\",\n summary: \"Delete entries\",\n description:\n \"Soft-deletes the selected entries and clears current-entry selections for affected members. An active schema migration can block this action.\\n\\nRequired API key permissions: entries. Write permissions also grant read access for the same resource.\",\n example: {\n ids: [\"ent_example\"]\n },\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"ids\",\n location: \"body\",\n required: true,\n schema: {\n type: \"array\",\n minItems: 1,\n maxItems: 100,\n items: {\n type: \"string\",\n pattern: \"^(?:\\\\w+?_[A-Za-z\\\\d]{1,22})$\"\n },\n description: \"IDs of the entries to delete\"\n },\n flag: \"ids\",\n kind: \"json\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"empty\"\n },\n {\n id: \"entries.create\",\n group: \"entries\",\n command: \"create\",\n method: \"post\",\n path: \"/entries\",\n summary: \"Create an entry\",\n description:\n \"Creates an entry and its initial document. The name defaults to Untitled. Creation selects an available sibling name with a numeric suffix when needed. Names are trimmed and NFC-normalized. Derived URL slugs must be unique across sibling entries and collections, including case and punctuation variants. Names cannot contain a slash or equal a single dot or two dots. A collection schema can set the initial content.\\n\\nRequired API key permissions: entries. Write permissions also grant read access for the same resource.\",\n example: {\n name: \"Getting started\",\n collectionID: \"coll_example\"\n },\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"id\",\n location: \"body\",\n required: false,\n schema: {\n type: \"string\",\n pattern: \"^(?:\\\\w+?_[A-Za-z\\\\d]{1,22})$\",\n description: \"ID of the entry\"\n },\n flag: \"id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"name\",\n location: \"body\",\n required: false,\n schema: {\n type: \"string\",\n maxLength: 300,\n description: \"Name of the entry\"\n },\n flag: \"name\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"collectionID\",\n location: \"body\",\n required: false,\n schema: {\n type: \"string\",\n pattern: \"^(?:\\\\w+?_[A-Za-z\\\\d]{1,22})$\",\n description: \"ID of the collection this entry belongs to\"\n },\n flag: \"collection-id\",\n kind: \"string\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"json\"\n },\n {\n id: \"entries.delete\",\n group: \"entries\",\n command: \"delete\",\n method: \"delete\",\n path: \"/entries/{id}\",\n summary: \"Delete an entry\",\n description:\n \"Soft-deletes the entry and clears current-entry selections for affected members. An active schema migration can block this action.\\n\\nRequired API key permissions: entries. Write permissions also grant read access for the same resource.\",\n example: {\n id: \"ent_example\"\n },\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"id\",\n location: \"path\",\n required: true,\n schema: {\n type: \"string\",\n pattern: \"^(?:\\\\w+?_[A-Za-z\\\\d]{1,22})$\",\n description: \"ID of the entry to delete\"\n },\n flag: \"id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"empty\"\n },\n {\n id: \"entries.get\",\n group: \"entries\",\n command: \"get\",\n method: \"get\",\n path: \"/entries/get\",\n summary: \"Get an entry\",\n description:\n \"Returns current entry details, fragments, properties, and recorded schema metadata. Validates content without changing it. expectedSchemaHash must match the recorded schema; schema-less content cannot match it. Use content.get to read published content.\\n\\nRequired API key permissions: read:entries. Write permissions also grant read access for the same resource.\",\n example: {\n id: \"ent_example\"\n },\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"id\",\n location: \"query\",\n required: false,\n schema: {\n type: \"string\",\n pattern: \"^ent_[A-Za-z\\\\d]{1,22}$\"\n },\n flag: \"id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"path\",\n location: \"query\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Decoded content path, such as /Docs/Page or coll_ID/Page. Names are case-sensitive. Do not URL-encode names before passing them to the SDK.\"\n },\n flag: \"path\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"slugPath\",\n location: \"query\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Decoded derived slug path, such as /docs/getting-started or coll_ID/getting-started. Use the returned slugPath without URL encoding.\"\n },\n flag: \"slug-path\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"expectedSchemaHash\",\n location: \"query\",\n required: false,\n schema: {\n type: \"string\",\n pattern: \"^[a-f\\\\d]{64}$\",\n description: \"Hash of the effective schema definition\"\n },\n flag: \"expected-schema-hash\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"json\"\n },\n {\n id: \"entries.list\",\n group: \"entries\",\n command: \"list\",\n method: \"get\",\n path: \"/entries/list\",\n summary: \"List entries\",\n description:\n \"Lists entries in the selected collection, or all accessible entries when collectionID is omitted. Pass pagination.nextCursor to the next request while pagination.hasMore is true. The limit is 1 to 100 and defaults to 50.\\n\\nRequired API key permissions: read:entries. Write permissions also grant read access for the same resource.\",\n example: {\n collectionID: \"coll_example\",\n limit: 20\n },\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"collectionID\",\n location: \"query\",\n required: false,\n schema: {\n type: \"string\",\n pattern: \"^coll_[A-Za-z\\\\d]{1,22}$\"\n },\n flag: \"collection-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"collectionPath\",\n location: \"query\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Decoded content path, such as /Docs/Page or coll_ID/Page. Names are case-sensitive. Do not URL-encode names before passing them to the SDK.\"\n },\n flag: \"collection-path\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"collectionSlugPath\",\n location: \"query\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Decoded derived slug path, such as /docs/getting-started or coll_ID/getting-started. Use the returned slugPath without URL encoding.\"\n },\n flag: \"collection-slug-path\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"cursor\",\n location: \"query\",\n required: false,\n schema: {\n type: \"string\",\n pattern: \"^(?:\\\\w+?_[A-Za-z\\\\d]{1,22})$\",\n description: \"Cursor from the previous page\"\n },\n flag: \"cursor\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"limit\",\n location: \"query\",\n required: false,\n schema: {\n type: \"integer\",\n minimum: 1,\n maximum: 100,\n description: \"Maximum entries to return\"\n },\n flag: \"limit\",\n kind: \"number\",\n nullable: false\n },\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"json\",\n pagination: \"cursor\"\n },\n {\n id: \"entries.update\",\n group: \"entries\",\n command: \"update\",\n method: \"put\",\n path: \"/entries/{id}\",\n summary: \"Rename an entry\",\n description:\n \"Updates the entry name. Rejects names already used by a sibling entry or collection. An active schema migration can block this action.\\n\\nRequired API key permissions: entries. Write permissions also grant read access for the same resource.\",\n example: {\n id: \"ent_example\",\n name: \"Installation\"\n },\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"id\",\n location: \"path\",\n required: true,\n schema: {\n type: \"string\",\n pattern: \"^(?:\\\\w+?_[A-Za-z\\\\d]{1,22})$\",\n description: \"ID of the entry to be updated\"\n },\n flag: \"id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"name\",\n location: \"body\",\n required: false,\n schema: {\n type: \"string\",\n maxLength: 300,\n description: \"New name of the entry\"\n },\n flag: \"name\",\n kind: \"string\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"empty\"\n },\n {\n id: \"instance.get\",\n group: \"instance\",\n command: \"get\",\n method: \"get\",\n path: \"/instance\",\n summary: \"Get instance capabilities and limits\",\n description:\n \"Returns configured features and effective limits for the authenticated workspace. These values do not grant permissions or report live service health. No discovery request is made automatically by the SDK.\",\n example: {},\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"json\"\n },\n {\n id: \"memberships.invite\",\n group: \"memberships\",\n command: \"invite\",\n method: \"post\",\n path: \"/memberships\",\n summary: \"Invite a workspace member\",\n description:\n \"Creates an invitation and attempts email delivery. Check emailDelivery in the result. Requires the Pro plan and permission to delegate the selected role. Existing membership or pending invitation returns a conflict.\\n\\nRequired API key permissions: memberships. Write permissions also grant read access for the same resource.\",\n example: {\n email: \"editor@example.com\",\n roleID: \"rl_example\"\n },\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"email\",\n location: \"body\",\n required: true,\n schema: {\n type: \"string\",\n format: \"email\",\n description: \"Email address of the user to invite\"\n },\n flag: \"email\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"roleID\",\n location: \"body\",\n required: true,\n schema: {\n type: \"string\",\n pattern: \"^(?:\\\\w+?_[A-Za-z\\\\d]{1,22})$\",\n description: \"ID of the role to assign\"\n },\n flag: \"role-id\",\n kind: \"string\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"json\"\n },\n {\n id: \"memberships.list\",\n group: \"memberships\",\n command: \"list\",\n method: \"get\",\n path: \"/memberships\",\n summary: \"List workspace members\",\n description:\n \"Lists workspace memberships with role and user details. Use pagination.nextCursor to continue with the same filters; concurrent changes can affect later pages.\\n\\nRequired API key permissions: read:memberships. Write permissions also grant read access for the same resource.\",\n example: {},\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"cursor\",\n location: \"query\",\n required: false,\n schema: {\n type: \"string\",\n pattern: \"^(?:\\\\w+?_[A-Za-z\\\\d]{1,22})$\",\n description: \"Cursor from the previous page; keep the same filters\"\n },\n flag: \"cursor\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"limit\",\n location: \"query\",\n required: false,\n schema: {\n type: \"integer\",\n minimum: 1,\n maximum: 100,\n default: 50\n },\n flag: \"limit\",\n kind: \"number\",\n nullable: false\n },\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"json\",\n pagination: \"cursor\"\n },\n {\n id: \"memberships.listInvites\",\n group: \"memberships\",\n command: \"list-invites\",\n method: \"get\",\n path: \"/memberships/invites\",\n summary: \"List invitations\",\n description:\n \"Lists pending, unexpired workspace invitations. Use pagination.nextCursor to continue. Requires the Pro plan.\\n\\nRequired API key permissions: memberships. Write permissions also grant read access for the same resource.\",\n example: {},\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"cursor\",\n location: \"query\",\n required: false,\n schema: {\n type: \"string\",\n pattern: \"^(?:\\\\w+?_[A-Za-z\\\\d]{1,22})$\",\n description: \"Cursor from the previous page; keep the same filters\"\n },\n flag: \"cursor\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"limit\",\n location: \"query\",\n required: false,\n schema: {\n type: \"integer\",\n minimum: 1,\n maximum: 100,\n default: 50\n },\n flag: \"limit\",\n kind: \"number\",\n nullable: false\n },\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"json\",\n pagination: \"cursor\"\n },\n {\n id: \"memberships.remove\",\n group: \"memberships\",\n command: \"remove\",\n method: \"delete\",\n path: \"/memberships/{id}\",\n summary: \"Remove a workspace member\",\n description:\n \"Removes the membership and its workspace access. Administrator memberships have additional restrictions.\\n\\nRequired API key permissions: memberships. Write permissions also grant read access for the same resource.\",\n example: {\n id: \"ms_example\"\n },\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"id\",\n location: \"path\",\n required: true,\n schema: {\n type: \"string\",\n pattern: \"^(?:\\\\w+?_[A-Za-z\\\\d]{1,22})$\",\n description: \"ID of the membership to remove\"\n },\n flag: \"id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"empty\"\n },\n {\n id: \"memberships.resendInvite\",\n group: \"memberships\",\n command: \"resend-invite\",\n method: \"post\",\n path: \"/memberships/invites/{id}/resend\",\n summary: \"Resend an invitation\",\n description:\n \"Attempts email delivery again for a pending invitation. Check emailDelivery in the result. Requires the Pro plan.\\n\\nRequired API key permissions: memberships. Write permissions also grant read access for the same resource.\",\n example: {\n id: \"inv_example\"\n },\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"id\",\n location: \"path\",\n required: true,\n schema: {\n type: \"string\",\n pattern: \"^(?:\\\\w+?_[A-Za-z\\\\d]{1,22})$\",\n description: \"ID of the pending invitation\"\n },\n flag: \"id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"json\"\n },\n {\n id: \"memberships.revokeInvite\",\n group: \"memberships\",\n command: \"revoke-invite\",\n method: \"delete\",\n path: \"/memberships/invites/{id}\",\n summary: \"Revoke an invitation\",\n description:\n \"Revokes a pending invitation so it can no longer be accepted. Requires the Pro plan.\\n\\nRequired API key permissions: memberships. Write permissions also grant read access for the same resource.\",\n example: {\n id: \"inv_example\"\n },\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"id\",\n location: \"path\",\n required: true,\n schema: {\n type: \"string\",\n pattern: \"^(?:\\\\w+?_[A-Za-z\\\\d]{1,22})$\",\n description: \"ID of the invite to revoke\"\n },\n flag: \"id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"empty\"\n },\n {\n id: \"memberships.update\",\n group: \"memberships\",\n command: \"update\",\n method: \"patch\",\n path: \"/memberships/{id}\",\n summary: \"Change a member role\",\n description:\n \"Assigns a new role to a member. Requires the Pro plan and permission to delegate that role. Administrator assignments have additional restrictions.\\n\\nRequired API key permissions: memberships. Write permissions also grant read access for the same resource.\",\n example: {\n id: \"ms_example\",\n roleID: \"rl_example\"\n },\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"id\",\n location: \"path\",\n required: true,\n schema: {\n type: \"string\",\n pattern: \"^(?:\\\\w+?_[A-Za-z\\\\d]{1,22})$\",\n description: \"ID of the membership to update\"\n },\n flag: \"id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"roleID\",\n location: \"body\",\n required: true,\n schema: {\n type: \"string\",\n pattern: \"^(?:\\\\w+?_[A-Za-z\\\\d]{1,22})$\",\n description: \"New role ID\"\n },\n flag: \"role-id\",\n kind: \"string\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"empty\"\n },\n {\n id: \"publishing.bulkPublishCollections\",\n group: \"publishing\",\n command: \"bulk-publish-collections\",\n method: \"post\",\n path: \"/publishing/collections/bulk/publish\",\n summary: \"Publish collection trees\",\n description:\n \"Publishes the latest entry versions in the selected publishing-enabled collection trees. At least one ID is required. The default channel is published. Supply expectedSnapshotID from a prior channel read to reject concurrent publication changes.\\n\\nRequired API key permissions: publishing. Write permissions also grant read access for the same resource.\",\n example: {\n ids: [\"coll_example\"],\n channel: \"published\"\n },\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"channel\",\n location: \"body\",\n required: false,\n schema: {\n type: \"string\",\n minLength: 1,\n maxLength: 50,\n default: \"published\",\n description: \"Publishing channel, defaults to published\"\n },\n flag: \"channel\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"expectedSnapshotID\",\n location: \"body\",\n required: false,\n schema: {\n type: \"string\",\n pattern: \"^snp_[A-Za-z\\\\d]{1,22}$\",\n description:\n \"Reject the mutation if the channel no longer points to this reviewed snapshot\"\n },\n flag: \"expected-snapshot-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"ids\",\n location: \"body\",\n required: true,\n schema: {\n type: \"array\",\n minItems: 1,\n maxItems: 100,\n items: {\n type: \"string\",\n pattern: \"^(?:\\\\w+?_[A-Za-z\\\\d]{1,22})$\"\n },\n description: \"IDs of the collection trees to publish\"\n },\n flag: \"ids\",\n kind: \"json\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"json\"\n },\n {\n id: \"publishing.bulkPublishEntries\",\n group: \"publishing\",\n command: \"bulk-publish-entries\",\n method: \"post\",\n path: \"/publishing/entries/bulk/publish\",\n summary: \"Publish entries\",\n description:\n \"Publishes the selected entries with optional version IDs. Entries must be in publishing-enabled collections. At least one entry is required. The default channel is published. Supply expectedSnapshotID from a prior channel read to reject concurrent publication changes.\\n\\nRequired API key permissions: publishing. Write permissions also grant read access for the same resource.\",\n example: {\n entries: [\n {\n entryID: \"ent_example\"\n }\n ],\n channel: \"published\"\n },\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"channel\",\n location: \"body\",\n required: false,\n schema: {\n type: \"string\",\n minLength: 1,\n maxLength: 50,\n default: \"published\",\n description: \"Publishing channel, defaults to published\"\n },\n flag: \"channel\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"expectedSnapshotID\",\n location: \"body\",\n required: false,\n schema: {\n type: \"string\",\n pattern: \"^snp_[A-Za-z\\\\d]{1,22}$\",\n description:\n \"Reject the mutation if the channel no longer points to this reviewed snapshot\"\n },\n flag: \"expected-snapshot-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"entries\",\n location: \"body\",\n required: true,\n schema: {\n type: \"array\",\n minItems: 1,\n maxItems: 100,\n items: {\n $ref: \"#/components/schemas/PublishEntryTarget\"\n },\n description: \"Entries and versions to publish\"\n },\n flag: \"entries\",\n kind: \"json\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"empty\"\n },\n {\n id: \"publishing.bulkSetCollections\",\n group: \"publishing\",\n command: \"bulk-set-collections\",\n method: \"post\",\n path: \"/publishing/collections/bulk/set\",\n summary: \"Configure publishing for collections\",\n description:\n \"Enables publishing for the selected collections, or disables it and unpublishes their trees from all channels. When enabling, publish can also publish the latest entry versions.\\n\\nRequired API key permissions: publishing. Write permissions also grant read access for the same resource.\",\n example: {\n ids: [\"coll_example\"],\n enabled: true,\n publish: false\n },\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"ids\",\n location: \"body\",\n required: true,\n schema: {\n type: \"array\",\n minItems: 1,\n maxItems: 100,\n items: {\n type: \"string\",\n pattern: \"^(?:\\\\w+?_[A-Za-z\\\\d]{1,22})$\"\n },\n description: \"IDs of the collections to configure\"\n },\n flag: \"ids\",\n kind: \"json\",\n nullable: false\n },\n {\n name: \"expectedSnapshots\",\n location: \"body\",\n required: false,\n schema: {\n type: \"object\",\n propertyNames: {\n type: \"string\",\n minLength: 1,\n maxLength: 50\n },\n additionalProperties: {\n type: \"string\",\n pattern: \"^snp_[A-Za-z\\\\d]{1,22}$\"\n },\n description:\n \"Optional snapshot checks for supplied channels before changing collection publishing. Omitted channels are not checked.\"\n },\n flag: \"expected-snapshots\",\n kind: \"json\",\n nullable: false\n },\n {\n name: \"enabled\",\n location: \"body\",\n required: true,\n schema: {\n type: \"boolean\",\n description:\n \"Enable publishing, or disable and unpublish the collection trees from all channels\"\n },\n flag: \"enabled\",\n kind: \"boolean\",\n nullable: false\n },\n {\n name: \"publish\",\n location: \"body\",\n required: false,\n schema: {\n type: \"boolean\",\n description: \"Whether to publish latest entry versions when enabling publishing\"\n },\n flag: \"publish\",\n kind: \"boolean\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"json\"\n },\n {\n id: \"publishing.bulkUnpublishCollections\",\n group: \"publishing\",\n command: \"bulk-unpublish-collections\",\n method: \"post\",\n path: \"/publishing/collections/bulk/unpublish\",\n summary: \"Unpublish collection trees\",\n description:\n \"Removes publication assignments for the selected collection trees from the channel. At least one ID is required. The default channel is published. Supply expectedSnapshotID from a prior channel read to reject concurrent publication changes.\\n\\nRequired API key permissions: publishing. Write permissions also grant read access for the same resource.\",\n example: {\n ids: [\"coll_example\"],\n channel: \"published\"\n },\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"channel\",\n location: \"body\",\n required: false,\n schema: {\n type: \"string\",\n minLength: 1,\n maxLength: 50,\n default: \"published\",\n description: \"Publishing channel, defaults to published\"\n },\n flag: \"channel\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"expectedSnapshotID\",\n location: \"body\",\n required: false,\n schema: {\n type: \"string\",\n pattern: \"^snp_[A-Za-z\\\\d]{1,22}$\",\n description:\n \"Reject the mutation if the channel no longer points to this reviewed snapshot\"\n },\n flag: \"expected-snapshot-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"ids\",\n location: \"body\",\n required: true,\n schema: {\n type: \"array\",\n minItems: 1,\n maxItems: 100,\n items: {\n type: \"string\",\n pattern: \"^(?:\\\\w+?_[A-Za-z\\\\d]{1,22})$\"\n },\n description: \"IDs of the collection trees to unpublish\"\n },\n flag: \"ids\",\n kind: \"json\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"json\"\n },\n {\n id: \"publishing.bulkUnpublishEntries\",\n group: \"publishing\",\n command: \"bulk-unpublish-entries\",\n method: \"post\",\n path: \"/publishing/entries/bulk/unpublish\",\n summary: \"Unpublish entries\",\n description:\n \"Removes publication assignments for the selected entries from the channel. At least one ID is required. The default channel is published. Supply expectedSnapshotID from a prior channel read to reject concurrent publication changes.\\n\\nRequired API key permissions: publishing. Write permissions also grant read access for the same resource.\",\n example: {\n ids: [\"ent_example\"],\n channel: \"published\"\n },\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"channel\",\n location: \"body\",\n required: false,\n schema: {\n type: \"string\",\n minLength: 1,\n maxLength: 50,\n default: \"published\",\n description: \"Publishing channel, defaults to published\"\n },\n flag: \"channel\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"expectedSnapshotID\",\n location: \"body\",\n required: false,\n schema: {\n type: \"string\",\n pattern: \"^snp_[A-Za-z\\\\d]{1,22}$\",\n description:\n \"Reject the mutation if the channel no longer points to this reviewed snapshot\"\n },\n flag: \"expected-snapshot-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"ids\",\n location: \"body\",\n required: true,\n schema: {\n type: \"array\",\n minItems: 1,\n maxItems: 100,\n items: {\n type: \"string\",\n pattern: \"^(?:\\\\w+?_[A-Za-z\\\\d]{1,22})$\"\n },\n description: \"IDs of the entries to unpublish\"\n },\n flag: \"ids\",\n kind: \"json\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"empty\"\n },\n {\n id: \"publishing.createChannel\",\n group: \"publishing\",\n command: \"create-channel\",\n method: \"post\",\n path: \"/publishing/channels\",\n summary: \"Create a publishing channel\",\n description:\n \"Creates a publishing channel from its display name and returns the generated channel code.\\n\\nRequired API key permissions: publishing. Write permissions also grant read access for the same resource.\",\n example: {\n name: \"Preview\"\n },\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"name\",\n location: \"body\",\n required: true,\n schema: {\n type: \"string\",\n minLength: 1,\n maxLength: 50,\n description: \"Publishing channel label\"\n },\n flag: \"name\",\n kind: \"string\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"json\"\n },\n {\n id: \"publishing.deleteChannel\",\n group: \"publishing\",\n command: \"delete-channel\",\n method: \"delete\",\n path: \"/publishing/channels/{code}\",\n summary: \"Delete a publishing channel\",\n description:\n \"Deletes a custom channel and its publication assignments. The default published channel cannot be deleted.\\n\\nRequired API key permissions: publishing. Write permissions also grant read access for the same resource.\",\n example: {\n code: \"preview\"\n },\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"code\",\n location: \"path\",\n required: true,\n schema: {\n type: \"string\",\n minLength: 1,\n maxLength: 50,\n description: \"Publishing channel identifier\"\n },\n flag: \"code\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"expectedSnapshotID\",\n location: \"body\",\n required: false,\n schema: {\n type: \"string\",\n pattern: \"^snp_[A-Za-z\\\\d]{1,22}$\",\n description: \"Reject deletion if the channel snapshot changed\"\n },\n flag: \"expected-snapshot-id\",\n kind: \"string\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"empty\"\n },\n {\n id: \"publishing.getChannelContent\",\n group: \"publishing\",\n command: \"get-channel-content\",\n method: \"get\",\n path: \"/publishing/channels/{channel}/content\",\n summary: \"Get channel content and pending changes\",\n description:\n \"Returns publication state and pending changes for a publishing root, with the snapshot ID needed to review and revert changes.\\n\\nRequired API key permissions: read:publishing. Write permissions also grant read access for the same resource.\",\n example: {\n channel: \"published\",\n collectionID: \"coll_example\"\n },\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"channel\",\n location: \"path\",\n required: true,\n schema: {\n type: \"string\",\n minLength: 1,\n maxLength: 50\n },\n flag: \"channel\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"collectionID\",\n location: \"query\",\n required: true,\n schema: {\n type: \"string\",\n pattern: \"^(?:\\\\w+?_[A-Za-z\\\\d]{1,22})$\",\n description: \"Publishing root collection whose content to list\"\n },\n flag: \"collection-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"json\"\n },\n {\n id: \"publishing.getEntryVersion\",\n group: \"publishing\",\n command: \"get-entry-version\",\n method: \"get\",\n path: \"/publishing/entries/{entryID}/version\",\n summary: \"Get a published entry version\",\n description:\n \"Returns the entry version assigned to a channel, or to an explicit available snapshot, with its recorded schema metadata. Validates content against that revision. expectedSchemaHash must match it; schema-less content cannot match it. The default channel is published.\\n\\nRequired API key permissions: read:publishing. Write permissions also grant read access for the same resource.\",\n example: {\n entryID: \"ent_example\",\n channel: \"published\"\n },\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"entryID\",\n location: \"path\",\n required: true,\n schema: {\n type: \"string\",\n pattern: \"^(?:\\\\w+?_[A-Za-z\\\\d]{1,22})$\",\n description: \"Entry whose published version to get\"\n },\n flag: \"entry-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"channel\",\n location: \"query\",\n required: false,\n schema: {\n type: \"string\",\n minLength: 1,\n maxLength: 50,\n default: \"published\",\n description: \"Publishing channel, defaults to published\"\n },\n flag: \"channel\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"expectedSchemaHash\",\n location: \"query\",\n required: false,\n schema: {\n type: \"string\",\n pattern: \"^[a-f\\\\d]{64}$\",\n description: \"Hash of the effective schema definition\"\n },\n flag: \"expected-schema-hash\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"snapshotID\",\n location: \"query\",\n required: false,\n schema: {\n type: \"string\",\n pattern: \"^snp_[A-Za-z\\\\d]{1,22}$\",\n description: \"Exact publication snapshot to read\"\n },\n flag: \"snapshot-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"json\"\n },\n {\n id: \"publishing.listChannels\",\n group: \"publishing\",\n command: \"list-channels\",\n method: \"get\",\n path: \"/publishing/channels\",\n summary: \"List publishing channels\",\n description:\n \"Returns workspace publishing channels. Set includeAssignmentCount to include entry assignment counts.\\n\\nRequired API key permissions: read:publishing. Write permissions also grant read access for the same resource.\",\n example: {\n includeAssignmentCount: true\n },\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"includeAssignmentCount\",\n location: \"query\",\n required: false,\n schema: {\n type: \"boolean\",\n description: \"Whether to include the number of assigned entries\"\n },\n flag: \"include-assignment-count\",\n kind: \"boolean\",\n nullable: false\n },\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"json\"\n },\n {\n id: \"publishing.listEntryPublications\",\n group: \"publishing\",\n command: \"list-entry-publications\",\n method: \"get\",\n path: \"/publishing/entries/{entryID}/publications\",\n summary: \"List entry publications\",\n description:\n \"Returns the entry publication assignments across channels.\\n\\nRequired API key permissions: read:publishing. Write permissions also grant read access for the same resource.\",\n example: {\n entryID: \"ent_example\"\n },\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"entryID\",\n location: \"path\",\n required: true,\n schema: {\n type: \"string\",\n pattern: \"^(?:\\\\w+?_[A-Za-z\\\\d]{1,22})$\",\n description: \"Entry whose publications to list\"\n },\n flag: \"entry-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"json\"\n },\n {\n id: \"publishing.publishCollection\",\n group: \"publishing\",\n command: \"publish-collection\",\n method: \"post\",\n path: \"/publishing/collections/{collectionID}\",\n summary: \"Publish a collection tree\",\n description:\n \"Publishes the latest entry versions in a publishing-enabled collection tree to the channel. The default channel is published. Supply expectedSnapshotID from a prior channel read to reject concurrent publication changes.\\n\\nRequired API key permissions: publishing. Write permissions also grant read access for the same resource.\",\n example: {\n collectionID: \"coll_example\",\n channel: \"published\"\n },\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"collectionID\",\n location: \"path\",\n required: true,\n schema: {\n type: \"string\",\n pattern: \"^(?:\\\\w+?_[A-Za-z\\\\d]{1,22})$\",\n description: \"Collection tree to publish\"\n },\n flag: \"collection-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"channel\",\n location: \"body\",\n required: false,\n schema: {\n type: \"string\",\n minLength: 1,\n maxLength: 50,\n default: \"published\",\n description: \"Publishing channel, defaults to published\"\n },\n flag: \"channel\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"expectedSnapshotID\",\n location: \"body\",\n required: false,\n schema: {\n type: \"string\",\n pattern: \"^snp_[A-Za-z\\\\d]{1,22}$\",\n description:\n \"Reject the mutation if the channel no longer points to this reviewed snapshot\"\n },\n flag: \"expected-snapshot-id\",\n kind: \"string\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"json\"\n },\n {\n id: \"publishing.publishEntry\",\n group: \"publishing\",\n command: \"publish-entry\",\n method: \"post\",\n path: \"/publishing/entries/{entryID}\",\n summary: \"Publish an entry\",\n description:\n \"Publishes an existing version, or the latest entry content if versionID is omitted. The entry must be in a publishing-enabled collection. The default channel is published. Supply expectedSnapshotID from a prior channel read to reject concurrent publication changes.\\n\\nRequired API key permissions: publishing. Write permissions also grant read access for the same resource.\",\n example: {\n entryID: \"ent_example\",\n channel: \"published\"\n },\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"entryID\",\n location: \"path\",\n required: true,\n schema: {\n type: \"string\",\n pattern: \"^(?:\\\\w+?_[A-Za-z\\\\d]{1,22})$\",\n description: \"Entry to publish\"\n },\n flag: \"entry-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"channel\",\n location: \"body\",\n required: false,\n schema: {\n type: \"string\",\n minLength: 1,\n maxLength: 50,\n default: \"published\",\n description: \"Publishing channel, defaults to published\"\n },\n flag: \"channel\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"expectedSnapshotID\",\n location: \"body\",\n required: false,\n schema: {\n type: \"string\",\n pattern: \"^snp_[A-Za-z\\\\d]{1,22}$\",\n description:\n \"Reject the mutation if the channel no longer points to this reviewed snapshot\"\n },\n flag: \"expected-snapshot-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"versionID\",\n location: \"body\",\n required: false,\n schema: {\n type: \"string\",\n pattern: \"^(?:\\\\w+?_[A-Za-z\\\\d]{1,22})$\",\n description: \"Existing version to publish\"\n },\n flag: \"version-id\",\n kind: \"string\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"empty\"\n },\n {\n id: \"publishing.revertChanges\",\n group: \"publishing\",\n command: \"revert-changes\",\n method: \"post\",\n path: \"/publishing/changes/revert\",\n summary: \"Revert pending publishing changes\",\n description:\n \"Restores selected drafts to the reviewed publication snapshot. This can remove unpublished items and replace draft content. First review publishing.getChannelContent and pass its snapshotID. Use all: true or specific collectionIDs/entryIDs, never both. Requires write access to affected resources in addition to read:publishing.\\n\\nRequired API key permissions: read:publishing. Write permissions also grant read access for the same resource.\",\n example: {\n collectionID: \"coll_example\",\n snapshotID: \"snp_example\",\n entryIDs: [\"ent_example\"],\n channel: \"published\"\n },\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"channel\",\n location: \"body\",\n required: false,\n schema: {\n type: \"string\",\n minLength: 1,\n maxLength: 50,\n default: \"published\",\n description: \"Publishing channel, defaults to published\"\n },\n flag: \"channel\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"all\",\n location: \"body\",\n required: false,\n schema: {\n type: \"boolean\",\n description: \"Whether to revert all pending changes\"\n },\n flag: \"all\",\n kind: \"boolean\",\n nullable: false\n },\n {\n name: \"collectionID\",\n location: \"body\",\n required: true,\n schema: {\n type: \"string\",\n pattern: \"^(?:\\\\w+?_[A-Za-z\\\\d]{1,22})$\",\n description: \"Publishing root collection\"\n },\n flag: \"collection-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"collectionIDs\",\n location: \"body\",\n required: false,\n schema: {\n type: \"array\",\n maxItems: 100,\n items: {\n type: \"string\",\n pattern: \"^(?:\\\\w+?_[A-Za-z\\\\d]{1,22})$\"\n },\n description: \"Collections whose changes to revert\"\n },\n flag: \"collection-ids\",\n kind: \"json\",\n nullable: false\n },\n {\n name: \"entryIDs\",\n location: \"body\",\n required: false,\n schema: {\n type: \"array\",\n maxItems: 100,\n items: {\n type: \"string\",\n pattern: \"^(?:\\\\w+?_[A-Za-z\\\\d]{1,22})$\"\n },\n description: \"Entries whose changes to revert\"\n },\n flag: \"entry-ids\",\n kind: \"json\",\n nullable: false\n },\n {\n name: \"snapshotID\",\n location: \"body\",\n required: true,\n schema: {\n type: \"string\",\n pattern: \"^snp_[A-Za-z\\\\d]{1,22}$\",\n description: \"Snapshot used to review the changes\"\n },\n flag: \"snapshot-id\",\n kind: \"string\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"json\"\n },\n {\n id: \"publishing.setCollection\",\n group: \"publishing\",\n command: \"set-collection\",\n method: \"put\",\n path: \"/publishing/collections/{collectionID}\",\n summary: \"Configure collection publishing\",\n description:\n \"Enables publishing for a collection, or disables it and unpublishes its tree from all channels. When enabling, publish can also publish the latest entry versions.\\n\\nRequired API key permissions: publishing. Write permissions also grant read access for the same resource.\",\n example: {\n collectionID: \"coll_example\",\n enabled: true,\n publish: false\n },\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"collectionID\",\n location: \"path\",\n required: true,\n schema: {\n type: \"string\",\n pattern: \"^(?:\\\\w+?_[A-Za-z\\\\d]{1,22})$\",\n description: \"Collection to configure\"\n },\n flag: \"collection-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"expectedSnapshots\",\n location: \"body\",\n required: false,\n schema: {\n type: \"object\",\n propertyNames: {\n type: \"string\",\n minLength: 1,\n maxLength: 50\n },\n additionalProperties: {\n type: \"string\",\n pattern: \"^snp_[A-Za-z\\\\d]{1,22}$\"\n },\n description:\n \"Optional snapshot checks for supplied channels before changing collection publishing. Omitted channels are not checked.\"\n },\n flag: \"expected-snapshots\",\n kind: \"json\",\n nullable: false\n },\n {\n name: \"enabled\",\n location: \"body\",\n required: true,\n schema: {\n type: \"boolean\",\n description:\n \"Enable publishing, or disable and unpublish the collection tree from all channels\"\n },\n flag: \"enabled\",\n kind: \"boolean\",\n nullable: false\n },\n {\n name: \"publish\",\n location: \"body\",\n required: false,\n schema: {\n type: \"boolean\",\n description: \"Whether to publish latest entry versions when enabling publishing\"\n },\n flag: \"publish\",\n kind: \"boolean\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"json\"\n },\n {\n id: \"publishing.unpublishCollection\",\n group: \"publishing\",\n command: \"unpublish-collection\",\n method: \"delete\",\n path: \"/publishing/collections/{collectionID}\",\n summary: \"Unpublish a collection tree\",\n description:\n \"Removes publication assignments for a collection tree from the channel. The default channel is published. Supply expectedSnapshotID from a prior channel read to reject concurrent publication changes.\\n\\nRequired API key permissions: publishing. Write permissions also grant read access for the same resource.\",\n example: {\n collectionID: \"coll_example\",\n channel: \"published\"\n },\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"collectionID\",\n location: \"path\",\n required: true,\n schema: {\n type: \"string\",\n pattern: \"^(?:\\\\w+?_[A-Za-z\\\\d]{1,22})$\",\n description: \"Collection tree to unpublish\"\n },\n flag: \"collection-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"channel\",\n location: \"body\",\n required: false,\n schema: {\n type: \"string\",\n minLength: 1,\n maxLength: 50,\n default: \"published\",\n description: \"Publishing channel, defaults to published\"\n },\n flag: \"channel\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"expectedSnapshotID\",\n location: \"body\",\n required: false,\n schema: {\n type: \"string\",\n pattern: \"^snp_[A-Za-z\\\\d]{1,22}$\",\n description:\n \"Reject the mutation if the channel no longer points to this reviewed snapshot\"\n },\n flag: \"expected-snapshot-id\",\n kind: \"string\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"json\"\n },\n {\n id: \"publishing.unpublishEntry\",\n group: \"publishing\",\n command: \"unpublish-entry\",\n method: \"delete\",\n path: \"/publishing/entries/{entryID}\",\n summary: \"Unpublish an entry\",\n description:\n \"Removes the entry publication from the channel. Supply versionID to require that version to be assigned; a changed assignment returns a conflict. The default channel is published. Supply expectedSnapshotID from a prior channel read to reject concurrent publication changes.\\n\\nRequired API key permissions: publishing. Write permissions also grant read access for the same resource.\",\n example: {\n entryID: \"ent_example\",\n channel: \"published\",\n versionID: \"ver_example\"\n },\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"entryID\",\n location: \"path\",\n required: true,\n schema: {\n type: \"string\",\n pattern: \"^(?:\\\\w+?_[A-Za-z\\\\d]{1,22})$\",\n description: \"Entry to unpublish\"\n },\n flag: \"entry-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"channel\",\n location: \"body\",\n required: false,\n schema: {\n type: \"string\",\n minLength: 1,\n maxLength: 50,\n default: \"published\",\n description: \"Publishing channel, defaults to published\"\n },\n flag: \"channel\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"expectedSnapshotID\",\n location: \"body\",\n required: false,\n schema: {\n type: \"string\",\n pattern: \"^snp_[A-Za-z\\\\d]{1,22}$\",\n description:\n \"Reject the mutation if the channel no longer points to this reviewed snapshot\"\n },\n flag: \"expected-snapshot-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"versionID\",\n location: \"body\",\n required: false,\n schema: {\n type: \"string\",\n pattern: \"^(?:\\\\w+?_[A-Za-z\\\\d]{1,22})$\",\n description: \"Version expected to be assigned\"\n },\n flag: \"version-id\",\n kind: \"string\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"empty\"\n },\n {\n id: \"roles.create\",\n group: \"roles\",\n command: \"create\",\n method: \"post\",\n path: \"/roles\",\n summary: \"Create a role\",\n description:\n \"Creates a workspace role. Names are unique without regard to case and must contain 1 to 50 characters after trimming. Requires the Pro plan and permission to delegate the selected permissions.\\n\\nRequired API key permissions: roles. Write permissions also grant read access for the same resource.\",\n example: {\n name: \"Editor\",\n permissions: [\"content\"]\n },\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"name\",\n location: \"body\",\n required: true,\n schema: {\n type: \"string\",\n minLength: 1,\n maxLength: 50,\n description: \"Name of the role\"\n },\n flag: \"name\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"permissions\",\n location: \"body\",\n required: true,\n schema: {\n type: \"array\",\n items: {\n $ref: \"#/components/schemas/Permission\"\n },\n description: \"Permissions to grant to the role\"\n },\n flag: \"permissions\",\n kind: \"json\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"json\"\n },\n {\n id: \"roles.delete\",\n group: \"roles\",\n command: \"delete\",\n method: \"delete\",\n path: \"/roles/{id}\",\n summary: \"Delete a role\",\n description:\n \"Deletes a custom role and updates its assignments. Built-in roles cannot be deleted. Requires the Pro plan.\\n\\nRequired API key permissions: roles. Write permissions also grant read access for the same resource.\",\n example: {\n id: \"rl_example\"\n },\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"id\",\n location: \"path\",\n required: true,\n schema: {\n type: \"string\",\n pattern: \"^(?:\\\\w+?_[A-Za-z\\\\d]{1,22})$\",\n description: \"ID of the role to delete\"\n },\n flag: \"id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"empty\"\n },\n {\n id: \"roles.list\",\n group: \"roles\",\n command: \"list\",\n method: \"get\",\n path: \"/roles\",\n summary: \"List roles\",\n description:\n \"Returns workspace roles and their permissions.\\n\\nRequired API key permissions: read:roles. Write permissions also grant read access for the same resource.\",\n example: {},\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"json\"\n },\n {\n id: \"roles.update\",\n group: \"roles\",\n command: \"update\",\n method: \"put\",\n path: \"/roles/{id}\",\n summary: \"Update a role\",\n description:\n \"Changes a role name or permissions. Names are unique without regard to case. Requires the Pro plan and permission to delegate the selected permissions. Built-in roles have additional restrictions.\\n\\nRequired API key permissions: roles. Write permissions also grant read access for the same resource.\",\n example: {\n id: \"rl_example\",\n name: \"Content editor\"\n },\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"id\",\n location: \"path\",\n required: true,\n schema: {\n type: \"string\",\n pattern: \"^(?:\\\\w+?_[A-Za-z\\\\d]{1,22})$\",\n description: \"ID of the role to update\"\n },\n flag: \"id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"name\",\n location: \"body\",\n required: false,\n schema: {\n type: \"string\",\n minLength: 1,\n maxLength: 50,\n description: \"New name for the role\"\n },\n flag: \"name\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"permissions\",\n location: \"body\",\n required: false,\n schema: {\n type: \"array\",\n items: {\n $ref: \"#/components/schemas/Permission\"\n },\n description: \"New permissions for the role\"\n },\n flag: \"permissions\",\n kind: \"json\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"empty\"\n },\n {\n id: \"schemaMigrations.get\",\n group: \"schema-migrations\",\n command: \"get\",\n method: \"get\",\n path: \"/schema-migrations/{id}\",\n summary: \"Get schema migration status\",\n description:\n \"Returns bounded migration progress and status. Use schemaMigrations.listContentLossEntries for per-entry content loss details. Check status before repeating an operation blocked by this migration.\\n\\nRequired API key permissions: read:collections. Write permissions also grant read access for the same resource.\",\n example: {\n id: \"smg_example\"\n },\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"id\",\n location: \"path\",\n required: true,\n schema: {\n type: \"string\",\n pattern: \"^(?:\\\\w+?_[A-Za-z\\\\d]{1,22})$\",\n description: \"ID of the schema migration\"\n },\n flag: \"id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"json\"\n },\n {\n id: \"schemaMigrations.getActive\",\n group: \"schema-migrations\",\n command: \"get-active\",\n method: \"get\",\n path: \"/collections/{collectionID}/schema-migration\",\n summary: \"Get the active schema migration\",\n description:\n \"Returns the active migration for a collection, or null when none is active.\\n\\nRequired API key permissions: read:collections. Write permissions also grant read access for the same resource.\",\n example: {\n collectionID: \"coll_example\"\n },\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"collectionID\",\n location: \"path\",\n required: true,\n schema: {\n type: \"string\",\n pattern: \"^(?:\\\\w+?_[A-Za-z\\\\d]{1,22})$\",\n description: \"ID of the affected collection\"\n },\n flag: \"collection-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"json\"\n },\n {\n id: \"schemaMigrations.listContentLossEntries\",\n group: \"schema-migrations\",\n command: \"list-content-loss-entries\",\n method: \"get\",\n path: \"/schema-migrations/{id}/content-loss-entries\",\n summary: \"List entries with migration content loss\",\n description:\n \"Lists accessible, non-deleted entries that lost content in a completed migration. Returns an empty page until completion. Use pagination.nextCursor to continue.\\n\\nRequired API key permissions: read:collections. Write permissions also grant read access for the same resource.\",\n example: {\n id: \"smg_example\",\n limit: 20\n },\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"id\",\n location: \"path\",\n required: true,\n schema: {\n type: \"string\",\n pattern: \"^(?:\\\\w+?_[A-Za-z\\\\d]{1,22})$\"\n },\n flag: \"id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"cursor\",\n location: \"query\",\n required: false,\n schema: {\n type: \"string\",\n pattern: \"^(?:\\\\w+?_[A-Za-z\\\\d]{1,22})$\",\n description: \"Cursor from the previous page; keep the same filters\"\n },\n flag: \"cursor\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"limit\",\n location: \"query\",\n required: false,\n schema: {\n type: \"integer\",\n minimum: 1,\n maximum: 100,\n default: 50\n },\n flag: \"limit\",\n kind: \"number\",\n nullable: false\n },\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"json\",\n pagination: \"cursor\"\n },\n {\n id: \"schemas.apply\",\n group: \"schemas\",\n command: \"apply\",\n method: \"post\",\n path: \"/schemas/{schemaID}/apply\",\n summary: \"Apply a schema draft\",\n description:\n \"Creates a schema version from the draft and starts any required migration of affected entry content. Review possible content removal before calling: confirmedDataLoss must be true. Use schemaMigrations.get to follow a returned migrationID.\\n\\nRequired API key permissions: collections. Write permissions also grant read access for the same resource.\",\n example: {\n schemaID: \"sch_example\",\n confirmedDataLoss: true,\n name: \"Reviewed schema\"\n },\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"schemaID\",\n location: \"path\",\n required: true,\n schema: {\n type: \"string\",\n pattern: \"^(?:\\\\w+?_[A-Za-z\\\\d]{1,22})$\",\n description: \"ID of the local collection schema\"\n },\n flag: \"schema-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"confirmedDataLoss\",\n location: \"body\",\n required: true,\n schema: {\n const: true,\n description: \"Confirmation that the migration can remove entry content\"\n },\n flag: \"confirmed-data-loss\",\n kind: \"boolean\",\n nullable: false\n },\n {\n name: \"name\",\n location: \"body\",\n required: false,\n schema: {\n type: \"string\",\n minLength: 1,\n maxLength: 100,\n description: \"Optional version name\"\n },\n flag: \"name\",\n kind: \"string\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"json\"\n },\n {\n id: \"schemas.create\",\n group: \"schemas\",\n command: \"create\",\n method: \"post\",\n path: \"/collections/{collectionID}/schema\",\n summary: \"Create a local collection schema\",\n description:\n \"Creates a local schema draft for the collection. Use schemas.get to inspect local and effective schemas.\\n\\nRequired API key permissions: collections. Write permissions also grant read access for the same resource.\",\n example: {\n collectionID: \"coll_example\"\n },\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"collectionID\",\n location: \"path\",\n required: true,\n schema: {\n type: \"string\",\n pattern: \"^(?:\\\\w+?_[A-Za-z\\\\d]{1,22})$\",\n description: \"ID of the collection\"\n },\n flag: \"collection-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"json\"\n },\n {\n id: \"schemas.delete\",\n group: \"schemas\",\n command: \"delete\",\n method: \"delete\",\n path: \"/schemas/{schemaID}\",\n summary: \"Delete a local schema\",\n description:\n \"Removes the local schema and recalculates inherited schemas. This can start a content migration. Review possible content removal before setting confirmedDataLoss. Use schemaMigrations.get with a returned migrationID.\\n\\nRequired API key permissions: collections. Write permissions also grant read access for the same resource.\",\n example: {\n schemaID: \"sch_example\",\n confirmedDataLoss: false\n },\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"schemaID\",\n location: \"path\",\n required: true,\n schema: {\n type: \"string\",\n pattern: \"^(?:\\\\w+?_[A-Za-z\\\\d]{1,22})$\",\n description: \"ID of the local collection schema\"\n },\n flag: \"schema-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"confirmedDataLoss\",\n location: \"body\",\n required: false,\n schema: {\n type: \"boolean\",\n default: false,\n description: \"Confirmation that an inherited-schema migration can remove entry content\"\n },\n flag: \"confirmed-data-loss\",\n kind: \"boolean\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"json\"\n },\n {\n id: \"schemas.get\",\n group: \"schemas\",\n command: \"get\",\n method: \"get\",\n path: \"/schemas/collection\",\n summary: \"Get collection schemas\",\n description:\n \"Returns local and effective schema details for the collection, including inheritance.\\n\\nRequired API key permissions: read:collections. Write permissions also grant read access for the same resource.\",\n example: {\n collectionID: \"coll_example\"\n },\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"collectionID\",\n location: \"query\",\n required: false,\n schema: {\n type: \"string\",\n pattern: \"^coll_[A-Za-z\\\\d]{1,22}$\"\n },\n flag: \"collection-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"collectionPath\",\n location: \"query\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Decoded content path, such as /Docs/Page or coll_ID/Page. Names are case-sensitive. Do not URL-encode names before passing them to the SDK.\"\n },\n flag: \"collection-path\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"collectionSlugPath\",\n location: \"query\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Decoded derived slug path, such as /docs/getting-started or coll_ID/getting-started. Use the returned slugPath without URL encoding.\"\n },\n flag: \"collection-slug-path\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"json\"\n },\n {\n id: \"schemas.getRevision\",\n group: \"schemas\",\n command: \"get-revision\",\n method: \"get\",\n path: \"/schema-revisions/{revisionID}\",\n summary: \"Get an exact schema revision\",\n description:\n \"Returns the recorded effective definition, including inherited fields. Requires read access to the revision's collection. The definition is independent of the currently active schema.\\n\\nRequired API key permissions: read:collections. Write permissions also grant read access for the same resource.\",\n example: {\n revisionID: \"schr_example\"\n },\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"revisionID\",\n location: \"path\",\n required: true,\n schema: {\n type: \"string\",\n pattern: \"^schr_[A-Za-z\\\\d]{1,22}$\"\n },\n flag: \"revision-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"json\"\n },\n {\n id: \"schemaVersions.get\",\n group: \"schema-versions\",\n command: \"get\",\n method: \"get\",\n path: \"/schema-versions/{id}\",\n summary: \"Get a schema version\",\n description:\n \"Returns a saved schema version and its definition.\\n\\nRequired API key permissions: read:collections. Write permissions also grant read access for the same resource.\",\n example: {\n id: \"schv_example\"\n },\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"id\",\n location: \"path\",\n required: true,\n schema: {\n type: \"string\",\n pattern: \"^(?:\\\\w+?_[A-Za-z\\\\d]{1,22})$\",\n description: \"ID of the schema version\"\n },\n flag: \"id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"json\"\n },\n {\n id: \"schemaVersions.list\",\n group: \"schema-versions\",\n command: \"list\",\n method: \"get\",\n path: \"/schemas/{schemaID}/versions\",\n summary: \"List schema versions\",\n description:\n \"Lists versions of a local collection schema. Pass pagination.nextCursor to the next request while pagination.hasMore is true. The limit is 1 to 100.\\n\\nRequired API key permissions: read:collections. Write permissions also grant read access for the same resource.\",\n example: {\n schemaID: \"sch_example\",\n limit: 20\n },\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"schemaID\",\n location: \"path\",\n required: true,\n schema: {\n type: \"string\",\n pattern: \"^(?:\\\\w+?_[A-Za-z\\\\d]{1,22})$\",\n description: \"ID of the local collection schema\"\n },\n flag: \"schema-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"cursor\",\n location: \"query\",\n required: false,\n schema: {\n type: \"string\",\n pattern: \"^(?:\\\\w+?_[A-Za-z\\\\d]{1,22})$\",\n description: \"Cursor from the previous page\"\n },\n flag: \"cursor\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"limit\",\n location: \"query\",\n required: false,\n schema: {\n type: \"integer\",\n minimum: 1,\n maximum: 100,\n description: \"Maximum versions to return\"\n },\n flag: \"limit\",\n kind: \"number\",\n nullable: false\n },\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"json\",\n pagination: \"cursor\"\n },\n {\n id: \"schemaVersions.revert\",\n group: \"schema-versions\",\n command: \"revert\",\n method: \"post\",\n path: \"/schema-versions/{id}/revert\",\n summary: \"Restore a schema version\",\n description:\n \"Restores the selected definition and starts any required content migration. Review possible content removal before calling: confirmedDataLoss must be true. Use schemaMigrations.get to follow a returned migrationID.\\n\\nRequired API key permissions: collections. Write permissions also grant read access for the same resource.\",\n example: {\n id: \"schv_example\",\n confirmedDataLoss: true\n },\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"id\",\n location: \"path\",\n required: true,\n schema: {\n type: \"string\",\n pattern: \"^(?:\\\\w+?_[A-Za-z\\\\d]{1,22})$\",\n description: \"ID of the schema version to restore\"\n },\n flag: \"id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"confirmedDataLoss\",\n location: \"body\",\n required: true,\n schema: {\n const: true,\n description: \"Confirmation that the migration can remove entry content\"\n },\n flag: \"confirmed-data-loss\",\n kind: \"boolean\",\n nullable: false\n },\n {\n name: \"name\",\n location: \"body\",\n required: false,\n schema: {\n type: \"string\",\n minLength: 1,\n maxLength: 100,\n description: \"Optional version name\"\n },\n flag: \"name\",\n kind: \"string\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"json\"\n },\n {\n id: \"schemaVersions.update\",\n group: \"schema-versions\",\n command: \"update\",\n method: \"patch\",\n path: \"/schema-versions/{id}\",\n summary: \"Rename a schema version\",\n description:\n \"Changes the saved version name. Set name to null to remove the name.\\n\\nRequired API key permissions: collections. Write permissions also grant read access for the same resource.\",\n example: {\n id: \"schv_example\",\n name: \"Reviewed schema\"\n },\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"id\",\n location: \"path\",\n required: true,\n schema: {\n type: \"string\",\n pattern: \"^(?:\\\\w+?_[A-Za-z\\\\d]{1,22})$\",\n description: \"ID of the schema version\"\n },\n flag: \"id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"name\",\n location: \"body\",\n required: true,\n schema: {\n anyOf: [\n {\n type: \"string\",\n minLength: 1,\n maxLength: 100\n },\n {\n type: \"null\"\n }\n ],\n description: \"New version name, or null to remove it\"\n },\n flag: \"name\",\n kind: \"string\",\n nullable: true\n }\n ],\n conditional: false,\n response: \"empty\"\n },\n {\n id: \"search.askCurrent\",\n group: \"search\",\n command: \"ask-current\",\n method: \"post\",\n path: \"/search/current/ask\",\n summary: \"Ask AI about current content\",\n description:\n \"Returns a complete answer with numbered sources. Requires explicit ai-answers permission in addition to content read permissions. Accepts up to 1,000 question characters, 10 history messages of up to 4,000 characters each, and 20 property filters. Uses 3 AI credits and the Ask AI rate limit. Use a secret key on your server, or a publishable key for published content.\\n\\nRequired API key permissions: ai-answers, read:entries, read:collections. Write permissions also grant read access for the same resource.\",\n example: {\n question: \"How do I install Andesine?\"\n },\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"question\",\n location: \"body\",\n required: true,\n schema: {\n type: \"string\",\n minLength: 1,\n maxLength: 1000\n },\n flag: \"question\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"collectionID\",\n location: \"body\",\n required: false,\n schema: {\n type: \"string\",\n pattern: \"^coll_[A-Za-z\\\\d]{1,22}$\"\n },\n flag: \"collection-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"collectionPath\",\n location: \"body\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Decoded content path, such as /Docs/Page or coll_ID/Page. Names are case-sensitive. Do not URL-encode names before passing them to the SDK.\"\n },\n flag: \"collection-path\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"collectionSlugPath\",\n location: \"body\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Decoded derived slug path, such as /docs/getting-started or coll_ID/getting-started. Use the returned slugPath without URL encoding.\"\n },\n flag: \"collection-slug-path\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"filters\",\n location: \"body\",\n required: false,\n schema: {\n type: \"array\",\n maxItems: 20,\n items: {\n $ref: \"#/components/schemas/PropertyFilter\"\n },\n default: []\n },\n flag: \"filters\",\n kind: \"json\",\n nullable: false\n },\n {\n name: \"history\",\n location: \"body\",\n required: false,\n schema: {\n type: \"array\",\n maxItems: 10,\n items: {\n $ref: \"#/components/schemas/AnswerHistoryMessage\"\n },\n default: []\n },\n flag: \"history\",\n kind: \"json\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"json\"\n },\n {\n id: \"search.askCurrentStream\",\n group: \"search\",\n command: \"ask-current-stream\",\n method: \"post\",\n path: \"/search/current/ask/stream\",\n summary: \"Stream an AI answer about current content\",\n description:\n \"Emits sources, textDelta, and completed events over SSE. Uses the same inputs, permissions, AI credits, and rate limit as complete answers. Stream errors use SSE error frames. Never reconnect automatically.\\n\\nRequired API key permissions: ai-answers, read:entries, read:collections. Write permissions also grant read access for the same resource.\",\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"question\",\n location: \"body\",\n required: true,\n schema: {\n type: \"string\",\n minLength: 1,\n maxLength: 1000\n },\n flag: \"question\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"collectionID\",\n location: \"body\",\n required: false,\n schema: {\n type: \"string\",\n pattern: \"^coll_[A-Za-z\\\\d]{1,22}$\"\n },\n flag: \"collection-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"collectionPath\",\n location: \"body\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Decoded content path, such as /Docs/Page or coll_ID/Page. Names are case-sensitive. Do not URL-encode names before passing them to the SDK.\"\n },\n flag: \"collection-path\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"collectionSlugPath\",\n location: \"body\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Decoded derived slug path, such as /docs/getting-started or coll_ID/getting-started. Use the returned slugPath without URL encoding.\"\n },\n flag: \"collection-slug-path\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"filters\",\n location: \"body\",\n required: false,\n schema: {\n type: \"array\",\n maxItems: 20,\n items: {\n $ref: \"#/components/schemas/PropertyFilter\"\n },\n default: []\n },\n flag: \"filters\",\n kind: \"json\",\n nullable: false\n },\n {\n name: \"history\",\n location: \"body\",\n required: false,\n schema: {\n type: \"array\",\n maxItems: 10,\n items: {\n $ref: \"#/components/schemas/AnswerHistoryMessage\"\n },\n default: []\n },\n flag: \"history\",\n kind: \"json\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"stream\"\n },\n {\n id: \"search.askPublished\",\n group: \"search\",\n command: \"ask-published\",\n method: \"post\",\n path: \"/search/published/ask\",\n summary: \"Ask AI about published content\",\n description:\n \"Returns a complete answer with numbered sources. Requires explicit ai-answers permission in addition to content read permissions. Accepts up to 1,000 question characters, 10 history messages of up to 4,000 characters each, and 20 property filters. Uses 3 AI credits and the Ask AI rate limit. Use a secret key on your server, or a publishable key for published content.\\n\\nRequired API key permissions: ai-answers, read:publishing. Write permissions also grant read access for the same resource.\",\n example: {\n question: \"How do I install Andesine?\",\n channel: \"published\"\n },\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"question\",\n location: \"body\",\n required: true,\n schema: {\n type: \"string\",\n minLength: 1,\n maxLength: 1000\n },\n flag: \"question\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"collectionID\",\n location: \"body\",\n required: false,\n schema: {\n type: \"string\",\n pattern: \"^coll_[A-Za-z\\\\d]{1,22}$\"\n },\n flag: \"collection-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"collectionPath\",\n location: \"body\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Decoded content path, such as /Docs/Page or coll_ID/Page. Names are case-sensitive. Do not URL-encode names before passing them to the SDK.\"\n },\n flag: \"collection-path\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"collectionSlugPath\",\n location: \"body\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Decoded derived slug path, such as /docs/getting-started or coll_ID/getting-started. Use the returned slugPath without URL encoding.\"\n },\n flag: \"collection-slug-path\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"filters\",\n location: \"body\",\n required: false,\n schema: {\n type: \"array\",\n maxItems: 20,\n items: {\n $ref: \"#/components/schemas/PropertyFilter\"\n },\n default: []\n },\n flag: \"filters\",\n kind: \"json\",\n nullable: false\n },\n {\n name: \"history\",\n location: \"body\",\n required: false,\n schema: {\n type: \"array\",\n maxItems: 10,\n items: {\n $ref: \"#/components/schemas/AnswerHistoryMessage\"\n },\n default: []\n },\n flag: \"history\",\n kind: \"json\",\n nullable: false\n },\n {\n name: \"channel\",\n location: \"body\",\n required: true,\n schema: {\n type: \"string\",\n minLength: 1,\n maxLength: 50,\n description: \"Publishing channel to search\"\n },\n flag: \"channel\",\n kind: \"string\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"json\"\n },\n {\n id: \"search.askPublishedStream\",\n group: \"search\",\n command: \"ask-published-stream\",\n method: \"post\",\n path: \"/search/published/ask/stream\",\n summary: \"Stream an AI answer about published content\",\n description:\n \"Emits sources, textDelta, and completed events over SSE. Uses the same inputs, permissions, AI credits, and rate limit as complete answers. Stream errors use SSE error frames. Never reconnect automatically.\\n\\nRequired API key permissions: ai-answers, read:publishing. Write permissions also grant read access for the same resource.\",\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"question\",\n location: \"body\",\n required: true,\n schema: {\n type: \"string\",\n minLength: 1,\n maxLength: 1000\n },\n flag: \"question\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"collectionID\",\n location: \"body\",\n required: false,\n schema: {\n type: \"string\",\n pattern: \"^coll_[A-Za-z\\\\d]{1,22}$\"\n },\n flag: \"collection-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"collectionPath\",\n location: \"body\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Decoded content path, such as /Docs/Page or coll_ID/Page. Names are case-sensitive. Do not URL-encode names before passing them to the SDK.\"\n },\n flag: \"collection-path\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"collectionSlugPath\",\n location: \"body\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Decoded derived slug path, such as /docs/getting-started or coll_ID/getting-started. Use the returned slugPath without URL encoding.\"\n },\n flag: \"collection-slug-path\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"filters\",\n location: \"body\",\n required: false,\n schema: {\n type: \"array\",\n maxItems: 20,\n items: {\n $ref: \"#/components/schemas/PropertyFilter\"\n },\n default: []\n },\n flag: \"filters\",\n kind: \"json\",\n nullable: false\n },\n {\n name: \"history\",\n location: \"body\",\n required: false,\n schema: {\n type: \"array\",\n maxItems: 10,\n items: {\n $ref: \"#/components/schemas/AnswerHistoryMessage\"\n },\n default: []\n },\n flag: \"history\",\n kind: \"json\",\n nullable: false\n },\n {\n name: \"channel\",\n location: \"body\",\n required: true,\n schema: {\n type: \"string\",\n minLength: 1,\n maxLength: 50,\n description: \"Publishing channel to search\"\n },\n flag: \"channel\",\n kind: \"string\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"stream\"\n },\n {\n id: \"search.current\",\n group: \"search\",\n command: \"current\",\n method: \"post\",\n path: \"/search/current\",\n summary: \"Search current content\",\n description:\n \"Searches current entry content by text and optional property filters. Up to 20 filters and 50 results are allowed. Semantic search is optional, uses 1 AI credit, and has a separate rate limit.\\n\\nRequired API key permissions: read:entries, read:collections. Write permissions also grant read access for the same resource.\",\n example: {\n query: \"installation\",\n limit: 10\n },\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"query\",\n location: \"body\",\n required: true,\n schema: {\n type: \"string\",\n maxLength: 500\n },\n flag: \"query\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"collectionID\",\n location: \"body\",\n required: false,\n schema: {\n type: \"string\",\n pattern: \"^coll_[A-Za-z\\\\d]{1,22}$\"\n },\n flag: \"collection-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"collectionPath\",\n location: \"body\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Decoded content path, such as /Docs/Page or coll_ID/Page. Names are case-sensitive. Do not URL-encode names before passing them to the SDK.\"\n },\n flag: \"collection-path\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"collectionSlugPath\",\n location: \"body\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Decoded derived slug path, such as /docs/getting-started or coll_ID/getting-started. Use the returned slugPath without URL encoding.\"\n },\n flag: \"collection-slug-path\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"filters\",\n location: \"body\",\n required: false,\n schema: {\n type: \"array\",\n maxItems: 20,\n items: {\n $ref: \"#/components/schemas/PropertyFilter\"\n },\n default: []\n },\n flag: \"filters\",\n kind: \"json\",\n nullable: false\n },\n {\n name: \"limit\",\n location: \"body\",\n required: false,\n schema: {\n type: \"integer\",\n minimum: 1,\n maximum: 50,\n default: 20\n },\n flag: \"limit\",\n kind: \"number\",\n nullable: false\n },\n {\n name: \"semantic\",\n location: \"body\",\n required: false,\n schema: {\n type: \"boolean\",\n default: false,\n description: \"Whether to combine keyword and vector search\"\n },\n flag: \"semantic\",\n kind: \"boolean\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"json\"\n },\n {\n id: \"search.published\",\n group: \"search\",\n command: \"published\",\n method: \"post\",\n path: \"/search/published\",\n summary: \"Search published content\",\n description:\n \"Searches content published to the required channel. Up to 20 filters and 50 results are allowed. Semantic search is optional, uses 1 AI credit, and has a separate rate limit.\\n\\nRequired API key permissions: read:publishing. Write permissions also grant read access for the same resource.\",\n example: {\n query: \"installation\",\n channel: \"published\",\n limit: 10\n },\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"query\",\n location: \"body\",\n required: true,\n schema: {\n type: \"string\",\n maxLength: 500\n },\n flag: \"query\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"collectionID\",\n location: \"body\",\n required: false,\n schema: {\n type: \"string\",\n pattern: \"^coll_[A-Za-z\\\\d]{1,22}$\"\n },\n flag: \"collection-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"collectionPath\",\n location: \"body\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Decoded content path, such as /Docs/Page or coll_ID/Page. Names are case-sensitive. Do not URL-encode names before passing them to the SDK.\"\n },\n flag: \"collection-path\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"collectionSlugPath\",\n location: \"body\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Decoded derived slug path, such as /docs/getting-started or coll_ID/getting-started. Use the returned slugPath without URL encoding.\"\n },\n flag: \"collection-slug-path\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"filters\",\n location: \"body\",\n required: false,\n schema: {\n type: \"array\",\n maxItems: 20,\n items: {\n $ref: \"#/components/schemas/PropertyFilter\"\n },\n default: []\n },\n flag: \"filters\",\n kind: \"json\",\n nullable: false\n },\n {\n name: \"limit\",\n location: \"body\",\n required: false,\n schema: {\n type: \"integer\",\n minimum: 1,\n maximum: 50,\n default: 20\n },\n flag: \"limit\",\n kind: \"number\",\n nullable: false\n },\n {\n name: \"semantic\",\n location: \"body\",\n required: false,\n schema: {\n type: \"boolean\",\n default: false,\n description: \"Whether to combine keyword and vector search\"\n },\n flag: \"semantic\",\n kind: \"boolean\",\n nullable: false\n },\n {\n name: \"channel\",\n location: \"body\",\n required: true,\n schema: {\n type: \"string\",\n minLength: 1,\n maxLength: 50,\n description: \"Publishing channel to search\"\n },\n flag: \"channel\",\n kind: \"string\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"json\"\n },\n {\n id: \"typeMetadata.getCurrent\",\n group: \"type-metadata\",\n command: \"get-current\",\n method: \"post\",\n path: \"/type-metadata/current\",\n summary: \"Get current content type metadata\",\n description:\n \"Read-only bulk metadata for type generation. Returns one consistent database snapshot of accessible collections and their active effective schemas, including inheritance. Optional entry/tree data requires read:entries in addition to read:collections. Explicit unavailable collection selectors fail. Active schema migrations in the selected collections return a conflict. No entry content is loaded. Schema-free collections use general types without warnings.\\n\\nRequired API key permissions: read:collections. Write permissions also grant read access for the same resource.\",\n example: {\n collections: [\"/Tutorials\"],\n includeEntries: false\n },\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"collections\",\n location: \"body\",\n required: false,\n schema: {\n type: \"array\",\n maxItems: 100,\n items: {\n anyOf: [\n {\n type: \"string\",\n pattern: \"^coll_[A-Za-z\\\\d]{1,22}$\"\n },\n {\n type: \"string\",\n description:\n \"Decoded content path, such as /Docs/Page or coll_ID/Page. Names are case-sensitive. Do not URL-encode names before passing them to the SDK.\"\n },\n {\n type: \"object\",\n properties: {\n collectionSlugPath: {\n type: \"string\",\n description:\n \"Decoded derived slug path, such as /docs/getting-started or coll_ID/getting-started. Use the returned slugPath without URL encoding.\"\n }\n },\n required: [\"collectionSlugPath\"]\n }\n ]\n },\n default: [],\n description:\n \"Collection IDs, name paths, or objects with collectionSlugPath. Includes selected subtrees; empty selects all accessible collections.\"\n },\n flag: \"collections\",\n kind: \"json\",\n nullable: false\n },\n {\n name: \"includeEntries\",\n location: \"body\",\n required: false,\n schema: {\n type: \"boolean\",\n default: false,\n description: \"Include entry IDs, names, paths, and schema associations.\"\n },\n flag: \"include-entries\",\n kind: \"boolean\",\n nullable: false\n },\n {\n name: \"includeTree\",\n location: \"body\",\n required: false,\n schema: {\n type: \"boolean\",\n default: false,\n description:\n \"Include ordered child IDs for each collection. Also includes entry metadata.\"\n },\n flag: \"include-tree\",\n kind: \"boolean\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"json\"\n },\n {\n id: \"typeMetadata.getPublished\",\n group: \"type-metadata\",\n command: \"get-published\",\n method: \"post\",\n path: \"/type-metadata/published\",\n summary: \"Get published content type metadata\",\n description:\n \"Read-only bulk metadata for type generation. Resolves a channel once (published by default), or reads a retained snapshot. Uses publication paths, names, and exact entry-version schema revisions; never substitutes current schemas. Supports mixed revisions and schema-free entries. Empty collections use general types without warnings. Includes selected subtrees; no selectors means all published collections and root entries. Publication-access rules match content.get. No entry content is loaded. Reuse source.snapshotID for related reads. The fingerprint changes only when returned type metadata changes, not when content-only publication creates a new snapshot.\\n\\nRequired API key permissions: read:publishing. Write permissions also grant read access for the same resource.\",\n example: {\n channel: \"published\",\n collections: [\"/Tutorials\"]\n },\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"collections\",\n location: \"body\",\n required: false,\n schema: {\n type: \"array\",\n maxItems: 100,\n items: {\n anyOf: [\n {\n type: \"string\",\n pattern: \"^coll_[A-Za-z\\\\d]{1,22}$\"\n },\n {\n type: \"string\",\n description:\n \"Decoded content path, such as /Docs/Page or coll_ID/Page. Names are case-sensitive. Do not URL-encode names before passing them to the SDK.\"\n },\n {\n type: \"object\",\n properties: {\n collectionSlugPath: {\n type: \"string\",\n description:\n \"Decoded derived slug path, such as /docs/getting-started or coll_ID/getting-started. Use the returned slugPath without URL encoding.\"\n }\n },\n required: [\"collectionSlugPath\"]\n }\n ]\n },\n default: [],\n description:\n \"Collection IDs, name paths, or objects with collectionSlugPath. Includes selected subtrees; empty selects all accessible collections.\"\n },\n flag: \"collections\",\n kind: \"json\",\n nullable: false\n },\n {\n name: \"includeEntries\",\n location: \"body\",\n required: false,\n schema: {\n type: \"boolean\",\n default: false,\n description: \"Include entry IDs, names, paths, and schema associations.\"\n },\n flag: \"include-entries\",\n kind: \"boolean\",\n nullable: false\n },\n {\n name: \"includeTree\",\n location: \"body\",\n required: false,\n schema: {\n type: \"boolean\",\n default: false,\n description:\n \"Include ordered child IDs for each collection. Also includes entry metadata.\"\n },\n flag: \"include-tree\",\n kind: \"boolean\",\n nullable: false\n },\n {\n name: \"channel\",\n location: \"body\",\n required: false,\n schema: {\n type: \"string\",\n minLength: 1,\n maxLength: 50\n },\n flag: \"channel\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"snapshotID\",\n location: \"body\",\n required: false,\n schema: {\n type: \"string\",\n pattern: \"^snp_[A-Za-z\\\\d]{1,22}$\"\n },\n flag: \"snapshot-id\",\n kind: \"string\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"json\"\n },\n {\n id: \"versions.create\",\n group: \"versions\",\n command: \"create\",\n method: \"post\",\n path: \"/entries/{entryID}/versions\",\n summary: \"Create an entry version\",\n description:\n \"Saves a version of the current entry content. Optionally assigns a name.\\n\\nRequired API key permissions: versions. Write permissions also grant read access for the same resource.\",\n example: {\n entryID: \"ent_example\",\n name: \"Before release\"\n },\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"entryID\",\n location: \"path\",\n required: true,\n schema: {\n type: \"string\",\n pattern: \"^(?:\\\\w+?_[A-Za-z\\\\d]{1,22})$\",\n description: \"ID of the entry to version\"\n },\n flag: \"entry-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"name\",\n location: \"body\",\n required: false,\n schema: {\n type: \"string\",\n minLength: 1,\n maxLength: 100,\n description: \"Optional version name\"\n },\n flag: \"name\",\n kind: \"string\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"json\"\n },\n {\n id: \"versions.get\",\n group: \"versions\",\n command: \"get\",\n method: \"get\",\n path: \"/versions/{id}\",\n summary: \"Get an entry version\",\n description:\n \"Returns the saved content and recorded schema metadata of an entry version. Validates against its recorded revision, including historical versions. expectedSchemaHash must match that revision; schema-less content cannot match it.\\n\\nRequired API key permissions: read:versions. Write permissions also grant read access for the same resource.\",\n example: {\n id: \"ver_example\"\n },\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"id\",\n location: \"path\",\n required: true,\n schema: {\n type: \"string\",\n pattern: \"^(?:\\\\w+?_[A-Za-z\\\\d]{1,22})$\",\n description: \"ID of the version to get\"\n },\n flag: \"id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"expectedSchemaHash\",\n location: \"query\",\n required: false,\n schema: {\n type: \"string\",\n pattern: \"^[a-f\\\\d]{64}$\",\n description: \"Hash of the effective schema definition\"\n },\n flag: \"expected-schema-hash\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"json\"\n },\n {\n id: \"versions.list\",\n group: \"versions\",\n command: \"list\",\n method: \"get\",\n path: \"/entries/{entryID}/versions\",\n summary: \"List entry versions\",\n description:\n \"Lists saved entry versions. Pass pagination.nextCursor to the next request while pagination.hasMore is true. The limit is 1 to 100.\\n\\nRequired API key permissions: read:versions. Write permissions also grant read access for the same resource.\",\n example: {\n entryID: \"ent_example\",\n limit: 20\n },\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"entryID\",\n location: \"path\",\n required: true,\n schema: {\n type: \"string\",\n pattern: \"^(?:\\\\w+?_[A-Za-z\\\\d]{1,22})$\",\n description: \"ID of the entry whose versions to list\"\n },\n flag: \"entry-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"cursor\",\n location: \"query\",\n required: false,\n schema: {\n type: \"string\",\n pattern: \"^(?:\\\\w+?_[A-Za-z\\\\d]{1,22})$\",\n description: \"Cursor from the previous page\"\n },\n flag: \"cursor\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"limit\",\n location: \"query\",\n required: false,\n schema: {\n type: \"integer\",\n minimum: 1,\n maximum: 100,\n description: \"Maximum versions to return\"\n },\n flag: \"limit\",\n kind: \"number\",\n nullable: false\n },\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"json\",\n pagination: \"cursor\"\n },\n {\n id: \"versions.revert\",\n group: \"versions\",\n command: \"revert\",\n method: \"post\",\n path: \"/versions/{id}/revert\",\n summary: \"Restore an entry version\",\n description:\n \"Restores saved content to the current entry and returns the resulting version. An active schema migration can block this action.\\n\\nRequired API key permissions: versions. Write permissions also grant read access for the same resource.\",\n example: {\n id: \"ver_example\"\n },\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"id\",\n location: \"path\",\n required: true,\n schema: {\n type: \"string\",\n pattern: \"^(?:\\\\w+?_[A-Za-z\\\\d]{1,22})$\",\n description: \"ID of the version to restore\"\n },\n flag: \"id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"json\"\n },\n {\n id: \"versions.update\",\n group: \"versions\",\n command: \"update\",\n method: \"patch\",\n path: \"/versions/{id}\",\n summary: \"Rename an entry version\",\n description:\n \"Changes the saved version name. Set name to null to remove the name.\\n\\nRequired API key permissions: versions. Write permissions also grant read access for the same resource.\",\n example: {\n id: \"ver_example\",\n name: \"Release candidate\"\n },\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"id\",\n location: \"path\",\n required: true,\n schema: {\n type: \"string\",\n pattern: \"^(?:\\\\w+?_[A-Za-z\\\\d]{1,22})$\",\n description: \"ID of the version to update\"\n },\n flag: \"id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"name\",\n location: \"body\",\n required: true,\n schema: {\n anyOf: [\n {\n type: \"string\",\n minLength: 1,\n maxLength: 100\n },\n {\n type: \"null\"\n }\n ],\n description: \"New version name, or null to remove it\"\n },\n flag: \"name\",\n kind: \"string\",\n nullable: true\n }\n ],\n conditional: false,\n response: \"empty\"\n },\n {\n id: \"webhooks.bulkDelete\",\n group: \"webhooks\",\n command: \"bulk-delete\",\n method: \"post\",\n path: \"/webhooks/bulk/delete\",\n summary: \"Delete webhooks\",\n description:\n \"Deletes every listed webhook in one transaction, checking each expectedRevision. Each deletion cancels pending deliveries and destroys signing keys; history stays until its original expiry.\\n\\nRequired API key permissions: webhooks. Write permissions also grant read access for the same resource.\",\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"webhooks\",\n location: \"body\",\n required: true,\n schema: {\n type: \"array\",\n minItems: 1,\n maxItems: 10,\n items: {\n type: \"object\",\n properties: {\n id: {\n type: \"string\",\n pattern: \"^wh_[A-Za-z\\\\d]{1,22}$\"\n },\n expectedRevision: {\n type: \"integer\",\n minimum: -9007199254740991,\n maximum: 9007199254740991,\n exclusiveMinimum: 0\n }\n },\n required: [\"id\", \"expectedRevision\"],\n additionalProperties: false\n }\n },\n flag: \"webhooks\",\n kind: \"json\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"empty\"\n },\n {\n id: \"webhooks.bulkRedeliver\",\n group: \"webhooks\",\n command: \"bulk-redeliver\",\n method: \"post\",\n path: \"/webhooks/{id}/deliveries/bulk/redeliver\",\n summary: \"Redeliver webhook events\",\n description:\n \"Replays every listed delivery in one transaction with the same checks as a single redelivery. Any ineligible delivery fails the whole request. Counts as one request for rate limiting.\\n\\nRequired API key permissions: webhooks. Write permissions also grant read access for the same resource.\",\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"id\",\n location: \"path\",\n required: true,\n schema: {\n type: \"string\",\n pattern: \"^wh_[A-Za-z\\\\d]{1,22}$\"\n },\n flag: \"id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"expectedDestinationRevision\",\n location: \"body\",\n required: true,\n schema: {\n type: \"integer\",\n minimum: -9007199254740991,\n maximum: 9007199254740991,\n exclusiveMinimum: 0\n },\n flag: \"expected-destination-revision\",\n kind: \"number\",\n nullable: false\n },\n {\n name: \"deliveryIDs\",\n location: \"body\",\n required: true,\n schema: {\n type: \"array\",\n minItems: 1,\n maxItems: 25,\n items: {\n type: \"string\",\n pattern: \"^whdel_[A-Za-z\\\\d]{1,22}$\"\n }\n },\n flag: \"delivery-ids\",\n kind: \"json\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"json\"\n },\n {\n id: \"webhooks.bulkSetEnabled\",\n group: \"webhooks\",\n command: \"bulk-set-enabled\",\n method: \"post\",\n path: \"/webhooks/bulk/set-enabled\",\n summary: \"Enable or disable webhooks\",\n description:\n \"Applies the state to every listed webhook in one transaction, checking each expectedRevision. Enabling checks the scope authority and destination of each webhook. Webhooks already in the state are unchanged.\\n\\nRequired API key permissions: webhooks. Write permissions also grant read access for the same resource.\",\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"webhooks\",\n location: \"body\",\n required: true,\n schema: {\n type: \"array\",\n minItems: 1,\n maxItems: 10,\n items: {\n type: \"object\",\n properties: {\n id: {\n type: \"string\",\n pattern: \"^wh_[A-Za-z\\\\d]{1,22}$\"\n },\n expectedRevision: {\n type: \"integer\",\n minimum: -9007199254740991,\n maximum: 9007199254740991,\n exclusiveMinimum: 0\n }\n },\n required: [\"id\", \"expectedRevision\"],\n additionalProperties: false\n }\n },\n flag: \"webhooks\",\n kind: \"json\",\n nullable: false\n },\n {\n name: \"enabled\",\n location: \"body\",\n required: true,\n schema: {\n type: \"boolean\"\n },\n flag: \"enabled\",\n kind: \"boolean\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"json\"\n },\n {\n id: \"webhooks.create\",\n group: \"webhooks\",\n command: \"create\",\n method: \"post\",\n path: \"/webhooks\",\n summary: \"Create a webhook\",\n description:\n \"Creates an enabled webhook unless `enabled` is false and returns the signing secret once. The caller must be able to read every resource type its events send, and restricted content when included.\\n\\nRequired API key permissions: webhooks. Write permissions also grant read access for the same resource.\",\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"name\",\n location: \"body\",\n required: true,\n schema: {\n type: \"string\",\n minLength: 1,\n maxLength: 100\n },\n flag: \"name\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"url\",\n location: \"body\",\n required: true,\n schema: {\n type: \"string\",\n maxLength: 2048,\n format: \"uri\"\n },\n flag: \"url\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"enabled\",\n location: \"body\",\n required: false,\n schema: {\n type: \"boolean\",\n default: true\n },\n flag: \"enabled\",\n kind: \"boolean\",\n nullable: false\n },\n {\n name: \"eventTypes\",\n location: \"body\",\n required: true,\n schema: {\n type: \"array\",\n minItems: 1,\n maxItems: 14,\n items: {\n $ref: \"#/components/schemas/WebhookEventName\"\n }\n },\n flag: \"event-types\",\n kind: \"json\",\n nullable: false\n },\n {\n name: \"schemaVersion\",\n location: \"body\",\n required: true,\n schema: {\n const: 1\n },\n flag: \"schema-version\",\n kind: \"number\",\n nullable: false\n },\n {\n name: \"collections\",\n location: \"body\",\n required: true,\n schema: {\n anyOf: [\n {\n type: \"object\",\n properties: {\n mode: {\n const: \"all\"\n }\n },\n required: [\"mode\"],\n additionalProperties: false\n },\n {\n type: \"object\",\n properties: {\n mode: {\n const: \"selected\"\n },\n roots: {\n type: \"array\",\n minItems: 1,\n maxItems: 100,\n items: {\n type: \"string\",\n pattern: \"^coll_[A-Za-z\\\\d]{1,22}$\"\n }\n }\n },\n required: [\"mode\", \"roots\"],\n additionalProperties: false\n }\n ]\n },\n flag: \"collections\",\n kind: \"json\",\n nullable: false\n },\n {\n name: \"channels\",\n location: \"body\",\n required: true,\n schema: {\n anyOf: [\n {\n type: \"object\",\n properties: {\n mode: {\n const: \"all\"\n }\n },\n required: [\"mode\"],\n additionalProperties: false\n },\n {\n type: \"object\",\n properties: {\n mode: {\n const: \"selected\"\n },\n codes: {\n type: \"array\",\n minItems: 1,\n maxItems: 100,\n items: {\n type: \"string\",\n minLength: 1,\n maxLength: 50\n }\n }\n },\n required: [\"mode\", \"codes\"],\n additionalProperties: false\n }\n ]\n },\n flag: \"channels\",\n kind: \"json\",\n nullable: false\n },\n {\n name: \"restrictedContent\",\n location: \"body\",\n required: true,\n schema: {\n type: \"boolean\",\n description: \"Include restricted collections, including ones restricted later\"\n },\n flag: \"restricted-content\",\n kind: \"boolean\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"json\"\n },\n {\n id: \"webhooks.delete\",\n group: \"webhooks\",\n command: \"delete\",\n method: \"delete\",\n path: \"/webhooks/{id}\",\n summary: \"Delete a webhook\",\n description:\n \"Cancels pending deliveries and destroys signing keys. Retains history until its original expiry; a deleted endpoint cannot be replayed.\\n\\nRequired API key permissions: webhooks. Write permissions also grant read access for the same resource.\",\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"id\",\n location: \"path\",\n required: true,\n schema: {\n type: \"string\",\n pattern: \"^wh_[A-Za-z\\\\d]{1,22}$\"\n },\n flag: \"id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"expectedRevision\",\n location: \"body\",\n required: true,\n schema: {\n type: \"integer\",\n minimum: -9007199254740991,\n maximum: 9007199254740991,\n exclusiveMinimum: 0\n },\n flag: \"expected-revision\",\n kind: \"number\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"empty\"\n },\n {\n id: \"webhooks.get\",\n group: \"webhooks\",\n command: \"get\",\n method: \"get\",\n path: \"/webhooks/{id}\",\n summary: \"Get a webhook\",\n description:\n \"Required API key permissions: read:webhooks. Write permissions also grant read access for the same resource.\",\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"id\",\n location: \"path\",\n required: true,\n schema: {\n type: \"string\",\n pattern: \"^wh_[A-Za-z\\\\d]{1,22}$\"\n },\n flag: \"id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"json\"\n },\n {\n id: \"webhooks.getDelivery\",\n group: \"webhooks\",\n command: \"get-delivery\",\n method: \"get\",\n path: \"/webhooks/{id}/deliveries/{deliveryID}\",\n summary: \"Get a webhook delivery\",\n description:\n \"Returns retained delivery metadata and, with content authority, the immutable event payload. Expired deliveries return not found even before physical cleanup.\\n\\nRequired API key permissions: read:webhooks. Write permissions also grant read access for the same resource.\",\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"id\",\n location: \"path\",\n required: true,\n schema: {\n type: \"string\",\n pattern: \"^wh_[A-Za-z\\\\d]{1,22}$\"\n },\n flag: \"id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"deliveryID\",\n location: \"path\",\n required: true,\n schema: {\n type: \"string\",\n pattern: \"^whdel_[A-Za-z\\\\d]{1,22}$\"\n },\n flag: \"delivery-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"json\"\n },\n {\n id: \"webhooks.list\",\n group: \"webhooks\",\n command: \"list\",\n method: \"get\",\n path: \"/webhooks\",\n summary: \"List webhooks\",\n description:\n \"Required API key permissions: read:webhooks. Write permissions also grant read access for the same resource.\",\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"cursor\",\n location: \"query\",\n required: false,\n schema: {\n type: \"string\",\n pattern: \"^(?:\\\\w+?_[A-Za-z\\\\d]{1,22})$\",\n description: \"Cursor from the previous page; keep the same filters\"\n },\n flag: \"cursor\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"limit\",\n location: \"query\",\n required: false,\n schema: {\n type: \"integer\",\n minimum: 1,\n maximum: 100,\n default: 50\n },\n flag: \"limit\",\n kind: \"number\",\n nullable: false\n },\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"json\",\n pagination: \"cursor\"\n },\n {\n id: \"webhooks.listAttempts\",\n group: \"webhooks\",\n command: \"list-attempts\",\n method: \"get\",\n path: \"/webhooks/{id}/deliveries/{deliveryID}/runs/{runID}/attempts\",\n summary: \"List delivery attempts\",\n description:\n \"Required API key permissions: read:webhooks. Write permissions also grant read access for the same resource.\",\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"id\",\n location: \"path\",\n required: true,\n schema: {\n type: \"string\",\n pattern: \"^wh_[A-Za-z\\\\d]{1,22}$\"\n },\n flag: \"id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"deliveryID\",\n location: \"path\",\n required: true,\n schema: {\n type: \"string\",\n pattern: \"^whdel_[A-Za-z\\\\d]{1,22}$\"\n },\n flag: \"delivery-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"runID\",\n location: \"path\",\n required: true,\n schema: {\n type: \"string\",\n pattern: \"^whrun_[A-Za-z\\\\d]{1,22}$\"\n },\n flag: \"run-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"cursor\",\n location: \"query\",\n required: false,\n schema: {\n type: \"string\",\n pattern: \"^whatt_[A-Za-z\\\\d]{1,22}$\"\n },\n flag: \"cursor\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"limit\",\n location: \"query\",\n required: false,\n schema: {\n type: \"integer\",\n minimum: 1,\n maximum: 100,\n default: 50\n },\n flag: \"limit\",\n kind: \"number\",\n nullable: false\n },\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"json\",\n pagination: \"cursor\"\n },\n {\n id: \"webhooks.listDeliveries\",\n group: \"webhooks\",\n command: \"list-deliveries\",\n method: \"get\",\n path: \"/webhooks/{id}/deliveries\",\n summary: \"List webhook deliveries\",\n description:\n \"Returns unexpired history, including for a deleted endpoint. Metadata does not include event payloads.\\n\\nRequired API key permissions: read:webhooks. Write permissions also grant read access for the same resource.\",\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"id\",\n location: \"path\",\n required: true,\n schema: {\n type: \"string\",\n pattern: \"^wh_[A-Za-z\\\\d]{1,22}$\"\n },\n flag: \"id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"cursor\",\n location: \"query\",\n required: false,\n schema: {\n type: \"string\",\n pattern: \"^whdel_[A-Za-z\\\\d]{1,22}$\"\n },\n flag: \"cursor\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"limit\",\n location: \"query\",\n required: false,\n schema: {\n type: \"integer\",\n minimum: 1,\n maximum: 100,\n default: 50\n },\n flag: \"limit\",\n kind: \"number\",\n nullable: false\n },\n {\n name: \"type\",\n location: \"query\",\n required: false,\n schema: {\n $ref: \"#/components/schemas/WebhookEventName\"\n },\n flag: \"type\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"state\",\n location: \"query\",\n required: false,\n schema: {\n enum: [\"pending\", \"in_flight\", \"succeeded\", \"failed\", \"cancelled\"],\n type: \"string\"\n },\n flag: \"state\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"createdAfter\",\n location: \"query\",\n required: false,\n schema: {\n type: \"string\",\n format: \"date-time\"\n },\n flag: \"created-after\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"createdBefore\",\n location: \"query\",\n required: false,\n schema: {\n type: \"string\",\n format: \"date-time\"\n },\n flag: \"created-before\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"json\",\n pagination: \"cursor\"\n },\n {\n id: \"webhooks.listRuns\",\n group: \"webhooks\",\n command: \"list-runs\",\n method: \"get\",\n path: \"/webhooks/{id}/deliveries/{deliveryID}/runs\",\n summary: \"List delivery runs\",\n description:\n \"Required API key permissions: read:webhooks. Write permissions also grant read access for the same resource.\",\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"id\",\n location: \"path\",\n required: true,\n schema: {\n type: \"string\",\n pattern: \"^wh_[A-Za-z\\\\d]{1,22}$\"\n },\n flag: \"id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"deliveryID\",\n location: \"path\",\n required: true,\n schema: {\n type: \"string\",\n pattern: \"^whdel_[A-Za-z\\\\d]{1,22}$\"\n },\n flag: \"delivery-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"cursor\",\n location: \"query\",\n required: false,\n schema: {\n type: \"string\",\n pattern: \"^whrun_[A-Za-z\\\\d]{1,22}$\"\n },\n flag: \"cursor\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"limit\",\n location: \"query\",\n required: false,\n schema: {\n type: \"integer\",\n minimum: 1,\n maximum: 100,\n default: 50\n },\n flag: \"limit\",\n kind: \"number\",\n nullable: false\n },\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"json\",\n pagination: \"cursor\"\n },\n {\n id: \"webhooks.redeliver\",\n group: \"webhooks\",\n command: \"redeliver\",\n method: \"post\",\n path: \"/webhooks/{id}/deliveries/{deliveryID}/redeliver\",\n summary: \"Redeliver a webhook event\",\n description:\n \"Checks the reviewed destination revision and current scope authority. Reuses the original event ID, payload, and expiry. Returns a conflict if a run is active, or the endpoint is disabled or deleted.\\n\\nRequired API key permissions: webhooks. Write permissions also grant read access for the same resource.\",\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"id\",\n location: \"path\",\n required: true,\n schema: {\n type: \"string\",\n pattern: \"^wh_[A-Za-z\\\\d]{1,22}$\"\n },\n flag: \"id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"deliveryID\",\n location: \"path\",\n required: true,\n schema: {\n type: \"string\",\n pattern: \"^whdel_[A-Za-z\\\\d]{1,22}$\"\n },\n flag: \"delivery-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"expectedDestinationRevision\",\n location: \"body\",\n required: true,\n schema: {\n type: \"integer\",\n minimum: -9007199254740991,\n maximum: 9007199254740991,\n exclusiveMinimum: 0\n },\n flag: \"expected-destination-revision\",\n kind: \"number\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"json\"\n },\n {\n id: \"webhooks.rotateSecret\",\n group: \"webhooks\",\n command: \"rotate-secret\",\n method: \"post\",\n path: \"/webhooks/{id}/rotate-secret\",\n summary: \"Rotate a webhook secret\",\n description:\n \"Returns a new secret once. Overlap keeps the old secret valid for 24 hours. Immediate rotation retires it at once. Normal rotation conflicts while a previous overlap remains active.\\n\\nRequired API key permissions: webhooks. Write permissions also grant read access for the same resource.\",\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"id\",\n location: \"path\",\n required: true,\n schema: {\n type: \"string\",\n pattern: \"^wh_[A-Za-z\\\\d]{1,22}$\"\n },\n flag: \"id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"expectedRevision\",\n location: \"body\",\n required: true,\n schema: {\n type: \"integer\",\n minimum: -9007199254740991,\n maximum: 9007199254740991,\n exclusiveMinimum: 0\n },\n flag: \"expected-revision\",\n kind: \"number\",\n nullable: false\n },\n {\n name: \"mode\",\n location: \"body\",\n required: true,\n schema: {\n enum: [\"overlap\", \"immediate\"],\n type: \"string\"\n },\n flag: \"mode\",\n kind: \"string\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"json\"\n },\n {\n id: \"webhooks.sendTest\",\n group: \"webhooks\",\n command: \"send-test\",\n method: \"post\",\n path: \"/webhooks/{id}/test\",\n summary: \"Send a webhook test\",\n description:\n \"Schedules one signed synthetic attempt for this endpoint, including when disabled. The event must be selected by the endpoint. It does not enable the endpoint or change content.\\n\\nRequired API key permissions: webhooks. Write permissions also grant read access for the same resource.\",\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"id\",\n location: \"path\",\n required: true,\n schema: {\n type: \"string\",\n pattern: \"^wh_[A-Za-z\\\\d]{1,22}$\"\n },\n flag: \"id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"expectedRevision\",\n location: \"body\",\n required: true,\n schema: {\n type: \"integer\",\n minimum: -9007199254740991,\n maximum: 9007199254740991,\n exclusiveMinimum: 0\n },\n flag: \"expected-revision\",\n kind: \"number\",\n nullable: false\n },\n {\n name: \"type\",\n location: \"body\",\n required: true,\n schema: {\n $ref: \"#/components/schemas/WebhookEventName\"\n },\n flag: \"type\",\n kind: \"string\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"json\"\n },\n {\n id: \"webhooks.update\",\n group: \"webhooks\",\n command: \"update\",\n method: \"put\",\n path: \"/webhooks/{id}\",\n summary: \"Update a webhook\",\n description:\n \"Checks expectedRevision and validates the merged configuration. A URL change cancels pending deliveries and returns a replacement secret once. Scope changes require authority over the previous and new scope.\\n\\nRequired API key permissions: webhooks. Write permissions also grant read access for the same resource.\",\n security: [\n {\n apiKey: []\n },\n {\n oauth: []\n }\n ],\n fields: [\n {\n name: \"id\",\n location: \"path\",\n required: true,\n schema: {\n type: \"string\",\n pattern: \"^wh_[A-Za-z\\\\d]{1,22}$\"\n },\n flag: \"id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"x-workspace-id\",\n location: \"header\",\n required: false,\n schema: {\n type: \"string\",\n description:\n \"Required for OAuth: ID of the workspace to access. API keys use their own workspace.\"\n },\n flag: \"x-workspace-id\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"name\",\n location: \"body\",\n required: false,\n schema: {\n type: \"string\",\n minLength: 1,\n maxLength: 100\n },\n flag: \"name\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"url\",\n location: \"body\",\n required: false,\n schema: {\n type: \"string\",\n maxLength: 2048,\n format: \"uri\"\n },\n flag: \"url\",\n kind: \"string\",\n nullable: false\n },\n {\n name: \"enabled\",\n location: \"body\",\n required: false,\n schema: {\n type: \"boolean\"\n },\n flag: \"enabled\",\n kind: \"boolean\",\n nullable: false\n },\n {\n name: \"eventTypes\",\n location: \"body\",\n required: false,\n schema: {\n type: \"array\",\n minItems: 1,\n maxItems: 14,\n items: {\n $ref: \"#/components/schemas/WebhookEventName\"\n }\n },\n flag: \"event-types\",\n kind: \"json\",\n nullable: false\n },\n {\n name: \"schemaVersion\",\n location: \"body\",\n required: false,\n schema: {\n const: 1\n },\n flag: \"schema-version\",\n kind: \"number\",\n nullable: false\n },\n {\n name: \"collections\",\n location: \"body\",\n required: false,\n schema: {\n anyOf: [\n {\n type: \"object\",\n properties: {\n mode: {\n const: \"all\"\n }\n },\n required: [\"mode\"],\n additionalProperties: false\n },\n {\n type: \"object\",\n properties: {\n mode: {\n const: \"selected\"\n },\n roots: {\n type: \"array\",\n minItems: 1,\n maxItems: 100,\n items: {\n type: \"string\",\n pattern: \"^coll_[A-Za-z\\\\d]{1,22}$\"\n }\n }\n },\n required: [\"mode\", \"roots\"],\n additionalProperties: false\n }\n ]\n },\n flag: \"collections\",\n kind: \"json\",\n nullable: false\n },\n {\n name: \"channels\",\n location: \"body\",\n required: false,\n schema: {\n anyOf: [\n {\n type: \"object\",\n properties: {\n mode: {\n const: \"all\"\n }\n },\n required: [\"mode\"],\n additionalProperties: false\n },\n {\n type: \"object\",\n properties: {\n mode: {\n const: \"selected\"\n },\n codes: {\n type: \"array\",\n minItems: 1,\n maxItems: 100,\n items: {\n type: \"string\",\n minLength: 1,\n maxLength: 50\n }\n }\n },\n required: [\"mode\", \"codes\"],\n additionalProperties: false\n }\n ]\n },\n flag: \"channels\",\n kind: \"json\",\n nullable: false\n },\n {\n name: \"restrictedContent\",\n location: \"body\",\n required: false,\n schema: {\n type: \"boolean\",\n description: \"Include restricted collections, including ones restricted later\"\n },\n flag: \"restricted-content\",\n kind: \"boolean\",\n nullable: false\n },\n {\n name: \"expectedRevision\",\n location: \"body\",\n required: true,\n schema: {\n type: \"integer\",\n minimum: -9007199254740991,\n maximum: 9007199254740991,\n exclusiveMinimum: 0\n },\n flag: \"expected-revision\",\n kind: \"number\",\n nullable: false\n }\n ],\n conditional: false,\n response: \"json\"\n },\n {\n id: \"workspaces.list\",\n group: \"workspaces\",\n command: \"list\",\n method: \"get\",\n path: \"/workspaces\",\n summary: \"List available workspaces\",\n description:\n \"Lists workspaces available to the OAuth user, with current role permissions and plan access. Browser sessions can list workspaces across signed-in accounts. Does not require workspace selection and does not count toward API usage.\",\n security: [\n {\n oauth: []\n }\n ],\n fields: [],\n conditional: false,\n response: \"json\"\n }\n];\nconst schemas: Record<string, JSONSchema> = {\n PropertyFilter: {\n anyOf: [\n {\n $ref: \"#/components/schemas/TextPropertyFilter\"\n },\n {\n $ref: \"#/components/schemas/NumberPropertyFilter\"\n },\n {\n $ref: \"#/components/schemas/BooleanPropertyFilter\"\n },\n {\n $ref: \"#/components/schemas/DatePropertyFilter\"\n }\n ]\n },\n TextPropertyFilter: {\n type: \"object\",\n properties: {\n kind: {\n const: \"text\"\n },\n key: {\n type: \"string\",\n minLength: 1,\n maxLength: 100,\n description: \"Property identifier\"\n },\n operator: {\n enum: [\"any\", \"all\", \"none\"],\n type: \"string\",\n default: \"any\"\n },\n values: {\n type: \"array\",\n minItems: 1,\n maxItems: 20,\n items: {\n type: \"string\",\n maxLength: 500\n }\n }\n },\n required: [\"kind\", \"key\", \"values\"]\n },\n NumberPropertyFilter: {\n type: \"object\",\n properties: {\n kind: {\n const: \"number\"\n },\n key: {\n type: \"string\",\n minLength: 1,\n maxLength: 100,\n description: \"Property identifier\"\n },\n operator: {\n $ref: \"#/components/schemas/ComparisonOperator\"\n },\n value: {\n type: \"number\"\n }\n },\n required: [\"kind\", \"key\", \"operator\", \"value\"]\n },\n ComparisonOperator: {\n enum: [\n \"equals\",\n \"notEquals\",\n \"greaterThan\",\n \"greaterThanOrEqual\",\n \"lessThan\",\n \"lessThanOrEqual\"\n ],\n type: \"string\"\n },\n BooleanPropertyFilter: {\n type: \"object\",\n properties: {\n kind: {\n const: \"boolean\"\n },\n key: {\n type: \"string\",\n minLength: 1,\n maxLength: 100,\n description: \"Property identifier\"\n },\n value: {\n type: \"boolean\"\n }\n },\n required: [\"kind\", \"key\", \"value\"]\n },\n DatePropertyFilter: {\n type: \"object\",\n properties: {\n kind: {\n const: \"date\"\n },\n key: {\n type: \"string\",\n minLength: 1,\n maxLength: 100,\n description: \"Property identifier\"\n },\n operator: {\n $ref: \"#/components/schemas/ComparisonOperator\"\n },\n value: {\n type: \"string\"\n }\n },\n required: [\"kind\", \"key\", \"operator\", \"value\"]\n },\n WebhookEventName: {\n enum: [\n \"entry.created\",\n \"entry.updated\",\n \"entry.content_saved\",\n \"entry.moved\",\n \"entry.deleted\",\n \"entry.restored\",\n \"collection.created\",\n \"collection.updated\",\n \"collection.moved\",\n \"collection.deleted\",\n \"collection.restored\",\n \"publishing.channel_advanced\",\n \"publishing.channel_created\",\n \"publishing.channel_deleted\"\n ],\n type: \"string\"\n },\n Permission: {\n enum: [\n \"content\",\n \"publishing\",\n \"api_keys\",\n \"read:api_keys\",\n \"billing\",\n \"read:billing\",\n \"restricted_collections\",\n \"read:restricted_collections\",\n \"memberships\",\n \"roles\",\n \"webhooks\",\n \"read:webhooks\",\n \"extensions\",\n \"workspace\"\n ],\n type: \"string\"\n },\n AnswerHistoryMessage: {\n type: \"object\",\n properties: {\n role: {\n enum: [\"user\", \"assistant\"],\n type: \"string\"\n },\n content: {\n type: \"string\",\n minLength: 1,\n maxLength: 4000\n }\n },\n required: [\"role\", \"content\"]\n },\n PublishEntryTarget: {\n type: \"object\",\n properties: {\n entryID: {\n type: \"string\",\n pattern: \"^(?:\\\\w+?_[A-Za-z\\\\d]{1,22})$\",\n description: \"Entry to publish\"\n },\n versionID: {\n type: \"string\",\n pattern: \"^(?:\\\\w+?_[A-Za-z\\\\d]{1,22})$\",\n description: \"Existing version to publish\"\n }\n },\n required: [\"entryID\"]\n }\n};\nexport { commands, schemas };\n","import { readFile } from \"node:fs/promises\";\nimport path from \"node:path\";\nimport { CLIError, exitCodes } from \"../errors\";\nimport type { APICommand, APIField, APIOptions } from \"./types\";\n\nconst readStdin = async (signal: AbortSignal): Promise<Buffer> => {\n const chunks: Buffer[] = [];\n const abort = () =>\n process.stdin.destroy(signal.reason instanceof Error ? signal.reason : new Error(\"Cancelled.\"));\n\n signal.throwIfAborted();\n signal.addEventListener(\"abort\", abort, { once: true });\n\n try {\n for await (const chunk of process.stdin) chunks.push(Buffer.from(chunk));\n signal.throwIfAborted();\n return Buffer.concat(chunks);\n } finally {\n signal.removeEventListener(\"abort\", abort);\n }\n};\nconst optionKey = (flag: string): string =>\n flag.replace(/-([a-z])/g, (_match, letter: string) => letter.toUpperCase());\n\nconst parseFlag = (field: APIField, value: string): unknown => {\n if (field.nullable && value === \"null\") return null;\n if (field.kind === \"string\" || field.kind === \"file\") return value;\n if (field.kind === \"boolean\") {\n if (value === \"true\") return true;\n if (value === \"false\") return false;\n throw new CLIError(`--${field.flag} expects true or false.`, exitCodes.usage);\n }\n\n try {\n const parsed: unknown = JSON.parse(value);\n\n if (field.kind === \"number\" && (typeof parsed !== \"number\" || !Number.isFinite(parsed))) {\n throw new Error();\n }\n\n return parsed;\n } catch {\n throw new CLIError(\n `--${field.flag} expects ${field.kind === \"number\" ? \"a number\" : \"valid JSON\"}.`,\n exitCodes.usage\n );\n }\n};\n\n/** Flat flags replace matching JSON fields; omitted flags never introduce defaults. */\nconst readInput = async (\n command: APICommand,\n options: APIOptions,\n signal: AbortSignal\n): Promise<Record<string, unknown>> => {\n let input: Record<string, unknown> = {};\n let stdinUsed = options.input === \"-\";\n\n if (options.input !== undefined) {\n if (options.input !== \"-\" && !options.input.startsWith(\"@\")) {\n throw new CLIError(\n \"Use --input @file.json or --input - for JSON from stdin.\",\n exitCodes.usage\n );\n }\n\n const source =\n options.input === \"-\"\n ? await readStdin(signal)\n : await readFile(options.input.slice(1), { signal });\n let parsed: unknown;\n\n try {\n parsed = JSON.parse(source.toString(\"utf8\"));\n } catch {\n throw new CLIError(\"Input is not valid JSON.\", exitCodes.usage);\n }\n\n if (!parsed || typeof parsed !== \"object\" || Array.isArray(parsed)) {\n throw new CLIError(\"Input must be a JSON object.\", exitCodes.usage);\n }\n\n input = { ...parsed };\n }\n\n const fields = new Set(command.fields.map((field) => field.name));\n\n for (const name of Object.keys(input)) {\n if (!fields.has(name)) {\n throw new CLIError(`Unknown input field: ${name}. See --help or --schema.`, exitCodes.usage);\n }\n }\n\n for (const field of command.fields) {\n const value = options[optionKey(field.flag)];\n\n if (typeof value === \"string\") input[field.name] = parseFlag(field, value);\n\n const supplied = Object.hasOwn(input, field.name);\n\n if (field.required && !supplied) {\n throw new CLIError(`Missing ${field.name}. Use --${field.flag} or --input.`, exitCodes.usage);\n }\n\n if (!supplied) continue;\n\n const current = input[field.name];\n\n if (current === null && field.nullable) continue;\n if (typeof current === \"number\" && !Number.isFinite(current)) {\n throw new CLIError(`Invalid number for ${field.name}.`, exitCodes.usage);\n }\n\n if (\n field.kind !== \"json\" &&\n typeof current !== (field.kind === \"file\" ? \"string\" : field.kind)\n ) {\n throw new CLIError(\n `Invalid type for ${field.name}; expected ${field.kind}.`,\n exitCodes.usage\n );\n }\n\n if (field.kind === \"file\") {\n const file = current as string;\n\n if (file === \"-\" && stdinUsed) {\n throw new CLIError(\n \"Stdin can supply either JSON or one upload file, not both.\",\n exitCodes.usage\n );\n }\n\n const bytes = file === \"-\" ? await readStdin(signal) : await readFile(file, { signal });\n\n stdinUsed ||= file === \"-\";\n input[field.name] = new File(\n [new Uint8Array(bytes)],\n file === \"-\" ? \"stdin\" : path.basename(file),\n { type: \"application/octet-stream\" }\n );\n }\n }\n\n return input;\n};\n\nexport { readInput, optionKey };\n","// Generated from SDK openapi.json. Do not edit.\nimport type { operations, OperationInput } from \"@andesine/sdk\";\nimport type { SDKOperation } from \"./types\";\n\nconst bindings: Record<\n Exclude<\n keyof operations,\n | \"extensions.getSelf\"\n | \"extensions.verifySession\"\n | \"extensions.listInstallations\"\n | \"extensions.getSelfDelivery\"\n | \"extensions.getSelfConfiguration\"\n | \"extensions.getSelfStorageEntry\"\n | \"extensions.setSelfStorageEntry\"\n | \"extensions.deleteSelfStorageEntry\"\n | \"extensions.listSelfStorageEntries\"\n >,\n SDKOperation\n> = {\n \"assets.attach\": (client, input, options) =>\n client.assets.attach(input as OperationInput<\"assets.attach\">, options),\n \"assets.get\": (client, input, options) =>\n client.assets.get(input as OperationInput<\"assets.get\">, options),\n \"assets.importURL\": (client, input, options) =>\n client.assets.importURL(input as OperationInput<\"assets.importURL\">, options),\n \"assets.register\": (client, input, options) =>\n client.assets.register(input as OperationInput<\"assets.register\">, options),\n \"assets.search\": (client, input, options) =>\n client.assets.search(input as OperationInput<\"assets.search\">, options),\n \"assets.upload\": (client, input, options) =>\n client.assets.upload(input as OperationInput<\"assets.upload\">, options),\n \"auth.getIdentity\": (client, input, options) =>\n client.auth.getIdentity(input as OperationInput<\"auth.getIdentity\">, options),\n \"collections.bulkDelete\": (client, input, options) =>\n client.collections.bulkDelete(input as OperationInput<\"collections.bulkDelete\">, options),\n \"collections.create\": (client, input, options) =>\n client.collections.create(input as OperationInput<\"collections.create\">, options),\n \"collections.delete\": (client, input, options) =>\n client.collections.delete(input as OperationInput<\"collections.delete\">, options),\n \"collections.list\": (client, input, options) =>\n client.collections.list(input as OperationInput<\"collections.list\">, options),\n \"collections.update\": (client, input, options) =>\n client.collections.update(input as OperationInput<\"collections.update\">, options),\n \"content.get\": (client, input, options) =>\n client.content.get(input as OperationInput<\"content.get\">, options),\n \"content.getAsset\": (client, input, options) =>\n client.content.getAsset(input as OperationInput<\"content.getAsset\">, options),\n \"content.getSchema\": (client, input, options) =>\n client.content.getSchema(input as OperationInput<\"content.getSchema\">, options),\n \"content.getTree\": (client, input, options) =>\n client.content.getTree(input as OperationInput<\"content.getTree\">, options),\n \"content.listCollections\": (client, input, options) =>\n client.content.listCollections(input as OperationInput<\"content.listCollections\">, options),\n \"content.listEntries\": (client, input, options) =>\n client.content.listEntries(input as OperationInput<\"content.listEntries\">, options),\n \"entries.bulkDelete\": (client, input, options) =>\n client.entries.bulkDelete(input as OperationInput<\"entries.bulkDelete\">, options),\n \"entries.create\": (client, input, options) =>\n client.entries.create(input as OperationInput<\"entries.create\">, options),\n \"entries.delete\": (client, input, options) =>\n client.entries.delete(input as OperationInput<\"entries.delete\">, options),\n \"entries.get\": (client, input, options) =>\n client.entries.get(input as OperationInput<\"entries.get\">, options),\n \"entries.list\": (client, input, options) =>\n client.entries.list(input as OperationInput<\"entries.list\">, options),\n \"entries.update\": (client, input, options) =>\n client.entries.update(input as OperationInput<\"entries.update\">, options),\n \"instance.get\": (client, input, options) =>\n client.instance.get(input as OperationInput<\"instance.get\">, options),\n \"memberships.invite\": (client, input, options) =>\n client.memberships.invite(input as OperationInput<\"memberships.invite\">, options),\n \"memberships.list\": (client, input, options) =>\n client.memberships.list(input as OperationInput<\"memberships.list\">, options),\n \"memberships.listInvites\": (client, input, options) =>\n client.memberships.listInvites(input as OperationInput<\"memberships.listInvites\">, options),\n \"memberships.remove\": (client, input, options) =>\n client.memberships.remove(input as OperationInput<\"memberships.remove\">, options),\n \"memberships.resendInvite\": (client, input, options) =>\n client.memberships.resendInvite(input as OperationInput<\"memberships.resendInvite\">, options),\n \"memberships.revokeInvite\": (client, input, options) =>\n client.memberships.revokeInvite(input as OperationInput<\"memberships.revokeInvite\">, options),\n \"memberships.update\": (client, input, options) =>\n client.memberships.update(input as OperationInput<\"memberships.update\">, options),\n \"publishing.bulkPublishCollections\": (client, input, options) =>\n client.publishing.bulkPublishCollections(\n input as OperationInput<\"publishing.bulkPublishCollections\">,\n options\n ),\n \"publishing.bulkPublishEntries\": (client, input, options) =>\n client.publishing.bulkPublishEntries(\n input as OperationInput<\"publishing.bulkPublishEntries\">,\n options\n ),\n \"publishing.bulkSetCollections\": (client, input, options) =>\n client.publishing.bulkSetCollections(\n input as OperationInput<\"publishing.bulkSetCollections\">,\n options\n ),\n \"publishing.bulkUnpublishCollections\": (client, input, options) =>\n client.publishing.bulkUnpublishCollections(\n input as OperationInput<\"publishing.bulkUnpublishCollections\">,\n options\n ),\n \"publishing.bulkUnpublishEntries\": (client, input, options) =>\n client.publishing.bulkUnpublishEntries(\n input as OperationInput<\"publishing.bulkUnpublishEntries\">,\n options\n ),\n \"publishing.createChannel\": (client, input, options) =>\n client.publishing.createChannel(input as OperationInput<\"publishing.createChannel\">, options),\n \"publishing.deleteChannel\": (client, input, options) =>\n client.publishing.deleteChannel(input as OperationInput<\"publishing.deleteChannel\">, options),\n \"publishing.getChannelContent\": (client, input, options) =>\n client.publishing.getChannelContent(\n input as OperationInput<\"publishing.getChannelContent\">,\n options\n ),\n \"publishing.getEntryVersion\": (client, input, options) =>\n client.publishing.getEntryVersion(\n input as OperationInput<\"publishing.getEntryVersion\">,\n options\n ),\n \"publishing.listChannels\": (client, input, options) =>\n client.publishing.listChannels(input as OperationInput<\"publishing.listChannels\">, options),\n \"publishing.listEntryPublications\": (client, input, options) =>\n client.publishing.listEntryPublications(\n input as OperationInput<\"publishing.listEntryPublications\">,\n options\n ),\n \"publishing.publishCollection\": (client, input, options) =>\n client.publishing.publishCollection(\n input as OperationInput<\"publishing.publishCollection\">,\n options\n ),\n \"publishing.publishEntry\": (client, input, options) =>\n client.publishing.publishEntry(input as OperationInput<\"publishing.publishEntry\">, options),\n \"publishing.revertChanges\": (client, input, options) =>\n client.publishing.revertChanges(input as OperationInput<\"publishing.revertChanges\">, options),\n \"publishing.setCollection\": (client, input, options) =>\n client.publishing.setCollection(input as OperationInput<\"publishing.setCollection\">, options),\n \"publishing.unpublishCollection\": (client, input, options) =>\n client.publishing.unpublishCollection(\n input as OperationInput<\"publishing.unpublishCollection\">,\n options\n ),\n \"publishing.unpublishEntry\": (client, input, options) =>\n client.publishing.unpublishEntry(input as OperationInput<\"publishing.unpublishEntry\">, options),\n \"roles.create\": (client, input, options) =>\n client.roles.create(input as OperationInput<\"roles.create\">, options),\n \"roles.delete\": (client, input, options) =>\n client.roles.delete(input as OperationInput<\"roles.delete\">, options),\n \"roles.list\": (client, input, options) =>\n client.roles.list(input as OperationInput<\"roles.list\">, options),\n \"roles.update\": (client, input, options) =>\n client.roles.update(input as OperationInput<\"roles.update\">, options),\n \"schemaMigrations.get\": (client, input, options) =>\n client.schemaMigrations.get(input as OperationInput<\"schemaMigrations.get\">, options),\n \"schemaMigrations.getActive\": (client, input, options) =>\n client.schemaMigrations.getActive(\n input as OperationInput<\"schemaMigrations.getActive\">,\n options\n ),\n \"schemaMigrations.listContentLossEntries\": (client, input, options) =>\n client.schemaMigrations.listContentLossEntries(\n input as OperationInput<\"schemaMigrations.listContentLossEntries\">,\n options\n ),\n \"schemas.apply\": (client, input, options) =>\n client.schemas.apply(input as OperationInput<\"schemas.apply\">, options),\n \"schemas.create\": (client, input, options) =>\n client.schemas.create(input as OperationInput<\"schemas.create\">, options),\n \"schemas.delete\": (client, input, options) =>\n client.schemas.delete(input as OperationInput<\"schemas.delete\">, options),\n \"schemas.get\": (client, input, options) =>\n client.schemas.get(input as OperationInput<\"schemas.get\">, options),\n \"schemas.getRevision\": (client, input, options) =>\n client.schemas.getRevision(input as OperationInput<\"schemas.getRevision\">, options),\n \"schemaVersions.get\": (client, input, options) =>\n client.schemaVersions.get(input as OperationInput<\"schemaVersions.get\">, options),\n \"schemaVersions.list\": (client, input, options) =>\n client.schemaVersions.list(input as OperationInput<\"schemaVersions.list\">, options),\n \"schemaVersions.revert\": (client, input, options) =>\n client.schemaVersions.revert(input as OperationInput<\"schemaVersions.revert\">, options),\n \"schemaVersions.update\": (client, input, options) =>\n client.schemaVersions.update(input as OperationInput<\"schemaVersions.update\">, options),\n \"search.askCurrent\": (client, input, options) =>\n client.search.askCurrent(input as OperationInput<\"search.askCurrent\">, options),\n \"search.askCurrentStream\": (client, input, options) =>\n client.search.askCurrentStream(input as OperationInput<\"search.askCurrentStream\">, options),\n \"search.askPublished\": (client, input, options) =>\n client.search.askPublished(input as OperationInput<\"search.askPublished\">, options),\n \"search.askPublishedStream\": (client, input, options) =>\n client.search.askPublishedStream(input as OperationInput<\"search.askPublishedStream\">, options),\n \"search.current\": (client, input, options) =>\n client.search.current(input as OperationInput<\"search.current\">, options),\n \"search.published\": (client, input, options) =>\n client.search.published(input as OperationInput<\"search.published\">, options),\n \"typeMetadata.getCurrent\": (client, input, options) =>\n client.typeMetadata.getCurrent(input as OperationInput<\"typeMetadata.getCurrent\">, options),\n \"typeMetadata.getPublished\": (client, input, options) =>\n client.typeMetadata.getPublished(input as OperationInput<\"typeMetadata.getPublished\">, options),\n \"versions.create\": (client, input, options) =>\n client.versions.create(input as OperationInput<\"versions.create\">, options),\n \"versions.get\": (client, input, options) =>\n client.versions.get(input as OperationInput<\"versions.get\">, options),\n \"versions.list\": (client, input, options) =>\n client.versions.list(input as OperationInput<\"versions.list\">, options),\n \"versions.revert\": (client, input, options) =>\n client.versions.revert(input as OperationInput<\"versions.revert\">, options),\n \"versions.update\": (client, input, options) =>\n client.versions.update(input as OperationInput<\"versions.update\">, options),\n \"webhooks.bulkDelete\": (client, input, options) =>\n client.webhooks.bulkDelete(input as OperationInput<\"webhooks.bulkDelete\">, options),\n \"webhooks.bulkRedeliver\": (client, input, options) =>\n client.webhooks.bulkRedeliver(input as OperationInput<\"webhooks.bulkRedeliver\">, options),\n \"webhooks.bulkSetEnabled\": (client, input, options) =>\n client.webhooks.bulkSetEnabled(input as OperationInput<\"webhooks.bulkSetEnabled\">, options),\n \"webhooks.create\": (client, input, options) =>\n client.webhooks.create(input as OperationInput<\"webhooks.create\">, options),\n \"webhooks.delete\": (client, input, options) =>\n client.webhooks.delete(input as OperationInput<\"webhooks.delete\">, options),\n \"webhooks.get\": (client, input, options) =>\n client.webhooks.get(input as OperationInput<\"webhooks.get\">, options),\n \"webhooks.getDelivery\": (client, input, options) =>\n client.webhooks.getDelivery(input as OperationInput<\"webhooks.getDelivery\">, options),\n \"webhooks.list\": (client, input, options) =>\n client.webhooks.list(input as OperationInput<\"webhooks.list\">, options),\n \"webhooks.listAttempts\": (client, input, options) =>\n client.webhooks.listAttempts(input as OperationInput<\"webhooks.listAttempts\">, options),\n \"webhooks.listDeliveries\": (client, input, options) =>\n client.webhooks.listDeliveries(input as OperationInput<\"webhooks.listDeliveries\">, options),\n \"webhooks.listRuns\": (client, input, options) =>\n client.webhooks.listRuns(input as OperationInput<\"webhooks.listRuns\">, options),\n \"webhooks.redeliver\": (client, input, options) =>\n client.webhooks.redeliver(input as OperationInput<\"webhooks.redeliver\">, options),\n \"webhooks.rotateSecret\": (client, input, options) =>\n client.webhooks.rotateSecret(input as OperationInput<\"webhooks.rotateSecret\">, options),\n \"webhooks.sendTest\": (client, input, options) =>\n client.webhooks.sendTest(input as OperationInput<\"webhooks.sendTest\">, options),\n \"webhooks.update\": (client, input, options) =>\n client.webhooks.update(input as OperationInput<\"webhooks.update\">, options),\n \"workspaces.list\": (client, input, options) =>\n client.workspaces.list(input as OperationInput<\"workspaces.list\">, options)\n};\nexport { bindings };\n","import { open, unlink } from \"node:fs/promises\";\nimport { Readable } from \"node:stream\";\nimport { pipeline } from \"node:stream/promises\";\nimport { CLIError } from \"../errors\";\nimport { writeOutput } from \"../output\";\n\n/** Write bytes only to an explicit destination; never overwrite an existing file. */\nconst writeBinary = async (\n value: unknown,\n destination: string,\n signal: AbortSignal\n): Promise<void> => {\n if (!(value instanceof Blob)) throw new CLIError(\"Expected binary data from this API operation.\");\n\n if (destination === \"-\") {\n for await (const chunk of value.stream()) {\n signal.throwIfAborted();\n await writeOutput(process.stdout, Buffer.from(chunk));\n }\n return;\n }\n\n const file = await open(destination, \"wx\");\n let completed = false;\n\n try {\n await pipeline(Readable.fromWeb(value.stream()), file.createWriteStream(), { signal });\n completed = true;\n } finally {\n await file.close();\n if (!completed) await unlink(destination);\n }\n};\n\nexport { writeBinary };\n","import {\n createClient,\n paginatePages,\n type AndesineClient,\n type OperationInput,\n type RequestOptions,\n type AnswerEvent\n} from \"@andesine/sdk\";\nimport { authenticatedClient } from \"../auth/client\";\nimport type { CommandContext } from \"../context\";\nimport { CLIError, exitCodes } from \"../errors\";\nimport { workspaceIDSchema } from \"../config/schema\";\nimport { readInput } from \"./input\";\nimport { bindings } from \"./bindings\";\nimport { reportAPIError } from \"./errors\";\nimport { writeBinary } from \"./binary\";\nimport type { APICommand, APIOptions } from \"./types\";\n\ninterface CursorPage {\n data: unknown[];\n pagination: { hasMore: boolean; nextCursor: string | null };\n}\n\nconst isPage = (value: unknown): value is CursorPage => {\n if (\n !value ||\n typeof value !== \"object\" ||\n !(\"data\" in value) ||\n !Array.isArray(value.data) ||\n !(\"pagination\" in value)\n ) {\n return false;\n }\n\n const pagination = value.pagination;\n\n return Boolean(\n pagination &&\n typeof pagination === \"object\" &&\n \"hasMore\" in pagination &&\n typeof pagination.hasMore === \"boolean\" &&\n \"nextCursor\" in pagination &&\n (pagination.nextCursor === null || typeof pagination.nextCursor === \"string\")\n );\n};\n\nconst pages = async function* (\n command: APICommand,\n client: AndesineClient,\n input: Record<string, unknown>,\n options: RequestOptions\n): AsyncGenerator<unknown> {\n if (command.id === \"content.listCollections\") {\n yield* client.content.paginateCollectionPages(\n input as OperationInput<\"content.listCollections\">,\n { ...options, response: \"data\" }\n );\n return;\n }\n\n if (command.id === \"content.listEntries\") {\n yield* client.content.paginateEntryPages(input as OperationInput<\"content.listEntries\">, {\n ...options,\n response: \"data\"\n });\n return;\n }\n\n const invoke = bindings[command.id as keyof typeof bindings];\n\n yield* paginatePages(\n async (cursor) => {\n const result = await invoke(client, { ...input, cursor }, { ...options, response: \"full\" });\n\n if (!isPage(result.data)) {\n throw new CLIError(\"The server returned an invalid paginated response.\");\n }\n\n return result.data;\n },\n { cursor: typeof input.cursor === \"string\" ? input.cursor : undefined }\n );\n};\n\n/** Use the SDK for all transport; command metadata and execution bindings are bundled locally. */\nconst executeAPI = async (\n command: APICommand,\n options: APIOptions,\n context: CommandContext\n): Promise<void> => {\n const { output, signal } = context;\n const timeout = options.timeout === undefined ? 30_000 : Number(options.timeout);\n\n if (!Number.isFinite(timeout) || timeout < 0 || options.timeout?.trim() === \"\") {\n throw new CLIError(\n \"--timeout must be a nonnegative number of milliseconds; 0 disables it.\",\n exitCodes.usage\n );\n }\n\n if (options.paginate && !command.pagination) {\n throw new CLIError(\"This operation does not support cursor pagination.\", exitCodes.usage);\n }\n\n if (options.paginate && options.ifNoneMatch !== undefined) {\n throw new CLIError(\"Conditional headers cannot be combined with --paginate.\", exitCodes.usage);\n }\n\n if (options.paginate && options.full) {\n throw new CLIError(\n \"--full cannot be combined with --paginate; pages already retain pagination and snapshot metadata.\",\n exitCodes.usage\n );\n }\n\n if (command.response === \"binary\" && !options.output) {\n throw new CLIError(\"Specify --output <file> or --output - for binary data.\", exitCodes.usage);\n }\n\n if (options.output && command.response !== \"binary\") {\n throw new CLIError(\"Use shell redirection for JSON and text output.\", exitCodes.usage);\n }\n\n if (options.format === \"text\" && command.response !== \"stream\") {\n throw new CLIError(\"--format text is only available for AI answer streams.\", exitCodes.usage);\n }\n\n const input = await readInput(command, options, signal);\n const headers = new Headers();\n\n for (const field of command.fields) {\n if (field.location !== \"header\" || !Object.hasOwn(input, field.name)) continue;\n\n headers.set(field.name, String(input[field.name]));\n delete input[field.name];\n }\n\n if (options.ifNoneMatch !== undefined) headers.set(\"If-None-Match\", options.ifNoneMatch);\n\n const request: RequestOptions = { signal, timeout, retries: 0, headers };\n\n await output.heading(`Andesine · ${command.summary}`);\n\n try {\n const anonymous =\n command.security.length === 0 ||\n command.security.some((requirement) => !Object.keys(requirement).length);\n const auth = anonymous\n ? {\n client: createClient({\n baseURL: context.config.baseURL,\n fetch: (input, init) => fetch(input, { ...init, redirect: \"error\" })\n }),\n source: \"anonymous\"\n }\n : await authenticatedClient(context);\n const acceptsAPIKey = command.security.some((requirement) =>\n Object.hasOwn(requirement, \"apiKey\")\n );\n\n if (auth.source === \"environment\" && !acceptsAPIKey) {\n throw new CLIError(\n \"This operation requires OAuth login. Unset ANDESINE_API_KEY and run andesine auth login.\"\n );\n }\n\n const requiresWorkspace =\n (auth.source === \"file\" || auth.source === \"keyring\") &&\n command.fields.some(\n (field) => field.location === \"header\" && field.name === \"x-workspace-id\"\n );\n\n if (requiresWorkspace) {\n const workspaceID = headers.get(\"x-workspace-id\") ?? context.config.workspaceID;\n\n if (workspaceID === undefined) {\n throw new CLIError(\n \"No workspace selected. Run andesine init, pass --workspace <id>, or set ANDESINE_WORKSPACE_ID. Use andesine api workspaces list to find a workspace ID.\",\n exitCodes.usage\n );\n }\n\n if (!workspaceIDSchema.safeParse(workspaceID).success) {\n throw new CLIError(\"The workspace must be a workspace ID (ws_…).\", exitCodes.usage);\n }\n\n headers.set(\"x-workspace-id\", workspaceID);\n }\n\n if (options.paginate) {\n let count = 0;\n\n for await (const page of pages(command, auth.client, input, request)) {\n signal.throwIfAborted();\n await output.json(page);\n count += 1;\n }\n\n await output.success(`Received ${count} page${count === 1 ? \"\" : \"s\"}.`);\n return;\n }\n\n const invoke = bindings[command.id as keyof typeof bindings];\n const response = await output.progress(\n \"Sending request\",\n () => invoke(auth.client, input, { ...request, response: \"full\" }),\n \"Response received\"\n );\n\n if (response.notModified) {\n await output.json({\n status: 304,\n notModified: true,\n etag: response.headers.get(\"etag\"),\n ...(options.full ? { headers: Object.fromEntries(response.headers), data: null } : {})\n });\n return;\n }\n\n if (options.full) {\n await output.json({\n status: response.status,\n headers: Object.fromEntries(response.headers),\n data: response.data ?? null,\n notModified: false\n });\n return;\n }\n\n if (command.response === \"stream\") {\n const events = response.data as AsyncIterable<AnswerEvent>;\n\n for await (const event of events) {\n signal.throwIfAborted();\n if (options.format !== \"text\") await output.json(event);\n else if (event.type === \"textDelta\") await output.text(event.text);\n }\n\n await output.success(\"Answer complete.\");\n } else if (command.response === \"binary\") {\n await writeBinary(response.data, options.output!, signal);\n await output.success(\n options.output === \"-\" ? \"Download complete.\" : `Saved ${options.output}.`\n );\n } else if (command.response === \"empty\" || response.data === undefined) {\n await output.success(`Request completed (${response.status}).`);\n } else {\n await output.json(response.data);\n }\n } catch (error) {\n await reportAPIError(context, error);\n }\n};\n\nexport { executeAPI };\n","import { Option, type CommandUnknownOpts } from \"@commander-js/extra-typings\";\nimport { createCommandContext } from \"../context\";\nimport { createOutput } from \"../output\";\nimport type { GlobalOptions } from \"../config/resolve\";\nimport { commands, schemas } from \"./manifest\";\nimport { executeAPI } from \"./execute\";\nimport type { APIOptions } from \"./types\";\n\n/** Register the public spec without reading user config or credentials for help. */\nconst registerAPI = (program: CommandUnknownOpts, signal: AbortSignal): void => {\n const api = program\n .command(\"api\")\n .description(\"Call the public API; browser-only endpoints are not exposed\");\n const groups = new Map<string, CommandUnknownOpts>();\n\n for (const operation of commands) {\n let group = groups.get(operation.group);\n\n if (!group) {\n group = api.command(operation.group).description(`${operation.group} operations`);\n group.action(() => group?.outputHelp());\n groups.set(operation.group, group);\n }\n\n const command = group\n .command(operation.command)\n .description(operation.summary)\n .option(\n \"--input <source>\",\n \"JSON object from @file or - (stdin); flags override matching fields\"\n )\n .option(\"--timeout <ms>\", \"Request timeout in milliseconds (default: 30000; 0 disables it)\")\n .option(\"--schema\", \"Print the bundled input JSON Schema without making a request\");\n\n if (operation.conditional) {\n command.option(\"--if-none-match <etag>\", \"Read only if the published content has changed\");\n }\n\n if (operation.response === \"json\" || operation.response === \"empty\") {\n command.option(\"--full\", \"Include HTTP status and headers with the response data\");\n }\n\n if (operation.pagination) {\n command.option(\"--paginate\", \"Emit every page as one JSON line, retaining snapshot metadata\");\n }\n\n if (operation.response === \"binary\") {\n command.option(\"--output <file>\", \"Save bytes to a new file, or use - for raw stdout\");\n }\n\n if (operation.response === \"stream\") {\n command.addOption(\n new Option(\"--format <format>\", \"NDJSON events or answer text deltas\")\n .choices([\"json\", \"text\"])\n .default(\"json\")\n );\n }\n\n for (const field of operation.fields) {\n const argument = field.kind === \"file\" ? \"file\" : field.kind === \"json\" ? \"json\" : \"value\";\n const description = [\n field.schema.description,\n field.required ? \"Required\" : undefined,\n field.kind === \"file\"\n ? \"File path or - for stdin\"\n : field.kind === \"boolean\"\n ? \"true or false\"\n : field.kind === \"json\"\n ? \"JSON value\"\n : undefined,\n field.nullable ? \"Use null to clear\" : undefined\n ]\n .filter(Boolean)\n .join(\". \");\n\n command.option(`--${field.flag} <${argument}>`, description || field.name);\n }\n\n const authentication = operation.security.length\n ? operation.security.map((requirement) => Object.keys(requirement).join(\" + \")).join(\" or \")\n : \"Anonymous\";\n\n command.addHelpText(\n \"after\",\n `\\n${operation.description}\\n\\n${operation.method.toUpperCase()} ${operation.path}\\nAuthentication: ${authentication}\\nUse --workspace for OAuth workspace selection. JSON keys use API names, such as collectionID.\\n${operation.example ? `\\nExample input (pass through --input @request.json):\\n${JSON.stringify(operation.example, null, 2)}\\n` : \"\"}`\n );\n command.action(async (...args) => {\n const action = args.at(-1) as CommandUnknownOpts;\n const options = action.opts() as APIOptions;\n if (options.schema) {\n await createOutput(false).json({\n $schema: \"https://json-schema.org/draft/2020-12/schema\",\n type: \"object\",\n properties: Object.fromEntries(\n operation.fields.map((field) => [field.name, field.schema])\n ),\n required: operation.fields.filter((field) => field.required).map((field) => field.name),\n additionalProperties: false,\n components: { schemas }\n });\n return;\n }\n\n const context = await createCommandContext(action.optsWithGlobals() as GlobalOptions, signal);\n\n await executeAPI(operation, options, context);\n });\n }\n\n api.action(() => api.outputHelp());\n};\n\nexport { registerAPI };\n","import { type Command, Option } from \"@commander-js/extra-typings\";\nimport { createCommandContext } from \"../context\";\nimport { executeTypes } from \"./execute\";\nimport type { GlobalOptions } from \"../config/resolve\";\nimport type { GenerateOptions } from \"./options\";\n\nconst registerTypes = (program: Command, signal: AbortSignal): void => {\n const types = program\n .command(\"types\")\n .description(\"Generate TypeScript types for workspace content\");\n\n types\n .command(\"generate\")\n .description(\"Generate a types file, check it for CI, or watch for metadata changes\")\n .addOption(\n new Option(\n \"--source <source>\",\n \"Content source (default: saved source or published)\"\n ).choices([\"published\", \"current\"] as const)\n )\n .option(\"--channel <code>\", \"Follow a publishing channel\")\n .option(\"--snapshot <id>\", \"Use a fixed published snapshot\")\n .option(\"--collection <selectors...>\", \"Collection IDs or decoded paths, including descendants\")\n .option(\n \"--collection-slug-path <paths...>\",\n \"Decoded collection slug paths, including descendants\"\n )\n .option(\"--all-collections\", \"Include all accessible collections\")\n .option(\n \"--output <file>\",\n \"Types file relative to config, or the working directory without config\"\n )\n .option(\"--include-entry-ids\", \"Include entry ID types\")\n .option(\"--no-include-entry-ids\", \"Omit entry ID types\")\n .option(\"--include-entry-paths\", \"Include entry path types\")\n .option(\"--no-include-entry-paths\", \"Omit entry path types\")\n .option(\"--include-tree\", \"Include exact tree types\")\n .option(\"--no-include-tree\", \"Omit exact tree types\")\n .option(\"--check\", \"Compare against live metadata without writes; exit 3 if missing or stale\")\n .option(\"--watch\", \"Poll in the foreground; no daemon or overlapping requests\")\n .option(\"--interval <seconds>\", \"Watch polling interval, 1–300 seconds (default: 10)\")\n .option(\n \"--force\",\n \"Replace an unrelated output file; with watch, applies only until the first successful generation\"\n )\n .addHelpText(\n \"after\",\n \"\\nCommit the generated file and use --check in CI. Channel/current sources follow live changes;\\n--snapshot fixes the source while that snapshot is retained. Options override saved config.\\nWatch holds configuration fixed; restart it after config changes. Nothing runs at install time.\"\n )\n .action(async (options, command) => {\n const globals = command.optsWithGlobals() as GlobalOptions & GenerateOptions;\n\n await executeTypes(await createCommandContext(globals, signal), options);\n });\n};\n\nexport { registerTypes };\n","import basex from \"base-x\";\n\nconst b16 = basex(\"0123456789abcdef\");\nconst b62 = basex(\"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\");\nconst hexToBytes = (hex: string) => {\n const bytes = b16.decode(hex);\n const expectedLength = Math.ceil(hex.length / 2);\n\n return bytes.length > expectedLength ? bytes.slice(bytes.length - expectedLength) : bytes;\n};\nconst bytesToHex = (bytes: Uint8Array) => b16.encode(bytes);\nconst base62ToBytes = (base62: string) => b62.decode(base62);\nconst bytesToBase62 = (bytes: Uint8Array) => b62.encode(bytes);\n\nexport { bytesToHex, hexToBytes, base62ToBytes, bytesToBase62 };\n","import { base62ToBytes, bytesToBase62, bytesToHex, hexToBytes } from \"./encoding\";\nimport * as z from \"zod\";\n\nconst UUID_REGEX = /^[a-f\\d]{8}-[a-f\\d]{4}-[1-8][a-f\\d]{3}-[89ab][a-f\\d]{3}-[a-f\\d]{12}$/i;\nconst ID_REGEX = /^(?:\\w+?_[A-Za-z\\d]{1,22})$/;\ntype PublicIDPrefix =\n | \"usr\"\n | \"ws\"\n | \"rl\"\n | \"ms\"\n | \"inv\"\n | \"grp\"\n | \"coll\"\n | \"ent\"\n | \"ast\"\n | \"adn\"\n | \"ver\"\n | \"sch\"\n | \"schv\"\n | \"schr\"\n | \"smg\"\n | \"snp\"\n | \"wh\"\n | \"whevt\"\n | \"whop\"\n | \"whdel\"\n | \"whrun\"\n | \"whatt\"\n | \"ext\";\nconst id = (options?: Exclude<Parameters<typeof z.regex>[1], string>) => {\n return z.string().regex(ID_REGEX, { error: \"invalid id\", ...options });\n};\nconst publicID = (\n prefix: PublicIDPrefix,\n options?: Exclude<Parameters<typeof z.regex>[1], string>\n) => {\n return z.string().regex(new RegExp(`^${prefix}_[A-Za-z\\\\d]{1,22}$`), {\n error: `invalid ${prefix} id`,\n ...options\n });\n};\nconst toUUID = (value: string): string => {\n if (UUID_REGEX.test(value)) return value.toLowerCase();\n\n const encoded = value.split(\"_\").pop() || \"\";\n let bytes = base62ToBytes(encoded);\n\n while (bytes.length > 16 && bytes[0] === 0) {\n bytes = bytes.slice(1);\n }\n\n if (bytes.length > 16) throw new Error(\"Invalid ID\");\n\n const hex = bytesToHex(bytes).padStart(32, \"0\");\n\n return `${hex.slice(0, 8)}-${hex.slice(8, 12)}-${hex.slice(12, 16)}-${hex.slice(16, 20)}-${hex.slice(20)}`;\n};\nconst fromUUID = (value: string, prefix?: PublicIDPrefix): string => {\n if (!UUID_REGEX.test(value)) throw new Error(\"Invalid UUID\");\n\n const bytes = hexToBytes(value.replaceAll(\"-\", \"\"));\n const encoded = bytesToBase62(bytes);\n\n return prefix ? `${prefix}_${encoded}` : encoded;\n};\nconst toUserID = (value: string) => fromUUID(value, \"usr\");\nconst toWorkspaceID = (value: string) => fromUUID(value, \"ws\");\nconst toRoleID = (value: string) => fromUUID(value, \"rl\");\nconst toMembershipID = (value: string) => fromUUID(value, \"ms\");\nconst toInviteID = (value: string) => fromUUID(value, \"inv\");\nconst toGroupID = (value: string) => fromUUID(value, \"grp\");\nconst toCollectionID = (value: string) => fromUUID(value, \"coll\");\nconst toEntryID = (value: string) => fromUUID(value, \"ent\");\nconst toAssetID = (value: string) => fromUUID(value, \"ast\");\nconst toKeyID = (value: string) => fromUUID(value, \"adn\");\nconst toVersionID = (value: string) => fromUUID(value, \"ver\");\nconst toSchemaID = (value: string) => fromUUID(value, \"sch\");\nconst toSchemaVersionID = (value: string) => fromUUID(value, \"schv\");\nconst toSchemaRevisionID = (value: string) => fromUUID(value, \"schr\");\nconst toSchemaMigrationID = (value: string) => fromUUID(value, \"smg\");\nconst toSnapshotID = (value: string) => fromUUID(value, \"snp\");\nconst toWebhookID = (value: string) => fromUUID(value, \"wh\");\nconst toWebhookEventID = (value: string) => fromUUID(value, \"whevt\");\nconst toWebhookOperationID = (value: string) => fromUUID(value, \"whop\");\nconst toWebhookDeliveryID = (value: string) => fromUUID(value, \"whdel\");\nconst toWebhookRunID = (value: string) => fromUUID(value, \"whrun\");\nconst toWebhookAttemptID = (value: string) => fromUUID(value, \"whatt\");\nconst toExtensionID = (value: string) => fromUUID(value, \"ext\");\nexport {\n fromUUID,\n id,\n publicID,\n toAssetID,\n toCollectionID,\n toEntryID,\n toExtensionID,\n toGroupID,\n toInviteID,\n toKeyID,\n toMembershipID,\n toRoleID,\n toSchemaID,\n toSchemaMigrationID,\n toSchemaRevisionID,\n toSchemaVersionID,\n toSnapshotID,\n toUserID,\n toVersionID,\n toUUID,\n toWorkspaceID,\n toWebhookID,\n toWebhookEventID,\n toWebhookOperationID,\n toWebhookDeliveryID,\n toWebhookRunID,\n toWebhookAttemptID\n};\nexport type { PublicIDPrefix };\n","/** Whether every value is distinct. */\nconst uniqueItems = <T>(values: T[]): boolean => new Set(values).size === values.length;\n\nexport { uniqueItems };\n","// Plain webhook catalog data shared by the backend and the web app. It has no runtime\n// dependencies, so the settings UI can import it instead of requesting the catalog.\ninterface WebhookEventDefinition {\n label: string;\n description: string;\n category: WebhookEventCategory;\n requiredPermissions: WebhookReadPermission[];\n filters: WebhookEventFilter[];\n}\n\ntype WebhookEventName = (typeof webhookEventNames)[number];\ntype WebhookReadPermission = (typeof webhookReadPermissions)[number];\ntype WebhookEventCategory = (typeof webhookEventCategories)[number][\"id\"];\ntype WebhookEventFilter = \"collections\" | \"channels\";\n\nconst webhookEventNames = [\n \"entry.created\",\n \"entry.updated\",\n \"entry.content_saved\",\n \"entry.moved\",\n \"entry.deleted\",\n \"entry.restored\",\n \"collection.created\",\n \"collection.updated\",\n \"collection.moved\",\n \"collection.deleted\",\n \"collection.restored\",\n \"publishing.channel_advanced\",\n \"publishing.channel_created\",\n \"publishing.channel_deleted\"\n] as const;\nconst webhookReadPermissions = [\"read:entries\", \"read:collections\", \"read:publishing\"] as const;\nconst webhookEventCategories = [\n { id: \"entries\", label: \"Entries\" },\n { id: \"collections\", label: \"Collections\" },\n { id: \"publishing\", label: \"Publishing\" }\n] as const;\nconst webhookEventDefinitions = {\n \"entry.created\": {\n label: \"Entry created\",\n description: \"An entry and its initial content were saved. Matches the committed collection.\",\n category: \"entries\",\n requiredPermissions: [\"read:entries\"],\n filters: [\"collections\"]\n },\n \"entry.updated\": {\n label: \"Entry metadata updated\",\n description: \"Entry metadata changed. Content and location changes have separate events.\",\n category: \"entries\",\n requiredPermissions: [\"read:entries\"],\n filters: [\"collections\"]\n },\n \"entry.content_saved\": {\n label: \"Entry content saved\",\n description:\n \"Changed content was saved and is available through the API. No-op saves do not qualify.\",\n category: \"entries\",\n requiredPermissions: [\"read:entries\"],\n filters: [\"collections\"]\n },\n \"entry.moved\": {\n label: \"Entry moved\",\n description:\n \"An entry was moved or reordered, directly or with an ancestor. Matches either location; unauthorized location details are hidden.\",\n category: \"entries\",\n requiredPermissions: [\"read:entries\"],\n filters: [\"collections\"]\n },\n \"entry.deleted\": {\n label: \"Entry deleted\",\n description:\n \"An entry was logically deleted. Matches its former collection; physical cleanup emits no event.\",\n category: \"entries\",\n requiredPermissions: [\"read:entries\"],\n filters: [\"collections\"]\n },\n \"entry.restored\": {\n label: \"Entry restored\",\n description: \"A deleted entry was restored. Matches its restored collection.\",\n category: \"entries\",\n requiredPermissions: [\"read:entries\"],\n filters: [\"collections\"]\n },\n \"collection.created\": {\n label: \"Collection created\",\n description: \"A collection was created. A selected subtree includes its root collection.\",\n category: \"collections\",\n requiredPermissions: [\"read:collections\"],\n filters: [\"collections\"]\n },\n \"collection.updated\": {\n label: \"Collection updated\",\n description:\n \"Collection metadata changed. Matches the committed subtree and its current access restrictions.\",\n category: \"collections\",\n requiredPermissions: [\"read:collections\"],\n filters: [\"collections\"]\n },\n \"collection.moved\": {\n label: \"Collection moved\",\n description:\n \"A collection was moved or reordered. Affected descendants have their own events; either location can match.\",\n category: \"collections\",\n requiredPermissions: [\"read:collections\"],\n filters: [\"collections\"]\n },\n \"collection.deleted\": {\n label: \"Collection deleted\",\n description:\n \"A collection was logically deleted. Matches its former subtree; deleted descendants have their own events.\",\n category: \"collections\",\n requiredPermissions: [\"read:collections\"],\n filters: [\"collections\"]\n },\n \"collection.restored\": {\n label: \"Collection restored\",\n description: \"A deleted collection was restored. Matches its restored subtree.\",\n category: \"collections\",\n requiredPermissions: [\"read:collections\"],\n filters: [\"collections\"]\n },\n \"publishing.channel_advanced\": {\n label: \"Channel snapshot advanced\",\n description:\n \"One channel snapshot changed. Matches changes inside the webhook scope in either snapshot, including removals, and the channel filter. Snapshot references do not grant content access.\",\n category: \"publishing\",\n requiredPermissions: [\"read:publishing\"],\n filters: [\"collections\", \"channels\"]\n },\n \"publishing.channel_created\": {\n label: \"Channel created\",\n description:\n \"A channel and its initial snapshot were created. The collection scope does not apply.\",\n category: \"publishing\",\n requiredPermissions: [\"read:publishing\"],\n filters: [\"channels\"]\n },\n \"publishing.channel_deleted\": {\n label: \"Channel deleted\",\n description:\n \"A channel was deleted. The collection scope does not apply; its final snapshot retains the existing workspace expiry policy.\",\n category: \"publishing\",\n requiredPermissions: [\"read:publishing\"],\n filters: [\"channels\"]\n }\n} satisfies Record<WebhookEventName, WebhookEventDefinition>;\n\nexport {\n webhookEventCategories,\n webhookEventDefinitions,\n webhookEventNames,\n webhookReadPermissions\n};\nexport type {\n WebhookEventCategory,\n WebhookEventDefinition,\n WebhookEventFilter,\n WebhookEventName,\n WebhookReadPermission\n};\n","import { publicID } from \"../primitives/id\";\nimport { uniqueItems } from \"../primitives/unique\";\nimport { JSON_SCHEMA_REGISTRY } from \"@orpc/zod/zod4\";\nimport * as z from \"zod\";\nimport { webhookEventNames, webhookReadPermissions } from \"./catalog-definitions\";\n\ntype WebhookEvent = z.infer<typeof webhookEventType>;\ntype WebhookEventName = WebhookEvent[\"type\"];\n\n// Wire schemas must not load database, configuration, or application services.\n// Strict objects reject accidental document, private matching, or destination data.\nconst webhookChannelCodeType = z.string().min(1).max(50);\nconst webhookReadPermissionType = z.enum(webhookReadPermissions);\nconst nameType = z.string().min(1).max(300);\nconst parentType = publicID(\"coll\").nullable();\nconst contentHashType = z.string().regex(/^[a-f\\d]{64}$/);\nconst entrySubjectType = z.strictObject({ kind: z.literal(\"entry\"), id: publicID(\"ent\") });\nconst collectionSubjectType = z.strictObject({\n kind: z.literal(\"collection\"),\n id: publicID(\"coll\")\n});\nconst channelSubjectType = z.strictObject({\n kind: z.literal(\"channel\"),\n code: webhookChannelCodeType\n});\nconst envelopeType = z.strictObject({\n id: publicID(\"whevt\"),\n operationID: publicID(\"whop\"),\n schemaVersion: z.literal(1),\n occurredAt: z.iso.datetime(),\n workspaceID: publicID(\"ws\"),\n test: z.boolean()\n});\nconst visibleLocationType = z.strictObject({\n visibility: z.literal(\"visible\"),\n parentID: parentType.describe(\"Null means the workspace root, never a hidden parent\"),\n order: z.string().min(1).max(255).optional()\n});\nconst hiddenLocationType = z.strictObject({ visibility: z.literal(\"hidden\") });\nconst moveReasonType = z.enum([\"direct\", \"ancestor_moved\", \"reordered\"]);\nconst moveDataType = z.discriminatedUnion(\"scopeTransition\", [\n z.strictObject({\n scopeTransition: z.literal(\"within\"),\n reason: moveReasonType,\n from: visibleLocationType,\n to: visibleLocationType\n }),\n z.strictObject({\n scopeTransition: z.literal(\"entered\"),\n reason: moveReasonType,\n from: hiddenLocationType,\n to: visibleLocationType\n }),\n z.strictObject({\n scopeTransition: z.literal(\"left\"),\n reason: moveReasonType,\n from: visibleLocationType,\n to: hiddenLocationType\n })\n]);\nconst entryDataType = z.strictObject({ name: nameType, collectionID: parentType });\nconst collectionDataType = z.strictObject({ name: nameType, parentID: parentType });\nconst entryEventType = envelopeType.extend({ subject: entrySubjectType });\nconst collectionEventType = envelopeType.extend({ subject: collectionSubjectType });\nconst channelEventType = envelopeType.extend({ subject: channelSubjectType });\nconst webhookEventSchemas = {\n \"entry.created\": entryEventType.extend({\n type: z.literal(\"entry.created\"),\n data: entryDataType.extend({ contentHash: contentHashType.optional() })\n }),\n \"entry.updated\": entryEventType.extend({\n type: z.literal(\"entry.updated\"),\n data: z.strictObject({\n collectionID: parentType,\n changedFields: z.array(z.literal(\"name\")).length(1)\n })\n }),\n \"entry.content_saved\": entryEventType.extend({\n type: z.literal(\"entry.content_saved\"),\n data: z.strictObject({\n collectionID: parentType,\n contentHash: contentHashType,\n savedAt: z.iso.datetime()\n })\n }),\n \"entry.moved\": entryEventType.extend({ type: z.literal(\"entry.moved\"), data: moveDataType }),\n \"entry.deleted\": entryEventType.extend({\n type: z.literal(\"entry.deleted\"),\n data: entryDataType.extend({ deletedAt: z.iso.datetime() })\n }),\n \"entry.restored\": entryEventType.extend({\n type: z.literal(\"entry.restored\"),\n data: entryDataType\n }),\n \"collection.created\": collectionEventType.extend({\n type: z.literal(\"collection.created\"),\n data: collectionDataType\n }),\n \"collection.updated\": collectionEventType.extend({\n type: z.literal(\"collection.updated\"),\n data: z.strictObject({\n parentID: parentType,\n changedFields: z\n .array(z.enum([\"name\", \"restricted\", \"publishingEnabled\"]))\n .min(1)\n .max(3)\n .refine(uniqueItems, \"Changed fields must be unique\")\n .register(JSON_SCHEMA_REGISTRY, { uniqueItems: true })\n })\n }),\n \"collection.moved\": collectionEventType.extend({\n type: z.literal(\"collection.moved\"),\n data: moveDataType\n }),\n \"collection.deleted\": collectionEventType.extend({\n type: z.literal(\"collection.deleted\"),\n data: collectionDataType.extend({ deletedAt: z.iso.datetime() })\n }),\n \"collection.restored\": collectionEventType.extend({\n type: z.literal(\"collection.restored\"),\n data: collectionDataType\n }),\n \"publishing.channel_advanced\": channelEventType.extend({\n type: z.literal(\"publishing.channel_advanced\"),\n data: z.strictObject({\n previousSnapshotID: publicID(\"snp\"),\n snapshotID: publicID(\"snp\"),\n reason: z.enum([\"publish\", \"unpublish\"])\n })\n }),\n \"publishing.channel_created\": channelEventType.extend({\n type: z.literal(\"publishing.channel_created\"),\n data: z.strictObject({\n name: z.string().min(1).max(50),\n builtIn: z.boolean(),\n snapshotID: publicID(\"snp\")\n })\n }),\n \"publishing.channel_deleted\": channelEventType.extend({\n type: z.literal(\"publishing.channel_deleted\"),\n data: z.strictObject({ name: z.string().min(1).max(50), snapshotID: publicID(\"snp\") })\n })\n};\nconst webhookEventNameType = z.enum(webhookEventNames);\nconst webhookEventType = z.discriminatedUnion(\"type\", [\n webhookEventSchemas[\"entry.created\"],\n webhookEventSchemas[\"entry.updated\"],\n webhookEventSchemas[\"entry.content_saved\"],\n webhookEventSchemas[\"entry.moved\"],\n webhookEventSchemas[\"entry.deleted\"],\n webhookEventSchemas[\"entry.restored\"],\n webhookEventSchemas[\"collection.created\"],\n webhookEventSchemas[\"collection.updated\"],\n webhookEventSchemas[\"collection.moved\"],\n webhookEventSchemas[\"collection.deleted\"],\n webhookEventSchemas[\"collection.restored\"],\n webhookEventSchemas[\"publishing.channel_advanced\"],\n webhookEventSchemas[\"publishing.channel_created\"],\n webhookEventSchemas[\"publishing.channel_deleted\"]\n]);\n\nexport {\n envelopeType as webhookEnvelopeType,\n webhookChannelCodeType,\n webhookReadPermissionType,\n webhookEventSchemas,\n webhookEventNameType,\n webhookEventType,\n uniqueItems\n};\nexport type { WebhookEvent, WebhookEventName };\n","import { id, publicID } from \"../primitives/id\";\nimport * as z from \"zod\";\n\nconst keyPermissionType = z.enum([\n \"entries\",\n \"read:entries\",\n \"versions\",\n \"read:versions\",\n \"publishing\",\n \"read:publishing\",\n \"collections\",\n \"read:collections\",\n \"memberships\",\n \"read:memberships\",\n \"roles\",\n \"read:roles\",\n \"webhooks\",\n \"read:webhooks\",\n \"ai-answers\"\n]);\n/** A secret key stays on servers; a publishable key is safe in browsers, for published content. */\nconst keyKindType = z.enum([\"secret\", \"publishable\"]);\n/** Permissions that a publishable key can have. It always needs `read:publishing`. */\nconst publishableKeyPermissionType = z.enum([\"read:publishing\", \"ai-answers\"]);\n/** An origin without a path, e.g. `https://docs.example.com`. */\nconst keyOriginType = z\n .string()\n .regex(/^https?:\\/\\/[a-z\\d.-]+(?::\\d{1,5})?$/i, \"Use an origin, e.g. https://docs.example.com\")\n .transform((origin) => origin.toLowerCase());\nconst keyType = z.object({\n id: id().describe(\"The ID of the API key\"),\n name: z.string().describe(\"The name for the API key\"),\n kind: keyKindType.describe(\"Secret keys stay on servers; publishable keys work in browsers\"),\n permissions: z.array(keyPermissionType).describe(\"The permissions of the API key\"),\n collectionIDs: z\n .array(publicID(\"coll\"))\n .describe(\n \"Publishable keys: the collections, with their descendants, that the key can read; none for all\"\n ),\n allowedOrigins: z\n .array(z.string())\n .describe(\"Publishable keys: the browser origins that can use the key, with localhost\"),\n value: z\n .string()\n .nullable()\n .describe(\"Publishable keys: the raw key, which is public; null for secret keys\"),\n prefix: z.string().describe(\"The first characters of the raw key\"),\n createdAt: z.iso.datetime().describe(\"The creation date\"),\n updatedAt: z.iso.datetime().describe(\"The last update date\"),\n expiresAt: z.iso.datetime().nullable().describe(\"The expiration date\")\n});\ntype KeyPermission = z.infer<typeof keyPermissionType>;\ntype KeyKind = z.infer<typeof keyKindType>;\ntype Key = z.infer<typeof keyType>;\nexport { keyPermissionType, keyKindType, publishableKeyPermissionType, keyOriginType, keyType };\nexport type { Key, KeyKind, KeyPermission };\n","import { type KeyPermission } from \"../entities/keys\";\nimport { type Permission } from \"../entities/roles\";\n\ninterface TypedAuthorizationRequirements {\n key?: KeyPermission[] | true;\n session?: Permission[] | true;\n oauth?: Permission[] | true;\n /** Operations of the extension API: only the extension principal (extension JWT). */\n extension?: true;\n}\ninterface ParsedPermission {\n access: string;\n resource: string;\n}\ntype AuthorizationRequirements = TypedAuthorizationRequirements | true;\nconst parsePermission = (permission: string): ParsedPermission => {\n const [accessOrResource, readResource] = permission.split(\":\");\n\n return readResource\n ? { resource: readResource, access: accessOrResource }\n : { resource: accessOrResource, access: \"write\" };\n};\nconst hasPermission = (granted: string, required: string): boolean => {\n const grantedPermission = parsePermission(granted);\n const requiredPermission = parsePermission(required);\n\n if (grantedPermission.resource !== requiredPermission.resource) return false;\n\n return grantedPermission.access === \"write\" || requiredPermission.access === \"read\";\n};\nexport { hasPermission };\nexport type { AuthorizationRequirements };\n","import * as z from \"zod\";\nimport { uniqueItems } from \"../primitives/unique\";\n\ntype ExtensionConfiguration = z.output<typeof extensionConfigurationType>;\ntype ExtensionConfigurationField = ExtensionConfiguration[\"properties\"][string];\ntype ExtensionConfigurationItem = Exclude<ExtensionConfigurationField, { type: \"array\" }>;\ntype ExtensionConfigurationPrimitive = string | number | boolean;\ntype ExtensionConfigurationValue =\n ExtensionConfigurationPrimitive | ExtensionConfigurationPrimitive[];\n\nconst JSON_SCHEMA_DIALECT = \"https://json-schema.org/draft/2020-12/schema\";\nconst MAX_CONFIGURATION_FIELDS = 50;\nconst MAX_CONFIGURATION_STRING_LENGTH = 10_000;\nconst MAX_CONFIGURATION_ARRAY_ITEMS = 100;\nconst MAX_CONFIGURATION_ENUM_VALUES = 100;\nconst MAX_CONFIGURATION_PATTERN_LENGTH = 500;\nconst isValidPattern = (pattern: string): boolean => {\n try {\n new RegExp(pattern);\n\n return true;\n } catch {\n return false;\n }\n};\nconst fieldKeyType = z\n .string()\n .regex(/^[A-Za-z][A-Za-z0-9_]{0,63}$/, \"Use a letter, then letters, digits, or underscores\");\nconst lengthType = z.int().min(0).max(MAX_CONFIGURATION_STRING_LENGTH);\nconst metadata = {\n title: z.string().min(1).max(100).optional(),\n description: z.string().min(1).max(500).optional()\n};\nconst stringItemType = z.strictObject({\n type: z.literal(\"string\"),\n minLength: lengthType.optional(),\n maxLength: lengthType.optional(),\n pattern: z\n .string()\n .min(1)\n .max(MAX_CONFIGURATION_PATTERN_LENGTH)\n .refine(isValidPattern, \"Use a valid regular expression\")\n .optional(),\n format: z.enum([\"uri\", \"email\"]).optional()\n});\nconst enumItemType = z.strictObject({\n type: z.literal(\"string\"),\n enum: z\n .array(z.string().min(1).max(200))\n .min(1)\n .max(MAX_CONFIGURATION_ENUM_VALUES)\n .refine(uniqueItems, \"Options must be unique\")\n});\nconst numberItemType = z.strictObject({\n type: z.enum([\"number\", \"integer\"]),\n minimum: z.number().optional(),\n maximum: z.number().optional(),\n exclusiveMinimum: z.number().optional(),\n exclusiveMaximum: z.number().optional(),\n multipleOf: z.number().positive().optional()\n});\nconst booleanItemType = z.strictObject({ type: z.literal(\"boolean\") });\nconst stringFormatTypes = { uri: z.url(), email: z.email() };\nconst itemType = z.union([stringItemType, enumItemType, numberItemType, booleanItemType]);\nconst fieldType = z.union([\n stringItemType.extend({\n ...metadata,\n default: z.string().optional(),\n // Secret values are write-only and readable only by the extension backend.\n secret: z.literal(true).optional(),\n control: z.literal(\"textarea\").optional()\n }),\n enumItemType.extend({ ...metadata, default: z.string().optional() }),\n numberItemType.extend({ ...metadata, default: z.number().optional() }),\n booleanItemType.extend({ ...metadata, default: z.boolean().optional() }),\n z.strictObject({\n ...metadata,\n type: z.literal(\"array\"),\n items: itemType,\n minItems: z.int().min(0).max(MAX_CONFIGURATION_ARRAY_ITEMS).optional(),\n maxItems: z.int().min(0).max(MAX_CONFIGURATION_ARRAY_ITEMS).optional(),\n uniqueItems: z.boolean().optional(),\n default: z.array(z.union([z.string(), z.number(), z.boolean()])).optional()\n })\n]);\n/** Flat JSON Schema (draft 2020-12) subset that the host validates without running extension code. */\nconst extensionConfigurationType = z\n .strictObject({\n $schema: z.literal(JSON_SCHEMA_DIALECT).optional(),\n type: z.literal(\"object\"),\n properties: z\n .record(fieldKeyType, fieldType)\n .refine(\n (properties) => Object.keys(properties).length <= MAX_CONFIGURATION_FIELDS,\n `Use at most ${MAX_CONFIGURATION_FIELDS} fields`\n ),\n required: z.array(fieldKeyType).refine(uniqueItems, \"Fields must be unique\").optional(),\n additionalProperties: z.literal(false)\n })\n .superRefine((configuration, context) => {\n for (const [index, key] of (configuration.required || []).entries()) {\n if (!configuration.properties[key]) {\n context.addIssue({ code: \"custom\", path: [\"required\", index], message: \"Unknown field\" });\n }\n }\n\n for (const [key, field] of Object.entries(configuration.properties)) {\n const isSecretWithDefault = \"secret\" in field && field.secret && field.default !== undefined;\n\n if (isSecretWithDefault) {\n context.addIssue({\n code: \"custom\",\n path: [\"properties\", key, \"default\"],\n message: \"Secret fields cannot have defaults\"\n });\n } else if (field.default !== undefined) {\n const result = createConfigurationValueType(field).safeParse(field.default);\n\n if (!result.success) {\n context.addIssue({\n code: \"custom\",\n path: [\"properties\", key, \"default\"],\n message: \"The default does not match the field\"\n });\n }\n }\n }\n });\nconst createConfigurationValueType = (\n field: ExtensionConfigurationField | ExtensionConfigurationItem\n): z.ZodType<ExtensionConfigurationValue> => {\n if (field.type === \"boolean\") return z.boolean();\n\n if (field.type === \"array\") {\n const maxItems = Math.min(\n field.maxItems ?? MAX_CONFIGURATION_ARRAY_ITEMS,\n MAX_CONFIGURATION_ARRAY_ITEMS\n );\n const items = z\n .array(\n createConfigurationValueType(field.items) as z.ZodType<ExtensionConfigurationPrimitive>\n )\n .min(field.minItems ?? 0)\n .max(maxItems);\n\n return field.uniqueItems ? items.refine(uniqueItems, \"Values must be unique\") : items;\n }\n\n if (\"enum\" in field) return z.enum(field.enum as [string, ...string[]]);\n\n if (field.type === \"string\") {\n const maxLength = Math.min(\n field.maxLength ?? MAX_CONFIGURATION_STRING_LENGTH,\n MAX_CONFIGURATION_STRING_LENGTH\n );\n const value = (field.format ? stringFormatTypes[field.format] : z.string())\n .min(field.minLength ?? 0)\n .max(maxLength);\n\n return field.pattern ? value.regex(new RegExp(field.pattern)) : value;\n }\n\n let value = field.type === \"integer\" ? z.int() : z.number();\n\n if (field.minimum !== undefined) value = value.gte(field.minimum);\n\n if (field.maximum !== undefined) value = value.lte(field.maximum);\n\n if (field.exclusiveMinimum !== undefined) value = value.gt(field.exclusiveMinimum);\n\n if (field.exclusiveMaximum !== undefined) value = value.lt(field.exclusiveMaximum);\n\n if (field.multipleOf !== undefined) value = value.multipleOf(field.multipleOf);\n\n return value;\n};\n/** Validates stored values: known fields only; missing required fields are a state, not an error. */\nconst createConfigurationValuesType = (\n configuration: ExtensionConfiguration\n): z.ZodType<Record<string, ExtensionConfigurationValue>> => {\n const shape = Object.fromEntries(\n Object.entries(configuration.properties).map(([key, field]) => {\n return [key, createConfigurationValueType(field).optional()];\n })\n );\n\n return z.strictObject(shape) as z.ZodType<Record<string, ExtensionConfigurationValue>>;\n};\n/** Converts an authoring Zod object to the configuration subset; unsupported constructs throw. */\nconst toExtensionConfiguration = (schema: z.ZodObject): ExtensionConfiguration => {\n const jsonSchema = z.toJSONSchema(schema, {\n io: \"input\",\n target: \"draft-2020-12\",\n unrepresentable: \"throw\"\n });\n const result = extensionConfigurationType.safeParse({\n additionalProperties: false,\n ...jsonSchema\n });\n\n if (!result.success) {\n throw new Error(`Unsupported configuration schema:\\n${z.prettifyError(result.error)}`);\n }\n\n return result.data;\n};\n\nexport {\n MAX_CONFIGURATION_FIELDS,\n extensionConfigurationType,\n createConfigurationValueType,\n createConfigurationValuesType,\n toExtensionConfiguration\n};\nexport type { ExtensionConfiguration, ExtensionConfigurationField, ExtensionConfigurationValue };\n","interface ElementData {\n name: string;\n props: Record<string, ElementValue>;\n selfClosing: boolean;\n}\ninterface ElementToken {\n from: number;\n to: number;\n kind:\n | \"name\"\n | \"attribute\"\n | \"property\"\n | \"string\"\n | \"number\"\n | \"literal\"\n | \"operator\"\n | \"punctuation\";\n}\ninterface ElementContent {\n type: string;\n attrs?: Record<string, unknown>;\n content?: ElementContent[];\n}\n\ntype ElementValue =\n string | number | boolean | null | ElementValue[] | { [key: string]: ElementValue };\n\nconst ELEMENT_NAME = /^[A-Za-z][A-Za-z0-9_-]*$/;\nconst ELEMENT_TAG_NAME = /^[A-Za-z][A-Za-z0-9_-]*(?:\\.[A-Za-z][A-Za-z0-9_-]*)*$/;\nconst getElementTagName = (source: string): string => {\n return /^\\s*<([A-Za-z][A-Za-z0-9_.-]*)?/.exec(source)?.[1] || \"\";\n};\nconst OBJECT_KEY = /^[$_\\p{ID_Start}][$\\u200c\\u200d_\\p{ID_Continue}]*$/u;\nconst parseElementValue = (source: string): ElementValue => {\n const json = source.replace(\n /\"(?:\\\\[\\s\\S]|[^\"\\\\])*\"|[$_\\p{ID_Start}][$\\u200c\\u200d_\\p{ID_Continue}]*/gu,\n (token, offset: number) => {\n if (!token.startsWith('\"') && /^\\s*:/.test(source.slice(offset + token.length))) {\n return JSON.stringify(token);\n }\n return token;\n }\n );\n\n return JSON.parse(json);\n};\nconst ELEMENT_BLOCKS = [\n \"paragraph\",\n \"heading\",\n \"blockquote\",\n \"bulletList\",\n \"orderedList\",\n \"taskList\",\n \"horizontalRule\",\n \"codeBlock\",\n \"table\",\n \"image\",\n \"element\"\n];\nconst ELEMENT_STRUCTURE = [\n \"listItem\",\n \"taskItem\",\n \"tableRow\",\n \"tableCell\",\n \"tableHeader\",\n \"text\",\n \"hardBreak\"\n];\nconst isElementValue = (value: unknown): value is ElementValue => {\n if (value === null || typeof value === \"string\" || typeof value === \"boolean\") {\n return true;\n }\n if (typeof value === \"number\") {\n return Number.isFinite(value);\n }\n if (Array.isArray(value)) {\n return Array.from(value).every(isElementValue);\n }\n if (\n !value ||\n typeof value !== \"object\" ||\n ![Object.prototype, null].includes(Object.getPrototypeOf(value))\n ) {\n return false;\n }\n\n return Object.values(value).every(isElementValue);\n};\nconst getElementData = (attrs: Record<string, unknown>): ElementData => {\n const { name, props, selfClosing } = attrs;\n\n if (typeof name !== \"string\" || !ELEMENT_TAG_NAME.test(name)) {\n throw new Error(\"Invalid Element name\");\n }\n if (!props || Array.isArray(props) || typeof props !== \"object\" || !isElementValue(props)) {\n throw new Error(\"Element props must be a JSON object\");\n }\n if (Object.keys(props).some((key) => !ELEMENT_NAME.test(key))) {\n throw new Error(\"Invalid Element prop name\");\n }\n if (typeof selfClosing !== \"boolean\") {\n throw new Error(\"Invalid Element closing state\");\n }\n\n return { name, props: props as ElementData[\"props\"], selfClosing };\n};\nconst parseElement = (source: string): ElementData => {\n const props: ElementData[\"props\"] = {};\n const fail = (): never => {\n throw new Error(\"Invalid opening tag\");\n };\n let position = 0;\n\n const whitespace = () => {\n while (/\\s/.test(source[position] || \"\") && position < source.length) {\n position += 1;\n }\n };\n const identifier = (tag = false): string => {\n const start = position;\n\n while (\n (tag ? /[A-Za-z0-9_.-]/ : /[A-Za-z0-9_-]/).test(source[position] || \"\") &&\n position < source.length\n ) {\n position += 1;\n }\n\n const value = source.slice(start, position);\n\n if (!(tag ? ELEMENT_TAG_NAME : ELEMENT_NAME).test(value)) {\n fail();\n }\n return value;\n };\n const quoted = (): string => {\n const start = position++;\n let escaped = false;\n\n while (position < source.length) {\n const character = source[position++];\n\n if (escaped) {\n escaped = false;\n continue;\n }\n if (character === \"\\\\\") {\n escaped = true;\n continue;\n }\n if (character === '\"') {\n return JSON.parse(source.slice(start, position));\n }\n }\n\n return fail();\n };\n\n whitespace();\n if (source[position++] !== \"<\") {\n fail();\n }\n\n const name = identifier(true);\n\n while (position < source.length) {\n const beforeSpace = position;\n\n whitespace();\n if (source[position] === \">\" || source.slice(position, position + 2) === \"/>\") {\n break;\n }\n if (position === beforeSpace) {\n fail();\n }\n\n const key = identifier();\n let value: ElementValue = true;\n const afterKey = position;\n\n whitespace();\n if (source[position] === \"=\") {\n position += 1;\n whitespace();\n\n if (source[position] === '\"') {\n value = quoted();\n } else if (source[position] === \"{\") {\n const start = ++position;\n const delimiters = [\"}\"];\n\n while (position < source.length && delimiters.length) {\n const character = source[position];\n\n if (character === '\"') {\n quoted();\n continue;\n }\n if (character === \"{\") {\n delimiters.push(\"}\");\n }\n if (character === \"[\") {\n delimiters.push(\"]\");\n }\n if (character === \"}\" || character === \"]\") {\n if (delimiters.pop() !== character) {\n fail();\n }\n if (!delimiters.length) {\n break;\n }\n }\n\n position += 1;\n }\n\n if (delimiters.length || source[position] !== \"}\") {\n fail();\n }\n value = parseElementValue(source.slice(start, position));\n position += 1;\n } else {\n fail();\n }\n } else {\n position = afterKey;\n }\n\n if (Object.prototype.hasOwnProperty.call(props, key)) {\n throw new Error(`Duplicate prop \"${key}\"`);\n }\n Object.defineProperty(props, key, {\n value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n }\n\n const selfClosing = source.slice(position, position + 2) === \"/>\";\n\n if (source[position] !== \">\" && !selfClosing) {\n fail();\n }\n position += selfClosing ? 2 : 1;\n whitespace();\n if (position !== source.length) {\n fail();\n }\n\n return getElementData({ name, props, selfClosing });\n};\nconst canonicalElementValue = (value: unknown): string => {\n if (Array.isArray(value)) {\n return `[${value.map(canonicalElementValue).join(\",\")}]`;\n }\n if (value && typeof value === \"object\") {\n return `{${Object.entries(value)\n .sort(([a], [b]) => a.localeCompare(b))\n .map(([key, item]) => `${JSON.stringify(key)}:${canonicalElementValue(item)}`)\n .join(\",\")}}`;\n }\n\n return JSON.stringify(value) ?? \"null\";\n};\nconst formatElement = (data: ElementData, width = 80): string => {\n const closing = data.selfClosing ? \" />\" : \">\";\n const formatProp = (key: string, value: ElementValue, multiline = false): string => {\n const json = JSON.stringify(value, null, multiline ? 2 : undefined).replace(\n /\"(?:\\\\[\\s\\S]|[^\"\\\\])*\"/g,\n (token, offset: number, source: string) => {\n const key = JSON.parse(token) as string;\n\n return OBJECT_KEY.test(key) && /^\\s*:/.test(source.slice(offset + token.length))\n ? key\n : token;\n }\n );\n\n if (value === true) {\n return key;\n }\n if (typeof value === \"string\" && !/[\\n\\r\"\\\\]/.test(value)) {\n return `${key}=${json}`;\n }\n return `${key}={${json}}`;\n };\n const entries = Object.entries(data.props);\n const hasStructuredValues = entries.some(\n ([, value]) => value !== null && typeof value === \"object\" && Object.keys(value).length > 0\n );\n const compact = `<${data.name}${entries.map(([key, value]) => ` ${formatProp(key, value)}`).join(\"\")}${closing}`;\n\n if ((!hasStructuredValues && compact.length <= width) || !entries.length) {\n return compact;\n }\n\n const lines = entries.map(([key, value]) => {\n const prop = formatProp(key, value, true);\n\n return prop\n .split(\"\\n\")\n .map((line) => ` ${line}`)\n .join(\"\\n\");\n });\n\n return `<${data.name}\\n${lines.join(\"\\n\")}\\n${closing.trimStart()}`;\n};\nconst normalizeElementAttributes = (attrs: Record<string, unknown>): Record<string, unknown> => {\n const data = getElementData(attrs);\n\n if (typeof attrs.source === \"string\") {\n try {\n if (canonicalElementValue(parseElement(attrs.source)) === canonicalElementValue(data)) {\n return { ...attrs, ...data };\n }\n } catch {\n /* Regenerate stale or invalid source from authoritative attributes. */\n }\n }\n\n return { ...attrs, ...data, source: formatElement(data) };\n};\nconst tokenizeElement = (source: string): ElementToken[] => {\n const tokens: ElementToken[] = [];\n let position = 0;\n let tagName = false;\n let depth = 0;\n\n while (position < source.length) {\n const from = position;\n const character = source[position++];\n let kind: ElementToken[\"kind\"] = \"punctuation\";\n\n if (/\\s/.test(character)) {\n continue;\n }\n\n if (character === '\"') {\n kind = \"string\";\n while (position < source.length) {\n const next = source[position++];\n if (next === \"\\\\\") {\n position = Math.min(position + 1, source.length);\n continue;\n }\n if (next === '\"') {\n break;\n }\n }\n if (depth && /^\\s*:/.test(source.slice(position))) kind = \"property\";\n } else if (/^[$_\\p{ID_Start}]/u.test(source.slice(from))) {\n const identifier =\n (tagName\n ? /^[A-Za-z][A-Za-z0-9_.-]*/\n : /^[$_\\p{ID_Start}][$\\u200c\\u200d_\\p{ID_Continue}-]*/u\n ).exec(source.slice(from))?.[0] || character;\n\n position = from + identifier.length;\n kind = tagName\n ? \"name\"\n : !depth\n ? \"attribute\"\n : /^\\s*:/.test(source.slice(position))\n ? \"property\"\n : \"literal\";\n tagName = false;\n } else if (/[0-9-]/.test(character)) {\n while (/[0-9.eE+-]/.test(source[position] || \"\") && position < source.length) {\n position += 1;\n }\n kind = \"number\";\n } else if (character === \"=\") {\n kind = \"operator\";\n } else if (character === \"<\") {\n tagName = true;\n } else if (character === \"{\" || character === \"[\") {\n depth += 1;\n } else if (character === \"}\" || character === \"]\") {\n depth = Math.max(0, depth - 1);\n }\n\n tokens.push({ from, to: position, kind });\n }\n\n return tokens;\n};\nconst getElementSearchText = (data: ElementData): string => {\n const lines = [data.name];\n const append = (key: string, value: ElementValue, depth: number) => {\n const prefix = `${\" \".repeat(depth)}- ${key}:`;\n const entries = value && typeof value === \"object\" ? Object.entries(value) : null;\n\n if (entries?.length) {\n lines.push(prefix);\n entries.forEach(([childKey, child]) => append(childKey, child, depth + 1));\n } else {\n const text =\n value === true\n ? \"yes\"\n : value === false\n ? \"no\"\n : typeof value === \"string\"\n ? value\n : JSON.stringify(value);\n lines.push(`${prefix} ${text}`);\n }\n };\n\n Object.entries(data.props).forEach(([key, value]) => append(key, value, 0));\n return lines.join(\"\\n\");\n};\nconst findDisallowedElementBlock = (\n nodes: ElementContent[],\n allowed: readonly string[],\n nested = false\n): string | null => {\n for (const node of nodes) {\n if (\n !ELEMENT_BLOCKS.includes(node.type) &&\n (!nested || !ELEMENT_STRUCTURE.includes(node.type))\n ) {\n return node.type;\n }\n if (\n ELEMENT_BLOCKS.includes(node.type) &&\n node.type !== \"paragraph\" &&\n !allowed.includes(node.type)\n ) {\n return node.type;\n }\n\n const invalid = findDisallowedElementBlock(node.content || [], allowed, true);\n\n if (invalid) {\n return invalid;\n }\n }\n\n return null;\n};\n\nexport {\n ELEMENT_BLOCKS,\n ELEMENT_TAG_NAME,\n parseElement,\n getElementTagName,\n getElementData,\n formatElement,\n normalizeElementAttributes,\n canonicalElementValue,\n tokenizeElement,\n getElementSearchText,\n findDisallowedElementBlock\n};\nexport type { ElementData, ElementValue, ElementToken, ElementContent };\n","import {\n ELEMENT_BLOCKS,\n findDisallowedElementBlock,\n getElementData,\n normalizeElementAttributes\n} from \"./element\";\nimport type { ContentNode } from \"./types\";\n\nconst normalizeContentElements = (node: ContentNode): ContentNode => {\n const content = node.content?.map(normalizeContentElements);\n const attrs = node.type === \"element\" ? normalizeElementAttributes(node.attrs || {}) : node.attrs;\n\n if (node.type === \"codeBlock\") {\n if (\n content?.some(\n (child) =>\n child.type !== \"text\" ||\n typeof child.text !== \"string\" ||\n !child.text ||\n child.marks?.length ||\n child.content?.length\n )\n ) {\n throw new Error(\"Code blocks can only contain plain text\");\n }\n if (attrs?.language != null && typeof attrs.language !== \"string\") {\n throw new Error(\"Code block language must be a string\");\n }\n }\n\n if (node.type === \"element\") {\n const data = getElementData(attrs!);\n const invalid = findDisallowedElementBlock(content || [], ELEMENT_BLOCKS);\n\n if (data.selfClosing && content?.length) {\n throw new Error(\"Self-closing Elements cannot contain blocks\");\n }\n if (content?.some((child) => !ELEMENT_BLOCKS.includes(child.type)) || invalid) {\n throw new Error(\"Elements can only contain regular editor blocks\");\n }\n }\n if (node.type === \"fragment\" && Array.isArray(attrs?.allowedBlocks)) {\n const invalid = findDisallowedElementBlock(content || [], attrs.allowedBlocks);\n\n if (invalid) {\n throw new Error(`Fragment does not allow ${invalid} blocks`);\n }\n }\n\n return { ...node, ...(attrs ? { attrs } : {}), ...(content ? { content } : {}) };\n};\n\nexport { normalizeContentElements };\n","import { normalizeContentElements } from \"./elements\";\nimport * as z from \"zod\";\nimport type { ContentNode } from \"./types\";\n\nconst contentMarkType = z.object({\n type: z.string(),\n attrs: z.record(z.string(), z.unknown()).optional()\n});\nconst contentNodeType: z.ZodType<ContentNode> = z.lazy(() => {\n return z\n .object({\n type: z.string(),\n attrs: z.record(z.string(), z.unknown()).optional(),\n content: z.array(contentNodeType).optional(),\n marks: z.array(contentMarkType).optional(),\n text: z.string().optional()\n })\n .superRefine((node, context) => {\n if (node.type !== \"element\" && node.type !== \"fragment\" && node.type !== \"codeBlock\") return;\n try {\n normalizeContentElements(node);\n } catch (error) {\n context.addIssue({\n code: \"custom\",\n message: error instanceof Error ? error.message : \"Invalid Element content\"\n });\n }\n });\n});\n\nexport { contentMarkType, contentNodeType };\n","import { ELEMENT_BLOCKS, ELEMENT_TAG_NAME } from \"@andesine/document\";\nimport * as z from \"zod\";\nimport { uniqueItems } from \"../webhooks/events\";\n\ntype ExtensionElementView = z.output<typeof extensionElementViewType>;\ntype ExtensionBlockAction = z.output<typeof extensionBlockActionType>;\ntype ExtensionPanel = z.output<typeof extensionPanelType>;\ntype ExtensionSettingsSection = z.output<typeof extensionSettingsSectionType>;\n\nconst extensionContributionLimits = {\n elementViews: 50,\n blockActions: 20,\n panelsPerSide: 2,\n settingsSections: 5\n} as const;\n/** Stable across versions; settings and managed records are keyed by it. */\nconst extensionStableIDType = z\n .string()\n .regex(/^[A-Za-z][A-Za-z0-9_-]{0,63}$/, \"Use a letter, then letters, digits, - or _\");\nconst extensionEntryType = z\n .string()\n .regex(/^[A-Za-z_$][A-Za-z0-9_$]{0,63}$/, \"Use the name of an exported view\")\n .describe(\"The export of the frontend bundle that renders this contribution\");\n/**\n * An icon class of the UnoCSS icons preset, e.g. `i-lucide:rocket`, or `i-acme:logo?bg` for a\n * colored icon. Sets come from the extension build (default, installed, or custom); the build\n * checks that each icon exists.\n */\nconst extensionIconType = z\n .string()\n .max(120)\n .regex(\n /^i-[a-z\\d]+(?:-[a-z\\d]+)*:[a-z\\d]+(?:-[a-z\\d]+)*(?:\\?(?:bg|mask))?$/,\n \"Use an icon class, e.g. i-lucide:rocket\"\n );\nconst labelType = z.string().min(1).max(60);\nconst elementNameType = z\n .string()\n .max(100)\n .regex(ELEMENT_TAG_NAME, \"Use an element name, e.g. Accordion\");\n/**\n * A root element view. `descendants` render elements of those names inside the root's content\n * (nearest root first), before their own root registrations.\n */\nconst extensionElementViewType = z.strictObject({\n id: extensionStableIDType,\n name: labelType,\n element: elementNameType,\n entry: extensionEntryType,\n descendants: z\n .array(z.strictObject({ element: elementNameType, entry: extensionEntryType }))\n .max(20)\n .refine(\n (descendants) => uniqueItems(descendants.map(({ element }) => element.toLowerCase())),\n \"Use one view per descendant element\"\n )\n .default([])\n});\nconst extensionBlockActionType = z.strictObject({\n id: extensionStableIDType,\n label: labelType,\n icon: extensionIconType.optional(),\n blocks: z\n .array(z.string().refine((block) => ELEMENT_BLOCKS.includes(block), \"Unknown block type\"))\n .min(1)\n .max(ELEMENT_BLOCKS.length)\n .refine(uniqueItems, \"Blocks must be unique\"),\n entry: extensionEntryType\n});\nconst panelType = { id: extensionStableIDType, name: labelType, icon: extensionIconType };\nconst extensionPanelType = z.discriminatedUnion(\"side\", [\n z.strictObject({ ...panelType, side: z.literal(\"left\"), entry: extensionEntryType }),\n z.strictObject({\n ...panelType,\n side: z.literal(\"right\"),\n context: z.enum([\"workspace\", \"collection\", \"entry\"]),\n entry: extensionEntryType\n })\n]);\nconst extensionSettingsSectionType = z.strictObject({\n id: extensionStableIDType,\n heading: labelType,\n entry: extensionEntryType\n});\nconst extensionContributionsType = {\n elementViews: z\n .array(extensionElementViewType)\n .max(extensionContributionLimits.elementViews)\n .refine(\n (views) => uniqueItems(views.map(({ element }) => element.toLowerCase())),\n \"Use one view per element\"\n )\n .default([]),\n blockActions: z\n .array(extensionBlockActionType)\n .max(extensionContributionLimits.blockActions)\n .default([]),\n panels: z\n .array(extensionPanelType)\n .refine((panels) => {\n return [\"left\", \"right\"].every((side) => {\n const count = panels.filter((panel) => panel.side === side).length;\n\n return count <= extensionContributionLimits.panelsPerSide;\n });\n }, `Use at most ${extensionContributionLimits.panelsPerSide} panels per side`)\n .default([]),\n settingsSections: z\n .array(extensionSettingsSectionType)\n .max(extensionContributionLimits.settingsSections)\n .default([])\n};\n\nexport {\n extensionContributionLimits,\n extensionStableIDType,\n extensionIconType,\n extensionElementViewType,\n extensionBlockActionType,\n extensionPanelType,\n extensionSettingsSectionType,\n extensionContributionsType\n};\nexport type {\n ExtensionElementView,\n ExtensionBlockAction,\n ExtensionPanel,\n ExtensionSettingsSection\n};\n","import { MAX_BULK_ITEMS } from \"../../limits\";\nimport { publicID } from \"../../primitives/id\";\nimport { uniqueItems, webhookChannelCodeType, webhookEventNameType } from \"../../webhooks/events\";\nimport * as z from \"zod\";\n\ntype WebhookConfiguration = z.infer<typeof webhookConfigurationType>;\ntype WebhookCreateInput = z.input<typeof webhookCreateInputType>;\ntype WebhookEndpoint = z.infer<typeof webhookEndpointType>;\ntype WebhookScope = Pick<WebhookConfiguration, \"collections\" | \"channels\" | \"restrictedContent\">;\ntype WebhookUpdateInput = z.infer<typeof webhookUpdateInputType>;\ntype WebhookRevisionInput = z.infer<typeof webhookRevisionInputType>;\ntype WebhookBulkRevisionInput = z.infer<typeof webhookBulkRevisionInputType>;\ntype WebhookBulkEnabledInput = z.infer<typeof webhookBulkEnabledInputType>;\ntype WebhookSecretResult = z.infer<typeof webhookSecretResultType>;\ntype WebhookUpdateResult = z.infer<typeof webhookUpdateResultType>;\n\nconst webhookCollectionScopeType = z.discriminatedUnion(\"mode\", [\n z.strictObject({ mode: z.literal(\"all\") }),\n z.strictObject({\n mode: z.literal(\"selected\"),\n roots: z\n .array(publicID(\"coll\"))\n .min(1)\n .max(MAX_BULK_ITEMS)\n .refine(uniqueItems, \"Roots must be unique\")\n })\n]);\nconst webhookChannelScopeType = z.discriminatedUnion(\"mode\", [\n z.strictObject({ mode: z.literal(\"all\") }),\n z.strictObject({\n mode: z.literal(\"selected\"),\n codes: z\n .array(webhookChannelCodeType)\n .min(1)\n .max(MAX_BULK_ITEMS)\n .refine(uniqueItems, \"Channels must be unique\")\n })\n]);\n// This checks URL syntax only. Every dispatch still requires server network policy.\n// HTTP is representable for explicit self-hosted operator exceptions.\nconst webhookURLType = z\n .url({ protocol: /^https?$/ })\n .max(2048)\n .refine((value) => {\n if (!URL.canParse(value)) return false;\n\n const url = new URL(value);\n\n return !url.username && !url.password && !value.includes(\"#\");\n }, \"Webhook URLs cannot include credentials or a fragment\");\nconst webhookConfigurationType = z.strictObject({\n name: z.string().trim().min(1).max(100),\n url: webhookURLType,\n enabled: z.boolean(),\n eventTypes: z\n .array(webhookEventNameType)\n .min(1)\n .max(webhookEventNameType.options.length)\n .refine(uniqueItems, \"Event types must be unique\"),\n schemaVersion: z.literal(1),\n // Selected roots include their subtrees. They are both the event filter and the\n // visibility boundary: locations outside them are never disclosed.\n collections: webhookCollectionScopeType,\n channels: webhookChannelScopeType,\n restrictedContent: z\n .boolean()\n .describe(\"Include restricted collections, including ones restricted later\")\n});\nconst webhookCreateInputType = webhookConfigurationType.extend({\n enabled: z.boolean().default(true)\n});\nconst webhookRevisionInputType = z.strictObject({\n id: publicID(\"wh\"),\n expectedRevision: z.number().int().positive()\n});\n// A workspace has at most 10 webhooks, so one request covers all of them.\nconst webhookBulkRevisionInputType = z.strictObject({\n webhooks: z\n .array(webhookRevisionInputType)\n .min(1)\n .max(10)\n .refine((items) => uniqueItems(items.map(({ id }) => id)), \"Webhooks must be unique\")\n});\nconst webhookBulkEnabledInputType = webhookBulkRevisionInputType.extend({ enabled: z.boolean() });\nconst webhookUpdateInputType = webhookConfigurationType\n .partial()\n .extend(webhookRevisionInputType.shape)\n .refine(\n (value) => Object.keys(value).some((key) => key !== \"id\" && key !== \"expectedRevision\"),\n \"Supply at least one configuration change\"\n );\nconst webhookFailureCategoryType = z.enum([\n \"http_status\",\n \"timeout\",\n \"network\",\n \"destination_policy\",\n \"internal\"\n]);\nconst webhookEndpointType = webhookConfigurationType.extend({\n id: publicID(\"wh\"),\n workspaceID: publicID(\"ws\"),\n revision: z.number().int().positive(),\n destinationRevision: z.number().int().positive(),\n createdAt: z.iso.datetime(),\n updatedAt: z.iso.datetime(),\n disabledReason: z.enum([\"manual\", \"failures\"]).nullable(),\n health: z.strictObject({\n consecutiveFailures: z.number().int().nonnegative(),\n firstFailureAt: z.iso.datetime().nullable(),\n lastFailureAt: z.iso.datetime().nullable(),\n lastFailureCategory: webhookFailureCategoryType.nullable(),\n lastSuccessAt: z.iso.datetime().nullable(),\n pendingCount: z.number().int().nonnegative(),\n failedCount: z.number().int().nonnegative()\n }),\n signing: z.strictObject({\n rotatedAt: z.iso.datetime(),\n previousSecretExpiresAt: z.iso.datetime().nullable()\n })\n});\nconst webhookSecretType = z\n .string()\n .regex(/^whsec_[A-Za-z\\d+/]{43}=$/)\n .describe(\"One-time signing secret. Never returned by configuration or history reads.\");\nconst webhookSecretResultType = z.strictObject({\n endpoint: webhookEndpointType,\n secret: webhookSecretType\n});\nconst webhookUpdateResultType = z.discriminatedUnion(\"secretChanged\", [\n z.strictObject({ secretChanged: z.literal(false), endpoint: webhookEndpointType }),\n webhookSecretResultType.extend({ secretChanged: z.literal(true) })\n]);\n\nexport {\n webhookConfigurationType,\n webhookCreateInputType,\n webhookUpdateInputType,\n webhookRevisionInputType,\n webhookBulkRevisionInputType,\n webhookBulkEnabledInputType,\n webhookEndpointType,\n webhookFailureCategoryType,\n webhookSecretResultType,\n webhookUpdateResultType\n};\nexport type {\n WebhookBulkEnabledInput,\n WebhookBulkRevisionInput,\n WebhookConfiguration,\n WebhookCreateInput,\n WebhookEndpoint,\n WebhookScope,\n WebhookUpdateInput,\n WebhookRevisionInput,\n WebhookSecretResult,\n WebhookUpdateResult\n};\n","import { publicID } from \"../primitives/id\";\nimport * as z from \"zod\";\nimport { webhookConfigurationType } from \"../api/schemas/webhooks\";\nimport { webhookEventNames } from \"./catalog-definitions\";\nimport { uniqueItems, webhookEnvelopeType, webhookEventType, type WebhookEvent } from \"./events\";\n\n// Outbound events are the HTTP webhook events plus the extension lifecycle events, which only\n// managed extension webhooks receive. Public webhook contracts keep using the HTTP events.\ntype OutboundEvent = z.infer<typeof outboundEventType>;\ntype OutboundEventName = OutboundEvent[\"type\"];\ntype OutboundConfiguration = z.infer<typeof outboundConfigurationType>;\ntype ExtensionLifecycleEventName = (typeof extensionLifecycleEventNames)[number];\n\n/** Delivered only to the webhooks of the extension they describe; they need no permission. */\nconst extensionLifecycleEventNames = [\n \"extension.installed\",\n \"extension.enabled\",\n \"extension.disabled\",\n \"extension.updated\",\n \"extension.configured\",\n \"extension.uninstalled\"\n] as const;\nconst versionType = z.string().min(1).max(64);\nconst lifecycleEventType = webhookEnvelopeType.extend({\n subject: z.strictObject({ kind: z.literal(\"extension\"), id: publicID(\"ext\") })\n});\nconst versionDataType = z.strictObject({ version: versionType });\nconst extensionLifecycleEventSchemas = {\n \"extension.installed\": lifecycleEventType.extend({\n type: z.literal(\"extension.installed\"),\n data: versionDataType\n }),\n \"extension.enabled\": lifecycleEventType.extend({\n type: z.literal(\"extension.enabled\"),\n data: versionDataType\n }),\n \"extension.disabled\": lifecycleEventType.extend({\n type: z.literal(\"extension.disabled\"),\n data: versionDataType.extend({\n reason: z.enum([\"manual\", \"approval_required\", \"configuration_required\", \"revoked\"])\n })\n }),\n \"extension.updated\": lifecycleEventType.extend({\n type: z.literal(\"extension.updated\"),\n data: versionDataType.extend({ previousVersion: versionType })\n }),\n \"extension.configured\": lifecycleEventType.extend({\n type: z.literal(\"extension.configured\"),\n data: versionDataType.extend({\n changedFields: z.array(z.string().max(64)).max(100).describe(\"Keys only, never values\")\n })\n }),\n \"extension.uninstalled\": lifecycleEventType.extend({\n type: z.literal(\"extension.uninstalled\"),\n data: versionDataType\n })\n};\nconst outboundEventNameType = z.enum([...webhookEventNames, ...extensionLifecycleEventNames]);\nconst outboundEventType = z.discriminatedUnion(\"type\", [\n ...webhookEventType.options,\n extensionLifecycleEventSchemas[\"extension.installed\"],\n extensionLifecycleEventSchemas[\"extension.enabled\"],\n extensionLifecycleEventSchemas[\"extension.disabled\"],\n extensionLifecycleEventSchemas[\"extension.updated\"],\n extensionLifecycleEventSchemas[\"extension.configured\"],\n extensionLifecycleEventSchemas[\"extension.uninstalled\"]\n]);\n/** Stored endpoint configuration; only managed extension webhooks select lifecycle events. */\nconst outboundConfigurationType = webhookConfigurationType.extend({\n eventTypes: z\n .array(outboundEventNameType)\n .min(1)\n .max(outboundEventNameType.options.length)\n .refine(uniqueItems, \"Event types must be unique\")\n});\nconst isExtensionLifecycleEvent = (type: string): type is ExtensionLifecycleEventName => {\n return (extensionLifecycleEventNames as readonly string[]).includes(type);\n};\n\n/** HTTP webhook events, as opposed to extension lifecycle events. */\nconst isWebhookEvent = (event: OutboundEvent): event is WebhookEvent => {\n return !isExtensionLifecycleEvent(event.type);\n};\n\nexport {\n isWebhookEvent,\n extensionLifecycleEventNames,\n extensionLifecycleEventSchemas,\n outboundEventNameType,\n outboundEventType,\n outboundConfigurationType,\n isExtensionLifecycleEvent\n};\nexport type {\n ExtensionLifecycleEventName,\n OutboundConfiguration,\n OutboundEvent,\n OutboundEventName\n};\n","import * as z from \"zod\";\nimport { webhookEventDefinitions, webhookEventNames } from \"../webhooks/catalog-definitions\";\nimport { uniqueItems, webhookChannelCodeType } from \"../webhooks/events\";\nimport {\n extensionLifecycleEventNames,\n type ExtensionLifecycleEventName\n} from \"../webhooks/outbound\";\n\ntype ExtensionWebhookEventName = z.output<typeof extensionWebhookEventNameType>;\ntype ExtensionWebhook = z.output<typeof extensionWebhookType>;\n\nconst MAX_EXTENSION_WEBHOOKS = 10;\nconst extensionWebhookEventNameType = z.enum([\n ...webhookEventNames,\n ...extensionLifecycleEventNames\n]);\nconst supportsChannels = (event: ExtensionWebhookEventName): boolean => {\n if (event.startsWith(\"extension.\")) return false;\n\n return webhookEventDefinitions[event as keyof typeof webhookEventDefinitions].filters.some(\n (filter) => {\n return filter === \"channels\";\n }\n );\n};\n/** A path appended to the backend URL; segments cannot be empty, `.` or `..`. */\nconst extensionWebhookPathType = z\n .string()\n .max(200)\n .regex(/^\\/(?:[A-Za-z\\d_~-][A-Za-z\\d._~-]*\\/?)*$/, \"Use a path, e.g. /webhooks\");\nconst extensionWebhookType = z\n .strictObject({\n events: z\n .array(extensionWebhookEventNameType)\n .min(1)\n .max(extensionWebhookEventNameType.options.length)\n .refine(uniqueItems, \"Events must be unique\"),\n path: extensionWebhookPathType,\n channels: z\n .array(webhookChannelCodeType)\n .max(50)\n .refine(uniqueItems, \"Channels must be unique\")\n .describe(\"Publishing channels to match; empty for all channels\")\n .default([])\n })\n .refine(({ events, channels }) => !channels.length || events.some(supportsChannels), {\n message: \"Channel filters need an event that supports them\",\n path: [\"channels\"]\n });\n\nexport {\n MAX_EXTENSION_WEBHOOKS,\n extensionLifecycleEventNames,\n extensionWebhookEventNameType,\n extensionWebhookType\n};\nexport type { ExtensionLifecycleEventName, ExtensionWebhookEventName, ExtensionWebhook };\n","import * as z from \"zod\";\nimport { keyPermissionType } from \"../entities/keys\";\nimport { hasPermission } from \"../permissions/requirements\";\nimport { webhookEventDefinitions } from \"../webhooks/catalog-definitions\";\nimport { uniqueItems } from \"../webhooks/events\";\nimport { extensionConfigurationType } from \"./configuration\";\nimport {\n extensionContributionsType,\n extensionIconType,\n extensionStableIDType\n} from \"./contributions\";\nimport { MAX_EXTENSION_WEBHOOKS, extensionWebhookType } from \"./webhooks\";\n\ntype ExtensionPermission = z.output<typeof extensionPermissionType>;\ntype ExtensionBackendKey = z.output<typeof extensionBackendKeyType>;\ntype ExtensionManifest = z.output<typeof extensionManifestType>;\ntype ExtensionManifestInput = z.input<typeof extensionManifestType>;\n\nconst EXTENSION_API_VERSION = 1;\nconst MAX_EXTENSION_REQUEST_URLS = 10;\nconst MAX_EXTENSION_BACKEND_KEYS = 3;\n/** Approving it requires workspace-wide restricted-content read authority. */\nconst RESTRICTED_CONTENT_PERMISSION = \"read:restricted_collections\";\nconst extensionPermissionType = z.enum([\n ...keyPermissionType.options,\n RESTRICTED_CONTENT_PERMISSION\n]);\nconst extensionNameType = z\n .string()\n .regex(/^[a-z\\d][a-z\\d-]{0,38}\\/[a-z\\d][a-z\\d-]{0,62}$/, \"Use scope/name, e.g. acme/publish\");\nconst extensionVersionType = z\n .string()\n .max(64)\n .regex(\n /^(?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)(?:-[\\dA-Za-z-]+(?:\\.[\\dA-Za-z-]+)*)?$/,\n \"Use a semantic version without build metadata, e.g. 1.4.0\"\n );\nconst base64URLType = z.string().regex(/^[A-Za-z\\d_-]{43}$/, \"Use a base64url 32-byte value\");\nconst extensionBackendKeyIDType = z.string().regex(/^[A-Za-z\\d._-]{1,64}$/, \"Use a key ID\");\n/** Public JWKs only; strict objects reject private key members. */\nconst extensionBackendKeyType = z.discriminatedUnion(\"alg\", [\n z.strictObject({\n kid: extensionBackendKeyIDType,\n kty: z.literal(\"OKP\"),\n alg: z.literal(\"EdDSA\"),\n crv: z.literal(\"Ed25519\"),\n x: base64URLType\n }),\n z.strictObject({\n kid: extensionBackendKeyIDType,\n kty: z.literal(\"EC\"),\n alg: z.literal(\"ES256\"),\n crv: z.literal(\"P-256\"),\n x: base64URLType,\n y: base64URLType\n })\n]);\n/** Canonical URL with an optional path prefix and no credentials, query, or fragment. */\nconst createURLType = (protocols: string[]): z.ZodString => {\n return z\n .string()\n .max(2048)\n .refine(\n (value) => {\n if (!URL.canParse(value)) return false;\n\n const url = new URL(value);\n const isCanonical = value === url.href || (url.pathname === \"/\" && value === url.origin);\n const hasExtraParts = url.username || url.password || url.search || url.hash;\n\n return protocols.includes(url.protocol) && isCanonical && !hasExtraParts;\n },\n `Use a canonical ${protocols.join(\" or \")} URL, e.g. https://api.example.com/v1/`\n );\n};\nconst createManifestType = (protocols: string[]) => {\n const urlType = createURLType(protocols);\n\n return z\n .strictObject({\n name: extensionNameType,\n version: extensionVersionType,\n displayName: z.string().min(1).max(60),\n description: z.string().min(1).max(300),\n /** The logo or main icon, shown in the catalog, extension list, and settings. */\n icon: extensionIconType.optional(),\n apiVersion: z.literal(EXTENSION_API_VERSION),\n permissions: z\n .array(extensionPermissionType)\n .refine(uniqueItems, \"Permissions must be unique\")\n .default([]),\n requests: z\n .array(urlType)\n .max(MAX_EXTENSION_REQUEST_URLS)\n .refine(uniqueItems, \"Request URLs must be unique\")\n .describe(\"URLs that the frontend can request, besides the backend\")\n .default([]),\n backend: z\n .strictObject({\n url: urlType,\n keys: z\n .array(extensionBackendKeyType)\n .min(1)\n .max(MAX_EXTENSION_BACKEND_KEYS)\n .refine((keys) => uniqueItems(keys.map(({ kid }) => kid)), \"Key IDs must be unique\")\n })\n .optional(),\n webhooks: z\n .record(extensionStableIDType, extensionWebhookType)\n .refine(\n (webhooks) => Object.keys(webhooks).length <= MAX_EXTENSION_WEBHOOKS,\n `Use at most ${MAX_EXTENSION_WEBHOOKS} webhooks`\n )\n .default({}),\n configuration: extensionConfigurationType.optional(),\n ...extensionContributionsType\n })\n .superRefine((manifest, context) => {\n const contributionIDs = [\n ...manifest.elementViews,\n ...manifest.blockActions,\n ...manifest.panels,\n ...manifest.settingsSections\n ].map(({ id }) => id);\n const isGranted = (required: string): boolean => {\n return manifest.permissions.some((permission) => hasPermission(permission, required));\n };\n const readsRestrictableContent = isGranted(\"read:entries\") || isGranted(\"read:collections\");\n const hasUnusedRestrictedGrant =\n manifest.permissions.includes(RESTRICTED_CONTENT_PERMISSION) && !readsRestrictableContent;\n\n if (!uniqueItems(contributionIDs)) {\n context.addIssue({ code: \"custom\", message: \"Contribution IDs must be unique\" });\n }\n\n if (hasUnusedRestrictedGrant) {\n context.addIssue({\n code: \"custom\",\n path: [\"permissions\"],\n message: \"Restricted content needs read:entries or read:collections\"\n });\n }\n\n for (const [id, webhook] of Object.entries(manifest.webhooks)) {\n if (!manifest.backend) {\n context.addIssue({\n code: \"custom\",\n path: [\"webhooks\", id],\n message: \"Webhooks need a backend\"\n });\n }\n\n for (const [index, event] of webhook.events.entries()) {\n const definition = webhookEventDefinitions[event as keyof typeof webhookEventDefinitions];\n const missing = definition?.requiredPermissions.filter(\n (required) => !isGranted(required)\n );\n\n if (missing?.length) {\n context.addIssue({\n code: \"custom\",\n path: [\"webhooks\", id, \"events\", index],\n message: `The event needs ${missing.join(\", \")}`\n });\n }\n }\n }\n });\n};\nconst extensionURLType = createURLType([\"https:\"]);\nconst extensionManifestType = createManifestType([\"https:\"]);\n/** Development extensions run on a fully local stack, so their URLs can use HTTP. */\nconst developmentExtensionManifestType = createManifestType([\"https:\", \"http:\"]);\n\nexport {\n EXTENSION_API_VERSION,\n RESTRICTED_CONTENT_PERMISSION,\n extensionPermissionType,\n extensionNameType,\n extensionVersionType,\n extensionBackendKeyIDType,\n extensionBackendKeyType,\n extensionURLType,\n extensionManifestType,\n developmentExtensionManifestType\n};\nexport type { ExtensionPermission, ExtensionBackendKey, ExtensionManifest, ExtensionManifestInput };\n","import * as z from \"zod\";\nimport { uniqueItems } from \"../webhooks/events\";\nimport {\n extensionBackendKeyIDType,\n extensionBackendKeyType,\n extensionManifestType,\n extensionNameType,\n extensionURLType,\n extensionVersionType\n} from \"./manifest\";\n\ntype ExtensionKeySet = z.output<typeof extensionKeySetType>;\ntype ExtensionArtifact = z.output<typeof extensionArtifactType>;\ntype ExtensionVersionManifest = z.output<typeof extensionVersionManifestType>;\ntype ExtensionRevocation = z.output<typeof extensionRevocationType>;\ntype ExtensionRegistryEntry = z.output<typeof extensionRegistryEntryType>;\ntype ExtensionRegistryIndex = z.output<typeof extensionRegistryIndexType>;\ntype ExtensionDisabledReason = z.output<typeof extensionDisabledReasonType>;\n\n// The backend and the registry tooling order versions with the same rules.\nconst splitVersion = (version: string): [number[], string[]] => {\n const separator = version.indexOf(\"-\");\n const core = separator < 0 ? version : version.slice(0, separator);\n const prerelease = separator < 0 ? [] : version.slice(separator + 1).split(\".\");\n\n return [core.split(\".\").map(Number), prerelease];\n};\nconst compareIdentifiers = (a: string, b: string): number => {\n const isNumericA = /^\\d+$/.test(a);\n const isNumericB = /^\\d+$/.test(b);\n\n if (isNumericA && isNumericB) return Number(a) - Number(b);\n\n if (isNumericA !== isNumericB) return isNumericA ? -1 : 1;\n\n return a < b ? -1 : Number(a > b);\n};\n/** Semantic version precedence: negative when `a` is older, positive when it is newer. */\nconst compareExtensionVersions = (a: string, b: string): number => {\n const [coreA, prereleaseA] = splitVersion(a);\n const [coreB, prereleaseB] = splitVersion(b);\n const coreDifference = coreA.map((part, index) => part - coreB[index]).find(Boolean);\n\n if (coreDifference) return coreDifference;\n\n if (!prereleaseA.length || !prereleaseB.length) {\n return prereleaseB.length - prereleaseA.length;\n }\n\n for (let index = 0; index < Math.min(prereleaseA.length, prereleaseB.length); index += 1) {\n const difference = compareIdentifiers(prereleaseA[index], prereleaseB[index]);\n\n if (difference) return difference;\n }\n\n return prereleaseA.length - prereleaseB.length;\n};\nconst MAX_EXTENSION_ARTIFACT_SIZE = 5 * 1024 * 1024;\nconst MAX_REGISTRY_EXTENSIONS = 1000;\nconst MAX_REGISTRY_VERSIONS = 500;\nconst keySetShape = {\n keys: z.array(extensionBackendKeyType).max(10),\n revokedKeys: z.array(extensionBackendKeyIDType).max(100).default([])\n};\nconst refineKeySet = (\n { keys, revokedKeys }: { keys: Array<{ kid: string }>; revokedKeys: string[] },\n context: z.RefinementCtx\n): void => {\n if (!uniqueItems([...keys.map(({ kid }) => kid), ...revokedKeys])) {\n context.addIssue({\n code: \"custom\",\n path: [\"keys\"],\n message: \"Key IDs must be unique and revoked keys cannot be listed as keys\"\n });\n }\n};\n/** The keys of a registry entry; extension projects keep them in `andesine.keys.json`. */\nconst extensionKeySetType = z.object(keySetShape).superRefine(refineKeySet);\nconst extensionArtifactType = z.strictObject({\n url: extensionURLType,\n sha256: z.string().regex(/^[a-f\\d]{64}$/, \"Use a lowercase hex SHA-256 digest\"),\n size: z.int().positive().max(MAX_EXTENSION_ARTIFACT_SIZE)\n});\n/** An immutable registry version: the reviewed manifest and its build output. */\nconst extensionVersionManifestType = z.strictObject({\n manifest: extensionManifestType,\n sourceCommit: z.string().regex(/^[a-f\\d]{40}$/, \"Use a full commit SHA\"),\n artifacts: z.strictObject({\n frontend: extensionArtifactType,\n /** CSS for the extension views. */\n styles: extensionArtifactType.optional(),\n /** CSS for the manifest icons, which the host shows outside the extension views. */\n icons: extensionArtifactType.optional()\n }),\n publishedAt: z.iso.datetime()\n});\nconst extensionRevocationType = z.strictObject({\n name: extensionNameType,\n version: extensionVersionType,\n reason: z.string().min(1).max(500),\n replacement: extensionVersionType.optional(),\n recordedAt: z.iso.datetime()\n});\n// Index objects strip unknown fields, and versions are validated one by one by the reader,\n// so additive registry changes and newer extension API versions do not break older instances.\nconst extensionRegistryEntryType = z\n .object({\n name: extensionNameType,\n publisher: z.object({ name: z.string().min(1).max(100), url: extensionURLType.optional() }),\n ...keySetShape,\n versions: z.array(z.unknown()).max(MAX_REGISTRY_VERSIONS)\n })\n .superRefine(refineKeySet);\nconst extensionRegistryIndexType = z\n .object({\n formatVersion: z.literal(1),\n generatedAt: z.iso.datetime(),\n extensions: z.array(extensionRegistryEntryType).max(MAX_REGISTRY_EXTENSIONS),\n revocations: z.array(extensionRevocationType).default([])\n })\n .refine(\n ({ extensions }) => uniqueItems(extensions.map(({ name }) => name)),\n \"Extension names must be unique\"\n );\nconst extensionDisabledReasonType = z.enum([\n \"manual\",\n \"approval_required\",\n \"configuration_required\",\n \"revoked\"\n]);\n\nexport {\n MAX_EXTENSION_ARTIFACT_SIZE,\n compareExtensionVersions,\n extensionKeySetType,\n extensionArtifactType,\n extensionVersionManifestType,\n extensionRevocationType,\n extensionRegistryEntryType,\n extensionRegistryIndexType,\n extensionDisabledReasonType\n};\nexport type {\n ExtensionKeySet,\n ExtensionArtifact,\n ExtensionVersionManifest,\n ExtensionRevocation,\n ExtensionRegistryEntry,\n ExtensionRegistryIndex,\n ExtensionDisabledReason\n};\n","import type { ExtensionManifest } from \"@andesine/contracts/extensions/manifest\";\nimport { transformAsync } from \"@babel/core\";\nimport { createRequire } from \"node:module\";\nimport path from \"node:path\";\nimport { stripVTControlCharacters } from \"node:util\";\nimport { build, type Plugin } from \"rolldown\";\nimport { transformSync } from \"rolldown/utils\";\nimport { CLIError, exitCodes } from \"../errors\";\n\ninterface FrontendBundle {\n code: string;\n /** The code of the project's own modules, which utility and icon classes are read from. */\n sources: string;\n}\n\nconst ENTRY_ID = \"\\0andesine-extension-entry\";\nconst require = createRequire(import.meta.url);\n\n/** The view entries that the manifest names, in manifest order. */\nconst getEntries = (manifest: ExtensionManifest): string[] => {\n const entries = [\n ...manifest.elementViews.flatMap((view) => [\n view.entry,\n ...view.descendants.map(({ entry }) => entry)\n ]),\n ...manifest.blockActions.map(({ entry }) => entry),\n ...manifest.panels.map(({ entry }) => entry),\n ...manifest.settingsSections.map(({ entry }) => entry)\n ];\n\n return [...new Set(entries)];\n};\n/** Generates the `startExtension` call; a missing export fails the build. */\nconst createEntryPlugin = (module: string, entries: string[]): Plugin => {\n const imports = entries.map((entry, index) => `${entry} as view${index}`).join(\", \");\n const views = entries.map((entry, index) => `${entry}: view${index}`).join(\", \");\n\n return {\n name: \"andesine-extension-entry\",\n resolveId: (id) => (id === ENTRY_ID ? id : null),\n load: (id) => {\n if (id !== ENTRY_ID) return null;\n\n return [\n entries.length ? `import { ${imports} } from ${JSON.stringify(module)};` : \"\",\n `import { startExtension } from \"@andesine/extensions/solid\";`,\n `startExtension({ ${views} });`\n ].join(\"\\n\");\n }\n };\n};\n/** Strips TypeScript, then compiles JSX for the extension renderer. */\nconst solidPlugin: Plugin = {\n name: \"andesine-extension-solid\",\n transform: {\n filter: { id: /\\.[jt]sx$/ },\n handler: async (code, id) => {\n const stripped = transformSync(id, code, { jsx: \"preserve\" });\n\n if (stripped.errors.length) throw stripped.errors[0];\n\n const result = await transformAsync(stripped.code, {\n filename: id,\n babelrc: false,\n configFile: false,\n presets: [\n [\n require.resolve(\"babel-preset-solid\"),\n { generate: \"universal\", moduleName: \"@andesine/extensions/solid\" }\n ]\n ]\n });\n\n return { code: result?.code ?? \"\" };\n }\n }\n};\n\n/** Bundles the frontend into one classic script for the extension worker. */\nconst bundleFrontend = async (\n root: string,\n manifest: ExtensionManifest,\n frontend: string,\n onWarning: (message: string) => void\n): Promise<FrontendBundle> => {\n const entries = getEntries(manifest);\n const module = path.resolve(root, frontend);\n const { output } = await build({\n cwd: root,\n input: ENTRY_ID,\n platform: \"browser\",\n plugins: [createEntryPlugin(module, entries), solidPlugin],\n transform: { define: { \"process.env.NODE_ENV\": JSON.stringify(\"production\") } },\n write: false,\n onLog: (level, log, handler) => {\n // An unresolved import would become a global that the worker does not have.\n if (log.code === \"UNRESOLVED_IMPORT\") handler(\"error\", log);\n else if (level === \"warn\") onWarning(log.message);\n },\n output: { format: \"iife\", codeSplitting: false, minify: true }\n }).catch((error: Error & { errors?: Array<{ message: string }> }) => {\n const messages = (error.errors?.map(({ message }) => message) ?? [error.message]).map(\n stripVTControlCharacters\n );\n\n throw new CLIError(`The frontend build failed:\\n${messages.join(\"\\n\")}`, exitCodes.failure);\n });\n const [chunk] = output;\n const isProjectModule = (id: string): boolean => {\n return id.startsWith(root + path.sep) && !id.includes(`${path.sep}node_modules${path.sep}`);\n };\n const sources = Object.entries(chunk.modules)\n .filter(([id]) => isProjectModule(id))\n .map(([, rendered]) => rendered.code ?? \"\");\n\n return { code: chunk.code, sources: sources.join(\"\\n\") };\n};\n\nexport { bundleFrontend };\n","import {\n type ExtensionBackendKey,\n type ExtensionManifest,\n developmentExtensionManifestType,\n extensionManifestType\n} from \"@andesine/contracts/extensions/manifest\";\nimport { type ExtensionKeySet, extensionKeySetType } from \"@andesine/contracts/extensions/registry\";\nimport { access, readFile, writeFile } from \"node:fs/promises\";\nimport path from \"node:path\";\nimport { pathToFileURL } from \"node:url\";\nimport { build } from \"rolldown\";\nimport * as z from \"zod\";\nimport { CLIError, exitCodes } from \"../errors\";\n\n/** The `build` export of the config file; see `defineBuild` in `@andesine/extensions`. */\ninterface ExtensionBuildOptions {\n frontend?: string;\n icons?: Record<string, string>;\n}\ninterface ExtensionProject {\n root: string;\n manifest: ExtensionManifest;\n build: ExtensionBuildOptions;\n}\n/** `extensions dev`: development keys and, optionally, the local backend URL. */\ninterface DevelopmentOverrides {\n keys: ExtensionBackendKey[];\n backendURL?: string;\n}\ninterface ValidationIssue {\n path: PropertyKey[];\n message: string;\n}\n\nconst CONFIG_FILE = \"andesine.config.ts\";\nconst KEYS_FILE = \"andesine.keys.json\";\n/** Build output and private keys; the template ignores it in Git. */\nconst WORK_DIRECTORY = \".andesine\";\nconst extensionBuildOptionsType = z\n .strictObject({\n frontend: z.string().min(1).optional(),\n icons: z.record(z.string().regex(/^[a-z\\d]+(?:-[a-z\\d]+)*$/), z.string().min(1)).optional()\n })\n .default({});\n\nconst exists = async (file: string): Promise<boolean> => {\n return access(file).then(\n () => true,\n () => false\n );\n};\n// Contracts can use another Zod version than the CLI, so issues are formatted here.\nconst formatError = (subject: string, issues: ValidationIssue[]): CLIError => {\n const lines = issues.map(({ path: at, message }) => {\n return `- ${at.length ? `${at.map(String).join(\".\")}: ` : \"\"}${message}`;\n });\n\n return new CLIError(`${subject} is invalid:\\n${lines.join(\"\\n\")}`, exitCodes.usage);\n};\n/** Bundles the config into the work directory, so its imports resolve from the project. */\nconst importConfig = async (root: string): Promise<Record<string, unknown>> => {\n const file = path.join(root, WORK_DIRECTORY, \"config.mjs\");\n\n await build({\n cwd: root,\n input: path.join(root, CONFIG_FILE),\n platform: \"node\",\n external: (id) => !id.startsWith(\".\") && !path.isAbsolute(id),\n logLevel: \"silent\",\n output: { file, format: \"esm\" }\n });\n\n return import(`${pathToFileURL(file).href}?t=${Date.now()}`);\n};\n\n/**\n * Loads and validates the manifest and build options of the extension in `root`. In\n * development, the manifest's backend uses the development keys and URL, and may use local HTTP.\n */\nconst loadExtensionProject = async (\n root: string,\n development?: DevelopmentOverrides\n): Promise<ExtensionProject> => {\n if (!(await exists(path.join(root, CONFIG_FILE)))) {\n throw new CLIError(`No ${CONFIG_FILE} in ${root}.`, exitCodes.usage);\n }\n\n const config = await importConfig(root);\n const input = config.default as { backend?: object } | undefined;\n const developmentBackend = input?.backend && {\n ...input.backend,\n keys: development?.keys,\n ...(development?.backendURL && { url: development.backendURL })\n };\n const manifest = development\n ? developmentExtensionManifestType.safeParse({ ...input, backend: developmentBackend })\n : extensionManifestType.safeParse(input);\n const buildOptions = extensionBuildOptionsType.safeParse(config.build);\n\n if (!manifest.success) throw formatError(\"The manifest\", manifest.error.issues);\n if (!buildOptions.success) throw formatError(\"The build options\", buildOptions.error.issues);\n\n return { root, manifest: manifest.data, build: buildOptions.data };\n};\n// The public keys of the manifest, and the key IDs that the registry entry lists as revoked.\nconst readExtensionKeys = async (root: string): Promise<ExtensionKeySet> => {\n const file = path.join(root, KEYS_FILE);\n\n if (!(await exists(file))) return { keys: [], revokedKeys: [] };\n\n const keys = extensionKeySetType.safeParse(JSON.parse(await readFile(file, \"utf8\")));\n\n if (!keys.success) throw formatError(KEYS_FILE, keys.error.issues);\n\n return keys.data;\n};\nconst writeExtensionKeys = async (root: string, keys: ExtensionKeySet): Promise<void> => {\n await writeFile(path.join(root, KEYS_FILE), `${JSON.stringify(keys, null, 2)}\\n`);\n};\n\nexport {\n KEYS_FILE,\n WORK_DIRECTORY,\n exists,\n loadExtensionProject,\n readExtensionKeys,\n writeExtensionKeys\n};\nexport type { ExtensionBuildOptions, ExtensionProject, DevelopmentOverrides };\n","type ExtensionStyleKind = \"view\" | \"icon\";\n\nconst MAX_EXTENSION_CSS_SIZE = 256 * 1024;\nconst ALLOWED_AT_RULES = new Set([\"media\", \"supports\"]);\n// Inline SVG icons (`--un-icon`) are the only URLs: they load nothing.\nconst DATA_SVG_URL = /url\\(\\s*(?:\"data:image\\/svg\\+xml[^\"]*\"|'data:image\\/svg\\+xml[^']*')\\s*\\)/gi;\nconst FORBIDDEN_VALUE =\n /url\\(|\\bsrc\\(|\\bimage\\(|image-set\\(|expression\\(|-moz-binding|behavior\\s*:|\\\\|@|[{}<]/i;\nconst NEWLINE = /[\\n\\r\\f]/;\n\nclass ExtensionStyleError extends Error {}\n\n/** Host-owned content slots inside element views; extension CSS stops at them. */\nconst EXTENSION_SLOT_SELECTOR = \"[data-content-slot]\";\n/** Views render inside `data-extension`; manifest icons inside `data-extension-icon`. */\nconst getExtensionScope = (name: string, kind: ExtensionStyleKind = \"view\"): string => {\n return `[${kind === \"view\" ? \"data-extension\" : \"data-extension-icon\"}=\"${name}\"]`;\n};\n/** The `@scope` prelude of view CSS: the view down to, but not into, its content slots. */\nconst getViewScopePrelude = (name: string): string => {\n return `(${getExtensionScope(name)}) to (${EXTENSION_SLOT_SELECTOR})`;\n};\nconst fail = (message: string): never => {\n throw new ExtensionStyleError(message);\n};\n/**\n * Removes comments outside strings. Escapes and strings are read like the browser reads them,\n * and a raw newline in a string fails, so the validated text cannot differ from what applies.\n */\nconst stripComments = (css: string): string => {\n let result = \"\";\n let quote = \"\";\n\n for (let index = 0; index < css.length; index += 1) {\n const char = css[index];\n\n if (char === \"\\\\\") {\n result += css.slice(index, index + 2);\n index += 1;\n } else if (quote) {\n if (NEWLINE.test(char)) fail(\"Unterminated CSS string\");\n\n if (char === quote) quote = \"\";\n\n result += char;\n } else if (char === \"/\" && css[index + 1] === \"*\") {\n const end = css.indexOf(\"*/\", index + 2);\n\n if (end < 0) fail(\"Unterminated CSS comment\");\n\n result += \" \";\n index = end + 1;\n } else {\n if (char === '\"' || char === \"'\") quote = char;\n\n result += char;\n }\n }\n\n return quote ? fail(\"Unterminated CSS string\") : result;\n};\n/** Finds the next `stops` character outside strings, escapes, parentheses, and brackets, or -1. */\nconst scan = (css: string, start: number, stops: string): number => {\n let depth = 0;\n let quote = \"\";\n\n for (let index = start; index < css.length; index += 1) {\n const char = css[index];\n\n if (char === \"\\\\\") {\n index += 1;\n } else if (quote) {\n if (char === quote) quote = \"\";\n } else if (char === '\"' || char === \"'\") {\n quote = char;\n } else if (char === \"(\" || char === \"[\") {\n depth += 1;\n } else if (char === \")\" || char === \"]\") {\n depth -= 1;\n } else if (depth === 0 && stops.includes(char)) {\n return index;\n }\n }\n\n return -1;\n};\nconst readUntil = (css: string, start: number, stops: string): number => {\n const index = scan(css, start, stops);\n\n return index < 0 ? fail(\"Unterminated CSS block\") : index;\n};\n/** Finds the `}` that closes the block opened at `open`, counting nested blocks. */\nconst findBlockEnd = (css: string, open: number): number => {\n let depth = 1;\n let index = open;\n\n while (depth > 0) {\n index = readUntil(css, index + 1, \"{}\");\n depth += css[index] === \"{\" ? 1 : -1;\n }\n\n return index;\n};\nconst splitSelectors = (prelude: string): string[] => {\n const selectors: string[] = [];\n\n let start = 0;\n\n for (let end = scan(prelude, 0, \",\"); end >= 0; end = scan(prelude, start, \",\")) {\n selectors.push(prelude.slice(start, end).trim());\n start = end + 1;\n }\n\n selectors.push(prelude.slice(start).trim());\n\n return selectors;\n};\n/** Every selector starts with `prefix` and a descendant combinator, never the prefix alone. */\nconst isScopedSelectorList = (selectors: string, prefix: string): boolean => {\n return splitSelectors(selectors).every((selector) => {\n return selector.startsWith(`${prefix} `) && selector.trim().length > prefix.length;\n });\n};\n/** Values load nothing (only inline SVG icon URLs) and contain no escapes or nested blocks. */\nconst isSafeCSSValue = (value: string): boolean => {\n return !FORBIDDEN_VALUE.test(value.replace(DATA_SVG_URL, \"\"));\n};\n/** `prefix` is null at the top level of view CSS, where only the `@scope` rule is allowed. */\nconst validateBlock = (\n css: string,\n start: number,\n end: number,\n prefix: string | null,\n scopePrelude: string\n): void => {\n let index = start;\n\n while (index < end) {\n while (index < end && /\\s/.test(css[index])) index += 1;\n\n if (index >= end) return;\n\n const open = readUntil(css, index, \"{;\");\n\n if (css[open] === \";\") fail(\"CSS statements must be rules\");\n\n const prelude = css.slice(index, open).trim();\n const close = findBlockEnd(css, open);\n\n if (scan(prelude, 0, \"}\") >= 0) fail(\"Unexpected CSS block end\");\n\n if (close > end) fail(\"Unterminated CSS block\");\n\n if (prelude.startsWith(\"@\")) {\n const atRule = (/^@([\\w-]+)/.exec(prelude)?.[1] ?? \"\").toLowerCase();\n const condition = prelude.slice(atRule.length + 1).trim();\n const isViewScope = atRule === \"scope\" && prefix === null && condition === scopePrelude;\n const isCondition = ALLOWED_AT_RULES.has(atRule) && prefix !== null;\n\n if (!isViewScope && !isCondition) fail(`CSS at-rule not allowed here: @${atRule}`);\n\n if (!isSafeCSSValue(condition)) fail(\"Unsafe CSS condition\");\n\n validateBlock(css, open + 1, close, isViewScope ? \":scope\" : prefix, scopePrelude);\n } else {\n if (prefix === null) fail(\"Extension view CSS must be inside its @scope rule\");\n\n if (!isScopedSelectorList(prelude, prefix!)) {\n fail(`CSS selector outside the scope: ${prelude}`);\n }\n\n if (!isSafeCSSValue(css.slice(open + 1, close))) {\n fail(\"CSS values cannot load resources or use escapes\");\n }\n }\n\n index = close + 1;\n }\n};\n/**\n * View CSS is one `@scope (<view>) to (<content slot>)` rule, so it never reaches host-owned\n * content in slots; icon CSS rules start with the icon scope. Inside, only style rules\n * (optionally in `@media`/`@supports`) without escapes in values or URL-bearing values other\n * than inline SVG icons. The host also checks the browser-parsed rules before applying them.\n */\nconst validateExtensionCSS = (\n css: string,\n name: string,\n kind: ExtensionStyleKind = \"view\"\n): void => {\n if (css.length > MAX_EXTENSION_CSS_SIZE) fail(\"Extension CSS is too large\");\n\n const withoutComments = stripComments(css);\n const prefix = kind === \"view\" ? null : getExtensionScope(name, kind);\n\n validateBlock(withoutComments, 0, withoutComments.length, prefix, getViewScopePrelude(name));\n};\n\nexport {\n MAX_EXTENSION_CSS_SIZE,\n EXTENSION_SLOT_SELECTOR,\n ExtensionStyleError,\n getExtensionScope,\n getViewScopePrelude,\n isScopedSelectorList,\n isSafeCSSValue,\n validateExtensionCSS\n};\nexport type { ExtensionStyleKind };\n","import { definePreset, type Rule } from \"unocss\";\nimport { colors } from \"unocss/preset-wind3\";\n\nconst andesineIcons = {\n logo: `<svg viewBox=\"0 0 24 24\" fill=\"currentColor\"><path d=\"M11.9069231,0 C13.0018372,0 13.9483357,0.635443279 14.397751,1.55766239 L18.5217192,9.80587694 C18.7187228,10.1865349 18.83,10.6187339 18.83,11.0769231 C18.83,12.606327 17.5901732,13.8461538 16.0607692,13.8461538 C14.9658551,13.8461538 14.0193566,13.2107106 13.5699414,12.2884915 L12.0384615,9.22476923 L6.15084166,22.3086788 C5.73044955,23.3025974 4.74628371,24 3.59923077,24 C2.06982685,24 0.83,22.7601732 0.83,21.2307692 C0.83,20.8083537 0.924579355,20.4080284 1.09371684,20.0498145 L9.35966608,1.68108512 C9.78247025,0.692617692 10.7638119,0 11.9069231,0 Z M18.3684615,14.7692308 C19.8978655,14.7692308 21.1376923,16.0090576 21.1376923,17.5384615 C21.1376923,19.0678655 19.8978655,20.3076923 18.3684615,20.3076923 C18.2141372,20.3076923 18.0627613,20.2950686 17.9153101,20.2707976 L12.83,19.8461538 L12.7298971,19.8440218 C11.5018339,19.7916084 10.5223077,18.7794252 10.5223077,17.5384615 C10.5223077,16.2639583 11.5554967,15.2307692 12.83,15.2307692 L17.9097768,14.8070421 C18.0589734,14.7821723 18.2122062,14.7692308 18.3684615,14.7692308 Z\"></path></svg>`\n};\nconst andesineTheme = {\n colors: {\n primary: \"#ff3617\",\n secondary: \"#f88f52\",\n // Mix of primary and secondary\n tertiary: \"#fc6335\",\n gray: {\n ...colors,\n 850: \"#1b2534\",\n 950: \"#0e1422\"\n }\n }\n};\nconst andesineRules: Rule[] = [\n [\n /^mask-edge-fading-(?:\\[side=(t|b|r|l)\\]|(t|b|r|l))-(\\d+)$/,\n ([, bracketSide, shortSide, value]) => {\n const side = bracketSide || shortSide;\n const rem = Number(value) / 4;\n const direction = {\n t: \"to bottom\",\n b: \"to top\",\n r: \"to left\",\n l: \"to right\"\n }[side];\n\n return {\n \"mask-image\": `linear-gradient(${direction}, transparent 0%, black ${rem}rem, black 100%)`,\n \"mask-repeat\": \"no-repeat\"\n };\n }\n ],\n [\n /^mask-edge-fading-(\\d+)$/,\n ([, value]) => {\n const rem = Number(value) / 4;\n\n return {\n \"mask-image\": [\n `linear-gradient(to top, black 0%, black 100%)`,\n `linear-gradient(to top, transparent 0%, black 100%)`,\n `linear-gradient(to right, transparent 0%, black 100%)`,\n `linear-gradient(to bottom, transparent 0%, black 100%)`,\n `linear-gradient(to left, transparent 0%, black 100%)`\n ].join(\", \"),\n \"mask-position\": `center, top, right, bottom, left`,\n \"mask-size\": `100% 100%, 100% ${rem}rem, ${rem}rem 100%, 100% ${rem}rem, ${rem}rem 100%`,\n \"mask-repeat\": \"no-repeat, no-repeat, no-repeat, no-repeat, no-repeat\",\n \"mask-composite\": \"subtract, add, add, add\"\n };\n }\n ]\n];\n/** Andesine theme tokens and rules, shared by the web app, landing, and extension builds. */\nconst presetAndesine = definePreset(() => ({\n name: \"andesine\",\n theme: andesineTheme,\n rules: andesineRules\n}));\n\nexport { andesineIcons, andesineTheme, presetAndesine };\n","import {\n ExtensionStyleError,\n getExtensionScope,\n getViewScopePrelude,\n validateExtensionCSS\n} from \"@andesine/contracts/extensions/styles\";\nimport { createGenerator, presetIcons, presetWind3, type UnoGenerator } from \"unocss\";\nimport { presetAndesine } from \"./index\";\n\ninterface ExtensionCSSOptions {\n /** The extension name; every rule is scoped to it. */\n name: string;\n /** Iconify collections by set prefix: default, installed, and custom sets. */\n icons: IconCollections;\n}\ninterface ExtensionViewCSSOptions extends ExtensionCSSOptions {\n /** The bundled frontend code that utility and icon classes are read from. */\n code: string;\n}\ninterface ExtensionIconCSSOptions extends ExtensionCSSOptions {\n /** Icon classes of the manifest (`icon`, panel and block action icons). */\n classes: string[];\n}\n\ntype IconCollections = NonNullable<NonNullable<Parameters<typeof presetIcons>[0]>[\"collections\"]>;\n\n/** Icon sets that the extension build provides without installation. */\nconst DEFAULT_ICON_SETS = [\"lucide\", \"tabler\"];\n\nconst createExtensionGenerator = (icons: IconCollections): Promise<UnoGenerator> => {\n return createGenerator({\n presets: [\n presetWind3({ preflight: false }),\n // Host components size icons; scoped icon rules would otherwise override their classes.\n presetIcons({\n collections: icons,\n processor: (css) => {\n delete css.width;\n delete css.height;\n }\n }),\n presetAndesine()\n ],\n // Animations need global keyframes, which extension CSS cannot define.\n blocklist: [/^animate-/]\n });\n};\n/**\n * Generates the CSS of the extension views at build time: utility and icon classes found in the\n * code, in one `@scope` rule from the views down to their content slots, without preflights\n * (the host has them). Throws if the result is invalid, for example when an arbitrary value\n * loads a URL.\n */\nconst generateExtensionCSS = async (options: ExtensionViewCSSOptions): Promise<string> => {\n const generator = await createExtensionGenerator(options.icons);\n const { css: rules } = await generator.generate(options.code, {\n preflights: false,\n scope: \":scope\"\n });\n const css = rules.trim() ? `@scope ${getViewScopePrelude(options.name)} {\\n${rules}\\n}\\n` : \"\";\n\n validateExtensionCSS(css, options.name);\n\n return css;\n};\n/** Generates the CSS of the manifest icons, which the host shows outside the views. */\nconst generateExtensionIconCSS = async (options: ExtensionIconCSSOptions): Promise<string> => {\n const generator = await createExtensionGenerator(options.icons);\n const { css, matched } = await generator.generate(options.classes.join(\" \"), {\n preflights: false,\n scope: getExtensionScope(options.name, \"icon\")\n });\n const missing = options.classes.filter((icon) => !matched.has(icon));\n\n if (missing.length) throw new ExtensionStyleError(`Unknown icons: ${missing.join(\", \")}`);\n\n validateExtensionCSS(css, options.name, \"icon\");\n\n return css;\n};\n\nexport { DEFAULT_ICON_SETS, generateExtensionCSS, generateExtensionIconCSS };\nexport type { ExtensionViewCSSOptions, ExtensionIconCSSOptions };\n","import type { ExtensionManifest } from \"@andesine/contracts/extensions/manifest\";\nimport { ExtensionStyleError } from \"@andesine/contracts/extensions/styles\";\nimport {\n DEFAULT_ICON_SETS,\n type ExtensionViewCSSOptions,\n generateExtensionCSS,\n generateExtensionIconCSS\n} from \"@andesine/uno-preset/extensions\";\nimport { FileSystemIconLoader } from \"@iconify/utils/lib/loader/node-loaders\";\nimport { readFile } from \"node:fs/promises\";\nimport { createRequire } from \"node:module\";\nimport path from \"node:path\";\nimport { CLIError, exitCodes } from \"../errors\";\nimport { exists } from \"./project\";\n\ninterface ExtensionStyles {\n styles: string;\n icons: string;\n}\n\ntype IconCollections = ExtensionViewCSSOptions[\"icons\"];\n\nconst ICON_SET_PACKAGE = \"@iconify-json/\";\n\nconst readJSON = async (file: string) => JSON.parse(await readFile(file, \"utf8\"));\n/** Sets of a package resolver, loaded when the CSS uses them. */\nconst loadPackageSets = (sets: string[], require: NodeJS.Require): IconCollections => {\n return Object.fromEntries(\n sets.map((set) => [\n set,\n () => readJSON(require.resolve(`${ICON_SET_PACKAGE}${set}/icons.json`))\n ])\n );\n};\n/** Default sets from the CLI, sets installed in the project, then custom SVG directories. */\nconst loadIconCollections = async (\n root: string,\n custom: Record<string, string> = {}\n): Promise<IconCollections> => {\n const manifestPath = path.join(root, \"package.json\");\n const manifest = (await exists(manifestPath)) ? await readJSON(manifestPath) : {};\n const installed = Object.keys({ ...manifest.dependencies, ...manifest.devDependencies })\n .filter((name) => name.startsWith(ICON_SET_PACKAGE))\n .map((name) => name.slice(ICON_SET_PACKAGE.length));\n\n return {\n ...loadPackageSets(DEFAULT_ICON_SETS, createRequire(import.meta.url)),\n ...loadPackageSets(installed, createRequire(manifestPath)),\n ...Object.fromEntries(\n Object.entries(custom).map(([set, directory]) => {\n return [set, FileSystemIconLoader(path.resolve(root, directory))];\n })\n )\n };\n};\nconst getManifestIcons = (manifest: ExtensionManifest): string[] => {\n const icons = [\n manifest.icon,\n ...manifest.panels.map(({ icon }) => icon),\n ...manifest.blockActions.map(({ icon }) => icon)\n ];\n\n return [...new Set(icons.filter((icon) => icon !== undefined))];\n};\n\n/** The view CSS from the project's code, and the CSS of the manifest icons. */\nconst generateExtensionStyles = async (\n root: string,\n manifest: ExtensionManifest,\n sources: string,\n custom?: Record<string, string>\n): Promise<ExtensionStyles> => {\n const icons = await loadIconCollections(root, custom);\n const classes = getManifestIcons(manifest);\n\n try {\n return {\n styles: await generateExtensionCSS({ name: manifest.name, icons, code: sources }),\n icons: classes.length\n ? await generateExtensionIconCSS({ name: manifest.name, icons, classes })\n : \"\"\n };\n } catch (error) {\n if (error instanceof ExtensionStyleError) throw new CLIError(error.message, exitCodes.usage);\n\n throw error;\n }\n};\n\nexport { generateExtensionStyles };\n","import type { ExtensionManifest } from \"@andesine/contracts/extensions/manifest\";\nimport { MAX_EXTENSION_ARTIFACT_SIZE } from \"@andesine/contracts/extensions/registry\";\nimport { createHash } from \"node:crypto\";\nimport { mkdir, rm, writeFile } from \"node:fs/promises\";\nimport path from \"node:path\";\nimport { CLIError } from \"../errors\";\nimport type { createOutput } from \"../output\";\nimport { bundleFrontend } from \"./frontend\";\nimport { type ExtensionProject, loadExtensionProject } from \"./project\";\nimport { generateExtensionStyles } from \"./styles\";\n\n/** A build file; publishing replaces `file` with the URL that serves it. */\ninterface ExtensionBuildArtifact {\n file: string;\n sha256: string;\n size: number;\n}\n/** `dist/extension.json`: the validated manifest and its artifacts. */\ninterface ExtensionBuildMetadata {\n manifest: ExtensionManifest;\n artifacts: Partial<Record<ArtifactName, ExtensionBuildArtifact>>;\n}\n\ntype ArtifactName = \"frontend\" | \"styles\" | \"icons\";\n\nconst OUTPUT_DIRECTORY = \"dist\";\nconst DEFAULT_FRONTEND = \"src/frontend/index.tsx\";\nconst artifactFiles: Record<ArtifactName, string> = {\n frontend: \"frontend.js\",\n styles: \"styles.css\",\n icons: \"icons.css\"\n};\n\nconst describeArtifact = (file: string, content: string): ExtensionBuildArtifact => {\n const size = Buffer.byteLength(content);\n\n if (size > MAX_EXTENSION_ARTIFACT_SIZE) {\n throw new CLIError(`${file} is larger than ${MAX_EXTENSION_ARTIFACT_SIZE / 1024 / 1024} MB.`);\n }\n\n return { file, sha256: createHash(\"sha256\").update(content).digest(\"hex\"), size };\n};\n\n/** Bundles the frontend and generates its CSS; empty CSS is an empty string. */\nconst compileExtension = async (\n project: ExtensionProject,\n output: ReturnType<typeof createOutput>\n): Promise<Record<ArtifactName, string>> => {\n const { root, manifest } = project;\n const bundle = await output.progress(\n \"Bundling the frontend\",\n () => {\n return bundleFrontend(\n root,\n manifest,\n project.build.frontend ?? DEFAULT_FRONTEND,\n (message) => {\n void output.warning(message);\n }\n );\n },\n \"Frontend bundled\"\n );\n const css = await output.progress(\n \"Generating the CSS\",\n () => generateExtensionStyles(root, manifest, bundle.sources, project.build.icons),\n \"CSS generated\"\n );\n\n return { frontend: bundle.code, styles: css.styles, icons: css.icons };\n};\n/** Validates the manifest, then writes the frontend, CSS, and metadata to `dist`. */\nconst buildExtension = async (\n directory: string,\n output: ReturnType<typeof createOutput>\n): Promise<ExtensionBuildMetadata> => {\n const root = path.resolve(directory);\n const target = path.join(root, OUTPUT_DIRECTORY);\n const project = await output.progress(\n \"Loading the manifest\",\n () => loadExtensionProject(root),\n \"Manifest valid\"\n );\n const { manifest } = project;\n const contents = await compileExtension(project, output);\n const metadata: ExtensionBuildMetadata = { manifest, artifacts: {} };\n\n await mkdir(target, { recursive: true });\n\n for (const [name, file] of Object.entries(artifactFiles) as Array<[ArtifactName, string]>) {\n const content = contents[name];\n\n // Empty CSS has no artifact; remove the file of an earlier build.\n if (!content) {\n await rm(path.join(target, file), { force: true });\n continue;\n }\n\n metadata.artifacts[name] = describeArtifact(file, content);\n await writeFile(path.join(target, file), content);\n }\n\n await writeFile(path.join(target, \"extension.json\"), `${JSON.stringify(metadata, null, 2)}\\n`);\n\n return metadata;\n};\n\nexport { artifactFiles, buildExtension, compileExtension, describeArtifact };\nexport type { ArtifactName, ExtensionBuildMetadata };\n","import type {\n ExtensionDevelopmentUpload,\n ExtensionStateResult,\n ExtensionWebhookDeliveryDetails\n} from \"@andesine/contracts/extensions\";\nimport { getAccessToken } from \"../../auth/client\";\nimport type { CommandContext } from \"../../context\";\nimport { CLIError, exitCodes } from \"../../errors\";\n\ninterface DevelopmentClient {\n workspaceID: string;\n upload(input: ExtensionDevelopmentUpload): Promise<ExtensionStateResult>;\n stop(extensionID: string, signal?: AbortSignal): Promise<ExtensionStateResult>;\n remove(extensionID: string): Promise<ExtensionStateResult>;\n sendTest(extensionID: string, webhookID: string, type: string): Promise<{ deliveryID: string }>;\n getDelivery(\n extensionID: string,\n webhookID: string,\n deliveryID: string\n ): Promise<ExtensionWebhookDeliveryDetails>;\n}\n\n/** A failure that the instance reported, as opposed to a failed build. */\nclass InstanceError extends CLIError {}\n\n// Hosted instances never enable development; these hosts serve only a local stack.\nconst LOCAL_HOSTS = [\"localhost\", \"127.0.0.1\", \"[::1]\"];\nconst LOCAL_DOMAINS = [\".localhost\", \".local\", \".test\"];\n\nconst isLocalInstance = (baseURL: string): boolean => {\n const { hostname } = new URL(baseURL);\n\n return (\n LOCAL_HOSTS.includes(hostname) || LOCAL_DOMAINS.some((domain) => hostname.endsWith(domain))\n );\n};\nconst describeFailure = (status: number, body: unknown): string => {\n const message = (body as { message?: unknown } | null)?.message;\n\n // The default message (no route, or the endpoints are off) differs from a missing extension.\n const isDevelopmentOff = status === 404 && (body === null || message === \"Not Found\");\n\n if (isDevelopmentOff) {\n return \"The instance has no development endpoints. Set PUBLIC_EXTENSIONS_ENABLED=true and EXTENSIONS_DEVELOPMENT_ENABLED=true on the local backend.\";\n }\n\n return typeof message === \"string\" ? message : `The request failed (HTTP ${status}).`;\n};\n\n/**\n * A client for the development operations of a local instance. They are not in the public API,\n * so the SDK has no methods for them; they need the signed-in member of a CLI profile.\n */\nconst createDevelopmentClient = (context: CommandContext): DevelopmentClient => {\n const { baseURL, workspaceID } = context.config;\n\n if (!isLocalInstance(baseURL)) {\n throw new CLIError(\n `${baseURL} is not a local instance. Extension development needs a local stack (localhost, *.localhost, *.local, or *.test); use --base-url.`,\n exitCodes.usage\n );\n }\n\n if (process.env.ANDESINE_API_KEY !== undefined) {\n throw new CLIError(\n \"API keys cannot develop extensions. Unset ANDESINE_API_KEY and run andesine auth login.\",\n exitCodes.usage\n );\n }\n\n if (!workspaceID) {\n throw new CLIError(\n \"Select a workspace with --workspace or ANDESINE_WORKSPACE_ID.\",\n exitCodes.usage\n );\n }\n\n const request = async <Result>(\n method: string,\n path: string,\n body?: unknown,\n signal = context.signal\n ): Promise<Result> => {\n const response = await fetch(`${baseURL}/extensions${path}`, {\n method,\n redirect: \"error\",\n signal,\n headers: {\n \"authorization\": `Bearer ${await getAccessToken({ ...context, signal })}`,\n \"x-workspace-id\": workspaceID,\n ...(body === undefined ? {} : { \"content-type\": \"application/json\" })\n },\n body: body === undefined ? undefined : JSON.stringify(body)\n });\n const result = await response.json().catch(() => null);\n\n if (!response.ok) throw new InstanceError(describeFailure(response.status, result));\n\n return result as Result;\n };\n const webhookPath = (extensionID: string, webhookID: string) => {\n return `/${extensionID}/webhooks/${encodeURIComponent(webhookID)}`;\n };\n\n return {\n workspaceID,\n upload: (input) => request(\"PUT\", \"/development\", input),\n stop: (extensionID, signal) => {\n return request(\"POST\", `/development/${extensionID}/stop`, undefined, signal);\n },\n remove: (extensionID) => request(\"DELETE\", `/development/${extensionID}`),\n sendTest: (extensionID, webhookID, type) => {\n return request(\"POST\", `${webhookPath(extensionID, webhookID)}/test`, { type });\n },\n getDelivery: (extensionID, webhookID, deliveryID) => {\n return request(\"GET\", `${webhookPath(extensionID, webhookID)}/deliveries/${deliveryID}`);\n }\n };\n};\n\nexport { InstanceError, createDevelopmentClient };\nexport type { DevelopmentClient };\n","import { readFile, rm, writeFile } from \"node:fs/promises\";\nimport path from \"node:path\";\nimport type { CommandContext } from \"../../context\";\nimport { CLIError, exitCodes } from \"../../errors\";\nimport { exists, WORK_DIRECTORY } from \"../project\";\n\n/** The development extension of a project on one instance and workspace. */\ninterface DevelopmentState {\n baseURL: string;\n workspaceID: string;\n extensionID: string;\n}\n\nconst getStateFile = (root: string) => path.join(root, WORK_DIRECTORY, \"development.json\");\n\nconst saveDevelopmentState = async (root: string, state: DevelopmentState): Promise<void> => {\n await writeFile(getStateFile(root), `${JSON.stringify(state, null, 2)}\\n`);\n};\n/** The recorded development extension for the selected instance and workspace. */\nconst readDevelopmentState = async (\n root: string,\n context: CommandContext\n): Promise<DevelopmentState> => {\n const file = getStateFile(root);\n const state = (await exists(file))\n ? (JSON.parse(await readFile(file, \"utf8\")) as DevelopmentState)\n : null;\n const isSelected =\n state?.baseURL === context.config.baseURL && state.workspaceID === context.config.workspaceID;\n\n if (!isSelected) {\n throw new CLIError(\n \"No development extension for this instance and workspace. Run andesine extensions dev first.\",\n exitCodes.usage\n );\n }\n\n return state!;\n};\nconst clearDevelopmentState = async (root: string): Promise<void> => {\n await rm(getStateFile(root), { force: true });\n};\n\nexport { saveDevelopmentState, readDevelopmentState, clearDevelopmentState };\nexport type { DevelopmentState };\n","import path from \"node:path\";\nimport type { CommandContext } from \"../../context\";\nimport { createDevelopmentClient } from \"./client\";\nimport { clearDevelopmentState, readDevelopmentState } from \"./state\";\n\n/** Uninstalls the project's development extension, which deletes its development state. */\nconst removeDevelopment = async (context: CommandContext, root: string): Promise<void> => {\n const directory = path.resolve(root);\n const client = createDevelopmentClient(context);\n const { extensionID } = await readDevelopmentState(directory, context);\n\n await context.output.progress(\n \"Removing the development extension\",\n () => client.remove(extensionID),\n \"Development extension removed\"\n );\n await clearDevelopmentState(directory);\n await context.output.success(\"The development extension and its state are removed.\");\n};\n\nexport { removeDevelopment };\n","import {\n type ExtensionBackendKey,\n extensionBackendKeyIDType,\n extensionBackendKeyType\n} from \"@andesine/contracts/extensions/manifest\";\nimport { extensionRegistryIndexType } from \"@andesine/contracts/extensions/registry\";\nimport { execFile } from \"node:child_process\";\nimport {\n createPrivateKey,\n createPublicKey,\n generateKeyPairSync,\n type webcrypto\n} from \"node:crypto\";\nimport { mkdir, readFile, writeFile } from \"node:fs/promises\";\nimport path from \"node:path\";\nimport { promisify } from \"node:util\";\nimport { CLIError, exitCodes } from \"../errors\";\nimport {\n KEYS_FILE,\n WORK_DIRECTORY,\n loadExtensionProject,\n readExtensionKeys,\n writeExtensionKeys\n} from \"./project\";\n\ninterface GeneratedKey {\n kid: string;\n /** The private JWK, for a secret manager or the local `.env`. */\n privateKey: string;\n /** The private JWK file, readable only by its owner; none when printed. */\n file?: string;\n /** False when Git does not ignore the private key file. */\n ignored: boolean;\n}\ninterface PrivateKey extends webcrypto.JsonWebKey {\n kid?: string;\n}\ninterface CheckedKey {\n kid: string;\n name: string;\n registry?: string;\n}\n\nconst MAX_KEYS = 3;\nconst KEY_ENVIRONMENT_VARIABLE = \"ANDESINE_EXTENSION_KEY\";\nconst runFile = promisify(execFile);\n\nconst createKeyID = (taken: string[]): string => {\n const base = `key-${new Date().toISOString().slice(0, 10)}`;\n\n let kid = base;\n\n for (let index = 2; taken.includes(kid); index += 1) kid = `${base}-${index}`;\n\n return kid;\n};\nconst isIgnored = async (root: string, file: string): Promise<boolean> => {\n try {\n await runFile(\"git\", [\"check-ignore\", \"--quiet\", file], { cwd: root });\n\n return true;\n } catch (error) {\n // Exit code 1 means not ignored; others mean no repository or no Git.\n return (error as { code?: number }).code !== 1;\n }\n};\n// Errors never include the key, which can come from an environment variable.\nconst parsePrivateKey = (source: string): PrivateKey => {\n try {\n const key = JSON.parse(source);\n\n if (key.d && key.kid) return key;\n } catch {}\n\n throw new CLIError(\"The private key must be a private JSON Web Key with a kid.\", exitCodes.usage);\n};\nconst toPublicKey = (privateKey: PrivateKey): ExtensionBackendKey => {\n const jwk = createPublicKey(createPrivateKey({ key: privateKey, format: \"jwk\" })).export({\n format: \"jwk\"\n });\n const alg = jwk.crv === \"Ed25519\" ? \"EdDSA\" : \"ES256\";\n const key = extensionBackendKeyType.safeParse({ kid: privateKey.kid, alg, ...jwk });\n\n if (!key.success) throw new CLIError(\"Use an Ed25519 or P-256 private key.\", exitCodes.usage);\n\n return key.data;\n};\nconst describeKey = (key: ExtensionBackendKey): string => {\n return [key.kid, key.alg, key.x, \"y\" in key ? key.y : \"\"].join(\" \");\n};\nconst isSameKey = (left: ExtensionBackendKey, right: ExtensionBackendKey): boolean => {\n return describeKey(left) === describeKey(right);\n};\n\n/** Generates an Ed25519 key: the public JWK goes to the keys file, the private one stays local. */\nconst generateExtensionKey = async (\n root: string,\n options: { kid?: string; print?: boolean } = {}\n): Promise<GeneratedKey> => {\n const keys = await readExtensionKeys(root);\n const taken = [...keys.keys.map(({ kid }) => kid), ...keys.revokedKeys];\n const kid = options.kid ?? createKeyID(taken);\n const directory = path.join(root, WORK_DIRECTORY, \"keys\");\n const file = path.join(directory, `${kid}.json`);\n const isNewKeyID = extensionBackendKeyIDType.safeParse(kid).success && !taken.includes(kid);\n\n if (keys.keys.length >= MAX_KEYS) {\n throw new CLIError(`${KEYS_FILE} has ${MAX_KEYS} keys. Revoke one first.`, exitCodes.usage);\n }\n\n if (!isNewKeyID) {\n throw new CLIError(`Use a new key ID of letters, digits, \".\", \"_\" or \"-\".`, exitCodes.usage);\n }\n\n const { privateKey } = generateKeyPairSync(\"ed25519\");\n const privateJWK = { kid, alg: \"EdDSA\", ...privateKey.export({ format: \"jwk\" }) };\n const serialized = JSON.stringify(privateJWK);\n\n if (!options.print) {\n await mkdir(directory, { recursive: true, mode: 0o700 });\n await writeFile(file, `${serialized}\\n`, { mode: 0o600, flag: \"wx\" });\n }\n\n await writeExtensionKeys(root, { ...keys, keys: [...keys.keys, toPublicKey(privateJWK)] });\n\n if (options.print) return { kid, privateKey: serialized, ignored: true };\n\n return { kid, privateKey: serialized, file, ignored: await isIgnored(root, file) };\n};\n/**\n * Checks that a private key matches a current key of the manifest and, with a registry URL, of\n * the registry entry, which Andesine instances trust.\n */\nconst checkExtensionKey = async (\n root: string,\n options: { key?: string; registry?: string } = {}\n): Promise<CheckedKey> => {\n const source = options.key\n ? await readFile(path.resolve(options.key), \"utf8\")\n : process.env[KEY_ENVIRONMENT_VARIABLE];\n\n if (!source) {\n throw new CLIError(`Set ${KEY_ENVIRONMENT_VARIABLE} or use --key <file>.`, exitCodes.usage);\n }\n\n const publicKey = toPublicKey(parsePrivateKey(source));\n const { manifest } = await loadExtensionProject(root);\n const { revokedKeys } = await readExtensionKeys(root);\n const manifestKey = manifest.backend?.keys.find(({ kid }) => kid === publicKey.kid);\n\n if (revokedKeys.includes(publicKey.kid)) {\n throw new CLIError(`Key ${publicKey.kid} is revoked.`, exitCodes.failure);\n }\n\n if (!manifestKey || !isSameKey(manifestKey, publicKey)) {\n throw new CLIError(`Key ${publicKey.kid} is not a key of the manifest.`, exitCodes.failure);\n }\n\n if (!options.registry) return { kid: publicKey.kid, name: manifest.name };\n\n const response = await fetch(options.registry);\n\n if (!response.ok) {\n throw new CLIError(`The registry returned HTTP ${response.status}.`, exitCodes.failure);\n }\n\n const index = extensionRegistryIndexType.safeParse(await response.json());\n\n if (!index.success) throw new CLIError(\"The registry index is invalid.\", exitCodes.failure);\n\n const entry = index.data.extensions.find(({ name }) => name === manifest.name);\n const registryKey = entry?.keys.find(({ kid }) => kid === publicKey.kid);\n const isTrusted = Boolean(registryKey && isSameKey(registryKey, publicKey));\n\n if (!entry) throw new CLIError(`The registry has no ${manifest.name}.`, exitCodes.failure);\n\n // Registry entries reject revoked IDs among their keys, so a listed key is current.\n if (!isTrusted) {\n throw new CLIError(`The registry does not trust key ${publicKey.kid}.`, exitCodes.failure);\n }\n\n return { kid: publicKey.kid, name: manifest.name, registry: options.registry };\n};\n/** Removes a public key from the manifest keys and records its ID as revoked. */\nconst revokeExtensionKey = async (root: string, kid: string): Promise<void> => {\n const keys = await readExtensionKeys(root);\n\n if (!keys.keys.some((key) => key.kid === kid)) {\n throw new CLIError(`${KEYS_FILE} has no key ${kid}.`, exitCodes.usage);\n }\n\n await writeExtensionKeys(root, {\n keys: keys.keys.filter((key) => key.kid !== kid),\n revokedKeys: [...keys.revokedKeys, kid]\n });\n};\n\nexport { KEY_ENVIRONMENT_VARIABLE, generateExtensionKey, checkExtensionKey, revokeExtensionKey };\n","import type { ExtensionBackendKey } from \"@andesine/contracts/extensions/manifest\";\nimport { generateKeyPairSync } from \"node:crypto\";\nimport { mkdir, readFile, writeFile } from \"node:fs/promises\";\nimport path from \"node:path\";\nimport { KEY_ENVIRONMENT_VARIABLE } from \"../keys\";\nimport { exists, WORK_DIRECTORY } from \"../project\";\n\ninterface DevelopmentKey {\n /** The private JWK, for the local backend. */\n privateKey: string;\n publicKey: ExtensionBackendKey;\n}\n\nconst KEY_ID = \"development\";\nconst INSTANCES_VARIABLE = \"ANDESINE_INSTANCES\";\n\n/**\n * The project's development key pair, created once. The local instance gets only the public\n * key; the private key stays in the work directory and the backend's environment file.\n */\nconst getDevelopmentKey = async (root: string): Promise<DevelopmentKey> => {\n const directory = path.join(root, WORK_DIRECTORY, \"keys\");\n const file = path.join(directory, `${KEY_ID}.json`);\n\n if (!(await exists(file))) {\n const { privateKey } = generateKeyPairSync(\"ed25519\");\n const jwk = { kid: KEY_ID, alg: \"EdDSA\", ...privateKey.export({ format: \"jwk\" }) };\n\n await mkdir(directory, { recursive: true, mode: 0o700 });\n await writeFile(file, `${JSON.stringify(jwk)}\\n`, { mode: 0o600 });\n }\n\n const privateKey = (await readFile(file, \"utf8\")).trim();\n const { x } = JSON.parse(privateKey) as { x: string };\n\n return { privateKey, publicKey: { kid: KEY_ID, kty: \"OKP\", alg: \"EdDSA\", crv: \"Ed25519\", x } };\n};\n/** Sets a variable of an environment file, replacing its line or adding one. */\nconst setVariable = (source: string, name: string, value: string): string => {\n const line = `${name}=${value}`;\n const pattern = new RegExp(`^${name}=.*$`, \"m\");\n\n if (pattern.test(source)) return source.replace(pattern, () => line);\n\n return `${source}${source && !source.endsWith(\"\\n\") ? \"\\n\" : \"\"}${line}\\n`;\n};\n/**\n * Points the local backend at the development key and trusts the local instance, in its\n * environment file (created from `.env.example` when missing). Other variables stay.\n */\nconst writeDevelopmentEnvironment = async (\n root: string,\n file: string,\n key: DevelopmentKey,\n baseURL: string\n): Promise<void> => {\n const target = path.resolve(root, file);\n const example = path.join(root, \".env.example\");\n const sourceFile = (await exists(target)) ? target : example;\n const source = (await exists(sourceFile)) ? await readFile(sourceFile, \"utf8\") : \"\";\n const instances = new RegExp(`^${INSTANCES_VARIABLE}=(.*)$`, \"m\")\n .exec(source)?.[1]\n ?.split(\",\")\n .filter(Boolean);\n const trusted = [...new Set([...(instances ?? []), baseURL])].join(\",\");\n const updated = setVariable(\n setVariable(source, KEY_ENVIRONMENT_VARIABLE, `'${key.privateKey}'`),\n INSTANCES_VARIABLE,\n trusted\n );\n\n await writeFile(target, updated, { mode: 0o600 });\n};\n\nexport { getDevelopmentKey, writeDevelopmentEnvironment };\nexport type { DevelopmentKey };\n","import { watch } from \"node:fs\";\nimport path from \"node:path\";\nimport { WORK_DIRECTORY } from \"../project\";\n\ninterface ChangeWatcher {\n /** Resolves after the next change, or at once when files changed since the last call. */\n next(): Promise<void>;\n}\n\nconst DEBOUNCE = 200;\n// Build output, dependencies, and the backend's environment do not change the extension.\nconst IGNORED_DIRECTORIES = [\"node_modules\", \"dist\", WORK_DIRECTORY, \".git\"];\n\nconst isIgnored = (file: string): boolean => {\n const [directory] = file.split(path.sep);\n\n return IGNORED_DIRECTORIES.includes(directory!) || path.basename(file).startsWith(\".env\");\n};\n\n/** Watches the project recursively until the signal aborts. */\nconst watchChanges = (root: string, signal: AbortSignal): ChangeWatcher => {\n let changed = false;\n let notify: (() => void) | null = null;\n let timer: NodeJS.Timeout | undefined;\n\n watch(root, { recursive: true, signal }, (_event, file) => {\n if (!file || isIgnored(file)) return;\n\n clearTimeout(timer);\n timer = setTimeout(() => {\n changed = true;\n notify?.();\n }, DEBOUNCE);\n }).on(\"error\", () => {});\n\n return {\n next: () => {\n return new Promise((resolve, reject) => {\n const abort = () => reject(signal.reason);\n\n notify = () => {\n notify = null;\n changed = false;\n signal.removeEventListener(\"abort\", abort);\n resolve();\n };\n\n if (signal.aborted) abort();\n else if (changed) notify();\n else signal.addEventListener(\"abort\", abort, { once: true });\n });\n }\n };\n};\n\nexport { watchChanges };\n","import type { ExtensionStateResult } from \"@andesine/contracts/extensions\";\nimport path from \"node:path\";\nimport type { CommandContext } from \"../../context\";\nimport { compileExtension } from \"../build\";\nimport { type DevelopmentOverrides, loadExtensionProject } from \"../project\";\nimport { InstanceError, createDevelopmentClient, type DevelopmentClient } from \"./client\";\nimport { getDevelopmentKey, writeDevelopmentEnvironment } from \"./environment\";\nimport { saveDevelopmentState } from \"./state\";\nimport { watchChanges } from \"./watch\";\n\ninterface DevelopmentOptions {\n root: string;\n /** The local backend's environment file, relative to the root. */\n envFile: string;\n /** The local backend URL, in place of the manifest's. */\n backend?: string;\n}\n\nconst STOP_TIMEOUT = 10_000;\nconst disabledHints: Record<string, string> = {\n approval_required: \"approve its new permissions or URLs in Settings → Extensions\",\n configuration_required: \"fill in its required configuration in Settings → Extensions\",\n manual: \"enable it in Settings → Extensions\"\n};\n\nconst getErrorMessage = (error: unknown) =>\n error instanceof Error ? error.message : String(error);\n\n/** Builds the project with the development key and uploads it, which installs or reloads it. */\nconst uploadBuild = async (\n root: string,\n context: CommandContext,\n client: DevelopmentClient,\n development: DevelopmentOverrides\n): Promise<ExtensionStateResult> => {\n const project = await loadExtensionProject(root, development);\n const { frontend, styles, icons } = await compileExtension(project, context.output);\n const result = await context.output.progress(\n \"Uploading the build\",\n () => {\n return client.upload({\n manifest: project.manifest,\n artifacts: { frontend, styles: styles || undefined, icons: icons || undefined }\n });\n },\n \"Build uploaded\"\n );\n const { name, version } = project.manifest;\n\n await saveDevelopmentState(root, {\n baseURL: context.config.baseURL,\n workspaceID: client.workspaceID,\n extensionID: result.id\n });\n\n if (result.state === \"active\") {\n await context.output.success(`${name}@${version} is running (${result.id}).`);\n } else {\n await context.output.warning(\n `${name}@${version} is disabled: ${disabledHints[result.disabledReason ?? \"manual\"]}.`\n );\n }\n\n return result;\n};\n\n/**\n * Runs an extension on the local instance for the signed-in member: uploads each build, reloads\n * it on file changes, and stops it on exit, keeping its configuration and storage.\n */\nconst runDevelopment = async (\n context: CommandContext,\n options: DevelopmentOptions\n): Promise<void> => {\n const { output, signal } = context;\n const root = path.resolve(options.root);\n const client = createDevelopmentClient(context);\n const key = await getDevelopmentKey(root);\n const development = { keys: [key.publicKey], backendURL: options.backend };\n\n let extensionID: string | null = null;\n\n await writeDevelopmentEnvironment(root, options.envFile, key, context.config.baseURL);\n await output.note(\"Local backend\", {\n Environment: `${options.envFile} (development key and trusted instance)`,\n Instance: context.config.baseURL\n });\n\n try {\n extensionID = (await uploadBuild(root, context, client, development)).id;\n } catch (error) {\n // The instance refusing the first build ends the command; a failed build waits for a fix.\n if (signal.aborted || error instanceof InstanceError) throw error;\n\n await output.error(getErrorMessage(error));\n }\n\n const changes = watchChanges(root, signal);\n\n try {\n await output.diagnostic(\"Watching for changes. Press Ctrl+C to stop the extension.\");\n\n while (true) {\n await changes.next();\n\n try {\n extensionID = (await uploadBuild(root, context, client, development)).id;\n } catch (error) {\n if (signal.aborted) throw error;\n\n await output.error(getErrorMessage(error));\n }\n }\n } finally {\n if (extensionID) {\n await client\n .stop(extensionID, AbortSignal.timeout(STOP_TIMEOUT))\n .then(() => output.diagnostic(\"Development extension stopped; its state is kept.\"))\n .catch(() => output.warning(\"Could not stop the development extension.\"));\n }\n }\n};\n\nexport { runDevelopment };\nexport type { DevelopmentOptions };\n","import type { ExtensionWebhookDeliveryDetails } from \"@andesine/contracts/extensions\";\nimport path from \"node:path\";\nimport { setTimeout as sleep } from \"node:timers/promises\";\nimport type { CommandContext } from \"../../context\";\nimport { CLIError } from \"../../errors\";\nimport { createDevelopmentClient } from \"./client\";\nimport { readDevelopmentState } from \"./state\";\n\nconst POLL_INTERVAL = 1000;\nconst POLL_LIMIT = 30;\n\nconst describeAttempt = ({ delivery }: ExtensionWebhookDeliveryDetails): string => {\n const result = delivery.lastHTTPStatus\n ? `HTTP ${delivery.lastHTTPStatus}`\n : (delivery.lastFailureCategory ?? \"no response\");\n\n return `${delivery.attemptCount} attempt(s), last: ${result}`;\n};\n/** Waits for the first attempt to finish, or the delivery to end. */\nconst waitForResult = async (\n context: CommandContext,\n read: () => Promise<ExtensionWebhookDeliveryDetails>\n): Promise<ExtensionWebhookDeliveryDetails> => {\n let details = await read();\n\n for (let poll = 0; poll < POLL_LIMIT; poll += 1) {\n const { state, attemptCount } = details.delivery;\n const isWaiting = state === \"in_flight\" || (state === \"pending\" && attemptCount === 0);\n\n if (!isWaiting) return details;\n\n await sleep(POLL_INTERVAL, undefined, { signal: context.signal });\n details = await read();\n }\n\n return details;\n};\n\n/** Sends a sample event to a webhook of the development extension and reports the result. */\nconst sendTestEvent = async (\n context: CommandContext,\n options: { root: string; webhookID: string; type: string }\n): Promise<void> => {\n const root = path.resolve(options.root);\n const client = createDevelopmentClient(context);\n const { extensionID } = await readDevelopmentState(root, context);\n const { deliveryID } = await client.sendTest(extensionID, options.webhookID, options.type);\n const details = await context.output.progress(\n `Sending ${options.type} to ${options.webhookID}`,\n () => {\n return waitForResult(context, () => {\n return client.getDelivery(extensionID, options.webhookID, deliveryID);\n });\n },\n \"Delivery attempted\"\n );\n const { state, nextAttemptAt } = details.delivery;\n\n const retry = nextAttemptAt ? `; next attempt at ${nextAttemptAt}` : \"\";\n\n if (state !== \"succeeded\") {\n throw new CLIError(`Not delivered: ${state}, ${describeAttempt(details)}${retry}.`);\n }\n\n await context.output.success(`Delivered (${describeAttempt(details)}).`);\n};\n\nexport { sendTestEvent };\n","import {\n extensionRegistryEntryType,\n extensionRegistryIndexType,\n extensionRevocationType,\n extensionVersionManifestType,\n type ExtensionKeySet,\n type ExtensionRegistryEntry,\n type ExtensionRegistryIndex,\n type ExtensionRevocation,\n type ExtensionVersionManifest\n} from \"@andesine/contracts/extensions/registry\";\nimport { readdir, readFile } from \"node:fs/promises\";\nimport path from \"node:path\";\nimport { CLIError, exitCodes } from \"../../errors\";\nimport { exists, loadExtensionProject, readExtensionKeys, type ExtensionProject } from \"../project\";\n\n/** An extension project of the registry repository, at `extensions/<scope>/<name>`. */\ninterface RegistryProject {\n directoryName: string;\n project: ExtensionProject;\n keys: ExtensionKeySet;\n publisher: ExtensionRegistryEntry[\"publisher\"];\n}\n/** The deployed registry site: its index and the versions it publishes per name. */\ninterface PublishedRegistry {\n index: ExtensionRegistryIndex | null;\n versions: Map<string, ExtensionVersionManifest[]>;\n}\n\nconst EXTENSIONS_DIRECTORY = \"extensions\";\n/** The registry entry data of a project that its manifest does not have. */\nconst PUBLISHER_FILE = \"andesine.registry.json\";\nconst REVOCATIONS_FILE = \"registry/revocations.json\";\nconst INDEX_FILE = \"index.json\";\n\nconst readJSON = async (file: string, label: string): Promise<unknown> => {\n try {\n return JSON.parse(await readFile(file, \"utf8\"));\n } catch {\n throw new CLIError(`${label} is not valid JSON.`, exitCodes.usage);\n }\n};\nconst listDirectories = async (directory: string): Promise<string[]> => {\n if (!(await exists(directory))) return [];\n\n const entries = await readdir(directory, { withFileTypes: true });\n\n return entries\n .filter((entry) => entry.isDirectory() && !entry.name.startsWith(\".\"))\n .map(({ name }) => name)\n .sort();\n};\n\n/** Loads every extension project with the registry rules for manifests (HTTPS URLs). */\nconst readRegistryProjects = async (repository: string): Promise<RegistryProject[]> => {\n const root = path.join(repository, EXTENSIONS_DIRECTORY);\n const projects: RegistryProject[] = [];\n\n for (const scope of await listDirectories(root)) {\n for (const name of await listDirectories(path.join(root, scope))) {\n const projectRoot = path.join(root, scope, name);\n const directoryName = `${scope}/${name}`;\n const publisherFile = path.join(projectRoot, PUBLISHER_FILE);\n\n if (!(await exists(publisherFile))) {\n throw new CLIError(`${directoryName} has no ${PUBLISHER_FILE}.`, exitCodes.usage);\n }\n\n const data = (await readJSON(publisherFile, `${directoryName}/${PUBLISHER_FILE}`)) as {\n publisher?: unknown;\n };\n const publisher = extensionRegistryEntryType.shape.publisher.safeParse(data.publisher);\n\n if (!publisher.success) {\n throw new CLIError(\n `${directoryName}/${PUBLISHER_FILE} has no valid publisher.`,\n exitCodes.usage\n );\n }\n\n projects.push({\n directoryName,\n project: await loadExtensionProject(projectRoot),\n keys: await readExtensionKeys(projectRoot),\n publisher: publisher.data\n });\n }\n }\n\n return projects;\n};\nconst readRevocations = async (repository: string): Promise<ExtensionRevocation[]> => {\n const file = path.join(repository, REVOCATIONS_FILE);\n\n if (!(await exists(file))) return [];\n\n const revocations = extensionRevocationType\n .array()\n .safeParse(await readJSON(file, REVOCATIONS_FILE));\n\n if (!revocations.success) throw new CLIError(`${REVOCATIONS_FILE} is invalid.`, exitCodes.usage);\n\n return revocations.data;\n};\n/** The published index, if the site has one; every published version must be valid. */\nconst readPublishedRegistry = async (directory: string): Promise<PublishedRegistry> => {\n const file = path.join(directory, INDEX_FILE);\n const versions = new Map<string, ExtensionVersionManifest[]>();\n\n if (!(await exists(file))) return { index: null, versions };\n\n const index = extensionRegistryIndexType.safeParse(await readJSON(file, INDEX_FILE));\n\n if (!index.success) throw new CLIError(`The published ${INDEX_FILE} is invalid.`);\n\n for (const entry of index.data.extensions) {\n const parsed = entry.versions.map((version) => extensionVersionManifestType.safeParse(version));\n\n if (parsed.some((result) => !result.success)) {\n throw new CLIError(`A published version of ${entry.name} is invalid.`);\n }\n\n versions.set(\n entry.name,\n parsed.map((result) => result.data!)\n );\n }\n\n return { index: index.data, versions };\n};\n\nexport {\n EXTENSIONS_DIRECTORY,\n INDEX_FILE,\n readPublishedRegistry,\n readRegistryProjects,\n readRevocations\n};\nexport type { PublishedRegistry, RegistryProject };\n","import {\n compareExtensionVersions,\n type ExtensionRevocation,\n type ExtensionVersionManifest\n} from \"@andesine/contracts/extensions/registry\";\nimport type { ExtensionBackendKey } from \"@andesine/contracts/extensions/manifest\";\nimport { createHash } from \"node:crypto\";\nimport type { createOutput } from \"../../output\";\nimport { type ArtifactName, compileExtension } from \"../build\";\nimport {\n type PublishedRegistry,\n readPublishedRegistry,\n readRegistryProjects,\n readRevocations,\n type RegistryProject\n} from \"./repository\";\n\n/** A version that the next build publishes. */\ninterface NewVersion {\n entry: RegistryProject;\n contents: Record<ArtifactName, string>;\n}\ninterface RegistryCheck {\n projects: RegistryProject[];\n published: PublishedRegistry;\n revocations: ExtensionRevocation[];\n newVersions: NewVersion[];\n /** Every problem found; the registry is valid when it is empty. */\n errors: string[];\n}\n\nconst hash = (content: string): string => createHash(\"sha256\").update(content).digest(\"hex\");\nconst describeKey = (key: ExtensionBackendKey): string =>\n JSON.stringify(key, Object.keys(key).sort());\n// Keys belong to the extension, not to a version, so key changes need no new version.\nconst withoutKeys = (manifest: ExtensionVersionManifest[\"manifest\"]): string => {\n return JSON.stringify({\n ...manifest,\n backend: manifest.backend && { ...manifest.backend, keys: [] }\n });\n};\nconst findVersion = (versions: ExtensionVersionManifest[], version: string) => {\n return versions.find(({ manifest }) => manifest.version === version);\n};\n\n/** Keys belong to the extension: published keys never change, revoked keys stay revoked. */\nconst checkKeys = (entry: RegistryProject, published: PublishedRegistry): string[] => {\n const { name, backend } = entry.project.manifest;\n const previous = published.index?.extensions.find((item) => item.name === name);\n const current = new Map(entry.keys.keys.map((key) => [key.kid, describeKey(key)]));\n const errors: string[] = [];\n\n for (const key of backend?.keys ?? []) {\n if (current.get(key.kid) !== describeKey(key)) {\n errors.push(`${name}: manifest key ${key.kid} is not a current key of the extension`);\n }\n }\n\n for (const key of previous?.keys ?? []) {\n const isChanged = current.has(key.kid) && current.get(key.kid) !== describeKey(key);\n\n if (isChanged) errors.push(`${name}: published key ${key.kid} cannot change`);\n }\n\n for (const kid of previous?.revokedKeys ?? []) {\n if (!entry.keys.revokedKeys.includes(kid)) {\n errors.push(`${name}: revoked key ${kid} must stay revoked`);\n }\n }\n\n return errors;\n};\n/** A version is new and newer than every published one, or identical to the published one. */\nconst checkVersion = (\n entry: RegistryProject,\n versions: ExtensionVersionManifest[],\n contents: Record<ArtifactName, string>\n): string[] => {\n const { manifest } = entry.project;\n const published = findVersion(versions, manifest.version);\n\n if (!published) {\n const newer = versions.find(({ manifest: item }) => {\n return compareExtensionVersions(item.version, manifest.version) > 0;\n });\n\n return newer\n ? [\n `${manifest.name}@${manifest.version}: versions publish in order; ${newer.manifest.version} is published`\n ]\n : [];\n }\n\n const errors: string[] = [];\n const styles = contents.styles ? hash(contents.styles) : undefined;\n\n if (withoutKeys(published.manifest) !== withoutKeys(manifest)) {\n errors.push(\n `${manifest.name}@${manifest.version}: published versions cannot change; use a new version`\n );\n }\n\n // CSS is the policy-relevant output, so a published version must rebuild to the same styles.\n if (styles !== published.artifacts.styles?.sha256) {\n errors.push(\n `${manifest.name}@${manifest.version}: the rebuilt styles differ from the published styles`\n );\n }\n\n return errors;\n};\n/** Revocations are permanent and name published (or new) versions and replacements. */\nconst checkRevocations = (\n revocations: ExtensionRevocation[],\n published: PublishedRegistry,\n available: Map<string, string[]>\n): string[] => {\n const errors: string[] = [];\n const isRevoked = (name: string, version: string) => {\n return revocations.some((item) => item.name === name && item.version === version);\n };\n\n for (const previous of published.index?.revocations ?? []) {\n if (!isRevoked(previous.name, previous.version)) {\n errors.push(`${previous.name}@${previous.version}: revocations are permanent`);\n }\n }\n\n for (const revocation of revocations) {\n const versions = available.get(revocation.name) ?? [];\n const label = `${revocation.name}@${revocation.version}`;\n const isReplacementValid =\n !revocation.replacement ||\n (versions.includes(revocation.replacement) &&\n !isRevoked(revocation.name, revocation.replacement));\n\n if (!versions.includes(revocation.version)) errors.push(`${label}: no such version`);\n if (!isReplacementValid) errors.push(`${label}: the replacement is not available`);\n }\n\n return errors;\n};\n\n/**\n * Checks the registry repository against the published site with the same rules that Andesine\n * instances apply on ingestion, and builds each project (its dependencies must be installed).\n */\nconst checkRegistry = async (\n repository: string,\n publishedDirectory: string,\n output: ReturnType<typeof createOutput>\n): Promise<RegistryCheck> => {\n const projects = await readRegistryProjects(repository);\n const published = await readPublishedRegistry(publishedDirectory);\n const revocations = await readRevocations(repository);\n const available = new Map<string, string[]>();\n const newVersions: NewVersion[] = [];\n const errors: string[] = [];\n\n for (const entry of projects) {\n const { name, version } = entry.project.manifest;\n const versions = published.versions.get(name) ?? [];\n\n if (entry.directoryName !== name) {\n errors.push(`${entry.directoryName}: the directory must match the name ${name}`);\n }\n\n await output.diagnostic(`Building ${name}@${version}`);\n\n const contents = await compileExtension(entry.project, output);\n const versionErrors = checkVersion(entry, versions, contents);\n\n errors.push(...checkKeys(entry, published), ...versionErrors);\n available.set(name, [...versions.map(({ manifest }) => manifest.version), version]);\n\n if (!findVersion(versions, version) && !versionErrors.length) {\n newVersions.push({ entry, contents });\n }\n }\n\n for (const name of published.versions.keys()) {\n if (!projects.some((entry) => entry.project.manifest.name === name)) {\n errors.push(`${name}: published extensions cannot be removed; revoke their versions`);\n }\n }\n\n errors.push(...checkRevocations(revocations, published, available));\n\n return { projects, published, revocations, newVersions, errors };\n};\n\nexport { checkRegistry };\nexport type { NewVersion, RegistryCheck };\n","import {\n extensionRegistryIndexType,\n extensionVersionManifestType,\n type ExtensionArtifact,\n type ExtensionVersionManifest\n} from \"@andesine/contracts/extensions/registry\";\nimport { execFile } from \"node:child_process\";\nimport { mkdir, writeFile } from \"node:fs/promises\";\nimport path from \"node:path\";\nimport { promisify } from \"node:util\";\nimport { CLIError, exitCodes } from \"../../errors\";\nimport type { createOutput } from \"../../output\";\nimport { type ArtifactName, artifactFiles, describeArtifact } from \"../build\";\nimport { exists } from \"../project\";\nimport { checkRegistry, type NewVersion } from \"./check\";\nimport { EXTENSIONS_DIRECTORY, INDEX_FILE } from \"./repository\";\n\ninterface RegistryBuildOptions {\n /** The registry repository. */\n repository: string;\n /** The published site: existing versions are read from it and new ones written to it. */\n published: string;\n /** The HTTPS URL that serves the published site. */\n siteURL: string;\n /** The repository commit of the build; defaults to `HEAD`. */\n commit?: string;\n}\ninterface RegistryBuildResult {\n published: string[];\n errors: string[];\n}\n\nconst VERSION_FILE = \"version.json\";\nconst runFile = promisify(execFile);\n\nconst getCommit = async (repository: string, commit?: string): Promise<string> => {\n const sha =\n commit ?? (await runFile(\"git\", [\"rev-parse\", \"HEAD\"], { cwd: repository })).stdout.trim();\n\n if (!/^[a-f\\d]{40}$/.test(sha)) throw new CLIError(\"Use a full commit SHA.\", exitCodes.usage);\n\n return sha;\n};\nconst getSiteURL = (siteURL: string): string => {\n const url = URL.canParse(siteURL) ? new URL(siteURL) : null;\n\n if (url?.protocol !== \"https:\") throw new CLIError(\"Use an HTTPS base URL.\", exitCodes.usage);\n\n return url.href.replace(/\\/$/, \"\");\n};\n/** Writes a new version's files, which are never overwritten, and returns its manifest. */\nconst writeVersion = async (\n published: string,\n siteURL: string,\n version: NewVersion,\n sourceCommit: string\n): Promise<ExtensionVersionManifest> => {\n const { manifest } = version.entry.project;\n const relative = path.posix.join(EXTENSIONS_DIRECTORY, manifest.name, manifest.version);\n const directory = path.join(published, relative);\n const artifacts: Partial<Record<ArtifactName, ExtensionArtifact>> = {};\n\n if (await exists(directory)) {\n throw new CLIError(`${manifest.name}@${manifest.version} is already published.`);\n }\n\n await mkdir(directory, { recursive: true });\n\n for (const [name, file] of Object.entries(artifactFiles) as Array<[ArtifactName, string]>) {\n const content = version.contents[name];\n\n if (!content) continue;\n\n const { sha256, size } = describeArtifact(file, content);\n\n artifacts[name] = { url: `${siteURL}/${relative}/${file}`, sha256, size };\n await writeFile(path.join(directory, file), content);\n }\n\n const versionManifest = extensionVersionManifestType.parse({\n manifest,\n sourceCommit,\n artifacts,\n publishedAt: new Date().toISOString()\n });\n\n await writeFile(\n path.join(directory, VERSION_FILE),\n `${JSON.stringify(versionManifest, null, 2)}\\n`\n );\n\n return versionManifest;\n};\n\n/**\n * Checks the registry, writes the files of new versions, then the index, which instances read;\n * the index comes last, so it never names files that are not published yet.\n */\nconst buildRegistry = async (\n options: RegistryBuildOptions,\n output: ReturnType<typeof createOutput>\n): Promise<RegistryBuildResult> => {\n const siteURL = getSiteURL(options.siteURL);\n const check = await checkRegistry(options.repository, options.published, output);\n const sourceCommit = await getCommit(options.repository, options.commit);\n const added = new Map<string, ExtensionVersionManifest>();\n\n if (check.errors.length) return { published: [], errors: check.errors };\n\n for (const version of check.newVersions) {\n const { name } = version.entry.project.manifest;\n\n added.set(name, await writeVersion(options.published, siteURL, version, sourceCommit));\n }\n\n const index = extensionRegistryIndexType.parse({\n formatVersion: 1,\n generatedAt: new Date().toISOString(),\n extensions: check.projects.map(({ project, keys, publisher }) => {\n const { name } = project.manifest;\n const versions = check.published.versions.get(name) ?? [];\n const version = added.get(name);\n\n return {\n name,\n publisher,\n keys: keys.keys,\n revokedKeys: keys.revokedKeys,\n versions: version ? [...versions, version] : versions\n };\n }),\n revocations: check.revocations\n });\n\n await writeFile(path.join(options.published, INDEX_FILE), `${JSON.stringify(index, null, 2)}\\n`);\n\n return {\n published: [...added.values()].map(({ manifest }) => `${manifest.name}@${manifest.version}`),\n errors: []\n };\n};\n\nexport { buildRegistry };\nexport type { RegistryBuildOptions };\n","import { extensionNameType } from \"@andesine/contracts/extensions/manifest\";\nimport { readFile, writeFile } from \"node:fs/promises\";\nimport path from \"node:path\";\nimport { CLIError, exitCodes } from \"../errors\";\nimport type { createOutput } from \"../output\";\nimport { copyTemplate } from \"../pages/init\";\nimport { generateExtensionKey, KEY_ENVIRONMENT_VARIABLE } from \"./keys\";\n\nconst TEMPLATE_NAME = \"example/hello\";\n// Files of the template that name the extension.\nconst namedFiles = [\"andesine.config.ts\", \"src/backend/server.ts\"];\n\nconst rename = async (target: string, name: string): Promise<void> => {\n for (const file of namedFiles) {\n const source = await readFile(path.join(target, file), \"utf8\");\n\n await writeFile(path.join(target, file), source.replaceAll(`\"${TEMPLATE_NAME}\"`, `\"${name}\"`));\n }\n};\n/** `.env` for the local backend, with the private key; Git ignores it. */\nconst writeEnvironment = async (target: string, key: string): Promise<void> => {\n const example = await readFile(path.join(target, \".env.example\"), \"utf8\");\n\n await writeFile(\n path.join(target, \".env\"),\n example.replace(`${KEY_ENVIRONMENT_VARIABLE}=`, `${KEY_ENVIRONMENT_VARIABLE}='${key}'`),\n { mode: 0o600 }\n );\n};\n\n/** Creates an extension from the template, with a backend key pair. */\nconst initExtension = async (\n directory: string,\n options: { name?: string },\n output: ReturnType<typeof createOutput>\n): Promise<void> => {\n if (options.name && !extensionNameType.safeParse(options.name).success) {\n throw new CLIError(\n \"Use scope/name for the extension name, e.g. acme/publish.\",\n exitCodes.usage\n );\n }\n\n const target = await copyTemplate(\"extension\", directory, output);\n const key = await generateExtensionKey(target);\n\n if (options.name) await rename(target, options.name);\n\n await writeEnvironment(target, key.privateKey);\n await output.note(\"Next steps\", {\n \"Open the extension\": `cd ${path.relative(process.cwd(), target) || \".\"}`,\n \"Install\": \"npm install\",\n \"Build\": \"npm run build\",\n \"Start the backend\": \"npm run backend\",\n \"Backend key\": `${key.kid} (private key in ${path.relative(target, key.file!)} and .env)`\n });\n};\n\nexport { initExtension };\n","import type { Command } from \"@commander-js/extra-typings\";\nimport type { GlobalOptions } from \"../config/resolve\";\nimport { createCommandContext } from \"../context\";\nimport path from \"node:path\";\nimport { CLIError } from \"../errors\";\nimport { createOutput } from \"../output\";\nimport { buildExtension } from \"./build\";\nimport { removeDevelopment } from \"./dev/remove\";\nimport { runDevelopment } from \"./dev/run\";\nimport { sendTestEvent } from \"./dev/test-event\";\nimport { buildRegistry } from \"./registry/build\";\nimport { checkRegistry } from \"./registry/check\";\nimport { initExtension } from \"./init\";\nimport {\n checkExtensionKey,\n generateExtensionKey,\n KEY_ENVIRONMENT_VARIABLE,\n revokeExtensionKey\n} from \"./keys\";\nimport { KEYS_FILE } from \"./project\";\n\nconst formatVersions = (manifests: Array<{ name: string; version: string }>): string => {\n return manifests.map(({ name, version }) => `${name}@${version}`).join(\", \");\n};\nconst reportRegistryErrors = async (\n output: ReturnType<typeof createOutput>,\n errors: string[]\n): Promise<void> => {\n if (!errors.length) return;\n\n for (const error of errors) await output.error(error);\n\n throw new CLIError(`The registry has ${errors.length} problem(s).`);\n};\nconst ROOT_DESCRIPTION = \"Extension directory (default: current directory)\";\n\nconst registerExtensions = (program: Command, signal: AbortSignal): void => {\n const getOutput = (command: { optsWithGlobals(): object }) => {\n return createOutput((command.optsWithGlobals() as GlobalOptions).interactive, signal);\n };\n const extensions = program.command(\"extensions\").description(\"Create and build extensions\");\n const keys = extensions.command(\"keys\").description(\"Manage the extension backend keys\");\n\n extensions\n .command(\"init\")\n .description(\"Create an extension with a backend from the template in a new or empty directory\")\n .argument(\"[directory]\", \"Directory of the new extension\", \"extension\")\n .option(\"--name <scope/name>\", \"Registry name of the extension (default: example/hello)\")\n .action(async (directory, options, command) => {\n await initExtension(directory, options, getOutput(command));\n });\n extensions\n .command(\"build\")\n .description(\"Validate the manifest, then build the frontend, CSS, and dist/extension.json\")\n .option(\"--root <directory>\", ROOT_DESCRIPTION, \".\")\n .action(async (options, command) => {\n const output = getOutput(command);\n const { manifest, artifacts } = await buildExtension(options.root, output);\n\n await output.note(`${manifest.name}@${manifest.version}`, {\n Frontend: `${artifacts.frontend?.size} bytes`,\n Styles: artifacts.styles && `${artifacts.styles.size} bytes`,\n Icons: artifacts.icons && `${artifacts.icons.size} bytes`\n });\n });\n\n extensions\n .command(\"dev\")\n .description(\n \"Run the extension on a local instance for you: upload each build, reload on changes, stop on exit\"\n )\n .option(\"--root <directory>\", ROOT_DESCRIPTION, \".\")\n .option(\"--env-file <file>\", \"The local backend's environment file\", \".env\")\n .option(\n \"--backend <url>\",\n \"Local backend URL in place of the manifest's, e.g. http://localhost:3000\"\n )\n .option(\"--remove\", \"Uninstall the development extension and delete its development state\")\n .addHelpText(\n \"after\",\n \"\\nNeeds a local instance with EXTENSIONS_DEVELOPMENT_ENABLED=true, andesine auth login, and a\\nworkspace. The backend's environment file gets the development key and the instance URL.\"\n )\n .action(async (options, command) => {\n const context = await createCommandContext(\n command.optsWithGlobals() as GlobalOptions,\n signal\n );\n\n if (options.remove) await removeDevelopment(context, options.root);\n else await runDevelopment(context, options);\n });\n extensions\n .command(\"test-event\")\n .description(\"Send a sample event to a webhook of the development extension\")\n .argument(\"<webhook>\", \"Webhook ID from the manifest\")\n .argument(\"<type>\", \"Event type, e.g. entry.created\")\n .option(\"--root <directory>\", ROOT_DESCRIPTION, \".\")\n .action(async (webhookID, type, options, command) => {\n const context = await createCommandContext(\n command.optsWithGlobals() as GlobalOptions,\n signal\n );\n\n await sendTestEvent(context, { root: options.root, webhookID, type });\n });\n\n const registry = extensions\n .command(\"registry\")\n .description(\"Check and build an extension registry repository (for its CI)\");\n\n registry\n .command(\"check\")\n .description(\"Check every extension of the repository against the published registry\")\n .option(\"--repository <directory>\", \"Registry repository\", \".\")\n .requiredOption(\"--published <directory>\", \"Checkout of the published registry site\")\n .action(async (options, command) => {\n const output = getOutput(command);\n const result = await checkRegistry(\n path.resolve(options.repository),\n path.resolve(options.published),\n output\n );\n\n await reportRegistryErrors(output, result.errors);\n await output.success(\n `The registry is valid; new versions: ${formatVersions(result.newVersions.map(({ entry }) => entry.project.manifest)) || \"none\"}.`\n );\n });\n registry\n .command(\"build\")\n .description(\"Write new versions and the index to the published registry site\")\n .option(\"--repository <directory>\", \"Registry repository\", \".\")\n .requiredOption(\"--published <directory>\", \"Checkout of the published registry site\")\n .requiredOption(\"--site-url <url>\", \"HTTPS URL that serves the published site\")\n .option(\"--commit <sha>\", \"Repository commit of the build (default: HEAD)\")\n .action(async (options, command) => {\n const output = getOutput(command);\n const result = await buildRegistry(\n {\n repository: path.resolve(options.repository),\n published: path.resolve(options.published),\n siteURL: options.siteUrl,\n commit: options.commit\n },\n output\n );\n\n await reportRegistryErrors(output, result.errors);\n await output.success(`Published: ${result.published.join(\", \") || \"no new versions\"}.`);\n });\n\n keys\n .command(\"generate\")\n .description(`Generate an Ed25519 key; add its public key to ${KEYS_FILE}`)\n .option(\"--root <directory>\", ROOT_DESCRIPTION, \".\")\n .option(\"--kid <id>\", \"Key ID (default: key-<date>)\")\n .option(\"--print\", \"Print the private JWK for a secret manager instead of saving it\")\n .action(async (options, command) => {\n const output = getOutput(command);\n const root = path.resolve(options.root);\n const key = await generateExtensionKey(root, options);\n\n if (!key.file) {\n await output.text(`${key.privateKey}\\n`);\n\n return;\n }\n\n const file = path.relative(process.cwd(), key.file);\n\n if (!key.ignored) await output.warning(`Git does not ignore ${file}. Never commit it.`);\n\n await output.note(`Key ${key.kid}`, {\n \"Private key\": file,\n \"Backend\": `Set ${KEY_ENVIRONMENT_VARIABLE} to the file content`\n });\n });\n keys\n .command(\"check\")\n .description(\n `Check that the private key in ${KEY_ENVIRONMENT_VARIABLE} or --key matches a current key`\n )\n .option(\"--root <directory>\", ROOT_DESCRIPTION, \".\")\n .option(\"--key <file>\", \"Private JWK file\")\n .option(\"--registry <url>\", \"Also check the key in this registry index\")\n .action(async (options, command) => {\n const output = getOutput(command);\n const result = await checkExtensionKey(path.resolve(options.root), options);\n\n await output.success(\n `Key ${result.kid} is a current key of ${result.name}${result.registry ? \" in the registry\" : \"\"}.`\n );\n });\n keys\n .command(\"revoke\")\n .description(`Remove a key from ${KEYS_FILE} and list it as revoked`)\n .argument(\"<kid>\", \"Key ID\")\n .option(\"--root <directory>\", ROOT_DESCRIPTION, \".\")\n .action(async (kid, options, command) => {\n const output = getOutput(command);\n\n await revokeExtensionKey(path.resolve(options.root), kid);\n await output.success(`Key ${kid} is revoked. Publish a new version to stop using it.`);\n });\n};\n\nexport { registerExtensions };\n","import { version } from \"../package.json\";\nimport { Command, Option } from \"@commander-js/extra-typings\";\nimport { createCommandContext } from \"./context\";\nimport { login } from \"./auth/login\";\nimport { logout } from \"./auth/logout\";\nimport { status } from \"./auth/status\";\nimport { init } from \"./init\";\nimport { createOutput } from \"./output\";\nimport { initPages } from \"./pages/init\";\nimport { registerAPI } from \"./api/register\";\nimport { registerTypes } from \"./types/register\";\nimport { registerExtensions } from \"./extensions/register\";\n\n/** Register custom commands and the generated public API group. */\nconst createProgram = (signal: AbortSignal) => {\n const program = new Command()\n .name(\"andesine\")\n .description(\"Command-line tools for Andesine\")\n .version(version)\n .option(\"--config <file>\", \"Use a project configuration file (ANDESINE_CONFIG)\")\n .option(\"--profile <name>\", \"Select a saved user profile (ANDESINE_PROFILE)\")\n .option(\"--base-url <url>\", \"Set the API root (ANDESINE_BASE_URL)\")\n .option(\"--workspace <id>\", \"Select a workspace (ANDESINE_WORKSPACE_ID)\")\n .option(\"--no-interactive\", \"Disable interactive prompts\")\n .showHelpAfterError()\n .exitOverride();\n\n const auth = program.command(\"auth\").description(\"Manage CLI authentication\");\n\n program\n .command(\"init\")\n .description(\"Configure this project for Andesine content and type generation\")\n .addOption(\n new Option(\"--source <source>\", \"Type source: published (default) or current\").choices([\n \"published\",\n \"current\"\n ] as const)\n )\n .option(\"--channel <code>\", \"Publishing channel (default: published)\")\n .option(\"--snapshot <id>\", \"Use a fixed published snapshot instead of a channel\")\n .option(\n \"--collection <selectors...>\",\n \"Collection IDs or decoded paths, including collection-ID anchors\"\n )\n .option(\n \"--collection-slug-path <paths...>\",\n \"Decoded collection slug paths, including descendants\"\n )\n .option(\"--all-collections\", \"Include all accessible collections\")\n .option(\"--output <file>\", \"Types file relative to config (default: src/andesine.generated.ts)\")\n .option(\"--include-entry-ids\", \"Include entry ID types\")\n .option(\"--no-include-entry-ids\", \"Omit entry ID types\")\n .option(\"--include-entry-paths\", \"Include entry path types\")\n .option(\"--no-include-entry-paths\", \"Omit entry path types\")\n .option(\"--include-tree\", \"Include exact tree types\")\n .option(\"--no-include-tree\", \"Omit exact tree types\")\n .option(\"--yes\", \"Save without confirmation, including updates to an existing config\")\n .option(\"--generate\", \"Generate the configured types file after saving\")\n .option(\"--no-generate\", \"Save configuration without generating types\")\n .option(\"--no-browser\", \"Do not open a browser if login is needed\")\n .addOption(\n new Option(\"--credential-store <store>\", \"Credential store for a new login\").choices([\n \"keyring\",\n \"file\"\n ] as const)\n )\n .action(async (_options, command) => {\n await init(command.optsWithGlobals(), signal);\n });\n\n program\n .command(\"pages\")\n .description(\"Create Andesine Pages documentation sites\")\n .command(\"init\")\n .description(\"Create an Andesine Pages site from the template in a new or empty directory\")\n .argument(\"[directory]\", \"Directory of the new site\", \"docs\")\n .action(async (directory, _options, command) => {\n await initPages(directory, createOutput(command.optsWithGlobals().interactive, signal));\n });\n\n auth\n .command(\"login\")\n .description(\"Sign in through browser device approval\")\n .option(\"--no-browser\", \"Display the URL and code without opening a browser\")\n .addOption(\n new Option(\n \"--credential-store <store>\",\n \"Store credentials in the OS keyring or an unencrypted private file\"\n ).choices([\"keyring\", \"file\"] as const)\n )\n .action(async (options, command) => {\n const context = await createCommandContext(command.optsWithGlobals(), signal, {\n allowNewProfile: true\n });\n\n await login(context, options);\n });\n auth\n .command(\"status\")\n .description(\"Verify the selected credential and show its identity as JSON\")\n .action(async (_options, command) => {\n await status(await createCommandContext(command.optsWithGlobals(), signal));\n });\n auth\n .command(\"logout\")\n .description(\n \"Revoke and remove the selected profile's credentials; leave API-key environment variables unchanged\"\n )\n .action(async (_options, command) => {\n await logout(await createCommandContext(command.optsWithGlobals(), signal));\n });\n\n program.addHelpText(\n \"after\",\n \"\\nConfiguration precedence: flags > environment > project > profile > defaults.\\nDefault API root: https://api.andesine.app\\nAPI keys are read from ANDESINE_API_KEY by authenticated commands.\"\n );\n program.hook(\"preAction\", () => {\n signal.throwIfAborted();\n });\n registerAPI(program, signal);\n registerTypes(program, signal);\n registerExtensions(program, signal);\n program.action(() => {\n program.outputHelp();\n });\n\n return program;\n};\n\nexport { createProgram };\n","import { CLIError, CancelledError, exitCodes } from \"./errors\";\nimport { createProgram } from \"./program\";\nimport { createOutput, writeOutput } from \"./output\";\nimport { CommanderError } from \"commander\";\n\n/** Run the executable and release signal listeners when it finishes. */\nconst runCLI = async (argv = process.argv): Promise<number> => {\n const controller = new AbortController();\n const program = createProgram(controller.signal);\n const cancel = () => {\n controller.abort(new CancelledError());\n };\n const handleOutputError = (error: NodeJS.ErrnoException) => {\n const isBrokenPipe = error.code === \"EPIPE\";\n\n controller.abort(\n new CLIError(\n isBrokenPipe ? \"Output pipe closed.\" : \"Cannot write output.\",\n isBrokenPipe ? exitCodes.success : exitCodes.failure\n )\n );\n };\n\n let exitCode: number = exitCodes.success;\n\n process.once(\"SIGINT\", cancel);\n process.once(\"SIGTERM\", cancel);\n process.stdout.on(\"error\", handleOutputError);\n process.stderr.on(\"error\", handleOutputError);\n\n try {\n await program.parseAsync(argv);\n controller.signal.throwIfAborted();\n } catch (error) {\n if (error instanceof CommanderError) {\n exitCode = error.exitCode === 0 ? exitCodes.success : exitCodes.usage;\n } else {\n const failure: unknown = controller.signal.aborted ? controller.signal.reason : error;\n const message = failure instanceof Error ? failure.message : \"Command failed.\";\n\n exitCode = failure instanceof CLIError ? failure.exitCode : exitCodes.failure;\n\n if (exitCode !== exitCodes.success && !process.stderr.destroyed) {\n await createOutput(program.opts().interactive)\n .error(message)\n .catch(() => {});\n }\n }\n } finally {\n // Commander writes synchronously. Drain its queued output before releasing error handlers.\n await Promise.allSettled([writeOutput(process.stdout, \"\"), writeOutput(process.stderr, \"\")]);\n process.removeListener(\"SIGINT\", cancel);\n process.removeListener(\"SIGTERM\", cancel);\n process.stdout.removeListener(\"error\", handleOutputError);\n process.stderr.removeListener(\"error\", handleOutputError);\n }\n\n if (controller.signal.aborted) {\n const reason: unknown = controller.signal.reason;\n\n return reason instanceof CLIError ? reason.exitCode : exitCodes.failure;\n }\n\n return exitCode;\n};\n\nexport { runCLI };\n","#!/usr/bin/env node\nimport { runCLI } from \"./run\";\n\nprocess.exitCode = await runCLI();\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,MAAM,YAAY;CAAE,SAAS;CAAG,SAAS;CAAG,OAAO;CAAG,OAAO;CAAG,WAAW;AAAI;AAE/E,IAAM,WAAN,cAAuB,MAAM;CAGhB;CAFX,YACE,SACA,WAA4B,UAAU,SACtC;EACA,MAAM,OAAO;EAFJ,KAAA,WAAA;EAGT,KAAK,OAAO;CACd;AACF;AAEA,IAAM,iBAAN,cAA6B,SAAS;CACpC,cAAc;EACZ,MAAM,cAAc,UAAU,SAAS;EACvC,KAAK,OAAO;CACd;AACF;;;;;;;AEZA,MAAM,iBAAiB,OACrB,UACA,QACA,WAAW,UAC+B;CAC1C,IAAI;CACJ,IAAI;CAEJ,IAAI;EACF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KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;IACX;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;EACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,SAAS;GACP,SAAS;GACT,SAAS;EACX;EACA,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ;GACN;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;IACX;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;IACX;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;EACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,SAAS;GACP,SAAS;GACT,SAAS;GACT,KAAK;GACL,iBAAiB;EACnB;EACA,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ;GACN;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;IACX;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;IACX;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,WAAW;KACX,QAAQ;IACV;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;IACX;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;EACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,SAAS;GACP,SAAS;GACT,SAAS;GACT,UAAU;GACV,UAAU;GACV,UAAU;EACZ;EACA,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ;GACN;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;IACX;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;IACX;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,WAAW;KACX,WAAW;IACb;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,SAAS;IACX;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;EACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,SAAS;GACP,OAAO;GACP,OAAO;EACT;EACA,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ;GACN;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,WAAW;KACX,SAAS;IACX;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;IACX;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;IACX;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,SAAS;KACT,SAAS;IACX;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;EACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,SAAS;GACP,SAAS;GACT,MAAM;EACR;EACA,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ;GACN;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;IACX;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,kBAAkB;IACpB;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;EACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ,CAAC;EACT,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,SAAS,EACP,KAAK,CAAC,cAAc,EACtB;EACA,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ,CACN;GACE,MAAM;GACN,UAAU;GACV,UAAU;GACV,QAAQ;IACN,MAAM;IACN,aACE;GACJ;GACA,MAAM;GACN,MAAM;GACN,UAAU;EACZ,GACA;GACE,MAAM;GACN,UAAU;GACV,UAAU;GACV,QAAQ;IACN,MAAM;IACN,UAAU;IACV,UAAU;IACV,OAAO;KACL,MAAM;KACN,SAAS;IACX;IACA,aAAa;GACf;GACA,MAAM;GACN,MAAM;GACN,UAAU;EACZ,CACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,SAAS;GACP,MAAM;GACN,UAAU;EACZ;EACA,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ;GACN;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,WAAW;KACX,WAAW;KACX,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;EACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,SAAS,EACP,IAAI,eACN;EACA,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ,CACN;GACE,MAAM;GACN,UAAU;GACV,UAAU;GACV,QAAQ;IACN,MAAM;IACN,SAAS;IACT,aAAa;GACf;GACA,MAAM;GACN,MAAM;GACN,UAAU;EACZ,GACA;GACE,MAAM;GACN,UAAU;GACV,UAAU;GACV,QAAQ;IACN,MAAM;IACN,aACE;GACJ;GACA,MAAM;GACN,MAAM;GACN,UAAU;EACZ,CACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,SAAS;GACP,cAAc;GACd,OAAO;EACT;EACA,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ;GACN;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;IACX;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,SAAS;KACT,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;EACF;EACA,aAAa;EACb,UAAU;EACV,YAAY;CACd;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,SAAS;GACP,IAAI;GACJ,MAAM;EACR;EACA,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ;GACN;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,WAAW;KACX,WAAW;KACX,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;EACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,SAAS;GACP,SAAS;GACT,SAAS;EACX;EACA,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ;GACN;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;IACX;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,WAAW;KACX,WAAW;KACX,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;EACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,SAAS;GACP,aAAa;GACb,YAAY;GACZ,SAAS;GACT,SAAS;GACT,SAAS;EACX;EACA,UAAU,CAAC;EACX,QAAQ;GACN;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;IACX;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;IACX;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;IACX;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;IACX;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM,CAAC,aAAa,SAAS;KAC7B,MAAM;IACR;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;EACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,SAAS;GACP,SAAS;GACT,SAAS;EACX;EACA,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ;GACN;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;IACX;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,WAAW;KACX,WAAW;IACb;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;IACX;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;EACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,SAAS;GACP,cAAc;GACd,SAAS;EACX;EACA,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ;GACN;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;IACX;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,WAAW;KACX,WAAW;KACX,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;EACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,SAAS;GACP,SAAS;GACT,OAAO;EACT;EACA,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ;GACN;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,SAAS;KACT,SAAS;IACX;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;IACX;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,WAAW;KACX,WAAW;IACb;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;IACX;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;EACF;EACA,aAAa;EACb,UAAU;EACV,YAAY;CACd;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,SAAS;GACP,SAAS;GACT,OAAO;EACT;EACA,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ;GACN;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,SAAS;KACT,SAAS;IACX;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;IACX;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,WAAW;KACX,WAAW;IACb;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;IACX;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;IACX;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;IACX;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,UAAU;KACV,OAAO,EACL,MAAM,sCACR;KACA,SAAS,CAAC;IACZ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;EACF;EACA,aAAa;EACb,UAAU;EACV,YAAY;CACd;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,SAAS,EACP,KAAK,CAAC,aAAa,EACrB;EACA,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ,CACN;GACE,MAAM;GACN,UAAU;GACV,UAAU;GACV,QAAQ;IACN,MAAM;IACN,aACE;GACJ;GACA,MAAM;GACN,MAAM;GACN,UAAU;EACZ,GACA;GACE,MAAM;GACN,UAAU;GACV,UAAU;GACV,QAAQ;IACN,MAAM;IACN,UAAU;IACV,UAAU;IACV,OAAO;KACL,MAAM;KACN,SAAS;IACX;IACA,aAAa;GACf;GACA,MAAM;GACN,MAAM;GACN,UAAU;EACZ,CACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,SAAS;GACP,MAAM;GACN,cAAc;EAChB;EACA,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ;GACN;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,WAAW;KACX,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;EACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,SAAS,EACP,IAAI,cACN;EACA,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ,CACN;GACE,MAAM;GACN,UAAU;GACV,UAAU;GACV,QAAQ;IACN,MAAM;IACN,SAAS;IACT,aAAa;GACf;GACA,MAAM;GACN,MAAM;GACN,UAAU;EACZ,GACA;GACE,MAAM;GACN,UAAU;GACV,UAAU;GACV,QAAQ;IACN,MAAM;IACN,aACE;GACJ;GACA,MAAM;GACN,MAAM;GACN,UAAU;EACZ,CACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,SAAS,EACP,IAAI,cACN;EACA,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ;GACN;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;IACX;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;EACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,SAAS;GACP,cAAc;GACd,OAAO;EACT;EACA,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ;GACN;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;IACX;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,SAAS;KACT,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;EACF;EACA,aAAa;EACb,UAAU;EACV,YAAY;CACd;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,SAAS;GACP,IAAI;GACJ,MAAM;EACR;EACA,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ;GACN;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,WAAW;KACX,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;EACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,SAAS,CAAC;EACV,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ,CACN;GACE,MAAM;GACN,UAAU;GACV,UAAU;GACV,QAAQ;IACN,MAAM;IACN,aACE;GACJ;GACA,MAAM;GACN,MAAM;GACN,UAAU;EACZ,CACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,SAAS;GACP,OAAO;GACP,QAAQ;EACV;EACA,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ;GACN;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,QAAQ;KACR,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;EACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,SAAS,CAAC;EACV,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ;GACN;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,SAAS;KACT,SAAS;IACX;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;EACF;EACA,aAAa;EACb,UAAU;EACV,YAAY;CACd;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,SAAS,CAAC;EACV,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ;GACN;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,SAAS;KACT,SAAS;IACX;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;EACF;EACA,aAAa;EACb,UAAU;EACV,YAAY;CACd;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,SAAS,EACP,IAAI,aACN;EACA,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ,CACN;GACE,MAAM;GACN,UAAU;GACV,UAAU;GACV,QAAQ;IACN,MAAM;IACN,SAAS;IACT,aAAa;GACf;GACA,MAAM;GACN,MAAM;GACN,UAAU;EACZ,GACA;GACE,MAAM;GACN,UAAU;GACV,UAAU;GACV,QAAQ;IACN,MAAM;IACN,aACE;GACJ;GACA,MAAM;GACN,MAAM;GACN,UAAU;EACZ,CACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,SAAS,EACP,IAAI,cACN;EACA,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ,CACN;GACE,MAAM;GACN,UAAU;GACV,UAAU;GACV,QAAQ;IACN,MAAM;IACN,SAAS;IACT,aAAa;GACf;GACA,MAAM;GACN,MAAM;GACN,UAAU;EACZ,GACA;GACE,MAAM;GACN,UAAU;GACV,UAAU;GACV,QAAQ;IACN,MAAM;IACN,aACE;GACJ;GACA,MAAM;GACN,MAAM;GACN,UAAU;EACZ,CACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,SAAS,EACP,IAAI,cACN;EACA,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ,CACN;GACE,MAAM;GACN,UAAU;GACV,UAAU;GACV,QAAQ;IACN,MAAM;IACN,SAAS;IACT,aAAa;GACf;GACA,MAAM;GACN,MAAM;GACN,UAAU;EACZ,GACA;GACE,MAAM;GACN,UAAU;GACV,UAAU;GACV,QAAQ;IACN,MAAM;IACN,aACE;GACJ;GACA,MAAM;GACN,MAAM;GACN,UAAU;EACZ,CACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,SAAS;GACP,IAAI;GACJ,QAAQ;EACV;EACA,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ;GACN;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;EACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,SAAS;GACP,KAAK,CAAC,cAAc;GACpB,SAAS;EACX;EACA,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ;GACN;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,WAAW;KACX,WAAW;KACX,SAAS;KACT,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,UAAU;KACV,UAAU;KACV,OAAO;MACL,MAAM;MACN,SAAS;KACX;KACA,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;EACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,SAAS;GACP,SAAS,CACP,EACE,SAAS,cACX,CACF;GACA,SAAS;EACX;EACA,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ;GACN;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,WAAW;KACX,WAAW;KACX,SAAS;KACT,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,UAAU;KACV,UAAU;KACV,OAAO,EACL,MAAM,0CACR;KACA,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;EACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,SAAS;GACP,KAAK,CAAC,cAAc;GACpB,SAAS;GACT,SAAS;EACX;EACA,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ;GACN;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,UAAU;KACV,UAAU;KACV,OAAO;MACL,MAAM;MACN,SAAS;KACX;KACA,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,eAAe;MACb,MAAM;MACN,WAAW;MACX,WAAW;KACb;KACA,sBAAsB;MACpB,MAAM;MACN,SAAS;KACX;KACA,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;EACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,SAAS;GACP,KAAK,CAAC,cAAc;GACpB,SAAS;EACX;EACA,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ;GACN;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,WAAW;KACX,WAAW;KACX,SAAS;KACT,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,UAAU;KACV,UAAU;KACV,OAAO;MACL,MAAM;MACN,SAAS;KACX;KACA,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;EACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,SAAS;GACP,KAAK,CAAC,aAAa;GACnB,SAAS;EACX;EACA,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ;GACN;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,WAAW;KACX,WAAW;KACX,SAAS;KACT,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,UAAU;KACV,UAAU;KACV,OAAO;MACL,MAAM;MACN,SAAS;KACX;KACA,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;EACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,SAAS,EACP,MAAM,UACR;EACA,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ,CACN;GACE,MAAM;GACN,UAAU;GACV,UAAU;GACV,QAAQ;IACN,MAAM;IACN,aACE;GACJ;GACA,MAAM;GACN,MAAM;GACN,UAAU;EACZ,GACA;GACE,MAAM;GACN,UAAU;GACV,UAAU;GACV,QAAQ;IACN,MAAM;IACN,WAAW;IACX,WAAW;IACX,aAAa;GACf;GACA,MAAM;GACN,MAAM;GACN,UAAU;EACZ,CACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,SAAS,EACP,MAAM,UACR;EACA,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ;GACN;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,WAAW;KACX,WAAW;KACX,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;EACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,SAAS;GACP,SAAS;GACT,cAAc;EAChB;EACA,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ;GACN;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,WAAW;KACX,WAAW;IACb;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;EACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,SAAS;GACP,SAAS;GACT,SAAS;EACX;EACA,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ;GACN;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,WAAW;KACX,WAAW;KACX,SAAS;KACT,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;EACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,SAAS,EACP,wBAAwB,KAC1B;EACA,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ,CACN;GACE,MAAM;GACN,UAAU;GACV,UAAU;GACV,QAAQ;IACN,MAAM;IACN,aAAa;GACf;GACA,MAAM;GACN,MAAM;GACN,UAAU;EACZ,GACA;GACE,MAAM;GACN,UAAU;GACV,UAAU;GACV,QAAQ;IACN,MAAM;IACN,aACE;GACJ;GACA,MAAM;GACN,MAAM;GACN,UAAU;EACZ,CACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,SAAS,EACP,SAAS,cACX;EACA,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ,CACN;GACE,MAAM;GACN,UAAU;GACV,UAAU;GACV,QAAQ;IACN,MAAM;IACN,SAAS;IACT,aAAa;GACf;GACA,MAAM;GACN,MAAM;GACN,UAAU;EACZ,GACA;GACE,MAAM;GACN,UAAU;GACV,UAAU;GACV,QAAQ;IACN,MAAM;IACN,aACE;GACJ;GACA,MAAM;GACN,MAAM;GACN,UAAU;EACZ,CACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,SAAS;GACP,cAAc;GACd,SAAS;EACX;EACA,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ;GACN;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,WAAW;KACX,WAAW;KACX,SAAS;KACT,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;EACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,SAAS;GACP,SAAS;GACT,SAAS;EACX;EACA,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ;GACN;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,WAAW;KACX,WAAW;KACX,SAAS;KACT,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;EACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,SAAS;GACP,cAAc;GACd,YAAY;GACZ,UAAU,CAAC,aAAa;GACxB,SAAS;EACX;EACA,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ;GACN;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,WAAW;KACX,WAAW;KACX,SAAS;KACT,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,UAAU;KACV,OAAO;MACL,MAAM;MACN,SAAS;KACX;KACA,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,UAAU;KACV,OAAO;MACL,MAAM;MACN,SAAS;KACX;KACA,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;EACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,SAAS;GACP,cAAc;GACd,SAAS;GACT,SAAS;EACX;EACA,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ;GACN;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,eAAe;MACb,MAAM;MACN,WAAW;MACX,WAAW;KACb;KACA,sBAAsB;MACpB,MAAM;MACN,SAAS;KACX;KACA,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;EACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,SAAS;GACP,cAAc;GACd,SAAS;EACX;EACA,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ;GACN;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,WAAW;KACX,WAAW;KACX,SAAS;KACT,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;EACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,SAAS;GACP,SAAS;GACT,SAAS;GACT,WAAW;EACb;EACA,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ;GACN;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,WAAW;KACX,WAAW;KACX,SAAS;KACT,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;EACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,SAAS;GACP,MAAM;GACN,aAAa,CAAC,SAAS;EACzB;EACA,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ;GACN;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,WAAW;KACX,WAAW;KACX,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,OAAO,EACL,MAAM,kCACR;KACA,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;EACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,SAAS,EACP,IAAI,aACN;EACA,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ,CACN;GACE,MAAM;GACN,UAAU;GACV,UAAU;GACV,QAAQ;IACN,MAAM;IACN,SAAS;IACT,aAAa;GACf;GACA,MAAM;GACN,MAAM;GACN,UAAU;EACZ,GACA;GACE,MAAM;GACN,UAAU;GACV,UAAU;GACV,QAAQ;IACN,MAAM;IACN,aACE;GACJ;GACA,MAAM;GACN,MAAM;GACN,UAAU;EACZ,CACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,SAAS,CAAC;EACV,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ,CACN;GACE,MAAM;GACN,UAAU;GACV,UAAU;GACV,QAAQ;IACN,MAAM;IACN,aACE;GACJ;GACA,MAAM;GACN,MAAM;GACN,UAAU;EACZ,CACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,SAAS;GACP,IAAI;GACJ,MAAM;EACR;EACA,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ;GACN;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,WAAW;KACX,WAAW;KACX,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,OAAO,EACL,MAAM,kCACR;KACA,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;EACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,SAAS,EACP,IAAI,cACN;EACA,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ,CACN;GACE,MAAM;GACN,UAAU;GACV,UAAU;GACV,QAAQ;IACN,MAAM;IACN,SAAS;IACT,aAAa;GACf;GACA,MAAM;GACN,MAAM;GACN,UAAU;EACZ,GACA;GACE,MAAM;GACN,UAAU;GACV,UAAU;GACV,QAAQ;IACN,MAAM;IACN,aACE;GACJ;GACA,MAAM;GACN,MAAM;GACN,UAAU;EACZ,CACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,SAAS,EACP,cAAc,eAChB;EACA,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ,CACN;GACE,MAAM;GACN,UAAU;GACV,UAAU;GACV,QAAQ;IACN,MAAM;IACN,SAAS;IACT,aAAa;GACf;GACA,MAAM;GACN,MAAM;GACN,UAAU;EACZ,GACA;GACE,MAAM;GACN,UAAU;GACV,UAAU;GACV,QAAQ;IACN,MAAM;IACN,aACE;GACJ;GACA,MAAM;GACN,MAAM;GACN,UAAU;EACZ,CACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,SAAS;GACP,IAAI;GACJ,OAAO;EACT;EACA,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ;GACN;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;IACX;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,SAAS;KACT,SAAS;IACX;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;EACF;EACA,aAAa;EACb,UAAU;EACV,YAAY;CACd;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,SAAS;GACP,UAAU;GACV,mBAAmB;GACnB,MAAM;EACR;EACA,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ;GACN;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,OAAO;KACP,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,WAAW;KACX,WAAW;KACX,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;EACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,SAAS,EACP,cAAc,eAChB;EACA,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ,CACN;GACE,MAAM;GACN,UAAU;GACV,UAAU;GACV,QAAQ;IACN,MAAM;IACN,SAAS;IACT,aAAa;GACf;GACA,MAAM;GACN,MAAM;GACN,UAAU;EACZ,GACA;GACE,MAAM;GACN,UAAU;GACV,UAAU;GACV,QAAQ;IACN,MAAM;IACN,aACE;GACJ;GACA,MAAM;GACN,MAAM;GACN,UAAU;EACZ,CACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,SAAS;GACP,UAAU;GACV,mBAAmB;EACrB;EACA,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ;GACN;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;EACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,SAAS,EACP,cAAc,eAChB;EACA,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ;GACN;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;IACX;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;EACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,SAAS,EACP,YAAY,eACd;EACA,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ,CACN;GACE,MAAM;GACN,UAAU;GACV,UAAU;GACV,QAAQ;IACN,MAAM;IACN,SAAS;GACX;GACA,MAAM;GACN,MAAM;GACN,UAAU;EACZ,GACA;GACE,MAAM;GACN,UAAU;GACV,UAAU;GACV,QAAQ;IACN,MAAM;IACN,aACE;GACJ;GACA,MAAM;GACN,MAAM;GACN,UAAU;EACZ,CACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,SAAS,EACP,IAAI,eACN;EACA,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ,CACN;GACE,MAAM;GACN,UAAU;GACV,UAAU;GACV,QAAQ;IACN,MAAM;IACN,SAAS;IACT,aAAa;GACf;GACA,MAAM;GACN,MAAM;GACN,UAAU;EACZ,GACA;GACE,MAAM;GACN,UAAU;GACV,UAAU;GACV,QAAQ;IACN,MAAM;IACN,aACE;GACJ;GACA,MAAM;GACN,MAAM;GACN,UAAU;EACZ,CACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,SAAS;GACP,UAAU;GACV,OAAO;EACT;EACA,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ;GACN;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,SAAS;KACT,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;EACF;EACA,aAAa;EACb,UAAU;EACV,YAAY;CACd;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,SAAS;GACP,IAAI;GACJ,mBAAmB;EACrB;EACA,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ;GACN;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,OAAO;KACP,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,WAAW;KACX,WAAW;KACX,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;EACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,SAAS;GACP,IAAI;GACJ,MAAM;EACR;EACA,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ;GACN;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,OAAO,CACL;MACE,MAAM;MACN,WAAW;MACX,WAAW;KACb,GACA,EACE,MAAM,OACR,CACF;KACA,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;EACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,SAAS,EACP,UAAU,6BACZ;EACA,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ;GACN;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,WAAW;KACX,WAAW;IACb;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;IACX;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,UAAU;KACV,OAAO,EACL,MAAM,sCACR;KACA,SAAS,CAAC;IACZ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,UAAU;KACV,OAAO,EACL,MAAM,4CACR;KACA,SAAS,CAAC;IACZ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;EACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ;GACN;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,WAAW;KACX,WAAW;IACb;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;IACX;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,UAAU;KACV,OAAO,EACL,MAAM,sCACR;KACA,SAAS,CAAC;IACZ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,UAAU;KACV,OAAO,EACL,MAAM,4CACR;KACA,SAAS,CAAC;IACZ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;EACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,SAAS;GACP,UAAU;GACV,SAAS;EACX;EACA,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ;GACN;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,WAAW;KACX,WAAW;IACb;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;IACX;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,UAAU;KACV,OAAO,EACL,MAAM,sCACR;KACA,SAAS,CAAC;IACZ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,UAAU;KACV,OAAO,EACL,MAAM,4CACR;KACA,SAAS,CAAC;IACZ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,WAAW;KACX,WAAW;KACX,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;EACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ;GACN;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,WAAW;KACX,WAAW;IACb;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;IACX;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,UAAU;KACV,OAAO,EACL,MAAM,sCACR;KACA,SAAS,CAAC;IACZ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,UAAU;KACV,OAAO,EACL,MAAM,4CACR;KACA,SAAS,CAAC;IACZ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,WAAW;KACX,WAAW;KACX,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;EACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,SAAS;GACP,OAAO;GACP,OAAO;EACT;EACA,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ;GACN;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,WAAW;IACb;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;IACX;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,UAAU;KACV,OAAO,EACL,MAAM,sCACR;KACA,SAAS,CAAC;IACZ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,SAAS;KACT,SAAS;IACX;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;EACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,SAAS;GACP,OAAO;GACP,SAAS;GACT,OAAO;EACT;EACA,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ;GACN;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,WAAW;IACb;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;IACX;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,UAAU;KACV,OAAO,EACL,MAAM,sCACR;KACA,SAAS,CAAC;IACZ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,SAAS;KACT,SAAS;IACX;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,WAAW;KACX,WAAW;KACX,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;EACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,SAAS;GACP,aAAa,CAAC,YAAY;GAC1B,gBAAgB;EAClB;EACA,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ;GACN;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,UAAU;KACV,OAAO,EACL,OAAO;MACL;OACE,MAAM;OACN,SAAS;MACX;MACA;OACE,MAAM;OACN,aACE;MACJ;MACA;OACE,MAAM;OACN,YAAY,EACV,oBAAoB;QAClB,MAAM;QACN,aACE;OACJ,EACF;OACA,UAAU,CAAC,oBAAoB;MACjC;KACF,EACF;KACA,SAAS,CAAC;KACV,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;EACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,SAAS;GACP,SAAS;GACT,aAAa,CAAC,YAAY;EAC5B;EACA,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ;GACN;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,UAAU;KACV,OAAO,EACL,OAAO;MACL;OACE,MAAM;OACN,SAAS;MACX;MACA;OACE,MAAM;OACN,aACE;MACJ;MACA;OACE,MAAM;OACN,YAAY,EACV,oBAAoB;QAClB,MAAM;QACN,aACE;OACJ,EACF;OACA,UAAU,CAAC,oBAAoB;MACjC;KACF,EACF;KACA,SAAS,CAAC;KACV,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,WAAW;KACX,WAAW;IACb;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;IACX;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;EACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,SAAS;GACP,SAAS;GACT,MAAM;EACR;EACA,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ;GACN;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,WAAW;KACX,WAAW;KACX,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;EACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,SAAS,EACP,IAAI,cACN;EACA,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ;GACN;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;EACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,SAAS;GACP,SAAS;GACT,OAAO;EACT;EACA,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ;GACN;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,SAAS;KACT,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;EACF;EACA,aAAa;EACb,UAAU;EACV,YAAY;CACd;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,SAAS,EACP,IAAI,cACN;EACA,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ,CACN;GACE,MAAM;GACN,UAAU;GACV,UAAU;GACV,QAAQ;IACN,MAAM;IACN,SAAS;IACT,aAAa;GACf;GACA,MAAM;GACN,MAAM;GACN,UAAU;EACZ,GACA;GACE,MAAM;GACN,UAAU;GACV,UAAU;GACV,QAAQ;IACN,MAAM;IACN,aACE;GACJ;GACA,MAAM;GACN,MAAM;GACN,UAAU;EACZ,CACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,SAAS;GACP,IAAI;GACJ,MAAM;EACR;EACA,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ;GACN;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,OAAO,CACL;MACE,MAAM;MACN,WAAW;MACX,WAAW;KACb,GACA,EACE,MAAM,OACR,CACF;KACA,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;EACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ,CACN;GACE,MAAM;GACN,UAAU;GACV,UAAU;GACV,QAAQ;IACN,MAAM;IACN,aACE;GACJ;GACA,MAAM;GACN,MAAM;GACN,UAAU;EACZ,GACA;GACE,MAAM;GACN,UAAU;GACV,UAAU;GACV,QAAQ;IACN,MAAM;IACN,UAAU;IACV,UAAU;IACV,OAAO;KACL,MAAM;KACN,YAAY;MACV,IAAI;OACF,MAAM;OACN,SAAS;MACX;MACA,kBAAkB;OAChB,MAAM;OACN,SAAS;OACT,SAAS;OACT,kBAAkB;MACpB;KACF;KACA,UAAU,CAAC,MAAM,kBAAkB;KACnC,sBAAsB;IACxB;GACF;GACA,MAAM;GACN,MAAM;GACN,UAAU;EACZ,CACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ;GACN;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;IACX;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,SAAS;KACT,kBAAkB;IACpB;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,UAAU;KACV,UAAU;KACV,OAAO;MACL,MAAM;MACN,SAAS;KACX;IACF;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;EACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ;GACN;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,UAAU;KACV,UAAU;KACV,OAAO;MACL,MAAM;MACN,YAAY;OACV,IAAI;QACF,MAAM;QACN,SAAS;OACX;OACA,kBAAkB;QAChB,MAAM;QACN,SAAS;QACT,SAAS;QACT,kBAAkB;OACpB;MACF;MACA,UAAU,CAAC,MAAM,kBAAkB;MACnC,sBAAsB;KACxB;IACF;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ,EACN,MAAM,UACR;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;EACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ;GACN;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,WAAW;KACX,WAAW;IACb;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,WAAW;KACX,QAAQ;IACV;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;IACX;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,UAAU;KACV,UAAU;KACV,OAAO,EACL,MAAM,wCACR;IACF;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ,EACN,OAAO,EACT;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ,EACN,OAAO,CACL;KACE,MAAM;KACN,YAAY,EACV,MAAM,EACJ,OAAO,MACT,EACF;KACA,UAAU,CAAC,MAAM;KACjB,sBAAsB;IACxB,GACA;KACE,MAAM;KACN,YAAY;MACV,MAAM,EACJ,OAAO,WACT;MACA,OAAO;OACL,MAAM;OACN,UAAU;OACV,UAAU;OACV,OAAO;QACL,MAAM;QACN,SAAS;OACX;MACF;KACF;KACA,UAAU,CAAC,QAAQ,OAAO;KAC1B,sBAAsB;IACxB,CACF,EACF;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ,EACN,OAAO,CACL;KACE,MAAM;KACN,YAAY,EACV,MAAM,EACJ,OAAO,MACT,EACF;KACA,UAAU,CAAC,MAAM;KACjB,sBAAsB;IACxB,GACA;KACE,MAAM;KACN,YAAY;MACV,MAAM,EACJ,OAAO,WACT;MACA,OAAO;OACL,MAAM;OACN,UAAU;OACV,UAAU;OACV,OAAO;QACL,MAAM;QACN,WAAW;QACX,WAAW;OACb;MACF;KACF;KACA,UAAU,CAAC,QAAQ,OAAO;KAC1B,sBAAsB;IACxB,CACF,EACF;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;EACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ;GACN;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;IACX;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,SAAS;KACT,kBAAkB;IACpB;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;EACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ,CACN;GACE,MAAM;GACN,UAAU;GACV,UAAU;GACV,QAAQ;IACN,MAAM;IACN,SAAS;GACX;GACA,MAAM;GACN,MAAM;GACN,UAAU;EACZ,GACA;GACE,MAAM;GACN,UAAU;GACV,UAAU;GACV,QAAQ;IACN,MAAM;IACN,aACE;GACJ;GACA,MAAM;GACN,MAAM;GACN,UAAU;EACZ,CACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ;GACN;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;IACX;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;IACX;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;EACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ;GACN;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,SAAS;KACT,SAAS;IACX;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;EACF;EACA,aAAa;EACb,UAAU;EACV,YAAY;CACd;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ;GACN;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;IACX;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;IACX;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;IACX;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;IACX;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,SAAS;KACT,SAAS;IACX;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;EACF;EACA,aAAa;EACb,UAAU;EACV,YAAY;CACd;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ;GACN;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;IACX;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;IACX;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,SAAS;KACT,SAAS;IACX;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ,EACN,MAAM,wCACR;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;MAAC;MAAW;MAAa;MAAa;MAAU;KAAW;KACjE,MAAM;IACR;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,QAAQ;IACV;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,QAAQ;IACV;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;EACF;EACA,aAAa;EACb,UAAU;EACV,YAAY;CACd;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ;GACN;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;IACX;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;IACX;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;IACX;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,SAAS;KACT,SAAS;IACX;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;EACF;EACA,aAAa;EACb,UAAU;EACV,YAAY;CACd;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ;GACN;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;IACX;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;IACX;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,SAAS;KACT,kBAAkB;IACpB;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;EACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ;GACN;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;IACX;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,SAAS;KACT,kBAAkB;IACpB;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM,CAAC,WAAW,WAAW;KAC7B,MAAM;IACR;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;EACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ;GACN;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;IACX;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,SAAS;KACT,kBAAkB;IACpB;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ,EACN,MAAM,wCACR;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;EACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,UAAU,CACR,EACE,QAAQ,CAAC,EACX,GACA,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ;GACN;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;IACX;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aACE;IACJ;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,WAAW;KACX,WAAW;IACb;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,WAAW;KACX,QAAQ;IACV;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ,EACN,MAAM,UACR;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,UAAU;KACV,UAAU;KACV,OAAO,EACL,MAAM,wCACR;IACF;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ,EACN,OAAO,EACT;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ,EACN,OAAO,CACL;KACE,MAAM;KACN,YAAY,EACV,MAAM,EACJ,OAAO,MACT,EACF;KACA,UAAU,CAAC,MAAM;KACjB,sBAAsB;IACxB,GACA;KACE,MAAM;KACN,YAAY;MACV,MAAM,EACJ,OAAO,WACT;MACA,OAAO;OACL,MAAM;OACN,UAAU;OACV,UAAU;OACV,OAAO;QACL,MAAM;QACN,SAAS;OACX;MACF;KACF;KACA,UAAU,CAAC,QAAQ,OAAO;KAC1B,sBAAsB;IACxB,CACF,EACF;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ,EACN,OAAO,CACL;KACE,MAAM;KACN,YAAY,EACV,MAAM,EACJ,OAAO,MACT,EACF;KACA,UAAU,CAAC,MAAM;KACjB,sBAAsB;IACxB,GACA;KACE,MAAM;KACN,YAAY;MACV,MAAM,EACJ,OAAO,WACT;MACA,OAAO;OACL,MAAM;OACN,UAAU;OACV,UAAU;OACV,OAAO;QACL,MAAM;QACN,WAAW;QACX,WAAW;OACb;MACF;KACF;KACA,UAAU,CAAC,QAAQ,OAAO;KAC1B,sBAAsB;IACxB,CACF,EACF;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,aAAa;IACf;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;GACA;IACE,MAAM;IACN,UAAU;IACV,UAAU;IACV,QAAQ;KACN,MAAM;KACN,SAAS;KACT,SAAS;KACT,kBAAkB;IACpB;IACA,MAAM;IACN,MAAM;IACN,UAAU;GACZ;EACF;EACA,aAAa;EACb,UAAU;CACZ;CACA;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,SAAS;EACT,aACE;EACF,UAAU,CACR,EACE,OAAO,CAAC,EACV,CACF;EACA,QAAQ,CAAC;EACT,aAAa;EACb,UAAU;CACZ;AACF;AACA,MAAM,UAAsC;CAC1C,gBAAgB,EACd,OAAO;EACL,EACE,MAAM,0CACR;EACA,EACE,MAAM,4CACR;EACA,EACE,MAAM,6CACR;EACA,EACE,MAAM,0CACR;CACF,EACF;CACA,oBAAoB;EAClB,MAAM;EACN,YAAY;GACV,MAAM,EACJ,OAAO,OACT;GACA,KAAK;IACH,MAAM;IACN,WAAW;IACX,WAAW;IACX,aAAa;GACf;GACA,UAAU;IACR,MAAM;KAAC;KAAO;KAAO;IAAM;IAC3B,MAAM;IACN,SAAS;GACX;GACA,QAAQ;IACN,MAAM;IACN,UAAU;IACV,UAAU;IACV,OAAO;KACL,MAAM;KACN,WAAW;IACb;GACF;EACF;EACA,UAAU;GAAC;GAAQ;GAAO;EAAQ;CACpC;CACA,sBAAsB;EACpB,MAAM;EACN,YAAY;GACV,MAAM,EACJ,OAAO,SACT;GACA,KAAK;IACH,MAAM;IACN,WAAW;IACX,WAAW;IACX,aAAa;GACf;GACA,UAAU,EACR,MAAM,0CACR;GACA,OAAO,EACL,MAAM,SACR;EACF;EACA,UAAU;GAAC;GAAQ;GAAO;GAAY;EAAO;CAC/C;CACA,oBAAoB;EAClB,MAAM;GACJ;GACA;GACA;GACA;GACA;GACA;EACF;EACA,MAAM;CACR;CACA,uBAAuB;EACrB,MAAM;EACN,YAAY;GACV,MAAM,EACJ,OAAO,UACT;GACA,KAAK;IACH,MA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