{"version":3,"file":"manifest-builder-DoEN7q--.mjs","names":[],"sources":["../src/i18n/normalize.ts","../src/migrations/manifest.ts","../src/migrations/integration-metadata.ts","../src/migrations/manifest-builder.ts"],"sourcesContent":["import type { I18nConfig } from \"./config.js\";\n\nexport interface AstroLocaleObject {\n\tpath: string;\n\tcodes: readonly string[];\n}\n\nexport interface AstroI18nInput {\n\tdefaultLocale: string;\n\tlocales: readonly (string | AstroLocaleObject)[];\n\tfallback?: Readonly<Record<string, string | undefined>>;\n\trouting?: string | { prefixDefaultLocale?: boolean };\n}\n\nexport function normalizeAstroI18n(config: AstroI18nInput | null | undefined): I18nConfig | null {\n\tif (!config) return null;\n\n\treturn {\n\t\tdefaultLocale: config.defaultLocale,\n\t\tlocales: config.locales.map((locale) => (typeof locale === \"string\" ? locale : locale.path)),\n\t\tfallback: config.fallback\n\t\t\t? Object.fromEntries(\n\t\t\t\t\tObject.entries(config.fallback).filter(\n\t\t\t\t\t\t(entry): entry is [string, string] => entry[1] !== undefined,\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t: undefined,\n\t\tprefixDefaultLocale:\n\t\t\ttypeof config.routing === \"object\" ? (config.routing.prefixDefaultLocale ?? false) : false,\n\t};\n}\n","import { z } from \"zod\";\n\nimport type { CoreMigrationIdentity } from \"./identity.js\";\nimport { fingerprintMigrationSet } from \"./identity.js\";\n\nconst FINGERPRINT_PATTERN = /^[0-9a-f]{64}$/;\nconst MIGRATION_NAME_PATTERN = /^\\d{3}_[a-z0-9_]+$/;\nconst EXECUTOR_ENTRYPOINT_PATTERN =\n\t/^(?:@[a-z0-9][a-z0-9._-]*\\/)?[a-z0-9][a-z0-9._-]*(?:\\/[A-Za-z0-9][A-Za-z0-9._-]*)*$/;\nconst ENVIRONMENT_VARIABLE_PATTERN = /^[A-Za-z_][A-Za-z0-9_]*$/;\nconst ENVIRONMENT_REFERENCE_KEY_PATTERN = /(?:env|envName|envVar)$/i;\nconst URL_SCHEME_PATTERN = /^[A-Za-z][A-Za-z0-9+.-]*:/;\nconst SECRET_QUERY_KEY_PATTERN = /(?:auth|credential|key|password|secret|signature|token)/i;\nconst SECRET_CONFIG_KEY_PATTERN =\n\t/(?:accessToken|apiKey|authToken|certificate|connectionString|password|privateKey|secret)/i;\nconst SECRET_CONFIG_EXACT_KEY_PATTERN = /^(?:ca|cert|key)$/i;\nconst CONNECTION_URL_PROTOCOLS = new Set([\"mysql:\", \"postgres:\", \"postgresql:\"]);\n\ntype JsonPrimitive = boolean | number | string | null;\ntype JsonValue = JsonPrimitive | JsonValue[] | { [key: string]: JsonValue };\n\nconst i18nConfigSchema = z\n\t.object({\n\t\tdefaultLocale: z.string().min(1),\n\t\tlocales: z.array(z.string().min(1)).min(1),\n\t\tfallback: z.record(z.string(), z.string()).optional(),\n\t\tprefixDefaultLocale: z.boolean().optional(),\n\t})\n\t.strict();\n\nexport const migrationManifestV1Schema = z\n\t.object({\n\t\tschemaVersion: z.literal(1),\n\t\temdashVersion: z.string().min(1),\n\t\tmigrationSet: z\n\t\t\t.object({\n\t\t\t\tnames: z\n\t\t\t\t\t.array(z.string().regex(MIGRATION_NAME_PATTERN))\n\t\t\t\t\t.min(1)\n\t\t\t\t\t.refine((names) => new Set(names).size === names.length),\n\t\t\t\tfingerprint: z.string().regex(FINGERPRINT_PATTERN),\n\t\t\t})\n\t\t\t.strict(),\n\t\ti18n: i18nConfigSchema.nullable(),\n\t\tdatabase: z\n\t\t\t.object({\n\t\t\t\ttype: z.enum([\"sqlite\", \"postgres\"]),\n\t\t\t\texecutorEntrypoint: z.string().regex(EXECUTOR_ENTRYPOINT_PATTERN),\n\t\t\t\texecutorConfig: z.unknown(),\n\t\t\t})\n\t\t\t.strict(),\n\t})\n\t.strict();\n\nexport type MigrationManifestV1 = z.infer<typeof migrationManifestV1Schema>;\n\nexport class MigrationManifestValidationError extends Error {\n\tconstructor(message: string) {\n\t\tsuper(`Invalid migration manifest: ${message}`);\n\t\tthis.name = \"MigrationManifestValidationError\";\n\t}\n}\n\nfunction isEnvironmentReferenceKey(key: string): boolean {\n\treturn ENVIRONMENT_REFERENCE_KEY_PATTERN.test(key);\n}\n\nfunction assertSafeUrl(value: string, path: string): void {\n\tif (!URL_SCHEME_PATTERN.test(value)) return;\n\n\tlet url: URL;\n\ttry {\n\t\turl = new URL(value);\n\t} catch {\n\t\tthrow new MigrationManifestValidationError(`${path} contains an invalid URL`);\n\t}\n\n\tif (CONNECTION_URL_PROTOCOLS.has(url.protocol)) {\n\t\tthrow new MigrationManifestValidationError(`${path} contains a database connection URL`);\n\t}\n\tif (url.username || url.password) {\n\t\tthrow new MigrationManifestValidationError(`${path} contains URL credentials`);\n\t}\n\tfor (const key of url.searchParams.keys()) {\n\t\tif (SECRET_QUERY_KEY_PATTERN.test(key)) {\n\t\t\tthrow new MigrationManifestValidationError(`${path} contains a credential query parameter`);\n\t\t}\n\t}\n}\n\nfunction cloneSecretFreeJson(value: unknown, path: string, ancestors: Set<object>): JsonValue {\n\tif (value === null || typeof value === \"boolean\") return value;\n\tif (typeof value === \"string\") {\n\t\tassertSafeUrl(value, path);\n\t\treturn value;\n\t}\n\tif (typeof value === \"number\") {\n\t\tif (Number.isFinite(value)) return value;\n\t\tthrow new MigrationManifestValidationError(`${path} contains a non-finite number`);\n\t}\n\tif (typeof value !== \"object\") {\n\t\tthrow new MigrationManifestValidationError(`${path} is not JSON-serializable`);\n\t}\n\tif (ancestors.has(value)) {\n\t\tthrow new MigrationManifestValidationError(`${path} contains a cycle`);\n\t}\n\n\tancestors.add(value);\n\ttry {\n\t\tif (Array.isArray(value)) {\n\t\t\treturn value.map((item, index) => cloneSecretFreeJson(item, `${path}[${index}]`, ancestors));\n\t\t}\n\n\t\tconst prototype = Object.getPrototypeOf(value);\n\t\tif (prototype !== Object.prototype && prototype !== null) {\n\t\t\tthrow new MigrationManifestValidationError(`${path} contains a non-plain object`);\n\t\t}\n\n\t\tconst cloned: Record<string, JsonValue> = {};\n\t\tfor (const [key, item] of Object.entries(value)) {\n\t\t\tconst itemPath = `${path}.${key}`;\n\t\t\tconst environmentReference = isEnvironmentReferenceKey(key);\n\t\t\tif (\n\t\t\t\t!environmentReference &&\n\t\t\t\t(SECRET_CONFIG_KEY_PATTERN.test(key) || SECRET_CONFIG_EXACT_KEY_PATTERN.test(key))\n\t\t\t) {\n\t\t\t\tthrow new MigrationManifestValidationError(`${itemPath} is a credential-bearing field`);\n\t\t\t}\n\t\t\tif (environmentReference) {\n\t\t\t\tif (typeof item !== \"string\" || !ENVIRONMENT_VARIABLE_PATTERN.test(item)) {\n\t\t\t\t\tthrow new MigrationManifestValidationError(\n\t\t\t\t\t\t`${itemPath} must contain an environment-variable name`,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t\tcloned[key] = cloneSecretFreeJson(item, itemPath, ancestors);\n\t\t}\n\t\treturn cloned;\n\t} finally {\n\t\tancestors.delete(value);\n\t}\n}\n\nexport function validateSecretFreeExecutorConfig(\n\tvalue: unknown,\n\tpath = \"database.executorConfig\",\n): unknown {\n\treturn cloneSecretFreeJson(value, path, new Set());\n}\n\nfunction identitiesMatch(\n\tmanifest: MigrationManifestV1,\n\texpectedIdentity: CoreMigrationIdentity,\n): boolean {\n\treturn (\n\t\tmanifest.emdashVersion === expectedIdentity.emdashVersion &&\n\t\tmanifest.migrationSet.fingerprint === expectedIdentity.fingerprint &&\n\t\tmanifest.migrationSet.names.length === expectedIdentity.names.length &&\n\t\tmanifest.migrationSet.names.every((name, index) => name === expectedIdentity.names[index])\n\t);\n}\n\nexport async function validateMigrationManifest(\n\tvalue: unknown,\n\texpectedIdentity?: CoreMigrationIdentity,\n): Promise<MigrationManifestV1> {\n\tconst parsed = migrationManifestV1Schema.safeParse(value);\n\tif (!parsed.success) {\n\t\tthrow new MigrationManifestValidationError(\"schema validation failed\");\n\t}\n\n\tconst executorConfig = validateSecretFreeExecutorConfig(parsed.data.database.executorConfig);\n\tconst manifest: MigrationManifestV1 = {\n\t\t...parsed.data,\n\t\tdatabase: { ...parsed.data.database, executorConfig },\n\t};\n\tconst fingerprint = await fingerprintMigrationSet(\n\t\tmanifest.emdashVersion,\n\t\tmanifest.migrationSet.names,\n\t);\n\tif (fingerprint !== manifest.migrationSet.fingerprint) {\n\t\tthrow new MigrationManifestValidationError(\n\t\t\t\"migrationSet fingerprint does not match its version and ordered names\",\n\t\t);\n\t}\n\tif (expectedIdentity && !identitiesMatch(manifest, expectedIdentity)) {\n\t\tthrow new MigrationManifestValidationError(\n\t\t\t\"manifest does not match the loaded EmDash migration identity\",\n\t\t);\n\t}\n\n\treturn manifest;\n}\n\nexport function serializeMigrationManifest(manifest: MigrationManifestV1): string {\n\treturn `${JSON.stringify(manifest, null, \"\\t\")}\\n`;\n}\n","import type { DatabaseDescriptor } from \"../db/adapters.js\";\nimport { validateSecretFreeExecutorConfig } from \"./manifest.js\";\n\nexport const MIGRATION_CONFIG_SYMBOL = Symbol.for(\"emdash:migration-config\");\n\nexport interface MigrationIntegrationMetadata {\n\tdatabase?: Pick<DatabaseDescriptor, \"type\" | \"migrations\">;\n}\n\nfunction isRecord(value: unknown): value is Record<PropertyKey, unknown> {\n\treturn typeof value === \"object\" && value !== null;\n}\n\nfunction isMigrationIntegrationMetadata(value: unknown): value is MigrationIntegrationMetadata {\n\tif (!isRecord(value)) return false;\n\tconst database = value.database;\n\tif (database === undefined) return true;\n\tif (!isRecord(database) || (database.type !== \"sqlite\" && database.type !== \"postgres\")) {\n\t\treturn false;\n\t}\n\n\tconst migrations = database.migrations;\n\treturn (\n\t\tmigrations === undefined ||\n\t\t(isRecord(migrations) &&\n\t\t\ttypeof migrations.entrypoint === \"string\" &&\n\t\t\tObject.hasOwn(migrations, \"manifestConfig\"))\n\t);\n}\n\nexport function createMigrationIntegrationMetadata(\n\tdatabase?: DatabaseDescriptor,\n): MigrationIntegrationMetadata {\n\tif (!database) return {};\n\n\treturn {\n\t\tdatabase: {\n\t\t\ttype: database.type,\n\t\t\tmigrations: database.migrations\n\t\t\t\t? {\n\t\t\t\t\t\tentrypoint: database.migrations.entrypoint,\n\t\t\t\t\t\tmanifestConfig: validateSecretFreeExecutorConfig(\n\t\t\t\t\t\t\tdatabase.migrations.manifestConfig,\n\t\t\t\t\t\t\t\"database.migrations.manifestConfig\",\n\t\t\t\t\t\t),\n\t\t\t\t\t}\n\t\t\t\t: undefined,\n\t\t},\n\t};\n}\n\nexport function getMigrationIntegrationMetadata(\n\tintegration: unknown,\n): MigrationIntegrationMetadata | undefined {\n\tif (\n\t\t(typeof integration !== \"object\" || integration === null) &&\n\t\ttypeof integration !== \"function\"\n\t) {\n\t\treturn undefined;\n\t}\n\tif (!Object.hasOwn(integration, MIGRATION_CONFIG_SYMBOL)) {\n\t\treturn undefined;\n\t}\n\n\tconst metadata: unknown = Reflect.get(integration, MIGRATION_CONFIG_SYMBOL);\n\treturn isMigrationIntegrationMetadata(metadata) ? metadata : undefined;\n}\n","import type { DatabaseDescriptor } from \"../db/adapters.js\";\nimport type { I18nConfig } from \"../i18n/config.js\";\nimport type { CoreMigrationIdentity } from \"./identity.js\";\nimport { fingerprintMigrationSet } from \"./identity.js\";\nimport type { MigrationManifestV1 } from \"./manifest.js\";\nimport { MigrationManifestValidationError, validateMigrationManifest } from \"./manifest.js\";\n\nexport type ManifestDatabaseDescriptor = Pick<DatabaseDescriptor, \"type\" | \"migrations\">;\n\nexport interface BuildMigrationManifestOptions {\n\tidentity: CoreMigrationIdentity;\n\ti18n: I18nConfig | null;\n\tdatabase: ManifestDatabaseDescriptor;\n}\n\nexport class UnsupportedMigrationAdapterError extends Error {\n\tconstructor() {\n\t\tsuper(\"The configured database adapter does not provide a deployment migration executor\");\n\t\tthis.name = \"UnsupportedMigrationAdapterError\";\n\t}\n}\n\nexport async function buildMigrationManifest({\n\tidentity,\n\ti18n,\n\tdatabase,\n}: BuildMigrationManifestOptions): Promise<MigrationManifestV1> {\n\tconst identityFingerprint = await fingerprintMigrationSet(identity.emdashVersion, identity.names);\n\tif (identityFingerprint !== identity.fingerprint) {\n\t\tthrow new MigrationManifestValidationError(\n\t\t\t\"loaded identity fingerprint does not match its version and ordered names\",\n\t\t);\n\t}\n\tif (!database.migrations) {\n\t\tthrow new UnsupportedMigrationAdapterError();\n\t}\n\n\treturn validateMigrationManifest(\n\t\t{\n\t\t\tschemaVersion: 1,\n\t\t\temdashVersion: identity.emdashVersion,\n\t\t\tmigrationSet: {\n\t\t\t\tnames: [...identity.names],\n\t\t\t\tfingerprint: identity.fingerprint,\n\t\t\t},\n\t\t\ti18n,\n\t\t\tdatabase: {\n\t\t\t\ttype: database.type,\n\t\t\t\texecutorEntrypoint: database.migrations.entrypoint,\n\t\t\t\texecutorConfig: database.migrations.manifestConfig,\n\t\t\t},\n\t\t},\n\t\tidentity,\n\t);\n}\n"],"mappings":";;;;AAcA,SAAgB,mBAAmB,QAA8D;AAChG,KAAI,CAAC,OAAQ,QAAO;AAEpB,QAAO;EACN,eAAe,OAAO;EACtB,SAAS,OAAO,QAAQ,KAAK,WAAY,OAAO,WAAW,WAAW,SAAS,OAAO,KAAM;EAC5F,UAAU,OAAO,WACd,OAAO,YACP,OAAO,QAAQ,OAAO,SAAS,CAAC,QAC9B,UAAqC,MAAM,OAAO,OACnD,CACD,GACA;EACH,qBACC,OAAO,OAAO,YAAY,WAAY,OAAO,QAAQ,uBAAuB,QAAS;EACtF;;;;;ACxBF,MAAM,sBAAsB;AAC5B,MAAM,yBAAyB;AAC/B,MAAM,8BACL;AACD,MAAM,+BAA+B;AACrC,MAAM,oCAAoC;AAC1C,MAAM,qBAAqB;AAC3B,MAAM,2BAA2B;AACjC,MAAM,4BACL;AACD,MAAM,kCAAkC;AACxC,MAAM,2BAA2B,IAAI,IAAI;CAAC;CAAU;CAAa;CAAc,CAAC;AAKhF,MAAM,mBAAmB,EACvB,OAAO;CACP,eAAe,EAAE,QAAQ,CAAC,IAAI,EAAE;CAChC,SAAS,EAAE,MAAM,EAAE,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE;CAC1C,U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