@api-client/core 0.12.3 → 0.12.5

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 (57) hide show
  1. package/build/src/browser.d.ts +2 -0
  2. package/build/src/browser.d.ts.map +1 -1
  3. package/build/src/browser.js +2 -0
  4. package/build/src/browser.js.map +1 -1
  5. package/build/src/events/BaseEvents.d.ts +11 -1
  6. package/build/src/events/BaseEvents.d.ts.map +1 -1
  7. package/build/src/events/BaseEvents.js.map +1 -1
  8. package/build/src/index.d.ts +2 -0
  9. package/build/src/index.d.ts.map +1 -1
  10. package/build/src/index.js +2 -0
  11. package/build/src/index.js.map +1 -1
  12. package/build/src/modeling/DomainVersioning.d.ts +2 -2
  13. package/build/src/modeling/DomainVersioning.d.ts.map +1 -1
  14. package/build/src/modeling/DomainVersioning.js +16 -1
  15. package/build/src/modeling/DomainVersioning.js.map +1 -1
  16. package/build/src/models/DataCatalog.d.ts +142 -0
  17. package/build/src/models/DataCatalog.d.ts.map +1 -0
  18. package/build/src/models/DataCatalog.js +120 -0
  19. package/build/src/models/DataCatalog.js.map +1 -0
  20. package/build/src/models/DataCatalogVersion.d.ts +123 -0
  21. package/build/src/models/DataCatalogVersion.d.ts.map +1 -0
  22. package/build/src/models/DataCatalogVersion.js +118 -0
  23. package/build/src/models/DataCatalogVersion.js.map +1 -0
  24. package/build/src/models/kinds.d.ts +2 -0
  25. package/build/src/models/kinds.d.ts.map +1 -1
  26. package/build/src/models/kinds.js +2 -0
  27. package/build/src/models/kinds.js.map +1 -1
  28. package/build/src/runtime/store/DataCatalogSdk.d.ts +46 -0
  29. package/build/src/runtime/store/DataCatalogSdk.d.ts.map +1 -0
  30. package/build/src/runtime/store/DataCatalogSdk.js +425 -0
  31. package/build/src/runtime/store/DataCatalogSdk.js.map +1 -0
  32. package/build/src/runtime/store/RouteBuilder.d.ts +10 -0
  33. package/build/src/runtime/store/RouteBuilder.d.ts.map +1 -1
  34. package/build/src/runtime/store/RouteBuilder.js +30 -0
  35. package/build/src/runtime/store/RouteBuilder.js.map +1 -1
  36. package/build/src/runtime/store/Sdk.d.ts +2 -0
  37. package/build/src/runtime/store/Sdk.d.ts.map +1 -1
  38. package/build/src/runtime/store/Sdk.js +10 -2
  39. package/build/src/runtime/store/Sdk.js.map +1 -1
  40. package/build/src/runtime/store/StoreSdkNode.d.ts +1 -0
  41. package/build/src/runtime/store/StoreSdkNode.d.ts.map +1 -1
  42. package/build/src/runtime/store/StoreSdkNode.js.map +1 -1
  43. package/build/src/runtime/store/StoreSdkWeb.d.ts +1 -0
  44. package/build/src/runtime/store/StoreSdkWeb.d.ts.map +1 -1
  45. package/build/src/runtime/store/StoreSdkWeb.js.map +1 -1
  46. package/data/models/example-generator-api.json +22 -22
  47. package/package.json +33 -2
  48. package/src/events/BaseEvents.ts +11 -1
  49. package/src/modeling/DomainVersioning.ts +18 -3
  50. package/src/models/DataCatalog.ts +260 -0
  51. package/src/models/DataCatalogVersion.ts +235 -0
  52. package/src/models/kinds.ts +2 -0
  53. package/src/runtime/store/DataCatalogSdk.ts +473 -0
  54. package/src/runtime/store/RouteBuilder.ts +40 -0
  55. package/src/runtime/store/Sdk.ts +11 -2
  56. package/src/runtime/store/StoreSdkNode.ts +1 -0
  57. package/src/runtime/store/StoreSdkWeb.ts +1 -0
@@ -6,7 +6,22 @@
6
6
  */
7
7
  export function createGraphVersion(root, version) {
8
8
  root.info.version = version;
9
- return serializeForVersionRelease(root);
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,OAAO,0BAA0B,CAAC,IAAI,CAAC,CAAA;AACzC,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,0BAA0B,CAAC,UAAsB;IAC/D,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG,UAAU,CAAA;IAC5C,MAAM,oBAAoB,GAAG,IAAI,GAAG,EAAU,CAAA;IAE9C,yEAAyE;IACzE,KAAK,MAAM,IAAI,IAAI,KAAK,CAAC,KAAK,EAAE,EAAE,CAAC;QACjC,MAAM,SAAS,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QAClC,IAAI,CAAC,SAAS,EAAE,CAAC;YACf,SAAQ;QACV,CAAC;QACD,IAAI,SAAS,CAAC,MAAM,CAAC,GAAG,KAAK,SAAS,EAAE,CAAC;YACvC,SAAQ,CAAC,mBAAmB;QAC9B,CAAC;QAED,mFAAmF;QACnF,IAAI,kBAAkB,CAAC,KAAK,EAAE,IAAI,EAAE,SAAS,CAAC,EAAE,CAAC;YAC/C,oBAAoB,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;QAChC,CAAC;IACH,CAAC;IAED,gDAAgD;IAChD,MAAM,KAAK,GAAG,EAAE,CAAA;IAChB,MAAM,KAAK,GAAG,EAAE,CAAA;IAEhB,KAAK,MAAM,IAAI,IAAI,KAAK,CAAC,KAAK,EAAE,EAAE,CAAC;QACjC,MAAM,SAAS,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QAClC,IAAI,CAAC,SAAS,EAAE,CAAC;YACf,SAAQ;QACV,CAAC;QAED,IAAI,S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C,OAAO,CAAC,EAAE,CAAC;YACtC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;QACpB,CAAC;QACD,KAAK,MAAM,IAAI,IAAI,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC;YACvC,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 } 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): SerializedGraph {\n root.info.version = version\n return serializeForVersionRelease(root)\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"]}
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,CAAC,MAAM,GAAG,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,CAAA;IAClC,CAAC;IACD,OAAO,MAAM,CAAA;AACf,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,0BAA0B,CAAC,UAAsB;IAC/D,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG,UAAU,CAAA;IAC5C,MAAM,oBAAoB,GAAG,IAAI,GAAG,EAAU,CAAA;IAE9C,yEAAyE;IACzE,KAAK,MA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ED,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"]}
@@ -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,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAE5C,MAAM,MAAM,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AW,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,EAC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AO,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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AC,wBAAwB,CAAM;IA8BzD,MAAM,IAAI,wBAAwB;CAgCnC"}
@@ -0,0 +1,118 @@
1
+ import { DataCatalogVersionKind } from './kinds.js';
2
+ export class DataCatalogVersion {
3
+ key;
4
+ get kind() {
5
+ return DataCatalogVersionKind;
6
+ }
7
+ catalogKey;
8
+ scope;
9
+ lifecycle;
10
+ version;
11
+ publishedBy;
12
+ unpublishedAt;
13
+ deprecated;
14
+ deprecatedAt;
15
+ deprecatedBy;
16
+ deprecationReason;
17
+ createdAt;
18
+ updatedAt;
19
+ changelog;
20
+ static createSchema(input) {
21
+ const { key = '', scope = 'private', publishedBy = '', createdAt = 0, updatedAt = 0, catalogKey = '', lifecycle = 'stable', version = '', } = input;
22
+ if (['public', 'private', 'organization'].indexOf(scope) === -1) {
23
+ throw new Error(`Invalid scope: ${scope}`);
24
+ }
25
+ const result = {
26
+ key,
27
+ kind: DataCatalogVersionKind,
28
+ scope,
29
+ publishedBy,
30
+ createdAt,
31
+ updatedAt,
32
+ catalogKey,
33
+ lifecycle,
34
+ version,
35
+ };
36
+ if (typeof input.deprecated === 'boolean') {
37
+ result.deprecated = input.deprecated;
38
+ }
39
+ if (typeof input.deprecatedAt === 'number') {
40
+ result.deprecatedAt = input.deprecatedAt;
41
+ }
42
+ if (typeof input.deprecatedBy === 'string') {
43
+ result.deprecatedBy = input.deprecatedBy;
44
+ }
45
+ if (typeof input.changelog === 'string') {
46
+ result.changelog = input.changelog;
47
+ }
48
+ if (typeof input.deprecationReason === 'string') {
49
+ result.deprecationReason = input.deprecationReason;
50
+ }
51
+ if (typeof input.unpublishedAt === 'number') {
52
+ result.unpublishedAt = input.unpublishedAt;
53
+ }
54
+ return result;
55
+ }
56
+ constructor(input = {}) {
57
+ const init = DataCatalogVersion.createSchema(input);
58
+ this.key = init.key;
59
+ this.catalogKey = init.catalogKey;
60
+ this.lifecycle = init.lifecycle;
61
+ this.scope = init.scope;
62
+ this.version = init.version;
63
+ this.publishedBy = init.publishedBy;
64
+ this.createdAt = init.createdAt;
65
+ this.updatedAt = init.updatedAt;
66
+ if (typeof init.changelog === 'string') {
67
+ this.changelog = init.changelog;
68
+ }
69
+ if (typeof init.deprecated === 'boolean') {
70
+ this.deprecated = init.deprecated;
71
+ }
72
+ if (typeof init.deprecatedAt === 'number') {
73
+ this.deprecatedAt = init.deprecatedAt;
74
+ }
75
+ if (typeof init.deprecatedBy === 'string') {
76
+ this.deprecatedBy = init.deprecatedBy;
77
+ }
78
+ if (typeof init.deprecationReason === 'string') {
79
+ this.deprecationReason = init.deprecationReason;
80
+ }
81
+ if (typeof init.unpublishedAt === 'number') {
82
+ this.unpublishedAt = init.unpublishedAt;
83
+ }
84
+ }
85
+ toJSON() {
86
+ const result = {
87
+ key: this.key,
88
+ kind: DataCatalogVersionKind,
89
+ scope: this.scope,
90
+ publishedBy: this.publishedBy,
91
+ createdAt: this.createdAt,
92
+ updatedAt: this.updatedAt,
93
+ catalogKey: this.catalogKey,
94
+ lifecycle: this.lifecycle,
95
+ version: this.version,
96
+ };
97
+ if (typeof this.deprecated === 'boolean') {
98
+ result.deprecated = this.deprecated;
99
+ }
100
+ if (typeof this.deprecatedAt === 'number') {
101
+ result.deprecatedAt = this.deprecatedAt;
102
+ }
103
+ if (typeof this.deprecatedBy === 'string') {
104
+ result.deprecatedBy = this.deprecatedBy;
105
+ }
106
+ if (typeof this.deprecationReason === 'string') {
107
+ result.deprecationReason = this.deprecationReason;
108
+ }
109
+ if (typeof this.unpublishedAt === 'number') {
110
+ result.unpublishedAt = this.unpublishedAt;
111
+ }
112
+ if (typeof this.changelog === 'string' && this.changelog) {
113
+ result.changelog = this.changelog;
114
+ }
115
+ return result;
116
+ }
117
+ }
118
+ //# sourceMappingURL=DataCatalogVersion.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DataCatalogVersion.js","sourceRoot":"","sources":["../../../src/models/DataCatalogVersion.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAA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AC;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,IAAI,OAAO,IAAI,CAAC,SAAS,KAAK,QAAQ,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;YACzD,MAAM,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,CAAA;QACnC,CAAC;QACD,OAAO,MAAM,CAAA;IACf,CAAC;CACF","sourcesContent":["import { DataCatalogScope } from './DataCatalog.js'\nimport { DataCatalogVersionKind } from './kinds.js'\n\nexport type DataCatalogLifecycle = 'stable' | 'beta' | 'dev'\n\nexport interface DataCatalogVersionSchema {\n /**\n * The key of the version.\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 */\n readonly kind: typeof DataCatalogVersionKind\n /**\n * The key of the parent data catalog entry.\n * It is only populated by the API when creating the version.\n * @readonly\n */\n catalogKey: string\n /**\n * The publication scope of the data catalog entry.\n *\n * When the scope is set to a different value than the one of the parent data catalog entry,\n * then this value is used to determine the visibility of the data catalog entry. However,\n * the reader cannot access the version with a \"public\" scope if the parent data catalog entry is private.\n *\n * @required\n */\n scope: DataCatalogScope\n /**\n * The lifecycle of the data catalog entry.\n *\n * - `stable`: The data catalog entry is stable and can be used in production.\n * - `beta`: The data catalog entry is in beta and may change in the future.\n * - `dev`: The data catalog entry is in development and likely will change in the future.\n *\n * The lifecycle is a readonly property and is set by the API when creating or updating the data catalog entry.\n * A version is immutable and to change the lifecycle, a new version must be created.\n *\n * @required\n */\n lifecycle: DataCatalogLifecycle\n /**\n * The version string according to the [semantic versioning](https://semver.org/) specification.\n * Note, this value is limited to 32 characters by the API.\n * @required\n */\n version: string\n /**\n * The id of the user who created the version.\n * It is ignored when creating or updating a data catalog entry.\n * @readonly\n */\n publishedBy: string\n /**\n * The timestamp when this version was unpublished.\n * Only set when the version was unpublished.\n * @readonly\n */\n unpublishedAt?: number\n /**\n * A flag indicating if the version is deprecated.\n * @readonly\n */\n deprecated?: boolean\n /**\n * The timestamp when the version was deprecated.\n * Only set when the version was deprecated.\n * @readonly\n */\n deprecatedAt?: number\n /**\n * The id of the user who deprecated the version.\n * Only set when the version was deprecated.\n * @readonly\n */\n deprecatedBy?: string\n /**\n * The reason why the version was deprecated.\n * Only set when the version was deprecated.\n */\n deprecationReason?: string\n /**\n * The timestamp 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 timestamp 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 changelog of the data catalog entry.\n * Note, this value is required by the API when creating the version.\n */\n changelog?: string\n}\n\nexport class DataCatalogVersion implements DataCatalogVersionSchema {\n key: string\n\n get kind(): typeof DataCatalogVersionKind {\n return DataCatalogVersionKind\n }\n\n catalogKey: string\n scope: DataCatalogScope\n lifecycle: DataCatalogLifecycle\n version: string\n publishedBy: string\n unpublishedAt?: number | undefined\n deprecated?: boolean | undefined\n deprecatedAt?: number | undefined\n deprecatedBy?: string | undefined\n deprecationReason?: string | undefined\n createdAt: number\n updatedAt: number\n changelog?: string | undefined\n\n static createSchema(input: Partial<DataCatalogVersionSchema>): DataCatalogVersionSchema {\n const {\n key = '',\n scope = 'private',\n publishedBy = '',\n createdAt = 0,\n updatedAt = 0,\n catalogKey = '',\n lifecycle = 'stable',\n version = '',\n } = input\n if (['public', 'private', 'organization'].indexOf(scope) === -1) {\n throw new Error(`Invalid scope: ${scope}`)\n }\n const result: DataCatalogVersionSchema = {\n key,\n kind: DataCatalogVersionKind,\n scope,\n publishedBy,\n createdAt,\n updatedAt,\n catalogKey,\n lifecycle,\n version,\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.changelog === 'string') {\n result.changelog = input.changelog\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<DataCatalogVersionSchema> = {}) {\n const init = DataCatalogVersion.createSchema(input)\n this.key = init.key\n this.catalogKey = init.catalogKey\n this.lifecycle = init.lifecycle\n this.scope = init.scope\n this.version = init.version\n this.publishedBy = init.publishedBy\n this.createdAt = init.createdAt\n this.updatedAt = init.updatedAt\n if (typeof init.changelog === 'string') {\n this.changelog = init.changelog\n }\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(): DataCatalogVersionSchema {\n const result: DataCatalogVersionSchema = {\n key: this.key,\n kind: DataCatalogVersionKind,\n scope: this.scope,\n publishedBy: this.publishedBy,\n createdAt: this.createdAt,\n updatedAt: this.updatedAt,\n catalogKey: this.catalogKey,\n lifecycle: this.lifecycle,\n version: this.version,\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 if (typeof this.changelog === 'string' && this.changelog) {\n result.changelog = this.changelog\n }\n return result\n }\n}\n"]}
@@ -16,6 +16,8 @@ export declare const DomainModelKind = "Domain#Model";
16
16
  export declare const DomainEntityKind = "Domain#Entity";
17
17
  export declare const DomainAssociationKind = "Domain#Association";
18
18
  export declare const DomainPropertyKind = "Domain#Property";
19
+ export declare const DataCatalogKind = "Core#DataCatalog";
20
+ export declare const DataCatalogVersionKind = "Core#DataCatalogVersion";
19
21
  /**
20
22
  * @deprecated Not used anymore.
21
23
  */
@@ -1 +1 @@
1
- {"version":3,"file":"kinds.d.ts","sourceRoot":"","sources":["../../../src/models/kinds.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,iBAAiB,uBAAuB,CAAA;AACrD,eAAO,MAAM,YAAY,sBAAsB,CAAA;AAC/C,eAAO,MAAM,gBAAgB,sBAAsB,CAAA;AACnD,eAAO,MAAM,mBAAmB,yBAAyB,CAAA;AACzD,eAAO,MAAM,UAAU,gBAAgB,CAAA;AACvC,eAAO,MAAM,WAAW,iBAAiB,CAAA;AACzC,eAAO,MAAM,SAAS,eAAe,CAAA;AACrC,eAAO,MAAM,YAAY,kBAAkB,CAAA;AAC3C,eAAO,MAAM,YAAY,kBAAkB,CAAA;AAC3C,eAAO,MAAM,wBAAwB,8BAA8B,CAAA;AACnE,eAAO,MAAM,QAAQ,cAAc,CAAA;AACnC,eAAO,MAAM,cAAc,oBAAoB,CAAA;AAC/C,eAAO,MAAM,cAAc,gBAAgB,CAAA;AAC3C,eAAO,MAAM,mBAAmB,qBAAqB,CAAA;AACrD,eAAO,MAAM,eAAe,iBAAiB,CAAA;AAC7C,eAAO,MAAM,gBAAg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,qBAAqB,CAAA;AACjD,eAAO,MAAM,sBAAsB,4BAA4B,CAAA;AAE/D;;GAEG;AACH,eAAO,MAAM,YAAY,kBAAkB,CAAA;AAC3C;;GAEG;AACH,eAAO,MAAM,iBAAiB,uBAAuB,CAAA;AACrD;;GAEG;AACH,eAAO,MAAM,aAAa,mBAAmB,CAAA;AAC7C;;GAEG;AACH,eAAO,MAAM,cAAc,oBAAoB,CAAA;AAC/C;;GAEG;AACH,eAAO,MAAM,mBAAmB,yBAAyB,CAAA;AACzD;;GAEG;AACH,eAAO,MAAM,gBAAgB,sBAAsB,CAAA"}
@@ -16,6 +16,8 @@ export const DomainModelKind = 'Domain#Model';
16
16
  export const DomainEntityKind = 'Domain#Entity';
17
17
  export const DomainAssociationKind = 'Domain#Association';
18
18
  export const DomainPropertyKind = 'Domain#Property';
19
+ export const DataCatalogKind = 'Core#DataCatalog';
20
+ export const DataCatalogVersionKind = 'Core#DataCatalogVersion';
19
21
  /**
20
22
  * @deprecated Not used anymore.
21
23
  */