@gooddata/sdk-backend-tiger 11.54.0-alpha.5 → 11.54.0-alpha.7
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/esm/__version.d.ts +1 -1
- package/esm/__version.js +1 -1
- package/esm/backend/features/feature.d.ts.map +1 -1
- package/esm/backend/features/feature.js +2 -0
- package/esm/backend/uiFeatures.d.ts +7 -1
- package/esm/backend/uiFeatures.d.ts.map +1 -1
- package/esm/backend/uiFeatures.js +6 -0
- package/esm/backend/workspace/catalog/availableItemsFactory.d.ts +7 -0
- package/esm/backend/workspace/catalog/availableItemsFactory.d.ts.map +1 -1
- package/esm/backend/workspace/catalog/availableItemsFactory.js +36 -6
- package/esm/backend/workspace/catalog/catalog.d.ts +2 -1
- package/esm/backend/workspace/catalog/catalog.d.ts.map +1 -1
- package/esm/backend/workspace/catalog/catalog.js +4 -1
- package/esm/backend/workspace/catalog/catalogWithAvailableItems.d.ts +3 -1
- package/esm/backend/workspace/catalog/catalogWithAvailableItems.d.ts.map +1 -1
- package/esm/backend/workspace/catalog/catalogWithAvailableItems.js +8 -2
- package/esm/backend/workspace/catalog/factory.d.ts +1 -0
- package/esm/backend/workspace/catalog/factory.d.ts.map +1 -1
- package/esm/backend/workspace/catalog/factory.js +20 -3
- package/esm/backend/workspace/computedAttributes/computedAttributesQuery.d.ts +27 -0
- package/esm/backend/workspace/computedAttributes/computedAttributesQuery.d.ts.map +1 -0
- package/esm/backend/workspace/computedAttributes/computedAttributesQuery.js +104 -0
- package/esm/backend/workspace/computedAttributes/index.d.ts +18 -0
- package/esm/backend/workspace/computedAttributes/index.d.ts.map +1 -0
- package/esm/backend/workspace/computedAttributes/index.js +145 -0
- package/esm/backend/workspace/genAI/ChatConversations.d.ts +1 -1
- package/esm/backend/workspace/genAI/ChatConversations.d.ts.map +1 -1
- package/esm/backend/workspace/genAI/ChatConversations.js +6 -4
- package/esm/backend/workspace/index.d.ts +3 -1
- package/esm/backend/workspace/index.d.ts.map +1 -1
- package/esm/backend/workspace/index.js +8 -0
- package/esm/backend/workspace/measures/index.d.ts +0 -2
- package/esm/backend/workspace/measures/index.d.ts.map +1 -1
- package/esm/backend/workspace/measures/index.js +12 -44
- package/esm/backend/workspace/measures/measureExpressionTokens.d.ts +14 -1
- package/esm/backend/workspace/measures/measureExpressionTokens.d.ts.map +1 -1
- package/esm/backend/workspace/measures/measureExpressionTokens.js +60 -0
- package/esm/backend/workspace/reports.d.ts +12 -0
- package/esm/backend/workspace/reports.d.ts.map +1 -0
- package/esm/backend/workspace/reports.js +45 -0
- package/esm/convertors/fromBackend/CatalogConverter.d.ts +3 -2
- package/esm/convertors/fromBackend/CatalogConverter.d.ts.map +1 -1
- package/esm/convertors/fromBackend/CatalogConverter.js +10 -1
- package/esm/convertors/fromBackend/ComputedAttributeConverter.d.ts +13 -0
- package/esm/convertors/fromBackend/ComputedAttributeConverter.d.ts.map +1 -0
- package/esm/convertors/fromBackend/ComputedAttributeConverter.js +71 -0
- package/esm/convertors/fromBackend/MetadataConverter.d.ts +2 -2
- package/esm/convertors/fromBackend/MetadataConverter.d.ts.map +1 -1
- package/esm/convertors/fromBackend/genAIConvertor.d.ts +1 -1
- package/esm/convertors/fromBackend/genAIConvertor.d.ts.map +1 -1
- package/esm/convertors/fromBackend/genAIConvertor.js +85 -8
- package/esm/convertors/toBackend/ComputedAttributeConverter.d.ts +4 -0
- package/esm/convertors/toBackend/ComputedAttributeConverter.d.ts.map +1 -0
- package/esm/convertors/toBackend/ComputedAttributeConverter.js +20 -0
- package/esm/convertors/toBackend/ExportDefinitionsConverter.d.ts.map +1 -1
- package/esm/convertors/toBackend/ExportDefinitionsConverter.js +1 -2
- package/esm/sdk-backend-tiger.d.ts +5 -1
- package/esm/types/index.d.ts +1 -1
- package/esm/types/index.d.ts.map +1 -1
- package/esm/types/refTypeMapping.d.ts +5 -1
- package/esm/types/refTypeMapping.d.ts.map +1 -1
- package/esm/types/refTypeMapping.js +3 -0
- package/package.json +14 -13
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
// (C) 2026 GoodData Corporation
|
|
2
|
+
import { MetadataUtilities } from "@gooddata/api-client-tiger";
|
|
3
|
+
import { EntitiesApi_CreateEntityComputedAttributes, EntitiesApi_DeleteEntityComputedAttributes, EntitiesApi_GetAllEntitiesMetrics, EntitiesApi_GetAllEntitiesVisualizationObjects, EntitiesApi_GetEntityComputedAttributes, EntitiesApi_PatchEntityComputedAttributes, EntitiesApi_UpdateEntityComputedAttributes, } from "@gooddata/api-client-tiger/endpoints/entitiesObjects";
|
|
4
|
+
import { isIdentifierRef, } from "@gooddata/sdk-model";
|
|
5
|
+
import { convertComputedAttributeFromBackend } from "../../../convertors/fromBackend/ComputedAttributeConverter.js";
|
|
6
|
+
import { visualizationObjectsItemToInsight } from "../../../convertors/fromBackend/InsightConverter.js";
|
|
7
|
+
import { convertMetricFromBackend } from "../../../convertors/fromBackend/MetricConverter.js";
|
|
8
|
+
import { convertComputedAttributeToBackend } from "../../../convertors/toBackend/ComputedAttributeConverter.js";
|
|
9
|
+
import { objRefToIdentifier } from "../../../utils/api.js";
|
|
10
|
+
import { resolveExpressionToken, tokenizeExpression } from "../measures/measureExpressionTokens.js";
|
|
11
|
+
import { ComputedAttributesQuery } from "./computedAttributesQuery.js";
|
|
12
|
+
export class TigerWorkspaceComputedAttributes {
|
|
13
|
+
authCall;
|
|
14
|
+
workspace;
|
|
15
|
+
constructor(authCall, workspace) {
|
|
16
|
+
this.authCall = authCall;
|
|
17
|
+
this.workspace = workspace;
|
|
18
|
+
}
|
|
19
|
+
async createComputedAttribute(computedAttribute) {
|
|
20
|
+
const attributes = convertComputedAttributeToBackend(computedAttribute);
|
|
21
|
+
const result = await this.authCall((client) => {
|
|
22
|
+
return EntitiesApi_CreateEntityComputedAttributes(client.axios, client.basePath, {
|
|
23
|
+
workspaceId: this.workspace,
|
|
24
|
+
jsonApiComputedAttributePostOptionalIdDocument: {
|
|
25
|
+
data: {
|
|
26
|
+
id: computedAttribute.id,
|
|
27
|
+
type: "computedAttribute",
|
|
28
|
+
attributes,
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
});
|
|
32
|
+
});
|
|
33
|
+
return convertComputedAttributeFromBackend(result.data, result.data.included);
|
|
34
|
+
}
|
|
35
|
+
async updateComputedAttribute(computedAttribute) {
|
|
36
|
+
const objectId = objRefToIdentifier(computedAttribute.ref, this.authCall);
|
|
37
|
+
const attributes = convertComputedAttributeToBackend(computedAttribute);
|
|
38
|
+
const result = await this.authCall((client) => {
|
|
39
|
+
return EntitiesApi_UpdateEntityComputedAttributes(client.axios, client.basePath, {
|
|
40
|
+
objectId,
|
|
41
|
+
workspaceId: this.workspace,
|
|
42
|
+
jsonApiComputedAttributeInDocument: {
|
|
43
|
+
data: {
|
|
44
|
+
id: objectId,
|
|
45
|
+
type: "computedAttribute",
|
|
46
|
+
attributes,
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
});
|
|
50
|
+
});
|
|
51
|
+
return convertComputedAttributeFromBackend(result.data, result.data.included);
|
|
52
|
+
}
|
|
53
|
+
async updateComputedAttributeMeta(computedAttribute) {
|
|
54
|
+
const objectId = objRefToIdentifier(computedAttribute.ref, this.authCall);
|
|
55
|
+
const result = await this.authCall((client) => {
|
|
56
|
+
return EntitiesApi_PatchEntityComputedAttributes(client.axios, client.basePath, {
|
|
57
|
+
objectId,
|
|
58
|
+
workspaceId: this.workspace,
|
|
59
|
+
jsonApiComputedAttributePatchDocument: {
|
|
60
|
+
data: {
|
|
61
|
+
id: objectId,
|
|
62
|
+
type: "computedAttribute",
|
|
63
|
+
attributes: {
|
|
64
|
+
...(computedAttribute.title === undefined
|
|
65
|
+
? {}
|
|
66
|
+
: { title: computedAttribute.title }),
|
|
67
|
+
...(computedAttribute.description === undefined
|
|
68
|
+
? {}
|
|
69
|
+
: { description: computedAttribute.description }),
|
|
70
|
+
...(computedAttribute.tags === undefined ? {} : { tags: computedAttribute.tags }),
|
|
71
|
+
...(computedAttribute.isHidden === undefined
|
|
72
|
+
? {}
|
|
73
|
+
: { isHidden: computedAttribute.isHidden }),
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
});
|
|
78
|
+
});
|
|
79
|
+
return convertComputedAttributeFromBackend(result.data, result.data.included);
|
|
80
|
+
}
|
|
81
|
+
async deleteComputedAttribute(ref) {
|
|
82
|
+
const objectId = objRefToIdentifier(ref, this.authCall);
|
|
83
|
+
await this.authCall((client) => {
|
|
84
|
+
return EntitiesApi_DeleteEntityComputedAttributes(client.axios, client.basePath, {
|
|
85
|
+
objectId,
|
|
86
|
+
workspaceId: this.workspace,
|
|
87
|
+
});
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
async getComputedAttribute(ref, options = {}) {
|
|
91
|
+
const id = objRefToIdentifier(ref, this.authCall);
|
|
92
|
+
const result = await this.authCall((client) => EntitiesApi_GetEntityComputedAttributes(client.axios, client.basePath, {
|
|
93
|
+
objectId: id,
|
|
94
|
+
workspaceId: this.workspace,
|
|
95
|
+
include: options.loadUserData ? ["createdBy", "modifiedBy"] : [],
|
|
96
|
+
}));
|
|
97
|
+
return convertComputedAttributeFromBackend(result.data, result.data.included);
|
|
98
|
+
}
|
|
99
|
+
async getComputedAttributeExpressionTokens(ref) {
|
|
100
|
+
if (!isIdentifierRef(ref)) {
|
|
101
|
+
throw new Error("only identifiers supported");
|
|
102
|
+
}
|
|
103
|
+
const result = await this.authCall((client) => EntitiesApi_GetEntityComputedAttributes(client.axios, client.basePath, {
|
|
104
|
+
objectId: ref.identifier,
|
|
105
|
+
workspaceId: this.workspace,
|
|
106
|
+
include: [
|
|
107
|
+
"facts",
|
|
108
|
+
"metrics",
|
|
109
|
+
"attributes",
|
|
110
|
+
"labels",
|
|
111
|
+
"datasets",
|
|
112
|
+
"parameters",
|
|
113
|
+
"computedAttributes",
|
|
114
|
+
],
|
|
115
|
+
}));
|
|
116
|
+
const computedAttribute = result.data;
|
|
117
|
+
const maql = computedAttribute.data.attributes.content.maql || "";
|
|
118
|
+
return tokenizeExpression(maql).map((regexToken) => resolveExpressionToken(regexToken, computedAttribute.included ?? [], computedAttribute.data.id));
|
|
119
|
+
}
|
|
120
|
+
async getComputedAttributeReferencingObjects(ref) {
|
|
121
|
+
const id = objRefToIdentifier(ref, this.authCall);
|
|
122
|
+
// A visualization grouping by a computed attribute is the referent that exists today. The
|
|
123
|
+
// backend allows the delete; the catalog refuses it and lists these titles instead.
|
|
124
|
+
const insights = this.authCall((client) => MetadataUtilities.getAllPagesOf(client, EntitiesApi_GetAllEntitiesVisualizationObjects, {
|
|
125
|
+
workspaceId: this.workspace,
|
|
126
|
+
// return only visualizationObjects that have a link to the given computed attribute
|
|
127
|
+
filter: `computedAttributes.id==${id}`,
|
|
128
|
+
})
|
|
129
|
+
.then(MetadataUtilities.mergeEntitiesResults)
|
|
130
|
+
.then((visualizationObjects) => visualizationObjects.data.map((visualizationObject) => visualizationObjectsItemToInsight(visualizationObject, visualizationObjects.included))));
|
|
131
|
+
// Reports nothing until a metric can reference a computed attribute (pending backend support).
|
|
132
|
+
const measures = this.authCall((client) => MetadataUtilities.getAllPagesOf(client, EntitiesApi_GetAllEntitiesMetrics, {
|
|
133
|
+
workspaceId: this.workspace,
|
|
134
|
+
include: ["computedAttributes"],
|
|
135
|
+
filter: `computedAttributes.id==${id}`,
|
|
136
|
+
})
|
|
137
|
+
.then(MetadataUtilities.mergeEntitiesResults)
|
|
138
|
+
.then((metrics) => metrics.data.map((metric) => convertMetricFromBackend(metric, metrics.included))));
|
|
139
|
+
const [insightList, measureList] = await Promise.all([insights, measures]);
|
|
140
|
+
return { insights: insightList, measures: measureList };
|
|
141
|
+
}
|
|
142
|
+
getComputedAttributesQuery() {
|
|
143
|
+
return new ComputedAttributesQuery(this.authCall, { workspaceId: this.workspace });
|
|
144
|
+
}
|
|
145
|
+
}
|
|
@@ -106,6 +106,6 @@ export declare class ChatConversationThreadQuery implements IChatConversationThr
|
|
|
106
106
|
withIncludeTags(includeTags?: string[]): IChatConversationThreadQuery;
|
|
107
107
|
withAllowedRelationshipTypes(relationshipTypes?: IAllowedRelationshipType[]): IChatConversationThreadQuery;
|
|
108
108
|
withEffort(effort?: GenAIChatEffort): IChatConversationThreadQuery;
|
|
109
|
-
stream(): ReadableStream<IChatConversationItem | IChatConversationError | IChatConversationInteractionStep>;
|
|
109
|
+
stream(history: IChatConversationItem[]): ReadableStream<IChatConversationItem | IChatConversationError | IChatConversationInteractionStep>;
|
|
110
110
|
}
|
|
111
111
|
//# sourceMappingURL=ChatConversations.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChatConversations.d.ts","sourceRoot":"","sources":["../../../../src/backend/workspace/genAI/ChatConversations.ts"],"names":[],"mappings":"AAwBA,OAAO,EACH,KAAK,iBAAiB,EACtB,KAAK,8BAA8B,EACnC,KAAK,sBAAsB,EAC3B,KAAK,gCAAgC,EACrC,KAAK,qBAAqB,EAC1B,KAAK,2BAA2B,EAChC,KAAK,iCAAiC,EACtC,KAAK,uBAAuB,EAC5B,KAAK,4BAA4B,EACjC,KAAK,kBAAkB,EAC1B,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EACH,KAAK,eAAe,EACpB,KAAK,gCAAgC,EACrC,KAAK,eAAe,EACpB,KAAK,wBAAwB,EAE7B,KAAK,iBAAiB,EAIzB,MAAM,qBAAqB,CAAC;AAG7B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yDAAyD,CAAC;AAY9F,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,yBAAyB,CAAC;AAE3E;;;GAGG;AACH,qBAAa,wBAAyB,YAAW,kBAAkB;IAE3D,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,WAAW;IAC5B,OAAO,CAAC,QAAQ,CAAC,cAAc;IAC/B,OAAO,CAAC,QAAQ,CAAC,OAAO;IAJ5B,YACqB,QAAQ,EAAE,2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C;IACvB,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,WAAW,CAAC,EAAE,iBAAiB,CAAC;IAChC,WAAW,CAAC,EAAE,eAAe,EAAE,CAAC;IAChC,wBAAwB,CAAC,EAAE,wBAAwB,EAAE,CAAC;IACtD,MAAM,CAAC,EAAE,eAAe,CAAC;CAC5B,CAAC;AAEF;;;GAGG;AACH,qBAAa,2BAA4B,YAAW,4BAA4B;IAExE,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,cAAc;IAC/B,OAAO,CAAC,QAAQ,CAAC,iBAAiB;IAHtC,YACqB,QAAQ,EAAE,2BAA2B,EACrC,cAAc,EAAE,cAAc,EAC9B,iBAAiB,EAAE,iCAAiC,EACrE;IAEJ,eAAe,CAAC,WAAW,EAAE,MAAM,GAAG,4BAA4B,CAKjE;IACD,eAAe,CAAC,WAAW,EAAE,MAAM,GAAG,4BAA4B,CAKjE;IACD,eAAe,CAAC,WAAW,EAAE,iBAAiB,GAAG,4BAA4B,CAK5E;IACD,eAAe,CAAC,WAAW,CAAC,EAAE,eAAe,EAAE,GAAG,4BAA4B,CAK7E;IACD,eAAe,CAAC,WAAW,CAAC,EAAE,MAAM,EAAE,GAAG,4BAA4B,CAKpE;IACD,eAAe,CAAC,WAAW,CAAC,EAAE,MAAM,EAAE,GAAG,4BAA4B,CAKpE;IACD,4BAA4B,CACxB,iBAAiB,CAAC,EAAE,wBAAwB,EAAE,GAC/C,4BAA4B,CAK9B;IACD,UAAU,CAAC,MAAM,CAAC,EAAE,eAAe,GAAG,4BAA4B,CAKjE;IACD,MAAM,
|
|
1
|
+
{"version":3,"file":"ChatConversations.d.ts","sourceRoot":"","sources":["../../../../src/backend/workspace/genAI/ChatConversations.ts"],"names":[],"mappings":"AAwBA,OAAO,EACH,KAAK,iBAAiB,EACtB,KAAK,8BAA8B,EACnC,KAAK,sBAAsB,EAC3B,KAAK,gCAAgC,EACrC,KAAK,qBAAqB,E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AC,WAAW,EAAE,iBAAiB,GAAG,4BAA4B,CAK5E;IACD,eAAe,CAAC,WAAW,CAAC,EAAE,eAAe,EAAE,GAAG,4BAA4B,CAK7E;IACD,eAAe,CAAC,WAAW,CAAC,EAAE,MAAM,EAAE,GAAG,4BAA4B,CAKpE;IACD,eAAe,CAAC,WAAW,CAAC,EAAE,MAAM,EAAE,GAAG,4BAA4B,CAKpE;IACD,4BAA4B,CACxB,iBAAiB,CAAC,EAAE,wBAAwB,EAAE,GAC/C,4BAA4B,CAK9B;IACD,UAAU,CAAC,MAAM,CAAC,EAAE,eAAe,GAAG,4BAA4B,CAKjE;IACD,MAAM,CACF,OAAO,EAAE,qBAAqB,EAAE,GACjC,cAAc,CAAC,qBAAqB,GAAG,sBAAsB,GAAG,gCAAgC,CAAC,CAqFnG;CACJ"}
|
|
@@ -290,7 +290,7 @@ export class ChatConversationThreadQuery {
|
|
|
290
290
|
effort,
|
|
291
291
|
});
|
|
292
292
|
}
|
|
293
|
-
stream() {
|
|
293
|
+
stream(history) {
|
|
294
294
|
// We are using Axios <1.7, which does not support streaming,
|
|
295
295
|
// as it can't use fetch API instead of XHR.
|
|
296
296
|
// This method can be simplified once we upgrade to Axios >=1.7.
|
|
@@ -361,7 +361,7 @@ export class ChatConversationThreadQuery {
|
|
|
361
361
|
return textStream
|
|
362
362
|
.pipeThrough(new EventSourceParserStream())
|
|
363
363
|
.pipeThrough(new ServerSentEventsDataParser())
|
|
364
|
-
.pipeThrough(new ServerSentEventsDataConverter(this.dateNormalizer, () => responseTraceId));
|
|
364
|
+
.pipeThrough(new ServerSentEventsDataConverter(this.dateNormalizer, history, () => responseTraceId));
|
|
365
365
|
}
|
|
366
366
|
}
|
|
367
367
|
/**
|
|
@@ -391,17 +391,19 @@ class ServerSentEventsDataParser extends TransformStream {
|
|
|
391
391
|
* @internal
|
|
392
392
|
*/
|
|
393
393
|
class ServerSentEventsDataConverter extends TransformStream {
|
|
394
|
-
constructor(dateNormalizer, traceIdProvider, locale, timezone) {
|
|
394
|
+
constructor(dateNormalizer, history, traceIdProvider, locale, timezone) {
|
|
395
|
+
const current = [];
|
|
395
396
|
super({
|
|
396
397
|
transform(event, controller) {
|
|
397
398
|
if (event.type === "error") {
|
|
398
399
|
controller.enqueue(convertChatConversationErrorFromBackend(event.data, traceIdProvider()));
|
|
399
400
|
}
|
|
400
401
|
else if (event.type === "item" && "item" in event.data) {
|
|
401
|
-
const item = convertChatConversationItemFromBackend(event.data.item, undefined, dateNormalizer, locale, timezone);
|
|
402
|
+
const item = convertChatConversationItemFromBackend(event.data.item, undefined, [...history, ...current], dateNormalizer, locale, timezone);
|
|
402
403
|
// Item is dropped (undefined) when its content type is unrecognized by
|
|
403
404
|
// this frontend version - do not enqueue anything for it.
|
|
404
405
|
if (item) {
|
|
406
|
+
current.push(item);
|
|
405
407
|
controller.enqueue(item);
|
|
406
408
|
}
|
|
407
409
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type IAnalyticalWorkspace, type IAttributeHierarchiesService, type IDataFiltersService, type IDateFilterConfigsQuery, type IExecutionFactory, type IGenAIService, type IReferencesService, type IWorkspaceAccessControlService, type IWorkspaceAgentsService, type IWorkspaceAttributesService, type IWorkspaceAutomationService, type IWorkspaceCatalogFactory, type IWorkspaceDashboardsService, type IWorkspaceDatasetsService, type IWorkspaceDescriptor, type IWorkspaceDescriptorUpdate, type IWorkspaceExportDefinitionsService, type IWorkspaceExportTemplatesService, type IWorkspaceFactsService, type IWorkspaceInsightsService, type IWorkspaceKeyDriverAnalysisService, type IWorkspaceLogicalModelService, type IWorkspaceMeasuresService, type IWorkspaceObjectPermissionsService, type IWorkspaceParametersService, type IWorkspacePermissionsService, type IWorkspaceSettingsService, type IWorkspaceStylingService, type IWorkspaceUserGroupsQuery, type IWorkspaceUsersQuery } from "@gooddata/sdk-backend-spi";
|
|
1
|
+
import { type IAnalyticalWorkspace, type IAttributeHierarchiesService, type IDataFiltersService, type IDateFilterConfigsQuery, type IExecutionFactory, type IGenAIService, type IReferencesService, type IWorkspaceAccessControlService, type IWorkspaceAgentsService, type IWorkspaceAttributesService, type IWorkspaceAutomationService, type IWorkspaceCatalogFactory, type IWorkspaceComputedAttributesService, type IWorkspaceDashboardsService, type IWorkspaceDatasetsService, type IWorkspaceDescriptor, type IWorkspaceDescriptorUpdate, type IWorkspaceExportDefinitionsService, type IWorkspaceExportTemplatesService, type IWorkspaceFactsService, type IWorkspaceInsightsService, type IWorkspaceKeyDriverAnalysisService, type IWorkspaceLogicalModelService, type IWorkspaceMeasuresService, type IWorkspaceObjectPermissionsService, type IWorkspaceParametersService, type IWorkspacePermissionsService, type IWorkspaceReportsService, type IWorkspaceSettingsService, type IWorkspaceStylingService, type IWorkspaceUserGroupsQuery, type IWorkspaceUsersQuery } from "@gooddata/sdk-backend-spi";
|
|
2
2
|
import { type DateFormatter, type DateNormalizer, type DateStringifier } from "../../convertors/fromBackend/dateFormatting/types.js";
|
|
3
3
|
import { type TigerAuthenticatedCallGuard } from "../../types/index.js";
|
|
4
4
|
export declare class TigerWorkspace implements IAnalyticalWorkspace {
|
|
@@ -21,6 +21,7 @@ export declare class TigerWorkspace implements IAnalyticalWorkspace {
|
|
|
21
21
|
measures(): IWorkspaceMeasuresService;
|
|
22
22
|
parameters(): IWorkspaceParametersService;
|
|
23
23
|
facts(): IWorkspaceFactsService;
|
|
24
|
+
computedAttributes(): IWorkspaceComputedAttributesService;
|
|
24
25
|
styling(): IWorkspaceStylingService;
|
|
25
26
|
catalog(): IWorkspaceCatalogFactory;
|
|
26
27
|
datasets(): IWorkspaceDatasetsService;
|
|
@@ -39,5 +40,6 @@ export declare class TigerWorkspace implements IAnalyticalWorkspace {
|
|
|
39
40
|
genAI(): IGenAIService;
|
|
40
41
|
references(): IReferencesService;
|
|
41
42
|
exportTemplates(): IWorkspaceExportTemplatesService;
|
|
43
|
+
reports(): IWorkspaceReportsService;
|
|
42
44
|
}
|
|
43
45
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/backend/workspace/index.ts"],"names":[],"mappings":"AAOA,OAAO,EACH,KAAK,oBAAoB,EACzB,KAAK,4BAA4B,EACjC,KAAK,mBAAmB,EACxB,KAAK,uBAAuB,EAC5B,KAAK,iBAAiB,EACtB,KAAK,aAAa,EAClB,KAAK,kBAAkB,EACvB,KAAK,8BAA8B,EACnC,KAAK,uBAAuB,EAC5B,KAAK,2BAA2B,EAChC,KAAK,2BAA2B,EAChC,KAAK,wBAAwB,EAC7B,KAAK,2BAA2B,EAChC,KAAK,yBAAyB,EAC9B,KAAK,oBAAoB,EACzB,KAAK,0BAA0B,EAC/B,KAAK,kCAAkC,EACvC,KAAK,gCAAgC,EACrC,KAAK,sBAAsB,EAC3B,KAAK,yBAAyB,EAC9B,KAAK,kCAAkC,EACvC,KAAK,6BAA6B,EAClC,KAAK,yBAAyB,EAC9B,KAAK,kCAAkC,EACvC,KAAK,2BAA2B,EAChC,KAAK,4BAA4B,EACjC,KAAK,yBAAyB,EAC9B,KAAK,wBAAwB,EAC7B,KAAK,yBAAyB,EAC9B,KAAK,oBAAoB,EAE5B,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EACH,KAAK,aAAa,EAClB,KAAK,cAAc,EACnB,KAAK,eAAe,EACvB,MAAM,sDAAsD,CAAC;AAG9D,OAAO,EAAE,KAAK,2BAA2B,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/backend/workspace/index.ts"],"names":[],"mappings":"AAOA,OAAO,EACH,KAAK,oBAAoB,EACzB,KAAK,4BAA4B,EACjC,KAAK,mBAAmB,EACxB,KAAK,uBAAuB,EAC5B,KAAK,iBAAiB,EACtB,KAAK,aAAa,EAClB,KAAK,kBAAkB,EACvB,KAAK,8BAA8B,EACnC,KAAK,uBAAuB,EAC5B,KAAK,2BAA2B,EAChC,KAAK,2BAA2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AAC,oBAAoB,GAAG,SAAS,CAAC,CAY3E;IAEM,UAAU,IAAI,2BAA2B,CAE/C;IAEM,SAAS,IAAI,iBAAiB,CAEpC;IAEM,QAAQ,IAAI,yBAAyB,CAE3C;IAEM,QAAQ,IAAI,yBAAyB,CAE3C;IAEM,UAAU,IAAI,2BAA2B,CAE/C;IAEM,iBAAiB,IAAI,kCAAkC,CAE7D;IAEM,QAAQ,IAAI,yBAAyB,CAE3C;IAEM,UAAU,IAAI,2BAA2B,CAE/C;IAEM,KAAK,IAAI,sBAAsB,CAErC;IAEM,kBAAkB,IAAI,mCAAmC,CAE/D;IAEM,OAAO,IAAI,wBAAwB,CAEzC;IAEM,OAAO,IAAI,wBAAwB,CAEzC;IAEM,QAAQ,IAAI,yBAAyB,CAE3C;IAEM,WAAW,IAAI,4BAA4B,CAEjD;IAEM,KAAK,IAAI,oBAAoB,CAEnC;IAEM,UAAU,IAAI,yBAAyB,CAE7C;IAEM,aAAa,IAAI,8BAA8B,CAErD;IAEM,iBAAiB,IAAI,kCAAkC,CAE7D;IAEM,iBAAiB,IAAI,uBAAuB,CAElD;IAEM,oBAAoB,IAAI,4BAA4B,CAE1D;IAEM,MAAM,IAAI,uBAAuB,CAEvC;IAEM,iBAAiB,IAAI,kCAAkC,CAE7D;IAEM,WAAW,IAAI,mBAAmB,CAExC;IAEM,YAAY,IAAI,6BAA6B,CAEnD;IAEM,WAAW,IAAI,2BAA2B,CAEhD;IAEM,KAAK,IAAI,aAAa,CAE5B;IAEM,UAAU,IAAI,kBAAkB,CAEtC;IAEM,eAAe,IAAI,gCAAgC,CAEzD;IAEM,OAAO,IAAI,wBAAwB,CAEzC;CACJ"}
|
|
@@ -10,6 +10,7 @@ import { TigerAttributeHierarchiesService } from "./attributeHierarchies/index.j
|
|
|
10
10
|
import { TigerWorkspaceAttributes } from "./attributes/index.js";
|
|
11
11
|
import { TigerWorkspaceAutomationService } from "./automations/index.js";
|
|
12
12
|
import { TigerWorkspaceCatalogFactory } from "./catalog/factory.js";
|
|
13
|
+
import { TigerWorkspaceComputedAttributes } from "./computedAttributes/index.js";
|
|
13
14
|
import { GET_OPTIMIZED_WORKSPACE_PARAMS } from "./constants.js";
|
|
14
15
|
import { TigerWorkspaceDashboards } from "./dashboards/index.js";
|
|
15
16
|
import { TigerDataFiltersService } from "./dataFilters/index.js";
|
|
@@ -28,6 +29,7 @@ import { TigerWorkspaceObjectPermissionsService } from "./objectPermissions/inde
|
|
|
28
29
|
import { TigerWorkspaceParameters } from "./parameters/index.js";
|
|
29
30
|
import { TigerWorkspacePermissionsFactory } from "./permissions/index.js";
|
|
30
31
|
import { TigerReferencesService } from "./references/index.js";
|
|
32
|
+
import { getTigerWorkspaceReportsService } from "./reports.js";
|
|
31
33
|
import { TigerWorkspaceSettings } from "./settings/index.js";
|
|
32
34
|
import { TigerWorkspaceStyling } from "./styling/index.js";
|
|
33
35
|
import { TigerWorkspaceUsersQuery } from "./users/index.js";
|
|
@@ -108,6 +110,9 @@ export class TigerWorkspace {
|
|
|
108
110
|
facts() {
|
|
109
111
|
return new TigerWorkspaceFacts(this.authCall, this.workspace);
|
|
110
112
|
}
|
|
113
|
+
computedAttributes() {
|
|
114
|
+
return new TigerWorkspaceComputedAttributes(this.authCall, this.workspace);
|
|
115
|
+
}
|
|
111
116
|
styling() {
|
|
112
117
|
return new TigerWorkspaceStyling(this.authCall, this.workspace);
|
|
113
118
|
}
|
|
@@ -162,4 +167,7 @@ export class TigerWorkspace {
|
|
|
162
167
|
exportTemplates() {
|
|
163
168
|
return new WorkspaceExportTemplatesService(this.authCall, this.workspace);
|
|
164
169
|
}
|
|
170
|
+
reports() {
|
|
171
|
+
return getTigerWorkspaceReportsService(this.workspace);
|
|
172
|
+
}
|
|
165
173
|
}
|
|
@@ -10,8 +10,6 @@ export declare class TigerWorkspaceMeasures implements IWorkspaceMeasuresService
|
|
|
10
10
|
sortDirection: "ASC" | "DESC";
|
|
11
11
|
}): Promise<IMeasureKeyDrivers>;
|
|
12
12
|
getMeasureExpressionTokens(ref: ObjRef): Promise<IMeasureExpressionToken[]>;
|
|
13
|
-
private resolveToken;
|
|
14
|
-
private resolveObjectToken;
|
|
15
13
|
createMeasure(measure: IMeasureMetadataObjectDefinition): Promise<IMeasureMetadataObject>;
|
|
16
14
|
updateMeasure(measure: IMeasureMetadataObject): Promise<IMeasureMetadataObject>;
|
|
17
15
|
updateMeasureMeta(measure: Partial<IMetadataObjectBase> & IMetadataObjectIdentity): Promise<IMeasureMetadataObject>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/backend/workspace/measures/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/backend/workspace/measures/index.ts"],"names":[],"mappings":"AAsBA,OAAO,KAAK,EACR,kBAAkB,EAClB,uBAAuB,EACvB,kBAAkB,EAClB,mBAAmB,EACnB,yBAAyB,EAC5B,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACH,KAAK,QAAQ,EACb,KAAK,sBAAsB,EAC3B,KAAK,gCAAgC,EACrC,KAAK,mBAAmB,EACxB,KAAK,uBAAuB,EAC5B,KAAK,yBAAyB,EAC9B,KAAK,MAAM,EAEd,MAAM,qBAAqB,CAAC;AAO7B,OAAO,EAAE,KAAK,2BAA2B,EAAE,MAAM,yBAAyB,CAAC;AAI3E,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAQnD,qBAAa,sBAAuB,YAAW,yBAAyB;IAEhE,OAAO,CAAC,QAAQ,CAAC,QAAQ;aACT,SAAS,EAAE,MAAM;IAFrC,YACqB,QAAQ,EAAE,2BAA2B,EACtC,SAAS,EAAE,MAAM,EACjC;IAES,iBAAiB,CAC1B,OAAO,EAAE,QAAQ,EACjB,OAAO,CAAC,EAAE;QAAE,aAAa,EAAE,KAAK,GAAG,MAAM,CAAA;KAAE,GAC5C,OAAO,CAAC,kBAAkB,CAAC,CAwC7B;IAEY,0BAA0B,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,uBAAuB,EAAE,CAAC,CA2BvF;IAEK,aAAa,CAAC,OAAO,EAAE,gCAAgC,GAAG,OAAO,CAAC,sBAAsB,CAAC,CAgB9F;IAEK,aAAa,CAAC,OAAO,EAAE,sBAAsB,GAAG,OAAO,CAAC,sBAAsB,CAAC,CAkBpF;IAEK,iBAAiB,CACnB,OAAO,EAAE,OAAO,CAAC,mBAAmB,CAAC,GAAG,uBAAuB,GAChE,OAAO,CAAC,sBAAsB,CAAC,CA2BjC;IAEK,gBAAgB,CAAC,GAAG,EAAE,MAAM,EAAE,aAAa,CAAC,EAAE,yBAAyB,GAAG,OAAO,CAAC,IAAI,CAAC,CAY5F;IAEK,aAAa,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CASrD;IAEM,4BAA4B,gDAqCjC;IAEK,gBAAgB,IAAI,aAAa,CAEvC;IAEY,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,GAAE,kBAAuB,GAAG,OAAO,CAAC,sBAAsB,CAAC,CAWtG;IAEY,sBAAsB,CAAC,UAAU,EAAE,QAAQ,EAAE,WAAW,CAAC,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAuBrG;CACJ"}
|
|
@@ -4,14 +4,14 @@ import { ActionsApi_SetCertification } from "@gooddata/api-client-tiger/endpoint
|
|
|
4
4
|
import { EntitiesApi_CreateEntityMetrics, EntitiesApi_DeleteEntityMetrics, EntitiesApi_GetAllEntitiesMetrics, EntitiesApi_GetAllEntitiesVisualizationObjects, EntitiesApi_GetEntityMetrics, EntitiesApi_PatchEntityMetrics, EntitiesApi_UpdateEntityMetrics, } from "@gooddata/api-client-tiger/endpoints/entitiesObjects";
|
|
5
5
|
import { SmartFunctionsApi_KeyDriverAnalysis, SmartFunctionsApi_KeyDriverAnalysisResult, } from "@gooddata/api-client-tiger/endpoints/smartFunctions";
|
|
6
6
|
import { ActionsApi_ComputeValidObjects } from "@gooddata/api-client-tiger/endpoints/validObjects";
|
|
7
|
-
import {
|
|
7
|
+
import { isIdentifierRef, } from "@gooddata/sdk-model";
|
|
8
8
|
import { visualizationObjectsItemToInsight } from "../../../convertors/fromBackend/InsightConverter.js";
|
|
9
9
|
import { convertMetricFromBackend } from "../../../convertors/fromBackend/MetricConverter.js";
|
|
10
10
|
import { jsonApiIdToObjRef } from "../../../convertors/fromBackend/ObjRefConverter.js";
|
|
11
11
|
import { convertMeasure } from "../../../convertors/toBackend/afm/MeasureConverter.js";
|
|
12
12
|
import { convertMetricToBackend } from "../../../convertors/toBackend/MetricConverter.js";
|
|
13
13
|
import { objRefToIdentifier } from "../../../utils/api.js";
|
|
14
|
-
import { tokenizeExpression } from "./measureExpressionTokens.js";
|
|
14
|
+
import { resolveExpressionToken, tokenizeExpression } from "./measureExpressionTokens.js";
|
|
15
15
|
import { MeasuresQuery } from "./measuresQuery.js";
|
|
16
16
|
const findDimensionality = (dims, attributeId) => dims.find((dimensionality) => dimensionality.attribute.id === attributeId);
|
|
17
17
|
export class TigerWorkspaceMeasures {
|
|
@@ -52,52 +52,20 @@ export class TigerWorkspaceMeasures {
|
|
|
52
52
|
const metricMetadata = await this.authCall((client) => EntitiesApi_GetEntityMetrics(client.axios, client.basePath, {
|
|
53
53
|
objectId: ref.identifier,
|
|
54
54
|
workspaceId: this.workspace,
|
|
55
|
-
include: [
|
|
55
|
+
include: [
|
|
56
|
+
"facts",
|
|
57
|
+
"metrics",
|
|
58
|
+
"attributes",
|
|
59
|
+
"labels",
|
|
60
|
+
"datasets",
|
|
61
|
+
"parameters",
|
|
62
|
+
"computedAttributes",
|
|
63
|
+
],
|
|
56
64
|
}));
|
|
57
65
|
const metric = metricMetadata.data;
|
|
58
66
|
const maql = metric.data.attributes.content.maql || "";
|
|
59
67
|
const regexTokens = tokenizeExpression(maql);
|
|
60
|
-
return regexTokens.map((regexToken) =>
|
|
61
|
-
}
|
|
62
|
-
resolveToken(regexToken, metric) {
|
|
63
|
-
if (regexToken.type === "text" ||
|
|
64
|
-
regexToken.type === "quoted_text" ||
|
|
65
|
-
regexToken.type === "comment" ||
|
|
66
|
-
regexToken.type === "number" ||
|
|
67
|
-
regexToken.type === "bracket") {
|
|
68
|
-
return { type: regexToken.type, value: regexToken.value };
|
|
69
|
-
}
|
|
70
|
-
const [type, id] = regexToken.value.split("/");
|
|
71
|
-
if (type === "metric" ||
|
|
72
|
-
type === "fact" ||
|
|
73
|
-
type === "attribute" ||
|
|
74
|
-
type === "label" ||
|
|
75
|
-
type === "dataset" ||
|
|
76
|
-
type === "parameter") {
|
|
77
|
-
return this.resolveObjectToken(id, type, metric.included || [], metric.data.id);
|
|
78
|
-
}
|
|
79
|
-
throw new Error(`Cannot resolve title of object type ${type}`);
|
|
80
|
-
}
|
|
81
|
-
resolveObjectToken(objectId, objectType, includedObjects, identifier) {
|
|
82
|
-
const includedObject = includedObjects.find((includedObject) => {
|
|
83
|
-
return includedObject.id === objectId && includedObject.type === objectType;
|
|
84
|
-
});
|
|
85
|
-
const typeMapping = {
|
|
86
|
-
metric: "measure",
|
|
87
|
-
fact: "fact",
|
|
88
|
-
attribute: "attribute",
|
|
89
|
-
label: "attribute",
|
|
90
|
-
dataset: "dataSet",
|
|
91
|
-
parameter: "parameter",
|
|
92
|
-
};
|
|
93
|
-
const value = includedObject?.attributes?.title || `${objectType}/${objectId}`;
|
|
94
|
-
const token = {
|
|
95
|
-
type: typeMapping[objectType],
|
|
96
|
-
value,
|
|
97
|
-
id: objectId,
|
|
98
|
-
ref: idRef(identifier),
|
|
99
|
-
};
|
|
100
|
-
return token;
|
|
68
|
+
return regexTokens.map((regexToken) => resolveExpressionToken(regexToken, metric.included ?? [], metric.data.id));
|
|
101
69
|
}
|
|
102
70
|
async createMeasure(measure) {
|
|
103
71
|
const metricAttributes = convertMetricToBackend(measure);
|
|
@@ -1,7 +1,20 @@
|
|
|
1
|
-
|
|
1
|
+
import { type IMeasureExpressionToken } from "@gooddata/sdk-backend-spi";
|
|
2
|
+
export type ExpressionTokenType = "text" | "quoted_text" | "number" | "bracket" | "fact" | "metric" | "attribute" | "computed_attribute" | "label" | "dataset" | "parameter" | "comment";
|
|
2
3
|
export interface IExpressionToken {
|
|
3
4
|
type: ExpressionTokenType;
|
|
4
5
|
value: string;
|
|
5
6
|
}
|
|
6
7
|
export declare const tokenizeExpression: (expression: string) => IExpressionToken[];
|
|
8
|
+
/**
|
|
9
|
+
* Resolves one tokenized MAQL fragment into a display token: a referenced object becomes the title
|
|
10
|
+
* of the included object it points at, everything else stays verbatim.
|
|
11
|
+
*
|
|
12
|
+
* Shared by metrics and computed attributes - both are MAQL expressions whose references are
|
|
13
|
+
* resolved from the same `included` payload.
|
|
14
|
+
*
|
|
15
|
+
* @param regexToken - one token out of {@link tokenizeExpression}
|
|
16
|
+
* @param included - the `included` array of the entity the expression belongs to
|
|
17
|
+
* @param identifier - id of the entity the expression belongs to
|
|
18
|
+
*/
|
|
19
|
+
export declare function resolveExpressionToken(regexToken: IExpressionToken, included: ReadonlyArray<any>, identifier: string): IMeasureExpressionToken;
|
|
7
20
|
//# sourceMappingURL=measureExpressionTokens.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"measureExpressionTokens.d.ts","sourceRoot":"","sources":["../../../../src/backend/workspace/measures/measureExpressionTokens.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,mBAAmB,GACzB,MAAM,GACN,aAAa,GACb,QAAQ,GACR,SAAS,GACT,MAAM,GACN,QAAQ,GACR,WAAW,GACX,OAAO,GACP,SAAS,GACT,WAAW,GACX,SAAS,CAAC;AAEhB,MAAM,WAAW,gBAAgB;IAC7B,IAAI,EAAE,mBAAmB,CAAC;IAC1B,KAAK,EAAE,MAAM,CAAC;CACjB;
|
|
1
|
+
{"version":3,"file":"measureExpressionTokens.d.ts","sourceRoot":"","sources":["../../../../src/backend/workspace/measures/measureExpressionTokens.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAGzE,MAAM,MAAM,mBAAmB,GACzB,MAAM,GACN,aAAa,GACb,QAAQ,GACR,SAAS,GACT,MAAM,GACN,QAAQ,GACR,WAAW,GACX,oBAAoB,GACpB,OAAO,GACP,SAAS,GACT,WAAW,GACX,SAAS,CAAC;AAEhB,MAAM,WAAW,gBAAgB;IAC7B,IAAI,EAAE,mBAAmB,CAAC;IAC1B,KAAK,EAAE,MAAM,CAAC;CACjB;AAoBD,eAAO,MAAM,kBAAkB,4CA2B9B,CAAC;AAgCF;;;;;;;;;;GAUG;AACH,wBAAgB,sBAAsB,CAClC,UAAU,EAAE,gBAAgB,EAC5B,QAAQ,EAAE,aAAa,CAAC,GAAG,CAAC,EAC5B,UAAU,EAAE,MAAM,GACnB,uBAAuB,CA0BzB"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
// (C) 2019-2026 GoodData Corporation
|
|
2
|
+
import { idRef } from "@gooddata/sdk-model";
|
|
2
3
|
const REMOVE_BRACKETS_REGEXP = /[[\]{}]/g;
|
|
3
4
|
const TOKEN_TYPE_REGEXP_PAIRS = [
|
|
4
5
|
["text", /^[^#{}[\]"()0-9.]+/],
|
|
@@ -9,6 +10,9 @@ const TOKEN_TYPE_REGEXP_PAIRS = [
|
|
|
9
10
|
["metric", /^\{metric\/[^}]*\}/],
|
|
10
11
|
["label", /^\{label\/[^}]*\}/],
|
|
11
12
|
["attribute", /^\{attribute\/[^}]*\}/],
|
|
13
|
+
// computed attributes can be referenced from a metric and from another computed attribute; the
|
|
14
|
+
// brace-delimited patterns are distinct literals, so the order among them does not matter
|
|
15
|
+
["computed_attribute", /^\{computed_attribute\/[^}]*\}/],
|
|
12
16
|
["dataset", /^\{dataset\/[^}]*\}/],
|
|
13
17
|
["parameter", /^\{parameter\/[^}]*\}/],
|
|
14
18
|
["comment", /#[^\n]*/],
|
|
@@ -36,3 +40,59 @@ export const tokenizeExpression = (expression) => {
|
|
|
36
40
|
value: token.type === "comment" ? token.value : token.value.replace(REMOVE_BRACKETS_REGEXP, ""),
|
|
37
41
|
}));
|
|
38
42
|
};
|
|
43
|
+
/**
|
|
44
|
+
* MAQL object types that can be resolved to a title, mapped to the JSON:API type of the included
|
|
45
|
+
* object that carries it. They coincide for everything except a computed attribute, whose MAQL
|
|
46
|
+
* token is snake_case while its entity type is camelCase.
|
|
47
|
+
*/
|
|
48
|
+
const INCLUDED_TYPE_BY_TOKEN_TYPE = {
|
|
49
|
+
metric: "metric",
|
|
50
|
+
fact: "fact",
|
|
51
|
+
attribute: "attribute",
|
|
52
|
+
label: "label",
|
|
53
|
+
dataset: "dataset",
|
|
54
|
+
parameter: "parameter",
|
|
55
|
+
computed_attribute: "computedAttribute",
|
|
56
|
+
};
|
|
57
|
+
const OBJECT_TYPE_BY_TOKEN_TYPE = {
|
|
58
|
+
metric: "measure",
|
|
59
|
+
fact: "fact",
|
|
60
|
+
attribute: "attribute",
|
|
61
|
+
label: "attribute",
|
|
62
|
+
dataset: "dataSet",
|
|
63
|
+
parameter: "parameter",
|
|
64
|
+
computed_attribute: "computedAttribute",
|
|
65
|
+
};
|
|
66
|
+
const isResolvableTokenType = (type) => Object.hasOwn(INCLUDED_TYPE_BY_TOKEN_TYPE, type);
|
|
67
|
+
/**
|
|
68
|
+
* Resolves one tokenized MAQL fragment into a display token: a referenced object becomes the title
|
|
69
|
+
* of the included object it points at, everything else stays verbatim.
|
|
70
|
+
*
|
|
71
|
+
* Shared by metrics and computed attributes - both are MAQL expressions whose references are
|
|
72
|
+
* resolved from the same `included` payload.
|
|
73
|
+
*
|
|
74
|
+
* @param regexToken - one token out of {@link tokenizeExpression}
|
|
75
|
+
* @param included - the `included` array of the entity the expression belongs to
|
|
76
|
+
* @param identifier - id of the entity the expression belongs to
|
|
77
|
+
*/
|
|
78
|
+
export function resolveExpressionToken(regexToken, included, identifier) {
|
|
79
|
+
if (regexToken.type === "text" ||
|
|
80
|
+
regexToken.type === "quoted_text" ||
|
|
81
|
+
regexToken.type === "comment" ||
|
|
82
|
+
regexToken.type === "number" ||
|
|
83
|
+
regexToken.type === "bracket") {
|
|
84
|
+
return { type: regexToken.type, value: regexToken.value };
|
|
85
|
+
}
|
|
86
|
+
const [tokenType, objectId] = regexToken.value.split("/");
|
|
87
|
+
if (!isResolvableTokenType(tokenType)) {
|
|
88
|
+
throw new Error(`Cannot resolve title of object type ${tokenType}`);
|
|
89
|
+
}
|
|
90
|
+
const includedType = INCLUDED_TYPE_BY_TOKEN_TYPE[tokenType];
|
|
91
|
+
const includedObject = included.find((object) => object.id === objectId && object.type === includedType);
|
|
92
|
+
return {
|
|
93
|
+
type: OBJECT_TYPE_BY_TOKEN_TYPE[tokenType],
|
|
94
|
+
value: includedObject?.attributes?.title || `${tokenType}/${objectId}`,
|
|
95
|
+
id: objectId,
|
|
96
|
+
ref: idRef(identifier),
|
|
97
|
+
};
|
|
98
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { InMemoryWorkspaceReportsService } from "@gooddata/sdk-backend-base";
|
|
2
|
+
/**
|
|
3
|
+
* Temporary implementation used until the backend entities (reportPageLayout, reportTemplate,
|
|
4
|
+
* report) exist: serves the built-in report page layouts and persists created objects to
|
|
5
|
+
* localStorage, scoped per workspace, so a UI built on the SPI works across page reloads.
|
|
6
|
+
* Falls back to plain in-memory state where localStorage is unavailable.
|
|
7
|
+
*/
|
|
8
|
+
export declare class TigerWorkspaceReportsService extends InMemoryWorkspaceReportsService {
|
|
9
|
+
constructor(workspace: string);
|
|
10
|
+
}
|
|
11
|
+
export declare function getTigerWorkspaceReportsService(workspace: string): TigerWorkspaceReportsService;
|
|
12
|
+
//# sourceMappingURL=reports.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reports.d.ts","sourceRoot":"","sources":["../../../src/backend/workspace/reports.ts"],"names":[],"mappings":"AAEA,OAAO,EAEH,+BAA+B,EAClC,MAAM,4BAA4B,CAAC;AAsBpC;;;;;GAKG;AACH,qBAAa,4BAA6B,SAAQ,+BAA+B;IAC7E,YAAY,SAAS,EAAE,MAAM,EAE5B;CACJ;AAQD,wBAAgB,+BAA+B,CAAC,SAAS,EAAE,MAAM,GAAG,4BAA4B,CAO/F"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
// (C) 2026 GoodData Corporation
|
|
2
|
+
import { InMemoryWorkspaceReportsService, } from "@gooddata/sdk-backend-base";
|
|
3
|
+
function localStoragePersistence(workspace) {
|
|
4
|
+
// Reading the accessor itself throws a SecurityError in opaque-origin sandboxed
|
|
5
|
+
// frames and under storage-blocking privacy settings, so the probe is guarded too.
|
|
6
|
+
let storage;
|
|
7
|
+
try {
|
|
8
|
+
if (typeof localStorage === "undefined") {
|
|
9
|
+
return undefined;
|
|
10
|
+
}
|
|
11
|
+
storage = localStorage;
|
|
12
|
+
}
|
|
13
|
+
catch {
|
|
14
|
+
return undefined;
|
|
15
|
+
}
|
|
16
|
+
const key = `gd.reports.${workspace}`;
|
|
17
|
+
return {
|
|
18
|
+
load: () => storage.getItem(key),
|
|
19
|
+
save: (value) => storage.setItem(key, value),
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Temporary implementation used until the backend entities (reportPageLayout, reportTemplate,
|
|
24
|
+
* report) exist: serves the built-in report page layouts and persists created objects to
|
|
25
|
+
* localStorage, scoped per workspace, so a UI built on the SPI works across page reloads.
|
|
26
|
+
* Falls back to plain in-memory state where localStorage is unavailable.
|
|
27
|
+
*/
|
|
28
|
+
export class TigerWorkspaceReportsService extends InMemoryWorkspaceReportsService {
|
|
29
|
+
constructor(workspace) {
|
|
30
|
+
super(localStoragePersistence(workspace));
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
// One service instance per workspace for the process lifetime. With localStorage the
|
|
34
|
+
// service reads persisted state through on every operation, so instances converge even
|
|
35
|
+
// across tabs; the cache only matters where no storage exists (node), and there the
|
|
36
|
+
// state is per-process scratch data for development, not tenant data.
|
|
37
|
+
const servicesByWorkspace = new Map();
|
|
38
|
+
export function getTigerWorkspaceReportsService(workspace) {
|
|
39
|
+
let service = servicesByWorkspace.get(workspace);
|
|
40
|
+
if (!service) {
|
|
41
|
+
service = new TigerWorkspaceReportsService(workspace);
|
|
42
|
+
servicesByWorkspace.set(workspace, service);
|
|
43
|
+
}
|
|
44
|
+
return service;
|
|
45
|
+
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { type JsonApiAttributeOutWithLinks, type JsonApiComputedAttributeOutIncludes, type JsonApiDatasetOutWithLinks, type JsonApiFactOutWithLinks, type JsonApiLabelOutWithLinks, type JsonApiMetricOutWithLinks } from "@gooddata/api-client-tiger";
|
|
2
|
-
import { type ICatalogAttribute, type ICatalogDateAttribute, type ICatalogDateDataset, type ICatalogFact, type ICatalogMeasure } from "@gooddata/sdk-model";
|
|
1
|
+
import { type JsonApiAttributeOutWithLinks, type JsonApiComputedAttributeOutIncludes, type JsonApiComputedAttributeOutWithLinks, type JsonApiDatasetOutWithLinks, type JsonApiFactOutWithLinks, type JsonApiLabelOutWithLinks, type JsonApiMetricOutWithLinks } from "@gooddata/api-client-tiger";
|
|
2
|
+
import { type ICatalogAttribute, type ICatalogComputedAttribute, type ICatalogDateAttribute, type ICatalogDateDataset, type ICatalogFact, type ICatalogMeasure } from "@gooddata/sdk-model";
|
|
3
3
|
export declare const convertAttribute: (attribute: JsonApiAttributeOutWithLinks, defaultLabel: JsonApiLabelOutWithLinks, geoLabels: JsonApiLabelOutWithLinks[], allLabels: JsonApiLabelOutWithLinks[], dataSet?: JsonApiDatasetOutWithLinks | undefined) => ICatalogAttribute;
|
|
4
4
|
export declare const convertMeasure: (measure: JsonApiMetricOutWithLinks, included?: JsonApiComputedAttributeOutIncludes[]) => ICatalogMeasure;
|
|
5
|
+
export declare const convertComputedAttributeToCatalogItem: (computedAttribute: JsonApiComputedAttributeOutWithLinks, included?: JsonApiComputedAttributeOutIncludes[]) => ICatalogComputedAttribute;
|
|
5
6
|
export declare const convertFact: (fact: JsonApiFactOutWithLinks) => ICatalogFact;
|
|
6
7
|
export declare const convertDateAttribute: (attribute: JsonApiAttributeOutWithLinks, label: JsonApiLabelOutWithLinks, allLabels: JsonApiLabelOutWithLinks[]) => ICatalogDateAttribute;
|
|
7
8
|
export declare const convertDateDataset: (dataset: JsonApiDatasetOutWithLinks, attributes: ICatalogDateAttribute[]) => ICatalogDateDataset;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CatalogConverter.d.ts","sourceRoot":"","sources":["../../../src/convertors/fromBackend/CatalogConverter.ts"],"names":[],"mappings":"AAEA,OAAO,EACH,KAAK,4BAA4B,EACjC,KAAK,mCAAmC,EACxC,KAAK,0BAA0B,EAC/B,KAAK,uBAAuB,EAC5B,KAAK,wBAAwB,EAC7B,KAAK,yBAAyB,EACjC,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"CatalogConverter.d.ts","sourceRoot":"","sources":["../../../src/convertors/fromBackend/CatalogConverter.ts"],"names":[],"mappings":"AAEA,OAAO,EACH,KAAK,4BAA4B,EACjC,KAAK,mCAAmC,EACxC,KAAK,oCAAoC,EACzC,KAAK,0BAA0B,EAC/B,KAAK,uBAAuB,EAC5B,KAAK,wBAAwB,EAC7B,KAAK,yBAAyB,EACjC,MAAM,4BAA4B,CAAC;AAYpC,OAAO,EAEH,KAAK,iBAAiB,EACtB,KAAK,yBAAyB,EAC9B,KAAK,qBAAqB,EAC1B,KAAK,mBAAmB,EACxB,KAAK,YAAY,EACjB,KAAK,eAAe,EAKvB,MAAM,qBAAqB,CAAC;AAoC7B,eAAO,MAAM,gBAAgB,wOA8B5B,CAAC;AAEF,eAAO,MAAM,cAAc,2GAyB1B,CAAC;AAEF,eAAO,MAAM,qCAAqC,0IAajD,CAAC;AAEF,eAAO,MAAM,WAAW,iDAMvB,CAAC;AAEF,eAAO,MAAM,oBAAoB,4IAkBhC,CAAC;AAEF,eAAO,MAAM,kBAAkB,mGAkB9B,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// (C) 2019-2026 GoodData Corporation
|
|
2
|
-
import { newAttributeDisplayFormMetadataObject, newCatalogAttribute, newCatalogDateAttribute, newCatalogDateDataset, newCatalogFact, newCatalogMeasure, } from "@gooddata/sdk-backend-base";
|
|
2
|
+
import { newAttributeDisplayFormMetadataObject, newCatalogAttribute, newCatalogComputedAttribute, newCatalogDateAttribute, newCatalogDateDataset, newCatalogFact, newCatalogMeasure, } from "@gooddata/sdk-backend-base";
|
|
3
3
|
import { idRef, } from "@gooddata/sdk-model";
|
|
4
|
+
import { convertComputedAttributeFromBackend } from "./ComputedAttributeConverter.js";
|
|
4
5
|
import { convertDataSetItem } from "./DataSetConverter.js";
|
|
5
6
|
import { toSdkGranularity } from "./dateGranularityConversions.js";
|
|
6
7
|
import { convertLabelType } from "./LabelTypeConverter.js";
|
|
@@ -59,6 +60,14 @@ export const convertMeasure = (measure, included = []) => {
|
|
|
59
60
|
.updatedBy(convertUserIdentifier(measure.relationships?.modifiedBy, included)))
|
|
60
61
|
.modify(commonGroupableCatalogItemModifications(measure)));
|
|
61
62
|
};
|
|
63
|
+
export const convertComputedAttributeToCatalogItem = (computedAttribute, included = []) => {
|
|
64
|
+
const metadataObject = convertComputedAttributeFromBackend(computedAttribute, included);
|
|
65
|
+
return newCatalogComputedAttribute((catalogCa) => catalogCa
|
|
66
|
+
.computedAttribute(metadataObject)
|
|
67
|
+
.defaultDisplayForm(metadataObject.displayForms[0])
|
|
68
|
+
.displayForms(metadataObject.displayForms)
|
|
69
|
+
.modify(commonGroupableCatalogItemModifications(computedAttribute)));
|
|
70
|
+
};
|
|
62
71
|
export const convertFact = (fact) => {
|
|
63
72
|
return newCatalogFact((catalogF) => catalogF
|
|
64
73
|
.fact(idRef(fact.id, "fact"), (f) => f.modify(commonMetadataObjectModifications(fact)))
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type JsonApiComputedAttributeOutDocument, type JsonApiComputedAttributeOutIncludes, type JsonApiComputedAttributeOutList, type JsonApiComputedAttributeOutWithLinks } from "@gooddata/api-client-tiger";
|
|
2
|
+
import { type IAttributeDisplayFormMetadataObject, type IComputedAttributeMetadataObject } from "@gooddata/sdk-model";
|
|
3
|
+
/**
|
|
4
|
+
* Fabricates the single display form of a computed attribute.
|
|
5
|
+
*
|
|
6
|
+
* A computed attribute has no real labels on the backend. To mimic the structure of a normal
|
|
7
|
+
* attribute (and thus be usable in the same UI places), exactly one display form is fabricated
|
|
8
|
+
* client-side: it shares the id and title with the computed attribute itself.
|
|
9
|
+
*/
|
|
10
|
+
export declare function fabricateComputedAttributeDisplayForm(id: string, title: string, description: string): IAttributeDisplayFormMetadataObject;
|
|
11
|
+
export declare function convertComputedAttributeFromBackend(data: JsonApiComputedAttributeOutDocument | JsonApiComputedAttributeOutWithLinks, included?: JsonApiComputedAttributeOutIncludes[]): IComputedAttributeMetadataObject;
|
|
12
|
+
export declare function convertComputedAttributesWithLinks(list: JsonApiComputedAttributeOutList): IComputedAttributeMetadataObject[];
|
|
13
|
+
//# sourceMappingURL=ComputedAttributeConverter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ComputedAttributeConverter.d.ts","sourceRoot":"","sources":["../../../src/convertors/fromBackend/ComputedAttributeConverter.ts"],"names":[],"mappings":"AAEA,OAAO,EAEH,KAAK,mCAAmC,EACxC,KAAK,mCAAmC,EACxC,KAAK,+BAA+B,EACpC,KAAK,oCAAoC,EAC5C,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACH,KAAK,mCAAmC,EACxC,KAAK,gCAAgC,EAExC,MAAM,qBAAqB,CAAC;AAM7B;;;;;;GAMG;AACH,wBAAgB,qCAAqC,CACjD,EAAE,EAAE,MAAM,EACV,KAAK,EAAE,MAAM,EACb,WAAW,EAAE,MAAM,GACpB,mCAAmC,CAmBrC;AAMD,wBAAgB,mCAAmC,CAC/C,IAAI,EAAE,mCAAmC,GAAG,oCAAoC,EAChF,QAAQ,GAAE,mCAAmC,EAAO,GACrD,gCAAgC,CAoClC;AAED,wBAAgB,kCAAkC,CAC9C,IAAI,EAAE,+BAA+B,GACtC,gCAAgC,EAAE,CAEpC"}
|