@constructive-io/bucket-provisioner 0.28.0 → 0.28.1
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/README.md +5 -5
- package/esm/index.d.ts +3 -3
- package/esm/index.js +3 -3
- package/esm/provisioner.d.ts +4 -4
- package/esm/provisioner.js +4 -4
- package/esm/types.d.ts +4 -4
- package/index.d.ts +3 -3
- package/index.js +3 -3
- package/package.json +3 -3
- package/provisioner.d.ts +4 -4
- package/provisioner.js +4 -4
- package/types.d.ts +4 -4
package/README.md
CHANGED
|
@@ -20,7 +20,7 @@ S3-compatible bucket provisioning library for the Constructive storage module. C
|
|
|
20
20
|
- **CORS configuration** — Browser-compatible rules for presigned URL uploads
|
|
21
21
|
- **Lifecycle rules** — Auto-cleanup for temp buckets (abandoned uploads)
|
|
22
22
|
- **Versioning** — Optional S3 versioning for durability
|
|
23
|
-
- **Multi-provider** — Works with AWS S3,
|
|
23
|
+
- **Multi-provider** — Works with AWS S3, RustFS (or any S3-compatible store), Cloudflare R2, Google Cloud Storage, and DigitalOcean Spaces
|
|
24
24
|
- **Inspect/audit** — Read back a bucket's current configuration for verification
|
|
25
25
|
- **Typed errors** — Structured `ProvisionerError` with error codes for programmatic handling
|
|
26
26
|
|
|
@@ -39,9 +39,9 @@ const provisioner = new BucketProvisioner({
|
|
|
39
39
|
connection: {
|
|
40
40
|
provider: 'minio',
|
|
41
41
|
region: 'us-east-1',
|
|
42
|
-
endpoint: 'http://
|
|
43
|
-
accessKeyId: '
|
|
44
|
-
secretAccessKey: '
|
|
42
|
+
endpoint: 'http://rustfs:9000',
|
|
43
|
+
accessKeyId: 'constructive',
|
|
44
|
+
secretAccessKey: 'constructive-dev-secret',
|
|
45
45
|
},
|
|
46
46
|
allowedOrigins: ['https://app.example.com'],
|
|
47
47
|
});
|
|
@@ -282,7 +282,7 @@ Error codes:
|
|
|
282
282
|
| Provider | Endpoint Required | Path Style | Notes |
|
|
283
283
|
|----------|------------------|------------|-------|
|
|
284
284
|
| `s3` | No | Virtual-hosted | AWS default |
|
|
285
|
-
| `minio` | Yes | Path-style | Local development, self-hosted |
|
|
285
|
+
| `minio` | Yes | Path-style S3-compatible (RustFS, MinIO) | Local development, self-hosted |
|
|
286
286
|
| `r2` | Yes | Path-style | Cloudflare R2 |
|
|
287
287
|
| `gcs` | Yes | Path-style | GCS S3-compatible API |
|
|
288
288
|
| `spaces` | Yes | Virtual-hosted | DigitalOcean Spaces |
|
package/esm/index.d.ts
CHANGED
|
@@ -13,9 +13,9 @@
|
|
|
13
13
|
* connection: {
|
|
14
14
|
* provider: 'minio',
|
|
15
15
|
* region: 'us-east-1',
|
|
16
|
-
* endpoint: 'http://
|
|
17
|
-
* accessKeyId: '
|
|
18
|
-
* secretAccessKey: '
|
|
16
|
+
* endpoint: 'http://rustfs:9000',
|
|
17
|
+
* accessKeyId: 'constructive',
|
|
18
|
+
* secretAccessKey: 'constructive-dev-secret',
|
|
19
19
|
* },
|
|
20
20
|
* allowedOrigins: ['https://app.example.com'],
|
|
21
21
|
* });
|
package/esm/index.js
CHANGED
|
@@ -13,9 +13,9 @@
|
|
|
13
13
|
* connection: {
|
|
14
14
|
* provider: 'minio',
|
|
15
15
|
* region: 'us-east-1',
|
|
16
|
-
* endpoint: 'http://
|
|
17
|
-
* accessKeyId: '
|
|
18
|
-
* secretAccessKey: '
|
|
16
|
+
* endpoint: 'http://rustfs:9000',
|
|
17
|
+
* accessKeyId: 'constructive',
|
|
18
|
+
* secretAccessKey: 'constructive-dev-secret',
|
|
19
19
|
* },
|
|
20
20
|
* allowedOrigins: ['https://app.example.com'],
|
|
21
21
|
* });
|
package/esm/provisioner.d.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Orchestrates S3 bucket creation, privacy configuration, CORS setup,
|
|
5
5
|
* versioning, and lifecycle rules. Uses the AWS SDK S3 client for all
|
|
6
|
-
* operations, which works with any S3-compatible backend (MinIO, R2, etc.).
|
|
6
|
+
* operations, which works with any S3-compatible backend (RustFS, MinIO, R2, etc.).
|
|
7
7
|
*
|
|
8
8
|
* Privacy model:
|
|
9
9
|
* - Private/temp buckets: Block All Public Access, no bucket policy, presigned URLs only
|
|
@@ -41,9 +41,9 @@ export interface BucketProvisionerOptions {
|
|
|
41
41
|
* connection: {
|
|
42
42
|
* provider: 'minio',
|
|
43
43
|
* region: 'us-east-1',
|
|
44
|
-
* endpoint: 'http://
|
|
45
|
-
* accessKeyId: '
|
|
46
|
-
* secretAccessKey: '
|
|
44
|
+
* endpoint: 'http://rustfs:9000',
|
|
45
|
+
* accessKeyId: 'constructive',
|
|
46
|
+
* secretAccessKey: 'constructive-dev-secret',
|
|
47
47
|
* },
|
|
48
48
|
* allowedOrigins: ['https://app.example.com'],
|
|
49
49
|
* });
|
package/esm/provisioner.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Orchestrates S3 bucket creation, privacy configuration, CORS setup,
|
|
5
5
|
* versioning, and lifecycle rules. Uses the AWS SDK S3 client for all
|
|
6
|
-
* operations, which works with any S3-compatible backend (MinIO, R2, etc.).
|
|
6
|
+
* operations, which works with any S3-compatible backend (RustFS, MinIO, R2, etc.).
|
|
7
7
|
*
|
|
8
8
|
* Privacy model:
|
|
9
9
|
* - Private/temp buckets: Block All Public Access, no bucket policy, presigned URLs only
|
|
@@ -26,9 +26,9 @@ import { ProvisionerError } from './types';
|
|
|
26
26
|
* connection: {
|
|
27
27
|
* provider: 'minio',
|
|
28
28
|
* region: 'us-east-1',
|
|
29
|
-
* endpoint: 'http://
|
|
30
|
-
* accessKeyId: '
|
|
31
|
-
* secretAccessKey: '
|
|
29
|
+
* endpoint: 'http://rustfs:9000',
|
|
30
|
+
* accessKeyId: 'constructive',
|
|
31
|
+
* secretAccessKey: 'constructive-dev-secret',
|
|
32
32
|
* },
|
|
33
33
|
* allowedOrigins: ['https://app.example.com'],
|
|
34
34
|
* });
|
package/esm/types.d.ts
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
/**
|
|
8
8
|
* Supported storage provider identifiers.
|
|
9
9
|
*
|
|
10
|
-
* Used to select provider-specific behavior (e.g., path-style URLs for MinIO,
|
|
10
|
+
* Used to select provider-specific behavior (e.g., path-style URLs for RustFS or MinIO,
|
|
11
11
|
* jurisdiction headers for R2).
|
|
12
12
|
*/
|
|
13
13
|
export type StorageProvider = 's3' | 'minio' | 'rustfs' | 'r2' | 'gcs' | 'spaces';
|
|
@@ -16,20 +16,20 @@ export type StorageProvider = 's3' | 'minio' | 'rustfs' | 'r2' | 'gcs' | 'spaces
|
|
|
16
16
|
*
|
|
17
17
|
* This is the input you provide to connect to your storage provider.
|
|
18
18
|
* For AWS S3, only `region` and credentials are needed.
|
|
19
|
-
* For MinIO/
|
|
19
|
+
* For RustFS/MinIO/R2/etc., also provide `endpoint`.
|
|
20
20
|
*/
|
|
21
21
|
export interface StorageConnectionConfig {
|
|
22
22
|
/** Storage provider type */
|
|
23
23
|
provider: StorageProvider;
|
|
24
24
|
/** S3 region (e.g., "us-east-1"). Required for AWS S3. */
|
|
25
25
|
region: string;
|
|
26
|
-
/** S3-compatible endpoint URL (e.g., "http://
|
|
26
|
+
/** S3-compatible endpoint URL (e.g., "http://rustfs:9000"). Required for non-AWS providers. */
|
|
27
27
|
endpoint?: string;
|
|
28
28
|
/** AWS access key ID */
|
|
29
29
|
accessKeyId: string;
|
|
30
30
|
/** AWS secret access key */
|
|
31
31
|
secretAccessKey: string;
|
|
32
|
-
/** Use path-style URLs (required for MinIO, optional for others) */
|
|
32
|
+
/** Use path-style URLs (required for RustFS and MinIO, optional for others) */
|
|
33
33
|
forcePathStyle?: boolean;
|
|
34
34
|
}
|
|
35
35
|
/**
|
package/index.d.ts
CHANGED
|
@@ -13,9 +13,9 @@
|
|
|
13
13
|
* connection: {
|
|
14
14
|
* provider: 'minio',
|
|
15
15
|
* region: 'us-east-1',
|
|
16
|
-
* endpoint: 'http://
|
|
17
|
-
* accessKeyId: '
|
|
18
|
-
* secretAccessKey: '
|
|
16
|
+
* endpoint: 'http://rustfs:9000',
|
|
17
|
+
* accessKeyId: 'constructive',
|
|
18
|
+
* secretAccessKey: 'constructive-dev-secret',
|
|
19
19
|
* },
|
|
20
20
|
* allowedOrigins: ['https://app.example.com'],
|
|
21
21
|
* });
|
package/index.js
CHANGED
|
@@ -14,9 +14,9 @@
|
|
|
14
14
|
* connection: {
|
|
15
15
|
* provider: 'minio',
|
|
16
16
|
* region: 'us-east-1',
|
|
17
|
-
* endpoint: 'http://
|
|
18
|
-
* accessKeyId: '
|
|
19
|
-
* secretAccessKey: '
|
|
17
|
+
* endpoint: 'http://rustfs:9000',
|
|
18
|
+
* accessKeyId: 'constructive',
|
|
19
|
+
* secretAccessKey: 'constructive-dev-secret',
|
|
20
20
|
* },
|
|
21
21
|
* allowedOrigins: ['https://app.example.com'],
|
|
22
22
|
* });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@constructive-io/bucket-provisioner",
|
|
3
|
-
"version": "0.28.
|
|
3
|
+
"version": "0.28.1",
|
|
4
4
|
"author": "Constructive <developers@constructive.io>",
|
|
5
5
|
"description": "S3-compatible bucket provisioning library — create buckets, configure privacy policies, CORS, and access controls",
|
|
6
6
|
"main": "index.js",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"@aws-sdk/client-s3": "^3.1052.0",
|
|
33
|
-
"@constructive-io/s3-utils": "^2.33.
|
|
33
|
+
"@constructive-io/s3-utils": "^2.33.1"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"makage": "^0.8.0"
|
|
@@ -44,5 +44,5 @@
|
|
|
44
44
|
"storage",
|
|
45
45
|
"constructive"
|
|
46
46
|
],
|
|
47
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "9bba983b38395277e0400294aaa380e586b049d4"
|
|
48
48
|
}
|
package/provisioner.d.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Orchestrates S3 bucket creation, privacy configuration, CORS setup,
|
|
5
5
|
* versioning, and lifecycle rules. Uses the AWS SDK S3 client for all
|
|
6
|
-
* operations, which works with any S3-compatible backend (MinIO, R2, etc.).
|
|
6
|
+
* operations, which works with any S3-compatible backend (RustFS, MinIO, R2, etc.).
|
|
7
7
|
*
|
|
8
8
|
* Privacy model:
|
|
9
9
|
* - Private/temp buckets: Block All Public Access, no bucket policy, presigned URLs only
|
|
@@ -41,9 +41,9 @@ export interface BucketProvisionerOptions {
|
|
|
41
41
|
* connection: {
|
|
42
42
|
* provider: 'minio',
|
|
43
43
|
* region: 'us-east-1',
|
|
44
|
-
* endpoint: 'http://
|
|
45
|
-
* accessKeyId: '
|
|
46
|
-
* secretAccessKey: '
|
|
44
|
+
* endpoint: 'http://rustfs:9000',
|
|
45
|
+
* accessKeyId: 'constructive',
|
|
46
|
+
* secretAccessKey: 'constructive-dev-secret',
|
|
47
47
|
* },
|
|
48
48
|
* allowedOrigins: ['https://app.example.com'],
|
|
49
49
|
* });
|
package/provisioner.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*
|
|
5
5
|
* Orchestrates S3 bucket creation, privacy configuration, CORS setup,
|
|
6
6
|
* versioning, and lifecycle rules. Uses the AWS SDK S3 client for all
|
|
7
|
-
* operations, which works with any S3-compatible backend (MinIO, R2, etc.).
|
|
7
|
+
* operations, which works with any S3-compatible backend (RustFS, MinIO, R2, etc.).
|
|
8
8
|
*
|
|
9
9
|
* Privacy model:
|
|
10
10
|
* - Private/temp buckets: Block All Public Access, no bucket policy, presigned URLs only
|
|
@@ -29,9 +29,9 @@ const types_1 = require("./types");
|
|
|
29
29
|
* connection: {
|
|
30
30
|
* provider: 'minio',
|
|
31
31
|
* region: 'us-east-1',
|
|
32
|
-
* endpoint: 'http://
|
|
33
|
-
* accessKeyId: '
|
|
34
|
-
* secretAccessKey: '
|
|
32
|
+
* endpoint: 'http://rustfs:9000',
|
|
33
|
+
* accessKeyId: 'constructive',
|
|
34
|
+
* secretAccessKey: 'constructive-dev-secret',
|
|
35
35
|
* },
|
|
36
36
|
* allowedOrigins: ['https://app.example.com'],
|
|
37
37
|
* });
|
package/types.d.ts
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
/**
|
|
8
8
|
* Supported storage provider identifiers.
|
|
9
9
|
*
|
|
10
|
-
* Used to select provider-specific behavior (e.g., path-style URLs for MinIO,
|
|
10
|
+
* Used to select provider-specific behavior (e.g., path-style URLs for RustFS or MinIO,
|
|
11
11
|
* jurisdiction headers for R2).
|
|
12
12
|
*/
|
|
13
13
|
export type StorageProvider = 's3' | 'minio' | 'rustfs' | 'r2' | 'gcs' | 'spaces';
|
|
@@ -16,20 +16,20 @@ export type StorageProvider = 's3' | 'minio' | 'rustfs' | 'r2' | 'gcs' | 'spaces
|
|
|
16
16
|
*
|
|
17
17
|
* This is the input you provide to connect to your storage provider.
|
|
18
18
|
* For AWS S3, only `region` and credentials are needed.
|
|
19
|
-
* For MinIO/
|
|
19
|
+
* For RustFS/MinIO/R2/etc., also provide `endpoint`.
|
|
20
20
|
*/
|
|
21
21
|
export interface StorageConnectionConfig {
|
|
22
22
|
/** Storage provider type */
|
|
23
23
|
provider: StorageProvider;
|
|
24
24
|
/** S3 region (e.g., "us-east-1"). Required for AWS S3. */
|
|
25
25
|
region: string;
|
|
26
|
-
/** S3-compatible endpoint URL (e.g., "http://
|
|
26
|
+
/** S3-compatible endpoint URL (e.g., "http://rustfs:9000"). Required for non-AWS providers. */
|
|
27
27
|
endpoint?: string;
|
|
28
28
|
/** AWS access key ID */
|
|
29
29
|
accessKeyId: string;
|
|
30
30
|
/** AWS secret access key */
|
|
31
31
|
secretAccessKey: string;
|
|
32
|
-
/** Use path-style URLs (required for MinIO, optional for others) */
|
|
32
|
+
/** Use path-style URLs (required for RustFS and MinIO, optional for others) */
|
|
33
33
|
forcePathStyle?: boolean;
|
|
34
34
|
}
|
|
35
35
|
/**
|