@google-cloud/kcmd 0.0.0-stage → 0.1.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.
Files changed (150) hide show
  1. package/LICENSE +203 -0
  2. package/README.md +266 -2
  3. package/build/ts/kcmd/cli.js +19578 -0
  4. package/build/ts/kcmd/gcp/alloydb.d.ts +12 -0
  5. package/build/ts/kcmd/gcp/alloydb.js +70 -0
  6. package/build/ts/kcmd/gcp/api.d.ts +29 -0
  7. package/build/ts/kcmd/gcp/api.js +162 -0
  8. package/build/ts/kcmd/gcp/biglake.d.ts +16 -0
  9. package/build/ts/kcmd/gcp/biglake.js +50 -0
  10. package/build/ts/kcmd/gcp/bigquery.d.ts +57 -0
  11. package/build/ts/kcmd/gcp/bigquery.js +134 -0
  12. package/build/ts/kcmd/gcp/context.d.ts +10 -0
  13. package/build/ts/kcmd/gcp/context.js +74 -0
  14. package/build/ts/kcmd/gcp/crm.d.ts +13 -0
  15. package/build/ts/kcmd/gcp/crm.js +91 -0
  16. package/build/ts/kcmd/gcp/dataplex.d.ts +147 -0
  17. package/build/ts/kcmd/gcp/dataplex.js +406 -0
  18. package/build/ts/kcmd/gcp/index.d.ts +3 -0
  19. package/build/ts/kcmd/gcp/index.js +21 -0
  20. package/build/ts/kcmd/gcp/spanner.d.ts +63 -0
  21. package/build/ts/kcmd/gcp/spanner.js +123 -0
  22. package/build/ts/kcmd/index.d.ts +7 -0
  23. package/build/ts/kcmd/index.js +46 -0
  24. package/build/ts/kcmd/layout.d.ts +16 -0
  25. package/build/ts/kcmd/layout.js +31 -0
  26. package/build/ts/kcmd/layouts/documents.d.ts +24 -0
  27. package/build/ts/kcmd/layouts/documents.js +264 -0
  28. package/build/ts/kcmd/layouts/okf.d.ts +31 -0
  29. package/build/ts/kcmd/layouts/okf.js +344 -0
  30. package/build/ts/kcmd/layouts/semantic-model.d.ts +61 -0
  31. package/build/ts/kcmd/layouts/semantic-model.js +542 -0
  32. package/build/ts/kcmd/layouts/standard.d.ts +13 -0
  33. package/build/ts/kcmd/layouts/standard.js +108 -0
  34. package/build/ts/kcmd/manifest.d.ts +34 -0
  35. package/build/ts/kcmd/manifest.js +262 -0
  36. package/build/ts/kcmd/metadata.d.ts +25 -0
  37. package/build/ts/kcmd/metadata.js +8 -0
  38. package/build/ts/kcmd/okf/catalog_residue.d.ts +14 -0
  39. package/build/ts/kcmd/okf/catalog_residue.js +124 -0
  40. package/build/ts/kcmd/okf/concept.d.ts +14 -0
  41. package/build/ts/kcmd/okf/concept.js +104 -0
  42. package/build/ts/kcmd/okf/concept_to_entry.d.ts +8 -0
  43. package/build/ts/kcmd/okf/concept_to_entry.js +254 -0
  44. package/build/ts/kcmd/okf/init_okf_workspace.d.ts +15 -0
  45. package/build/ts/kcmd/okf/init_okf_workspace.js +115 -0
  46. package/build/ts/kcmd/okf/links.d.ts +23 -0
  47. package/build/ts/kcmd/okf/links.js +468 -0
  48. package/build/ts/kcmd/okf/okf_metadata.d.ts +12 -0
  49. package/build/ts/kcmd/okf/okf_metadata.js +82 -0
  50. package/build/ts/kcmd/semantic/bigquery.d.ts +22 -0
  51. package/build/ts/kcmd/semantic/bigquery.js +525 -0
  52. package/build/ts/kcmd/semantic/binding.d.ts +3 -0
  53. package/build/ts/kcmd/semantic/binding.js +97 -0
  54. package/build/ts/kcmd/semantic/catalog_entry.d.ts +24 -0
  55. package/build/ts/kcmd/semantic/catalog_entry.js +35 -0
  56. package/build/ts/kcmd/semantic/converters/owl/convert.d.ts +26 -0
  57. package/build/ts/kcmd/semantic/converters/owl/convert.js +41 -0
  58. package/build/ts/kcmd/semantic/converters/owl/model.d.ts +98 -0
  59. package/build/ts/kcmd/semantic/converters/owl/model.js +30 -0
  60. package/build/ts/kcmd/semantic/converters/owl/parse.d.ts +11 -0
  61. package/build/ts/kcmd/semantic/converters/owl/parse.js +634 -0
  62. package/build/ts/kcmd/semantic/converters/owl/to_ir.d.ts +19 -0
  63. package/build/ts/kcmd/semantic/converters/owl/to_ir.js +390 -0
  64. package/build/ts/kcmd/semantic/deploy_bigquery.d.ts +20 -0
  65. package/build/ts/kcmd/semantic/deploy_bigquery.js +226 -0
  66. package/build/ts/kcmd/semantic/deploy_knowledge_catalog.d.ts +129 -0
  67. package/build/ts/kcmd/semantic/deploy_knowledge_catalog.js +1396 -0
  68. package/build/ts/kcmd/semantic/deploy_spanner.d.ts +15 -0
  69. package/build/ts/kcmd/semantic/deploy_spanner.js +150 -0
  70. package/build/ts/kcmd/semantic/deployment_target.d.ts +93 -0
  71. package/build/ts/kcmd/semantic/deployment_target.js +379 -0
  72. package/build/ts/kcmd/semantic/graph_ddl.d.ts +34 -0
  73. package/build/ts/kcmd/semantic/graph_ddl.js +563 -0
  74. package/build/ts/kcmd/semantic/import_model.d.ts +50 -0
  75. package/build/ts/kcmd/semantic/import_model.js +1275 -0
  76. package/build/ts/kcmd/semantic/ir.d.ts +589 -0
  77. package/build/ts/kcmd/semantic/ir.js +247 -0
  78. package/build/ts/kcmd/semantic/kc_actions.d.ts +45 -0
  79. package/build/ts/kcmd/semantic/kc_actions.js +531 -0
  80. package/build/ts/kcmd/semantic/kc_constraints.d.ts +44 -0
  81. package/build/ts/kcmd/semantic/kc_constraints.js +279 -0
  82. package/build/ts/kcmd/semantic/kc_converter.d.ts +31 -0
  83. package/build/ts/kcmd/semantic/kc_converter.js +824 -0
  84. package/build/ts/kcmd/semantic/kc_custom_types.d.ts +70 -0
  85. package/build/ts/kcmd/semantic/kc_custom_types.js +828 -0
  86. package/build/ts/kcmd/semantic/kc_entries.d.ts +155 -0
  87. package/build/ts/kcmd/semantic/kc_entries.js +284 -0
  88. package/build/ts/kcmd/semantic/kc_ids.d.ts +103 -0
  89. package/build/ts/kcmd/semantic/kc_ids.js +191 -0
  90. package/build/ts/kcmd/semantic/knowledge_catalog.d.ts +32 -0
  91. package/build/ts/kcmd/semantic/knowledge_catalog.js +1043 -0
  92. package/build/ts/kcmd/semantic/loader.d.ts +262 -0
  93. package/build/ts/kcmd/semantic/loader.js +3440 -0
  94. package/build/ts/kcmd/semantic/names.d.ts +10 -0
  95. package/build/ts/kcmd/semantic/names.js +85 -0
  96. package/build/ts/kcmd/semantic/osi_converter.d.ts +60 -0
  97. package/build/ts/kcmd/semantic/osi_converter.js +911 -0
  98. package/build/ts/kcmd/semantic/parameters.d.ts +18 -0
  99. package/build/ts/kcmd/semantic/parameters.js +152 -0
  100. package/build/ts/kcmd/semantic/pull_kc.d.ts +14 -0
  101. package/build/ts/kcmd/semantic/pull_kc.js +346 -0
  102. package/build/ts/kcmd/semantic/resolve_inheritance.d.ts +54 -0
  103. package/build/ts/kcmd/semantic/resolve_inheritance.js +330 -0
  104. package/build/ts/kcmd/semantic/resolve_profiles.d.ts +250 -0
  105. package/build/ts/kcmd/semantic/resolve_profiles.js +1822 -0
  106. package/build/ts/kcmd/semantic/runtime/agent_tools.d.ts +93 -0
  107. package/build/ts/kcmd/semantic/runtime/agent_tools.js +243 -0
  108. package/build/ts/kcmd/semantic/runtime/dialect.d.ts +13 -0
  109. package/build/ts/kcmd/semantic/runtime/dialect.js +39 -0
  110. package/build/ts/kcmd/semantic/runtime/runtime.d.ts +94 -0
  111. package/build/ts/kcmd/semantic/runtime/runtime.js +318 -0
  112. package/build/ts/kcmd/semantic/runtime/store.d.ts +112 -0
  113. package/build/ts/kcmd/semantic/runtime/store.js +344 -0
  114. package/build/ts/kcmd/semantic/skills.d.ts +110 -0
  115. package/build/ts/kcmd/semantic/skills.js +697 -0
  116. package/build/ts/kcmd/semantic/source_dialect.d.ts +10 -0
  117. package/build/ts/kcmd/semantic/source_dialect.js +261 -0
  118. package/build/ts/kcmd/semantic/source_entries.d.ts +12 -0
  119. package/build/ts/kcmd/semantic/source_entries.js +282 -0
  120. package/build/ts/kcmd/semantic/spanner.d.ts +18 -0
  121. package/build/ts/kcmd/semantic/spanner.js +60 -0
  122. package/build/ts/kcmd/semantic/sql_expr_utils.d.ts +17 -0
  123. package/build/ts/kcmd/semantic/sql_expr_utils.js +221 -0
  124. package/build/ts/kcmd/semantic/sql_identifiers.d.ts +6 -0
  125. package/build/ts/kcmd/semantic/sql_identifiers.js +267 -0
  126. package/build/ts/kcmd/semantic/sql_parser.d.ts +44 -0
  127. package/build/ts/kcmd/semantic/sql_parser.js +378 -0
  128. package/build/ts/kcmd/semantic/transpile.d.ts +74 -0
  129. package/build/ts/kcmd/semantic/transpile.js +563 -0
  130. package/build/ts/kcmd/semantic/validate.d.ts +35 -0
  131. package/build/ts/kcmd/semantic/validate.js +1899 -0
  132. package/build/ts/kcmd/semantic/yaml_options.d.ts +6 -0
  133. package/build/ts/kcmd/semantic/yaml_options.js +58 -0
  134. package/build/ts/kcmd/semantic/yaml_update.d.ts +26 -0
  135. package/build/ts/kcmd/semantic/yaml_update.js +782 -0
  136. package/build/ts/kcmd/snapshot.d.ts +33 -0
  137. package/build/ts/kcmd/snapshot.js +379 -0
  138. package/build/ts/kcmd/source.d.ts +31 -0
  139. package/build/ts/kcmd/source.js +119 -0
  140. package/build/ts/kcmd/sources/bq-dataset.d.ts +17 -0
  141. package/build/ts/kcmd/sources/bq-dataset.js +131 -0
  142. package/build/ts/kcmd/sources/entrygroup.d.ts +21 -0
  143. package/build/ts/kcmd/sources/entrygroup.js +83 -0
  144. package/build/ts/kcmd/sources/kb.d.ts +21 -0
  145. package/build/ts/kcmd/sources/kb.js +82 -0
  146. package/build/ts/kcmd/sources/semantic-model.d.ts +18 -0
  147. package/build/ts/kcmd/sources/semantic-model.js +48 -0
  148. package/build/ts/kcmd/sync.d.ts +35 -0
  149. package/build/ts/kcmd/sync.js +697 -0
  150. package/package.json +62 -4
@@ -0,0 +1,262 @@
1
+ import * as z from 'zod';
2
+ import { DialectExpression, Entity, Executor, Field, Metric, ProfileSpec, SemanticModel } from './ir';
3
+ import { DeclaredConcept } from './resolve_inheritance';
4
+ export interface LoadOptions {
5
+ dialect?: string;
6
+ defaultProject?: string;
7
+ defaultDataset?: string;
8
+ bindingOptional?: boolean;
9
+ allowLegacyBareSource?: boolean;
10
+ sourceDialects?: ReadonlyMap<string, string>;
11
+ warnUnacceptedSource?: boolean;
12
+ fieldTextChecked?: boolean;
13
+ }
14
+ export interface LoadResult {
15
+ models: SemanticModel[];
16
+ warnings: string[];
17
+ }
18
+ export declare class SemanticModelError extends Error {
19
+ }
20
+ export declare const HALF_BOUND_JOIN_PROBLEM: string;
21
+ export declare function joinLengthProblem(from: number, to: number): string;
22
+ export declare function joinLengthMessage(relationship: string, from: number, to: number): string;
23
+ export declare function undefinedEndpointProblem(side: 'from' | 'to', dataset: string): string;
24
+ export declare const DEFAULT_DIALECT = "BIGQUERY";
25
+ export declare const OSSIE_VERSION = "0.2.0.dev0";
26
+ export declare const GOOGLE_VERSION = "0.2.0.dev0/google";
27
+ /**
28
+ * The declared format version, as stored on the IR
29
+ * (`SemanticModel.version`).
30
+ */
31
+ export type FormatVersion = NonNullable<SemanticModel['version']>;
32
+ export declare function isFormatVersion(v: string): v is FormatVersion;
33
+ /**
34
+ * The location of an IR construct in documents of a given format version:
35
+ * - `'native'`: a direct key on the YAML object (`deployments:`, `extends:`)
36
+ * - `'file'`: a `<model>.profile.<name>.yaml` sidecar file (`profiles`)
37
+ * - `'block'`: a `GOOGLE` `custom_extensions` block on the owning YAML object
38
+ * - `'none'`: unsupported in this format version (rejected on load, warned and
39
+ * omitted on write)
40
+ */
41
+ export type ConstructPlacement = 'native' | 'file' | 'block' | 'none';
42
+ type Placements<K extends string> = Readonly<Record<K, ConstructPlacement>>;
43
+ /**
44
+ * The construct placements for a single format version, grouped by owning YAML
45
+ * object level.
46
+ */
47
+ export interface ConstructPlacements {
48
+ readonly model: Placements<'profiles' | 'deployments' | 'actions' | 'constraints'>;
49
+ readonly dataset: Placements<'extends' | 'abstract'>;
50
+ readonly relationship: Placements<'description'>;
51
+ readonly metric: Placements<'entity'>;
52
+ }
53
+ /**
54
+ * Where each format version places each Google extension construct. Other
55
+ * differences between the versions, such as required bindings and datatype
56
+ * casing, are checked where they are read.
57
+ */
58
+ export declare const FORMAT_VERSION_PLACEMENT: Readonly<Record<FormatVersion, ConstructPlacements>>;
59
+ declare const expressionSchema: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
60
+ dialects: z.ZodArray<z.ZodObject<{
61
+ dialect: z.ZodString;
62
+ expression: z.ZodString;
63
+ }, z.core.$strict>>;
64
+ }, z.core.$strict>]>;
65
+ export declare function noSqlReason(text: string, dialect: string, entity?: string): string | undefined;
66
+ export declare function listed(problems: string[]): string | undefined;
67
+ export declare function expressionDocOf(f: Pick<Field, 'expression' | 'dialects' | 'stringForm' | 'importedExpression' | 'importedDialect'>): string | {
68
+ dialects: DialectExpression[];
69
+ } | undefined;
70
+ export declare function noSqlProblemOf(x: Pick<Field, 'expression' | 'dialects' | 'stringForm' | 'importedExpression' | 'importedDialect'>, entity?: string): string | undefined;
71
+ export declare function inheritedNoSqlProblems(entities: Entity[], concepts: Map<string, DeclaredConcept>, problemOf?: (f: Field, entity?: string) => string | undefined): string[];
72
+ type ExpressionDoc = z.infer<typeof expressionSchema>;
73
+ export declare const GOOGLE_VENDOR = "GOOGLE";
74
+ export declare function isGoogleVendor(vendorName: unknown): boolean;
75
+ export declare function hasGoogleBlock(exts: ReadonlyArray<{
76
+ vendor_name?: unknown;
77
+ }> | undefined): boolean;
78
+ export declare function setsAKeyTwice(data: string): boolean;
79
+ /**
80
+ * The profiles the model in a vanilla document carries in its GOOGLE blocks,
81
+ * read as a load reads them, without loading the rest of the model. So a
82
+ * caller finds a profile even in a model that does not load, as it finds a
83
+ * profile file. Only the profiles in the model's GOOGLE blocks are read, and
84
+ * the load reports a problem with any other key. Empty for a document that is
85
+ * not a vanilla model.
86
+ *
87
+ * A profile's field binding that is not blank needs the SQL parser, so call
88
+ * `loadSqlEngine()` first. Without it, this throws the parser's plain Error.
89
+ *
90
+ * A GOOGLE block whose shape the load rejects is read too, and the load
91
+ * reports its shape. Its profiles may be in data written as a JSON string or
92
+ * as a YAML mapping, or listed beside `vendor_name` with no data. Throws
93
+ * SemanticModelError on profiles a load rejects, on data that sets `profiles`
94
+ * twice or a key twice inside them, and on data that is not a JSON object in
95
+ * a block whose shape the load accepts.
96
+ *
97
+ * Text that is not valid YAML is read as far as it parses. A document whose
98
+ * root keys are all strings, and that sets `version` once, to a string other
99
+ * than the vanilla one, gives none when each YAML error is a key set twice, an
100
+ * alias whose anchor is not set, or more aliases than a load expands. Otherwise
101
+ * its profiles are read as in text that parses, and only when that reading is
102
+ * unambiguous. Each YAML error is a key set twice or an alias whose anchor is
103
+ * not set, since any other error, such as a bad indent, can move the blocks,
104
+ * cut them short or change the version. The document sets `version` once, to
105
+ * the vanilla one, and `semantic_model` at most once. Its model sets
106
+ * `custom_extensions` at most once, and each block that is a mapping sets
107
+ * `vendor_name` once, to a string. A GOOGLE block sets `data` and `profiles` at
108
+ * most once each, and holds no alias. Every key of a mapping on that path is a
109
+ * string, so not an alias or a merge key, and no value on it is an alias. No
110
+ * key is set twice inside `custom_extensions`. When any of these fails, when a
111
+ * GOOGLE block cannot be read, or when a load rejects its profiles, it throws
112
+ * the error a load reports for the text. So does a vanilla model whose text has
113
+ * more aliases than a load expands, or a merge key whose value is not a
114
+ * mapping.
115
+ */
116
+ export declare function googleBlockProfiles(text: string): ProfileSpec[];
117
+ /**
118
+ * The `version` the model document `text` sets, as googleBlockProfiles reads
119
+ * it. Valid YAML gives its version. Past a YAML error, the version is read
120
+ * only when every root key is a string and the root sets `version` once, to a
121
+ * string. Each error must be a key set twice, an alias whose anchor is not
122
+ * set, or more aliases than a load expands. Undefined otherwise, and when the
123
+ * text sets no string version.
124
+ */
125
+ export declare function modelDocumentVersion(text: string): string | undefined;
126
+ export declare function isRecord(v: unknown): v is Record<string, any>;
127
+ export declare function modelAiContexts(doc: unknown): Generator<{
128
+ ai: Record<string, unknown>;
129
+ label: string;
130
+ }>;
131
+ /**
132
+ * Loads YAML or JSON text (a document in the AI-first semantics format) into
133
+ * the Semantic Model IR. `yaml.parse` accepts JSON too, so both are supported.
134
+ *
135
+ * A document with a field or metric expression that is not blank needs the SQL
136
+ * parser, so call `loadSqlEngine()` first. Without it, this throws a plain
137
+ * Error instead of a SemanticModelError.
138
+ */
139
+ export declare function loadModels(text: string, opts?: LoadOptions): LoadResult;
140
+ /**
141
+ * Converts an already-parsed document object into the Semantic Model IR. Throws
142
+ * on a structurally invalid document; softer, lossy conversions are reported in
143
+ * `warnings` rather than thrown.
144
+ */
145
+ export declare function fromDocument(doc: unknown, opts?: LoadOptions): LoadResult;
146
+ export declare function inferMetricEntities(metric: Pick<Metric, 'name' | 'authoredEntity' | 'expression' | 'importedExpression' | 'importedDialect' | 'dialects'>, entityNames: string[], preferred?: string, impliedDialect?: string, version?: FormatVersion): {
147
+ referenced: string[];
148
+ warning?: string;
149
+ };
150
+ export declare function entityAndMetricWarnings(model: SemanticModel, preferred?: string, profiled?: boolean): string[];
151
+ type FieldExpression = Pick<Field, 'expression' | 'dialects' | 'stringForm' | 'importedExpression' | 'importedDialect'>;
152
+ export declare function parseFieldExpression(raw: unknown, where: string, dialect: string, entity: string): FieldExpression;
153
+ export declare function readFieldExpression(raw: unknown, where: string, dialect: string, problemOf: (doc: ExpressionDoc) => string | undefined): FieldExpression;
154
+ export declare function parseFieldBinding(binding: Pick<Field, 'expression' | 'dialects' | 'stringForm' | 'importedExpression' | 'importedDialect'>, where: string, dialect: string, entity: string): FieldExpression;
155
+ export declare function parseExecutor(raw: unknown, where: string): Executor;
156
+ interface ParsedSource {
157
+ dataSource: string;
158
+ authoredSource: string;
159
+ sourceDialect?: string;
160
+ }
161
+ export interface CloudSqlTable {
162
+ project: string;
163
+ location: string;
164
+ instance: string;
165
+ resourceName: string;
166
+ inSchema: boolean;
167
+ }
168
+ export declare function cloudSqlTableOf(source: string): CloudSqlTable | undefined;
169
+ export type SourceTable = {
170
+ resourceName: string;
171
+ project: string;
172
+ } & ({
173
+ system: 'bigquery';
174
+ dataset: string;
175
+ table: string;
176
+ } | {
177
+ system: 'biglake';
178
+ catalog: string;
179
+ } | {
180
+ system: 'spanner';
181
+ instance: string;
182
+ } | {
183
+ system: 'alloydb';
184
+ location: string;
185
+ });
186
+ export declare function sourceTableOf(source: string): SourceTable | undefined;
187
+ export declare function asResourceUri(value: string): string;
188
+ export declare function asResourceName(value: string): string;
189
+ export declare function resourceUriFix(uri: string): string;
190
+ export declare function oldSourceForm(source: string): string | undefined;
191
+ export declare const NO_SPACE = "kcmd cannot name a table whose name holds a space";
192
+ export declare const TABLE_FORMS: {
193
+ bigquery: string;
194
+ spanner: string;
195
+ alloydb: string;
196
+ cloudsql: string;
197
+ cloudsqlSchema: string;
198
+ biglake: string;
199
+ };
200
+ export declare function fillForm(form: string, parts: string[]): string | undefined;
201
+ export declare function dottedPartProblem(parts: string[], form: string, service?: boolean): string | undefined;
202
+ export declare function catalogNameSegments(path: string, colons?: boolean): string[];
203
+ export declare function hasUnquotedWhitespace(source: string): boolean;
204
+ export declare function databaseOf(written: string): string | undefined;
205
+ export declare function isAcceptedSource(source: string | undefined): boolean;
206
+ export declare function writtenSource(entity: {
207
+ authoredSource?: string;
208
+ dataSource?: string;
209
+ }): string;
210
+ export declare function sourceToDataSource(source: string): string;
211
+ export declare const DIALECT_OF_ENTRY_TYPE: Record<string, string>;
212
+ export declare const DIALECT_OF_FQN_PREFIX: Map<string, string>;
213
+ export declare const ENTRY_NAME_FORM = "projects/<p>/locations/<l>/entryGroups/<g>/entries/<id>";
214
+ export declare const THIRD_PARTY_SOURCE: string;
215
+ export interface ThirdPartyEntry {
216
+ project: string;
217
+ location: string;
218
+ name: string;
219
+ }
220
+ export declare function thirdPartyEntryOf(source: string): ThirdPartyEntry | undefined;
221
+ export declare function bindsThirdPartyTable(entity: {
222
+ authoredSource?: string;
223
+ }): boolean;
224
+ export declare function dialectLookupKey(source: string): string | undefined;
225
+ export declare function isGoogleCloudForm(source: string): boolean;
226
+ export declare function parseSource(source: string, opts: LoadOptions, ctx: string, warnings?: string[], importHint?: boolean): ParsedSource;
227
+ export declare function unquote(part: string): string;
228
+ export declare function bareNameSegments(name: string, bigQuery: boolean): string[];
229
+ export declare function bareNameParts(name: string, bigQuery: boolean): Array<{
230
+ text: string;
231
+ quoted: boolean;
232
+ }>;
233
+ export interface LoadedModel {
234
+ document: string;
235
+ model: SemanticModel;
236
+ }
237
+ export interface LoadedModels {
238
+ models: LoadedModel[];
239
+ warnings: string[];
240
+ error?: string;
241
+ }
242
+ /**
243
+ * Loads every authored document into the IR once, so a multi-destination push
244
+ * parses and validates each model a single time and fans the result out to each
245
+ * deploy leg (BigQuery, Knowledge Catalog) rather than re-parsing per leg.
246
+ *
247
+ * A parse/schema error is returned as `error` (naming the document) rather than
248
+ * thrown, mirroring how the deploy legs previously reported it; loader warnings
249
+ * are prefixed with their document name.
250
+ *
251
+ * A document's `allowLegacyBareSource` sets that load option for that document
252
+ * alone.
253
+ *
254
+ * Each document needs the SQL parser as loadModels does, so call
255
+ * `loadSqlEngine()` first. Without it, this throws the parser's plain Error.
256
+ */
257
+ export declare function loadSemanticModels(docs: {
258
+ name: string;
259
+ text: string;
260
+ allowLegacyBareSource?: boolean;
261
+ }[], opts?: LoadOptions): LoadedModels;
262
+ export {};