@budibase/server 2.4.27-alpha.8 → 2.4.27-alpha.9
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.de2f79b4.css → index.5bc70767.css} +1 -1
- package/builder/assets/{index.7f87e580.js → index.ae03d7b1.js} +370 -370
- package/builder/index.html +7 -7
- package/dist/api/controllers/static/index.js +84 -24
- package/dist/api/controllers/static/templates/BudibaseApp.svelte +33 -10
- package/dist/package.json +7 -7
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +8 -8
- package/src/api/controllers/static/index.ts +69 -26
- package/src/api/controllers/static/templates/BudibaseApp.svelte +33 -10
- package/builder/assets/favicon.e7fc7733.png +0 -0
package/builder/index.html
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
<!doctype html>
|
|
2
2
|
<html class="spectrum spectrum--medium spectrum--darkest" lang="en" dir="ltr">
|
|
3
|
+
|
|
3
4
|
<head>
|
|
4
5
|
<meta charset='utf8'>
|
|
5
6
|
<meta name='viewport' content='width=device-width'>
|
|
6
7
|
<title>Budibase</title>
|
|
7
|
-
<link rel='icon' href='/builder/assets/favicon.e7fc7733.png'>
|
|
8
8
|
<link rel="preconnect" href="https://fonts.gstatic.com" />
|
|
9
|
-
<link
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
<script type="module" crossorigin src="/builder/assets/index.7f87e580.js"></script>
|
|
14
|
-
<link rel="stylesheet" href="/builder/assets/index.de2f79b4.css">
|
|
9
|
+
<link href="https://fonts.googleapis.com/css2?family=Source+Sans+Pro:wght@400;600;700&display=swap"
|
|
10
|
+
rel="stylesheet" />
|
|
11
|
+
<script type="module" crossorigin src="/builder/assets/index.ae03d7b1.js"></script>
|
|
12
|
+
<link rel="stylesheet" href="/builder/assets/index.5bc70767.css">
|
|
15
13
|
</head>
|
|
14
|
+
|
|
16
15
|
<body id="app">
|
|
17
16
|
|
|
18
17
|
</body>
|
|
18
|
+
|
|
19
19
|
</html>
|
|
@@ -1,4 +1,27 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
2
25
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
26
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
27
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -25,6 +48,7 @@ const backend_core_1 = require("@budibase/backend-core");
|
|
|
25
48
|
const aws_sdk_1 = __importDefault(require("aws-sdk"));
|
|
26
49
|
const fs_1 = __importDefault(require("fs"));
|
|
27
50
|
const sdk_1 = __importDefault(require("../../../sdk"));
|
|
51
|
+
const pro = __importStar(require("@budibase/pro"));
|
|
28
52
|
const send = require("koa-send");
|
|
29
53
|
function prepareUpload({ s3Key, bucket, metadata, file }) {
|
|
30
54
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -102,31 +126,67 @@ const deleteObjects = function (ctx) {
|
|
|
102
126
|
exports.deleteObjects = deleteObjects;
|
|
103
127
|
const serveApp = function (ctx) {
|
|
104
128
|
return __awaiter(this, void 0, void 0, function* () {
|
|
105
|
-
|
|
106
|
-
const
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
const
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
129
|
+
//Public Settings
|
|
130
|
+
const { config } = yield backend_core_1.configs.getSettingsConfigDoc();
|
|
131
|
+
const branding = yield pro.branding.getBrandingConfig(config);
|
|
132
|
+
let db;
|
|
133
|
+
try {
|
|
134
|
+
db = backend_core_1.context.getAppDB({ skip_setup: true });
|
|
135
|
+
const appInfo = yield db.get(utils_1.DocumentType.APP_METADATA);
|
|
136
|
+
let appId = backend_core_1.context.getAppId();
|
|
137
|
+
if (!environment_1.default.isJest()) {
|
|
138
|
+
const App = require("./templates/BudibaseApp.svelte").default;
|
|
139
|
+
const plugins = backend_core_1.objectStore.enrichPluginURLs(appInfo.usedPlugins);
|
|
140
|
+
const { head, html, css } = App.render({
|
|
141
|
+
metaImage: (branding === null || branding === void 0 ? void 0 : branding.metaImageUrl) ||
|
|
142
|
+
"https://res.cloudinary.com/daog6scxm/image/upload/v1666109324/meta-images/budibase-meta-image_uukc1m.png",
|
|
143
|
+
metaDescription: (branding === null || branding === void 0 ? void 0 : branding.metaDescription) || "",
|
|
144
|
+
metaTitle: (branding === null || branding === void 0 ? void 0 : branding.metaTitle) || `${appInfo.name} - built with Budibase`,
|
|
145
|
+
title: appInfo.name,
|
|
146
|
+
production: environment_1.default.isProd(),
|
|
147
|
+
appId,
|
|
148
|
+
clientLibPath: backend_core_1.objectStore.clientLibraryUrl(appId, appInfo.version),
|
|
149
|
+
usedPlugins: plugins,
|
|
150
|
+
favicon: branding.faviconUrl !== ""
|
|
151
|
+
? backend_core_1.objectStore.getGlobalFileUrl("settings", "faviconUrl")
|
|
152
|
+
: "",
|
|
153
|
+
logo: (config === null || config === void 0 ? void 0 : config.logoUrl) !== ""
|
|
154
|
+
? backend_core_1.objectStore.getGlobalFileUrl("settings", "logoUrl")
|
|
155
|
+
: "",
|
|
156
|
+
});
|
|
157
|
+
const appHbs = (0, fileSystem_1.loadHandlebarsFile)(`${__dirname}/templates/app.hbs`);
|
|
158
|
+
ctx.body = yield (0, string_templates_1.processString)(appHbs, {
|
|
159
|
+
head,
|
|
160
|
+
body: html,
|
|
161
|
+
style: css.code,
|
|
162
|
+
appId,
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
else {
|
|
166
|
+
// just return the app info for jest to assert on
|
|
167
|
+
ctx.body = appInfo;
|
|
168
|
+
}
|
|
126
169
|
}
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
170
|
+
catch (error) {
|
|
171
|
+
if (!environment_1.default.isJest()) {
|
|
172
|
+
const App = require("./templates/BudibaseApp.svelte").default;
|
|
173
|
+
const { head, html, css } = App.render({
|
|
174
|
+
title: branding === null || branding === void 0 ? void 0 : branding.metaTitle,
|
|
175
|
+
metaTitle: branding === null || branding === void 0 ? void 0 : branding.metaTitle,
|
|
176
|
+
metaImage: (branding === null || branding === void 0 ? void 0 : branding.metaImageUrl) ||
|
|
177
|
+
"https://res.cloudinary.com/daog6scxm/image/upload/v1666109324/meta-images/budibase-meta-image_uukc1m.png",
|
|
178
|
+
metaDescription: (branding === null || branding === void 0 ? void 0 : branding.metaDescription) || "",
|
|
179
|
+
favicon: branding.faviconUrl !== ""
|
|
180
|
+
? backend_core_1.objectStore.getGlobalFileUrl("settings", "faviconUrl")
|
|
181
|
+
: "",
|
|
182
|
+
});
|
|
183
|
+
const appHbs = (0, fileSystem_1.loadHandlebarsFile)(`${__dirname}/templates/app.hbs`);
|
|
184
|
+
ctx.body = yield (0, string_templates_1.processString)(appHbs, {
|
|
185
|
+
head,
|
|
186
|
+
body: html,
|
|
187
|
+
style: css.code,
|
|
188
|
+
});
|
|
189
|
+
}
|
|
130
190
|
}
|
|
131
191
|
});
|
|
132
192
|
};
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
<script>
|
|
2
2
|
export let title = ""
|
|
3
3
|
export let favicon = ""
|
|
4
|
+
|
|
4
5
|
export let metaImage = ""
|
|
6
|
+
export let metaTitle = ""
|
|
7
|
+
export let metaDescription = ""
|
|
5
8
|
|
|
6
9
|
export let clientLibPath
|
|
7
10
|
export let usedPlugins
|
|
@@ -13,18 +16,33 @@
|
|
|
13
16
|
name="viewport"
|
|
14
17
|
content="width=device-width, initial-scale=1.0, viewport-fit=cover"
|
|
15
18
|
/>
|
|
19
|
+
|
|
20
|
+
<!-- Primary Meta Tags -->
|
|
21
|
+
<meta name="title" content={metaTitle} />
|
|
22
|
+
<meta name="description" content={metaDescription} />
|
|
23
|
+
|
|
16
24
|
<!-- Opengraph Meta Tags -->
|
|
17
|
-
<meta name="twitter:card" content="summary_large_image" />
|
|
18
|
-
<meta name="twitter:site" content="@budibase" />
|
|
19
|
-
<meta name="twitter:image" content={metaImage} />
|
|
20
|
-
<meta name="twitter:title" content="{title} - built with Budibase" />
|
|
21
25
|
<meta property="og:site_name" content="Budibase" />
|
|
22
26
|
<meta property="og:title" content="{title} - built with Budibase" />
|
|
27
|
+
<meta property="og:description" content={metaDescription} />
|
|
23
28
|
<meta property="og:type" content="website" />
|
|
24
29
|
<meta property="og:image" content={metaImage} />
|
|
25
30
|
|
|
31
|
+
<!-- Twitter -->
|
|
32
|
+
<meta property="twitter:card" content="summary_large_image" />
|
|
33
|
+
<meta property="twitter:site" content="@budibase" />
|
|
34
|
+
<meta property="twitter:image" content={metaImage} />
|
|
35
|
+
<meta property="twitter:image:alt" content="{title} - built with Budibase" />
|
|
36
|
+
<meta property="twitter:title" content="{title} - built with Budibase" />
|
|
37
|
+
<meta property="twitter:description" content={metaDescription} />
|
|
38
|
+
|
|
26
39
|
<title>{title}</title>
|
|
27
|
-
|
|
40
|
+
{#if favicon !== ""}
|
|
41
|
+
<link rel="icon" type="image/png" href={favicon} />
|
|
42
|
+
{:else}
|
|
43
|
+
<link rel="icon" type="image/png" href="https://i.imgur.com/Xhdt1YP.png" />
|
|
44
|
+
{/if}
|
|
45
|
+
|
|
28
46
|
<link rel="stylesheet" href="https://rsms.me/inter/inter.css" />
|
|
29
47
|
<link rel="preconnect" href="https://fonts.gstatic.com" />
|
|
30
48
|
<link
|
|
@@ -83,11 +101,16 @@
|
|
|
83
101
|
|
|
84
102
|
<body id="app">
|
|
85
103
|
<div id="error">
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
104
|
+
{#if clientLibPath}
|
|
105
|
+
<h1>There was an error loading your app</h1>
|
|
106
|
+
<h2>
|
|
107
|
+
The Budibase client library could not be loaded. Try republishing your
|
|
108
|
+
app.
|
|
109
|
+
</h2>
|
|
110
|
+
{:else}
|
|
111
|
+
<h2>We couldn't find that application</h2>
|
|
112
|
+
<p />
|
|
113
|
+
{/if}
|
|
91
114
|
</div>
|
|
92
115
|
<script type="application/javascript">
|
|
93
116
|
window.INIT_TIME = Date.now()
|
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.4.27-alpha.
|
|
4
|
+
"version": "2.4.27-alpha.8",
|
|
5
5
|
"description": "Budibase Web Server",
|
|
6
6
|
"main": "src/index.ts",
|
|
7
7
|
"repository": {
|
|
@@ -44,12 +44,12 @@
|
|
|
44
44
|
"license": "GPL-3.0",
|
|
45
45
|
"dependencies": {
|
|
46
46
|
"@apidevtools/swagger-parser": "10.0.3",
|
|
47
|
-
"@budibase/backend-core": "2.4.27-alpha.
|
|
48
|
-
"@budibase/client": "2.4.27-alpha.
|
|
49
|
-
"@budibase/pro": "2.4.27-alpha.
|
|
50
|
-
"@budibase/shared-core": "2.4.27-alpha.
|
|
51
|
-
"@budibase/string-templates": "2.4.27-alpha.
|
|
52
|
-
"@budibase/types": "2.4.27-alpha.
|
|
47
|
+
"@budibase/backend-core": "2.4.27-alpha.8",
|
|
48
|
+
"@budibase/client": "2.4.27-alpha.8",
|
|
49
|
+
"@budibase/pro": "2.4.27-alpha.8",
|
|
50
|
+
"@budibase/shared-core": "2.4.27-alpha.8",
|
|
51
|
+
"@budibase/string-templates": "2.4.27-alpha.8",
|
|
52
|
+
"@budibase/types": "2.4.27-alpha.8",
|
|
53
53
|
"@bull-board/api": "3.7.0",
|
|
54
54
|
"@bull-board/koa": "3.9.4",
|
|
55
55
|
"@elastic/elasticsearch": "7.10.0",
|