@api-client/core 0.12.2 → 0.12.4
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/build/src/browser.d.ts +2 -0
- package/build/src/browser.d.ts.map +1 -1
- package/build/src/browser.js +2 -0
- package/build/src/browser.js.map +1 -1
- package/build/src/events/BaseEvents.d.ts +11 -1
- package/build/src/events/BaseEvents.d.ts.map +1 -1
- package/build/src/events/BaseEvents.js.map +1 -1
- package/build/src/index.d.ts +2 -0
- package/build/src/index.d.ts.map +1 -1
- package/build/src/index.js +2 -0
- package/build/src/index.js.map +1 -1
- package/build/src/modeling/DomainVersioning.d.ts +2 -2
- package/build/src/modeling/DomainVersioning.d.ts.map +1 -1
- package/build/src/modeling/DomainVersioning.js +16 -1
- package/build/src/modeling/DomainVersioning.js.map +1 -1
- package/build/src/modeling/validation/entity_validation.js +2 -2
- package/build/src/modeling/validation/entity_validation.js.map +1 -1
- package/build/src/modeling/validation/rules.js +2 -2
- package/build/src/modeling/validation/rules.js.map +1 -1
- package/build/src/models/DataCatalog.d.ts +142 -0
- package/build/src/models/DataCatalog.d.ts.map +1 -0
- package/build/src/models/DataCatalog.js +120 -0
- package/build/src/models/DataCatalog.js.map +1 -0
- package/build/src/models/DataCatalogVersion.d.ts +123 -0
- package/build/src/models/DataCatalogVersion.d.ts.map +1 -0
- package/build/src/models/DataCatalogVersion.js +118 -0
- package/build/src/models/DataCatalogVersion.js.map +1 -0
- package/build/src/models/kinds.d.ts +2 -0
- package/build/src/models/kinds.d.ts.map +1 -1
- package/build/src/models/kinds.js +2 -0
- package/build/src/models/kinds.js.map +1 -1
- package/build/src/runtime/store/DataCatalogSdk.d.ts +46 -0
- package/build/src/runtime/store/DataCatalogSdk.d.ts.map +1 -0
- package/build/src/runtime/store/DataCatalogSdk.js +425 -0
- package/build/src/runtime/store/DataCatalogSdk.js.map +1 -0
- package/build/src/runtime/store/RouteBuilder.d.ts +10 -0
- package/build/src/runtime/store/RouteBuilder.d.ts.map +1 -1
- package/build/src/runtime/store/RouteBuilder.js +30 -0
- package/build/src/runtime/store/RouteBuilder.js.map +1 -1
- package/build/src/runtime/store/Sdk.d.ts +2 -0
- package/build/src/runtime/store/Sdk.d.ts.map +1 -1
- package/build/src/runtime/store/Sdk.js +10 -2
- package/build/src/runtime/store/Sdk.js.map +1 -1
- package/build/src/runtime/store/StoreSdkNode.d.ts +1 -0
- package/build/src/runtime/store/StoreSdkNode.d.ts.map +1 -1
- package/build/src/runtime/store/StoreSdkNode.js.map +1 -1
- package/build/src/runtime/store/StoreSdkWeb.d.ts +1 -0
- package/build/src/runtime/store/StoreSdkWeb.d.ts.map +1 -1
- package/build/src/runtime/store/StoreSdkWeb.js.map +1 -1
- package/data/models/example-generator-api.json +6 -6
- package/package.json +1 -1
- package/src/events/BaseEvents.ts +11 -1
- package/src/modeling/DomainVersioning.ts +18 -3
- package/src/modeling/validation/entity_validation.ts +2 -2
- package/src/modeling/validation/rules.ts +2 -2
- package/src/models/DataCatalog.ts +260 -0
- package/src/models/DataCatalogVersion.ts +235 -0
- package/src/models/kinds.ts +2 -0
- package/src/runtime/store/DataCatalogSdk.ts +473 -0
- package/src/runtime/store/RouteBuilder.ts +40 -0
- package/src/runtime/store/Sdk.ts +11 -2
- package/src/runtime/store/StoreSdkNode.ts +1 -0
- package/src/runtime/store/StoreSdkWeb.ts +1 -0
- package/tests/unit/modeling/validation/association_validation.spec.ts +17 -0
- package/tests/unit/modeling/validation/entity_validation.spec.ts +1 -1
- package/tests/unit/modeling/validation/property_validation.spec.ts +10 -0
|
@@ -6,7 +6,22 @@
|
|
|
6
6
|
*/
|
|
7
7
|
export function createGraphVersion(root, version) {
|
|
8
8
|
root.info.version = version;
|
|
9
|
-
|
|
9
|
+
const graph = serializeForVersionRelease(root);
|
|
10
|
+
const result = {
|
|
11
|
+
key: root.key,
|
|
12
|
+
kind: root.kind,
|
|
13
|
+
info: root.info.toJSON(),
|
|
14
|
+
graph,
|
|
15
|
+
};
|
|
16
|
+
if (root.dependencyList.length) {
|
|
17
|
+
// Note: the used dependencies are serialized in the graph.
|
|
18
|
+
// The dependency list is only preserved for linage purposes.
|
|
19
|
+
result.dependencyList = [...root.dependencyList];
|
|
20
|
+
}
|
|
21
|
+
if (root.fields.length) {
|
|
22
|
+
result.fields = [...root.fields];
|
|
23
|
+
}
|
|
24
|
+
return result;
|
|
10
25
|
}
|
|
11
26
|
/**
|
|
12
27
|
* Serializes a DataDomain for version release, including only relevant foreign nodes.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DomainVersioning.js","sourceRoot":"","sources":["../../../src/modeling/DomainVersioning.ts"],"names":[],"mappings":"AAIA;;;;;GAKG;AACH,MAAM,UAAU,kBAAkB,CAAC,IAAgB,EAAE,OAAe;IAClE,IAAI,CAAC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;IAC3B,
|
|
1
|
+
{"version":3,"file":"DomainVersioning.js","sourceRoot":"","sources":["../../../src/modeling/DomainVersioning.ts"],"names":[],"mappings":"AAIA;;;;;GAKG;AACH,MAAM,UAAU,kBAAkB,CAAC,IAAgB,EAAE,OAAe;IAClE,IAAI,CAAC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;IAC3B,MAAM,KAAK,GAAG,0BAA0B,CAAC,IAAI,CAAC,CAAA;IAC9C,MAAM,MAAM,GAAqB;QAC/B,GAAG,EAAE,IAAI,CAAC,GAAG;QACb,IAAI,EAAE,IAAI,CAAC,IAAI;QACf,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE;QACxB,KAAK;KACN,CAAA;IACD,IAAI,IAAI,CAAC,cAAc,CAAC,MAAM,EAAE,CAAC;QAC/B,2DAA2D;QAC3D,6DAA6D;QAC7D,MAAM,CAAC,cAAc,GAAG,CAAC,GAAG,IAAI,CAAC,cAAc,CAAC,CAAA;IAClD,CAAC;IACD,IAAI,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC;QACvB,MAAM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C,MAAM,KAAK,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;YAC1B,IAAI,EAAE,GAAG,IAAI,CAAC,CAAC,CAAA;YACf,IAAI,KAAK,EAAE,OAAO,EAAE,CAAC;gBACnB,EAAE,GAAG,GAAG,KAAK,CAAC,MAAM,IAAI,IAAI,CAAC,CAAC,EAAE,CAAA;YAClC,CAAC;YACD,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;QAChB,CAAC;IACH,CAAC;IAED,OAAO,KAAK,CAAA,CAAC,uCAAuC;AACtD,CAAC","sourcesContent":["import type { JsonEdge, Node } from '@api-client/graph'\nimport type { DataDomain, DataDomainSchema } from './DataDomain.js'\nimport type { DomainGraphEdge, DataDomainGraph, SerializedGraph } from './types.js'\n\n/**\n * Serializes a DataDomain for version release, including only relevant foreign nodes.\n * @param root The DataDomain to serialize.\n * @param version The version to set in the serialized graph. This mutates the DataDomain.\n * @returns The serialized graph with the version set.\n */\nexport function createGraphVersion(root: DataDomain, version: string): DataDomainSchema {\n root.info.version = version\n const graph = serializeForVersionRelease(root)\n const result: DataDomainSchema = {\n key: root.key,\n kind: root.kind,\n info: root.info.toJSON(),\n graph,\n }\n if (root.dependencyList.length) {\n // Note: the used dependencies are serialized in the graph.\n // The dependency list is only preserved for linage purposes.\n result.dependencyList = [...root.dependencyList]\n }\n if (root.fields.length) {\n result.fields = [...root.fields]\n }\n return result\n}\n\n/**\n * Serializes a DataDomain for version release, including only relevant foreign nodes.\n *\n * @param dataDomain The DataDomain to serialize.\n * @returns A SerializedGraph containing the versioned data.\n */\nexport function serializeForVersionRelease(dataDomain: DataDomain): SerializedGraph {\n const { graph, key: domainKey } = dataDomain\n const relevantForeignNodes = new Set<string>()\n\n // 1. Identify relevant foreign nodes: those connected to local entities.\n for (const node of graph.nodes()) {\n const nodeValue = graph.node(node)\n if (!nodeValue) {\n continue\n }\n if (nodeValue.domain.key === domainKey) {\n continue // Skip local nodes\n }\n\n // Check if the foreign node is connected to a local node (directly or indirectly).\n if (isConnectedToLocal(graph, node, domainKey)) {\n relevantForeignNodes.add(node)\n }\n }\n\n // 2. Filter nodes and edges based on relevance.\n const nodes = []\n const edges = []\n\n for (const node of graph.nodes()) {\n const nodeValue = graph.node(node)\n if (!nodeValue) {\n continue\n }\n\n if (nodeValue.domain.key === domainKey || relevantForeignNodes.has(node)) {\n const parents = [...graph.parents(node)]\n const serializedNode: Node<object> = { v: node, value: nodeValue.toJSON() }\n if (parents.length) {\n serializedNode.parents = parents\n }\n nodes.push(serializedNode)\n }\n }\n\n for (const edge of graph.edges()) {\n const edgeValue = graph.edge(edge)\n if (!edgeValue) continue\n\n const sourceNode = graph.node(edge.v)\n const targetNode = graph.node(edge.w)\n\n if (!sourceNode || !targetNode) continue\n\n const isSourceRelevant = sourceNode.domain.key === domainKey || relevantForeignNodes.has(edge.v)\n const isTargetRelevant = targetNode.domain.key === domainKey || relevantForeignNodes.has(edge.w)\n\n if (isSourceRelevant && isTargetRelevant) {\n const serializedEdge: JsonEdge<DomainGraphEdge> = { v: edge.v, w: edge.w, value: structuredClone(edgeValue) }\n if (edge.name) {\n serializedEdge.name = edge.name\n }\n edges.push(serializedEdge)\n }\n }\n\n // 3. Construct the SerializedGraph.\n const json: SerializedGraph = {\n options: {\n directed: graph.isDirected(),\n multigraph: graph.isMultigraph(),\n compound: graph.isCompound(),\n },\n nodes,\n edges,\n }\n\n return json\n}\n\n/**\n * Checks if a foreign node is connected to a local node (directly or indirectly).\n *\n * This function performs a breadth-first search (BFS) to determine if a foreign node\n * is connected to any local node.\n *\n * @param g The DataDomain graph.\n * @param node The key of the foreign node to check.\n * @param domainKey The key of the local domain.\n * @returns True if the foreign node is connected to a local node.\n */\nfunction isConnectedToLocal(g: DataDomainGraph, node: string, domainKey: string): boolean {\n const visited = new Set<string>()\n const queue: string[] = [node]\n\n while (queue.length > 0) {\n const current = queue.shift() as string\n if (visited.has(current)) {\n continue\n }\n visited.add(current)\n\n const value = g.node(current)\n if (!value) {\n continue\n }\n\n if (value.domain.key === domainKey) {\n // It means the foreign node is connected to a local node.\n return true\n }\n\n // Explore adjacent nodes (both incoming and outgoing edges).\n for (const edge of g.inEdges(current)) {\n queue.push(edge.v)\n }\n for (const edge of g.outEdges(current)) {\n const label = g.edge(edge)\n let id = edge.w\n if (label?.foreign) {\n id = `${label.domain}:${edge.w}`\n }\n queue.push(id)\n }\n }\n\n return false // No connection to a local node found.\n}\n"]}
|
|
@@ -126,9 +126,9 @@ export class EntityValidation {
|
|
|
126
126
|
return results;
|
|
127
127
|
}
|
|
128
128
|
const name = entity.info.name;
|
|
129
|
-
if (name.length <
|
|
129
|
+
if (name.length < 2) {
|
|
130
130
|
const message = `The "${label}" entity name is too short.`;
|
|
131
|
-
const help = `The name must be at least
|
|
131
|
+
const help = `The name must be at least 2 characters long.`;
|
|
132
132
|
results.push({
|
|
133
133
|
field: 'name',
|
|
134
134
|
rule: 'length',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entity_validation.js","sourceRoot":"","sources":["../../../../src/modeling/validation/entity_validation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AAGxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AAGlD;;;;;;GAMG;AACH,MAAM,OAAO,gBAAgB;IACL;IAAtB,YAAsB,MAAkB;QAAlB,WAAM,GAAN,MAAM,CAAY;IAAG,CAAC;IAE5C;;;;OAIG;IACH,QAAQ,CAAC,MAA6B;QACpC,MAAM,OAAO,GAAuB,EAAE,CAAA;QACtC,IAAI,MAAgC,CAAA;QACpC,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE,CAAC;YAC/B,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,CAAA;QACzC,CAAC;aAAM,CAAC;YACN,MAAM,GAAG,MAAM,CAAA;QACjB,CAAC;QACD,IAAI,CAAC,MAAM,EAA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CAAC,IAAI,EAAE,WAAW,EAAE,KAAK,IAAI,IAAI,KAAK,CAAC,GAAG,KAAK,MAAM,CAAC,GAAG,EAAE,CAAC;gBACxE,MAAM,OAAO,GAAG,QAAQ,IAAI,mDAAmD,CAAA;gBAC/E,MAAM,IAAI,GAAG,0EAA0E,CAAA;gBACvF,OAAO,CAAC,IAAI,CAAC;oBACX,KAAK,EAAE,MAAM;oBACb,IAAI,EAAE,QAAQ;oBACd,OAAO;oBACP,IAAI;oBACJ,QAAQ,EAAE,OAAO;oBACjB,GAAG,EAAE,KAAK,CAAC,GAAG;oBACd,IAAI,EAAE,KAAK,CAAC,IAAI;iBACjB,CAAC,CAAA;YACJ,CAAC;QACH,CAAC;QACD,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,MAAM,CAAC,mBAAmB,EAAE,EAAE,CAAC;YACtD,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,EAAE,WAAW,EAAE,KAAK,IAAI,IAAI,KAAK,CAAC,GAAG,KAAK,MAAM,CAAC,GAAG,EAAE,CAAC;gBACxE,MAAM,OAAO,GAAG,QAAQ,IAAI,2DAA2D,CAAA;gBACvF,MAAM,IAAI,GAAG,0EAA0E,CAAA;gBACvF,OAAO,CAAC,IAAI,CAAC;oBACX,KAAK,EAAE,MAAM;oBACb,IAAI,EAAE,QAAQ;oBACd,OAAO;oBACP,IAAI;oBACJ,QAAQ,EAAE,OAAO;oBACjB,GAAG,EAAE,KAAK,CAAC,GAAG;oBACd,IAAI,EAAE,KAAK,CAAC,IAAI;oBAChB,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG;iBACzB,CAAC,CAAA;YACJ,CAAC;QACH,CAAC;QACD,OAAO,OAAO,CAAA;IAChB,CAAC;CACF","sourcesContent":["import { DomainEntityKind } from '../../models/kinds.js'\nimport type { DataDomain } from '../DataDomain.js'\nimport type { DomainEntity } from '../DomainEntity.js'\nimport { ReservedKeywords } from './postgresql.js'\nimport type { DomainValidation } from './rules.js'\n\n/**\n * EntityValidation is a class that performs validation on entities in a data domain.\n *\n * @remarks\n * - We do not need to check for parent uniqueness here, because in the graph there can only be one edge\n * between two nodes. Parent relationships are described by an edge in the graph.\n */\nexport class EntityValidation {\n constructor(protected domain: DataDomain) {}\n\n /**\n * Performs all the validation rules on the entity.\n * If you are interested in a specific rule, use the specific method.\n * @param target The target entity to validate. Can be a string with the entity key or a DomainEntity object.\n */\n validate(target: string | DomainEntity): DomainValidation[] {\n const results: DomainValidation[] = []\n let entity: DomainEntity | undefined\n if (typeof target === 'string') {\n entity = this.domain.findEntity(target)\n } else {\n entity = target\n }\n if (!entity) {\n const message = `The \"${target}\" entity does not exist.`\n const help = `The entity must be defined in the domain.`\n results.push({\n field: '*',\n rule: 'exists',\n message,\n help,\n key: target as string,\n kind: DomainEntityKind,\n severity: 'error',\n })\n return results\n }\n const primary = this.validatePrimaryKey(entity)\n results.push(...primary)\n const minimum = this.minimumRequiredProperties(entity)\n results.push(...minimum)\n const name = this.validateName(entity)\n results.push(...name)\n const uniqueName = this.uniqueName(entity)\n results.push(...uniqueName)\n return results\n }\n\n /**\n * Validates the entity against the primary key validation rules.\n * @param entity The entity to validate\n * @returns The list of validation messages.\n */\n validatePrimaryKey(entity: DomainEntity): DomainValidation[] {\n const results: DomainValidation[] = []\n const primary = entity.primaryKey()\n if (!primary) {\n const message = `The \"${entity.info.getLabel()}\" entity has no identifier.`\n const help = `An entity that can exists by itself must have identifier defined.`\n results.push({\n field: 'properties',\n rule: 'primary_key',\n message,\n help,\n severity: 'error',\n key: entity.key,\n kind: entity.kind,\n })\n }\n return results\n }\n\n /**\n * Checks if the entity has the minimum required properties.\n * @param entity The entity to validate\n */\n minimumRequiredProperties(entity: DomainEntity): DomainValidation[] {\n const results: DomainValidation[] = []\n if (!entity.hasProperties() && !entity.hasAssociations()) {\n const message = `The \"${entity.info.getLabel()}\" entity has no properties. It will be ignored.`\n const help = `Entities that have no properties are ignored in the data domain. No schema will be generated for it.`\n results.push({\n field: 'properties',\n rule: 'required',\n message,\n help,\n severity: 'warning',\n key: entity.key,\n kind: entity.kind,\n })\n }\n return results\n }\n\n /**\n * Validates the entity name.\n *\n * @remarks\n * - An entity must have a name defined.\n * - The name has to follow the same rules as the names in a PostgreSQL database.\n * - Table names must start with a letter (a-z) or underscore (_).\n * - Subsequent characters can be letters, digits (0-9), or underscores (_).\n * - Names are case-insensitive.\n * - The maximum length of a table name is 31 characters\n * - Should be snake case (it's a convention, not an error).\n * - Should not be a reserved word (for example: \"IN\", \"SELECT\", \"FROM\", etc.).\n * @param entity The entity to validate\n */\n validateName(entity: DomainEntity): DomainValidation[] {\n const results: DomainValidation[] = []\n const label = entity.info.getLabel()\n if (!entity.info.name) {\n const message = `The \"${label}\" entity has no name.`\n const help = `An entity must have a name.`\n results.push({\n field: 'name',\n rule: 'required',\n message,\n help,\n severity: 'error',\n key: entity.key,\n kind: entity.kind,\n })\n return results\n }\n\n const name = entity.info.name\n if (name.length < 3) {\n const message = `The \"${label}\" entity name is too short.`\n const help = `The name must be at least 3 characters long.`\n results.push({\n field: 'name',\n rule: 'length',\n message,\n help,\n severity: 'error',\n key: entity.key,\n kind: entity.kind,\n })\n }\n if (name.length > 31) {\n const message = `The \"${label}\" entity name is too long.`\n const help = `The name must be at most 31 characters long.`\n results.push({\n field: 'name',\n rule: 'length',\n message,\n help,\n severity: 'error',\n key: entity.key,\n kind: entity.kind,\n })\n }\n if (!/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(name)) {\n const message = `The \"${label}\" entity name is invalid.`\n const help = `The name must start with a letter (a-z) or underscore (_). Subsequent characters can be letters, digits (0-9), or underscores (_).`\n results.push({\n field: 'name',\n rule: 'format',\n message,\n help,\n severity: 'error',\n key: entity.key,\n kind: entity.kind,\n })\n }\n if (/^[A-Z]/.test(name)) {\n const message = `The \"${label}\" entity name is not in snake case.`\n const help = `The name should be in snake case (lowercase letters and underscores).`\n results.push({\n field: 'name',\n rule: 'snake_case',\n message,\n help,\n severity: 'info',\n key: entity.key,\n kind: entity.kind,\n })\n }\n if (ReservedKeywords.has(name.toUpperCase())) {\n const message = `The \"${label}\" entity name is a reserved keyword.`\n const help = `The name should not be a reserved keyword.`\n results.push({\n field: 'name',\n rule: 'reserved',\n message,\n help,\n severity: 'error',\n key: entity.key,\n kind: entity.kind,\n })\n }\n return results\n }\n\n /**\n * Checks if the entity name is unique in the data domain.\n * @param entity The entity to validate\n */\n uniqueName(entity: DomainEntity): DomainValidation[] {\n const results: DomainValidation[] = []\n const name = entity.info.name?.toLowerCase()\n if (!name) {\n return results\n }\n // We need to check the unique names in all entities, including foreign ones.\n for (const other of this.domain.listEntities()) {\n if (other.info.name?.toLowerCase() === name && other.key !== entity.key) {\n const message = `The \"${name}\" entity name is already used in the data domain.`\n const help = `The name must be unique. This includes references to other data domains.`\n results.push({\n field: 'name',\n rule: 'unique',\n message,\n help,\n severity: 'error',\n key: other.key,\n kind: other.kind,\n })\n }\n }\n for (const other of this.domain.listForeignEntities()) {\n if (other.info.name?.toLowerCase() === name && other.key !== entity.key) {\n const message = `The \"${name}\" entity name is already used in the foreign data domain.`\n const help = `The name must be unique. This includes references to other data domains.`\n results.push({\n field: 'name',\n rule: 'unique',\n message,\n help,\n severity: 'error',\n key: other.key,\n kind: other.kind,\n parent: other.domain.key,\n })\n }\n }\n return results\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"entity_validation.js","sourceRoot":"","sources":["../../../../src/modeling/validation/entity_validation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AAGxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AAGlD;;;;;;GAMG;AACH,MAAM,OAAO,gBAAgB;IACL;IAAtB,YAAsB,MAAkB;QAAlB,WAAM,GAAN,MAAM,CAAY;IAAG,CAAC;IAE5C;;;;OAIG;IACH,QAAQ,CAAC,MAA6B;QACpC,MAAM,OAAO,GAAuB,EAAE,CAAA;QACtC,IAAI,M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B,CAAC,CAAA;YACJ,CAAC;QACH,CAAC;QACD,OAAO,OAAO,CAAA;IAChB,CAAC;CACF","sourcesContent":["import { DomainEntityKind } from '../../models/kinds.js'\nimport type { DataDomain } from '../DataDomain.js'\nimport type { DomainEntity } from '../DomainEntity.js'\nimport { ReservedKeywords } from './postgresql.js'\nimport type { DomainValidation } from './rules.js'\n\n/**\n * EntityValidation is a class that performs validation on entities in a data domain.\n *\n * @remarks\n * - We do not need to check for parent uniqueness here, because in the graph there can only be one edge\n * between two nodes. Parent relationships are described by an edge in the graph.\n */\nexport class EntityValidation {\n constructor(protected domain: DataDomain) {}\n\n /**\n * Performs all the validation rules on the entity.\n * If you are interested in a specific rule, use the specific method.\n * @param target The target entity to validate. Can be a string with the entity key or a DomainEntity object.\n */\n validate(target: string | DomainEntity): DomainValidation[] {\n const results: DomainValidation[] = []\n let entity: DomainEntity | undefined\n if (typeof target === 'string') {\n entity = this.domain.findEntity(target)\n } else {\n entity = target\n }\n if (!entity) {\n const message = `The \"${target}\" entity does not exist.`\n const help = `The entity must be defined in the domain.`\n results.push({\n field: '*',\n rule: 'exists',\n message,\n help,\n key: target as string,\n kind: DomainEntityKind,\n severity: 'error',\n })\n return results\n }\n const primary = this.validatePrimaryKey(entity)\n results.push(...primary)\n const minimum = this.minimumRequiredProperties(entity)\n results.push(...minimum)\n const name = this.validateName(entity)\n results.push(...name)\n const uniqueName = this.uniqueName(entity)\n results.push(...uniqueName)\n return results\n }\n\n /**\n * Validates the entity against the primary key validation rules.\n * @param entity The entity to validate\n * @returns The list of validation messages.\n */\n validatePrimaryKey(entity: DomainEntity): DomainValidation[] {\n const results: DomainValidation[] = []\n const primary = entity.primaryKey()\n if (!primary) {\n const message = `The \"${entity.info.getLabel()}\" entity has no identifier.`\n const help = `An entity that can exists by itself must have identifier defined.`\n results.push({\n field: 'properties',\n rule: 'primary_key',\n message,\n help,\n severity: 'error',\n key: entity.key,\n kind: entity.kind,\n })\n }\n return results\n }\n\n /**\n * Checks if the entity has the minimum required properties.\n * @param entity The entity to validate\n */\n minimumRequiredProperties(entity: DomainEntity): DomainValidation[] {\n const results: DomainValidation[] = []\n if (!entity.hasProperties() && !entity.hasAssociations()) {\n const message = `The \"${entity.info.getLabel()}\" entity has no properties. It will be ignored.`\n const help = `Entities that have no properties are ignored in the data domain. No schema will be generated for it.`\n results.push({\n field: 'properties',\n rule: 'required',\n message,\n help,\n severity: 'warning',\n key: entity.key,\n kind: entity.kind,\n })\n }\n return results\n }\n\n /**\n * Validates the entity name.\n *\n * @remarks\n * - An entity must have a name defined.\n * - The name has to follow the same rules as the names in a PostgreSQL database.\n * - Table names must start with a letter (a-z) or underscore (_).\n * - Subsequent characters can be letters, digits (0-9), or underscores (_).\n * - Names are case-insensitive.\n * - The maximum length of a table name is 31 characters\n * - Should be snake case (it's a convention, not an error).\n * - Should not be a reserved word (for example: \"IN\", \"SELECT\", \"FROM\", etc.).\n * @param entity The entity to validate\n */\n validateName(entity: DomainEntity): DomainValidation[] {\n const results: DomainValidation[] = []\n const label = entity.info.getLabel()\n if (!entity.info.name) {\n const message = `The \"${label}\" entity has no name.`\n const help = `An entity must have a name.`\n results.push({\n field: 'name',\n rule: 'required',\n message,\n help,\n severity: 'error',\n key: entity.key,\n kind: entity.kind,\n })\n return results\n }\n\n const name = entity.info.name\n if (name.length < 2) {\n const message = `The \"${label}\" entity name is too short.`\n const help = `The name must be at least 2 characters long.`\n results.push({\n field: 'name',\n rule: 'length',\n message,\n help,\n severity: 'error',\n key: entity.key,\n kind: entity.kind,\n })\n }\n if (name.length > 31) {\n const message = `The \"${label}\" entity name is too long.`\n const help = `The name must be at most 31 characters long.`\n results.push({\n field: 'name',\n rule: 'length',\n message,\n help,\n severity: 'error',\n key: entity.key,\n kind: entity.kind,\n })\n }\n if (!/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(name)) {\n const message = `The \"${label}\" entity name is invalid.`\n const help = `The name must start with a letter (a-z) or underscore (_). Subsequent characters can be letters, digits (0-9), or underscores (_).`\n results.push({\n field: 'name',\n rule: 'format',\n message,\n help,\n severity: 'error',\n key: entity.key,\n kind: entity.kind,\n })\n }\n if (/^[A-Z]/.test(name)) {\n const message = `The \"${label}\" entity name is not in snake case.`\n const help = `The name should be in snake case (lowercase letters and underscores).`\n results.push({\n field: 'name',\n rule: 'snake_case',\n message,\n help,\n severity: 'info',\n key: entity.key,\n kind: entity.kind,\n })\n }\n if (ReservedKeywords.has(name.toUpperCase())) {\n const message = `The \"${label}\" entity name is a reserved keyword.`\n const help = `The name should not be a reserved keyword.`\n results.push({\n field: 'name',\n rule: 'reserved',\n message,\n help,\n severity: 'error',\n key: entity.key,\n kind: entity.kind,\n })\n }\n return results\n }\n\n /**\n * Checks if the entity name is unique in the data domain.\n * @param entity The entity to validate\n */\n uniqueName(entity: DomainEntity): DomainValidation[] {\n const results: DomainValidation[] = []\n const name = entity.info.name?.toLowerCase()\n if (!name) {\n return results\n }\n // We need to check the unique names in all entities, including foreign ones.\n for (const other of this.domain.listEntities()) {\n if (other.info.name?.toLowerCase() === name && other.key !== entity.key) {\n const message = `The \"${name}\" entity name is already used in the data domain.`\n const help = `The name must be unique. This includes references to other data domains.`\n results.push({\n field: 'name',\n rule: 'unique',\n message,\n help,\n severity: 'error',\n key: other.key,\n kind: other.kind,\n })\n }\n }\n for (const other of this.domain.listForeignEntities()) {\n if (other.info.name?.toLowerCase() === name && other.key !== entity.key) {\n const message = `The \"${name}\" entity name is already used in the foreign data domain.`\n const help = `The name must be unique. This includes references to other data domains.`\n results.push({\n field: 'name',\n rule: 'unique',\n message,\n help,\n severity: 'error',\n key: other.key,\n kind: other.kind,\n parent: other.domain.key,\n })\n }\n }\n return results\n }\n}\n"]}
|
|
@@ -35,9 +35,9 @@ export function validatePropertyName(property) {
|
|
|
35
35
|
return results;
|
|
36
36
|
}
|
|
37
37
|
const name = property.info.name;
|
|
38
|
-
if (name.length <
|
|
38
|
+
if (name.length < 2) {
|
|
39
39
|
const message = `The "${label}" ${type} name is too short.`;
|
|
40
|
-
const help = `The name must be at least
|
|
40
|
+
const help = `The name must be at least 2 characters long.`;
|
|
41
41
|
results.push({
|
|
42
42
|
field: 'name',
|
|
43
43
|
rule: 'length',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rules.js","sourceRoot":"","sources":["../../../../src/modeling/validation/rules.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AAKlD,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAA;AAwC1D;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,oBAAoB,CAAC,QAA4C;IAC/E,MAAM,OAAO,GAAuB,EAAE,CAAA;IACtC,MAAM,KAAK,GAAG,QAAQ,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAA;IACtC,MAAM,YAAY,GAAG,QAAQ,CAAC,iBAAiB,EAAkB,CAAA;IACjE,MAAM,IAAI,GAAG,QAAQ,CAAC,IAAI,KAAK,kBAAkB,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,aAAa,CAAA;IAC9E,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;QACxB,MAAM,OAAO,GAAG,QAAQ,KAAK,KAAK,IAAI,eAAe,CAAA;QACrD,MAAM,IAAI,GAAG,OAAO,IAAI,oBAAoB,CAAA;QAC5C,OAAO,CAAC,IAAI,CAAC;YACX,KAAK,EAAE,MAAM;YACb,IAAI,EAAE,UAAU;YAChB,OAAO;YACP,IAAI;YACJ,QAAQ,EAAE,OAAO;YACjB,GAAG,EAAE,QAAQ,CAAC,GAAG;YACjB,IAAI,EAAE,QAAQ,CAAC,IAAI;YACnB,MAAM,EAAE,YAAY,CAAC,GAAG;SACzB,CAAC,CAAA;QACF,OAAO,OAAO,CAAA;IAChB,CAAC;IACD,MAAM,IAAI,GAAG,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAA;IAC/B,IAAI,IAAI,CAAC,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B,CAAC,CAAA;IACJ,CAAC;IACD,IAAI,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;QACxB,MAAM,OAAO,GAAG,QAAQ,KAAK,KAAK,IAAI,6BAA6B,CAAA;QACnE,MAAM,IAAI,GAAG,uEAAuE,CAAA;QACpF,OAAO,CAAC,IAAI,CAAC;YACX,KAAK,EAAE,MAAM;YACb,IAAI,EAAE,YAAY;YAClB,OAAO;YACP,IAAI;YACJ,QAAQ,EAAE,MAAM;YAChB,GAAG,EAAE,QAAQ,CAAC,GAAG;YACjB,IAAI,EAAE,QAAQ,CAAC,IAAI;YACnB,MAAM,EAAE,YAAY,CAAC,GAAG;SACzB,CAAC,CAAA;IACJ,CAAC;IACD,IAAI,gBAAgB,CAAC,GAAG,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,EAAE,CAAC;QAC7C,MAAM,OAAO,GAAG,QAAQ,KAAK,KAAK,IAAI,8BAA8B,CAAA;QACpE,MAAM,IAAI,GAAG,4CAA4C,CAAA;QACzD,OAAO,CAAC,IAAI,CAAC;YACX,KAAK,EAAE,MAAM;YACb,IAAI,EAAE,UAAU;YAChB,OAAO;YACP,IAAI;YACJ,QAAQ,EAAE,OAAO;YACjB,GAAG,EAAE,QAAQ,CAAC,GAAG;YACjB,IAAI,EAAE,QAAQ,CAAC,IAAI;YACnB,MAAM,EAAE,YAAY,CAAC,GAAG;SACzB,CAAC,CAAA;IACJ,CAAC;IACD,OAAO,OAAO,CAAA;AAChB,CAAC","sourcesContent":["import { ReservedKeywords } from './postgresql.js'\nimport type { DomainProperty } from '../DomainProperty.js'\nimport type { DomainAssociation } from '../DomainAssociation.js'\nimport type { DomainImpactItem } from '../DomainImpactAnalysis.js'\nimport type { DomainEntity } from '../DomainEntity.js'\nimport { DomainPropertyKind } from '../../models/kinds.js'\n\n/**\n * `DomainImpactItem` mapping:\n * - `impact` -> `message`\n * - `resolution` -> `help`\n * - `type` -> unused\n * - `blocking` -> unused (deprecated)\n * - `relationship` -> unused\n */\nexport interface DomainValidation\n extends Omit<DomainImpactItem, 'type' | 'impact' | 'blocking' | 'relationship' | 'resolution'> {\n /**\n * The field that did not pass validation.\n */\n field: string\n /**\n * The name of the rule that was violated.\n */\n rule: string\n /**\n * Optional help message that can be used to provide\n * more information about the error.\n */\n help?: string\n /**\n * Optional URL that can be used to provide more information\n * about the error.\n */\n url?: string\n /**\n * The validation error message.\n * This message should be user-friendly and should not\n * contain any technical details.\n * It should be used to display the error to the user.\n * It should be short and concise.\n */\n message: string\n}\n\n/**\n * Validates the property name. This includes associations.\n *\n * @remarks\n * - A property must have a name defined.\n * - The name has to follow the same rules as the names in a PostgreSQL database.\n * - Column names can only contain letters (a-z, A-Z), numbers (0-9), and underscores (_).\n * - The name must start with a letter (a-z, A-Z) or an underscore (_).\n * - PostgreSQL limits column names to a maximum of 59 characters.\n * - (our rule) Column names are case insensitive.\n * - (recommendation) Column names should be in lower case.\n *\n * @param property The property to validate\n */\nexport function validatePropertyName(property: DomainProperty | DomainAssociation): DomainValidation[] {\n const results: DomainValidation[] = []\n const label = property.info.getLabel()\n const parentEntity = property.getParentInstance() as DomainEntity\n const type = property.kind === DomainPropertyKind ? 'property' : 'association'\n if (!property.info.name) {\n const message = `The \"${label}\" ${type} has no name.`\n const help = `The ${type} must have a name.`\n results.push({\n field: 'name',\n rule: 'required',\n message,\n help,\n severity: 'error',\n key: property.key,\n kind: property.kind,\n parent: parentEntity.key,\n })\n return results\n }\n const name = property.info.name\n if (name.length <
|
|
1
|
+
{"version":3,"file":"rules.js","sourceRoot":"","sources":["../../../../src/modeling/validation/rules.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AAKlD,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAA;AAwC1D;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,oBAAoB,CAAC,QAA4C;IAC/E,MAAM,OAAO,GAAuB,EAAE,CAAA;IAC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,CAAC;IACD,IAAI,gBAAgB,CAAC,GAAG,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,EAAE,CAAC;QAC7C,MAAM,OAAO,GAAG,QAAQ,KAAK,KAAK,IAAI,8BAA8B,CAAA;QACpE,MAAM,IAAI,GAAG,4CAA4C,CAAA;QACzD,OAAO,CAAC,IAAI,CAAC;YACX,KAAK,EAAE,MAAM;YACb,IAAI,EAAE,UAAU;YAChB,OAAO;YACP,IAAI;YACJ,QAAQ,EAAE,OAAO;YACjB,GAAG,EAAE,QAAQ,CAAC,GAAG;YACjB,IAAI,EAAE,QAAQ,CAAC,IAAI;YACnB,MAAM,EAAE,YAAY,CAAC,GAAG;SACzB,CAAC,CAAA;IACJ,CAAC;IACD,OAAO,OAAO,CAAA;AAChB,CAAC","sourcesContent":["import { ReservedKeywords } from './postgresql.js'\nimport type { DomainProperty } from '../DomainProperty.js'\nimport type { DomainAssociation } from '../DomainAssociation.js'\nimport type { DomainImpactItem } from '../DomainImpactAnalysis.js'\nimport type { DomainEntity } from '../DomainEntity.js'\nimport { DomainPropertyKind } from '../../models/kinds.js'\n\n/**\n * `DomainImpactItem` mapping:\n * - `impact` -> `message`\n * - `resolution` -> `help`\n * - `type` -> unused\n * - `blocking` -> unused (deprecated)\n * - `relationship` -> unused\n */\nexport interface DomainValidation\n extends Omit<DomainImpactItem, 'type' | 'impact' | 'blocking' | 'relationship' | 'resolution'> {\n /**\n * The field that did not pass validation.\n */\n field: string\n /**\n * The name of the rule that was violated.\n */\n rule: string\n /**\n * Optional help message that can be used to provide\n * more information about the error.\n */\n help?: string\n /**\n * Optional URL that can be used to provide more information\n * about the error.\n */\n url?: string\n /**\n * The validation error message.\n * This message should be user-friendly and should not\n * contain any technical details.\n * It should be used to display the error to the user.\n * It should be short and concise.\n */\n message: string\n}\n\n/**\n * Validates the property name. This includes associations.\n *\n * @remarks\n * - A property must have a name defined.\n * - The name has to follow the same rules as the names in a PostgreSQL database.\n * - Column names can only contain letters (a-z, A-Z), numbers (0-9), and underscores (_).\n * - The name must start with a letter (a-z, A-Z) or an underscore (_).\n * - PostgreSQL limits column names to a maximum of 59 characters.\n * - (our rule) Column names are case insensitive.\n * - (recommendation) Column names should be in lower case.\n *\n * @param property The property to validate\n */\nexport function validatePropertyName(property: DomainProperty | DomainAssociation): DomainValidation[] {\n const results: DomainValidation[] = []\n const label = property.info.getLabel()\n const parentEntity = property.getParentInstance() as DomainEntity\n const type = property.kind === DomainPropertyKind ? 'property' : 'association'\n if (!property.info.name) {\n const message = `The \"${label}\" ${type} has no name.`\n const help = `The ${type} must have a name.`\n results.push({\n field: 'name',\n rule: 'required',\n message,\n help,\n severity: 'error',\n key: property.key,\n kind: property.kind,\n parent: parentEntity.key,\n })\n return results\n }\n const name = property.info.name\n if (name.length < 2) {\n const message = `The \"${label}\" ${type} name is too short.`\n const help = `The name must be at least 2 characters long.`\n results.push({\n field: 'name',\n rule: 'length',\n message,\n help,\n severity: 'error',\n key: property.key,\n kind: property.kind,\n parent: parentEntity.key,\n })\n }\n if (name.length > 59) {\n const message = `The \"${label}\" ${type} name is too long.`\n const help = `The name must be at most 59 characters long.`\n results.push({\n field: 'name',\n rule: 'length',\n message,\n help,\n severity: 'error',\n key: property.key,\n kind: property.kind,\n parent: parentEntity.key,\n })\n }\n if (!/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(name)) {\n const message = `The \"${label}\" ${type} name is invalid.`\n const help = `The name must start with a letter (a-z) or underscore (_). Subsequent characters can be letters, digits (0-9), or underscores (_).`\n results.push({\n field: 'name',\n rule: 'format',\n message,\n help,\n severity: 'error',\n key: property.key,\n kind: property.kind,\n parent: parentEntity.key,\n })\n }\n if (/^[A-Z]/.test(name)) {\n const message = `The \"${label}\" ${type} name is not in snake case.`\n const help = `The name should be in snake case (lowercase letters and underscores).`\n results.push({\n field: 'name',\n rule: 'snake_case',\n message,\n help,\n severity: 'info',\n key: property.key,\n kind: property.kind,\n parent: parentEntity.key,\n })\n }\n if (ReservedKeywords.has(name.toUpperCase())) {\n const message = `The \"${label}\" ${type} name is a reserved keyword.`\n const help = `The name should not be a reserved keyword.`\n results.push({\n field: 'name',\n rule: 'reserved',\n message,\n help,\n severity: 'error',\n key: property.key,\n kind: property.kind,\n parent: parentEntity.key,\n })\n }\n return results\n}\n"]}
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import { DataCatalogKind } from './kinds.js';
|
|
2
|
+
export type DataCatalogScope = 'public' | 'private' | 'organization';
|
|
3
|
+
export interface DataCatalogSchema {
|
|
4
|
+
/**
|
|
5
|
+
* The key of the data catalog entry.
|
|
6
|
+
* When the value is missing it will be generated by the API.
|
|
7
|
+
*
|
|
8
|
+
* The key can only be set when creating a new data catalog entry.
|
|
9
|
+
* @readonly
|
|
10
|
+
*/
|
|
11
|
+
key: string;
|
|
12
|
+
/**
|
|
13
|
+
* The kind of the schema
|
|
14
|
+
* This is set by the API and is used to identify the schema.
|
|
15
|
+
* @readonly
|
|
16
|
+
*/
|
|
17
|
+
readonly kind: typeof DataCatalogKind;
|
|
18
|
+
/**
|
|
19
|
+
* The key of the organization.
|
|
20
|
+
* @required
|
|
21
|
+
*/
|
|
22
|
+
organization: string;
|
|
23
|
+
/**
|
|
24
|
+
* The key of the related data catalog file entry.
|
|
25
|
+
* @required
|
|
26
|
+
*/
|
|
27
|
+
file: string;
|
|
28
|
+
/**
|
|
29
|
+
* The scope of the data catalog entry.
|
|
30
|
+
* @required
|
|
31
|
+
*/
|
|
32
|
+
scope: DataCatalogScope;
|
|
33
|
+
/**
|
|
34
|
+
* The name of the data catalog entry.
|
|
35
|
+
* It is required when creating a new data catalog entry.
|
|
36
|
+
* @required
|
|
37
|
+
*/
|
|
38
|
+
name: string;
|
|
39
|
+
/**
|
|
40
|
+
* A short description of the data catalog entry.
|
|
41
|
+
* @required
|
|
42
|
+
*/
|
|
43
|
+
description: string;
|
|
44
|
+
/**
|
|
45
|
+
* The id of the user who created the data catalog entry.
|
|
46
|
+
* It is ignored when creating or updating a data catalog entry.
|
|
47
|
+
* @readonly
|
|
48
|
+
*/
|
|
49
|
+
publishedBy: string;
|
|
50
|
+
/**
|
|
51
|
+
* The time when the last version was published.
|
|
52
|
+
* It is ignored when creating or updating a data catalog entry.
|
|
53
|
+
* @readonly
|
|
54
|
+
*/
|
|
55
|
+
publishedAt: number;
|
|
56
|
+
/**
|
|
57
|
+
* The time when the data catalog entry was created.
|
|
58
|
+
* It is ignored when creating or updating a data catalog entry.
|
|
59
|
+
* @readonly
|
|
60
|
+
*/
|
|
61
|
+
createdAt: number;
|
|
62
|
+
/**
|
|
63
|
+
* The time when the data catalog entry was last updated.
|
|
64
|
+
* It is ignored when creating or updating a data catalog entry.
|
|
65
|
+
* @readonly
|
|
66
|
+
*/
|
|
67
|
+
updatedAt: number;
|
|
68
|
+
/**
|
|
69
|
+
* The timestamp when this entry was unpublished.
|
|
70
|
+
* Only set when the entry was unpublished.
|
|
71
|
+
* @readonly
|
|
72
|
+
*/
|
|
73
|
+
unpublishedAt?: number;
|
|
74
|
+
/**
|
|
75
|
+
* A flag indicating if the entry is deprecated.
|
|
76
|
+
* @readonly
|
|
77
|
+
*/
|
|
78
|
+
deprecated?: boolean;
|
|
79
|
+
/**
|
|
80
|
+
* The timestamp when the entry was deprecated.
|
|
81
|
+
* Only set when the entry was deprecated.
|
|
82
|
+
* @readonly
|
|
83
|
+
*/
|
|
84
|
+
deprecatedAt?: number;
|
|
85
|
+
/**
|
|
86
|
+
* The id of the user who deprecated the entry.
|
|
87
|
+
* Only set when the entry was deprecated.
|
|
88
|
+
* @readonly
|
|
89
|
+
*/
|
|
90
|
+
deprecatedBy?: string;
|
|
91
|
+
/**
|
|
92
|
+
* The reason why the entry was deprecated.
|
|
93
|
+
* Only set when the entry was deprecated.
|
|
94
|
+
*/
|
|
95
|
+
deprecationReason?: string;
|
|
96
|
+
/**
|
|
97
|
+
* The list of tags associated with the data catalog entry.
|
|
98
|
+
* @readonly Use the API endpoints to manage tags.
|
|
99
|
+
*/
|
|
100
|
+
tags: string[];
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Used with API communication when listing data catalog entries.
|
|
104
|
+
*/
|
|
105
|
+
export interface DataCatalogSchemaWithVersion extends DataCatalogSchema {
|
|
106
|
+
/**
|
|
107
|
+
* The list of published versions of the data catalog entry.
|
|
108
|
+
* Note, this is limited to the last 20 versions.
|
|
109
|
+
*/
|
|
110
|
+
versions: string[];
|
|
111
|
+
}
|
|
112
|
+
export interface DataCatalogVersionInfo {
|
|
113
|
+
key: string;
|
|
114
|
+
version: string;
|
|
115
|
+
published: number;
|
|
116
|
+
}
|
|
117
|
+
export interface DataCatalogStatus extends DataCatalogSchema {
|
|
118
|
+
versions: DataCatalogVersionInfo[];
|
|
119
|
+
}
|
|
120
|
+
export declare class DataCatalog implements DataCatalogSchema {
|
|
121
|
+
key: string;
|
|
122
|
+
get kind(): typeof DataCatalogKind;
|
|
123
|
+
organization: string;
|
|
124
|
+
file: string;
|
|
125
|
+
scope: DataCatalogScope;
|
|
126
|
+
name: string;
|
|
127
|
+
description: string;
|
|
128
|
+
publishedBy: string;
|
|
129
|
+
publishedAt: number;
|
|
130
|
+
createdAt: number;
|
|
131
|
+
updatedAt: number;
|
|
132
|
+
unpublishedAt?: number | undefined;
|
|
133
|
+
deprecated?: boolean | undefined;
|
|
134
|
+
deprecatedAt?: number | undefined;
|
|
135
|
+
deprecatedBy?: string | undefined;
|
|
136
|
+
deprecationReason?: string | undefined;
|
|
137
|
+
tags: string[];
|
|
138
|
+
static createSchema(input: Partial<DataCatalogSchema>): DataCatalogSchema;
|
|
139
|
+
constructor(input?: Partial<DataCatalogSchema>);
|
|
140
|
+
toJSON(): DataCatalogSchema;
|
|
141
|
+
}
|
|
142
|
+
//# sourceMappingURL=DataCatalog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DataCatalog.d.ts","sourceRoot":"","sources":["../../../src/models/DataCatalog.ts"],"names":[],"mappings":"AAAA,OAAO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Q,EAAE,sBAAsB,EAAE,CAAA;CACnC;AAED,qBAAa,WAAY,YAAW,iBAAiB;IACnD,GAAG,EAAE,MAAM,CAAA;IAEX,IAAI,IAAI,IAAI,OAAO,eAAe,CAEjC;IAED,YAAY,EAAE,MAAM,CAAA;IACpB,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,gBAAgB,CAAA;IACvB,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,EAAE,MAAM,CAAA;IACnB,WAAW,EAAE,MAAM,CAAA;IACnB,WAAW,EAAE,MAAM,CAAA;IACnB,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;IACjB,aAAa,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAClC,UAAU,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;IAChC,YAAY,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IACjC,YAAY,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IACjC,iBAAiB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IACtC,IAAI,EAAE,MAAM,EAAE,CAAA;IAEd,MAAM,CAAC,YAAY,CAAC,KAAK,EAAE,OAAO,CAAC,iBAAiB,CAAC,GAAG,iBAAiB;gBAiD7D,KAAK,GAAE,OAAO,CAAC,iBAAiB,CAAM;IA8BlD,MAAM,IAAI,iBAAiB;CAgC5B"}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { DataCatalogKind } from './kinds.js';
|
|
2
|
+
export class DataCatalog {
|
|
3
|
+
key;
|
|
4
|
+
get kind() {
|
|
5
|
+
return DataCatalogKind;
|
|
6
|
+
}
|
|
7
|
+
organization;
|
|
8
|
+
file;
|
|
9
|
+
scope;
|
|
10
|
+
name;
|
|
11
|
+
description;
|
|
12
|
+
publishedBy;
|
|
13
|
+
publishedAt;
|
|
14
|
+
createdAt;
|
|
15
|
+
updatedAt;
|
|
16
|
+
unpublishedAt;
|
|
17
|
+
deprecated;
|
|
18
|
+
deprecatedAt;
|
|
19
|
+
deprecatedBy;
|
|
20
|
+
deprecationReason;
|
|
21
|
+
tags;
|
|
22
|
+
static createSchema(input) {
|
|
23
|
+
const { key = '', organization = '', file = '', scope = 'private', name = '', description = '', publishedBy = '', publishedAt = 0, createdAt = 0, updatedAt = 0, tags = [], } = input;
|
|
24
|
+
if (['public', 'private', 'organization'].indexOf(scope) === -1) {
|
|
25
|
+
throw new Error(`Invalid scope: ${scope}`);
|
|
26
|
+
}
|
|
27
|
+
const result = {
|
|
28
|
+
key,
|
|
29
|
+
kind: DataCatalogKind,
|
|
30
|
+
organization,
|
|
31
|
+
file,
|
|
32
|
+
scope,
|
|
33
|
+
name,
|
|
34
|
+
description,
|
|
35
|
+
publishedBy,
|
|
36
|
+
publishedAt,
|
|
37
|
+
createdAt,
|
|
38
|
+
updatedAt,
|
|
39
|
+
tags,
|
|
40
|
+
};
|
|
41
|
+
if (typeof input.deprecated === 'boolean') {
|
|
42
|
+
result.deprecated = input.deprecated;
|
|
43
|
+
}
|
|
44
|
+
if (typeof input.deprecatedAt === 'number') {
|
|
45
|
+
result.deprecatedAt = input.deprecatedAt;
|
|
46
|
+
}
|
|
47
|
+
if (typeof input.deprecatedBy === 'string') {
|
|
48
|
+
result.deprecatedBy = input.deprecatedBy;
|
|
49
|
+
}
|
|
50
|
+
if (typeof input.deprecationReason === 'string') {
|
|
51
|
+
result.deprecationReason = input.deprecationReason;
|
|
52
|
+
}
|
|
53
|
+
if (typeof input.unpublishedAt === 'number') {
|
|
54
|
+
result.unpublishedAt = input.unpublishedAt;
|
|
55
|
+
}
|
|
56
|
+
return result;
|
|
57
|
+
}
|
|
58
|
+
constructor(input = {}) {
|
|
59
|
+
const init = DataCatalog.createSchema(input);
|
|
60
|
+
this.key = init.key;
|
|
61
|
+
this.organization = init.organization;
|
|
62
|
+
this.file = init.file;
|
|
63
|
+
this.scope = init.scope;
|
|
64
|
+
this.name = init.name;
|
|
65
|
+
this.description = init.description;
|
|
66
|
+
this.publishedBy = init.publishedBy;
|
|
67
|
+
this.publishedAt = init.publishedAt;
|
|
68
|
+
this.createdAt = init.createdAt;
|
|
69
|
+
this.updatedAt = init.updatedAt;
|
|
70
|
+
this.tags = init.tags;
|
|
71
|
+
if (typeof init.deprecated === 'boolean') {
|
|
72
|
+
this.deprecated = init.deprecated;
|
|
73
|
+
}
|
|
74
|
+
if (typeof init.deprecatedAt === 'number') {
|
|
75
|
+
this.deprecatedAt = init.deprecatedAt;
|
|
76
|
+
}
|
|
77
|
+
if (typeof init.deprecatedBy === 'string') {
|
|
78
|
+
this.deprecatedBy = init.deprecatedBy;
|
|
79
|
+
}
|
|
80
|
+
if (typeof init.deprecationReason === 'string') {
|
|
81
|
+
this.deprecationReason = init.deprecationReason;
|
|
82
|
+
}
|
|
83
|
+
if (typeof init.unpublishedAt === 'number') {
|
|
84
|
+
this.unpublishedAt = init.unpublishedAt;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
toJSON() {
|
|
88
|
+
const result = {
|
|
89
|
+
key: this.key,
|
|
90
|
+
kind: DataCatalogKind,
|
|
91
|
+
organization: this.organization,
|
|
92
|
+
file: this.file,
|
|
93
|
+
scope: this.scope,
|
|
94
|
+
name: this.name,
|
|
95
|
+
description: this.description,
|
|
96
|
+
publishedBy: this.publishedBy,
|
|
97
|
+
publishedAt: this.publishedAt,
|
|
98
|
+
createdAt: this.createdAt,
|
|
99
|
+
updatedAt: this.updatedAt,
|
|
100
|
+
tags: [...this.tags],
|
|
101
|
+
};
|
|
102
|
+
if (typeof this.deprecated === 'boolean') {
|
|
103
|
+
result.deprecated = this.deprecated;
|
|
104
|
+
}
|
|
105
|
+
if (typeof this.deprecatedAt === 'number') {
|
|
106
|
+
result.deprecatedAt = this.deprecatedAt;
|
|
107
|
+
}
|
|
108
|
+
if (typeof this.deprecatedBy === 'string') {
|
|
109
|
+
result.deprecatedBy = this.deprecatedBy;
|
|
110
|
+
}
|
|
111
|
+
if (typeof this.deprecationReason === 'string') {
|
|
112
|
+
result.deprecationReason = this.deprecationReason;
|
|
113
|
+
}
|
|
114
|
+
if (typeof this.unpublishedAt === 'number') {
|
|
115
|
+
result.unpublishedAt = this.unpublishedAt;
|
|
116
|
+
}
|
|
117
|
+
return result;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
//# sourceMappingURL=DataCatalog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DataCatalog.js","sourceRoot":"","sources":["../../../src/models/DataCatalog.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AA6H5C,MAAM,OAAO,WAAW;IACtB,GAAG,CAAQ;IAEX,IAAI,IAAI;QACN,OAAO,eAAe,CAAA;IACxB,CAAC;IAED,YAAY,CAAQ;IACpB,IAAI,CAAQ;IACZ,KAAK,CAAkB;IACvB,IAAI,CAAQ;IACZ,WAAW,CAAQ;IACnB,WAAW,CAAQ;IACnB,WAAW,CAAQ;IACnB,SAAS,CAAQ;IACjB,SAAS,CAAQ;IACjB,aAAa,CAAqB;IAClC,UAAU,CAAsB;IAChC,YAAY,CAAqB;IACjC,YAAY,CAAqB;IACjC,iBAAiB,CAAqB;IACtC,IAAI,CAAU;IAEd,MAAM,CAAC,YAAY,CAAC,KAAiC;QACnD,MAAM,EACJ,GAAG,GAAG,EAAE,EACR,YAAY,GAAG,EAAE,EACjB,IAAI,GAAG,EAAE,EACT,KAAK,GAAG,SAAS,EACjB,IAAI,GAAG,EAAE,EACT,WAAW,GAAG,EAAE,EAChB,WAAW,GAAG,EAAE,EAChB,WAAW,GAAG,CAAC,EACf,SAAS,GAAG,CAAC,EACb,SAAS,GAAG,CAAC,EACb,IAAI,GAAG,EAAE,GACV,GAAG,KAAK,CAAA;QACT,IAAI,CAAC,QAAQ,EAAE,SAAS,EAAE,cAAc,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC;YAChE,MAAM,I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C,KAAK;YACjB,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,SAAS,EAAE,IAAI,CAAC,SAAS;YACzB,SAAS,EAAE,IAAI,CAAC,SAAS;YACzB,IAAI,EAAE,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC;SACrB,CAAA;QACD,IAAI,OAAO,IAAI,CAAC,UAAU,KAAK,SAAS,EAAE,CAAC;YACzC,MAAM,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,CAAA;QACrC,CAAC;QACD,IAAI,OAAO,IAAI,CAAC,YAAY,KAAK,QAAQ,EAAE,CAAC;YAC1C,MAAM,CAAC,YAAY,GAAG,IAAI,CAAC,YAAY,CAAA;QACzC,CAAC;QACD,IAAI,OAAO,IAAI,CAAC,YAAY,KAAK,QAAQ,EAAE,CAAC;YAC1C,MAAM,CAAC,YAAY,GAAG,IAAI,CAAC,YAAY,CAAA;QACzC,CAAC;QACD,IAAI,OAAO,IAAI,CAAC,iBAAiB,KAAK,QAAQ,EAAE,CAAC;YAC/C,MAAM,CAAC,iBAAiB,GAAG,IAAI,CAAC,iBAAiB,CAAA;QACnD,CAAC;QACD,IAAI,OAAO,IAAI,CAAC,aAAa,KAAK,QAAQ,EAAE,CAAC;YAC3C,MAAM,CAAC,aAAa,GAAG,IAAI,CAAC,aAAa,CAAA;QAC3C,CAAC;QACD,OAAO,MAAM,CAAA;IACf,CAAC;CACF","sourcesContent":["import { DataCatalogKind } from './kinds.js'\n\nexport type DataCatalogScope = 'public' | 'private' | 'organization'\n\nexport interface DataCatalogSchema {\n /**\n * The key of the data catalog entry.\n * When the value is missing it will be generated by the API.\n *\n * The key can only be set when creating a new data catalog entry.\n * @readonly\n */\n key: string\n /**\n * The kind of the schema\n * This is set by the API and is used to identify the schema.\n * @readonly\n */\n readonly kind: typeof DataCatalogKind\n /**\n * The key of the organization.\n * @required\n */\n organization: string\n /**\n * The key of the related data catalog file entry.\n * @required\n */\n file: string\n /**\n * The scope of the data catalog entry.\n * @required\n */\n scope: DataCatalogScope\n /**\n * The name of the data catalog entry.\n * It is required when creating a new data catalog entry.\n * @required\n */\n name: string\n /**\n * A short description of the data catalog entry.\n * @required\n */\n description: string\n /**\n * The id of the user who created the data catalog entry.\n * It is ignored when creating or updating a data catalog entry.\n * @readonly\n */\n publishedBy: string\n /**\n * The time when the last version was published.\n * It is ignored when creating or updating a data catalog entry.\n * @readonly\n */\n publishedAt: number\n /**\n * The time when the data catalog entry was created.\n * It is ignored when creating or updating a data catalog entry.\n * @readonly\n */\n createdAt: number\n /**\n * The time when the data catalog entry was last updated.\n * It is ignored when creating or updating a data catalog entry.\n * @readonly\n */\n updatedAt: number\n /**\n * The timestamp when this entry was unpublished.\n * Only set when the entry was unpublished.\n * @readonly\n */\n unpublishedAt?: number\n /**\n * A flag indicating if the entry is deprecated.\n * @readonly\n */\n deprecated?: boolean\n /**\n * The timestamp when the entry was deprecated.\n * Only set when the entry was deprecated.\n * @readonly\n */\n deprecatedAt?: number\n /**\n * The id of the user who deprecated the entry.\n * Only set when the entry was deprecated.\n * @readonly\n */\n deprecatedBy?: string\n /**\n * The reason why the entry was deprecated.\n * Only set when the entry was deprecated.\n */\n deprecationReason?: string\n /**\n * The list of tags associated with the data catalog entry.\n * @readonly Use the API endpoints to manage tags.\n */\n tags: string[]\n}\n\n/**\n * Used with API communication when listing data catalog entries.\n */\nexport interface DataCatalogSchemaWithVersion extends DataCatalogSchema {\n /**\n * The list of published versions of the data catalog entry.\n * Note, this is limited to the last 20 versions.\n */\n versions: string[]\n}\n\nexport interface DataCatalogVersionInfo {\n key: string\n version: string\n published: number\n}\n\nexport interface DataCatalogStatus extends DataCatalogSchema {\n versions: DataCatalogVersionInfo[]\n}\n\nexport class DataCatalog implements DataCatalogSchema {\n key: string\n\n get kind(): typeof DataCatalogKind {\n return DataCatalogKind\n }\n\n organization: string\n file: string\n scope: DataCatalogScope\n name: string\n description: string\n publishedBy: string\n publishedAt: number\n createdAt: number\n updatedAt: number\n unpublishedAt?: number | undefined\n deprecated?: boolean | undefined\n deprecatedAt?: number | undefined\n deprecatedBy?: string | undefined\n deprecationReason?: string | undefined\n tags: string[]\n\n static createSchema(input: Partial<DataCatalogSchema>): DataCatalogSchema {\n const {\n key = '',\n organization = '',\n file = '',\n scope = 'private',\n name = '',\n description = '',\n publishedBy = '',\n publishedAt = 0,\n createdAt = 0,\n updatedAt = 0,\n tags = [],\n } = input\n if (['public', 'private', 'organization'].indexOf(scope) === -1) {\n throw new Error(`Invalid scope: ${scope}`)\n }\n const result: DataCatalogSchema = {\n key,\n kind: DataCatalogKind,\n organization,\n file,\n scope,\n name,\n description,\n publishedBy,\n publishedAt,\n createdAt,\n updatedAt,\n tags,\n }\n if (typeof input.deprecated === 'boolean') {\n result.deprecated = input.deprecated\n }\n if (typeof input.deprecatedAt === 'number') {\n result.deprecatedAt = input.deprecatedAt\n }\n if (typeof input.deprecatedBy === 'string') {\n result.deprecatedBy = input.deprecatedBy\n }\n if (typeof input.deprecationReason === 'string') {\n result.deprecationReason = input.deprecationReason\n }\n if (typeof input.unpublishedAt === 'number') {\n result.unpublishedAt = input.unpublishedAt\n }\n return result\n }\n\n constructor(input: Partial<DataCatalogSchema> = {}) {\n const init = DataCatalog.createSchema(input)\n this.key = init.key\n this.organization = init.organization\n this.file = init.file\n this.scope = init.scope\n this.name = init.name\n this.description = init.description\n this.publishedBy = init.publishedBy\n this.publishedAt = init.publishedAt\n this.createdAt = init.createdAt\n this.updatedAt = init.updatedAt\n this.tags = init.tags\n if (typeof init.deprecated === 'boolean') {\n this.deprecated = init.deprecated\n }\n if (typeof init.deprecatedAt === 'number') {\n this.deprecatedAt = init.deprecatedAt\n }\n if (typeof init.deprecatedBy === 'string') {\n this.deprecatedBy = init.deprecatedBy\n }\n if (typeof init.deprecationReason === 'string') {\n this.deprecationReason = init.deprecationReason\n }\n if (typeof init.unpublishedAt === 'number') {\n this.unpublishedAt = init.unpublishedAt\n }\n }\n\n toJSON(): DataCatalogSchema {\n const result: DataCatalogSchema = {\n key: this.key,\n kind: DataCatalogKind,\n organization: this.organization,\n file: this.file,\n scope: this.scope,\n name: this.name,\n description: this.description,\n publishedBy: this.publishedBy,\n publishedAt: this.publishedAt,\n createdAt: this.createdAt,\n updatedAt: this.updatedAt,\n tags: [...this.tags],\n }\n if (typeof this.deprecated === 'boolean') {\n result.deprecated = this.deprecated\n }\n if (typeof this.deprecatedAt === 'number') {\n result.deprecatedAt = this.deprecatedAt\n }\n if (typeof this.deprecatedBy === 'string') {\n result.deprecatedBy = this.deprecatedBy\n }\n if (typeof this.deprecationReason === 'string') {\n result.deprecationReason = this.deprecationReason\n }\n if (typeof this.unpublishedAt === 'number') {\n result.unpublishedAt = this.unpublishedAt\n }\n return result\n }\n}\n"]}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { DataCatalogScope } from './DataCatalog.js';
|
|
2
|
+
import { DataCatalogVersionKind } from './kinds.js';
|
|
3
|
+
export type DataCatalogLifecycle = 'stable' | 'beta' | 'dev';
|
|
4
|
+
export interface DataCatalogVersionSchema {
|
|
5
|
+
/**
|
|
6
|
+
* The key of the version.
|
|
7
|
+
*
|
|
8
|
+
* The key can only be set when creating a new data catalog entry.
|
|
9
|
+
* @readonly
|
|
10
|
+
*/
|
|
11
|
+
key: string;
|
|
12
|
+
/**
|
|
13
|
+
* The kind of the schema
|
|
14
|
+
*/
|
|
15
|
+
readonly kind: typeof DataCatalogVersionKind;
|
|
16
|
+
/**
|
|
17
|
+
* The key of the parent data catalog entry.
|
|
18
|
+
* It is only populated by the API when creating the version.
|
|
19
|
+
* @readonly
|
|
20
|
+
*/
|
|
21
|
+
catalogKey: string;
|
|
22
|
+
/**
|
|
23
|
+
* The publication scope of the data catalog entry.
|
|
24
|
+
*
|
|
25
|
+
* When the scope is set to a different value than the one of the parent data catalog entry,
|
|
26
|
+
* then this value is used to determine the visibility of the data catalog entry. However,
|
|
27
|
+
* the reader cannot access the version with a "public" scope if the parent data catalog entry is private.
|
|
28
|
+
*
|
|
29
|
+
* @required
|
|
30
|
+
*/
|
|
31
|
+
scope: DataCatalogScope;
|
|
32
|
+
/**
|
|
33
|
+
* The lifecycle of the data catalog entry.
|
|
34
|
+
*
|
|
35
|
+
* - `stable`: The data catalog entry is stable and can be used in production.
|
|
36
|
+
* - `beta`: The data catalog entry is in beta and may change in the future.
|
|
37
|
+
* - `dev`: The data catalog entry is in development and likely will change in the future.
|
|
38
|
+
*
|
|
39
|
+
* The lifecycle is a readonly property and is set by the API when creating or updating the data catalog entry.
|
|
40
|
+
* A version is immutable and to change the lifecycle, a new version must be created.
|
|
41
|
+
*
|
|
42
|
+
* @required
|
|
43
|
+
*/
|
|
44
|
+
lifecycle: DataCatalogLifecycle;
|
|
45
|
+
/**
|
|
46
|
+
* The version string according to the [semantic versioning](https://semver.org/) specification.
|
|
47
|
+
* Note, this value is limited to 32 characters by the API.
|
|
48
|
+
* @required
|
|
49
|
+
*/
|
|
50
|
+
version: string;
|
|
51
|
+
/**
|
|
52
|
+
* The id of the user who created the version.
|
|
53
|
+
* It is ignored when creating or updating a data catalog entry.
|
|
54
|
+
* @readonly
|
|
55
|
+
*/
|
|
56
|
+
publishedBy: string;
|
|
57
|
+
/**
|
|
58
|
+
* The timestamp when this version was unpublished.
|
|
59
|
+
* Only set when the version was unpublished.
|
|
60
|
+
* @readonly
|
|
61
|
+
*/
|
|
62
|
+
unpublishedAt?: number;
|
|
63
|
+
/**
|
|
64
|
+
* A flag indicating if the version is deprecated.
|
|
65
|
+
* @readonly
|
|
66
|
+
*/
|
|
67
|
+
deprecated?: boolean;
|
|
68
|
+
/**
|
|
69
|
+
* The timestamp when the version was deprecated.
|
|
70
|
+
* Only set when the version was deprecated.
|
|
71
|
+
* @readonly
|
|
72
|
+
*/
|
|
73
|
+
deprecatedAt?: number;
|
|
74
|
+
/**
|
|
75
|
+
* The id of the user who deprecated the version.
|
|
76
|
+
* Only set when the version was deprecated.
|
|
77
|
+
* @readonly
|
|
78
|
+
*/
|
|
79
|
+
deprecatedBy?: string;
|
|
80
|
+
/**
|
|
81
|
+
* The reason why the version was deprecated.
|
|
82
|
+
* Only set when the version was deprecated.
|
|
83
|
+
*/
|
|
84
|
+
deprecationReason?: string;
|
|
85
|
+
/**
|
|
86
|
+
* The timestamp when the data catalog entry was created.
|
|
87
|
+
* It is ignored when creating or updating a data catalog entry.
|
|
88
|
+
* @readonly
|
|
89
|
+
*/
|
|
90
|
+
createdAt: number;
|
|
91
|
+
/**
|
|
92
|
+
* The timestamp when the data catalog entry was last updated.
|
|
93
|
+
* It is ignored when creating or updating a data catalog entry.
|
|
94
|
+
* @readonly
|
|
95
|
+
*/
|
|
96
|
+
updatedAt: number;
|
|
97
|
+
/**
|
|
98
|
+
* The changelog of the data catalog entry.
|
|
99
|
+
* Note, this value is required by the API when creating the version.
|
|
100
|
+
*/
|
|
101
|
+
changelog?: string;
|
|
102
|
+
}
|
|
103
|
+
export declare class DataCatalogVersion implements DataCatalogVersionSchema {
|
|
104
|
+
key: string;
|
|
105
|
+
get kind(): typeof DataCatalogVersionKind;
|
|
106
|
+
catalogKey: string;
|
|
107
|
+
scope: DataCatalogScope;
|
|
108
|
+
lifecycle: DataCatalogLifecycle;
|
|
109
|
+
version: string;
|
|
110
|
+
publishedBy: string;
|
|
111
|
+
unpublishedAt?: number | undefined;
|
|
112
|
+
deprecated?: boolean | undefined;
|
|
113
|
+
deprecatedAt?: number | undefined;
|
|
114
|
+
deprecatedBy?: string | undefined;
|
|
115
|
+
deprecationReason?: string | undefined;
|
|
116
|
+
createdAt: number;
|
|
117
|
+
updatedAt: number;
|
|
118
|
+
changelog?: string | undefined;
|
|
119
|
+
static createSchema(input: Partial<DataCatalogVersionSchema>): DataCatalogVersionSchema;
|
|
120
|
+
constructor(input?: Partial<DataCatalogVersionSchema>);
|
|
121
|
+
toJSON(): DataCatalogVersionSchema;
|
|
122
|
+
}
|
|
123
|
+
//# sourceMappingURL=DataCatalogVersion.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DataCatalogVersion.d.ts","sourceRoot":"","sources":["../../../src/models/DataCatalogVersion.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAA;AACnD,OAAO,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAA;AAEnD,MAAM,MAAM,oBAAoB,GAAG,QAAQ,GAAG,MAAM,GAAG,KAAK,CAAA;AAE5D,MAAM,WAAW,wBAAwB;IACvC;;;;;OAKG;IACH,GAAG,EAAE,MAAM,CAAA;IACX;;OAEG;IACH,QAAQ,CAAC,IAAI,EAAE,OAAO,sBAAsB,CAAA;IAC5C;;;;OAIG;IACH,UAAU,EAAE,MAAM,CAAA;IAClB;;;;;;;;OAQG;IACH,KAAK,EAAE,gBAAgB,CAAA;IACvB;;;;;;;;;;;OAWG;IACH,SAAS,EAAE,oBAAoB,CAAA;IAC/B;;;;OAIG;IACH,OAAO,EAAE,MAAM,CAAA;IACf;;;;OAIG;IACH,WAAW,EAAE,MAAM,CAAA;IACnB;;;;OAIG;IACH,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB;;;;OAIG;IACH,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB;;;;OAIG;IACH,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB;;;OAGG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B;;;;OAIG;IACH,SAAS,EAAE,MAAM,CAAA;IACjB;;;;OAIG;IACH,SAAS,EAAE,MAAM,CAAA;IACjB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED,qBAAa,kBAAmB,YAAW,wBAAwB;IACjE,GAAG,EAAE,MAAM,CAAA;IAEX,IAAI,IAAI,IAAI,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