@lightdash/common 0.1392.0 → 0.1393.0
Sign up to get free protection for your applications and to get access to all the features.
package/dist/index.d.ts
CHANGED
@@ -124,6 +124,7 @@ export * from './types/warehouse';
|
|
124
124
|
export * from './utils/additionalMetrics';
|
125
125
|
export * from './utils/api';
|
126
126
|
export { default as assertUnreachable } from './utils/assertUnreachable';
|
127
|
+
export * from './utils/catalogMetricsTree';
|
127
128
|
export * from './utils/conditionalFormatting';
|
128
129
|
export * from './utils/convertToDbt';
|
129
130
|
export * from './utils/dashboard';
|
package/dist/index.js
CHANGED
@@ -94,6 +94,7 @@ tslib_1.__exportStar(require("./utils/additionalMetrics"), exports);
|
|
94
94
|
tslib_1.__exportStar(require("./utils/api"), exports);
|
95
95
|
var assertUnreachable_1 = require("./utils/assertUnreachable");
|
96
96
|
Object.defineProperty(exports, "assertUnreachable", { enumerable: true, get: function () { return tslib_1.__importDefault(assertUnreachable_1).default; } });
|
97
|
+
tslib_1.__exportStar(require("./utils/catalogMetricsTree"), exports);
|
97
98
|
tslib_1.__exportStar(require("./utils/conditionalFormatting"), exports);
|
98
99
|
tslib_1.__exportStar(require("./utils/convertToDbt"), exports);
|
99
100
|
tslib_1.__exportStar(require("./utils/dashboard"), exports);
|
package/dist/types/catalog.d.ts
CHANGED
@@ -56,6 +56,11 @@ export type CatalogTable = Pick<TableBase, 'name' | 'label' | 'groupLabel' | 'de
|
|
56
56
|
icon: CatalogItemIcon | null;
|
57
57
|
};
|
58
58
|
export type CatalogItem = CatalogField | CatalogTable;
|
59
|
+
export type CatalogMetricsTreeNode = Pick<CatalogField, 'name' | 'tableName'>;
|
60
|
+
export type CatalogMetricsTreeEdge = {
|
61
|
+
source: CatalogMetricsTreeNode;
|
62
|
+
target: CatalogMetricsTreeNode;
|
63
|
+
};
|
59
64
|
export type ApiCatalogResults = CatalogItem[];
|
60
65
|
export type ApiMetricsCatalogResults = CatalogField[];
|
61
66
|
export type ApiMetricsCatalog = {
|
@@ -67,6 +72,16 @@ export type ApiGetMetricPeek = {
|
|
67
72
|
status: 'ok';
|
68
73
|
results: MetricWithAssociatedTimeDimension;
|
69
74
|
};
|
75
|
+
export type ApiGetMetricsTree = {
|
76
|
+
status: 'ok';
|
77
|
+
results: {
|
78
|
+
edges: CatalogMetricsTreeEdge[];
|
79
|
+
};
|
80
|
+
};
|
81
|
+
export type ApiCreateMetricsTreeEdgePayload = {
|
82
|
+
sourceMetricId: string;
|
83
|
+
targetMetricId: string;
|
84
|
+
};
|
70
85
|
export type CatalogMetadata = {
|
71
86
|
name: string;
|
72
87
|
description: string | undefined;
|
@@ -0,0 +1,18 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.parseMetricsTreeNodeId = exports.getMetricsTreeNodeId = void 0;
|
4
|
+
function getMetricsTreeNodeId(field) {
|
5
|
+
return `${field.tableName}::${field.name}`;
|
6
|
+
}
|
7
|
+
exports.getMetricsTreeNodeId = getMetricsTreeNodeId;
|
8
|
+
function parseMetricsTreeNodeId(id) {
|
9
|
+
const [tableName, name] = id.split('::');
|
10
|
+
if (!tableName || !name) {
|
11
|
+
throw new Error('Invalid metrics tree node id');
|
12
|
+
}
|
13
|
+
return {
|
14
|
+
name,
|
15
|
+
tableName,
|
16
|
+
};
|
17
|
+
}
|
18
|
+
exports.parseMetricsTreeNodeId = parseMetricsTreeNodeId;
|