@ingestron/core 0.12.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/LICENSE +202 -0
- package/NOTICE +6 -0
- package/README.md +56 -0
- package/SECURITY.md +44 -0
- package/THIRD_PARTY_NOTICES.md +693 -0
- package/dist/assets/schemas/ODCS-LICENSE +201 -0
- package/dist/assets/schemas/odcs-3.1.0.json +2929 -0
- package/dist/assets/schemas/provenance.json +16 -0
- package/dist/compiler-fingerprint.json +84 -0
- package/dist/core/authoring.d.ts +55 -0
- package/dist/core/authoring.js +315 -0
- package/dist/core/config.d.ts +34 -0
- package/dist/core/config.js +233 -0
- package/dist/core/connections.d.ts +19 -0
- package/dist/core/connections.js +203 -0
- package/dist/core/connector-package.d.ts +37 -0
- package/dist/core/connector-package.js +43 -0
- package/dist/core/contracts.d.ts +8 -0
- package/dist/core/contracts.js +45 -0
- package/dist/core/deliveries.d.ts +16 -0
- package/dist/core/deliveries.js +28 -0
- package/dist/core/delivery-exports.d.ts +20 -0
- package/dist/core/delivery-exports.js +119 -0
- package/dist/core/development.d.ts +50 -0
- package/dist/core/development.js +94 -0
- package/dist/core/ecosystem-authoring.d.ts +13 -0
- package/dist/core/ecosystem-authoring.js +82 -0
- package/dist/core/errors.d.ts +12 -0
- package/dist/core/errors.js +43 -0
- package/dist/core/execution.d.ts +28 -0
- package/dist/core/execution.js +297 -0
- package/dist/core/extension-packs.d.ts +8 -0
- package/dist/core/extension-packs.js +34 -0
- package/dist/core/fingerprint.d.ts +1 -0
- package/dist/core/fingerprint.js +16 -0
- package/dist/core/generate.d.ts +16 -0
- package/dist/core/generate.js +198 -0
- package/dist/core/installation.d.ts +3 -0
- package/dist/core/installation.js +14 -0
- package/dist/core/installed-plugins.d.ts +41 -0
- package/dist/core/installed-plugins.js +92 -0
- package/dist/core/model-pack-schema.d.ts +46 -0
- package/dist/core/model-pack-schema.js +81 -0
- package/dist/core/model-packs.d.ts +4 -0
- package/dist/core/model-packs.js +33 -0
- package/dist/core/operations.d.ts +346 -0
- package/dist/core/operations.js +760 -0
- package/dist/core/package-references.d.ts +36 -0
- package/dist/core/package-references.js +103 -0
- package/dist/core/packages.d.ts +340 -0
- package/dist/core/packages.js +579 -0
- package/dist/core/planner.d.ts +114 -0
- package/dist/core/planner.js +821 -0
- package/dist/core/project-build.d.ts +13 -0
- package/dist/core/project-build.js +266 -0
- package/dist/core/provider-commands.d.ts +83 -0
- package/dist/core/provider-commands.js +252 -0
- package/dist/core/provider-starter.d.ts +5 -0
- package/dist/core/provider-starter.js +155 -0
- package/dist/core/report-pack-schema.d.ts +13 -0
- package/dist/core/report-pack-schema.js +15 -0
- package/dist/core/schema.d.ts +257 -0
- package/dist/core/schema.js +126 -0
- package/dist/core/workflows.d.ts +91 -0
- package/dist/core/workflows.js +438 -0
- package/dist/plugins/authoring.d.ts +88 -0
- package/dist/plugins/authoring.js +34 -0
- package/dist/plugins/compatibility.d.ts +23 -0
- package/dist/plugins/compatibility.js +55 -0
- package/dist/plugins/generation.d.ts +5 -0
- package/dist/plugins/generation.js +105 -0
- package/dist/plugins/provider-renderer.d.ts +7 -0
- package/dist/plugins/provider-renderer.js +37 -0
- package/dist/plugins/provider-worker.d.ts +1 -0
- package/dist/plugins/provider-worker.js +74 -0
- package/dist/sdk/adapter.d.ts +15 -0
- package/dist/sdk/adapter.js +15 -0
- package/dist/sdk/index.d.ts +4 -0
- package/dist/sdk/index.js +3 -0
- package/dist/sdk/schemas.d.ts +34 -0
- package/dist/sdk/schemas.js +74 -0
- package/dist/version.d.ts +5 -0
- package/dist/version.js +7 -0
- package/package.json +72 -0
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
/** Discover only packages present in the caller's integrity-checked lock/cache. */
|
|
2
|
+
import { check } from "./errors.js";
|
|
3
|
+
import { packageLock, packageYaml, resolvePackage, providerPackageSchema, extensionPackSchema, } from "./packages.js";
|
|
4
|
+
import { connectorPackageSchema } from "./connector-package.js";
|
|
5
|
+
import { validateModelPack } from "./model-pack-schema.js";
|
|
6
|
+
import { reportPackSchema } from "./report-pack-schema.js";
|
|
7
|
+
export const pluginKindLabel = (kind) => ({
|
|
8
|
+
provider: "Provider",
|
|
9
|
+
connector: "Connector",
|
|
10
|
+
"model-pack": "Model pack",
|
|
11
|
+
"activity-pack": "Activity preset pack",
|
|
12
|
+
"report-pack": "Report pack",
|
|
13
|
+
})[kind];
|
|
14
|
+
export function browseProviders(root, query = "", kind, filters = {}) {
|
|
15
|
+
check(!kind ||
|
|
16
|
+
Object.hasOwn({
|
|
17
|
+
provider: 1,
|
|
18
|
+
connector: 1,
|
|
19
|
+
"model-pack": 1,
|
|
20
|
+
"activity-pack": 1,
|
|
21
|
+
"report-pack": 1,
|
|
22
|
+
}, kind), "INPUT", "Unknown plugin category");
|
|
23
|
+
const needle = query.toLowerCase();
|
|
24
|
+
const entries = Object.keys(packageLock(root).packages)
|
|
25
|
+
.sort()
|
|
26
|
+
.flatMap((reference) => {
|
|
27
|
+
const source = resolvePackage(root, reference);
|
|
28
|
+
const raw = packageYaml(source.file);
|
|
29
|
+
let kind;
|
|
30
|
+
let manifest;
|
|
31
|
+
switch (raw.apiVersion) {
|
|
32
|
+
case "ingestron.provider/v1":
|
|
33
|
+
kind = "provider";
|
|
34
|
+
manifest = providerPackageSchema.parse(raw);
|
|
35
|
+
break;
|
|
36
|
+
case "ingestron.connector/v1":
|
|
37
|
+
kind = "connector";
|
|
38
|
+
manifest = connectorPackageSchema.parse(raw);
|
|
39
|
+
break;
|
|
40
|
+
case "ingestron.extension-pack/v1":
|
|
41
|
+
kind = "activity-pack";
|
|
42
|
+
manifest = extensionPackSchema.parse(raw);
|
|
43
|
+
break;
|
|
44
|
+
case "ingestron.extension-pack/v2":
|
|
45
|
+
kind = "model-pack";
|
|
46
|
+
manifest = validateModelPack(raw);
|
|
47
|
+
break;
|
|
48
|
+
case "ingestron.extension-pack/v3":
|
|
49
|
+
kind = "report-pack";
|
|
50
|
+
manifest = reportPackSchema.parse(raw);
|
|
51
|
+
break;
|
|
52
|
+
default:
|
|
53
|
+
return [];
|
|
54
|
+
}
|
|
55
|
+
const url = `https://github.com/${source.entry.repository}/tree/${source.entry.commit}`;
|
|
56
|
+
return [
|
|
57
|
+
{
|
|
58
|
+
id: manifest.id,
|
|
59
|
+
name: manifest.id,
|
|
60
|
+
version: manifest.version,
|
|
61
|
+
kind,
|
|
62
|
+
kindLabel: pluginKindLabel(kind),
|
|
63
|
+
reference,
|
|
64
|
+
commit: source.entry.commit,
|
|
65
|
+
repository: source.entry.repository,
|
|
66
|
+
description: (manifest.description ?? ""),
|
|
67
|
+
engines: kind === "connector"
|
|
68
|
+
? [
|
|
69
|
+
...new Set(Object.values(manifest.execution).flatMap((e) => e.modes)),
|
|
70
|
+
]
|
|
71
|
+
: [manifest.platform].filter(Boolean),
|
|
72
|
+
availability: "installed",
|
|
73
|
+
installable: false,
|
|
74
|
+
documentation: (manifest.documentation ?? url),
|
|
75
|
+
licence: (manifest.upstream?.licence ??
|
|
76
|
+
"See the installed package licence files"),
|
|
77
|
+
url,
|
|
78
|
+
evidence: "Locked package metadata; capabilities are declared by the package, not verified target support.",
|
|
79
|
+
},
|
|
80
|
+
];
|
|
81
|
+
});
|
|
82
|
+
return entries.filter((p) => (!kind || p.kind === kind) &&
|
|
83
|
+
(!filters.engine || p.engines.includes(filters.engine)) &&
|
|
84
|
+
(!filters.installable || p.installable) &&
|
|
85
|
+
`${p.id} ${p.description} ${p.reference}`.toLowerCase().includes(needle));
|
|
86
|
+
}
|
|
87
|
+
export function pluginDetails(root, id) {
|
|
88
|
+
const entries = browseProviders(root).filter((p) => p.id === id || p.reference === id);
|
|
89
|
+
check(entries.length > 0, "PACKAGE", "No installed package matches; inspect packages_list or install an explicit repository reference");
|
|
90
|
+
check(entries.length === 1, "PACKAGE", "Multiple installed packages match; select an exact reference");
|
|
91
|
+
return entries[0];
|
|
92
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const modelPackSchema: z.ZodObject<{
|
|
3
|
+
apiVersion: z.ZodLiteral<"ingestron.extension-pack/v2">;
|
|
4
|
+
kind: z.ZodLiteral<"model">;
|
|
5
|
+
id: z.ZodString;
|
|
6
|
+
version: z.ZodString;
|
|
7
|
+
description: z.ZodString;
|
|
8
|
+
contracts: z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
9
|
+
relationships: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
10
|
+
id: z.ZodString;
|
|
11
|
+
from: z.ZodString;
|
|
12
|
+
fields: z.ZodArray<z.ZodString>;
|
|
13
|
+
to: z.ZodString;
|
|
14
|
+
references: z.ZodArray<z.ZodString>;
|
|
15
|
+
}, z.core.$strict>>>;
|
|
16
|
+
provenance: z.ZodObject<{
|
|
17
|
+
sources: z.ZodArray<z.ZodString>;
|
|
18
|
+
retrieved: z.ZodString;
|
|
19
|
+
status: z.ZodEnum<{
|
|
20
|
+
"documented-projection": "documented-projection";
|
|
21
|
+
"recorded-schema": "recorded-schema";
|
|
22
|
+
}>;
|
|
23
|
+
notes: z.ZodString;
|
|
24
|
+
}, z.core.$strict>;
|
|
25
|
+
}, z.core.$strict>;
|
|
26
|
+
export declare function validateModelPack(raw: unknown): {
|
|
27
|
+
apiVersion: "ingestron.extension-pack/v2";
|
|
28
|
+
kind: "model";
|
|
29
|
+
id: string;
|
|
30
|
+
version: string;
|
|
31
|
+
description: string;
|
|
32
|
+
contracts: Record<string, Record<string, unknown>>;
|
|
33
|
+
relationships: {
|
|
34
|
+
id: string;
|
|
35
|
+
from: string;
|
|
36
|
+
fields: string[];
|
|
37
|
+
to: string;
|
|
38
|
+
references: string[];
|
|
39
|
+
}[];
|
|
40
|
+
provenance: {
|
|
41
|
+
sources: string[];
|
|
42
|
+
retrieved: string;
|
|
43
|
+
status: "documented-projection" | "recorded-schema";
|
|
44
|
+
notes: string;
|
|
45
|
+
};
|
|
46
|
+
};
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { validateContract } from "./contracts.js";
|
|
3
|
+
import { check, isMap } from "./errors.js";
|
|
4
|
+
const name = z.string().regex(/^[a-z][a-z0-9_-]*$/);
|
|
5
|
+
export const modelPackSchema = z
|
|
6
|
+
.object({
|
|
7
|
+
apiVersion: z.literal("ingestron.extension-pack/v2"),
|
|
8
|
+
kind: z.literal("model"),
|
|
9
|
+
id: name,
|
|
10
|
+
version: z.string().regex(/^\d+\.\d+\.\d+$/),
|
|
11
|
+
description: z.string().min(1),
|
|
12
|
+
contracts: z
|
|
13
|
+
.record(name, z.record(z.string(), z.unknown()))
|
|
14
|
+
.refine((v) => Object.keys(v).length > 0 && Object.keys(v).length <= 200, "Export 1–200 contracts"),
|
|
15
|
+
relationships: z
|
|
16
|
+
.array(z
|
|
17
|
+
.object({
|
|
18
|
+
id: name,
|
|
19
|
+
from: name,
|
|
20
|
+
fields: z.array(z.string().min(1)).min(1),
|
|
21
|
+
to: name,
|
|
22
|
+
references: z.array(z.string().min(1)).min(1),
|
|
23
|
+
})
|
|
24
|
+
.strict())
|
|
25
|
+
.max(500)
|
|
26
|
+
.default([]),
|
|
27
|
+
provenance: z
|
|
28
|
+
.object({
|
|
29
|
+
sources: z.array(z.string().min(1)).min(1),
|
|
30
|
+
retrieved: z.string().regex(/^\d{4}-\d{2}-\d{2}$/),
|
|
31
|
+
status: z.enum(["recorded-schema", "documented-projection"]),
|
|
32
|
+
notes: z.string().min(1),
|
|
33
|
+
})
|
|
34
|
+
.strict(),
|
|
35
|
+
})
|
|
36
|
+
.strict();
|
|
37
|
+
export function validateModelPack(raw) {
|
|
38
|
+
const pack = modelPackSchema.parse(raw);
|
|
39
|
+
const noDirectives = (v) => {
|
|
40
|
+
if (Array.isArray(v))
|
|
41
|
+
v.forEach(noDirectives);
|
|
42
|
+
else if (isMap(v))
|
|
43
|
+
for (const [key, value] of Object.entries(v)) {
|
|
44
|
+
check(!key.startsWith("$"), "MODEL_PACK", "Model packs cannot contain configuration directives");
|
|
45
|
+
noDirectives(value);
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
noDirectives(pack);
|
|
49
|
+
const schemas = {};
|
|
50
|
+
for (const [alias, contract] of Object.entries(pack.contracts)) {
|
|
51
|
+
validateContract(contract);
|
|
52
|
+
const schema = contract.schema;
|
|
53
|
+
check(schema?.length === 1 && schema[0].properties?.length, "MODEL_PACK", `${alias}: export one dataset with properties`);
|
|
54
|
+
const columns = schema[0].properties;
|
|
55
|
+
check(new Set(columns.map((c) => c.name)).size === columns.length, "MODEL_PACK", `${alias}: duplicate property`);
|
|
56
|
+
schemas[alias] = columns;
|
|
57
|
+
}
|
|
58
|
+
const ids = new Set();
|
|
59
|
+
for (const relation of pack.relationships) {
|
|
60
|
+
check(!ids.has(relation.id), "MODEL_PACK", "Duplicate relationship id");
|
|
61
|
+
ids.add(relation.id);
|
|
62
|
+
check(schemas[relation.from] && schemas[relation.to], "MODEL_PACK", `${relation.id}: unknown dataset`);
|
|
63
|
+
check(relation.fields.length === relation.references.length &&
|
|
64
|
+
new Set(relation.fields).size === relation.fields.length &&
|
|
65
|
+
new Set(relation.references).size === relation.references.length, "MODEL_PACK", `${relation.id}: invalid relationship fields`);
|
|
66
|
+
const keys = schemas[relation.to]
|
|
67
|
+
.filter((c) => c.primaryKey)
|
|
68
|
+
.map((c) => c.name)
|
|
69
|
+
.sort();
|
|
70
|
+
check(JSON.stringify(keys) === JSON.stringify([...relation.references].sort()), "MODEL_PACK", `${relation.id}: reference the complete target primary key`);
|
|
71
|
+
relation.fields.forEach((field, index) => {
|
|
72
|
+
const from = schemas[relation.from].find((c) => c.name === field);
|
|
73
|
+
const to = schemas[relation.to].find((c) => c.name === relation.references[index]);
|
|
74
|
+
check(from &&
|
|
75
|
+
to &&
|
|
76
|
+
from.logicalType === to.logicalType &&
|
|
77
|
+
from.physicalType === to.physicalType, "MODEL_PACK", `${relation.id}: missing or incompatible relationship field`);
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
return pack;
|
|
81
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { Configuration } from "./config.js";
|
|
2
|
+
import type { Project, Flow } from "./schema.js";
|
|
3
|
+
/** Read immutable model text, never evaluate it as configuration or plugin code. */
|
|
4
|
+
export declare function resolveModelContracts(reader: Configuration, project: Project, flows: Flow[]): void;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { resolvePackage, packageYaml } from "./packages.js";
|
|
2
|
+
import { validateModelPack } from "./model-pack-schema.js";
|
|
3
|
+
import { check } from "./errors.js";
|
|
4
|
+
/** Read immutable model text, never evaluate it as configuration or plugin code. */
|
|
5
|
+
export function resolveModelContracts(reader, project, flows) {
|
|
6
|
+
const packs = Object.fromEntries(Object.entries(project.modelPacks).map(([alias, selection]) => {
|
|
7
|
+
const local = selection.source.startsWith(".");
|
|
8
|
+
const file = local
|
|
9
|
+
? reader.path(selection.source)
|
|
10
|
+
: resolvePackage(reader.root, `${selection.source}@${selection.version}`).file;
|
|
11
|
+
reader.text(file);
|
|
12
|
+
if (!local)
|
|
13
|
+
reader.text("packages.lock.yaml");
|
|
14
|
+
const pack = validateModelPack(packageYaml(file));
|
|
15
|
+
check(pack.version === selection.version ||
|
|
16
|
+
(!local && /^[a-f0-9]{40}$/.test(selection.version)), "MODEL_PACK", `${alias}: model version differs from selector`);
|
|
17
|
+
return [alias, pack];
|
|
18
|
+
}));
|
|
19
|
+
const resolveContract = (contract) => {
|
|
20
|
+
if (!Object.hasOwn(contract, "$model"))
|
|
21
|
+
return contract;
|
|
22
|
+
check(Object.keys(contract).length === 1 && typeof contract.$model === "string", "MODEL_PACK", "Use only {$model: pack:dataset}; model overrides are not supported");
|
|
23
|
+
const parts = contract.$model.split(":");
|
|
24
|
+
check(parts.length === 2 && packs[parts[0]]?.contracts[parts[1]], "MODEL_PACK", `Unknown model ${contract.$model}`);
|
|
25
|
+
return structuredClone(packs[parts[0]].contracts[parts[1]]);
|
|
26
|
+
};
|
|
27
|
+
for (const flow of flows) {
|
|
28
|
+
for (const table of Object.values(flow.tables ?? {}))
|
|
29
|
+
table.contract = resolveContract(table.contract);
|
|
30
|
+
for (const output of Object.values(flow.publishes))
|
|
31
|
+
output.contract = resolveContract(output.contract);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -0,0 +1,346 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const operationSchemas: {
|
|
3
|
+
readonly provider_scaffold: z.ZodObject<{
|
|
4
|
+
id: z.ZodString;
|
|
5
|
+
out: z.ZodString;
|
|
6
|
+
}, z.core.$strict>;
|
|
7
|
+
readonly pack_configure: z.ZodObject<{
|
|
8
|
+
reference: z.ZodString;
|
|
9
|
+
name: z.ZodString;
|
|
10
|
+
provider: z.ZodOptional<z.ZodString>;
|
|
11
|
+
}, z.core.$strict>;
|
|
12
|
+
readonly flow_connect: z.ZodObject<{
|
|
13
|
+
id: z.ZodString;
|
|
14
|
+
input: z.ZodString;
|
|
15
|
+
dataset: z.ZodString;
|
|
16
|
+
handover: z.ZodEnum<{
|
|
17
|
+
files: "files";
|
|
18
|
+
relation: "relation";
|
|
19
|
+
}>;
|
|
20
|
+
table: z.ZodOptional<z.ZodString>;
|
|
21
|
+
}, z.core.$strict>;
|
|
22
|
+
readonly flow_export: z.ZodObject<{
|
|
23
|
+
id: z.ZodString;
|
|
24
|
+
group: z.ZodString;
|
|
25
|
+
}, z.core.$strict>;
|
|
26
|
+
readonly provider_check: z.ZodObject<{
|
|
27
|
+
delivery: z.ZodDefault<z.ZodBoolean>;
|
|
28
|
+
}, z.core.$strict>;
|
|
29
|
+
readonly plugin_show: z.ZodObject<{
|
|
30
|
+
id: z.ZodString;
|
|
31
|
+
}, z.core.$strict>;
|
|
32
|
+
readonly plugin_browse: z.ZodObject<{
|
|
33
|
+
engine: z.ZodOptional<z.ZodString>;
|
|
34
|
+
installable: z.ZodOptional<z.ZodBoolean>;
|
|
35
|
+
query: z.ZodOptional<z.ZodString>;
|
|
36
|
+
kind: z.ZodOptional<z.ZodEnum<{
|
|
37
|
+
"activity-pack": "activity-pack";
|
|
38
|
+
connector: "connector";
|
|
39
|
+
"model-pack": "model-pack";
|
|
40
|
+
provider: "provider";
|
|
41
|
+
"report-pack": "report-pack";
|
|
42
|
+
}>>;
|
|
43
|
+
}, z.core.$strict>;
|
|
44
|
+
readonly plugin_versions: z.ZodObject<{
|
|
45
|
+
provider: z.ZodString;
|
|
46
|
+
fromGit: z.ZodOptional<z.ZodString>;
|
|
47
|
+
tagPrefix: z.ZodOptional<z.ZodString>;
|
|
48
|
+
}, z.core.$strict>;
|
|
49
|
+
readonly source_list: z.ZodObject<{}, z.core.$strict>;
|
|
50
|
+
readonly source_show: z.ZodObject<{
|
|
51
|
+
id: z.ZodString;
|
|
52
|
+
}, z.core.$strict>;
|
|
53
|
+
readonly source_add: z.ZodObject<{
|
|
54
|
+
id: z.ZodString;
|
|
55
|
+
type: z.ZodString;
|
|
56
|
+
format: z.ZodOptional<z.ZodString>;
|
|
57
|
+
provider: z.ZodOptional<z.ZodString>;
|
|
58
|
+
execution: z.ZodDefault<z.ZodEnum<{
|
|
59
|
+
local: "local";
|
|
60
|
+
manual: "manual";
|
|
61
|
+
}>>;
|
|
62
|
+
binding: z.ZodOptional<z.ZodString>;
|
|
63
|
+
}, z.core.$strict>;
|
|
64
|
+
readonly source_configure: z.ZodObject<{
|
|
65
|
+
id: z.ZodString;
|
|
66
|
+
patch: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
67
|
+
}, z.core.$strict>;
|
|
68
|
+
readonly source_prepare: z.ZodObject<{
|
|
69
|
+
id: z.ZodString;
|
|
70
|
+
input: z.ZodString;
|
|
71
|
+
out: z.ZodOptional<z.ZodString>;
|
|
72
|
+
}, z.core.$strict>;
|
|
73
|
+
readonly source_import: z.ZodObject<{
|
|
74
|
+
id: z.ZodString;
|
|
75
|
+
metadata: z.ZodString;
|
|
76
|
+
}, z.core.$strict>;
|
|
77
|
+
readonly plugin_configure: z.ZodObject<{
|
|
78
|
+
reference: z.ZodString;
|
|
79
|
+
name: z.ZodOptional<z.ZodString>;
|
|
80
|
+
update: z.ZodOptional<z.ZodBoolean>;
|
|
81
|
+
}, z.core.$strict>;
|
|
82
|
+
readonly contract_list: z.ZodObject<{}, z.core.$strict>;
|
|
83
|
+
readonly contract_show: z.ZodObject<{
|
|
84
|
+
id: z.ZodString;
|
|
85
|
+
}, z.core.$strict>;
|
|
86
|
+
readonly contract_check: z.ZodObject<{
|
|
87
|
+
id: z.ZodString;
|
|
88
|
+
native: z.ZodDefault<z.ZodBoolean>;
|
|
89
|
+
}, z.core.$strict>;
|
|
90
|
+
readonly contract_create: z.ZodObject<{
|
|
91
|
+
id: z.ZodString;
|
|
92
|
+
source: z.ZodOptional<z.ZodString>;
|
|
93
|
+
metadata: z.ZodOptional<z.ZodString>;
|
|
94
|
+
entity: z.ZodOptional<z.ZodString>;
|
|
95
|
+
out: z.ZodOptional<z.ZodString>;
|
|
96
|
+
provider: z.ZodOptional<z.ZodString>;
|
|
97
|
+
}, z.core.$strict>;
|
|
98
|
+
readonly flow_create: z.ZodObject<{
|
|
99
|
+
id: z.ZodString;
|
|
100
|
+
kind: z.ZodDefault<z.ZodEnum<{
|
|
101
|
+
ingestion: "ingestion";
|
|
102
|
+
transformation: "transformation";
|
|
103
|
+
}>>;
|
|
104
|
+
standard: z.ZodOptional<z.ZodString>;
|
|
105
|
+
sourceKind: z.ZodOptional<z.ZodString>;
|
|
106
|
+
format: z.ZodOptional<z.ZodString>;
|
|
107
|
+
sourceBinding: z.ZodOptional<z.ZodString>;
|
|
108
|
+
inputDataset: z.ZodOptional<z.ZodString>;
|
|
109
|
+
provider: z.ZodOptional<z.ZodString>;
|
|
110
|
+
source: z.ZodOptional<z.ZodString>;
|
|
111
|
+
contract: z.ZodOptional<z.ZodString>;
|
|
112
|
+
}, z.core.$strict>;
|
|
113
|
+
readonly flow_show: z.ZodObject<{
|
|
114
|
+
id: z.ZodString;
|
|
115
|
+
}, z.core.$strict>;
|
|
116
|
+
readonly build: z.ZodObject<{
|
|
117
|
+
provider: z.ZodOptional<z.ZodString>;
|
|
118
|
+
delivery: z.ZodDefault<z.ZodBoolean>;
|
|
119
|
+
flow: z.ZodOptional<z.ZodString>;
|
|
120
|
+
table: z.ZodOptional<z.ZodString>;
|
|
121
|
+
step: z.ZodOptional<z.ZodString>;
|
|
122
|
+
out: z.ZodDefault<z.ZodString>;
|
|
123
|
+
ownership: z.ZodDefault<z.ZodEnum<{
|
|
124
|
+
managed: "managed";
|
|
125
|
+
team: "team";
|
|
126
|
+
}>>;
|
|
127
|
+
}, z.core.$strict>;
|
|
128
|
+
readonly environments: z.ZodObject<{}, z.core.$strict>;
|
|
129
|
+
readonly environment_add: z.ZodObject<{
|
|
130
|
+
name: z.ZodString;
|
|
131
|
+
from: z.ZodString;
|
|
132
|
+
}, z.core.$strict>;
|
|
133
|
+
readonly datasets: z.ZodObject<{}, z.core.$strict>;
|
|
134
|
+
readonly tables: z.ZodObject<{}, z.core.$strict>;
|
|
135
|
+
readonly config_explain: z.ZodObject<{
|
|
136
|
+
path: z.ZodString;
|
|
137
|
+
}, z.core.$strict>;
|
|
138
|
+
readonly diff: z.ZodObject<{
|
|
139
|
+
plan: z.ZodString;
|
|
140
|
+
}, z.core.$strict>;
|
|
141
|
+
readonly inspect: z.ZodObject<{}, z.core.$strict>;
|
|
142
|
+
readonly schema: z.ZodObject<{
|
|
143
|
+
name: z.ZodEnum<{
|
|
144
|
+
activity: "activity";
|
|
145
|
+
"delivery-index": "delivery-index";
|
|
146
|
+
environment: "environment";
|
|
147
|
+
"extension-pack": "extension-pack";
|
|
148
|
+
flow: "flow";
|
|
149
|
+
project: "project";
|
|
150
|
+
provider: "provider";
|
|
151
|
+
source: "source";
|
|
152
|
+
step: "step";
|
|
153
|
+
}>;
|
|
154
|
+
}, z.core.$strict>;
|
|
155
|
+
readonly read: z.ZodObject<{
|
|
156
|
+
path: z.ZodString;
|
|
157
|
+
}, z.core.$strict>;
|
|
158
|
+
readonly validate: z.ZodObject<{
|
|
159
|
+
mode: z.ZodDefault<z.ZodEnum<{
|
|
160
|
+
draft: "draft";
|
|
161
|
+
strict: "strict";
|
|
162
|
+
}>>;
|
|
163
|
+
flow: z.ZodOptional<z.ZodString>;
|
|
164
|
+
table: z.ZodOptional<z.ZodString>;
|
|
165
|
+
step: z.ZodOptional<z.ZodString>;
|
|
166
|
+
}, z.core.$strict>;
|
|
167
|
+
readonly resolve: z.ZodObject<{}, z.core.$strict>;
|
|
168
|
+
readonly plan: z.ZodObject<{
|
|
169
|
+
flow: z.ZodOptional<z.ZodString>;
|
|
170
|
+
table: z.ZodOptional<z.ZodString>;
|
|
171
|
+
step: z.ZodOptional<z.ZodString>;
|
|
172
|
+
}, z.core.$strict>;
|
|
173
|
+
readonly generate: z.ZodObject<{
|
|
174
|
+
plan: z.ZodString;
|
|
175
|
+
out: z.ZodString;
|
|
176
|
+
ownership: z.ZodDefault<z.ZodEnum<{
|
|
177
|
+
managed: "managed";
|
|
178
|
+
team: "team";
|
|
179
|
+
}>>;
|
|
180
|
+
}, z.core.$strict>;
|
|
181
|
+
readonly validate_output: z.ZodObject<{
|
|
182
|
+
directory: z.ZodString;
|
|
183
|
+
}, z.core.$strict>;
|
|
184
|
+
readonly catalogue: z.ZodObject<{
|
|
185
|
+
kind: z.ZodEnum<{
|
|
186
|
+
activities: "activities";
|
|
187
|
+
providers: "providers";
|
|
188
|
+
standards: "standards";
|
|
189
|
+
}>;
|
|
190
|
+
id: z.ZodOptional<z.ZodString>;
|
|
191
|
+
}, z.core.$strict>;
|
|
192
|
+
readonly initialise: z.ZodObject<{
|
|
193
|
+
id: z.ZodString;
|
|
194
|
+
provider: z.ZodOptional<z.ZodString>;
|
|
195
|
+
environments: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
196
|
+
}, z.core.$strict>;
|
|
197
|
+
readonly activity_inspect: z.ZodObject<{
|
|
198
|
+
path: z.ZodString;
|
|
199
|
+
}, z.core.$strict>;
|
|
200
|
+
readonly contract_draft: z.ZodObject<{
|
|
201
|
+
metadata: z.ZodString;
|
|
202
|
+
id: z.ZodString;
|
|
203
|
+
out: z.ZodString;
|
|
204
|
+
}, z.core.$strict>;
|
|
205
|
+
readonly contract_validate: z.ZodObject<{
|
|
206
|
+
path: z.ZodString;
|
|
207
|
+
}, z.core.$strict>;
|
|
208
|
+
readonly flow_configure: z.ZodObject<{
|
|
209
|
+
flow: z.ZodString;
|
|
210
|
+
patch: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
211
|
+
}, z.core.$strict>;
|
|
212
|
+
readonly step_add: z.ZodObject<{
|
|
213
|
+
flow: z.ZodString;
|
|
214
|
+
step: z.ZodObject<{
|
|
215
|
+
id: z.ZodString;
|
|
216
|
+
uses: z.ZodString;
|
|
217
|
+
provider: z.ZodOptional<z.ZodString>;
|
|
218
|
+
with: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
219
|
+
select: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
220
|
+
}, z.core.$strict>;
|
|
221
|
+
after: z.ZodOptional<z.ZodString>;
|
|
222
|
+
}, z.core.$strict>;
|
|
223
|
+
readonly flow_add: z.ZodObject<{
|
|
224
|
+
id: z.ZodString;
|
|
225
|
+
kind: z.ZodEnum<{
|
|
226
|
+
ingestion: "ingestion";
|
|
227
|
+
transformation: "transformation";
|
|
228
|
+
}>;
|
|
229
|
+
standard: z.ZodOptional<z.ZodString>;
|
|
230
|
+
sourceKind: z.ZodOptional<z.ZodString>;
|
|
231
|
+
provider: z.ZodOptional<z.ZodString>;
|
|
232
|
+
format: z.ZodOptional<z.ZodString>;
|
|
233
|
+
inputDataset: z.ZodOptional<z.ZodString>;
|
|
234
|
+
sourceBinding: z.ZodOptional<z.ZodString>;
|
|
235
|
+
}, z.core.$strict>;
|
|
236
|
+
readonly table_add: z.ZodObject<{
|
|
237
|
+
id: z.ZodString;
|
|
238
|
+
flow: z.ZodString;
|
|
239
|
+
contract: z.ZodString;
|
|
240
|
+
}, z.core.$strict>;
|
|
241
|
+
readonly table_configure: z.ZodObject<{
|
|
242
|
+
id: z.ZodString;
|
|
243
|
+
flow: z.ZodString;
|
|
244
|
+
patch: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
245
|
+
}, z.core.$strict>;
|
|
246
|
+
readonly dataset_add: z.ZodObject<{
|
|
247
|
+
id: z.ZodString;
|
|
248
|
+
flow: z.ZodString;
|
|
249
|
+
contract: z.ZodString;
|
|
250
|
+
from: z.ZodString;
|
|
251
|
+
}, z.core.$strict>;
|
|
252
|
+
readonly config_set: z.ZodObject<{
|
|
253
|
+
path: z.ZodString;
|
|
254
|
+
value: z.ZodUnknown;
|
|
255
|
+
}, z.core.$strict>;
|
|
256
|
+
readonly edit: z.ZodObject<{
|
|
257
|
+
files: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
258
|
+
}, z.core.$strict>;
|
|
259
|
+
readonly apply: z.ZodObject<{
|
|
260
|
+
proposal: z.ZodUnknown;
|
|
261
|
+
}, z.core.$strict>;
|
|
262
|
+
readonly packages_install: z.ZodObject<{
|
|
263
|
+
reference: z.ZodString;
|
|
264
|
+
fromGit: z.ZodOptional<z.ZodString>;
|
|
265
|
+
update: z.ZodOptional<z.ZodBoolean>;
|
|
266
|
+
frozen: z.ZodOptional<z.ZodBoolean>;
|
|
267
|
+
tagPrefix: z.ZodOptional<z.ZodString>;
|
|
268
|
+
}, z.core.$strict>;
|
|
269
|
+
readonly provider_migrate: z.ZodObject<{
|
|
270
|
+
package: z.ZodString;
|
|
271
|
+
to: z.ZodString;
|
|
272
|
+
}, z.core.$strict>;
|
|
273
|
+
readonly provider_export: z.ZodObject<{
|
|
274
|
+
result: z.ZodString;
|
|
275
|
+
out: z.ZodString;
|
|
276
|
+
}, z.core.$strict>;
|
|
277
|
+
readonly connection_prepare: z.ZodObject<{
|
|
278
|
+
flow: z.ZodString;
|
|
279
|
+
validateOnly: z.ZodDefault<z.ZodBoolean>;
|
|
280
|
+
review: z.ZodOptional<z.ZodString>;
|
|
281
|
+
}, z.core.$strict>;
|
|
282
|
+
readonly plugin_commands: z.ZodObject<{}, z.core.$strict>;
|
|
283
|
+
readonly plugin_command: z.ZodObject<{
|
|
284
|
+
namespace: z.ZodString;
|
|
285
|
+
target: z.ZodOptional<z.ZodString>;
|
|
286
|
+
command: z.ZodString;
|
|
287
|
+
input: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
288
|
+
}, z.core.$strict>;
|
|
289
|
+
readonly provider_commands: z.ZodObject<{
|
|
290
|
+
configuration: z.ZodString;
|
|
291
|
+
}, z.core.$strict>;
|
|
292
|
+
readonly provider_command: z.ZodObject<{
|
|
293
|
+
configuration: z.ZodString;
|
|
294
|
+
command: z.ZodString;
|
|
295
|
+
input: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
296
|
+
}, z.core.$strict>;
|
|
297
|
+
readonly packages_list: z.ZodObject<{}, z.core.$strict>;
|
|
298
|
+
readonly doctor: z.ZodObject<{}, z.core.$strict>;
|
|
299
|
+
readonly runtime_prepare: z.ZodObject<{
|
|
300
|
+
from: z.ZodOptional<z.ZodString>;
|
|
301
|
+
provider: z.ZodOptional<z.ZodString>;
|
|
302
|
+
flow: z.ZodOptional<z.ZodString>;
|
|
303
|
+
python: z.ZodOptional<z.ZodString>;
|
|
304
|
+
}, z.core.$strict>;
|
|
305
|
+
readonly run: z.ZodObject<{
|
|
306
|
+
from: z.ZodOptional<z.ZodString>;
|
|
307
|
+
provider: z.ZodOptional<z.ZodString>;
|
|
308
|
+
flow: z.ZodOptional<z.ZodString>;
|
|
309
|
+
action: z.ZodDefault<z.ZodEnum<{
|
|
310
|
+
approve: "approve";
|
|
311
|
+
discover: "discover";
|
|
312
|
+
review: "review";
|
|
313
|
+
run: "run";
|
|
314
|
+
}>>;
|
|
315
|
+
runId: z.ZodOptional<z.ZodString>;
|
|
316
|
+
retry: z.ZodOptional<z.ZodString>;
|
|
317
|
+
envFile: z.ZodOptional<z.ZodString>;
|
|
318
|
+
}, z.core.$strict>;
|
|
319
|
+
readonly run_status: z.ZodObject<{
|
|
320
|
+
id: z.ZodString;
|
|
321
|
+
}, z.core.$strict>;
|
|
322
|
+
};
|
|
323
|
+
export type OperationName = keyof typeof operationSchemas;
|
|
324
|
+
export interface Context {
|
|
325
|
+
root: string;
|
|
326
|
+
environment?: string;
|
|
327
|
+
allowWrite?: boolean;
|
|
328
|
+
allowNetwork?: boolean;
|
|
329
|
+
allowExecute?: boolean;
|
|
330
|
+
}
|
|
331
|
+
export interface Result {
|
|
332
|
+
apiVersion: "ingestron.operation/v1";
|
|
333
|
+
operation: string;
|
|
334
|
+
ok: boolean;
|
|
335
|
+
result?: any;
|
|
336
|
+
diagnostics: {
|
|
337
|
+
code: string;
|
|
338
|
+
message: string;
|
|
339
|
+
file?: string;
|
|
340
|
+
pointer?: string;
|
|
341
|
+
hint?: string;
|
|
342
|
+
}[];
|
|
343
|
+
}
|
|
344
|
+
export declare function execute(context: Context, operation: OperationName, request?: unknown): Result;
|
|
345
|
+
/** Shared CLI/MCP entry point; ordinary compiler operations remain synchronous/offline. */
|
|
346
|
+
export declare function executeAsync(context: Context, operation: OperationName, request?: unknown): Promise<Result>;
|