@breadstone/archipel-mcp 0.0.40 → 0.0.41
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/data/guides/blob-storage.md +20 -16
- package/data/packages/platform-blob-storage/api/Class.AwsS3BlobStorageStrategy.md +197 -0
- package/data/packages/platform-blob-storage/api/Class.AzureBlobStorageStrategy.md +197 -0
- package/data/packages/platform-blob-storage/api/Class.BlobModule.md +20 -10
- package/data/packages/platform-blob-storage/api/Class.BlobService.md +8 -8
- package/data/packages/platform-blob-storage/api/Class.BlobStorageStrategyBase.md +158 -0
- package/data/packages/platform-blob-storage/api/Class.LocalBlobStorageStrategy.md +197 -0
- package/data/packages/platform-blob-storage/api/Class.VercelBlobStorageStrategy.md +198 -0
- package/data/packages/platform-blob-storage/api/Interface.IBlobDeleteRequest.md +4 -4
- package/data/packages/platform-blob-storage/api/Interface.IBlobDownloadRequest.md +5 -5
- package/data/packages/platform-blob-storage/api/Interface.IBlobDownloadResult.md +6 -6
- package/data/packages/platform-blob-storage/api/Interface.IBlobModuleOptions.md +20 -10
- package/data/packages/platform-blob-storage/api/Interface.IBlobObjectMetadata.md +14 -14
- package/data/packages/platform-blob-storage/api/Interface.IBlobSignedUrlRequest.md +5 -5
- package/data/packages/platform-blob-storage/api/Interface.IBlobUploadRequest.md +10 -10
- package/data/packages/platform-blob-storage/api/Interface.IBlobUploadResult.md +3 -3
- package/data/packages/platform-blob-storage/api/TypeAlias.BlobDownloadResponseType.md +1 -1
- package/data/packages/platform-blob-storage/api/TypeAlias.BlobUploadBody.md +1 -1
- package/data/packages/platform-blob-storage/api/Variable.AWS_S3_ACCESS_KEY_ID.md +14 -0
- package/data/packages/platform-blob-storage/api/Variable.AWS_S3_BUCKET.md +14 -0
- package/data/packages/platform-blob-storage/api/Variable.AWS_S3_CONFIG_ENTRIES.md +14 -0
- package/data/packages/platform-blob-storage/api/Variable.AWS_S3_ENDPOINT.md +14 -0
- package/data/packages/platform-blob-storage/api/Variable.AWS_S3_REGION.md +14 -0
- package/data/packages/platform-blob-storage/api/Variable.AWS_S3_SECRET_ACCESS_KEY.md +14 -0
- package/data/packages/platform-blob-storage/api/Variable.AZURE_BLOB_CONNECTION_STRING.md +14 -0
- package/data/packages/platform-blob-storage/api/Variable.AZURE_BLOB_CONTAINER_NAME.md +14 -0
- package/data/packages/platform-blob-storage/api/Variable.AZURE_CONFIG_ENTRIES.md +14 -0
- package/data/packages/platform-blob-storage/api/{Variable.BLOB_PROVIDER.md → Variable.BLOB_STORAGE_STRATEGY_TOKEN.md} +3 -3
- package/data/packages/platform-blob-storage/api/Variable.BlobDownloadResponseTypes.md +5 -5
- package/data/packages/platform-blob-storage/api/Variable.LOCAL_BLOB_BASE_PATH.md +14 -0
- package/data/packages/platform-blob-storage/api/Variable.LOCAL_BLOB_BUCKET.md +14 -0
- package/data/packages/platform-blob-storage/api/Variable.LOCAL_CONFIG_ENTRIES.md +14 -0
- package/data/packages/platform-blob-storage/api/Variable.PLATFORM_BLOB_STORAGE_CONFIG_ENTRIES.md +14 -0
- package/data/packages/platform-blob-storage/api/Variable.VERCEL_BLOB_BUCKET.md +14 -0
- package/data/packages/platform-blob-storage/api/Variable.VERCEL_BLOB_PUBLIC_URL.md +14 -0
- package/data/packages/platform-blob-storage/api/Variable.VERCEL_BLOB_READ_WRITE_TOKEN.md +14 -0
- package/data/packages/platform-blob-storage/api/Variable.VERCEL_BLOB_REGION.md +14 -0
- package/data/packages/platform-blob-storage/api/Variable.VERCEL_BLOB_URL.md +14 -0
- package/data/packages/platform-blob-storage/api/Variable.VERCEL_CONFIG_ENTRIES.md +14 -0
- package/data/packages/platform-blob-storage/api/index.md +26 -18
- package/data/packages/platform-blob-storage/index.md +104 -68
- package/package.json +1 -1
- package/data/packages/platform-blob-storage/api/Class.AwsS3BlobProvider.md +0 -196
- package/data/packages/platform-blob-storage/api/Class.AzureBlobProvider.md +0 -196
- package/data/packages/platform-blob-storage/api/Class.VercelBlobProvider.md +0 -197
- package/data/packages/platform-blob-storage/api/Interface.IAwsS3BlobProviderRegistration.md +0 -28
- package/data/packages/platform-blob-storage/api/Interface.IAwsS3ProviderOptions.md +0 -68
- package/data/packages/platform-blob-storage/api/Interface.IAzureBlobProviderOptions.md +0 -48
- package/data/packages/platform-blob-storage/api/Interface.IAzureBlobProviderRegistration.md +0 -28
- package/data/packages/platform-blob-storage/api/Interface.IBlobProvider.md +0 -114
- package/data/packages/platform-blob-storage/api/Interface.ICustomBlobProviderRegistration.md +0 -28
- package/data/packages/platform-blob-storage/api/Interface.IVercelBlobProviderOptions.md +0 -80
- package/data/packages/platform-blob-storage/api/Interface.IVercelBlobProviderRegistration.md +0 -28
- package/data/packages/platform-blob-storage/api/TypeAlias.IBlobProviderRegistration.md +0 -16
- package/data/packages/platform-blob-storage/api/Variable.AWS_S3_PROVIDER_OPTIONS.md +0 -12
- package/data/packages/platform-blob-storage/api/Variable.AZURE_BLOB_PROVIDER_OPTIONS.md +0 -12
- package/data/packages/platform-blob-storage/api/Variable.BlobProviderKinds.md +0 -26
- package/data/packages/platform-blob-storage/api/Variable.VERCEL_BLOB_PROVIDER_OPTIONS.md +0 -12
|
@@ -18,16 +18,17 @@ yarn add @breadstone/archipel-platform-blob-storage
|
|
|
18
18
|
|
|
19
19
|
---
|
|
20
20
|
|
|
21
|
-
## Choose a
|
|
21
|
+
## Choose a Strategy
|
|
22
22
|
|
|
23
|
-
`platform-blob-storage` abstracts file operations behind a unified `BlobService`. You select the
|
|
23
|
+
`platform-blob-storage` abstracts file operations behind a unified `BlobService`. You select the storage strategy at module registration time. Built-in strategies:
|
|
24
24
|
|
|
25
|
-
|
|
|
26
|
-
|
|
|
27
|
-
| **Vercel**
|
|
28
|
-
| **Azure**
|
|
29
|
-
| **AWS S3**
|
|
30
|
-
| **
|
|
25
|
+
| Strategy | Import subpath | When to use |
|
|
26
|
+
| ----------------------------- | --------------------- | ------------------------------------------- |
|
|
27
|
+
| **Vercel** | `strategies/vercel` | Vercel-hosted apps with Vercel Blob storage |
|
|
28
|
+
| **Azure** | `strategies/azure` | Azure Blob Storage accounts |
|
|
29
|
+
| **AWS S3** | `strategies/aws-s3` | Amazon S3 or S3-compatible providers |
|
|
30
|
+
| **Local** | `strategies/local` | Local filesystem (development / testing) |
|
|
31
|
+
| **Custom** | — | Extend `BlobStorageStrategyBase` |
|
|
31
32
|
|
|
32
33
|
---
|
|
33
34
|
|
|
@@ -35,14 +36,14 @@ yarn add @breadstone/archipel-platform-blob-storage
|
|
|
35
36
|
|
|
36
37
|
```typescript
|
|
37
38
|
import { Module } from '@nestjs/common';
|
|
38
|
-
import { BlobModule
|
|
39
|
+
import { BlobModule } from '@breadstone/archipel-platform-blob-storage';
|
|
40
|
+
import { AwsS3BlobStorageStrategy, AWS_S3_CONFIG_ENTRIES } from '@breadstone/archipel-platform-blob-storage/strategies/aws-s3';
|
|
39
41
|
|
|
40
42
|
@Module({
|
|
41
43
|
imports: [
|
|
42
|
-
BlobModule.
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
},
|
|
44
|
+
BlobModule.register({
|
|
45
|
+
storageStrategy: AwsS3BlobStorageStrategy,
|
|
46
|
+
configEntries: AWS_S3_CONFIG_ENTRIES,
|
|
46
47
|
}),
|
|
47
48
|
],
|
|
48
49
|
})
|
|
@@ -234,8 +235,11 @@ export class PrismaBlobVariantAdapter extends BlobVariantPersistencePort {
|
|
|
234
235
|
### Register with Persistence
|
|
235
236
|
|
|
236
237
|
```typescript
|
|
237
|
-
|
|
238
|
-
|
|
238
|
+
import { AwsS3BlobStorageStrategy, AWS_S3_CONFIG_ENTRIES } from '@breadstone/archipel-platform-blob-storage/strategies/aws-s3';
|
|
239
|
+
|
|
240
|
+
BlobModule.register({
|
|
241
|
+
storageStrategy: AwsS3BlobStorageStrategy,
|
|
242
|
+
configEntries: AWS_S3_CONFIG_ENTRIES,
|
|
239
243
|
objectPersistence: PrismaBlobObjectAdapter,
|
|
240
244
|
variantPersistence: PrismaBlobVariantAdapter,
|
|
241
245
|
}),
|
|
@@ -245,7 +249,7 @@ BlobModule.forRoot({
|
|
|
245
249
|
|
|
246
250
|
## Security
|
|
247
251
|
|
|
248
|
-
All built-in blob
|
|
252
|
+
All built-in blob storage strategies (AWS S3, Azure, Vercel, Local) apply automatic key normalization via the internal `normalizeKey` method before any storage operation. This includes:
|
|
249
253
|
|
|
250
254
|
- **Path traversal prevention** — segments such as `..` and `.` are removed so callers cannot escape the intended directory.
|
|
251
255
|
- **Backslash normalization** — backslashes (`\`) are converted to forward slashes before processing.
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: 'Class: AwsS3BlobStorageStrategy'
|
|
3
|
+
generated: true
|
|
4
|
+
editUrl: false
|
|
5
|
+
---
|
|
6
|
+
# Class: AwsS3BlobStorageStrategy
|
|
7
|
+
|
|
8
|
+
Defined in: [strategies/aws-s3/AwsS3BlobStorageStrategy.ts:26](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-blob-storage/src/strategies/aws-s3/AwsS3BlobStorageStrategy.ts#L26)
|
|
9
|
+
|
|
10
|
+
Provides a blob storage strategy backed by Amazon S3.
|
|
11
|
+
|
|
12
|
+
## Extends
|
|
13
|
+
|
|
14
|
+
- [`BlobStorageStrategyBase`](Class.BlobStorageStrategyBase)
|
|
15
|
+
|
|
16
|
+
## Constructors
|
|
17
|
+
|
|
18
|
+
### Constructor
|
|
19
|
+
|
|
20
|
+
```ts
|
|
21
|
+
new AwsS3BlobStorageStrategy(configService): AwsS3BlobStorageStrategy;
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Defined in: [strategies/aws-s3/AwsS3BlobStorageStrategy.ts:47](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-blob-storage/src/strategies/aws-s3/AwsS3BlobStorageStrategy.ts#L47)
|
|
25
|
+
|
|
26
|
+
Initializes a new instance of the AwsS3BlobStorageStrategy class.
|
|
27
|
+
|
|
28
|
+
#### Parameters
|
|
29
|
+
|
|
30
|
+
| Parameter | Type | Description |
|
|
31
|
+
| ------ | ------ | ------ |
|
|
32
|
+
| `configService` | `ConfigService` | The configuration service providing environment values. |
|
|
33
|
+
|
|
34
|
+
#### Returns
|
|
35
|
+
|
|
36
|
+
`AwsS3BlobStorageStrategy`
|
|
37
|
+
|
|
38
|
+
#### Overrides
|
|
39
|
+
|
|
40
|
+
[`BlobStorageStrategyBase`](Class.BlobStorageStrategyBase).[`constructor`](Class.BlobStorageStrategyBase#constructor)
|
|
41
|
+
|
|
42
|
+
## Properties
|
|
43
|
+
|
|
44
|
+
### providerId
|
|
45
|
+
|
|
46
|
+
```ts
|
|
47
|
+
readonly providerId: string = 'aws-s3';
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Defined in: [strategies/aws-s3/AwsS3BlobStorageStrategy.ts:77](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-blob-storage/src/strategies/aws-s3/AwsS3BlobStorageStrategy.ts#L77)
|
|
51
|
+
|
|
52
|
+
Gets the unique identifier for this storage provider.
|
|
53
|
+
|
|
54
|
+
#### Overrides
|
|
55
|
+
|
|
56
|
+
[`BlobStorageStrategyBase`](Class.BlobStorageStrategyBase).[`providerId`](Class.BlobStorageStrategyBase#providerid)
|
|
57
|
+
|
|
58
|
+
## Accessors
|
|
59
|
+
|
|
60
|
+
### defaultBucket
|
|
61
|
+
|
|
62
|
+
#### Get Signature
|
|
63
|
+
|
|
64
|
+
```ts
|
|
65
|
+
get defaultBucket(): string;
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Defined in: [strategies/aws-s3/AwsS3BlobStorageStrategy.ts:80](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-blob-storage/src/strategies/aws-s3/AwsS3BlobStorageStrategy.ts#L80)
|
|
69
|
+
|
|
70
|
+
Gets the default bucket (container/directory) configured for the provider.
|
|
71
|
+
|
|
72
|
+
##### Returns
|
|
73
|
+
|
|
74
|
+
`string`
|
|
75
|
+
|
|
76
|
+
Gets the default bucket (container/directory) configured for the provider.
|
|
77
|
+
|
|
78
|
+
#### Overrides
|
|
79
|
+
|
|
80
|
+
[`BlobStorageStrategyBase`](Class.BlobStorageStrategyBase).[`defaultBucket`](Class.BlobStorageStrategyBase#defaultbucket)
|
|
81
|
+
|
|
82
|
+
## Methods
|
|
83
|
+
|
|
84
|
+
### createSignedUrl()
|
|
85
|
+
|
|
86
|
+
```ts
|
|
87
|
+
createSignedUrl(request): Promise<string>;
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
Defined in: [strategies/aws-s3/AwsS3BlobStorageStrategy.ts:177](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-blob-storage/src/strategies/aws-s3/AwsS3BlobStorageStrategy.ts#L177)
|
|
91
|
+
|
|
92
|
+
Creates a signed URL for the specified blob object.
|
|
93
|
+
Not all providers support this operation.
|
|
94
|
+
|
|
95
|
+
#### Parameters
|
|
96
|
+
|
|
97
|
+
| Parameter | Type | Description |
|
|
98
|
+
| ------ | ------ | ------ |
|
|
99
|
+
| `request` | [`IBlobSignedUrlRequest`](Interface.IBlobSignedUrlRequest) | The request describing the object to link. |
|
|
100
|
+
|
|
101
|
+
#### Returns
|
|
102
|
+
|
|
103
|
+
`Promise`\<`string`\>
|
|
104
|
+
|
|
105
|
+
The generated signed URL.
|
|
106
|
+
|
|
107
|
+
#### Overrides
|
|
108
|
+
|
|
109
|
+
[`BlobStorageStrategyBase`](Class.BlobStorageStrategyBase).[`createSignedUrl`](Class.BlobStorageStrategyBase#createsignedurl)
|
|
110
|
+
|
|
111
|
+
***
|
|
112
|
+
|
|
113
|
+
### deleteObject()
|
|
114
|
+
|
|
115
|
+
```ts
|
|
116
|
+
deleteObject(request): Promise<void>;
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
Defined in: [strategies/aws-s3/AwsS3BlobStorageStrategy.ts:159](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-blob-storage/src/strategies/aws-s3/AwsS3BlobStorageStrategy.ts#L159)
|
|
120
|
+
|
|
121
|
+
Deletes a blob object from the storage backend.
|
|
122
|
+
|
|
123
|
+
#### Parameters
|
|
124
|
+
|
|
125
|
+
| Parameter | Type | Description |
|
|
126
|
+
| ------ | ------ | ------ |
|
|
127
|
+
| `request` | [`IBlobDeleteRequest`](Interface.IBlobDeleteRequest) | The delete request describing the object to remove. |
|
|
128
|
+
|
|
129
|
+
#### Returns
|
|
130
|
+
|
|
131
|
+
`Promise`\<`void`\>
|
|
132
|
+
|
|
133
|
+
#### Overrides
|
|
134
|
+
|
|
135
|
+
[`BlobStorageStrategyBase`](Class.BlobStorageStrategyBase).[`deleteObject`](Class.BlobStorageStrategyBase#deleteobject)
|
|
136
|
+
|
|
137
|
+
***
|
|
138
|
+
|
|
139
|
+
### downloadObject()
|
|
140
|
+
|
|
141
|
+
```ts
|
|
142
|
+
downloadObject<TData>(request): Promise<IBlobDownloadResult<TData>>;
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
Defined in: [strategies/aws-s3/AwsS3BlobStorageStrategy.ts:134](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-blob-storage/src/strategies/aws-s3/AwsS3BlobStorageStrategy.ts#L134)
|
|
146
|
+
|
|
147
|
+
Downloads a blob object from the storage backend.
|
|
148
|
+
|
|
149
|
+
#### Type Parameters
|
|
150
|
+
|
|
151
|
+
| Type Parameter |
|
|
152
|
+
| ------ |
|
|
153
|
+
| `TData` |
|
|
154
|
+
|
|
155
|
+
#### Parameters
|
|
156
|
+
|
|
157
|
+
| Parameter | Type | Description |
|
|
158
|
+
| ------ | ------ | ------ |
|
|
159
|
+
| `request` | [`IBlobDownloadRequest`](Interface.IBlobDownloadRequest) | The download request describing the object to download. |
|
|
160
|
+
|
|
161
|
+
#### Returns
|
|
162
|
+
|
|
163
|
+
`Promise`\<[`IBlobDownloadResult`](Interface.IBlobDownloadResult)\<`TData`\>\>
|
|
164
|
+
|
|
165
|
+
The download result including payload and metadata.
|
|
166
|
+
|
|
167
|
+
#### Overrides
|
|
168
|
+
|
|
169
|
+
[`BlobStorageStrategyBase`](Class.BlobStorageStrategyBase).[`downloadObject`](Class.BlobStorageStrategyBase#downloadobject)
|
|
170
|
+
|
|
171
|
+
***
|
|
172
|
+
|
|
173
|
+
### uploadObject()
|
|
174
|
+
|
|
175
|
+
```ts
|
|
176
|
+
uploadObject(request): Promise<IBlobUploadResult>;
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
Defined in: [strategies/aws-s3/AwsS3BlobStorageStrategy.ts:89](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-blob-storage/src/strategies/aws-s3/AwsS3BlobStorageStrategy.ts#L89)
|
|
180
|
+
|
|
181
|
+
Uploads a blob object to the storage backend.
|
|
182
|
+
|
|
183
|
+
#### Parameters
|
|
184
|
+
|
|
185
|
+
| Parameter | Type | Description |
|
|
186
|
+
| ------ | ------ | ------ |
|
|
187
|
+
| `request` | [`IBlobUploadRequest`](Interface.IBlobUploadRequest) | The upload request describing the object to upload. |
|
|
188
|
+
|
|
189
|
+
#### Returns
|
|
190
|
+
|
|
191
|
+
`Promise`\<[`IBlobUploadResult`](Interface.IBlobUploadResult)\>
|
|
192
|
+
|
|
193
|
+
The resulting upload metadata.
|
|
194
|
+
|
|
195
|
+
#### Overrides
|
|
196
|
+
|
|
197
|
+
[`BlobStorageStrategyBase`](Class.BlobStorageStrategyBase).[`uploadObject`](Class.BlobStorageStrategyBase#uploadobject)
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: 'Class: AzureBlobStorageStrategy'
|
|
3
|
+
generated: true
|
|
4
|
+
editUrl: false
|
|
5
|
+
---
|
|
6
|
+
# Class: AzureBlobStorageStrategy
|
|
7
|
+
|
|
8
|
+
Defined in: [strategies/azure/AzureBlobStorageStrategy.ts:25](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-blob-storage/src/strategies/azure/AzureBlobStorageStrategy.ts#L25)
|
|
9
|
+
|
|
10
|
+
Provides a blob storage strategy backed by Microsoft Azure Blob Storage.
|
|
11
|
+
|
|
12
|
+
## Extends
|
|
13
|
+
|
|
14
|
+
- [`BlobStorageStrategyBase`](Class.BlobStorageStrategyBase)
|
|
15
|
+
|
|
16
|
+
## Constructors
|
|
17
|
+
|
|
18
|
+
### Constructor
|
|
19
|
+
|
|
20
|
+
```ts
|
|
21
|
+
new AzureBlobStorageStrategy(configService): AzureBlobStorageStrategy;
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Defined in: [strategies/azure/AzureBlobStorageStrategy.ts:44](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-blob-storage/src/strategies/azure/AzureBlobStorageStrategy.ts#L44)
|
|
25
|
+
|
|
26
|
+
Initializes a new instance of the AzureBlobStorageStrategy class.
|
|
27
|
+
|
|
28
|
+
#### Parameters
|
|
29
|
+
|
|
30
|
+
| Parameter | Type | Description |
|
|
31
|
+
| ------ | ------ | ------ |
|
|
32
|
+
| `configService` | `ConfigService` | The configuration service providing environment values. |
|
|
33
|
+
|
|
34
|
+
#### Returns
|
|
35
|
+
|
|
36
|
+
`AzureBlobStorageStrategy`
|
|
37
|
+
|
|
38
|
+
#### Overrides
|
|
39
|
+
|
|
40
|
+
[`BlobStorageStrategyBase`](Class.BlobStorageStrategyBase).[`constructor`](Class.BlobStorageStrategyBase#constructor)
|
|
41
|
+
|
|
42
|
+
## Properties
|
|
43
|
+
|
|
44
|
+
### providerId
|
|
45
|
+
|
|
46
|
+
```ts
|
|
47
|
+
readonly providerId: string = 'azure';
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Defined in: [strategies/azure/AzureBlobStorageStrategy.ts:67](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-blob-storage/src/strategies/azure/AzureBlobStorageStrategy.ts#L67)
|
|
51
|
+
|
|
52
|
+
Gets the unique identifier for this storage provider.
|
|
53
|
+
|
|
54
|
+
#### Overrides
|
|
55
|
+
|
|
56
|
+
[`BlobStorageStrategyBase`](Class.BlobStorageStrategyBase).[`providerId`](Class.BlobStorageStrategyBase#providerid)
|
|
57
|
+
|
|
58
|
+
## Accessors
|
|
59
|
+
|
|
60
|
+
### defaultBucket
|
|
61
|
+
|
|
62
|
+
#### Get Signature
|
|
63
|
+
|
|
64
|
+
```ts
|
|
65
|
+
get defaultBucket(): string;
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Defined in: [strategies/azure/AzureBlobStorageStrategy.ts:70](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-blob-storage/src/strategies/azure/AzureBlobStorageStrategy.ts#L70)
|
|
69
|
+
|
|
70
|
+
Gets the default bucket (container/directory) configured for the provider.
|
|
71
|
+
|
|
72
|
+
##### Returns
|
|
73
|
+
|
|
74
|
+
`string`
|
|
75
|
+
|
|
76
|
+
Gets the default bucket (container/directory) configured for the provider.
|
|
77
|
+
|
|
78
|
+
#### Overrides
|
|
79
|
+
|
|
80
|
+
[`BlobStorageStrategyBase`](Class.BlobStorageStrategyBase).[`defaultBucket`](Class.BlobStorageStrategyBase#defaultbucket)
|
|
81
|
+
|
|
82
|
+
## Methods
|
|
83
|
+
|
|
84
|
+
### createSignedUrl()
|
|
85
|
+
|
|
86
|
+
```ts
|
|
87
|
+
createSignedUrl(request): Promise<string>;
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
Defined in: [strategies/azure/AzureBlobStorageStrategy.ts:154](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-blob-storage/src/strategies/azure/AzureBlobStorageStrategy.ts#L154)
|
|
91
|
+
|
|
92
|
+
Creates a signed URL for the specified blob object.
|
|
93
|
+
Not all providers support this operation.
|
|
94
|
+
|
|
95
|
+
#### Parameters
|
|
96
|
+
|
|
97
|
+
| Parameter | Type | Description |
|
|
98
|
+
| ------ | ------ | ------ |
|
|
99
|
+
| `request` | [`IBlobSignedUrlRequest`](Interface.IBlobSignedUrlRequest) | The request describing the object to link. |
|
|
100
|
+
|
|
101
|
+
#### Returns
|
|
102
|
+
|
|
103
|
+
`Promise`\<`string`\>
|
|
104
|
+
|
|
105
|
+
The generated signed URL.
|
|
106
|
+
|
|
107
|
+
#### Overrides
|
|
108
|
+
|
|
109
|
+
[`BlobStorageStrategyBase`](Class.BlobStorageStrategyBase).[`createSignedUrl`](Class.BlobStorageStrategyBase#createsignedurl)
|
|
110
|
+
|
|
111
|
+
***
|
|
112
|
+
|
|
113
|
+
### deleteObject()
|
|
114
|
+
|
|
115
|
+
```ts
|
|
116
|
+
deleteObject(request): Promise<void>;
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
Defined in: [strategies/azure/AzureBlobStorageStrategy.ts:141](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-blob-storage/src/strategies/azure/AzureBlobStorageStrategy.ts#L141)
|
|
120
|
+
|
|
121
|
+
Deletes a blob object from the storage backend.
|
|
122
|
+
|
|
123
|
+
#### Parameters
|
|
124
|
+
|
|
125
|
+
| Parameter | Type | Description |
|
|
126
|
+
| ------ | ------ | ------ |
|
|
127
|
+
| `request` | [`IBlobDeleteRequest`](Interface.IBlobDeleteRequest) | The delete request describing the object to remove. |
|
|
128
|
+
|
|
129
|
+
#### Returns
|
|
130
|
+
|
|
131
|
+
`Promise`\<`void`\>
|
|
132
|
+
|
|
133
|
+
#### Overrides
|
|
134
|
+
|
|
135
|
+
[`BlobStorageStrategyBase`](Class.BlobStorageStrategyBase).[`deleteObject`](Class.BlobStorageStrategyBase#deleteobject)
|
|
136
|
+
|
|
137
|
+
***
|
|
138
|
+
|
|
139
|
+
### downloadObject()
|
|
140
|
+
|
|
141
|
+
```ts
|
|
142
|
+
downloadObject<TData>(request): Promise<IBlobDownloadResult<TData>>;
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
Defined in: [strategies/azure/AzureBlobStorageStrategy.ts:121](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-blob-storage/src/strategies/azure/AzureBlobStorageStrategy.ts#L121)
|
|
146
|
+
|
|
147
|
+
Downloads a blob object from the storage backend.
|
|
148
|
+
|
|
149
|
+
#### Type Parameters
|
|
150
|
+
|
|
151
|
+
| Type Parameter |
|
|
152
|
+
| ------ |
|
|
153
|
+
| `TData` |
|
|
154
|
+
|
|
155
|
+
#### Parameters
|
|
156
|
+
|
|
157
|
+
| Parameter | Type | Description |
|
|
158
|
+
| ------ | ------ | ------ |
|
|
159
|
+
| `request` | [`IBlobDownloadRequest`](Interface.IBlobDownloadRequest) | The download request describing the object to download. |
|
|
160
|
+
|
|
161
|
+
#### Returns
|
|
162
|
+
|
|
163
|
+
`Promise`\<[`IBlobDownloadResult`](Interface.IBlobDownloadResult)\<`TData`\>\>
|
|
164
|
+
|
|
165
|
+
The download result including payload and metadata.
|
|
166
|
+
|
|
167
|
+
#### Overrides
|
|
168
|
+
|
|
169
|
+
[`BlobStorageStrategyBase`](Class.BlobStorageStrategyBase).[`downloadObject`](Class.BlobStorageStrategyBase#downloadobject)
|
|
170
|
+
|
|
171
|
+
***
|
|
172
|
+
|
|
173
|
+
### uploadObject()
|
|
174
|
+
|
|
175
|
+
```ts
|
|
176
|
+
uploadObject(request): Promise<IBlobUploadResult>;
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
Defined in: [strategies/azure/AzureBlobStorageStrategy.ts:79](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-blob-storage/src/strategies/azure/AzureBlobStorageStrategy.ts#L79)
|
|
180
|
+
|
|
181
|
+
Uploads a blob object to the storage backend.
|
|
182
|
+
|
|
183
|
+
#### Parameters
|
|
184
|
+
|
|
185
|
+
| Parameter | Type | Description |
|
|
186
|
+
| ------ | ------ | ------ |
|
|
187
|
+
| `request` | [`IBlobUploadRequest`](Interface.IBlobUploadRequest) | The upload request describing the object to upload. |
|
|
188
|
+
|
|
189
|
+
#### Returns
|
|
190
|
+
|
|
191
|
+
`Promise`\<[`IBlobUploadResult`](Interface.IBlobUploadResult)\>
|
|
192
|
+
|
|
193
|
+
The resulting upload metadata.
|
|
194
|
+
|
|
195
|
+
#### Overrides
|
|
196
|
+
|
|
197
|
+
[`BlobStorageStrategyBase`](Class.BlobStorageStrategyBase).[`uploadObject`](Class.BlobStorageStrategyBase#uploadobject)
|
|
@@ -5,9 +5,22 @@ editUrl: false
|
|
|
5
5
|
---
|
|
6
6
|
# Class: BlobModule
|
|
7
7
|
|
|
8
|
-
Defined in: [BlobModule.ts:
|
|
8
|
+
Defined in: [BlobModule.ts:47](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-blob-storage/src/BlobModule.ts#L47)
|
|
9
9
|
|
|
10
10
|
NestJS module responsible for providing blob storage services.
|
|
11
|
+
Uses a strategy pattern to support pluggable storage backends.
|
|
12
|
+
|
|
13
|
+
## Example
|
|
14
|
+
|
|
15
|
+
```typescript
|
|
16
|
+
import { BlobModule } from '@breadstone/archipel-platform-blob-storage';
|
|
17
|
+
import { VercelBlobStorageStrategy, VERCEL_CONFIG_ENTRIES } from '@breadstone/archipel-platform-blob-storage/strategies/vercel';
|
|
18
|
+
|
|
19
|
+
BlobModule.register({
|
|
20
|
+
storageStrategy: VercelBlobStorageStrategy,
|
|
21
|
+
configEntries: VERCEL_CONFIG_ENTRIES,
|
|
22
|
+
});
|
|
23
|
+
```
|
|
11
24
|
|
|
12
25
|
## Constructors
|
|
13
26
|
|
|
@@ -23,27 +36,24 @@ new BlobModule(): BlobModule;
|
|
|
23
36
|
|
|
24
37
|
## Methods
|
|
25
38
|
|
|
26
|
-
###
|
|
39
|
+
### register()
|
|
27
40
|
|
|
28
41
|
```ts
|
|
29
|
-
static
|
|
42
|
+
static register(options): DynamicModule;
|
|
30
43
|
```
|
|
31
44
|
|
|
32
|
-
Defined in: [BlobModule.ts:
|
|
45
|
+
Defined in: [BlobModule.ts:57](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-blob-storage/src/BlobModule.ts#L57)
|
|
33
46
|
|
|
34
|
-
Configures the module with the specified
|
|
35
|
-
When `objectPersistence` / `variantPersistence` are provided the
|
|
36
|
-
corresponding adapters are registered as ports. Otherwise the
|
|
37
|
-
service works without metadata tracking.
|
|
47
|
+
Configures the module with the specified storage strategy.
|
|
38
48
|
|
|
39
49
|
#### Parameters
|
|
40
50
|
|
|
41
51
|
| Parameter | Type | Description |
|
|
42
52
|
| ------ | ------ | ------ |
|
|
43
|
-
| `options
|
|
53
|
+
| `options` | [`IBlobModuleOptions`](Interface.IBlobModuleOptions) | The module configuration options. |
|
|
44
54
|
|
|
45
55
|
#### Returns
|
|
46
56
|
|
|
47
57
|
`DynamicModule`
|
|
48
58
|
|
|
49
|
-
Dynamic module definition
|
|
59
|
+
Dynamic module definition.
|
|
@@ -15,7 +15,7 @@ Provides a generic abstraction for blob storage operations independent of the un
|
|
|
15
15
|
|
|
16
16
|
```ts
|
|
17
17
|
new BlobService(
|
|
18
|
-
|
|
18
|
+
storageStrategy,
|
|
19
19
|
objectPersistence,
|
|
20
20
|
variantPersistence): BlobService;
|
|
21
21
|
```
|
|
@@ -28,7 +28,7 @@ Initializes a new instance of the BlobService class.
|
|
|
28
28
|
|
|
29
29
|
| Parameter | Type | Description |
|
|
30
30
|
| ------ | ------ | ------ |
|
|
31
|
-
| `
|
|
31
|
+
| `storageStrategy` | [`BlobStorageStrategyBase`](Class.BlobStorageStrategyBase) | The concrete blob storage strategy implementation. |
|
|
32
32
|
| `objectPersistence` | \| [`BlobObjectPersistencePort`](Class.BlobObjectPersistencePort) \| `null` | Optional port persisting original blob metadata. |
|
|
33
33
|
| `variantPersistence` | \| [`BlobVariantPersistencePort`](Class.BlobVariantPersistencePort) \| `null` | Optional port persisting derived blob metadata. |
|
|
34
34
|
|
|
@@ -44,7 +44,7 @@ Initializes a new instance of the BlobService class.
|
|
|
44
44
|
createSignedUrl(request): Promise<string>;
|
|
45
45
|
```
|
|
46
46
|
|
|
47
|
-
Defined in: [services/BlobService.ts:
|
|
47
|
+
Defined in: [services/BlobService.ts:121](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-blob-storage/src/services/BlobService.ts#L121)
|
|
48
48
|
|
|
49
49
|
Generates a signed URL for the specified object.
|
|
50
50
|
|
|
@@ -68,7 +68,7 @@ A signed URL that can be used to access the object.
|
|
|
68
68
|
deleteFile(key): Promise<void>;
|
|
69
69
|
```
|
|
70
70
|
|
|
71
|
-
Defined in: [services/BlobService.ts:
|
|
71
|
+
Defined in: [services/BlobService.ts:171](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-blob-storage/src/services/BlobService.ts#L171)
|
|
72
72
|
|
|
73
73
|
Deletes a file by key.
|
|
74
74
|
|
|
@@ -90,7 +90,7 @@ Deletes a file by key.
|
|
|
90
90
|
deleteObject(request): Promise<void>;
|
|
91
91
|
```
|
|
92
92
|
|
|
93
|
-
Defined in: [services/BlobService.ts:
|
|
93
|
+
Defined in: [services/BlobService.ts:108](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-blob-storage/src/services/BlobService.ts#L108)
|
|
94
94
|
|
|
95
95
|
Deletes an object from the configured blob provider.
|
|
96
96
|
|
|
@@ -112,7 +112,7 @@ Deletes an object from the configured blob provider.
|
|
|
112
112
|
downloadFile<TData>(key, responseType?): Promise<IBlobDownloadResult<TData>>;
|
|
113
113
|
```
|
|
114
114
|
|
|
115
|
-
Defined in: [services/BlobService.ts:
|
|
115
|
+
Defined in: [services/BlobService.ts:156](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-blob-storage/src/services/BlobService.ts#L156)
|
|
116
116
|
|
|
117
117
|
Downloads a file by key.
|
|
118
118
|
|
|
@@ -143,7 +143,7 @@ The downloaded data and related metadata.
|
|
|
143
143
|
downloadObject<TData>(request): Promise<IBlobDownloadResult<TData>>;
|
|
144
144
|
```
|
|
145
145
|
|
|
146
|
-
Defined in: [services/BlobService.ts:
|
|
146
|
+
Defined in: [services/BlobService.ts:98](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-blob-storage/src/services/BlobService.ts#L98)
|
|
147
147
|
|
|
148
148
|
Downloads an object from the configured blob provider.
|
|
149
149
|
|
|
@@ -176,7 +176,7 @@ uploadFile(
|
|
|
176
176
|
contentType?): Promise<IBlobUploadResult>;
|
|
177
177
|
```
|
|
178
178
|
|
|
179
|
-
Defined in: [services/BlobService.ts:
|
|
179
|
+
Defined in: [services/BlobService.ts:138](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-blob-storage/src/services/BlobService.ts#L138)
|
|
180
180
|
|
|
181
181
|
Uploads a buffer using the provided key.
|
|
182
182
|
|