@gooddata/sdk-backend-tiger 11.48.0-alpha.0 → 11.48.0-alpha.2
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/auth.d.ts.map +1 -1
- package/esm/auth.js +11 -2
- package/esm/backend/features/feature.d.ts.map +1 -1
- package/esm/backend/features/feature.js +2 -3
- package/esm/backend/organization/automations/automationsQuery.d.ts.map +1 -1
- package/esm/backend/organization/automations/automationsQuery.js +1 -3
- package/esm/backend/organization/settings.d.ts.map +1 -1
- package/esm/backend/organization/settings.js +24 -9
- package/esm/backend/settings/responseCacheCoherence.d.ts +34 -0
- package/esm/backend/settings/responseCacheCoherence.d.ts.map +1 -0
- package/esm/backend/settings/responseCacheCoherence.js +70 -0
- package/esm/backend/uiFeatures.d.ts +7 -10
- package/esm/backend/uiFeatures.d.ts.map +1 -1
- package/esm/backend/uiFeatures.js +8 -11
- package/esm/backend/user/settings.d.ts.map +1 -1
- package/esm/backend/user/settings.js +26 -10
- package/esm/backend/workspace/automations/automationsQuery.d.ts.map +1 -1
- package/esm/backend/workspace/automations/automationsQuery.js +1 -4
- package/esm/backend/workspace/automations/index.d.ts +0 -1
- package/esm/backend/workspace/automations/index.d.ts.map +1 -1
- package/esm/backend/workspace/automations/index.js +6 -15
- package/esm/backend/workspace/execution/executionResult.d.ts.map +1 -1
- package/esm/backend/workspace/execution/executionResult.js +22 -0
- package/esm/backend/workspace/genAI/ChatConversations.js +10 -0
- package/esm/backend/workspace/settings/index.d.ts +10 -3
- package/esm/backend/workspace/settings/index.d.ts.map +1 -1
- package/esm/backend/workspace/settings/index.js +52 -14
- package/esm/backend/workspace/styling/index.d.ts +68 -1
- package/esm/backend/workspace/styling/index.d.ts.map +1 -1
- package/esm/backend/workspace/styling/index.js +199 -37
- package/esm/convertors/fromBackend/AutomationConverter.d.ts +2 -2
- package/esm/convertors/fromBackend/AutomationConverter.d.ts.map +1 -1
- package/esm/convertors/fromBackend/AutomationConverter.js +16 -23
- package/esm/convertors/fromBackend/ColorPaletteConverter.d.ts +4 -4
- package/esm/convertors/fromBackend/ColorPaletteConverter.d.ts.map +1 -1
- package/esm/convertors/fromBackend/ColorPaletteConverter.js +8 -3
- package/esm/convertors/fromBackend/ExportDefinitionsConverter.d.ts +0 -1
- package/esm/convertors/fromBackend/ExportDefinitionsConverter.d.ts.map +1 -1
- package/esm/convertors/fromBackend/ExportDefinitionsConverter.js +0 -18
- package/esm/convertors/fromBackend/ThemeConverter.d.ts +3 -3
- package/esm/convertors/fromBackend/ThemeConverter.d.ts.map +1 -1
- package/esm/convertors/fromBackend/ThemeConverter.js +7 -4
- package/esm/convertors/toBackend/AutomationConverter.d.ts +1 -1
- package/esm/convertors/toBackend/AutomationConverter.d.ts.map +1 -1
- package/esm/convertors/toBackend/AutomationConverter.js +5 -15
- package/esm/convertors/toBackend/ColorPaletteConverter.d.ts +2 -1
- package/esm/convertors/toBackend/ColorPaletteConverter.d.ts.map +1 -1
- package/esm/convertors/toBackend/ColorPaletteConverter.js +11 -0
- package/esm/convertors/toBackend/ThemeConverter.d.ts +2 -1
- package/esm/convertors/toBackend/ThemeConverter.d.ts.map +1 -1
- package/esm/convertors/toBackend/ThemeConverter.js +11 -0
- package/esm/sdk-backend-tiger.d.ts +2 -0
- package/esm/types/refTypeMapping.d.ts +2 -0
- package/esm/types/refTypeMapping.d.ts.map +1 -1
- package/package.json +11 -11
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type IWorkspaceStylingService } from "@gooddata/sdk-backend-spi";
|
|
2
|
-
import { type IColorPaletteItem, type ITheme, type ObjRef } from "@gooddata/sdk-model";
|
|
2
|
+
import { type IColorPaletteDefinition, type IColorPaletteItem, type IColorPaletteMetadataObject, type ITheme, type IThemeDefinition, type IThemeMetadataObject, type ObjRef } from "@gooddata/sdk-model";
|
|
3
3
|
import { type TigerAuthenticatedCallGuard } from "../../../types/index.js";
|
|
4
4
|
export declare class TigerWorkspaceStyling implements IWorkspaceStylingService {
|
|
5
5
|
private readonly authCall;
|
|
@@ -13,6 +13,13 @@ export declare class TigerWorkspaceStyling implements IWorkspaceStylingService {
|
|
|
13
13
|
* @returns boolean
|
|
14
14
|
*/
|
|
15
15
|
private isStylizable;
|
|
16
|
+
/**
|
|
17
|
+
* Resolve the active styling object's content by fetching a filtered single-object list and unwrapping
|
|
18
|
+
* the first hit. A missing object (or a failed fetch) yields the provided fallback rather than throwing,
|
|
19
|
+
* so styling problems never break the application. The caller selects the scope-specific endpoint, so
|
|
20
|
+
* there is no cross-scope fallback here.
|
|
21
|
+
*/
|
|
22
|
+
private resolveActiveStyleContent;
|
|
16
23
|
getColorPalette: () => Promise<IColorPaletteItem[]>;
|
|
17
24
|
getTheme: () => Promise<ITheme>;
|
|
18
25
|
private getActiveSetting;
|
|
@@ -22,5 +29,65 @@ export declare class TigerWorkspaceStyling implements IWorkspaceStylingService {
|
|
|
22
29
|
setActiveColorPalette(colorPaletteRef: ObjRef): Promise<void>;
|
|
23
30
|
clearActiveTheme(): Promise<void>;
|
|
24
31
|
clearActiveColorPalette(): Promise<void>;
|
|
32
|
+
/**
|
|
33
|
+
* Request all themes defined on the workspace level.
|
|
34
|
+
*
|
|
35
|
+
* @returns promise of array of theme metadata objects
|
|
36
|
+
*/
|
|
37
|
+
getThemes(): Promise<IThemeMetadataObject[]>;
|
|
38
|
+
/**
|
|
39
|
+
* Create a new theme on the workspace level.
|
|
40
|
+
*
|
|
41
|
+
* @param theme - theme definition; a random id is generated when none is provided
|
|
42
|
+
* @returns promise of the created theme metadata object
|
|
43
|
+
*/
|
|
44
|
+
createTheme(theme: IThemeDefinition): Promise<IThemeMetadataObject>;
|
|
45
|
+
/**
|
|
46
|
+
* Update an existing theme on the workspace level. Falls back to {@link createTheme} when the definition
|
|
47
|
+
* carries no reference yet.
|
|
48
|
+
*
|
|
49
|
+
* @param theme - theme definition
|
|
50
|
+
* @returns promise of the updated theme metadata object
|
|
51
|
+
*/
|
|
52
|
+
updateTheme(theme: IThemeDefinition): Promise<IThemeMetadataObject>;
|
|
53
|
+
private parseThemeResult;
|
|
54
|
+
/**
|
|
55
|
+
* Delete a theme on the workspace level.
|
|
56
|
+
*
|
|
57
|
+
* @param themeRef - theme reference
|
|
58
|
+
* @returns promise
|
|
59
|
+
*/
|
|
60
|
+
deleteTheme(themeRef: ObjRef): Promise<void>;
|
|
61
|
+
/**
|
|
62
|
+
* Request all color palettes defined on the workspace level. Palettes with invalid content are filtered out.
|
|
63
|
+
*
|
|
64
|
+
* @returns promise of array of color palette metadata objects
|
|
65
|
+
*/
|
|
66
|
+
getColorPalettes(): Promise<IColorPaletteMetadataObject[]>;
|
|
67
|
+
/**
|
|
68
|
+
* Create a new color palette on the workspace level.
|
|
69
|
+
*
|
|
70
|
+
* @param colorPalette - color palette definition; a random id is generated when none is provided
|
|
71
|
+
* @returns promise of the created color palette metadata object
|
|
72
|
+
* @throws Error when the color palette content is not a valid palette
|
|
73
|
+
*/
|
|
74
|
+
createColorPalette(colorPalette: IColorPaletteDefinition): Promise<IColorPaletteMetadataObject>;
|
|
75
|
+
/**
|
|
76
|
+
* Update an existing color palette on the workspace level. Falls back to {@link createColorPalette} when
|
|
77
|
+
* the definition carries no reference yet.
|
|
78
|
+
*
|
|
79
|
+
* @param colorPalette - color palette definition
|
|
80
|
+
* @returns promise of the updated color palette metadata object
|
|
81
|
+
* @throws Error when the color palette content is not a valid palette
|
|
82
|
+
*/
|
|
83
|
+
updateColorPalette(colorPalette: IColorPaletteDefinition): Promise<IColorPaletteMetadataObject>;
|
|
84
|
+
/**
|
|
85
|
+
* Delete a color palette on the workspace level.
|
|
86
|
+
*
|
|
87
|
+
* @param colorPaletteRef - color palette reference
|
|
88
|
+
* @returns promise
|
|
89
|
+
*/
|
|
90
|
+
deleteColorPalette(colorPaletteRef: ObjRef): Promise<void>;
|
|
91
|
+
private parseColorPaletteResult;
|
|
25
92
|
}
|
|
26
93
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/backend/workspace/styling/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/backend/workspace/styling/index.ts"],"names":[],"mappings":"AAuBA,OAAO,EAAE,KAAK,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;AAC1E,OAAO,EACH,KAAK,uBAAuB,EAC5B,KAAK,iBAAiB,EACtB,KAAK,2BAA2B,EAChC,KAAK,MAAM,EACX,KAAK,gBAAgB,EACrB,KAAK,oBAAoB,EACzB,KAAK,MAAM,EAEd,MAAM,qBAAqB,CAAC;AAe7B,OAAO,EAAE,KAAK,2BAA2B,EAAE,MAAM,yBAAyB,CAAC;AAiB3E,qBAAa,qBAAsB,YAAW,wBAAwB;IAI9D,OAAO,CAAC,QAAQ,CAAC,QAAQ;aACT,SAAS,EAAE,MAAM;IAJrC,OAAO,CAAC,eAAe,CAAyB;IAEhD,YACqB,QAAQ,EAAE,2BAA2B,EACtC,SAAS,EAAE,MAAM,EAGpC;IAED;;;;;OAKG;IACH,OAAO,CAAC,YAAY;IAIpB;;;;;OAKG;IACH,OAAO,CAAC,yBAAyB,CAgB3B;IAEC,eAAe,qCA+BpB;IAEK,QAAQ,wBAqBb;YAEY,gBAAgB;IAQvB,cAAc,oCAA8C;IAEtD,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAG3D;IAEM,qBAAqB,oCAAqD;IAEpE,qBAAqB,CAAC,eAAe,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAEzE;IAEY,gBAAgB,IAAI,OAAO,CAAC,IAAI,CAAC,CAE7C;IAEY,uBAAuB,IAAI,OAAO,CAAC,IAAI,CAAC,CAEpD;IAED;;;;OAIG;IACU,SAAS,IAAI,OAAO,CAAC,oBAAoB,EAAE,CAAC,CAYxD;IAED;;;;;OAKG;IACU,WAAW,CAAC,KAAK,EAAE,gBAAgB,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAS/E;IAED;;;;;;OAMG;IACU,WAAW,CAAC,KAAK,EAAE,gBAAgB,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAc/E;IAED,OAAO,CAAC,gBAAgB;IAIxB;;;;;OAKG;IACU,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAQxD;IAED;;;;OAIG;IACU,gBAAgB,IAAI,OAAO,CAAC,2BAA2B,EAAE,CAAC,CAiBtE;IAED;;;;;;OAMG;IACU,kBAAkB,CAC3B,YAAY,EAAE,uBAAuB,GACtC,OAAO,CAAC,2BAA2B,CAAC,CAetC;IAED;;;;;;;OAOG;IACU,kBAAkB,CAC3B,YAAY,EAAE,uBAAuB,GACtC,OAAO,CAAC,2BAA2B,CAAC,CAiBtC;IAED;;;;;OAKG;IACU,kBAAkB,CAAC,eAAe,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAQtE;IAED,OAAO,CAAC,uBAAuB;CAKlC"}
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
// (C) 2019-2026 GoodData Corporation
|
|
2
|
-
import {
|
|
2
|
+
import { v4 as uuidv4 } from "uuid";
|
|
3
|
+
import { MetadataUtilities, } from "@gooddata/api-client-tiger";
|
|
4
|
+
import { EntitiesApi_CreateEntityWorkspaceColorPalettes, EntitiesApi_CreateEntityWorkspaceThemes, EntitiesApi_DeleteEntityWorkspaceColorPalettes, EntitiesApi_DeleteEntityWorkspaceThemes, EntitiesApi_GetAllEntitiesColorPalettes, EntitiesApi_GetAllEntitiesThemes, EntitiesApi_GetAllEntitiesWorkspaceColorPalettes, EntitiesApi_GetAllEntitiesWorkspaceThemes, EntitiesApi_UpdateEntityWorkspaceColorPalettes, EntitiesApi_UpdateEntityWorkspaceThemes, } from "@gooddata/api-client-tiger/endpoints/entitiesObjects";
|
|
3
5
|
import { idRef, } from "@gooddata/sdk-model";
|
|
4
|
-
import { unwrapColorPaletteContent } from "../../../convertors/fromBackend/ColorPaletteConverter.js";
|
|
6
|
+
import { convertColorPalette as convertColorPaletteFromBackend, convertColorPaletteWithLinks, getColorPaletteFromMDObject, isValidColorPalette, unwrapColorPaletteContent, } from "../../../convertors/fromBackend/ColorPaletteConverter.js";
|
|
7
|
+
import { convertTheme as convertThemeFromBackend, convertThemeWithLinks, } from "../../../convertors/fromBackend/ThemeConverter.js";
|
|
8
|
+
import { convertWorkspaceColorPalette as convertWorkspaceColorPaletteToBackend } from "../../../convertors/toBackend/ColorPaletteConverter.js";
|
|
9
|
+
import { convertWorkspaceTheme as convertWorkspaceThemeToBackend } from "../../../convertors/toBackend/ThemeConverter.js";
|
|
5
10
|
import { objRefToIdentifier } from "../../../utils/api.js";
|
|
6
11
|
import { TigerWorkspaceSettings, getSettingsForCurrentUser } from "../settings/index.js";
|
|
7
12
|
import { DefaultColorPalette } from "./mocks/colorPalette.js";
|
|
@@ -24,58 +29,72 @@ export class TigerWorkspaceStyling {
|
|
|
24
29
|
isStylizable(activeStyleId) {
|
|
25
30
|
return activeStyleId !== "";
|
|
26
31
|
}
|
|
32
|
+
/**
|
|
33
|
+
* Resolve the active styling object's content by fetching a filtered single-object list and unwrapping
|
|
34
|
+
* the first hit. A missing object (or a failed fetch) yields the provided fallback rather than throwing,
|
|
35
|
+
* so styling problems never break the application. The caller selects the scope-specific endpoint, so
|
|
36
|
+
* there is no cross-scope fallback here.
|
|
37
|
+
*/
|
|
38
|
+
resolveActiveStyleContent = (fetchList, unwrapContent, fallback) => this.authCall((client) => fetchList(client)
|
|
39
|
+
.then((response) => response.data.data.length === 0
|
|
40
|
+
? fallback
|
|
41
|
+
: unwrapContent(response.data.data[0].attributes.content))
|
|
42
|
+
// Failed styling loading should not break the application
|
|
43
|
+
.catch(() => fallback));
|
|
27
44
|
getColorPalette = async () => {
|
|
28
45
|
const userSettings = await getSettingsForCurrentUser(this.authCall, this.workspace);
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
46
|
+
const activeColorPalette = userSettings["activeColorPalette"];
|
|
47
|
+
const activeColorPaletteId = activeColorPalette?.id ?? "";
|
|
48
|
+
if (!this.isStylizable(activeColorPaletteId)) {
|
|
49
|
+
return DefaultColorPalette;
|
|
50
|
+
}
|
|
51
|
+
const filter = `id=="${activeColorPaletteId}"`;
|
|
52
|
+
// Resolve the id against the scope declared by the setting; no cross-scope fallback.
|
|
53
|
+
const fetchList = activeColorPalette?.type === "workspaceColorPalette"
|
|
54
|
+
? (client) => EntitiesApi_GetAllEntitiesWorkspaceColorPalettes(client.axios, client.basePath, {
|
|
55
|
+
workspaceId: this.workspace,
|
|
56
|
+
filter,
|
|
39
57
|
})
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
58
|
+
: (client) => EntitiesApi_GetAllEntitiesColorPalettes(client.axios, client.basePath, { filter });
|
|
59
|
+
// Validate the resolved content the same way the listing path does, so malformed backend content
|
|
60
|
+
// falls back to the default rather than flowing through unchecked.
|
|
61
|
+
return this.resolveActiveStyleContent(fetchList, (content) => {
|
|
62
|
+
const colorPalette = unwrapColorPaletteContent(content);
|
|
63
|
+
return isValidColorPalette(colorPalette) ? colorPalette : DefaultColorPalette;
|
|
64
|
+
}, DefaultColorPalette);
|
|
45
65
|
};
|
|
46
66
|
getTheme = async () => {
|
|
47
67
|
const userSettings = await getSettingsForCurrentUser(this.authCall, this.workspace);
|
|
48
|
-
const
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
68
|
+
const activeTheme = userSettings["activeTheme"];
|
|
69
|
+
const activeThemeId = activeTheme?.id ?? "";
|
|
70
|
+
if (!this.isStylizable(activeThemeId)) {
|
|
71
|
+
return DefaultTheme;
|
|
72
|
+
}
|
|
73
|
+
const filter = `id=="${activeThemeId}"`;
|
|
74
|
+
// Resolve the id against the scope declared by the setting; no cross-scope fallback.
|
|
75
|
+
const fetchList = activeTheme?.type === "workspaceTheme"
|
|
76
|
+
? (client) => EntitiesApi_GetAllEntitiesWorkspaceThemes(client.axios, client.basePath, {
|
|
77
|
+
workspaceId: this.workspace,
|
|
78
|
+
filter,
|
|
52
79
|
})
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
return themes.data.data[0].attributes.content;
|
|
56
|
-
}
|
|
57
|
-
return DefaultTheme;
|
|
58
|
-
})
|
|
59
|
-
.catch(() => {
|
|
60
|
-
// Failed theme loading should not break application
|
|
61
|
-
return DefaultTheme;
|
|
62
|
-
}))
|
|
63
|
-
: DefaultTheme;
|
|
80
|
+
: (client) => EntitiesApi_GetAllEntitiesThemes(client.axios, client.basePath, { filter });
|
|
81
|
+
return this.resolveActiveStyleContent(fetchList, (content) => content, DefaultTheme);
|
|
64
82
|
};
|
|
65
83
|
async getActiveSetting(setting) {
|
|
66
84
|
const settings = await this.settingsService.getSettings();
|
|
67
85
|
const foundSetting = settings?.[setting];
|
|
68
|
-
|
|
86
|
+
// Preserve the scope discriminator on the returned reference so it round-trips back through
|
|
87
|
+
// setActiveTheme / setActiveColorPalette without losing which collection it points at.
|
|
88
|
+
return foundSetting?.id ? idRef(foundSetting.id, foundSetting.type) : undefined;
|
|
69
89
|
}
|
|
70
90
|
getActiveTheme = () => this.getActiveSetting("activeTheme");
|
|
71
91
|
async setActiveTheme(themeRef) {
|
|
72
|
-
|
|
73
|
-
await this.settingsService.setTheme(
|
|
92
|
+
// The scope is carried by the reference type; the settings service maps it to the setting discriminator.
|
|
93
|
+
await this.settingsService.setTheme(themeRef);
|
|
74
94
|
}
|
|
75
95
|
getActiveColorPalette = () => this.getActiveSetting("activeColorPalette");
|
|
76
96
|
async setActiveColorPalette(colorPaletteRef) {
|
|
77
|
-
|
|
78
|
-
await this.settingsService.setColorPalette(colorPaletteId);
|
|
97
|
+
await this.settingsService.setColorPalette(colorPaletteRef);
|
|
79
98
|
}
|
|
80
99
|
async clearActiveTheme() {
|
|
81
100
|
await this.settingsService.deleteTheme();
|
|
@@ -83,4 +102,147 @@ export class TigerWorkspaceStyling {
|
|
|
83
102
|
async clearActiveColorPalette() {
|
|
84
103
|
await this.settingsService.deleteColorPalette();
|
|
85
104
|
}
|
|
105
|
+
/**
|
|
106
|
+
* Request all themes defined on the workspace level.
|
|
107
|
+
*
|
|
108
|
+
* @returns promise of array of theme metadata objects
|
|
109
|
+
*/
|
|
110
|
+
async getThemes() {
|
|
111
|
+
return await this.authCall((client) => MetadataUtilities.getAllPagesOf(client, EntitiesApi_GetAllEntitiesWorkspaceThemes, {
|
|
112
|
+
workspaceId: this.workspace,
|
|
113
|
+
// Only the workspace's own themes are manageable here; update/delete target this workspace's
|
|
114
|
+
// path, so inherited parent themes (origin ALL/PARENTS) must be excluded from the listing.
|
|
115
|
+
origin: "NATIVE",
|
|
116
|
+
sort: ["name"],
|
|
117
|
+
})
|
|
118
|
+
.then(MetadataUtilities.mergeEntitiesResults)
|
|
119
|
+
.then((themes) => themes.data.map(convertThemeWithLinks)));
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Create a new theme on the workspace level.
|
|
123
|
+
*
|
|
124
|
+
* @param theme - theme definition; a random id is generated when none is provided
|
|
125
|
+
* @returns promise of the created theme metadata object
|
|
126
|
+
*/
|
|
127
|
+
async createTheme(theme) {
|
|
128
|
+
return await this.authCall((client) => EntitiesApi_CreateEntityWorkspaceThemes(client.axios, client.basePath, {
|
|
129
|
+
workspaceId: this.workspace,
|
|
130
|
+
jsonApiWorkspaceThemeInDocument: {
|
|
131
|
+
data: convertWorkspaceThemeToBackend(theme.id || uuidv4(), theme),
|
|
132
|
+
},
|
|
133
|
+
}).then(this.parseThemeResult));
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Update an existing theme on the workspace level. Falls back to {@link createTheme} when the definition
|
|
137
|
+
* carries no reference yet.
|
|
138
|
+
*
|
|
139
|
+
* @param theme - theme definition
|
|
140
|
+
* @returns promise of the updated theme metadata object
|
|
141
|
+
*/
|
|
142
|
+
async updateTheme(theme) {
|
|
143
|
+
if (!theme.ref) {
|
|
144
|
+
return this.createTheme(theme);
|
|
145
|
+
}
|
|
146
|
+
const id = objRefToIdentifier(theme.ref, this.authCall);
|
|
147
|
+
return await this.authCall((client) => EntitiesApi_UpdateEntityWorkspaceThemes(client.axios, client.basePath, {
|
|
148
|
+
workspaceId: this.workspace,
|
|
149
|
+
objectId: id,
|
|
150
|
+
jsonApiWorkspaceThemeInDocument: {
|
|
151
|
+
data: convertWorkspaceThemeToBackend(id, theme),
|
|
152
|
+
},
|
|
153
|
+
}).then(this.parseThemeResult));
|
|
154
|
+
}
|
|
155
|
+
parseThemeResult(result) {
|
|
156
|
+
return convertThemeFromBackend(result.data);
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* Delete a theme on the workspace level.
|
|
160
|
+
*
|
|
161
|
+
* @param themeRef - theme reference
|
|
162
|
+
* @returns promise
|
|
163
|
+
*/
|
|
164
|
+
async deleteTheme(themeRef) {
|
|
165
|
+
const id = objRefToIdentifier(themeRef, this.authCall);
|
|
166
|
+
await this.authCall((client) => EntitiesApi_DeleteEntityWorkspaceThemes(client.axios, client.basePath, {
|
|
167
|
+
workspaceId: this.workspace,
|
|
168
|
+
objectId: id,
|
|
169
|
+
}));
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* Request all color palettes defined on the workspace level. Palettes with invalid content are filtered out.
|
|
173
|
+
*
|
|
174
|
+
* @returns promise of array of color palette metadata objects
|
|
175
|
+
*/
|
|
176
|
+
async getColorPalettes() {
|
|
177
|
+
return await this.authCall((client) => MetadataUtilities.getAllPagesOf(client, EntitiesApi_GetAllEntitiesWorkspaceColorPalettes, {
|
|
178
|
+
workspaceId: this.workspace,
|
|
179
|
+
// Only the workspace's own palettes are manageable here; exclude inherited parent palettes.
|
|
180
|
+
origin: "NATIVE",
|
|
181
|
+
sort: ["name"],
|
|
182
|
+
})
|
|
183
|
+
.then(MetadataUtilities.mergeEntitiesResults)
|
|
184
|
+
.then((colorPalettes) => {
|
|
185
|
+
return colorPalettes.data
|
|
186
|
+
.filter((colorPaletteData) => isValidColorPalette(getColorPaletteFromMDObject(colorPaletteData)))
|
|
187
|
+
.map(convertColorPaletteWithLinks);
|
|
188
|
+
}));
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* Create a new color palette on the workspace level.
|
|
192
|
+
*
|
|
193
|
+
* @param colorPalette - color palette definition; a random id is generated when none is provided
|
|
194
|
+
* @returns promise of the created color palette metadata object
|
|
195
|
+
* @throws Error when the color palette content is not a valid palette
|
|
196
|
+
*/
|
|
197
|
+
async createColorPalette(colorPalette) {
|
|
198
|
+
if (isValidColorPalette(colorPalette.colorPalette)) {
|
|
199
|
+
return await this.authCall((client) => EntitiesApi_CreateEntityWorkspaceColorPalettes(client.axios, client.basePath, {
|
|
200
|
+
workspaceId: this.workspace,
|
|
201
|
+
jsonApiWorkspaceColorPaletteInDocument: {
|
|
202
|
+
data: convertWorkspaceColorPaletteToBackend(colorPalette.id || uuidv4(), colorPalette),
|
|
203
|
+
},
|
|
204
|
+
}).then(this.parseColorPaletteResult));
|
|
205
|
+
}
|
|
206
|
+
throw new Error("Invalid color palette format");
|
|
207
|
+
}
|
|
208
|
+
/**
|
|
209
|
+
* Update an existing color palette on the workspace level. Falls back to {@link createColorPalette} when
|
|
210
|
+
* the definition carries no reference yet.
|
|
211
|
+
*
|
|
212
|
+
* @param colorPalette - color palette definition
|
|
213
|
+
* @returns promise of the updated color palette metadata object
|
|
214
|
+
* @throws Error when the color palette content is not a valid palette
|
|
215
|
+
*/
|
|
216
|
+
async updateColorPalette(colorPalette) {
|
|
217
|
+
if (!colorPalette.ref) {
|
|
218
|
+
return this.createColorPalette(colorPalette);
|
|
219
|
+
}
|
|
220
|
+
if (isValidColorPalette(colorPalette.colorPalette)) {
|
|
221
|
+
const id = objRefToIdentifier(colorPalette.ref, this.authCall);
|
|
222
|
+
return await this.authCall((client) => EntitiesApi_UpdateEntityWorkspaceColorPalettes(client.axios, client.basePath, {
|
|
223
|
+
workspaceId: this.workspace,
|
|
224
|
+
objectId: id,
|
|
225
|
+
jsonApiWorkspaceColorPaletteInDocument: {
|
|
226
|
+
data: convertWorkspaceColorPaletteToBackend(id, colorPalette),
|
|
227
|
+
},
|
|
228
|
+
}).then(this.parseColorPaletteResult));
|
|
229
|
+
}
|
|
230
|
+
throw new Error("Invalid color palette format");
|
|
231
|
+
}
|
|
232
|
+
/**
|
|
233
|
+
* Delete a color palette on the workspace level.
|
|
234
|
+
*
|
|
235
|
+
* @param colorPaletteRef - color palette reference
|
|
236
|
+
* @returns promise
|
|
237
|
+
*/
|
|
238
|
+
async deleteColorPalette(colorPaletteRef) {
|
|
239
|
+
const id = objRefToIdentifier(colorPaletteRef, this.authCall);
|
|
240
|
+
await this.authCall((client) => EntitiesApi_DeleteEntityWorkspaceColorPalettes(client.axios, client.basePath, {
|
|
241
|
+
workspaceId: this.workspace,
|
|
242
|
+
objectId: id,
|
|
243
|
+
}));
|
|
244
|
+
}
|
|
245
|
+
parseColorPaletteResult(result) {
|
|
246
|
+
return convertColorPaletteFromBackend(result.data);
|
|
247
|
+
}
|
|
86
248
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type AutomationAutomationAlert, type JsonApiAutomationOutAttributesStateEnum, type JsonApiAutomationOutIncludes, type JsonApiAutomationOutList, type JsonApiAutomationOutWithLinks, type JsonApiWorkspaceAutomationOutWithLinks } from "@gooddata/api-client-tiger";
|
|
2
2
|
import { type FilterContextItem, type IAutomationAlert, type IAutomationMetadataObject, type IFilter } from "@gooddata/sdk-model";
|
|
3
|
-
export declare function convertAutomation(automation: JsonApiAutomationOutWithLinks | JsonApiWorkspaceAutomationOutWithLinks, included: JsonApiAutomationOutIncludes[]
|
|
4
|
-
export declare const convertAutomationListToAutomations: (automationList: JsonApiAutomationOutList
|
|
3
|
+
export declare function convertAutomation(automation: JsonApiAutomationOutWithLinks | JsonApiWorkspaceAutomationOutWithLinks, included: JsonApiAutomationOutIncludes[]): IAutomationMetadataObject;
|
|
4
|
+
export declare const convertAutomationListToAutomations: (automationList: JsonApiAutomationOutList) => IAutomationMetadataObject[];
|
|
5
5
|
export declare const convertAlert: (alert: import("@gooddata/api-client-tiger").AiAlertDefinition | AutomationAutomationAlert | undefined, state?: JsonApiAutomationOutAttributesStateEnum | undefined) => IAutomationAlert | undefined;
|
|
6
6
|
/**
|
|
7
7
|
* Converts a legacy execution-level filter to a dashboard `FilterContextItem`. Used during
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AutomationConverter.d.ts","sourceRoot":"","sources":["../../../src/convertors/fromBackend/AutomationConverter.ts"],"names":[],"mappings":"AAIA,OAAO,EAIH,KAAK,yBAAyB,EAO9B,KAAK,uCAAuC,EAC5C,KAAK,4BAA4B,EACjC,KAAK,wBAAwB,EAE7B,KAAK,6BAA6B,EAQlC,KAAK,sCAAsC,EAK9C,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAEH,KAAK,iBAAiB,EAEtB,KAAK,gBAAgB,EACrB,KAAK,yBAAyB,EAI9B,KAAK,OAAO,EA0Bf,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"AutomationConverter.d.ts","sourceRoot":"","sources":["../../../src/convertors/fromBackend/AutomationConverter.ts"],"names":[],"mappings":"AAIA,OAAO,EAIH,KAAK,yBAAyB,EAO9B,KAAK,uCAAuC,EAC5C,KAAK,4BAA4B,EACjC,KAAK,wBAAwB,EAE7B,KAAK,6BAA6B,EAQlC,KAAK,sCAAsC,EAK9C,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAEH,KAAK,iBAAiB,EAEtB,KAAK,gBAAgB,EACrB,KAAK,yBAAyB,EAI9B,KAAK,OAAO,EA0Bf,MAAM,qBAAqB,CAAC;AA0I7B,wBAAgB,iBAAiB,CAC7B,UAAU,EAAE,6BAA6B,GAAG,sCAAsC,EAClF,QAAQ,EAAE,4BAA4B,EAAE,GACzC,yBAAyB,CA0H3B;AAED,eAAO,MAAM,kCAAkC,2EAM9C,CAAC;AAiBF,eAAO,MAAM,YAAY,sMAoGxB,CAAC;AA0CF;;;;;;;GAOG;AACH,wBAAgB,yCAAyC,CACrD,MAAM,EAAE,OAAO,EACf,uBAAuB,EAAE,MAAM,GAChC,iBAAiB,GAAG,SAAS,CAgG/B"}
|
|
@@ -5,7 +5,7 @@ import { fixNumber } from "../../utils/fixNumber.js";
|
|
|
5
5
|
import { convertFilter } from "./afm/FilterConverter.js";
|
|
6
6
|
import { convertMeasure } from "./afm/MeasureConverter.js";
|
|
7
7
|
import { convertAttribute } from "./AttributeConvertor.js";
|
|
8
|
-
import { convertDashboardTabularExportRequest, convertExportDefinitionMdObject as convertExportDefinitionMdObjectFromBackend, convertImageExportRequest,
|
|
8
|
+
import { convertDashboardTabularExportRequest, convertExportDefinitionMdObject as convertExportDefinitionMdObjectFromBackend, convertImageExportRequest, convertSlidesExportRequest, convertTabularExportRequest, convertToRawExportRequest, convertVisualExportRequest, wrapExportDefinition, } from "./ExportDefinitionsConverter.js";
|
|
9
9
|
import { convertUserIdentifier } from "./UsersConverter.js";
|
|
10
10
|
function convertRecipient(userLinkage, included) {
|
|
11
11
|
const linkedUser = included.find((i) => i.type === "user" && i.id === userLinkage.id);
|
|
@@ -78,7 +78,7 @@ const convertAutomationResult = (relationships, included) => {
|
|
|
78
78
|
}, undefined) ?? results[results.length - 1];
|
|
79
79
|
return latestResult?.attributes;
|
|
80
80
|
};
|
|
81
|
-
export function convertAutomation(automation, included
|
|
81
|
+
export function convertAutomation(automation, included) {
|
|
82
82
|
const { id, attributes = {}, relationships = {} } = automation;
|
|
83
83
|
const { title, description, tags, schedule, alert, details, createdAt, modifiedAt, metadata, state, visualExports, tabularExports, imageExports, slidesExports, rawExports, dashboardTabularExports, externalRecipients, evaluationMode, } = attributes;
|
|
84
84
|
const { createdBy, modifiedBy } = relationships;
|
|
@@ -87,20 +87,14 @@ export function convertAutomation(automation, included, enableNewScheduledExport
|
|
|
87
87
|
const includedExportDefinitions = compact(exportDefinitionsIds.map((exportDefinitionId) => included.find((i) => i.type === "exportDefinition" && i.id === exportDefinitionId)));
|
|
88
88
|
const exportDefinitions = [
|
|
89
89
|
...includedExportDefinitions.map((ed) => convertExportDefinitionMdObjectFromBackend(ed, undefined)),
|
|
90
|
-
...(visualExports?.map((ve) =>
|
|
91
|
-
|
|
92
|
-
: convertInlineExportDefinitionMdObject(ve)) ?? []),
|
|
93
|
-
...(tabularExports?.map((te) => enableNewScheduledExport
|
|
94
|
-
? wrapExportDefinition(convertTabularExportRequest(te), te.requestPayload.metadata ?? undefined)
|
|
95
|
-
: convertInlineExportDefinitionMdObject(te)) ?? []),
|
|
90
|
+
...(visualExports?.map((ve) => wrapExportDefinition(convertVisualExportRequest(ve), ve.requestPayload.metadata)) ?? []),
|
|
91
|
+
...(tabularExports?.map((te) => wrapExportDefinition(convertTabularExportRequest(te), te.requestPayload.metadata ?? undefined)) ?? []),
|
|
96
92
|
...(imageExports?.map((ie) => wrapExportDefinition(convertImageExportRequest(ie), ie.requestPayload.metadata ?? undefined)) ?? []),
|
|
97
93
|
...(slidesExports?.map((se) => wrapExportDefinition(convertSlidesExportRequest(se), se.requestPayload.metadata ?? undefined)) ?? []),
|
|
98
94
|
...(dashboardTabularExports?.map((dte) => wrapExportDefinition(convertDashboardTabularExportRequest(dte))) ?? []),
|
|
99
95
|
...(rawExports?.map((re) => wrapExportDefinition(convertToRawExportRequest(re), re.requestPayload.metadata ?? undefined)) ?? []),
|
|
100
96
|
];
|
|
101
|
-
const normalizedExportDefinitions =
|
|
102
|
-
? exportDefinitions.map(convertLegacyTabularFiltersToFilterContext)
|
|
103
|
-
: exportDefinitions;
|
|
97
|
+
const normalizedExportDefinitions = exportDefinitions.map(convertLegacyTabularFiltersToFilterContext);
|
|
104
98
|
const recipients = [
|
|
105
99
|
...(relationships?.recipients?.data
|
|
106
100
|
?.map((r) => convertRecipient(r, included))
|
|
@@ -159,23 +153,22 @@ export function convertAutomation(automation, included, enableNewScheduledExport
|
|
|
159
153
|
deprecated: false,
|
|
160
154
|
};
|
|
161
155
|
}
|
|
162
|
-
export const convertAutomationListToAutomations = (automationList
|
|
163
|
-
return automationList.data.map((automationObject) => convertAutomation(automationObject, automationList.included ?? []
|
|
156
|
+
export const convertAutomationListToAutomations = (automationList) => {
|
|
157
|
+
return automationList.data.map((automationObject) => convertAutomation(automationObject, automationList.included ?? []));
|
|
164
158
|
};
|
|
165
159
|
/**
|
|
166
|
-
*
|
|
167
|
-
*
|
|
160
|
+
* The wire value is an untyped string with no type tag. A value that parses to a finite number
|
|
161
|
+
* decodes as a number (legacy NUMBER rows, incl. `Number("") === 0`); everything else passes
|
|
162
|
+
* through as-is, so a STRING value that happens to look numeric decodes as a number too.
|
|
168
163
|
*/
|
|
169
164
|
function convertParameterItems(items) {
|
|
170
|
-
|
|
171
|
-
for (const item of items) {
|
|
165
|
+
return items.map((item) => {
|
|
172
166
|
const value = Number(item.value);
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
}
|
|
178
|
-
return result;
|
|
167
|
+
return {
|
|
168
|
+
ref: idRef(item.parameter.identifier.id, "parameter"),
|
|
169
|
+
value: Number.isFinite(value) ? value : item.value,
|
|
170
|
+
};
|
|
171
|
+
});
|
|
179
172
|
}
|
|
180
173
|
export const convertAlert = (alert, state) => {
|
|
181
174
|
if (!alert) {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { type JsonApiColorPaletteOutDocument, type JsonApiColorPaletteOutWithLinks } from "@gooddata/api-client-tiger";
|
|
1
|
+
import { type JsonApiColorPaletteOutDocument, type JsonApiColorPaletteOutWithLinks, type JsonApiWorkspaceColorPaletteOutDocument, type JsonApiWorkspaceColorPaletteOutWithLinks } from "@gooddata/api-client-tiger";
|
|
2
2
|
import { type IColorPalette, type IColorPaletteMetadataObject } from "@gooddata/sdk-model";
|
|
3
3
|
export declare const unwrapColorPaletteContent: (value: object) => IColorPalette;
|
|
4
|
-
export declare const convertColorPaletteWithLinks: (colorPaletteObject: JsonApiColorPaletteOutWithLinks) => IColorPaletteMetadataObject;
|
|
5
|
-
export declare const getColorPaletteFromMDObject: ({ attributes, }: JsonApiColorPaletteOutWithLinks) => IColorPalette;
|
|
4
|
+
export declare const convertColorPaletteWithLinks: (colorPaletteObject: JsonApiColorPaletteOutWithLinks | JsonApiWorkspaceColorPaletteOutWithLinks) => IColorPaletteMetadataObject;
|
|
5
|
+
export declare const getColorPaletteFromMDObject: ({ attributes, }: JsonApiColorPaletteOutWithLinks | JsonApiWorkspaceColorPaletteOutWithLinks) => IColorPalette;
|
|
6
6
|
export declare const isValidColorPalette: (colorPalette: IColorPalette) => boolean;
|
|
7
|
-
export declare const convertColorPalette: (
|
|
7
|
+
export declare const convertColorPalette: (document: JsonApiColorPaletteOutDocument | JsonApiWorkspaceColorPaletteOutDocument) => IColorPaletteMetadataObject;
|
|
8
8
|
//# sourceMappingURL=ColorPaletteConverter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ColorPaletteConverter.d.ts","sourceRoot":"","sources":["../../../src/convertors/fromBackend/ColorPaletteConverter.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ColorPaletteConverter.d.ts","sourceRoot":"","sources":["../../../src/convertors/fromBackend/ColorPaletteConverter.ts"],"names":[],"mappings":"AAEA,OAAO,EACH,KAAK,8BAA8B,EACnC,KAAK,+BAA+B,EACpC,KAAK,uCAAuC,EAC5C,KAAK,wCAAwC,EAChD,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACH,KAAK,aAAa,EAClB,KAAK,2BAA2B,EAGnC,MAAM,qBAAqB,CAAC;AAE7B,eAAO,MAAM,yBAAyB,kCAErC,CAAC;AAMF,eAAO,MAAM,4BAA4B,iIAiBxC,CAAC;AAEF,eAAO,MAAM,2BAA2B,gHAIvC,CAAC;AAEF,eAAO,MAAM,mBAAmB,0CAE/B,CAAC;AAEF,eAAO,MAAM,mBAAmB,qHAE2E,CAAC"}
|
|
@@ -1,13 +1,18 @@
|
|
|
1
|
+
// (C) 2022-2026 GoodData Corporation
|
|
1
2
|
import { idRef, isColorPaletteItem, } from "@gooddata/sdk-model";
|
|
2
3
|
export const unwrapColorPaletteContent = (value) => {
|
|
3
4
|
return value?.colorPalette ?? [];
|
|
4
5
|
};
|
|
6
|
+
// Accepts both organization- and workspace-scoped color palette objects. The JSON:API `type`
|
|
7
|
+
// ("colorPalette" / "workspaceColorPalette") is carried onto the returned reference so the object's scope is
|
|
8
|
+
// preserved and it can be handed straight back to setActiveColorPalette; the metadata object kind itself is
|
|
9
|
+
// always "colorPalette".
|
|
5
10
|
export const convertColorPaletteWithLinks = (colorPaletteObject) => {
|
|
6
|
-
const { id, attributes, links } = colorPaletteObject;
|
|
11
|
+
const { id, type, attributes, links } = colorPaletteObject;
|
|
7
12
|
const colorPalette = getColorPaletteFromMDObject(colorPaletteObject);
|
|
8
13
|
return {
|
|
9
14
|
id,
|
|
10
|
-
ref: idRef(id),
|
|
15
|
+
ref: idRef(id, type),
|
|
11
16
|
title: attributes.name,
|
|
12
17
|
colorPalette: isValidColorPalette(colorPalette) ? colorPalette : [],
|
|
13
18
|
uri: links.self,
|
|
@@ -24,4 +29,4 @@ export const getColorPaletteFromMDObject = ({ attributes, }) => {
|
|
|
24
29
|
export const isValidColorPalette = (colorPalette) => {
|
|
25
30
|
return colorPalette && Array.isArray(colorPalette) && colorPalette.every(isColorPaletteItem);
|
|
26
31
|
};
|
|
27
|
-
export const convertColorPalette = (
|
|
32
|
+
export const convertColorPalette = (document) => convertColorPaletteWithLinks({ ...document.data, links: document.links });
|
|
@@ -17,6 +17,5 @@ export declare const convertImageExportRequest: (exportRequest: AutomationAutoma
|
|
|
17
17
|
export declare const convertSlidesExportRequest: (exportRequest: AutomationAutomationSlidesExport) => IExportDefinitionDashboardRequestPayload | IExportDefinitionVisualizationObjectRequestPayload;
|
|
18
18
|
export declare const convertTabularExportRequest: (exportRequest: AutomationAutomationTabularExport) => IExportDefinitionVisualizationObjectRequestPayload;
|
|
19
19
|
export declare const convertExportDefinitionMdObject: (exportDefinitionOut: JsonApiExportDefinitionOutWithLinks, included?: JsonApiExportDefinitionOutIncludes[]) => IExportDefinitionMetadataObject;
|
|
20
|
-
export declare const convertInlineExportDefinitionMdObject: (exportDefinitionOut: AutomationAutomationTabularExport | AutomationAutomationVisualExport) => IExportDefinitionMetadataObject;
|
|
21
20
|
export {};
|
|
22
21
|
//# sourceMappingURL=ExportDefinitionsConverter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExportDefinitionsConverter.d.ts","sourceRoot":"","sources":["../../../src/convertors/fromBackend/ExportDefinitionsConverter.ts"],"names":[],"mappings":"AAKA,OAAO,EACH,KAAK,+BAA+B,EACpC,KAAK,gCAAgC,EACrC,KAAK,iCAAiC,EACtC,KAAK,gCAAgC,EAErC,KAAK,YAAY,EACjB,KAAK,uBAAuB,EAC5B,KAAK,kCAAkC,EACvC,KAAK,mCAAmC,EACxC,KAAK,mEAAmE,EACxE,KAAK,sDAAsD,EAI9D,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAEH,KAAK,yBAAyB,EAC9B,KAAK,wCAAwC,EAE7C,KAAK,+BAA+B,EACpC,KAAK,+BAA+B,EACpC,KAAK,kDAAkD,EAG1D,MAAM,qBAAqB,CAAC;AAsC7B,KAAK,wBAAwB,CAAC,CAAC,SAAS,YAAY,GAAG,uBAAuB,GAAG,uBAAuB,IAAI;IACxG,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,CAAC,EAAE,CAAC;IACd,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,uBAAuB,EAAE,CAAC,CAAC;IACzD,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,yBAAyB,EAAE,CAAC,CAAC;CACjE,CAAC;AASF,eAAO,MAAM,oBAAoB,gKAkBhC,CAAC;AAEF,eAAO,MAAM,oCAAoC,uLA2DhD,CAAC;AAEF,eAAO,MAAM,0BAA0B,+FAmCtC,CAAC;AAEF,eAAO,MAAM,yBAAyB,+HAwBrC,CAAC;AAEF,eAAO,MAAM,yBAAyB,wGAqBrC,CAAC;AAEF,eAAO,MAAM,0BAA0B,oJAmDtC,CAAC;AAEF,eAAO,MAAM,2BAA2B,0GAiCvC,CAAC;AAEF,eAAO,MAAM,+BAA+B,gJAmC3C,CAAC
|
|
1
|
+
{"version":3,"file":"ExportDefinitionsConverter.d.ts","sourceRoot":"","sources":["../../../src/convertors/fromBackend/ExportDefinitionsConverter.ts"],"names":[],"mappings":"AAKA,OAAO,EACH,KAAK,+BAA+B,EACpC,KAAK,gCAAgC,EACrC,KAAK,iCAAiC,EACtC,KAAK,gCAAgC,EAErC,KAAK,YAAY,EACjB,KAAK,uBAAuB,EAC5B,KAAK,kCAAkC,EACvC,KAAK,mCAAmC,EACxC,KAAK,mEAAmE,EACxE,KAAK,sDAAsD,EAI9D,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAEH,KAAK,yBAAyB,EAC9B,KAAK,wCAAwC,EAE7C,KAAK,+BAA+B,EACpC,KAAK,+BAA+B,EACpC,KAAK,kDAAkD,EAG1D,MAAM,qBAAqB,CAAC;AAsC7B,KAAK,wBAAwB,CAAC,CAAC,SAAS,YAAY,GAAG,uBAAuB,GAAG,uBAAuB,IAAI;IACxG,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,CAAC,EAAE,CAAC;IACd,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,uBAAuB,EAAE,CAAC,CAAC;IACzD,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,yBAAyB,EAAE,CAAC,CAAC;CACjE,CAAC;AASF,eAAO,MAAM,oBAAoB,gKAkBhC,CAAC;AAEF,eAAO,MAAM,oCAAoC,uLA2DhD,CAAC;AAEF,eAAO,MAAM,0BAA0B,+FAmCtC,CAAC;AAEF,eAAO,MAAM,yBAAyB,+HAwBrC,CAAC;AAEF,eAAO,MAAM,yBAAyB,wGAqBrC,CAAC;AAEF,eAAO,MAAM,0BAA0B,oJAmDtC,CAAC;AAEF,eAAO,MAAM,2BAA2B,0GAiCvC,CAAC;AAEF,eAAO,MAAM,+BAA+B,gJAmC3C,CAAC"}
|
|
@@ -231,24 +231,6 @@ export const convertExportDefinitionMdObject = (exportDefinitionOut, included =
|
|
|
231
231
|
unlisted: false,
|
|
232
232
|
};
|
|
233
233
|
};
|
|
234
|
-
export const convertInlineExportDefinitionMdObject = (exportDefinitionOut) => {
|
|
235
|
-
const id = uuid();
|
|
236
|
-
const request = convertExportDefinitionRequestPayload(exportDefinitionOut.requestPayload);
|
|
237
|
-
const metadata = exportDefinitionOut.requestPayload.metadata;
|
|
238
|
-
return {
|
|
239
|
-
type: "exportDefinition",
|
|
240
|
-
id,
|
|
241
|
-
uri: id,
|
|
242
|
-
ref: idRef(id, "exportDefinition"),
|
|
243
|
-
title: metadata?.title ?? "",
|
|
244
|
-
description: "",
|
|
245
|
-
tags: [],
|
|
246
|
-
requestPayload: request,
|
|
247
|
-
production: true,
|
|
248
|
-
deprecated: false,
|
|
249
|
-
unlisted: false,
|
|
250
|
-
};
|
|
251
|
-
};
|
|
252
234
|
const convertExportDefinitionRequestPayload = (exportRequest) => {
|
|
253
235
|
if (isTabularRequest(exportRequest)) {
|
|
254
236
|
const { widget, parametersByTab } = exportRequest.metadata ?? {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type JsonApiThemeOutDocument, type JsonApiThemeOutWithLinks } from "@gooddata/api-client-tiger";
|
|
1
|
+
import { type JsonApiThemeOutDocument, type JsonApiThemeOutWithLinks, type JsonApiWorkspaceThemeOutDocument, type JsonApiWorkspaceThemeOutWithLinks } from "@gooddata/api-client-tiger";
|
|
2
2
|
import { type IThemeMetadataObject } from "@gooddata/sdk-model";
|
|
3
|
-
export declare const convertThemeWithLinks: ({ id, attributes, links, }: JsonApiThemeOutWithLinks) => IThemeMetadataObject;
|
|
4
|
-
export declare const convertTheme: (
|
|
3
|
+
export declare const convertThemeWithLinks: ({ id, type, attributes, links, }: JsonApiThemeOutWithLinks | JsonApiWorkspaceThemeOutWithLinks) => IThemeMetadataObject;
|
|
4
|
+
export declare const convertTheme: (document: JsonApiThemeOutDocument | JsonApiWorkspaceThemeOutDocument) => IThemeMetadataObject;
|
|
5
5
|
//# sourceMappingURL=ThemeConverter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThemeConverter.d.ts","sourceRoot":"","sources":["../../../src/convertors/fromBackend/ThemeConverter.ts"],"names":[],"mappings":"AAEA,OAAO,
|
|
1
|
+
{"version":3,"file":"ThemeConverter.d.ts","sourceRoot":"","sources":["../../../src/convertors/fromBackend/ThemeConverter.ts"],"names":[],"mappings":"AAEA,OAAO,EACH,KAAK,uBAAuB,EAC5B,KAAK,wBAAwB,EAC7B,KAAK,gCAAgC,EACrC,KAAK,iCAAiC,EACzC,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,KAAK,oBAAoB,EAAS,MAAM,qBAAqB,CAAC;AAKvE,eAAO,MAAM,qBAAqB,0HAgBhC,CAAC;AAEH,eAAO,MAAM,YAAY,gGAEoE,CAAC"}
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
// (C) 2022-
|
|
1
|
+
// (C) 2022-2026 GoodData Corporation
|
|
2
2
|
import { idRef } from "@gooddata/sdk-model";
|
|
3
|
-
|
|
3
|
+
// Accepts both organization- and workspace-scoped theme objects. The JSON:API `type` ("theme" /
|
|
4
|
+
// "workspaceTheme") is carried onto the returned reference so the object's scope is preserved and it can
|
|
5
|
+
// be handed straight back to setActiveTheme; the metadata object kind itself is always "theme".
|
|
6
|
+
export const convertThemeWithLinks = ({ id, type, attributes, links, }) => ({
|
|
4
7
|
id,
|
|
5
|
-
ref: idRef(id),
|
|
8
|
+
ref: idRef(id, type),
|
|
6
9
|
title: attributes.name,
|
|
7
10
|
theme: attributes.content,
|
|
8
11
|
uri: links.self,
|
|
@@ -12,4 +15,4 @@ export const convertThemeWithLinks = ({ id, attributes, links, }) => ({
|
|
|
12
15
|
unlisted: false,
|
|
13
16
|
deprecated: false,
|
|
14
17
|
});
|
|
15
|
-
export const convertTheme = (
|
|
18
|
+
export const convertTheme = (document) => convertThemeWithLinks({ ...document.data, links: document.links });
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type JsonApiAutomationIn, type JsonApiWorkspaceAutomationOutAttributesAlert } from "@gooddata/api-client-tiger";
|
|
2
2
|
import { type IRawExportCustomOverrides } from "@gooddata/sdk-backend-spi";
|
|
3
3
|
import { type IAutomationAlert, type IAutomationMetadataObject, type IAutomationMetadataObjectDefinition, type IExecutionDefinition } from "@gooddata/sdk-model";
|
|
4
|
-
export declare function convertAutomation(automation: IAutomationMetadataObject | IAutomationMetadataObjectDefinition,
|
|
4
|
+
export declare function convertAutomation(automation: IAutomationMetadataObject | IAutomationMetadataObjectDefinition, widgetExecution?: IExecutionDefinition, overrides?: IRawExportCustomOverrides): JsonApiAutomationIn;
|
|
5
5
|
export declare const convertAlert: (alert: IAutomationAlert) => JsonApiWorkspaceAutomationOutAttributesAlert;
|
|
6
6
|
//# sourceMappingURL=AutomationConverter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AutomationConverter.d.ts","sourceRoot":"","sources":["../../../src/convertors/toBackend/AutomationConverter.ts"],"names":[],"mappings":"AAKA,OAAO,EAGH,KAAK,mBAAmB,EAExB,KAAK,4CAA4C,EAEpD,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,KAAK,yBAAyB,EAAE,MAAM,2BAA2B,CAAC;AAC3E,OAAO,EACH,KAAK,gBAAgB,EACrB,KAAK,yBAAyB,EAC9B,KAAK,mCAAmC,EACxC,KAAK,oBAAoB,EAK5B,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"AutomationConverter.d.ts","sourceRoot":"","sources":["../../../src/convertors/toBackend/AutomationConverter.ts"],"names":[],"mappings":"AAKA,OAAO,EAGH,KAAK,mBAAmB,EAExB,KAAK,4CAA4C,EAEpD,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,KAAK,yBAAyB,EAAE,MAAM,2BAA2B,CAAC;AAC3E,OAAO,EACH,KAAK,gBAAgB,EACrB,KAAK,yBAAyB,EAC9B,KAAK,mCAAmC,EACxC,KAAK,oBAAoB,EAK5B,MAAM,qBAAqB,CAAC;AAmB7B,wBAAgB,iBAAiB,CAC7B,UAAU,EAAE,yBAAyB,GAAG,mCAAmC,EAC3E,eAAe,CAAC,EAAE,oBAAoB,EACtC,SAAS,CAAC,EAAE,yBAAyB,GACtC,mBAAmB,CAsNrB;AAED,eAAO,MAAM,YAAY,2EAgGxB,CAAC"}
|