@gooddata/sdk-backend-tiger 11.62.0-alpha.0 → 11.62.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/backend/features/feature.d.ts.map +1 -1
- package/esm/backend/features/feature.js +2 -1
- package/esm/backend/localization/aggregate.d.ts +27 -0
- package/esm/backend/localization/aggregate.d.ts.map +1 -0
- package/esm/backend/localization/aggregate.js +151 -0
- package/esm/backend/localization/fixture.d.ts +21 -0
- package/esm/backend/localization/fixture.d.ts.map +1 -0
- package/esm/backend/localization/fixture.js +125 -0
- package/esm/backend/localization/index.d.ts +35 -0
- package/esm/backend/localization/index.d.ts.map +1 -0
- package/esm/backend/localization/index.js +134 -0
- package/esm/backend/organization/index.d.ts +2 -1
- package/esm/backend/organization/index.d.ts.map +1 -1
- package/esm/backend/organization/index.js +4 -0
- package/esm/backend/organization/settings.d.ts +4 -1
- package/esm/backend/organization/settings.d.ts.map +1 -1
- package/esm/backend/organization/settings.js +12 -0
- package/esm/backend/settings/mapping.d.ts.map +1 -1
- package/esm/backend/settings/mapping.js +1 -0
- package/esm/backend/tigerSpecificFunctions.js +2 -3
- package/esm/backend/uiFeatures.d.ts +7 -4
- package/esm/backend/uiFeatures.d.ts.map +1 -1
- package/esm/backend/uiFeatures.js +6 -3
- package/esm/backend/user/settings.d.ts +1 -1
- package/esm/backend/user/settings.d.ts.map +1 -1
- package/esm/backend/workspace/genAI/ChatConversations.d.ts +7 -3
- package/esm/backend/workspace/genAI/ChatConversations.d.ts.map +1 -1
- package/esm/backend/workspace/genAI/ChatConversations.js +31 -12
- package/esm/backend/workspace/index.d.ts +3 -2
- package/esm/backend/workspace/index.d.ts.map +1 -1
- package/esm/backend/workspace/index.js +7 -3
- package/esm/backend/workspace/publisher.d.ts +28 -0
- package/esm/backend/workspace/publisher.d.ts.map +1 -0
- package/esm/backend/workspace/{reports.js → publisher.js} +51 -49
- package/esm/backend/workspace/settings/index.d.ts +1 -1
- package/esm/backend/workspace/settings/index.d.ts.map +1 -1
- package/esm/convertors/fromBackend/PublisherConverter.d.ts +6 -0
- package/esm/convertors/fromBackend/PublisherConverter.d.ts.map +1 -0
- package/esm/convertors/fromBackend/{ReportsConverter.js → PublisherConverter.js} +3 -3
- package/esm/convertors/fromBackend/genAIConvertor.d.ts.map +1 -1
- package/esm/convertors/fromBackend/genAIConvertor.js +18 -7
- package/esm/convertors/fromBackend/publisherDocumentPartConvertor.d.ts +8 -0
- package/esm/convertors/fromBackend/publisherDocumentPartConvertor.d.ts.map +1 -0
- package/esm/convertors/fromBackend/{reportPartConvertor.js → publisherDocumentPartConvertor.js} +24 -22
- package/esm/convertors/toBackend/PublisherConverter.d.ts +6 -0
- package/esm/convertors/toBackend/PublisherConverter.d.ts.map +1 -0
- package/esm/convertors/toBackend/PublisherConverter.js +28 -0
- package/package.json +12 -12
- package/esm/backend/workspace/reports.d.ts +0 -28
- package/esm/backend/workspace/reports.d.ts.map +0 -1
- package/esm/convertors/fromBackend/ReportsConverter.d.ts +0 -6
- package/esm/convertors/fromBackend/ReportsConverter.d.ts.map +0 -1
- package/esm/convertors/fromBackend/reportPartConvertor.d.ts +0 -8
- package/esm/convertors/fromBackend/reportPartConvertor.d.ts.map +0 -1
- package/esm/convertors/toBackend/ReportsConverter.d.ts +0 -6
- package/esm/convertors/toBackend/ReportsConverter.d.ts.map +0 -1
- package/esm/convertors/toBackend/ReportsConverter.js +0 -28
|
@@ -4,35 +4,35 @@ import { ActionsUtilities } from "@gooddata/api-client-tiger";
|
|
|
4
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
5
|
import { ExportApi_CreateReportExport } from "@gooddata/api-client-tiger/endpoints/export";
|
|
6
6
|
import { UnexpectedError, } from "@gooddata/sdk-backend-spi";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
7
|
+
import { BuiltInPublisherPageLayouts, areObjRefsEqual, objRefToString, } from "@gooddata/sdk-model";
|
|
8
|
+
import { convertPublisherDocument, convertPublisherDocumentTemplate, convertPublisherPageLayout, } from "../../convertors/fromBackend/PublisherConverter.js";
|
|
9
|
+
import { convertPublisherDocumentTemplateToBackend, convertPublisherDocumentToBackend, convertPublisherPageLayoutToBackend, } from "../../convertors/toBackend/PublisherConverter.js";
|
|
10
10
|
import { objRefToIdentifier } from "../../utils/api.js";
|
|
11
11
|
import { handleExportResultPolling } from "../../utils/exportPolling.js";
|
|
12
12
|
const auditInclude = ["createdBy", "modifiedBy"];
|
|
13
13
|
// The backend orders a never-modified object by its creation time.
|
|
14
14
|
const byLastChange = ["modifiedAt,desc"];
|
|
15
15
|
function findBuiltInPageLayout(ref) {
|
|
16
|
-
return
|
|
16
|
+
return BuiltInPublisherPageLayouts.find((layout) => areObjRefsEqual(layout.ref, ref));
|
|
17
17
|
}
|
|
18
|
-
export class
|
|
18
|
+
export class TigerWorkspacePublisherService {
|
|
19
19
|
authCall;
|
|
20
20
|
workspace;
|
|
21
21
|
constructor(authCall, workspace) {
|
|
22
22
|
this.authCall = authCall;
|
|
23
23
|
this.workspace = workspace;
|
|
24
24
|
}
|
|
25
|
-
|
|
25
|
+
getPageLayouts = async () => {
|
|
26
26
|
const layouts = await this.authCall((client) => ActionsUtilities.loadAllPages(({ page, size }) => EntitiesApi_GetAllEntitiesReportPageLayouts(client.axios, client.basePath, {
|
|
27
27
|
workspaceId: this.workspace,
|
|
28
28
|
metaInclude: ["origin"],
|
|
29
29
|
include: auditInclude,
|
|
30
30
|
page,
|
|
31
31
|
size,
|
|
32
|
-
}).then((response) => response.data.data.map((layout) =>
|
|
33
|
-
return [...
|
|
32
|
+
}).then((response) => response.data.data.map((layout) => convertPublisherPageLayout(layout, response.data.included)))));
|
|
33
|
+
return [...BuiltInPublisherPageLayouts, ...layouts];
|
|
34
34
|
};
|
|
35
|
-
|
|
35
|
+
getPageLayout = async (ref) => {
|
|
36
36
|
const builtIn = findBuiltInPageLayout(ref);
|
|
37
37
|
if (builtIn) {
|
|
38
38
|
return builtIn;
|
|
@@ -45,11 +45,11 @@ export class TigerWorkspaceReportsService {
|
|
|
45
45
|
metaInclude: ["origin"],
|
|
46
46
|
include: auditInclude,
|
|
47
47
|
});
|
|
48
|
-
return
|
|
48
|
+
return convertPublisherPageLayout(response.data.data, response.data.included);
|
|
49
49
|
});
|
|
50
50
|
};
|
|
51
|
-
|
|
52
|
-
const id = this.newObjectId(layout.ref, "
|
|
51
|
+
createPageLayout = async (layout) => {
|
|
52
|
+
const id = this.newObjectId(layout.ref, "Page layout");
|
|
53
53
|
return this.authCall(async (client) => {
|
|
54
54
|
const response = await EntitiesApi_CreateEntityReportPageLayouts(client.axios, client.basePath, {
|
|
55
55
|
workspaceId: this.workspace,
|
|
@@ -58,15 +58,15 @@ export class TigerWorkspaceReportsService {
|
|
|
58
58
|
data: {
|
|
59
59
|
type: "reportPageLayout",
|
|
60
60
|
id,
|
|
61
|
-
attributes:
|
|
61
|
+
attributes: convertPublisherPageLayoutToBackend(layout),
|
|
62
62
|
},
|
|
63
63
|
},
|
|
64
64
|
});
|
|
65
|
-
return
|
|
65
|
+
return convertPublisherPageLayout(response.data.data, response.data.included);
|
|
66
66
|
});
|
|
67
67
|
};
|
|
68
|
-
|
|
69
|
-
const objectId = this.editableObjectId(layout.ref, "
|
|
68
|
+
updatePageLayout = async (layout) => {
|
|
69
|
+
const objectId = this.editableObjectId(layout.ref, "Page layout");
|
|
70
70
|
return this.authCall(async (client) => {
|
|
71
71
|
const response = await EntitiesApi_UpdateEntityReportPageLayouts(client.axios, client.basePath, {
|
|
72
72
|
workspaceId: this.workspace,
|
|
@@ -76,21 +76,21 @@ export class TigerWorkspaceReportsService {
|
|
|
76
76
|
data: {
|
|
77
77
|
type: "reportPageLayout",
|
|
78
78
|
id: objectId,
|
|
79
|
-
attributes:
|
|
79
|
+
attributes: convertPublisherPageLayoutToBackend(layout),
|
|
80
80
|
},
|
|
81
81
|
},
|
|
82
82
|
});
|
|
83
|
-
return
|
|
83
|
+
return convertPublisherPageLayout(response.data.data, response.data.included);
|
|
84
84
|
});
|
|
85
85
|
};
|
|
86
|
-
|
|
87
|
-
const objectId = this.editableObjectId(ref, "
|
|
86
|
+
deletePageLayout = async (ref) => {
|
|
87
|
+
const objectId = this.editableObjectId(ref, "Page layout");
|
|
88
88
|
await this.authCall((client) => EntitiesApi_DeleteEntityReportPageLayouts(client.axios, client.basePath, {
|
|
89
89
|
workspaceId: this.workspace,
|
|
90
90
|
objectId,
|
|
91
91
|
}));
|
|
92
92
|
};
|
|
93
|
-
|
|
93
|
+
getDocumentTemplates = async () => {
|
|
94
94
|
return this.authCall((client) => ActionsUtilities.loadAllPages(({ page, size }) => EntitiesApi_GetAllEntitiesReportTemplates(client.axios, client.basePath, {
|
|
95
95
|
workspaceId: this.workspace,
|
|
96
96
|
metaInclude: ["origin"],
|
|
@@ -98,9 +98,9 @@ export class TigerWorkspaceReportsService {
|
|
|
98
98
|
sort: byLastChange,
|
|
99
99
|
page,
|
|
100
100
|
size,
|
|
101
|
-
}).then((response) => response.data.data.map((template) =>
|
|
101
|
+
}).then((response) => response.data.data.map((template) => convertPublisherDocumentTemplate(template, response.data.included)))));
|
|
102
102
|
};
|
|
103
|
-
|
|
103
|
+
getDocumentTemplate = async (ref) => {
|
|
104
104
|
const objectId = objRefToIdentifier(ref, this.authCall);
|
|
105
105
|
return this.authCall(async (client) => {
|
|
106
106
|
const response = await EntitiesApi_GetEntityReportTemplates(client.axios, client.basePath, {
|
|
@@ -109,10 +109,10 @@ export class TigerWorkspaceReportsService {
|
|
|
109
109
|
metaInclude: ["origin"],
|
|
110
110
|
include: auditInclude,
|
|
111
111
|
});
|
|
112
|
-
return
|
|
112
|
+
return convertPublisherDocumentTemplate(response.data.data, response.data.included);
|
|
113
113
|
});
|
|
114
114
|
};
|
|
115
|
-
|
|
115
|
+
createDocumentTemplate = async (template) => {
|
|
116
116
|
const id = template.ref ? objRefToIdentifier(template.ref, this.authCall) : uuidv4();
|
|
117
117
|
return this.authCall(async (client) => {
|
|
118
118
|
const response = await EntitiesApi_CreateEntityReportTemplates(client.axios, client.basePath, {
|
|
@@ -122,14 +122,14 @@ export class TigerWorkspaceReportsService {
|
|
|
122
122
|
data: {
|
|
123
123
|
type: "reportTemplate",
|
|
124
124
|
id,
|
|
125
|
-
attributes:
|
|
125
|
+
attributes: convertPublisherDocumentTemplateToBackend(template),
|
|
126
126
|
},
|
|
127
127
|
},
|
|
128
128
|
});
|
|
129
|
-
return
|
|
129
|
+
return convertPublisherDocumentTemplate(response.data.data, response.data.included);
|
|
130
130
|
});
|
|
131
131
|
};
|
|
132
|
-
|
|
132
|
+
updateDocumentTemplate = async (template) => {
|
|
133
133
|
const objectId = objRefToIdentifier(template.ref, this.authCall);
|
|
134
134
|
return this.authCall(async (client) => {
|
|
135
135
|
const response = await EntitiesApi_UpdateEntityReportTemplates(client.axios, client.basePath, {
|
|
@@ -140,21 +140,21 @@ export class TigerWorkspaceReportsService {
|
|
|
140
140
|
data: {
|
|
141
141
|
type: "reportTemplate",
|
|
142
142
|
id: objectId,
|
|
143
|
-
attributes:
|
|
143
|
+
attributes: convertPublisherDocumentTemplateToBackend(template),
|
|
144
144
|
},
|
|
145
145
|
},
|
|
146
146
|
});
|
|
147
|
-
return
|
|
147
|
+
return convertPublisherDocumentTemplate(response.data.data, response.data.included);
|
|
148
148
|
});
|
|
149
149
|
};
|
|
150
|
-
|
|
150
|
+
deleteDocumentTemplate = async (ref) => {
|
|
151
151
|
const objectId = objRefToIdentifier(ref, this.authCall);
|
|
152
152
|
await this.authCall((client) => EntitiesApi_DeleteEntityReportTemplates(client.axios, client.basePath, {
|
|
153
153
|
workspaceId: this.workspace,
|
|
154
154
|
objectId,
|
|
155
155
|
}));
|
|
156
156
|
};
|
|
157
|
-
|
|
157
|
+
getDocuments = async () => {
|
|
158
158
|
return this.authCall((client) => ActionsUtilities.loadAllPages(({ page, size }) => EntitiesApi_GetAllEntitiesReports(client.axios, client.basePath, {
|
|
159
159
|
workspaceId: this.workspace,
|
|
160
160
|
metaInclude: ["origin"],
|
|
@@ -162,9 +162,9 @@ export class TigerWorkspaceReportsService {
|
|
|
162
162
|
sort: byLastChange,
|
|
163
163
|
page,
|
|
164
164
|
size,
|
|
165
|
-
}).then((response) => response.data.data.map((
|
|
165
|
+
}).then((response) => response.data.data.map((publisherDocument) => convertPublisherDocument(publisherDocument, response.data.included)))));
|
|
166
166
|
};
|
|
167
|
-
|
|
167
|
+
getDocument = async (ref) => {
|
|
168
168
|
const objectId = objRefToIdentifier(ref, this.authCall);
|
|
169
169
|
return this.authCall(async (client) => {
|
|
170
170
|
const response = await EntitiesApi_GetEntityReports(client.axios, client.basePath, {
|
|
@@ -173,11 +173,13 @@ export class TigerWorkspaceReportsService {
|
|
|
173
173
|
metaInclude: ["origin"],
|
|
174
174
|
include: auditInclude,
|
|
175
175
|
});
|
|
176
|
-
return
|
|
176
|
+
return convertPublisherDocument(response.data.data, response.data.included);
|
|
177
177
|
});
|
|
178
178
|
};
|
|
179
|
-
|
|
180
|
-
const id =
|
|
179
|
+
createDocument = async (publisherDocument) => {
|
|
180
|
+
const id = publisherDocument.ref
|
|
181
|
+
? objRefToIdentifier(publisherDocument.ref, this.authCall)
|
|
182
|
+
: uuidv4();
|
|
181
183
|
return this.authCall(async (client) => {
|
|
182
184
|
const response = await EntitiesApi_CreateEntityReports(client.axios, client.basePath, {
|
|
183
185
|
workspaceId: this.workspace,
|
|
@@ -186,15 +188,15 @@ export class TigerWorkspaceReportsService {
|
|
|
186
188
|
data: {
|
|
187
189
|
type: "report",
|
|
188
190
|
id,
|
|
189
|
-
attributes:
|
|
191
|
+
attributes: convertPublisherDocumentToBackend(publisherDocument),
|
|
190
192
|
},
|
|
191
193
|
},
|
|
192
194
|
});
|
|
193
|
-
return
|
|
195
|
+
return convertPublisherDocument(response.data.data, response.data.included);
|
|
194
196
|
});
|
|
195
197
|
};
|
|
196
|
-
|
|
197
|
-
const objectId = objRefToIdentifier(
|
|
198
|
+
updateDocument = async (publisherDocument) => {
|
|
199
|
+
const objectId = objRefToIdentifier(publisherDocument.ref, this.authCall);
|
|
198
200
|
return this.authCall(async (client) => {
|
|
199
201
|
const response = await EntitiesApi_UpdateEntityReports(client.axios, client.basePath, {
|
|
200
202
|
workspaceId: this.workspace,
|
|
@@ -204,34 +206,34 @@ export class TigerWorkspaceReportsService {
|
|
|
204
206
|
data: {
|
|
205
207
|
type: "report",
|
|
206
208
|
id: objectId,
|
|
207
|
-
attributes:
|
|
209
|
+
attributes: convertPublisherDocumentToBackend(publisherDocument),
|
|
208
210
|
},
|
|
209
211
|
},
|
|
210
212
|
});
|
|
211
|
-
return
|
|
213
|
+
return convertPublisherDocument(response.data.data, response.data.included);
|
|
212
214
|
});
|
|
213
215
|
};
|
|
214
|
-
|
|
216
|
+
deleteDocument = async (ref) => {
|
|
215
217
|
const objectId = objRefToIdentifier(ref, this.authCall);
|
|
216
218
|
await this.authCall((client) => EntitiesApi_DeleteEntityReports(client.axios, client.basePath, {
|
|
217
219
|
workspaceId: this.workspace,
|
|
218
220
|
objectId,
|
|
219
221
|
}));
|
|
220
222
|
};
|
|
221
|
-
|
|
222
|
-
const
|
|
223
|
+
exportDocumentToPdf = async (ref, options) => {
|
|
224
|
+
const documentId = objRefToIdentifier(ref, this.authCall);
|
|
223
225
|
return this.authCall(async (client) => {
|
|
224
|
-
const
|
|
226
|
+
const documentExport = await ExportApi_CreateReportExport(client.axios, client.basePath, {
|
|
225
227
|
workspaceId: this.workspace,
|
|
226
228
|
exportReportExportRequest: {
|
|
227
229
|
format: "PDF",
|
|
228
|
-
reportId,
|
|
230
|
+
reportId: documentId,
|
|
229
231
|
fileName: options?.filename ?? "",
|
|
230
232
|
},
|
|
231
233
|
});
|
|
232
234
|
return handleExportResultPolling(client, {
|
|
233
235
|
workspaceId: this.workspace,
|
|
234
|
-
exportId:
|
|
236
|
+
exportId: documentExport.data.exportResult,
|
|
235
237
|
}, "getReportExport", options?.timeout);
|
|
236
238
|
});
|
|
237
239
|
};
|
|
@@ -43,7 +43,7 @@ export declare class TigerWorkspaceSettings extends TigerSettingsService<IWorksp
|
|
|
43
43
|
deleteColorPalette(): Promise<any>;
|
|
44
44
|
deleteMetricFormatOverride(): Promise<void>;
|
|
45
45
|
getSettingsForCurrentUser(): Promise<IUserWorkspaceSettings>;
|
|
46
|
-
protected getSettingByType(type: TigerSettingsType): Promise<import("axios").AxiosResponse<import("@gooddata/api-client-tiger").JsonApiWorkspaceSettingOutList, any, {}>>;
|
|
46
|
+
protected getSettingByType(type: TigerSettingsType): Promise<import("axios").AxiosResponse<import("@gooddata/api-client-tiger").JsonApiWorkspaceSettingOutList, any, {}, any>>;
|
|
47
47
|
protected updateSetting(type: TigerSettingsType, id: string, content: any): Promise<any>;
|
|
48
48
|
protected createSetting(type: TigerSettingsType, id: string, content: any): Promise<any>;
|
|
49
49
|
protected deleteSettingByType(type: TigerSettingsType): 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,EACvB,KAAK,yBAAyB,EACjC,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACH,KAA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AAI,CAAC,CAEvD;IAEM,yBAAyB,IAAI,OAAO,CAAC,sBAAsB,CAAC,CAElE;IAED,UAAyB,gBAAgB,CAAC,IAAI,EAAE,iBAAiB,6HAQhE;IAED,UAAyB,aAAa,CAAC,IAAI,EAAE,iBAAiB,EAAE,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,CAmBtG;IAED,UAAyB,aAAa,CAAC,IAAI,EAAE,iBAAiB,EAAE,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,CAkBtG;IAED,UAAyB,mBAAmB,CAAC,IAAI,EAAE,iBAAiB,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"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type JsonApiReportOut, type JsonApiReportOutWithLinks, type JsonApiReportPageLayoutOut, type JsonApiReportPageLayoutOutWithLinks, type JsonApiReportTemplateOut, type JsonApiReportTemplateOutWithLinks, type JsonApiUserIdentifierOutWithLinks } from "@gooddata/api-client-tiger";
|
|
2
|
+
import { type IPublisherDocument, type IPublisherDocumentTemplate, type IPublisherPageLayout } from "@gooddata/sdk-model";
|
|
3
|
+
export declare function convertPublisherPageLayout(entity: JsonApiReportPageLayoutOut | JsonApiReportPageLayoutOutWithLinks, included?: JsonApiUserIdentifierOutWithLinks[]): IPublisherPageLayout;
|
|
4
|
+
export declare function convertPublisherDocumentTemplate(entity: JsonApiReportTemplateOut | JsonApiReportTemplateOutWithLinks, included?: JsonApiUserIdentifierOutWithLinks[]): IPublisherDocumentTemplate;
|
|
5
|
+
export declare function convertPublisherDocument(entity: JsonApiReportOut | JsonApiReportOutWithLinks, included?: JsonApiUserIdentifierOutWithLinks[]): IPublisherDocument;
|
|
6
|
+
//# sourceMappingURL=PublisherConverter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PublisherConverter.d.ts","sourceRoot":"","sources":["../../../src/convertors/fromBackend/PublisherConverter.ts"],"names":[],"mappings":"AAEA,OAAO,EACH,KAAK,gBAAgB,EACrB,KAAK,yBAAyB,EAC9B,KAAK,0BAA0B,EAC/B,KAAK,mCAAmC,EACxC,KAAK,wBAAwB,EAC7B,KAAK,iCAAiC,EACtC,KAAK,iCAAiC,EACzC,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACH,KAAK,kBAAkB,EAEvB,KAAK,0BAA0B,EAC/B,KAAK,oBAAoB,EAG5B,MAAM,qBAAqB,CAAC;AAW7B,wBAAgB,0BAA0B,CACtC,MAAM,EAAE,0BAA0B,GAAG,mCAAmC,EACxE,QAAQ,GAAE,iCAAiC,EAAO,GACnD,oBAAoB,CActB;AAED,wBAAgB,gCAAgC,CAC5C,MAAM,EAAE,wBAAwB,GAAG,iCAAiC,EACpE,QAAQ,GAAE,iCAAiC,EAAO,GACnD,0BAA0B,CAc5B;AAED,wBAAgB,wBAAwB,CACpC,MAAM,EAAE,gBAAgB,GAAG,yBAAyB,EACpD,QAAQ,GAAE,iCAAiC,EAAO,GACnD,kBAAkB,CAiBpB"}
|
|
@@ -7,7 +7,7 @@ import { convertUserIdentifier } from "./UsersConverter.js";
|
|
|
7
7
|
function asContent(content) {
|
|
8
8
|
return content;
|
|
9
9
|
}
|
|
10
|
-
export function
|
|
10
|
+
export function convertPublisherPageLayout(entity, included = []) {
|
|
11
11
|
return {
|
|
12
12
|
type: "reportPageLayout",
|
|
13
13
|
ref: idRef(entity.id, "reportPageLayout"),
|
|
@@ -22,7 +22,7 @@ export function convertReportPageLayout(entity, included = []) {
|
|
|
22
22
|
updatedBy: convertUserIdentifier(entity.relationships?.modifiedBy, included),
|
|
23
23
|
};
|
|
24
24
|
}
|
|
25
|
-
export function
|
|
25
|
+
export function convertPublisherDocumentTemplate(entity, included = []) {
|
|
26
26
|
return {
|
|
27
27
|
type: "reportTemplate",
|
|
28
28
|
ref: idRef(entity.id, "reportTemplate"),
|
|
@@ -37,7 +37,7 @@ export function convertReportTemplate(entity, included = []) {
|
|
|
37
37
|
updatedBy: convertUserIdentifier(entity.relationships?.modifiedBy, included),
|
|
38
38
|
};
|
|
39
39
|
}
|
|
40
|
-
export function
|
|
40
|
+
export function convertPublisherDocument(entity, included = []) {
|
|
41
41
|
return {
|
|
42
42
|
type: "report",
|
|
43
43
|
ref: idRef(entity.id, "report"),
|
|
@@ -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,EACrC,KAAK,sBAAsB,EAC3B,KAAK,0BAA0B,EAK/B,KAAK,yBAAyB,EAK9B,KAAK,aAAa,
|
|
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,EACrC,KAAK,sBAAsB,EAC3B,KAAK,0BAA0B,EAK/B,KAAK,yBAAyB,EAK9B,KAAK,aAAa,EAUrB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAEH,KAAK,iBAAiB,EAGtB,KAAK,sBAAsB,EAE3B,KAAK,gCAAgC,EACrC,KAAK,qBAAqB,EAC1B,KAAK,2BAA2B,EAGhC,KAAK,gBAAgB,EAExB,MAAM,2BAA2B,CAAC;AAyCnC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0CAA0C,CAAC;AACjF,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAKhE,wBAAgB,kCAAkC,CAAC,YAAY,EAAE,sBAAsB,GAAG,iBAAiB,CAS1G;AAED,wBAAgB,sCAAsC,CAClD,IAAI,EAAE,0BAA0B,EAChC,SAAS,EAAE,0BAA0B,CAAC,WAAW,CAAC,GAAG,SAAS,EAC9D,OAAO,EAAE,qBAAqB,EAAE,EAChC,cAAc,EAAE,cAAc,EAC9B,MAAM,CAAC,EAAE,gBAAgB,EACzB,QAAQ,CAAC,EAAE,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;AAiND,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"}
|
|
@@ -10,7 +10,7 @@ import { convertAttribute } from "./AttributeConvertor.js";
|
|
|
10
10
|
import { convertAlert } from "./AutomationConverter.js";
|
|
11
11
|
import { cloneWithSanitizedIds } from "./IdSanitization.js";
|
|
12
12
|
import { visualizationObjectsItemToInsight } from "./InsightConverter.js";
|
|
13
|
-
import {
|
|
13
|
+
import { convertPublisherDocumentPart } from "./publisherDocumentPartConvertor.js";
|
|
14
14
|
export function convertChatConversationFromBackend(conversation) {
|
|
15
15
|
return {
|
|
16
16
|
id: conversation.conversationId,
|
|
@@ -156,7 +156,7 @@ function convertMultipartPart(part, history, siblings, dateNormalizer, locale, t
|
|
|
156
156
|
return {
|
|
157
157
|
type: "visualization",
|
|
158
158
|
visualization: part.visualization
|
|
159
|
-
? visualizationObjectsItemToInsight(yamlVisualisationToMetadataObject(
|
|
159
|
+
? visualizationObjectsItemToInsight(yamlVisualisationToMetadataObject(buildDatasetEntities(part.references), part.visualization))
|
|
160
160
|
: null,
|
|
161
161
|
};
|
|
162
162
|
case "dashboard": {
|
|
@@ -175,7 +175,7 @@ function convertMultipartPart(part, history, siblings, dateNormalizer, locale, t
|
|
|
175
175
|
};
|
|
176
176
|
}
|
|
177
177
|
case "report":
|
|
178
|
-
return
|
|
178
|
+
return convertPublisherDocumentPart(part);
|
|
179
179
|
case "kda":
|
|
180
180
|
if (!part.kda) {
|
|
181
181
|
return undefined;
|
|
@@ -547,6 +547,7 @@ function applyDashboardPatch(items, siblings, patch) {
|
|
|
547
547
|
return {
|
|
548
548
|
datasets: unique(acc?.datasets, curr?.datasets),
|
|
549
549
|
datedatasets: unique(acc?.datedatasets, curr?.datedatasets),
|
|
550
|
+
metrics: unique(getReferencedMetrics(acc), getReferencedMetrics(curr)),
|
|
550
551
|
new_visualizations: unique(acc?.new_visualizations, curr?.new_visualizations),
|
|
551
552
|
visualizations: unique(acc?.visualizations, curr?.visualizations),
|
|
552
553
|
};
|
|
@@ -606,8 +607,7 @@ function applyDashboardDefinition(part) {
|
|
|
606
607
|
dashboard: convertToTemporaryFilterContexts(dashboard),
|
|
607
608
|
};
|
|
608
609
|
}
|
|
609
|
-
function
|
|
610
|
-
const entities = [];
|
|
610
|
+
function buildDatasetEntities(references) {
|
|
611
611
|
const dateDatasets = references?.datedatasets?.map((ds) => {
|
|
612
612
|
const data = ds;
|
|
613
613
|
return {
|
|
@@ -618,7 +618,6 @@ function buildDashboardReferences(aacDashboard, references, savedDashboardId) {
|
|
|
618
618
|
declarative: yamlDateDatesetToDeclarative(data),
|
|
619
619
|
};
|
|
620
620
|
}) ?? [];
|
|
621
|
-
entities.push(...dateDatasets);
|
|
622
621
|
const datasets = references?.datasets?.map((ds) => {
|
|
623
622
|
const data = ds;
|
|
624
623
|
return {
|
|
@@ -629,7 +628,19 @@ function buildDashboardReferences(aacDashboard, references, savedDashboardId) {
|
|
|
629
628
|
declarative: yamlDatasetToDeclarative(dateDatasets, data),
|
|
630
629
|
};
|
|
631
630
|
}) ?? [];
|
|
632
|
-
|
|
631
|
+
const metrics = getReferencedMetrics(references).map((data) => ({
|
|
632
|
+
data,
|
|
633
|
+
path: "",
|
|
634
|
+
type: "metric",
|
|
635
|
+
id: data.id,
|
|
636
|
+
}));
|
|
637
|
+
return [...dateDatasets, ...datasets, ...metrics];
|
|
638
|
+
}
|
|
639
|
+
function getReferencedMetrics(references) {
|
|
640
|
+
return (references?.metrics ?? []);
|
|
641
|
+
}
|
|
642
|
+
function buildDashboardReferences(aacDashboard, references, savedDashboardId) {
|
|
643
|
+
const entities = buildDatasetEntities(references);
|
|
633
644
|
const existingVisualizations = (references?.visualizations ?? []).map((vis) => {
|
|
634
645
|
const data = vis;
|
|
635
646
|
return {
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type AiReportPart } from "@gooddata/api-client-tiger";
|
|
2
|
+
import { type IChatConversationPublisherDocumentContent } from "@gooddata/sdk-backend-spi";
|
|
3
|
+
/**
|
|
4
|
+
* Converts a report 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 convertPublisherDocumentPart(part: AiReportPart): IChatConversationPublisherDocumentContent;
|
|
8
|
+
//# sourceMappingURL=publisherDocumentPartConvertor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"publisherDocumentPartConvertor.d.ts","sourceRoot":"","sources":["../../../src/convertors/fromBackend/publisherDocumentPartConvertor.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAE,KAAK,yCAAyC,EAAE,MAAM,2BAA2B,CAAC;AA2E3F;;;GAGG;AACH,wBAAgB,4BAA4B,CAAC,IAAI,EAAE,YAAY,GAAG,yCAAyC,CAY1G"}
|
package/esm/convertors/fromBackend/{reportPartConvertor.js → publisherDocumentPartConvertor.js}
RENAMED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
// (C) 2026 GoodData Corporation
|
|
2
|
-
import {
|
|
2
|
+
import { yamlPublisherDocumentToDefinition } from "@gooddata/sdk-code-convertors";
|
|
3
3
|
import { isIdentifierRef } from "@gooddata/sdk-model";
|
|
4
|
-
const
|
|
4
|
+
const DEFAULT_PUBLISHER_DOCUMENT_FORMAT = "aac-v1";
|
|
5
5
|
// The backend can name a format this client was not generated for, so the name is read as text.
|
|
6
|
-
const
|
|
7
|
-
[
|
|
6
|
+
const PUBLISHER_DOCUMENT_FORMAT_CONVERTORS = new Map([
|
|
7
|
+
[DEFAULT_PUBLISHER_DOCUMENT_FORMAT, yamlPublisherDocumentToDefinition],
|
|
8
8
|
]);
|
|
9
|
-
// The convertor throws on a document it cannot read, so this only has to tell a
|
|
9
|
+
// The convertor throws on a document it cannot read, so this only has to tell a document from any other
|
|
10
10
|
// value; what is inside is the convertor's to reject.
|
|
11
|
-
function
|
|
11
|
+
function isAacPublisherDocument(value) {
|
|
12
12
|
return typeof value === "object" && value !== null && "type" in value && value.type === "report";
|
|
13
13
|
}
|
|
14
14
|
const isText = (value) => typeof value === "string";
|
|
@@ -17,11 +17,11 @@ const isTextMap = (value) => typeof value === "object" &&
|
|
|
17
17
|
value !== null &&
|
|
18
18
|
!Array.isArray(value) &&
|
|
19
19
|
Object.values(value).every(isText);
|
|
20
|
-
// The format convertors copy the fields across as written. Without a text title and period the
|
|
20
|
+
// The format convertors copy the fields across as written. Without a text title and period the document
|
|
21
21
|
// cannot be shown, so a wrong type rejects it.
|
|
22
22
|
const hasTypedRequiredFields = ({ title, periodStart, periodEnd }) => [title, periodStart, periodEnd].every(isText);
|
|
23
23
|
// An optional field of the wrong type would reach the caller typed as the right one.
|
|
24
|
-
// Dropping it keeps the rest of the
|
|
24
|
+
// Dropping it keeps the rest of the document readable.
|
|
25
25
|
function withTypedOptionalFields(definition) {
|
|
26
26
|
const { description, tags, variableValues, ref, ...required } = definition;
|
|
27
27
|
return {
|
|
@@ -32,20 +32,20 @@ function withTypedOptionalFields(definition) {
|
|
|
32
32
|
...(isIdentifierRef(ref) && isText(ref.identifier) ? { ref } : {}),
|
|
33
33
|
};
|
|
34
34
|
}
|
|
35
|
-
function
|
|
36
|
-
const convertor =
|
|
35
|
+
function toPublisherDocumentDefinition(publisherDocument, format) {
|
|
36
|
+
const convertor = PUBLISHER_DOCUMENT_FORMAT_CONVERTORS.get(format);
|
|
37
37
|
if (!convertor) {
|
|
38
|
-
console.error(`Unknown
|
|
38
|
+
console.error(`Unknown document format "${format}".`);
|
|
39
39
|
return null;
|
|
40
40
|
}
|
|
41
|
-
if (!
|
|
42
|
-
console.error("The report part does not carry a
|
|
41
|
+
if (!isAacPublisherDocument(publisherDocument)) {
|
|
42
|
+
console.error("The report part does not carry a document.");
|
|
43
43
|
return null;
|
|
44
44
|
}
|
|
45
45
|
try {
|
|
46
|
-
const definition = convertor(
|
|
46
|
+
const definition = convertor(publisherDocument);
|
|
47
47
|
if (!hasTypedRequiredFields(definition)) {
|
|
48
|
-
console.error("The
|
|
48
|
+
console.error("The document's title or period is not text.");
|
|
49
49
|
return null;
|
|
50
50
|
}
|
|
51
51
|
return withTypedOptionalFields(definition);
|
|
@@ -56,17 +56,19 @@ function convertReport(report, format) {
|
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
58
|
/**
|
|
59
|
-
* Converts a report part. A
|
|
60
|
-
* chat can say the
|
|
59
|
+
* Converts a report part. A document that cannot be read still yields a part, with `publisherDocument`
|
|
60
|
+
* null, so the chat can say the document is unavailable instead of dropping it.
|
|
61
61
|
*/
|
|
62
|
-
export function
|
|
62
|
+
export function convertPublisherDocumentPart(part) {
|
|
63
63
|
return {
|
|
64
|
-
type: "
|
|
65
|
-
|
|
64
|
+
type: "publisherDocument",
|
|
65
|
+
publisherDocument: part.report
|
|
66
|
+
? toPublisherDocumentDefinition(part.report, part.format ?? DEFAULT_PUBLISHER_DOCUMENT_FORMAT)
|
|
67
|
+
: null,
|
|
66
68
|
saved: part.saved_report_id,
|
|
67
69
|
ref: part.report_ref,
|
|
68
|
-
|
|
70
|
+
baseDocumentId: part.base_report_id,
|
|
69
71
|
refines: part.refines_ref,
|
|
70
|
-
...(part.reworks_open_report ? {
|
|
72
|
+
...(part.reworks_open_report ? { reworksOpenDocument: true } : {}),
|
|
71
73
|
};
|
|
72
74
|
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type JsonApiReportInAttributes, type JsonApiReportPageLayoutInAttributes, type JsonApiReportTemplateInAttributes } from "@gooddata/api-client-tiger";
|
|
2
|
+
import { type IPublisherDocumentDefinition, type IPublisherDocumentTemplateDefinition, type IPublisherPageLayoutDefinition } from "@gooddata/sdk-model";
|
|
3
|
+
export declare function convertPublisherPageLayoutToBackend(layout: IPublisherPageLayoutDefinition): JsonApiReportPageLayoutInAttributes;
|
|
4
|
+
export declare function convertPublisherDocumentTemplateToBackend(template: IPublisherDocumentTemplateDefinition): JsonApiReportTemplateInAttributes;
|
|
5
|
+
export declare function convertPublisherDocumentToBackend(publisherDocument: IPublisherDocumentDefinition): JsonApiReportInAttributes;
|
|
6
|
+
//# sourceMappingURL=PublisherConverter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PublisherConverter.d.ts","sourceRoot":"","sources":["../../../src/convertors/toBackend/PublisherConverter.ts"],"names":[],"mappings":"AAEA,OAAO,EACH,KAAK,yBAAyB,EAC9B,KAAK,mCAAmC,EACxC,KAAK,iCAAiC,EACzC,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACH,KAAK,4BAA4B,EACjC,KAAK,oCAAoC,EACzC,KAAK,8BAA8B,EACtC,MAAM,qBAAqB,CAAC;AAE7B,wBAAgB,mCAAmC,CAC/C,MAAM,EAAE,8BAA8B,GACvC,mCAAmC,CAOrC;AAED,wBAAgB,yCAAyC,CACrD,QAAQ,EAAE,oCAAoC,GAC/C,iCAAiC,CAOnC;AAED,wBAAgB,iCAAiC,CAC7C,iBAAiB,EAAE,4BAA4B,GAChD,yBAAyB,CAU3B"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
// (C) 2026 GoodData Corporation
|
|
2
|
+
export function convertPublisherPageLayoutToBackend(layout) {
|
|
3
|
+
return {
|
|
4
|
+
title: layout.title,
|
|
5
|
+
description: layout.description,
|
|
6
|
+
tags: layout.tags,
|
|
7
|
+
content: layout.content,
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
export function convertPublisherDocumentTemplateToBackend(template) {
|
|
11
|
+
return {
|
|
12
|
+
title: template.title,
|
|
13
|
+
description: template.description,
|
|
14
|
+
tags: template.tags,
|
|
15
|
+
content: template.content,
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
export function convertPublisherDocumentToBackend(publisherDocument) {
|
|
19
|
+
return {
|
|
20
|
+
title: publisherDocument.title,
|
|
21
|
+
description: publisherDocument.description,
|
|
22
|
+
tags: publisherDocument.tags,
|
|
23
|
+
periodStart: publisherDocument.periodStart,
|
|
24
|
+
periodEnd: publisherDocument.periodEnd,
|
|
25
|
+
content: publisherDocument.content,
|
|
26
|
+
variableValues: publisherDocument.variableValues,
|
|
27
|
+
};
|
|
28
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gooddata/sdk-backend-tiger",
|
|
3
|
-
"version": "11.62.0-alpha.
|
|
3
|
+
"version": "11.62.0-alpha.2",
|
|
4
4
|
"description": "GoodData Backend SPI implementation for GoodData Cloud and GoodData.CN",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "GoodData",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"exports": "./esm/index.js",
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"@gooddata/emailjs-mime-codec-new": "3.0.2",
|
|
25
|
-
"axios": "1.
|
|
25
|
+
"axios": "1.20.0",
|
|
26
26
|
"date-fns": "4.1.0",
|
|
27
27
|
"date-fns-tz": "^3.2.0",
|
|
28
28
|
"eventsource-parser": "~3.0.0",
|
|
@@ -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/
|
|
38
|
-
"@gooddata/sdk-
|
|
39
|
-
"@gooddata/
|
|
40
|
-
"@gooddata/sdk-
|
|
41
|
-
"@gooddata/
|
|
42
|
-
"@gooddata/
|
|
37
|
+
"@gooddata/api-client-tiger": "11.62.0-alpha.2",
|
|
38
|
+
"@gooddata/sdk-backend-base": "11.62.0-alpha.2",
|
|
39
|
+
"@gooddata/sdk-backend-spi": "11.62.0-alpha.2",
|
|
40
|
+
"@gooddata/sdk-model": "11.62.0-alpha.2",
|
|
41
|
+
"@gooddata/sdk-code-convertors": "11.62.0-alpha.2",
|
|
42
|
+
"@gooddata/util": "11.62.0-alpha.2"
|
|
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": "4.1.11",
|
|
67
|
-
"@gooddata/catalog-export": "11.62.0-alpha.
|
|
68
|
-
"@gooddata/
|
|
69
|
-
"@gooddata/oxlint-config": "11.62.0-alpha.
|
|
70
|
-
"@gooddata/
|
|
67
|
+
"@gooddata/catalog-export": "11.62.0-alpha.2",
|
|
68
|
+
"@gooddata/reference-workspace": "11.62.0-alpha.2",
|
|
69
|
+
"@gooddata/oxlint-config": "11.62.0-alpha.2",
|
|
70
|
+
"@gooddata/eslint-config": "11.62.0-alpha.2"
|
|
71
71
|
},
|
|
72
72
|
"scripts": {
|
|
73
73
|
"_phase:build": "npm run build",
|