@budibase/server 2.3.18-alpha.12 → 2.3.18-alpha.13

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.
@@ -10,8 +10,8 @@
10
10
  href="https://fonts.googleapis.com/css2?family=Source+Sans+Pro:wght@400;600;700&display=swap"
11
11
  rel="stylesheet"
12
12
  />
13
- <script type="module" crossorigin src="/builder/assets/index.55fe0543.js"></script>
14
- <link rel="stylesheet" href="/builder/assets/index.22724f34.css">
13
+ <script type="module" crossorigin src="/builder/assets/index.5db9630c.js"></script>
14
+ <link rel="stylesheet" href="/builder/assets/index.d4b6aa43.css">
15
15
  </head>
16
16
  <body id="app">
17
17
 
@@ -71,7 +71,7 @@ function exportApps(ctx) {
71
71
  exports.exportApps = exportApps;
72
72
  function checkHasBeenImported() {
73
73
  return __awaiter(this, void 0, void 0, function* () {
74
- if (!environment_1.default.SELF_HOSTED || environment_1.default.MULTI_TENANCY) {
74
+ if (!environment_1.default.SELF_HOSTED) {
75
75
  return true;
76
76
  }
77
77
  const apps = yield backend_core_1.db.getAllApps({ all: true });
@@ -88,7 +88,7 @@ function hasBeenImported(ctx) {
88
88
  exports.hasBeenImported = hasBeenImported;
89
89
  function importApps(ctx) {
90
90
  return __awaiter(this, void 0, void 0, function* () {
91
- if (!environment_1.default.SELF_HOSTED || environment_1.default.MULTI_TENANCY) {
91
+ if (!environment_1.default.SELF_HOSTED) {
92
92
  ctx.throw(400, "Importing only allowed in self hosted environments.");
93
93
  }
94
94
  const beenImported = yield checkHasBeenImported();
@@ -8,16 +8,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  step((generator = generator.apply(thisArg, _arguments || [])).next());
9
9
  });
10
10
  };
11
- var __importDefault = (this && this.__importDefault) || function (mod) {
12
- return (mod && mod.__esModule) ? mod : { "default": mod };
13
- };
14
11
  Object.defineProperty(exports, "__esModule", { value: true });
15
12
  const types_1 = require("@budibase/types");
16
13
  const google_auth_library_1 = require("google-auth-library");
17
14
  const utils_1 = require("./utils");
18
15
  const constants_1 = require("../constants");
19
16
  const google_spreadsheet_1 = require("google-spreadsheet");
20
- const environment_1 = __importDefault(require("../environment"));
21
17
  const backend_core_1 = require("@budibase/backend-core");
22
18
  const fetch = require("node-fetch");
23
19
  const SCHEMA = {
@@ -138,15 +134,9 @@ class GoogleSheetsIntegration {
138
134
  return __awaiter(this, void 0, void 0, function* () {
139
135
  try {
140
136
  // Initialise oAuth client
141
- const db = backend_core_1.tenancy.getGlobalDB();
142
- let googleConfig = yield backend_core_1.db.getScopedConfig(db, {
143
- type: backend_core_1.constants.Config.GOOGLE,
144
- });
137
+ let googleConfig = yield backend_core_1.configs.getGoogleConfig();
145
138
  if (!googleConfig) {
146
- googleConfig = {
147
- clientID: environment_1.default.GOOGLE_CLIENT_ID,
148
- clientSecret: environment_1.default.GOOGLE_CLIENT_SECRET,
149
- };
139
+ throw new backend_core_1.HTTPError("Google config not found", 400);
150
140
  }
151
141
  const oauthClient = new google_auth_library_1.OAuth2Client({
152
142
  clientId: googleConfig.clientID,
@@ -12,14 +12,20 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
12
12
  return (mod && mod.__esModule) ? mod : { "default": mod };
13
13
  };
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.backfill = void 0;
15
+ exports.backfill = exports.getConfigParams = void 0;
16
16
  const backend_core_1 = require("@budibase/backend-core");
17
17
  const types_1 = require("@budibase/types");
18
18
  const environment_1 = __importDefault(require("./../../../../environment"));
19
- const getConfigs = (globalDb) => __awaiter(void 0, void 0, void 0, function* () {
20
- const response = yield globalDb.allDocs(backend_core_1.db.getConfigParams({}, {
19
+ const getConfigParams = () => {
20
+ return {
21
21
  include_docs: true,
22
- }));
22
+ startkey: `${backend_core_1.DocumentType.CONFIG}${backend_core_1.SEPARATOR}`,
23
+ endkey: `${backend_core_1.DocumentType.CONFIG}${backend_core_1.SEPARATOR}${backend_core_1.UNICODE_MAX}`,
24
+ };
25
+ };
26
+ exports.getConfigParams = getConfigParams;
27
+ const getConfigs = (globalDb) => __awaiter(void 0, void 0, void 0, function* () {
28
+ const response = yield globalDb.allDocs((0, exports.getConfigParams)());
23
29
  return response.rows.map((row) => row.doc);
24
30
  });
25
31
  const backfill = (globalDb, timestamp) => __awaiter(void 0, void 0, void 0, function* () {
@@ -57,7 +57,7 @@ const saveSmtpConfig = (globalDb) => __awaiter(void 0, void 0, void 0, function*
57
57
  });
58
58
  exports.saveSmtpConfig = saveSmtpConfig;
59
59
  const saveConfig = (config, globalDb) => __awaiter(void 0, void 0, void 0, function* () {
60
- config._id = backend_core_1.db.generateConfigID({ type: config.type });
60
+ config._id = backend_core_1.configs.generateConfigID(config.type);
61
61
  let response;
62
62
  try {
63
63
  response = yield globalDb.get(config._id);
@@ -8,7 +8,7 @@ const oidc = (conf) => {
8
8
  type: types_1.ConfigType.OIDC,
9
9
  config: {
10
10
  configs: [
11
- Object.assign({ configUrl: "http://someconfigurl", clientID: "clientId", clientSecret: "clientSecret", logo: "Microsoft", name: "Active Directory", uuid: backend_core_1.utils.newid(), activated: true }, conf),
11
+ Object.assign({ configUrl: "http://someconfigurl", clientID: "clientId", clientSecret: "clientSecret", logo: "Microsoft", name: "Active Directory", uuid: backend_core_1.utils.newid(), activated: true, scopes: [] }, conf),
12
12
  ],
13
13
  },
14
14
  };
package/dist/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@budibase/server",
3
3
  "email": "hi@budibase.com",
4
- "version": "2.3.18-alpha.11",
4
+ "version": "2.3.18-alpha.12",
5
5
  "description": "Budibase Web Server",
6
6
  "main": "src/index.ts",
7
7
  "repository": {
@@ -43,11 +43,11 @@
43
43
  "license": "GPL-3.0",
44
44
  "dependencies": {
45
45
  "@apidevtools/swagger-parser": "10.0.3",
46
- "@budibase/backend-core": "2.3.18-alpha.11",
47
- "@budibase/client": "2.3.18-alpha.11",
48
- "@budibase/pro": "2.3.18-alpha.10",
49
- "@budibase/string-templates": "2.3.18-alpha.11",
50
- "@budibase/types": "2.3.18-alpha.11",
46
+ "@budibase/backend-core": "2.3.18-alpha.12",
47
+ "@budibase/client": "2.3.18-alpha.12",
48
+ "@budibase/pro": "2.3.18-alpha.12",
49
+ "@budibase/string-templates": "2.3.18-alpha.12",
50
+ "@budibase/types": "2.3.18-alpha.12",
51
51
  "@bull-board/api": "3.7.0",
52
52
  "@bull-board/koa": "3.9.4",
53
53
  "@elastic/elasticsearch": "7.10.0",