@breadstone/archipel-mcp 0.0.21 → 0.0.22
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/cryptography-and-otp.md +2 -2
- package/data/guides/database-setup.md +4 -3
- package/data/guides/email-templates.md +3 -3
- package/data/guides/getting-started.md +6 -6
- package/data/guides/resource-management.md +9 -9
- package/data/packages/platform-blob-storage/api/Variable.AWS_S3_PROVIDER_OPTIONS.md +1 -1
- package/data/packages/platform-blob-storage/api/Variable.AZURE_BLOB_PROVIDER_OPTIONS.md +1 -1
- package/data/packages/platform-blob-storage/api/Variable.BLOB_PROVIDER.md +1 -1
- package/data/packages/platform-blob-storage/api/Variable.VERCEL_BLOB_PROVIDER_OPTIONS.md +1 -1
- package/data/packages/platform-core/api/Class.ErrorTemplateService.md +1 -1
- package/data/packages/platform-core/api/Class.HostService.md +1 -1
- package/data/packages/platform-core/api/Variable.ID_GENERATOR_TOKEN.md +1 -1
- package/data/packages/platform-core/api/index.md +0 -27
- package/data/packages/platform-core/index.md +7 -4
- package/data/packages/platform-cryptography/api/Class.BcryptService.md +4 -4
- package/data/packages/platform-cryptography/api/Class.OtpService.md +6 -6
- package/data/packages/platform-cryptography/api/Variable.BCRYPT_OPTIONS.md +2 -2
- package/data/packages/platform-cryptography/api/Variable.MAX_BCRYPT_PASSWORD_BYTES.md +1 -1
- package/data/packages/platform-cryptography/api/Variable.MIN_BCRYPT_ROUNDS.md +1 -1
- package/data/packages/platform-cryptography/api/Variable.OTP_OPTIONS.md +2 -2
- package/data/packages/platform-cryptography/api/Variable.OTP_SERVICE_TOKEN.md +2 -2
- package/data/packages/platform-cryptography/api/Variable.TOTP_EPOCH_TOLERANCE.md +1 -1
- package/data/packages/platform-cryptography/api/index.md +3 -3
- package/data/packages/platform-documents/api/Class.BaseDocumentRenderer.md +32 -1
- package/data/packages/platform-documents/api/Class.DocumentEngine.md +4 -4
- package/data/packages/platform-documents/api/Class.DocumentModule.md +2 -2
- package/data/packages/platform-documents/api/Class.DocxDocumentRenderer2.md +333 -0
- package/data/packages/platform-documents/api/Class.PdfDocumentRenderer.md +355 -0
- package/data/packages/platform-documents/api/Interface.IDocumentModuleOptions.md +31 -5
- package/data/packages/platform-documents/api/Variable.DOCUMENT_MODULE_OPTIONS.md +1 -1
- package/data/packages/platform-documents/api/Variable.DOCUMENT_PARSER_TOKEN.md +1 -1
- package/data/packages/platform-documents/api/Variable.DOCUMENT_RENDERER_TOKEN.md +1 -1
- package/data/packages/platform-documents/api/Variable.IMAGE_PROCESSOR_TOKEN.md +1 -1
- package/data/packages/platform-documents/api/index.md +2 -0
- package/data/packages/platform-esigning/api/Class.EsigningClientPort.md +1 -1
- package/data/packages/platform-health/index.md +128 -0
- package/data/packages/platform-mailing/api/Class.DeliveryStrategyBase.md +0 -1
- package/data/packages/platform-mailing/api/Class.MailModule.md +1 -1
- package/data/packages/platform-mailing/api/Class.TemplateFetchStrategyBase.md +0 -5
- package/data/packages/platform-mailing/api/Variable.SMTP_CONFIG_ENTRIES.md +14 -0
- package/data/packages/platform-mailing/api/Variable.SMTP_HOST.md +14 -0
- package/data/packages/platform-mailing/api/Variable.SMTP_PASSWORD.md +14 -0
- package/data/packages/platform-mailing/api/Variable.SMTP_PORT.md +14 -0
- package/data/packages/platform-mailing/api/Variable.SMTP_SECURE.md +14 -0
- package/data/packages/platform-mailing/api/Variable.SMTP_USER.md +14 -0
- package/data/packages/platform-mailing/api/index.md +6 -3
- package/data/packages/platform-mapping/index.md +121 -0
- package/data/packages/platform-mcp/api/Variable.MCP_MODULE_OPTIONS.md +1 -1
- package/data/packages/platform-openapi/api/Class.SwaggerMultiDocumentService.md +4 -4
- package/data/packages/platform-resources/index.md +135 -0
- package/data/packages/platform-telemetry/api/Variable.TELEMETRY_ENABLED.md +1 -1
- package/data/packages/platform-telemetry/api/Variable.TELEMETRY_FACADE.md +1 -1
- package/data/packages/platform-telemetry/api/Variable.TELEMETRY_OPTIONS.md +1 -1
- package/{src/knowledge/configPattern.js → data/patterns/config-pattern.md} +44 -47
- package/{src/knowledge/dtoPattern.js → data/patterns/dto-pattern.md} +58 -61
- package/{src/knowledge/errorHandlingPattern.js → data/patterns/error-handling-pattern.md} +35 -38
- package/{src/knowledge/guardPattern.js → data/patterns/guard-pattern.md} +35 -38
- package/{src/knowledge/mappingPattern.js → data/patterns/mapping-pattern.md} +43 -144
- package/data/patterns/module-pattern.md +182 -0
- package/data/patterns/query-pattern.md +137 -0
- package/data/patterns/repository-pattern.md +208 -0
- package/{src/knowledge/testingPattern.js → data/patterns/testing-pattern.md} +37 -40
- package/package.json +1 -1
- package/src/PatternsLoader.d.ts +12 -0
- package/src/PatternsLoader.js +65 -0
- package/src/generators/mappingPatternGenerator.d.ts +5 -0
- package/src/generators/mappingPatternGenerator.js +107 -0
- package/src/generators/modulePatternGenerator.d.ts +5 -0
- package/src/generators/modulePatternGenerator.js +107 -0
- package/src/generators/queryPatternGenerator.d.ts +4 -0
- package/src/generators/queryPatternGenerator.js +83 -0
- package/src/generators/repositoryPatternGenerator.d.ts +5 -0
- package/src/generators/repositoryPatternGenerator.js +165 -0
- package/src/main.js +15 -9
- package/src/models/IPatternDoc.d.ts +15 -0
- package/src/models/IPatternDoc.js +3 -0
- package/src/tools/registerGetConfigPatternTool.d.ts +2 -1
- package/src/tools/registerGetConfigPatternTool.js +4 -3
- package/src/tools/registerGetDtoPatternTool.d.ts +2 -1
- package/src/tools/registerGetDtoPatternTool.js +4 -3
- package/src/tools/registerGetErrorHandlingPatternTool.d.ts +2 -1
- package/src/tools/registerGetErrorHandlingPatternTool.js +4 -3
- package/src/tools/registerGetGuardPatternTool.d.ts +2 -1
- package/src/tools/registerGetGuardPatternTool.js +4 -3
- package/src/tools/registerGetMappingPatternTool.d.ts +2 -1
- package/src/tools/registerGetMappingPatternTool.js +5 -4
- package/src/tools/registerGetModulePatternTool.d.ts +2 -1
- package/src/tools/registerGetModulePatternTool.js +5 -4
- package/src/tools/registerGetQueryPatternTool.d.ts +2 -1
- package/src/tools/registerGetQueryPatternTool.js +5 -4
- package/src/tools/registerGetRepositoryPatternTool.d.ts +2 -1
- package/src/tools/registerGetRepositoryPatternTool.js +5 -4
- package/src/tools/registerGetTestingPatternTool.d.ts +2 -1
- package/src/tools/registerGetTestingPatternTool.js +4 -3
- package/data/packages/platform-core/api/Class.BlobResourceStrategy.md +0 -195
- package/data/packages/platform-core/api/Class.EmbeddedResourceStrategy.md +0 -215
- package/data/packages/platform-core/api/Class.FileResourceStrategy.md +0 -192
- package/data/packages/platform-core/api/Class.HealthModule.md +0 -42
- package/data/packages/platform-core/api/Class.HealthOrchestrator.md +0 -64
- package/data/packages/platform-core/api/Class.MappingBuilder.md +0 -110
- package/data/packages/platform-core/api/Class.MappingModule.md +0 -46
- package/data/packages/platform-core/api/Class.MappingNotRegisteredError.md +0 -56
- package/data/packages/platform-core/api/Class.MappingProfileBase.md +0 -52
- package/data/packages/platform-core/api/Class.MappingService.md +0 -284
- package/data/packages/platform-core/api/Class.ResourceManager.md +0 -565
- package/data/packages/platform-core/api/Class.ResourceModule.md +0 -46
- package/data/packages/platform-core/api/Class.TypeMappingNotRegisteredError.md +0 -57
- package/data/packages/platform-core/api/Function.createMappingKey.md +0 -39
- package/data/packages/platform-core/api/Interface.IBlobResourceStrategyConfig.md +0 -28
- package/data/packages/platform-core/api/Interface.IBlobServiceAdapter.md +0 -40
- package/data/packages/platform-core/api/Interface.IFileResourceStrategyConfig.md +0 -72
- package/data/packages/platform-core/api/Interface.IHealthCheckResult.md +0 -46
- package/data/packages/platform-core/api/Interface.IHealthIndicator.md +0 -41
- package/data/packages/platform-core/api/Interface.IMappingBuilder.md +0 -76
- package/data/packages/platform-core/api/Interface.IMappingKey.md +0 -58
- package/data/packages/platform-core/api/Interface.IMappingProfile.md +0 -32
- package/data/packages/platform-core/api/Interface.IResourceManagerConfig.md +0 -89
- package/data/packages/platform-core/api/Interface.IResourceMetadata.md +0 -94
- package/data/packages/platform-core/api/Interface.IResourceResult.md +0 -34
- package/data/packages/platform-core/api/Interface.IResourceStrategy.md +0 -134
- package/data/packages/platform-core/api/Variable.HEALTH_INDICATORS_TOKEN.md +0 -14
- package/data/packages/platform-mailing/api/Class.BlobTemplateFetchStrategy.md +0 -60
- package/data/packages/platform-mailing/api/Class.FileTemplateFetchStrategy.md +0 -58
- package/data/packages/platform-mailing/api/Class.LogDeliveryStrategy.md +0 -71
- package/src/knowledge/configPattern.d.ts +0 -5
- package/src/knowledge/dtoPattern.d.ts +0 -5
- package/src/knowledge/errorHandlingPattern.d.ts +0 -5
- package/src/knowledge/guardPattern.d.ts +0 -5
- package/src/knowledge/mappingPattern.d.ts +0 -6
- package/src/knowledge/modulePattern.d.ts +0 -6
- package/src/knowledge/modulePattern.js +0 -283
- package/src/knowledge/queryPattern.d.ts +0 -6
- package/src/knowledge/queryPattern.js +0 -215
- package/src/knowledge/repositoryPattern.d.ts +0 -6
- package/src/knowledge/repositoryPattern.js +0 -367
- package/src/knowledge/testingPattern.d.ts +0 -5
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.registerGetQueryPatternTool = registerGetQueryPatternTool;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
|
-
const
|
|
5
|
+
const queryPatternGenerator_1 = require("../generators/queryPatternGenerator");
|
|
6
6
|
/**
|
|
7
7
|
* Registers the get-query-pattern tool on the MCP server.
|
|
8
8
|
*/
|
|
9
|
-
function registerGetQueryPatternTool(server) {
|
|
9
|
+
function registerGetQueryPatternTool(server, patternsLoader) {
|
|
10
10
|
server.tool('get-query-pattern', 'Returns the Archipel query pattern documentation — interfaces, factories, rules, and examples. Optionally tailored to a specific Prisma model.', {
|
|
11
11
|
modelName: zod_1.z
|
|
12
12
|
.string()
|
|
@@ -17,9 +17,10 @@ function registerGetQueryPatternTool(server) {
|
|
|
17
17
|
.optional()
|
|
18
18
|
.describe('Field names of the model (e.g. ["id", "email", "name", "createdAt"]). Used with modelName for tailored examples.'),
|
|
19
19
|
}, async (params) => {
|
|
20
|
-
|
|
20
|
+
const pattern = patternsLoader.patterns.get('query-pattern');
|
|
21
|
+
let content = pattern?.content ?? 'Query pattern documentation not available.';
|
|
21
22
|
if (params.modelName && params.fields && params.fields.length > 0) {
|
|
22
|
-
content += '\n\n' + (0,
|
|
23
|
+
content += '\n\n' + (0, queryPatternGenerator_1.QUERY_PATTERN_WITH_MODEL)(params.modelName, params.fields);
|
|
23
24
|
}
|
|
24
25
|
return {
|
|
25
26
|
content: [{ type: 'text', text: content }],
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
2
|
+
import type { PatternsLoader } from '../PatternsLoader';
|
|
2
3
|
/**
|
|
3
4
|
* Registers the get-repository-pattern tool on the MCP server.
|
|
4
5
|
*/
|
|
5
|
-
export declare function registerGetRepositoryPatternTool(server: McpServer): void;
|
|
6
|
+
export declare function registerGetRepositoryPatternTool(server: McpServer, patternsLoader: PatternsLoader): void;
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.registerGetRepositoryPatternTool = registerGetRepositoryPatternTool;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
|
-
const
|
|
5
|
+
const repositoryPatternGenerator_1 = require("../generators/repositoryPatternGenerator");
|
|
6
6
|
/**
|
|
7
7
|
* Registers the get-repository-pattern tool on the MCP server.
|
|
8
8
|
*/
|
|
9
|
-
function registerGetRepositoryPatternTool(server) {
|
|
9
|
+
function registerGetRepositoryPatternTool(server, patternsLoader) {
|
|
10
10
|
server.tool('get-repository-pattern', 'Returns the Archipel repository class pattern — how to create a RepositoryBase subclass with correct generics, module registration, and service injection. Optionally tailored to a specific Prisma model.', {
|
|
11
11
|
modelName: zod_1.z
|
|
12
12
|
.string()
|
|
@@ -17,9 +17,10 @@ function registerGetRepositoryPatternTool(server) {
|
|
|
17
17
|
.optional()
|
|
18
18
|
.describe('Field names of the model (e.g. ["id", "email", "name", "createdAt"]). Used with modelName for tailored examples.'),
|
|
19
19
|
}, async (params) => {
|
|
20
|
-
|
|
20
|
+
const pattern = patternsLoader.patterns.get('repository-pattern');
|
|
21
|
+
let content = pattern?.content ?? 'Repository pattern documentation not available.';
|
|
21
22
|
if (params.modelName && params.fields && params.fields.length > 0) {
|
|
22
|
-
content += '\n\n' + (0,
|
|
23
|
+
content += '\n\n' + (0, repositoryPatternGenerator_1.REPOSITORY_PATTERN_WITH_MODEL)(params.modelName, params.fields);
|
|
23
24
|
}
|
|
24
25
|
return {
|
|
25
26
|
content: [{ type: 'text', text: content }],
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
2
|
+
import type { PatternsLoader } from '../PatternsLoader';
|
|
2
3
|
/**
|
|
3
4
|
* Registers the get-testing-pattern tool on the MCP server.
|
|
4
5
|
*/
|
|
5
|
-
export declare function registerGetTestingPatternTool(server: McpServer): void;
|
|
6
|
+
export declare function registerGetTestingPatternTool(server: McpServer, patternsLoader: PatternsLoader): void;
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.registerGetTestingPatternTool = registerGetTestingPatternTool;
|
|
4
|
-
const testingPattern_1 = require("../knowledge/testingPattern");
|
|
5
4
|
/**
|
|
6
5
|
* Registers the get-testing-pattern tool on the MCP server.
|
|
7
6
|
*/
|
|
8
|
-
function registerGetTestingPatternTool(server) {
|
|
7
|
+
function registerGetTestingPatternTool(server, patternsLoader) {
|
|
9
8
|
server.tool('get-testing-pattern', 'Returns the Archipel testing pattern — Vitest conventions, mocking patterns for repositories/services/delegates, AAA structure, and test naming conventions.', {}, async () => {
|
|
9
|
+
const pattern = patternsLoader.patterns.get('testing-pattern');
|
|
10
|
+
const text = pattern?.content ?? 'Testing pattern documentation not available.';
|
|
10
11
|
return {
|
|
11
|
-
content: [{ type: 'text', text
|
|
12
|
+
content: [{ type: 'text', text }],
|
|
12
13
|
};
|
|
13
14
|
});
|
|
14
15
|
}
|
|
@@ -1,195 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: 'Class: BlobResourceStrategy'
|
|
3
|
-
generated: true
|
|
4
|
-
editUrl: false
|
|
5
|
-
---
|
|
6
|
-
# Class: BlobResourceStrategy
|
|
7
|
-
|
|
8
|
-
Defined in: [resources/strategies/BlobResourceStrategy.ts:51](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-core/src/resources/strategies/BlobResourceStrategy.ts#L51)
|
|
9
|
-
|
|
10
|
-
Strategy for loading resources from blob storage.
|
|
11
|
-
|
|
12
|
-
## Implements
|
|
13
|
-
|
|
14
|
-
- [`IResourceStrategy`](Interface.IResourceStrategy)
|
|
15
|
-
|
|
16
|
-
## Constructors
|
|
17
|
-
|
|
18
|
-
### Constructor
|
|
19
|
-
|
|
20
|
-
```ts
|
|
21
|
-
new BlobResourceStrategy(blobService, config?): BlobResourceStrategy;
|
|
22
|
-
```
|
|
23
|
-
|
|
24
|
-
Defined in: [resources/strategies/BlobResourceStrategy.ts:68](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-core/src/resources/strategies/BlobResourceStrategy.ts#L68)
|
|
25
|
-
|
|
26
|
-
Constructs a new instance of the `BlobResourceStrategy` class.
|
|
27
|
-
|
|
28
|
-
#### Parameters
|
|
29
|
-
|
|
30
|
-
| Parameter | Type |
|
|
31
|
-
| ------ | ------ |
|
|
32
|
-
| `blobService` | [`IBlobServiceAdapter`](Interface.IBlobServiceAdapter) |
|
|
33
|
-
| `config` | [`IBlobResourceStrategyConfig`](Interface.IBlobResourceStrategyConfig) |
|
|
34
|
-
|
|
35
|
-
#### Returns
|
|
36
|
-
|
|
37
|
-
`BlobResourceStrategy`
|
|
38
|
-
|
|
39
|
-
## Accessors
|
|
40
|
-
|
|
41
|
-
### name
|
|
42
|
-
|
|
43
|
-
#### Get Signature
|
|
44
|
-
|
|
45
|
-
```ts
|
|
46
|
-
get name(): string;
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
Defined in: [resources/strategies/BlobResourceStrategy.ts:77](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-core/src/resources/strategies/BlobResourceStrategy.ts#L77)
|
|
50
|
-
|
|
51
|
-
The unique name of this strategy.
|
|
52
|
-
|
|
53
|
-
##### Returns
|
|
54
|
-
|
|
55
|
-
`string`
|
|
56
|
-
|
|
57
|
-
The unique name of this strategy.
|
|
58
|
-
|
|
59
|
-
#### Implementation of
|
|
60
|
-
|
|
61
|
-
[`IResourceStrategy`](Interface.IResourceStrategy).[`name`](Interface.IResourceStrategy#name)
|
|
62
|
-
|
|
63
|
-
## Methods
|
|
64
|
-
|
|
65
|
-
### exists()
|
|
66
|
-
|
|
67
|
-
```ts
|
|
68
|
-
exists(key): boolean;
|
|
69
|
-
```
|
|
70
|
-
|
|
71
|
-
Defined in: [resources/strategies/BlobResourceStrategy.ts:143](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-core/src/resources/strategies/BlobResourceStrategy.ts#L143)
|
|
72
|
-
|
|
73
|
-
Checks if a resource exists without loading it.
|
|
74
|
-
Note: Blob storage is inherently async, so this delegates to existsAsync internally.
|
|
75
|
-
|
|
76
|
-
#### Parameters
|
|
77
|
-
|
|
78
|
-
| Parameter | Type | Description |
|
|
79
|
-
| ------ | ------ | ------ |
|
|
80
|
-
| `key` | `string` | The resource key |
|
|
81
|
-
|
|
82
|
-
#### Returns
|
|
83
|
-
|
|
84
|
-
`boolean`
|
|
85
|
-
|
|
86
|
-
True if the resource exists
|
|
87
|
-
|
|
88
|
-
#### Implementation of
|
|
89
|
-
|
|
90
|
-
[`IResourceStrategy`](Interface.IResourceStrategy).[`exists`](Interface.IResourceStrategy#exists)
|
|
91
|
-
|
|
92
|
-
***
|
|
93
|
-
|
|
94
|
-
### existsAsync()
|
|
95
|
-
|
|
96
|
-
```ts
|
|
97
|
-
existsAsync(key): Promise<boolean>;
|
|
98
|
-
```
|
|
99
|
-
|
|
100
|
-
Defined in: [resources/strategies/BlobResourceStrategy.ts:154](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-core/src/resources/strategies/BlobResourceStrategy.ts#L154)
|
|
101
|
-
|
|
102
|
-
Checks if a resource exists without loading it (asynchronous).
|
|
103
|
-
|
|
104
|
-
#### Parameters
|
|
105
|
-
|
|
106
|
-
| Parameter | Type | Description |
|
|
107
|
-
| ------ | ------ | ------ |
|
|
108
|
-
| `key` | `string` | The resource key |
|
|
109
|
-
|
|
110
|
-
#### Returns
|
|
111
|
-
|
|
112
|
-
`Promise`\<`boolean`\>
|
|
113
|
-
|
|
114
|
-
Promise resolving to true if the resource exists
|
|
115
|
-
|
|
116
|
-
#### Implementation of
|
|
117
|
-
|
|
118
|
-
[`IResourceStrategy`](Interface.IResourceStrategy).[`existsAsync`](Interface.IResourceStrategy#existsasync)
|
|
119
|
-
|
|
120
|
-
***
|
|
121
|
-
|
|
122
|
-
### load()
|
|
123
|
-
|
|
124
|
-
```ts
|
|
125
|
-
load(key): IResourceResult | undefined;
|
|
126
|
-
```
|
|
127
|
-
|
|
128
|
-
Defined in: [resources/strategies/BlobResourceStrategy.ts:93](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-core/src/resources/strategies/BlobResourceStrategy.ts#L93)
|
|
129
|
-
|
|
130
|
-
Loads a resource by its key.
|
|
131
|
-
Note: Blob storage is inherently async, so this delegates to loadAsync internally.
|
|
132
|
-
|
|
133
|
-
#### Parameters
|
|
134
|
-
|
|
135
|
-
| Parameter | Type | Description |
|
|
136
|
-
| ------ | ------ | ------ |
|
|
137
|
-
| `key` | `string` | The resource key |
|
|
138
|
-
|
|
139
|
-
#### Returns
|
|
140
|
-
|
|
141
|
-
[`IResourceResult`](Interface.IResourceResult) \| `undefined`
|
|
142
|
-
|
|
143
|
-
The resource result or undefined if not found
|
|
144
|
-
|
|
145
|
-
#### Implementation of
|
|
146
|
-
|
|
147
|
-
[`IResourceStrategy`](Interface.IResourceStrategy).[`load`](Interface.IResourceStrategy#load)
|
|
148
|
-
|
|
149
|
-
***
|
|
150
|
-
|
|
151
|
-
### loadAsync()
|
|
152
|
-
|
|
153
|
-
```ts
|
|
154
|
-
loadAsync(key): Promise<IResourceResult | undefined>;
|
|
155
|
-
```
|
|
156
|
-
|
|
157
|
-
Defined in: [resources/strategies/BlobResourceStrategy.ts:104](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-core/src/resources/strategies/BlobResourceStrategy.ts#L104)
|
|
158
|
-
|
|
159
|
-
Loads a resource by its key (asynchronous).
|
|
160
|
-
|
|
161
|
-
#### Parameters
|
|
162
|
-
|
|
163
|
-
| Parameter | Type | Description |
|
|
164
|
-
| ------ | ------ | ------ |
|
|
165
|
-
| `key` | `string` | The resource key |
|
|
166
|
-
|
|
167
|
-
#### Returns
|
|
168
|
-
|
|
169
|
-
`Promise`\<[`IResourceResult`](Interface.IResourceResult) \| `undefined`\>
|
|
170
|
-
|
|
171
|
-
Promise resolving to the resource result or undefined if not found
|
|
172
|
-
|
|
173
|
-
#### Implementation of
|
|
174
|
-
|
|
175
|
-
[`IResourceStrategy`](Interface.IResourceStrategy).[`loadAsync`](Interface.IResourceStrategy#loadasync)
|
|
176
|
-
|
|
177
|
-
***
|
|
178
|
-
|
|
179
|
-
### whatDoIHave()
|
|
180
|
-
|
|
181
|
-
```ts
|
|
182
|
-
whatDoIHave(): void;
|
|
183
|
-
```
|
|
184
|
-
|
|
185
|
-
Defined in: [resources/strategies/BlobResourceStrategy.ts:170](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-core/src/resources/strategies/BlobResourceStrategy.ts#L170)
|
|
186
|
-
|
|
187
|
-
List all files and folders in the base paths for debugging purposes.
|
|
188
|
-
|
|
189
|
-
#### Returns
|
|
190
|
-
|
|
191
|
-
`void`
|
|
192
|
-
|
|
193
|
-
#### Implementation of
|
|
194
|
-
|
|
195
|
-
[`IResourceStrategy`](Interface.IResourceStrategy).[`whatDoIHave`](Interface.IResourceStrategy#whatdoihave)
|
|
@@ -1,215 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: 'Class: EmbeddedResourceStrategy'
|
|
3
|
-
generated: true
|
|
4
|
-
editUrl: false
|
|
5
|
-
---
|
|
6
|
-
# Class: EmbeddedResourceStrategy
|
|
7
|
-
|
|
8
|
-
Defined in: [resources/strategies/EmbeddedResourceStrategy.ts:14](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-core/src/resources/strategies/EmbeddedResourceStrategy.ts#L14)
|
|
9
|
-
|
|
10
|
-
Strategy for loading embedded resources from memory.
|
|
11
|
-
|
|
12
|
-
## Implements
|
|
13
|
-
|
|
14
|
-
- [`IResourceStrategy`](Interface.IResourceStrategy)
|
|
15
|
-
|
|
16
|
-
## Constructors
|
|
17
|
-
|
|
18
|
-
### Constructor
|
|
19
|
-
|
|
20
|
-
```ts
|
|
21
|
-
new EmbeddedResourceStrategy(resources?): EmbeddedResourceStrategy;
|
|
22
|
-
```
|
|
23
|
-
|
|
24
|
-
Defined in: [resources/strategies/EmbeddedResourceStrategy.ts:30](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-core/src/resources/strategies/EmbeddedResourceStrategy.ts#L30)
|
|
25
|
-
|
|
26
|
-
Constructs a new instance of the `EmbeddedResourceStrategy` class.
|
|
27
|
-
|
|
28
|
-
#### Parameters
|
|
29
|
-
|
|
30
|
-
| Parameter | Type |
|
|
31
|
-
| ------ | ------ |
|
|
32
|
-
| `resources` | `Record`\<`string`, `string`\> |
|
|
33
|
-
|
|
34
|
-
#### Returns
|
|
35
|
-
|
|
36
|
-
`EmbeddedResourceStrategy`
|
|
37
|
-
|
|
38
|
-
## Accessors
|
|
39
|
-
|
|
40
|
-
### name
|
|
41
|
-
|
|
42
|
-
#### Get Signature
|
|
43
|
-
|
|
44
|
-
```ts
|
|
45
|
-
get name(): string;
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
Defined in: [resources/strategies/EmbeddedResourceStrategy.ts:38](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-core/src/resources/strategies/EmbeddedResourceStrategy.ts#L38)
|
|
49
|
-
|
|
50
|
-
The unique name of this strategy.
|
|
51
|
-
|
|
52
|
-
##### Returns
|
|
53
|
-
|
|
54
|
-
`string`
|
|
55
|
-
|
|
56
|
-
The unique name of this strategy.
|
|
57
|
-
|
|
58
|
-
#### Implementation of
|
|
59
|
-
|
|
60
|
-
[`IResourceStrategy`](Interface.IResourceStrategy).[`name`](Interface.IResourceStrategy#name)
|
|
61
|
-
|
|
62
|
-
## Methods
|
|
63
|
-
|
|
64
|
-
### exists()
|
|
65
|
-
|
|
66
|
-
```ts
|
|
67
|
-
exists(key): boolean;
|
|
68
|
-
```
|
|
69
|
-
|
|
70
|
-
Defined in: [resources/strategies/EmbeddedResourceStrategy.ts:94](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-core/src/resources/strategies/EmbeddedResourceStrategy.ts#L94)
|
|
71
|
-
|
|
72
|
-
Checks if a resource exists without loading it.
|
|
73
|
-
|
|
74
|
-
#### Parameters
|
|
75
|
-
|
|
76
|
-
| Parameter | Type | Description |
|
|
77
|
-
| ------ | ------ | ------ |
|
|
78
|
-
| `key` | `string` | The resource key |
|
|
79
|
-
|
|
80
|
-
#### Returns
|
|
81
|
-
|
|
82
|
-
`boolean`
|
|
83
|
-
|
|
84
|
-
True if the resource exists
|
|
85
|
-
|
|
86
|
-
#### Implementation of
|
|
87
|
-
|
|
88
|
-
[`IResourceStrategy`](Interface.IResourceStrategy).[`exists`](Interface.IResourceStrategy#exists)
|
|
89
|
-
|
|
90
|
-
***
|
|
91
|
-
|
|
92
|
-
### existsAsync()
|
|
93
|
-
|
|
94
|
-
```ts
|
|
95
|
-
existsAsync(key): Promise<boolean>;
|
|
96
|
-
```
|
|
97
|
-
|
|
98
|
-
Defined in: [resources/strategies/EmbeddedResourceStrategy.ts:105](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-core/src/resources/strategies/EmbeddedResourceStrategy.ts#L105)
|
|
99
|
-
|
|
100
|
-
Checks if a resource exists without loading it (asynchronous).
|
|
101
|
-
|
|
102
|
-
#### Parameters
|
|
103
|
-
|
|
104
|
-
| Parameter | Type | Description |
|
|
105
|
-
| ------ | ------ | ------ |
|
|
106
|
-
| `key` | `string` | The resource key |
|
|
107
|
-
|
|
108
|
-
#### Returns
|
|
109
|
-
|
|
110
|
-
`Promise`\<`boolean`\>
|
|
111
|
-
|
|
112
|
-
Promise resolving to true if the resource exists
|
|
113
|
-
|
|
114
|
-
#### Implementation of
|
|
115
|
-
|
|
116
|
-
[`IResourceStrategy`](Interface.IResourceStrategy).[`existsAsync`](Interface.IResourceStrategy#existsasync)
|
|
117
|
-
|
|
118
|
-
***
|
|
119
|
-
|
|
120
|
-
### load()
|
|
121
|
-
|
|
122
|
-
```ts
|
|
123
|
-
load(key): IResourceResult | undefined;
|
|
124
|
-
```
|
|
125
|
-
|
|
126
|
-
Defined in: [resources/strategies/EmbeddedResourceStrategy.ts:53](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-core/src/resources/strategies/EmbeddedResourceStrategy.ts#L53)
|
|
127
|
-
|
|
128
|
-
Loads a resource by its key.
|
|
129
|
-
|
|
130
|
-
#### Parameters
|
|
131
|
-
|
|
132
|
-
| Parameter | Type | Description |
|
|
133
|
-
| ------ | ------ | ------ |
|
|
134
|
-
| `key` | `string` | The resource key |
|
|
135
|
-
|
|
136
|
-
#### Returns
|
|
137
|
-
|
|
138
|
-
[`IResourceResult`](Interface.IResourceResult) \| `undefined`
|
|
139
|
-
|
|
140
|
-
The resource result or undefined if not found
|
|
141
|
-
|
|
142
|
-
#### Implementation of
|
|
143
|
-
|
|
144
|
-
[`IResourceStrategy`](Interface.IResourceStrategy).[`load`](Interface.IResourceStrategy#load)
|
|
145
|
-
|
|
146
|
-
***
|
|
147
|
-
|
|
148
|
-
### loadAsync()
|
|
149
|
-
|
|
150
|
-
```ts
|
|
151
|
-
loadAsync(key): Promise<IResourceResult | undefined>;
|
|
152
|
-
```
|
|
153
|
-
|
|
154
|
-
Defined in: [resources/strategies/EmbeddedResourceStrategy.ts:83](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-core/src/resources/strategies/EmbeddedResourceStrategy.ts#L83)
|
|
155
|
-
|
|
156
|
-
Loads a resource by its key (asynchronous).
|
|
157
|
-
|
|
158
|
-
#### Parameters
|
|
159
|
-
|
|
160
|
-
| Parameter | Type | Description |
|
|
161
|
-
| ------ | ------ | ------ |
|
|
162
|
-
| `key` | `string` | The resource key |
|
|
163
|
-
|
|
164
|
-
#### Returns
|
|
165
|
-
|
|
166
|
-
`Promise`\<[`IResourceResult`](Interface.IResourceResult) \| `undefined`\>
|
|
167
|
-
|
|
168
|
-
Promise resolving to the resource result or undefined if not found
|
|
169
|
-
|
|
170
|
-
#### Implementation of
|
|
171
|
-
|
|
172
|
-
[`IResourceStrategy`](Interface.IResourceStrategy).[`loadAsync`](Interface.IResourceStrategy#loadasync)
|
|
173
|
-
|
|
174
|
-
***
|
|
175
|
-
|
|
176
|
-
### register()
|
|
177
|
-
|
|
178
|
-
```ts
|
|
179
|
-
register(key, content): void;
|
|
180
|
-
```
|
|
181
|
-
|
|
182
|
-
Defined in: [resources/strategies/EmbeddedResourceStrategy.ts:116](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-core/src/resources/strategies/EmbeddedResourceStrategy.ts#L116)
|
|
183
|
-
|
|
184
|
-
Registers a new embedded resource.
|
|
185
|
-
|
|
186
|
-
#### Parameters
|
|
187
|
-
|
|
188
|
-
| Parameter | Type | Description |
|
|
189
|
-
| ------ | ------ | ------ |
|
|
190
|
-
| `key` | `string` | The resource key |
|
|
191
|
-
| `content` | `string` | The resource content |
|
|
192
|
-
|
|
193
|
-
#### Returns
|
|
194
|
-
|
|
195
|
-
`void`
|
|
196
|
-
|
|
197
|
-
***
|
|
198
|
-
|
|
199
|
-
### whatDoIHave()
|
|
200
|
-
|
|
201
|
-
```ts
|
|
202
|
-
whatDoIHave(): void;
|
|
203
|
-
```
|
|
204
|
-
|
|
205
|
-
Defined in: [resources/strategies/EmbeddedResourceStrategy.ts:125](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-core/src/resources/strategies/EmbeddedResourceStrategy.ts#L125)
|
|
206
|
-
|
|
207
|
-
List all files and folders in the base paths for debugging purposes.
|
|
208
|
-
|
|
209
|
-
#### Returns
|
|
210
|
-
|
|
211
|
-
`void`
|
|
212
|
-
|
|
213
|
-
#### Implementation of
|
|
214
|
-
|
|
215
|
-
[`IResourceStrategy`](Interface.IResourceStrategy).[`whatDoIHave`](Interface.IResourceStrategy#whatdoihave)
|
|
@@ -1,192 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: 'Class: FileResourceStrategy'
|
|
3
|
-
generated: true
|
|
4
|
-
editUrl: false
|
|
5
|
-
---
|
|
6
|
-
# Class: FileResourceStrategy
|
|
7
|
-
|
|
8
|
-
Defined in: [resources/strategies/FileResourceStrategy.ts:47](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-core/src/resources/strategies/FileResourceStrategy.ts#L47)
|
|
9
|
-
|
|
10
|
-
Strategy for loading resources from the local file system.
|
|
11
|
-
|
|
12
|
-
## Implements
|
|
13
|
-
|
|
14
|
-
- [`IResourceStrategy`](Interface.IResourceStrategy)
|
|
15
|
-
|
|
16
|
-
## Constructors
|
|
17
|
-
|
|
18
|
-
### Constructor
|
|
19
|
-
|
|
20
|
-
```ts
|
|
21
|
-
new FileResourceStrategy(config): FileResourceStrategy;
|
|
22
|
-
```
|
|
23
|
-
|
|
24
|
-
Defined in: [resources/strategies/FileResourceStrategy.ts:63](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-core/src/resources/strategies/FileResourceStrategy.ts#L63)
|
|
25
|
-
|
|
26
|
-
Constructs a new instance of the `FileResourceStrategy` class.
|
|
27
|
-
|
|
28
|
-
#### Parameters
|
|
29
|
-
|
|
30
|
-
| Parameter | Type |
|
|
31
|
-
| ------ | ------ |
|
|
32
|
-
| `config` | [`IFileResourceStrategyConfig`](Interface.IFileResourceStrategyConfig) |
|
|
33
|
-
|
|
34
|
-
#### Returns
|
|
35
|
-
|
|
36
|
-
`FileResourceStrategy`
|
|
37
|
-
|
|
38
|
-
## Accessors
|
|
39
|
-
|
|
40
|
-
### name
|
|
41
|
-
|
|
42
|
-
#### Get Signature
|
|
43
|
-
|
|
44
|
-
```ts
|
|
45
|
-
get name(): string;
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
Defined in: [resources/strategies/FileResourceStrategy.ts:75](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-core/src/resources/strategies/FileResourceStrategy.ts#L75)
|
|
49
|
-
|
|
50
|
-
The unique name of this strategy.
|
|
51
|
-
|
|
52
|
-
##### Returns
|
|
53
|
-
|
|
54
|
-
`string`
|
|
55
|
-
|
|
56
|
-
The unique name of this strategy.
|
|
57
|
-
|
|
58
|
-
#### Implementation of
|
|
59
|
-
|
|
60
|
-
[`IResourceStrategy`](Interface.IResourceStrategy).[`name`](Interface.IResourceStrategy#name)
|
|
61
|
-
|
|
62
|
-
## Methods
|
|
63
|
-
|
|
64
|
-
### exists()
|
|
65
|
-
|
|
66
|
-
```ts
|
|
67
|
-
exists(key): boolean;
|
|
68
|
-
```
|
|
69
|
-
|
|
70
|
-
Defined in: [resources/strategies/FileResourceStrategy.ts:138](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-core/src/resources/strategies/FileResourceStrategy.ts#L138)
|
|
71
|
-
|
|
72
|
-
Checks if a resource exists without loading it.
|
|
73
|
-
|
|
74
|
-
#### Parameters
|
|
75
|
-
|
|
76
|
-
| Parameter | Type | Description |
|
|
77
|
-
| ------ | ------ | ------ |
|
|
78
|
-
| `key` | `string` | The resource key |
|
|
79
|
-
|
|
80
|
-
#### Returns
|
|
81
|
-
|
|
82
|
-
`boolean`
|
|
83
|
-
|
|
84
|
-
True if the resource exists
|
|
85
|
-
|
|
86
|
-
#### Implementation of
|
|
87
|
-
|
|
88
|
-
[`IResourceStrategy`](Interface.IResourceStrategy).[`exists`](Interface.IResourceStrategy#exists)
|
|
89
|
-
|
|
90
|
-
***
|
|
91
|
-
|
|
92
|
-
### existsAsync()
|
|
93
|
-
|
|
94
|
-
```ts
|
|
95
|
-
existsAsync(key): Promise<boolean>;
|
|
96
|
-
```
|
|
97
|
-
|
|
98
|
-
Defined in: [resources/strategies/FileResourceStrategy.ts:149](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-core/src/resources/strategies/FileResourceStrategy.ts#L149)
|
|
99
|
-
|
|
100
|
-
Checks if a resource exists without loading it (asynchronous).
|
|
101
|
-
|
|
102
|
-
#### Parameters
|
|
103
|
-
|
|
104
|
-
| Parameter | Type | Description |
|
|
105
|
-
| ------ | ------ | ------ |
|
|
106
|
-
| `key` | `string` | The resource key |
|
|
107
|
-
|
|
108
|
-
#### Returns
|
|
109
|
-
|
|
110
|
-
`Promise`\<`boolean`\>
|
|
111
|
-
|
|
112
|
-
Promise resolving to true if the resource exists
|
|
113
|
-
|
|
114
|
-
#### Implementation of
|
|
115
|
-
|
|
116
|
-
[`IResourceStrategy`](Interface.IResourceStrategy).[`existsAsync`](Interface.IResourceStrategy#existsasync)
|
|
117
|
-
|
|
118
|
-
***
|
|
119
|
-
|
|
120
|
-
### load()
|
|
121
|
-
|
|
122
|
-
```ts
|
|
123
|
-
load(key): IResourceResult | undefined;
|
|
124
|
-
```
|
|
125
|
-
|
|
126
|
-
Defined in: [resources/strategies/FileResourceStrategy.ts:90](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-core/src/resources/strategies/FileResourceStrategy.ts#L90)
|
|
127
|
-
|
|
128
|
-
Loads a resource by its key.
|
|
129
|
-
|
|
130
|
-
#### Parameters
|
|
131
|
-
|
|
132
|
-
| Parameter | Type | Description |
|
|
133
|
-
| ------ | ------ | ------ |
|
|
134
|
-
| `key` | `string` | The resource key |
|
|
135
|
-
|
|
136
|
-
#### Returns
|
|
137
|
-
|
|
138
|
-
[`IResourceResult`](Interface.IResourceResult) \| `undefined`
|
|
139
|
-
|
|
140
|
-
The resource result or undefined if not found
|
|
141
|
-
|
|
142
|
-
#### Implementation of
|
|
143
|
-
|
|
144
|
-
[`IResourceStrategy`](Interface.IResourceStrategy).[`load`](Interface.IResourceStrategy#load)
|
|
145
|
-
|
|
146
|
-
***
|
|
147
|
-
|
|
148
|
-
### loadAsync()
|
|
149
|
-
|
|
150
|
-
```ts
|
|
151
|
-
loadAsync(key): Promise<IResourceResult | undefined>;
|
|
152
|
-
```
|
|
153
|
-
|
|
154
|
-
Defined in: [resources/strategies/FileResourceStrategy.ts:127](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-core/src/resources/strategies/FileResourceStrategy.ts#L127)
|
|
155
|
-
|
|
156
|
-
Loads a resource by its key (asynchronous).
|
|
157
|
-
|
|
158
|
-
#### Parameters
|
|
159
|
-
|
|
160
|
-
| Parameter | Type | Description |
|
|
161
|
-
| ------ | ------ | ------ |
|
|
162
|
-
| `key` | `string` | The resource key |
|
|
163
|
-
|
|
164
|
-
#### Returns
|
|
165
|
-
|
|
166
|
-
`Promise`\<[`IResourceResult`](Interface.IResourceResult) \| `undefined`\>
|
|
167
|
-
|
|
168
|
-
Promise resolving to the resource result or undefined if not found
|
|
169
|
-
|
|
170
|
-
#### Implementation of
|
|
171
|
-
|
|
172
|
-
[`IResourceStrategy`](Interface.IResourceStrategy).[`loadAsync`](Interface.IResourceStrategy#loadasync)
|
|
173
|
-
|
|
174
|
-
***
|
|
175
|
-
|
|
176
|
-
### whatDoIHave()
|
|
177
|
-
|
|
178
|
-
```ts
|
|
179
|
-
whatDoIHave(): void;
|
|
180
|
-
```
|
|
181
|
-
|
|
182
|
-
Defined in: [resources/strategies/FileResourceStrategy.ts:158](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-core/src/resources/strategies/FileResourceStrategy.ts#L158)
|
|
183
|
-
|
|
184
|
-
List all files and folders in the base paths for debugging purposes.
|
|
185
|
-
|
|
186
|
-
#### Returns
|
|
187
|
-
|
|
188
|
-
`void`
|
|
189
|
-
|
|
190
|
-
#### Implementation of
|
|
191
|
-
|
|
192
|
-
[`IResourceStrategy`](Interface.IResourceStrategy).[`whatDoIHave`](Interface.IResourceStrategy#whatdoihave)
|