@breadstone/archipel-mcp 0.0.39 → 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/data/packages/platform-core/api/Class.ProblemDetailResponse.md +115 -0
- package/data/packages/platform-core/api/index.md +1 -0
- package/data/packages/platform-openapi/api/Function.Api.md +1 -1
- 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
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: 'Variable: VERCEL\_BLOB\_READ\_WRITE\_TOKEN'
|
|
3
|
+
generated: true
|
|
4
|
+
editUrl: false
|
|
5
|
+
---
|
|
6
|
+
# Variable: VERCEL\_BLOB\_READ\_WRITE\_TOKEN
|
|
7
|
+
|
|
8
|
+
```ts
|
|
9
|
+
const VERCEL_BLOB_READ_WRITE_TOKEN: IConfigKey<string>;
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
Defined in: [strategies/vercel/env.ts:13](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-blob-storage/src/strategies/vercel/env.ts#L13)
|
|
13
|
+
|
|
14
|
+
Vercel Blob read/write access token.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: 'Variable: VERCEL\_BLOB\_REGION'
|
|
3
|
+
generated: true
|
|
4
|
+
editUrl: false
|
|
5
|
+
---
|
|
6
|
+
# Variable: VERCEL\_BLOB\_REGION
|
|
7
|
+
|
|
8
|
+
```ts
|
|
9
|
+
const VERCEL_BLOB_REGION: IConfigKey<string>;
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
Defined in: [strategies/vercel/env.ts:19](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-blob-storage/src/strategies/vercel/env.ts#L19)
|
|
13
|
+
|
|
14
|
+
Vercel Blob region.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: 'Variable: VERCEL\_BLOB\_URL'
|
|
3
|
+
generated: true
|
|
4
|
+
editUrl: false
|
|
5
|
+
---
|
|
6
|
+
# Variable: VERCEL\_BLOB\_URL
|
|
7
|
+
|
|
8
|
+
```ts
|
|
9
|
+
const VERCEL_BLOB_URL: IConfigKey<string>;
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
Defined in: [strategies/vercel/env.ts:10](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-blob-storage/src/strategies/vercel/env.ts#L10)
|
|
13
|
+
|
|
14
|
+
Vercel Blob API URL.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: 'Variable: VERCEL\_CONFIG\_ENTRIES'
|
|
3
|
+
generated: true
|
|
4
|
+
editUrl: false
|
|
5
|
+
---
|
|
6
|
+
# Variable: VERCEL\_CONFIG\_ENTRIES
|
|
7
|
+
|
|
8
|
+
```ts
|
|
9
|
+
const VERCEL_CONFIG_ENTRIES: ReadonlyArray<Omit<IConfigRegistryEntry, "module">>;
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
Defined in: [strategies/vercel/env.ts:25](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-blob-storage/src/strategies/vercel/env.ts#L25)
|
|
13
|
+
|
|
14
|
+
Configuration entries required by the Vercel blob storage strategy.
|
|
@@ -9,35 +9,29 @@ editUrl: false
|
|
|
9
9
|
|
|
10
10
|
| Class | Description |
|
|
11
11
|
| ------ | ------ |
|
|
12
|
-
| [
|
|
13
|
-
| [
|
|
12
|
+
| [AwsS3BlobStorageStrategy](Class.AwsS3BlobStorageStrategy) | Provides a blob storage strategy backed by Amazon S3. |
|
|
13
|
+
| [AzureBlobStorageStrategy](Class.AzureBlobStorageStrategy) | Provides a blob storage strategy backed by Microsoft Azure Blob Storage. |
|
|
14
14
|
| [BlobHealthIndicator](Class.BlobHealthIndicator) | Health indicator for blob storage service. |
|
|
15
|
-
| [BlobModule](Class.BlobModule) | NestJS module responsible for providing blob storage services. |
|
|
15
|
+
| [BlobModule](Class.BlobModule) | NestJS module responsible for providing blob storage services. Uses a strategy pattern to support pluggable storage backends. |
|
|
16
16
|
| [BlobObjectPersistencePort](Class.BlobObjectPersistencePort) | Abstract port for persisting blob object metadata. Consuming projects must provide a concrete implementation (e.g. backed by Prisma, Mongo, etc.) and register it via `BlobModule.forRoot({ objectPersistence: MyAdapter })`. |
|
|
17
17
|
| [BlobService](Class.BlobService) | Provides a generic abstraction for blob storage operations independent of the underlying provider. |
|
|
18
|
+
| [BlobStorageStrategyBase](Class.BlobStorageStrategyBase) | Abstract base class for blob storage strategies. Every concrete provider (AWS S3, Azure, Vercel, Local, etc.) must extend this class. Serves as both the type contract and the NestJS DI token type reference. |
|
|
18
19
|
| [BlobVariantPersistencePort](Class.BlobVariantPersistencePort) | Abstract port for persisting blob variant metadata. Consuming projects must provide a concrete implementation and register it via `BlobModule.forRoot({ variantPersistence: MyAdapter })`. |
|
|
19
|
-
| [
|
|
20
|
+
| [LocalBlobStorageStrategy](Class.LocalBlobStorageStrategy) | Provides a blob storage strategy backed by the local filesystem. |
|
|
21
|
+
| [VercelBlobStorageStrategy](Class.VercelBlobStorageStrategy) | Provides a blob storage strategy backed by the Vercel Blob API. |
|
|
20
22
|
|
|
21
23
|
## Interfaces
|
|
22
24
|
|
|
23
25
|
| Interface | Description |
|
|
24
26
|
| ------ | ------ |
|
|
25
|
-
| [IAwsS3BlobProviderRegistration](Interface.IAwsS3BlobProviderRegistration) | - |
|
|
26
|
-
| [IAwsS3ProviderOptions](Interface.IAwsS3ProviderOptions) | - |
|
|
27
|
-
| [IAzureBlobProviderOptions](Interface.IAzureBlobProviderOptions) | - |
|
|
28
|
-
| [IAzureBlobProviderRegistration](Interface.IAzureBlobProviderRegistration) | - |
|
|
29
27
|
| [IBlobDeleteRequest](Interface.IBlobDeleteRequest) | - |
|
|
30
28
|
| [IBlobDownloadRequest](Interface.IBlobDownloadRequest) | - |
|
|
31
29
|
| [IBlobDownloadResult](Interface.IBlobDownloadResult) | - |
|
|
32
30
|
| [IBlobModuleOptions](Interface.IBlobModuleOptions) | - |
|
|
33
31
|
| [IBlobObjectMetadata](Interface.IBlobObjectMetadata) | - |
|
|
34
|
-
| [IBlobProvider](Interface.IBlobProvider) | - |
|
|
35
32
|
| [IBlobSignedUrlRequest](Interface.IBlobSignedUrlRequest) | - |
|
|
36
33
|
| [IBlobUploadRequest](Interface.IBlobUploadRequest) | - |
|
|
37
34
|
| [IBlobUploadResult](Interface.IBlobUploadResult) | - |
|
|
38
|
-
| [ICustomBlobProviderRegistration](Interface.ICustomBlobProviderRegistration) | - |
|
|
39
|
-
| [IVercelBlobProviderOptions](Interface.IVercelBlobProviderOptions) | - |
|
|
40
|
-
| [IVercelBlobProviderRegistration](Interface.IVercelBlobProviderRegistration) | - |
|
|
41
35
|
|
|
42
36
|
## Type Aliases
|
|
43
37
|
|
|
@@ -45,15 +39,29 @@ editUrl: false
|
|
|
45
39
|
| ------ | ------ |
|
|
46
40
|
| [BlobDownloadResponseType](TypeAlias.BlobDownloadResponseType) | - |
|
|
47
41
|
| [BlobUploadBody](TypeAlias.BlobUploadBody) | - |
|
|
48
|
-
| [IBlobProviderRegistration](TypeAlias.IBlobProviderRegistration) | - |
|
|
49
42
|
|
|
50
43
|
## Variables
|
|
51
44
|
|
|
52
45
|
| Variable | Description |
|
|
53
46
|
| ------ | ------ |
|
|
54
|
-
| [AWS\_S3\
|
|
55
|
-
| [
|
|
56
|
-
| [
|
|
47
|
+
| [AWS\_S3\_ACCESS\_KEY\_ID](Variable.AWS_S3_ACCESS_KEY_ID) | AWS S3 access key ID. |
|
|
48
|
+
| [AWS\_S3\_BUCKET](Variable.AWS_S3_BUCKET) | AWS S3 bucket name. |
|
|
49
|
+
| [AWS\_S3\_CONFIG\_ENTRIES](Variable.AWS_S3_CONFIG_ENTRIES) | Configuration entries required by the AWS S3 blob storage strategy. |
|
|
50
|
+
| [AWS\_S3\_ENDPOINT](Variable.AWS_S3_ENDPOINT) | AWS S3 custom endpoint (for S3-compatible providers). |
|
|
51
|
+
| [AWS\_S3\_REGION](Variable.AWS_S3_REGION) | AWS S3 region. |
|
|
52
|
+
| [AWS\_S3\_SECRET\_ACCESS\_KEY](Variable.AWS_S3_SECRET_ACCESS_KEY) | AWS S3 secret access key. |
|
|
53
|
+
| [AZURE\_BLOB\_CONNECTION\_STRING](Variable.AZURE_BLOB_CONNECTION_STRING) | Azure Blob Storage connection string. |
|
|
54
|
+
| [AZURE\_BLOB\_CONTAINER\_NAME](Variable.AZURE_BLOB_CONTAINER_NAME) | Azure Blob Storage container name. |
|
|
55
|
+
| [AZURE\_CONFIG\_ENTRIES](Variable.AZURE_CONFIG_ENTRIES) | Configuration entries required by the Azure blob storage strategy. |
|
|
56
|
+
| [BLOB\_STORAGE\_STRATEGY\_TOKEN](Variable.BLOB_STORAGE_STRATEGY_TOKEN) | - |
|
|
57
57
|
| [BlobDownloadResponseTypes](Variable.BlobDownloadResponseTypes) | - |
|
|
58
|
-
| [
|
|
59
|
-
| [
|
|
58
|
+
| [LOCAL\_BLOB\_BASE\_PATH](Variable.LOCAL_BLOB_BASE_PATH) | Local blob storage base path. |
|
|
59
|
+
| [LOCAL\_BLOB\_BUCKET](Variable.LOCAL_BLOB_BUCKET) | Local blob storage bucket (subdirectory). |
|
|
60
|
+
| [LOCAL\_CONFIG\_ENTRIES](Variable.LOCAL_CONFIG_ENTRIES) | Configuration entries required by the local blob storage strategy. |
|
|
61
|
+
| [PLATFORM\_BLOB\_STORAGE\_CONFIG\_ENTRIES](Variable.PLATFORM_BLOB_STORAGE_CONFIG_ENTRIES) | All configuration entries for `platform-blob-storage`. All keys are optional at the aggregate level. |
|
|
62
|
+
| [VERCEL\_BLOB\_BUCKET](Variable.VERCEL_BLOB_BUCKET) | Vercel Blob bucket name. |
|
|
63
|
+
| [VERCEL\_BLOB\_PUBLIC\_URL](Variable.VERCEL_BLOB_PUBLIC_URL) | Vercel Blob public URL. |
|
|
64
|
+
| [VERCEL\_BLOB\_READ\_WRITE\_TOKEN](Variable.VERCEL_BLOB_READ_WRITE_TOKEN) | Vercel Blob read/write access token. |
|
|
65
|
+
| [VERCEL\_BLOB\_REGION](Variable.VERCEL_BLOB_REGION) | Vercel Blob region. |
|
|
66
|
+
| [VERCEL\_BLOB\_URL](Variable.VERCEL_BLOB_URL) | Vercel Blob API URL. |
|
|
67
|
+
| [VERCEL\_CONFIG\_ENTRIES](Variable.VERCEL_CONFIG_ENTRIES) | Configuration entries required by the Vercel blob storage strategy. |
|
|
@@ -8,7 +8,7 @@ package: '@breadstone/archipel-platform-blob-storage'
|
|
|
8
8
|
|
|
9
9
|
# platform-blob-storage
|
|
10
10
|
|
|
11
|
-
Cloud file storage abstraction supporting pluggable
|
|
11
|
+
Cloud file storage abstraction supporting pluggable strategies and optional metadata persistence via ports. Ships with Vercel Blob, Azure Blob Storage, AWS S3, and local filesystem strategies out of the box.
|
|
12
12
|
|
|
13
13
|
**Package:** `@breadstone/archipel-platform-blob-storage`
|
|
14
14
|
|
|
@@ -19,15 +19,20 @@ Cloud file storage abstraction supporting pluggable providers and optional metad
|
|
|
19
19
|
```typescript
|
|
20
20
|
import { Module } from '@nestjs/common';
|
|
21
21
|
import { BlobModule } from '@breadstone/archipel-platform-blob-storage';
|
|
22
|
+
import { VercelBlobStorageStrategy, VERCEL_CONFIG_ENTRIES } from '@breadstone/archipel-platform-blob-storage/strategies/vercel';
|
|
22
23
|
|
|
23
24
|
@Module({
|
|
24
25
|
imports: [
|
|
25
26
|
// Minimal setup — Vercel Blob, no metadata tracking
|
|
26
|
-
BlobModule.
|
|
27
|
+
BlobModule.register({
|
|
28
|
+
storageStrategy: VercelBlobStorageStrategy,
|
|
29
|
+
configEntries: VERCEL_CONFIG_ENTRIES,
|
|
30
|
+
}),
|
|
27
31
|
|
|
28
|
-
// Full setup —
|
|
29
|
-
BlobModule.
|
|
30
|
-
|
|
32
|
+
// Full setup — with metadata tracking
|
|
33
|
+
BlobModule.register({
|
|
34
|
+
storageStrategy: VercelBlobStorageStrategy,
|
|
35
|
+
configEntries: VERCEL_CONFIG_ENTRIES,
|
|
31
36
|
objectPersistence: PrismaBlobObjectAdapter,
|
|
32
37
|
variantPersistence: PrismaBlobVariantAdapter,
|
|
33
38
|
isGlobal: true,
|
|
@@ -43,27 +48,36 @@ export class AppModule {}
|
|
|
43
48
|
|
|
44
49
|
### IBlobModuleOptions
|
|
45
50
|
|
|
46
|
-
| Property | Type | Required | Default
|
|
47
|
-
| -------------------- | ---------------------------------- | -------- |
|
|
48
|
-
| `
|
|
49
|
-
| `
|
|
50
|
-
| `
|
|
51
|
-
| `
|
|
51
|
+
| Property | Type | Required | Default | Description |
|
|
52
|
+
| -------------------- | ---------------------------------- | -------- | ------- | -------------------------------------- |
|
|
53
|
+
| `storageStrategy` | `Type<BlobStorageStrategyBase>` | Yes | — | Storage strategy to use |
|
|
54
|
+
| `configEntries` | `IConfigEntry[]` | No | `[]` | Config entries for the chosen strategy |
|
|
55
|
+
| `objectPersistence` | `Type<BlobObjectPersistencePort>` | No | — | Metadata tracking for uploaded objects |
|
|
56
|
+
| `variantPersistence` | `Type<BlobVariantPersistencePort>` | No | — | Metadata tracking for image variants |
|
|
57
|
+
| `isGlobal` | `boolean` | No | `true` | Register as a global module |
|
|
52
58
|
|
|
53
|
-
###
|
|
59
|
+
### Strategy Registration
|
|
54
60
|
|
|
55
61
|
```typescript
|
|
56
|
-
|
|
57
|
-
{
|
|
62
|
+
import { VercelBlobStorageStrategy, VERCEL_CONFIG_ENTRIES } from '@breadstone/archipel-platform-blob-storage/strategies/vercel';
|
|
63
|
+
import { AzureBlobStorageStrategy, AZURE_CONFIG_ENTRIES } from '@breadstone/archipel-platform-blob-storage/strategies/azure';
|
|
64
|
+
import { AwsS3BlobStorageStrategy, AWS_S3_CONFIG_ENTRIES } from '@breadstone/archipel-platform-blob-storage/strategies/aws-s3';
|
|
65
|
+
import { LocalBlobStorageStrategy, LOCAL_CONFIG_ENTRIES } from '@breadstone/archipel-platform-blob-storage/strategies/local';
|
|
66
|
+
|
|
67
|
+
// Vercel Blob
|
|
68
|
+
BlobModule.register({ storageStrategy: VercelBlobStorageStrategy, configEntries: VERCEL_CONFIG_ENTRIES });
|
|
58
69
|
|
|
59
70
|
// Azure Blob Storage
|
|
60
|
-
{
|
|
71
|
+
BlobModule.register({ storageStrategy: AzureBlobStorageStrategy, configEntries: AZURE_CONFIG_ENTRIES });
|
|
61
72
|
|
|
62
73
|
// AWS S3
|
|
63
|
-
{
|
|
74
|
+
BlobModule.register({ storageStrategy: AwsS3BlobStorageStrategy, configEntries: AWS_S3_CONFIG_ENTRIES });
|
|
64
75
|
|
|
65
|
-
//
|
|
66
|
-
{
|
|
76
|
+
// Local filesystem
|
|
77
|
+
BlobModule.register({ storageStrategy: LocalBlobStorageStrategy, configEntries: LOCAL_CONFIG_ENTRIES });
|
|
78
|
+
|
|
79
|
+
// Custom strategy — extend BlobStorageStrategyBase
|
|
80
|
+
BlobModule.register({ storageStrategy: MyCustomStrategy });
|
|
67
81
|
```
|
|
68
82
|
|
|
69
83
|
---
|
|
@@ -204,32 +218,33 @@ export class PrismaBlobObjectAdapter extends BlobObjectPersistencePort {
|
|
|
204
218
|
|
|
205
219
|
---
|
|
206
220
|
|
|
207
|
-
## Built-in
|
|
221
|
+
## Built-in Strategies
|
|
208
222
|
|
|
209
|
-
###
|
|
223
|
+
### VercelBlobStorageStrategy
|
|
210
224
|
|
|
211
|
-
The
|
|
225
|
+
The Vercel Blob storage strategy using Vercel's Blob Storage API.
|
|
212
226
|
|
|
213
227
|
```typescript
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
228
|
+
import { VercelBlobStorageStrategy, VERCEL_CONFIG_ENTRIES } from '@breadstone/archipel-platform-blob-storage/strategies/vercel';
|
|
229
|
+
|
|
230
|
+
BlobModule.register({
|
|
231
|
+
storageStrategy: VercelBlobStorageStrategy,
|
|
232
|
+
configEntries: VERCEL_CONFIG_ENTRIES,
|
|
219
233
|
});
|
|
220
234
|
```
|
|
221
235
|
|
|
222
|
-
**Environment variables:** `
|
|
236
|
+
**Environment variables:** `VERCEL_BLOB_READ_WRITE_TOKEN`, `VERCEL_BLOB_URL`, `VERCEL_BLOB_PUBLIC_URL`, `VERCEL_BLOB_BUCKET`, `VERCEL_BLOB_REGION`
|
|
223
237
|
|
|
224
|
-
###
|
|
238
|
+
### AzureBlobStorageStrategy
|
|
225
239
|
|
|
226
240
|
Microsoft Azure Blob Storage integration using `@azure/storage-blob`.
|
|
227
241
|
|
|
228
242
|
```typescript
|
|
229
|
-
import {
|
|
243
|
+
import { AzureBlobStorageStrategy, AZURE_CONFIG_ENTRIES } from '@breadstone/archipel-platform-blob-storage/strategies/azure';
|
|
230
244
|
|
|
231
|
-
BlobModule.
|
|
232
|
-
|
|
245
|
+
BlobModule.register({
|
|
246
|
+
storageStrategy: AzureBlobStorageStrategy,
|
|
247
|
+
configEntries: AZURE_CONFIG_ENTRIES,
|
|
233
248
|
});
|
|
234
249
|
```
|
|
235
250
|
|
|
@@ -241,19 +256,20 @@ BlobModule.forRoot({
|
|
|
241
256
|
| `AZURE_BLOB_ACCOUNT_NAME` | No* | Storage account name for DefaultAzureCredential |
|
|
242
257
|
| `AZURE_BLOB_CONTAINER_NAME` | Yes | Container to operate on |
|
|
243
258
|
|
|
244
|
-
> **\*** Provide either `connectionString` or `accountName`. When `accountName` is set without a connection string, the
|
|
259
|
+
> **\*** Provide either `connectionString` or `accountName`. When `accountName` is set without a connection string, the strategy authenticates via `DefaultAzureCredential` from `@azure/identity` (supports managed identity, environment credentials, etc.). Install `@azure/identity` as a peer dependency when using this mode.
|
|
245
260
|
|
|
246
|
-
The
|
|
261
|
+
The strategy supports SAS token generation for signed URLs and lazy-loads the Azure SDK for tree-shaking.
|
|
247
262
|
|
|
248
|
-
###
|
|
263
|
+
### AwsS3BlobStorageStrategy
|
|
249
264
|
|
|
250
265
|
Amazon S3 integration using `@aws-sdk/client-s3` and `@aws-sdk/s3-request-presigner`.
|
|
251
266
|
|
|
252
267
|
```typescript
|
|
253
|
-
import {
|
|
268
|
+
import { AwsS3BlobStorageStrategy, AWS_S3_CONFIG_ENTRIES } from '@breadstone/archipel-platform-blob-storage/strategies/aws-s3';
|
|
254
269
|
|
|
255
|
-
BlobModule.
|
|
256
|
-
|
|
270
|
+
BlobModule.register({
|
|
271
|
+
storageStrategy: AwsS3BlobStorageStrategy,
|
|
272
|
+
configEntries: AWS_S3_CONFIG_ENTRIES,
|
|
257
273
|
});
|
|
258
274
|
```
|
|
259
275
|
|
|
@@ -269,16 +285,37 @@ BlobModule.forRoot({
|
|
|
269
285
|
|
|
270
286
|
> **\*** `accessKeyId` and `secretAccessKey` must be provided **together**. Omit both to use the default AWS credential chain (IAM roles, instance profiles, environment variables).
|
|
271
287
|
|
|
272
|
-
The
|
|
288
|
+
The strategy supports pre-signed URLs and lazy-loads the AWS SDK for tree-shaking. `downloadObject()` gracefully handles JSON parse errors, returning the raw response body when content cannot be parsed.
|
|
273
289
|
|
|
274
|
-
###
|
|
290
|
+
### LocalBlobStorageStrategy
|
|
275
291
|
|
|
276
|
-
|
|
292
|
+
Local filesystem storage for development and testing.
|
|
293
|
+
|
|
294
|
+
```typescript
|
|
295
|
+
import { LocalBlobStorageStrategy, LOCAL_CONFIG_ENTRIES } from '@breadstone/archipel-platform-blob-storage/strategies/local';
|
|
296
|
+
|
|
297
|
+
BlobModule.register({
|
|
298
|
+
storageStrategy: LocalBlobStorageStrategy,
|
|
299
|
+
configEntries: LOCAL_CONFIG_ENTRIES,
|
|
300
|
+
});
|
|
301
|
+
```
|
|
302
|
+
|
|
303
|
+
**Environment variables:**
|
|
304
|
+
|
|
305
|
+
| Variable | Required | Default | Description |
|
|
306
|
+
| ---------------------- | -------- | ------------- | ------------------------------------- |
|
|
307
|
+
| `LOCAL_BLOB_BASE_PATH` | No | `./blob-data` | Base directory for local file storage |
|
|
308
|
+
| `LOCAL_BLOB_BUCKET` | No | `default` | Default bucket subdirectory |
|
|
309
|
+
|
|
310
|
+
### Custom Strategy
|
|
311
|
+
|
|
312
|
+
Extend `BlobStorageStrategyBase` for any other storage backend (GCS, MinIO, etc.):
|
|
277
313
|
|
|
278
314
|
```typescript
|
|
279
315
|
@Injectable()
|
|
280
|
-
export class
|
|
281
|
-
public readonly providerId = 'gcs';
|
|
316
|
+
export class GcsBlobStorageStrategy extends BlobStorageStrategyBase {
|
|
317
|
+
public override readonly providerId = 'gcs';
|
|
318
|
+
public override readonly defaultBucket = 'my-gcs-bucket';
|
|
282
319
|
|
|
283
320
|
public async uploadObject(request: IBlobUploadRequest): Promise<IBlobUploadResult> {
|
|
284
321
|
// GCS upload implementation
|
|
@@ -292,15 +329,13 @@ export class GcsBlobProvider implements IBlobProvider {
|
|
|
292
329
|
// GCS delete implementation
|
|
293
330
|
}
|
|
294
331
|
|
|
295
|
-
public async createSignedUrl(request: IBlobSignedUrlRequest): Promise<string> {
|
|
332
|
+
public override async createSignedUrl(request: IBlobSignedUrlRequest): Promise<string> {
|
|
296
333
|
// GCS signed URL
|
|
297
334
|
}
|
|
298
335
|
}
|
|
299
336
|
|
|
300
337
|
// Register
|
|
301
|
-
BlobModule.
|
|
302
|
-
provider: { kind: 'custom', useClass: GcsBlobProvider },
|
|
303
|
-
});
|
|
338
|
+
BlobModule.register({ storageStrategy: GcsBlobStorageStrategy });
|
|
304
339
|
```
|
|
305
340
|
|
|
306
341
|
---
|
|
@@ -315,7 +350,7 @@ import { HealthModule } from '@breadstone/archipel-platform-health';
|
|
|
315
350
|
|
|
316
351
|
@Module({
|
|
317
352
|
imports: [
|
|
318
|
-
BlobModule.
|
|
353
|
+
BlobModule.register({ /* ... */ }),
|
|
319
354
|
HealthModule.withIndicators([BlobHealthIndicator]),
|
|
320
355
|
],
|
|
321
356
|
})
|
|
@@ -331,30 +366,31 @@ export class AppModule {}
|
|
|
331
366
|
|
|
332
367
|
## Sub-path Imports
|
|
333
368
|
|
|
334
|
-
Each
|
|
369
|
+
Each strategy is tree-shakeable via sub-path imports:
|
|
335
370
|
|
|
336
|
-
| Import Path
|
|
337
|
-
|
|
|
338
|
-
| `@breadstone/archipel-platform-blob-storage`
|
|
339
|
-
| `@breadstone/archipel-platform-blob-storage/vercel` |
|
|
340
|
-
| `@breadstone/archipel-platform-blob-storage/azure` |
|
|
341
|
-
| `@breadstone/archipel-platform-blob-storage/aws-s3` |
|
|
342
|
-
| `@breadstone/archipel-platform-blob-storage/
|
|
371
|
+
| Import Path | Contents |
|
|
372
|
+
| -------------------------------------------------------------- | ---------------------------------------------------------- |
|
|
373
|
+
| `@breadstone/archipel-platform-blob-storage` | Core module, service, ports, interfaces, abstract base |
|
|
374
|
+
| `@breadstone/archipel-platform-blob-storage/strategies/vercel` | VercelBlobStorageStrategy, VERCEL_CONFIG_ENTRIES |
|
|
375
|
+
| `@breadstone/archipel-platform-blob-storage/strategies/azure` | AzureBlobStorageStrategy, AZURE_CONFIG_ENTRIES |
|
|
376
|
+
| `@breadstone/archipel-platform-blob-storage/strategies/aws-s3` | AwsS3BlobStorageStrategy, AWS_S3_CONFIG_ENTRIES |
|
|
377
|
+
| `@breadstone/archipel-platform-blob-storage/strategies/local` | LocalBlobStorageStrategy, LOCAL_CONFIG_ENTRIES |
|
|
378
|
+
| `@breadstone/archipel-platform-blob-storage/health` | BlobHealthIndicator |
|
|
343
379
|
|
|
344
380
|
---
|
|
345
381
|
|
|
346
382
|
## Exports Summary
|
|
347
383
|
|
|
348
|
-
| Export
|
|
349
|
-
|
|
|
350
|
-
| `BlobModule`
|
|
351
|
-
| `BlobService`
|
|
352
|
-
| `
|
|
353
|
-
| `
|
|
354
|
-
| `
|
|
355
|
-
| `
|
|
356
|
-
| `
|
|
357
|
-
| `
|
|
358
|
-
| `
|
|
359
|
-
| `
|
|
360
|
-
| `BlobDownloadResponseTypes`
|
|
384
|
+
| Export | Type | Description |
|
|
385
|
+
| ----------------------------- | ------------- | ------------------------------------------------------ |
|
|
386
|
+
| `BlobModule` | NestJS Module | Main module with `register()` |
|
|
387
|
+
| `BlobService` | Service | Upload, download, delete, signed URLs |
|
|
388
|
+
| `BlobStorageStrategyBase` | Abstract | Base class for custom storage strategies |
|
|
389
|
+
| `BlobObjectPersistencePort` | Port | Object metadata tracking |
|
|
390
|
+
| `BlobVariantPersistencePort` | Port | Variant metadata tracking |
|
|
391
|
+
| `VercelBlobStorageStrategy` | Strategy | Vercel Blob implementation (sub-path) |
|
|
392
|
+
| `AzureBlobStorageStrategy` | Strategy | Azure Blob Storage implementation (sub-path) |
|
|
393
|
+
| `AwsS3BlobStorageStrategy` | Strategy | AWS S3 implementation (sub-path) |
|
|
394
|
+
| `LocalBlobStorageStrategy` | Strategy | Local filesystem implementation (sub-path) |
|
|
395
|
+
| `BlobHealthIndicator` | Health | Blob storage health check (`/health` subpath) |
|
|
396
|
+
| `BlobDownloadResponseTypes` | Constant | `'arraybuffer'` \| `'json'` \| `'stream'` \| `'text'` |
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: 'Class: ProblemDetailResponse'
|
|
3
|
+
generated: true
|
|
4
|
+
editUrl: false
|
|
5
|
+
---
|
|
6
|
+
# Class: ProblemDetailResponse
|
|
7
|
+
|
|
8
|
+
Defined in: models/response/ProblemDetailResponse.ts:29
|
|
9
|
+
|
|
10
|
+
OpenAPI schema class representing a Problem Detail response as per RFC 9457.
|
|
11
|
+
|
|
12
|
+
This class is used exclusively for Swagger / OpenAPI documentation. It is
|
|
13
|
+
**not** instantiated at runtime — the actual response body is produced by
|
|
14
|
+
[ProblemDetailExceptionFilter](Class.ProblemDetailExceptionFilter).
|
|
15
|
+
|
|
16
|
+
The static [MEDIA\_TYPE](#media_type) property signals to the `@Api` decorator
|
|
17
|
+
that this response schema must be served under `application/problem+json`
|
|
18
|
+
instead of the default `application/json`.
|
|
19
|
+
|
|
20
|
+
Usage in controllers:
|
|
21
|
+
```typescript
|
|
22
|
+
@Api({
|
|
23
|
+
responses: [
|
|
24
|
+
{ status: HttpStatus.NOT_FOUND, description: 'User not found.', type: ProblemDetailResponse },
|
|
25
|
+
]
|
|
26
|
+
})
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Constructors
|
|
30
|
+
|
|
31
|
+
### Constructor
|
|
32
|
+
|
|
33
|
+
```ts
|
|
34
|
+
new ProblemDetailResponse(): ProblemDetailResponse;
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
#### Returns
|
|
38
|
+
|
|
39
|
+
`ProblemDetailResponse`
|
|
40
|
+
|
|
41
|
+
## Properties
|
|
42
|
+
|
|
43
|
+
### code?
|
|
44
|
+
|
|
45
|
+
```ts
|
|
46
|
+
optional code?: string;
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Defined in: models/response/ProblemDetailResponse.ts:81
|
|
50
|
+
|
|
51
|
+
***
|
|
52
|
+
|
|
53
|
+
### detail
|
|
54
|
+
|
|
55
|
+
```ts
|
|
56
|
+
detail: string;
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Defined in: models/response/ProblemDetailResponse.ts:69
|
|
60
|
+
|
|
61
|
+
***
|
|
62
|
+
|
|
63
|
+
### instance?
|
|
64
|
+
|
|
65
|
+
```ts
|
|
66
|
+
optional instance?: string;
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
Defined in: models/response/ProblemDetailResponse.ts:75
|
|
70
|
+
|
|
71
|
+
***
|
|
72
|
+
|
|
73
|
+
### MEDIA\_TYPE
|
|
74
|
+
|
|
75
|
+
```ts
|
|
76
|
+
readonly static MEDIA_TYPE: "application/problem+json" = 'application/problem+json';
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
Defined in: models/response/ProblemDetailResponse.ts:41
|
|
80
|
+
|
|
81
|
+
The media type for Problem Detail responses as per RFC 9457.
|
|
82
|
+
|
|
83
|
+
This static property is consumed by the `@Api` decorator to override the
|
|
84
|
+
default `application/json` content type when this class is used as a
|
|
85
|
+
response `type`.
|
|
86
|
+
|
|
87
|
+
***
|
|
88
|
+
|
|
89
|
+
### status
|
|
90
|
+
|
|
91
|
+
```ts
|
|
92
|
+
status: number;
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
Defined in: models/response/ProblemDetailResponse.ts:63
|
|
96
|
+
|
|
97
|
+
***
|
|
98
|
+
|
|
99
|
+
### title
|
|
100
|
+
|
|
101
|
+
```ts
|
|
102
|
+
title: string;
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
Defined in: models/response/ProblemDetailResponse.ts:57
|
|
106
|
+
|
|
107
|
+
***
|
|
108
|
+
|
|
109
|
+
### type
|
|
110
|
+
|
|
111
|
+
```ts
|
|
112
|
+
type: string;
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
Defined in: models/response/ProblemDetailResponse.ts:51
|
|
@@ -41,6 +41,7 @@ editUrl: false
|
|
|
41
41
|
| [PageableResponse](Class.PageableResponse) | Base class describing pagination metadata returned alongside list payloads. |
|
|
42
42
|
| [ProblemDetailException](Class.ProblemDetailException) | A NestJS HttpException that represents a Problem Detail as per RFC 7807. |
|
|
43
43
|
| [ProblemDetailExceptionFilter](Class.ProblemDetailExceptionFilter) | A NestJS exception filter that transforms exceptions into Problem Details compliant responses as per RFC 7807. |
|
|
44
|
+
| [ProblemDetailResponse](Class.ProblemDetailResponse) | OpenAPI schema class representing a Problem Detail response as per RFC 9457. |
|
|
44
45
|
| [QuantityResponse](Class.QuantityResponse) | Base class for quantity responses. |
|
|
45
46
|
| [ResponseReturn](Class.ResponseReturn) | - |
|
|
46
47
|
| [SseHub](Class.SseHub) | Represents a server-sent event service. |
|
|
@@ -9,7 +9,7 @@ editUrl: false
|
|
|
9
9
|
function Api(options): ClassDecorator & MethodDecorator & PropertyDecorator;
|
|
10
10
|
```
|
|
11
11
|
|
|
12
|
-
Defined in: [decorators/Api.ts:
|
|
12
|
+
Defined in: [decorators/Api.ts:142](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-openapi/src/decorators/Api.ts#L142)
|
|
13
13
|
|
|
14
14
|
Composite Swagger decorator that wraps all NestJS OpenAPI decorators into a single declaration.
|
|
15
15
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@breadstone/archipel-mcp",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.41",
|
|
4
4
|
"description": "MCP server providing Archipel platform knowledge - documentation, query patterns, and coding conventions - to AI development tools.",
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"main": "./src/main.js",
|