@breadstone/archipel-mcp 0.0.53 → 0.0.55
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/ai-image-generation.md +96 -0
- package/data/guides/ai-realtime-voice.md +69 -464
- package/data/guides/ai-text-generation.md +95 -622
- package/data/guides/index.md +3 -1
- package/data/guides/intelligence-prompts-warm-up.md +138 -0
- package/data/packages/platform-intelligence/api/Class.AnthropicIntelligenceProviderAdapter.md +78 -0
- package/data/packages/platform-intelligence/api/Class.DefaultIntelligencePromptPolicyAdapter.md +54 -0
- package/data/packages/platform-intelligence/api/Class.GatewayIntelligenceProviderAdapter.md +78 -0
- package/data/packages/platform-intelligence/api/Class.GoogleIntelligenceProviderAdapter.md +78 -0
- package/data/packages/platform-intelligence/api/Class.GrokIntelligenceProviderAdapter.md +78 -0
- package/data/packages/platform-intelligence/api/Class.IntelligenceAgent.md +95 -0
- package/data/packages/platform-intelligence/api/Class.IntelligenceAgentFactory.md +11 -23
- package/data/packages/platform-intelligence/api/Class.IntelligenceEmbeddingGenerator.md +25 -21
- package/data/packages/platform-intelligence/api/Class.IntelligenceHealthIndicator.md +11 -7
- package/data/packages/platform-intelligence/api/Class.IntelligenceLanguageGenerator.md +159 -0
- package/data/packages/platform-intelligence/api/Class.IntelligenceMediaGenerator.md +60 -38
- package/data/packages/platform-intelligence/api/Class.IntelligenceModule.md +2 -2
- package/data/packages/platform-intelligence/api/Class.IntelligencePromptExecutor.md +88 -0
- package/data/packages/platform-intelligence/api/Class.IntelligencePromptPolicyPort.md +48 -0
- package/data/packages/platform-intelligence/api/Class.IntelligenceProviderAssetUploader.md +21 -15
- package/data/packages/platform-intelligence/api/Class.IntelligenceProviderDiagnostics.md +55 -0
- package/data/packages/platform-intelligence/api/Class.IntelligenceProviderError.md +14 -4
- package/data/packages/platform-intelligence/api/Class.IntelligenceProviderRegistry.md +68 -0
- package/data/packages/platform-intelligence/api/Class.IntelligenceRealtimeError.md +9 -9
- package/data/packages/platform-intelligence/api/Class.IntelligenceRealtimeMeteringPort.md +2 -2
- package/data/packages/platform-intelligence/api/Class.IntelligenceRealtimeSessionFactory.md +12 -12
- package/data/packages/platform-intelligence/api/Class.IntelligenceRealtimeSessionPort.md +18 -18
- package/data/packages/platform-intelligence/api/Class.IntelligenceReranker.md +58 -0
- package/data/packages/platform-intelligence/api/Class.IntelligenceToolBase.md +14 -16
- package/data/packages/platform-intelligence/api/Class.IntelligenceToolRegistry.md +10 -14
- package/data/packages/platform-intelligence/api/Class.MiMoIntelligenceProviderAdapter.md +78 -0
- package/data/packages/platform-intelligence/api/Class.OpenAIIntelligenceProviderAdapter.md +102 -0
- package/data/packages/platform-intelligence/api/Function.createAnthropicAdvisor20260301Tool.md +1 -1
- package/data/packages/platform-intelligence/api/Function.createAnthropicBash20241022Tool.md +1 -1
- package/data/packages/platform-intelligence/api/Function.createAnthropicBash20250124Tool.md +1 -1
- package/data/packages/platform-intelligence/api/Function.createAnthropicCodeExecution20250522Tool.md +1 -1
- package/data/packages/platform-intelligence/api/Function.createAnthropicCodeExecution20250825Tool.md +1 -1
- package/data/packages/platform-intelligence/api/Function.createAnthropicCodeExecution20260120Tool.md +1 -1
- package/data/packages/platform-intelligence/api/Function.createAnthropicComputer20241022Tool.md +1 -1
- package/data/packages/platform-intelligence/api/Function.createAnthropicComputer20250124Tool.md +1 -1
- package/data/packages/platform-intelligence/api/Function.createAnthropicComputer20251124Tool.md +1 -1
- package/data/packages/platform-intelligence/api/Function.createAnthropicMemory20250818Tool.md +1 -1
- package/data/packages/platform-intelligence/api/Function.createAnthropicTextEditor20241022Tool.md +1 -1
- package/data/packages/platform-intelligence/api/Function.createAnthropicTextEditor20250124Tool.md +1 -1
- package/data/packages/platform-intelligence/api/Function.createAnthropicTextEditor20250429Tool.md +1 -1
- package/data/packages/platform-intelligence/api/Function.createAnthropicTextEditor20250728Tool.md +1 -1
- package/data/packages/platform-intelligence/api/Function.createAnthropicToolSearchBM2520251119Tool.md +1 -1
- package/data/packages/platform-intelligence/api/Function.createAnthropicToolSearchRegex20251119Tool.md +1 -1
- package/data/packages/platform-intelligence/api/Function.createAnthropicWebFetch20250910Tool.md +1 -1
- package/data/packages/platform-intelligence/api/Function.createAnthropicWebFetch20260209Tool.md +1 -1
- package/data/packages/platform-intelligence/api/Function.createAnthropicWebSearch20250305Tool.md +1 -1
- package/data/packages/platform-intelligence/api/Function.createAnthropicWebSearch20260209Tool.md +1 -1
- package/data/packages/platform-intelligence/api/Function.createGoogleCodeExecutionTool.md +1 -1
- package/data/packages/platform-intelligence/api/Function.createGoogleEnterpriseWebSearchTool.md +1 -1
- package/data/packages/platform-intelligence/api/Function.createGoogleFileSearchTool.md +1 -1
- package/data/packages/platform-intelligence/api/Function.createGoogleGoogleMapsTool.md +1 -1
- package/data/packages/platform-intelligence/api/Function.createGoogleGoogleSearchTool.md +1 -1
- package/data/packages/platform-intelligence/api/Function.createGoogleUrlContextTool.md +1 -1
- package/data/packages/platform-intelligence/api/Function.createGoogleVertexRagStoreTool.md +1 -1
- package/data/packages/platform-intelligence/api/Function.createGrokCodeExecutionTool.md +1 -1
- package/data/packages/platform-intelligence/api/Function.createGrokFileSearchTool.md +1 -1
- package/data/packages/platform-intelligence/api/Function.createGrokMcpServerTool.md +1 -1
- package/data/packages/platform-intelligence/api/Function.createGrokViewImageTool.md +1 -1
- package/data/packages/platform-intelligence/api/Function.createGrokViewXVideoTool.md +1 -1
- package/data/packages/platform-intelligence/api/Function.createGrokWebSearchTool.md +1 -1
- package/data/packages/platform-intelligence/api/Function.createGrokXSearchTool.md +1 -1
- package/data/packages/platform-intelligence/api/Function.createIntelligenceJsonSchema.md +31 -0
- package/data/packages/platform-intelligence/api/Function.createIntelligenceTool.md +2 -2
- package/data/packages/platform-intelligence/api/Function.createMimoCustomTool.md +5 -5
- package/data/packages/platform-intelligence/api/Function.createOpenAIApplyPatchTool.md +1 -1
- package/data/packages/platform-intelligence/api/Function.createOpenAICodeInterpreterTool.md +1 -1
- package/data/packages/platform-intelligence/api/Function.createOpenAICustomTool.md +1 -1
- package/data/packages/platform-intelligence/api/Function.createOpenAIFileSearchTool.md +1 -1
- package/data/packages/platform-intelligence/api/Function.createOpenAIImageGenerationTool.md +1 -1
- package/data/packages/platform-intelligence/api/Function.createOpenAILocalShellTool.md +1 -1
- package/data/packages/platform-intelligence/api/Function.createOpenAIMcpTool.md +1 -1
- package/data/packages/platform-intelligence/api/Function.createOpenAIShellTool.md +1 -1
- package/data/packages/platform-intelligence/api/Function.createOpenAIToolSearchTool.md +1 -1
- package/data/packages/platform-intelligence/api/Function.createOpenAIWebSearchPreviewTool.md +1 -1
- package/data/packages/platform-intelligence/api/Function.createOpenAIWebSearchTool.md +1 -1
- package/data/packages/platform-intelligence/api/Function.defineIntelligenceTool.md +31 -0
- package/data/packages/platform-intelligence/api/Function.intelligencePrompt.md +31 -0
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceAgentConfiguration.md +70 -0
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceEmbeddingBatchOptions.md +124 -0
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceEmbeddingBatchResult.md +70 -0
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceEmbeddingOptions.md +114 -0
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceEmbeddingResult.md +70 -0
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceFileUploadOptions.md +102 -0
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceFileUploadResult.md +60 -0
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceGeneratedFile.md +40 -0
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceGenerationStepStartEvent.md +50 -0
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceImageGenerationOptions.md +170 -0
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceImageGenerationResult.md +60 -0
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceLanguageCompletion.md +141 -0
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceLanguageGenerationOptions.md +234 -0
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceLanguageStream.md +50 -0
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceModelReference.md +34 -0
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceModelRequestOptions.md +52 -0
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceModelStatus.md +30 -0
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceModuleOptions.md +43 -25
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceObjectStream.md +56 -0
- package/data/packages/platform-intelligence/api/Interface.IIntelligencePrompt.md +50 -0
- package/data/packages/platform-intelligence/api/Interface.IIntelligencePromptDefinition.md +145 -0
- package/data/packages/platform-intelligence/api/Interface.IIntelligencePromptEffectivePolicy.md +30 -0
- package/data/packages/platform-intelligence/api/Interface.IIntelligencePromptExecutionContext.md +20 -0
- package/data/packages/platform-intelligence/api/Interface.IIntelligencePromptExecutionPolicy.md +70 -0
- package/data/packages/platform-intelligence/api/Interface.IIntelligencePromptExecutionResult.md +127 -0
- package/data/packages/platform-intelligence/api/Interface.IIntelligencePromptInvocation.md +49 -0
- package/data/packages/platform-intelligence/api/Interface.IIntelligencePromptPolicyRequest.md +60 -0
- package/data/packages/platform-intelligence/api/Interface.IIntelligencePromptRenderContext.md +26 -0
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceProviderAdapter.md +73 -0
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceProviderConfiguration.md +10 -10
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceProviderLoadRequest.md +40 -0
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceProviderProbeResult.md +70 -0
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceRealtimeAudioFormat.md +3 -3
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceRealtimeCloseEvent.md +4 -4
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceRealtimeModuleOptions.md +9 -21
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceRealtimeSessionConfiguration.md +11 -11
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceRealtimeSessionOptions.md +11 -11
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceRealtimeToolDefinition.md +5 -5
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceRealtimeTranscriptionConfiguration.md +4 -4
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceRealtimeTurnDetectionConfiguration.md +5 -5
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceRealtimeUsage.md +10 -10
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceRequestOptions.md +98 -0
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceRerankingOptions.md +140 -0
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceRerankingResult.md +50 -0
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceSkillUploadOptions.md +94 -0
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceSkillUploadResult.md +80 -0
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceSpeechGenerationOptions.md +164 -0
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceSpeechGenerationResult.md +50 -0
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceStreamingTranscriptionOptions.md +139 -0
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceTool.md +7 -10
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceToolCall.md +40 -0
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceToolDefinition.md +91 -0
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceToolExecutionEndEvent.md +50 -0
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceToolExecutionStartEvent.md +30 -0
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceToolRegistry.md +4 -4
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceTranscriptionOptions.md +114 -0
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceTranscriptionResult.md +84 -0
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceTranscriptionStream.md +97 -0
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceUsage.md +40 -0
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceVideoGenerationOptions.md +229 -0
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceVideoGenerationResult.md +50 -0
- package/data/packages/platform-intelligence/api/TypeAlias.IIntelligenceModelMessage.md +43 -0
- package/data/packages/platform-intelligence/api/TypeAlias.IIntelligencePromptModelRequirement.md +25 -0
- package/data/packages/platform-intelligence/api/TypeAlias.IIntelligenceSchema.md +70 -0
- package/data/packages/platform-intelligence/api/TypeAlias.IntelligenceCapability.md +14 -0
- package/data/packages/platform-intelligence/api/TypeAlias.IntelligenceDefaultModels.md +14 -0
- package/data/packages/platform-intelligence/api/TypeAlias.IntelligenceJsonValue.md +22 -0
- package/data/packages/platform-intelligence/api/TypeAlias.IntelligencePromptCapability.md +20 -0
- package/data/packages/platform-intelligence/api/TypeAlias.IntelligencePromptDefinitionConfiguration.md +29 -0
- package/data/packages/platform-intelligence/api/TypeAlias.IntelligencePromptGenerationOptions.md +16 -0
- package/data/packages/platform-intelligence/api/TypeAlias.IntelligencePromptLatency.md +14 -0
- package/data/packages/platform-intelligence/api/TypeAlias.IntelligencePromptMode.md +14 -0
- package/data/packages/platform-intelligence/api/TypeAlias.IntelligencePromptQuality.md +14 -0
- package/data/packages/platform-intelligence/api/TypeAlias.IntelligencePromptReasoning.md +14 -0
- package/data/packages/platform-intelligence/api/TypeAlias.IntelligenceProviderName.md +1 -1
- package/data/packages/platform-intelligence/api/TypeAlias.IntelligenceProviderOptions.md +14 -0
- package/data/packages/platform-intelligence/api/TypeAlias.IntelligenceProviderProbeStatus.md +14 -0
- package/data/packages/platform-intelligence/api/TypeAlias.IntelligenceProviderToolOptions.md +17 -0
- package/data/packages/platform-intelligence/api/TypeAlias.IntelligenceRealtimeClientEvent.md +1 -1
- package/data/packages/platform-intelligence/api/TypeAlias.IntelligenceRealtimeMetadataValue.md +1 -1
- package/data/packages/platform-intelligence/api/TypeAlias.IntelligenceRealtimeMeteringEvent.md +1 -1
- package/data/packages/platform-intelligence/api/TypeAlias.IntelligenceRealtimeServerEvent.md +1 -1
- package/data/packages/platform-intelligence/api/TypeAlias.IntelligenceRealtimeStatus.md +1 -1
- package/data/packages/platform-intelligence/api/TypeAlias.IntelligenceRequestTimeouts.md +14 -0
- package/data/packages/platform-intelligence/api/TypeAlias.IntelligenceToolChoice.md +21 -0
- package/data/packages/platform-intelligence/api/TypeAlias.IntelligenceToolOutput.md +22 -0
- package/data/packages/platform-intelligence/api/TypeAlias.IntelligenceToolSet.md +14 -0
- package/data/packages/platform-intelligence/api/TypeAlias.IntelligenceTranscriptionStreamPart.md +46 -0
- package/data/packages/platform-intelligence/api/Variable.AI_GATEWAY_API_KEY.md +14 -0
- package/data/packages/platform-intelligence/api/Variable.AI_GATEWAY_BASE_URL.md +14 -0
- package/data/packages/platform-intelligence/api/Variable.AI_GATEWAY_CONFIG_ENTRIES.md +14 -0
- package/data/packages/platform-intelligence/api/Variable.INTELLIGENCE_API_KEY.md +1 -1
- package/data/packages/platform-intelligence/api/Variable.INTELLIGENCE_BASE_URL.md +1 -1
- package/data/packages/platform-intelligence/api/Variable.INTELLIGENCE_MAX_OUTPUT_TOKENS.md +1 -1
- package/data/packages/platform-intelligence/api/Variable.INTELLIGENCE_MODEL.md +1 -1
- package/data/packages/platform-intelligence/api/Variable.INTELLIGENCE_PROVIDER.md +2 -2
- package/data/packages/platform-intelligence/api/Variable.INTELLIGENCE_TEMPERATURE.md +1 -1
- package/data/packages/platform-intelligence/api/Variable.INTELLIGENCE_TOP_P.md +1 -1
- package/data/packages/platform-intelligence/api/Variable.IntelligenceCapabilityNames.md +40 -0
- package/data/packages/platform-intelligence/api/Variable.IntelligenceProviderNames.md +2 -0
- package/data/packages/platform-intelligence/api/Variable.PLATFORM_INTELLIGENCE_CONFIG_ENTRIES.md +1 -1
- package/data/packages/platform-intelligence/api/index.md +98 -30
- package/package.json +1 -1
- package/data/packages/index.md +0 -8
- package/data/packages/platform-analytics/index.md +0 -209
- package/data/packages/platform-authentication/index.md +0 -725
- package/data/packages/platform-blob-storage/index.md +0 -416
- package/data/packages/platform-bootstrap/index.md +0 -162
- package/data/packages/platform-caching/index.md +0 -167
- package/data/packages/platform-configuration/index.md +0 -226
- package/data/packages/platform-core/index.md +0 -504
- package/data/packages/platform-cryptography/index.md +0 -142
- package/data/packages/platform-database/index.md +0 -337
- package/data/packages/platform-documents/index.md +0 -255
- package/data/packages/platform-esigning/index.md +0 -710
- package/data/packages/platform-feature-flags/index.md +0 -103
- package/data/packages/platform-health/index.md +0 -141
- package/data/packages/platform-intelligence/api/Class.IntelligenceStructuredGenerator.md +0 -70
- package/data/packages/platform-intelligence/api/Class.IntelligenceTelemetryRegistry.md +0 -44
- package/data/packages/platform-intelligence/api/Class.IntelligenceTextGenerator.md +0 -138
- package/data/packages/platform-intelligence/api/Function.createProviderOptions.md +0 -39
- package/data/packages/platform-intelligence/api/Function.loadAnthropicLanguageModel.md +0 -26
- package/data/packages/platform-intelligence/api/Function.loadGoogleLanguageModel.md +0 -26
- package/data/packages/platform-intelligence/api/Function.loadGoogleRealtimeModel.md +0 -25
- package/data/packages/platform-intelligence/api/Function.loadGrokLanguageModel.md +0 -26
- package/data/packages/platform-intelligence/api/Function.loadGrokRealtimeModel.md +0 -25
- package/data/packages/platform-intelligence/api/Function.loadMimoLanguageModel.md +0 -26
- package/data/packages/platform-intelligence/api/Function.loadOpenAILanguageModel.md +0 -26
- package/data/packages/platform-intelligence/api/Function.loadOpenAIRealtimeModel.md +0 -25
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceCompletionUsage.md +0 -46
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceTextCompletion.md +0 -168
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceTextGenerationOptions.md +0 -144
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceTextGenerator.md +0 -78
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceTextStreamingOptions.md +0 -170
- package/data/packages/platform-intelligence/api/TypeAlias.IntelligenceLanguageModelLoader.md +0 -24
- package/data/packages/platform-intelligence/api/TypeAlias.IntelligenceLanguageModelLoaders.md +0 -14
- package/data/packages/platform-intelligence/api/TypeAlias.IntelligenceRealtimeModelLoader.md +0 -25
- package/data/packages/platform-intelligence/api/TypeAlias.IntelligenceRealtimeModelLoaders.md +0 -14
- package/data/packages/platform-intelligence/api/TypeAlias.IntelligenceTextStream.md +0 -14
- package/data/packages/platform-intelligence/index.md +0 -549
- package/data/packages/platform-logging/index.md +0 -150
- package/data/packages/platform-mailing/index.md +0 -470
- package/data/packages/platform-mapping/index.md +0 -123
- package/data/packages/platform-mcp/index.md +0 -335
- package/data/packages/platform-openapi/index.md +0 -207
- package/data/packages/platform-payments/index.md +0 -610
- package/data/packages/platform-queue/index.md +0 -192
- package/data/packages/platform-reporting/index.md +0 -233
- package/data/packages/platform-resources/index.md +0 -137
- package/data/packages/platform-telemetry/index.md +0 -262
|
@@ -1,192 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: platform-queue
|
|
3
|
-
description: Provider-agnostic queue infrastructure with support for in-memory FIFO, BullMQ (Redis), Azure Service Bus, and Vercel Queues.
|
|
4
|
-
order: 19
|
|
5
|
-
tags: [queue, job-queue, fifo, memory-queue, bullmq, redis, azure-service-bus, vercel-queues, 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 four ready-made implementations: in-memory FIFO (`MemoryQueue`), BullMQ/Redis (`BullMqQueue`), Azure Service Bus (`AzureQueue`), and Vercel Queues (`VercelQueue`). 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
|
-
<InstallTabs />
|
|
16
|
-
|
|
17
|
-
## Architecture
|
|
18
|
-
|
|
19
|
-
```mermaid
|
|
20
|
-
graph TD
|
|
21
|
-
Core["@breadstone/archipel-platform-queue<br/><i>IQueue, models, errors, MemoryQueue</i>"]
|
|
22
|
-
BullMQ["@breadstone/archipel-platform-queue/bullmq<br/><i>BullMqQueue</i>"]
|
|
23
|
-
Azure["@breadstone/archipel-platform-queue/azure<br/><i>AzureQueue</i>"]
|
|
24
|
-
Vercel["@breadstone/archipel-platform-queue/vercel<br/><i>VercelQueue</i>"]
|
|
25
|
-
|
|
26
|
-
BullMQ -->|implements| Core
|
|
27
|
-
Azure -->|implements| Core
|
|
28
|
-
Vercel -->|implements| Core
|
|
29
|
-
|
|
30
|
-
BullMQ -.-|requires| R["bullmq"]
|
|
31
|
-
Azure -.-|requires| S["@azure/service-bus"]
|
|
32
|
-
Vercel -.-|requires| V["@vercel/queue"]
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
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.
|
|
36
|
-
|
|
37
|
-
---
|
|
38
|
-
|
|
39
|
-
## Quick Start
|
|
40
|
-
|
|
41
|
-
### 1. Install the provider SDK (optional)
|
|
42
|
-
|
|
43
|
-
```bash
|
|
44
|
-
# Pick one (or use MemoryQueue without any extra SDK):
|
|
45
|
-
yarn add bullmq
|
|
46
|
-
yarn add @azure/service-bus
|
|
47
|
-
yarn add @vercel/queue
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
### 2. Register the queue
|
|
51
|
-
|
|
52
|
-
```typescript
|
|
53
|
-
import { Module } from '@nestjs/common';
|
|
54
|
-
import { IQueue, MemoryQueue } from '@breadstone/archipel-platform-queue';
|
|
55
|
-
|
|
56
|
-
@Module({
|
|
57
|
-
providers: [
|
|
58
|
-
{
|
|
59
|
-
provide: 'IQueue',
|
|
60
|
-
useFactory: () => new MemoryQueue({ maxJobs: 5_000 }),
|
|
61
|
-
},
|
|
62
|
-
],
|
|
63
|
-
exports: ['IQueue'],
|
|
64
|
-
})
|
|
65
|
-
export class AppModule {}
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
### Switching providers
|
|
69
|
-
|
|
70
|
-
Replace the imports — no other code change needed:
|
|
71
|
-
|
|
72
|
-
```typescript
|
|
73
|
-
import { BullMqQueue } from '@breadstone/archipel-platform-queue/bullmq';
|
|
74
|
-
|
|
75
|
-
{
|
|
76
|
-
provide: 'IQueue',
|
|
77
|
-
useFactory: () => new BullMqQueue({ redisUrl: 'redis://localhost:6379' }),
|
|
78
|
-
}
|
|
79
|
-
```
|
|
80
|
-
|
|
81
|
-
---
|
|
82
|
-
|
|
83
|
-
## Queue Providers
|
|
84
|
-
|
|
85
|
-
### Memory (built-in)
|
|
86
|
-
|
|
87
|
-
**Entry point:** `@breadstone/archipel-platform-queue`
|
|
88
|
-
|
|
89
|
-
| Variable | Required | Default | Description |
|
|
90
|
-
| ---------------- | -------- | ------- | ------------------------------------- |
|
|
91
|
-
| `QUEUE_MAX_JOBS` | No | `10000` | Maximum jobs retained before eviction |
|
|
92
|
-
|
|
93
|
-
### BullMQ
|
|
94
|
-
|
|
95
|
-
**Subpath:** `@breadstone/archipel-platform-queue/bullmq`
|
|
96
|
-
**SDK:** `bullmq` ≥ 5.0.0
|
|
97
|
-
|
|
98
|
-
| Variable | Required | Default | Description |
|
|
99
|
-
| ----------------- | -------- | ------- | -------------------------------------------- |
|
|
100
|
-
| `BULLMQ_REDIS_URL`| Yes | — | Redis connection URL (e.g. `redis://localhost:6379`) |
|
|
101
|
-
| `BULLMQ_PREFIX` | No | `""` | Optional key prefix for all BullMQ queues |
|
|
102
|
-
|
|
103
|
-
```typescript
|
|
104
|
-
import { BullMqQueue, BULLMQ_CONFIG_ENTRIES } from '@breadstone/archipel-platform-queue/bullmq';
|
|
105
|
-
```
|
|
106
|
-
|
|
107
|
-
### Azure Service Bus
|
|
108
|
-
|
|
109
|
-
**Subpath:** `@breadstone/archipel-platform-queue/azure`
|
|
110
|
-
**SDK:** `@azure/service-bus` ≥ 7.0.0
|
|
111
|
-
|
|
112
|
-
| Variable | Required | Default | Description |
|
|
113
|
-
| ------------------------- | -------- | ------- | ---------------------------------------- |
|
|
114
|
-
| `AZURE_CONNECTION_STRING` | Yes | — | Azure Service Bus connection string |
|
|
115
|
-
| `AZURE_RECEIVE_WAIT_MS` | No | `5000` | Max wait time (ms) when receiving messages|
|
|
116
|
-
|
|
117
|
-
```typescript
|
|
118
|
-
import { AzureQueue, AZURE_CONFIG_ENTRIES } from '@breadstone/archipel-platform-queue/azure';
|
|
119
|
-
```
|
|
120
|
-
|
|
121
|
-
### Vercel Queues
|
|
122
|
-
|
|
123
|
-
**Subpath:** `@breadstone/archipel-platform-queue/vercel`
|
|
124
|
-
**SDK:** `@vercel/queue` ≥ 0.1.0
|
|
125
|
-
|
|
126
|
-
| Variable | Required | Default | Description |
|
|
127
|
-
| --------------------------------------- | -------- | ------- | ----------------------------------------------------- |
|
|
128
|
-
| `VERCEL_QUEUE_REGION` | Yes | — | Vercel region code (e.g. `iad1`, `fra1`, `sfo1`) |
|
|
129
|
-
| `VERCEL_QUEUE_CONSUMER_GROUP` | Yes | — | Consumer group name for receiving messages |
|
|
130
|
-
| `VERCEL_QUEUE_TOKEN` | No | — | OIDC bearer token (auto-fetched when omitted) |
|
|
131
|
-
| `VERCEL_QUEUE_DEPLOYMENT_ID` | No | — | Deployment ID for per-deployment message isolation |
|
|
132
|
-
| `VERCEL_QUEUE_VISIBILITY_TIMEOUT_SECONDS`| No | `300` | Visibility timeout in seconds for received messages |
|
|
133
|
-
|
|
134
|
-
```typescript
|
|
135
|
-
import { VercelQueue, VERCEL_CONFIG_ENTRIES } from '@breadstone/archipel-platform-queue/vercel';
|
|
136
|
-
```
|
|
137
|
-
|
|
138
|
-
---
|
|
139
|
-
|
|
140
|
-
## Job Lifecycle
|
|
141
|
-
|
|
142
|
-
| Status | Description |
|
|
143
|
-
| ------------ | ---------------------------------------------------- |
|
|
144
|
-
| `pending` | Job is waiting to be picked up |
|
|
145
|
-
| `processing` | Job has been dequeued and is being processed |
|
|
146
|
-
| `completed` | Job finished successfully via `markCompleted()` |
|
|
147
|
-
| `failed` | Job finished with an error via `markFailed()` |
|
|
148
|
-
|
|
149
|
-
---
|
|
150
|
-
|
|
151
|
-
## Error Handling
|
|
152
|
-
|
|
153
|
-
| Error Class | Base Class | When Thrown |
|
|
154
|
-
| ----------------------- | ------------ | ---------------------------------------------- |
|
|
155
|
-
| `QueueError` | `Error` | Base class for all queue errors |
|
|
156
|
-
| `QueueJobNotFoundError` | `QueueError` | Job ID does not exist |
|
|
157
|
-
| `QueueJobStateError` | `QueueError` | Job is in wrong state for requested transition |
|
|
158
|
-
| `QueueValidationError` | `QueueError` | Empty queue name or error message |
|
|
159
|
-
|
|
160
|
-
---
|
|
161
|
-
|
|
162
|
-
## Health Check
|
|
163
|
-
|
|
164
|
-
The `QueueHealthIndicator` reports the queue subsystem as available. Import it from the `/health` subpath:
|
|
165
|
-
|
|
166
|
-
```typescript
|
|
167
|
-
import { QueueHealthIndicator } from '@breadstone/archipel-platform-queue/health';
|
|
168
|
-
import { HealthModule } from '@breadstone/archipel-platform-health';
|
|
169
|
-
|
|
170
|
-
@Module({
|
|
171
|
-
imports: [
|
|
172
|
-
QueueModule.register({ /* ... */ }),
|
|
173
|
-
HealthModule.withIndicators([QueueHealthIndicator]),
|
|
174
|
-
],
|
|
175
|
-
})
|
|
176
|
-
export class AppModule {}
|
|
177
|
-
```
|
|
178
|
-
|
|
179
|
-
| Key | Check | Dependencies |
|
|
180
|
-
| --- | ----- | ------------ |
|
|
181
|
-
| `queue` | Always reports `up` | None |
|
|
182
|
-
|
|
183
|
-
---
|
|
184
|
-
|
|
185
|
-
## Peer Dependencies
|
|
186
|
-
|
|
187
|
-
| Package | Required | Notes |
|
|
188
|
-
| -------------------- | -------- | -------------------------------- |
|
|
189
|
-
| `@nestjs/common` | Yes | NestJS core |
|
|
190
|
-
| `bullmq` | Optional | Required for BullMQ provider |
|
|
191
|
-
| `@azure/service-bus` | Optional | Required for Azure Service Bus |
|
|
192
|
-
| `@vercel/queue` | Optional | Required for Vercel Queues |
|
|
@@ -1,233 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: platform-reporting
|
|
3
|
-
description: Business reporting framework with pluggable data contributors and query execution.
|
|
4
|
-
order: 10
|
|
5
|
-
tags: [reporting, analytics, datasets, queries, contributors]
|
|
6
|
-
package: '@breadstone/archipel-platform-reporting'
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
# platform-reporting
|
|
10
|
-
|
|
11
|
-
Extensible business reporting framework using a contributor registry pattern. Feature modules register data contributors that expose datasets, and the central facade handles catalog discovery and query execution.
|
|
12
|
-
|
|
13
|
-
**Package:** `@breadstone/archipel-platform-reporting`
|
|
14
|
-
|
|
15
|
-
<InstallTabs />
|
|
16
|
-
|
|
17
|
-
## Quick Start
|
|
18
|
-
|
|
19
|
-
```typescript
|
|
20
|
-
import { Module } from '@nestjs/common';
|
|
21
|
-
import { ReportingModule } from '@breadstone/archipel-platform-reporting';
|
|
22
|
-
|
|
23
|
-
@Module({
|
|
24
|
-
imports: [ReportingModule],
|
|
25
|
-
})
|
|
26
|
-
export class AppModule {}
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
---
|
|
30
|
-
|
|
31
|
-
## Contributor Pattern
|
|
32
|
-
|
|
33
|
-
Each feature module provides an `IReportingContributor` that exposes the datasets it can report on. Contributors are registered with the `ReportingContributorRegistry` and discovered by the `ReportingFacade`.
|
|
34
|
-
|
|
35
|
-
> **Capacity limit:** The registry enforces a maximum of **200** registered contributors. Attempts to exceed this limit are logged as warnings and silently ignored.
|
|
36
|
-
|
|
37
|
-
### IReportingContributor
|
|
38
|
-
|
|
39
|
-
```typescript
|
|
40
|
-
interface IReportingContributor {
|
|
41
|
-
readonly featureKey: string;
|
|
42
|
-
listDatasets(): Promise<IReportingDataset[]>;
|
|
43
|
-
executeQuery(dataset: IReportingDataset, request: IReportingQuery): Promise<IReportingQueryResult>;
|
|
44
|
-
}
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
### Implementing a Contributor
|
|
48
|
-
|
|
49
|
-
```typescript
|
|
50
|
-
import { Injectable } from '@nestjs/common';
|
|
51
|
-
import type {
|
|
52
|
-
IReportingContributor,
|
|
53
|
-
IReportingDataset,
|
|
54
|
-
IReportingQuery,
|
|
55
|
-
IReportingQueryResult,
|
|
56
|
-
} from '@breadstone/archipel-platform-reporting';
|
|
57
|
-
|
|
58
|
-
@Injectable()
|
|
59
|
-
export class OrderReportingContributor implements IReportingContributor {
|
|
60
|
-
public readonly featureKey = 'orders';
|
|
61
|
-
|
|
62
|
-
constructor(private readonly _prisma: PrismaService) {}
|
|
63
|
-
|
|
64
|
-
public async listDatasets(): Promise<IReportingDataset[]> {
|
|
65
|
-
return [
|
|
66
|
-
{
|
|
67
|
-
datasetId: 'orders.summary',
|
|
68
|
-
featureKey: 'orders',
|
|
69
|
-
datasetKey: 'summary',
|
|
70
|
-
name: 'Order Summary',
|
|
71
|
-
description: 'Aggregated order data by period',
|
|
72
|
-
fields: [
|
|
73
|
-
{ fieldId: 'period', label: 'Period', type: 'string', isNullable: false },
|
|
74
|
-
{ fieldId: 'orderCount', label: 'Order Count', type: 'number', isNullable: false },
|
|
75
|
-
{ fieldId: 'revenue', label: 'Revenue', type: 'number', isNullable: false },
|
|
76
|
-
{ fieldId: 'avgOrderValue', label: 'Avg. Order Value', type: 'number', isNullable: false },
|
|
77
|
-
],
|
|
78
|
-
},
|
|
79
|
-
{
|
|
80
|
-
datasetId: 'orders.by-product',
|
|
81
|
-
featureKey: 'orders',
|
|
82
|
-
datasetKey: 'by-product',
|
|
83
|
-
name: 'Orders by Product',
|
|
84
|
-
description: 'Order breakdown by product',
|
|
85
|
-
fields: [
|
|
86
|
-
{ fieldId: 'productName', label: 'Product', type: 'string', isNullable: false },
|
|
87
|
-
{ fieldId: 'quantity', label: 'Quantity Sold', type: 'number', isNullable: false },
|
|
88
|
-
{ fieldId: 'revenue', label: 'Revenue', type: 'number', isNullable: false },
|
|
89
|
-
],
|
|
90
|
-
},
|
|
91
|
-
];
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
public async executeQuery(dataset: IReportingDataset, request: IReportingQuery): Promise<IReportingQueryResult> {
|
|
95
|
-
// Execute query against database
|
|
96
|
-
const rows = await this._prisma.$queryRaw`
|
|
97
|
-
SELECT /* ... */
|
|
98
|
-
`;
|
|
99
|
-
|
|
100
|
-
return {
|
|
101
|
-
datasetId: dataset.datasetId,
|
|
102
|
-
fields: dataset.fields,
|
|
103
|
-
rows,
|
|
104
|
-
total: rows.length,
|
|
105
|
-
};
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
```
|
|
109
|
-
|
|
110
|
-
### Registering a Contributor
|
|
111
|
-
|
|
112
|
-
```typescript
|
|
113
|
-
import { Module, type OnModuleInit } from '@nestjs/common';
|
|
114
|
-
import { ReportingContributorRegistry } from '@breadstone/archipel-platform-reporting';
|
|
115
|
-
|
|
116
|
-
@Module({
|
|
117
|
-
providers: [OrderReportingContributor],
|
|
118
|
-
})
|
|
119
|
-
export class OrderModule implements OnModuleInit {
|
|
120
|
-
constructor(
|
|
121
|
-
private readonly _registry: ReportingContributorRegistry,
|
|
122
|
-
private readonly _contributor: OrderReportingContributor,
|
|
123
|
-
) {}
|
|
124
|
-
|
|
125
|
-
public onModuleInit(): void {
|
|
126
|
-
this._registry.register(this._contributor);
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
```
|
|
130
|
-
|
|
131
|
-
---
|
|
132
|
-
|
|
133
|
-
## ReportingFacade
|
|
134
|
-
|
|
135
|
-
Central API for catalog browsing and query execution. Each `executeQuery()` call is subject to a **30-second timeout** — queries that exceed this limit throw a `ReportingExecutionError`.
|
|
136
|
-
|
|
137
|
-
### Browse Catalog
|
|
138
|
-
|
|
139
|
-
```typescript
|
|
140
|
-
import { ReportingFacade } from '@breadstone/archipel-platform-reporting';
|
|
141
|
-
|
|
142
|
-
@Controller('api/v1/reports')
|
|
143
|
-
export class ReportController {
|
|
144
|
-
constructor(private readonly _reporting: ReportingFacade) {}
|
|
145
|
-
|
|
146
|
-
@Get('datasets')
|
|
147
|
-
public async listDatasets(): Promise<IReportingDataset[]> {
|
|
148
|
-
return this._reporting.getCatalog();
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
@Get('datasets/:id')
|
|
152
|
-
public async getDataset(@Param('id') id: string): Promise<IReportingDataset> {
|
|
153
|
-
return this._reporting.getDataset(id);
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
```
|
|
157
|
-
|
|
158
|
-
### Execute Query
|
|
159
|
-
|
|
160
|
-
```typescript
|
|
161
|
-
@Post('query')
|
|
162
|
-
public async runQuery(@Body() body: IReportingQuery): Promise<IReportingQueryResult> {
|
|
163
|
-
return this._reporting.executeQuery(body);
|
|
164
|
-
}
|
|
165
|
-
```
|
|
166
|
-
|
|
167
|
-
---
|
|
168
|
-
|
|
169
|
-
## Data Model
|
|
170
|
-
|
|
171
|
-
### IReportingDataset
|
|
172
|
-
|
|
173
|
-
```typescript
|
|
174
|
-
interface IReportingDataset {
|
|
175
|
-
readonly datasetId: string; // e.g. 'orders.summary'
|
|
176
|
-
readonly featureKey: string; // e.g. 'orders'
|
|
177
|
-
readonly datasetKey: string; // e.g. 'summary'
|
|
178
|
-
readonly name: string; // Human-readable name
|
|
179
|
-
readonly description?: string;
|
|
180
|
-
readonly fields: IReportingDatasetField[];
|
|
181
|
-
}
|
|
182
|
-
```
|
|
183
|
-
|
|
184
|
-
### IReportingDatasetField
|
|
185
|
-
|
|
186
|
-
```typescript
|
|
187
|
-
interface IReportingDatasetField {
|
|
188
|
-
readonly fieldId: string;
|
|
189
|
-
readonly label: string;
|
|
190
|
-
readonly type: ReportingFieldType; // 'boolean' | 'datetime' | 'json' | 'number' | 'string'
|
|
191
|
-
readonly isNullable: boolean;
|
|
192
|
-
readonly description?: string;
|
|
193
|
-
}
|
|
194
|
-
```
|
|
195
|
-
|
|
196
|
-
### IReportingQuery
|
|
197
|
-
|
|
198
|
-
```typescript
|
|
199
|
-
interface IReportingQuery {
|
|
200
|
-
readonly datasetId: string;
|
|
201
|
-
readonly filters?: IReportingQueryFilter[];
|
|
202
|
-
readonly sorts?: IReportingQuerySort[];
|
|
203
|
-
readonly limit?: number;
|
|
204
|
-
readonly offset?: number;
|
|
205
|
-
}
|
|
206
|
-
```
|
|
207
|
-
|
|
208
|
-
### IReportingQueryResult
|
|
209
|
-
|
|
210
|
-
```typescript
|
|
211
|
-
interface IReportingQueryResult {
|
|
212
|
-
readonly datasetId: string;
|
|
213
|
-
readonly fields: IReportingDatasetField[];
|
|
214
|
-
readonly rows: ReadonlyArray<Record<string, unknown>>;
|
|
215
|
-
readonly total: number;
|
|
216
|
-
}
|
|
217
|
-
```
|
|
218
|
-
|
|
219
|
-
---
|
|
220
|
-
|
|
221
|
-
## Exports Summary
|
|
222
|
-
|
|
223
|
-
| Export | Type | Description |
|
|
224
|
-
| ------------------------------- | ------------- | ------------------------- |
|
|
225
|
-
| `ReportingModule` | NestJS Module | Global reporting module |
|
|
226
|
-
| `ReportingFacade` | Service | Catalog + query execution |
|
|
227
|
-
| `ReportingContributorRegistry` | Service | Contributor registration |
|
|
228
|
-
| `IReportingContributor` | Interface | Contributor contract |
|
|
229
|
-
| `ReportingDataset` | Model | Dataset definition |
|
|
230
|
-
| `ReportingDatasetField` | Model | Field definition |
|
|
231
|
-
| `ReportingQuery` | Model | Query structure |
|
|
232
|
-
| `ReportingQueryResult` | Model | Query result |
|
|
233
|
-
| `ReportingDatasetNotFoundError` | Error | Dataset lookup failure |
|
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: platform-resources
|
|
3
|
-
description: Multi-strategy resource management with MIME type detection and optional caching.
|
|
4
|
-
order: 3
|
|
5
|
-
tags: [resources, files, blob, mime, caching]
|
|
6
|
-
package: '@breadstone/archipel-platform-resources'
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
# platform-resources
|
|
10
|
-
|
|
11
|
-
Multi-strategy resource management for NestJS applications. Loads files from the file system, embedded buffers, or blob storage with MIME type detection and optional caching. Extracted from `platform-core` to provide a focused, independently versionable resource module.
|
|
12
|
-
|
|
13
|
-
**Package:** `@breadstone/archipel-platform-resources`
|
|
14
|
-
|
|
15
|
-
<InstallTabs />
|
|
16
|
-
|
|
17
|
-
## Installation
|
|
18
|
-
|
|
19
|
-
```typescript
|
|
20
|
-
import {
|
|
21
|
-
ResourceModule,
|
|
22
|
-
ResourceManager,
|
|
23
|
-
FileResourceStrategy,
|
|
24
|
-
BlobResourceStrategy,
|
|
25
|
-
EmbeddedResourceStrategy,
|
|
26
|
-
ResourceNotFoundError,
|
|
27
|
-
} from '@breadstone/archipel-platform-resources';
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
---
|
|
31
|
-
|
|
32
|
-
## Module Registration
|
|
33
|
-
|
|
34
|
-
Register the module with one or more resource strategies:
|
|
35
|
-
|
|
36
|
-
```typescript
|
|
37
|
-
import { Module } from '@nestjs/common';
|
|
38
|
-
import { ResourceModule, FileResourceStrategy, EmbeddedResourceStrategy } from '@breadstone/archipel-platform-resources';
|
|
39
|
-
import { join } from 'node:path';
|
|
40
|
-
|
|
41
|
-
@Module({
|
|
42
|
-
imports: [
|
|
43
|
-
ResourceModule.forRoot({
|
|
44
|
-
strategies: [
|
|
45
|
-
new FileResourceStrategy({
|
|
46
|
-
basePath: join(__dirname, '..', 'assets'),
|
|
47
|
-
}),
|
|
48
|
-
new EmbeddedResourceStrategy([
|
|
49
|
-
{ name: 'fallback.html', buffer: Buffer.from('<html>Fallback</html>') },
|
|
50
|
-
]),
|
|
51
|
-
],
|
|
52
|
-
}),
|
|
53
|
-
],
|
|
54
|
-
})
|
|
55
|
-
export class AppModule {}
|
|
56
|
-
```
|
|
57
|
-
|
|
58
|
-
## Using ResourceManager
|
|
59
|
-
|
|
60
|
-
Inject and use `ResourceManager` to load resources at runtime:
|
|
61
|
-
|
|
62
|
-
```typescript
|
|
63
|
-
import { Injectable } from '@nestjs/common';
|
|
64
|
-
import { ResourceManager } from '@breadstone/archipel-platform-resources';
|
|
65
|
-
|
|
66
|
-
@Injectable()
|
|
67
|
-
export class TemplateService {
|
|
68
|
-
constructor(private readonly _resourceManager: ResourceManager) {}
|
|
69
|
-
|
|
70
|
-
public async loadTemplate(name: string): Promise<string> {
|
|
71
|
-
const result = await this._resourceManager.get(name);
|
|
72
|
-
return result.buffer.toString('utf-8');
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
```
|
|
76
|
-
|
|
77
|
-
---
|
|
78
|
-
|
|
79
|
-
## Strategies
|
|
80
|
-
|
|
81
|
-
| Strategy | Description |
|
|
82
|
-
| --------------------------- | ----------------------------------------------------------------- |
|
|
83
|
-
| `FileResourceStrategy` | Loads resources from the local file system with glob support |
|
|
84
|
-
| `BlobResourceStrategy` | Loads resources from a blob storage adapter (Vercel, Azure, S3) |
|
|
85
|
-
| `EmbeddedResourceStrategy` | Serves pre-loaded in-memory buffers |
|
|
86
|
-
|
|
87
|
-
### BlobResourceStrategy
|
|
88
|
-
|
|
89
|
-
For loading resources from cloud blob storage, provide an adapter that implements `IBlobServiceAdapter`:
|
|
90
|
-
|
|
91
|
-
```typescript
|
|
92
|
-
import { BlobResourceStrategy, type IBlobServiceAdapter } from '@breadstone/archipel-platform-resources';
|
|
93
|
-
|
|
94
|
-
const blobStrategy = new BlobResourceStrategy({
|
|
95
|
-
adapter: myBlobAdapter,
|
|
96
|
-
containerName: 'templates',
|
|
97
|
-
});
|
|
98
|
-
```
|
|
99
|
-
|
|
100
|
-
### Custom Strategies
|
|
101
|
-
|
|
102
|
-
Implement `IResourceStrategy` to create your own resource loading strategy:
|
|
103
|
-
|
|
104
|
-
```typescript
|
|
105
|
-
import type { IResourceStrategy, IResourceResult } from '@breadstone/archipel-platform-resources';
|
|
106
|
-
|
|
107
|
-
export class CustomStrategy implements IResourceStrategy {
|
|
108
|
-
public async get(name: string): Promise<IResourceResult | undefined> {
|
|
109
|
-
// Custom loading logic
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
```
|
|
113
|
-
|
|
114
|
-
---
|
|
115
|
-
|
|
116
|
-
## Interfaces
|
|
117
|
-
|
|
118
|
-
| Interface | Description |
|
|
119
|
-
| ---------------------- | ---------------------------------------- |
|
|
120
|
-
| `IResourceResult` | Result object with `buffer` and `metadata` |
|
|
121
|
-
| `IResourceMetadata` | Metadata including `mimeType` and `size` |
|
|
122
|
-
| `IResourceStrategy` | Strategy contract for resource loading |
|
|
123
|
-
| `IBlobServiceAdapter` | Adapter contract for blob storage access |
|
|
124
|
-
|
|
125
|
-
---
|
|
126
|
-
|
|
127
|
-
## Error Classes
|
|
128
|
-
|
|
129
|
-
| Error | Description |
|
|
130
|
-
| ------------------------ | --------------------------------------------- |
|
|
131
|
-
| `ResourceNotFoundError` | Thrown when a requested resource is not found |
|
|
132
|
-
|
|
133
|
-
---
|
|
134
|
-
|
|
135
|
-
## API Reference
|
|
136
|
-
|
|
137
|
-
The auto-generated API reference is published when API docs are generated for this package.
|