@budibase/server 2.7.0 → 2.7.1-alpha.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/builder/assets/{index.4ca5529d.js → index.933787a7.js} +326 -326
- package/builder/assets/{index.a86e2071.css → index.b33e8ad5.css} +1 -1
- package/builder/index.html +2 -2
- package/dist/automation.js +45 -34
- package/dist/automation.js.map +3 -3
- package/dist/index.js +49 -34
- package/dist/index.js.map +3 -3
- package/dist/query.js +22 -19
- package/dist/query.js.map +3 -3
- package/package.json +8 -8
- package/src/api/controllers/datasource.ts +13 -1
- package/src/integrations/googlesheets.ts +18 -2
package/dist/query.js
CHANGED
|
@@ -11478,8 +11478,8 @@ async function preAuth(passport2, ctx, next) {
|
|
|
11478
11478
|
callbackUrl,
|
|
11479
11479
|
ssoSaveUserNoOp
|
|
11480
11480
|
);
|
|
11481
|
-
if (!ctx.query.appId
|
|
11482
|
-
ctx.throw(400, "appId
|
|
11481
|
+
if (!ctx.query.appId) {
|
|
11482
|
+
ctx.throw(400, "appId query param not present.");
|
|
11483
11483
|
}
|
|
11484
11484
|
return passport2.authenticate(strategy, {
|
|
11485
11485
|
scope: ["profile", "email", "https://www.googleapis.com/auth/spreadsheets"],
|
|
@@ -11499,7 +11499,7 @@ async function postAuth(passport2, ctx, next) {
|
|
|
11499
11499
|
clientSecret: config.clientSecret,
|
|
11500
11500
|
callbackURL: callbackUrl
|
|
11501
11501
|
},
|
|
11502
|
-
(accessToken, refreshToken,
|
|
11502
|
+
(accessToken, refreshToken, _profile, done) => {
|
|
11503
11503
|
clearCookie(ctx, "budibase:datasourceauth" /* DatasourceAuth */);
|
|
11504
11504
|
done(null, { accessToken, refreshToken });
|
|
11505
11505
|
}
|
|
@@ -11507,22 +11507,14 @@ async function postAuth(passport2, ctx, next) {
|
|
|
11507
11507
|
{ successRedirect: "/", failureRedirect: "/error" },
|
|
11508
11508
|
async (err, tokens) => {
|
|
11509
11509
|
const baseUrl = `/builder/app/${authStateCookie.appId}/data`;
|
|
11510
|
-
|
|
11511
|
-
|
|
11512
|
-
|
|
11513
|
-
|
|
11514
|
-
|
|
11515
|
-
if (err2.status === 404) {
|
|
11516
|
-
ctx.redirect(baseUrl);
|
|
11517
|
-
}
|
|
11518
|
-
}
|
|
11519
|
-
if (!datasource2.config) {
|
|
11520
|
-
datasource2.config = {};
|
|
11510
|
+
const id = utils_exports2.newid();
|
|
11511
|
+
await cache_exports.store(
|
|
11512
|
+
`datasource:creation:${authStateCookie.appId}:google:${id}`,
|
|
11513
|
+
{
|
|
11514
|
+
tokens
|
|
11521
11515
|
}
|
|
11522
|
-
|
|
11523
|
-
|
|
11524
|
-
ctx.redirect(`${baseUrl}/datasource/${authStateCookie.datasourceId}`);
|
|
11525
|
-
});
|
|
11516
|
+
);
|
|
11517
|
+
ctx.redirect(`${baseUrl}/new?continue_google_setup=${id}`);
|
|
11526
11518
|
}
|
|
11527
11519
|
)(ctx, next);
|
|
11528
11520
|
}
|
|
@@ -17260,7 +17252,7 @@ var SCHEMA12 = {
|
|
|
17260
17252
|
},
|
|
17261
17253
|
datasource: {
|
|
17262
17254
|
spreadsheetId: {
|
|
17263
|
-
display: "
|
|
17255
|
+
display: "Spreadsheet URL",
|
|
17264
17256
|
type: "string" /* STRING */,
|
|
17265
17257
|
required: true
|
|
17266
17258
|
}
|
|
@@ -17330,6 +17322,7 @@ var GoogleSheetsIntegration = class {
|
|
|
17330
17322
|
}
|
|
17331
17323
|
async testConnection() {
|
|
17332
17324
|
try {
|
|
17325
|
+
await setupCreationAuth(this.config);
|
|
17333
17326
|
await this.connect();
|
|
17334
17327
|
return { connected: true };
|
|
17335
17328
|
} catch (e) {
|
|
@@ -17691,6 +17684,16 @@ var GoogleSheetsIntegration = class {
|
|
|
17691
17684
|
}
|
|
17692
17685
|
}
|
|
17693
17686
|
};
|
|
17687
|
+
async function setupCreationAuth(datasouce) {
|
|
17688
|
+
if (datasouce.continueSetupId) {
|
|
17689
|
+
const appId = context_exports.getAppId();
|
|
17690
|
+
const tokens = await cache_exports.get(
|
|
17691
|
+
`datasource:creation:${appId}:google:${datasouce.continueSetupId}`
|
|
17692
|
+
);
|
|
17693
|
+
datasouce.auth = tokens.tokens;
|
|
17694
|
+
delete datasouce.continueSetupId;
|
|
17695
|
+
}
|
|
17696
|
+
}
|
|
17694
17697
|
var googlesheets_default = {
|
|
17695
17698
|
schema: SCHEMA12,
|
|
17696
17699
|
integration: GoogleSheetsIntegration
|