@gooddata/sdk-backend-tiger 11.54.0-alpha.4 → 11.54.0-alpha.6
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 +17 -0
- package/esm/backend/workspace/computedAttributes/index.d.ts.map +1 -0
- package/esm/backend/workspace/computedAttributes/index.js +120 -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 +2 -1
- package/esm/backend/workspace/index.d.ts.map +1 -1
- package/esm/backend/workspace/index.js +4 -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/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/sdk-backend-tiger.d.ts +2 -1
- package/esm/types/index.d.ts +1 -1
- package/esm/types/index.d.ts.map +1 -1
- package/esm/types/refTypeMapping.d.ts +2 -1
- package/esm/types/refTypeMapping.d.ts.map +1 -1
- package/esm/types/refTypeMapping.js +3 -0
- package/package.json +12 -11
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
// (C) 2026 GoodData Corporation
|
|
2
|
+
import { EntitiesApi_CreateEntityComputedAttributes, EntitiesApi_DeleteEntityComputedAttributes, EntitiesApi_GetEntityComputedAttributes, EntitiesApi_PatchEntityComputedAttributes, EntitiesApi_UpdateEntityComputedAttributes, } from "@gooddata/api-client-tiger/endpoints/entitiesObjects";
|
|
3
|
+
import { isIdentifierRef, } from "@gooddata/sdk-model";
|
|
4
|
+
import { convertComputedAttributeFromBackend } from "../../../convertors/fromBackend/ComputedAttributeConverter.js";
|
|
5
|
+
import { convertComputedAttributeToBackend } from "../../../convertors/toBackend/ComputedAttributeConverter.js";
|
|
6
|
+
import { objRefToIdentifier } from "../../../utils/api.js";
|
|
7
|
+
import { resolveExpressionToken, tokenizeExpression } from "../measures/measureExpressionTokens.js";
|
|
8
|
+
import { ComputedAttributesQuery } from "./computedAttributesQuery.js";
|
|
9
|
+
export class TigerWorkspaceComputedAttributes {
|
|
10
|
+
authCall;
|
|
11
|
+
workspace;
|
|
12
|
+
constructor(authCall, workspace) {
|
|
13
|
+
this.authCall = authCall;
|
|
14
|
+
this.workspace = workspace;
|
|
15
|
+
}
|
|
16
|
+
async createComputedAttribute(computedAttribute) {
|
|
17
|
+
const attributes = convertComputedAttributeToBackend(computedAttribute);
|
|
18
|
+
const result = await this.authCall((client) => {
|
|
19
|
+
return EntitiesApi_CreateEntityComputedAttributes(client.axios, client.basePath, {
|
|
20
|
+
workspaceId: this.workspace,
|
|
21
|
+
jsonApiComputedAttributePostOptionalIdDocument: {
|
|
22
|
+
data: {
|
|
23
|
+
id: computedAttribute.id,
|
|
24
|
+
type: "computedAttribute",
|
|
25
|
+
attributes,
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
return convertComputedAttributeFromBackend(result.data, result.data.included);
|
|
31
|
+
}
|
|
32
|
+
async updateComputedAttribute(computedAttribute) {
|
|
33
|
+
const objectId = objRefToIdentifier(computedAttribute.ref, this.authCall);
|
|
34
|
+
const attributes = convertComputedAttributeToBackend(computedAttribute);
|
|
35
|
+
const result = await this.authCall((client) => {
|
|
36
|
+
return EntitiesApi_UpdateEntityComputedAttributes(client.axios, client.basePath, {
|
|
37
|
+
objectId,
|
|
38
|
+
workspaceId: this.workspace,
|
|
39
|
+
jsonApiComputedAttributeInDocument: {
|
|
40
|
+
data: {
|
|
41
|
+
id: objectId,
|
|
42
|
+
type: "computedAttribute",
|
|
43
|
+
attributes,
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
});
|
|
47
|
+
});
|
|
48
|
+
return convertComputedAttributeFromBackend(result.data, result.data.included);
|
|
49
|
+
}
|
|
50
|
+
async updateComputedAttributeMeta(computedAttribute) {
|
|
51
|
+
const objectId = objRefToIdentifier(computedAttribute.ref, this.authCall);
|
|
52
|
+
const result = await this.authCall((client) => {
|
|
53
|
+
return EntitiesApi_PatchEntityComputedAttributes(client.axios, client.basePath, {
|
|
54
|
+
objectId,
|
|
55
|
+
workspaceId: this.workspace,
|
|
56
|
+
jsonApiComputedAttributePatchDocument: {
|
|
57
|
+
data: {
|
|
58
|
+
id: objectId,
|
|
59
|
+
type: "computedAttribute",
|
|
60
|
+
attributes: {
|
|
61
|
+
...(computedAttribute.title === undefined
|
|
62
|
+
? {}
|
|
63
|
+
: { title: computedAttribute.title }),
|
|
64
|
+
...(computedAttribute.description === undefined
|
|
65
|
+
? {}
|
|
66
|
+
: { description: computedAttribute.description }),
|
|
67
|
+
...(computedAttribute.tags === undefined ? {} : { tags: computedAttribute.tags }),
|
|
68
|
+
...(computedAttribute.isHidden === undefined
|
|
69
|
+
? {}
|
|
70
|
+
: { isHidden: computedAttribute.isHidden }),
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
});
|
|
75
|
+
});
|
|
76
|
+
return convertComputedAttributeFromBackend(result.data, result.data.included);
|
|
77
|
+
}
|
|
78
|
+
async deleteComputedAttribute(ref) {
|
|
79
|
+
const objectId = objRefToIdentifier(ref, this.authCall);
|
|
80
|
+
await this.authCall((client) => {
|
|
81
|
+
return EntitiesApi_DeleteEntityComputedAttributes(client.axios, client.basePath, {
|
|
82
|
+
objectId,
|
|
83
|
+
workspaceId: this.workspace,
|
|
84
|
+
});
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
async getComputedAttribute(ref, options = {}) {
|
|
88
|
+
const id = objRefToIdentifier(ref, this.authCall);
|
|
89
|
+
const result = await this.authCall((client) => EntitiesApi_GetEntityComputedAttributes(client.axios, client.basePath, {
|
|
90
|
+
objectId: id,
|
|
91
|
+
workspaceId: this.workspace,
|
|
92
|
+
include: options.loadUserData ? ["createdBy", "modifiedBy"] : [],
|
|
93
|
+
}));
|
|
94
|
+
return convertComputedAttributeFromBackend(result.data, result.data.included);
|
|
95
|
+
}
|
|
96
|
+
async getComputedAttributeExpressionTokens(ref) {
|
|
97
|
+
if (!isIdentifierRef(ref)) {
|
|
98
|
+
throw new Error("only identifiers supported");
|
|
99
|
+
}
|
|
100
|
+
const result = await this.authCall((client) => EntitiesApi_GetEntityComputedAttributes(client.axios, client.basePath, {
|
|
101
|
+
objectId: ref.identifier,
|
|
102
|
+
workspaceId: this.workspace,
|
|
103
|
+
include: [
|
|
104
|
+
"facts",
|
|
105
|
+
"metrics",
|
|
106
|
+
"attributes",
|
|
107
|
+
"labels",
|
|
108
|
+
"datasets",
|
|
109
|
+
"parameters",
|
|
110
|
+
"computedAttributes",
|
|
111
|
+
],
|
|
112
|
+
}));
|
|
113
|
+
const computedAttribute = result.data;
|
|
114
|
+
const maql = computedAttribute.data.attributes.content.maql || "";
|
|
115
|
+
return tokenizeExpression(maql).map((regexToken) => resolveExpressionToken(regexToken, computedAttribute.included ?? [], computedAttribute.data.id));
|
|
116
|
+
}
|
|
117
|
+
getComputedAttributesQuery() {
|
|
118
|
+
return new ComputedAttributesQuery(this.authCall, { workspaceId: this.workspace });
|
|
119
|
+
}
|
|
120
|
+
}
|
|
@@ -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,2BAA2B,EACrC,WAAW,EAAE,MAAM,EACnB,cAAc,EAAE,cAAc,EAC9B,OAAO,GAAE;QAAE,SAAS,CAAC,EAAE,O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,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,EAC1B,KAAK,2BAA2B,EAChC,KAAK,iCAAiC,EACtC,KAAK,uBAAuB,EAC5B,KAAK,4BAA4B,EACjC,KAAK,kBAA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BAA4B,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 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;
|
|
@@ -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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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;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";
|
|
@@ -108,6 +109,9 @@ export class TigerWorkspace {
|
|
|
108
109
|
facts() {
|
|
109
110
|
return new TigerWorkspaceFacts(this.authCall, this.workspace);
|
|
110
111
|
}
|
|
112
|
+
computedAttributes() {
|
|
113
|
+
return new TigerWorkspaceComputedAttributes(this.authCall, this.workspace);
|
|
114
|
+
}
|
|
111
115
|
styling() {
|
|
112
116
|
return new TigerWorkspaceStyling(this.authCall, this.workspace);
|
|
113
117
|
}
|
|
@@ -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;aAC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Api_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
|
+
}
|
|
@@ -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"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
// (C) 2026 GoodData Corporation
|
|
2
|
+
import { idRef, } from "@gooddata/sdk-model";
|
|
3
|
+
import { convertCertificationFromBackend } from "./CertificationConverter.js";
|
|
4
|
+
import { isInheritedObject } from "./ObjectInheritance.js";
|
|
5
|
+
import { convertUserIdentifier } from "./UsersConverter.js";
|
|
6
|
+
/**
|
|
7
|
+
* Fabricates the single display form of a computed attribute.
|
|
8
|
+
*
|
|
9
|
+
* A computed attribute has no real labels on the backend. To mimic the structure of a normal
|
|
10
|
+
* attribute (and thus be usable in the same UI places), exactly one display form is fabricated
|
|
11
|
+
* client-side: it shares the id and title with the computed attribute itself.
|
|
12
|
+
*/
|
|
13
|
+
export function fabricateComputedAttributeDisplayForm(id, title, description) {
|
|
14
|
+
return {
|
|
15
|
+
type: "displayForm",
|
|
16
|
+
// The ref carries the COMPUTED ATTRIBUTE type, not "displayForm": this ref is what ends up
|
|
17
|
+
// in the insight and what the AFM converter turns into an object qualifier, and the backend
|
|
18
|
+
// expects an attribute item to reference a computed attribute by its own type rather than as
|
|
19
|
+
// a label (a computed attribute has no real labels).
|
|
20
|
+
ref: idRef(id, "computedAttribute"),
|
|
21
|
+
id,
|
|
22
|
+
uri: id,
|
|
23
|
+
title,
|
|
24
|
+
description,
|
|
25
|
+
production: true,
|
|
26
|
+
deprecated: false,
|
|
27
|
+
unlisted: false,
|
|
28
|
+
attribute: idRef(id, "computedAttribute"),
|
|
29
|
+
isDefault: true,
|
|
30
|
+
isPrimary: true,
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
function isJsonApiComputedAttributeOutDocument(obj) {
|
|
34
|
+
return obj.data !== undefined;
|
|
35
|
+
}
|
|
36
|
+
export function convertComputedAttributeFromBackend(data, included = []) {
|
|
37
|
+
const object = isJsonApiComputedAttributeOutDocument(data) ? data.data : data;
|
|
38
|
+
const { id, attributes, relationships } = object;
|
|
39
|
+
const title = attributes.title ?? "";
|
|
40
|
+
const description = attributes.description ?? "";
|
|
41
|
+
return {
|
|
42
|
+
type: "computedAttribute",
|
|
43
|
+
ref: idRef(id, "computedAttribute"),
|
|
44
|
+
id,
|
|
45
|
+
uri: id,
|
|
46
|
+
title,
|
|
47
|
+
description,
|
|
48
|
+
tags: attributes.tags ?? [],
|
|
49
|
+
production: true,
|
|
50
|
+
deprecated: false,
|
|
51
|
+
unlisted: false,
|
|
52
|
+
isHidden: attributes.isHidden,
|
|
53
|
+
isLocked: isInheritedObject(object),
|
|
54
|
+
expression: attributes.content.maql,
|
|
55
|
+
format: attributes.content.format ?? undefined,
|
|
56
|
+
metricType: attributes.content.metricType,
|
|
57
|
+
dataType: attributes.dataType,
|
|
58
|
+
isNullable: attributes.isNullable,
|
|
59
|
+
nullValue: attributes.nullValue,
|
|
60
|
+
locale: attributes.locale,
|
|
61
|
+
displayForms: [fabricateComputedAttributeDisplayForm(id, title, description)],
|
|
62
|
+
created: attributes.createdAt ?? undefined,
|
|
63
|
+
createdBy: convertUserIdentifier(relationships?.createdBy, included),
|
|
64
|
+
updated: attributes.modifiedAt ?? undefined,
|
|
65
|
+
updatedBy: convertUserIdentifier(relationships?.modifiedBy, included),
|
|
66
|
+
certification: convertCertificationFromBackend(attributes, convertUserIdentifier(relationships?.certifiedBy, included)),
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
export function convertComputedAttributesWithLinks(list) {
|
|
70
|
+
return list.data.map((item) => convertComputedAttributeFromBackend(item, list.included));
|
|
71
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { type JsonApiAnalyticalDashboardOutWithLinks, type JsonApiAttributeOut, type JsonApiAttributeOutDocument, type JsonApiAttributeOutList, type JsonApiAttributeOutWithLinks, type JsonApiDatasetOutWithLinks, type JsonApiFactOutDocument, type JsonApiFactOutList, type JsonApiFactOutWithLinks, type JsonApiLabelOutWithLinks, type JsonApiMetricOutList, type JsonApiMetricOutWithLinks } from "@gooddata/api-client-tiger";
|
|
1
|
+
import { type JsonApiAnalyticalDashboardOutWithLinks, type JsonApiAttributeOut, type JsonApiAttributeOutDocument, type JsonApiAttributeOutList, type JsonApiAttributeOutWithLinks, type JsonApiComputedAttributeOutWithLinks, type JsonApiDatasetOutWithLinks, type JsonApiFactOutDocument, type JsonApiFactOutList, type JsonApiFactOutWithLinks, type JsonApiLabelOutWithLinks, type JsonApiMetricOutList, type JsonApiMetricOutWithLinks } from "@gooddata/api-client-tiger";
|
|
2
2
|
import { type IMetadataObjectBuilder } from "@gooddata/sdk-backend-base";
|
|
3
3
|
import { type IAttributeDisplayFormMetadataObject, type IAttributeMetadataObject, type IDashboardMetadataObject, type IDataSetMetadataObject, type IFactMetadataObject, type IMeasureMetadataObject } from "@gooddata/sdk-model";
|
|
4
|
-
export type MetadataObjectFromApi = JsonApiAttributeOutWithLinks | JsonApiFactOutWithLinks | JsonApiMetricOutWithLinks | JsonApiLabelOutWithLinks | JsonApiDatasetOutWithLinks | JsonApiAnalyticalDashboardOutWithLinks;
|
|
4
|
+
export type MetadataObjectFromApi = JsonApiAttributeOutWithLinks | JsonApiComputedAttributeOutWithLinks | JsonApiFactOutWithLinks | JsonApiMetricOutWithLinks | JsonApiLabelOutWithLinks | JsonApiDatasetOutWithLinks | JsonApiAnalyticalDashboardOutWithLinks;
|
|
5
5
|
export declare const commonMetadataObjectModifications: <TItem extends MetadataObjectFromApi, T extends IMetadataObjectBuilder<import("@gooddata/sdk-model").IMetadataObject>>(item: TItem) => (builder: T) => T;
|
|
6
6
|
export declare function createLabelMap(included: JsonApiAttributeOutDocument["included"] | undefined): Record<string, JsonApiLabelOutWithLinks>;
|
|
7
7
|
export declare function createDataSetMap(included: JsonApiAttributeOutDocument["included"] | undefined): Record<string, JsonApiDatasetOutWithLinks>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MetadataConverter.d.ts","sourceRoot":"","sources":["../../../src/convertors/fromBackend/MetadataConverter.ts"],"names":[],"mappings":"AAIA,OAAO,EACH,KAAK,sCAAsC,EAC3C,KAAK,mBAAmB,EACxB,KAAK,2BAA2B,EAChC,KAAK,uBAAuB,EAC5B,KAAK,4BAA4B,EACjC,KAAK,0BAA0B,EAE/B,KAAK,sBAAsB,EAC3B,KAAK,kBAAkB,EACvB,KAAK,uBAAuB,EAC5B,KAAK,wBAAwB,EAC7B,KAAK,oBAAoB,EACzB,KAAK,yBAAyB,EAGjC,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACH,KAAK,sBAAsB,EAM9B,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACH,KAAK,mCAAmC,EACxC,KAAK,wBAAwB,EAC7B,KAAK,wBAAwB,EAC7B,KAAK,sBAAsB,EAC3B,KAAK,mBAAmB,EACxB,KAAK,sBAAsB,EAE9B,MAAM,qBAAqB,CAAC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wBAAwB,CAAC,GACpD,mCAAmC,EAAE,CAmBvC;AA8ED;;;;GAIG;AACH,wBAAgB,oCAAoC,CAChD,SAAS,EAAE,2BAA2B,GACvC,wBAAwB,CAK1B;AAED;;;;GAIG;AACH,wBAAgB,qCAAqC,CACjD,UAAU,EAAE,uBAAuB,GACpC,wBAAwB,EAAE,CAW5B;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,kBAAkB,GAAG,mBAAmB,EAAE,CAWtF;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,sBAAsB,GAAG,mBAAmB,CAehF;AAED;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,oBAAoB,GAAG,sBAAsB,EAAE,CAE/F;AAED;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,0BAA0B,GAAG,sBAAsB,CAInG;AAyBD;;;;GAIG;AACH,wBAAgB,mCAAmC,CAC/C,SAAS,EAAE,sCAAsC,GAClD,wBAAwB,CAI1B"}
|
|
@@ -3,7 +3,7 @@ import { type IChatConversation, type IChatConversationError, type IChatConversa
|
|
|
3
3
|
import type { FormattingLocale } from "./dateFormatting/defaultDateFormatter.js";
|
|
4
4
|
import { type DateNormalizer } from "./dateFormatting/types.js";
|
|
5
5
|
export declare function convertChatConversationFromBackend(conversation: AiConversationResponse): IChatConversation;
|
|
6
|
-
export declare function convertChatConversationItemFromBackend(item: AiConversationItemResponse, responses: AiConversationResponseList["responses"] | undefined, dateNormalizer: DateNormalizer, locale?: FormattingLocale, timezone?: string): IChatConversationItem | undefined;
|
|
6
|
+
export declare function convertChatConversationItemFromBackend(item: AiConversationItemResponse, responses: AiConversationResponseList["responses"] | undefined, history: IChatConversationItem[], dateNormalizer: DateNormalizer, locale?: FormattingLocale, timezone?: string): IChatConversationItem | undefined;
|
|
7
7
|
export declare function convertChatConversationItemsFromBackend(items: AiConversationItemResponse[], responses: AiConversationResponseList["responses"] | undefined, dateNormalizer: DateNormalizer, locale?: FormattingLocale, timezone?: string): IChatConversationItem[];
|
|
8
8
|
export declare function convertChatConversationErrorFromBackend(item: Partial<{
|
|
9
9
|
statusCode: number;
|