@budibase/server 2.6.28-alpha.0 → 2.7.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.9465fac4.js → index.4ca5529d.js} +399 -399
- package/builder/assets/{index.b33e8ad5.css → index.a86e2071.css} +1 -1
- package/builder/index.html +2 -2
- package/dist/automation.js +34 -45
- package/dist/automation.js.map +3 -3
- package/dist/index.js +34 -49
- package/dist/index.js.map +3 -3
- package/dist/query.js +19 -22
- package/dist/query.js.map +3 -3
- package/package.json +8 -8
- package/src/api/controllers/datasource.ts +1 -13
- package/src/integrations/googlesheets.ts +2 -18
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 query
|
|
11481
|
+
if (!ctx.query.appId || !ctx.query.datasourceId) {
|
|
11482
|
+
ctx.throw(400, "appId and datasourceId query params 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,14 +11507,22 @@ 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
|
-
|
|
11510
|
+
await doWithDB(authStateCookie.appId, async (db) => {
|
|
11511
|
+
let datasource2;
|
|
11512
|
+
try {
|
|
11513
|
+
datasource2 = await db.get(authStateCookie.datasourceId);
|
|
11514
|
+
} catch (err2) {
|
|
11515
|
+
if (err2.status === 404) {
|
|
11516
|
+
ctx.redirect(baseUrl);
|
|
11517
|
+
}
|
|
11515
11518
|
}
|
|
11516
|
-
|
|
11517
|
-
|
|
11519
|
+
if (!datasource2.config) {
|
|
11520
|
+
datasource2.config = {};
|
|
11521
|
+
}
|
|
11522
|
+
datasource2.config.auth = { type: "google", ...tokens };
|
|
11523
|
+
await db.put(datasource2);
|
|
11524
|
+
ctx.redirect(`${baseUrl}/datasource/${authStateCookie.datasourceId}`);
|
|
11525
|
+
});
|
|
11518
11526
|
}
|
|
11519
11527
|
)(ctx, next);
|
|
11520
11528
|
}
|
|
@@ -17252,7 +17260,7 @@ var SCHEMA12 = {
|
|
|
17252
17260
|
},
|
|
17253
17261
|
datasource: {
|
|
17254
17262
|
spreadsheetId: {
|
|
17255
|
-
display: "
|
|
17263
|
+
display: "Google Sheet URL",
|
|
17256
17264
|
type: "string" /* STRING */,
|
|
17257
17265
|
required: true
|
|
17258
17266
|
}
|
|
@@ -17322,7 +17330,6 @@ var GoogleSheetsIntegration = class {
|
|
|
17322
17330
|
}
|
|
17323
17331
|
async testConnection() {
|
|
17324
17332
|
try {
|
|
17325
|
-
await setupCreationAuth(this.config);
|
|
17326
17333
|
await this.connect();
|
|
17327
17334
|
return { connected: true };
|
|
17328
17335
|
} catch (e) {
|
|
@@ -17684,16 +17691,6 @@ var GoogleSheetsIntegration = class {
|
|
|
17684
17691
|
}
|
|
17685
17692
|
}
|
|
17686
17693
|
};
|
|
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
|
-
}
|
|
17697
17694
|
var googlesheets_default = {
|
|
17698
17695
|
schema: SCHEMA12,
|
|
17699
17696
|
integration: GoogleSheetsIntegration
|