@gooddata/sdk-backend-mockingbird 11.51.0-alpha.2 → 11.51.0-alpha.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm/index.d.ts +0 -1
- package/esm/index.d.ts.map +1 -1
- package/esm/index.js +0 -1
- package/esm/sdk-backend-mockingbird.d.ts +0 -52
- package/package.json +8 -8
- package/esm/legacyRecordedBackend/index.d.ts +0 -51
- package/esm/legacyRecordedBackend/index.d.ts.map +0 -1
- package/esm/legacyRecordedBackend/index.js +0 -233
- package/esm/legacyRecordedBackend/legacyBackendTypes.d.ts +0 -87
- package/esm/legacyRecordedBackend/legacyBackendTypes.d.ts.map +0 -1
- package/esm/legacyRecordedBackend/legacyBackendTypes.js +0 -8
package/esm/index.d.ts
CHANGED
|
@@ -13,6 +13,5 @@ export type { RecordingIndex, ExecutionRecording, InsightRecording, DisplayFormR
|
|
|
13
13
|
export { type NamedDataView, recordedDataView, recordedDataViews, recordedInsight, recordedInsights, DataViewAll, dataViewWindow, DataViewFirstPage, } from "./recordedBackend/execution.js";
|
|
14
14
|
export { newAttributeFilterLimitingItem, newDateFilterLimitingItem, newMeasureLimitingItem, } from "./recordedBackend/elementsUtils.js";
|
|
15
15
|
export { type CompositeBackendPart, compositeBackend } from "./compositeBackend/index.js";
|
|
16
|
-
export { type LegacyExecutionRecording, type LegacyRecordingIndex, type LegacyWorkspaceRecordings, legacyRecordedDataView, } from "./legacyRecordedBackend/index.js";
|
|
17
16
|
export { objRefsToStringKey } from "./recordedBackend/utils.js";
|
|
18
17
|
//# sourceMappingURL=index.d.ts.map
|
package/esm/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA;;;;;;;GAOG;AACH,OAAO,EAAE,YAAY,EAAE,qBAAqB,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAChG,OAA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EACV,MAAM,EACN,cAAc,EACd,eAAe,EACf,0BAA0B,EAC1B,mCAAmC,GACtC,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EACH,KAAK,aAAa,EAClB,gBAAgB,EAChB,iBAAiB,EACjB,eAAe,EACf,gBAAgB,EAChB,WAAW,EACX,cAAc,EACd,iBAAiB,GACpB,MAAM,gCAAgC,CAAC;AAExC,OAAO,EACH,8BAA8B,EAC9B,yBAAyB,EACzB,sBAAsB,GACzB,MAAM,oCAAoC,CAAC;AAE5C,OAAO,EAAE,KAAK,oBAAoB,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAE1F,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC"}
|
package/esm/index.js
CHANGED
|
@@ -14,5 +14,4 @@ export { recordedBackend, defaultRecordedBackendCapabilities } from "./recordedB
|
|
|
14
14
|
export { recordedDataView, recordedDataViews, recordedInsight, recordedInsights, DataViewAll, dataViewWindow, DataViewFirstPage, } from "./recordedBackend/execution.js";
|
|
15
15
|
export { newAttributeFilterLimitingItem, newDateFilterLimitingItem, newMeasureLimitingItem, } from "./recordedBackend/elementsUtils.js";
|
|
16
16
|
export { compositeBackend } from "./compositeBackend/index.js";
|
|
17
|
-
export { legacyRecordedDataView, } from "./legacyRecordedBackend/index.js";
|
|
18
17
|
export { objRefsToStringKey } from "./recordedBackend/utils.js";
|
|
@@ -208,58 +208,6 @@ export declare type IUsers = {
|
|
|
208
208
|
users?: IWorkspaceUser[];
|
|
209
209
|
};
|
|
210
210
|
|
|
211
|
-
/**
|
|
212
|
-
* Each recording in the master index has these 3 entries
|
|
213
|
-
*
|
|
214
|
-
* @internal
|
|
215
|
-
* @deprecated this implementation is deprecated, use non-legacy recorded backend
|
|
216
|
-
*/
|
|
217
|
-
export declare type LegacyExecutionRecording = {
|
|
218
|
-
definition: IExecutionDefinition;
|
|
219
|
-
response: any;
|
|
220
|
-
result: any;
|
|
221
|
-
};
|
|
222
|
-
|
|
223
|
-
/**
|
|
224
|
-
* Creates a new data view facade for the provided recording.
|
|
225
|
-
*
|
|
226
|
-
* This is legacy implementation of recorded backend. Do not use for new tests.
|
|
227
|
-
*
|
|
228
|
-
* @param recording - recorded definition, AFM response and AFM result
|
|
229
|
-
* @internal
|
|
230
|
-
* @deprecated this implementation is deprecated, use non-legacy recorded backend
|
|
231
|
-
*/
|
|
232
|
-
export declare function legacyRecordedDataView(recording: LegacyExecutionRecording): IDataView;
|
|
233
|
-
|
|
234
|
-
/**
|
|
235
|
-
* Master Index is the input needed to initialize the recorded backend.
|
|
236
|
-
* @internal
|
|
237
|
-
* @deprecated this implementation is deprecated, use non-legacy recorded backend
|
|
238
|
-
*/
|
|
239
|
-
export declare type LegacyRecordingIndex = {
|
|
240
|
-
[workspace: string]: LegacyWorkspaceRecordings;
|
|
241
|
-
};
|
|
242
|
-
|
|
243
|
-
/**
|
|
244
|
-
* Workspace-specific recordings
|
|
245
|
-
*
|
|
246
|
-
* @internal
|
|
247
|
-
* @deprecated this implementation is deprecated, use non-legacy recorded backend
|
|
248
|
-
*/
|
|
249
|
-
export declare type LegacyWorkspaceRecordings = {
|
|
250
|
-
execution?: {
|
|
251
|
-
[fp: string]: LegacyExecutionRecording;
|
|
252
|
-
};
|
|
253
|
-
metadata?: {
|
|
254
|
-
attributeDisplayForm?: {
|
|
255
|
-
[id: string]: IAttributeDisplayFormMetadataObject;
|
|
256
|
-
};
|
|
257
|
-
};
|
|
258
|
-
elements?: {
|
|
259
|
-
[id: string]: IAttributeElement[];
|
|
260
|
-
};
|
|
261
|
-
};
|
|
262
|
-
|
|
263
211
|
/**
|
|
264
212
|
* @internal
|
|
265
213
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gooddata/sdk-backend-mockingbird",
|
|
3
|
-
"version": "11.51.0-alpha.
|
|
3
|
+
"version": "11.51.0-alpha.4",
|
|
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-backend-
|
|
29
|
-
"@gooddata/sdk-
|
|
30
|
-
"@gooddata/sdk-
|
|
31
|
-
"@gooddata/util": "11.51.0-alpha.
|
|
28
|
+
"@gooddata/sdk-backend-spi": "11.51.0-alpha.4",
|
|
29
|
+
"@gooddata/sdk-backend-base": "11.51.0-alpha.4",
|
|
30
|
+
"@gooddata/sdk-model": "11.51.0-alpha.4",
|
|
31
|
+
"@gooddata/util": "11.51.0-alpha.4"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"@microsoft/api-documenter": "^7.17.0",
|
|
@@ -52,9 +52,9 @@
|
|
|
52
52
|
"oxlint-tsgolint": "0.15.0",
|
|
53
53
|
"typescript": "5.9.3",
|
|
54
54
|
"vitest": "4.1.8",
|
|
55
|
-
"@gooddata/eslint-config": "11.51.0-alpha.
|
|
56
|
-
"@gooddata/oxlint-config": "11.51.0-alpha.
|
|
57
|
-
"@gooddata/reference-workspace": "11.51.0-alpha.
|
|
55
|
+
"@gooddata/eslint-config": "11.51.0-alpha.4",
|
|
56
|
+
"@gooddata/oxlint-config": "11.51.0-alpha.4",
|
|
57
|
+
"@gooddata/reference-workspace": "11.51.0-alpha.4"
|
|
58
58
|
},
|
|
59
59
|
"scripts": {
|
|
60
60
|
"_phase:build": "npm run build",
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { type IDataView } from "@gooddata/sdk-backend-spi";
|
|
2
|
-
import { type IAttributeDisplayFormMetadataObject, type IAttributeElement, type IExecutionDefinition } from "@gooddata/sdk-model";
|
|
3
|
-
/**
|
|
4
|
-
* Master Index is the input needed to initialize the recorded backend.
|
|
5
|
-
* @internal
|
|
6
|
-
* @deprecated this implementation is deprecated, use non-legacy recorded backend
|
|
7
|
-
*/
|
|
8
|
-
export type LegacyRecordingIndex = {
|
|
9
|
-
[workspace: string]: LegacyWorkspaceRecordings;
|
|
10
|
-
};
|
|
11
|
-
/**
|
|
12
|
-
* Workspace-specific recordings
|
|
13
|
-
*
|
|
14
|
-
* @internal
|
|
15
|
-
* @deprecated this implementation is deprecated, use non-legacy recorded backend
|
|
16
|
-
*/
|
|
17
|
-
export type LegacyWorkspaceRecordings = {
|
|
18
|
-
execution?: {
|
|
19
|
-
[fp: string]: LegacyExecutionRecording;
|
|
20
|
-
};
|
|
21
|
-
metadata?: {
|
|
22
|
-
attributeDisplayForm?: {
|
|
23
|
-
[id: string]: IAttributeDisplayFormMetadataObject;
|
|
24
|
-
};
|
|
25
|
-
};
|
|
26
|
-
elements?: {
|
|
27
|
-
[id: string]: IAttributeElement[];
|
|
28
|
-
};
|
|
29
|
-
};
|
|
30
|
-
/**
|
|
31
|
-
* Each recording in the master index has these 3 entries
|
|
32
|
-
*
|
|
33
|
-
* @internal
|
|
34
|
-
* @deprecated this implementation is deprecated, use non-legacy recorded backend
|
|
35
|
-
*/
|
|
36
|
-
export type LegacyExecutionRecording = {
|
|
37
|
-
definition: IExecutionDefinition;
|
|
38
|
-
response: any;
|
|
39
|
-
result: any;
|
|
40
|
-
};
|
|
41
|
-
/**
|
|
42
|
-
* Creates a new data view facade for the provided recording.
|
|
43
|
-
*
|
|
44
|
-
* This is legacy implementation of recorded backend. Do not use for new tests.
|
|
45
|
-
*
|
|
46
|
-
* @param recording - recorded definition, AFM response and AFM result
|
|
47
|
-
* @internal
|
|
48
|
-
* @deprecated this implementation is deprecated, use non-legacy recorded backend
|
|
49
|
-
*/
|
|
50
|
-
export declare function legacyRecordedDataView(recording: LegacyExecutionRecording): IDataView;
|
|
51
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/legacyRecordedBackend/index.ts"],"names":[],"mappings":"AAKA,OAAO,EAOH,KAAK,SAAS,EAcjB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAGH,KAAK,mCAAmC,EACxC,KAAK,iBAAiB,EAKtB,KAAK,oBAAoB,EAS5B,MAAM,qBAAqB,CAAC;AAS7B;;;;GAIG;AACH,MAAM,MAAM,oBAAoB,GAAG;IAC/B,CAAC,SAAS,EAAE,MAAM,GAAG,yBAAyB,CAAC;CAClD,CAAC;AAEF;;;;;GAKG;AACH,MAAM,MAAM,yBAAyB,GAAG;IACpC,SAAS,CAAC,EAAE;QACR,CAAC,EAAE,EAAE,MAAM,GAAG,wBAAwB,CAAC;KAC1C,CAAC;IACF,QAAQ,CAAC,EAAE;QACP,oBAAoB,CAAC,EAAE;YAAE,CAAC,EAAE,EAAE,MAAM,GAAG,mCAAmC,CAAA;SAAE,CAAC;KAChF,CAAC;IACF,QAAQ,CAAC,EAAE;QACP,CAAC,EAAE,EAAE,MAAM,GAAG,iBAAiB,EAAE,CAAC;KACrC,CAAC;CACL,CAAC;AAEF;;;;;GAKG;AACH,MAAM,MAAM,wBAAwB,GAAG;IACnC,UAAU,EAAE,oBAAoB,CAAC;IACjC,QAAQ,EAAE,GAAG,CAAC;IACd,MAAM,EAAE,GAAG,CAAC;CACf,CAAC;AAEF;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,CAAC,SAAS,EAAE,wBAAwB,GAAG,SAAS,CAMrF"}
|
|
@@ -1,233 +0,0 @@
|
|
|
1
|
-
// (C) 2019-2026 GoodData Corporation
|
|
2
|
-
import { isEmpty, isEqual } from "lodash-es";
|
|
3
|
-
import { AbstractExecutionFactory } from "@gooddata/sdk-backend-base";
|
|
4
|
-
import { NotSupported, } from "@gooddata/sdk-backend-spi";
|
|
5
|
-
import { defFingerprint, defWithBuckets, defWithDateFormat, defWithDimensions, defWithSorting, uriRef, } from "@gooddata/sdk-model";
|
|
6
|
-
import { isAttributeHeader, } from "./legacyBackendTypes.js";
|
|
7
|
-
/**
|
|
8
|
-
* Creates a new data view facade for the provided recording.
|
|
9
|
-
*
|
|
10
|
-
* This is legacy implementation of recorded backend. Do not use for new tests.
|
|
11
|
-
*
|
|
12
|
-
* @param recording - recorded definition, AFM response and AFM result
|
|
13
|
-
* @internal
|
|
14
|
-
* @deprecated this implementation is deprecated, use non-legacy recorded backend
|
|
15
|
-
*/
|
|
16
|
-
export function legacyRecordedDataView(recording) {
|
|
17
|
-
const definition = recording.definition;
|
|
18
|
-
const executionFactory = new RecordedExecutionFactory({}, recording.definition.workspace);
|
|
19
|
-
const result = recordedExecutionResult(definition, executionFactory, recording);
|
|
20
|
-
return recordedDataView(definition, result, recording);
|
|
21
|
-
}
|
|
22
|
-
//
|
|
23
|
-
// Internals
|
|
24
|
-
//
|
|
25
|
-
class RecordedExecutionFactory extends AbstractExecutionFactory {
|
|
26
|
-
recordings;
|
|
27
|
-
constructor(recordings, workspace) {
|
|
28
|
-
super(workspace);
|
|
29
|
-
this.recordings = recordings;
|
|
30
|
-
}
|
|
31
|
-
forDefinition(def) {
|
|
32
|
-
return recordedPreparedExecution(def, this, this.recordings);
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
function recordedDataView(definition, result, recording) {
|
|
36
|
-
const afmResult = recording.result.executionResult;
|
|
37
|
-
const fp = defFingerprint(definition) + "/recordedData";
|
|
38
|
-
return {
|
|
39
|
-
definition,
|
|
40
|
-
result,
|
|
41
|
-
headerItems: afmResult.headerItems ? afmResult.headerItems : [],
|
|
42
|
-
data: afmResult.data,
|
|
43
|
-
totals: afmResult.totals,
|
|
44
|
-
offset: afmResult.paging.offset,
|
|
45
|
-
count: afmResult.paging.count,
|
|
46
|
-
totalCount: afmResult.paging.total,
|
|
47
|
-
metadata: {
|
|
48
|
-
dataSourceMessages: [],
|
|
49
|
-
},
|
|
50
|
-
fingerprint() {
|
|
51
|
-
return fp;
|
|
52
|
-
},
|
|
53
|
-
equals(other) {
|
|
54
|
-
return fp === other.fingerprint();
|
|
55
|
-
},
|
|
56
|
-
withForecast() {
|
|
57
|
-
throw new NotSupported("not supported");
|
|
58
|
-
},
|
|
59
|
-
forecast() {
|
|
60
|
-
return {
|
|
61
|
-
headerItems: [],
|
|
62
|
-
low: [],
|
|
63
|
-
high: [],
|
|
64
|
-
prediction: [],
|
|
65
|
-
loading: false,
|
|
66
|
-
};
|
|
67
|
-
},
|
|
68
|
-
clustering() {
|
|
69
|
-
throw new NotSupported("Clustering is not supported by the legacy recorded backend.");
|
|
70
|
-
},
|
|
71
|
-
withClustering(_config, _result) {
|
|
72
|
-
throw new NotSupported("Clustering is not supported by the legacy recorded backend.");
|
|
73
|
-
},
|
|
74
|
-
outliers() {
|
|
75
|
-
return {
|
|
76
|
-
headerItems: [],
|
|
77
|
-
anomalies: [],
|
|
78
|
-
loading: false,
|
|
79
|
-
};
|
|
80
|
-
},
|
|
81
|
-
withOutliers(_config, _result) {
|
|
82
|
-
throw new NotSupported("Outliers are not supported by the legacy recorded backend.");
|
|
83
|
-
},
|
|
84
|
-
readCollectionItems(_config) {
|
|
85
|
-
throw new NotSupported("readCollectionItems is not supported by the legacy recorded backend.");
|
|
86
|
-
},
|
|
87
|
-
};
|
|
88
|
-
}
|
|
89
|
-
function convertDimensions(dims) {
|
|
90
|
-
return dims.map((dim) => {
|
|
91
|
-
return {
|
|
92
|
-
headers: dim.headers.map((header) => {
|
|
93
|
-
if (isAttributeHeader(header)) {
|
|
94
|
-
return {
|
|
95
|
-
attributeHeader: {
|
|
96
|
-
...header.attributeHeader,
|
|
97
|
-
ref: uriRef(header.attributeHeader.uri),
|
|
98
|
-
formOf: {
|
|
99
|
-
...header.attributeHeader.formOf,
|
|
100
|
-
ref: uriRef(header.attributeHeader.formOf.uri),
|
|
101
|
-
},
|
|
102
|
-
},
|
|
103
|
-
};
|
|
104
|
-
}
|
|
105
|
-
else {
|
|
106
|
-
return {
|
|
107
|
-
measureGroupHeader: {
|
|
108
|
-
items: header.measureGroupHeader.items.map((measure) => {
|
|
109
|
-
return {
|
|
110
|
-
measureHeaderItem: {
|
|
111
|
-
...measure.measureHeaderItem,
|
|
112
|
-
ref: measure.measureHeaderItem.uri
|
|
113
|
-
? uriRef(measure.measureHeaderItem.uri)
|
|
114
|
-
: undefined,
|
|
115
|
-
},
|
|
116
|
-
};
|
|
117
|
-
}),
|
|
118
|
-
totalItems: header.measureGroupHeader.totalItems,
|
|
119
|
-
},
|
|
120
|
-
};
|
|
121
|
-
}
|
|
122
|
-
}),
|
|
123
|
-
};
|
|
124
|
-
});
|
|
125
|
-
}
|
|
126
|
-
function recordedExecutionResult(definition, executionFactory, recording) {
|
|
127
|
-
const fp = defFingerprint(definition) + "/recordedResult";
|
|
128
|
-
const afmResponse = recording.response.executionResponse;
|
|
129
|
-
const result = {
|
|
130
|
-
definition,
|
|
131
|
-
dimensions: convertDimensions(afmResponse.dimensions),
|
|
132
|
-
readAll() {
|
|
133
|
-
return Promise.resolve(recordedDataView(definition, result, recording));
|
|
134
|
-
},
|
|
135
|
-
readWindow(_1, _2) {
|
|
136
|
-
return Promise.resolve(recordedDataView(definition, result, recording));
|
|
137
|
-
},
|
|
138
|
-
readForecastAll() {
|
|
139
|
-
throw new NotSupported("Forecasting is not supported by the recorded backend.");
|
|
140
|
-
},
|
|
141
|
-
readOutliersAll() {
|
|
142
|
-
throw new NotSupported("Outliers detection is not supported by the recorded backend.");
|
|
143
|
-
},
|
|
144
|
-
readAnomalyDetectionAll() {
|
|
145
|
-
throw new NotSupported("Anomaly detection is not supported by the recorded backend.");
|
|
146
|
-
},
|
|
147
|
-
readClusteringAll() {
|
|
148
|
-
throw new NotSupported("Clustering is not supported by the recorded backend.");
|
|
149
|
-
},
|
|
150
|
-
readBinaryStreamAll() {
|
|
151
|
-
throw new NotSupported("Binary Stream results are not supported by the recorded backend.");
|
|
152
|
-
},
|
|
153
|
-
fingerprint() {
|
|
154
|
-
return fp;
|
|
155
|
-
},
|
|
156
|
-
resultId() {
|
|
157
|
-
return undefined;
|
|
158
|
-
},
|
|
159
|
-
equals(other) {
|
|
160
|
-
return fp === other.fingerprint();
|
|
161
|
-
},
|
|
162
|
-
export(_) {
|
|
163
|
-
throw new NotSupported("...");
|
|
164
|
-
},
|
|
165
|
-
transform() {
|
|
166
|
-
return executionFactory.forDefinition(definition);
|
|
167
|
-
},
|
|
168
|
-
withSignal(_signal) {
|
|
169
|
-
throw new NotSupported("not supported");
|
|
170
|
-
},
|
|
171
|
-
};
|
|
172
|
-
return result;
|
|
173
|
-
}
|
|
174
|
-
function recordedPreparedExecution(definition, executionFactory, recordings = {}) {
|
|
175
|
-
const fp = defFingerprint(definition);
|
|
176
|
-
return {
|
|
177
|
-
definition,
|
|
178
|
-
withDimensions(...dim) {
|
|
179
|
-
return executionFactory.forDefinition(defWithDimensions(definition, ...dim));
|
|
180
|
-
},
|
|
181
|
-
withSorting(...items) {
|
|
182
|
-
return executionFactory.forDefinition(defWithSorting(definition, items));
|
|
183
|
-
},
|
|
184
|
-
withBuckets(...buckets) {
|
|
185
|
-
return executionFactory.forDefinition(defWithBuckets(definition, ...buckets));
|
|
186
|
-
},
|
|
187
|
-
withDateFormat(dateFormat) {
|
|
188
|
-
return executionFactory.forDefinition(defWithDateFormat(definition, dateFormat));
|
|
189
|
-
},
|
|
190
|
-
withExecConfig(config) {
|
|
191
|
-
if (!isEmpty(config?.dataSamplingPercentage)) {
|
|
192
|
-
console.warn("Backend does not support data sampling, result will be not affected");
|
|
193
|
-
}
|
|
194
|
-
return executionFactory.forDefinition(definition);
|
|
195
|
-
},
|
|
196
|
-
withSignal(_signal) {
|
|
197
|
-
return recordedPreparedExecution(definition, executionFactory, recordings);
|
|
198
|
-
},
|
|
199
|
-
withContext(_context) {
|
|
200
|
-
throw new NotSupported("Execution context is not supported by the legacy recorded backend.");
|
|
201
|
-
},
|
|
202
|
-
execute() {
|
|
203
|
-
return new Promise((resolve, reject) => {
|
|
204
|
-
const recording = recordings.execution?.["fp_" + fp];
|
|
205
|
-
if (recording) {
|
|
206
|
-
if (definition.postProcessing) {
|
|
207
|
-
recording.definition = {
|
|
208
|
-
...recording.definition,
|
|
209
|
-
postProcessing: definition.postProcessing,
|
|
210
|
-
};
|
|
211
|
-
}
|
|
212
|
-
resolve(recordedExecutionResult(definition, executionFactory, recording));
|
|
213
|
-
}
|
|
214
|
-
else {
|
|
215
|
-
reject(new Error("Recording not found"));
|
|
216
|
-
}
|
|
217
|
-
});
|
|
218
|
-
},
|
|
219
|
-
explain() {
|
|
220
|
-
console.warn("Backend does not support explain mode");
|
|
221
|
-
return {
|
|
222
|
-
data: () => Promise.reject(new Error(`Backend does not support explain mode data call.`)),
|
|
223
|
-
download: () => Promise.resolve(),
|
|
224
|
-
};
|
|
225
|
-
},
|
|
226
|
-
fingerprint() {
|
|
227
|
-
return fp;
|
|
228
|
-
},
|
|
229
|
-
equals(other) {
|
|
230
|
-
return isEqual(this.definition, other.definition);
|
|
231
|
-
},
|
|
232
|
-
};
|
|
233
|
-
}
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
export interface IMeasureHeaderItem {
|
|
2
|
-
measureHeaderItem: {
|
|
3
|
-
uri?: string;
|
|
4
|
-
identifier?: string;
|
|
5
|
-
localIdentifier: string;
|
|
6
|
-
name: string;
|
|
7
|
-
format: string;
|
|
8
|
-
};
|
|
9
|
-
}
|
|
10
|
-
export interface ITotalHeaderItem {
|
|
11
|
-
totalHeaderItem: {
|
|
12
|
-
name: string;
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
|
-
export interface IMeasureGroupHeader {
|
|
16
|
-
measureGroupHeader: {
|
|
17
|
-
items: IMeasureHeaderItem[];
|
|
18
|
-
totalItems?: ITotalHeaderItem[];
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* @public
|
|
23
|
-
*/
|
|
24
|
-
export interface IAttributeHeader {
|
|
25
|
-
attributeHeader: {
|
|
26
|
-
uri: string;
|
|
27
|
-
identifier: string;
|
|
28
|
-
localIdentifier: string;
|
|
29
|
-
name: string;
|
|
30
|
-
totalItems?: ITotalHeaderItem[];
|
|
31
|
-
formOf: {
|
|
32
|
-
uri: string;
|
|
33
|
-
identifier: string;
|
|
34
|
-
name: string;
|
|
35
|
-
};
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
export type IHeader = IMeasureGroupHeader | IAttributeHeader;
|
|
39
|
-
export interface IResultDimension {
|
|
40
|
-
headers: IHeader[];
|
|
41
|
-
}
|
|
42
|
-
export type DataValue = null | string | number;
|
|
43
|
-
export interface IResultAttributeHeaderItem {
|
|
44
|
-
attributeHeaderItem: {
|
|
45
|
-
uri: string;
|
|
46
|
-
name: string;
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
export interface IResultMeasureHeaderItem {
|
|
50
|
-
measureHeaderItem: {
|
|
51
|
-
name: string;
|
|
52
|
-
order: number;
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
export interface IResultTotalHeaderItem {
|
|
56
|
-
totalHeaderItem: {
|
|
57
|
-
name: string;
|
|
58
|
-
type: string;
|
|
59
|
-
};
|
|
60
|
-
}
|
|
61
|
-
export type IResultHeaderItem = IResultAttributeHeaderItem | IResultMeasureHeaderItem | IResultTotalHeaderItem;
|
|
62
|
-
export interface IWarning {
|
|
63
|
-
warningCode: string;
|
|
64
|
-
message: string;
|
|
65
|
-
parameters?: any[];
|
|
66
|
-
}
|
|
67
|
-
export interface IExecutionResult {
|
|
68
|
-
headerItems?: IResultHeaderItem[][][];
|
|
69
|
-
data: DataValue[][] | DataValue[];
|
|
70
|
-
totals?: DataValue[][][];
|
|
71
|
-
totalTotals?: DataValue[][][];
|
|
72
|
-
paging: {
|
|
73
|
-
count: number[];
|
|
74
|
-
offset: number[];
|
|
75
|
-
total: number[];
|
|
76
|
-
};
|
|
77
|
-
warnings?: IWarning[];
|
|
78
|
-
}
|
|
79
|
-
export interface IExecutionResponse {
|
|
80
|
-
links: {
|
|
81
|
-
executionResult: string;
|
|
82
|
-
};
|
|
83
|
-
dimensions: IResultDimension[];
|
|
84
|
-
}
|
|
85
|
-
export declare function isAttributeHeaderItem(header: IResultHeaderItem): header is IResultAttributeHeaderItem;
|
|
86
|
-
export declare function isAttributeHeader(header: IHeader): header is IAttributeHeader;
|
|
87
|
-
//# sourceMappingURL=legacyBackendTypes.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"legacyBackendTypes.d.ts","sourceRoot":"","sources":["../../src/legacyRecordedBackend/legacyBackendTypes.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,kBAAkB;IAC/B,iBAAiB,EAAE;QACf,GAAG,CAAC,EAAE,MAAM,CAAC;QACb,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,eAAe,EAAE,MAAM,CAAC;QACxB,IAAI,EAAE,MAAM,CAAC;QACb,MAAM,EAAE,MAAM,CAAC;KAClB,CAAC;CACL;AAED,MAAM,WAAW,gBAAgB;IAC7B,eAAe,EAAE;QACb,IAAI,EAAE,MAAM,CAAC;KAChB,CAAC;CACL;AAED,MAAM,WAAW,mBAAmB;IAChC,kBAAkB,EAAE;QAChB,KAAK,EAAE,kBAAkB,EAAE,CAAC;QAC5B,UAAU,CAAC,EAAE,gBAAgB,EAAE,CAAC;KACnC,CAAC;CACL;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC7B,eAAe,EAAE;QACb,GAAG,EAAE,MAAM,CAAC;QACZ,UAAU,EAAE,MAAM,CAAC;QACnB,eAAe,EAAE,MAAM,CAAC;QACxB,IAAI,EAAE,MAAM,CAAC;QACb,UAAU,CAAC,EAAE,gBAAgB,EAAE,CAAC;QAChC,MAAM,EAAE;YACJ,GAAG,EAAE,MAAM,CAAC;YACZ,UAAU,EAAE,MAAM,CAAC;YACnB,IAAI,EAAE,MAAM,CAAC;SAChB,CAAC;KACL,CAAC;CACL;AAED,MAAM,MAAM,OAAO,GAAG,mBAAmB,GAAG,gBAAgB,CAAC;AAE7D,MAAM,WAAW,gBAAgB;IA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EAAE,CAAC;CAClC;AAED,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,iBAAiB,GAAG,MAAM,IAAI,0BAA0B,CAErG;AAED,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,IAAI,gBAAgB,CAE7E"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
// (C) 2019-2026 GoodData Corporation
|
|
2
|
-
import { isEmpty } from "lodash-es";
|
|
3
|
-
export function isAttributeHeaderItem(header) {
|
|
4
|
-
return !isEmpty(header) && header.attributeHeaderItem !== undefined;
|
|
5
|
-
}
|
|
6
|
-
export function isAttributeHeader(header) {
|
|
7
|
-
return !isEmpty(header) && header.attributeHeader !== undefined;
|
|
8
|
-
}
|