@budibase/backend-core 2.11.43 → 2.11.44
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/dist/index.js +372 -344
- package/dist/index.js.map +3 -3
- package/dist/index.js.meta.json +1 -1
- package/dist/package.json +4 -4
- package/dist/src/objectStore/buckets/app.d.ts +7 -10
- package/dist/src/objectStore/buckets/app.js +40 -27
- package/dist/src/objectStore/buckets/app.js.map +1 -1
- package/dist/src/objectStore/buckets/plugins.d.ts +4 -4
- package/dist/src/objectStore/buckets/plugins.js +19 -19
- package/dist/src/objectStore/buckets/plugins.js.map +1 -1
- package/dist/src/objectStore/objectStore.d.ts +19 -16
- package/dist/src/objectStore/objectStore.js +257 -218
- package/dist/src/objectStore/objectStore.js.map +1 -1
- package/package.json +4 -4
- package/src/objectStore/buckets/app.ts +36 -23
- package/src/objectStore/buckets/plugins.ts +8 -8
- package/src/objectStore/buckets/tests/app.spec.ts +16 -26
- package/src/objectStore/objectStore.ts +38 -24
package/dist/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@budibase/backend-core",
|
|
3
|
-
"version": "2.11.
|
|
3
|
+
"version": "2.11.44",
|
|
4
4
|
"description": "Budibase backend core libraries used in server and worker",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/src/index.d.ts",
|
|
@@ -23,8 +23,8 @@
|
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"@budibase/nano": "10.1.2",
|
|
25
25
|
"@budibase/pouchdb-replication-stream": "1.2.10",
|
|
26
|
-
"@budibase/shared-core": "2.11.
|
|
27
|
-
"@budibase/types": "2.11.
|
|
26
|
+
"@budibase/shared-core": "2.11.44",
|
|
27
|
+
"@budibase/types": "2.11.44",
|
|
28
28
|
"@techpass/passport-openidconnect": "0.3.2",
|
|
29
29
|
"aws-cloudfront-sign": "3.0.2",
|
|
30
30
|
"aws-sdk": "2.1030.0",
|
|
@@ -96,5 +96,5 @@
|
|
|
96
96
|
}
|
|
97
97
|
}
|
|
98
98
|
},
|
|
99
|
-
"gitHead": "
|
|
99
|
+
"gitHead": "49232b33cbfc480cb28d5210b71b43cdcf2e50dc"
|
|
100
100
|
}
|
|
@@ -1,12 +1,9 @@
|
|
|
1
|
+
export declare function clientLibraryPath(appId: string): string;
|
|
1
2
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* @param appId In production we need the appId to look up the correct bucket, as the
|
|
6
|
-
* version of the client lib may differ between apps.
|
|
7
|
-
* @param version The version to retrieve.
|
|
8
|
-
* @return The URL to be inserted into appPackage response or server rendered
|
|
9
|
-
* app index file.
|
|
3
|
+
* Previously we used to serve the client library directly from Cloudfront, however
|
|
4
|
+
* due to issues with the domain we were unable to continue doing this - keeping
|
|
5
|
+
* incase we are able to switch back to CDN path again in future.
|
|
10
6
|
*/
|
|
11
|
-
export declare
|
|
12
|
-
export declare
|
|
7
|
+
export declare function clientLibraryCDNUrl(appId: string, version: string): string;
|
|
8
|
+
export declare function clientLibraryUrl(appId: string, version: string): string;
|
|
9
|
+
export declare function getAppFileUrl(s3Key: string): string;
|
|
@@ -26,48 +26,61 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
26
26
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.getAppFileUrl = exports.clientLibraryUrl = void 0;
|
|
29
|
+
exports.getAppFileUrl = exports.clientLibraryUrl = exports.clientLibraryCDNUrl = exports.clientLibraryPath = void 0;
|
|
30
30
|
const environment_1 = __importDefault(require("../../environment"));
|
|
31
31
|
const objectStore = __importStar(require("../objectStore"));
|
|
32
32
|
const cloudfront = __importStar(require("../cloudfront"));
|
|
33
|
+
const querystring_1 = __importDefault(require("querystring"));
|
|
34
|
+
const context_1 = require("../../context");
|
|
35
|
+
function clientLibraryPath(appId) {
|
|
36
|
+
return `${objectStore.sanitizeKey(appId)}/budibase-client.js`;
|
|
37
|
+
}
|
|
38
|
+
exports.clientLibraryPath = clientLibraryPath;
|
|
33
39
|
/**
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
* @param appId In production we need the appId to look up the correct bucket, as the
|
|
38
|
-
* version of the client lib may differ between apps.
|
|
39
|
-
* @param version The version to retrieve.
|
|
40
|
-
* @return The URL to be inserted into appPackage response or server rendered
|
|
41
|
-
* app index file.
|
|
40
|
+
* Previously we used to serve the client library directly from Cloudfront, however
|
|
41
|
+
* due to issues with the domain we were unable to continue doing this - keeping
|
|
42
|
+
* incase we are able to switch back to CDN path again in future.
|
|
42
43
|
*/
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
file += `?v=${version}`;
|
|
50
|
-
}
|
|
51
|
-
// don't need to use presigned for client with cloudfront
|
|
52
|
-
// file is public
|
|
53
|
-
return cloudfront.getUrl(file);
|
|
54
|
-
}
|
|
55
|
-
else {
|
|
56
|
-
return objectStore.getPresignedUrl(environment_1.default.APPS_BUCKET_NAME, file);
|
|
44
|
+
function clientLibraryCDNUrl(appId, version) {
|
|
45
|
+
let file = clientLibraryPath(appId);
|
|
46
|
+
if (environment_1.default.CLOUDFRONT_CDN) {
|
|
47
|
+
// append app version to bust the cache
|
|
48
|
+
if (version) {
|
|
49
|
+
file += `?v=${version}`;
|
|
57
50
|
}
|
|
51
|
+
// don't need to use presigned for client with cloudfront
|
|
52
|
+
// file is public
|
|
53
|
+
return cloudfront.getUrl(file);
|
|
58
54
|
}
|
|
59
55
|
else {
|
|
60
|
-
return
|
|
56
|
+
return objectStore.getPresignedUrl(environment_1.default.APPS_BUCKET_NAME, file);
|
|
61
57
|
}
|
|
62
|
-
}
|
|
58
|
+
}
|
|
59
|
+
exports.clientLibraryCDNUrl = clientLibraryCDNUrl;
|
|
60
|
+
function clientLibraryUrl(appId, version) {
|
|
61
|
+
let tenantId, qsParams;
|
|
62
|
+
try {
|
|
63
|
+
tenantId = (0, context_1.getTenantId)();
|
|
64
|
+
}
|
|
65
|
+
finally {
|
|
66
|
+
qsParams = {
|
|
67
|
+
appId,
|
|
68
|
+
version,
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
if (tenantId && tenantId !== context_1.DEFAULT_TENANT_ID) {
|
|
72
|
+
qsParams.tenantId = tenantId;
|
|
73
|
+
}
|
|
74
|
+
return `/api/assets/client?${querystring_1.default.encode(qsParams)}`;
|
|
75
|
+
}
|
|
63
76
|
exports.clientLibraryUrl = clientLibraryUrl;
|
|
64
|
-
|
|
77
|
+
function getAppFileUrl(s3Key) {
|
|
65
78
|
if (environment_1.default.CLOUDFRONT_CDN) {
|
|
66
79
|
return cloudfront.getPresignedUrl(s3Key);
|
|
67
80
|
}
|
|
68
81
|
else {
|
|
69
82
|
return objectStore.getPresignedUrl(environment_1.default.APPS_BUCKET_NAME, s3Key);
|
|
70
83
|
}
|
|
71
|
-
}
|
|
84
|
+
}
|
|
72
85
|
exports.getAppFileUrl = getAppFileUrl;
|
|
73
86
|
//# sourceMappingURL=app.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app.js","sourceRoot":"","sources":["../../../../src/objectStore/buckets/app.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oEAAmC;AACnC,4DAA6C;AAC7C,0DAA2C;
|
|
1
|
+
{"version":3,"file":"app.js","sourceRoot":"","sources":["../../../../src/objectStore/buckets/app.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oEAAmC;AACnC,4DAA6C;AAC7C,0DAA2C;AAC3C,8DAA4B;AAC5B,2CAA8D;AAE9D,SAAgB,iBAAiB,CAAC,KAAa;IAC7C,OAAO,GAAG,WAAW,CAAC,WAAW,CAAC,KAAK,CAAC,qBAAqB,CAAA;AAC/D,CA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]): {
|
|
3
3
|
jsUrl: string;
|
|
4
4
|
iconUrl: string | undefined;
|
|
5
5
|
description: string;
|
|
@@ -20,6 +20,6 @@ export declare const enrichPluginURLs: (plugins: Plugin[]) => {
|
|
|
20
20
|
createdAt?: string | number | undefined;
|
|
21
21
|
updatedAt?: string | undefined;
|
|
22
22
|
}[];
|
|
23
|
-
export declare
|
|
24
|
-
export declare
|
|
25
|
-
export declare
|
|
23
|
+
export declare function getPluginJSKey(plugin: Plugin): string;
|
|
24
|
+
export declare function getPluginIconKey(plugin: Plugin): string | undefined;
|
|
25
|
+
export declare function getPluginS3Dir(pluginName: string): string;
|
|
@@ -32,7 +32,7 @@ const objectStore = __importStar(require("../objectStore"));
|
|
|
32
32
|
const context = __importStar(require("../../context"));
|
|
33
33
|
const cloudfront = __importStar(require("../cloudfront"));
|
|
34
34
|
// URLS
|
|
35
|
-
|
|
35
|
+
function enrichPluginURLs(plugins) {
|
|
36
36
|
if (!plugins || !plugins.length) {
|
|
37
37
|
return [];
|
|
38
38
|
}
|
|
@@ -41,46 +41,46 @@ const enrichPluginURLs = (plugins) => {
|
|
|
41
41
|
const iconUrl = getPluginIconUrl(plugin);
|
|
42
42
|
return Object.assign(Object.assign({}, plugin), { jsUrl, iconUrl });
|
|
43
43
|
});
|
|
44
|
-
}
|
|
44
|
+
}
|
|
45
45
|
exports.enrichPluginURLs = enrichPluginURLs;
|
|
46
|
-
|
|
47
|
-
const s3Key =
|
|
46
|
+
function getPluginJSUrl(plugin) {
|
|
47
|
+
const s3Key = getPluginJSKey(plugin);
|
|
48
48
|
return getPluginUrl(s3Key);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
const s3Key =
|
|
49
|
+
}
|
|
50
|
+
function getPluginIconUrl(plugin) {
|
|
51
|
+
const s3Key = getPluginIconKey(plugin);
|
|
52
52
|
if (!s3Key) {
|
|
53
53
|
return;
|
|
54
54
|
}
|
|
55
55
|
return getPluginUrl(s3Key);
|
|
56
|
-
}
|
|
57
|
-
|
|
56
|
+
}
|
|
57
|
+
function getPluginUrl(s3Key) {
|
|
58
58
|
if (environment_1.default.CLOUDFRONT_CDN) {
|
|
59
59
|
return cloudfront.getPresignedUrl(s3Key);
|
|
60
60
|
}
|
|
61
61
|
else {
|
|
62
62
|
return objectStore.getPresignedUrl(environment_1.default.PLUGIN_BUCKET_NAME, s3Key);
|
|
63
63
|
}
|
|
64
|
-
}
|
|
64
|
+
}
|
|
65
65
|
// S3 KEYS
|
|
66
|
-
|
|
66
|
+
function getPluginJSKey(plugin) {
|
|
67
67
|
return getPluginS3Key(plugin, "plugin.min.js");
|
|
68
|
-
}
|
|
68
|
+
}
|
|
69
69
|
exports.getPluginJSKey = getPluginJSKey;
|
|
70
|
-
|
|
70
|
+
function getPluginIconKey(plugin) {
|
|
71
71
|
// stored iconUrl is deprecated - hardcode to icon.svg in this case
|
|
72
72
|
const iconFileName = plugin.iconUrl ? "icon.svg" : plugin.iconFileName;
|
|
73
73
|
if (!iconFileName) {
|
|
74
74
|
return;
|
|
75
75
|
}
|
|
76
76
|
return getPluginS3Key(plugin, iconFileName);
|
|
77
|
-
}
|
|
77
|
+
}
|
|
78
78
|
exports.getPluginIconKey = getPluginIconKey;
|
|
79
|
-
|
|
80
|
-
const s3Key =
|
|
79
|
+
function getPluginS3Key(plugin, fileName) {
|
|
80
|
+
const s3Key = getPluginS3Dir(plugin.name);
|
|
81
81
|
return `${s3Key}/${fileName}`;
|
|
82
|
-
}
|
|
83
|
-
|
|
82
|
+
}
|
|
83
|
+
function getPluginS3Dir(pluginName) {
|
|
84
84
|
let s3Key = `${pluginName}`;
|
|
85
85
|
if (environment_1.default.MULTI_TENANCY) {
|
|
86
86
|
const tenantId = context.getTenantId();
|
|
@@ -90,6 +90,6 @@ const getPluginS3Dir = (pluginName) => {
|
|
|
90
90
|
s3Key = `plugins/${s3Key}`;
|
|
91
91
|
}
|
|
92
92
|
return s3Key;
|
|
93
|
-
}
|
|
93
|
+
}
|
|
94
94
|
exports.getPluginS3Dir = getPluginS3Dir;
|
|
95
95
|
//# sourceMappingURL=plugins.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugins.js","sourceRoot":"","sources":["../../../../src/objectStore/buckets/plugins.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oEAAmC;AACnC,4DAA6C;AAC7C,uDAAwC;AACxC,0DAA2C;AAG3C,OAAO;
|
|
1
|
+
{"version":3,"file":"plugins.js","sourceRoot":"","sources":["../../../../src/objectStore/buckets/plugins.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oEAAmC;AACnC,4DAA6C;AAC7C,uDAAwC;AACxC,0DAA2C;AAG3C,OAAO;AAEP,SAAgB,gBAAgB,CAAC,OAAiB;IAChD,IAAI,CAAC,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE;QAC/B,OAAO,EAAE,CAAA;KACV;IACD,OAAO,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE;QAC1B,MAAM,KAAK,GAAG,cAAc,CAAC,MAAM,CAAC,CAAA;QACpC,MAAM,OAAO,GAAG,gBAAgB,CAAC,MAAM,CAAC,CAAA;QACxC,uCAAY,MAAM,KAAE,KAAK,EAAE,OAAO,IAAE;IACtC,CAAC,CAAC,CAAA;AACJ,CAAC;AATD,4CASC;AAED,SAAS,cAAc,CAAC,MAAc;IACpC,MAAM,KAAK,GAAG,cAAc,CAAC,MAAM,CAAC,CAAA;IACpC,OAAO,YAAY,CAAC,KAAK,CAAC,CAAA;AAC5B,CAAC;AAED,SAAS,gBAAgB,CAAC,MAAc;IACtC,MAAM,KAAK,GAAG,gBAAgB,CAAC,MAAM,CAAC,CAAA;IACtC,IAAI,CAAC,KAAK,EAAE;QACV,OAAM;KACP;IACD,OAAO,YAAY,CAAC,KAAK,CAAC,CAAA;AAC5B,CAAC;AAED,SAAS,YAAY,CAAC,KAAa;IACjC,IAAI,qBAAG,CAAC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
|
4
|
+
import { Readable } from "stream";
|
|
3
5
|
import fs from "fs";
|
|
4
6
|
type UploadParams = {
|
|
5
7
|
bucket: string;
|
|
@@ -19,49 +21,50 @@ export declare function sanitizeBucket(input: string): string;
|
|
|
19
21
|
* @return an S3 object store object, check S3 Nodejs SDK for usage.
|
|
20
22
|
* @constructor
|
|
21
23
|
*/
|
|
22
|
-
export declare
|
|
24
|
+
export declare function ObjectStore(bucket: string, opts?: {
|
|
23
25
|
presigning: boolean;
|
|
24
|
-
})
|
|
26
|
+
}): AWS.S3;
|
|
25
27
|
/**
|
|
26
28
|
* Given an object store and a bucket name this will make sure the bucket exists,
|
|
27
29
|
* if it does not exist then it will create it.
|
|
28
30
|
*/
|
|
29
|
-
export declare
|
|
31
|
+
export declare function makeSureBucketExists(client: any, bucketName: string): Promise<void>;
|
|
30
32
|
/**
|
|
31
33
|
* Uploads the contents of a file given the required parameters, useful when
|
|
32
34
|
* temp files in use (for example file uploaded as an attachment).
|
|
33
35
|
*/
|
|
34
|
-
export declare
|
|
36
|
+
export declare function upload({ bucket: bucketName, filename, path, type, metadata, }: UploadParams): Promise<AWS.S3.ManagedUpload.SendData>;
|
|
35
37
|
/**
|
|
36
38
|
* Similar to the upload function but can be used to send a file stream
|
|
37
39
|
* through to the object store.
|
|
38
40
|
*/
|
|
39
|
-
export declare
|
|
41
|
+
export declare function streamUpload(bucketName: string, filename: string, stream: any, extra?: {}): Promise<AWS.S3.ManagedUpload.SendData>;
|
|
40
42
|
/**
|
|
41
43
|
* retrieves the contents of a file from the object store, if it is a known content type it
|
|
42
44
|
* will be converted, otherwise it will be returned as a buffer stream.
|
|
43
45
|
*/
|
|
44
|
-
export declare
|
|
45
|
-
export declare
|
|
46
|
+
export declare function retrieve(bucketName: string, filepath: string): Promise<any>;
|
|
47
|
+
export declare function listAllObjects(bucketName: string, path: string): Promise<AWS.S3.Object[]>;
|
|
46
48
|
/**
|
|
47
49
|
* Generate a presigned url with a default TTL of 1 hour
|
|
48
50
|
*/
|
|
49
|
-
export declare
|
|
51
|
+
export declare function getPresignedUrl(bucketName: string, key: string, durationSeconds?: number): string;
|
|
50
52
|
/**
|
|
51
53
|
* Same as retrieval function but puts to a temporary file.
|
|
52
54
|
*/
|
|
53
|
-
export declare
|
|
54
|
-
export declare
|
|
55
|
+
export declare function retrieveToTmp(bucketName: string, filepath: string): Promise<string>;
|
|
56
|
+
export declare function retrieveDirectory(bucketName: string, path: string): Promise<string>;
|
|
55
57
|
/**
|
|
56
58
|
* Delete a single file.
|
|
57
59
|
*/
|
|
58
|
-
export declare
|
|
59
|
-
export declare
|
|
60
|
+
export declare function deleteFile(bucketName: string, filepath: string): Promise<import("aws-sdk/lib/request").PromiseResult<AWS.S3.DeleteObjectOutput, AWS.AWSError>>;
|
|
61
|
+
export declare function deleteFiles(bucketName: string, filepaths: string[]): Promise<import("aws-sdk/lib/request").PromiseResult<AWS.S3.DeleteObjectsOutput, AWS.AWSError>>;
|
|
60
62
|
/**
|
|
61
63
|
* Delete a path, including everything within.
|
|
62
64
|
*/
|
|
63
|
-
export declare
|
|
64
|
-
export declare
|
|
65
|
-
export declare
|
|
66
|
-
export declare
|
|
65
|
+
export declare function deleteFolder(bucketName: string, folder: string): Promise<any>;
|
|
66
|
+
export declare function uploadDirectory(bucketName: string, localPath: string, bucketPath: string): Promise<fs.Dirent[]>;
|
|
67
|
+
export declare function downloadTarballDirect(url: string, path: string, headers?: {}): Promise<void>;
|
|
68
|
+
export declare function downloadTarball(url: string, bucketName: string, path: string): Promise<string>;
|
|
69
|
+
export declare function getReadStream(bucketName: string, path: string): Promise<Readable>;
|
|
67
70
|
export {};
|