@google-cloud/kcmd 0.0.0-stage → 0.2.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 +203 -0
- package/README.md +264 -2
- package/build/ts/kcmd/cli.js +20252 -0
- package/build/ts/kcmd/gcp/alloydb.d.ts +12 -0
- package/build/ts/kcmd/gcp/alloydb.js +70 -0
- package/build/ts/kcmd/gcp/api.d.ts +29 -0
- package/build/ts/kcmd/gcp/api.js +162 -0
- package/build/ts/kcmd/gcp/biglake.d.ts +18 -0
- package/build/ts/kcmd/gcp/biglake.js +59 -0
- package/build/ts/kcmd/gcp/bigquery.d.ts +57 -0
- package/build/ts/kcmd/gcp/bigquery.js +134 -0
- package/build/ts/kcmd/gcp/context.d.ts +10 -0
- package/build/ts/kcmd/gcp/context.js +74 -0
- package/build/ts/kcmd/gcp/crm.d.ts +13 -0
- package/build/ts/kcmd/gcp/crm.js +91 -0
- package/build/ts/kcmd/gcp/dataplex.d.ts +147 -0
- package/build/ts/kcmd/gcp/dataplex.js +406 -0
- package/build/ts/kcmd/gcp/index.d.ts +3 -0
- package/build/ts/kcmd/gcp/index.js +21 -0
- package/build/ts/kcmd/gcp/spanner.d.ts +73 -0
- package/build/ts/kcmd/gcp/spanner.js +126 -0
- package/build/ts/kcmd/index.d.ts +7 -0
- package/build/ts/kcmd/index.js +46 -0
- package/build/ts/kcmd/layout.d.ts +16 -0
- package/build/ts/kcmd/layout.js +31 -0
- package/build/ts/kcmd/layouts/documents.d.ts +24 -0
- package/build/ts/kcmd/layouts/documents.js +264 -0
- package/build/ts/kcmd/layouts/okf.d.ts +31 -0
- package/build/ts/kcmd/layouts/okf.js +386 -0
- package/build/ts/kcmd/layouts/semantic-model.d.ts +74 -0
- package/build/ts/kcmd/layouts/semantic-model.js +621 -0
- package/build/ts/kcmd/layouts/standard.d.ts +13 -0
- package/build/ts/kcmd/layouts/standard.js +108 -0
- package/build/ts/kcmd/manifest.d.ts +34 -0
- package/build/ts/kcmd/manifest.js +262 -0
- package/build/ts/kcmd/metadata.d.ts +25 -0
- package/build/ts/kcmd/metadata.js +8 -0
- package/build/ts/kcmd/okf/catalog_residue.d.ts +14 -0
- package/build/ts/kcmd/okf/catalog_residue.js +124 -0
- package/build/ts/kcmd/okf/concept.d.ts +14 -0
- package/build/ts/kcmd/okf/concept.js +110 -0
- package/build/ts/kcmd/okf/concept_to_entry.d.ts +10 -0
- package/build/ts/kcmd/okf/concept_to_entry.js +281 -0
- package/build/ts/kcmd/okf/init_okf_workspace.d.ts +15 -0
- package/build/ts/kcmd/okf/init_okf_workspace.js +113 -0
- package/build/ts/kcmd/okf/links.d.ts +23 -0
- package/build/ts/kcmd/okf/links.js +468 -0
- package/build/ts/kcmd/okf/okf_metadata.d.ts +12 -0
- package/build/ts/kcmd/okf/okf_metadata.js +99 -0
- package/build/ts/kcmd/semantic/bigquery.d.ts +22 -0
- package/build/ts/kcmd/semantic/bigquery.js +469 -0
- package/build/ts/kcmd/semantic/binding.d.ts +3 -0
- package/build/ts/kcmd/semantic/binding.js +92 -0
- package/build/ts/kcmd/semantic/catalog_entry.d.ts +24 -0
- package/build/ts/kcmd/semantic/catalog_entry.js +35 -0
- package/build/ts/kcmd/semantic/converters/owl/convert.d.ts +26 -0
- package/build/ts/kcmd/semantic/converters/owl/convert.js +41 -0
- package/build/ts/kcmd/semantic/converters/owl/model.d.ts +98 -0
- package/build/ts/kcmd/semantic/converters/owl/model.js +30 -0
- package/build/ts/kcmd/semantic/converters/owl/parse.d.ts +11 -0
- package/build/ts/kcmd/semantic/converters/owl/parse.js +634 -0
- package/build/ts/kcmd/semantic/converters/owl/to_ir.d.ts +19 -0
- package/build/ts/kcmd/semantic/converters/owl/to_ir.js +390 -0
- package/build/ts/kcmd/semantic/deploy_bigquery.d.ts +20 -0
- package/build/ts/kcmd/semantic/deploy_bigquery.js +226 -0
- package/build/ts/kcmd/semantic/deploy_knowledge_catalog.d.ts +104 -0
- package/build/ts/kcmd/semantic/deploy_knowledge_catalog.js +1367 -0
- package/build/ts/kcmd/semantic/deploy_spanner.d.ts +15 -0
- package/build/ts/kcmd/semantic/deploy_spanner.js +150 -0
- package/build/ts/kcmd/semantic/deployment_target.d.ts +93 -0
- package/build/ts/kcmd/semantic/deployment_target.js +379 -0
- package/build/ts/kcmd/semantic/graph_ddl.d.ts +44 -0
- package/build/ts/kcmd/semantic/graph_ddl.js +656 -0
- package/build/ts/kcmd/semantic/import_model.d.ts +72 -0
- package/build/ts/kcmd/semantic/import_model.js +1698 -0
- package/build/ts/kcmd/semantic/ir.d.ts +589 -0
- package/build/ts/kcmd/semantic/ir.js +247 -0
- package/build/ts/kcmd/semantic/kc_actions.d.ts +45 -0
- package/build/ts/kcmd/semantic/kc_actions.js +531 -0
- package/build/ts/kcmd/semantic/kc_constraints.d.ts +44 -0
- package/build/ts/kcmd/semantic/kc_constraints.js +279 -0
- package/build/ts/kcmd/semantic/kc_converter.d.ts +37 -0
- package/build/ts/kcmd/semantic/kc_converter.js +839 -0
- package/build/ts/kcmd/semantic/kc_custom_types.d.ts +63 -0
- package/build/ts/kcmd/semantic/kc_custom_types.js +751 -0
- package/build/ts/kcmd/semantic/kc_entries.d.ts +155 -0
- package/build/ts/kcmd/semantic/kc_entries.js +284 -0
- package/build/ts/kcmd/semantic/kc_ids.d.ts +102 -0
- package/build/ts/kcmd/semantic/kc_ids.js +188 -0
- package/build/ts/kcmd/semantic/knowledge_catalog.d.ts +29 -0
- package/build/ts/kcmd/semantic/knowledge_catalog.js +960 -0
- package/build/ts/kcmd/semantic/loader.d.ts +258 -0
- package/build/ts/kcmd/semantic/loader.js +3576 -0
- package/build/ts/kcmd/semantic/names.d.ts +10 -0
- package/build/ts/kcmd/semantic/names.js +85 -0
- package/build/ts/kcmd/semantic/osi_converter.d.ts +60 -0
- package/build/ts/kcmd/semantic/osi_converter.js +910 -0
- package/build/ts/kcmd/semantic/parameters.d.ts +19 -0
- package/build/ts/kcmd/semantic/parameters.js +171 -0
- package/build/ts/kcmd/semantic/pull_kc.d.ts +10 -0
- package/build/ts/kcmd/semantic/pull_kc.js +272 -0
- package/build/ts/kcmd/semantic/resolve_inheritance.d.ts +59 -0
- package/build/ts/kcmd/semantic/resolve_inheritance.js +346 -0
- package/build/ts/kcmd/semantic/resolve_profiles.d.ts +291 -0
- package/build/ts/kcmd/semantic/resolve_profiles.js +2003 -0
- package/build/ts/kcmd/semantic/runtime/agent_tools.d.ts +93 -0
- package/build/ts/kcmd/semantic/runtime/agent_tools.js +243 -0
- package/build/ts/kcmd/semantic/runtime/dialect.d.ts +13 -0
- package/build/ts/kcmd/semantic/runtime/dialect.js +39 -0
- package/build/ts/kcmd/semantic/runtime/runtime.d.ts +88 -0
- package/build/ts/kcmd/semantic/runtime/runtime.js +301 -0
- package/build/ts/kcmd/semantic/runtime/store.d.ts +112 -0
- package/build/ts/kcmd/semantic/runtime/store.js +344 -0
- package/build/ts/kcmd/semantic/skills.d.ts +110 -0
- package/build/ts/kcmd/semantic/skills.js +697 -0
- package/build/ts/kcmd/semantic/source_dialect.d.ts +17 -0
- package/build/ts/kcmd/semantic/source_dialect.js +311 -0
- package/build/ts/kcmd/semantic/source_entries.d.ts +12 -0
- package/build/ts/kcmd/semantic/source_entries.js +341 -0
- package/build/ts/kcmd/semantic/spanner.d.ts +18 -0
- package/build/ts/kcmd/semantic/spanner.js +60 -0
- package/build/ts/kcmd/semantic/sql_expr_utils.d.ts +23 -0
- package/build/ts/kcmd/semantic/sql_expr_utils.js +394 -0
- package/build/ts/kcmd/semantic/sql_identifiers.d.ts +6 -0
- package/build/ts/kcmd/semantic/sql_identifiers.js +267 -0
- package/build/ts/kcmd/semantic/sql_parser.d.ts +47 -0
- package/build/ts/kcmd/semantic/sql_parser.js +400 -0
- package/build/ts/kcmd/semantic/transpile.d.ts +76 -0
- package/build/ts/kcmd/semantic/transpile.js +581 -0
- package/build/ts/kcmd/semantic/validate.d.ts +70 -0
- package/build/ts/kcmd/semantic/validate.js +2266 -0
- package/build/ts/kcmd/semantic/yaml_options.d.ts +6 -0
- package/build/ts/kcmd/semantic/yaml_options.js +58 -0
- package/build/ts/kcmd/semantic/yaml_update.d.ts +26 -0
- package/build/ts/kcmd/semantic/yaml_update.js +782 -0
- package/build/ts/kcmd/snapshot.d.ts +37 -0
- package/build/ts/kcmd/snapshot.js +386 -0
- package/build/ts/kcmd/source.d.ts +31 -0
- package/build/ts/kcmd/source.js +119 -0
- package/build/ts/kcmd/sources/bq-dataset.d.ts +17 -0
- package/build/ts/kcmd/sources/bq-dataset.js +131 -0
- package/build/ts/kcmd/sources/entrygroup.d.ts +21 -0
- package/build/ts/kcmd/sources/entrygroup.js +83 -0
- package/build/ts/kcmd/sources/kb.d.ts +21 -0
- package/build/ts/kcmd/sources/kb.js +82 -0
- package/build/ts/kcmd/sources/semantic-model.d.ts +18 -0
- package/build/ts/kcmd/sources/semantic-model.js +48 -0
- package/build/ts/kcmd/sync.d.ts +35 -0
- package/build/ts/kcmd/sync.js +734 -0
- package/package.json +62 -4
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import * as context from '../gcp/context';
|
|
2
|
+
import { Entry } from '../gcp/dataplex';
|
|
3
|
+
import type { OverviewSidecar } from '../layouts/semantic-model';
|
|
4
|
+
import * as kcEmit from './knowledge_catalog';
|
|
5
|
+
import { LoadedModel } from './loader';
|
|
6
|
+
export interface KcDeployOptions {
|
|
7
|
+
project: string;
|
|
8
|
+
location: string;
|
|
9
|
+
entryGroup: string;
|
|
10
|
+
systemTypeProject?: string;
|
|
11
|
+
systemTypeLocation?: string;
|
|
12
|
+
emitExpressions?: boolean;
|
|
13
|
+
v2Aspects?: boolean;
|
|
14
|
+
overviews?: ReadonlyMap<string, OverviewSidecar>;
|
|
15
|
+
onWarnings?: (warnings: readonly string[]) => void;
|
|
16
|
+
validateOnly?: boolean;
|
|
17
|
+
forceRemove?: boolean;
|
|
18
|
+
entryCreateTries?: number;
|
|
19
|
+
entryCreateRetryMs?: number;
|
|
20
|
+
}
|
|
21
|
+
export interface KcDeployResult {
|
|
22
|
+
success: boolean;
|
|
23
|
+
details?: string;
|
|
24
|
+
warnings: string[];
|
|
25
|
+
created: number;
|
|
26
|
+
updated: number;
|
|
27
|
+
deleted: number;
|
|
28
|
+
linked: number;
|
|
29
|
+
unlinked: number;
|
|
30
|
+
plan: string[];
|
|
31
|
+
}
|
|
32
|
+
/** One authored model paired with the catalog resources it emitted. */
|
|
33
|
+
export interface EmittedModel {
|
|
34
|
+
model: string;
|
|
35
|
+
resources: kcEmit.KcResources;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* The read-only preflight output handed to `applyKnowledgeCatalog`. Holds the
|
|
39
|
+
* emitted catalog resources, the pre-write entry-group snapshot, any emitter
|
|
40
|
+
* warnings, and the human-readable plan so `applyKnowledgeCatalog` can write
|
|
41
|
+
* without repeating generation or listing.
|
|
42
|
+
*/
|
|
43
|
+
export interface KcPreparedDeploy {
|
|
44
|
+
emitted: EmittedModel[];
|
|
45
|
+
existing: Entry[];
|
|
46
|
+
warnings: string[];
|
|
47
|
+
plan: string[];
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Runs every read-only check for a Knowledge Catalog push without writing to
|
|
51
|
+
* the catalog.
|
|
52
|
+
*
|
|
53
|
+
* The method performs the following actions:
|
|
54
|
+
* 1. Translates the IR models into catalog resources.
|
|
55
|
+
* 2. Verifies that exactly one model is being deployed, builds the dry-run
|
|
56
|
+
* plan, and returns early when `opts.validateOnly` is set.
|
|
57
|
+
* 3. Fails when the destination entry group does not exist. Lists it and
|
|
58
|
+
* fails if an unrecognized model's anchor entry is present without
|
|
59
|
+
* `--force-remove`.
|
|
60
|
+
* 4. Verifies that every custom entry type and aspect type required by the
|
|
61
|
+
* model exists in the target project.
|
|
62
|
+
* 5. Returns the emitted resources, entry-group listing, warnings, and plan
|
|
63
|
+
* as `prepared` for `applyKnowledgeCatalog`.
|
|
64
|
+
* With `opts.v2Aspects` set, step 2 also checks every aspect's size.
|
|
65
|
+
*/
|
|
66
|
+
export declare function preflightKnowledgeCatalog(models: LoadedModel[], ctx: context.ApiContext, opts: KcDeployOptions): Promise<{
|
|
67
|
+
prepared?: KcPreparedDeploy;
|
|
68
|
+
result?: KcDeployResult;
|
|
69
|
+
}>;
|
|
70
|
+
/**
|
|
71
|
+
* Writes a preflight-checked Knowledge Catalog deployment.
|
|
72
|
+
*
|
|
73
|
+
* The method performs the following actions:
|
|
74
|
+
* 1. Removes foreign models when `--force-remove` is set.
|
|
75
|
+
* 2. Writes each emitted model's entries and relationship links and deletes
|
|
76
|
+
* any orphaned links and entries.
|
|
77
|
+
*/
|
|
78
|
+
export declare function applyKnowledgeCatalog(prepared: KcPreparedDeploy, ctx: context.ApiContext, opts: KcDeployOptions): Promise<KcDeployResult>;
|
|
79
|
+
/**
|
|
80
|
+
* Deploys every authored model's Knowledge Catalog resources.
|
|
81
|
+
*
|
|
82
|
+
* Runs `preflightKnowledgeCatalog` followed by `applyKnowledgeCatalog`, and
|
|
83
|
+
* passes the warnings to `opts.onWarnings` between the two.
|
|
84
|
+
*/
|
|
85
|
+
export declare function deployKnowledgeCatalog(models: LoadedModel[], ctx: context.ApiContext, opts: KcDeployOptions): Promise<KcDeployResult>;
|
|
86
|
+
/**
|
|
87
|
+
* Publishes models that are already mapped to catalog resources.
|
|
88
|
+
*
|
|
89
|
+
* Origin-agnostic wrapper over `preflightEmittedModels` and
|
|
90
|
+
* `applyKnowledgeCatalog` for callers with their own emitter (such as LookML).
|
|
91
|
+
*/
|
|
92
|
+
export declare function deployEmittedModels(emitted: EmittedModel[], emitWarnings: string[], ctx: context.ApiContext, opts: KcDeployOptions): Promise<KcDeployResult>;
|
|
93
|
+
/** The error for an entry group that would receive more than one model. */
|
|
94
|
+
export declare function oneModelPerEntryGroupMessage(entryGroup: string, models: number): string;
|
|
95
|
+
export declare const MAX_ASPECT_DATA_BYTES: number;
|
|
96
|
+
/**
|
|
97
|
+
* The emitter's warnings for `models`, and an emit error or the first aspect
|
|
98
|
+
* too large to store. With v2Aspects on, that error is why push's catalog leg
|
|
99
|
+
* cannot write them. Calls no service.
|
|
100
|
+
*/
|
|
101
|
+
export declare function checkCatalogAspects(models: LoadedModel[], opts: KcDeployOptions): {
|
|
102
|
+
error?: string;
|
|
103
|
+
warnings: string[];
|
|
104
|
+
};
|