@breadstone/archipel-mcp 0.0.20 → 0.0.21
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-text-generation.md +10 -0
- package/data/guides/analytics-and-error-tracking.md +6 -0
- package/data/guides/cryptography-and-otp.md +18 -0
- package/data/guides/document-generation.md +26 -0
- package/data/guides/email-delivery.md +23 -0
- package/data/guides/email-templates.md +298 -0
- package/data/guides/esigning-integration.md +1 -1
- package/data/guides/index.md +1 -0
- package/data/guides/mcp-server.md +9 -0
- package/data/guides/payments-and-feature-gating.md +18 -0
- package/data/guides/telemetry-and-observability.md +7 -1
- package/data/packages/platform-analytics/api/Class.AppInsightsAnalyticsClient.md +55 -6
- package/data/packages/platform-analytics/api/Class.DatadogAnalyticsClient.md +32 -6
- package/data/packages/platform-analytics/api/Class.SentryAnalyticsClient.md +55 -6
- package/data/packages/platform-analytics/index.md +13 -0
- package/data/packages/platform-core/api/Class.EventHub.md +7 -7
- package/data/packages/platform-core/api/Class.HealthOrchestrator.md +1 -1
- package/data/packages/platform-core/api/Class.SseHub.md +29 -6
- package/data/packages/platform-core/index.md +2 -1
- package/data/packages/platform-cryptography/api/Class.CryptoService.md +3 -3
- package/data/packages/platform-cryptography/index.md +10 -0
- package/data/packages/platform-documents/api/Class.DocumentEngine.md +4 -4
- package/data/packages/platform-documents/api/Class.DocumentError.md +61 -0
- package/data/packages/platform-documents/api/Class.DocumentRenderError.md +53 -0
- package/data/packages/platform-documents/api/Class.DocumentValidationError.md +52 -0
- package/data/packages/platform-documents/api/Class.ImageProcessingError.md +53 -0
- package/data/packages/platform-documents/api/Class.SharpImageProcessor.md +5 -5
- package/data/packages/platform-documents/api/index.md +4 -0
- package/data/packages/platform-documents/index.md +27 -0
- package/data/packages/platform-esigning/api/Class.EsigningClientPort.md +1 -1
- package/data/packages/platform-esigning/api/Class.InternalEsigningProvider.md +8 -8
- package/data/packages/platform-esigning/index.md +2 -0
- package/data/packages/platform-intelligence/api/Class.IntelligenceCapabilityRegistry.md +3 -3
- package/data/packages/platform-intelligence/api/Class.IntelligenceConfigurationError.md +50 -0
- package/data/packages/platform-intelligence/api/Class.IntelligenceTextGenerator.md +27 -4
- package/data/packages/platform-intelligence/api/Class.IntelligenceValidationError.md +50 -0
- package/data/packages/platform-intelligence/api/Function.loadProviderFactory.md +1 -1
- package/data/packages/platform-intelligence/api/index.md +2 -0
- package/data/packages/platform-intelligence/index.md +32 -0
- package/data/packages/platform-logging/api/Class.LoggerModule.md +1 -1
- package/data/packages/platform-logging/index.md +2 -0
- package/data/packages/platform-mailing/api/Class.MailDeliveryError.md +65 -0
- package/data/packages/platform-mailing/api/Class.MailgunDeliveryStrategy.md +3 -3
- package/data/packages/platform-mailing/api/Class.PostmarkDeliveryStrategy.md +3 -3
- package/data/packages/platform-mailing/api/Class.ResendDeliveryStrategy.md +3 -3
- package/data/packages/platform-mailing/api/Class.SendGridDeliveryStrategy.md +3 -3
- package/data/packages/platform-mailing/api/Class.SmtpDeliveryStrategy.md +3 -3
- package/data/packages/platform-mailing/api/index.md +1 -0
- package/data/packages/platform-mailing/index.md +29 -0
- package/data/packages/platform-mcp/api/Class.McpServerService.md +8 -8
- package/data/packages/platform-mcp/index.md +11 -0
- package/data/packages/platform-openapi/api/Class.SwaggerTheme.md +2 -2
- package/data/packages/platform-openapi/index.md +1 -1
- package/data/packages/platform-payments/api/Class.LemonSqueezyClient.md +6 -6
- package/data/packages/platform-payments/api/Class.MollieClient.md +6 -6
- package/data/packages/platform-payments/api/Class.PaddleClient.md +6 -6
- package/data/packages/platform-payments/api/Class.PaymentError.md +65 -0
- package/data/packages/platform-payments/api/Class.StripeClient.md +6 -6
- package/data/packages/platform-payments/api/index.md +1 -0
- package/data/packages/platform-payments/index.md +29 -0
- package/data/packages/platform-reporting/api/Class.ReportingContributorRegistry.md +1 -1
- package/data/packages/platform-reporting/index.md +3 -1
- package/data/packages/platform-telemetry/api/Class.MetricsService.md +29 -3
- package/data/packages/platform-telemetry/api/Class.OtelSdkHolder.md +3 -2
- package/data/packages/platform-telemetry/api/Class.TelemetryLoggerService.md +6 -6
- package/data/packages/platform-telemetry/api/Class.TelemetryRuleEngine.md +3 -3
- package/data/packages/platform-telemetry/api/index.md +1 -1
- package/data/packages/platform-telemetry/index.md +3 -1
- package/package.json +1 -1
|
@@ -5,7 +5,7 @@ editUrl: false
|
|
|
5
5
|
---
|
|
6
6
|
# Class: ResendDeliveryStrategy
|
|
7
7
|
|
|
8
|
-
Defined in: [platform-mailing/src/services/strategies/ResendDeliveryStrategy.ts:
|
|
8
|
+
Defined in: [platform-mailing/src/services/strategies/ResendDeliveryStrategy.ts:17](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-mailing/src/services/strategies/ResendDeliveryStrategy.ts#L17)
|
|
9
9
|
|
|
10
10
|
Delivers emails via the Resend API.
|
|
11
11
|
|
|
@@ -21,7 +21,7 @@ Delivers emails via the Resend API.
|
|
|
21
21
|
new ResendDeliveryStrategy(configService): ResendDeliveryStrategy;
|
|
22
22
|
```
|
|
23
23
|
|
|
24
|
-
Defined in: [platform-mailing/src/services/strategies/ResendDeliveryStrategy.ts:
|
|
24
|
+
Defined in: [platform-mailing/src/services/strategies/ResendDeliveryStrategy.ts:32](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-mailing/src/services/strategies/ResendDeliveryStrategy.ts#L32)
|
|
25
25
|
|
|
26
26
|
Constructs a new instance of the `ResendDeliveryStrategy` class.
|
|
27
27
|
|
|
@@ -53,7 +53,7 @@ send(
|
|
|
53
53
|
_attachments?): Promise<void>;
|
|
54
54
|
```
|
|
55
55
|
|
|
56
|
-
Defined in: [platform-mailing/src/services/strategies/ResendDeliveryStrategy.ts:
|
|
56
|
+
Defined in: [platform-mailing/src/services/strategies/ResendDeliveryStrategy.ts:52](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-mailing/src/services/strategies/ResendDeliveryStrategy.ts#L52)
|
|
57
57
|
|
|
58
58
|
Sends an email using the Resend transport.
|
|
59
59
|
|
|
@@ -5,7 +5,7 @@ editUrl: false
|
|
|
5
5
|
---
|
|
6
6
|
# Class: SendGridDeliveryStrategy
|
|
7
7
|
|
|
8
|
-
Defined in: [platform-mailing/src/services/strategies/SendGridDeliveryStrategy.ts:
|
|
8
|
+
Defined in: [platform-mailing/src/services/strategies/SendGridDeliveryStrategy.ts:17](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-mailing/src/services/strategies/SendGridDeliveryStrategy.ts#L17)
|
|
9
9
|
|
|
10
10
|
Delivers emails via the SendGrid API.
|
|
11
11
|
|
|
@@ -21,7 +21,7 @@ Delivers emails via the SendGrid API.
|
|
|
21
21
|
new SendGridDeliveryStrategy(configService): SendGridDeliveryStrategy;
|
|
22
22
|
```
|
|
23
23
|
|
|
24
|
-
Defined in: [platform-mailing/src/services/strategies/SendGridDeliveryStrategy.ts:
|
|
24
|
+
Defined in: [platform-mailing/src/services/strategies/SendGridDeliveryStrategy.ts:31](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-mailing/src/services/strategies/SendGridDeliveryStrategy.ts#L31)
|
|
25
25
|
|
|
26
26
|
Constructs a new instance of the `SendGridDeliveryStrategy` class.
|
|
27
27
|
|
|
@@ -53,7 +53,7 @@ send(
|
|
|
53
53
|
_attachments?): Promise<void>;
|
|
54
54
|
```
|
|
55
55
|
|
|
56
|
-
Defined in: [platform-mailing/src/services/strategies/SendGridDeliveryStrategy.ts:
|
|
56
|
+
Defined in: [platform-mailing/src/services/strategies/SendGridDeliveryStrategy.ts:51](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-mailing/src/services/strategies/SendGridDeliveryStrategy.ts#L51)
|
|
57
57
|
|
|
58
58
|
Sends an email using the SendGrid transport.
|
|
59
59
|
|
|
@@ -5,7 +5,7 @@ editUrl: false
|
|
|
5
5
|
---
|
|
6
6
|
# Class: SmtpDeliveryStrategy
|
|
7
7
|
|
|
8
|
-
Defined in: [platform-mailing/src/services/strategies/SmtpDeliveryStrategy.ts:
|
|
8
|
+
Defined in: [platform-mailing/src/services/strategies/SmtpDeliveryStrategy.ts:17](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-mailing/src/services/strategies/SmtpDeliveryStrategy.ts#L17)
|
|
9
9
|
|
|
10
10
|
The `SmtpDeliveryStrategy` class.
|
|
11
11
|
|
|
@@ -21,7 +21,7 @@ The `SmtpDeliveryStrategy` class.
|
|
|
21
21
|
new SmtpDeliveryStrategy(configService): SmtpDeliveryStrategy;
|
|
22
22
|
```
|
|
23
23
|
|
|
24
|
-
Defined in: [platform-mailing/src/services/strategies/SmtpDeliveryStrategy.ts:
|
|
24
|
+
Defined in: [platform-mailing/src/services/strategies/SmtpDeliveryStrategy.ts:32](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-mailing/src/services/strategies/SmtpDeliveryStrategy.ts#L32)
|
|
25
25
|
|
|
26
26
|
Constructs a new instance of the `LogDelivery` class.
|
|
27
27
|
|
|
@@ -53,7 +53,7 @@ send(
|
|
|
53
53
|
_attachments?): Promise<void>;
|
|
54
54
|
```
|
|
55
55
|
|
|
56
|
-
Defined in: [platform-mailing/src/services/strategies/SmtpDeliveryStrategy.ts:
|
|
56
|
+
Defined in: [platform-mailing/src/services/strategies/SmtpDeliveryStrategy.ts:62](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-mailing/src/services/strategies/SmtpDeliveryStrategy.ts#L62)
|
|
57
57
|
|
|
58
58
|
Sends an email using the SMTP transport.
|
|
59
59
|
|
|
@@ -13,6 +13,7 @@ editUrl: false
|
|
|
13
13
|
| [DeliveryStrategyBase](Class.DeliveryStrategyBase) | Represents the base class for all email delivery strategies. |
|
|
14
14
|
| [FileTemplateFetchStrategy](Class.FileTemplateFetchStrategy) | The `FileTemplateFetchStrategy` class. |
|
|
15
15
|
| [LogDeliveryStrategy](Class.LogDeliveryStrategy) | The `LogDeliveryStrategy` class. |
|
|
16
|
+
| [MailDeliveryError](Class.MailDeliveryError) | Domain error thrown when email delivery fails. |
|
|
16
17
|
| [MailgunDeliveryStrategy](Class.MailgunDeliveryStrategy) | Delivers emails via the Mailgun API. |
|
|
17
18
|
| [MailHealthIndicator](Class.MailHealthIndicator) | Health indicator for mail service. |
|
|
18
19
|
| [MailModule](Class.MailModule) | Represents the mail module. |
|
|
@@ -353,6 +353,34 @@ export class OrderEmailService {
|
|
|
353
353
|
|
|
354
354
|
---
|
|
355
355
|
|
|
356
|
+
## Error Handling
|
|
357
|
+
|
|
358
|
+
All delivery strategies throw a `MailDeliveryError` when email sending fails. This domain error class wraps the underlying provider SDK error and exposes structured metadata for error handling and observability.
|
|
359
|
+
|
|
360
|
+
```typescript
|
|
361
|
+
import { MailDeliveryError } from '@breadstone/archipel-platform-mailing';
|
|
362
|
+
|
|
363
|
+
try {
|
|
364
|
+
await this._mail.send(options, content, true);
|
|
365
|
+
} catch (error) {
|
|
366
|
+
if (error instanceof MailDeliveryError) {
|
|
367
|
+
logger.error('Mail delivery failed', {
|
|
368
|
+
provider: error.provider, // 'postmark', 'resend', 'sendgrid', etc.
|
|
369
|
+
code: error.code, // 'MAIL_DELIVERY'
|
|
370
|
+
cause: error.cause, // Original provider SDK error
|
|
371
|
+
});
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
```
|
|
375
|
+
|
|
376
|
+
| Property | Type | Description |
|
|
377
|
+
| ---------- | -------- | ---------------------------------------------- |
|
|
378
|
+
| `code` | `string` | Always `'MAIL_DELIVERY'` |
|
|
379
|
+
| `provider` | `string` | Provider that failed (`smtp`, `postmark`, etc.) |
|
|
380
|
+
| `cause` | `unknown`| Original error from the provider SDK |
|
|
381
|
+
|
|
382
|
+
---
|
|
383
|
+
|
|
356
384
|
## Exports Summary
|
|
357
385
|
|
|
358
386
|
### Core (`@breadstone/archipel-platform-mailing`)
|
|
@@ -372,6 +400,7 @@ export class OrderEmailService {
|
|
|
372
400
|
| `FileTemplateFetchStrategy` | Strategy | File-based templates |
|
|
373
401
|
| `BlobTemplateFetchStrategy` | Strategy | Blob-stored templates |
|
|
374
402
|
| `MailHealthIndicator` | Health | Mail readiness check |
|
|
403
|
+
| `MailDeliveryError` | Error class | Domain error for delivery failures |
|
|
375
404
|
|
|
376
405
|
### Provider subpaths
|
|
377
406
|
|
|
@@ -24,7 +24,7 @@ the registry, and provides methods to connect various transports.
|
|
|
24
24
|
new McpServerService(_options, _registry): McpServerService;
|
|
25
25
|
```
|
|
26
26
|
|
|
27
|
-
Defined in: [services/McpServerService.ts:
|
|
27
|
+
Defined in: [services/McpServerService.ts:51](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-mcp/src/services/McpServerService.ts#L51)
|
|
28
28
|
|
|
29
29
|
#### Parameters
|
|
30
30
|
|
|
@@ -47,7 +47,7 @@ Defined in: [services/McpServerService.ts:50](https://github.com/RueDeRennes/arc
|
|
|
47
47
|
get server(): McpServer;
|
|
48
48
|
```
|
|
49
49
|
|
|
50
|
-
Defined in: [services/McpServerService.ts:
|
|
50
|
+
Defined in: [services/McpServerService.ts:65](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-mcp/src/services/McpServerService.ts#L65)
|
|
51
51
|
|
|
52
52
|
Returns the underlying `McpServer` instance.
|
|
53
53
|
|
|
@@ -67,7 +67,7 @@ Error if the server has not been initialized yet.
|
|
|
67
67
|
connectStdio(): Promise<StdioServerTransport>;
|
|
68
68
|
```
|
|
69
69
|
|
|
70
|
-
Defined in: [services/McpServerService.ts:
|
|
70
|
+
Defined in: [services/McpServerService.ts:129](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-mcp/src/services/McpServerService.ts#L129)
|
|
71
71
|
|
|
72
72
|
Connects the server to a stdio transport.
|
|
73
73
|
Suitable for local, process-spawned integrations.
|
|
@@ -84,7 +84,7 @@ Suitable for local, process-spawned integrations.
|
|
|
84
84
|
connectTransport(transport): Promise<void>;
|
|
85
85
|
```
|
|
86
86
|
|
|
87
|
-
Defined in: [services/McpServerService.ts:
|
|
87
|
+
Defined in: [services/McpServerService.ts:183](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-mcp/src/services/McpServerService.ts#L183)
|
|
88
88
|
|
|
89
89
|
Connects a custom transport to the MCP server.
|
|
90
90
|
|
|
@@ -106,7 +106,7 @@ Connects a custom transport to the MCP server.
|
|
|
106
106
|
createSseTransport(options, response): Promise<SSEServerTransport>;
|
|
107
107
|
```
|
|
108
108
|
|
|
109
|
-
Defined in: [services/McpServerService.ts:
|
|
109
|
+
Defined in: [services/McpServerService.ts:169](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-mcp/src/services/McpServerService.ts#L169)
|
|
110
110
|
|
|
111
111
|
Creates an SSE transport for legacy client support.
|
|
112
112
|
The caller is responsible for wiring the returned transport to Express routes.
|
|
@@ -132,7 +132,7 @@ The configured SSE transport instance.
|
|
|
132
132
|
createStreamableHttpTransport(options?): Promise<StreamableHTTPServerTransport>;
|
|
133
133
|
```
|
|
134
134
|
|
|
135
|
-
Defined in: [services/McpServerService.ts:
|
|
135
|
+
Defined in: [services/McpServerService.ts:146](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-mcp/src/services/McpServerService.ts#L146)
|
|
136
136
|
|
|
137
137
|
Creates a Streamable HTTP transport for use with Express.
|
|
138
138
|
The caller is responsible for wiring the transport's `handleRequest`
|
|
@@ -158,7 +158,7 @@ The configured transport instance.
|
|
|
158
158
|
onModuleDestroy(): Promise<void>;
|
|
159
159
|
```
|
|
160
160
|
|
|
161
|
-
Defined in: [services/McpServerService.ts:
|
|
161
|
+
Defined in: [services/McpServerService.ts:103](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-mcp/src/services/McpServerService.ts#L103)
|
|
162
162
|
|
|
163
163
|
Cleans up all active transports when the module is destroyed.
|
|
164
164
|
|
|
@@ -180,7 +180,7 @@ OnModuleDestroy.onModuleDestroy
|
|
|
180
180
|
onModuleInit(): void;
|
|
181
181
|
```
|
|
182
182
|
|
|
183
|
-
Defined in: [services/McpServerService.ts:
|
|
183
|
+
Defined in: [services/McpServerService.ts:81](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-mcp/src/services/McpServerService.ts#L81)
|
|
184
184
|
|
|
185
185
|
Initializes the MCP server and registers all tools, resources, and prompts
|
|
186
186
|
from the registry.
|
|
@@ -297,3 +297,14 @@ graph TD
|
|
|
297
297
|
2. **McpDiscoveryService** runs `onModuleInit`, iterates all providers, reads decorator metadata, and populates the registry.
|
|
298
298
|
3. **McpServerService** runs `onModuleInit`, creates the `McpServer` instance, and registers all handlers from the registry.
|
|
299
299
|
4. The application connects a transport (stdio, HTTP, SSE, or custom) to start serving MCP requests.
|
|
300
|
+
|
|
301
|
+
---
|
|
302
|
+
|
|
303
|
+
## Resource Limits & Shutdown
|
|
304
|
+
|
|
305
|
+
| Limit | Value | Description |
|
|
306
|
+
| -------------------- | ---------- | ------------------------------------------------------------------------ |
|
|
307
|
+
| **Max transports** | 1,000 | `McpServerService` tracks up to 1,000 active transports |
|
|
308
|
+
| **Shutdown timeout** | 5 seconds | Each transport and the server are closed with a 5-second timeout guard |
|
|
309
|
+
|
|
310
|
+
When the module is destroyed, `McpServerService.onModuleDestroy()` iterates all active transports, closes each with a 5-second timeout, and then closes the MCP server itself.
|
|
@@ -17,7 +17,7 @@ The swagger theme class
|
|
|
17
17
|
new SwaggerTheme(resourceManager): SwaggerTheme;
|
|
18
18
|
```
|
|
19
19
|
|
|
20
|
-
Defined in: [SwaggerTheme.ts:
|
|
20
|
+
Defined in: [SwaggerTheme.ts:30](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-openapi/src/SwaggerTheme.ts#L30)
|
|
21
21
|
|
|
22
22
|
Constructs a new instance of the `SwaggerTheme` class.
|
|
23
23
|
|
|
@@ -39,7 +39,7 @@ Constructs a new instance of the `SwaggerTheme` class.
|
|
|
39
39
|
getOptions(): Pick<SwaggerCustomOptions, "customCss" | "customJsStr">;
|
|
40
40
|
```
|
|
41
41
|
|
|
42
|
-
Defined in: [SwaggerTheme.ts:
|
|
42
|
+
Defined in: [SwaggerTheme.ts:38](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-openapi/src/SwaggerTheme.ts#L38)
|
|
43
43
|
|
|
44
44
|
#### Returns
|
|
45
45
|
|
|
@@ -201,5 +201,5 @@ const features = registry.getFeatures(); // sorted, read-only copy
|
|
|
201
201
|
| `SwaggerFeatureDiscovery` | Service | Auto-discover features |
|
|
202
202
|
| `SwaggerFeatureRegistry` | Service | Manage feature configs |
|
|
203
203
|
| `SwaggerMultiDocumentService` | Service | Generate per-feature specs |
|
|
204
|
-
| `SwaggerTheme` | Utility | Theme customization
|
|
204
|
+
| `SwaggerTheme` | Utility | Theme customization (CSS/JS cached after first load) |
|
|
205
205
|
| `IFeatureSwaggerConfig` | Interface | Feature config shape |
|
|
@@ -5,7 +5,7 @@ editUrl: false
|
|
|
5
5
|
---
|
|
6
6
|
# Class: LemonSqueezyClient
|
|
7
7
|
|
|
8
|
-
Defined in: [lemonsqueezy/LemonSqueezyClient.ts:
|
|
8
|
+
Defined in: [lemonsqueezy/LemonSqueezyClient.ts:31](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-payments/src/lemonsqueezy/LemonSqueezyClient.ts#L31)
|
|
9
9
|
|
|
10
10
|
LemonSqueezy implementation of the [PaymentClientPort](Class.PaymentClientPort).
|
|
11
11
|
Uses the official `@lemonsqueezy/lemonsqueezy.js` SDK.
|
|
@@ -22,7 +22,7 @@ Uses the official `@lemonsqueezy/lemonsqueezy.js` SDK.
|
|
|
22
22
|
new LemonSqueezyClient(configService): LemonSqueezyClient;
|
|
23
23
|
```
|
|
24
24
|
|
|
25
|
-
Defined in: [lemonsqueezy/LemonSqueezyClient.ts:
|
|
25
|
+
Defined in: [lemonsqueezy/LemonSqueezyClient.ts:41](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-payments/src/lemonsqueezy/LemonSqueezyClient.ts#L41)
|
|
26
26
|
|
|
27
27
|
#### Parameters
|
|
28
28
|
|
|
@@ -46,7 +46,7 @@ Defined in: [lemonsqueezy/LemonSqueezyClient.ts:40](https://github.com/RueDeRenn
|
|
|
46
46
|
constructWebhookEvent(payload, signature): INormalizedWebhookEvent;
|
|
47
47
|
```
|
|
48
48
|
|
|
49
|
-
Defined in: [lemonsqueezy/LemonSqueezyClient.ts:
|
|
49
|
+
Defined in: [lemonsqueezy/LemonSqueezyClient.ts:144](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-payments/src/lemonsqueezy/LemonSqueezyClient.ts#L144)
|
|
50
50
|
|
|
51
51
|
Construct and normalize a webhook event from raw payload.
|
|
52
52
|
|
|
@@ -79,7 +79,7 @@ createCheckoutSession(
|
|
|
79
79
|
userId?): Promise<INormalizedCheckoutSession>;
|
|
80
80
|
```
|
|
81
81
|
|
|
82
|
-
Defined in: [lemonsqueezy/LemonSqueezyClient.ts:
|
|
82
|
+
Defined in: [lemonsqueezy/LemonSqueezyClient.ts:79](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-payments/src/lemonsqueezy/LemonSqueezyClient.ts#L79)
|
|
83
83
|
|
|
84
84
|
Create a checkout session.
|
|
85
85
|
|
|
@@ -110,7 +110,7 @@ Normalized checkout session.
|
|
|
110
110
|
fetchPrices(productId): Promise<INormalizedPrice[]>;
|
|
111
111
|
```
|
|
112
112
|
|
|
113
|
-
Defined in: [lemonsqueezy/LemonSqueezyClient.ts:
|
|
113
|
+
Defined in: [lemonsqueezy/LemonSqueezyClient.ts:57](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-payments/src/lemonsqueezy/LemonSqueezyClient.ts#L57)
|
|
114
114
|
|
|
115
115
|
Fetch all active prices for a product.
|
|
116
116
|
|
|
@@ -140,7 +140,7 @@ fetchSubscription(subscriptionId): Promise<
|
|
|
140
140
|
| null>;
|
|
141
141
|
```
|
|
142
142
|
|
|
143
|
-
Defined in: [lemonsqueezy/LemonSqueezyClient.ts:
|
|
143
|
+
Defined in: [lemonsqueezy/LemonSqueezyClient.ts:125](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-payments/src/lemonsqueezy/LemonSqueezyClient.ts#L125)
|
|
144
144
|
|
|
145
145
|
Retrieve subscription details.
|
|
146
146
|
|
|
@@ -5,7 +5,7 @@ editUrl: false
|
|
|
5
5
|
---
|
|
6
6
|
# Class: MollieClient
|
|
7
7
|
|
|
8
|
-
Defined in: [mollie/MollieClient.ts:
|
|
8
|
+
Defined in: [mollie/MollieClient.ts:25](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-payments/src/mollie/MollieClient.ts#L25)
|
|
9
9
|
|
|
10
10
|
Mollie implementation of the [PaymentClientPort](Class.PaymentClientPort).
|
|
11
11
|
Uses the official `@mollie/api-client` to interact with the Mollie API.
|
|
@@ -22,7 +22,7 @@ Uses the official `@mollie/api-client` to interact with the Mollie API.
|
|
|
22
22
|
new MollieClient(configService): MollieClient;
|
|
23
23
|
```
|
|
24
24
|
|
|
25
|
-
Defined in: [mollie/MollieClient.ts:
|
|
25
|
+
Defined in: [mollie/MollieClient.ts:36](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-payments/src/mollie/MollieClient.ts#L36)
|
|
26
26
|
|
|
27
27
|
#### Parameters
|
|
28
28
|
|
|
@@ -46,7 +46,7 @@ Defined in: [mollie/MollieClient.ts:35](https://github.com/RueDeRennes/archipel/
|
|
|
46
46
|
constructWebhookEvent(payload, signature): INormalizedWebhookEvent;
|
|
47
47
|
```
|
|
48
48
|
|
|
49
|
-
Defined in: [mollie/MollieClient.ts:
|
|
49
|
+
Defined in: [mollie/MollieClient.ts:133](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-payments/src/mollie/MollieClient.ts#L133)
|
|
50
50
|
|
|
51
51
|
Construct and normalize a webhook event from raw payload.
|
|
52
52
|
|
|
@@ -79,7 +79,7 @@ createCheckoutSession(
|
|
|
79
79
|
userId?): Promise<INormalizedCheckoutSession>;
|
|
80
80
|
```
|
|
81
81
|
|
|
82
|
-
Defined in: [mollie/MollieClient.ts:
|
|
82
|
+
Defined in: [mollie/MollieClient.ts:66](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-payments/src/mollie/MollieClient.ts#L66)
|
|
83
83
|
|
|
84
84
|
Creates a checkout session for Mollie.
|
|
85
85
|
|
|
@@ -113,7 +113,7 @@ formatted monetary amount (e.g. "10.00") for the payment creation.
|
|
|
113
113
|
fetchPrices(_productId): Promise<INormalizedPrice[]>;
|
|
114
114
|
```
|
|
115
115
|
|
|
116
|
-
Defined in: [mollie/MollieClient.ts:
|
|
116
|
+
Defined in: [mollie/MollieClient.ts:50](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-payments/src/mollie/MollieClient.ts#L50)
|
|
117
117
|
|
|
118
118
|
Fetch all active prices for a product.
|
|
119
119
|
|
|
@@ -143,7 +143,7 @@ fetchSubscription(subscriptionId): Promise<
|
|
|
143
143
|
| null>;
|
|
144
144
|
```
|
|
145
145
|
|
|
146
|
-
Defined in: [mollie/MollieClient.ts:
|
|
146
|
+
Defined in: [mollie/MollieClient.ts:107](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-payments/src/mollie/MollieClient.ts#L107)
|
|
147
147
|
|
|
148
148
|
Retrieve subscription details.
|
|
149
149
|
|
|
@@ -5,7 +5,7 @@ editUrl: false
|
|
|
5
5
|
---
|
|
6
6
|
# Class: PaddleClient
|
|
7
7
|
|
|
8
|
-
Defined in: [paddle/PaddleClient.ts:
|
|
8
|
+
Defined in: [paddle/PaddleClient.ts:25](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-payments/src/paddle/PaddleClient.ts#L25)
|
|
9
9
|
|
|
10
10
|
Paddle implementation of the [PaymentClientPort](Class.PaymentClientPort).
|
|
11
11
|
Uses the official `@paddle/paddle-node-sdk` to interact with the Paddle Billing API.
|
|
@@ -22,7 +22,7 @@ Uses the official `@paddle/paddle-node-sdk` to interact with the Paddle Billing
|
|
|
22
22
|
new PaddleClient(configService): PaddleClient;
|
|
23
23
|
```
|
|
24
24
|
|
|
25
|
-
Defined in: [paddle/PaddleClient.ts:
|
|
25
|
+
Defined in: [paddle/PaddleClient.ts:36](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-payments/src/paddle/PaddleClient.ts#L36)
|
|
26
26
|
|
|
27
27
|
#### Parameters
|
|
28
28
|
|
|
@@ -46,7 +46,7 @@ Defined in: [paddle/PaddleClient.ts:35](https://github.com/RueDeRennes/archipel/
|
|
|
46
46
|
constructWebhookEvent(payload, signature): Promise<INormalizedWebhookEvent>;
|
|
47
47
|
```
|
|
48
48
|
|
|
49
|
-
Defined in: [paddle/PaddleClient.ts:
|
|
49
|
+
Defined in: [paddle/PaddleClient.ts:122](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-payments/src/paddle/PaddleClient.ts#L122)
|
|
50
50
|
|
|
51
51
|
Construct and normalize a webhook event from raw payload.
|
|
52
52
|
|
|
@@ -79,7 +79,7 @@ createCheckoutSession(
|
|
|
79
79
|
userId?): Promise<INormalizedCheckoutSession>;
|
|
80
80
|
```
|
|
81
81
|
|
|
82
|
-
Defined in: [paddle/PaddleClient.ts:
|
|
82
|
+
Defined in: [paddle/PaddleClient.ts:73](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-payments/src/paddle/PaddleClient.ts#L73)
|
|
83
83
|
|
|
84
84
|
Create a checkout session.
|
|
85
85
|
|
|
@@ -110,7 +110,7 @@ Normalized checkout session.
|
|
|
110
110
|
fetchPrices(productId): Promise<INormalizedPrice[]>;
|
|
111
111
|
```
|
|
112
112
|
|
|
113
|
-
Defined in: [paddle/PaddleClient.ts:
|
|
113
|
+
Defined in: [paddle/PaddleClient.ts:53](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-payments/src/paddle/PaddleClient.ts#L53)
|
|
114
114
|
|
|
115
115
|
Fetch all active prices for a product.
|
|
116
116
|
|
|
@@ -140,7 +140,7 @@ fetchSubscription(subscriptionId): Promise<
|
|
|
140
140
|
| null>;
|
|
141
141
|
```
|
|
142
142
|
|
|
143
|
-
Defined in: [paddle/PaddleClient.ts:
|
|
143
|
+
Defined in: [paddle/PaddleClient.ts:107](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-payments/src/paddle/PaddleClient.ts#L107)
|
|
144
144
|
|
|
145
145
|
Retrieve subscription details.
|
|
146
146
|
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: 'Class: PaymentError'
|
|
3
|
+
generated: true
|
|
4
|
+
editUrl: false
|
|
5
|
+
---
|
|
6
|
+
# Class: PaymentError
|
|
7
|
+
|
|
8
|
+
Defined in: [errors/PaymentError.ts:6](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-payments/src/errors/PaymentError.ts#L6)
|
|
9
|
+
|
|
10
|
+
Domain error thrown when a payment operation fails.
|
|
11
|
+
|
|
12
|
+
## Extends
|
|
13
|
+
|
|
14
|
+
- `Error`
|
|
15
|
+
|
|
16
|
+
## Constructors
|
|
17
|
+
|
|
18
|
+
### Constructor
|
|
19
|
+
|
|
20
|
+
```ts
|
|
21
|
+
new PaymentError(
|
|
22
|
+
provider,
|
|
23
|
+
message,
|
|
24
|
+
cause?): PaymentError;
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Defined in: [errors/PaymentError.ts:16](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-payments/src/errors/PaymentError.ts#L16)
|
|
28
|
+
|
|
29
|
+
#### Parameters
|
|
30
|
+
|
|
31
|
+
| Parameter | Type |
|
|
32
|
+
| ------ | ------ |
|
|
33
|
+
| `provider` | `string` |
|
|
34
|
+
| `message` | `string` |
|
|
35
|
+
| `cause?` | `unknown` |
|
|
36
|
+
|
|
37
|
+
#### Returns
|
|
38
|
+
|
|
39
|
+
`PaymentError`
|
|
40
|
+
|
|
41
|
+
#### Overrides
|
|
42
|
+
|
|
43
|
+
```ts
|
|
44
|
+
Error.constructor
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Properties
|
|
48
|
+
|
|
49
|
+
### code
|
|
50
|
+
|
|
51
|
+
```ts
|
|
52
|
+
readonly code: "PAYMENT" = 'PAYMENT';
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Defined in: [errors/PaymentError.ts:9](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-payments/src/errors/PaymentError.ts#L9)
|
|
56
|
+
|
|
57
|
+
***
|
|
58
|
+
|
|
59
|
+
### provider
|
|
60
|
+
|
|
61
|
+
```ts
|
|
62
|
+
readonly provider: string;
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
Defined in: [errors/PaymentError.ts:10](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-payments/src/errors/PaymentError.ts#L10)
|
|
@@ -5,7 +5,7 @@ editUrl: false
|
|
|
5
5
|
---
|
|
6
6
|
# Class: StripeClient
|
|
7
7
|
|
|
8
|
-
Defined in: [stripe/StripeClient.ts:
|
|
8
|
+
Defined in: [stripe/StripeClient.ts:29](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-payments/src/stripe/StripeClient.ts#L29)
|
|
9
9
|
|
|
10
10
|
Stripe implementation of the [PaymentClientPort](Class.PaymentClientPort).
|
|
11
11
|
All Stripe-specific types and logic are encapsulated here.
|
|
@@ -22,7 +22,7 @@ All Stripe-specific types and logic are encapsulated here.
|
|
|
22
22
|
new StripeClient(configService): StripeClient;
|
|
23
23
|
```
|
|
24
24
|
|
|
25
|
-
Defined in: [stripe/StripeClient.ts:
|
|
25
|
+
Defined in: [stripe/StripeClient.ts:40](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-payments/src/stripe/StripeClient.ts#L40)
|
|
26
26
|
|
|
27
27
|
#### Parameters
|
|
28
28
|
|
|
@@ -46,7 +46,7 @@ Defined in: [stripe/StripeClient.ts:39](https://github.com/RueDeRennes/archipel/
|
|
|
46
46
|
constructWebhookEvent(payload, signature): INormalizedWebhookEvent;
|
|
47
47
|
```
|
|
48
48
|
|
|
49
|
-
Defined in: [stripe/StripeClient.ts:
|
|
49
|
+
Defined in: [stripe/StripeClient.ts:153](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-payments/src/stripe/StripeClient.ts#L153)
|
|
50
50
|
|
|
51
51
|
Construct and normalize a webhook event.
|
|
52
52
|
|
|
@@ -79,7 +79,7 @@ createCheckoutSession(
|
|
|
79
79
|
userId?): Promise<INormalizedCheckoutSession>;
|
|
80
80
|
```
|
|
81
81
|
|
|
82
|
-
Defined in: [stripe/StripeClient.ts:
|
|
82
|
+
Defined in: [stripe/StripeClient.ts:88](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-payments/src/stripe/StripeClient.ts#L88)
|
|
83
83
|
|
|
84
84
|
Create a checkout session.
|
|
85
85
|
|
|
@@ -110,7 +110,7 @@ Normalized checkout session
|
|
|
110
110
|
fetchPrices(productId): Promise<INormalizedPrice[]>;
|
|
111
111
|
```
|
|
112
112
|
|
|
113
|
-
Defined in: [stripe/StripeClient.ts:
|
|
113
|
+
Defined in: [stripe/StripeClient.ts:59](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-payments/src/stripe/StripeClient.ts#L59)
|
|
114
114
|
|
|
115
115
|
Fetch all active prices for a product.
|
|
116
116
|
|
|
@@ -140,7 +140,7 @@ fetchSubscription(subscriptionId): Promise<
|
|
|
140
140
|
| null>;
|
|
141
141
|
```
|
|
142
142
|
|
|
143
|
-
Defined in: [stripe/StripeClient.ts:
|
|
143
|
+
Defined in: [stripe/StripeClient.ts:128](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-payments/src/stripe/StripeClient.ts#L128)
|
|
144
144
|
|
|
145
145
|
Retrieve subscription details.
|
|
146
146
|
|
|
@@ -16,6 +16,7 @@ editUrl: false
|
|
|
16
16
|
| [MollieClient](Class.MollieClient) | Mollie implementation of the [PaymentClientPort](Class.PaymentClientPort). Uses the official `@mollie/api-client` to interact with the Mollie API. |
|
|
17
17
|
| [PaddleClient](Class.PaddleClient) | Paddle implementation of the [PaymentClientPort](Class.PaymentClientPort). Uses the official `@paddle/paddle-node-sdk` to interact with the Paddle Billing API. |
|
|
18
18
|
| [PaymentClientPort](Class.PaymentClientPort) | Abstract port for payment provider clients. Each provider (Stripe, Paddle, LemonSqueezy, Mollie) must implement this contract so that the consuming application can switch providers without changing business logic. |
|
|
19
|
+
| [PaymentError](Class.PaymentError) | Domain error thrown when a payment operation fails. |
|
|
19
20
|
| [PaymentModule](Class.PaymentModule) | NestJS module providing generic payment infrastructure. Exposes a configurable payment client, a feature-gating guard, and a usage-tracking interceptor. The specific payment provider (Stripe, Paddle, LemonSqueezy, Mollie) is selected via the options. |
|
|
20
21
|
| [StripeClient](Class.StripeClient) | Stripe implementation of the [PaymentClientPort](Class.PaymentClientPort). All Stripe-specific types and logic are encapsulated here. |
|
|
21
22
|
|
|
@@ -504,6 +504,34 @@ export class RecipeController {
|
|
|
504
504
|
|
|
505
505
|
---
|
|
506
506
|
|
|
507
|
+
## Error Handling
|
|
508
|
+
|
|
509
|
+
All payment clients throw a `PaymentError` when provider operations fail (checkout session creation, webhook signature verification, price fetching, etc.). This domain error wraps the underlying SDK error and exposes structured metadata:
|
|
510
|
+
|
|
511
|
+
```typescript
|
|
512
|
+
import { PaymentError } from '@breadstone/archipel-platform-payments';
|
|
513
|
+
|
|
514
|
+
try {
|
|
515
|
+
await this._paymentClient.createCheckoutSession(params);
|
|
516
|
+
} catch (error) {
|
|
517
|
+
if (error instanceof PaymentError) {
|
|
518
|
+
logger.error('Payment operation failed', {
|
|
519
|
+
provider: error.provider, // 'stripe', 'paddle', 'mollie', 'lemonsqueezy'
|
|
520
|
+
code: error.code, // 'PAYMENT'
|
|
521
|
+
cause: error.cause, // Original provider SDK error
|
|
522
|
+
});
|
|
523
|
+
}
|
|
524
|
+
}
|
|
525
|
+
```
|
|
526
|
+
|
|
527
|
+
| Property | Type | Description |
|
|
528
|
+
| ---------- | -------- | -------------------------------------------------- |
|
|
529
|
+
| `code` | `string` | Always `'PAYMENT'` |
|
|
530
|
+
| `provider` | `string` | Provider that failed (`stripe`, `paddle`, etc.) |
|
|
531
|
+
| `cause` | `unknown`| Original error from the provider SDK |
|
|
532
|
+
|
|
533
|
+
---
|
|
534
|
+
|
|
507
535
|
## Exports Summary
|
|
508
536
|
|
|
509
537
|
### Core (`@breadstone/archipel-platform-payments`)
|
|
@@ -523,6 +551,7 @@ export class RecipeController {
|
|
|
523
551
|
| `INormalizedSubscription` | Interface | Normalized subscription |
|
|
524
552
|
| `INormalizedWebhookEvent` | Interface | Normalized webhook event |
|
|
525
553
|
| `SubscriptionStatus` | Type Alias | Subscription status union |
|
|
554
|
+
| `PaymentError` | Error class | Domain error for payment failures |
|
|
526
555
|
|
|
527
556
|
### Provider subpaths
|
|
528
557
|
|
|
@@ -29,7 +29,7 @@ new ReportingContributorRegistry(): ReportingContributorRegistry;
|
|
|
29
29
|
getContributors(): readonly IReportingContributor[];
|
|
30
30
|
```
|
|
31
31
|
|
|
32
|
-
Defined in: [core/ReportingContributorRegistry.ts:
|
|
32
|
+
Defined in: [core/ReportingContributorRegistry.ts:37](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-reporting/src/core/ReportingContributorRegistry.ts#L37)
|
|
33
33
|
|
|
34
34
|
#### Returns
|
|
35
35
|
|
|
@@ -30,6 +30,8 @@ export class AppModule {}
|
|
|
30
30
|
|
|
31
31
|
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`.
|
|
32
32
|
|
|
33
|
+
> **Capacity limit:** The registry enforces a maximum of **200** registered contributors. Attempts to exceed this limit are logged as warnings and silently ignored.
|
|
34
|
+
|
|
33
35
|
### IReportingContributor
|
|
34
36
|
|
|
35
37
|
```typescript
|
|
@@ -128,7 +130,7 @@ export class OrderModule implements OnModuleInit {
|
|
|
128
130
|
|
|
129
131
|
## ReportingFacade
|
|
130
132
|
|
|
131
|
-
Central API for catalog browsing and query execution.
|
|
133
|
+
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`.
|
|
132
134
|
|
|
133
135
|
### Browse Catalog
|
|
134
136
|
|