@gooddata/sdk-backend-tiger 11.65.0-alpha.0 → 11.65.0-alpha.10
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.d.ts.map +1 -1
- package/esm/__version.js +1 -1
- package/esm/backend/uiFeatures.js +1 -1
- package/esm/backend/workspace/attributes/elements/index.d.ts.map +1 -1
- package/esm/backend/workspace/attributes/elements/index.js +39 -2
- package/esm/backend/workspace/genAI/ChatConversations.d.ts +4 -2
- package/esm/backend/workspace/genAI/ChatConversations.d.ts.map +1 -1
- package/esm/backend/workspace/genAI/ChatConversations.js +46 -8
- package/esm/backend/workspace/genAI/index.d.ts +4 -1
- package/esm/backend/workspace/genAI/index.d.ts.map +1 -1
- package/esm/backend/workspace/genAI/index.js +35 -1
- package/esm/convertors/fromBackend/afm/dimensions.d.ts.map +1 -1
- package/esm/convertors/fromBackend/afm/dimensions.js +3 -0
- package/esm/convertors/fromBackend/attributeNumberFormat.d.ts +16 -0
- package/esm/convertors/fromBackend/attributeNumberFormat.d.ts.map +1 -0
- package/esm/convertors/fromBackend/attributeNumberFormat.js +26 -0
- package/esm/convertors/fromBackend/genAIConvertor.d.ts.map +1 -1
- package/esm/convertors/fromBackend/genAIConvertor.js +3 -0
- package/esm/convertors/fromBackend/publisherDocumentPartConvertorV2.d.ts +8 -0
- package/esm/convertors/fromBackend/publisherDocumentPartConvertorV2.d.ts.map +1 -0
- package/esm/convertors/fromBackend/publisherDocumentPartConvertorV2.js +42 -0
- package/package.json +11 -11
package/esm/__version.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const LIB_VERSION = "11.65.0-alpha.
|
|
1
|
+
export declare const LIB_VERSION = "11.65.0-alpha.10";
|
|
2
2
|
export declare const LIB_DESCRIPTION = "GoodData Backend SPI implementation for GoodData Cloud and GoodData.CN";
|
|
3
3
|
export declare const LIB_NAME = "@gooddata/sdk-backend-tiger";
|
|
4
4
|
//# sourceMappingURL=__version.d.ts.map
|
package/esm/__version.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"__version.d.ts","sourceRoot":"","sources":["../src/__version.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"__version.d.ts","sourceRoot":"","sources":["../src/__version.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,WAAW,qBAAqB,CAAC;AAE9C,eAAO,MAAM,eAAe,2EAA2E,CAAC;AAExG,eAAO,MAAM,QAAQ,gCAAgC,CAAC"}
|
package/esm/__version.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// (C) 2021 GoodData Corporation
|
|
2
2
|
// DO NOT CHANGE THIS FILE, IT IS RE-GENERATED ON EVERY BUILD
|
|
3
|
-
export const LIB_VERSION = "11.65.0-alpha.
|
|
3
|
+
export const LIB_VERSION = "11.65.0-alpha.10";
|
|
4
4
|
export const LIB_DESCRIPTION = "GoodData Backend SPI implementation for GoodData Cloud and GoodData.CN";
|
|
5
5
|
export const LIB_NAME = "@gooddata/sdk-backend-tiger";
|
|
@@ -270,7 +270,7 @@ export const DefaultFeatureFlags = {
|
|
|
270
270
|
enableGenAiReportTakeaways: false,
|
|
271
271
|
enableEmbeddingWriteCommands: false,
|
|
272
272
|
enableLocalizationOverview: false,
|
|
273
|
-
enableUserLanguageChange:
|
|
273
|
+
enableUserLanguageChange: true,
|
|
274
274
|
};
|
|
275
275
|
export const FeatureFlagsValues = {
|
|
276
276
|
enableMetricSqlAndDataExplain: [true, false],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/backend/workspace/attributes/elements/index.ts"],"names":[],"mappings":"AAaA,OAAO,EACH,KAAK,4BAA4B,EACjC,KAAK,cAAc,EAEnB,KAAK,qBAAqB,EAG1B,KAAK,oBAAoB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/backend/workspace/attributes/elements/index.ts"],"names":[],"mappings":"AAaA,OAAO,EACH,KAAK,4BAA4B,EACjC,KAAK,cAAc,EAEnB,KAAK,qBAAqB,EAG1B,KAAK,oBAAoB,EAM5B,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAQH,KAAK,MAAM,EAYd,MAAM,qBAAqB,CAAC;AAO7B,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,4DAA4D,CAAC;AAGhG,OAAO,EAAE,KAAK,2BAA2B,EAAE,MAAM,4BAA4B,CAAC;AA4D9E,qBAAa,sBAAuB,YAAW,qBAAqB;IAE5D,OAAO,CAAC,QAAQ,CAAC,QAAQ;aACT,SAAS,EAAE,MAAM;IACjC,OAAO,CAAC,QAAQ,CAAC,aAAa;IAHlC,YACqB,QAAQ,EAAE,2BAA2B,EACtC,SAAS,EAAE,MAAM,EAChB,aAAa,EAAE,aAAa,EAC7C;IAEG,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,cAAc,CAEjD;IAEM,SAAS,CAAC,MAAM,EAAE,4BAA4B,GAAG,oBAAoB,CAE3E;CACJ"}
|
|
@@ -5,6 +5,7 @@ import { InMemoryPaging, ServerPaging } from "@gooddata/sdk-backend-base";
|
|
|
5
5
|
import { NotSupported, UnexpectedError, isElementsQueryOptionsElementsByValue, isValueBasedElementsQueryOptionsElements, } from "@gooddata/sdk-backend-spi";
|
|
6
6
|
import { filterAttributeElements, filterIsEmpty, filterObjRef, isArbitraryAttributeFilter, isAttributeElementsByRef, isAttributeFilter, isAttributeFilterWithSelection, isIdentifierRef, isMatchAttributeFilter, isNegativeAttributeFilter, objRefToString, } from "@gooddata/sdk-model";
|
|
7
7
|
import { TigerCancellationConverter } from "../../../../cancelation/index.js";
|
|
8
|
+
import { attributeNumberFormat } from "../../../../convertors/fromBackend/attributeNumberFormat.js";
|
|
8
9
|
import { createDateValueFormatter } from "../../../../convertors/fromBackend/dateFormatting/dateValueFormatter.js";
|
|
9
10
|
import { createDateValueNormalizer } from "../../../../convertors/fromBackend/dateFormatting/dateValueNormalizer.js";
|
|
10
11
|
import { toSdkGranularity } from "../../../../convertors/fromBackend/dateGranularityConversions.js";
|
|
@@ -26,6 +27,36 @@ const MATCH_OPERATOR_TO_TIGER = {
|
|
|
26
27
|
function toElementsLabelType(ref) {
|
|
27
28
|
return isIdentifierRef(ref) && ref.type === "computedAttribute" ? "computedAttribute" : undefined;
|
|
28
29
|
}
|
|
30
|
+
/**
|
|
31
|
+
* Elements query result that carries the number format of the element values on every page.
|
|
32
|
+
*/
|
|
33
|
+
class TigerElementsQueryResult {
|
|
34
|
+
page;
|
|
35
|
+
numberFormat;
|
|
36
|
+
constructor(page, numberFormat) {
|
|
37
|
+
this.page = page;
|
|
38
|
+
this.numberFormat = numberFormat;
|
|
39
|
+
}
|
|
40
|
+
get items() {
|
|
41
|
+
return this.page.items;
|
|
42
|
+
}
|
|
43
|
+
get limit() {
|
|
44
|
+
return this.page.limit;
|
|
45
|
+
}
|
|
46
|
+
get offset() {
|
|
47
|
+
return this.page.offset;
|
|
48
|
+
}
|
|
49
|
+
get totalCount() {
|
|
50
|
+
return this.page.totalCount;
|
|
51
|
+
}
|
|
52
|
+
get cacheId() {
|
|
53
|
+
return this.page.cacheId;
|
|
54
|
+
}
|
|
55
|
+
next = async () => new TigerElementsQueryResult(await this.page.next(), this.numberFormat);
|
|
56
|
+
goTo = async (pageIndex) => new TigerElementsQueryResult(await this.page.goTo(pageIndex), this.numberFormat);
|
|
57
|
+
all = () => this.page.all();
|
|
58
|
+
allSorted = (compareFn) => this.page.allSorted(compareFn);
|
|
59
|
+
}
|
|
29
60
|
export class TigerWorkspaceElements {
|
|
30
61
|
authCall;
|
|
31
62
|
workspace;
|
|
@@ -222,7 +253,9 @@ class TigerWorkspaceElementsQuery {
|
|
|
222
253
|
if (!isIdentifierRef(ref)) {
|
|
223
254
|
throw new UnexpectedError("Tiger backend does not allow referencing objects by URI");
|
|
224
255
|
}
|
|
225
|
-
|
|
256
|
+
// resolved from the first response; the same for every page of the query
|
|
257
|
+
let numberFormat;
|
|
258
|
+
const paging = await ServerPaging.for(async ({ offset, limit, cacheId }) => {
|
|
226
259
|
const elementsRequest = this.buildElementsRequest(options, ref.identifier, cacheId);
|
|
227
260
|
const response = await this.authCall((client) => {
|
|
228
261
|
return ActionsApi_ComputeLabelElementsPost(client.axios, "", {
|
|
@@ -234,7 +267,8 @@ class TigerWorkspaceElementsQuery {
|
|
|
234
267
|
...new TigerCancellationConverter(this.signal).forAxios(),
|
|
235
268
|
});
|
|
236
269
|
});
|
|
237
|
-
const { paging, elements, format, granularity, cacheId: responseCacheId } = response.data;
|
|
270
|
+
const { paging, elements, format, granularity, cacheId: responseCacheId, numberFormat: responseNumberFormat, dataType, } = response.data;
|
|
271
|
+
numberFormat = attributeNumberFormat(responseNumberFormat, dataType);
|
|
238
272
|
// Only date attributes carry a granularity; for the rest it is absent, so convert only when
|
|
239
273
|
// present (passing undefined into the strict converter is what previously threw).
|
|
240
274
|
const sdkGranularity = granularity
|
|
@@ -251,6 +285,9 @@ class TigerWorkspaceElementsQuery {
|
|
|
251
285
|
cacheId: responseCacheId,
|
|
252
286
|
};
|
|
253
287
|
}, this.limit, this.offset, this.options?.cacheId);
|
|
288
|
+
// Only results that have a number format to carry get the elements-specific page object; every other
|
|
289
|
+
// result stays the plain server paging, the same as the results of every other query service.
|
|
290
|
+
return numberFormat === undefined ? paging : new TigerElementsQueryResult(paging, numberFormat);
|
|
254
291
|
}
|
|
255
292
|
mapValidationItems(item) {
|
|
256
293
|
return toObjQualifier(item).identifier;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type IChatConversation, type IChatConversationCreateOptions, type IChatConversationError, type IChatConversationInteractionStep, type IChatConversationItem, type IChatConversationItemsQuery, type IChatConversationItemsQueryResult, type IChatConversationThread, type IChatConversationThreadQuery, type IChatConversations, type UserQuestionItem } from "@gooddata/sdk-backend-spi";
|
|
1
|
+
import { type GenAIPublisherDocumentFormat, type IChatConversation, type IChatConversationCreateOptions, type IChatConversationError, type IChatConversationInteractionStep, type IChatConversationItem, type IChatConversationItemsQuery, type IChatConversationItemsQueryResult, type IChatConversationResavePublisherDocumentOptions, type IChatConversationThread, type IChatConversationThreadQuery, type IChatConversations, type UserQuestionItem } from "@gooddata/sdk-backend-spi";
|
|
2
2
|
import { type GenAIChatEffort, type GenAIChatInteractionUserFeedback, type GenAIObjectType, type IAllowedRelationshipType, type IGenAIUserContext } from "@gooddata/sdk-model";
|
|
3
3
|
import type { DateNormalizer } from "../../../convertors/fromBackend/dateFormatting/types.js";
|
|
4
4
|
import type { TigerAuthenticatedCallGuard } from "../../../types/index.js";
|
|
@@ -74,7 +74,7 @@ export declare class ConversationThread implements IChatConversationThread {
|
|
|
74
74
|
/**
|
|
75
75
|
* Records the saved document that a document drafted in the conversation became.
|
|
76
76
|
*/
|
|
77
|
-
resavePublisherDocument(documentRef: string, savedDocumentId: string): Promise<void>;
|
|
77
|
+
resavePublisherDocument(documentRef: string, savedDocumentId: string, options?: IChatConversationResavePublisherDocumentOptions): Promise<void>;
|
|
78
78
|
/**
|
|
79
79
|
* Queries the conversation thread.
|
|
80
80
|
*/
|
|
@@ -96,6 +96,7 @@ export type ChatConversationThreadQueryConfig = {
|
|
|
96
96
|
objectTypes?: GenAIObjectType[];
|
|
97
97
|
allowedRelationshipTypes?: IAllowedRelationshipType[];
|
|
98
98
|
effort?: GenAIChatEffort;
|
|
99
|
+
documentFormat: GenAIPublisherDocumentFormat;
|
|
99
100
|
};
|
|
100
101
|
/**
|
|
101
102
|
* Chat conversation thread query implementation.
|
|
@@ -114,6 +115,7 @@ export declare class ChatConversationThreadQuery implements IChatConversationThr
|
|
|
114
115
|
withIncludeTags(includeTags?: string[]): IChatConversationThreadQuery;
|
|
115
116
|
withAllowedRelationshipTypes(relationshipTypes?: IAllowedRelationshipType[]): IChatConversationThreadQuery;
|
|
116
117
|
withEffort(effort?: GenAIChatEffort): IChatConversationThreadQuery;
|
|
118
|
+
withPublisherDocumentFormat(documentFormat: GenAIPublisherDocumentFormat): IChatConversationThreadQuery;
|
|
117
119
|
stream(history: IChatConversationItem[]): ReadableStream<IChatConversationItem | IChatConversationError | IChatConversationInteractionStep>;
|
|
118
120
|
}
|
|
119
121
|
//# sourceMappingURL=ChatConversations.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChatConversations.d.ts","sourceRoot":"","sources":["../../../../src/backend/workspace/genAI/ChatConversations.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ChatConversations.d.ts","sourceRoot":"","sources":["../../../../src/backend/workspace/genAI/ChatConversations.ts"],"names":[],"mappings":"AAiCA,OAAO,EACH,KAAK,4BAA4B,EACjC,KAAK,iBAAiB,EACtB,KAAK,8BAA8B,EACnC,KAAK,sBAAsB,EAC3B,KAAK,gCAAgC,EACrC,KAAK,qBAAqB,EAC1B,KAAK,2BAA2B,EAChC,KAAK,iCAAiC,EACtC,KAAK,+CAA+C,EACpD,KAAK,uBAAuB,EAC5B,KAAK,4BAA4B,EACjC,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EACxB,MAAM,2BAA2B,CAAC;AAMnC,OAAO,EACH,KAAK,eAAe,EACpB,KAAK,gCAAgC,EACrC,KAAK,eAAe,EACpB,KAAK,wBAAwB,EAO7B,KAAK,iBAAiB,EAQzB,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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AiB,CAAC,EAAE,wBAAwB,EAAE,GAC/C,4BAA4B,CAK9B;IACD,UAAU,CAAC,MAAM,CAAC,EAAE,eAAe,GAAG,4BAA4B,CAKjE;IACD,2BAA2B,CAAC,cAAc,EAAE,4BAA4B,GAAG,4BAA4B,CAKtG;IACD,MAAM,CACF,OAAO,EAAE,qBAAqB,EAAE,GACjC,cAAc,CAAC,qBAAqB,GAAG,sBAAsB,GAAG,gCAAgC,CAAC,CAuFnG;CACJ"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
// (C) 2024-2026 GoodData Corporation
|
|
2
2
|
import { EventSourceParserStream } from "eventsource-parser/stream";
|
|
3
3
|
import { v4 as uuidv4 } from "uuid";
|
|
4
|
-
import { GenAiApi_DeleteConversation, GenAiApi_GetConversation, GenAiApi_GetConversationItems, GenAiApi_GetConversationResponses, GenAiApi_GetConversations, GenAiApi_PatchConversation, GenAiApi_PatchDashboard, GenAiApi_PatchReport, GenAiApi_PatchVisualization, GenAiApi_PostConversationFeedback, GenAiApi_PostConversations, GenAiApi_PostGenerateConversationTitle, GenAiApi_PostMessages, GenAiApi_SwitchAgent, } from "@gooddata/api-client-tiger/endpoints/genAI";
|
|
4
|
+
import { GenAiApi_DeleteConversation, GenAiApi_GetConversation, GenAiApi_GetConversationItems, GenAiApi_GetConversationResponses, GenAiApi_GetConversations, GenAiApi_PatchConversation, GenAiApi_PatchDashboard, GenAiApi_PatchPublisherDocument, GenAiApi_PatchReport, GenAiApi_PatchVisualization, GenAiApi_PostConversationFeedback, GenAiApi_PostConversations, GenAiApi_PostGenerateConversationTitle, GenAiApi_PostMessages, GenAiApi_SwitchAgent, } from "@gooddata/api-client-tiger/endpoints/genAI";
|
|
5
5
|
import { ServerPaging } from "@gooddata/sdk-backend-base";
|
|
6
|
-
import { declarativeDashboardToYaml, publisherDocumentDefinitionToYaml } from "@gooddata/sdk-code-convertors";
|
|
6
|
+
import { declarativeDashboardToYaml, publisherDocumentDefinitionToYaml, publisherDocumentDefinitionToYamlV2, } from "@gooddata/sdk-code-convertors";
|
|
7
7
|
import { isIdentifierRef, isTempFilterContext, objRefToString, } from "@gooddata/sdk-model";
|
|
8
8
|
import { convertChatConversationErrorFromBackend, convertChatConversationFromBackend, convertChatConversationInteractionStepFromBackend, convertChatConversationItemFromBackend, convertChatConversationItemsFromBackend, } from "../../../convertors/fromBackend/genAIConvertor.js";
|
|
9
9
|
import { convertAnalyticalDashboard, convertFilterContextToBackend, } from "../../../convertors/toBackend/AnalyticalDashboardConverter.js";
|
|
@@ -235,12 +235,20 @@ export class ConversationThread {
|
|
|
235
235
|
/**
|
|
236
236
|
* Records the saved document that a document drafted in the conversation became.
|
|
237
237
|
*/
|
|
238
|
-
async resavePublisherDocument(documentRef, savedDocumentId) {
|
|
238
|
+
async resavePublisherDocument(documentRef, savedDocumentId, options) {
|
|
239
239
|
const conversationId = this.conversationId;
|
|
240
240
|
if (!conversationId) {
|
|
241
241
|
throw new Error("Conversation ID is not set");
|
|
242
242
|
}
|
|
243
243
|
await this.authCall((client) => {
|
|
244
|
+
if (options?.format === "aac-v2") {
|
|
245
|
+
return GenAiApi_PatchPublisherDocument(client.axios, client.basePath, {
|
|
246
|
+
workspaceId: this.workspaceId,
|
|
247
|
+
conversationId,
|
|
248
|
+
documentRef,
|
|
249
|
+
aiPublisherDocumentIdUpdateRequest: { id: savedDocumentId },
|
|
250
|
+
});
|
|
251
|
+
}
|
|
244
252
|
return GenAiApi_PatchReport(client.axios, client.basePath, {
|
|
245
253
|
workspaceId: this.workspaceId,
|
|
246
254
|
conversationId,
|
|
@@ -261,6 +269,7 @@ export class ConversationThread {
|
|
|
261
269
|
workspaceId: this.workspaceId,
|
|
262
270
|
userQuestion: userMessage,
|
|
263
271
|
conversationId,
|
|
272
|
+
documentFormat: "aac-v1",
|
|
264
273
|
});
|
|
265
274
|
}
|
|
266
275
|
}
|
|
@@ -325,6 +334,12 @@ export class ChatConversationThreadQuery {
|
|
|
325
334
|
effort,
|
|
326
335
|
});
|
|
327
336
|
}
|
|
337
|
+
withPublisherDocumentFormat(documentFormat) {
|
|
338
|
+
return new ChatConversationThreadQuery(this.authCall, this.dateNormalizer, {
|
|
339
|
+
...this.requestParameters,
|
|
340
|
+
documentFormat,
|
|
341
|
+
});
|
|
342
|
+
}
|
|
328
343
|
stream(history) {
|
|
329
344
|
// We are using Axios <1.7, which does not support streaming,
|
|
330
345
|
// as it can't use fetch API instead of XHR.
|
|
@@ -355,8 +370,9 @@ export class ChatConversationThreadQuery {
|
|
|
355
370
|
includeTags: requestParameters.includeTags,
|
|
356
371
|
},
|
|
357
372
|
reasoningEffort: requestParameters.effort,
|
|
373
|
+
documentFormat: requestParameters.documentFormat,
|
|
358
374
|
},
|
|
359
|
-
userContext: convertUserContext(requestParameters.userContext),
|
|
375
|
+
userContext: convertUserContext(requestParameters.userContext, requestParameters.documentFormat),
|
|
360
376
|
},
|
|
361
377
|
}, {
|
|
362
378
|
// Abort signal only affecting the request, as the stream is generally
|
|
@@ -474,7 +490,7 @@ class ServerSentEventsDataConverter extends TransformStream {
|
|
|
474
490
|
/**
|
|
475
491
|
* Convert SDK model user context (with ObjRef) to the API user context (with plain string IDs).
|
|
476
492
|
*/
|
|
477
|
-
function convertUserContext(userContext) {
|
|
493
|
+
function convertUserContext(userContext, documentFormat) {
|
|
478
494
|
if (!userContext) {
|
|
479
495
|
return undefined;
|
|
480
496
|
}
|
|
@@ -482,9 +498,7 @@ function convertUserContext(userContext) {
|
|
|
482
498
|
...(userContext.view?.dashboard
|
|
483
499
|
? { dashboard: convertDashboardView(userContext.view.dashboard) }
|
|
484
500
|
: {}),
|
|
485
|
-
...(userContext
|
|
486
|
-
? { report: convertPublisherDocumentView(userContext.view.publisherDocument) }
|
|
487
|
-
: {}),
|
|
501
|
+
...convertPublisherDocumentViewOfFormat(userContext, documentFormat),
|
|
488
502
|
};
|
|
489
503
|
return {
|
|
490
504
|
...convertActiveObject(userContext),
|
|
@@ -492,6 +506,30 @@ function convertUserContext(userContext) {
|
|
|
492
506
|
...convertReferencedObjects(userContext),
|
|
493
507
|
};
|
|
494
508
|
}
|
|
509
|
+
function convertPublisherDocumentViewOfFormat({ view }, documentFormat) {
|
|
510
|
+
if (documentFormat === "aac-v2") {
|
|
511
|
+
return view?.publisherDocumentV2
|
|
512
|
+
? { document: convertPublisherDocumentViewV2(view.publisherDocumentV2) }
|
|
513
|
+
: {};
|
|
514
|
+
}
|
|
515
|
+
return view?.publisherDocument ? { report: convertPublisherDocumentView(view.publisherDocument) } : {};
|
|
516
|
+
}
|
|
517
|
+
function convertPublisherDocumentViewV2({ ref, title, definition, }) {
|
|
518
|
+
return {
|
|
519
|
+
id: ref ? objRefToString(ref) : null,
|
|
520
|
+
...(title ? { title } : {}),
|
|
521
|
+
...(definition ? convertPublisherDocumentDefinitionV2({ ...definition, ref }) : {}),
|
|
522
|
+
};
|
|
523
|
+
}
|
|
524
|
+
function convertPublisherDocumentDefinitionV2(definition) {
|
|
525
|
+
try {
|
|
526
|
+
return { definition: publisherDocumentDefinitionToYamlV2(definition).json };
|
|
527
|
+
}
|
|
528
|
+
catch (error) {
|
|
529
|
+
console.warn("Document cannot be written as code, sending the AI assistant only its id: ", error);
|
|
530
|
+
return {};
|
|
531
|
+
}
|
|
532
|
+
}
|
|
495
533
|
function convertPublisherDocumentView({ ref, title, definition, draftRef, }) {
|
|
496
534
|
return {
|
|
497
535
|
id: ref ? objRefToString(ref) : null,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { IAnalyticsCatalogService, IChatConversations, IDashboardSummary, IDashboardSummaryRequest, IGenAIService, IKnowledgeDocumentsService, IMemoryItemsService, ISemanticQualityService, ISemanticSearchQuery, IVisualizationsSummaryRequest } from "@gooddata/sdk-backend-spi";
|
|
1
|
+
import type { IAnalyticsCatalogService, IChatConversations, IDashboardSummary, IDashboardSummaryRequest, IGenAIService, IKnowledgeDocumentsService, IMemoryItemsService, ISemanticQualityService, ISemanticSearchQuery, ITakeawayRequest, ITakeawayResult, IVisualizationsSummaryRequest } from "@gooddata/sdk-backend-spi";
|
|
2
2
|
import { type DateNormalizer } from "../../../convertors/fromBackend/dateFormatting/types.js";
|
|
3
3
|
import { type TigerAuthenticatedCallGuard } from "../../../types/index.js";
|
|
4
4
|
export declare class GenAIService implements IGenAIService {
|
|
@@ -21,5 +21,8 @@ export declare class GenAIService implements IGenAIService {
|
|
|
21
21
|
summarizeVisualizations(request: IVisualizationsSummaryRequest, options?: {
|
|
22
22
|
signal?: AbortSignal;
|
|
23
23
|
}): Promise<IDashboardSummary>;
|
|
24
|
+
generateTakeaway(request: ITakeawayRequest, options?: {
|
|
25
|
+
signal?: AbortSignal;
|
|
26
|
+
}): Promise<ITakeawayResult>;
|
|
24
27
|
}
|
|
25
28
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/backend/workspace/genAI/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/backend/workspace/genAI/index.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EACR,wBAAwB,EACxB,kBAAkB,EAClB,iBAAiB,EACjB,wBAAwB,EACxB,aAAa,EACb,0BAA0B,EAC1B,mBAAmB,EACnB,uBAAuB,EACvB,oBAAoB,EACpB,gBAAgB,EAChB,eAAe,EACf,6BAA6B,EAChC,MAAM,2BAA2B,CAAC;AAGnC,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,yDAAyD,CAAC;AAE9F,OAAO,EAAE,KAAK,2BAA2B,EAAE,MAAM,yBAAyB,CAAC;AAS3E,qBAAa,YAAa,YAAW,aAAa;IAE1C,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,WAAW;IAC5B,OAAO,CAAC,QAAQ,CAAC,cAAc;IAHnC,YACqB,QAAQ,EAAE,2BAA2B,EACrC,WAAW,EAAE,MAAM,EACnB,cAAc,EAAE,cAAc,EAC/C;IAEJ,oBAAoB,CAAC,OAAO,CAAC,EAAE;QAAE,SAAS,CAAC,EAAE,OAAO,CAAA;KAAE,GAAG,kBAAkB,CAE1E;IAED,sBAAsB,IAAI,oBAAoB,CAE7C;IAEK,gBAAgB,IAAI,OAAO,CAAC,OAAO,CAAC,CAOzC;IAED,qBAAqB,IAAI,0BAA0B,CAElD;IAED,cAAc,IAAI,mBAAmB,CAEpC;IAED,mBAAmB,IAAI,wBAAwB,CAE9C;IAED,kBAAkB,IAAI,uBAAuB,CAE5C;IAEK,kBAAkB,CACpB,OAAO,EAAE,wBAAwB,EACjC,OAAO,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,WAAW,CAAA;KAAE,GACnC,OAAO,CAAC,iBAAiB,CAAC,CAkC5B;IAEK,uBAAuB,CACzB,OAAO,EAAE,6BAA6B,EACtC,OAAO,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,WAAW,CAAA;KAAE,GACnC,OAAO,CAAC,iBAAiB,CAAC,CA6B5B;IAEK,gBAAgB,CAClB,OAAO,EAAE,gBAAgB,EACzB,OAAO,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,WAAW,CAAA;KAAE,GACnC,OAAO,CAAC,eAAe,CAAC,CAiC1B;CACJ"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// (C) 2024-2026 GoodData Corporation
|
|
2
2
|
import { SmartFunctionsAi_ResolveLlmProviders } from "@gooddata/api-client-tiger";
|
|
3
|
-
import { GenAiApi_SummarizeDashboard, GenAiApi_SummarizeVisualizations, } from "@gooddata/api-client-tiger/endpoints/genAI";
|
|
3
|
+
import { GenAiApi_GenerateTakeaway, GenAiApi_SummarizeDashboard, GenAiApi_SummarizeVisualizations, } from "@gooddata/api-client-tiger/endpoints/genAI";
|
|
4
4
|
import { convertFilter } from "../../../convertors/toBackend/afm/FilterConverter.js";
|
|
5
5
|
import { AnalyticsCatalogService } from "./AnalyticsCatalogService.js";
|
|
6
6
|
import { ChatConversationsService } from "./ChatConversations.js";
|
|
@@ -86,6 +86,31 @@ export class GenAIService {
|
|
|
86
86
|
}, { signal: options?.signal }));
|
|
87
87
|
return convertSummaryResponse(response.data);
|
|
88
88
|
}
|
|
89
|
+
async generateTakeaway(request, options) {
|
|
90
|
+
const aiTakeawayRequest = {
|
|
91
|
+
data: {
|
|
92
|
+
visualizations: request.visualizations.map((placement) => ({
|
|
93
|
+
visualizationId: placement.visualizationId,
|
|
94
|
+
filters: convertSummaryFilters(placement.filters),
|
|
95
|
+
})),
|
|
96
|
+
filterContext: convertSummaryFilters(request.filters),
|
|
97
|
+
},
|
|
98
|
+
};
|
|
99
|
+
if (request.instructions !== undefined) {
|
|
100
|
+
aiTakeawayRequest.instructions = request.instructions;
|
|
101
|
+
}
|
|
102
|
+
if (request.maxCharacters !== undefined) {
|
|
103
|
+
aiTakeawayRequest.maxCharacters = request.maxCharacters;
|
|
104
|
+
}
|
|
105
|
+
if (request.agentId !== undefined) {
|
|
106
|
+
aiTakeawayRequest.agentId = request.agentId;
|
|
107
|
+
}
|
|
108
|
+
const response = await this.authCall((client) => GenAiApi_GenerateTakeaway(client.axios, client.basePath, {
|
|
109
|
+
workspaceId: this.workspaceId,
|
|
110
|
+
aiTakeawayRequest,
|
|
111
|
+
}, { signal: options?.signal }));
|
|
112
|
+
return convertTakeawayResponse(response.data);
|
|
113
|
+
}
|
|
89
114
|
}
|
|
90
115
|
// Cast bridges the AFM filter definitions to the generated union type of the AI API.
|
|
91
116
|
function convertSummaryFilters(filters) {
|
|
@@ -110,3 +135,12 @@ function convertSummaryResponse(data) {
|
|
|
110
135
|
tabId: data.tabId ?? undefined,
|
|
111
136
|
};
|
|
112
137
|
}
|
|
138
|
+
function convertTakeawayResponse(data) {
|
|
139
|
+
return {
|
|
140
|
+
takeaway: data.takeaway,
|
|
141
|
+
noData: data.noData,
|
|
142
|
+
generatedAt: data.generatedAt,
|
|
143
|
+
agentId: data.agentId,
|
|
144
|
+
contextOmitted: data.contextOmitted,
|
|
145
|
+
};
|
|
146
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dimensions.d.ts","sourceRoot":"","sources":["../../../../src/convertors/fromBackend/afm/dimensions.ts"],"names":[],"mappings":"AAIA,OAAO,EAA0B,KAAK,eAAe,EAAqB,MAAM,4BAA4B,CAAC;AAC7G,OAAO,EAEH,KAAK,oBAAoB,EAEzB,KAAK,oBAAoB,EAS5B,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"dimensions.d.ts","sourceRoot":"","sources":["../../../../src/convertors/fromBackend/afm/dimensions.ts"],"names":[],"mappings":"AAIA,OAAO,EAA0B,KAAK,eAAe,EAAqB,MAAM,4BAA4B,CAAC;AAC7G,OAAO,EAEH,KAAK,oBAAoB,EAEzB,KAAK,oBAAoB,EAS5B,MAAM,qBAAqB,CAAC;AAoH7B;;;;;;;;;;GAUG;AACH,wBAAgB,yBAAyB,CACrC,UAAU,EAAE,eAAe,EAAE,EAC7B,GAAG,EAAE,oBAAoB,GAC1B,oBAAoB,EAAE,CAOxB"}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { groupBy, keyBy, mapValues, uniqBy } from "lodash-es";
|
|
3
3
|
import { isAttributeHeader } from "@gooddata/api-client-tiger";
|
|
4
4
|
import { idRef, isIdentifierRef, isSimpleMeasure, measureItem, measureLocalId, } from "@gooddata/sdk-model";
|
|
5
|
+
import { attributeNumberFormat } from "../attributeNumberFormat.js";
|
|
5
6
|
import { convertLabelType } from "../LabelTypeConverter.js";
|
|
6
7
|
const DEFAULT_FORMAT = "#,#.##";
|
|
7
8
|
function isComputedAttributeIdentifier(identifier) {
|
|
@@ -25,6 +26,7 @@ function transformDimension(dim, simpleMeasureRefs, attrTotals) {
|
|
|
25
26
|
// them through the computedAttributes service instead of labels. The backend states
|
|
26
27
|
// the type on the header identifiers.
|
|
27
28
|
const isComputedAttributeHeader = isComputedAttributeIdentifier(h.attributeHeader.label);
|
|
29
|
+
const numberFormat = attributeNumberFormat(h.attributeHeader.numberFormat, h.attributeHeader.dataType);
|
|
28
30
|
const labelRefType = isComputedAttributeHeader ? "computedAttribute" : "displayForm";
|
|
29
31
|
const attributeRefType = isComputedAttributeHeader ? "computedAttribute" : "attribute";
|
|
30
32
|
return {
|
|
@@ -48,6 +50,7 @@ function transformDimension(dim, simpleMeasureRefs, attrTotals) {
|
|
|
48
50
|
labelType: convertLabelType(h.attributeHeader.valueType),
|
|
49
51
|
primaryLabel: idRef(h.attributeHeader.primaryLabel.id, labelRefType),
|
|
50
52
|
geoAreaConfig,
|
|
53
|
+
...(numberFormat ? { numberFormat } : {}),
|
|
51
54
|
},
|
|
52
55
|
};
|
|
53
56
|
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type ComputedAttributeDataType } from "@gooddata/sdk-model";
|
|
2
|
+
/**
|
|
3
|
+
* Number format of the attribute's element values, as stated by the backend for the attribute header
|
|
4
|
+
* of an execution result or for an elements response.
|
|
5
|
+
*
|
|
6
|
+
* @remarks
|
|
7
|
+
* Only numeric attributes (`INT` or `NUMERIC` data type, i.e. numeric computed attributes) are formatted:
|
|
8
|
+
* with their own format or, when they have none, with the attribute default. Everything else yields
|
|
9
|
+
* undefined and stays unformatted, even with a format, because formatting would mangle text values.
|
|
10
|
+
*
|
|
11
|
+
* @param numberFormat - format the backend states for the values
|
|
12
|
+
* @param dataType - data type of the values
|
|
13
|
+
* @internal
|
|
14
|
+
*/
|
|
15
|
+
export declare function attributeNumberFormat(numberFormat: string | undefined, dataType: ComputedAttributeDataType | undefined): string | undefined;
|
|
16
|
+
//# sourceMappingURL=attributeNumberFormat.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"attributeNumberFormat.d.ts","sourceRoot":"","sources":["../../../src/convertors/fromBackend/attributeNumberFormat.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AAUrE;;;;;;;;;;;;GAYG;AACH,wBAAgB,qBAAqB,CACjC,YAAY,EAAE,MAAM,GAAG,SAAS,EAChC,QAAQ,EAAE,yBAAyB,GAAG,SAAS,GAChD,MAAM,GAAG,SAAS,CAMpB"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// (C) 2026 GoodData Corporation
|
|
2
|
+
const NUMERIC_DATA_TYPES = ["INT", "NUMERIC"];
|
|
3
|
+
/**
|
|
4
|
+
* Format applied to numeric attribute values without a format of their own. Unlike the measure default,
|
|
5
|
+
* it keeps a leading digit, so a zero element reads "0" and not an empty label.
|
|
6
|
+
*/
|
|
7
|
+
const DEFAULT_ATTRIBUTE_NUMBER_FORMAT = "#,##0.##";
|
|
8
|
+
/**
|
|
9
|
+
* Number format of the attribute's element values, as stated by the backend for the attribute header
|
|
10
|
+
* of an execution result or for an elements response.
|
|
11
|
+
*
|
|
12
|
+
* @remarks
|
|
13
|
+
* Only numeric attributes (`INT` or `NUMERIC` data type, i.e. numeric computed attributes) are formatted:
|
|
14
|
+
* with their own format or, when they have none, with the attribute default. Everything else yields
|
|
15
|
+
* undefined and stays unformatted, even with a format, because formatting would mangle text values.
|
|
16
|
+
*
|
|
17
|
+
* @param numberFormat - format the backend states for the values
|
|
18
|
+
* @param dataType - data type of the values
|
|
19
|
+
* @internal
|
|
20
|
+
*/
|
|
21
|
+
export function attributeNumberFormat(numberFormat, dataType) {
|
|
22
|
+
if (dataType === undefined || !NUMERIC_DATA_TYPES.includes(dataType)) {
|
|
23
|
+
return undefined;
|
|
24
|
+
}
|
|
25
|
+
return numberFormat || DEFAULT_ATTRIBUTE_NUMBER_FORMAT;
|
|
26
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"genAIConvertor.d.ts","sourceRoot":"","sources":["../../../src/convertors/fromBackend/genAIConvertor.ts"],"names":[],"mappings":"AAKA,OAAO,EAGH,KAAK,0BAA0B,EAC/B,KAAK,gCAAgC,EACr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AE,MAAM,GAClB,qBAAqB,GAAG,SAAS,CA6BnC;AAED,wBAAgB,uCAAuC,CACnD,KAAK,EAAE,0BAA0B,EAAE,EACnC,SAAS,EAAE,0BAA0B,CAAC,WAAW,CAAC,GAAG,SAAS,EAC9D,cAAc,EAAE,cAAc,EAC9B,MAAM,CAAC,EAAE,gBAAgB,EACzB,QAAQ,CAAC,EAAE,MAAM,GAClB,qBAAqB,EAAE,CAkBzB;AA8ND,wBAAgB,uCAAuC,CACnD,IAAI,EAAE,OAAO,CAAC;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC,EACrE,OAAO,CAAC,EAAE,MAAM,GACjB,sBAAsB,CAQxB;AAED;;;GAGG;AACH,wBAAgB,iDAAiD,CAC7D,IAAI,EAAE,yBAAyB,EAC/B,OAAO,CAAC,EAAE,MAAM,GACjB,gCAAgC,CAgBlC;AAED;;;;GAIG;AACH,wBAAgB,4CAA4C,CACxD,MAAM,EAAE,gCAAgC,GAAG,IAAI,GAAG,SAAS,GAC5D,2BAA2B,GAAG,SAAS,CAgEzC;AA2FD,wBAAgB,oCAAoC,CAChD,IAAI,EAAE,aAAa,GAAG,IAAI,GAAG,SAAS,GACvC,gBAAgB,CAQlB"}
|
|
@@ -11,6 +11,7 @@ import { convertAlert } from "./AutomationConverter.js";
|
|
|
11
11
|
import { cloneWithSanitizedIds } from "./IdSanitization.js";
|
|
12
12
|
import { visualizationObjectsItemToInsight } from "./InsightConverter.js";
|
|
13
13
|
import { convertPublisherDocumentPart } from "./publisherDocumentPartConvertor.js";
|
|
14
|
+
import { convertPublisherDocumentPartV2 } from "./publisherDocumentPartConvertorV2.js";
|
|
14
15
|
export function convertChatConversationFromBackend(conversation) {
|
|
15
16
|
return {
|
|
16
17
|
id: conversation.conversationId,
|
|
@@ -187,6 +188,8 @@ function convertMultipartPart(part, history, siblings, dateNormalizer, locale, t
|
|
|
187
188
|
}
|
|
188
189
|
case "report":
|
|
189
190
|
return convertPublisherDocumentPart(part);
|
|
191
|
+
case "document":
|
|
192
|
+
return convertPublisherDocumentPartV2(part);
|
|
190
193
|
case "kda":
|
|
191
194
|
if (!part.kda) {
|
|
192
195
|
return undefined;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type AiPublisherDocumentPart } from "@gooddata/api-client-tiger";
|
|
2
|
+
import { type IChatConversationPublisherDocumentContentV2 } from "@gooddata/sdk-backend-spi";
|
|
3
|
+
/**
|
|
4
|
+
* Converts a document part. A document that cannot be read still yields a part, with `publisherDocument`
|
|
5
|
+
* null, so the chat can say the document is unavailable instead of dropping it.
|
|
6
|
+
*/
|
|
7
|
+
export declare function convertPublisherDocumentPartV2(part: AiPublisherDocumentPart): IChatConversationPublisherDocumentContentV2;
|
|
8
|
+
//# sourceMappingURL=publisherDocumentPartConvertorV2.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"publisherDocumentPartConvertorV2.d.ts","sourceRoot":"","sources":["../../../src/convertors/fromBackend/publisherDocumentPartConvertorV2.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,uBAAuB,EAAE,MAAM,4BAA4B,CAAC;AAC1E,OAAO,EAAE,KAAK,2CAA2C,EAAE,MAAM,2BAA2B,CAAC;AAmC7F;;;GAGG;AACH,wBAAgB,8BAA8B,CAC1C,IAAI,EAAE,uBAAuB,GAC9B,2CAA2C,CAU7C"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
// (C) 2026 GoodData Corporation
|
|
2
|
+
import { yamlPublisherDocumentToDefinitionV2, } from "@gooddata/sdk-code-convertors";
|
|
3
|
+
import { validateLoadedPublisherEntityV2 } from "@gooddata/sdk-model";
|
|
4
|
+
// The convertor throws on a document it cannot read, so this only has to tell a document from any other
|
|
5
|
+
// value; what is inside is the convertor's and the validator's to reject.
|
|
6
|
+
function isAacPublisherDocumentV2(value) {
|
|
7
|
+
return typeof value === "object" && value !== null && "type" in value && value.type === "document";
|
|
8
|
+
}
|
|
9
|
+
function toPublisherDocumentDefinitionV2(document) {
|
|
10
|
+
if (!isAacPublisherDocumentV2(document)) {
|
|
11
|
+
console.error("The document part does not carry a document.");
|
|
12
|
+
return null;
|
|
13
|
+
}
|
|
14
|
+
try {
|
|
15
|
+
const definition = yamlPublisherDocumentToDefinitionV2(document);
|
|
16
|
+
const issues = validateLoadedPublisherEntityV2(definition);
|
|
17
|
+
if (issues.length > 0) {
|
|
18
|
+
console.error("The document part's document is not valid.", issues);
|
|
19
|
+
return null;
|
|
20
|
+
}
|
|
21
|
+
return definition;
|
|
22
|
+
}
|
|
23
|
+
catch (e) {
|
|
24
|
+
console.error(e);
|
|
25
|
+
return null;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Converts a document part. A document that cannot be read still yields a part, with `publisherDocument`
|
|
30
|
+
* null, so the chat can say the document is unavailable instead of dropping it.
|
|
31
|
+
*/
|
|
32
|
+
export function convertPublisherDocumentPartV2(part) {
|
|
33
|
+
return {
|
|
34
|
+
type: "publisherDocumentV2",
|
|
35
|
+
publisherDocument: part.document ? toPublisherDocumentDefinitionV2(part.document) : null,
|
|
36
|
+
saved: part.saved_document_id,
|
|
37
|
+
ref: part.document_ref,
|
|
38
|
+
baseDocumentId: part.base_document_id,
|
|
39
|
+
refines: part.refines_ref,
|
|
40
|
+
...(part.reworks_open_document ? { reworksOpenDocument: true } : {}),
|
|
41
|
+
};
|
|
42
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gooddata/sdk-backend-tiger",
|
|
3
|
-
"version": "11.65.0-alpha.
|
|
3
|
+
"version": "11.65.0-alpha.10",
|
|
4
4
|
"description": "GoodData Backend SPI implementation for GoodData Cloud and GoodData.CN",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "GoodData",
|
|
@@ -34,12 +34,12 @@
|
|
|
34
34
|
"ts-invariant": "0.10.3",
|
|
35
35
|
"tslib": "2.8.1",
|
|
36
36
|
"uuid": "11.1.1",
|
|
37
|
-
"@gooddata/api-client-tiger": "11.65.0-alpha.
|
|
38
|
-
"@gooddata/sdk-backend-base": "11.65.0-alpha.
|
|
39
|
-
"@gooddata/sdk-backend-spi": "11.65.0-alpha.
|
|
40
|
-
"@gooddata/sdk-code-convertors": "11.65.0-alpha.
|
|
41
|
-
"@gooddata/sdk-model": "11.65.0-alpha.
|
|
42
|
-
"@gooddata/util": "11.65.0-alpha.
|
|
37
|
+
"@gooddata/api-client-tiger": "11.65.0-alpha.10",
|
|
38
|
+
"@gooddata/sdk-backend-base": "11.65.0-alpha.10",
|
|
39
|
+
"@gooddata/sdk-backend-spi": "11.65.0-alpha.10",
|
|
40
|
+
"@gooddata/sdk-code-convertors": "11.65.0-alpha.10",
|
|
41
|
+
"@gooddata/sdk-model": "11.65.0-alpha.10",
|
|
42
|
+
"@gooddata/util": "11.65.0-alpha.10"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@gooddata/fixtures": "3.7.0",
|
|
@@ -64,10 +64,10 @@
|
|
|
64
64
|
"oxlint-tsgolint": "7.0.2001",
|
|
65
65
|
"typescript": "7.0.2",
|
|
66
66
|
"vitest": "5.0.4",
|
|
67
|
-
"@gooddata/
|
|
68
|
-
"@gooddata/
|
|
69
|
-
"@gooddata/
|
|
70
|
-
"@gooddata/
|
|
67
|
+
"@gooddata/catalog-export": "11.65.0-alpha.10",
|
|
68
|
+
"@gooddata/eslint-config": "11.65.0-alpha.10",
|
|
69
|
+
"@gooddata/oxlint-config": "11.65.0-alpha.10",
|
|
70
|
+
"@gooddata/reference-workspace": "11.65.0-alpha.10"
|
|
71
71
|
},
|
|
72
72
|
"scripts": {
|
|
73
73
|
"_phase:build": "npm run build",
|