@lightdash/cli 2.573.4 → 2.575.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/README.md +31 -0
- package/dist/.tsbuildinfo.build +1 -1
- package/dist/agentConnections/agentTokenProvider.d.ts.map +1 -1
- package/dist/agentConnections/agentTokenProvider.js +5 -4
- package/dist/agentConnections/responseValidation.d.ts +3 -0
- package/dist/agentConnections/responseValidation.d.ts.map +1 -0
- package/dist/agentConnections/responseValidation.js +12 -0
- package/dist/agentConnections/schema.d.ts.map +1 -1
- package/dist/agentConnections/schema.js +70 -4
- package/dist/agentConnections/serverError.d.ts +5 -0
- package/dist/agentConnections/serverError.d.ts.map +1 -0
- package/dist/agentConnections/serverError.js +38 -0
- package/dist/agentConnections/statusResponse.d.ts.map +1 -1
- package/dist/agentConnections/statusResponse.js +19 -11
- package/dist/agentConnections/store.d.ts.map +1 -1
- package/dist/agentConnections/store.js +6 -32
- package/dist/agentConnections/warehouseStatus.d.ts.map +1 -1
- package/dist/agentConnections/warehouseStatus.js +4 -26
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +2 -0
- package/dist/connectionErrors.fixture.d.ts +2 -0
- package/dist/connectionErrors.fixture.d.ts.map +1 -0
- package/dist/connectionErrors.fixture.js +38 -0
- package/dist/dbt/targets/Databricks/oauth.d.ts.map +1 -1
- package/dist/dbt/targets/Databricks/oauth.js +3 -3
- package/dist/errorHandler.fixture.d.ts +2 -0
- package/dist/errorHandler.fixture.d.ts.map +1 -0
- package/dist/errorHandler.fixture.js +48 -0
- package/dist/handlers/agentConnectionConnect.d.ts.map +1 -1
- package/dist/handlers/agentConnectionConnect.js +18 -8
- package/dist/handlers/agentConnectionStatus.d.ts.map +1 -1
- package/dist/handlers/agentConnectionStatus.js +5 -1
- package/dist/handlers/agentRevoke.d.ts.map +1 -1
- package/dist/handlers/agentRevoke.js +5 -0
- package/dist/handlers/apps/appCodeFiles.d.ts.map +1 -1
- package/dist/handlers/apps/appCodeFiles.js +4 -1
- package/dist/handlers/apps/appsDownload.d.ts.map +1 -1
- package/dist/handlers/apps/appsDownload.js +22 -6
- package/dist/handlers/asyncQuery.d.ts +1 -0
- package/dist/handlers/asyncQuery.d.ts.map +1 -1
- package/dist/handlers/asyncQuery.js +15 -0
- package/dist/handlers/compile.d.ts.map +1 -1
- package/dist/handlers/compile.js +3 -1
- package/dist/handlers/dbt/apiClient.d.ts +1 -0
- package/dist/handlers/dbt/apiClient.d.ts.map +1 -1
- package/dist/handlers/dbt/apiClient.js +68 -17
- package/dist/handlers/deploy.d.ts.map +1 -1
- package/dist/handlers/deploy.js +10 -0
- package/dist/handlers/download.d.ts.map +1 -1
- package/dist/handlers/download.js +31 -8
- package/dist/handlers/getProject.d.ts.map +1 -1
- package/dist/handlers/getProject.js +10 -1
- package/dist/handlers/homepagesAsCode.d.ts.map +1 -1
- package/dist/handlers/homepagesAsCode.js +4 -1
- package/dist/handlers/runChart.d.ts.map +1 -1
- package/dist/handlers/runChart.js +8 -2
- package/dist/handlers/spacesAsCode.d.ts.map +1 -1
- package/dist/handlers/spacesAsCode.js +16 -3
- package/dist/handlers/sql.d.ts.map +1 -1
- package/dist/handlers/sql.js +3 -2
- package/dist/handlers/timestampConversion.d.ts.map +1 -1
- package/dist/handlers/timestampConversion.js +6 -0
- package/dist/ordinaryError.main.json +20 -0
- package/dist/outputUnchanged.main.json +30 -0
- package/package.json +3 -3
|
@@ -11,6 +11,7 @@ const initialToken_1 = require("../agentConnections/initialToken");
|
|
|
11
11
|
const lifecycle_1 = require("../agentConnections/lifecycle");
|
|
12
12
|
const personalRecovery_1 = require("../agentConnections/personalRecovery");
|
|
13
13
|
const schema_1 = require("../agentConnections/schema");
|
|
14
|
+
const serverError_1 = require("../agentConnections/serverError");
|
|
14
15
|
const statusResponse_1 = require("../agentConnections/statusResponse");
|
|
15
16
|
const store_1 = require("../agentConnections/store");
|
|
16
17
|
const warehouseStatus_1 = require("../agentConnections/warehouseStatus");
|
|
@@ -44,7 +45,7 @@ const requestResults = async (response) => {
|
|
|
44
45
|
catch {
|
|
45
46
|
throw new ApprovalStartError(couldNotStart);
|
|
46
47
|
}
|
|
47
|
-
if (!response.ok) {
|
|
48
|
+
if (!response.ok || envelope.status !== 'ok') {
|
|
48
49
|
const error = typeof envelope.error === 'object' && envelope.error !== null
|
|
49
50
|
? (0, statusResponse_1.responseRecord)(envelope.error)
|
|
50
51
|
: {};
|
|
@@ -53,10 +54,8 @@ const requestResults = async (response) => {
|
|
|
53
54
|
throw availabilityError;
|
|
54
55
|
if (response.status === 403)
|
|
55
56
|
throw new ApprovalStartError('The server refused agent connection approval. Check your permissions with an administrator.');
|
|
56
|
-
throw new ApprovalStartError(couldNotStart);
|
|
57
|
+
throw new ApprovalStartError(`${couldNotStart} ${(0, serverError_1.connectionServerError)(response.status, envelope).message}`);
|
|
57
58
|
}
|
|
58
|
-
if (envelope.status !== 'ok')
|
|
59
|
-
throw new ApprovalStartError(couldNotStart);
|
|
60
59
|
return (0, statusResponse_1.responseRecord)(envelope.results);
|
|
61
60
|
};
|
|
62
61
|
const personIdentity = (person) => {
|
|
@@ -125,6 +124,7 @@ const agentConnectionConnectHandler = async (options, dependencies = {
|
|
|
125
124
|
console.error(`Replacing agent connection slot ${safeText(input.name)}. The old credential stays until the new approval is verified. The old connection will not be revoked.`);
|
|
126
125
|
const state = (0, crypto_1.randomBytes)(32).toString('base64url');
|
|
127
126
|
const verifier = (0, crypto_1.randomBytes)(32).toString('base64url');
|
|
127
|
+
secrets.push(verifier);
|
|
128
128
|
const codeChallenge = (0, crypto_1.createHash)('sha256')
|
|
129
129
|
.update(verifier)
|
|
130
130
|
.digest('base64url');
|
|
@@ -152,7 +152,9 @@ const agentConnectionConnectHandler = async (options, dependencies = {
|
|
|
152
152
|
}),
|
|
153
153
|
}));
|
|
154
154
|
if (typeof approval.authorizationUrl !== 'string' ||
|
|
155
|
-
!bootstrap.publicTextIsSafe(approval.authorizationUrl
|
|
155
|
+
!bootstrap.publicTextIsSafe(approval.authorizationUrl, [
|
|
156
|
+
verifier,
|
|
157
|
+
]) ||
|
|
156
158
|
!/^https?:\/\//.test(approval.authorizationUrl) ||
|
|
157
159
|
approval.issuer !== instance ||
|
|
158
160
|
approval.resource !== instance ||
|
|
@@ -162,13 +164,21 @@ const agentConnectionConnectHandler = async (options, dependencies = {
|
|
|
162
164
|
Date.parse(approval.expiresAt) <= Date.now())
|
|
163
165
|
throw new ApprovalStartError(couldNotStart);
|
|
164
166
|
const approvalDeadline = Date.parse(approval.expiresAt);
|
|
165
|
-
const
|
|
166
|
-
const destination = new URL(
|
|
167
|
-
if (!bootstrap.publicTextIsSafe(
|
|
167
|
+
const suppliedAuthorizationUrl = (0, apiUrl_1.agentConnectionApiUrl)(instance, approval.authorizationUrl);
|
|
168
|
+
const destination = new URL(suppliedAuthorizationUrl);
|
|
169
|
+
if (!bootstrap.publicTextIsSafe(suppliedAuthorizationUrl, [verifier]) ||
|
|
168
170
|
destination.pathname !==
|
|
169
171
|
new URL(`${instance}/api/v1/oauth/authorize`).pathname ||
|
|
170
172
|
destination.hash)
|
|
171
173
|
throw new ApprovalStartError(couldNotStart);
|
|
174
|
+
const requestUuid = destination.searchParams.get('agent_request');
|
|
175
|
+
if (!requestUuid ||
|
|
176
|
+
!(0, uuid_1.validate)(requestUuid) ||
|
|
177
|
+
destination.searchParams.getAll('agent_request').length !== 1)
|
|
178
|
+
throw new ApprovalStartError(couldNotStart);
|
|
179
|
+
const localAuthorizationUrl = new URL(`${instance}/api/v1/oauth/authorize`);
|
|
180
|
+
localAuthorizationUrl.searchParams.set('agent_request', requestUuid);
|
|
181
|
+
const authorizationUrl = localAuthorizationUrl.href;
|
|
172
182
|
console.error(`Open this page to approve the agent connection:\n${authorizationUrl}`);
|
|
173
183
|
console.error('Waiting for browser approval and warehouse setup...');
|
|
174
184
|
phase = 'callback';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agentConnectionStatus.d.ts","sourceRoot":"","sources":["../../src/handlers/agentConnectionStatus.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"agentConnectionStatus.d.ts","sourceRoot":"","sources":["../../src/handlers/agentConnectionStatus.ts"],"names":[],"mappings":"AA6BA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,eAAe,CAAC;AAGlD,MAAM,MAAM,uBAAuB,GAAG,YAAY,GAAG;IACjD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,OAAO,CAAC;CAClB,CAAC;AAyCF,eAAO,MAAM,4BAA4B,YAC5B,uBAAuB,KACjC,OAAO,CAAC,IAAI,CAgPd,CAAC"}
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.agentConnectionStatusHandler = void 0;
|
|
4
4
|
const common_1 = require("@lightdash/common");
|
|
5
5
|
const lifecycle_1 = require("../agentConnections/lifecycle");
|
|
6
|
+
const serverError_1 = require("../agentConnections/serverError");
|
|
6
7
|
const statusResponse_1 = require("../agentConnections/statusResponse");
|
|
7
8
|
const store_1 = require("../agentConnections/store");
|
|
8
9
|
const warehouseStatus_1 = require("../agentConnections/warehouseStatus");
|
|
@@ -62,6 +63,7 @@ const agentConnectionStatusHandler = async (options) => {
|
|
|
62
63
|
},
|
|
63
64
|
});
|
|
64
65
|
const value = await response.json();
|
|
66
|
+
(0, serverError_1.checkConnectionErrorEnvelope)(response.status, value);
|
|
65
67
|
const requestedSlot = slot;
|
|
66
68
|
const latest = await store.readSlot(slot);
|
|
67
69
|
if (!latest || latest.grantUuid !== slot.grantUuid)
|
|
@@ -95,7 +97,9 @@ const agentConnectionStatusHandler = async (options) => {
|
|
|
95
97
|
state = failure.state;
|
|
96
98
|
else if (failure instanceof statusResponse_1.ConnectionMismatchError)
|
|
97
99
|
state = 'mismatched';
|
|
98
|
-
if (
|
|
100
|
+
if (failure instanceof serverError_1.ConnectionServerError)
|
|
101
|
+
error = `Connection status is unconfirmed. ${failure.message}`;
|
|
102
|
+
else if (state === 'invalid')
|
|
99
103
|
error =
|
|
100
104
|
slot === null
|
|
101
105
|
? 'Invalid agent connection data. Reconnect before using this slot.'
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agentRevoke.d.ts","sourceRoot":"","sources":["../../src/handlers/agentRevoke.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"agentRevoke.d.ts","sourceRoot":"","sources":["../../src/handlers/agentRevoke.ts"],"names":[],"mappings":"AA6BA,MAAM,MAAM,kBAAkB,GAAG;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,KAAK,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AACF,eAAO,MAAM,kBAAkB,YAClB,kBAAkB,KAC5B,OAAO,CAAC,IAAI,CAyJd,CAAC"}
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.agentRevokeHandler = void 0;
|
|
4
4
|
const lifecycle_1 = require("../agentConnections/lifecycle");
|
|
5
5
|
const personalRecovery_1 = require("../agentConnections/personalRecovery");
|
|
6
|
+
const serverError_1 = require("../agentConnections/serverError");
|
|
6
7
|
const statusResponse_1 = require("../agentConnections/statusResponse");
|
|
7
8
|
const store_1 = require("../agentConnections/store");
|
|
8
9
|
const config_1 = require("../config");
|
|
@@ -41,6 +42,7 @@ const agentRevokeHandler = async (options) => {
|
|
|
41
42
|
signal: AbortSignal.timeout(15_000),
|
|
42
43
|
});
|
|
43
44
|
const value = await response.json();
|
|
45
|
+
(0, serverError_1.checkConnectionErrorEnvelope)(response.status, value);
|
|
44
46
|
const envelope = (0, statusResponse_1.responseRecord)(value);
|
|
45
47
|
const person = (0, statusResponse_1.responseRecord)(envelope.results);
|
|
46
48
|
if (envelope.status !== 'ok' ||
|
|
@@ -85,6 +87,7 @@ const agentRevokeHandler = async (options) => {
|
|
|
85
87
|
},
|
|
86
88
|
});
|
|
87
89
|
const value = await response.json();
|
|
90
|
+
(0, serverError_1.checkConnectionErrorEnvelope)(response.status, value);
|
|
88
91
|
const checked = (0, statusResponse_1.connectionResponse)(value, slot, false);
|
|
89
92
|
if (checked.lastReported.status !== 'revoked' ||
|
|
90
93
|
checked.lastReported.revokedAt === null)
|
|
@@ -99,6 +102,8 @@ const agentRevokeHandler = async (options) => {
|
|
|
99
102
|
if (confirmed)
|
|
100
103
|
error =
|
|
101
104
|
'The server confirmed revocation, but the local credential could not be removed.';
|
|
105
|
+
else if (failure instanceof serverError_1.ConnectionServerError)
|
|
106
|
+
error = `Revocation was not confirmed. The local slot was kept. ${failure.message}`;
|
|
102
107
|
else if (slot === null)
|
|
103
108
|
error =
|
|
104
109
|
key === null
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"appCodeFiles.d.ts","sourceRoot":"","sources":["../../../src/handlers/apps/appCodeFiles.ts"],"names":[],"mappings":"AAAA,OAAO,EAKH,KAAK,WAAW,EAChB,KAAK,eAAe,EACpB,KAAK,cAAc,EAEnB,KAAK,mBAAmB,EACxB,KAAK,eAAe,EACpB,KAAK,wBAAwB,EAChC,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"appCodeFiles.d.ts","sourceRoot":"","sources":["../../../src/handlers/apps/appCodeFiles.ts"],"names":[],"mappings":"AAAA,OAAO,EAKH,KAAK,WAAW,EAChB,KAAK,eAAe,EACpB,KAAK,cAAc,EAEnB,KAAK,mBAAmB,EACxB,KAAK,eAAe,EACpB,KAAK,wBAAwB,EAChC,MAAM,mBAAmB,CAAC;AAQ3B;;;;GAIG;AACH,eAAO,MAAM,aAAa,SAChB,MAAM,WACH,MAAM,gBACD,GAAG,CAAC,MAAM,CAAC,KAC1B,MAcF,CAAC;AAEF,eAAO,MAAM,eAAe,QACnB,MAAM,SACJ,eAAe,EAAE,KACzB,OAAO,CAAC,IAAI,CAwBd,CAAC;AAEF,eAAO,MAAM,iBAAiB,QAC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,mBAAmB,KAC1B,WAC4E,CAAC;AAEhF,eAAO,MAAM,mBAAmB,QACvB,MAAM,KACZ,OAAO,CAAC,eAAe,CAYzB,CAAC;AAEF,eAAO,MAAM,iBAAiB,QAAe,MAAM,KAAG,OAAO,CAAC,WAAW,CAYxE,CAAC"}
|
|
@@ -6,6 +6,7 @@ const common_1 = require("@lightdash/common");
|
|
|
6
6
|
const fs_1 = require("fs");
|
|
7
7
|
const path = tslib_1.__importStar(require("path"));
|
|
8
8
|
const YAML = tslib_1.__importStar(require("yaml"));
|
|
9
|
+
const credentials_1 = require("../../credentials");
|
|
9
10
|
const MANIFEST_FILENAME = 'lightdash-app.yml';
|
|
10
11
|
/**
|
|
11
12
|
* Derives a collision-safe folder name for a data app.
|
|
@@ -36,7 +37,9 @@ const writeFilesToDir = async (dir, files) => {
|
|
|
36
37
|
// if the server returns a traversal path.
|
|
37
38
|
if (filePath !== resolvedRoot &&
|
|
38
39
|
!filePath.startsWith(resolvedRoot + path.sep)) {
|
|
39
|
-
throw new Error(
|
|
40
|
+
throw new Error((0, credentials_1.getAgentConnectionSelection)() !== null
|
|
41
|
+
? 'Refusing to write a file outside the target directory.'
|
|
42
|
+
: `Refusing to write file outside the target directory: ${file.path}`);
|
|
40
43
|
}
|
|
41
44
|
await fs_1.promises.mkdir(path.dirname(filePath), { recursive: true });
|
|
42
45
|
await fs_1.promises.writeFile(filePath, Buffer.from(file.contentBase64, 'base64'));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"appsDownload.d.ts","sourceRoot":"","sources":["../../../src/handlers/apps/appsDownload.ts"],"names":[],"mappings":"AAAA,OAAO,EAKH,KAAK,mBAAmB,EACxB,KAAK,eAAe,EACvB,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"appsDownload.d.ts","sourceRoot":"","sources":["../../../src/handlers/apps/appsDownload.ts"],"names":[],"mappings":"AAAA,OAAO,EAKH,KAAK,mBAAmB,EACxB,KAAK,eAAe,EACvB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KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CAC3D,KAAG,OAAO,CAAC,mBAAmB,CAyH9B,CAAC"}
|
|
@@ -5,6 +5,7 @@ const tslib_1 = require("tslib");
|
|
|
5
5
|
const common_1 = require("@lightdash/common");
|
|
6
6
|
const path = tslib_1.__importStar(require("path"));
|
|
7
7
|
const uuid_1 = require("uuid");
|
|
8
|
+
const credentials_1 = require("../../credentials");
|
|
8
9
|
const globalState_1 = tslib_1.__importDefault(require("../../globalState"));
|
|
9
10
|
const styles = tslib_1.__importStar(require("../../styles"));
|
|
10
11
|
const appCodeFiles_1 = require("./appCodeFiles");
|
|
@@ -159,7 +160,9 @@ exports.computeLinkedAppSlugs = computeLinkedAppSlugs;
|
|
|
159
160
|
*/
|
|
160
161
|
const ensureDownloadedAppContext = (appRef, code) => {
|
|
161
162
|
if (code.context === undefined) {
|
|
162
|
-
throw new Error(
|
|
163
|
+
throw new Error((0, credentials_1.getAgentConnectionSelection)() !== null
|
|
164
|
+
? 'This server does not support app context downloads. Upgrade the server, or use a CLI version matching your server.'
|
|
165
|
+
: `This Lightdash server does not support app context downloads (app ${code.manifest.slug ?? appRef}). Upgrade the server, or use a CLI version matching your server.`);
|
|
163
166
|
}
|
|
164
167
|
return code;
|
|
165
168
|
};
|
|
@@ -232,7 +235,9 @@ const appsDownloadSummary = (successCount, total, failures, appsDir, skippedNotB
|
|
|
232
235
|
return {
|
|
233
236
|
ok: false,
|
|
234
237
|
message: `${base} — ${failures.length} failed`,
|
|
235
|
-
failureLines: failures.map((failure) =>
|
|
238
|
+
failureLines: failures.map((failure) => (0, credentials_1.getAgentConnectionSelection)() !== null
|
|
239
|
+
? ' ✖ An app could not be downloaded.'
|
|
240
|
+
: ` ✖ ${failure.appRef}: ${failure.message}`),
|
|
236
241
|
};
|
|
237
242
|
};
|
|
238
243
|
exports.appsDownloadSummary = appsDownloadSummary;
|
|
@@ -256,7 +261,9 @@ const downloadAppsToDir = async (args) => {
|
|
|
256
261
|
const skipReason = skipBundle?.(code.manifest) ?? null;
|
|
257
262
|
if (skipReason !== null) {
|
|
258
263
|
skippedWrongKindCount += 1;
|
|
259
|
-
globalState_1.default.log(styles.warning(
|
|
264
|
+
globalState_1.default.log(styles.warning((0, credentials_1.getAgentConnectionSelection)() !== null
|
|
265
|
+
? 'An app was skipped because its kind does not match the requested kind.'
|
|
266
|
+
: `Skipped ${appRef}: ${skipReason}`));
|
|
260
267
|
onProgress?.(successCount +
|
|
261
268
|
skippedNotBuiltCount +
|
|
262
269
|
skippedWrongKindCount +
|
|
@@ -297,11 +304,20 @@ const downloadAppsToDir = async (args) => {
|
|
|
297
304
|
const outcome = (0, exports.classifyAppDownloadError)(appErr);
|
|
298
305
|
if (outcome.kind === 'skip-not-built') {
|
|
299
306
|
skippedNotBuiltCount += 1;
|
|
300
|
-
globalState_1.default.debug(
|
|
307
|
+
globalState_1.default.debug((0, credentials_1.getAgentConnectionSelection)() !== null
|
|
308
|
+
? 'An app was skipped because it has no built version.'
|
|
309
|
+
: `> Skipped app ${appRef}: no built version to download`);
|
|
301
310
|
}
|
|
302
311
|
else {
|
|
303
|
-
failures.push({
|
|
304
|
-
|
|
312
|
+
failures.push({
|
|
313
|
+
appRef: (0, credentials_1.getAgentConnectionSelection)() !== null ? 'App' : appRef,
|
|
314
|
+
message: (0, credentials_1.getAgentConnectionSelection)() !== null
|
|
315
|
+
? 'An app could not be downloaded.'
|
|
316
|
+
: outcome.message,
|
|
317
|
+
});
|
|
318
|
+
globalState_1.default.log(styles.error((0, credentials_1.getAgentConnectionSelection)() !== null
|
|
319
|
+
? 'An app could not be downloaded.'
|
|
320
|
+
: `Failed to download app ${appRef}: ${outcome.message}`));
|
|
305
321
|
}
|
|
306
322
|
}
|
|
307
323
|
onProgress?.(successCount +
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ApiGetAsyncQueryResults, ResultRow } from '@lightdash/common';
|
|
2
|
+
export declare const validateConnectionQueryUuid: (value: string) => string;
|
|
2
3
|
export declare function pollForResults(projectUuid: string, queryUuid: string, options?: {
|
|
3
4
|
pageSize?: number;
|
|
4
5
|
backoffMs?: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"asyncQuery.d.ts","sourceRoot":"","sources":["../../src/handlers/asyncQuery.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,uBAAuB,EAEvB,SAAS,EACZ,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"asyncQuery.d.ts","sourceRoot":"","sources":["../../src/handlers/asyncQuery.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,uBAAuB,EAEvB,SAAS,EACZ,MAAM,mBAAmB,CAAC;AAe3B,eAAO,MAAM,2BAA2B,UAAW,MAAM,KAAG,MAI3D,CAAC;AAEF,wBAAsB,cAAc,CAChC,WAAW,EAAE,MAAM,EACnB,SAAS,EAAE,MAAM,EACjB,OAAO,GAAE;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAO,GACxD,OAAO,CAAC,uBAAuB,CAAC,CA+BlC;AAED,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,MAAM,CAkBzE"}
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.validateConnectionQueryUuid = void 0;
|
|
3
4
|
exports.pollForResults = pollForResults;
|
|
4
5
|
exports.resultsToCsv = resultsToCsv;
|
|
5
6
|
const tslib_1 = require("tslib");
|
|
6
7
|
const common_1 = require("@lightdash/common");
|
|
8
|
+
const uuid_1 = require("uuid");
|
|
9
|
+
const credentials_1 = require("../credentials");
|
|
7
10
|
const globalState_1 = tslib_1.__importDefault(require("../globalState"));
|
|
8
11
|
const apiClient_1 = require("./dbt/apiClient");
|
|
9
12
|
const INITIAL_BACKOFF_MS = 250;
|
|
@@ -13,6 +16,12 @@ function sleep(ms) {
|
|
|
13
16
|
setTimeout(resolve, ms);
|
|
14
17
|
});
|
|
15
18
|
}
|
|
19
|
+
const validateConnectionQueryUuid = (value) => {
|
|
20
|
+
if ((0, credentials_1.getAgentConnectionSelection)() !== null && !(0, uuid_1.validate)(value))
|
|
21
|
+
throw new Error('The server returned an invalid query identifier.');
|
|
22
|
+
return value;
|
|
23
|
+
};
|
|
24
|
+
exports.validateConnectionQueryUuid = validateConnectionQueryUuid;
|
|
16
25
|
async function pollForResults(projectUuid, queryUuid, options = {}) {
|
|
17
26
|
const { pageSize, backoffMs = INITIAL_BACKOFF_MS } = options;
|
|
18
27
|
const pageSizeParam = pageSize ? `?pageSize=${pageSize}` : '';
|
|
@@ -21,6 +30,12 @@ async function pollForResults(projectUuid, queryUuid, options = {}) {
|
|
|
21
30
|
url: `/api/v2/projects/${projectUuid}/query/${queryUuid}${pageSizeParam}`,
|
|
22
31
|
body: undefined,
|
|
23
32
|
});
|
|
33
|
+
if ((0, credentials_1.getAgentConnectionSelection)() !== null) {
|
|
34
|
+
if (!Object.values(common_1.QueryHistoryStatus).includes(result.status))
|
|
35
|
+
throw new Error('The server returned an invalid query status.');
|
|
36
|
+
if (result.status === common_1.QueryHistoryStatus.ERROR)
|
|
37
|
+
throw new Error('Query execution failed.');
|
|
38
|
+
}
|
|
24
39
|
globalState_1.default.debug(`> Query status: ${result.status}`);
|
|
25
40
|
if (result.status === common_1.QueryHistoryStatus.PENDING ||
|
|
26
41
|
result.status === common_1.QueryHistoryStatus.QUEUED ||
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compile.d.ts","sourceRoot":"","sources":["../../src/handlers/compile.ts"],"names":[],"mappings":"AAAA,OAAO,EAOH,OAAO,EACP,YAAY,EAgBf,MAAM,mBAAmB,CAAC;AAsB3B,OAAO,EAAE,iBAAiB,EAA8B,MAAM,eAAe,CAAC;AAI9E,MAAM,MAAM,qBAAqB,GAAG,iBAAiB,GAA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,GAAG,SAAS,CAAC;IAC3B,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;IACzB,OAAO,EAAE,OAAO,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,0BAA0B,CAAC,EAAE,OAAO,CAAC;IACrC,wBAAwB,CAAC,EAAE,OAAO,CAAC;IACnC,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,0BAA0B,CAAC,EAAE,MAAM,CAAC;IACpC,OAAO,CAAC,EAAE,OAAO,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG;IAC/B,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IACzB,QAAQ,EAAE,CAAC,OAAO,GAAG,YAAY,CAAC,EAAE,CAAC;IACrC,iBAAiB,EAAE,OAAO,CAAC;CAC9B,CAAC;AAEF,eAAO,MAAM,uBAAuB,YACvB,OAAO,GAAG,YAAY,KAChC,OAIW,CAAC;AAEf,eAAO,MAAM,0BAA0B,YAC1B,OAAO,GAAG,YAAY,KAChC,OAAO,GAAG,YAiBZ,CAAC;AAgTF,eAAO,MAAM,cAAc,YACd,qBAAqB,KAC/B,OAAO,CAAC,oBAAoB,CAic9B,CAAC;AAEF,eAAO,MAAM,OAAO,YACP,qBAAqB,KAC/B,OAAO,CAAC,CAAC,OAAO,GAAG,YAAY,CAAC,EAAE,CACO,CAAC;AAE7C,eAAO,MAAM,cAAc,oBACN,qBAAqB,kBAmCzC,CAAC"}
|
package/dist/handlers/compile.js
CHANGED
|
@@ -286,7 +286,9 @@ const compileProject = async (options) => {
|
|
|
286
286
|
url: manifestEndpoint,
|
|
287
287
|
body: undefined,
|
|
288
288
|
});
|
|
289
|
-
const servedManifest = await
|
|
289
|
+
const servedManifest = await ((0, credentials_1.getAgentConnectionSelection)() === null
|
|
290
|
+
? response.json()
|
|
291
|
+
: (0, apiClient_1.readRawApiJson)(response));
|
|
290
292
|
if (!isServedDbtManifest(servedManifest)) {
|
|
291
293
|
throw new Error(`${manifestEndpoint} returned an invalid manifest: expected an object with metadata and a nodes record`);
|
|
292
294
|
}
|
|
@@ -13,6 +13,7 @@ type LightdashRawApiProps = LightdashApiProps & {
|
|
|
13
13
|
};
|
|
14
14
|
export declare const setGzipEnabled: (enabled: boolean) => void;
|
|
15
15
|
export declare const lightdashRawApi: ({ method, url, body, headers: requestHeaders, signal, safeToRetry, lifecycle, }: LightdashRawApiProps) => Promise<Response>;
|
|
16
|
+
export declare const readRawApiJson: (response: Response) => Promise<unknown>;
|
|
16
17
|
export declare const lightdashApi: <T extends ApiResponse['results']>({ method, url, body, signal, safeToRetry, }: LightdashApiProps) => Promise<T>;
|
|
17
18
|
export declare const getUserContext: () => Promise<LightdashUserWithAbilityRules>;
|
|
18
19
|
export type ContentAsCodeUploadPermissions = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apiClient.d.ts","sourceRoot":"","sources":["../../../src/handlers/dbt/apiClient.ts"],"names":[],"mappings":"AACA,OAAO,EAGH,WAAW,EAIX,WAAW,EAEX,KAAK,6BAA6B,EAGrC,MAAM,mBAAmB,CAAC;AAC3B,OAAc,EAAE,QAAQ,EAAE,KAAK,QAAQ,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"apiClient.d.ts","sourceRoot":"","sources":["../../../src/handlers/dbt/apiClient.ts"],"names":[],"mappings":"AACA,OAAO,EAGH,WAAW,EAIX,WAAW,EAEX,KAAK,6BAA6B,EAGrC,MAAM,mBAAmB,CAAC;AAC3B,OAAc,EAAE,QAAQ,EAAE,KAAK,QAAQ,EAAE,MAAM,YAAY,CAAC;AAkB5D,KAAK,iBAAiB,GAAG;IACrB,MAAM,EAAE,KAAK,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,KAAK,CAAC;IACpD,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI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C"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.checkLightdashVersion = exports.checkProjectCreationPermission = exports.getContentAsCodeUploadPermissions = exports.getUserContext = exports.lightdashApi = exports.lightdashRawApi = exports.setGzipEnabled = void 0;
|
|
3
|
+
exports.checkLightdashVersion = exports.checkProjectCreationPermission = exports.getContentAsCodeUploadPermissions = exports.getUserContext = exports.lightdashApi = exports.readRawApiJson = exports.lightdashRawApi = exports.setGzipEnabled = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const ability_1 = require("@casl/ability");
|
|
6
6
|
const common_1 = require("@lightdash/common");
|
|
@@ -8,6 +8,7 @@ const node_fetch_1 = tslib_1.__importDefault(require("node-fetch"));
|
|
|
8
8
|
const stream_1 = require("stream");
|
|
9
9
|
const url_1 = require("url");
|
|
10
10
|
const zlib_1 = require("zlib");
|
|
11
|
+
const serverError_1 = require("../../agentConnections/serverError");
|
|
11
12
|
const config_1 = require("../../config");
|
|
12
13
|
const credentials_1 = require("../../credentials");
|
|
13
14
|
const env_1 = require("../../env");
|
|
@@ -58,6 +59,7 @@ const fetchWithTimeout = async (fullUrl, init) => {
|
|
|
58
59
|
clearTimeout(timer);
|
|
59
60
|
}
|
|
60
61
|
};
|
|
62
|
+
const connectionResponses = new WeakSet();
|
|
61
63
|
const lightdashRawApi = async ({ method, url, body, headers: requestHeaders = {}, signal, safeToRetry = false, lifecycle, }) => {
|
|
62
64
|
const config = await ((0, credentials_1.getAgentConnectionSelection)() === null
|
|
63
65
|
? (0, config_1.getConfig)()
|
|
@@ -162,7 +164,8 @@ const lightdashRawApi = async ({ method, url, body, headers: requestHeaders = {}
|
|
|
162
164
|
if (response.status === 401)
|
|
163
165
|
throw new Error(`Agent connection ${(0, credentials_1.getAgentConnectionSelection)()} could not authenticate. No personal credential was used.`);
|
|
164
166
|
if (!response.ok)
|
|
165
|
-
throw
|
|
167
|
+
throw (0, serverError_1.connectionServerError)(response.status, await response.json().catch(() => null));
|
|
168
|
+
connectionResponses.add(response);
|
|
166
169
|
return response;
|
|
167
170
|
}
|
|
168
171
|
if (!(config.context?.apiKey && config.context.serverUrl)) {
|
|
@@ -193,27 +196,59 @@ const lightdashRawApi = async ({ method, url, body, headers: requestHeaders = {}
|
|
|
193
196
|
return response;
|
|
194
197
|
};
|
|
195
198
|
exports.lightdashRawApi = lightdashRawApi;
|
|
196
|
-
async
|
|
197
|
-
|
|
198
|
-
.
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
199
|
+
const readRawApiJson = async (response) => {
|
|
200
|
+
const connection = connectionResponses.has(response) ||
|
|
201
|
+
(0, credentials_1.getAgentConnectionSelection)() !== null;
|
|
202
|
+
try {
|
|
203
|
+
const value = await response.json();
|
|
204
|
+
if (connection &&
|
|
205
|
+
typeof value === 'object' &&
|
|
206
|
+
value !== null &&
|
|
207
|
+
'status' in value &&
|
|
208
|
+
value.status === 'error')
|
|
209
|
+
throw (0, serverError_1.connectionServerError)(response.status, value);
|
|
210
|
+
return value;
|
|
211
|
+
}
|
|
212
|
+
catch (error) {
|
|
213
|
+
if (connection) {
|
|
214
|
+
if (error instanceof serverError_1.ConnectionServerError)
|
|
215
|
+
throw error;
|
|
216
|
+
throw (0, serverError_1.connectionServerError)(response.status, null);
|
|
208
217
|
}
|
|
209
|
-
|
|
210
|
-
}
|
|
218
|
+
throw error;
|
|
219
|
+
}
|
|
220
|
+
};
|
|
221
|
+
exports.readRawApiJson = readRawApiJson;
|
|
222
|
+
const readApiResults = async (response) => {
|
|
223
|
+
const connection = (0, credentials_1.getAgentConnectionSelection)() !== null;
|
|
224
|
+
let data;
|
|
225
|
+
try {
|
|
226
|
+
data = await response.json();
|
|
227
|
+
}
|
|
228
|
+
catch (error) {
|
|
229
|
+
if (connection)
|
|
230
|
+
throw (0, serverError_1.connectionServerError)(response.status, null);
|
|
231
|
+
throw error;
|
|
232
|
+
}
|
|
233
|
+
if (connection &&
|
|
234
|
+
(typeof data !== 'object' || data === null || data.status !== 'ok'))
|
|
235
|
+
throw (0, serverError_1.connectionServerError)(response.status, data);
|
|
236
|
+
globalState_1.default.debug(`> HTTP request returned status: ${data.status}`);
|
|
237
|
+
switch (data.status) {
|
|
238
|
+
case 'ok':
|
|
239
|
+
return data.results;
|
|
240
|
+
case 'error':
|
|
241
|
+
throw new common_1.LightdashError(data.error);
|
|
242
|
+
default:
|
|
243
|
+
throw new Error(data);
|
|
244
|
+
}
|
|
245
|
+
};
|
|
211
246
|
const lightdashApi = async ({ method, url, body, signal, safeToRetry, }) => {
|
|
212
247
|
if ((0, credentials_1.getAgentConnectionSelection)() !== null &&
|
|
213
248
|
safeToRetry &&
|
|
214
249
|
method === 'GET' &&
|
|
215
250
|
body === undefined) {
|
|
216
|
-
return
|
|
251
|
+
return readApiResults(await (0, exports.lightdashRawApi)({ method, url, body, signal, safeToRetry }));
|
|
217
252
|
}
|
|
218
253
|
const headers = {};
|
|
219
254
|
let requestBody = body;
|
|
@@ -232,6 +267,14 @@ const lightdashApi = async ({ method, url, body, signal, safeToRetry, }) => {
|
|
|
232
267
|
globalState_1.default.debug(`> Gzip compression failed, sending uncompressed: ${err}`);
|
|
233
268
|
}
|
|
234
269
|
}
|
|
270
|
+
if ((0, credentials_1.getAgentConnectionSelection)() !== null)
|
|
271
|
+
return readApiResults(await (0, exports.lightdashRawApi)({
|
|
272
|
+
method,
|
|
273
|
+
url,
|
|
274
|
+
body: requestBody,
|
|
275
|
+
headers,
|
|
276
|
+
signal,
|
|
277
|
+
}));
|
|
235
278
|
return (0, exports.lightdashRawApi)({
|
|
236
279
|
method,
|
|
237
280
|
url,
|
|
@@ -415,9 +458,17 @@ const checkLightdashVersion = async () => {
|
|
|
415
458
|
body: undefined,
|
|
416
459
|
safeToRetry: true,
|
|
417
460
|
});
|
|
461
|
+
if ((0, credentials_1.getAgentConnectionSelection)() !== null &&
|
|
462
|
+
(typeof health?.version !== 'string' ||
|
|
463
|
+
!/^\d+\.\d+\.\d+(?:-[a-z0-9.-]+)?(?:\+[a-z0-9.-]+)?$/i.test(health.version)))
|
|
464
|
+
throw new Error('The server returned invalid version data.');
|
|
418
465
|
const cliMajor = env_1.CLI_VERSION.split('.')[0];
|
|
419
466
|
const serverMajor = health.version.split('.')[0];
|
|
420
467
|
if (cliMajor !== serverMajor) {
|
|
468
|
+
if ((0, credentials_1.getAgentConnectionSelection)() !== null) {
|
|
469
|
+
console.error('The CLI and server use different major versions. Use a CLI version that matches your server.');
|
|
470
|
+
return;
|
|
471
|
+
}
|
|
421
472
|
const config = await ((0, credentials_1.getAgentConnectionSelection)() === null
|
|
422
473
|
? (0, config_1.getConfig)()
|
|
423
474
|
: (0, config_1.getConfig)({ readOnly: true }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deploy.d.ts","sourceRoot":"","sources":["../../src/handlers/deploy.ts"],"names":[],"mappings":"AAAA,OAAO,EAIH,OAAO,EACP,YAAY,EASZ,KAAK,eAAe,EACpB,KAAK,YAAY,EAGpB,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"deploy.d.ts","sourceRoot":"","sources":["../../src/handlers/deploy.ts"],"names":[],"mappings":"AAAA,OAAO,EAIH,OAAO,EACP,YAAY,EASZ,KAAK,eAAe,EACpB,KAAK,YAAY,EAGpB,MAAM,mBAAmB,CAAC;AAoB3B,OAAO,EAAE,cAAc,EAAqB,MAAM,0BAA0B,CAAC;AAgB7E,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAUlD,KAAK,oBAAoB,GAAG,iBAAiB,GAAG;IAC5C,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,OAAO,EAAE,MAAM,GAAG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ist/handlers/deploy.js
CHANGED
|
@@ -8,6 +8,7 @@ const path_1 = tslib_1.__importDefault(require("path"));
|
|
|
8
8
|
const url_1 = require("url");
|
|
9
9
|
const uuid_1 = require("uuid");
|
|
10
10
|
const commandPolicy_1 = require("../agentConnections/commandPolicy");
|
|
11
|
+
const responseValidation_1 = require("../agentConnections/responseValidation");
|
|
11
12
|
const analytics_1 = require("../analytics/analytics");
|
|
12
13
|
const config_1 = require("../config");
|
|
13
14
|
const credentials_1 = require("../credentials");
|
|
@@ -78,6 +79,10 @@ const logDeployWarnings = (warningResults) => {
|
|
|
78
79
|
!warningResults.exploresWithWarnings?.length) {
|
|
79
80
|
return;
|
|
80
81
|
}
|
|
82
|
+
if ((0, credentials_1.getAgentConnectionSelection)() !== null) {
|
|
83
|
+
console.error('The server reported compilation warnings. Review the project in the app.');
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
81
86
|
console.error(styles.warning(`\nCompilation warnings (${warningResults.warningCount})`));
|
|
82
87
|
warningResults.exploresWithWarnings.forEach((explore) => {
|
|
83
88
|
explore.warnings.forEach((warning) => {
|
|
@@ -183,6 +188,8 @@ const deployBatched = async (explores, options) => {
|
|
|
183
188
|
url: `/api/v2/projects/${options.projectUuid}/deploy`,
|
|
184
189
|
body: JSON.stringify({}),
|
|
185
190
|
}));
|
|
191
|
+
(0, responseValidation_1.assertConnectionResponse)(typeof startSessionResponse?.deploySessionUuid === 'string' &&
|
|
192
|
+
(0, uuid_1.validate)(startSessionResponse.deploySessionUuid));
|
|
186
193
|
sessionUuid = startSessionResponse.deploySessionUuid;
|
|
187
194
|
}
|
|
188
195
|
catch (error) {
|
|
@@ -215,6 +222,8 @@ const deployBatched = async (explores, options) => {
|
|
|
215
222
|
complete: options.complete === true,
|
|
216
223
|
}),
|
|
217
224
|
}), batchIndex + 1);
|
|
225
|
+
(0, responseValidation_1.assertConnectionResponse)((0, responseValidation_1.isResponseCount)(response?.exploreCount) &&
|
|
226
|
+
(0, responseValidation_1.isResponseCount)(response?.batchNumber));
|
|
218
227
|
globalState_1.default.log(styles.success(` ✓ Batch ${batchIndex + 1} uploaded (${response.exploreCount} explores)`));
|
|
219
228
|
return response;
|
|
220
229
|
};
|
|
@@ -245,6 +254,7 @@ const deployBatched = async (explores, options) => {
|
|
|
245
254
|
target: options.deployTarget,
|
|
246
255
|
}),
|
|
247
256
|
});
|
|
257
|
+
(0, responseValidation_1.assertConnectionResponse)((0, responseValidation_1.isResponseCount)(finalizeResponse?.exploreCount));
|
|
248
258
|
globalState_1.default.log(styles.success(`Deploy completed! ${finalizeResponse.exploreCount} explores deployed.`));
|
|
249
259
|
logDeployWarnings(finalizeResponse.warnings);
|
|
250
260
|
await analytics_1.LightdashAnalytics.track({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"download.d.ts","sourceRoot":"","sources":["../../src/handlers/download.ts"],"names":[],"mappings":"AAEA,OAAO,EACH,WAAW,EA4BX,WAAW,EAIX,eAAe,EAKf,wBAAwB,EAoBxB,KAAK,WAAW,EACnB,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"download.d.ts","sourceRoot":"","sources":["../../src/handlers/download.ts"],"names":[],"mappings":"AAEA,OAAO,EACH,WAAW,EA4BX,WAAW,EAIX,eAAe,EAKf,wBAAwB,EAoBxB,KAAK,WAAW,EACnB,MAAM,mBAAmB,CAAC;AA2B3B,OAAO,EAIH,KAAK,0BAA0B,EAClC,MAAM,iCAAiC,CAAC;AAuEzC,OAAO,EACH,sBAAsB,EAGtB,cAAc,EACd,qBAAqB,EAKrB,cAAc,EACd,cAAc,EACd,8BAA8B,EAC9B,yBAAyB,EACzB,YAAY,EACZ,qBAAqB,EACrB,eAAe,EAElB,MAAM,gBAAgB,CAAC;AAExB,MAAM,MAAM,sBAAsB,GAAG;IACjC,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,MAAM,EA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