@breadstone/archipel-mcp 0.0.23 → 0.0.25
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/caching.md +33 -0
- package/data/guides/email-delivery.md +27 -1
- package/data/guides/esigning-integration.md +11 -5
- package/data/guides/health-indicators.md +220 -0
- package/data/guides/index.md +2 -0
- package/data/guides/queue-infrastructure.md +329 -0
- package/data/guides/telemetry-and-observability.md +20 -0
- package/data/packages/platform-analytics/api/Class.AnalyticsClientPort.md +20 -0
- package/data/packages/platform-analytics/api/Class.AnalyticsHealthIndicator.md +78 -0
- package/data/packages/platform-analytics/api/Class.AppInsightsAnalyticsClient.md +24 -0
- package/data/packages/platform-analytics/api/Class.DatadogAnalyticsClient.md +24 -0
- package/data/packages/platform-analytics/api/Class.NoopAnalyticsClient.md +24 -0
- package/data/packages/platform-analytics/api/Class.SentryAnalyticsClient.md +24 -0
- package/data/packages/platform-analytics/api/index.md +1 -0
- package/data/packages/platform-analytics/index.md +25 -1
- package/data/packages/platform-authentication/api/Class.AuthenticationHealthIndicator.md +68 -0
- package/data/packages/platform-authentication/api/index.md +1 -0
- package/data/packages/platform-authentication/index.md +25 -1
- package/data/packages/platform-blob-storage/api/Class.BlobHealthIndicator.md +7 -7
- package/data/packages/platform-blob-storage/api/Class.BlobModule.md +2 -2
- package/data/packages/platform-blob-storage/api/Interface.IAwsS3BlobProviderRegistration.md +3 -3
- package/data/packages/platform-blob-storage/api/Interface.IAzureBlobProviderRegistration.md +3 -3
- package/data/packages/platform-blob-storage/api/Interface.IBlobModuleOptions.md +5 -5
- package/data/packages/platform-blob-storage/api/Interface.ICustomBlobProviderRegistration.md +3 -3
- package/data/packages/platform-blob-storage/api/Interface.IVercelBlobProviderRegistration.md +3 -3
- package/data/packages/platform-blob-storage/api/TypeAlias.IBlobProviderRegistration.md +1 -1
- package/data/packages/platform-blob-storage/api/index.md +1 -1
- package/data/packages/platform-blob-storage/index.md +19 -14
- package/data/packages/platform-caching/api/Class.MemoryLayeredCache.md +10 -10
- package/data/packages/platform-caching/api/Class.NoopCacheMetricsRecorder.md +6 -6
- package/data/packages/platform-caching/api/Class.RedisLayeredCache.md +10 -10
- package/data/packages/platform-caching/api/Interface.ILayeredCache.md +9 -9
- package/data/packages/platform-caching/api/Interface.ILayeredCacheOptions.md +6 -6
- package/data/packages/platform-caching/api/Variable.CACHE_DEFAULT_TTL_MS.md +14 -0
- package/data/packages/platform-caching/api/Variable.CACHE_MAX_ENTRIES.md +14 -0
- package/data/packages/platform-caching/api/Variable.CACHE_STALE_WHILE_REVALIDATE.md +14 -0
- package/data/packages/platform-caching/api/Variable.PLATFORM_CACHING_CONFIG_ENTRIES.md +14 -0
- package/data/packages/platform-caching/api/Variable.REDIS_CONFIG_ENTRIES.md +14 -0
- package/data/packages/platform-caching/api/Variable.REDIS_KEY_PREFIX.md +14 -0
- package/data/packages/platform-caching/api/Variable.REDIS_TTL_SECONDS.md +14 -0
- package/data/packages/platform-caching/api/Variable.REDIS_URL.md +14 -0
- package/data/packages/platform-caching/api/index.md +13 -0
- package/data/packages/platform-caching/index.md +47 -1
- package/data/packages/platform-configuration/api/Function.createConfigKey.md +1 -1
- package/data/packages/platform-core/api/Class.HttpLoggerMiddleware.md +3 -3
- package/data/packages/platform-core/api/Function.maskSensitive.md +26 -0
- package/data/packages/platform-core/api/Function.maskSensitiveFields.md +26 -0
- package/data/packages/platform-core/api/index.md +2 -0
- package/data/packages/platform-core/index.md +11 -0
- package/data/packages/platform-database/api/Class.DatabaseHealthIndicator.md +8 -6
- package/data/packages/platform-database/api/Class.DatabaseModule.md +3 -3
- package/data/packages/platform-database/api/Class.RepositoryBase.md +20 -20
- package/data/packages/platform-database/api/Function.paginator.md +1 -1
- package/data/packages/platform-database/api/Interface.IDatabaseModuleConfig.md +3 -3
- package/data/packages/platform-database/api/TypeAlias.DelegateArgs.md +1 -1
- package/data/packages/platform-database/api/TypeAlias.DelegateReturnTypes.md +1 -1
- package/data/packages/platform-database/api/TypeAlias.PaginateFunction.md +1 -1
- package/data/packages/platform-database/api/Variable.DATABASE_MODULE_CONFIG.md +1 -1
- package/data/packages/platform-database/index.md +17 -5
- package/data/packages/platform-documents/api/Class.DocumentEngine.md +9 -5
- package/data/packages/platform-documents/index.md +1 -1
- package/data/packages/platform-esigning/api/Class.AdobeSignEsigningProvider.md +24 -0
- package/data/packages/platform-esigning/api/Class.DocuSignEsigningProvider.md +24 -0
- package/data/packages/platform-esigning/api/Class.DropboxSignEsigningProvider.md +24 -0
- package/data/packages/platform-esigning/api/Class.EsigningClientPort.md +20 -0
- package/data/packages/platform-esigning/api/Class.EsigningHealthIndicator.md +78 -0
- package/data/packages/platform-esigning/api/Class.InternalEsigningProvider.md +24 -0
- package/data/packages/platform-esigning/api/index.md +1 -0
- package/data/packages/platform-esigning/index.md +26 -2
- package/data/packages/platform-health/api/Class.HealthModule.md +42 -0
- package/data/packages/platform-health/api/Class.HealthOrchestrator.md +64 -0
- package/data/packages/platform-health/api/Interface.IHealthCheckResult.md +46 -0
- package/data/packages/platform-health/api/Interface.IHealthIndicator.md +41 -0
- package/data/packages/platform-health/api/Variable.HEALTH_INDICATORS_TOKEN.md +14 -0
- package/data/packages/platform-health/api/index.md +26 -0
- package/data/packages/platform-health/index.md +18 -7
- package/data/packages/platform-intelligence/api/Class.IntelligenceHealthIndicator.md +78 -0
- package/data/packages/platform-intelligence/api/index.md +1 -0
- package/data/packages/platform-intelligence/index.md +24 -1
- package/data/packages/platform-logging/api/Class.ContextLogger.md +152 -0
- package/data/packages/platform-logging/api/Class.LoggerModule.md +8 -2
- package/data/packages/platform-logging/api/Class.RequestContextStore.md +90 -0
- package/data/packages/platform-logging/api/Class.RequestIdMiddleware.md +68 -0
- package/data/packages/platform-logging/api/Interface.IRequestContext.md +34 -0
- package/data/packages/platform-logging/api/Variable.REQUEST_ID_HEADER.md +14 -0
- package/data/packages/platform-logging/api/index.md +11 -1
- package/data/packages/platform-logging/index.md +89 -7
- package/data/packages/platform-mailing/api/Class.MailHealthIndicator.md +5 -5
- package/data/packages/platform-mailing/api/Class.MailModule.md +28 -1
- package/data/packages/platform-mailing/api/Class.MailVerificationService.md +49 -16
- package/data/packages/platform-mailing/api/Class.SmtpConnectionVerifier.md +84 -0
- package/data/packages/platform-mailing/api/Interface.IMailModuleOptions.md +36 -0
- package/data/packages/platform-mailing/api/index.md +3 -1
- package/data/packages/platform-mailing/index.md +64 -8
- package/data/packages/platform-mapping/api/Class.MappingBuilder.md +110 -0
- package/data/packages/platform-mapping/api/Class.MappingError.md +56 -0
- package/data/packages/platform-mapping/api/Class.MappingModule.md +46 -0
- package/data/packages/platform-mapping/api/Class.MappingNotRegisteredError.md +52 -0
- package/data/packages/platform-mapping/api/Class.MappingProfileBase.md +52 -0
- package/data/packages/platform-mapping/api/Class.MappingService.md +284 -0
- package/data/packages/platform-mapping/api/Class.TypeMappingNotRegisteredError.md +53 -0
- package/data/packages/platform-mapping/api/Function.createMappingKey.md +39 -0
- package/data/packages/platform-mapping/api/Interface.IMappingBuilder.md +76 -0
- package/data/packages/platform-mapping/api/Interface.IMappingKey.md +58 -0
- package/data/packages/platform-mapping/api/Interface.IMappingProfile.md +32 -0
- package/data/packages/platform-mapping/api/TypeAlias.Constructor.md +28 -0
- package/data/packages/platform-mapping/api/index.md +38 -0
- package/data/packages/platform-mcp/api/Class.McpHealthIndicator.md +78 -0
- package/data/packages/platform-mcp/api/index.md +1 -0
- package/data/packages/platform-mcp/index.md +24 -1
- package/data/packages/platform-openapi/api/Function.SwaggerFeature.md +2 -2
- package/data/packages/platform-openapi/api/Function.getSwaggerFeatureMetadata.md +2 -2
- package/data/packages/platform-payments/api/Class.LemonSqueezyClient.md +24 -0
- package/data/packages/platform-payments/api/Class.MollieClient.md +24 -0
- package/data/packages/platform-payments/api/Class.PaddleClient.md +24 -0
- package/data/packages/platform-payments/api/Class.PaymentClientPort.md +20 -0
- package/data/packages/platform-payments/api/Class.PaymentHealthIndicator.md +78 -0
- package/data/packages/platform-payments/api/Class.StripeClient.md +28 -4
- package/data/packages/platform-payments/api/index.md +1 -0
- package/data/packages/platform-payments/index.md +26 -2
- package/data/packages/platform-queue/api/Class.AzureQueue.md +221 -0
- package/data/packages/platform-queue/api/Class.BullMqQueue.md +220 -0
- package/data/packages/platform-queue/api/Class.MemoryQueue.md +194 -0
- package/data/packages/platform-queue/api/Class.QueueError.md +51 -0
- package/data/packages/platform-queue/api/Class.QueueHealthIndicator.md +68 -0
- package/data/packages/platform-queue/api/Class.QueueJobNotFoundError.md +43 -0
- package/data/packages/platform-queue/api/Class.QueueJobStateError.md +48 -0
- package/data/packages/platform-queue/api/Class.QueueValidationError.md +43 -0
- package/data/packages/platform-queue/api/Interface.IAzureQueueOptions.md +48 -0
- package/data/packages/platform-queue/api/Interface.IBullMqQueueOptions.md +45 -0
- package/data/packages/platform-queue/api/Interface.IMemoryQueueOptions.md +32 -0
- package/data/packages/platform-queue/api/Interface.IQueue.md +173 -0
- package/data/packages/platform-queue/api/Interface.IQueueJob.md +139 -0
- package/data/packages/platform-queue/api/TypeAlias.QueueJobStatus.md +14 -0
- package/data/packages/platform-queue/api/Variable.AZURE_CONFIG_ENTRIES.md +17 -0
- package/data/packages/platform-queue/api/Variable.AZURE_CONNECTION_STRING.md +14 -0
- package/data/packages/platform-queue/api/Variable.AZURE_RECEIVE_WAIT_MS.md +21 -0
- package/data/packages/platform-queue/api/Variable.BULLMQ_CONFIG_ENTRIES.md +17 -0
- package/data/packages/platform-queue/api/Variable.BULLMQ_PREFIX.md +18 -0
- package/data/packages/platform-queue/api/Variable.BULLMQ_REDIS_URL.md +21 -0
- package/data/packages/platform-queue/api/Variable.PLATFORM_QUEUE_CONFIG_ENTRIES.md +17 -0
- package/data/packages/platform-queue/api/Variable.QUEUE_JOB_STATUS.md +30 -0
- package/data/packages/platform-queue/api/Variable.QUEUE_MAX_JOBS.md +21 -0
- package/data/packages/platform-queue/api/index.md +49 -0
- package/data/packages/platform-queue/index.md +168 -0
- package/data/packages/platform-resources/api/Class.BlobResourceStrategy.md +195 -0
- package/data/packages/platform-resources/api/Class.EmbeddedResourceStrategy.md +215 -0
- package/data/packages/platform-resources/api/Class.FileResourceStrategy.md +190 -0
- package/data/packages/platform-resources/api/Class.ResourceManager.md +477 -0
- package/data/packages/platform-resources/api/Class.ResourceModule.md +46 -0
- package/data/packages/platform-resources/api/Class.ResourceNotFoundError.md +60 -0
- package/data/packages/platform-resources/api/Interface.IBlobResourceStrategyConfig.md +28 -0
- package/data/packages/platform-resources/api/Interface.IBlobServiceAdapter.md +40 -0
- package/data/packages/platform-resources/api/Interface.IFileResourceStrategyConfig.md +72 -0
- package/data/packages/platform-resources/api/Interface.IResourceManagerConfig.md +89 -0
- package/data/packages/platform-resources/api/Interface.IResourceMetadata.md +94 -0
- package/data/packages/platform-resources/api/Interface.IResourceResult.md +34 -0
- package/data/packages/platform-resources/api/Interface.IResourceStrategy.md +134 -0
- package/data/packages/platform-resources/api/index.md +29 -0
- package/data/packages/platform-telemetry/api/Class.OtelSdkHolder.md +20 -2
- package/data/packages/platform-telemetry/api/Class.TelemetryHealthIndicator.md +78 -0
- package/data/packages/platform-telemetry/api/index.md +1 -0
- package/data/packages/platform-telemetry/index.md +25 -1
- package/data/patterns/config-pattern.md +3 -1
- package/package.json +1 -1
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: platform-queue
|
|
3
|
+
description: Provider-agnostic queue infrastructure with support for in-memory FIFO, BullMQ (Redis), and Azure Service Bus.
|
|
4
|
+
order: 19
|
|
5
|
+
tags: [queue, job-queue, fifo, memory-queue, bullmq, redis, azure-service-bus, ports-and-adapters, health]
|
|
6
|
+
package: '@breadstone/archipel-platform-queue'
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# platform-queue
|
|
10
|
+
|
|
11
|
+
Provider-agnostic queue infrastructure for NestJS. Exposes a unified `IQueue` contract with three ready-made implementations: in-memory FIFO (`MemoryQueue`), BullMQ/Redis (`BullMqQueue`), and Azure Service Bus (`AzureQueue`). Jobs follow a lifecycle from pending through processing to completed or failed, with full metadata tracking.
|
|
12
|
+
|
|
13
|
+
**Package:** `@breadstone/archipel-platform-queue`
|
|
14
|
+
|
|
15
|
+
## Architecture
|
|
16
|
+
|
|
17
|
+
```mermaid
|
|
18
|
+
graph TD
|
|
19
|
+
Core["@breadstone/archipel-platform-queue<br/><i>IQueue, models, errors, MemoryQueue</i>"]
|
|
20
|
+
BullMQ["@breadstone/archipel-platform-queue/bullmq<br/><i>BullMqQueue</i>"]
|
|
21
|
+
Azure["@breadstone/archipel-platform-queue/azure<br/><i>AzureQueue</i>"]
|
|
22
|
+
|
|
23
|
+
BullMQ -->|implements| Core
|
|
24
|
+
Azure -->|implements| Core
|
|
25
|
+
|
|
26
|
+
BullMQ -.-|requires| R["bullmq"]
|
|
27
|
+
Azure -.-|requires| S["@azure/service-bus"]
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Each provider SDK is an **optional peer dependency**. Install only the one you need. `MemoryQueue` ships with the core entry point and requires no additional dependencies.
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
## Quick Start
|
|
35
|
+
|
|
36
|
+
### 1. Install the provider SDK (optional)
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
# Pick one (or use MemoryQueue without any extra SDK):
|
|
40
|
+
yarn add bullmq
|
|
41
|
+
yarn add @azure/service-bus
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### 2. Register the queue
|
|
45
|
+
|
|
46
|
+
```typescript
|
|
47
|
+
import { Module } from '@nestjs/common';
|
|
48
|
+
import { IQueue, MemoryQueue } from '@breadstone/archipel-platform-queue';
|
|
49
|
+
|
|
50
|
+
@Module({
|
|
51
|
+
providers: [
|
|
52
|
+
{
|
|
53
|
+
provide: 'IQueue',
|
|
54
|
+
useFactory: () => new MemoryQueue({ maxJobs: 5_000 }),
|
|
55
|
+
},
|
|
56
|
+
],
|
|
57
|
+
exports: ['IQueue'],
|
|
58
|
+
})
|
|
59
|
+
export class AppModule {}
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### Switching providers
|
|
63
|
+
|
|
64
|
+
Replace the imports — no other code change needed:
|
|
65
|
+
|
|
66
|
+
```typescript
|
|
67
|
+
import { BullMqQueue } from '@breadstone/archipel-platform-queue/bullmq';
|
|
68
|
+
|
|
69
|
+
{
|
|
70
|
+
provide: 'IQueue',
|
|
71
|
+
useFactory: () => new BullMqQueue({ redisUrl: 'redis://localhost:6379' }),
|
|
72
|
+
}
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
---
|
|
76
|
+
|
|
77
|
+
## Queue Providers
|
|
78
|
+
|
|
79
|
+
### Memory (built-in)
|
|
80
|
+
|
|
81
|
+
**Entry point:** `@breadstone/archipel-platform-queue`
|
|
82
|
+
|
|
83
|
+
| Variable | Required | Default | Description |
|
|
84
|
+
| ---------------- | -------- | ------- | ------------------------------------- |
|
|
85
|
+
| `QUEUE_MAX_JOBS` | No | `10000` | Maximum jobs retained before eviction |
|
|
86
|
+
|
|
87
|
+
### BullMQ
|
|
88
|
+
|
|
89
|
+
**Subpath:** `@breadstone/archipel-platform-queue/bullmq`
|
|
90
|
+
**SDK:** `bullmq` ≥ 5.0.0
|
|
91
|
+
|
|
92
|
+
| Variable | Required | Default | Description |
|
|
93
|
+
| ----------------- | -------- | ------- | -------------------------------------------- |
|
|
94
|
+
| `BULLMQ_REDIS_URL`| Yes | — | Redis connection URL (e.g. `redis://localhost:6379`) |
|
|
95
|
+
| `BULLMQ_PREFIX` | No | `""` | Optional key prefix for all BullMQ queues |
|
|
96
|
+
|
|
97
|
+
```typescript
|
|
98
|
+
import { BullMqQueue, BULLMQ_CONFIG_ENTRIES } from '@breadstone/archipel-platform-queue/bullmq';
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
### Azure Service Bus
|
|
102
|
+
|
|
103
|
+
**Subpath:** `@breadstone/archipel-platform-queue/azure`
|
|
104
|
+
**SDK:** `@azure/service-bus` ≥ 7.0.0
|
|
105
|
+
|
|
106
|
+
| Variable | Required | Default | Description |
|
|
107
|
+
| ------------------------- | -------- | ------- | ---------------------------------------- |
|
|
108
|
+
| `AZURE_CONNECTION_STRING` | Yes | — | Azure Service Bus connection string |
|
|
109
|
+
| `AZURE_RECEIVE_WAIT_MS` | No | `5000` | Max wait time (ms) when receiving messages|
|
|
110
|
+
|
|
111
|
+
```typescript
|
|
112
|
+
import { AzureQueue, AZURE_CONFIG_ENTRIES } from '@breadstone/archipel-platform-queue/azure';
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
---
|
|
116
|
+
|
|
117
|
+
## Job Lifecycle
|
|
118
|
+
|
|
119
|
+
| Status | Description |
|
|
120
|
+
| ------------ | ---------------------------------------------------- |
|
|
121
|
+
| `pending` | Job is waiting to be picked up |
|
|
122
|
+
| `processing` | Job has been dequeued and is being processed |
|
|
123
|
+
| `completed` | Job finished successfully via `markCompleted()` |
|
|
124
|
+
| `failed` | Job finished with an error via `markFailed()` |
|
|
125
|
+
|
|
126
|
+
---
|
|
127
|
+
|
|
128
|
+
## Error Handling
|
|
129
|
+
|
|
130
|
+
| Error Class | Base Class | When Thrown |
|
|
131
|
+
| ----------------------- | ------------ | ---------------------------------------------- |
|
|
132
|
+
| `QueueError` | `Error` | Base class for all queue errors |
|
|
133
|
+
| `QueueJobNotFoundError` | `QueueError` | Job ID does not exist |
|
|
134
|
+
| `QueueJobStateError` | `QueueError` | Job is in wrong state for requested transition |
|
|
135
|
+
| `QueueValidationError` | `QueueError` | Empty queue name or error message |
|
|
136
|
+
|
|
137
|
+
---
|
|
138
|
+
|
|
139
|
+
## Health Check
|
|
140
|
+
|
|
141
|
+
The `QueueHealthIndicator` reports the queue subsystem as available. Import it from the `/health` subpath:
|
|
142
|
+
|
|
143
|
+
```typescript
|
|
144
|
+
import { QueueHealthIndicator } from '@breadstone/archipel-platform-queue/health';
|
|
145
|
+
import { HealthModule } from '@breadstone/archipel-platform-health';
|
|
146
|
+
|
|
147
|
+
@Module({
|
|
148
|
+
imports: [
|
|
149
|
+
QueueModule.register({ /* ... */ }),
|
|
150
|
+
HealthModule.withIndicators([QueueHealthIndicator]),
|
|
151
|
+
],
|
|
152
|
+
})
|
|
153
|
+
export class AppModule {}
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
| Key | Check | Dependencies |
|
|
157
|
+
| --- | ----- | ------------ |
|
|
158
|
+
| `queue` | Always reports `up` | None |
|
|
159
|
+
|
|
160
|
+
---
|
|
161
|
+
|
|
162
|
+
## Peer Dependencies
|
|
163
|
+
|
|
164
|
+
| Package | Required | Notes |
|
|
165
|
+
| -------------------- | -------- | -------------------------------- |
|
|
166
|
+
| `@nestjs/common` | Yes | NestJS core |
|
|
167
|
+
| `bullmq` | Optional | Required for BullMQ provider |
|
|
168
|
+
| `@azure/service-bus` | Optional | Required for Azure Service Bus |
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: 'Class: BlobResourceStrategy'
|
|
3
|
+
generated: true
|
|
4
|
+
editUrl: false
|
|
5
|
+
---
|
|
6
|
+
# Class: BlobResourceStrategy
|
|
7
|
+
|
|
8
|
+
Defined in: [strategies/BlobResourceStrategy.ts:47](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-resources/src/strategies/BlobResourceStrategy.ts#L47)
|
|
9
|
+
|
|
10
|
+
Strategy for loading resources from blob storage.
|
|
11
|
+
|
|
12
|
+
## Implements
|
|
13
|
+
|
|
14
|
+
- [`IResourceStrategy`](Interface.IResourceStrategy)
|
|
15
|
+
|
|
16
|
+
## Constructors
|
|
17
|
+
|
|
18
|
+
### Constructor
|
|
19
|
+
|
|
20
|
+
```ts
|
|
21
|
+
new BlobResourceStrategy(blobService, config?): BlobResourceStrategy;
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Defined in: [strategies/BlobResourceStrategy.ts:63](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-resources/src/strategies/BlobResourceStrategy.ts#L63)
|
|
25
|
+
|
|
26
|
+
Constructs a new instance of the `BlobResourceStrategy` class.
|
|
27
|
+
|
|
28
|
+
#### Parameters
|
|
29
|
+
|
|
30
|
+
| Parameter | Type |
|
|
31
|
+
| ------ | ------ |
|
|
32
|
+
| `blobService` | [`IBlobServiceAdapter`](Interface.IBlobServiceAdapter) |
|
|
33
|
+
| `config` | [`IBlobResourceStrategyConfig`](Interface.IBlobResourceStrategyConfig) |
|
|
34
|
+
|
|
35
|
+
#### Returns
|
|
36
|
+
|
|
37
|
+
`BlobResourceStrategy`
|
|
38
|
+
|
|
39
|
+
## Accessors
|
|
40
|
+
|
|
41
|
+
### name
|
|
42
|
+
|
|
43
|
+
#### Get Signature
|
|
44
|
+
|
|
45
|
+
```ts
|
|
46
|
+
get name(): string;
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Defined in: [strategies/BlobResourceStrategy.ts:72](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-resources/src/strategies/BlobResourceStrategy.ts#L72)
|
|
50
|
+
|
|
51
|
+
The unique name of this strategy.
|
|
52
|
+
|
|
53
|
+
##### Returns
|
|
54
|
+
|
|
55
|
+
`string`
|
|
56
|
+
|
|
57
|
+
The unique name of this strategy.
|
|
58
|
+
|
|
59
|
+
#### Implementation of
|
|
60
|
+
|
|
61
|
+
[`IResourceStrategy`](Interface.IResourceStrategy).[`name`](Interface.IResourceStrategy#name)
|
|
62
|
+
|
|
63
|
+
## Methods
|
|
64
|
+
|
|
65
|
+
### exists()
|
|
66
|
+
|
|
67
|
+
```ts
|
|
68
|
+
exists(key): boolean;
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
Defined in: [strategies/BlobResourceStrategy.ts:136](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-resources/src/strategies/BlobResourceStrategy.ts#L136)
|
|
72
|
+
|
|
73
|
+
Checks if a resource exists without loading it.
|
|
74
|
+
Note: Blob storage is inherently async, so this delegates to existsAsync internally.
|
|
75
|
+
|
|
76
|
+
#### Parameters
|
|
77
|
+
|
|
78
|
+
| Parameter | Type | Description |
|
|
79
|
+
| ------ | ------ | ------ |
|
|
80
|
+
| `key` | `string` | The resource key |
|
|
81
|
+
|
|
82
|
+
#### Returns
|
|
83
|
+
|
|
84
|
+
`boolean`
|
|
85
|
+
|
|
86
|
+
True if the resource exists
|
|
87
|
+
|
|
88
|
+
#### Implementation of
|
|
89
|
+
|
|
90
|
+
[`IResourceStrategy`](Interface.IResourceStrategy).[`exists`](Interface.IResourceStrategy#exists)
|
|
91
|
+
|
|
92
|
+
***
|
|
93
|
+
|
|
94
|
+
### existsAsync()
|
|
95
|
+
|
|
96
|
+
```ts
|
|
97
|
+
existsAsync(key): Promise<boolean>;
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
Defined in: [strategies/BlobResourceStrategy.ts:147](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-resources/src/strategies/BlobResourceStrategy.ts#L147)
|
|
101
|
+
|
|
102
|
+
Checks if a resource exists without loading it (asynchronous).
|
|
103
|
+
|
|
104
|
+
#### Parameters
|
|
105
|
+
|
|
106
|
+
| Parameter | Type | Description |
|
|
107
|
+
| ------ | ------ | ------ |
|
|
108
|
+
| `key` | `string` | The resource key |
|
|
109
|
+
|
|
110
|
+
#### Returns
|
|
111
|
+
|
|
112
|
+
`Promise`\<`boolean`\>
|
|
113
|
+
|
|
114
|
+
Promise resolving to true if the resource exists
|
|
115
|
+
|
|
116
|
+
#### Implementation of
|
|
117
|
+
|
|
118
|
+
[`IResourceStrategy`](Interface.IResourceStrategy).[`existsAsync`](Interface.IResourceStrategy#existsasync)
|
|
119
|
+
|
|
120
|
+
***
|
|
121
|
+
|
|
122
|
+
### load()
|
|
123
|
+
|
|
124
|
+
```ts
|
|
125
|
+
load(key): IResourceResult | undefined;
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
Defined in: [strategies/BlobResourceStrategy.ts:88](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-resources/src/strategies/BlobResourceStrategy.ts#L88)
|
|
129
|
+
|
|
130
|
+
Loads a resource by its key.
|
|
131
|
+
Note: Blob storage is inherently async, so this delegates to loadAsync internally.
|
|
132
|
+
|
|
133
|
+
#### Parameters
|
|
134
|
+
|
|
135
|
+
| Parameter | Type | Description |
|
|
136
|
+
| ------ | ------ | ------ |
|
|
137
|
+
| `key` | `string` | The resource key |
|
|
138
|
+
|
|
139
|
+
#### Returns
|
|
140
|
+
|
|
141
|
+
[`IResourceResult`](Interface.IResourceResult) \| `undefined`
|
|
142
|
+
|
|
143
|
+
The resource result or undefined if not found
|
|
144
|
+
|
|
145
|
+
#### Implementation of
|
|
146
|
+
|
|
147
|
+
[`IResourceStrategy`](Interface.IResourceStrategy).[`load`](Interface.IResourceStrategy#load)
|
|
148
|
+
|
|
149
|
+
***
|
|
150
|
+
|
|
151
|
+
### loadAsync()
|
|
152
|
+
|
|
153
|
+
```ts
|
|
154
|
+
loadAsync(key): Promise<IResourceResult | undefined>;
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
Defined in: [strategies/BlobResourceStrategy.ts:99](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-resources/src/strategies/BlobResourceStrategy.ts#L99)
|
|
158
|
+
|
|
159
|
+
Loads a resource by its key (asynchronous).
|
|
160
|
+
|
|
161
|
+
#### Parameters
|
|
162
|
+
|
|
163
|
+
| Parameter | Type | Description |
|
|
164
|
+
| ------ | ------ | ------ |
|
|
165
|
+
| `key` | `string` | The resource key |
|
|
166
|
+
|
|
167
|
+
#### Returns
|
|
168
|
+
|
|
169
|
+
`Promise`\<[`IResourceResult`](Interface.IResourceResult) \| `undefined`\>
|
|
170
|
+
|
|
171
|
+
Promise resolving to the resource result or undefined if not found
|
|
172
|
+
|
|
173
|
+
#### Implementation of
|
|
174
|
+
|
|
175
|
+
[`IResourceStrategy`](Interface.IResourceStrategy).[`loadAsync`](Interface.IResourceStrategy#loadasync)
|
|
176
|
+
|
|
177
|
+
***
|
|
178
|
+
|
|
179
|
+
### whatDoIHave()
|
|
180
|
+
|
|
181
|
+
```ts
|
|
182
|
+
whatDoIHave(): void;
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
Defined in: [strategies/BlobResourceStrategy.ts:163](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-resources/src/strategies/BlobResourceStrategy.ts#L163)
|
|
186
|
+
|
|
187
|
+
List all files and folders in the base paths for debugging purposes.
|
|
188
|
+
|
|
189
|
+
#### Returns
|
|
190
|
+
|
|
191
|
+
`void`
|
|
192
|
+
|
|
193
|
+
#### Implementation of
|
|
194
|
+
|
|
195
|
+
[`IResourceStrategy`](Interface.IResourceStrategy).[`whatDoIHave`](Interface.IResourceStrategy#whatdoihave)
|
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: 'Class: EmbeddedResourceStrategy'
|
|
3
|
+
generated: true
|
|
4
|
+
editUrl: false
|
|
5
|
+
---
|
|
6
|
+
# Class: EmbeddedResourceStrategy
|
|
7
|
+
|
|
8
|
+
Defined in: [strategies/EmbeddedResourceStrategy.ts:14](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-resources/src/strategies/EmbeddedResourceStrategy.ts#L14)
|
|
9
|
+
|
|
10
|
+
Strategy for loading embedded resources from memory.
|
|
11
|
+
|
|
12
|
+
## Implements
|
|
13
|
+
|
|
14
|
+
- [`IResourceStrategy`](Interface.IResourceStrategy)
|
|
15
|
+
|
|
16
|
+
## Constructors
|
|
17
|
+
|
|
18
|
+
### Constructor
|
|
19
|
+
|
|
20
|
+
```ts
|
|
21
|
+
new EmbeddedResourceStrategy(resources?): EmbeddedResourceStrategy;
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Defined in: [strategies/EmbeddedResourceStrategy.ts:29](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-resources/src/strategies/EmbeddedResourceStrategy.ts#L29)
|
|
25
|
+
|
|
26
|
+
Constructs a new instance of the `EmbeddedResourceStrategy` class.
|
|
27
|
+
|
|
28
|
+
#### Parameters
|
|
29
|
+
|
|
30
|
+
| Parameter | Type |
|
|
31
|
+
| ------ | ------ |
|
|
32
|
+
| `resources` | `Record`\<`string`, `string`\> |
|
|
33
|
+
|
|
34
|
+
#### Returns
|
|
35
|
+
|
|
36
|
+
`EmbeddedResourceStrategy`
|
|
37
|
+
|
|
38
|
+
## Accessors
|
|
39
|
+
|
|
40
|
+
### name
|
|
41
|
+
|
|
42
|
+
#### Get Signature
|
|
43
|
+
|
|
44
|
+
```ts
|
|
45
|
+
get name(): string;
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Defined in: [strategies/EmbeddedResourceStrategy.ts:37](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-resources/src/strategies/EmbeddedResourceStrategy.ts#L37)
|
|
49
|
+
|
|
50
|
+
The unique name of this strategy.
|
|
51
|
+
|
|
52
|
+
##### Returns
|
|
53
|
+
|
|
54
|
+
`string`
|
|
55
|
+
|
|
56
|
+
The unique name of this strategy.
|
|
57
|
+
|
|
58
|
+
#### Implementation of
|
|
59
|
+
|
|
60
|
+
[`IResourceStrategy`](Interface.IResourceStrategy).[`name`](Interface.IResourceStrategy#name)
|
|
61
|
+
|
|
62
|
+
## Methods
|
|
63
|
+
|
|
64
|
+
### exists()
|
|
65
|
+
|
|
66
|
+
```ts
|
|
67
|
+
exists(key): boolean;
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
Defined in: [strategies/EmbeddedResourceStrategy.ts:93](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-resources/src/strategies/EmbeddedResourceStrategy.ts#L93)
|
|
71
|
+
|
|
72
|
+
Checks if a resource exists without loading it.
|
|
73
|
+
|
|
74
|
+
#### Parameters
|
|
75
|
+
|
|
76
|
+
| Parameter | Type | Description |
|
|
77
|
+
| ------ | ------ | ------ |
|
|
78
|
+
| `key` | `string` | The resource key |
|
|
79
|
+
|
|
80
|
+
#### Returns
|
|
81
|
+
|
|
82
|
+
`boolean`
|
|
83
|
+
|
|
84
|
+
True if the resource exists
|
|
85
|
+
|
|
86
|
+
#### Implementation of
|
|
87
|
+
|
|
88
|
+
[`IResourceStrategy`](Interface.IResourceStrategy).[`exists`](Interface.IResourceStrategy#exists)
|
|
89
|
+
|
|
90
|
+
***
|
|
91
|
+
|
|
92
|
+
### existsAsync()
|
|
93
|
+
|
|
94
|
+
```ts
|
|
95
|
+
existsAsync(key): Promise<boolean>;
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
Defined in: [strategies/EmbeddedResourceStrategy.ts:104](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-resources/src/strategies/EmbeddedResourceStrategy.ts#L104)
|
|
99
|
+
|
|
100
|
+
Checks if a resource exists without loading it (asynchronous).
|
|
101
|
+
|
|
102
|
+
#### Parameters
|
|
103
|
+
|
|
104
|
+
| Parameter | Type | Description |
|
|
105
|
+
| ------ | ------ | ------ |
|
|
106
|
+
| `key` | `string` | The resource key |
|
|
107
|
+
|
|
108
|
+
#### Returns
|
|
109
|
+
|
|
110
|
+
`Promise`\<`boolean`\>
|
|
111
|
+
|
|
112
|
+
Promise resolving to true if the resource exists
|
|
113
|
+
|
|
114
|
+
#### Implementation of
|
|
115
|
+
|
|
116
|
+
[`IResourceStrategy`](Interface.IResourceStrategy).[`existsAsync`](Interface.IResourceStrategy#existsasync)
|
|
117
|
+
|
|
118
|
+
***
|
|
119
|
+
|
|
120
|
+
### load()
|
|
121
|
+
|
|
122
|
+
```ts
|
|
123
|
+
load(key): IResourceResult | undefined;
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
Defined in: [strategies/EmbeddedResourceStrategy.ts:52](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-resources/src/strategies/EmbeddedResourceStrategy.ts#L52)
|
|
127
|
+
|
|
128
|
+
Loads a resource by its key.
|
|
129
|
+
|
|
130
|
+
#### Parameters
|
|
131
|
+
|
|
132
|
+
| Parameter | Type | Description |
|
|
133
|
+
| ------ | ------ | ------ |
|
|
134
|
+
| `key` | `string` | The resource key |
|
|
135
|
+
|
|
136
|
+
#### Returns
|
|
137
|
+
|
|
138
|
+
[`IResourceResult`](Interface.IResourceResult) \| `undefined`
|
|
139
|
+
|
|
140
|
+
The resource result or undefined if not found
|
|
141
|
+
|
|
142
|
+
#### Implementation of
|
|
143
|
+
|
|
144
|
+
[`IResourceStrategy`](Interface.IResourceStrategy).[`load`](Interface.IResourceStrategy#load)
|
|
145
|
+
|
|
146
|
+
***
|
|
147
|
+
|
|
148
|
+
### loadAsync()
|
|
149
|
+
|
|
150
|
+
```ts
|
|
151
|
+
loadAsync(key): Promise<IResourceResult | undefined>;
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
Defined in: [strategies/EmbeddedResourceStrategy.ts:82](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-resources/src/strategies/EmbeddedResourceStrategy.ts#L82)
|
|
155
|
+
|
|
156
|
+
Loads a resource by its key (asynchronous).
|
|
157
|
+
|
|
158
|
+
#### Parameters
|
|
159
|
+
|
|
160
|
+
| Parameter | Type | Description |
|
|
161
|
+
| ------ | ------ | ------ |
|
|
162
|
+
| `key` | `string` | The resource key |
|
|
163
|
+
|
|
164
|
+
#### Returns
|
|
165
|
+
|
|
166
|
+
`Promise`\<[`IResourceResult`](Interface.IResourceResult) \| `undefined`\>
|
|
167
|
+
|
|
168
|
+
Promise resolving to the resource result or undefined if not found
|
|
169
|
+
|
|
170
|
+
#### Implementation of
|
|
171
|
+
|
|
172
|
+
[`IResourceStrategy`](Interface.IResourceStrategy).[`loadAsync`](Interface.IResourceStrategy#loadasync)
|
|
173
|
+
|
|
174
|
+
***
|
|
175
|
+
|
|
176
|
+
### register()
|
|
177
|
+
|
|
178
|
+
```ts
|
|
179
|
+
register(key, content): void;
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
Defined in: [strategies/EmbeddedResourceStrategy.ts:115](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-resources/src/strategies/EmbeddedResourceStrategy.ts#L115)
|
|
183
|
+
|
|
184
|
+
Registers a new embedded resource.
|
|
185
|
+
|
|
186
|
+
#### Parameters
|
|
187
|
+
|
|
188
|
+
| Parameter | Type | Description |
|
|
189
|
+
| ------ | ------ | ------ |
|
|
190
|
+
| `key` | `string` | The resource key |
|
|
191
|
+
| `content` | `string` | The resource content |
|
|
192
|
+
|
|
193
|
+
#### Returns
|
|
194
|
+
|
|
195
|
+
`void`
|
|
196
|
+
|
|
197
|
+
***
|
|
198
|
+
|
|
199
|
+
### whatDoIHave()
|
|
200
|
+
|
|
201
|
+
```ts
|
|
202
|
+
whatDoIHave(): void;
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
Defined in: [strategies/EmbeddedResourceStrategy.ts:124](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-resources/src/strategies/EmbeddedResourceStrategy.ts#L124)
|
|
206
|
+
|
|
207
|
+
List all files and folders in the base paths for debugging purposes.
|
|
208
|
+
|
|
209
|
+
#### Returns
|
|
210
|
+
|
|
211
|
+
`void`
|
|
212
|
+
|
|
213
|
+
#### Implementation of
|
|
214
|
+
|
|
215
|
+
[`IResourceStrategy`](Interface.IResourceStrategy).[`whatDoIHave`](Interface.IResourceStrategy#whatdoihave)
|