@ankhorage/contracts 20.0.0 → 22.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 +12 -0
- package/dist/appManifest/apis.d.ts +3 -3
- package/dist/appManifest/apis.d.ts.map +1 -1
- package/dist/appManifest/apis.js +4 -6
- package/dist/appManifest/apis.js.map +1 -1
- package/dist/appManifest/bindings.d.ts.map +1 -1
- package/dist/appManifest/bindings.js +2 -1
- package/dist/appManifest/bindings.js.map +1 -1
- package/dist/appManifest/data.d.ts.map +1 -1
- package/dist/appManifest/data.js +5 -4
- package/dist/appManifest/data.js.map +1 -1
- package/dist/appManifest/isAppManifest.js +3 -3
- package/dist/appManifest/isAppManifest.js.map +1 -1
- package/dist/appManifest/isManifestValue.d.ts +1 -1
- package/dist/appManifest/isManifestValue.d.ts.map +1 -1
- package/dist/appManifest/isManifestValue.js +3 -12
- package/dist/appManifest/isManifestValue.js.map +1 -1
- package/dist/appManifest/screens.d.ts +3 -2
- package/dist/appManifest/screens.d.ts.map +1 -1
- package/dist/appManifest/screens.js +15 -7
- package/dist/appManifest/screens.js.map +1 -1
- package/dist/bindings.d.ts +2 -3
- package/dist/bindings.d.ts.map +1 -1
- package/dist/bindings.js.map +1 -1
- package/dist/collections.d.ts +4 -0
- package/dist/collections.d.ts.map +1 -0
- package/dist/collections.js +6 -0
- package/dist/collections.js.map +1 -0
- package/dist/data/apis.d.ts +1 -1
- package/dist/data/apis.d.ts.map +1 -1
- package/dist/data/apis.js.map +1 -1
- package/dist/data/values.d.ts +2 -3
- package/dist/data/values.d.ts.map +1 -1
- package/dist/data/values.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/infra/isInfraEnvironmentSpec.d.ts.map +1 -1
- package/dist/infra/isInfraEnvironmentSpec.js +10 -12
- package/dist/infra/isInfraEnvironmentSpec.js.map +1 -1
- package/dist/infra/isInfraManifest.d.ts.map +1 -1
- package/dist/infra/isInfraManifest.js +14 -5
- package/dist/infra/isInfraManifest.js.map +1 -1
- package/dist/infra/isInfraWorkloadSpec.d.ts.map +1 -1
- package/dist/infra/isInfraWorkloadSpec.js +26 -20
- package/dist/infra/isInfraWorkloadSpec.js.map +1 -1
- package/dist/requirements.d.ts +5 -10
- package/dist/requirements.d.ts.map +1 -1
- package/dist/requirements.js.map +1 -1
- package/dist/serializable.d.ts +6 -0
- package/dist/serializable.d.ts.map +1 -0
- package/dist/serializable.js +14 -0
- package/dist/serializable.js.map +1 -0
- package/dist/state.d.ts +2 -3
- package/dist/state.d.ts.map +1 -1
- package/dist/state.js.map +1 -1
- package/dist/types/infraAdapters.d.ts +12 -3
- package/dist/types/infraAdapters.d.ts.map +1 -1
- package/dist/types/infraAdapters.js.map +1 -1
- package/dist/types/infraManifest.d.ts +14 -13
- package/dist/types/infraManifest.d.ts.map +1 -1
- package/dist/types/infraManifest.js.map +1 -1
- package/dist/types/infraWorkload.d.ts +11 -11
- package/dist/types/infraWorkload.d.ts.map +1 -1
- package/dist/types/infraWorkload.js.map +1 -1
- package/dist/types.d.ts +9 -8
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/package.json +10 -9
- package/src/appManifest/apis.ts +9 -6
- package/src/appManifest/bindings.ts +7 -1
- package/src/appManifest/data.ts +13 -4
- package/src/appManifest/isAppManifest.ts +3 -3
- package/src/appManifest/isManifestValue.ts +3 -16
- package/src/appManifest/screens.ts +21 -10
- package/src/appManifest.test.ts +21 -16
- package/src/bindings.test.ts +11 -8
- package/src/bindings.ts +2 -9
- package/src/collections.ts +8 -0
- package/src/contracts.test.ts +16 -13
- package/src/data/apis.test.ts +6 -4
- package/src/data/apis.ts +1 -1
- package/src/data/values.ts +3 -9
- package/src/deploy.test.ts +4 -4
- package/src/index.ts +2 -0
- package/src/infra/isInfraEnvironmentSpec.ts +16 -16
- package/src/infra/isInfraManifest.ts +17 -6
- package/src/infra/isInfraWorkloadSpec.ts +39 -24
- package/src/infra-published-port.test.ts +8 -8
- package/src/infra-types.test.ts +27 -0
- package/src/infra-workload-persistence.test.ts +4 -4
- package/src/infra-workload.test.ts +24 -22
- package/src/infra.test.ts +16 -20
- package/src/infraPersistence.test.ts +1 -1
- package/src/infraServices.test.ts +1 -1
- package/src/requirements.test.ts +2 -2
- package/src/requirements.ts +6 -12
- package/src/secrets.test.ts +1 -1
- package/src/serializable.ts +25 -0
- package/src/state.ts +3 -6
- package/src/types/infraAdapters.ts +20 -5
- package/src/types/infraManifest.ts +17 -13
- package/src/types/infraWorkload.ts +12 -11
- package/src/types.ts +11 -12
|
@@ -11,6 +11,15 @@ export type InfraAdapterDescriptor<P extends InfraAdapterId = InfraAdapterId> =
|
|
|
11
11
|
readonly operations?: readonly ('suspend' | 'resume' | 'generate' | 'diagnostics')[];
|
|
12
12
|
};
|
|
13
13
|
}[P];
|
|
14
|
+
/** Trusted execution-only control-plane credential lookup, resolution and persistence. */
|
|
15
|
+
export interface InfraCredentialPort {
|
|
16
|
+
/** Return a credential bundle when present; absence is not an error. */
|
|
17
|
+
findAsync(reference: InfraControlPlaneCredentialRef): Promise<InfraResult<Readonly<Record<string, string>> | null>>;
|
|
18
|
+
/** Resolve a required credential bundle; absence is an error. */
|
|
19
|
+
resolveAsync(reference: InfraControlPlaneCredentialRef): Promise<InfraResult<Readonly<Record<string, string>>>>;
|
|
20
|
+
/** Persist an opaque provider-owned credential bundle without exposing its schema to the host. */
|
|
21
|
+
persistAsync(reference: InfraControlPlaneCredentialRef, values: Readonly<Record<string, string>>): Promise<InfraResult<null>>;
|
|
22
|
+
}
|
|
14
23
|
/** Trusted execution-only ports. Implementations must not serialize resolved credential values. */
|
|
15
24
|
export interface InfraExecutionContext {
|
|
16
25
|
readonly projectId: string;
|
|
@@ -18,9 +27,7 @@ export interface InfraExecutionContext {
|
|
|
18
27
|
readonly desired: InfraEnvironmentSpec;
|
|
19
28
|
readonly previous?: InfraLedger;
|
|
20
29
|
readonly signal?: AbortSignal;
|
|
21
|
-
readonly credentials:
|
|
22
|
-
resolveAsync(reference: InfraControlPlaneCredentialRef): Promise<InfraResult<Readonly<Record<string, string>>>>;
|
|
23
|
-
};
|
|
30
|
+
readonly credentials: InfraCredentialPort;
|
|
24
31
|
readonly secrets: {
|
|
25
32
|
resolveAsync(reference: InfraSecretReference): Promise<InfraResult<string>>;
|
|
26
33
|
};
|
|
@@ -68,6 +75,8 @@ export interface InfraServiceAdapter {
|
|
|
68
75
|
/** Read-only service config, bootstrap credentials and dependency validation. */
|
|
69
76
|
validateAsync(context: InfraExecutionContext): Promise<InfraResult<null>>;
|
|
70
77
|
planAsync(context: InfraExecutionContext): Promise<InfraResult<readonly InfraPlanAction[]>>;
|
|
78
|
+
/** Mutating pre-runtime preparation invoked only by an orchestrated `up` operation. */
|
|
79
|
+
prepareAsync?(context: InfraExecutionContext): Promise<InfraResult<null>>;
|
|
71
80
|
desiredWorkloadsAsync(context: InfraExecutionContext): Promise<InfraResult<readonly InfraWorkloadSpec[]>>;
|
|
72
81
|
reconcileAsync(context: InfraExecutionContext, runtimeOutputs: readonly InfraOutput[]): Promise<InfraResult<InfraReconcileResult>>;
|
|
73
82
|
statusAsync(context: InfraExecutionContext): Promise<InfraResult<readonly InfraResourceStatus[]>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"infraAdapters.d.ts","sourceRoot":"","sources":["../../src/types/infraAdapters.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAChE,OAAO,KAAK,EACV,mBAAmB,EACnB,sBAAsB,EACtB,WAAW,EACX,WAAW,EACX,kBAAkB,EAClB,eAAe,EACf,mBAAmB,EACnB,WAAW,EACZ,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EACV,cAAc,E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SAAS,mBAAmB,EAAE,CAAC,CAAC,CAAC;IAClG,YAAY,CACV,OAAO,EAAE,qBAAqB,EAC9B,OAAO,EAAE,mBAAmB,GAC3B,OAAO,CAAC,WAAW,CAAC,oBAAoB,CAAC,CAAC,CAAC;IAC9C,YAAY,CAAC,CAAC,OAAO,EAAE,qBAAqB,GAAG,OAAO,CAAC,WAAW,CAAC,oBAAoB,CAAC,CAAC,CAAC;CAC3F"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"infraAdapters.js","sourceRoot":"","sources":["../../src/types/infraAdapters.ts"],"names":[],"mappings":"","sourcesContent":["import type { AppEnvironmentId } from '../environments';\nimport type { INFRA_ADAPTER_CATALOG } from '../infra/constants';\nimport type {\n InfraDestroyRequest,\n InfraGeneratedArtifact,\n InfraLedger,\n InfraOutput,\n InfraOwnedResource,\n InfraPlanAction,\n InfraResourceStatus,\n InfraResult,\n} from './infraLifecycle';\nimport type {\n InfraAdapterId,\n InfraComputeProviderId,\n InfraComputeSelection,\n InfraEnvironmentSpec,\n InfraRuntimeProviderId,\n InfraRuntimeSelection,\n} from './infraManifest';\nimport type { InfraControlPlaneCredentialRef, InfraSecretReference } from './infraSecrets';\nimport type { InfraComputeTarget } from './infraTargets';\nimport type { InfraWorkloadSpec } from './infraWorkload';\n\n/** Package exports must match this exact catalog entry; optional operations are advertised explicitly. */\nexport type InfraAdapterDescriptor<P extends InfraAdapterId = InfraAdapterId> = {\n [K in P]: (typeof INFRA_ADAPTER_CATALOG)[K] & {\n readonly operations?: readonly ('suspend' | 'resume' | 'generate' | 'diagnostics')[];\n };\n}[P];\n\n/** Trusted execution-only ports. Implementations must not serialize resolved credential values. */\nexport interface InfraExecutionContext {\n readonly projectId: string;\n readonly environment: AppEnvironmentId;\n readonly desired: InfraEnvironmentSpec;\n readonly previous?: InfraLedger;\n readonly signal?: AbortSignal;\n readonly credentials:
|
|
1
|
+
{"version":3,"file":"infraAdapters.js","sourceRoot":"","sources":["../../src/types/infraAdapters.ts"],"names":[],"mappings":"","sourcesContent":["import type { AppEnvironmentId } from '../environments';\nimport type { INFRA_ADAPTER_CATALOG } from '../infra/constants';\nimport type {\n InfraDestroyRequest,\n InfraGeneratedArtifact,\n InfraLedger,\n InfraOutput,\n InfraOwnedResource,\n InfraPlanAction,\n InfraResourceStatus,\n InfraResult,\n} from './infraLifecycle';\nimport type {\n InfraAdapterId,\n InfraComputeProviderId,\n InfraComputeSelection,\n InfraEnvironmentSpec,\n InfraRuntimeProviderId,\n InfraRuntimeSelection,\n} from './infraManifest';\nimport type { InfraControlPlaneCredentialRef, InfraSecretReference } from './infraSecrets';\nimport type { InfraComputeTarget } from './infraTargets';\nimport type { InfraWorkloadSpec } from './infraWorkload';\n\n/** Package exports must match this exact catalog entry; optional operations are advertised explicitly. */\nexport type InfraAdapterDescriptor<P extends InfraAdapterId = InfraAdapterId> = {\n [K in P]: (typeof INFRA_ADAPTER_CATALOG)[K] & {\n readonly operations?: readonly ('suspend' | 'resume' | 'generate' | 'diagnostics')[];\n };\n}[P];\n\n/** Trusted execution-only control-plane credential lookup, resolution and persistence. */\nexport interface InfraCredentialPort {\n /** Return a credential bundle when present; absence is not an error. */\n findAsync(\n reference: InfraControlPlaneCredentialRef,\n ): Promise<InfraResult<Readonly<Record<string, string>> | null>>;\n /** Resolve a required credential bundle; absence is an error. */\n resolveAsync(\n reference: InfraControlPlaneCredentialRef,\n ): Promise<InfraResult<Readonly<Record<string, string>>>>;\n /** Persist an opaque provider-owned credential bundle without exposing its schema to the host. */\n persistAsync(\n reference: InfraControlPlaneCredentialRef,\n values: Readonly<Record<string, string>>,\n ): Promise<InfraResult<null>>;\n}\n\n/** Trusted execution-only ports. Implementations must not serialize resolved credential values. */\nexport interface InfraExecutionContext {\n readonly projectId: string;\n readonly environment: AppEnvironmentId;\n readonly desired: InfraEnvironmentSpec;\n readonly previous?: InfraLedger;\n readonly signal?: AbortSignal;\n readonly credentials: InfraCredentialPort;\n readonly secrets: {\n resolveAsync(reference: InfraSecretReference): Promise<InfraResult<string>>;\n };\n}\n\nexport interface InfraReconcileResult {\n readonly resources: readonly InfraOwnedResource[];\n readonly outputs: readonly InfraOutput[];\n}\n\n/** Current portable compute state resolved without creating, updating or deleting resources. */\nexport interface InfraComputeSnapshot extends InfraReconcileResult {\n readonly targets: readonly InfraComputeTarget[];\n}\n\nexport interface InfraComputeAdapter<P extends InfraComputeProviderId = InfraComputeProviderId> {\n readonly descriptor: InfraAdapterDescriptor<P>;\n /** Read-only prerequisites, config and control-plane credential validation. */\n validateAsync(\n context: InfraExecutionContext,\n selection: InfraComputeSelection<P>,\n ): Promise<InfraResult<null>>;\n /** Read-only discovery for planning and stateless runtime projection. Missing compute is empty. */\n inspectAsync(\n context: InfraExecutionContext,\n selection: InfraComputeSelection<P>,\n ): Promise<InfraResult<InfraComputeSnapshot>>;\n planAsync(\n context: InfraExecutionContext,\n selection: InfraComputeSelection<P>,\n ): Promise<InfraResult<readonly InfraPlanAction[]>>;\n ensureAsync(\n context: InfraExecutionContext,\n selection: InfraComputeSelection<P>,\n ): Promise<InfraResult<InfraComputeSnapshot>>;\n statusAsync(context: InfraExecutionContext): Promise<InfraResult<readonly InfraResourceStatus[]>>;\n destroyAsync(\n context: InfraExecutionContext,\n request: InfraDestroyRequest,\n ): Promise<InfraResult<InfraReconcileResult>>;\n}\n\nexport interface InfraRuntimeDesiredState<\n P extends InfraRuntimeProviderId = InfraRuntimeProviderId,\n> {\n readonly selection: InfraRuntimeSelection<P>;\n readonly targets: readonly InfraComputeTarget[];\n readonly workloads: readonly InfraWorkloadSpec[];\n /** Previously resolved outputs available to portable workload value references. */\n readonly availableOutputs: readonly InfraOutput[];\n}\n\nexport interface InfraRuntimeAdapter<P extends InfraRuntimeProviderId = InfraRuntimeProviderId> {\n readonly descriptor: InfraAdapterDescriptor<P>;\n /** Read-only prerequisites and desired-state validation; no cluster creation. */\n validateAsync(\n context: InfraExecutionContext,\n desired: InfraRuntimeDesiredState<P>,\n ): Promise<InfraResult<null>>;\n planAsync(\n context: InfraExecutionContext,\n desired: InfraRuntimeDesiredState<P>,\n ): Promise<InfraResult<readonly InfraPlanAction[]>>;\n ensureAsync(\n context: InfraExecutionContext,\n desired: InfraRuntimeDesiredState<P>,\n ): Promise<InfraResult<InfraReconcileResult>>;\n statusAsync(\n context: InfraExecutionContext,\n desired: InfraRuntimeDesiredState<P>,\n ): Promise<InfraResult<readonly InfraResourceStatus[]>>;\n suspendAsync(\n context: InfraExecutionContext,\n desired: InfraRuntimeDesiredState<P>,\n ): Promise<InfraResult<InfraReconcileResult>>;\n destroyAsync(\n context: InfraExecutionContext,\n desired: InfraRuntimeDesiredState<P>,\n request: InfraDestroyRequest,\n ): Promise<InfraResult<InfraReconcileResult>>;\n generateAsync?(\n context: InfraExecutionContext,\n desired: InfraRuntimeDesiredState<P>,\n ): Promise<InfraResult<readonly InfraGeneratedArtifact[]>>;\n}\n\n/** A service can own several capabilities but contributes one deduplicated platform instance. */\nexport interface InfraServiceAdapter {\n readonly descriptor: InfraAdapterDescriptor<'supabase' | 'cerbos' | 'r2' | 'supabase-vault'>;\n /** Read-only service config, bootstrap credentials and dependency validation. */\n validateAsync(context: InfraExecutionContext): Promise<InfraResult<null>>;\n planAsync(context: InfraExecutionContext): Promise<InfraResult<readonly InfraPlanAction[]>>;\n /** Mutating pre-runtime preparation invoked only by an orchestrated `up` operation. */\n prepareAsync?(context: InfraExecutionContext): Promise<InfraResult<null>>;\n desiredWorkloadsAsync(\n context: InfraExecutionContext,\n ): Promise<InfraResult<readonly InfraWorkloadSpec[]>>;\n reconcileAsync(\n context: InfraExecutionContext,\n runtimeOutputs: readonly InfraOutput[],\n ): Promise<InfraResult<InfraReconcileResult>>;\n statusAsync(context: InfraExecutionContext): Promise<InfraResult<readonly InfraResourceStatus[]>>;\n destroyAsync(\n context: InfraExecutionContext,\n request: InfraDestroyRequest,\n ): Promise<InfraResult<InfraReconcileResult>>;\n suspendAsync?(context: InfraExecutionContext): Promise<InfraResult<InfraReconcileResult>>;\n}\n"]}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import type { AuthFlowConfig, AuthOAuthConfig } from '../auth';
|
|
2
|
-
import type {
|
|
2
|
+
import type { SerializableSet } from '../collections';
|
|
3
|
+
import type { ApiDefinitionRegistry, DataContractValue } from '../data';
|
|
3
4
|
import type { AppEnvironmentId } from '../environments';
|
|
4
5
|
import type { INFRA_ADAPTER_CATALOG, INFRA_RUNTIME_COMPATIBILITY } from '../infra/constants';
|
|
5
6
|
import type { AuthProfileSpec, AuthScope, AuthSignInSpec, AuthSignUpSpec } from '../types';
|
|
6
7
|
import type { InfraControlPlaneCredentialRef } from './infraSecrets';
|
|
7
|
-
import type {
|
|
8
|
+
import type { InfraWorkloadRegistry } from './infraWorkload';
|
|
8
9
|
export type InfraAdapterId = keyof typeof INFRA_ADAPTER_CATALOG;
|
|
9
10
|
export type InfraCapability = (typeof INFRA_ADAPTER_CATALOG)[InfraAdapterId]['capabilities'][number];
|
|
10
11
|
export type InfraProviderFor<C extends InfraCapability> = {
|
|
@@ -86,11 +87,11 @@ export interface InfraDatabaseConfigMap {
|
|
|
86
87
|
}
|
|
87
88
|
export interface InfraObjectStorageConfigMap {
|
|
88
89
|
readonly supabase: {
|
|
89
|
-
readonly buckets?:
|
|
90
|
+
readonly buckets?: SerializableSet;
|
|
90
91
|
readonly backend?: InfraS3PersistenceTarget;
|
|
91
92
|
};
|
|
92
93
|
readonly r2: {
|
|
93
|
-
readonly buckets?:
|
|
94
|
+
readonly buckets?: SerializableSet;
|
|
94
95
|
readonly accountId?: string;
|
|
95
96
|
readonly credentials?: InfraControlPlaneCredentialRef;
|
|
96
97
|
};
|
|
@@ -108,13 +109,9 @@ export interface InfraAuthConfigMap {
|
|
|
108
109
|
export interface InfraAuthzConfigMap {
|
|
109
110
|
readonly cerbos: {
|
|
110
111
|
readonly kind: 'RBAC' | 'ABAC';
|
|
111
|
-
readonly policies?:
|
|
112
|
+
readonly policies?: Readonly<Record<string, string>>;
|
|
112
113
|
};
|
|
113
114
|
}
|
|
114
|
-
export interface InfraAuthzPolicyFile {
|
|
115
|
-
readonly path: string;
|
|
116
|
-
readonly content: string;
|
|
117
|
-
}
|
|
118
115
|
export interface InfraSecretStoreConfigMap {
|
|
119
116
|
readonly 'supabase-vault': {
|
|
120
117
|
readonly schema?: string;
|
|
@@ -167,12 +164,16 @@ export interface InfraEnvironmentSpec {
|
|
|
167
164
|
readonly authz?: InfraAuthzSpec;
|
|
168
165
|
readonly secretStore?: InfraSecretStoreSpec;
|
|
169
166
|
readonly networking?: InfraNetworkingSpec;
|
|
170
|
-
readonly workloads?:
|
|
167
|
+
readonly workloads?: InfraWorkloadRegistry;
|
|
168
|
+
}
|
|
169
|
+
export type InfraModuleId = string;
|
|
170
|
+
export interface InfraModuleSpec {
|
|
171
|
+
readonly config?: DataContractValue;
|
|
171
172
|
}
|
|
173
|
+
export type InfraModuleRegistry = Readonly<Record<InfraModuleId, InfraModuleSpec>>;
|
|
172
174
|
export interface InfraManifest {
|
|
173
175
|
readonly environments: Readonly<Record<'local', InfraEnvironmentSpec> & Partial<Record<Exclude<AppEnvironmentId, 'local'>, InfraEnvironmentSpec>>>;
|
|
174
|
-
readonly apis?:
|
|
175
|
-
readonly modules:
|
|
176
|
-
readonly modulesConfig?: Readonly<Record<string, unknown>>;
|
|
176
|
+
readonly apis?: ApiDefinitionRegistry;
|
|
177
|
+
readonly modules: InfraModuleRegistry;
|
|
177
178
|
}
|
|
178
179
|
//# sourceMappingURL=infraManifest.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"infraManifest.d.ts","sourceRoot":"","sources":["../../src/types/infraManifest.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAC/D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"infraManifest.d.ts","sourceRoot":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AC,EAAE,MAAM,CAAC;IAChC,sGAAsG;IACtG,QAAQ,CAAC,GAAG,CAAC,EAAE,sBAAsB,CAAC;CACvC;AAED,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,UAAU,EAAE,mBAAmB,CAAC;IACzC,QAAQ,CAAC,QAAQ,CAAC,EAAE,iBAAiB,CAAC;IACtC,QAAQ,CAAC,aAAa,CAAC,EAAE,sBAAsB,CAAC;IAChD,QAAQ,CAAC,IAAI,CAAC,EAAE,aAAa,CAAC;IAC9B,QAAQ,CAAC,KAAK,CAAC,EAAE,cAAc,CAAC;IAChC,QAAQ,CAAC,WAAW,CAAC,EAAE,oBAAoB,CAAC;IAC5C,QAAQ,CAAC,UAAU,CAAC,EAAE,mBAAmB,CAAC;IAC1C,QAAQ,CAAC,SAAS,CAAC,EAAE,qBAAqB,CAAC;CAC5C;AAED,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC;AAEnC,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,MAAM,CAAC,EAAE,iBAAiB,CAAC;CACrC;AAED,MAAM,MAAM,mBAAmB,GAAG,QAAQ,CAAC,MAAM,CAAC,aAAa,EAAE,eAAe,CAAC,CAAC,CAAC;AAEnF,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,YAAY,EAAE,QAAQ,CAC7B,MAAM,CAAC,OAAO,EAAE,oBAAoB,CAAC,GACnC,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,gBAAgB,EAAE,OAAO,CAAC,EAAE,oBAAoB,CAAC,CAAC,CAC5E,CAAC;IACF,QAAQ,CAAC,IAAI,CAAC,EAAE,qBAAqB,CAAC;IACtC,QAAQ,CAAC,OAAO,EAAE,mBAAmB,CAAC;CACvC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"infraManifest.js","sourceRoot":"","sources":["../../src/types/infraManifest.ts"],"names":[],"mappings":"","sourcesContent":["import type { AuthFlowConfig, AuthOAuthConfig } from '../auth';\nimport type {
|
|
1
|
+
{"version":3,"file":"infraManifest.js","sourceRoot":"","sources":["../../src/types/infraManifest.ts"],"names":[],"mappings":"","sourcesContent":["import type { AuthFlowConfig, AuthOAuthConfig } from '../auth';\nimport type { SerializableSet } from '../collections';\nimport type { ApiDefinitionRegistry, DataContractValue } from '../data';\nimport type { AppEnvironmentId } from '../environments';\nimport type { INFRA_ADAPTER_CATALOG, INFRA_RUNTIME_COMPATIBILITY } from '../infra/constants';\nimport type { AuthProfileSpec, AuthScope, AuthSignInSpec, AuthSignUpSpec } from '../types';\nimport type { InfraControlPlaneCredentialRef } from './infraSecrets';\nimport type { InfraWorkloadRegistry } from './infraWorkload';\n\nexport type InfraAdapterId = keyof typeof INFRA_ADAPTER_CATALOG;\nexport type InfraCapability =\n (typeof INFRA_ADAPTER_CATALOG)[InfraAdapterId]['capabilities'][number];\nexport type InfraProviderFor<C extends InfraCapability> = {\n [P in InfraAdapterId]: C extends (typeof INFRA_ADAPTER_CATALOG)[P]['capabilities'][number]\n ? P\n : never;\n}[InfraAdapterId];\nexport type InfraComputeProviderId = InfraProviderFor<'compute'>;\nexport type InfraRuntimeProviderId = keyof typeof INFRA_RUNTIME_COMPATIBILITY;\n\n/** Non-secret provider configuration; credentials are resolved only at the execution boundary. */\nexport interface InfraComputeConfigMap {\n readonly local: { readonly workingDirectory?: string };\n readonly hetzner: {\n readonly location: string;\n readonly serverType?: string;\n readonly image?: string;\n readonly credentials?: InfraControlPlaneCredentialRef;\n readonly ssh?: {\n readonly user?: string;\n readonly port?: number;\n readonly credentials?: InfraControlPlaneCredentialRef;\n };\n };\n}\n\nexport interface InfraRuntimeConfigMap {\n readonly minikube: {\n readonly profile?: string;\n readonly driver?: 'docker' | 'podman';\n readonly cpus?: number;\n readonly memoryMiB?: number;\n };\n readonly k3s: {\n readonly version?: string;\n readonly topology?: { readonly servers: number; readonly agents: number };\n };\n readonly 'docker-compose': { readonly projectName?: string };\n}\n\nexport type InfraComputeSelection<P extends InfraComputeProviderId = InfraComputeProviderId> = {\n [K in P]: { readonly provider: K } & InfraComputeConfigMap[K];\n}[P];\nexport type InfraRuntimeSelection<P extends InfraRuntimeProviderId = InfraRuntimeProviderId> = {\n [K in P]: { readonly provider: K } & InfraRuntimeConfigMap[K];\n}[P];\n\n/** A discriminated union derived from the runtime catalog, never a Cartesian product. */\nexport type InfraDeploymentSpec = {\n [R in InfraRuntimeProviderId]: {\n readonly compute: InfraComputeSelection<(typeof INFRA_RUNTIME_COMPATIBILITY)[R][number]>;\n readonly runtime: InfraRuntimeSelection<R>;\n };\n}[InfraRuntimeProviderId];\n\n/** Portable S3-compatible persistence target; privileged values stay behind one credential ref. */\nexport interface InfraS3PersistenceTarget {\n readonly endpoint: string;\n readonly region: string;\n readonly bucket: string;\n readonly credentials: InfraControlPlaneCredentialRef;\n readonly forcePathStyle?: boolean;\n}\n\n/** Scheduled database protection intent; the selected database provider owns its concrete engine. */\nexport interface InfraScheduledDatabaseBackupSpec {\n readonly mode: 'scheduled';\n readonly target: InfraS3PersistenceTarget;\n readonly intervalHours?: number;\n}\n\nexport interface InfraDatabaseConfigMap {\n readonly supabase: {\n readonly tier?: 'dev' | 'prod';\n readonly backup?: InfraScheduledDatabaseBackupSpec;\n };\n}\nexport interface InfraObjectStorageConfigMap {\n readonly supabase: {\n readonly buckets?: SerializableSet;\n readonly backend?: InfraS3PersistenceTarget;\n };\n readonly r2: {\n readonly buckets?: SerializableSet;\n readonly accountId?: string;\n readonly credentials?: InfraControlPlaneCredentialRef;\n };\n}\nexport interface InfraAuthConfigMap {\n readonly supabase: {\n readonly scope?: AuthScope;\n readonly flow?: AuthFlowConfig;\n readonly signIn?: AuthSignInSpec;\n readonly signUp?: AuthSignUpSpec;\n readonly oauth?: AuthOAuthConfig;\n readonly profile?: AuthProfileSpec;\n };\n}\nexport interface InfraAuthzConfigMap {\n readonly cerbos: {\n readonly kind: 'RBAC' | 'ABAC';\n readonly policies?: Readonly<Record<string, string>>;\n };\n}\nexport interface InfraSecretStoreConfigMap {\n readonly 'supabase-vault': { readonly schema?: string };\n}\n\nexport type InfraDatabaseSpec = {\n [P in InfraProviderFor<'database'>]: { readonly provider: P } & InfraDatabaseConfigMap[P];\n}[InfraProviderFor<'database'>];\nexport type InfraObjectStorageSpec = {\n [P in InfraProviderFor<'objectStorage'>]: {\n readonly provider: P;\n } & InfraObjectStorageConfigMap[P];\n}[InfraProviderFor<'objectStorage'>];\nexport type InfraAuthSpec = {\n [P in InfraProviderFor<'auth'>]: { readonly provider: P } & InfraAuthConfigMap[P];\n}[InfraProviderFor<'auth'>];\nexport type InfraAuthzSpec = {\n [P in InfraProviderFor<'authz'>]: { readonly provider: P } & InfraAuthzConfigMap[P];\n}[InfraProviderFor<'authz'>];\nexport type InfraSecretStoreSpec = {\n [P in InfraProviderFor<'secretStore'>]: { readonly provider: P } & InfraSecretStoreConfigMap[P];\n}[InfraProviderFor<'secretStore'>];\n\nexport interface InfraNetworkingTlsSpec {\n /** First production slice: runtime-managed ACME using the HTTP-01 challenge. */\n readonly mode: 'acme-http-01';\n /** ACME registration and expiry-notification contact. */\n readonly contactEmail: string;\n}\n\nexport interface InfraNetworkingSpec {\n /** Public DNS name intent, not automatic DNS/CDN vendor provisioning. */\n readonly domain?: string;\n /** Absolute HTTP(S) origin used by workloads that must know their external URL at startup. */\n readonly publicBaseUrl?: string;\n /** Runtime-neutral automatic TLS intent; the selected runtime owns concrete ingress configuration. */\n readonly tls?: InfraNetworkingTlsSpec;\n}\n\nexport interface InfraEnvironmentSpec {\n readonly deployment: InfraDeploymentSpec;\n readonly database?: InfraDatabaseSpec;\n readonly objectStorage?: InfraObjectStorageSpec;\n readonly auth?: InfraAuthSpec;\n readonly authz?: InfraAuthzSpec;\n readonly secretStore?: InfraSecretStoreSpec;\n readonly networking?: InfraNetworkingSpec;\n readonly workloads?: InfraWorkloadRegistry;\n}\n\nexport type InfraModuleId = string;\n\nexport interface InfraModuleSpec {\n readonly config?: DataContractValue;\n}\n\nexport type InfraModuleRegistry = Readonly<Record<InfraModuleId, InfraModuleSpec>>;\n\nexport interface InfraManifest {\n readonly environments: Readonly<\n Record<'local', InfraEnvironmentSpec> &\n Partial<Record<Exclude<AppEnvironmentId, 'local'>, InfraEnvironmentSpec>>\n >;\n readonly apis?: ApiDefinitionRegistry;\n readonly modules: InfraModuleRegistry;\n}\n"]}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { SerializableSet } from '../collections';
|
|
1
2
|
import type { InfraControlPlaneCredentialRef, InfraSecretReference } from './infraSecrets';
|
|
2
3
|
export interface InfraWorkloadArtifact {
|
|
3
4
|
readonly kind: 'image';
|
|
@@ -25,7 +26,6 @@ export type InfraWorkloadValue = InfraWorkloadScalarValue | {
|
|
|
25
26
|
readonly segments: readonly InfraWorkloadScalarValue[];
|
|
26
27
|
};
|
|
27
28
|
export interface InfraWorkloadPort {
|
|
28
|
-
readonly name: string;
|
|
29
29
|
readonly port: number;
|
|
30
30
|
readonly protocol?: 'tcp' | 'udp';
|
|
31
31
|
/** Exact external listener port requested for a public single-replica workload. */
|
|
@@ -59,25 +59,25 @@ export interface InfraWorkloadVolumeSpec {
|
|
|
59
59
|
/** Persistence survives down and is retained by default on destroy. */
|
|
60
60
|
readonly retention: 'retain' | 'delete-on-destroy';
|
|
61
61
|
}
|
|
62
|
-
|
|
63
|
-
export
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
}
|
|
62
|
+
export type InfraWorkloadId = string;
|
|
63
|
+
export type InfraWorkloadPortRegistry = Readonly<Record<string, InfraWorkloadPort>>;
|
|
64
|
+
export type InfraWorkloadFileMap = Readonly<Record<string, InfraWorkloadValue>>;
|
|
65
|
+
export type InfraWorkloadVolumeRegistry = Readonly<Record<string, InfraWorkloadVolumeSpec>>;
|
|
67
66
|
export interface InfraWorkloadSpec {
|
|
68
|
-
readonly id:
|
|
67
|
+
readonly id: InfraWorkloadId;
|
|
69
68
|
readonly artifact: InfraWorkloadArtifact;
|
|
70
69
|
readonly command?: readonly string[];
|
|
71
70
|
readonly args?: readonly string[];
|
|
72
|
-
readonly ports?:
|
|
71
|
+
readonly ports?: InfraWorkloadPortRegistry;
|
|
73
72
|
readonly environment?: Readonly<Record<string, InfraWorkloadValue>>;
|
|
74
|
-
readonly files?:
|
|
73
|
+
readonly files?: InfraWorkloadFileMap;
|
|
75
74
|
readonly health?: InfraWorkloadHealthSpec;
|
|
76
75
|
readonly resources?: InfraWorkloadResourceSpec;
|
|
77
|
-
readonly persistence?:
|
|
76
|
+
readonly persistence?: InfraWorkloadVolumeRegistry;
|
|
78
77
|
readonly exposure?: 'internal' | 'public';
|
|
79
78
|
readonly replicas?: number;
|
|
80
79
|
/** IDs in the composed desired-state graph; the orchestrator validates missing/cyclic edges. */
|
|
81
|
-
readonly dependsOn?:
|
|
80
|
+
readonly dependsOn?: SerializableSet;
|
|
82
81
|
}
|
|
82
|
+
export type InfraWorkloadRegistry = Readonly<Record<InfraWorkloadId, InfraWorkloadSpec>>;
|
|
83
83
|
//# sourceMappingURL=infraWorkload.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"infraWorkload.d.ts","sourceRoot":"","sources":["../../src/types/infraWorkload.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,8BAA8B,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAE3F,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IACvB,2FAA2F;IAC3F,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,MAAM,wBAAwB,GAChC;IAAE,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GACpD;IAAE,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;IAAC,QAAQ,CAAC,SAAS,EAAE,oBAAoB,CAAA;CAAE,GACrE;IACE,QAAQ,CAAC,IAAI,EAAE,YAAY,CAAC;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QAAQ,CAAC,QAAQ,CAAC,EAAE,UAAU,GAAG,QAAQ,CAAC;IAC1C,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,gGAAgG;IAChG,QAAQ,CAAC,SAAS,CAAC,EAAE,eAAe,CAAC;CACtC;AAED,MAAM,MAAM,qBAAqB,GAAG,QAAQ,CAAC,MAAM,CAAC,eAAe,EAAE,iBAAiB,CAAC,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"infraWorkload.js","sourceRoot":"","sources":["../../src/types/infraWorkload.ts"],"names":[],"mappings":"","sourcesContent":["import type { InfraControlPlaneCredentialRef, InfraSecretReference } from './infraSecrets';\n\nexport interface InfraWorkloadArtifact {\n readonly kind: 'image';\n /** Prebuilt image, optionally pinned by digest. No registry/build provider requirement. */\n readonly image: string;\n}\n\nexport type InfraWorkloadScalarValue =\n | { readonly kind: 'literal'; readonly value: string }\n | { readonly kind: 'secret'; readonly reference: InfraSecretReference }\n | {\n readonly kind: 'credential';\n readonly reference: InfraControlPlaneCredentialRef;\n readonly key: string;\n }\n | { readonly kind: 'output'; readonly resourceId: string; readonly output: string };\n\nexport type InfraWorkloadValue =\n | InfraWorkloadScalarValue\n | {\n readonly kind: 'template';\n /** Ordered scalar segments materialized into one value only at the runtime boundary. */\n readonly segments: readonly InfraWorkloadScalarValue[];\n };\n\nexport interface InfraWorkloadPort {\n readonly
|
|
1
|
+
{"version":3,"file":"infraWorkload.js","sourceRoot":"","sources":["../../src/types/infraWorkload.ts"],"names":[],"mappings":"","sourcesContent":["import type { SerializableSet } from '../collections';\nimport type { InfraControlPlaneCredentialRef, InfraSecretReference } from './infraSecrets';\n\nexport interface InfraWorkloadArtifact {\n readonly kind: 'image';\n /** Prebuilt image, optionally pinned by digest. No registry/build provider requirement. */\n readonly image: string;\n}\n\nexport type InfraWorkloadScalarValue =\n | { readonly kind: 'literal'; readonly value: string }\n | { readonly kind: 'secret'; readonly reference: InfraSecretReference }\n | {\n readonly kind: 'credential';\n readonly reference: InfraControlPlaneCredentialRef;\n readonly key: string;\n }\n | { readonly kind: 'output'; readonly resourceId: string; readonly output: string };\n\nexport type InfraWorkloadValue =\n | InfraWorkloadScalarValue\n | {\n readonly kind: 'template';\n /** Ordered scalar segments materialized into one value only at the runtime boundary. */\n readonly segments: readonly InfraWorkloadScalarValue[];\n };\n\nexport interface InfraWorkloadPort {\n readonly port: number;\n readonly protocol?: 'tcp' | 'udp';\n /** Exact external listener port requested for a public single-replica workload. */\n readonly publishedPort?: number;\n}\n\nexport type InfraWorkloadHealthSpec = {\n readonly intervalSeconds?: number;\n readonly timeoutSeconds?: number;\n readonly failureThreshold?: number;\n} & (\n | { readonly kind: 'http'; readonly port: number; readonly path: string }\n | { readonly kind: 'tcp'; readonly port: number }\n | { readonly kind: 'command'; readonly command: readonly string[] }\n);\n\nexport interface InfraWorkloadResourceSpec {\n readonly cpuMillis?: number;\n readonly memoryMiB?: number;\n}\n\nexport interface InfraWorkloadVolumeSpec {\n readonly id: string;\n readonly mountPath: string;\n readonly sizeGiB: number;\n /** Seed a newly created empty volume from the image contents at mountPath before workload start. */\n readonly seed?: 'image';\n /** Persistence survives down and is retained by default on destroy. */\n readonly retention: 'retain' | 'delete-on-destroy';\n}\n\nexport type InfraWorkloadId = string;\nexport type InfraWorkloadPortRegistry = Readonly<Record<string, InfraWorkloadPort>>;\nexport type InfraWorkloadFileMap = Readonly<Record<string, InfraWorkloadValue>>;\nexport type InfraWorkloadVolumeRegistry = Readonly<Record<string, InfraWorkloadVolumeSpec>>;\n\nexport interface InfraWorkloadSpec {\n readonly id: InfraWorkloadId;\n readonly artifact: InfraWorkloadArtifact;\n readonly command?: readonly string[];\n readonly args?: readonly string[];\n readonly ports?: InfraWorkloadPortRegistry;\n readonly environment?: Readonly<Record<string, InfraWorkloadValue>>;\n readonly files?: InfraWorkloadFileMap;\n readonly health?: InfraWorkloadHealthSpec;\n readonly resources?: InfraWorkloadResourceSpec;\n readonly persistence?: InfraWorkloadVolumeRegistry;\n readonly exposure?: 'internal' | 'public';\n readonly replicas?: number;\n /** IDs in the composed desired-state graph; the orchestrator validates missing/cyclic edges. */\n readonly dependsOn?: SerializableSet;\n}\n\nexport type InfraWorkloadRegistry = Readonly<Record<InfraWorkloadId, InfraWorkloadSpec>>;\n"]}
|
package/dist/types.d.ts
CHANGED
|
@@ -9,14 +9,16 @@ import type { MediaAssetReference, MediaManifest } from './media';
|
|
|
9
9
|
import type { AppNavigatorManifest } from './navigator';
|
|
10
10
|
import type { RepositoryManifest } from './repository';
|
|
11
11
|
import type { ScreenRequirements } from './requirements';
|
|
12
|
+
import type { SerializableValue } from './serializable';
|
|
12
13
|
import type { AppStateSpec } from './state';
|
|
13
14
|
import type { ThemeGlobalTokenOverrides, ThemeRecipeOverrides } from './theme';
|
|
14
15
|
export interface ThemeModeConfig {
|
|
15
16
|
primaryColor: string;
|
|
16
17
|
harmony: ColorHarmony;
|
|
17
18
|
}
|
|
19
|
+
export type ThemeId = string;
|
|
18
20
|
export interface ThemeConfig {
|
|
19
|
-
id:
|
|
21
|
+
id: ThemeId;
|
|
20
22
|
name: string;
|
|
21
23
|
light: ThemeModeConfig;
|
|
22
24
|
dark: ThemeModeConfig;
|
|
@@ -25,6 +27,7 @@ export interface ThemeConfig {
|
|
|
25
27
|
/** Component/pattern recipe override values; recipe schemas remain package-owned metadata. */
|
|
26
28
|
recipes?: ThemeRecipeOverrides;
|
|
27
29
|
}
|
|
30
|
+
export type ThemeRegistry = Readonly<Record<ThemeId, ThemeConfig>>;
|
|
28
31
|
export type ActionType = 'navigate' | 'alert' | 'console' | 'toggleDarkMode' | 'setLanguage' | 'search' | 'filter';
|
|
29
32
|
export interface NavigateAction {
|
|
30
33
|
type: 'navigate';
|
|
@@ -68,9 +71,7 @@ export interface FilterAction {
|
|
|
68
71
|
};
|
|
69
72
|
}
|
|
70
73
|
export type Action = AlertAction | ConsoleAction | FilterAction | NavigateAction | SearchAction | SetLanguageAction | ToggleDarkModeAction;
|
|
71
|
-
export type ManifestValue =
|
|
72
|
-
readonly [key: string]: ManifestValue;
|
|
73
|
-
};
|
|
74
|
+
export type ManifestValue = SerializableValue;
|
|
74
75
|
export type ComponentEventPayloadValue = ManifestValue;
|
|
75
76
|
export interface ComponentEventDto<TType extends string = string, TPayload extends object = Record<string, ComponentEventPayloadValue>> {
|
|
76
77
|
readonly type: TType;
|
|
@@ -172,12 +173,12 @@ export interface AppManifest {
|
|
|
172
173
|
slug: string;
|
|
173
174
|
version: string;
|
|
174
175
|
category: AppCategory;
|
|
175
|
-
themeId:
|
|
176
|
+
themeId: ThemeId;
|
|
176
177
|
created?: string;
|
|
177
178
|
updated?: string;
|
|
178
179
|
};
|
|
179
|
-
themes:
|
|
180
|
-
activeThemeId:
|
|
180
|
+
themes: ThemeRegistry;
|
|
181
|
+
activeThemeId: ThemeId;
|
|
181
182
|
activeThemeMode?: 'dark' | 'light';
|
|
182
183
|
splashScreen?: SplashScreenSpec;
|
|
183
184
|
/** Studio-managed authoring media. Runtime/user uploads are intentionally separate. */
|
|
@@ -188,7 +189,7 @@ export interface AppManifest {
|
|
|
188
189
|
state?: AppStateSpec;
|
|
189
190
|
infra: InfraManifest;
|
|
190
191
|
navigator: AppNavigatorManifest;
|
|
191
|
-
screens: Record<string, ScreenSpec
|
|
192
|
+
screens: Readonly<Record<string, ScreenSpec>>;
|
|
192
193
|
dataSources?: DataSourceRegistry;
|
|
193
194
|
dataBindings?: ComponentDataBindingRegistry;
|
|
194
195
|
repository?: RepositoryManifest;
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAE5D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,KAAK,EAAE,kBAAkB,EAAE,e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EAAE,CAAC;KACnB,CAAC;CACH;AAED,MAAM,WAAW,WAAW;IAC1B,QAAQ,EAAE;QACR,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,EAAE,MAAM,CAAC;QAChB,QAAQ,EAAE,WAAW,CAAC;QACtB,OAAO,EAAE,OAAO,CAAC;QACjB,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,CAAC;IACF,MAAM,EAAE,aAAa,CAAC;IACtB,aAAa,EAAE,OAAO,CAAC;IACvB,eAAe,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IACnC,YAAY,CAAC,EAAE,gBAAgB,CAAC;IAChC,uFAAuF;IACvF,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,yFAAyF;IACzF,MAAM,CAAC,EAAE,iBAAiB,CAAC;IAC3B,6DAA6D;IAC7D,KAAK,CAAC,EAAE,YAAY,CAAC;IACrB,KAAK,EAAE,aAAa,CAAC;IACrB,SAAS,EAAE,oBAAoB,CAAC;IAChC,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC,CAAC;IAC9C,WAAW,CAAC,EAAE,kBAAkB,CAAC;IACjC,YAAY,CAAC,EAAE,4BAA4B,CAAC;IAC5C,UAAU,CAAC,EAAE,kBAAkB,CAAC;IAChC,QAAQ,EAAE,WAAW,CAAC;CACvB"}
|
package/dist/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AA4IA,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,eAAe;IACf,uBAAuB;IACvB,iBAAiB;IACjB,oBAAoB;IACpB,qBAAqB;IACrB,eAAe;IACf,YAAY;IACZ,OAAO;IACP,iBAAiB;IACjB,gBAAgB;IAChB,aAAa;IACb,WAAW;IACX,SAAS;IACT,aAAa;IACb,mBAAmB;IACnB,gBAAgB;IAChB,aAAa;IACb,WAAW;IACX,mBAAmB;IACnB,kBAAkB;IAClB,QAAQ;IACR,iBAAiB;IACjB,SAAS;CACD,CAAC;AAGX,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,QAAQ,EAAE,MAAM,EAAE,YAAY,CAAU,CAAC;AAGrE,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,OAAO,EAAE,UAAU,EAAE,OAAO,CAAU,CAAC;AAGhF,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,YAAY,EAAE,qBAAqB,CAAU,CAAC;AAGpF,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,GAAG,wBAAwB;IAC3B,WAAW;IACX,UAAU;IACV,aAAa;IACb,WAAW;CACH,CAAC;AAIX,MAAM,CAAC,MAAM,mCAAmC,GAAG,CAAC,YAAY,CAAU,CAAC;AAG3E,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAAC,SAAS,EAAE,KAAK,EAAE,KAAK,CAAU,CAAC;AAGjF,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAAC,KAAK,EAAE,KAAK,CAAU,CAAC","sourcesContent":["import type { ColorHarmony } from '@ankhorage/color-theory';\n\nimport type { SplashScreenSpec } from './appManifest/splashScreen';\nimport type { AuthIdentifierKind, AuthSignUpField } from './auth';\nimport type {\n BindingValueSource,\n ComponentDataBindingRegistry,\n ScreenDataLoaderDefinition,\n} from './bindings';\nimport type { DataSourceRegistry } from './data';\nimport type { AppDeployManifest } from './deploy';\nimport type { InfraManifest } from './infra';\nimport type { MediaAssetReference, MediaManifest } from './media';\nimport type { AppNavigatorManifest } from './navigator';\nimport type { RepositoryManifest } from './repository';\nimport type { ScreenRequirements } from './requirements';\nimport type { SerializableValue } from './serializable';\nimport type { AppStateSpec } from './state';\nimport type { ThemeGlobalTokenOverrides, ThemeRecipeOverrides } from './theme';\n\nexport interface ThemeModeConfig {\n primaryColor: string;\n harmony: ColorHarmony;\n}\n\nexport type ThemeId = string;\n\nexport interface ThemeConfig {\n id: ThemeId;\n name: string;\n light: ThemeModeConfig;\n dark: ThemeModeConfig;\n /** Theme-global authored token overrides shared by light and dark mode. */\n tokens?: ThemeGlobalTokenOverrides;\n /** Component/pattern recipe override values; recipe schemas remain package-owned metadata. */\n recipes?: ThemeRecipeOverrides;\n}\n\nexport type ThemeRegistry = Readonly<Record<ThemeId, ThemeConfig>>;\n\nexport type ActionType =\n 'navigate' | 'alert' | 'console' | 'toggleDarkMode' | 'setLanguage' | 'search' | 'filter';\n\nexport interface NavigateAction {\n type: 'navigate';\n payload: {\n route: string;\n params?: Record<string, number | string>;\n };\n}\n\nexport interface AlertAction {\n type: 'alert';\n payload?: {\n message?: string;\n };\n}\n\nexport interface ConsoleAction {\n type: 'console';\n payload?: Record<string, unknown>;\n}\n\nexport interface ToggleDarkModeAction {\n type: 'toggleDarkMode';\n payload?: never;\n}\n\nexport interface SetLanguageAction {\n type: 'setLanguage';\n payload: {\n locale: string;\n };\n}\n\nexport interface SearchAction {\n type: 'search';\n payload: {\n query: string;\n scope?: string;\n };\n}\n\nexport interface FilterAction {\n type: 'filter';\n payload: {\n filterKey: string;\n filterValue: string;\n };\n}\n\nexport type Action =\n | AlertAction\n | ConsoleAction\n | FilterAction\n | NavigateAction\n | SearchAction\n | SetLanguageAction\n | ToggleDarkModeAction;\n\nexport type ManifestValue = SerializableValue;\n\nexport type ComponentEventPayloadValue = ManifestValue;\n\nexport interface ComponentEventDto<\n TType extends string = string,\n TPayload extends object = Record<string, ComponentEventPayloadValue>,\n> {\n readonly type: TType;\n readonly sourceNodeId: string;\n readonly payload: TPayload;\n}\n\nexport type FormSubmitValues = Record<string, ComponentEventPayloadValue>;\n\nexport type FormSubmitEventDto = ComponentEventDto<\n 'form.submit',\n {\n readonly values: FormSubmitValues;\n }\n>;\n\nexport type ButtonPressEventDto = ComponentEventDto<'button.press', Record<string, never>>;\n\nexport interface CollectionItemPressPayload {\n readonly itemId: string | number;\n readonly item: Record<string, ComponentEventPayloadValue>;\n}\n\nexport type CollectionItemPressEventDto = ComponentEventDto<\n 'collection.itemPress',\n CollectionItemPressPayload\n>;\n\nexport type ComponentEventDtoKind =\n ButtonPressEventDto['type'] | CollectionItemPressEventDto['type'] | FormSubmitEventDto['type'];\n\nexport type KnownComponentEventDto =\n ButtonPressEventDto | CollectionItemPressEventDto | FormSubmitEventDto;\n\nexport const APP_CATEGORIES = [\n 'books_reading',\n 'business_productivity',\n 'developer_tools',\n 'education_learning',\n 'entertainment_media',\n 'finance_money',\n 'food_drink',\n 'games',\n 'graphics_design',\n 'health_fitness',\n 'kids_family',\n 'lifestyle',\n 'medical',\n 'music_audio',\n 'navigation_travel',\n 'news_magazines',\n 'photo_video',\n 'reference',\n 'shopping_commerce',\n 'social_community',\n 'sports',\n 'utilities_tools',\n 'weather',\n] as const;\nexport type AppCategory = (typeof APP_CATEGORIES)[number];\n\nexport const AUTH_SCOPES = ['global', 'none', 'integrated'] as const;\nexport type AuthScope = (typeof AUTH_SCOPES)[number];\n\nexport const AUTH_SIGN_IN_IDENTIFIERS = ['email', 'username', 'phone'] as const;\nexport type AuthSignInIdentifier = AuthIdentifierKind;\n\nexport const AUTH_SIGN_UP_POLICIES = ['autoSignIn', 'requireVerification'] as const;\nexport type AuthSignUpPolicy = (typeof AUTH_SIGN_UP_POLICIES)[number];\n\nexport const AUTH_PROFILE_FIELDS = [\n ...AUTH_SIGN_IN_IDENTIFIERS,\n 'firstName',\n 'lastName',\n 'displayName',\n 'avatarUrl',\n] as const;\nexport type KnownAuthProfileField = (typeof AUTH_PROFILE_FIELDS)[number];\nexport type AuthProfileField = KnownAuthProfileField | (string & {});\n\nexport const AUTH_PROFILE_PRIMARY_KEY_STRATEGIES = ['authUserId'] as const;\nexport type AuthProfilePrimaryKeyStrategy = (typeof AUTH_PROFILE_PRIMARY_KEY_STRATEGIES)[number];\n\nexport const AUTH_PROFILE_CREATE_STRATEGIES = ['trigger', 'api', 'app'] as const;\nexport type AuthProfileCreateStrategy = (typeof AUTH_PROFILE_CREATE_STRATEGIES)[number];\n\nexport const AUTH_PROFILE_UPDATE_STRATEGIES = ['api', 'app'] as const;\nexport type AuthProfileUpdateStrategy = (typeof AUTH_PROFILE_UPDATE_STRATEGIES)[number];\n\ninterface IconPresentationSpec {\n size?: number | string;\n color?: string;\n}\n\nexport interface NamedIconSpec extends IconPresentationSpec {\n name: string;\n provider?: string;\n source?: never;\n}\n\nexport interface SvgIconSpec extends IconPresentationSpec {\n source: MediaAssetReference;\n name?: never;\n provider?: never;\n}\n\nexport type IconSpec = NamedIconSpec | SvgIconSpec;\n\nexport interface UiNodeRepeatSpec {\n source: BindingValueSource;\n itemAlias?: string;\n keyPath?: string;\n empty?: readonly UiNode[];\n}\n\nexport interface UiNode {\n id: string;\n type: string;\n alias?: string;\n props?: Record<string, unknown>;\n children?: UiNode[];\n style?: Record<string, number | string>;\n repeat?: UiNodeRepeatSpec;\n}\n\nexport interface ScreenSpec {\n id: string;\n name: string;\n title?: string;\n description?: string;\n root: UiNode;\n dataLoaders?: readonly ScreenDataLoaderDefinition[];\n requires?: ScreenRequirements;\n}\n\nexport interface AuthSignInSpec {\n identifiers: AuthSignInIdentifier[];\n}\n\nexport interface AuthSignUpSpec {\n requiredFields: AuthSignUpField[];\n optionalFields?: AuthSignUpField[];\n signUpPolicy?: AuthSignUpPolicy;\n}\n\nexport interface AuthProfileSpec {\n fields: AuthProfileField[];\n table?: string;\n primaryKey?: AuthProfilePrimaryKeyStrategy;\n createStrategy?: AuthProfileCreateStrategy;\n updateStrategy?: AuthProfileUpdateStrategy;\n}\n\nexport interface AppSettings {\n localization: {\n defaultLocale: string;\n locales: string[];\n };\n}\n\nexport interface AppManifest {\n metadata: {\n name: string;\n slug: string;\n version: string;\n category: AppCategory;\n themeId: ThemeId;\n created?: string;\n updated?: string;\n };\n themes: ThemeRegistry;\n activeThemeId: ThemeId;\n activeThemeMode?: 'dark' | 'light';\n splashScreen?: SplashScreenSpec;\n /** Studio-managed authoring media. Runtime/user uploads are intentionally separate. */\n media?: MediaManifest;\n /** App distribution desired state, separate from environment-specific infrastructure. */\n deploy?: AppDeployManifest;\n /** Application runtime state is not provisioned by Infra. */\n state?: AppStateSpec;\n infra: InfraManifest;\n navigator: AppNavigatorManifest;\n screens: Readonly<Record<string, ScreenSpec>>;\n dataSources?: DataSourceRegistry;\n dataBindings?: ComponentDataBindingRegistry;\n repository?: RepositoryManifest;\n settings: AppSettings;\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ankhorage/contracts",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "22.0.0",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"ankh": {
|
|
6
6
|
"category": "contracts",
|
|
@@ -97,18 +97,19 @@
|
|
|
97
97
|
},
|
|
98
98
|
"description": "Serializable app, action, theme, auth, and secret-store contracts for Ankhorage.",
|
|
99
99
|
"keywords": [
|
|
100
|
-
"
|
|
100
|
+
"adapter",
|
|
101
|
+
"ankhorage",
|
|
102
|
+
"assets",
|
|
103
|
+
"auth",
|
|
101
104
|
"contracts",
|
|
102
|
-
"schema",
|
|
103
105
|
"manifest",
|
|
104
|
-
"auth",
|
|
105
|
-
"secrets",
|
|
106
|
-
"secret-store",
|
|
107
|
-
"storage",
|
|
108
|
-
"adapter",
|
|
109
106
|
"media",
|
|
110
107
|
"navigator",
|
|
111
|
-
"
|
|
108
|
+
"schema",
|
|
109
|
+
"secret-store",
|
|
110
|
+
"secrets",
|
|
111
|
+
"storage",
|
|
112
|
+
"typescript"
|
|
112
113
|
],
|
|
113
114
|
"files": [
|
|
114
115
|
"dist",
|
package/src/appManifest/apis.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { hasOnlyKeys, isRecord } from '@ankhorage/utility/object';
|
|
2
2
|
import { isNonEmptyString, isOptionalString } from '@ankhorage/utility/string';
|
|
3
3
|
|
|
4
|
-
import type { ApiDefinition,
|
|
4
|
+
import type { ApiDefinition, ApiDefinitionRegistry } from '../data';
|
|
5
5
|
import { isCredentialRef, isDataEndpointRegistry, isDataSchemaRegistry } from './data';
|
|
6
6
|
import { isManifestValue } from './isManifestValue';
|
|
7
7
|
|
|
@@ -22,11 +22,14 @@ const INTERNAL_REST_KEYS = [...API_BASE_KEYS, 'basePath'] as const;
|
|
|
22
22
|
const OPEN_API_KEYS = ['url', 'documentId', 'version'] as const;
|
|
23
23
|
const INTROSPECTION_KEYS = ['enabled', 'schemaVersion'] as const;
|
|
24
24
|
|
|
25
|
-
/*** Validate API definitions and require
|
|
26
|
-
export function
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
25
|
+
/*** Validate API definitions in the canonical registry and require key/identity consistency. */
|
|
26
|
+
export function isApiDefinitionRegistry(value: unknown): value is ApiDefinitionRegistry {
|
|
27
|
+
return (
|
|
28
|
+
isRecord(value) &&
|
|
29
|
+
Object.entries(value).every(
|
|
30
|
+
([registryKey, api]) => isApiDefinition(api) && registryKey === api.id,
|
|
31
|
+
)
|
|
32
|
+
);
|
|
30
33
|
}
|
|
31
34
|
|
|
32
35
|
/*** Validate one API definition against its origin and protocol branch. */
|
|
@@ -5,7 +5,13 @@ import { isManifestValue } from './isManifestValue';
|
|
|
5
5
|
|
|
6
6
|
/*** Validate every component binding in the authored registry. */
|
|
7
7
|
export function isComponentDataBindingRegistry(value: unknown): boolean {
|
|
8
|
-
return
|
|
8
|
+
return (
|
|
9
|
+
isRecord(value) &&
|
|
10
|
+
Object.entries(value).every(
|
|
11
|
+
([componentId, binding]) =>
|
|
12
|
+
isComponentDataBinding(binding) && isRecord(binding) && binding.componentId === componentId,
|
|
13
|
+
)
|
|
14
|
+
);
|
|
9
15
|
}
|
|
10
16
|
|
|
11
17
|
/*** Validate literal, operation and path-based binding sources. */
|
package/src/appManifest/data.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { isStringArray } from '@ankhorage/utility/array';
|
|
2
|
-
import { isRecord } from '@ankhorage/utility/object';
|
|
2
|
+
import { isRecord, readOwnProperty } from '@ankhorage/utility/object';
|
|
3
3
|
import { isOptionalString } from '@ankhorage/utility/string';
|
|
4
4
|
|
|
5
5
|
import { isManifestValue } from './isManifestValue';
|
|
@@ -18,7 +18,13 @@ const PARAMETER_LOCATIONS = new Set(['body', 'cookie', 'header', 'path', 'query'
|
|
|
18
18
|
|
|
19
19
|
/*** Validate every endpoint in the data endpoint registry. */
|
|
20
20
|
export function isDataEndpointRegistry(value: unknown): boolean {
|
|
21
|
-
return
|
|
21
|
+
return (
|
|
22
|
+
isRecord(value) &&
|
|
23
|
+
Object.entries(value).every(
|
|
24
|
+
([endpointId, endpoint]) =>
|
|
25
|
+
isDataEndpointConfig(endpoint) && isRecord(endpoint) && endpoint.id === endpointId,
|
|
26
|
+
)
|
|
27
|
+
);
|
|
22
28
|
}
|
|
23
29
|
|
|
24
30
|
/*** Validate every schema in the data schema registry. */
|
|
@@ -61,7 +67,10 @@ function isDataEndpointConfig(value: unknown): boolean {
|
|
|
61
67
|
isOptionalString(value.path) &&
|
|
62
68
|
(value.credential === undefined || isCredentialRef(value.credential)) &&
|
|
63
69
|
isRecord(value.operations) &&
|
|
64
|
-
Object.
|
|
70
|
+
Object.entries(value.operations).every(
|
|
71
|
+
([operationId, operation]) =>
|
|
72
|
+
isDataOperationConfig(operation) && isRecord(operation) && operation.id === operationId,
|
|
73
|
+
) &&
|
|
65
74
|
(value.metadata === undefined || isManifestValue(value.metadata))
|
|
66
75
|
);
|
|
67
76
|
}
|
|
@@ -182,7 +191,7 @@ function isOptionalSchemaCollections(value: Record<string, unknown>): boolean {
|
|
|
182
191
|
/*** Validate optional schema alternatives and intersections. */
|
|
183
192
|
function isOptionalSchemaComposition(value: Record<string, unknown>): boolean {
|
|
184
193
|
return ['allOf', 'anyOf', 'oneOf'].every((key) => {
|
|
185
|
-
const entry = value
|
|
194
|
+
const entry = readOwnProperty(value, key);
|
|
186
195
|
return entry === undefined || (Array.isArray(entry) && entry.every(isDataSchema));
|
|
187
196
|
});
|
|
188
197
|
}
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
isManifestMetadata,
|
|
15
15
|
isScreenRegistry,
|
|
16
16
|
isSplashScreenSpec,
|
|
17
|
-
|
|
17
|
+
isThemeRegistry,
|
|
18
18
|
} from './screens';
|
|
19
19
|
|
|
20
20
|
/*** Return whether an unknown value satisfies the canonical AppManifest shape. */
|
|
@@ -74,9 +74,9 @@ function isAppSettings(value: unknown): boolean {
|
|
|
74
74
|
/*** Validate authored appearance as one cohesive manifest concern. */
|
|
75
75
|
function isPresentation(value: Record<string, unknown>): boolean {
|
|
76
76
|
return (
|
|
77
|
-
|
|
78
|
-
value.themes.every(isThemeConfig) &&
|
|
77
|
+
isThemeRegistry(value.themes) &&
|
|
79
78
|
typeof value.activeThemeId === 'string' &&
|
|
79
|
+
Object.hasOwn(value.themes, value.activeThemeId) &&
|
|
80
80
|
isActiveThemeMode(value.activeThemeMode) &&
|
|
81
81
|
(value.splashScreen === undefined || isSplashScreenSpec(value.splashScreen)) &&
|
|
82
82
|
(value.media === undefined || isMediaManifest(value.media))
|