@twin.org/blob-storage-connector-aws-s3 0.0.1-next.9 → 0.0.2-next.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/dist/cjs/index.cjs +56 -1
- package/dist/esm/index.mjs +58 -3
- package/dist/types/index.d.ts +1 -0
- package/dist/types/models/IS3BlobStorageConnectorConstructorOptions.d.ts +10 -0
- package/dist/types/s3BlobStorageConnector.d.ts +8 -5
- package/docs/changelog.md +158 -1
- package/docs/reference/classes/S3BlobStorageConnector.md +43 -13
- package/docs/reference/index.md +1 -0
- package/docs/reference/interfaces/IS3BlobStorageConnectorConstructorOptions.md +11 -0
- package/locales/en.json +8 -0
- package/package.json +7 -6
package/dist/cjs/index.cjs
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
var clientS3 = require('@aws-sdk/client-s3');
|
|
4
4
|
var core = require('@twin.org/core');
|
|
5
5
|
var crypto = require('@twin.org/crypto');
|
|
6
|
+
var loggingModels = require('@twin.org/logging-models');
|
|
6
7
|
|
|
7
8
|
// Copyright 2024 IOTA Stiftung.
|
|
8
9
|
// SPDX-License-Identifier: Apache-2.0.
|
|
@@ -32,7 +33,6 @@ class S3BlobStorageConnector {
|
|
|
32
33
|
/**
|
|
33
34
|
* Create a new instance of S3BlobStorageConnector.
|
|
34
35
|
* @param options The options for the connector.
|
|
35
|
-
* @param options.config The configuration for the connector.
|
|
36
36
|
*/
|
|
37
37
|
constructor(options) {
|
|
38
38
|
core.Guards.object(this.CLASS_NAME, "options", options);
|
|
@@ -52,6 +52,61 @@ class S3BlobStorageConnector {
|
|
|
52
52
|
forcePathStyle: true
|
|
53
53
|
});
|
|
54
54
|
}
|
|
55
|
+
/**
|
|
56
|
+
* Bootstrap the component by creating and initializing any resources it needs.
|
|
57
|
+
* @param nodeLoggingConnectorType The node logging connector type, defaults to "node-logging".
|
|
58
|
+
* @returns True if the bootstrapping process was successful.
|
|
59
|
+
*/
|
|
60
|
+
async bootstrap(nodeLoggingConnectorType) {
|
|
61
|
+
const nodeLogging = loggingModels.LoggingConnectorFactory.getIfExists(nodeLoggingConnectorType ?? "node-logging");
|
|
62
|
+
try {
|
|
63
|
+
await nodeLogging?.log({
|
|
64
|
+
level: "info",
|
|
65
|
+
source: this.CLASS_NAME,
|
|
66
|
+
message: "bucketCreating",
|
|
67
|
+
data: {
|
|
68
|
+
bucket: this._config.bucketName
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
const listBucketsCommand = new clientS3.ListBucketsCommand({});
|
|
72
|
+
const bucketsList = await this._s3Client.send(listBucketsCommand);
|
|
73
|
+
const bucketExists = bucketsList.Buckets?.some(bucket => bucket.Name === this._config.bucketName);
|
|
74
|
+
if (bucketExists) {
|
|
75
|
+
await nodeLogging?.log({
|
|
76
|
+
level: "info",
|
|
77
|
+
source: this.CLASS_NAME,
|
|
78
|
+
message: "bucketExists",
|
|
79
|
+
data: {
|
|
80
|
+
bucket: this._config.bucketName
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
else {
|
|
85
|
+
await this._s3Client.send(new clientS3.CreateBucketCommand({ Bucket: this._config.bucketName }));
|
|
86
|
+
await nodeLogging?.log({
|
|
87
|
+
level: "info",
|
|
88
|
+
source: this.CLASS_NAME,
|
|
89
|
+
message: "bucketCreated",
|
|
90
|
+
data: {
|
|
91
|
+
bucket: this._config.bucketName
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
catch (err) {
|
|
97
|
+
await nodeLogging?.log({
|
|
98
|
+
level: "error",
|
|
99
|
+
source: this.CLASS_NAME,
|
|
100
|
+
message: "bucketCreateFailed",
|
|
101
|
+
data: {
|
|
102
|
+
bucket: this._config.bucketName
|
|
103
|
+
},
|
|
104
|
+
error: core.BaseError.fromError(err)
|
|
105
|
+
});
|
|
106
|
+
return false;
|
|
107
|
+
}
|
|
108
|
+
return true;
|
|
109
|
+
}
|
|
55
110
|
/**
|
|
56
111
|
* Set the blob.
|
|
57
112
|
* @param blob The data for the blob.
|
package/dist/esm/index.mjs
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { S3Client, PutObjectCommand, GetObjectCommand, HeadObjectCommand, DeleteObjectCommand } from '@aws-sdk/client-s3';
|
|
2
|
-
import { Guards, Converter, Urn, GeneralError
|
|
1
|
+
import { S3Client, ListBucketsCommand, CreateBucketCommand, PutObjectCommand, GetObjectCommand, HeadObjectCommand, DeleteObjectCommand } from '@aws-sdk/client-s3';
|
|
2
|
+
import { Guards, BaseError, Converter, Urn, GeneralError } from '@twin.org/core';
|
|
3
3
|
import { Sha256 } from '@twin.org/crypto';
|
|
4
|
+
import { LoggingConnectorFactory } from '@twin.org/logging-models';
|
|
4
5
|
|
|
5
6
|
// Copyright 2024 IOTA Stiftung.
|
|
6
7
|
// SPDX-License-Identifier: Apache-2.0.
|
|
@@ -30,7 +31,6 @@ class S3BlobStorageConnector {
|
|
|
30
31
|
/**
|
|
31
32
|
* Create a new instance of S3BlobStorageConnector.
|
|
32
33
|
* @param options The options for the connector.
|
|
33
|
-
* @param options.config The configuration for the connector.
|
|
34
34
|
*/
|
|
35
35
|
constructor(options) {
|
|
36
36
|
Guards.object(this.CLASS_NAME, "options", options);
|
|
@@ -50,6 +50,61 @@ class S3BlobStorageConnector {
|
|
|
50
50
|
forcePathStyle: true
|
|
51
51
|
});
|
|
52
52
|
}
|
|
53
|
+
/**
|
|
54
|
+
* Bootstrap the component by creating and initializing any resources it needs.
|
|
55
|
+
* @param nodeLoggingConnectorType The node logging connector type, defaults to "node-logging".
|
|
56
|
+
* @returns True if the bootstrapping process was successful.
|
|
57
|
+
*/
|
|
58
|
+
async bootstrap(nodeLoggingConnectorType) {
|
|
59
|
+
const nodeLogging = LoggingConnectorFactory.getIfExists(nodeLoggingConnectorType ?? "node-logging");
|
|
60
|
+
try {
|
|
61
|
+
await nodeLogging?.log({
|
|
62
|
+
level: "info",
|
|
63
|
+
source: this.CLASS_NAME,
|
|
64
|
+
message: "bucketCreating",
|
|
65
|
+
data: {
|
|
66
|
+
bucket: this._config.bucketName
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
const listBucketsCommand = new ListBucketsCommand({});
|
|
70
|
+
const bucketsList = await this._s3Client.send(listBucketsCommand);
|
|
71
|
+
const bucketExists = bucketsList.Buckets?.some(bucket => bucket.Name === this._config.bucketName);
|
|
72
|
+
if (bucketExists) {
|
|
73
|
+
await nodeLogging?.log({
|
|
74
|
+
level: "info",
|
|
75
|
+
source: this.CLASS_NAME,
|
|
76
|
+
message: "bucketExists",
|
|
77
|
+
data: {
|
|
78
|
+
bucket: this._config.bucketName
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
else {
|
|
83
|
+
await this._s3Client.send(new CreateBucketCommand({ Bucket: this._config.bucketName }));
|
|
84
|
+
await nodeLogging?.log({
|
|
85
|
+
level: "info",
|
|
86
|
+
source: this.CLASS_NAME,
|
|
87
|
+
message: "bucketCreated",
|
|
88
|
+
data: {
|
|
89
|
+
bucket: this._config.bucketName
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
catch (err) {
|
|
95
|
+
await nodeLogging?.log({
|
|
96
|
+
level: "error",
|
|
97
|
+
source: this.CLASS_NAME,
|
|
98
|
+
message: "bucketCreateFailed",
|
|
99
|
+
data: {
|
|
100
|
+
bucket: this._config.bucketName
|
|
101
|
+
},
|
|
102
|
+
error: BaseError.fromError(err)
|
|
103
|
+
});
|
|
104
|
+
return false;
|
|
105
|
+
}
|
|
106
|
+
return true;
|
|
107
|
+
}
|
|
53
108
|
/**
|
|
54
109
|
* Set the blob.
|
|
55
110
|
* @param blob The data for the blob.
|
package/dist/types/index.d.ts
CHANGED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { IS3BlobStorageConnectorConfig } from "./IS3BlobStorageConnectorConfig";
|
|
2
|
+
/**
|
|
3
|
+
* Options for the S3 Blob Storage Connector constructor.
|
|
4
|
+
*/
|
|
5
|
+
export interface IS3BlobStorageConnectorConstructorOptions {
|
|
6
|
+
/**
|
|
7
|
+
* The configuration for the connector.
|
|
8
|
+
*/
|
|
9
|
+
config: IS3BlobStorageConnectorConfig;
|
|
10
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { IBlobStorageConnector } from "@twin.org/blob-storage-models";
|
|
2
|
-
import type {
|
|
2
|
+
import type { IS3BlobStorageConnectorConstructorOptions } from "./models/IS3BlobStorageConnectorConstructorOptions";
|
|
3
3
|
/**
|
|
4
4
|
* Class for performing blob storage operations on S3.
|
|
5
5
|
* See https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/s3/ for more information.
|
|
@@ -16,11 +16,14 @@ export declare class S3BlobStorageConnector implements IBlobStorageConnector {
|
|
|
16
16
|
/**
|
|
17
17
|
* Create a new instance of S3BlobStorageConnector.
|
|
18
18
|
* @param options The options for the connector.
|
|
19
|
-
* @param options.config The configuration for the connector.
|
|
20
19
|
*/
|
|
21
|
-
constructor(options:
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
constructor(options: IS3BlobStorageConnectorConstructorOptions);
|
|
21
|
+
/**
|
|
22
|
+
* Bootstrap the component by creating and initializing any resources it needs.
|
|
23
|
+
* @param nodeLoggingConnectorType The node logging connector type, defaults to "node-logging".
|
|
24
|
+
* @returns True if the bootstrapping process was successful.
|
|
25
|
+
*/
|
|
26
|
+
bootstrap(nodeLoggingConnectorType?: string): Promise<boolean>;
|
|
24
27
|
/**
|
|
25
28
|
* Set the blob.
|
|
26
29
|
* @param blob The data for the blob.
|
package/docs/changelog.md
CHANGED
|
@@ -1,5 +1,162 @@
|
|
|
1
1
|
# @twin.org/blob-storage-connector-aws-s3 - Changelog
|
|
2
2
|
|
|
3
|
-
##
|
|
3
|
+
## [0.0.2-next.1](https://github.com/twinfoundation/blob-storage/compare/blob-storage-connector-aws-s3-v0.0.2-next.0...blob-storage-connector-aws-s3-v0.0.2-next.1) (2025-07-24)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* Blob storage connector for AWS S3 ([#7](https://github.com/twinfoundation/blob-storage/issues/7)) ([1d7f1e7](https://github.com/twinfoundation/blob-storage/commit/1d7f1e7d323926f7f31229d38eb5de429f6e1554))
|
|
9
|
+
* update dependencies ([56f0094](https://github.com/twinfoundation/blob-storage/commit/56f0094b68d8bd22864cd899ac1b61d95540f719))
|
|
10
|
+
* update to support fully qualified data type names ([3297d69](https://github.com/twinfoundation/blob-storage/commit/3297d69d332058b0f0141002087f56ba230620e1))
|
|
11
|
+
* use shared store mechanism ([#12](https://github.com/twinfoundation/blob-storage/issues/12)) ([cae8110](https://github.com/twinfoundation/blob-storage/commit/cae8110681847a1ac4fcac968b8196694e49c320))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### Dependencies
|
|
15
|
+
|
|
16
|
+
* The following workspace dependencies were updated
|
|
17
|
+
* dependencies
|
|
18
|
+
* @twin.org/blob-storage-models bumped from 0.0.2-next.0 to 0.0.2-next.1
|
|
19
|
+
|
|
20
|
+
## 0.0.1 (2025-07-04)
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
### Features
|
|
24
|
+
|
|
25
|
+
* release to production ([eacfe75](https://github.com/twinfoundation/blob-storage/commit/eacfe754a0dcd9243d9e13d86422327d0a605164))
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
### Dependencies
|
|
29
|
+
|
|
30
|
+
* The following workspace dependencies were updated
|
|
31
|
+
* dependencies
|
|
32
|
+
* @twin.org/blob-storage-models bumped from ^0.0.0 to ^0.0.1
|
|
33
|
+
|
|
34
|
+
## [0.0.1-next.37](https://github.com/twinfoundation/blob-storage/compare/blob-storage-connector-aws-s3-v0.0.1-next.36...blob-storage-connector-aws-s3-v0.0.1-next.37) (2025-06-20)
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
### Miscellaneous Chores
|
|
38
|
+
|
|
39
|
+
* **blob-storage-connector-aws-s3:** Synchronize repo versions
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
### Dependencies
|
|
43
|
+
|
|
44
|
+
* The following workspace dependencies were updated
|
|
45
|
+
* dependencies
|
|
46
|
+
* @twin.org/blob-storage-models bumped from 0.0.1-next.36 to 0.0.1-next.37
|
|
47
|
+
|
|
48
|
+
## [0.0.1-next.36](https://github.com/twinfoundation/blob-storage/compare/blob-storage-connector-aws-s3-v0.0.1-next.35...blob-storage-connector-aws-s3-v0.0.1-next.36) (2025-06-19)
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
### Miscellaneous Chores
|
|
52
|
+
|
|
53
|
+
* **blob-storage-connector-aws-s3:** Synchronize repo versions
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
### Dependencies
|
|
57
|
+
|
|
58
|
+
* The following workspace dependencies were updated
|
|
59
|
+
* dependencies
|
|
60
|
+
* @twin.org/blob-storage-models bumped from 0.0.1-next.35 to 0.0.1-next.36
|
|
61
|
+
|
|
62
|
+
## [0.0.1-next.35](https://github.com/twinfoundation/blob-storage/compare/blob-storage-connector-aws-s3-v0.0.1-next.34...blob-storage-connector-aws-s3-v0.0.1-next.35) (2025-06-17)
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
### Miscellaneous Chores
|
|
66
|
+
|
|
67
|
+
* **blob-storage-connector-aws-s3:** Synchronize repo versions
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
### Dependencies
|
|
71
|
+
|
|
72
|
+
* The following workspace dependencies were updated
|
|
73
|
+
* dependencies
|
|
74
|
+
* @twin.org/blob-storage-models bumped from 0.0.1-next.34 to 0.0.1-next.35
|
|
75
|
+
|
|
76
|
+
## [0.0.1-next.34](https://github.com/twinfoundation/blob-storage/compare/blob-storage-connector-aws-s3-v0.0.1-next.33...blob-storage-connector-aws-s3-v0.0.1-next.34) (2025-06-12)
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
### Features
|
|
80
|
+
|
|
81
|
+
* update dependencies ([56f0094](https://github.com/twinfoundation/blob-storage/commit/56f0094b68d8bd22864cd899ac1b61d95540f719))
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
### Dependencies
|
|
85
|
+
|
|
86
|
+
* The following workspace dependencies were updated
|
|
87
|
+
* dependencies
|
|
88
|
+
* @twin.org/blob-storage-models bumped from 0.0.1-next.33 to 0.0.1-next.34
|
|
89
|
+
|
|
90
|
+
## [0.0.1-next.33](https://github.com/twinfoundation/blob-storage/compare/blob-storage-connector-aws-s3-v0.0.1-next.32...blob-storage-connector-aws-s3-v0.0.1-next.33) (2025-06-03)
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
### Miscellaneous Chores
|
|
94
|
+
|
|
95
|
+
* **blob-storage-connector-aws-s3:** Synchronize repo versions
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
### Dependencies
|
|
99
|
+
|
|
100
|
+
* The following workspace dependencies were updated
|
|
101
|
+
* dependencies
|
|
102
|
+
* @twin.org/blob-storage-models bumped from 0.0.1-next.32 to 0.0.1-next.33
|
|
103
|
+
|
|
104
|
+
## [0.0.1-next.32](https://github.com/twinfoundation/blob-storage/compare/blob-storage-connector-aws-s3-v0.0.1-next.31...blob-storage-connector-aws-s3-v0.0.1-next.32) (2025-05-28)
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
### Features
|
|
108
|
+
|
|
109
|
+
* update to support fully qualified data type names ([3297d69](https://github.com/twinfoundation/blob-storage/commit/3297d69d332058b0f0141002087f56ba230620e1))
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
### Dependencies
|
|
113
|
+
|
|
114
|
+
* The following workspace dependencies were updated
|
|
115
|
+
* dependencies
|
|
116
|
+
* @twin.org/blob-storage-models bumped from 0.0.1-next.31 to 0.0.1-next.32
|
|
117
|
+
|
|
118
|
+
## [0.0.1-next.31](https://github.com/twinfoundation/blob-storage/compare/blob-storage-connector-aws-s3-v0.0.1-next.30...blob-storage-connector-aws-s3-v0.0.1-next.31) (2025-05-08)
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
### Miscellaneous Chores
|
|
122
|
+
|
|
123
|
+
* **blob-storage-connector-aws-s3:** Synchronize repo versions
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
### Dependencies
|
|
127
|
+
|
|
128
|
+
* The following workspace dependencies were updated
|
|
129
|
+
* dependencies
|
|
130
|
+
* @twin.org/blob-storage-models bumped from 0.0.1-next.30 to 0.0.1-next.31
|
|
131
|
+
|
|
132
|
+
## [0.0.1-next.30](https://github.com/twinfoundation/blob-storage/compare/blob-storage-connector-aws-s3-v0.0.1-next.29...blob-storage-connector-aws-s3-v0.0.1-next.30) (2025-04-17)
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
### Features
|
|
136
|
+
|
|
137
|
+
* use shared store mechanism ([#12](https://github.com/twinfoundation/blob-storage/issues/12)) ([cae8110](https://github.com/twinfoundation/blob-storage/commit/cae8110681847a1ac4fcac968b8196694e49c320))
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
### Dependencies
|
|
141
|
+
|
|
142
|
+
* The following workspace dependencies were updated
|
|
143
|
+
* dependencies
|
|
144
|
+
* @twin.org/blob-storage-models bumped from 0.0.1-next.29 to 0.0.1-next.30
|
|
145
|
+
|
|
146
|
+
## [0.0.1-next.29](https://github.com/twinfoundation/blob-storage/compare/blob-storage-connector-aws-s3-v0.0.1-next.28...blob-storage-connector-aws-s3-v0.0.1-next.29) (2025-03-28)
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
### Features
|
|
150
|
+
|
|
151
|
+
* Blob storage connector for AWS S3 ([#7](https://github.com/twinfoundation/blob-storage/issues/7)) ([1d7f1e7](https://github.com/twinfoundation/blob-storage/commit/1d7f1e7d323926f7f31229d38eb5de429f6e1554))
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
### Dependencies
|
|
155
|
+
|
|
156
|
+
* The following workspace dependencies were updated
|
|
157
|
+
* dependencies
|
|
158
|
+
* @twin.org/blob-storage-models bumped from 0.0.1-next.28 to 0.0.1-next.29
|
|
159
|
+
|
|
160
|
+
## v0.0.1-next.28
|
|
4
161
|
|
|
5
162
|
- Initial Release
|
|
@@ -9,25 +9,23 @@ See https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/s3/ for more i
|
|
|
9
9
|
|
|
10
10
|
## Constructors
|
|
11
11
|
|
|
12
|
-
###
|
|
12
|
+
### Constructor
|
|
13
13
|
|
|
14
|
-
> **new S3BlobStorageConnector**(`options`):
|
|
14
|
+
> **new S3BlobStorageConnector**(`options`): `S3BlobStorageConnector`
|
|
15
15
|
|
|
16
16
|
Create a new instance of S3BlobStorageConnector.
|
|
17
17
|
|
|
18
18
|
#### Parameters
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
##### options
|
|
21
21
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
• **options.config**: [`IS3BlobStorageConnectorConfig`](../interfaces/IS3BlobStorageConnectorConfig.md)
|
|
22
|
+
[`IS3BlobStorageConnectorConstructorOptions`](../interfaces/IS3BlobStorageConnectorConstructorOptions.md)
|
|
25
23
|
|
|
26
|
-
The
|
|
24
|
+
The options for the connector.
|
|
27
25
|
|
|
28
26
|
#### Returns
|
|
29
27
|
|
|
30
|
-
|
|
28
|
+
`S3BlobStorageConnector`
|
|
31
29
|
|
|
32
30
|
## Properties
|
|
33
31
|
|
|
@@ -51,6 +49,32 @@ Runtime name for the class.
|
|
|
51
49
|
|
|
52
50
|
## Methods
|
|
53
51
|
|
|
52
|
+
### bootstrap()
|
|
53
|
+
|
|
54
|
+
> **bootstrap**(`nodeLoggingConnectorType?`): `Promise`\<`boolean`\>
|
|
55
|
+
|
|
56
|
+
Bootstrap the component by creating and initializing any resources it needs.
|
|
57
|
+
|
|
58
|
+
#### Parameters
|
|
59
|
+
|
|
60
|
+
##### nodeLoggingConnectorType?
|
|
61
|
+
|
|
62
|
+
`string`
|
|
63
|
+
|
|
64
|
+
The node logging connector type, defaults to "node-logging".
|
|
65
|
+
|
|
66
|
+
#### Returns
|
|
67
|
+
|
|
68
|
+
`Promise`\<`boolean`\>
|
|
69
|
+
|
|
70
|
+
True if the bootstrapping process was successful.
|
|
71
|
+
|
|
72
|
+
#### Implementation of
|
|
73
|
+
|
|
74
|
+
`IBlobStorageConnector.bootstrap`
|
|
75
|
+
|
|
76
|
+
***
|
|
77
|
+
|
|
54
78
|
### set()
|
|
55
79
|
|
|
56
80
|
> **set**(`blob`): `Promise`\<`string`\>
|
|
@@ -59,7 +83,9 @@ Set the blob.
|
|
|
59
83
|
|
|
60
84
|
#### Parameters
|
|
61
85
|
|
|
62
|
-
|
|
86
|
+
##### blob
|
|
87
|
+
|
|
88
|
+
`Uint8Array`
|
|
63
89
|
|
|
64
90
|
The data for the blob.
|
|
65
91
|
|
|
@@ -77,19 +103,21 @@ The id of the stored blob in urn format.
|
|
|
77
103
|
|
|
78
104
|
### get()
|
|
79
105
|
|
|
80
|
-
> **get**(`id`): `Promise`\<`undefined` \| `Uint8Array
|
|
106
|
+
> **get**(`id`): `Promise`\<`undefined` \| `Uint8Array`\<`ArrayBufferLike`\>\>
|
|
81
107
|
|
|
82
108
|
Get the blob.
|
|
83
109
|
|
|
84
110
|
#### Parameters
|
|
85
111
|
|
|
86
|
-
|
|
112
|
+
##### id
|
|
113
|
+
|
|
114
|
+
`string`
|
|
87
115
|
|
|
88
116
|
The id of the blob to get in urn format.
|
|
89
117
|
|
|
90
118
|
#### Returns
|
|
91
119
|
|
|
92
|
-
`Promise`\<`undefined` \| `Uint8Array
|
|
120
|
+
`Promise`\<`undefined` \| `Uint8Array`\<`ArrayBufferLike`\>\>
|
|
93
121
|
|
|
94
122
|
The data for the blob if it can be found or undefined.
|
|
95
123
|
|
|
@@ -107,7 +135,9 @@ Remove the blob.
|
|
|
107
135
|
|
|
108
136
|
#### Parameters
|
|
109
137
|
|
|
110
|
-
|
|
138
|
+
##### id
|
|
139
|
+
|
|
140
|
+
`string`
|
|
111
141
|
|
|
112
142
|
The id of the blob to remove in urn format.
|
|
113
143
|
|
package/docs/reference/index.md
CHANGED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# Interface: IS3BlobStorageConnectorConstructorOptions
|
|
2
|
+
|
|
3
|
+
Options for the S3 Blob Storage Connector constructor.
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
### config
|
|
8
|
+
|
|
9
|
+
> **config**: [`IS3BlobStorageConnectorConfig`](IS3BlobStorageConnectorConfig.md)
|
|
10
|
+
|
|
11
|
+
The configuration for the connector.
|
package/locales/en.json
CHANGED
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
{
|
|
2
|
+
"info": {
|
|
3
|
+
"s3BlobStorageConnector": {
|
|
4
|
+
"bucketCreating": "Creating bucket \"{bucket}\"",
|
|
5
|
+
"bucketCreated": "Created bucket \"{bucket}\"",
|
|
6
|
+
"bucketExists": "Skipping create bucket \"{bucket}\" as it already exists"
|
|
7
|
+
}
|
|
8
|
+
},
|
|
2
9
|
"error": {
|
|
3
10
|
"s3BlobStorageConnector": {
|
|
11
|
+
"bucketCreateFailed": "Creating bucket \"{bucket}\" failed",
|
|
4
12
|
"namespaceMismatch": "The namespace in the urn \"{id}\" does not match the namespace of the blob storage \"{namespace}\"",
|
|
5
13
|
"getBlobFailed": "Failed to get blob in S3",
|
|
6
14
|
"setBlobFailed": "Failed to set blob in S3",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@twin.org/blob-storage-connector-aws-s3",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.2-next.1",
|
|
4
4
|
"description": "Blob Storage connector implementation using AWS S3",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -14,10 +14,11 @@
|
|
|
14
14
|
"node": ">=20.0.0"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@aws-sdk/client-s3": "
|
|
18
|
-
"@twin.org/blob-storage-models": "0.0.
|
|
17
|
+
"@aws-sdk/client-s3": "3.844.0",
|
|
18
|
+
"@twin.org/blob-storage-models": "0.0.2-next.1",
|
|
19
19
|
"@twin.org/core": "next",
|
|
20
20
|
"@twin.org/crypto": "next",
|
|
21
|
+
"@twin.org/logging-models": "next",
|
|
21
22
|
"@twin.org/nameof": "next"
|
|
22
23
|
},
|
|
23
24
|
"main": "./dist/cjs/index.cjs",
|
|
@@ -25,11 +26,11 @@
|
|
|
25
26
|
"types": "./dist/types/index.d.ts",
|
|
26
27
|
"exports": {
|
|
27
28
|
".": {
|
|
29
|
+
"types": "./dist/types/index.d.ts",
|
|
28
30
|
"require": "./dist/cjs/index.cjs",
|
|
29
|
-
"import": "./dist/esm/index.mjs"
|
|
30
|
-
"types": "./dist/types/index.d.ts"
|
|
31
|
+
"import": "./dist/esm/index.mjs"
|
|
31
32
|
},
|
|
32
|
-
"./locales": "./locales"
|
|
33
|
+
"./locales/*.json": "./locales/*.json"
|
|
33
34
|
},
|
|
34
35
|
"files": [
|
|
35
36
|
"dist/cjs",
|