@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.
Files changed (232) hide show
  1. package/data/guides/ai-image-generation.md +96 -0
  2. package/data/guides/ai-realtime-voice.md +69 -464
  3. package/data/guides/ai-text-generation.md +95 -622
  4. package/data/guides/index.md +3 -1
  5. package/data/guides/intelligence-prompts-warm-up.md +138 -0
  6. package/data/packages/platform-intelligence/api/Class.AnthropicIntelligenceProviderAdapter.md +78 -0
  7. package/data/packages/platform-intelligence/api/Class.DefaultIntelligencePromptPolicyAdapter.md +54 -0
  8. package/data/packages/platform-intelligence/api/Class.GatewayIntelligenceProviderAdapter.md +78 -0
  9. package/data/packages/platform-intelligence/api/Class.GoogleIntelligenceProviderAdapter.md +78 -0
  10. package/data/packages/platform-intelligence/api/Class.GrokIntelligenceProviderAdapter.md +78 -0
  11. package/data/packages/platform-intelligence/api/Class.IntelligenceAgent.md +95 -0
  12. package/data/packages/platform-intelligence/api/Class.IntelligenceAgentFactory.md +11 -23
  13. package/data/packages/platform-intelligence/api/Class.IntelligenceEmbeddingGenerator.md +25 -21
  14. package/data/packages/platform-intelligence/api/Class.IntelligenceHealthIndicator.md +11 -7
  15. package/data/packages/platform-intelligence/api/Class.IntelligenceLanguageGenerator.md +159 -0
  16. package/data/packages/platform-intelligence/api/Class.IntelligenceMediaGenerator.md +60 -38
  17. package/data/packages/platform-intelligence/api/Class.IntelligenceModule.md +2 -2
  18. package/data/packages/platform-intelligence/api/Class.IntelligencePromptExecutor.md +88 -0
  19. package/data/packages/platform-intelligence/api/Class.IntelligencePromptPolicyPort.md +48 -0
  20. package/data/packages/platform-intelligence/api/Class.IntelligenceProviderAssetUploader.md +21 -15
  21. package/data/packages/platform-intelligence/api/Class.IntelligenceProviderDiagnostics.md +55 -0
  22. package/data/packages/platform-intelligence/api/Class.IntelligenceProviderError.md +14 -4
  23. package/data/packages/platform-intelligence/api/Class.IntelligenceProviderRegistry.md +68 -0
  24. package/data/packages/platform-intelligence/api/Class.IntelligenceRealtimeError.md +9 -9
  25. package/data/packages/platform-intelligence/api/Class.IntelligenceRealtimeMeteringPort.md +2 -2
  26. package/data/packages/platform-intelligence/api/Class.IntelligenceRealtimeSessionFactory.md +12 -12
  27. package/data/packages/platform-intelligence/api/Class.IntelligenceRealtimeSessionPort.md +18 -18
  28. package/data/packages/platform-intelligence/api/Class.IntelligenceReranker.md +58 -0
  29. package/data/packages/platform-intelligence/api/Class.IntelligenceToolBase.md +14 -16
  30. package/data/packages/platform-intelligence/api/Class.IntelligenceToolRegistry.md +10 -14
  31. package/data/packages/platform-intelligence/api/Class.MiMoIntelligenceProviderAdapter.md +78 -0
  32. package/data/packages/platform-intelligence/api/Class.OpenAIIntelligenceProviderAdapter.md +102 -0
  33. package/data/packages/platform-intelligence/api/Function.createAnthropicAdvisor20260301Tool.md +1 -1
  34. package/data/packages/platform-intelligence/api/Function.createAnthropicBash20241022Tool.md +1 -1
  35. package/data/packages/platform-intelligence/api/Function.createAnthropicBash20250124Tool.md +1 -1
  36. package/data/packages/platform-intelligence/api/Function.createAnthropicCodeExecution20250522Tool.md +1 -1
  37. package/data/packages/platform-intelligence/api/Function.createAnthropicCodeExecution20250825Tool.md +1 -1
  38. package/data/packages/platform-intelligence/api/Function.createAnthropicCodeExecution20260120Tool.md +1 -1
  39. package/data/packages/platform-intelligence/api/Function.createAnthropicComputer20241022Tool.md +1 -1
  40. package/data/packages/platform-intelligence/api/Function.createAnthropicComputer20250124Tool.md +1 -1
  41. package/data/packages/platform-intelligence/api/Function.createAnthropicComputer20251124Tool.md +1 -1
  42. package/data/packages/platform-intelligence/api/Function.createAnthropicMemory20250818Tool.md +1 -1
  43. package/data/packages/platform-intelligence/api/Function.createAnthropicTextEditor20241022Tool.md +1 -1
  44. package/data/packages/platform-intelligence/api/Function.createAnthropicTextEditor20250124Tool.md +1 -1
  45. package/data/packages/platform-intelligence/api/Function.createAnthropicTextEditor20250429Tool.md +1 -1
  46. package/data/packages/platform-intelligence/api/Function.createAnthropicTextEditor20250728Tool.md +1 -1
  47. package/data/packages/platform-intelligence/api/Function.createAnthropicToolSearchBM2520251119Tool.md +1 -1
  48. package/data/packages/platform-intelligence/api/Function.createAnthropicToolSearchRegex20251119Tool.md +1 -1
  49. package/data/packages/platform-intelligence/api/Function.createAnthropicWebFetch20250910Tool.md +1 -1
  50. package/data/packages/platform-intelligence/api/Function.createAnthropicWebFetch20260209Tool.md +1 -1
  51. package/data/packages/platform-intelligence/api/Function.createAnthropicWebSearch20250305Tool.md +1 -1
  52. package/data/packages/platform-intelligence/api/Function.createAnthropicWebSearch20260209Tool.md +1 -1
  53. package/data/packages/platform-intelligence/api/Function.createGoogleCodeExecutionTool.md +1 -1
  54. package/data/packages/platform-intelligence/api/Function.createGoogleEnterpriseWebSearchTool.md +1 -1
  55. package/data/packages/platform-intelligence/api/Function.createGoogleFileSearchTool.md +1 -1
  56. package/data/packages/platform-intelligence/api/Function.createGoogleGoogleMapsTool.md +1 -1
  57. package/data/packages/platform-intelligence/api/Function.createGoogleGoogleSearchTool.md +1 -1
  58. package/data/packages/platform-intelligence/api/Function.createGoogleUrlContextTool.md +1 -1
  59. package/data/packages/platform-intelligence/api/Function.createGoogleVertexRagStoreTool.md +1 -1
  60. package/data/packages/platform-intelligence/api/Function.createGrokCodeExecutionTool.md +1 -1
  61. package/data/packages/platform-intelligence/api/Function.createGrokFileSearchTool.md +1 -1
  62. package/data/packages/platform-intelligence/api/Function.createGrokMcpServerTool.md +1 -1
  63. package/data/packages/platform-intelligence/api/Function.createGrokViewImageTool.md +1 -1
  64. package/data/packages/platform-intelligence/api/Function.createGrokViewXVideoTool.md +1 -1
  65. package/data/packages/platform-intelligence/api/Function.createGrokWebSearchTool.md +1 -1
  66. package/data/packages/platform-intelligence/api/Function.createGrokXSearchTool.md +1 -1
  67. package/data/packages/platform-intelligence/api/Function.createIntelligenceJsonSchema.md +31 -0
  68. package/data/packages/platform-intelligence/api/Function.createIntelligenceTool.md +2 -2
  69. package/data/packages/platform-intelligence/api/Function.createMimoCustomTool.md +5 -5
  70. package/data/packages/platform-intelligence/api/Function.createOpenAIApplyPatchTool.md +1 -1
  71. package/data/packages/platform-intelligence/api/Function.createOpenAICodeInterpreterTool.md +1 -1
  72. package/data/packages/platform-intelligence/api/Function.createOpenAICustomTool.md +1 -1
  73. package/data/packages/platform-intelligence/api/Function.createOpenAIFileSearchTool.md +1 -1
  74. package/data/packages/platform-intelligence/api/Function.createOpenAIImageGenerationTool.md +1 -1
  75. package/data/packages/platform-intelligence/api/Function.createOpenAILocalShellTool.md +1 -1
  76. package/data/packages/platform-intelligence/api/Function.createOpenAIMcpTool.md +1 -1
  77. package/data/packages/platform-intelligence/api/Function.createOpenAIShellTool.md +1 -1
  78. package/data/packages/platform-intelligence/api/Function.createOpenAIToolSearchTool.md +1 -1
  79. package/data/packages/platform-intelligence/api/Function.createOpenAIWebSearchPreviewTool.md +1 -1
  80. package/data/packages/platform-intelligence/api/Function.createOpenAIWebSearchTool.md +1 -1
  81. package/data/packages/platform-intelligence/api/Function.defineIntelligenceTool.md +31 -0
  82. package/data/packages/platform-intelligence/api/Function.intelligencePrompt.md +31 -0
  83. package/data/packages/platform-intelligence/api/Interface.IIntelligenceAgentConfiguration.md +70 -0
  84. package/data/packages/platform-intelligence/api/Interface.IIntelligenceEmbeddingBatchOptions.md +124 -0
  85. package/data/packages/platform-intelligence/api/Interface.IIntelligenceEmbeddingBatchResult.md +70 -0
  86. package/data/packages/platform-intelligence/api/Interface.IIntelligenceEmbeddingOptions.md +114 -0
  87. package/data/packages/platform-intelligence/api/Interface.IIntelligenceEmbeddingResult.md +70 -0
  88. package/data/packages/platform-intelligence/api/Interface.IIntelligenceFileUploadOptions.md +102 -0
  89. package/data/packages/platform-intelligence/api/Interface.IIntelligenceFileUploadResult.md +60 -0
  90. package/data/packages/platform-intelligence/api/Interface.IIntelligenceGeneratedFile.md +40 -0
  91. package/data/packages/platform-intelligence/api/Interface.IIntelligenceGenerationStepStartEvent.md +50 -0
  92. package/data/packages/platform-intelligence/api/Interface.IIntelligenceImageGenerationOptions.md +170 -0
  93. package/data/packages/platform-intelligence/api/Interface.IIntelligenceImageGenerationResult.md +60 -0
  94. package/data/packages/platform-intelligence/api/Interface.IIntelligenceLanguageCompletion.md +141 -0
  95. package/data/packages/platform-intelligence/api/Interface.IIntelligenceLanguageGenerationOptions.md +234 -0
  96. package/data/packages/platform-intelligence/api/Interface.IIntelligenceLanguageStream.md +50 -0
  97. package/data/packages/platform-intelligence/api/Interface.IIntelligenceModelReference.md +34 -0
  98. package/data/packages/platform-intelligence/api/Interface.IIntelligenceModelRequestOptions.md +52 -0
  99. package/data/packages/platform-intelligence/api/Interface.IIntelligenceModelStatus.md +30 -0
  100. package/data/packages/platform-intelligence/api/Interface.IIntelligenceModuleOptions.md +43 -25
  101. package/data/packages/platform-intelligence/api/Interface.IIntelligenceObjectStream.md +56 -0
  102. package/data/packages/platform-intelligence/api/Interface.IIntelligencePrompt.md +50 -0
  103. package/data/packages/platform-intelligence/api/Interface.IIntelligencePromptDefinition.md +145 -0
  104. package/data/packages/platform-intelligence/api/Interface.IIntelligencePromptEffectivePolicy.md +30 -0
  105. package/data/packages/platform-intelligence/api/Interface.IIntelligencePromptExecutionContext.md +20 -0
  106. package/data/packages/platform-intelligence/api/Interface.IIntelligencePromptExecutionPolicy.md +70 -0
  107. package/data/packages/platform-intelligence/api/Interface.IIntelligencePromptExecutionResult.md +127 -0
  108. package/data/packages/platform-intelligence/api/Interface.IIntelligencePromptInvocation.md +49 -0
  109. package/data/packages/platform-intelligence/api/Interface.IIntelligencePromptPolicyRequest.md +60 -0
  110. package/data/packages/platform-intelligence/api/Interface.IIntelligencePromptRenderContext.md +26 -0
  111. package/data/packages/platform-intelligence/api/Interface.IIntelligenceProviderAdapter.md +73 -0
  112. package/data/packages/platform-intelligence/api/Interface.IIntelligenceProviderConfiguration.md +10 -10
  113. package/data/packages/platform-intelligence/api/Interface.IIntelligenceProviderLoadRequest.md +40 -0
  114. package/data/packages/platform-intelligence/api/Interface.IIntelligenceProviderProbeResult.md +70 -0
  115. package/data/packages/platform-intelligence/api/Interface.IIntelligenceRealtimeAudioFormat.md +3 -3
  116. package/data/packages/platform-intelligence/api/Interface.IIntelligenceRealtimeCloseEvent.md +4 -4
  117. package/data/packages/platform-intelligence/api/Interface.IIntelligenceRealtimeModuleOptions.md +9 -21
  118. package/data/packages/platform-intelligence/api/Interface.IIntelligenceRealtimeSessionConfiguration.md +11 -11
  119. package/data/packages/platform-intelligence/api/Interface.IIntelligenceRealtimeSessionOptions.md +11 -11
  120. package/data/packages/platform-intelligence/api/Interface.IIntelligenceRealtimeToolDefinition.md +5 -5
  121. package/data/packages/platform-intelligence/api/Interface.IIntelligenceRealtimeTranscriptionConfiguration.md +4 -4
  122. package/data/packages/platform-intelligence/api/Interface.IIntelligenceRealtimeTurnDetectionConfiguration.md +5 -5
  123. package/data/packages/platform-intelligence/api/Interface.IIntelligenceRealtimeUsage.md +10 -10
  124. package/data/packages/platform-intelligence/api/Interface.IIntelligenceRequestOptions.md +98 -0
  125. package/data/packages/platform-intelligence/api/Interface.IIntelligenceRerankingOptions.md +140 -0
  126. package/data/packages/platform-intelligence/api/Interface.IIntelligenceRerankingResult.md +50 -0
  127. package/data/packages/platform-intelligence/api/Interface.IIntelligenceSkillUploadOptions.md +94 -0
  128. package/data/packages/platform-intelligence/api/Interface.IIntelligenceSkillUploadResult.md +80 -0
  129. package/data/packages/platform-intelligence/api/Interface.IIntelligenceSpeechGenerationOptions.md +164 -0
  130. package/data/packages/platform-intelligence/api/Interface.IIntelligenceSpeechGenerationResult.md +50 -0
  131. package/data/packages/platform-intelligence/api/Interface.IIntelligenceStreamingTranscriptionOptions.md +139 -0
  132. package/data/packages/platform-intelligence/api/Interface.IIntelligenceTool.md +7 -10
  133. package/data/packages/platform-intelligence/api/Interface.IIntelligenceToolCall.md +40 -0
  134. package/data/packages/platform-intelligence/api/Interface.IIntelligenceToolDefinition.md +91 -0
  135. package/data/packages/platform-intelligence/api/Interface.IIntelligenceToolExecutionEndEvent.md +50 -0
  136. package/data/packages/platform-intelligence/api/Interface.IIntelligenceToolExecutionStartEvent.md +30 -0
  137. package/data/packages/platform-intelligence/api/Interface.IIntelligenceToolRegistry.md +4 -4
  138. package/data/packages/platform-intelligence/api/Interface.IIntelligenceTranscriptionOptions.md +114 -0
  139. package/data/packages/platform-intelligence/api/Interface.IIntelligenceTranscriptionResult.md +84 -0
  140. package/data/packages/platform-intelligence/api/Interface.IIntelligenceTranscriptionStream.md +97 -0
  141. package/data/packages/platform-intelligence/api/Interface.IIntelligenceUsage.md +40 -0
  142. package/data/packages/platform-intelligence/api/Interface.IIntelligenceVideoGenerationOptions.md +229 -0
  143. package/data/packages/platform-intelligence/api/Interface.IIntelligenceVideoGenerationResult.md +50 -0
  144. package/data/packages/platform-intelligence/api/TypeAlias.IIntelligenceModelMessage.md +43 -0
  145. package/data/packages/platform-intelligence/api/TypeAlias.IIntelligencePromptModelRequirement.md +25 -0
  146. package/data/packages/platform-intelligence/api/TypeAlias.IIntelligenceSchema.md +70 -0
  147. package/data/packages/platform-intelligence/api/TypeAlias.IntelligenceCapability.md +14 -0
  148. package/data/packages/platform-intelligence/api/TypeAlias.IntelligenceDefaultModels.md +14 -0
  149. package/data/packages/platform-intelligence/api/TypeAlias.IntelligenceJsonValue.md +22 -0
  150. package/data/packages/platform-intelligence/api/TypeAlias.IntelligencePromptCapability.md +20 -0
  151. package/data/packages/platform-intelligence/api/TypeAlias.IntelligencePromptDefinitionConfiguration.md +29 -0
  152. package/data/packages/platform-intelligence/api/TypeAlias.IntelligencePromptGenerationOptions.md +16 -0
  153. package/data/packages/platform-intelligence/api/TypeAlias.IntelligencePromptLatency.md +14 -0
  154. package/data/packages/platform-intelligence/api/TypeAlias.IntelligencePromptMode.md +14 -0
  155. package/data/packages/platform-intelligence/api/TypeAlias.IntelligencePromptQuality.md +14 -0
  156. package/data/packages/platform-intelligence/api/TypeAlias.IntelligencePromptReasoning.md +14 -0
  157. package/data/packages/platform-intelligence/api/TypeAlias.IntelligenceProviderName.md +1 -1
  158. package/data/packages/platform-intelligence/api/TypeAlias.IntelligenceProviderOptions.md +14 -0
  159. package/data/packages/platform-intelligence/api/TypeAlias.IntelligenceProviderProbeStatus.md +14 -0
  160. package/data/packages/platform-intelligence/api/TypeAlias.IntelligenceProviderToolOptions.md +17 -0
  161. package/data/packages/platform-intelligence/api/TypeAlias.IntelligenceRealtimeClientEvent.md +1 -1
  162. package/data/packages/platform-intelligence/api/TypeAlias.IntelligenceRealtimeMetadataValue.md +1 -1
  163. package/data/packages/platform-intelligence/api/TypeAlias.IntelligenceRealtimeMeteringEvent.md +1 -1
  164. package/data/packages/platform-intelligence/api/TypeAlias.IntelligenceRealtimeServerEvent.md +1 -1
  165. package/data/packages/platform-intelligence/api/TypeAlias.IntelligenceRealtimeStatus.md +1 -1
  166. package/data/packages/platform-intelligence/api/TypeAlias.IntelligenceRequestTimeouts.md +14 -0
  167. package/data/packages/platform-intelligence/api/TypeAlias.IntelligenceToolChoice.md +21 -0
  168. package/data/packages/platform-intelligence/api/TypeAlias.IntelligenceToolOutput.md +22 -0
  169. package/data/packages/platform-intelligence/api/TypeAlias.IntelligenceToolSet.md +14 -0
  170. package/data/packages/platform-intelligence/api/TypeAlias.IntelligenceTranscriptionStreamPart.md +46 -0
  171. package/data/packages/platform-intelligence/api/Variable.AI_GATEWAY_API_KEY.md +14 -0
  172. package/data/packages/platform-intelligence/api/Variable.AI_GATEWAY_BASE_URL.md +14 -0
  173. package/data/packages/platform-intelligence/api/Variable.AI_GATEWAY_CONFIG_ENTRIES.md +14 -0
  174. package/data/packages/platform-intelligence/api/Variable.INTELLIGENCE_API_KEY.md +1 -1
  175. package/data/packages/platform-intelligence/api/Variable.INTELLIGENCE_BASE_URL.md +1 -1
  176. package/data/packages/platform-intelligence/api/Variable.INTELLIGENCE_MAX_OUTPUT_TOKENS.md +1 -1
  177. package/data/packages/platform-intelligence/api/Variable.INTELLIGENCE_MODEL.md +1 -1
  178. package/data/packages/platform-intelligence/api/Variable.INTELLIGENCE_PROVIDER.md +2 -2
  179. package/data/packages/platform-intelligence/api/Variable.INTELLIGENCE_TEMPERATURE.md +1 -1
  180. package/data/packages/platform-intelligence/api/Variable.INTELLIGENCE_TOP_P.md +1 -1
  181. package/data/packages/platform-intelligence/api/Variable.IntelligenceCapabilityNames.md +40 -0
  182. package/data/packages/platform-intelligence/api/Variable.IntelligenceProviderNames.md +2 -0
  183. package/data/packages/platform-intelligence/api/Variable.PLATFORM_INTELLIGENCE_CONFIG_ENTRIES.md +1 -1
  184. package/data/packages/platform-intelligence/api/index.md +98 -30
  185. package/package.json +1 -1
  186. package/data/packages/index.md +0 -8
  187. package/data/packages/platform-analytics/index.md +0 -209
  188. package/data/packages/platform-authentication/index.md +0 -725
  189. package/data/packages/platform-blob-storage/index.md +0 -416
  190. package/data/packages/platform-bootstrap/index.md +0 -162
  191. package/data/packages/platform-caching/index.md +0 -167
  192. package/data/packages/platform-configuration/index.md +0 -226
  193. package/data/packages/platform-core/index.md +0 -504
  194. package/data/packages/platform-cryptography/index.md +0 -142
  195. package/data/packages/platform-database/index.md +0 -337
  196. package/data/packages/platform-documents/index.md +0 -255
  197. package/data/packages/platform-esigning/index.md +0 -710
  198. package/data/packages/platform-feature-flags/index.md +0 -103
  199. package/data/packages/platform-health/index.md +0 -141
  200. package/data/packages/platform-intelligence/api/Class.IntelligenceStructuredGenerator.md +0 -70
  201. package/data/packages/platform-intelligence/api/Class.IntelligenceTelemetryRegistry.md +0 -44
  202. package/data/packages/platform-intelligence/api/Class.IntelligenceTextGenerator.md +0 -138
  203. package/data/packages/platform-intelligence/api/Function.createProviderOptions.md +0 -39
  204. package/data/packages/platform-intelligence/api/Function.loadAnthropicLanguageModel.md +0 -26
  205. package/data/packages/platform-intelligence/api/Function.loadGoogleLanguageModel.md +0 -26
  206. package/data/packages/platform-intelligence/api/Function.loadGoogleRealtimeModel.md +0 -25
  207. package/data/packages/platform-intelligence/api/Function.loadGrokLanguageModel.md +0 -26
  208. package/data/packages/platform-intelligence/api/Function.loadGrokRealtimeModel.md +0 -25
  209. package/data/packages/platform-intelligence/api/Function.loadMimoLanguageModel.md +0 -26
  210. package/data/packages/platform-intelligence/api/Function.loadOpenAILanguageModel.md +0 -26
  211. package/data/packages/platform-intelligence/api/Function.loadOpenAIRealtimeModel.md +0 -25
  212. package/data/packages/platform-intelligence/api/Interface.IIntelligenceCompletionUsage.md +0 -46
  213. package/data/packages/platform-intelligence/api/Interface.IIntelligenceTextCompletion.md +0 -168
  214. package/data/packages/platform-intelligence/api/Interface.IIntelligenceTextGenerationOptions.md +0 -144
  215. package/data/packages/platform-intelligence/api/Interface.IIntelligenceTextGenerator.md +0 -78
  216. package/data/packages/platform-intelligence/api/Interface.IIntelligenceTextStreamingOptions.md +0 -170
  217. package/data/packages/platform-intelligence/api/TypeAlias.IntelligenceLanguageModelLoader.md +0 -24
  218. package/data/packages/platform-intelligence/api/TypeAlias.IntelligenceLanguageModelLoaders.md +0 -14
  219. package/data/packages/platform-intelligence/api/TypeAlias.IntelligenceRealtimeModelLoader.md +0 -25
  220. package/data/packages/platform-intelligence/api/TypeAlias.IntelligenceRealtimeModelLoaders.md +0 -14
  221. package/data/packages/platform-intelligence/api/TypeAlias.IntelligenceTextStream.md +0 -14
  222. package/data/packages/platform-intelligence/index.md +0 -549
  223. package/data/packages/platform-logging/index.md +0 -150
  224. package/data/packages/platform-mailing/index.md +0 -470
  225. package/data/packages/platform-mapping/index.md +0 -123
  226. package/data/packages/platform-mcp/index.md +0 -335
  227. package/data/packages/platform-openapi/index.md +0 -207
  228. package/data/packages/platform-payments/index.md +0 -610
  229. package/data/packages/platform-queue/index.md +0 -192
  230. package/data/packages/platform-reporting/index.md +0 -233
  231. package/data/packages/platform-resources/index.md +0 -137
  232. package/data/packages/platform-telemetry/index.md +0 -262
@@ -1,416 +0,0 @@
1
- ---
2
- title: platform-blob-storage
3
- description: Cloud file storage abstraction with pluggable providers and optional metadata persistence.
4
- order: 3
5
- tags: [blob-storage, files, upload, download, vercel, azure, aws, s3, providers, ports-and-adapters, health]
6
- package: '@breadstone/archipel-platform-blob-storage'
7
- ---
8
-
9
- # platform-blob-storage
10
-
11
- Cloud file storage abstraction supporting pluggable strategies and optional metadata persistence via ports. Ships with Vercel Blob, Azure Blob Storage, AWS S3, local filesystem, and an empty/mock strategy out of the box.
12
-
13
- **Package:** `@breadstone/archipel-platform-blob-storage`
14
-
15
- <InstallTabs />
16
-
17
- ## Quick Start
18
-
19
- ```typescript
20
- import { Module } from '@nestjs/common';
21
- import { BlobModule } from '@breadstone/archipel-platform-blob-storage';
22
- import { VercelBlobStorageStrategy, VERCEL_CONFIG_ENTRIES } from '@breadstone/archipel-platform-blob-storage/strategies/vercel';
23
-
24
- @Module({
25
- imports: [
26
- // Minimal setup — Vercel Blob, no metadata tracking
27
- BlobModule.register({
28
- storageStrategy: VercelBlobStorageStrategy,
29
- configEntries: VERCEL_CONFIG_ENTRIES,
30
- }),
31
-
32
- // Full setup — with metadata tracking
33
- BlobModule.register({
34
- storageStrategy: VercelBlobStorageStrategy,
35
- configEntries: VERCEL_CONFIG_ENTRIES,
36
- objectPersistence: PrismaBlobObjectAdapter,
37
- variantPersistence: PrismaBlobVariantAdapter,
38
- isGlobal: true,
39
- }),
40
- ],
41
- })
42
- export class AppModule {}
43
- ```
44
-
45
- ---
46
-
47
- ## Module Configuration
48
-
49
- ### IBlobModuleOptions
50
-
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 |
58
-
59
- ### Strategy Registration
60
-
61
- ```typescript
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
- import { EmptyBlobStorageStrategy } from '@breadstone/archipel-platform-blob-storage/strategies/empty';
67
-
68
- // Vercel Blob
69
- BlobModule.register({ storageStrategy: VercelBlobStorageStrategy, configEntries: VERCEL_CONFIG_ENTRIES });
70
-
71
- // Azure Blob Storage
72
- BlobModule.register({ storageStrategy: AzureBlobStorageStrategy, configEntries: AZURE_CONFIG_ENTRIES });
73
-
74
- // AWS S3
75
- BlobModule.register({ storageStrategy: AwsS3BlobStorageStrategy, configEntries: AWS_S3_CONFIG_ENTRIES });
76
-
77
- // Local filesystem
78
- BlobModule.register({ storageStrategy: LocalBlobStorageStrategy, configEntries: LOCAL_CONFIG_ENTRIES });
79
-
80
- // Empty/mock strategy (for development and testing — logs operations, returns mock data)
81
- BlobModule.register({ storageStrategy: EmptyBlobStorageStrategy });
82
-
83
- // Custom strategy — extend BlobStorageStrategyBase
84
- BlobModule.register({ storageStrategy: MyCustomStrategy });
85
- ```
86
-
87
- ---
88
-
89
- ## BlobService API
90
-
91
- The main service for all blob operations. Inject it anywhere:
92
-
93
- ```typescript
94
- import { BlobService } from '@breadstone/archipel-platform-blob-storage';
95
-
96
- @Injectable()
97
- export class ImageService {
98
- constructor(private readonly _blob: BlobService) {}
99
- }
100
- ```
101
-
102
- ### Upload
103
-
104
- ```typescript
105
- // Upload from buffer
106
- const result = await this._blob.uploadFile('avatars/user-123.png', imageBuffer, 'image/png');
107
- console.log(result.metadata.url);
108
-
109
- // Upload with full request
110
- const result = await this._blob.uploadObject({
111
- key: 'documents/report.pdf',
112
- body: pdfBuffer,
113
- contentType: 'application/pdf',
114
- bucket: 'my-bucket',
115
- });
116
- ```
117
-
118
- ### Upload Variant
119
-
120
- Upload a derived version of an existing blob (e.g., thumbnail):
121
-
122
- ```typescript
123
- const thumbnail = await this._blob.uploadVariant(originalBlobId, 'thumbnail-200x200', {
124
- key: 'avatars/user-123-thumb.png',
125
- body: thumbnailBuffer,
126
- contentType: 'image/png',
127
- });
128
- ```
129
-
130
- ### Download
131
-
132
- ```typescript
133
- // Download as buffer
134
- const result = await this._blob.downloadFile<Buffer>('avatars/user-123.png', 'arraybuffer');
135
- const buffer = result.data;
136
-
137
- // Download as stream
138
- const result = await this._blob.downloadFile<ReadableStream>('videos/intro.mp4', 'stream');
139
-
140
- // Download as JSON
141
- const result = await this._blob.downloadFile<Record<string, unknown>>('config/settings.json', 'json');
142
- ```
143
-
144
- ### Delete
145
-
146
- ```typescript
147
- await this._blob.deleteObject({
148
- key: 'avatars/user-123.png',
149
- bucket: 'my-bucket',
150
- });
151
- // If objectPersistence is registered, metadata is also marked as deleted
152
- ```
153
-
154
- ### Signed URLs
155
-
156
- ```typescript
157
- const signedUrl = await this._blob.createSignedUrl({
158
- key: 'private/contract.pdf',
159
- expiresIn: 3600, // 1 hour
160
- });
161
- ```
162
-
163
- ---
164
-
165
- ## Ports (Contracts)
166
-
167
- ### BlobObjectPersistencePort
168
-
169
- Tracks metadata for uploaded blob objects. Optional — when not provided, uploads still work but metadata is not persisted.
170
-
171
- ```typescript
172
- abstract class BlobObjectPersistencePort {
173
- abstract createFromMetadata(metadata: IBlobObjectMetadata): Promise<void>;
174
- abstract markAsDeleted(provider: string, bucket: string, key: string, versionId?: string): Promise<void>;
175
- }
176
- ```
177
-
178
- ### BlobVariantPersistencePort
179
-
180
- Tracks metadata for image/document variants.
181
-
182
- ```typescript
183
- abstract class BlobVariantPersistencePort {
184
- abstract createFromMetadata(originalId: string, label: string, metadata: IBlobObjectMetadata): Promise<void>;
185
- }
186
- ```
187
-
188
- ### Real-World Adapter: Prisma
189
-
190
- ```typescript
191
- @Injectable()
192
- export class PrismaBlobObjectAdapter extends BlobObjectPersistencePort {
193
- private readonly _prisma: PrismaService;
194
-
195
- constructor(prisma: PrismaService) {
196
- super();
197
- this._prisma = prisma;
198
- }
199
-
200
- public async createFromMetadata(metadata: IBlobObjectMetadata): Promise<void> {
201
- await this._prisma.blobObject.create({
202
- data: {
203
- provider: metadata.provider,
204
- bucket: metadata.bucket,
205
- key: metadata.key,
206
- url: metadata.url,
207
- size: metadata.size,
208
- contentType: metadata.contentType,
209
- versionId: metadata.versionId,
210
- },
211
- });
212
- }
213
-
214
- public async markAsDeleted(provider: string, bucket: string, key: string, versionId?: string): Promise<void> {
215
- await this._prisma.blobObject.updateMany({
216
- where: { provider, bucket, key, versionId },
217
- data: { deletedAt: new Date() },
218
- });
219
- }
220
- }
221
- ```
222
-
223
- ---
224
-
225
- ## Built-in Strategies
226
-
227
- ### VercelBlobStorageStrategy
228
-
229
- The Vercel Blob storage strategy using Vercel's Blob Storage API.
230
-
231
- ```typescript
232
- import { VercelBlobStorageStrategy, VERCEL_CONFIG_ENTRIES } from '@breadstone/archipel-platform-blob-storage/strategies/vercel';
233
-
234
- BlobModule.register({
235
- storageStrategy: VercelBlobStorageStrategy,
236
- configEntries: VERCEL_CONFIG_ENTRIES,
237
- });
238
- ```
239
-
240
- **Environment variables:** `VERCEL_BLOB_READ_WRITE_TOKEN`, `VERCEL_BLOB_URL`, `VERCEL_BLOB_PUBLIC_URL`, `VERCEL_BLOB_BUCKET`, `VERCEL_BLOB_REGION`
241
-
242
- ### AzureBlobStorageStrategy
243
-
244
- Microsoft Azure Blob Storage integration using `@azure/storage-blob`.
245
-
246
- ```typescript
247
- import { AzureBlobStorageStrategy, AZURE_CONFIG_ENTRIES } from '@breadstone/archipel-platform-blob-storage/strategies/azure';
248
-
249
- BlobModule.register({
250
- storageStrategy: AzureBlobStorageStrategy,
251
- configEntries: AZURE_CONFIG_ENTRIES,
252
- });
253
- ```
254
-
255
- **Environment variables:**
256
-
257
- | Variable | Required | Description |
258
- | ----------------------------- | -------- | ----------------------------------------------- |
259
- | `AZURE_BLOB_CONNECTION_STRING` | No* | Full connection string (takes precedence) |
260
- | `AZURE_BLOB_ACCOUNT_NAME` | No* | Storage account name for DefaultAzureCredential |
261
- | `AZURE_BLOB_CONTAINER_NAME` | Yes | Container to operate on |
262
-
263
- > **\*** 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.
264
-
265
- The strategy supports SAS token generation for signed URLs and lazy-loads the Azure SDK for tree-shaking.
266
-
267
- ### AwsS3BlobStorageStrategy
268
-
269
- Amazon S3 integration using `@aws-sdk/client-s3` and `@aws-sdk/s3-request-presigner`.
270
-
271
- ```typescript
272
- import { AwsS3BlobStorageStrategy, AWS_S3_CONFIG_ENTRIES } from '@breadstone/archipel-platform-blob-storage/strategies/aws-s3';
273
-
274
- BlobModule.register({
275
- storageStrategy: AwsS3BlobStorageStrategy,
276
- configEntries: AWS_S3_CONFIG_ENTRIES,
277
- });
278
- ```
279
-
280
- **Environment variables:**
281
-
282
- | Variable | Required | Description |
283
- | ---------------------------- | -------- | ---------------------------------------------------- |
284
- | `AWS_S3_REGION` | Yes | AWS region |
285
- | `AWS_S3_BUCKET` | Yes | S3 bucket name |
286
- | `AWS_S3_ACCESS_KEY_ID` | No* | Explicit access key |
287
- | `AWS_S3_SECRET_ACCESS_KEY` | No* | Explicit secret key |
288
- | `AWS_S3_ENDPOINT` | No | Custom endpoint (for MinIO, LocalStack, etc.) |
289
-
290
- > **\*** `accessKeyId` and `secretAccessKey` must be provided **together**. Omit both to use the default AWS credential chain (IAM roles, instance profiles, environment variables).
291
-
292
- 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.
293
-
294
- ### LocalBlobStorageStrategy
295
-
296
- Local filesystem storage for development and testing.
297
-
298
- ```typescript
299
- import { LocalBlobStorageStrategy, LOCAL_CONFIG_ENTRIES } from '@breadstone/archipel-platform-blob-storage/strategies/local';
300
-
301
- BlobModule.register({
302
- storageStrategy: LocalBlobStorageStrategy,
303
- configEntries: LOCAL_CONFIG_ENTRIES,
304
- });
305
- ```
306
-
307
- **Environment variables:**
308
-
309
- | Variable | Required | Default | Description |
310
- | ---------------------- | -------- | ------------- | ------------------------------------- |
311
- | `LOCAL_BLOB_BASE_PATH` | No | `./blob-data` | Base directory for local file storage |
312
- | `LOCAL_BLOB_BUCKET` | No | `default` | Default bucket subdirectory |
313
-
314
- ### EmptyBlobStorageStrategy
315
-
316
- A no-op storage strategy for development and testing. Logs all operations to the NestJS logger and returns mock results. No actual storage occurs.
317
-
318
- ```typescript
319
- import { EmptyBlobStorageStrategy } from '@breadstone/archipel-platform-blob-storage/strategies/empty';
320
-
321
- BlobModule.register({
322
- storageStrategy: EmptyBlobStorageStrategy,
323
- });
324
- ```
325
-
326
- No environment variables required.
327
-
328
- ### Custom Strategy
329
-
330
- Extend `BlobStorageStrategyBase` for any other storage backend (GCS, MinIO, etc.):
331
-
332
- ```typescript
333
- @Injectable()
334
- export class GcsBlobStorageStrategy extends BlobStorageStrategyBase {
335
- public override readonly providerId = 'gcs';
336
- public override readonly defaultBucket = 'my-gcs-bucket';
337
-
338
- public async uploadObject(request: IBlobUploadRequest): Promise<IBlobUploadResult> {
339
- // GCS upload implementation
340
- }
341
-
342
- public async downloadObject<TData>(request: IBlobDownloadRequest): Promise<IBlobDownloadResult<TData>> {
343
- // GCS download implementation
344
- }
345
-
346
- public async deleteObject(request: IBlobDeleteRequest): Promise<void> {
347
- // GCS delete implementation
348
- }
349
-
350
- public override async createSignedUrl(request: IBlobSignedUrlRequest): Promise<string> {
351
- // GCS signed URL
352
- }
353
- }
354
-
355
- // Register
356
- BlobModule.register({ storageStrategy: GcsBlobStorageStrategy });
357
- ```
358
-
359
- ---
360
-
361
- ## Health Check
362
-
363
- The `BlobHealthIndicator` pings the configured blob storage URL via HTTP. If no URL is configured, it reports `disabled: true`. Import it from the `/health` subpath:
364
-
365
- ```typescript
366
- import { BlobHealthIndicator } from '@breadstone/archipel-platform-blob-storage/health';
367
- import { HealthModule } from '@breadstone/archipel-platform-health';
368
-
369
- @Module({
370
- imports: [
371
- BlobModule.register({ /* ... */ }),
372
- HealthModule.withIndicators([BlobHealthIndicator]),
373
- ],
374
- })
375
- export class AppModule {}
376
- ```
377
-
378
- | Key | Check | Dependencies |
379
- | --- | ----- | ------------ |
380
- | `blob` | HTTP ping to blob URL (or disabled if unconfigured) | `ConfigService`, `HttpHealthIndicator` |
381
- ```
382
-
383
- ---
384
-
385
- ## Sub-path Imports
386
-
387
- Each strategy is tree-shakeable via sub-path imports:
388
-
389
- | Import Path | Contents |
390
- | -------------------------------------------------------------- | ---------------------------------------------------------- |
391
- | `@breadstone/archipel-platform-blob-storage` | Core module, service, ports, interfaces, abstract base |
392
- | `@breadstone/archipel-platform-blob-storage/strategies/vercel` | VercelBlobStorageStrategy, VERCEL_CONFIG_ENTRIES |
393
- | `@breadstone/archipel-platform-blob-storage/strategies/azure` | AzureBlobStorageStrategy, AZURE_CONFIG_ENTRIES |
394
- | `@breadstone/archipel-platform-blob-storage/strategies/aws-s3` | AwsS3BlobStorageStrategy, AWS_S3_CONFIG_ENTRIES |
395
- | `@breadstone/archipel-platform-blob-storage/strategies/local` | LocalBlobStorageStrategy, LOCAL_CONFIG_ENTRIES |
396
- | `@breadstone/archipel-platform-blob-storage/strategies/empty` | EmptyBlobStorageStrategy (mock/logging) |
397
- | `@breadstone/archipel-platform-blob-storage/health` | BlobHealthIndicator |
398
-
399
- ---
400
-
401
- ## Exports Summary
402
-
403
- | Export | Type | Description |
404
- | ----------------------------- | ------------- | ------------------------------------------------------ |
405
- | `BlobModule` | NestJS Module | Main module with `register()` |
406
- | `BlobService` | Service | Upload, download, delete, signed URLs |
407
- | `BlobStorageStrategyBase` | Abstract | Base class for custom storage strategies |
408
- | `BlobObjectPersistencePort` | Port | Object metadata tracking |
409
- | `BlobVariantPersistencePort` | Port | Variant metadata tracking |
410
- | `VercelBlobStorageStrategy` | Strategy | Vercel Blob implementation (sub-path) |
411
- | `AzureBlobStorageStrategy` | Strategy | Azure Blob Storage implementation (sub-path) |
412
- | `AwsS3BlobStorageStrategy` | Strategy | AWS S3 implementation (sub-path) |
413
- | `LocalBlobStorageStrategy` | Strategy | Local filesystem implementation (sub-path) |
414
- | `EmptyBlobStorageStrategy` | Strategy | Mock/logging implementation (sub-path) |
415
- | `BlobHealthIndicator` | Health | Blob storage health check (`/health` subpath) |
416
- | `BlobDownloadResponseTypes` | Constant | `'arraybuffer'` \| `'json'` \| `'stream'` \| `'text'` |
@@ -1,162 +0,0 @@
1
- ---
2
- title: platform-bootstrap
3
- description: Generic NestJS application composition for APIs, Express middleware, security, sessions, and OpenAPI.
4
- order: 1
5
- tags: [application, bootstrap, server, security, openapi, nestjs]
6
- package: '@breadstone/archipel-platform-bootstrap'
7
- ---
8
-
9
- # platform-bootstrap
10
-
11
- Generic NestJS application composition for Archipel APIs. It replaces repeated app-level bootstrap code with a fluent `PlatformApplication` builder and tree-shakable subpath steps.
12
-
13
- The package starts from an existing Nest application. Your entrypoint still calls `NestFactory.create()`, selects the HTTP adapter, and keeps the concrete application type visible. `platform-bootstrap` then applies reusable startup steps for API defaults, Express middleware, security, sessions, OpenAPI, and tests.
14
-
15
- **Package:** `@breadstone/archipel-platform-bootstrap`
16
-
17
- <InstallTabs />
18
-
19
- ## When to Use
20
-
21
- Use this package when multiple NestJS apps need the same startup shape but still need explicit control over their adapter and deployment target.
22
-
23
- | Use Case | Fit |
24
- | -------- | --- |
25
- | HTTP APIs on Express | Built-in `server/express`, `security`, `session`, and `openapi` steps. |
26
- | Vercel-compatible NestJS apps | `NestFactory`, `ExpressAdapter`, and `NestExpressApplication` remain in the app entrypoint. |
27
- | Shared platform startup defaults | Compose a stable sequence once and reuse it across apps. |
28
- | Step-order tests | Use the `testing` subpath without starting a real HTTP server. |
29
-
30
- ## Quick Start
31
-
32
- ```typescript
33
- import { ConsoleLogger } from '@nestjs/common';
34
- import { NestFactory } from '@nestjs/core';
35
- import { ExpressAdapter, NestExpressApplication } from '@nestjs/platform-express';
36
- import { PlatformApplication, useApi } from '@breadstone/archipel-platform-bootstrap';
37
- import { useExpressServer } from '@breadstone/archipel-platform-bootstrap/server/express';
38
- import { useSecurity } from '@breadstone/archipel-platform-bootstrap/security';
39
- import { useSession } from '@breadstone/archipel-platform-bootstrap/session';
40
- import { useOpenApi } from '@breadstone/archipel-platform-bootstrap/openapi';
41
- import { AppModule } from './AppModule';
42
-
43
- async function main(): Promise<void> {
44
- const app = await NestFactory.create<NestExpressApplication>(AppModule, new ExpressAdapter(), {
45
- logger: new ConsoleLogger({ prefix: 'API', colors: true, forceConsole: true, compact: true, sorted: true }),
46
- });
47
-
48
- await PlatformApplication.from(app)
49
- .use(useApi({ prefix: 'api' }))
50
- .use(useExpressServer({ json: { limit: '1mb' }, urlEncoded: { extended: true, limit: '1mb' } }))
51
- .use(useSecurity({ contentSecurityPolicy: 'swagger-compatible' }))
52
- .use(useSession())
53
- .use(useOpenApi())
54
- .listenFromConfig({ fallbackPort: 3000 });
55
- }
56
-
57
- void main();
58
- ```
59
-
60
- For a full application setup, see the [Application Bootstrap](/guides/application-bootstrap) guide.
61
-
62
- ## Entry Points
63
-
64
- | Import | Purpose |
65
- | ------ | ------- |
66
- | `@breadstone/archipel-platform-bootstrap` | `PlatformApplication`, builder types, API step, config keys |
67
- | `@breadstone/archipel-platform-bootstrap/server/express` | Express body parsers and compression middleware |
68
- | `@breadstone/archipel-platform-bootstrap/security` | CORS, Helmet, content-security-policy, rate limiting |
69
- | `@breadstone/archipel-platform-bootstrap/session` | Express-compatible session middleware |
70
- | `@breadstone/archipel-platform-bootstrap/openapi` | `SwaggerFeatureDiscovery.setupMultiDocumentSwagger()` step |
71
- | `@breadstone/archipel-platform-bootstrap/testing` | Lightweight bootstrap test application helpers |
72
-
73
- ## Configuration
74
-
75
- Register the config entries in the root module so startup validation and configuration discovery see the same keys the steps read at runtime.
76
-
77
- ```typescript
78
- import { Module } from '@nestjs/common';
79
- import {
80
- ConfigModule,
81
- EnvironmentConfigStrategy,
82
- } from '@breadstone/archipel-platform-configuration';
83
- import {
84
- PLATFORM_SECURITY_CONFIG_ENTRIES,
85
- PLATFORM_SERVER_CONFIG_ENTRIES,
86
- PLATFORM_SESSION_CONFIG_ENTRIES,
87
- } from '@breadstone/archipel-platform-bootstrap';
88
-
89
- @Module({
90
- imports: [
91
- ConfigModule.forRoot({
92
- strategyFactory: () => new EnvironmentConfigStrategy(),
93
- }),
94
- ConfigModule.register('platform-bootstrap/server', PLATFORM_SERVER_CONFIG_ENTRIES),
95
- ConfigModule.register('platform-bootstrap/security', PLATFORM_SECURITY_CONFIG_ENTRIES),
96
- ConfigModule.register('platform-bootstrap/session', PLATFORM_SESSION_CONFIG_ENTRIES),
97
- ],
98
- })
99
- export class AppModule {}
100
- ```
101
-
102
- | Entry | Keys |
103
- | ----- | ---- |
104
- | `PLATFORM_SERVER_CONFIG_ENTRIES` | `PORT` |
105
- | `PLATFORM_SECURITY_CONFIG_ENTRIES` | `APP_CORS_ORIGIN`, `APP_RATE_LIMIT_WINDOW_MS`, `APP_RATE_LIMIT_MAX_REQUESTS` |
106
- | `PLATFORM_SESSION_CONFIG_ENTRIES` | `AUTH_SESSION_SECRET`, `AUTH_SESSION_SECURE`, `AUTH_SESSION_MAX_AGE` |
107
-
108
- `listenFromConfig()` resolves the HTTP port from `PORT`, then `APP_PORT`, then the provided fallback.
109
-
110
- ## Built-In Steps
111
-
112
- | Step | Options | Purpose |
113
- | ---- | ------- | ------- |
114
- | `useApi()` | `IApiStepOptions` | Global prefix, validation, and global exception filters. |
115
- | `useExpressServer()` | `IExpressServerStepOptions` | JSON parser, URL-encoded parser, and compression middleware. |
116
- | `useSecurity()` | `ISecurityStepOptions` | CORS, Helmet, content security policy, and rate limiting. |
117
- | `useSession()` | `ISessionStepOptions` | Express-compatible sessions using typed config entries. |
118
- | `useOpenApi()` | `IOpenApiStepOptions` | Multi-document Swagger UI discovery and setup. |
119
-
120
- ## Composition Model
121
-
122
- The platform builder uses bootstrap steps that receive a `PlatformBootstrapContext` and call `next()` to continue the pipeline. Built-in `use*` helpers are normal step factories, so application-specific setup can live beside them without introducing a new NestJS module.
123
-
124
- ```typescript
125
- import { PlatformBootstrapStep } from '@breadstone/archipel-platform-bootstrap';
126
-
127
- export const useCustomBootstrap = (): PlatformBootstrapStep => {
128
- return async function customBootstrapStep(context, next): Promise<void> {
129
- context.app.enableShutdownHooks();
130
- await next();
131
- };
132
- };
133
- ```
134
-
135
- Step factories should use the `use*` naming convention and option interfaces should end in `StepOptions`. The shared pattern is documented in [Bootstrap Pattern](/patterns/bootstrap-pattern).
136
-
137
- ## Testing
138
-
139
- Use the `testing` subpath when the behavior under test is bootstrap composition rather than HTTP integration.
140
-
141
- ```typescript
142
- import { describe, expect, it } from 'vitest';
143
- import { PlatformApplication, useApi } from '@breadstone/archipel-platform-bootstrap';
144
- import { createPlatformTestApplication } from '@breadstone/archipel-platform-bootstrap/testing';
145
-
146
- describe('bootstrap', (): void => {
147
- it('initializes after applying API defaults', async (): Promise<void> => {
148
- const app = createPlatformTestApplication();
149
-
150
- await PlatformApplication.from(app)
151
- .use(useApi({ prefix: 'api' }))
152
- .initialize();
153
-
154
- expect(app.calls).toContain('setGlobalPrefix');
155
- expect(app.calls.at(-1)).toBe('init');
156
- });
157
- });
158
- ```
159
-
160
- ## Current Scope
161
-
162
- The first implementation targets Express-compatible NestJS HTTP applications and keeps `NestFactory` in the consuming entrypoint. Fastify, serverless handler exports, and standalone worker bootstrap steps are planned as additive subpaths.