@ankhorage/infra 3.3.0 → 4.0.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 CHANGED
@@ -1,5 +1,11 @@
1
1
  # @ankhorage/infra
2
2
 
3
+ ## 4.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - 82e969e: Align infrastructure generation with canonical `infra.apis[]`, remove generated-API database projection and public generator exports, treat external APIs as infrastructure no-ops, and report internal API provisioning as unsupported in Phase 1.
8
+
3
9
  ## 3.3.0
4
10
 
5
11
  ### Minor Changes
package/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
 
4
4
  # INFRA
5
5
 
6
- ![license: MIT](././paradox/badges/license.svg) ![npm: v3.2.0](././paradox/badges/npm.svg) ![runtime: bun](././paradox/badges/runtime.svg) ![typescript: strict](././paradox/badges/typescript.svg) ![eslint: checked](././paradox/badges/eslint.svg) ![prettier: checked](././paradox/badges/prettier.svg) ![build: checked](././paradox/badges/build.svg) ![tests: checked](././paradox/badges/tests.svg) ![docs: paradox](././paradox/badges/docs.svg)
6
+ ![license: MIT](././paradox/badges/license.svg) ![npm: v3.3.0](././paradox/badges/npm.svg) ![runtime: bun](././paradox/badges/runtime.svg) ![typescript: strict](././paradox/badges/typescript.svg) ![eslint: checked](././paradox/badges/eslint.svg) ![prettier: checked](././paradox/badges/prettier.svg) ![build: checked](././paradox/badges/build.svg) ![tests: checked](././paradox/badges/tests.svg) ![docs: paradox](././paradox/badges/docs.svg)
7
7
 
8
8
  Executable infra provider and standalone CLI for Ankhorage project workflows.
9
9
 
@@ -45,12 +45,6 @@ import { runCli } from './cli/bin.js';
45
45
  await runCli(['--help']);
46
46
  ```
47
47
 
48
- ## Installation
49
-
50
- ```bash
51
- bunx @ankhorage/infra
52
- ```
53
-
54
48
  ## Generated documentation
55
49
 
56
50
  - [Interactive documentation app](././paradox/index.html)
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/adapters/minikube/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAEV,kBAAkB,EAClB,+BAA+B,EAC/B,8BAA8B,EAC/B,MAAM,aAAa,CAAC;AAUrB,wBAAgB,qBAAqB,CACnC,QAAQ,EAAE,kBAAkB,EAC5B,OAAO,GAAE,+BAAoC,GAC5C,8BAA8B,CAsGhC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/adapters/minikube/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAEV,kBAAkB,EAClB,+BAA+B,EAC/B,8BAA8B,EAC/B,MAAM,aAAa,CAAC;AAUrB,wBAAgB,qBAAqB,CACnC,QAAQ,EAAE,kBAAkB,EAC5B,OAAO,GAAE,+BAAoC,GAC5C,8BAA8B,CAmFhC"}
@@ -1,4 +1,4 @@
1
- import { generateGeneratedApiDatabaseArtifacts } from '../../generatedApiDatabase';
1
+ import { validateInfraApiSupport } from '../../infraValidation';
2
2
  import { generateAuthProviderArtifacts } from './auth';
3
3
  import { generateAuthorizationArtifacts } from './authz';
4
4
  import { APP_NAMESPACE, generateMinikubeBaseArtifacts } from './base';
@@ -27,16 +27,6 @@ export function generateMinikubeInfra(manifest, options = {}) {
27
27
  });
28
28
  const storageArtifacts = generateStorageArtifacts({ manifest, namespace });
29
29
  const secretStoreArtifacts = generateSecretStoreArtifacts({ manifest, namespace });
30
- const generatedApiDatabaseArtifacts = generateGeneratedApiDatabaseArtifacts({
31
- generatedApis: options.appManifest?.generatedApis,
32
- databaseProvider: manifest.database?.provider,
33
- });
34
- const generatedApiErrors = generatedApiDatabaseArtifacts.diagnostics.filter((diagnostic) => diagnostic.severity === 'error');
35
- if (generatedApiErrors.length > 0) {
36
- throw new Error(`Generated API database definition is invalid:\n${generatedApiErrors
37
- .map((diagnostic) => `- ${diagnostic.path ?? diagnostic.apiId}: ${diagnostic.message}`)
38
- .join('\n')}`);
39
- }
40
30
  const extraResources = unique([
41
31
  ...authArtifacts.resources,
42
32
  ...authzArtifacts.resources,
@@ -72,9 +62,6 @@ export function generateMinikubeInfra(manifest, options = {}) {
72
62
  ...authzArtifacts.warnings,
73
63
  ...storageArtifacts.warnings,
74
64
  ...secretStoreArtifacts.warnings,
75
- ...generatedApiDatabaseArtifacts.diagnostics
76
- .filter((diagnostic) => diagnostic.severity === 'warning')
77
- .map((diagnostic) => diagnostic.message),
78
65
  ]);
79
66
  return {
80
67
  files: [
@@ -83,7 +70,6 @@ export function generateMinikubeInfra(manifest, options = {}) {
83
70
  ...authzArtifacts.files,
84
71
  ...storageArtifacts.files,
85
72
  ...secretStoreArtifacts.files,
86
- ...generatedApiDatabaseArtifacts.files,
87
73
  ],
88
74
  warnings,
89
75
  meta: {
@@ -123,7 +109,7 @@ function collectDependencies(manifest) {
123
109
  ];
124
110
  }
125
111
  function collectWarnings(manifest) {
126
- const warnings = [];
112
+ const warnings = [...validateInfraApiSupport(manifest)];
127
113
  if (manifest.deployment?.monitoring) {
128
114
  warnings.push('Monitoring is enabled in manifest, but monitoring stack resources are not generated yet.');
129
115
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/adapters/minikube/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qCAAqC,EAAE,MAAM,4BAA4B,CAAC;AAOnF,OAAO,EAAE,6BAA6B,EAAE,MAAM,QAAQ,CAAC;AACvD,OAAO,EAAE,8BAA8B,EAAE,MAAM,SAAS,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,6BAA6B,EAAE,MAAM,QAAQ,CAAC;AACtE,OAAO,EAAE,4BAA4B,EAAE,MAAM,WAAW,CAAC;AACzD,OAAO,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAC;AAErD,MAAM,yBAAyB,GAAG,wCAAwC,CAAC;AAC3E,MAAM,mBAAmB,GAAG,IAAI,GAAG,CAAC,CAAC,aAAa,EAAE,UAAU,CAAC,CAAC,CAAC;AAEjE,MAAM,UAAU,qBAAqB,CACn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;IAED,IAAI,IAAI,CAAC,IAAI,EAAE,KAAK,IAAI,IAAI,CAAC,yBAAyB,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;QAClE,MAAM,IAAI,KAAK,CACb,kMAAkM,CACnM,CAAC;IACJ,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC;AAED,SAAS,MAAM,CAAC,MAAgB;IAC9B,OAAO,CAAC,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC;AAC9B,CAAC","sourcesContent":["import { generateGeneratedApiDatabaseArtifacts } from '../../generatedApiDatabase';\nimport type {\n GeneratedPackageDependency,\n InfraManifestInput,\n InfrastructureGenerationOptions,\n InfrastructureGenerationResult,\n} from '../../types';\nimport { generateAuthProviderArtifacts } from './auth';\nimport { generateAuthorizationArtifacts } from './authz';\nimport { APP_NAMESPACE, generateMinikubeBaseArtifacts } from './base';\nimport { generateSecretStoreArtifacts } from './secrets';\nimport { generateStorageArtifacts } from './storage';\n\nconst CANONICAL_PROJECT_SLUG_RE = /^[a-z0-9](?:[a-z0-9-]{0,38}[a-z0-9])?$/;\nconst BUILT_IN_NAMESPACES = new Set([APP_NAMESPACE, 'supabase']);\n\nexport function generateMinikubeInfra(\n manifest: InfraManifestInput,\n options: InfrastructureGenerationOptions = {},\n): InfrastructureGenerationResult {\n if (manifest.deployment?.target !== 'minikube') {\n throw new Error(\n `Minikube adapter only supports deployment target \"minikube\" (received \"${manifest.deployment?.target ?? 'undefined'}\").`,\n );\n }\n\n if (manifest.database?.provider && manifest.database.provider !== 'supabase') {\n throw new Error(\n `Unsupported database provider for minikube adapter: \"${manifest.database.provider}\". Only \"supabase\" is implemented.`,\n );\n }\n\n const appSlug = validateCanonicalAppSlug(options.appManifest?.metadata.slug);\n const namespace = APP_NAMESPACE;\n\n const authArtifacts = generateAuthProviderArtifacts({\n appManifest: options.appManifest,\n manifest,\n namespace,\n });\n const authzArtifacts = generateAuthorizationArtifacts({\n manifest,\n namespace,\n appManifest: options.appManifest,\n });\n const storageArtifacts = generateStorageArtifacts({ manifest, namespace });\n const secretStoreArtifacts = generateSecretStoreArtifacts({ manifest, namespace });\n const generatedApiDatabaseArtifacts = generateGeneratedApiDatabaseArtifacts({\n generatedApis: options.appManifest?.generatedApis,\n databaseProvider: manifest.database?.provider,\n });\n const generatedApiErrors = generatedApiDatabaseArtifacts.diagnostics.filter(\n (diagnostic) => diagnostic.severity === 'error',\n );\n\n if (generatedApiErrors.length > 0) {\n throw new Error(\n `Generated API database definition is invalid:\\n${generatedApiErrors\n .map((diagnostic) => `- ${diagnostic.path ?? diagnostic.apiId}: ${diagnostic.message}`)\n .join('\\n')}`,\n );\n }\n\n const extraResources = unique([\n ...authArtifacts.resources,\n ...authzArtifacts.resources,\n ...storageArtifacts.resources,\n ...secretStoreArtifacts.resources,\n ]);\n const providerLifecycle = [\n ...authArtifacts.providerLifecycle,\n ...authzArtifacts.providerLifecycle,\n ...storageArtifacts.providerLifecycle,\n ...secretStoreArtifacts.providerLifecycle,\n ];\n const providerNamespaces = unique([\n ...providerLifecycle.map((contribution) => contribution.namespace),\n ]).filter((providerNamespace) => !BUILT_IN_NAMESPACES.has(providerNamespace));\n const extraEnvEntries = unique([\n ...authArtifacts.envEntries,\n ...authzArtifacts.envEntries,\n ...storageArtifacts.envEntries,\n ...secretStoreArtifacts.envEntries,\n ]);\n\n const baseFiles = generateMinikubeBaseArtifacts({\n manifest,\n appSlug,\n extraResources,\n providerNamespaces,\n providerLifecycle,\n extraEnvEntries,\n });\n\n const warnings = unique([\n ...collectWarnings(manifest),\n ...authArtifacts.warnings,\n ...authzArtifacts.warnings,\n ...storageArtifacts.warnings,\n ...secretStoreArtifacts.warnings,\n ...generatedApiDatabaseArtifacts.diagnostics\n .filter((diagnostic) => diagnostic.severity === 'warning')\n .map((diagnostic) => diagnostic.message),\n ]);\n\n return {\n files: [\n ...baseFiles,\n ...authArtifacts.files,\n ...authzArtifacts.files,\n ...storageArtifacts.files,\n ...secretStoreArtifacts.files,\n ...generatedApiDatabaseArtifacts.files,\n ],\n warnings,\n meta: {\n target: 'minikube',\n providers: collectProviders(manifest),\n },\n dependencies: collectDependencies(manifest),\n };\n}\n\nfunction collectProviders(manifest: InfraManifestInput): string[] {\n const providers = new Set<string>();\n\n if (manifest.auth?.provider) providers.add(manifest.auth.provider);\n if (manifest.auth?.authorization?.engine) {\n providers.add(manifest.auth.authorization.engine);\n }\n if (manifest.database?.provider) providers.add(manifest.database.provider);\n if (manifest.storage?.provider) providers.add(manifest.storage.provider);\n if (manifest.secretStore?.provider) providers.add(manifest.secretStore.provider);\n if (manifest.state?.provider) providers.add(manifest.state.provider);\n\n return [...providers].sort();\n}\n\nfunction collectDependencies(manifest: InfraManifestInput): readonly GeneratedPackageDependency[] {\n if (manifest.state?.provider !== 'legend') {\n return [];\n }\n\n return [\n {\n name: '@ankhorage/state-legend',\n version: '^0.1.0',\n reason: 'Selected by infra.state.provider=legend.',\n },\n ];\n}\n\nfunction collectWarnings(manifest: InfraManifestInput): string[] {\n const warnings: string[] = [];\n\n if (manifest.deployment?.monitoring) {\n warnings.push(\n 'Monitoring is enabled in manifest, but monitoring stack resources are not generated yet.',\n );\n }\n\n if (manifest.networking?.cdn) {\n warnings.push('CDN is enabled in manifest, but CDN resources are not generated for minikube.');\n }\n\n return warnings;\n}\n\nfunction validateCanonicalAppSlug(slug: string | undefined): string {\n if (!slug) {\n throw new Error(\n 'Cannot generate Minikube infrastructure: appManifest.metadata.slug is required.',\n );\n }\n\n if (slug.trim() !== slug || !CANONICAL_PROJECT_SLUG_RE.test(slug)) {\n throw new Error(\n 'Cannot generate Minikube infrastructure: appManifest.metadata.slug must be a canonical lowercase slug up to 40 characters using only a-z, 0-9, and hyphens, without leading or trailing hyphens.',\n );\n }\n\n return slug;\n}\n\nfunction unique(values: string[]): string[] {\n return [...new Set(values)];\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/adapters/minikube/index.ts"],"names":[],"mappings":"AAA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C;AAC9B,CAAC","sourcesContent":["import { validateInfraApiSupport } from '../../infraValidation';\nimport type {\n GeneratedPackageDependency,\n InfraManifestInput,\n InfrastructureGenerationOptions,\n InfrastructureGenerationResult,\n} from '../../types';\nimport { generateAuthProviderArtifacts } from './auth';\nimport { generateAuthorizationArtifacts } from './authz';\nimport { APP_NAMESPACE, generateMinikubeBaseArtifacts } from './base';\nimport { generateSecretStoreArtifacts } from './secrets';\nimport { generateStorageArtifacts } from './storage';\n\nconst CANONICAL_PROJECT_SLUG_RE = /^[a-z0-9](?:[a-z0-9-]{0,38}[a-z0-9])?$/;\nconst BUILT_IN_NAMESPACES = new Set([APP_NAMESPACE, 'supabase']);\n\nexport function generateMinikubeInfra(\n manifest: InfraManifestInput,\n options: InfrastructureGenerationOptions = {},\n): InfrastructureGenerationResult {\n if (manifest.deployment?.target !== 'minikube') {\n throw new Error(\n `Minikube adapter only supports deployment target \"minikube\" (received \"${manifest.deployment?.target ?? 'undefined'}\").`,\n );\n }\n\n if (manifest.database?.provider && manifest.database.provider !== 'supabase') {\n throw new Error(\n `Unsupported database provider for minikube adapter: \"${manifest.database.provider}\". Only \"supabase\" is implemented.`,\n );\n }\n\n const appSlug = validateCanonicalAppSlug(options.appManifest?.metadata.slug);\n const namespace = APP_NAMESPACE;\n\n const authArtifacts = generateAuthProviderArtifacts({\n appManifest: options.appManifest,\n manifest,\n namespace,\n });\n const authzArtifacts = generateAuthorizationArtifacts({\n manifest,\n namespace,\n appManifest: options.appManifest,\n });\n const storageArtifacts = generateStorageArtifacts({ manifest, namespace });\n const secretStoreArtifacts = generateSecretStoreArtifacts({ manifest, namespace });\n\n const extraResources = unique([\n ...authArtifacts.resources,\n ...authzArtifacts.resources,\n ...storageArtifacts.resources,\n ...secretStoreArtifacts.resources,\n ]);\n const providerLifecycle = [\n ...authArtifacts.providerLifecycle,\n ...authzArtifacts.providerLifecycle,\n ...storageArtifacts.providerLifecycle,\n ...secretStoreArtifacts.providerLifecycle,\n ];\n const providerNamespaces = unique([\n ...providerLifecycle.map((contribution) => contribution.namespace),\n ]).filter((providerNamespace) => !BUILT_IN_NAMESPACES.has(providerNamespace));\n const extraEnvEntries = unique([\n ...authArtifacts.envEntries,\n ...authzArtifacts.envEntries,\n ...storageArtifacts.envEntries,\n ...secretStoreArtifacts.envEntries,\n ]);\n\n const baseFiles = generateMinikubeBaseArtifacts({\n manifest,\n appSlug,\n extraResources,\n providerNamespaces,\n providerLifecycle,\n extraEnvEntries,\n });\n\n const warnings = unique([\n ...collectWarnings(manifest),\n ...authArtifacts.warnings,\n ...authzArtifacts.warnings,\n ...storageArtifacts.warnings,\n ...secretStoreArtifacts.warnings,\n ]);\n\n return {\n files: [\n ...baseFiles,\n ...authArtifacts.files,\n ...authzArtifacts.files,\n ...storageArtifacts.files,\n ...secretStoreArtifacts.files,\n ],\n warnings,\n meta: {\n target: 'minikube',\n providers: collectProviders(manifest),\n },\n dependencies: collectDependencies(manifest),\n };\n}\n\nfunction collectProviders(manifest: InfraManifestInput): string[] {\n const providers = new Set<string>();\n\n if (manifest.auth?.provider) providers.add(manifest.auth.provider);\n if (manifest.auth?.authorization?.engine) {\n providers.add(manifest.auth.authorization.engine);\n }\n if (manifest.database?.provider) providers.add(manifest.database.provider);\n if (manifest.storage?.provider) providers.add(manifest.storage.provider);\n if (manifest.secretStore?.provider) providers.add(manifest.secretStore.provider);\n if (manifest.state?.provider) providers.add(manifest.state.provider);\n\n return [...providers].sort();\n}\n\nfunction collectDependencies(manifest: InfraManifestInput): readonly GeneratedPackageDependency[] {\n if (manifest.state?.provider !== 'legend') {\n return [];\n }\n\n return [\n {\n name: '@ankhorage/state-legend',\n version: '^0.1.0',\n reason: 'Selected by infra.state.provider=legend.',\n },\n ];\n}\n\nfunction collectWarnings(manifest: InfraManifestInput): string[] {\n const warnings = [...validateInfraApiSupport(manifest)];\n\n if (manifest.deployment?.monitoring) {\n warnings.push(\n 'Monitoring is enabled in manifest, but monitoring stack resources are not generated yet.',\n );\n }\n\n if (manifest.networking?.cdn) {\n warnings.push('CDN is enabled in manifest, but CDN resources are not generated for minikube.');\n }\n\n return warnings;\n}\n\nfunction validateCanonicalAppSlug(slug: string | undefined): string {\n if (!slug) {\n throw new Error(\n 'Cannot generate Minikube infrastructure: appManifest.metadata.slug is required.',\n );\n }\n\n if (slug.trim() !== slug || !CANONICAL_PROJECT_SLUG_RE.test(slug)) {\n throw new Error(\n 'Cannot generate Minikube infrastructure: appManifest.metadata.slug must be a canonical lowercase slug up to 40 characters using only a-z, 0-9, and hyphens, without leading or trailing hyphens.',\n );\n }\n\n return slug;\n}\n\nfunction unique(values: string[]): string[] {\n return [...new Set(values)];\n}\n"]}
package/dist/index.d.ts CHANGED
@@ -1,6 +1,5 @@
1
1
  import type { InfraGenerationInput, InfraManifestInput, InfrastructureGenerationOptions, InfrastructureGenerationResult } from './types';
2
2
  export { type AuthRedirectConfiguration, type AuthRedirectEnvironment, getLocalAuthRedirectPatterns, normalizeAuthCallbackRoute, resolveAuthRedirectConfiguration, type ResolveAuthRedirectConfigurationInput, } from './authRedirects';
3
- export { type GeneratedApiDatabaseArtifacts, type GeneratedApiDatabaseDiagnostic, type GeneratedApiDatabaseDiagnosticCode, generateGeneratedApiDatabaseArtifacts, } from './generatedApiDatabase';
4
3
  export { createInfraSecretStoreAdapter, type CreateInfraSecretStoreAdapterInput, type InfraSecretStoreProviders, } from './secretStore';
5
4
  export type { GeneratedFile, GeneratedInfrastructureFile, GeneratedPackageDependency, InfraDiagnostic, InfraGenerationInput, InfraGenerationOptions, InfraGenerationResult, InfraManifestInput, InfrastructureGenerationMeta, InfrastructureGenerationOptions, InfrastructureGenerationResult, PackageDependency, } from './types';
6
5
  export declare function generateInfra(input: InfraGenerationInput): InfrastructureGenerationResult;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,oBAAoB,EACpB,kBAAkB,EAClB,+BAA+B,EAC/B,8B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AAe,EACf,oBAAoB,EACpB,sBAAsB,EACtB,qBAAqB,EACrB,kBAAkB,EAClB,4BAA4B,EAC5B,+BAA+B,EAC/B,8BAA8B,EAC9B,iBAAiB,GAClB,MAAM,SAAS,CAAC;AAEjB,wBAAgB,aAAa,CAAC,KAAK,EAAE,oBAAoB,GAAG,8BAA8B,CAEzF;AAED,wBAAgB,sBAAsB,CACpC,QAAQ,EAAE,kBAAkB,EAC5B,OAAO,GAAE,+BAAoC,GAC5C,8BAA8B,CAUhC"}
package/dist/index.js CHANGED
@@ -1,6 +1,5 @@
1
1
  import { generateMinikubeInfra } from './adapters/minikube';
2
2
  export { getLocalAuthRedirectPatterns, normalizeAuthCallbackRoute, resolveAuthRedirectConfiguration, } from './authRedirects';
3
- export { generateGeneratedApiDatabaseArtifacts, } from './generatedApiDatabase';
4
3
  export { createInfraSecretStoreAdapter, } from './secretStore';
5
4
  export function generateInfra(input) {
6
5
  return generateInfrastructure(input.manifest, input.options ?? {});
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAQ5D,OAAO,EAGL,4BAA4B,EAC5B,0BAA0B,EAC1B,gCAAgC,GAEjC,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAIL,qCAAqC,GACtC,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,6BAA6B,GAG9B,MAAM,eAAe,CAAC;AAgBvB,MAAM,UAAU,aAAa,CAAC,KAA2B;IACvD,OAAO,sBAAsB,CAAC,KAAK,CAAC,QAAQ,EAAE,KAAK,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC;AACrE,CAAC;AAED,MAAM,UAAU,sBAAsB,CACpC,QAA4B,EAC5B,UAA2C,EAAE;IAE7C,IAAI,CAAC,QAAQ,CAAC,UAAU,EAAE,CAAC;QACzB,MAAM,IAAI,KAAK,CAAC,sCAAsC,CAAC,CAAC;IAC1D,CAAC;IAED,IAAI,QAAQ,CAAC,UAAU,CAAC,MAAM,KAAK,UAAU,EAAE,CAAC;QAC9C,MAAM,IAAI,KAAK,CAAC,kCAAkC,QAAQ,CAAC,UAAU,CAAC,MAAM,EAAE,CAAC,CAAC;IAClF,CAAC;IAED,OAAO,qBAAqB,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;AAClD,CAAC","sourcesContent":["import { generateMinikubeInfra } from './adapters/minikube';\nimport type {\n InfraGenerationInput,\n InfraManifestInput,\n InfrastructureGenerationOptions,\n InfrastructureGenerationResult,\n} from './types';\n\nexport {\n type AuthRedirectConfiguration,\n type AuthRedirectEnvironment,\n getLocalAuthRedirectPatterns,\n normalizeAuthCallbackRoute,\n resolveAuthRedirectConfiguration,\n type ResolveAuthRedirectConfigurationInput,\n} from './authRedirects';\nexport {\n type GeneratedApiDatabaseArtifacts,\n type GeneratedApiDatabaseDiagnostic,\n type GeneratedApiDatabaseDiagnosticCode,\n generateGeneratedApiDatabaseArtifacts,\n} from './generatedApiDatabase';\nexport {\n createInfraSecretStoreAdapter,\n type CreateInfraSecretStoreAdapterInput,\n type InfraSecretStoreProviders,\n} from './secretStore';\nexport type {\n GeneratedFile,\n GeneratedInfrastructureFile,\n GeneratedPackageDependency,\n InfraDiagnostic,\n InfraGenerationInput,\n InfraGenerationOptions,\n InfraGenerationResult,\n InfraManifestInput,\n InfrastructureGenerationMeta,\n InfrastructureGenerationOptions,\n InfrastructureGenerationResult,\n PackageDependency,\n} from './types';\n\nexport function generateInfra(input: InfraGenerationInput): InfrastructureGenerationResult {\n return generateInfrastructure(input.manifest, input.options ?? {});\n}\n\nexport function generateInfrastructure(\n manifest: InfraManifestInput,\n options: InfrastructureGenerationOptions = {},\n): InfrastructureGenerationResult {\n if (!manifest.deployment) {\n throw new Error('Deployment configuration is missing.');\n }\n\n if (manifest.deployment.target !== 'minikube') {\n throw new Error(`Unsupported deployment target: ${manifest.deployment.target}`);\n }\n\n return generateMinikubeInfra(manifest, options);\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAQ5D,OAAO,EAGL,4BAA4B,EAC5B,0BAA0B,EAC1B,gCAAgC,GAEjC,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,6BAA6B,GAG9B,MAAM,eAAe,CAAC;AAgBvB,MAAM,UAAU,aAAa,CAAC,KAA2B;IACvD,OAAO,sBAAsB,CAAC,KAAK,CAAC,QAAQ,EAAE,KAAK,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC;AACrE,CAAC;AAED,MAAM,UAAU,sBAAsB,CACpC,QAA4B,EAC5B,UAA2C,EAAE;IAE7C,IAAI,CAAC,QAAQ,CAAC,UAAU,EAAE,CAAC;QACzB,MAAM,IAAI,KAAK,CAAC,sCAAsC,CAAC,CAAC;IAC1D,CAAC;IAED,IAAI,QAAQ,CAAC,UAAU,CAAC,MAAM,KAAK,UAAU,EAAE,CAAC;QAC9C,MAAM,IAAI,KAAK,CAAC,kCAAkC,QAAQ,CAAC,UAAU,CAAC,MAAM,EAAE,CAAC,CAAC;IAClF,CAAC;IAED,OAAO,qBAAqB,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;AAClD,CAAC","sourcesContent":["import { generateMinikubeInfra } from './adapters/minikube';\nimport type {\n InfraGenerationInput,\n InfraManifestInput,\n InfrastructureGenerationOptions,\n InfrastructureGenerationResult,\n} from './types';\n\nexport {\n type AuthRedirectConfiguration,\n type AuthRedirectEnvironment,\n getLocalAuthRedirectPatterns,\n normalizeAuthCallbackRoute,\n resolveAuthRedirectConfiguration,\n type ResolveAuthRedirectConfigurationInput,\n} from './authRedirects';\nexport {\n createInfraSecretStoreAdapter,\n type CreateInfraSecretStoreAdapterInput,\n type InfraSecretStoreProviders,\n} from './secretStore';\nexport type {\n GeneratedFile,\n GeneratedInfrastructureFile,\n GeneratedPackageDependency,\n InfraDiagnostic,\n InfraGenerationInput,\n InfraGenerationOptions,\n InfraGenerationResult,\n InfraManifestInput,\n InfrastructureGenerationMeta,\n InfrastructureGenerationOptions,\n InfrastructureGenerationResult,\n PackageDependency,\n} from './types';\n\nexport function generateInfra(input: InfraGenerationInput): InfrastructureGenerationResult {\n return generateInfrastructure(input.manifest, input.options ?? {});\n}\n\nexport function generateInfrastructure(\n manifest: InfraManifestInput,\n options: InfrastructureGenerationOptions = {},\n): InfrastructureGenerationResult {\n if (!manifest.deployment) {\n throw new Error('Deployment configuration is missing.');\n }\n\n if (manifest.deployment.target !== 'minikube') {\n throw new Error(`Unsupported deployment target: ${manifest.deployment.target}`);\n }\n\n return generateMinikubeInfra(manifest, options);\n}\n"]}
@@ -1,3 +1,4 @@
1
1
  import type { InfraManifestInput } from './types.js';
2
2
  export declare function validateInfraSupport(manifest: InfraManifestInput): readonly string[];
3
+ export declare function validateInfraApiSupport(manifest: InfraManifestInput): readonly string[];
3
4
  //# sourceMappingURL=infraValidation.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"infraValidation.d.ts","sourceRoot":"","sources":["../src/infraValidation.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAErD,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,kBAAkB,GAAG,SAAS,MAAM,EAAE,CA2DpF"}
1
+ {"version":3,"file":"infraValidation.d.ts","sourceRoot":"","sources":["../src/infraValidation.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAErD,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,kBAAkB,GAAG,SAAS,MAAM,EAAE,CA2DpF;AAED,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,kBAAkB,GAAG,SAAS,MAAM,EAAE,CAOvF"}
@@ -1,6 +1,6 @@
1
1
  import { AUTH_PROVIDERS, AUTH_SCOPES, AUTHZ_ENGINES, DATABASE_PROVIDERS, DEPLOYMENT_TARGETS, } from '@ankhorage/contracts';
2
2
  export function validateInfraSupport(manifest) {
3
- const warnings = [];
3
+ const warnings = [...validateInfraApiSupport(manifest)];
4
4
  const deploymentTarget = manifest.deployment?.target;
5
5
  if (deploymentTarget !== undefined && !isSupported(deploymentTarget, DEPLOYMENT_TARGETS)) {
6
6
  warnings.push(warningForUnsupportedValue({
@@ -43,6 +43,11 @@ export function validateInfraSupport(manifest) {
43
43
  }
44
44
  return warnings;
45
45
  }
46
+ export function validateInfraApiSupport(manifest) {
47
+ return (manifest.apis ?? [])
48
+ .filter((api) => api.origin === 'internal')
49
+ .map((api) => `infra.apis.${api.id} has origin "internal", but internal API provisioning is not supported in Phase 1; no API infrastructure will be generated.`);
50
+ }
46
51
  function warningForUnsupportedValue(args) {
47
52
  return `${args.path} "${args.value}" is not currently supported by implemented generators. Supported values: ${formatSupportedValues(args.supported)}.`;
48
53
  }
@@ -1 +1 @@
1
- {"version":3,"file":"infraValidation.js","sourceRoot":"","sources":["../src/infraValidation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,WAAW,EACX,aAAa,EACb,kBAAkB,EAClB,kBAAkB,GACnB,MAAM,sBAAsB,CAAC;AAI9B,MAAM,UAAU,oBAAoB,CAAC,QAA4B;IAC/D,MAAM,QAAQ,GAAa,EAAE,CAAC;IAE9B,MAAM,gBAAgB,GAAG,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IACrD,IAAI,gBAAgB,KAAK,SAAS,IAAI,CAAC,WAAW,CAAC,gBAAgB,EAAE,kBAAkB,CAAC,EAAE,CAAC;QACzF,QAAQ,CAAC,IAAI,CACX,0BAA0B,CAAC;YACzB,IAAI,EAAE,yBAAyB;YAC/B,KAAK,EAAE,gBAAgB;YACvB,SAAS,EAAE,kBAAkB;SAC9B,CAAC,CACH,CAAC;IACJ,CAAC;IAED,MAAM,gBAAgB,GAAG,QAAQ,C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,QAAQ,CAAC;AAClB,CAAC;AAED,SAAS,0BAA0B,CAAC,IAInC;IACC,OAAO,GAAG,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,KAAK,6EAA6E,qBAAqB,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC;AAC1J,CAAC;AAED,SAAS,qBAAqB,CAAC,MAAyB;IACtD,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACxB,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED,OAAO,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC3B,CAAC;AAED,SAAS,WAAW,CAAC,KAAa,EAAE,SAA4B;IAC9D,OAAO,SAAS,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;AACnC,CAAC","sourcesContent":["import {\n AUTH_PROVIDERS,\n AUTH_SCOPES,\n AUTHZ_ENGINES,\n DATABASE_PROVIDERS,\n DEPLOYMENT_TARGETS,\n} from '@ankhorage/contracts';\n\nimport type { InfraManifestInput } from './types.js';\n\nexport function validateInfraSupport(manifest: InfraManifestInput): readonly string[] {\n const warnings: string[] = [];\n\n const deploymentTarget = manifest.deployment?.target;\n if (deploymentTarget !== undefined && !isSupported(deploymentTarget, DEPLOYMENT_TARGETS)) {\n warnings.push(\n warningForUnsupportedValue({\n path: 'infra.deployment.target',\n value: deploymentTarget,\n supported: DEPLOYMENT_TARGETS,\n }),\n );\n }\n\n const databaseProvider = manifest.database?.provider;\n if (databaseProvider !== undefined && !isSupported(databaseProvider, DATABASE_PROVIDERS)) {\n warnings.push(\n warningForUnsupportedValue({\n path: 'infra.database.provider',\n value: databaseProvider,\n supported: DATABASE_PROVIDERS,\n }),\n );\n }\n\n const authProvider = manifest.auth?.provider;\n if (authProvider !== undefined && !isSupported(authProvider, AUTH_PROVIDERS)) {\n warnings.push(\n warningForUnsupportedValue({\n path: 'infra.auth.provider',\n value: authProvider,\n supported: AUTH_PROVIDERS,\n }),\n );\n }\n\n const authScope = manifest.auth?.scope;\n if (authScope !== undefined && !isSupported(authScope, AUTH_SCOPES)) {\n warnings.push(\n warningForUnsupportedValue({\n path: 'infra.auth.scope',\n value: authScope,\n supported: AUTH_SCOPES,\n }),\n );\n }\n\n const authzEngine = manifest.auth?.authorization?.engine;\n if (authzEngine !== undefined && !isSupported(authzEngine, AUTHZ_ENGINES)) {\n warnings.push(\n warningForUnsupportedValue({\n path: 'infra.auth.authorization.engine',\n value: authzEngine,\n supported: AUTHZ_ENGINES,\n }),\n );\n }\n\n return warnings;\n}\n\nfunction warningForUnsupportedValue(args: {\n readonly path: string;\n readonly value: string;\n readonly supported: readonly string[];\n}): string {\n return `${args.path} \"${args.value}\" is not currently supported by implemented generators. Supported values: ${formatSupportedValues(args.supported)}.`;\n}\n\nfunction formatSupportedValues(values: readonly string[]): string {\n if (values.length === 0) {\n return '(none)';\n }\n\n return values.join(', ');\n}\n\nfunction isSupported(value: string, supported: readonly string[]): boolean {\n return supported.includes(value);\n}\n"]}
1
+ {"version":3,"file":"infraValidation.js","sourceRoot":"","sources":["../src/infraValidation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,WAAW,EACX,aAAa,EACb,kBAAkB,EAClB,kBAAkB,GACnB,MAAM,sBAAsB,CAAC;AAI9B,MAAM,UAAU,oBAAoB,CAAC,QAA4B;IAC/D,MAAM,QAAQ,GAAa,CAAC,GAAG,uBAAuB,CAAC,QAAQ,CAAC,CAAC,CAAC;IAElE,MAAM,gBAAgB,GAAG,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IACrD,IAAI,gBAAgB,KAAK,SAAS,IAAI,CAAC,WAAW,CAAC,gBAAgB,EAAE,kBAAkB,CAAC,EAAE,CAAC;QACzF,QAAQ,CAAC,IAAI,CACX,0BAA0B,CAAC;YACzB,IAAI,EAAE,yBAAyB;YAC/B,KAAK,EAAE,gBAAgB;YACvB,SAAS,EAAE,kBAAkB;SAC9B,CAAC,CACH,CAAC;IACJ,CAAC;IAED,MA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AAC;IACJ,CAAC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED,MAAM,UAAU,uBAAuB,CAAC,QAA4B;IAClE,OAAO,CAAC,QAAQ,CAAC,IAAI,IAAI,EAAE,CAAC;SACzB,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,MAAM,KAAK,UAAU,CAAC;SAC1C,GAAG,CACF,CAAC,GAAG,EAAE,EAAE,CACN,cAAc,GAAG,CAAC,EAAE,6HAA6H,CACpJ,CAAC;AACN,CAAC;AAED,SAAS,0BAA0B,CAAC,IAInC;IACC,OAAO,GAAG,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,KAAK,6EAA6E,qBAAqB,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC;AAC1J,CAAC;AAED,SAAS,qBAAqB,CAAC,MAAyB;IACtD,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACxB,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED,OAAO,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC3B,CAAC;AAED,SAAS,WAAW,CAAC,KAAa,EAAE,SAA4B;IAC9D,OAAO,SAAS,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;AACnC,CAAC","sourcesContent":["import {\n AUTH_PROVIDERS,\n AUTH_SCOPES,\n AUTHZ_ENGINES,\n DATABASE_PROVIDERS,\n DEPLOYMENT_TARGETS,\n} from '@ankhorage/contracts';\n\nimport type { InfraManifestInput } from './types.js';\n\nexport function validateInfraSupport(manifest: InfraManifestInput): readonly string[] {\n const warnings: string[] = [...validateInfraApiSupport(manifest)];\n\n const deploymentTarget = manifest.deployment?.target;\n if (deploymentTarget !== undefined && !isSupported(deploymentTarget, DEPLOYMENT_TARGETS)) {\n warnings.push(\n warningForUnsupportedValue({\n path: 'infra.deployment.target',\n value: deploymentTarget,\n supported: DEPLOYMENT_TARGETS,\n }),\n );\n }\n\n const databaseProvider = manifest.database?.provider;\n if (databaseProvider !== undefined && !isSupported(databaseProvider, DATABASE_PROVIDERS)) {\n warnings.push(\n warningForUnsupportedValue({\n path: 'infra.database.provider',\n value: databaseProvider,\n supported: DATABASE_PROVIDERS,\n }),\n );\n }\n\n const authProvider = manifest.auth?.provider;\n if (authProvider !== undefined && !isSupported(authProvider, AUTH_PROVIDERS)) {\n warnings.push(\n warningForUnsupportedValue({\n path: 'infra.auth.provider',\n value: authProvider,\n supported: AUTH_PROVIDERS,\n }),\n );\n }\n\n const authScope = manifest.auth?.scope;\n if (authScope !== undefined && !isSupported(authScope, AUTH_SCOPES)) {\n warnings.push(\n warningForUnsupportedValue({\n path: 'infra.auth.scope',\n value: authScope,\n supported: AUTH_SCOPES,\n }),\n );\n }\n\n const authzEngine = manifest.auth?.authorization?.engine;\n if (authzEngine !== undefined && !isSupported(authzEngine, AUTHZ_ENGINES)) {\n warnings.push(\n warningForUnsupportedValue({\n path: 'infra.auth.authorization.engine',\n value: authzEngine,\n supported: AUTHZ_ENGINES,\n }),\n );\n }\n\n return warnings;\n}\n\nexport function validateInfraApiSupport(manifest: InfraManifestInput): readonly string[] {\n return (manifest.apis ?? [])\n .filter((api) => api.origin === 'internal')\n .map(\n (api) =>\n `infra.apis.${api.id} has origin \"internal\", but internal API provisioning is not supported in Phase 1; no API infrastructure will be generated.`,\n );\n}\n\nfunction warningForUnsupportedValue(args: {\n readonly path: string;\n readonly value: string;\n readonly supported: readonly string[];\n}): string {\n return `${args.path} \"${args.value}\" is not currently supported by implemented generators. Supported values: ${formatSupportedValues(args.supported)}.`;\n}\n\nfunction formatSupportedValues(values: readonly string[]): string {\n if (values.length === 0) {\n return '(none)';\n }\n\n return values.join(', ');\n}\n\nfunction isSupported(value: string, supported: readonly string[]): boolean {\n return supported.includes(value);\n}\n"]}
package/dist/types.d.ts CHANGED
@@ -30,7 +30,7 @@ export interface InfrastructureGenerationOptions {
30
30
  /**
31
31
  * Optional app-level context used by provider/engine-specific generators.
32
32
  */
33
- readonly appManifest?: Pick<AppManifest, 'deploy' | 'generatedApis' | 'infra' | 'metadata' | 'navigator' | 'screens' | 'settings'>;
33
+ readonly appManifest?: Pick<AppManifest, 'deploy' | 'infra' | 'metadata' | 'navigator' | 'screens' | 'settings'>;
34
34
  }
35
35
  export interface InfraGenerationInput {
36
36
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAEvE,MAAM,WAAW,2BAA2B;IAC1C;;OAEG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,UAAU,CAAC,EAAE,OAAO,CAAC;CAC/B;AAED,MAAM,WAAW,0BAA0B;IACzC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,4BAA4B;IAC3C,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC,aAAa,CAAC,YAAY,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;IACpE,QAAQ,CAAC,SAAS,EAAE,SAAS,MAAM,EAAE,CAAC;CACvC;AAED,MAAM,WAAW,8BAA8B;IAC7C,QAAQ,CAAC,KAAK,EAAE,SAAS,2BAA2B,EAAE,CAAC;IACvD,QAAQ,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAC;IACrC,QAAQ,CAAC,IAAI,EAAE,4BAA4B,CAAC;IAC5C,QAAQ,CAAC,YAAY,EAAE,SAAS,0BAA0B,EAAE,CAAC;CAC9D;AAED,MAAM,WAAW,+BAA+B;IAC9C;;OAEG;IACH,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAChC;;OAEG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+B,CAAC;AACrE,MAAM,MAAM,qBAAqB,GAAG,8BAA8B,CAAC;AACnE,MAAM,MAAM,aAAa,GAAG,2BAA2B,CAAC;AACxD,MAAM,MAAM,iBAAiB,GAAG,0BAA0B,CAAC;AAE3D,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAC;IAC7B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B;AAED,KAAK,oBAAoB,GAAG,WAAW,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC,CAAC,UAAU,CAAC,GAAG,UAAU,CAAC;AAE3F,UAAU,qBAAqB;IAC7B,QAAQ,CAAC,QAAQ,EAAE,oBAAoB,CAAC;IACxC,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;CACrC;AAED;;;;;GAKG;AACH,MAAM,MAAM,kBAAkB,GAAG,IAAI,CAAC,aAAa,EAAE,SAAS,CAAC,GAAG;IAChE,QAAQ,CAAC,OAAO,CAAC,EAAE,qBAAqB,CAAC;CAC1C,CAAC"}
package/dist/types.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { AppManifest, InfraManifest } from '@ankhorage/contracts';\n\nexport interface GeneratedInfrastructureFile {\n /**\n * Path relative to the target app root.\n */\n readonly path: string;\n readonly content: string;\n readonly executable?: boolean;\n}\n\nexport interface GeneratedPackageDependency {\n readonly name: string;\n readonly version: string;\n readonly reason: string;\n}\n\nexport interface InfrastructureGenerationMeta {\n readonly target: NonNullable<InfraManifest['deployment']>['target'];\n readonly providers: readonly string[];\n}\n\nexport interface InfrastructureGenerationResult {\n readonly files: readonly GeneratedInfrastructureFile[];\n readonly warnings: readonly string[];\n readonly meta: InfrastructureGenerationMeta;\n readonly dependencies: readonly GeneratedPackageDependency[];\n}\n\nexport interface InfrastructureGenerationOptions {\n /**\n * Optional namespace hint from caller context, such as app slug or project id.\n */\n readonly namespaceHint?: string;\n /**\n * Optional app-level context used by provider/engine-specific generators.\n */\n readonly appManifest?: Pick<\n AppManifest,\n 'deploy' | 'generatedApis' | 'infra' | 'metadata' | 'navigator' | 'screens' | 'settings'\n >;\n}\n\nexport interface InfraGenerationInput {\n /**\n * Infra manifest section from an app manifest.\n */\n readonly manifest: InfraManifestInput;\n /**\n * Optional root used by callers that want to keep output intent alongside generation.\n * The generator itself still returns relative file paths and does not write to disk.\n */\n readonly outputRoot?: string;\n readonly options?: InfrastructureGenerationOptions;\n}\n\nexport type InfraGenerationOptions = InfrastructureGenerationOptions;\nexport type InfraGenerationResult = InfrastructureGenerationResult;\nexport type GeneratedFile = GeneratedInfrastructureFile;\nexport type PackageDependency = GeneratedPackageDependency;\n\nexport interface InfraDiagnostic {\n readonly severity: 'warning';\n readonly message: string;\n}\n\ntype InfraStorageProvider = NonNullable<InfraManifest['storage']>['provider'] | 'supabase';\n\ninterface InfraStorageSpecInput {\n readonly provider: InfraStorageProvider;\n readonly buckets: readonly string[];\n}\n\n/**\n * Infra-local manifest input type.\n *\n * This is intentionally broader than `@ankhorage/contracts` to allow adapters to support\n * additional providers before the shared contracts package officially includes them.\n */\nexport type InfraManifestInput = Omit<InfraManifest, 'storage'> & {\n readonly storage?: InfraStorageSpecInput;\n};\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { AppManifest, InfraManifest } from '@ankhorage/contracts';\n\nexport interface GeneratedInfrastructureFile {\n /**\n * Path relative to the target app root.\n */\n readonly path: string;\n readonly content: string;\n readonly executable?: boolean;\n}\n\nexport interface GeneratedPackageDependency {\n readonly name: string;\n readonly version: string;\n readonly reason: string;\n}\n\nexport interface InfrastructureGenerationMeta {\n readonly target: NonNullable<InfraManifest['deployment']>['target'];\n readonly providers: readonly string[];\n}\n\nexport interface InfrastructureGenerationResult {\n readonly files: readonly GeneratedInfrastructureFile[];\n readonly warnings: readonly string[];\n readonly meta: InfrastructureGenerationMeta;\n readonly dependencies: readonly GeneratedPackageDependency[];\n}\n\nexport interface InfrastructureGenerationOptions {\n /**\n * Optional namespace hint from caller context, such as app slug or project id.\n */\n readonly namespaceHint?: string;\n /**\n * Optional app-level context used by provider/engine-specific generators.\n */\n readonly appManifest?: Pick<\n AppManifest,\n 'deploy' | 'infra' | 'metadata' | 'navigator' | 'screens' | 'settings'\n >;\n}\n\nexport interface InfraGenerationInput {\n /**\n * Infra manifest section from an app manifest.\n */\n readonly manifest: InfraManifestInput;\n /**\n * Optional root used by callers that want to keep output intent alongside generation.\n * The generator itself still returns relative file paths and does not write to disk.\n */\n readonly outputRoot?: string;\n readonly options?: InfrastructureGenerationOptions;\n}\n\nexport type InfraGenerationOptions = InfrastructureGenerationOptions;\nexport type InfraGenerationResult = InfrastructureGenerationResult;\nexport type GeneratedFile = GeneratedInfrastructureFile;\nexport type PackageDependency = GeneratedPackageDependency;\n\nexport interface InfraDiagnostic {\n readonly severity: 'warning';\n readonly message: string;\n}\n\ntype InfraStorageProvider = NonNullable<InfraManifest['storage']>['provider'] | 'supabase';\n\ninterface InfraStorageSpecInput {\n readonly provider: InfraStorageProvider;\n readonly buckets: readonly string[];\n}\n\n/**\n * Infra-local manifest input type.\n *\n * This is intentionally broader than `@ankhorage/contracts` to allow adapters to support\n * additional providers before the shared contracts package officially includes them.\n */\nexport type InfraManifestInput = Omit<InfraManifest, 'storage'> & {\n readonly storage?: InfraStorageSpecInput;\n};\n"]}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ankhorage/infra",
3
3
  "type": "module",
4
- "version": "3.3.0",
4
+ "version": "4.0.0",
5
5
  "description": "Project-aware infrastructure generation library and executable Ankh provider for Ankhorage.",
6
6
  "homepage": "https://github.com/ankhorage/infra#readme",
7
7
  "bugs": {
@@ -35,7 +35,7 @@
35
35
  "openapi"
36
36
  ],
37
37
  "dependencies": {
38
- "@ankhorage/contracts": "^7.7.0",
38
+ "@ankhorage/contracts": "^8.0.0",
39
39
  "@ankhorage/supabase-vault": "^0.2.4"
40
40
  },
41
41
  "files": [
@@ -106,13 +106,13 @@
106
106
  "version-packages": "changeset version"
107
107
  },
108
108
  "devDependencies": {
109
- "@ankhorage/ankh": "^0.4.0",
110
- "@ankhorage/devtools": "^1.0.6",
111
- "@ankhorage/paradox": "^0.1.10",
109
+ "@ankhorage/ankh": "^0.8.1",
110
+ "@ankhorage/devtools": "^1.2.1",
111
+ "@ankhorage/paradox": "^0.1.21",
112
112
  "@changesets/cli": "^2.31.0",
113
- "@types/bun": "^1.3.13",
113
+ "@types/bun": "^1.3.14",
114
114
  "@types/node": "^25.6.0",
115
115
  "typescript": "^5.9.3"
116
116
  },
117
- "packageManager": "bun@1.3.13"
117
+ "packageManager": "bun@1.3.14"
118
118
  }
@@ -1,4 +1,4 @@
1
- import { generateGeneratedApiDatabaseArtifacts } from '../../generatedApiDatabase';
1
+ import { validateInfraApiSupport } from '../../infraValidation';
2
2
  import type {
3
3
  GeneratedPackageDependency,
4
4
  InfraManifestInput,
@@ -45,21 +45,6 @@ export function generateMinikubeInfra(
45
45
  });
46
46
  const storageArtifacts = generateStorageArtifacts({ manifest, namespace });
47
47
  const secretStoreArtifacts = generateSecretStoreArtifacts({ manifest, namespace });
48
- const generatedApiDatabaseArtifacts = generateGeneratedApiDatabaseArtifacts({
49
- generatedApis: options.appManifest?.generatedApis,
50
- databaseProvider: manifest.database?.provider,
51
- });
52
- const generatedApiErrors = generatedApiDatabaseArtifacts.diagnostics.filter(
53
- (diagnostic) => diagnostic.severity === 'error',
54
- );
55
-
56
- if (generatedApiErrors.length > 0) {
57
- throw new Error(
58
- `Generated API database definition is invalid:\n${generatedApiErrors
59
- .map((diagnostic) => `- ${diagnostic.path ?? diagnostic.apiId}: ${diagnostic.message}`)
60
- .join('\n')}`,
61
- );
62
- }
63
48
 
64
49
  const extraResources = unique([
65
50
  ...authArtifacts.resources,
@@ -98,9 +83,6 @@ export function generateMinikubeInfra(
98
83
  ...authzArtifacts.warnings,
99
84
  ...storageArtifacts.warnings,
100
85
  ...secretStoreArtifacts.warnings,
101
- ...generatedApiDatabaseArtifacts.diagnostics
102
- .filter((diagnostic) => diagnostic.severity === 'warning')
103
- .map((diagnostic) => diagnostic.message),
104
86
  ]);
105
87
 
106
88
  return {
@@ -110,7 +92,6 @@ export function generateMinikubeInfra(
110
92
  ...authzArtifacts.files,
111
93
  ...storageArtifacts.files,
112
94
  ...secretStoreArtifacts.files,
113
- ...generatedApiDatabaseArtifacts.files,
114
95
  ],
115
96
  warnings,
116
97
  meta: {
@@ -151,7 +132,7 @@ function collectDependencies(manifest: InfraManifestInput): readonly GeneratedPa
151
132
  }
152
133
 
153
134
  function collectWarnings(manifest: InfraManifestInput): string[] {
154
- const warnings: string[] = [];
135
+ const warnings = [...validateInfraApiSupport(manifest)];
155
136
 
156
137
  if (manifest.deployment?.monitoring) {
157
138
  warnings.push(
@@ -0,0 +1,69 @@
1
+ import { describe, expect, test } from 'bun:test';
2
+
3
+ import { generateInfrastructure } from './index';
4
+ import { createAppManifest } from './testSupport';
5
+ import type { InfraManifestInput } from './types';
6
+
7
+ const DEPLOYMENT = { target: 'minikube', monitoring: false } as const;
8
+
9
+ describe('canonical API infrastructure', () => {
10
+ test('treats external APIs as infrastructure no-ops', () => {
11
+ const manifest: InfraManifestInput = {
12
+ deployment: DEPLOYMENT,
13
+ modules: [],
14
+ apis: [
15
+ {
16
+ id: 'nutrition',
17
+ origin: 'external',
18
+ protocol: 'rest',
19
+ baseUrl: 'https://api.ankhorage.com/v1/nutrition',
20
+ endpoints: {},
21
+ },
22
+ ],
23
+ };
24
+
25
+ const result = generateInfrastructure(manifest, {
26
+ appManifest: createAppManifest('nutrition', manifest),
27
+ });
28
+
29
+ expect(result.warnings).not.toContainEqual(expect.stringContaining('infra.apis.nutrition'));
30
+ expect(listApiArtifactPaths(result.files)).toEqual([]);
31
+ });
32
+
33
+ test('warns for internal APIs without generating partial API infrastructure', () => {
34
+ const manifest: InfraManifestInput = {
35
+ deployment: DEPLOYMENT,
36
+ modules: [],
37
+ apis: [
38
+ {
39
+ id: 'orders',
40
+ origin: 'internal',
41
+ protocol: 'rest',
42
+ basePath: '/api/orders',
43
+ endpoints: {},
44
+ },
45
+ ],
46
+ };
47
+
48
+ const result = generateInfrastructure(manifest, {
49
+ appManifest: createAppManifest('orders', manifest),
50
+ });
51
+
52
+ expect(result.warnings).toContain(
53
+ 'infra.apis.orders has origin "internal", but internal API provisioning is not supported in Phase 1; no API infrastructure will be generated.',
54
+ );
55
+ expect(listApiArtifactPaths(result.files)).toEqual([]);
56
+ });
57
+ });
58
+
59
+ function listApiArtifactPaths(files: readonly { readonly path: string }[]): readonly string[] {
60
+ return files
61
+ .map((file) => file.path)
62
+ .filter(
63
+ (path) =>
64
+ path.includes('generated-api') ||
65
+ path.includes('generated_api') ||
66
+ path.includes('/api/deployment') ||
67
+ path.includes('/api/service'),
68
+ );
69
+ }
@@ -0,0 +1,72 @@
1
+ import { expect, test } from 'bun:test';
2
+ import { promises as fs } from 'fs';
3
+ import os from 'os';
4
+ import path from 'path';
5
+
6
+ import { syncProjectInfrastructure } from './projectInfrastructure';
7
+ import { createAppManifest } from './testSupport';
8
+
9
+ const OBSOLETE_FILES = [
10
+ 'infra/minikube/db/generated-api-resources.json',
11
+ 'infra/minikube/db/migrations/001_generated_api_resources.sql',
12
+ ] as const;
13
+
14
+ test('removes obsolete generated API database artifacts tracked by the infra ledger', async () => {
15
+ const projectPath = await fs.mkdtemp(path.join(os.tmpdir(), 'infra-api-cleanup-'));
16
+
17
+ try {
18
+ await writeObsoleteArtifacts(projectPath);
19
+ const manifest = createAppManifest('shop', {
20
+ deployment: { target: 'minikube', monitoring: false },
21
+ modules: [],
22
+ });
23
+ const result = await syncProjectInfrastructure({
24
+ projectId: 'shop',
25
+ projectPath,
26
+ manifest,
27
+ generateInfrastructureImpl: () => ({
28
+ files: [],
29
+ warnings: [],
30
+ meta: { target: 'minikube', providers: [] },
31
+ dependencies: [],
32
+ }),
33
+ });
34
+
35
+ expect(result.removed).toBe(OBSOLETE_FILES.length);
36
+ for (const filePath of OBSOLETE_FILES) {
37
+ expect(await pathExists(path.join(projectPath, filePath))).toBe(false);
38
+ }
39
+ } finally {
40
+ await fs.rm(projectPath, { force: true, recursive: true });
41
+ }
42
+ });
43
+
44
+ async function writeObsoleteArtifacts(projectPath: string): Promise<void> {
45
+ for (const filePath of OBSOLETE_FILES) {
46
+ const absolutePath = path.join(projectPath, filePath);
47
+ await fs.mkdir(path.dirname(absolutePath), { recursive: true });
48
+ await fs.writeFile(absolutePath, 'obsolete', 'utf8');
49
+ }
50
+
51
+ await fs.mkdir(path.join(projectPath, '.ankh'), { recursive: true });
52
+ await fs.writeFile(
53
+ path.join(projectPath, '.ankh/infra-ledger.json'),
54
+ JSON.stringify({
55
+ schemaVersion: 1,
56
+ generatedAt: new Date().toISOString(),
57
+ target: 'minikube',
58
+ files: OBSOLETE_FILES,
59
+ warnings: [],
60
+ }),
61
+ 'utf8',
62
+ );
63
+ }
64
+
65
+ async function pathExists(filePath: string): Promise<boolean> {
66
+ try {
67
+ await fs.access(filePath);
68
+ return true;
69
+ } catch {
70
+ return false;
71
+ }
72
+ }
package/src/index.ts CHANGED
@@ -14,12 +14,6 @@ export {
14
14
  resolveAuthRedirectConfiguration,
15
15
  type ResolveAuthRedirectConfigurationInput,
16
16
  } from './authRedirects';
17
- export {
18
- type GeneratedApiDatabaseArtifacts,
19
- type GeneratedApiDatabaseDiagnostic,
20
- type GeneratedApiDatabaseDiagnosticCode,
21
- generateGeneratedApiDatabaseArtifacts,
22
- } from './generatedApiDatabase';
23
17
  export {
24
18
  createInfraSecretStoreAdapter,
25
19
  type CreateInfraSecretStoreAdapterInput,
@@ -0,0 +1,42 @@
1
+ import { describe, expect, test } from 'bun:test';
2
+
3
+ import { validateInfraSupport } from './infraValidation';
4
+ import type { InfraManifestInput } from './types';
5
+
6
+ describe('canonical API support validation', () => {
7
+ test('does not warn for external APIs', () => {
8
+ const manifest: InfraManifestInput = {
9
+ modules: [],
10
+ apis: [
11
+ {
12
+ id: 'nutrition',
13
+ origin: 'external',
14
+ protocol: 'rest',
15
+ baseUrl: 'https://api.ankhorage.com/v1/nutrition',
16
+ endpoints: {},
17
+ },
18
+ ],
19
+ };
20
+
21
+ expect(validateInfraSupport(manifest)).toEqual([]);
22
+ });
23
+
24
+ test('reports every internal API as unsupported without treating it as invalid', () => {
25
+ const manifest: InfraManifestInput = {
26
+ modules: [],
27
+ apis: [
28
+ {
29
+ id: 'orders',
30
+ origin: 'internal',
31
+ protocol: 'rest',
32
+ basePath: '/api/orders',
33
+ endpoints: {},
34
+ },
35
+ ],
36
+ };
37
+
38
+ expect(validateInfraSupport(manifest)).toEqual([
39
+ 'infra.apis.orders has origin "internal", but internal API provisioning is not supported in Phase 1; no API infrastructure will be generated.',
40
+ ]);
41
+ });
42
+ });
@@ -9,7 +9,7 @@ import {
9
9
  import type { InfraManifestInput } from './types.js';
10
10
 
11
11
  export function validateInfraSupport(manifest: InfraManifestInput): readonly string[] {
12
- const warnings: string[] = [];
12
+ const warnings: string[] = [...validateInfraApiSupport(manifest)];
13
13
 
14
14
  const deploymentTarget = manifest.deployment?.target;
15
15
  if (deploymentTarget !== undefined && !isSupported(deploymentTarget, DEPLOYMENT_TARGETS)) {
@@ -69,6 +69,15 @@ export function validateInfraSupport(manifest: InfraManifestInput): readonly str
69
69
  return warnings;
70
70
  }
71
71
 
72
+ export function validateInfraApiSupport(manifest: InfraManifestInput): readonly string[] {
73
+ return (manifest.apis ?? [])
74
+ .filter((api) => api.origin === 'internal')
75
+ .map(
76
+ (api) =>
77
+ `infra.apis.${api.id} has origin "internal", but internal API provisioning is not supported in Phase 1; no API infrastructure will be generated.`,
78
+ );
79
+ }
80
+
72
81
  function warningForUnsupportedValue(args: {
73
82
  readonly path: string;
74
83
  readonly value: string;
package/src/types.ts CHANGED
@@ -37,7 +37,7 @@ export interface InfrastructureGenerationOptions {
37
37
  */
38
38
  readonly appManifest?: Pick<
39
39
  AppManifest,
40
- 'deploy' | 'generatedApis' | 'infra' | 'metadata' | 'navigator' | 'screens' | 'settings'
40
+ 'deploy' | 'infra' | 'metadata' | 'navigator' | 'screens' | 'settings'
41
41
  >;
42
42
  }
43
43
 
@@ -1,20 +0,0 @@
1
- import type { GeneratedApiRegistry } from '@ankhorage/contracts';
2
- import type { GeneratedInfrastructureFile } from './types';
3
- export type GeneratedApiDatabaseDiagnosticCode = 'duplicate-field' | 'duplicate-resource-id' | 'duplicate-target' | 'invalid-default' | 'invalid-identifier' | 'invalid-primary-key' | 'invalid-seed' | 'registry-id-mismatch' | 'unsupported-policy' | 'unsupported-provider';
4
- export interface GeneratedApiDatabaseDiagnostic {
5
- readonly code: GeneratedApiDatabaseDiagnosticCode;
6
- readonly severity: 'error' | 'warning';
7
- readonly apiId: string;
8
- readonly resourceId?: string;
9
- readonly path?: string;
10
- readonly message: string;
11
- }
12
- export interface GeneratedApiDatabaseArtifacts {
13
- readonly files: readonly GeneratedInfrastructureFile[];
14
- readonly diagnostics: readonly GeneratedApiDatabaseDiagnostic[];
15
- }
16
- export declare function generateGeneratedApiDatabaseArtifacts(args: {
17
- readonly generatedApis: GeneratedApiRegistry | undefined;
18
- readonly databaseProvider: string | undefined;
19
- }): GeneratedApiDatabaseArtifacts;
20
- //# sourceMappingURL=generatedApiDatabase.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"generatedApiDatabase.d.ts","sourceRoot":"","sources":["../src/generatedApiDatabase.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAKV,oBAAoB,EAGrB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,SAAS,CAAC;AAE3D,MAAM,MAAM,kCAAkC,GAC1C,iBAAiB,GACjB,uBAAuB,GACvB,kBAAkB,GAClB,iBAAiB,GACjB,oBAAoB,GACpB,qBAAqB,GACrB,cAAc,GACd,sBAAsB,GACtB,oBAAoB,GACpB,sBAAsB,CAAC;AAE3B,MAAM,WAAW,8BAA8B;IAC7C,QAAQ,CAAC,IAAI,EAAE,kCAAkC,CAAC;IAClD,QAAQ,CAAC,QAAQ,EAAE,OAAO,GAAG,SAAS,CAAC;IACvC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,6BAA6B;IAC5C,QAAQ,CAAC,KAAK,EAAE,SAAS,2BAA2B,EAAE,CAAC;IACvD,QAAQ,CAAC,WAAW,EAAE,SAAS,8BAA8B,EAAE,CAAC;CACjE;AAmBD,wBAAgB,qCAAqC,CAAC,IAAI,EAAE;IAC1D,QAAQ,CAAC,aAAa,EAAE,oBAAoB,GAAG,SAAS,CAAC;IACzD,QAAQ,CAAC,gBAAgB,EAAE,MAAM,GAAG,SAAS,CAAC;CAC/C,GAAG,6BAA6B,CA2ChC"}