@gooddata/mock-handling 10.35.0-alpha.8 → 10.35.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.
- package/esm/__version.d.ts +1 -1
- package/esm/__version.d.ts.map +1 -1
- package/esm/__version.js +1 -1
- package/esm/__version.js.map +1 -1
- package/esm/backend.d.ts.map +1 -1
- package/esm/base/types.d.ts.map +1 -1
- package/esm/base/types.js +1 -1
- package/esm/base/types.js.map +1 -1
- package/esm/codegen/catalog.d.ts +1 -2
- package/esm/codegen/catalog.d.ts.map +1 -1
- package/esm/codegen/catalog.js +8 -23
- package/esm/codegen/catalog.js.map +1 -1
- package/esm/codegen/dashboard.d.ts +1 -2
- package/esm/codegen/dashboard.d.ts.map +1 -1
- package/esm/codegen/dashboard.js +12 -22
- package/esm/codegen/dashboard.js.map +1 -1
- package/esm/codegen/dataSample.d.ts +2 -2
- package/esm/codegen/dataSample.d.ts.map +1 -1
- package/esm/codegen/dataSample.js +5 -27
- package/esm/codegen/dataSample.js.map +1 -1
- package/esm/codegen/displayForm.d.ts +1 -2
- package/esm/codegen/displayForm.d.ts.map +1 -1
- package/esm/codegen/displayForm.js +12 -22
- package/esm/codegen/displayForm.js.map +1 -1
- package/esm/codegen/execution.d.ts +1 -2
- package/esm/codegen/execution.d.ts.map +1 -1
- package/esm/codegen/execution.js +16 -32
- package/esm/codegen/execution.js.map +1 -1
- package/esm/codegen/index.d.ts +3 -3
- package/esm/codegen/index.d.ts.map +1 -1
- package/esm/codegen/index.js +103 -68
- package/esm/codegen/index.js.map +1 -1
- package/esm/codegen/insight.d.ts +1 -2
- package/esm/codegen/insight.d.ts.map +1 -1
- package/esm/codegen/insight.js +13 -32
- package/esm/codegen/insight.js.map +1 -1
- package/esm/codegen/visClasses.d.ts +1 -2
- package/esm/codegen/visClasses.d.ts.map +1 -1
- package/esm/codegen/visClasses.js +8 -23
- package/esm/codegen/visClasses.js.map +1 -1
- package/esm/index.js +3 -3
- package/esm/index.js.map +1 -1
- package/esm/recordings/common.js +2 -2
- package/esm/recordings/common.js.map +1 -1
- package/package.json +12 -13
package/esm/__version.d.ts
CHANGED
package/esm/__version.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"__version.d.ts","sourceRoot":"","sources":["../src/__version.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"__version.d.ts","sourceRoot":"","sources":["../src/__version.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,WAAW,YAAY,CAAC;AAErC,eAAO,MAAM,QAAQ,4BAA4B,CAAC"}
|
package/esm/__version.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// (C) 2021 GoodData Corporation
|
|
2
2
|
// DO NOT CHANGE THIS FILE, IT IS RE-GENERATED ON EVERY BUILD
|
|
3
|
-
export const LIB_VERSION = "10.35.0
|
|
3
|
+
export const LIB_VERSION = "10.35.0";
|
|
4
4
|
export const LIB_NAME = "@gooddata/mock-handling";
|
|
5
5
|
//# sourceMappingURL=__version.js.map
|
package/esm/__version.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"__version.js","sourceRoot":"","sources":["../src/__version.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,6DAA6D;AAC7D,MAAM,CAAC,MAAM,WAAW,GAAG,
|
|
1
|
+
{"version":3,"file":"__version.js","sourceRoot":"","sources":["../src/__version.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,6DAA6D;AAC7D,MAAM,CAAC,MAAM,WAAW,GAAG,SAAS,CAAC;AAErC,MAAM,CAAC,MAAM,QAAQ,GAAG,yBAAyB,CAAC"}
|
package/esm/backend.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"backend.d.ts","sourceRoot":"","sources":["../src/backend.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAmB,MAAM,2BAA2B,CAAC;AAKhF,eAAO,MAAM,gBAAgB,
|
|
1
|
+
{"version":3,"file":"backend.d.ts","sourceRoot":"","sources":["../src/backend.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAmB,MAAM,2BAA2B,CAAC;AAKhF,eAAO,MAAM,gBAAgB,GAAI,YAAY,MAAM,EAAE,UAAU,MAAM,KAAG,kBAavE,CAAC;AAEF,QAAA,MAAM,UAAU,QAAO,kBAOtB,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
package/esm/base/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/base/types.ts"],"names":[],"mappings":"AAGA;;;;;;GAMG;AACH,qBAAa,iBAAkB,SAAQ,KAAK;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/base/types.ts"],"names":[],"mappings":"AAGA;;;;;;GAMG;AACH,qBAAa,iBAAkB,SAAQ,KAAK;aAGpB,EAAE,EAAE,MAAM;gBAD1B,OAAO,EAAE,MAAM,EACC,EAAE,EAAE,MAAM;CAIjC;AAMD;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG;IAC7B;;OAEG;IACH,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IAExB;;OAEG;IACH,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IAEzB;;OAEG;IACH,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAE1B;;OAEG;IACH,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAE5B;;;OAGG;IACH,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;CACnC,CAAC;AAEF,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,OAAO,GAAG,GAAG,IAAI,iBAAiB,CAE1E"}
|
package/esm/base/types.js
CHANGED
package/esm/base/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/base/types.ts"],"names":[],"mappings":"AAAA,qCAAqC;AACrC,OAAO,OAAO,MAAM,mBAAmB,CAAC;AAExC;;;;;;GAMG;AACH,MAAM,OAAO,iBAAkB,SAAQ,KAAK;
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/base/types.ts"],"names":[],"mappings":"AAAA,qCAAqC;AACrC,OAAO,OAAO,MAAM,mBAAmB,CAAC;AAExC;;;;;;GAMG;AACH,MAAM,OAAO,iBAAkB,SAAQ,KAAK;IAGpB;IAFpB,YACI,OAAe,EACC,EAAU;QAE1B,KAAK,CAAC,OAAO,CAAC,CAAC;QAFC,OAAE,GAAF,EAAE,CAAQ;IAG9B,CAAC;CACJ;AAqCD,MAAM,UAAU,mBAAmB,CAAC,GAAY;IAC5C,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,IAAK,GAAyB,CAAC,EAAE,KAAK,SAAS,CAAC;AACxE,CAAC"}
|
package/esm/codegen/catalog.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { OptionalKind, VariableStatementStructure } from "ts-morph";
|
|
2
1
|
import { CatalogRecording } from "../recordings/catalog.js";
|
|
3
2
|
/**
|
|
4
3
|
* Generate constants for catalog recording. This function will return non-exported constant per recording.
|
|
@@ -7,5 +6,5 @@ import { CatalogRecording } from "../recordings/catalog.js";
|
|
|
7
6
|
* @param targetDir - absolute path to directory where index will be stored, this is needed so that paths can be
|
|
8
7
|
* made relative for require()
|
|
9
8
|
*/
|
|
10
|
-
export declare function generateConstantsForCatalog(recording: CatalogRecording
|
|
9
|
+
export declare function generateConstantsForCatalog(recording: CatalogRecording, targetDir: string): string[];
|
|
11
10
|
//# sourceMappingURL=catalog.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"catalog.d.ts","sourceRoot":"","sources":["../../src/codegen/catalog.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"catalog.d.ts","sourceRoot":"","sources":["../../src/codegen/catalog.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAI5D;;;;;;GAMG;AACH,wBAAgB,2BAA2B,CAAC,SAAS,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,EAAE,CAcpG"}
|
package/esm/codegen/catalog.js
CHANGED
|
@@ -1,27 +1,6 @@
|
|
|
1
|
-
// (C) 2020 GoodData Corporation
|
|
1
|
+
// (C) 2020-2025 GoodData Corporation
|
|
2
2
|
import * as path from "path";
|
|
3
|
-
import { VariableDeclarationKind } from "ts-morph";
|
|
4
|
-
import compact from "lodash/compact.js";
|
|
5
3
|
// const CatalogIndexConstName = "Catalog";
|
|
6
|
-
function catalogRecordingInit(rec, targetDir) {
|
|
7
|
-
const entries = Object.entries(rec.getEntryForRecordingIndex());
|
|
8
|
-
const entryRows = entries
|
|
9
|
-
.map(([type, file]) => `${type}: require('./${path.relative(targetDir, file)}')`)
|
|
10
|
-
.join(",");
|
|
11
|
-
return `{ ${entryRows} }`;
|
|
12
|
-
}
|
|
13
|
-
function generateRecordingConst(rec, targetDir) {
|
|
14
|
-
return {
|
|
15
|
-
declarationKind: VariableDeclarationKind.Const,
|
|
16
|
-
isExported: false,
|
|
17
|
-
declarations: [
|
|
18
|
-
{
|
|
19
|
-
name: rec.getRecordingName(),
|
|
20
|
-
initializer: catalogRecordingInit(rec, targetDir),
|
|
21
|
-
},
|
|
22
|
-
],
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
4
|
/**
|
|
26
5
|
* Generate constants for catalog recording. This function will return non-exported constant per recording.
|
|
27
6
|
*
|
|
@@ -30,6 +9,12 @@ function generateRecordingConst(rec, targetDir) {
|
|
|
30
9
|
* made relative for require()
|
|
31
10
|
*/
|
|
32
11
|
export function generateConstantsForCatalog(recording, targetDir) {
|
|
33
|
-
|
|
12
|
+
const entries = Object.entries(recording.getEntryForRecordingIndex());
|
|
13
|
+
const recordingName = recording.getRecordingName();
|
|
14
|
+
const entryRows = entries.map(([type, _]) => `${type}: ${recordingName}_${type}`).join(",");
|
|
15
|
+
return [
|
|
16
|
+
...entries.map(([type, file]) => `import ${recordingName}_${type} from "./${path.relative(targetDir, file)}" with { type: "json" };`),
|
|
17
|
+
`const ${recordingName} = { ${entryRows} };`,
|
|
18
|
+
];
|
|
34
19
|
}
|
|
35
20
|
//# sourceMappingURL=catalog.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"catalog.js","sourceRoot":"","sources":["../../src/codegen/catalog.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"catalog.js","sourceRoot":"","sources":["../../src/codegen/catalog.ts"],"names":[],"mappings":"AAAA,qCAAqC;AACrC,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAG7B,2CAA2C;AAE3C;;;;;;GAMG;AACH,MAAM,UAAU,2BAA2B,CAAC,SAA2B,EAAE,SAAiB;IACtF,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,yBAAyB,EAAE,CAAC,CAAC;IAEtE,MAAM,aAAa,GAAG,SAAS,CAAC,gBAAgB,EAAE,CAAC;IAEnD,MAAM,SAAS,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,IAAI,KAAK,aAAa,IAAI,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAE5F,OAAO;QACH,GAAG,OAAO,CAAC,GAAG,CACV,CAAC,CAAC,IAAI,EAAE,IAAI,CAAC,EAAE,EAAE,CACb,UAAU,aAAa,IAAI,IAAI,YAAY,IAAI,CAAC,QAAQ,CAAC,SAAS,EAAE,IAAI,CAAC,0BAA0B,CAC1G;QACD,SAAS,aAAa,QAAQ,SAAS,KAAK;KAC/C,CAAC;AACN,CAAC"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { OptionalKind, VariableStatementStructure } from "ts-morph";
|
|
2
1
|
import { DashboardRecording } from "../recordings/dashboards.js";
|
|
3
2
|
/**
|
|
4
3
|
* Generate constants for the dashboard recordings. This function will return non-exported constant per recording.
|
|
@@ -7,5 +6,5 @@ import { DashboardRecording } from "../recordings/dashboards.js";
|
|
|
7
6
|
* @param targetDir - absolute path to directory where index will be stored, this is needed so that paths can be
|
|
8
7
|
* made relative for require()
|
|
9
8
|
*/
|
|
10
|
-
export declare function generateConstantsForDashboards(recordings: DashboardRecording[], targetDir: string):
|
|
9
|
+
export declare function generateConstantsForDashboards(recordings: DashboardRecording[], targetDir: string): string[];
|
|
11
10
|
//# sourceMappingURL=dashboard.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dashboard.d.ts","sourceRoot":"","sources":["../../src/codegen/dashboard.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"dashboard.d.ts","sourceRoot":"","sources":["../../src/codegen/dashboard.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AAEjE;;;;;;GAMG;AACH,wBAAgB,8BAA8B,CAC1C,UAAU,EAAE,kBAAkB,EAAE,EAChC,SAAS,EAAE,MAAM,GAClB,MAAM,EAAE,CAkBV"}
|
package/esm/codegen/dashboard.js
CHANGED
|
@@ -1,25 +1,5 @@
|
|
|
1
|
-
// (C) 2007-
|
|
1
|
+
// (C) 2007-2025 GoodData Corporation
|
|
2
2
|
import * as path from "path";
|
|
3
|
-
import { VariableDeclarationKind } from "ts-morph";
|
|
4
|
-
function displayFormRecordingInit(rec, targetDir) {
|
|
5
|
-
const entries = Object.entries(rec.getEntryForRecordingIndex());
|
|
6
|
-
const entryRows = entries
|
|
7
|
-
.map(([type, file]) => `${type}: require('./${path.relative(targetDir, file)}')`)
|
|
8
|
-
.join(",");
|
|
9
|
-
return `{ ${entryRows} }`;
|
|
10
|
-
}
|
|
11
|
-
function generateRecordingConst(rec, targetDir) {
|
|
12
|
-
return {
|
|
13
|
-
declarationKind: VariableDeclarationKind.Const,
|
|
14
|
-
isExported: false,
|
|
15
|
-
declarations: [
|
|
16
|
-
{
|
|
17
|
-
name: rec.getRecordingName(),
|
|
18
|
-
initializer: displayFormRecordingInit(rec, targetDir),
|
|
19
|
-
},
|
|
20
|
-
],
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
3
|
/**
|
|
24
4
|
* Generate constants for the dashboard recordings. This function will return non-exported constant per recording.
|
|
25
5
|
*
|
|
@@ -28,6 +8,16 @@ function generateRecordingConst(rec, targetDir) {
|
|
|
28
8
|
* made relative for require()
|
|
29
9
|
*/
|
|
30
10
|
export function generateConstantsForDashboards(recordings, targetDir) {
|
|
31
|
-
return recordings
|
|
11
|
+
return recordings
|
|
12
|
+
.map((r) => {
|
|
13
|
+
const entries = Object.entries(r.getEntryForRecordingIndex());
|
|
14
|
+
const recordingName = r.getRecordingName();
|
|
15
|
+
const entryRows = entries.map(([type, _]) => `${type}: ${recordingName}_${type}`).join(",");
|
|
16
|
+
return [
|
|
17
|
+
...entries.map(([type, file]) => `import ${recordingName}_${type} from "./${path.relative(targetDir, file)}" with { type: "json" }`),
|
|
18
|
+
`const ${recordingName} = { ${entryRows} };`,
|
|
19
|
+
];
|
|
20
|
+
})
|
|
21
|
+
.reduce((acc, curr) => acc.concat(curr), []);
|
|
32
22
|
}
|
|
33
23
|
//# sourceMappingURL=dashboard.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dashboard.js","sourceRoot":"","sources":["../../src/codegen/dashboard.ts"],"names":[],"mappings":"AAAA,qCAAqC;AAErC,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"dashboard.js","sourceRoot":"","sources":["../../src/codegen/dashboard.ts"],"names":[],"mappings":"AAAA,qCAAqC;AAErC,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAG7B;;;;;;GAMG;AACH,MAAM,UAAU,8BAA8B,CAC1C,UAAgC,EAChC,SAAiB;IAEjB,OAAO,UAAU;SACZ,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE;QACP,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,yBAAyB,EAAE,CAAC,CAAC;QAE9D,MAAM,aAAa,GAAG,CAAC,CAAC,gBAAgB,EAAE,CAAC;QAE3C,MAAM,SAAS,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,IAAI,KAAK,aAAa,IAAI,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAE5F,OAAO;YACH,GAAG,OAAO,CAAC,GAAG,CACV,CAAC,CAAC,IAAI,EAAE,IAAI,CAAC,EAAE,EAAE,CACb,UAAU,aAAa,IAAI,IAAI,YAAY,IAAI,CAAC,QAAQ,CAAC,SAAS,EAAE,IAAI,CAAC,yBAAyB,CACzG;YACD,SAAS,aAAa,QAAQ,SAAS,KAAK;SAC/C,CAAC;IACN,CAAC,CAAC;SACD,MAAM,CAAC,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC;AACrD,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { OptionalKind, VariableStatementStructure } from "ts-morph";
|
|
2
1
|
import { DisplayFormRecording } from "../recordings/displayForms.js";
|
|
2
|
+
export declare function generateDataSampleConst(recordings: DisplayFormRecording[]): string;
|
|
3
3
|
/**
|
|
4
4
|
* Generate constants for the display form recordings and data sample. This function will return non-exported constant per recording
|
|
5
5
|
* and then also an exported 'DataSamples' constant that is a map from data sample ⇒ display form ⇒ recording.
|
|
@@ -8,5 +8,5 @@ import { DisplayFormRecording } from "../recordings/displayForms.js";
|
|
|
8
8
|
* @param targetDir - absolute path to directory where index will be stored, this is needed so that paths can be
|
|
9
9
|
* made relative for require()
|
|
10
10
|
*/
|
|
11
|
-
export declare function
|
|
11
|
+
export declare function generateImportsForDataSamples(recordings: DisplayFormRecording[], targetDir: string): string[];
|
|
12
12
|
//# sourceMappingURL=dataSample.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dataSample.d.ts","sourceRoot":"","sources":["../../src/codegen/dataSample.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"dataSample.d.ts","sourceRoot":"","sources":["../../src/codegen/dataSample.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AA0DrE,wBAAgB,uBAAuB,CAAC,UAAU,EAAE,oBAAoB,EAAE,GAAG,MAAM,CAclF;AAED;;;;;;;GAOG;AACH,wBAAgB,6BAA6B,CACzC,UAAU,EAAE,oBAAoB,EAAE,EAClC,SAAS,EAAE,MAAM,GAClB,MAAM,EAAE,CAQV"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
// (C) 2020-
|
|
2
|
-
import { VariableDeclarationKind } from "ts-morph";
|
|
1
|
+
// (C) 2020-2025 GoodData Corporation
|
|
3
2
|
import * as path from "path";
|
|
4
3
|
import { createUniqueVariableName } from "../base/variableNaming.js";
|
|
5
4
|
import groupBy from "lodash/groupBy.js";
|
|
@@ -43,7 +42,7 @@ function comparatorDataSample(a, b) {
|
|
|
43
42
|
}
|
|
44
43
|
return 0;
|
|
45
44
|
}
|
|
46
|
-
function generateDataSampleConst(recordings) {
|
|
45
|
+
export function generateDataSampleConst(recordings) {
|
|
47
46
|
const recsWithDataSample = recordings.map((rec) => [
|
|
48
47
|
createUniqueVariableName(rec.getDisplayFormTitle()),
|
|
49
48
|
rec,
|
|
@@ -52,16 +51,7 @@ function generateDataSampleConst(recordings) {
|
|
|
52
51
|
const dataSampleRows = entriesDataSample
|
|
53
52
|
.map(([title, rec]) => `${title}: ${generateRecordingForDataSample(rec)}`)
|
|
54
53
|
.join(",");
|
|
55
|
-
return {
|
|
56
|
-
declarationKind: VariableDeclarationKind.Const,
|
|
57
|
-
isExported: true,
|
|
58
|
-
declarations: [
|
|
59
|
-
{
|
|
60
|
-
name: DataSampleConstName,
|
|
61
|
-
initializer: `{ ${dataSampleRows} }`,
|
|
62
|
-
},
|
|
63
|
-
],
|
|
64
|
-
};
|
|
54
|
+
return `export const ${DataSampleConstName} = { ${dataSampleRows} }`;
|
|
65
55
|
}
|
|
66
56
|
/**
|
|
67
57
|
* Generate constants for the display form recordings and data sample. This function will return non-exported constant per recording
|
|
@@ -71,19 +61,7 @@ function generateDataSampleConst(recordings) {
|
|
|
71
61
|
* @param targetDir - absolute path to directory where index will be stored, this is needed so that paths can be
|
|
72
62
|
* made relative for require()
|
|
73
63
|
*/
|
|
74
|
-
export function
|
|
75
|
-
|
|
76
|
-
return {
|
|
77
|
-
declarationKind: VariableDeclarationKind.Const,
|
|
78
|
-
isExported: false,
|
|
79
|
-
declarations: [
|
|
80
|
-
{
|
|
81
|
-
name: rec.getRecordingName(),
|
|
82
|
-
initializer: `require('./${path.relative(targetDir, rec.elementFile)}')`,
|
|
83
|
-
},
|
|
84
|
-
],
|
|
85
|
-
};
|
|
86
|
-
});
|
|
87
|
-
return [...recConsts, generateDataSampleConst(recordings)];
|
|
64
|
+
export function generateImportsForDataSamples(recordings, targetDir) {
|
|
65
|
+
return recordings.map((rec) => `import ${rec.getRecordingName()} from "./${path.relative(targetDir, rec.elementFile)}" with { type: "json" };`);
|
|
88
66
|
}
|
|
89
67
|
//# sourceMappingURL=dataSample.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dataSample.js","sourceRoot":"","sources":["../../src/codegen/dataSample.ts"],"names":[],"mappings":"AAAA,qCAAqC;AACrC,OAAO,
|
|
1
|
+
{"version":3,"file":"dataSample.js","sourceRoot":"","sources":["../../src/codegen/dataSample.ts"],"names":[],"mappings":"AA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C;SACzE,IAAI,CAAC,GAAG,CAAC,CAAC;IAEf,OAAO,gBAAgB,mBAAmB,QAAQ,cAAc,IAAI,CAAC;AACzE,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,6BAA6B,CACzC,UAAkC,EAClC,SAAiB;IAEjB,OAAO,UAAU,CAAC,GAAG,CACjB,CAAC,GAAG,EAAE,EAAE,CACJ,UAAU,GAAG,CAAC,gBAAgB,EAAE,YAAY,IAAI,CAAC,QAAQ,CACrD,SAAS,EACT,GAAG,CAAC,WAAW,CAClB,0BAA0B,CAClC,CAAC;AACN,CAAC"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { OptionalKind, VariableStatementStructure } from "ts-morph";
|
|
2
1
|
import { DisplayFormRecording } from "../recordings/displayForms.js";
|
|
3
2
|
/**
|
|
4
3
|
* Generate constants for the valid element recordings. This function will return non-exported constant per recording.
|
|
@@ -7,5 +6,5 @@ import { DisplayFormRecording } from "../recordings/displayForms.js";
|
|
|
7
6
|
* @param targetDir - absolute path to directory where index will be stored, this is needed so that paths can be
|
|
8
7
|
* made relative for require()
|
|
9
8
|
*/
|
|
10
|
-
export declare function generateConstantsForDisplayForms(recordings: DisplayFormRecording[], targetDir: string):
|
|
9
|
+
export declare function generateConstantsForDisplayForms(recordings: DisplayFormRecording[], targetDir: string): string[];
|
|
11
10
|
//# sourceMappingURL=displayForm.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"displayForm.d.ts","sourceRoot":"","sources":["../../src/codegen/displayForm.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"displayForm.d.ts","sourceRoot":"","sources":["../../src/codegen/displayForm.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AAErE;;;;;;GAMG;AACH,wBAAgB,gCAAgC,CAC5C,UAAU,EAAE,oBAAoB,EAAE,EAClC,SAAS,EAAE,MAAM,GAClB,MAAM,EAAE,CAkBV"}
|
|
@@ -1,25 +1,5 @@
|
|
|
1
|
-
// (C) 2007-
|
|
1
|
+
// (C) 2007-2025 GoodData Corporation
|
|
2
2
|
import * as path from "path";
|
|
3
|
-
import { VariableDeclarationKind } from "ts-morph";
|
|
4
|
-
function displayFormRecordingInit(rec, targetDir) {
|
|
5
|
-
const entries = Object.entries(rec.getEntryForRecordingIndex());
|
|
6
|
-
const entryRows = entries
|
|
7
|
-
.map(([type, file]) => `${type}: require('./${path.relative(targetDir, file)}')`)
|
|
8
|
-
.join(",");
|
|
9
|
-
return `{ ${entryRows} }`;
|
|
10
|
-
}
|
|
11
|
-
function generateRecordingConst(rec, targetDir) {
|
|
12
|
-
return {
|
|
13
|
-
declarationKind: VariableDeclarationKind.Const,
|
|
14
|
-
isExported: false,
|
|
15
|
-
declarations: [
|
|
16
|
-
{
|
|
17
|
-
name: rec.getRecordingName(),
|
|
18
|
-
initializer: displayFormRecordingInit(rec, targetDir),
|
|
19
|
-
},
|
|
20
|
-
],
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
3
|
/**
|
|
24
4
|
* Generate constants for the valid element recordings. This function will return non-exported constant per recording.
|
|
25
5
|
*
|
|
@@ -28,6 +8,16 @@ function generateRecordingConst(rec, targetDir) {
|
|
|
28
8
|
* made relative for require()
|
|
29
9
|
*/
|
|
30
10
|
export function generateConstantsForDisplayForms(recordings, targetDir) {
|
|
31
|
-
return recordings
|
|
11
|
+
return recordings
|
|
12
|
+
.map((r) => {
|
|
13
|
+
const entries = Object.entries(r.getEntryForRecordingIndex());
|
|
14
|
+
const recordingName = r.getRecordingName();
|
|
15
|
+
const entryRows = entries.map(([type, _]) => `${type}: ${recordingName}_${type}`).join(",");
|
|
16
|
+
return [
|
|
17
|
+
...entries.map(([type, file]) => `import ${recordingName}_${type} from "./${path.relative(targetDir, file)}" with { type: "json" };`),
|
|
18
|
+
`const ${recordingName} = { ${entryRows} }`,
|
|
19
|
+
];
|
|
20
|
+
})
|
|
21
|
+
.reduce((acc, curr) => acc.concat(curr), []);
|
|
32
22
|
}
|
|
33
23
|
//# sourceMappingURL=displayForm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"displayForm.js","sourceRoot":"","sources":["../../src/codegen/displayForm.ts"],"names":[],"mappings":"AAAA,qCAAqC;AAErC,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"displayForm.js","sourceRoot":"","sources":["../../src/codegen/displayForm.ts"],"names":[],"mappings":"AAAA,qCAAqC;AAErC,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAG7B;;;;;;GAMG;AACH,MAAM,UAAU,gCAAgC,CAC5C,UAAkC,EAClC,SAAiB;IAEjB,OAAO,UAAU;SACZ,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE;QACP,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,yBAAyB,EAAE,CAAC,CAAC;QAE9D,MAAM,aAAa,GAAG,CAAC,CAAC,gBAAgB,EAAE,CAAC;QAE3C,MAAM,SAAS,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,IAAI,KAAK,aAAa,IAAI,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAE5F,OAAO;YACH,GAAG,OAAO,CAAC,GAAG,CACV,CAAC,CAAC,IAAI,EAAE,IAAI,CAAC,EAAE,EAAE,CACb,UAAU,aAAa,IAAI,IAAI,YAAY,IAAI,CAAC,QAAQ,CAAC,SAAS,EAAE,IAAI,CAAC,0BAA0B,CAC1G;YACD,SAAS,aAAa,QAAQ,SAAS,IAAI;SAC9C,CAAC;IACN,CAAC,CAAC;SACD,MAAM,CAAC,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC;AACrD,CAAC"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { OptionalKind, VariableStatementStructure } from "ts-morph";
|
|
2
1
|
import { ExecutionRecording } from "../recordings/execution.js";
|
|
3
2
|
/**
|
|
4
3
|
* Generate constants for the execution recordings. This function will return non-exported constant per recording
|
|
@@ -9,5 +8,5 @@ import { ExecutionRecording } from "../recordings/execution.js";
|
|
|
9
8
|
* @param targetDir - absolute path to directory where index will be stored, this is needed so that paths can be
|
|
10
9
|
* made relative for require()
|
|
11
10
|
*/
|
|
12
|
-
export declare function generateConstantsForExecutions(recordings: ExecutionRecording[], targetDir: string):
|
|
11
|
+
export declare function generateConstantsForExecutions(recordings: ExecutionRecording[], targetDir: string): string[];
|
|
13
12
|
//# sourceMappingURL=execution.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"execution.d.ts","sourceRoot":"","sources":["../../src/codegen/execution.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"execution.d.ts","sourceRoot":"","sources":["../../src/codegen/execution.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAkDhE;;;;;;;;GAQG;AACH,wBAAgB,8BAA8B,CAC1C,UAAU,EAAE,kBAAkB,EAAE,EAChC,SAAS,EAAE,MAAM,GAClB,MAAM,EAAE,CAgCV"}
|
package/esm/codegen/execution.js
CHANGED
|
@@ -1,29 +1,9 @@
|
|
|
1
|
-
// (C) 2007-
|
|
1
|
+
// (C) 2007-2025 GoodData Corporation
|
|
2
2
|
import * as path from "path";
|
|
3
|
-
import { VariableDeclarationKind } from "ts-morph";
|
|
4
3
|
import { createUniqueVariableName } from "../base/variableNaming.js";
|
|
5
4
|
import flatMap from "lodash/flatMap.js";
|
|
6
5
|
import groupBy from "lodash/groupBy.js";
|
|
7
6
|
const ScenariosConstName = "Scenarios";
|
|
8
|
-
function executionRecordingInit(rec, targetDir) {
|
|
9
|
-
const entries = Object.entries(rec.getEntryForRecordingIndex());
|
|
10
|
-
const entryRows = entries
|
|
11
|
-
.map(([type, file]) => `${type}: require('./${path.relative(targetDir, file)}')`)
|
|
12
|
-
.join(",");
|
|
13
|
-
return `{ ${entryRows} }`;
|
|
14
|
-
}
|
|
15
|
-
function generateRecordingConst(rec, targetDir) {
|
|
16
|
-
return {
|
|
17
|
-
declarationKind: VariableDeclarationKind.Const,
|
|
18
|
-
isExported: false,
|
|
19
|
-
declarations: [
|
|
20
|
-
{
|
|
21
|
-
name: rec.getRecordingName(),
|
|
22
|
-
initializer: executionRecordingInit(rec, targetDir),
|
|
23
|
-
},
|
|
24
|
-
],
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
7
|
function generateScenarioForVis(entries) {
|
|
28
8
|
const entryRows = entries
|
|
29
9
|
.map(([_, entryName, entryRecording, scenarioIndex]) => {
|
|
@@ -53,16 +33,7 @@ function generateScenariosConst(recordings) {
|
|
|
53
33
|
const entryRows = entriesByVis
|
|
54
34
|
.map(([vis, visScenarios]) => `${vis}: ${generateScenarioForVis(visScenarios)}`)
|
|
55
35
|
.join(",");
|
|
56
|
-
return {
|
|
57
|
-
declarationKind: VariableDeclarationKind.Const,
|
|
58
|
-
isExported: true,
|
|
59
|
-
declarations: [
|
|
60
|
-
{
|
|
61
|
-
name: ScenariosConstName,
|
|
62
|
-
initializer: `{ ${entryRows} }`,
|
|
63
|
-
},
|
|
64
|
-
],
|
|
65
|
-
};
|
|
36
|
+
return `export const ${ScenariosConstName} = { ${entryRows} }`;
|
|
66
37
|
}
|
|
67
38
|
/**
|
|
68
39
|
* Generate constants for the execution recordings. This function will return non-exported constant per recording
|
|
@@ -84,6 +55,19 @@ export function generateConstantsForExecutions(recordings, targetDir) {
|
|
|
84
55
|
}
|
|
85
56
|
return acc;
|
|
86
57
|
}, []);
|
|
87
|
-
return [
|
|
58
|
+
return [
|
|
59
|
+
...unique
|
|
60
|
+
.map((r) => {
|
|
61
|
+
const entries = Object.entries(r.getEntryForRecordingIndex());
|
|
62
|
+
const recordingName = r.getRecordingName();
|
|
63
|
+
const entryRows = entries.map(([type, _]) => `${type}: ${recordingName}_${type}`).join(",");
|
|
64
|
+
return [
|
|
65
|
+
...entries.map(([type, file]) => `import ${recordingName}_${type} from "./${path.relative(targetDir, file)}" with { type: "json" };`),
|
|
66
|
+
`const ${recordingName} = { ${entryRows} };`,
|
|
67
|
+
];
|
|
68
|
+
})
|
|
69
|
+
.reduce((acc, curr) => acc.concat(curr), []),
|
|
70
|
+
generateScenariosConst(unique),
|
|
71
|
+
];
|
|
88
72
|
}
|
|
89
73
|
//# sourceMappingURL=execution.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"execution.js","sourceRoot":"","sources":["../../src/codegen/execution.ts"],"names":[],"mappings":"AAAA,qCAAqC;AAErC,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,
|
|
1
|
+
{"version":3,"file":"execution.js","sourceRoot":"","sources":["../../src/codegen/execution.ts"],"names":[],"mappings":"AAAA,qCAAqC;AAErC,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;AACrE,OAAO,OAAO,MAAM,mBAAmB,CAAC;AACxC,OAAO,OAAO,MAAM,mBAAmB,CAAC;AAGxC,MAAM,kBAAkB,GAAG,WAAW,CAAC;AAQvC,SAAS,sBAAsB,CAAC,OAA+B;IAC3D,MAAM,SAAS,GAAG,OAAO;SACpB,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,cAAc,EAAE,aAAa,CAAC,EAAE,EAAE;QACnD,MAAM,IAAI,GAAG,wBAAwB,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC;QAErD,OAAO;YACH,KAAK,EAAE,GAAG,IAAI,sBAAsB,aAAa,gBAAgB,cAAc,CAAC,gBAAgB,EAAE,GAAG;YACrG,IAAI;SACP,CAAC;IACN,CAAC,CA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N,CAAC,CAAC;aACD,MAAM,CAAC,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC;QAChD,sBAAsB,CAAC,MAAM,CAAC;KACjC,CAAC;AACN,CAAC"}
|
package/esm/codegen/index.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { IRecording } from "../recordings/common.js";
|
|
2
2
|
/**
|
|
3
|
-
* Given various types of recordings, this function will generate and write `dataSample.ts and index.ts` file in the root of
|
|
3
|
+
* Given various types of recordings, this function will generate and write `dataSample.ts` and `index.ts` file in the root of
|
|
4
4
|
* the recordings directory.
|
|
5
5
|
*
|
|
6
|
-
* The index will use
|
|
6
|
+
* The index will use import to reference the JSON files. It is assumed that all paths on input to this function
|
|
7
7
|
* are absolute, the code will relativize paths as needed.
|
|
8
8
|
*
|
|
9
9
|
* @param recordings - recordings to include in the index
|
|
10
10
|
* @param targetDir - absolute path to directory where the index should be created
|
|
11
11
|
*/
|
|
12
|
-
export declare function generateAllFiles(recordings: IRecording[], targetDir: string): void
|
|
12
|
+
export declare function generateAllFiles(recordings: IRecording[], targetDir: string): Promise<void>;
|
|
13
13
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/codegen/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/codegen/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAiB,MAAM,yBAAyB,CAAC;AA6LpE;;;;;;;;;GASG;AAEH,wBAAsB,gBAAgB,CAAC,UAAU,EAAE,UAAU,EAAE,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAKjG"}
|
package/esm/codegen/index.js
CHANGED
|
@@ -1,35 +1,17 @@
|
|
|
1
|
-
// (C) 2007-
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import pkg from "prettier";
|
|
5
|
-
const { format } = pkg;
|
|
6
|
-
import { Project, VariableDeclarationKind, } from "ts-morph";
|
|
1
|
+
// (C) 2007-2025 GoodData Corporation
|
|
2
|
+
import { writeFileSync } from "fs";
|
|
3
|
+
import { join } from "path";
|
|
7
4
|
import { RecordingType } from "../recordings/common.js";
|
|
8
5
|
import { generateConstantsForDisplayForms } from "./displayForm.js";
|
|
9
|
-
import {
|
|
6
|
+
import { generateDataSampleConst, generateImportsForDataSamples } from "./dataSample.js";
|
|
10
7
|
import { generateConstantsForExecutions } from "./execution.js";
|
|
11
8
|
import { generateConstantsForInsights } from "./insight.js";
|
|
12
9
|
import { generateConstantsForCatalog } from "./catalog.js";
|
|
13
10
|
import { generateConstantsForVisClasses } from "./visClasses.js";
|
|
14
11
|
import groupBy from "lodash/groupBy.js";
|
|
15
12
|
import { generateConstantsForDashboards } from "./dashboard.js";
|
|
16
|
-
const FILE_DIRECTIVES = [
|
|
17
|
-
"/* eslint-disable @typescript-eslint/no-var-requires */",
|
|
18
|
-
"/* eslint-disable header/header */",
|
|
19
|
-
];
|
|
20
13
|
const FILE_HEADER = `/* THIS FILE WAS AUTO-GENERATED USING MOCK HANDLING TOOL; YOU SHOULD NOT EDIT THIS FILE; GENERATE TIME: ${new Date().toISOString()}; */`;
|
|
21
14
|
const MainIndexConstName = "Recordings";
|
|
22
|
-
function initialize(targetDir, fileName) {
|
|
23
|
-
const outputFile = path.join(targetDir, fileName);
|
|
24
|
-
const project = new Project({});
|
|
25
|
-
const sourceFile = project.createSourceFile(outputFile, {
|
|
26
|
-
leadingTrivia: [...FILE_DIRECTIVES, FILE_HEADER],
|
|
27
|
-
}, { overwrite: true });
|
|
28
|
-
return {
|
|
29
|
-
project,
|
|
30
|
-
sourceFile,
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
15
|
function recNameList(recs) {
|
|
34
16
|
return recs.map((r) => r.getRecordingName()).join(",");
|
|
35
17
|
}
|
|
@@ -48,33 +30,104 @@ function generateIndexConst(input) {
|
|
|
48
30
|
dashboards: { ${recNameList(input.dashboards())} }
|
|
49
31
|
}
|
|
50
32
|
`;
|
|
51
|
-
return {
|
|
52
|
-
declarationKind: VariableDeclarationKind.Const,
|
|
53
|
-
isExported: true,
|
|
54
|
-
declarations: [
|
|
55
|
-
{
|
|
56
|
-
name: MainIndexConstName,
|
|
57
|
-
initializer: `{ ${executionsInit}, ${metadataInit} }`,
|
|
58
|
-
},
|
|
59
|
-
],
|
|
60
|
-
};
|
|
33
|
+
return `export const ${MainIndexConstName}: RecordingIndex = { ${executionsInit}, ${metadataInit} } as unknown as RecordingIndex;`;
|
|
61
34
|
}
|
|
62
|
-
function transformToTypescript(input, targetDir, fileName) {
|
|
63
|
-
const
|
|
64
|
-
const sourceFile = output.sourceFile;
|
|
35
|
+
async function transformToTypescript(input, targetDir, fileName) {
|
|
36
|
+
const fileContents = [`// (C) ${new Date().getFullYear()} GoodData Corporation`, "", FILE_HEADER, ""];
|
|
65
37
|
if (fileName === "dataSample.ts") {
|
|
66
|
-
|
|
38
|
+
const displayForms = input.displayForms();
|
|
39
|
+
generateImportsForDataSamples(displayForms, targetDir).forEach((l) => fileContents.push(l));
|
|
40
|
+
fileContents.push("");
|
|
41
|
+
fileContents.push(generateDataSampleConst(displayForms));
|
|
67
42
|
}
|
|
68
43
|
else {
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
44
|
+
generateConstantsForExecutions(input.executions(), targetDir).forEach((l) => fileContents.push(l));
|
|
45
|
+
fileContents.push("");
|
|
46
|
+
generateConstantsForDisplayForms(input.displayForms(), targetDir).forEach((l) => fileContents.push(l));
|
|
47
|
+
fileContents.push("");
|
|
48
|
+
generateConstantsForInsights(input.insights(), targetDir).forEach((l) => fileContents.push(l));
|
|
49
|
+
fileContents.push("");
|
|
50
|
+
const catalog = input.catalog();
|
|
51
|
+
if (catalog) {
|
|
52
|
+
generateConstantsForCatalog(catalog, targetDir).forEach((l) => fileContents.push(l));
|
|
53
|
+
fileContents.push("");
|
|
54
|
+
}
|
|
55
|
+
const visClasses = input.visClasses();
|
|
56
|
+
if (visClasses) {
|
|
57
|
+
generateConstantsForVisClasses(visClasses, targetDir).forEach((l) => fileContents.push(l));
|
|
58
|
+
fileContents.push("");
|
|
59
|
+
}
|
|
60
|
+
generateConstantsForDashboards(input.dashboards(), targetDir).forEach((l) => fileContents.push(l));
|
|
61
|
+
fileContents.push("");
|
|
62
|
+
fileContents.push(`import {
|
|
63
|
+
IExecutionDefinition,
|
|
64
|
+
CatalogItem,
|
|
65
|
+
ICatalogGroup,
|
|
66
|
+
IVisualizationClass,
|
|
67
|
+
IAttributeDisplayFormMetadataObject,
|
|
68
|
+
IAttributeElement,
|
|
69
|
+
IInsight,
|
|
70
|
+
IDashboard,
|
|
71
|
+
IDashboardPlugin,
|
|
72
|
+
IDataSetMetadataObject,
|
|
73
|
+
} from "@gooddata/sdk-model";
|
|
74
|
+
|
|
75
|
+
type ExecutionRecording = {
|
|
76
|
+
scenarios?: any[];
|
|
77
|
+
definition: IExecutionDefinition;
|
|
78
|
+
executionResult: any;
|
|
79
|
+
[dataViews: string]: any;
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
type CatalogRecording = {
|
|
83
|
+
items: CatalogItem[];
|
|
84
|
+
groups: ICatalogGroup[];
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
type DisplayFormRecording = {
|
|
88
|
+
obj: IAttributeDisplayFormMetadataObject;
|
|
89
|
+
elements: IAttributeElement[];
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
type InsightRecording = {
|
|
93
|
+
obj: IInsight;
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
type VisClassesRecording = {
|
|
97
|
+
items: IVisualizationClass[];
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
interface IDashboardReferences {
|
|
101
|
+
insights: IInsight[];
|
|
102
|
+
plugins: IDashboardPlugin[];
|
|
103
|
+
dataSets?: IDataSetMetadataObject[];
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
interface IDashboardWithReferences {
|
|
107
|
+
dashboard: IDashboard;
|
|
108
|
+
references: IDashboardReferences;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
type DashboardRecording = {
|
|
112
|
+
obj: IDashboardWithReferences;
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
type RecordingIndex = {
|
|
116
|
+
executions?: {
|
|
117
|
+
[fp: string]: ExecutionRecording;
|
|
118
|
+
};
|
|
119
|
+
metadata?: {
|
|
120
|
+
catalog?: CatalogRecording;
|
|
121
|
+
displayForms?: Record<string, DisplayFormRecording>;
|
|
122
|
+
insights?: Record<string, InsightRecording>;
|
|
123
|
+
visClasses?: VisClassesRecording;
|
|
124
|
+
dashboards?: Record<string, DashboardRecording>;
|
|
125
|
+
};
|
|
126
|
+
};`);
|
|
127
|
+
fileContents.push("");
|
|
128
|
+
fileContents.push(generateIndexConst(input));
|
|
76
129
|
}
|
|
77
|
-
|
|
130
|
+
writeFileSync(join(targetDir, fileName), fileContents.join("\n"), { encoding: "utf-8" });
|
|
78
131
|
}
|
|
79
132
|
function createGeneratorInput(recordings) {
|
|
80
133
|
const categorized = groupBy(recordings, (rec) => rec.getRecordingType());
|
|
@@ -99,37 +152,19 @@ function createGeneratorInput(recordings) {
|
|
|
99
152
|
},
|
|
100
153
|
};
|
|
101
154
|
}
|
|
102
|
-
function generateRecordingIndex(recordings, targetDir) {
|
|
103
|
-
const input = createGeneratorInput(recordings);
|
|
104
|
-
const output = transformToTypescript(input, targetDir, "index.ts");
|
|
105
|
-
const sourceFile = output.sourceFile;
|
|
106
|
-
const generatedTypescript = sourceFile.getFullText();
|
|
107
|
-
const formattedTypescript = format(generatedTypescript, { parser: "typescript", printWidth: 120 });
|
|
108
|
-
fs.writeFileSync(sourceFile.getFilePath(), formattedTypescript, { encoding: "utf-8" });
|
|
109
|
-
}
|
|
110
|
-
function generateDataSample(recordings, targetDir) {
|
|
111
|
-
const input = createGeneratorInput(recordings);
|
|
112
|
-
const output = transformToTypescript(input, targetDir, "dataSample.ts");
|
|
113
|
-
const sourceFile = output.sourceFile;
|
|
114
|
-
const generatedTypescriptForDataSample = sourceFile.getFullText();
|
|
115
|
-
const formattedTypescriptForDataSample = format(generatedTypescriptForDataSample, {
|
|
116
|
-
parser: "typescript",
|
|
117
|
-
printWidth: 120,
|
|
118
|
-
});
|
|
119
|
-
fs.writeFileSync(sourceFile.getFilePath(), formattedTypescriptForDataSample, { encoding: "utf-8" });
|
|
120
|
-
}
|
|
121
155
|
/**
|
|
122
|
-
* Given various types of recordings, this function will generate and write `dataSample.ts and index.ts` file in the root of
|
|
156
|
+
* Given various types of recordings, this function will generate and write `dataSample.ts` and `index.ts` file in the root of
|
|
123
157
|
* the recordings directory.
|
|
124
158
|
*
|
|
125
|
-
* The index will use
|
|
159
|
+
* The index will use import to reference the JSON files. It is assumed that all paths on input to this function
|
|
126
160
|
* are absolute, the code will relativize paths as needed.
|
|
127
161
|
*
|
|
128
162
|
* @param recordings - recordings to include in the index
|
|
129
163
|
* @param targetDir - absolute path to directory where the index should be created
|
|
130
164
|
*/
|
|
131
|
-
export function generateAllFiles(recordings, targetDir) {
|
|
132
|
-
|
|
133
|
-
|
|
165
|
+
export async function generateAllFiles(recordings, targetDir) {
|
|
166
|
+
const input = createGeneratorInput(recordings);
|
|
167
|
+
await transformToTypescript(input, targetDir, "index.ts");
|
|
168
|
+
await transformToTypescript(input, targetDir, "dataSample.ts");
|
|
134
169
|
}
|
|
135
170
|
//# sourceMappingURL=index.js.map
|
package/esm/codegen/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/codegen/index.ts"],"names":[],"mappings":"AAAA,qCAAqC;AAErC,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceR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,EAAE,GAAG,EAAE;YACb,OAAQ,WAAW,CAAC,aAAa,CAAC,UAAU,CAAqC,IAAI,EAAE,CAAC;QAC5F,CAAC;KACJ,CAAC;AACN,CAAC;AAED;;;;;;;;;GASG;AAEH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAC,UAAwB,EAAE,SAAiB;IAC9E,MAAM,KAAK,GAAG,oBAAoB,CAAC,UAAU,CAAC,CAAC;IAE/C,MAAM,qBAAqB,CAAC,KAAK,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC;IAC1D,MAAM,qBAAqB,CAAC,KAAK,EAAE,SAAS,EAAE,eAAe,CAAC,CAAC;AACnE,CAAC"}
|
package/esm/codegen/insight.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { OptionalKind, VariableStatementStructure } from "ts-morph";
|
|
2
1
|
import { InsightRecording } from "../recordings/insights.js";
|
|
3
2
|
/**
|
|
4
3
|
* Generate constants for insight recordings. This function will return non-exported constant per recording.
|
|
@@ -7,5 +6,5 @@ import { InsightRecording } from "../recordings/insights.js";
|
|
|
7
6
|
* @param targetDir - absolute path to directory where index will be stored, this is needed so that paths can be
|
|
8
7
|
* made relative for require()
|
|
9
8
|
*/
|
|
10
|
-
export declare function generateConstantsForInsights(recordings: InsightRecording[], targetDir: string):
|
|
9
|
+
export declare function generateConstantsForInsights(recordings: InsightRecording[], targetDir: string): string[];
|
|
11
10
|
//# sourceMappingURL=insight.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"insight.d.ts","sourceRoot":"","sources":["../../src/codegen/insight.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"insight.d.ts","sourceRoot":"","sources":["../../src/codegen/insight.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAuC7D;;;;;;GAMG;AACH,wBAAgB,4BAA4B,CAAC,UAAU,EAAE,gBAAgB,EAAE,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,EAAE,CAqBxG"}
|
package/esm/codegen/insight.js
CHANGED
|
@@ -1,28 +1,8 @@
|
|
|
1
|
-
// (C) 2007-
|
|
1
|
+
// (C) 2007-2025 GoodData Corporation
|
|
2
2
|
import * as path from "path";
|
|
3
|
-
import { VariableDeclarationKind } from "ts-morph";
|
|
4
3
|
import { createUniqueVariableName } from "../base/variableNaming.js";
|
|
5
4
|
import groupBy from "lodash/groupBy.js";
|
|
6
5
|
const InsightIndexConstName = "Insights";
|
|
7
|
-
function insightRecordingInit(rec, targetDir) {
|
|
8
|
-
const entries = Object.entries(rec.getEntryForRecordingIndex());
|
|
9
|
-
const entryPairs = entries
|
|
10
|
-
.map(([type, file]) => `${type}: require('./${path.relative(targetDir, file)}')`)
|
|
11
|
-
.join(",");
|
|
12
|
-
return `{ ${entryPairs} }`;
|
|
13
|
-
}
|
|
14
|
-
function generateRecordingConst(rec, targetDir) {
|
|
15
|
-
return {
|
|
16
|
-
declarationKind: VariableDeclarationKind.Const,
|
|
17
|
-
isExported: false,
|
|
18
|
-
declarations: [
|
|
19
|
-
{
|
|
20
|
-
name: rec.getRecordingName(),
|
|
21
|
-
initializer: insightRecordingInit(rec, targetDir),
|
|
22
|
-
},
|
|
23
|
-
],
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
6
|
function generateScenarioForVis(entries) {
|
|
27
7
|
const scope = {};
|
|
28
8
|
const entryRows = entries
|
|
@@ -42,16 +22,7 @@ function generateInsightsConst(recordings) {
|
|
|
42
22
|
const entryRows = entriesByVis
|
|
43
23
|
.map(([vis, visScenarios]) => `${vis}: ${generateScenarioForVis(visScenarios)}`)
|
|
44
24
|
.join(",");
|
|
45
|
-
return {
|
|
46
|
-
declarationKind: VariableDeclarationKind.Const,
|
|
47
|
-
isExported: true,
|
|
48
|
-
declarations: [
|
|
49
|
-
{
|
|
50
|
-
name: InsightIndexConstName,
|
|
51
|
-
initializer: `{ ${entryRows} }`,
|
|
52
|
-
},
|
|
53
|
-
],
|
|
54
|
-
};
|
|
25
|
+
return `export const ${InsightIndexConstName} = { ${entryRows} };`;
|
|
55
26
|
}
|
|
56
27
|
/**
|
|
57
28
|
* Generate constants for insight recordings. This function will return non-exported constant per recording.
|
|
@@ -62,7 +33,17 @@ function generateInsightsConst(recordings) {
|
|
|
62
33
|
*/
|
|
63
34
|
export function generateConstantsForInsights(recordings, targetDir) {
|
|
64
35
|
return [
|
|
65
|
-
...recordings
|
|
36
|
+
...recordings
|
|
37
|
+
.map((r) => {
|
|
38
|
+
const entries = Object.entries(r.getEntryForRecordingIndex());
|
|
39
|
+
const recordingName = r.getRecordingName();
|
|
40
|
+
const entryPairs = entries.map(([type, _]) => `${type}: ${recordingName}_${type}`).join(",");
|
|
41
|
+
return [
|
|
42
|
+
...entries.map(([type, file]) => `import ${recordingName}_${type} from "./${path.relative(targetDir, file)}" with { type: "json" };`),
|
|
43
|
+
`const ${recordingName} = { ${entryPairs} };`,
|
|
44
|
+
];
|
|
45
|
+
})
|
|
46
|
+
.reduce((acc, curr) => acc.concat(curr), []),
|
|
66
47
|
generateInsightsConst(recordings),
|
|
67
48
|
];
|
|
68
49
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"insight.js","sourceRoot":"","sources":["../../src/codegen/insight.ts"],"names":[],"mappings":"AAAA,qCAAqC;AAErC,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,
|
|
1
|
+
{"version":3,"file":"insight.js","sourceRoot":"","sources":["../../src/codegen/insight.ts"],"names":[],"mappings":"AAAA,qCAAqC;AAErC,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,wBAAwB,EAAiB,MAAM,2BAA2B,CAAC;AAEpF,OAAO,OAAO,MAAM,mBAAmB,CAAC;AAExC,MAAM,qBAAqB,GAAG,UAAU,CAAC;AAQzC,SAAS,sBAAsB,CAAC,OAA+B;IAC3D,MAAM,KAAK,GAAkB,EAAE,CAA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E;YACP,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,yBAAyB,EAAE,CAAC,CAAC;YAE9D,MAAM,aAAa,GAAG,CAAC,CAAC,gBAAgB,EAAE,CAAC;YAE3C,MAAM,UAAU,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,IAAI,KAAK,aAAa,IAAI,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;YAE7F,OAAO;gBACH,GAAG,OAAO,CAAC,GAAG,CACV,CAAC,CAAC,IAAI,EAAE,IAAI,CAAC,EAAE,EAAE,CACb,UAAU,aAAa,IAAI,IAAI,YAAY,IAAI,CAAC,QAAQ,CAAC,SAAS,EAAE,IAAI,CAAC,0BAA0B,CAC1G;gBACD,SAAS,aAAa,QAAQ,UAAU,KAAK;aAChD,CAAC;QACN,CAAC,CAAC;aACD,MAAM,CAAC,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC;QAChD,qBAAqB,CAAC,UAAU,CAAC;KACpC,CAAC;AACN,CAAC"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { OptionalKind, VariableStatementStructure } from "ts-morph";
|
|
2
1
|
import { VisClassesRecording } from "../recordings/visClasses.js";
|
|
3
2
|
/**
|
|
4
3
|
* Generate constants for visClasses recording. This function will return non-exported constant per recording.
|
|
@@ -7,5 +6,5 @@ import { VisClassesRecording } from "../recordings/visClasses.js";
|
|
|
7
6
|
* @param targetDir - absolute path to directory where index will be stored, this is needed so that paths can be
|
|
8
7
|
* made relative for require()
|
|
9
8
|
*/
|
|
10
|
-
export declare function generateConstantsForVisClasses(recording: VisClassesRecording
|
|
9
|
+
export declare function generateConstantsForVisClasses(recording: VisClassesRecording, targetDir: string): string[];
|
|
11
10
|
//# sourceMappingURL=visClasses.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"visClasses.d.ts","sourceRoot":"","sources":["../../src/codegen/visClasses.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"visClasses.d.ts","sourceRoot":"","sources":["../../src/codegen/visClasses.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAElE;;;;;;GAMG;AACH,wBAAgB,8BAA8B,CAAC,SAAS,EAAE,mBAAmB,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,EAAE,CAc1G"}
|
|
@@ -1,26 +1,5 @@
|
|
|
1
|
-
// (C) 2020 GoodData Corporation
|
|
1
|
+
// (C) 2020-2025 GoodData Corporation
|
|
2
2
|
import * as path from "path";
|
|
3
|
-
import { VariableDeclarationKind } from "ts-morph";
|
|
4
|
-
import compact from "lodash/compact.js";
|
|
5
|
-
function visClassesRecordingInit(rec, targetDir) {
|
|
6
|
-
const entries = Object.entries(rec.getEntryForRecordingIndex());
|
|
7
|
-
const entryRows = entries
|
|
8
|
-
.map(([type, file]) => `${type}: require('./${path.relative(targetDir, file)}')`)
|
|
9
|
-
.join(",");
|
|
10
|
-
return `{ ${entryRows} }`;
|
|
11
|
-
}
|
|
12
|
-
function generateRecordingConst(rec, targetDir) {
|
|
13
|
-
return {
|
|
14
|
-
declarationKind: VariableDeclarationKind.Const,
|
|
15
|
-
isExported: false,
|
|
16
|
-
declarations: [
|
|
17
|
-
{
|
|
18
|
-
name: rec.getRecordingName(),
|
|
19
|
-
initializer: visClassesRecordingInit(rec, targetDir),
|
|
20
|
-
},
|
|
21
|
-
],
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
3
|
/**
|
|
25
4
|
* Generate constants for visClasses recording. This function will return non-exported constant per recording.
|
|
26
5
|
*
|
|
@@ -29,6 +8,12 @@ function generateRecordingConst(rec, targetDir) {
|
|
|
29
8
|
* made relative for require()
|
|
30
9
|
*/
|
|
31
10
|
export function generateConstantsForVisClasses(recording, targetDir) {
|
|
32
|
-
|
|
11
|
+
const entries = Object.entries(recording.getEntryForRecordingIndex());
|
|
12
|
+
const recordingName = recording.getRecordingName();
|
|
13
|
+
const entryRows = entries.map(([type, _]) => `${type}: ${recordingName}_${type}`).join(",");
|
|
14
|
+
return [
|
|
15
|
+
...entries.map(([type, file]) => `import ${recordingName}_${type} from "./${path.relative(targetDir, file)}" with { type: "json" };`),
|
|
16
|
+
`const ${recordingName} = { ${entryRows} };`,
|
|
17
|
+
];
|
|
33
18
|
}
|
|
34
19
|
//# sourceMappingURL=visClasses.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"visClasses.js","sourceRoot":"","sources":["../../src/codegen/visClasses.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"visClasses.js","sourceRoot":"","sources":["../../src/codegen/visClasses.ts"],"names":[],"mappings":"AAAA,qCAAqC;AACrC,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAG7B;;;;;;GAMG;AACH,MAAM,UAAU,8BAA8B,CAAC,SAA8B,EAAE,SAAiB;IAC5F,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,yBAAyB,EAAE,CAAC,CAAC;IAEtE,MAAM,aAAa,GAAG,SAAS,CAAC,gBAAgB,EAAE,CAAC;IAEnD,MAAM,SAAS,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,IAAI,KAAK,aAAa,IAAI,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAE5F,OAAO;QACH,GAAG,OAAO,CAAC,GAAG,CACV,CAAC,CAAC,IAAI,EAAE,IAAI,CAAC,EAAE,EAAE,CACb,UAAU,aAAa,IAAI,IAAI,YAAY,IAAI,CAAC,QAAQ,CAAC,SAAS,EAAE,IAAI,CAAC,0BAA0B,CAC1G;QACD,SAAS,aAAa,QAAQ,SAAS,KAAK;KAC/C,CAAC;AACN,CAAC"}
|
package/esm/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
// (C) 2007-
|
|
2
|
+
// (C) 2007-2025 GoodData Corporation
|
|
3
3
|
import { program } from "commander";
|
|
4
4
|
import ora from "ora";
|
|
5
5
|
import chalk from "chalk";
|
|
@@ -38,7 +38,7 @@ async function promptForMissingConfig(config) {
|
|
|
38
38
|
try {
|
|
39
39
|
tigerToken = tigerToken || (await promptTigerToken());
|
|
40
40
|
logInSpinner.start("Logging in...");
|
|
41
|
-
|
|
41
|
+
getOrInitBackend(tigerToken, hostname || DEFAULT_HOSTNAME);
|
|
42
42
|
logInSpinner.succeed();
|
|
43
43
|
clearLine();
|
|
44
44
|
}
|
|
@@ -142,7 +142,7 @@ async function run() {
|
|
|
142
142
|
recordingsToIndex = recordingsToIndex.concat(newRecordings.filter((e) => e.isComplete()));
|
|
143
143
|
}
|
|
144
144
|
logInfo(`Building recording index for all executions with captured data in ${absoluteRecordingDir}`);
|
|
145
|
-
generateAllFiles(recordingsToIndex, absoluteRecordingDir);
|
|
145
|
+
await generateAllFiles(recordingsToIndex, absoluteRecordingDir);
|
|
146
146
|
logSuccess("Done");
|
|
147
147
|
process.exit(0);
|
|
148
148
|
}
|
package/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA,qCAAqC;AAErC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,GAAG,MAAM,KAAK,CAAC;AACtB,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,OAAO,MAAM,SAAS,CAAC;AACnC,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,IAAI,MAAM,OAAO,CAAC;AACzB,OAAO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GAAG,MAAM,sBAAsB,CAAC,aAAa,CAAC,CAAC;QAE/D;;;WAGG;QACH,MAAM,OAAO,GAAG,gBAAgB,CAAC,UAAU,CAAC,UAAW,EAAE,OAAO,CAAC,QAAQ,IAAI,gBAAgB,CAAC,CAAC;QAE/F,MAAM,aAAa,GAAG,MAAM,iBAAiB,CAAC,oBAAoB,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC;QAEzF,iBAAiB,GAAG,iBAAiB,CAAC,MAAM,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC;IAC9F,CAAC;IAED,OAAO,CAAC,qEAAqE,oBAAoB,EAAE,CAAC,CAAC;IAErG,MAAM,gBAAgB,CAAC,iBAAiB,EAAE,oBAAoB,CAAC,CAAC;IAEhE,UAAU,CAAC,MAAM,CAAC,CAAC;IAEnB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACpB,CAAC;AAED,GAAG,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;IAChB,IAAI,mBAAmB,CAAC,GAAG,CAAC,EAAE,CAAC;QAC3B,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IACzB,CAAC;SAAM,CAAC;QACJ,QAAQ,CAAC,qCAAqC,GAAG,EAAE,CAAC,CAAC;QACrD,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAEnB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACpB,CAAC;AACL,CAAC,CAAC,CAAC;AAYH,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC"}
|
package/esm/recordings/common.js
CHANGED
|
@@ -18,10 +18,10 @@ export function toJsonString(obj, options = {}) {
|
|
|
18
18
|
const { pickKeys, replaceString } = options;
|
|
19
19
|
let result;
|
|
20
20
|
if (pickKeys) {
|
|
21
|
-
result = stringify(pick(obj, pickKeys));
|
|
21
|
+
result = stringify(pick(obj, pickKeys)) || "undefined";
|
|
22
22
|
}
|
|
23
23
|
else {
|
|
24
|
-
result = stringify(obj);
|
|
24
|
+
result = stringify(obj) || "undefined";
|
|
25
25
|
}
|
|
26
26
|
if (replaceString) {
|
|
27
27
|
replaceString.forEach(([searchString, replacement]) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../src/recordings/common.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,IAAI,MAAM,gBAAgB,CAAC;AAClC,OAAO,OAAO,MAAM,mBAAmB,CAAC;AACxC,OAAO,SAAS,MAAM,uBAAuB,CAAC;AAU9C,MAAM,CAAN,IAAY,aAOX;AAPD,WAAY,aAAa;IACrB,wCAAuB,CAAA;IACvB,8CAA6B,CAAA;IAC7B,sCAAqB,CAAA;IACrB,0CAAyB,CAAA;IACzB,oCAAmB,CAAA;IACnB,0CAAyB,CAAA;AAC7B,CAAC,EAPW,aAAa,KAAb,aAAa,QAOxB;AA+CD,EAAE;AACF,EAAE;AACF,EAAE;AAEF,MAAM,UAAU,YAAY,CAAC,GAAW,EAAE,UAA4B,EAAE;IACpE,MAAM,EAAE,QAAQ,EAAE,aAAa,EAAE,GAAG,OAAO,CAAC;IAC5C,IAAI,MAAc,CAAC;IAEnB,IAAI,QAAQ,EAAE,CAAC;QACX,MAAM,GAAG,SAAS,CAAC,IAAI,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../src/recordings/common.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,IAAI,MAAM,gBAAgB,CAAC;AAClC,OAAO,OAAO,MAAM,mBAAmB,CAAC;AACxC,OAAO,SAAS,MAAM,uBAAuB,CAAC;AAU9C,MAAM,CAAN,IAAY,aAO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ACpE,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,GAAe;IAC9C,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,IAAK,GAAkB,CAAC,SAAS,KAAK,SAAS,CAAC;AACxE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gooddata/mock-handling",
|
|
3
|
-
"version": "10.35.0
|
|
3
|
+
"version": "10.35.0",
|
|
4
4
|
"author": "GoodData",
|
|
5
5
|
"description": "GoodData SDK Mock data capture and management tool",
|
|
6
6
|
"repository": {
|
|
@@ -25,41 +25,40 @@
|
|
|
25
25
|
"chalk": "^4.1.1",
|
|
26
26
|
"commander": "^8.1.0",
|
|
27
27
|
"inquirer": "^8.2.3",
|
|
28
|
-
"json-stable-stringify": "
|
|
28
|
+
"json-stable-stringify": "1.3.0",
|
|
29
29
|
"lodash": "^4.17.21",
|
|
30
30
|
"ora": "^5.3.0",
|
|
31
31
|
"p-map": "^3.0.0",
|
|
32
|
-
"prettier": "
|
|
32
|
+
"prettier": "^3.6.2",
|
|
33
33
|
"rimraf": "^3.0.0",
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
"@gooddata/sdk-backend-
|
|
37
|
-
"@gooddata/sdk-model": "10.35.0
|
|
38
|
-
"@gooddata/sdk-backend-spi": "10.35.0-alpha.8"
|
|
34
|
+
"tslib": "2.8.1",
|
|
35
|
+
"@gooddata/sdk-backend-tiger": "10.35.0",
|
|
36
|
+
"@gooddata/sdk-backend-spi": "10.35.0",
|
|
37
|
+
"@gooddata/sdk-model": "10.35.0"
|
|
39
38
|
},
|
|
40
39
|
"devDependencies": {
|
|
41
40
|
"@gooddata/eslint-config": "^4.1.1",
|
|
42
41
|
"@types/inquirer": "^8.2.6",
|
|
43
|
-
"@types/json-stable-stringify": "^1.0.32",
|
|
44
42
|
"@types/lodash": "^4.14.202",
|
|
45
|
-
"@types/node": "^
|
|
43
|
+
"@types/node": "^22.13.0",
|
|
46
44
|
"@types/prettier": "~1.18.2",
|
|
47
45
|
"@types/rimraf": "^2.0.2",
|
|
48
46
|
"@typescript-eslint/eslint-plugin": "^5.57.1",
|
|
49
47
|
"@typescript-eslint/parser": "^5.57.1",
|
|
50
48
|
"dependency-cruiser": "^13.0.3",
|
|
51
49
|
"eslint": "^8.25.0",
|
|
50
|
+
"eslint-config-prettier": "^10.1.5",
|
|
52
51
|
"eslint-plugin-header": "^3.0.0",
|
|
53
52
|
"eslint-plugin-import": "^2.22.0",
|
|
54
53
|
"eslint-plugin-import-esm": "^1.2.1",
|
|
55
54
|
"eslint-plugin-jest": "^27.1.1",
|
|
56
55
|
"eslint-plugin-no-only-tests": "^2.4.0",
|
|
57
|
-
"eslint-plugin-prettier": "^
|
|
56
|
+
"eslint-plugin-prettier": "^5.5.1",
|
|
58
57
|
"eslint-plugin-regexp": "^1.9.0",
|
|
59
58
|
"eslint-plugin-sonarjs": "^0.16.0",
|
|
60
59
|
"eslint-plugin-tsdoc": "^0.2.14",
|
|
61
|
-
"typescript": "5.
|
|
62
|
-
"vitest": "3.
|
|
60
|
+
"typescript": "5.8.3",
|
|
61
|
+
"vitest": "3.2.4"
|
|
63
62
|
},
|
|
64
63
|
"scripts": {
|
|
65
64
|
"clean": "rm -rf ci dist esm coverage *.log tsconfig.tsbuildinfo",
|