@gooddata/sdk-backend-mockingbird 11.64.0-alpha.4 → 11.64.0
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/recordedBackend/index.ts"],"names":[],"mappings":"AAOA,OAAO,EACH,KAAK,kBAAkB,EAKvB,KAAK,oBAAoB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/recordedBackend/index.ts"],"names":[],"mappings":"AAOA,OAAO,EACH,KAAK,kBAAkB,EAKvB,KAAK,oBAAoB,EA0D5B,MAAM,2BAA2B,CAAC;AAmCnC,OAAO,EAAE,KAAK,qBAAqB,EAAE,KAAK,cAAc,EAAE,MAAM,YAAY,CAAC;AAkB7E;;GAEG;AACH,eAAO,MAAM,kCAAkC,EAAE,oBAehD,CAAC;AAEF;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,eAAe,CAC3B,KAAK,EAAE,cAAc,EACrB,MAAM,GAAE,qBAAqC,EAC7C,YAAY,uBAAqC,GAClD,kBAAkB,CAsDpB"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// (C) 2019-2026 GoodData Corporation
|
|
2
2
|
import { DummyChatConversations, DummySemanticSearchQueryBuilder, InMemoryPaging, } from "@gooddata/sdk-backend-base";
|
|
3
3
|
import { NotSupported, UnexpectedResponseError, } from "@gooddata/sdk-backend-spi";
|
|
4
|
-
import {
|
|
4
|
+
import { DefaultPublisherPageTemplatesV1, areObjRefsEqual, idRef, isIdentifierRef, } from "@gooddata/sdk-model";
|
|
5
5
|
import { createMockGeoService } from "../geoService.js";
|
|
6
6
|
import { RecordedAttributeHierarchiesService } from "./attributeHierarchies.js";
|
|
7
7
|
import { RecordedAttributes } from "./attributes.js";
|
|
@@ -467,9 +467,9 @@ function recordedWorkspace(workspace, recordings = {}, implConfig) {
|
|
|
467
467
|
},
|
|
468
468
|
publisher() {
|
|
469
469
|
return {
|
|
470
|
-
getPageTemplates: () => Promise.resolve([...
|
|
470
|
+
getPageTemplates: () => Promise.resolve([...DefaultPublisherPageTemplatesV1]),
|
|
471
471
|
getPageTemplate: (ref) => {
|
|
472
|
-
const page =
|
|
472
|
+
const page = DefaultPublisherPageTemplatesV1.find((candidate) => areObjRefsEqual(candidate.ref, ref));
|
|
473
473
|
if (!page) {
|
|
474
474
|
throw new UnexpectedResponseError("Report page not found", 404, {});
|
|
475
475
|
}
|
|
@@ -477,13 +477,13 @@ function recordedWorkspace(workspace, recordings = {}, implConfig) {
|
|
|
477
477
|
},
|
|
478
478
|
createPageTemplate: (page) => Promise.resolve({ ...page, ref: idRef("recordedReportPage") }),
|
|
479
479
|
updatePageTemplate: (page) => {
|
|
480
|
-
if (
|
|
480
|
+
if (DefaultPublisherPageTemplatesV1.some((candidate) => areObjRefsEqual(candidate.ref, page.ref))) {
|
|
481
481
|
throw new NotSupported("Default page templates cannot be updated.");
|
|
482
482
|
}
|
|
483
483
|
return Promise.resolve(page);
|
|
484
484
|
},
|
|
485
485
|
deletePageTemplate: (ref) => {
|
|
486
|
-
if (
|
|
486
|
+
if (DefaultPublisherPageTemplatesV1.some((candidate) => areObjRefsEqual(candidate.ref, ref))) {
|
|
487
487
|
throw new NotSupported("Default page templates cannot be deleted.");
|
|
488
488
|
}
|
|
489
489
|
return Promise.resolve();
|
|
@@ -496,6 +496,7 @@ function recordedWorkspace(workspace, recordings = {}, implConfig) {
|
|
|
496
496
|
updateDocumentTemplate: (template) => Promise.resolve(template),
|
|
497
497
|
deleteDocumentTemplate: () => Promise.resolve(),
|
|
498
498
|
getDocuments: () => Promise.resolve([]),
|
|
499
|
+
hasDocuments: () => Promise.resolve(false),
|
|
499
500
|
getDocument: () => {
|
|
500
501
|
throw new UnexpectedResponseError("Report not found", 404, {});
|
|
501
502
|
},
|
|
@@ -509,6 +510,33 @@ function recordedWorkspace(workspace, recordings = {}, implConfig) {
|
|
|
509
510
|
}),
|
|
510
511
|
};
|
|
511
512
|
},
|
|
513
|
+
publisherV2() {
|
|
514
|
+
return {
|
|
515
|
+
getPageTemplates: () => Promise.resolve([]),
|
|
516
|
+
getPageTemplate: () => Promise.reject(new UnexpectedResponseError("Page template not found", 404, {})),
|
|
517
|
+
createPageTemplate: (template) => Promise.resolve({ ...template, ref: idRef("recordedPageTemplate", "pageTemplate") }),
|
|
518
|
+
updatePageTemplate: (template) => Promise.resolve(template),
|
|
519
|
+
deletePageTemplate: () => Promise.resolve(),
|
|
520
|
+
getDocumentTemplates: () => Promise.resolve([]),
|
|
521
|
+
getDocumentTemplate: () => Promise.reject(new UnexpectedResponseError("Document template not found", 404, {})),
|
|
522
|
+
createDocumentTemplate: (template) => Promise.resolve({
|
|
523
|
+
...template,
|
|
524
|
+
ref: idRef("recordedDocumentTemplate", "documentTemplate"),
|
|
525
|
+
}),
|
|
526
|
+
updateDocumentTemplate: (template) => Promise.resolve(template),
|
|
527
|
+
deleteDocumentTemplate: () => Promise.resolve(),
|
|
528
|
+
getDocuments: () => Promise.resolve([]),
|
|
529
|
+
getDocument: () => Promise.reject(new UnexpectedResponseError("Document not found", 404, {})),
|
|
530
|
+
createDocument: (publisherDocument) => Promise.resolve({ ...publisherDocument, ref: idRef("recordedDocument", "document") }),
|
|
531
|
+
updateDocument: (publisherDocument) => Promise.resolve(publisherDocument),
|
|
532
|
+
deleteDocument: () => Promise.resolve(),
|
|
533
|
+
exportDocumentToPdf: () => Promise.resolve({
|
|
534
|
+
uri: "/example/export.pdf",
|
|
535
|
+
objectUrl: "blob:/01345454545454",
|
|
536
|
+
fileName: "export.pdf",
|
|
537
|
+
}),
|
|
538
|
+
};
|
|
539
|
+
},
|
|
512
540
|
localization() {
|
|
513
541
|
return recordedLocalizationService();
|
|
514
542
|
},
|
|
@@ -936,6 +964,7 @@ function recordedUserService(implConfig) {
|
|
|
936
964
|
...implConfig.globalSettings,
|
|
937
965
|
}),
|
|
938
966
|
setLocale: () => Promise.resolve(),
|
|
967
|
+
deleteLocale: () => Promise.resolve(),
|
|
939
968
|
setMetadataLocale: () => Promise.resolve(),
|
|
940
969
|
setFormatLocale: () => Promise.resolve(),
|
|
941
970
|
setSeparators: () => Promise.resolve(),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gooddata/sdk-backend-mockingbird",
|
|
3
|
-
"version": "11.64.0
|
|
3
|
+
"version": "11.64.0",
|
|
4
4
|
"description": "Mock GoodData Backend SPI implementation",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "GoodData",
|
|
@@ -25,10 +25,10 @@
|
|
|
25
25
|
"ts-invariant": "0.10.3",
|
|
26
26
|
"tslib": "2.8.1",
|
|
27
27
|
"uuid": "11.1.1",
|
|
28
|
-
"@gooddata/sdk-
|
|
29
|
-
"@gooddata/sdk-
|
|
30
|
-
"@gooddata/sdk-backend-spi": "11.64.0
|
|
31
|
-
"@gooddata/util": "11.64.0
|
|
28
|
+
"@gooddata/sdk-backend-base": "11.64.0",
|
|
29
|
+
"@gooddata/sdk-model": "11.64.0",
|
|
30
|
+
"@gooddata/sdk-backend-spi": "11.64.0",
|
|
31
|
+
"@gooddata/util": "11.64.0"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"@microsoft/api-documenter": "7.30.16",
|
|
@@ -50,9 +50,9 @@
|
|
|
50
50
|
"oxlint-tsgolint": "7.0.2001",
|
|
51
51
|
"typescript": "7.0.2",
|
|
52
52
|
"vitest": "5.0.4",
|
|
53
|
-
"@gooddata/eslint-config": "11.64.0
|
|
54
|
-
"@gooddata/reference-workspace": "11.64.0
|
|
55
|
-
"@gooddata/oxlint-config": "11.64.0
|
|
53
|
+
"@gooddata/eslint-config": "11.64.0",
|
|
54
|
+
"@gooddata/reference-workspace": "11.64.0",
|
|
55
|
+
"@gooddata/oxlint-config": "11.64.0"
|
|
56
56
|
},
|
|
57
57
|
"scripts": {
|
|
58
58
|
"_phase:build": "npm run build",
|