@budibase/backend-core 3.2.35 → 3.2.37

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@budibase/backend-core",
3
- "version": "3.2.35",
3
+ "version": "3.2.37",
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",
@@ -30,9 +30,6 @@
30
30
  "test:watch": "jest --watchAll"
31
31
  },
32
32
  "dependencies": {
33
- "@aws-sdk/client-s3": "3.709.0",
34
- "@aws-sdk/lib-storage": "3.709.0",
35
- "@aws-sdk/s3-request-presigner": "3.709.0",
36
33
  "@budibase/nano": "10.1.5",
37
34
  "@budibase/pouchdb-replication-stream": "1.2.11",
38
35
  "@budibase/shared-core": "*",
@@ -74,7 +71,6 @@
74
71
  "devDependencies": {
75
72
  "@jest/types": "^29.6.3",
76
73
  "@shopify/jest-koa-mocks": "5.1.1",
77
- "@smithy/types": "4.0.0",
78
74
  "@swc/core": "1.3.71",
79
75
  "@swc/jest": "0.2.27",
80
76
  "@types/chance": "1.1.3",
@@ -114,5 +110,5 @@
114
110
  }
115
111
  }
116
112
  },
117
- "gitHead": "b3b24c0789b35d089f69e9b56ddfc7462c09fc0e"
113
+ "gitHead": "39f78eda743e69d71d9a247f6dd63a44856b3c72"
118
114
  }
@@ -45,7 +45,7 @@ declare const environment: {
45
45
  MINIO_ACCESS_KEY: string | undefined;
46
46
  MINIO_SECRET_KEY: string | undefined;
47
47
  AWS_SESSION_TOKEN: string | undefined;
48
- AWS_REGION: string;
48
+ AWS_REGION: string | undefined;
49
49
  MINIO_URL: string | undefined;
50
50
  MINIO_ENABLED: string | number;
51
51
  INTERNAL_API_KEY: string | undefined;
@@ -4,6 +4,6 @@ export declare function clientLibraryPath(appId: string): string;
4
4
  * due to issues with the domain we were unable to continue doing this - keeping
5
5
  * incase we are able to switch back to CDN path again in future.
6
6
  */
7
- export declare function clientLibraryCDNUrl(appId: string, version: string): Promise<string>;
7
+ export declare function clientLibraryCDNUrl(appId: string, version: string): string;
8
8
  export declare function clientLibraryUrl(appId: string, version: string): string;
9
- export declare function getAppFileUrl(s3Key: string): Promise<string>;
9
+ export declare function getAppFileUrl(s3Key: string): string;
@@ -1,2 +1,2 @@
1
- export declare const getGlobalFileUrl: (type: string, name: string, etag?: string) => Promise<string>;
1
+ export declare const getGlobalFileUrl: (type: string, name: string, etag?: string) => string;
2
2
  export declare const getGlobalFileS3Key: (type: string, name: string) => string;
@@ -1,5 +1,5 @@
1
1
  import { Plugin } from "@budibase/types";
2
- export declare function enrichPluginURLs(plugins?: Plugin[]): Promise<Plugin[]>;
2
+ export declare function enrichPluginURLs(plugins?: Plugin[]): Plugin[];
3
3
  export declare function getPluginJSKey(plugin: Plugin): string;
4
4
  export declare function getPluginIconKey(plugin: Plugin): string | undefined;
5
5
  export declare function getPluginS3Dir(pluginName: string): string;
@@ -1,6 +1,7 @@
1
- import { HeadObjectCommandOutput, S3, _Object as S3Object } from "@aws-sdk/client-s3";
2
- import stream, { Readable } from "stream";
1
+ import AWS from "aws-sdk";
2
+ import { Readable } from "stream";
3
3
  import fs, { PathLike, ReadStream } from "fs";
4
+ import { HeadObjectOutput } from "aws-sdk/clients/s3";
4
5
  import { ReadableStream } from "stream/web";
5
6
  export declare const SIGNED_FILE_PREFIX = "/files/signed";
6
7
  type BaseUploadParams = {
@@ -31,9 +32,9 @@ export declare function sanitizeBucket(input: string): string;
31
32
  * @return an S3 object store object, check S3 Nodejs SDK for usage.
32
33
  * @constructor
33
34
  */
34
- export declare function ObjectStore(opts?: {
35
+ export declare function ObjectStore(bucket: string, opts?: {
35
36
  presigning: boolean;
36
- }): S3;
37
+ }): AWS.S3;
37
38
  /**
38
39
  * Given an object store and a bucket name this will make sure the bucket exists,
39
40
  * if it does not exist then it will create it.
@@ -46,39 +47,28 @@ export declare function createBucketIfNotExists(client: any, bucketName: string)
46
47
  * Uploads the contents of a file given the required parameters, useful when
47
48
  * temp files in use (for example file uploaded as an attachment).
48
49
  */
49
- export declare function upload({ bucket: bucketName, filename, path, type, metadata, body, ttl, }: UploadParams): Promise<import("@aws-sdk/client-s3").CompleteMultipartUploadCommandOutput>;
50
+ export declare function upload({ bucket: bucketName, filename, path, type, metadata, body, ttl, }: UploadParams): Promise<AWS.S3.ManagedUpload.SendData>;
50
51
  /**
51
52
  * Similar to the upload function but can be used to send a file stream
52
53
  * through to the object store.
53
54
  */
54
55
  export declare function streamUpload({ bucket: bucketName, stream, filename, type, extra, ttl, }: StreamUploadParams): Promise<{
55
56
  ContentLength: number | undefined;
56
- Location?: string | undefined;
57
- Bucket?: string | undefined;
58
- Key?: string | undefined;
59
- Expiration?: string | undefined;
60
- ETag?: string | undefined;
61
- ChecksumCRC32?: string | undefined;
62
- ChecksumCRC32C?: string | undefined;
63
- ChecksumSHA1?: string | undefined;
64
- ChecksumSHA256?: string | undefined;
65
- ServerSideEncryption?: import("@aws-sdk/client-s3").ServerSideEncryption | undefined;
66
- VersionId?: string | undefined;
67
- SSEKMSKeyId?: string | undefined;
68
- BucketKeyEnabled?: boolean | undefined;
69
- RequestCharged?: import("@aws-sdk/client-s3").RequestCharged | undefined;
70
- $metadata: import("@smithy/types").ResponseMetadata;
57
+ Location: string;
58
+ ETag: string;
59
+ Bucket: string;
60
+ Key: string;
71
61
  }>;
72
62
  /**
73
63
  * retrieves the contents of a file from the object store, if it is a known content type it
74
64
  * will be converted, otherwise it will be returned as a buffer stream.
75
65
  */
76
- export declare function retrieve(bucketName: string, filepath: string): Promise<string | stream.Readable>;
77
- export declare function listAllObjects(bucketName: string, path: string): Promise<S3Object[]>;
66
+ export declare function retrieve(bucketName: string, filepath: string): Promise<any>;
67
+ export declare function listAllObjects(bucketName: string, path: string): Promise<AWS.S3.Object[]>;
78
68
  /**
79
69
  * Generate a presigned url with a default TTL of 1 hour
80
70
  */
81
- export declare function getPresignedUrl(bucketName: string, key: string, durationSeconds?: number): Promise<string>;
71
+ export declare function getPresignedUrl(bucketName: string, key: string, durationSeconds?: number): string;
82
72
  /**
83
73
  * Same as retrieval function but puts to a temporary file.
84
74
  */
@@ -87,8 +77,8 @@ export declare function retrieveDirectory(bucketName: string, path: string): Pro
87
77
  /**
88
78
  * Delete a single file.
89
79
  */
90
- export declare function deleteFile(bucketName: string, filepath: string): Promise<import("@aws-sdk/client-s3").DeleteObjectCommandOutput>;
91
- export declare function deleteFiles(bucketName: string, filepaths: string[]): Promise<import("@aws-sdk/client-s3").DeleteObjectsCommandOutput>;
80
+ export declare function deleteFile(bucketName: string, filepath: string): Promise<import("aws-sdk/lib/request").PromiseResult<AWS.S3.DeleteObjectOutput, AWS.AWSError>>;
81
+ export declare function deleteFiles(bucketName: string, filepaths: string[]): Promise<import("aws-sdk/lib/request").PromiseResult<AWS.S3.DeleteObjectsOutput, AWS.AWSError>>;
92
82
  /**
93
83
  * Delete a path, including everything within.
94
84
  */
@@ -97,7 +87,7 @@ export declare function uploadDirectory(bucketName: string, localPath: string, b
97
87
  export declare function downloadTarballDirect(url: string, path: string, headers?: {}): Promise<void>;
98
88
  export declare function downloadTarball(url: string, bucketName: string, path: string): Promise<string>;
99
89
  export declare function getReadStream(bucketName: string, path: string): Promise<Readable>;
100
- export declare function getObjectMetadata(bucket: string, path: string): Promise<HeadObjectCommandOutput>;
90
+ export declare function getObjectMetadata(bucket: string, path: string): Promise<HeadObjectOutput>;
101
91
  export declare function extractBucketAndPath(url: string): {
102
92
  bucket: string;
103
93
  path: string;
@@ -1,4 +1,4 @@
1
- import { PutBucketLifecycleConfigurationCommandInput } from "@aws-sdk/client-s3";
1
+ import { PutBucketLifecycleConfigurationRequest } from "aws-sdk/clients/s3";
2
2
  import { AutomationAttachment, AutomationAttachmentContent, BucketedContent } from "@budibase/types";
3
3
  /****************************************************
4
4
  * NOTE: When adding a new bucket - name *
@@ -14,6 +14,6 @@ export declare const ObjectStoreBuckets: {
14
14
  TEMP: string;
15
15
  };
16
16
  export declare function budibaseTempDir(): string;
17
- export declare const bucketTTLConfig: (bucketName: string, days: number) => PutBucketLifecycleConfigurationCommandInput;
17
+ export declare const bucketTTLConfig: (bucketName: string, days: number) => PutBucketLifecycleConfigurationRequest;
18
18
  export declare function processObjectStoreAttachment(attachment: AutomationAttachment): Promise<BucketedContent>;
19
19
  export declare function processAutomationAttachment(attachment: AutomationAttachment): Promise<AutomationAttachmentContent | BucketedContent>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@budibase/backend-core",
3
- "version": "3.2.35",
3
+ "version": "3.2.37",
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",
@@ -30,9 +30,6 @@
30
30
  "test:watch": "jest --watchAll"
31
31
  },
32
32
  "dependencies": {
33
- "@aws-sdk/client-s3": "3.709.0",
34
- "@aws-sdk/lib-storage": "3.709.0",
35
- "@aws-sdk/s3-request-presigner": "3.709.0",
36
33
  "@budibase/nano": "10.1.5",
37
34
  "@budibase/pouchdb-replication-stream": "1.2.11",
38
35
  "@budibase/shared-core": "*",
@@ -74,7 +71,6 @@
74
71
  "devDependencies": {
75
72
  "@jest/types": "^29.6.3",
76
73
  "@shopify/jest-koa-mocks": "5.1.1",
77
- "@smithy/types": "4.0.0",
78
74
  "@swc/core": "1.3.71",
79
75
  "@swc/jest": "0.2.27",
80
76
  "@types/chance": "1.1.3",
@@ -114,5 +110,5 @@
114
110
  }
115
111
  }
116
112
  },
117
- "gitHead": "b3b24c0789b35d089f69e9b56ddfc7462c09fc0e"
113
+ "gitHead": "39f78eda743e69d71d9a247f6dd63a44856b3c72"
118
114
  }