@gooddata/sdk-backend-tiger 11.55.0-alpha.2 → 11.55.0-alpha.4
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 +1 -0
- package/esm/backend/settings/mapping.d.ts.map +1 -1
- package/esm/backend/settings/mapping.js +1 -0
- package/esm/backend/uiFeatures.d.ts +3 -0
- package/esm/backend/uiFeatures.d.ts.map +1 -1
- package/esm/backend/uiFeatures.js +3 -0
- package/esm/backend/workspace/catalog/availableItemsFactory.d.ts +0 -7
- package/esm/backend/workspace/catalog/availableItemsFactory.d.ts.map +1 -1
- package/esm/backend/workspace/catalog/availableItemsFactory.js +3 -29
- package/esm/backend/workspace/computedAttributes/index.d.ts.map +1 -1
- package/esm/backend/workspace/computedAttributes/index.js +19 -7
- package/esm/backend/workspace/execution/executionResult.d.ts.map +1 -1
- package/esm/backend/workspace/execution/executionResult.js +4 -0
- package/esm/backend/workspace/genAI/SemanticSearchQuery.js +1 -1
- package/esm/backend/workspace/index.js +2 -2
- package/esm/backend/workspace/insights/index.d.ts.map +1 -1
- package/esm/backend/workspace/insights/index.js +5 -0
- package/esm/backend/workspace/measures/index.d.ts.map +1 -1
- package/esm/backend/workspace/measures/index.js +1 -0
- package/esm/backend/workspace/measures/measuresQuery.d.ts +2 -0
- package/esm/backend/workspace/measures/measuresQuery.d.ts.map +1 -1
- package/esm/backend/workspace/measures/measuresQuery.js +11 -1
- package/esm/backend/workspace/objectPermissions/index.d.ts +1 -1
- package/esm/backend/workspace/objectPermissions/index.d.ts.map +1 -1
- package/esm/backend/workspace/reports.d.ts +29 -10
- package/esm/backend/workspace/reports.d.ts.map +1 -1
- package/esm/backend/workspace/reports.js +229 -38
- package/esm/backend/workspace/settings/index.d.ts +3 -1
- package/esm/backend/workspace/settings/index.d.ts.map +1 -1
- package/esm/backend/workspace/settings/index.js +6 -0
- package/esm/convertors/fromBackend/AutomationConverter.d.ts.map +1 -1
- package/esm/convertors/fromBackend/AutomationConverter.js +7 -10
- package/esm/convertors/fromBackend/ReportsConverter.d.ts +6 -0
- package/esm/convertors/fromBackend/ReportsConverter.d.ts.map +1 -0
- package/esm/convertors/fromBackend/ReportsConverter.js +44 -0
- package/esm/convertors/toBackend/ConditionalFormattingConverter.d.ts +35 -0
- package/esm/convertors/toBackend/ConditionalFormattingConverter.d.ts.map +1 -0
- package/esm/convertors/toBackend/ConditionalFormattingConverter.js +83 -0
- package/esm/convertors/toBackend/ReportsConverter.d.ts +6 -0
- package/esm/convertors/toBackend/ReportsConverter.d.ts.map +1 -0
- package/esm/convertors/toBackend/ReportsConverter.js +28 -0
- package/package.json +13 -13
|
@@ -1,45 +1,236 @@
|
|
|
1
1
|
// (C) 2026 GoodData Corporation
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
2
|
+
import { v4 as uuidv4 } from "uuid";
|
|
3
|
+
import { ActionsUtilities } from "@gooddata/api-client-tiger";
|
|
4
|
+
import { EntitiesApi_CreateEntityReportPageLayouts, EntitiesApi_CreateEntityReportTemplates, EntitiesApi_CreateEntityReports, EntitiesApi_DeleteEntityReportPageLayouts, EntitiesApi_DeleteEntityReportTemplates, EntitiesApi_DeleteEntityReports, EntitiesApi_GetAllEntitiesReportPageLayouts, EntitiesApi_GetAllEntitiesReportTemplates, EntitiesApi_GetAllEntitiesReports, EntitiesApi_GetEntityReportPageLayouts, EntitiesApi_GetEntityReportTemplates, EntitiesApi_GetEntityReports, EntitiesApi_UpdateEntityReportPageLayouts, EntitiesApi_UpdateEntityReportTemplates, EntitiesApi_UpdateEntityReports, } from "@gooddata/api-client-tiger/endpoints/entitiesObjects";
|
|
5
|
+
import { UnexpectedError } from "@gooddata/sdk-backend-spi";
|
|
6
|
+
import { BuiltInReportPageLayouts, areObjRefsEqual, objRefToString, sanitizeReportsBrandKit, } from "@gooddata/sdk-model";
|
|
7
|
+
import { convertReport, convertReportPageLayout, convertReportTemplate, } from "../../convertors/fromBackend/ReportsConverter.js";
|
|
8
|
+
import { convertReportPageLayoutToBackend, convertReportTemplateToBackend, convertReportToBackend, } from "../../convertors/toBackend/ReportsConverter.js";
|
|
9
|
+
import { objRefToIdentifier } from "../../utils/api.js";
|
|
10
|
+
import { TigerWorkspaceSettings } from "./settings/index.js";
|
|
11
|
+
function findBuiltInPageLayout(ref) {
|
|
12
|
+
return BuiltInReportPageLayouts.find((layout) => areObjRefsEqual(layout.ref, ref));
|
|
13
|
+
}
|
|
14
|
+
export class TigerWorkspaceReportsService {
|
|
15
|
+
authCall;
|
|
16
|
+
workspace;
|
|
17
|
+
constructor(authCall, workspace) {
|
|
18
|
+
this.authCall = authCall;
|
|
19
|
+
this.workspace = workspace;
|
|
20
|
+
}
|
|
21
|
+
getReportPageLayouts = async () => {
|
|
22
|
+
const layouts = await this.authCall((client) => ActionsUtilities.loadAllPages(({ page, size }) => EntitiesApi_GetAllEntitiesReportPageLayouts(client.axios, client.basePath, {
|
|
23
|
+
workspaceId: this.workspace,
|
|
24
|
+
metaInclude: ["origin"],
|
|
25
|
+
page,
|
|
26
|
+
size,
|
|
27
|
+
}).then((response) => response.data.data.map(convertReportPageLayout))));
|
|
28
|
+
return [...BuiltInReportPageLayouts, ...layouts];
|
|
29
|
+
};
|
|
30
|
+
getReportPageLayout = async (ref) => {
|
|
31
|
+
const builtIn = findBuiltInPageLayout(ref);
|
|
32
|
+
if (builtIn) {
|
|
33
|
+
return builtIn;
|
|
34
|
+
}
|
|
35
|
+
const objectId = objRefToIdentifier(ref, this.authCall);
|
|
36
|
+
return this.authCall(async (client) => {
|
|
37
|
+
const response = await EntitiesApi_GetEntityReportPageLayouts(client.axios, client.basePath, {
|
|
38
|
+
workspaceId: this.workspace,
|
|
39
|
+
objectId,
|
|
40
|
+
metaInclude: ["origin"],
|
|
41
|
+
});
|
|
42
|
+
return convertReportPageLayout(response.data.data);
|
|
43
|
+
});
|
|
44
|
+
};
|
|
45
|
+
createReportPageLayout = async (layout) => {
|
|
46
|
+
const id = this.newObjectId(layout.ref, "Report page layout");
|
|
47
|
+
return this.authCall(async (client) => {
|
|
48
|
+
const response = await EntitiesApi_CreateEntityReportPageLayouts(client.axios, client.basePath, {
|
|
49
|
+
workspaceId: this.workspace,
|
|
50
|
+
jsonApiReportPageLayoutPostOptionalIdDocument: {
|
|
51
|
+
data: {
|
|
52
|
+
type: "reportPageLayout",
|
|
53
|
+
id,
|
|
54
|
+
attributes: convertReportPageLayoutToBackend(layout),
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
});
|
|
58
|
+
return convertReportPageLayout(response.data.data);
|
|
59
|
+
});
|
|
60
|
+
};
|
|
61
|
+
updateReportPageLayout = async (layout) => {
|
|
62
|
+
const objectId = this.editableObjectId(layout.ref, "Report page layout");
|
|
63
|
+
return this.authCall(async (client) => {
|
|
64
|
+
const response = await EntitiesApi_UpdateEntityReportPageLayouts(client.axios, client.basePath, {
|
|
65
|
+
workspaceId: this.workspace,
|
|
66
|
+
objectId,
|
|
67
|
+
jsonApiReportPageLayoutInDocument: {
|
|
68
|
+
data: {
|
|
69
|
+
type: "reportPageLayout",
|
|
70
|
+
id: objectId,
|
|
71
|
+
attributes: convertReportPageLayoutToBackend(layout),
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
});
|
|
75
|
+
return convertReportPageLayout(response.data.data);
|
|
76
|
+
});
|
|
77
|
+
};
|
|
78
|
+
deleteReportPageLayout = async (ref) => {
|
|
79
|
+
const objectId = this.editableObjectId(ref, "Report page layout");
|
|
80
|
+
await this.authCall((client) => EntitiesApi_DeleteEntityReportPageLayouts(client.axios, client.basePath, {
|
|
81
|
+
workspaceId: this.workspace,
|
|
82
|
+
objectId,
|
|
83
|
+
}));
|
|
84
|
+
};
|
|
85
|
+
getReportTemplates = async () => {
|
|
86
|
+
return this.authCall((client) => ActionsUtilities.loadAllPages(({ page, size }) => EntitiesApi_GetAllEntitiesReportTemplates(client.axios, client.basePath, {
|
|
87
|
+
workspaceId: this.workspace,
|
|
88
|
+
metaInclude: ["origin"],
|
|
89
|
+
page,
|
|
90
|
+
size,
|
|
91
|
+
}).then((response) => response.data.data.map(convertReportTemplate))));
|
|
92
|
+
};
|
|
93
|
+
getReportTemplate = async (ref) => {
|
|
94
|
+
const objectId = objRefToIdentifier(ref, this.authCall);
|
|
95
|
+
return this.authCall(async (client) => {
|
|
96
|
+
const response = await EntitiesApi_GetEntityReportTemplates(client.axios, client.basePath, {
|
|
97
|
+
workspaceId: this.workspace,
|
|
98
|
+
objectId,
|
|
99
|
+
metaInclude: ["origin"],
|
|
100
|
+
});
|
|
101
|
+
return convertReportTemplate(response.data.data);
|
|
102
|
+
});
|
|
103
|
+
};
|
|
104
|
+
createReportTemplate = async (template) => {
|
|
105
|
+
const id = template.ref ? objRefToIdentifier(template.ref, this.authCall) : uuidv4();
|
|
106
|
+
return this.authCall(async (client) => {
|
|
107
|
+
const response = await EntitiesApi_CreateEntityReportTemplates(client.axios, client.basePath, {
|
|
108
|
+
workspaceId: this.workspace,
|
|
109
|
+
jsonApiReportTemplatePostOptionalIdDocument: {
|
|
110
|
+
data: {
|
|
111
|
+
type: "reportTemplate",
|
|
112
|
+
id,
|
|
113
|
+
attributes: convertReportTemplateToBackend(template),
|
|
114
|
+
},
|
|
115
|
+
},
|
|
116
|
+
});
|
|
117
|
+
return convertReportTemplate(response.data.data);
|
|
118
|
+
});
|
|
119
|
+
};
|
|
120
|
+
updateReportTemplate = async (template) => {
|
|
121
|
+
const objectId = objRefToIdentifier(template.ref, this.authCall);
|
|
122
|
+
return this.authCall(async (client) => {
|
|
123
|
+
const response = await EntitiesApi_UpdateEntityReportTemplates(client.axios, client.basePath, {
|
|
124
|
+
workspaceId: this.workspace,
|
|
125
|
+
objectId,
|
|
126
|
+
jsonApiReportTemplateInDocument: {
|
|
127
|
+
data: {
|
|
128
|
+
type: "reportTemplate",
|
|
129
|
+
id: objectId,
|
|
130
|
+
attributes: convertReportTemplateToBackend(template),
|
|
131
|
+
},
|
|
132
|
+
},
|
|
133
|
+
});
|
|
134
|
+
return convertReportTemplate(response.data.data);
|
|
135
|
+
});
|
|
136
|
+
};
|
|
137
|
+
deleteReportTemplate = async (ref) => {
|
|
138
|
+
const objectId = objRefToIdentifier(ref, this.authCall);
|
|
139
|
+
await this.authCall((client) => EntitiesApi_DeleteEntityReportTemplates(client.axios, client.basePath, {
|
|
140
|
+
workspaceId: this.workspace,
|
|
141
|
+
objectId,
|
|
142
|
+
}));
|
|
143
|
+
};
|
|
144
|
+
getReports = async () => {
|
|
145
|
+
return this.authCall((client) => ActionsUtilities.loadAllPages(({ page, size }) => EntitiesApi_GetAllEntitiesReports(client.axios, client.basePath, {
|
|
146
|
+
workspaceId: this.workspace,
|
|
147
|
+
metaInclude: ["origin"],
|
|
148
|
+
page,
|
|
149
|
+
size,
|
|
150
|
+
}).then((response) => response.data.data.map(convertReport))));
|
|
151
|
+
};
|
|
152
|
+
getReport = async (ref) => {
|
|
153
|
+
const objectId = objRefToIdentifier(ref, this.authCall);
|
|
154
|
+
return this.authCall(async (client) => {
|
|
155
|
+
const response = await EntitiesApi_GetEntityReports(client.axios, client.basePath, {
|
|
156
|
+
workspaceId: this.workspace,
|
|
157
|
+
objectId,
|
|
158
|
+
metaInclude: ["origin"],
|
|
159
|
+
});
|
|
160
|
+
return convertReport(response.data.data);
|
|
161
|
+
});
|
|
162
|
+
};
|
|
163
|
+
createReport = async (report) => {
|
|
164
|
+
const id = report.ref ? objRefToIdentifier(report.ref, this.authCall) : uuidv4();
|
|
165
|
+
return this.authCall(async (client) => {
|
|
166
|
+
const response = await EntitiesApi_CreateEntityReports(client.axios, client.basePath, {
|
|
167
|
+
workspaceId: this.workspace,
|
|
168
|
+
jsonApiReportPostOptionalIdDocument: {
|
|
169
|
+
data: {
|
|
170
|
+
type: "report",
|
|
171
|
+
id,
|
|
172
|
+
attributes: convertReportToBackend(report),
|
|
173
|
+
},
|
|
174
|
+
},
|
|
175
|
+
});
|
|
176
|
+
return convertReport(response.data.data);
|
|
177
|
+
});
|
|
178
|
+
};
|
|
179
|
+
updateReport = async (report) => {
|
|
180
|
+
const objectId = objRefToIdentifier(report.ref, this.authCall);
|
|
181
|
+
return this.authCall(async (client) => {
|
|
182
|
+
const response = await EntitiesApi_UpdateEntityReports(client.axios, client.basePath, {
|
|
183
|
+
workspaceId: this.workspace,
|
|
184
|
+
objectId,
|
|
185
|
+
jsonApiReportInDocument: {
|
|
186
|
+
data: {
|
|
187
|
+
type: "report",
|
|
188
|
+
id: objectId,
|
|
189
|
+
attributes: convertReportToBackend(report),
|
|
190
|
+
},
|
|
191
|
+
},
|
|
192
|
+
});
|
|
193
|
+
return convertReport(response.data.data);
|
|
194
|
+
});
|
|
195
|
+
};
|
|
196
|
+
deleteReport = async (ref) => {
|
|
197
|
+
const objectId = objRefToIdentifier(ref, this.authCall);
|
|
198
|
+
await this.authCall((client) => EntitiesApi_DeleteEntityReports(client.axios, client.basePath, {
|
|
199
|
+
workspaceId: this.workspace,
|
|
200
|
+
objectId,
|
|
201
|
+
}));
|
|
202
|
+
};
|
|
203
|
+
getBrandKit = async () => {
|
|
204
|
+
const settings = await this.settings().getSettings();
|
|
205
|
+
return sanitizeReportsBrandKit(settings.reportsBrandKit);
|
|
206
|
+
};
|
|
207
|
+
setBrandKit = async (brandKit) => {
|
|
208
|
+
const sanitized = sanitizeReportsBrandKit(brandKit);
|
|
209
|
+
if (sanitized === undefined) {
|
|
210
|
+
throw new UnexpectedError("The provided value is not a valid brand kit.");
|
|
10
211
|
}
|
|
11
|
-
|
|
212
|
+
await this.settings().setReportsBrandKit(sanitized);
|
|
213
|
+
};
|
|
214
|
+
deleteBrandKit = async () => {
|
|
215
|
+
await this.settings().deleteReportsBrandKit();
|
|
216
|
+
};
|
|
217
|
+
settings() {
|
|
218
|
+
return new TigerWorkspaceSettings(this.authCall, this.workspace);
|
|
12
219
|
}
|
|
13
|
-
|
|
14
|
-
|
|
220
|
+
newObjectId(ref, what) {
|
|
221
|
+
if (!ref) {
|
|
222
|
+
return uuidv4();
|
|
223
|
+
}
|
|
224
|
+
this.assertNotBuiltIn(ref, what);
|
|
225
|
+
return objRefToIdentifier(ref, this.authCall);
|
|
15
226
|
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
save: (value) => storage.setItem(key, value),
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Temporary implementation used until the backend entities (reportPageLayout, reportTemplate,
|
|
24
|
-
* report) exist: serves the built-in report page layouts and persists created objects to
|
|
25
|
-
* localStorage, scoped per workspace, so a UI built on the SPI works across page reloads.
|
|
26
|
-
* Falls back to plain in-memory state where localStorage is unavailable.
|
|
27
|
-
*/
|
|
28
|
-
export class TigerWorkspaceReportsService extends InMemoryWorkspaceReportsService {
|
|
29
|
-
constructor(workspace) {
|
|
30
|
-
super(localStoragePersistence(workspace));
|
|
227
|
+
editableObjectId(ref, what) {
|
|
228
|
+
this.assertNotBuiltIn(ref, what);
|
|
229
|
+
return objRefToIdentifier(ref, this.authCall);
|
|
31
230
|
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
// state is per-process scratch data for development, not tenant data.
|
|
37
|
-
const servicesByWorkspace = new Map();
|
|
38
|
-
export function getTigerWorkspaceReportsService(workspace) {
|
|
39
|
-
let service = servicesByWorkspace.get(workspace);
|
|
40
|
-
if (!service) {
|
|
41
|
-
service = new TigerWorkspaceReportsService(workspace);
|
|
42
|
-
servicesByWorkspace.set(workspace, service);
|
|
231
|
+
assertNotBuiltIn(ref, what) {
|
|
232
|
+
if (findBuiltInPageLayout(ref)) {
|
|
233
|
+
throw new UnexpectedError(`${what} "${objRefToString(ref)}" is built-in and cannot be changed.`);
|
|
234
|
+
}
|
|
43
235
|
}
|
|
44
|
-
return service;
|
|
45
236
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type IUserWorkspaceSettings, type IWorkspaceSettings, type IWorkspaceSettingsService } from "@gooddata/sdk-backend-spi";
|
|
2
|
-
import { type DashboardFiltersApplyMode, type IActiveCalendars, type IAiRateLimit, type IAlertDefault, type IDefaultExportTemplate, type IFiscalYear, type ISeparators, type ObjRef } from "@gooddata/sdk-model";
|
|
2
|
+
import { type DashboardFiltersApplyMode, type IActiveCalendars, type IAiRateLimit, type IAlertDefault, type IDefaultExportTemplate, type IFiscalYear, type IReportsBrandKit, type ISeparators, type ObjRef } from "@gooddata/sdk-model";
|
|
3
3
|
import { type TigerAuthenticatedCallGuard, type TigerSettingsType } from "../../../types/index.js";
|
|
4
4
|
import { TigerSettingsService } from "../../settings/settings.js";
|
|
5
5
|
export declare class TigerWorkspaceSettings extends TigerSettingsService<IWorkspaceSettings> implements IWorkspaceSettingsService {
|
|
@@ -49,6 +49,8 @@ export declare class TigerWorkspaceSettings extends TigerSettingsService<IWorksp
|
|
|
49
49
|
deleteTheme(): Promise<any>;
|
|
50
50
|
deleteColorPalette(): Promise<any>;
|
|
51
51
|
deleteMetricFormatOverride(): Promise<void>;
|
|
52
|
+
setReportsBrandKit(brandKit: IReportsBrandKit): Promise<void>;
|
|
53
|
+
deleteReportsBrandKit(): Promise<void>;
|
|
52
54
|
getSettingsForCurrentUser(): Promise<IUserWorkspaceSettings>;
|
|
53
55
|
protected getSettingByType(type: TigerSettingsType): Promise<import("axios").AxiosResponse<import("@gooddata/api-client-tiger").JsonApiWorkspaceSettingOutList, any, {}>>;
|
|
54
56
|
protected updateSetting(type: TigerSettingsType, id: string, content: any): Promise<any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/backend/workspace/settings/index.ts"],"names":[],"mappings":"AAYA,OAAO,EACH,KAAK,sBAAsB,EAC3B,KAAK,kBAAkB,E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BAAiB,GAAG,OAAO,CAAC,GAAG,CAAC,CAmBlF;CACJ;AAkED;;;;GAIG;AACH,wBAAgB,yBAAyB,CACrC,QAAQ,EAAE,2BAA2B,EACrC,SAAS,EAAE,MAAM,GAClB,OAAO,CAAC,sBAAsB,CAAC,CAuEjC"}
|
|
@@ -170,6 +170,12 @@ export class TigerWorkspaceSettings extends TigerSettingsService {
|
|
|
170
170
|
async deleteMetricFormatOverride() {
|
|
171
171
|
return this.deleteSettingByType("METRIC_FORMAT_OVERRIDE");
|
|
172
172
|
}
|
|
173
|
+
async setReportsBrandKit(brandKit) {
|
|
174
|
+
return this.setSetting("REPORTS_BRAND_KIT", brandKit);
|
|
175
|
+
}
|
|
176
|
+
async deleteReportsBrandKit() {
|
|
177
|
+
return this.deleteSettingByType("REPORTS_BRAND_KIT");
|
|
178
|
+
}
|
|
173
179
|
getSettingsForCurrentUser() {
|
|
174
180
|
return getSettingsForCurrentUser(this.authCall, this.workspace);
|
|
175
181
|
}
|
|
@@ -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;AA0I7B,wBAAgB,iBAAiB,CAC7B,UAAU,EAAE,6BAA6B,GAAG,sCAAsC,EAClF,QAAQ,EAAE,4BAA4B,EAAE,GACzC,yBAAyB,CA0H3B;AAED,eAAO,MAAM,kCAAkC,2EAM9C,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;AAcF,eAAO,MAAM,YAAY,sMAuGxB,CAAC;AA0CF;;;;;;;GAOG;AACH,wBAAgB,yCAAyC,CACrD,MAAM,EAAE,OAAO,EACf,uBAAuB,EAAE,MAAM,GAChC,iBAAiB,GAAG,SAAS,CAgG/B"}
|
|
@@ -157,18 +157,15 @@ export const convertAutomationListToAutomations = (automationList) => {
|
|
|
157
157
|
return automationList.data.map((automationObject) => convertAutomation(automationObject, automationList.included ?? []));
|
|
158
158
|
};
|
|
159
159
|
/**
|
|
160
|
-
* The wire value is an untyped string with no type tag
|
|
161
|
-
* decodes
|
|
162
|
-
*
|
|
160
|
+
* The wire value is an untyped string with no type tag, so it is passed through verbatim — the
|
|
161
|
+
* consumer decodes it against the workspace parameter definition, which is the only source of the
|
|
162
|
+
* value's type (see `decodeParameterWireValue` in sdk-ui-dashboard).
|
|
163
163
|
*/
|
|
164
164
|
function convertParameterItems(items) {
|
|
165
|
-
return items.map((item) => {
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
value: Number.isFinite(value) ? value : item.value,
|
|
170
|
-
};
|
|
171
|
-
});
|
|
165
|
+
return items.map((item) => ({
|
|
166
|
+
ref: idRef(item.parameter.identifier.id, "parameter"),
|
|
167
|
+
value: item.value,
|
|
168
|
+
}));
|
|
172
169
|
}
|
|
173
170
|
export const convertAlert = (alert, state) => {
|
|
174
171
|
if (!alert) {
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type JsonApiReportOut, type JsonApiReportOutWithLinks, type JsonApiReportPageLayoutOut, type JsonApiReportPageLayoutOutWithLinks, type JsonApiReportTemplateOut, type JsonApiReportTemplateOutWithLinks } from "@gooddata/api-client-tiger";
|
|
2
|
+
import { type IReport, type IReportPageLayout, type IReportTemplate } from "@gooddata/sdk-model";
|
|
3
|
+
export declare function convertReportPageLayout(entity: JsonApiReportPageLayoutOut | JsonApiReportPageLayoutOutWithLinks): IReportPageLayout;
|
|
4
|
+
export declare function convertReportTemplate(entity: JsonApiReportTemplateOut | JsonApiReportTemplateOutWithLinks): IReportTemplate;
|
|
5
|
+
export declare function convertReport(entity: JsonApiReportOut | JsonApiReportOutWithLinks): IReport;
|
|
6
|
+
//# sourceMappingURL=ReportsConverter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ReportsConverter.d.ts","sourceRoot":"","sources":["../../../src/convertors/fromBackend/ReportsConverter.ts"],"names":[],"mappings":"AAEA,OAAO,EACH,KAAK,gBAAgB,EACrB,KAAK,yBAAyB,EAC9B,KAAK,0BAA0B,EAC/B,KAAK,mCAAmC,EACxC,KAAK,wBAAwB,EAC7B,KAAK,iCAAiC,EACzC,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACH,KAAK,OAAO,EAEZ,KAAK,iBAAiB,EAEtB,KAAK,eAAe,EAEvB,MAAM,qBAAqB,CAAC;AAU7B,wBAAgB,uBAAuB,CACnC,MAAM,EAAE,0BAA0B,GAAG,mCAAmC,GACzE,iBAAiB,CAUnB;AAED,wBAAgB,qBAAqB,CACjC,MAAM,EAAE,wBAAwB,GAAG,iCAAiC,GACrE,eAAe,CAUjB;AAED,wBAAgB,aAAa,CAAC,MAAM,EAAE,gBAAgB,GAAG,yBAAyB,GAAG,OAAO,CAa3F"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
// (C) 2026 GoodData Corporation
|
|
2
|
+
import { idRef, } from "@gooddata/sdk-model";
|
|
3
|
+
import { isInheritedObject } from "./ObjectInheritance.js";
|
|
4
|
+
// Content is stored verbatim as free-form JSON, so the wire type carries no structure and the
|
|
5
|
+
// model type is restored by assertion. Callers that must not trust it use the content type-guards.
|
|
6
|
+
function asContent(content) {
|
|
7
|
+
return content;
|
|
8
|
+
}
|
|
9
|
+
export function convertReportPageLayout(entity) {
|
|
10
|
+
return {
|
|
11
|
+
type: "reportPageLayout",
|
|
12
|
+
ref: idRef(entity.id, "reportPageLayout"),
|
|
13
|
+
title: entity.attributes.title,
|
|
14
|
+
description: entity.attributes.description,
|
|
15
|
+
tags: entity.attributes.tags,
|
|
16
|
+
content: asContent(entity.attributes.content),
|
|
17
|
+
isLocked: isInheritedObject(entity),
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
export function convertReportTemplate(entity) {
|
|
21
|
+
return {
|
|
22
|
+
type: "reportTemplate",
|
|
23
|
+
ref: idRef(entity.id, "reportTemplate"),
|
|
24
|
+
title: entity.attributes.title,
|
|
25
|
+
description: entity.attributes.description,
|
|
26
|
+
tags: entity.attributes.tags,
|
|
27
|
+
content: asContent(entity.attributes.content),
|
|
28
|
+
isLocked: isInheritedObject(entity),
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
export function convertReport(entity) {
|
|
32
|
+
return {
|
|
33
|
+
type: "report",
|
|
34
|
+
ref: idRef(entity.id, "report"),
|
|
35
|
+
title: entity.attributes.title,
|
|
36
|
+
description: entity.attributes.description,
|
|
37
|
+
tags: entity.attributes.tags,
|
|
38
|
+
periodStart: entity.attributes.periodStart,
|
|
39
|
+
periodEnd: entity.attributes.periodEnd,
|
|
40
|
+
content: asContent(entity.attributes.content),
|
|
41
|
+
variableValues: entity.attributes.variableValues ?? undefined,
|
|
42
|
+
isLocked: isInheritedObject(entity),
|
|
43
|
+
};
|
|
44
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { type JsonApiVisualizationObjectInAttributesConditionalFormatting, type ConditionalFormatting as TigerConditionalFormatting } from "@gooddata/api-client-tiger";
|
|
2
|
+
import { type IConditionalFormatting, type IInsightDefinition } from "@gooddata/sdk-model";
|
|
3
|
+
/**
|
|
4
|
+
* Projects the insight's conditional formatting (persisted free-form under
|
|
5
|
+
* `properties.controls.conditionalFormatting`) into the typed visualizationObject entity attribute.
|
|
6
|
+
*
|
|
7
|
+
* Dual-write: `content` — which still carries the same rules inside `properties` — stays
|
|
8
|
+
* authoritative; this typed attribute is a parallel, server-validated projection that readers switch
|
|
9
|
+
* to later. Two boundary guarantees:
|
|
10
|
+
* - Returns `null` (never `undefined`) when there is no formatting, so the PUT body explicitly clears
|
|
11
|
+
* the projection rather than relying on the server's omitted-attribute semantics — otherwise a
|
|
12
|
+
* cleared CF could leave a stale typed projection diverging from the authoritative `content`.
|
|
13
|
+
* - A malformed blob (`content` is free-form and unvalidated) also degrades to `null`: the projection
|
|
14
|
+
* must never break a save, since `content` remains the source of truth. This includes a
|
|
15
|
+
* relative-date granularity tiger does not model.
|
|
16
|
+
*
|
|
17
|
+
* `version` and `suppressedTargets` are intentionally NOT carried — the typed schema does not model
|
|
18
|
+
* them yet, and `content` stays authoritative until the switch, so nothing is lost. This is an
|
|
19
|
+
* allow-list (see {@link convertConditionalFormattingToBackend}): a field added to
|
|
20
|
+
* {@link IConditionalFormatting} will not auto-propagate; extend the shared mapping (and its test)
|
|
21
|
+
* when the typed schema grows.
|
|
22
|
+
*/
|
|
23
|
+
export declare function convertConditionalFormatting(insight: IInsightDefinition): JsonApiVisualizationObjectInAttributesConditionalFormatting | null;
|
|
24
|
+
/**
|
|
25
|
+
* Converts typed SDK conditional formatting into the tiger wire shape — the single mapping shared by
|
|
26
|
+
* the visualizationObject entity attribute (see {@link convertConditionalFormatting}) and the tabular
|
|
27
|
+
* export request. The mapping is a structural copy except for relative-date granularities, which the
|
|
28
|
+
* SDK stores in its own vocabulary (`GDC.time.*`) while the wire uses tiger's (`YEAR`,
|
|
29
|
+
* `MONTH_OF_YEAR`, ...); those are translated via the canonical granularity mapping.
|
|
30
|
+
*
|
|
31
|
+
* Throws `NotSupported` for a granularity tiger does not model — a caller feeding it untrusted data
|
|
32
|
+
* must catch and degrade (the insight projection above turns it into `null`).
|
|
33
|
+
*/
|
|
34
|
+
export declare function convertConditionalFormattingToBackend(conditionalFormatting: IConditionalFormatting): TigerConditionalFormatting;
|
|
35
|
+
//# sourceMappingURL=ConditionalFormattingConverter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConditionalFormattingConverter.d.ts","sourceRoot":"","sources":["../../../src/convertors/toBackend/ConditionalFormattingConverter.ts"],"names":[],"mappings":"AAEA,OAAO,EACH,KAAK,2DAA2D,EAChE,KAAK,qBAAqB,IAAI,0BAA0B,EAC3D,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EAEH,KAAK,sBAAsB,EAE3B,KAAK,kBAAkB,EAE1B,MAAM,qBAAqB,CAAC;AAI7B;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,4BAA4B,CACxC,OAAO,EAAE,kBAAkB,GAC5B,2DAA2D,GAAG,IAAI,CA2BpE;AAED;;;;;;;;;GASG;AACH,wBAAgB,qCAAqC,CACjD,qBAAqB,EAAE,sBAAsB,GAC9C,0BAA0B,CAc5B"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
// (C) 2026 GoodData Corporation
|
|
2
|
+
import { NotSupported } from "@gooddata/sdk-backend-spi";
|
|
3
|
+
import { insightProperties, } from "@gooddata/sdk-model";
|
|
4
|
+
import { toTigerGranularity } from "../fromBackend/dateGranularityConversions.js";
|
|
5
|
+
/**
|
|
6
|
+
* Projects the insight's conditional formatting (persisted free-form under
|
|
7
|
+
* `properties.controls.conditionalFormatting`) into the typed visualizationObject entity attribute.
|
|
8
|
+
*
|
|
9
|
+
* Dual-write: `content` — which still carries the same rules inside `properties` — stays
|
|
10
|
+
* authoritative; this typed attribute is a parallel, server-validated projection that readers switch
|
|
11
|
+
* to later. Two boundary guarantees:
|
|
12
|
+
* - Returns `null` (never `undefined`) when there is no formatting, so the PUT body explicitly clears
|
|
13
|
+
* the projection rather than relying on the server's omitted-attribute semantics — otherwise a
|
|
14
|
+
* cleared CF could leave a stale typed projection diverging from the authoritative `content`.
|
|
15
|
+
* - A malformed blob (`content` is free-form and unvalidated) also degrades to `null`: the projection
|
|
16
|
+
* must never break a save, since `content` remains the source of truth. This includes a
|
|
17
|
+
* relative-date granularity tiger does not model.
|
|
18
|
+
*
|
|
19
|
+
* `version` and `suppressedTargets` are intentionally NOT carried — the typed schema does not model
|
|
20
|
+
* them yet, and `content` stays authoritative until the switch, so nothing is lost. This is an
|
|
21
|
+
* allow-list (see {@link convertConditionalFormattingToBackend}): a field added to
|
|
22
|
+
* {@link IConditionalFormatting} will not auto-propagate; extend the shared mapping (and its test)
|
|
23
|
+
* when the typed schema grows.
|
|
24
|
+
*/
|
|
25
|
+
export function convertConditionalFormatting(insight) {
|
|
26
|
+
const conditionalFormatting = insightProperties(insight)["controls"]?.["conditionalFormatting"];
|
|
27
|
+
if (!conditionalFormatting ||
|
|
28
|
+
!Array.isArray(conditionalFormatting.rules) ||
|
|
29
|
+
conditionalFormatting.rules.some((rule) => !Array.isArray(rule?.conditions) ||
|
|
30
|
+
rule.conditions.some((condition) => !condition || typeof condition !== "object"))) {
|
|
31
|
+
return null;
|
|
32
|
+
}
|
|
33
|
+
// Array.isArray() narrows the readonly rules array to any[]; re-annotate to keep element types.
|
|
34
|
+
const rules = conditionalFormatting.rules;
|
|
35
|
+
try {
|
|
36
|
+
return convertConditionalFormattingToBackend({ enabled: conditionalFormatting.enabled, rules });
|
|
37
|
+
}
|
|
38
|
+
catch (error) {
|
|
39
|
+
// convertConditionalFormattingToBackend throws NotSupported for a granularity the free-form
|
|
40
|
+
// blob may carry but tiger does not model; the projection degrades like any other
|
|
41
|
+
// malformed-blob case.
|
|
42
|
+
if (error instanceof NotSupported) {
|
|
43
|
+
return null;
|
|
44
|
+
}
|
|
45
|
+
throw error;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Converts typed SDK conditional formatting into the tiger wire shape — the single mapping shared by
|
|
50
|
+
* the visualizationObject entity attribute (see {@link convertConditionalFormatting}) and the tabular
|
|
51
|
+
* export request. The mapping is a structural copy except for relative-date granularities, which the
|
|
52
|
+
* SDK stores in its own vocabulary (`GDC.time.*`) while the wire uses tiger's (`YEAR`,
|
|
53
|
+
* `MONTH_OF_YEAR`, ...); those are translated via the canonical granularity mapping.
|
|
54
|
+
*
|
|
55
|
+
* Throws `NotSupported` for a granularity tiger does not model — a caller feeding it untrusted data
|
|
56
|
+
* must catch and degrade (the insight projection above turns it into `null`).
|
|
57
|
+
*/
|
|
58
|
+
export function convertConditionalFormattingToBackend(conditionalFormatting) {
|
|
59
|
+
return {
|
|
60
|
+
enabled: conditionalFormatting.enabled,
|
|
61
|
+
rules: conditionalFormatting.rules.map((rule) => ({
|
|
62
|
+
id: rule.id,
|
|
63
|
+
target: rule.target,
|
|
64
|
+
conditions: rule.conditions.map((condition) => ({
|
|
65
|
+
id: condition.id,
|
|
66
|
+
operator: condition.operator,
|
|
67
|
+
value: convertValue(condition.value),
|
|
68
|
+
format: condition.format,
|
|
69
|
+
})),
|
|
70
|
+
})),
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
function convertValue(value) {
|
|
74
|
+
if (value.kind === "relativeDate") {
|
|
75
|
+
return {
|
|
76
|
+
kind: value.kind,
|
|
77
|
+
granularity: toTigerGranularity(value.granularity),
|
|
78
|
+
from: value.from,
|
|
79
|
+
to: value.to,
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
return value;
|
|
83
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type JsonApiReportInAttributes, type JsonApiReportPageLayoutInAttributes, type JsonApiReportTemplateInAttributes } from "@gooddata/api-client-tiger";
|
|
2
|
+
import { type IReportDefinition, type IReportPageLayoutDefinition, type IReportTemplateDefinition } from "@gooddata/sdk-model";
|
|
3
|
+
export declare function convertReportPageLayoutToBackend(layout: IReportPageLayoutDefinition): JsonApiReportPageLayoutInAttributes;
|
|
4
|
+
export declare function convertReportTemplateToBackend(template: IReportTemplateDefinition): JsonApiReportTemplateInAttributes;
|
|
5
|
+
export declare function convertReportToBackend(report: IReportDefinition): JsonApiReportInAttributes;
|
|
6
|
+
//# sourceMappingURL=ReportsConverter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ReportsConverter.d.ts","sourceRoot":"","sources":["../../../src/convertors/toBackend/ReportsConverter.ts"],"names":[],"mappings":"AAEA,OAAO,EACH,KAAK,yBAAyB,EAC9B,KAAK,mCAAmC,EACxC,KAAK,iCAAiC,EACzC,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACH,KAAK,iBAAiB,EACtB,KAAK,2BAA2B,EAChC,KAAK,yBAAyB,EACjC,MAAM,qBAAqB,CAAC;AAE7B,wBAAgB,gCAAgC,CAC5C,MAAM,EAAE,2BAA2B,GACpC,mCAAmC,CAOrC;AAED,wBAAgB,8BAA8B,CAC1C,QAAQ,EAAE,yBAAyB,GACpC,iCAAiC,CAOnC;AAED,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,iBAAiB,GAAG,yBAAyB,CAU3F"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
// (C) 2026 GoodData Corporation
|
|
2
|
+
export function convertReportPageLayoutToBackend(layout) {
|
|
3
|
+
return {
|
|
4
|
+
title: layout.title,
|
|
5
|
+
description: layout.description,
|
|
6
|
+
tags: layout.tags,
|
|
7
|
+
content: layout.content,
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
export function convertReportTemplateToBackend(template) {
|
|
11
|
+
return {
|
|
12
|
+
title: template.title,
|
|
13
|
+
description: template.description,
|
|
14
|
+
tags: template.tags,
|
|
15
|
+
content: template.content,
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
export function convertReportToBackend(report) {
|
|
19
|
+
return {
|
|
20
|
+
title: report.title,
|
|
21
|
+
description: report.description,
|
|
22
|
+
tags: report.tags,
|
|
23
|
+
periodStart: report.periodStart,
|
|
24
|
+
periodEnd: report.periodEnd,
|
|
25
|
+
content: report.content,
|
|
26
|
+
variableValues: report.variableValues,
|
|
27
|
+
};
|
|
28
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gooddata/sdk-backend-tiger",
|
|
3
|
-
"version": "11.55.0-alpha.
|
|
3
|
+
"version": "11.55.0-alpha.4",
|
|
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.55.0-alpha.
|
|
38
|
-
"@gooddata/sdk-backend-base": "11.55.0-alpha.
|
|
39
|
-
"@gooddata/sdk-
|
|
40
|
-
"@gooddata/sdk-
|
|
41
|
-
"@gooddata/sdk-
|
|
42
|
-
"@gooddata/util": "11.55.0-alpha.
|
|
37
|
+
"@gooddata/api-client-tiger": "11.55.0-alpha.4",
|
|
38
|
+
"@gooddata/sdk-backend-base": "11.55.0-alpha.4",
|
|
39
|
+
"@gooddata/sdk-model": "11.55.0-alpha.4",
|
|
40
|
+
"@gooddata/sdk-backend-spi": "11.55.0-alpha.4",
|
|
41
|
+
"@gooddata/sdk-code-convertors": "11.55.0-alpha.4",
|
|
42
|
+
"@gooddata/util": "11.55.0-alpha.4"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@gooddata/fixtures": "3.7.0",
|
|
@@ -59,15 +59,15 @@
|
|
|
59
59
|
"eslint-plugin-no-barrel-files": "1.2.2",
|
|
60
60
|
"eslint-plugin-sonarjs": "3.0.6",
|
|
61
61
|
"npm-run-all": "4.1.5",
|
|
62
|
-
"oxfmt": "0.
|
|
63
|
-
"oxlint": "1.
|
|
62
|
+
"oxfmt": "0.58.0",
|
|
63
|
+
"oxlint": "1.57.0",
|
|
64
64
|
"oxlint-tsgolint": "0.15.0",
|
|
65
65
|
"typescript": "5.9.3",
|
|
66
66
|
"vitest": "4.1.8",
|
|
67
|
-
"@gooddata/catalog-export": "11.55.0-alpha.
|
|
68
|
-
"@gooddata/eslint-config": "11.55.0-alpha.
|
|
69
|
-
"@gooddata/
|
|
70
|
-
"@gooddata/
|
|
67
|
+
"@gooddata/catalog-export": "11.55.0-alpha.4",
|
|
68
|
+
"@gooddata/eslint-config": "11.55.0-alpha.4",
|
|
69
|
+
"@gooddata/oxlint-config": "11.55.0-alpha.4",
|
|
70
|
+
"@gooddata/reference-workspace": "11.55.0-alpha.4"
|
|
71
71
|
},
|
|
72
72
|
"scripts": {
|
|
73
73
|
"_phase:build": "npm run build",
|