@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.
Files changed (136) hide show
  1. package/data/guides/cryptography-and-otp.md +2 -2
  2. package/data/guides/database-setup.md +4 -3
  3. package/data/guides/email-templates.md +3 -3
  4. package/data/guides/getting-started.md +6 -6
  5. package/data/guides/resource-management.md +9 -9
  6. package/data/packages/platform-blob-storage/api/Variable.AWS_S3_PROVIDER_OPTIONS.md +1 -1
  7. package/data/packages/platform-blob-storage/api/Variable.AZURE_BLOB_PROVIDER_OPTIONS.md +1 -1
  8. package/data/packages/platform-blob-storage/api/Variable.BLOB_PROVIDER.md +1 -1
  9. package/data/packages/platform-blob-storage/api/Variable.VERCEL_BLOB_PROVIDER_OPTIONS.md +1 -1
  10. package/data/packages/platform-core/api/Class.ErrorTemplateService.md +1 -1
  11. package/data/packages/platform-core/api/Class.HostService.md +1 -1
  12. package/data/packages/platform-core/api/Variable.ID_GENERATOR_TOKEN.md +1 -1
  13. package/data/packages/platform-core/api/index.md +0 -27
  14. package/data/packages/platform-core/index.md +7 -4
  15. package/data/packages/platform-cryptography/api/Class.BcryptService.md +4 -4
  16. package/data/packages/platform-cryptography/api/Class.OtpService.md +6 -6
  17. package/data/packages/platform-cryptography/api/Variable.BCRYPT_OPTIONS.md +2 -2
  18. package/data/packages/platform-cryptography/api/Variable.MAX_BCRYPT_PASSWORD_BYTES.md +1 -1
  19. package/data/packages/platform-cryptography/api/Variable.MIN_BCRYPT_ROUNDS.md +1 -1
  20. package/data/packages/platform-cryptography/api/Variable.OTP_OPTIONS.md +2 -2
  21. package/data/packages/platform-cryptography/api/Variable.OTP_SERVICE_TOKEN.md +2 -2
  22. package/data/packages/platform-cryptography/api/Variable.TOTP_EPOCH_TOLERANCE.md +1 -1
  23. package/data/packages/platform-cryptography/api/index.md +3 -3
  24. package/data/packages/platform-documents/api/Class.BaseDocumentRenderer.md +32 -1
  25. package/data/packages/platform-documents/api/Class.DocumentEngine.md +4 -4
  26. package/data/packages/platform-documents/api/Class.DocumentModule.md +2 -2
  27. package/data/packages/platform-documents/api/Class.DocxDocumentRenderer2.md +333 -0
  28. package/data/packages/platform-documents/api/Class.PdfDocumentRenderer.md +355 -0
  29. package/data/packages/platform-documents/api/Interface.IDocumentModuleOptions.md +31 -5
  30. package/data/packages/platform-documents/api/Variable.DOCUMENT_MODULE_OPTIONS.md +1 -1
  31. package/data/packages/platform-documents/api/Variable.DOCUMENT_PARSER_TOKEN.md +1 -1
  32. package/data/packages/platform-documents/api/Variable.DOCUMENT_RENDERER_TOKEN.md +1 -1
  33. package/data/packages/platform-documents/api/Variable.IMAGE_PROCESSOR_TOKEN.md +1 -1
  34. package/data/packages/platform-documents/api/index.md +2 -0
  35. package/data/packages/platform-esigning/api/Class.EsigningClientPort.md +1 -1
  36. package/data/packages/platform-health/index.md +128 -0
  37. package/data/packages/platform-mailing/api/Class.DeliveryStrategyBase.md +0 -1
  38. package/data/packages/platform-mailing/api/Class.MailModule.md +1 -1
  39. package/data/packages/platform-mailing/api/Class.TemplateFetchStrategyBase.md +0 -5
  40. package/data/packages/platform-mailing/api/Variable.SMTP_CONFIG_ENTRIES.md +14 -0
  41. package/data/packages/platform-mailing/api/Variable.SMTP_HOST.md +14 -0
  42. package/data/packages/platform-mailing/api/Variable.SMTP_PASSWORD.md +14 -0
  43. package/data/packages/platform-mailing/api/Variable.SMTP_PORT.md +14 -0
  44. package/data/packages/platform-mailing/api/Variable.SMTP_SECURE.md +14 -0
  45. package/data/packages/platform-mailing/api/Variable.SMTP_USER.md +14 -0
  46. package/data/packages/platform-mailing/api/index.md +6 -3
  47. package/data/packages/platform-mapping/index.md +121 -0
  48. package/data/packages/platform-mcp/api/Variable.MCP_MODULE_OPTIONS.md +1 -1
  49. package/data/packages/platform-openapi/api/Class.SwaggerMultiDocumentService.md +4 -4
  50. package/data/packages/platform-resources/index.md +135 -0
  51. package/data/packages/platform-telemetry/api/Variable.TELEMETRY_ENABLED.md +1 -1
  52. package/data/packages/platform-telemetry/api/Variable.TELEMETRY_FACADE.md +1 -1
  53. package/data/packages/platform-telemetry/api/Variable.TELEMETRY_OPTIONS.md +1 -1
  54. package/{src/knowledge/configPattern.js → data/patterns/config-pattern.md} +44 -47
  55. package/{src/knowledge/dtoPattern.js → data/patterns/dto-pattern.md} +58 -61
  56. package/{src/knowledge/errorHandlingPattern.js → data/patterns/error-handling-pattern.md} +35 -38
  57. package/{src/knowledge/guardPattern.js → data/patterns/guard-pattern.md} +35 -38
  58. package/{src/knowledge/mappingPattern.js → data/patterns/mapping-pattern.md} +43 -144
  59. package/data/patterns/module-pattern.md +182 -0
  60. package/data/patterns/query-pattern.md +137 -0
  61. package/data/patterns/repository-pattern.md +208 -0
  62. package/{src/knowledge/testingPattern.js → data/patterns/testing-pattern.md} +37 -40
  63. package/package.json +1 -1
  64. package/src/PatternsLoader.d.ts +12 -0
  65. package/src/PatternsLoader.js +65 -0
  66. package/src/generators/mappingPatternGenerator.d.ts +5 -0
  67. package/src/generators/mappingPatternGenerator.js +107 -0
  68. package/src/generators/modulePatternGenerator.d.ts +5 -0
  69. package/src/generators/modulePatternGenerator.js +107 -0
  70. package/src/generators/queryPatternGenerator.d.ts +4 -0
  71. package/src/generators/queryPatternGenerator.js +83 -0
  72. package/src/generators/repositoryPatternGenerator.d.ts +5 -0
  73. package/src/generators/repositoryPatternGenerator.js +165 -0
  74. package/src/main.js +15 -9
  75. package/src/models/IPatternDoc.d.ts +15 -0
  76. package/src/models/IPatternDoc.js +3 -0
  77. package/src/tools/registerGetConfigPatternTool.d.ts +2 -1
  78. package/src/tools/registerGetConfigPatternTool.js +4 -3
  79. package/src/tools/registerGetDtoPatternTool.d.ts +2 -1
  80. package/src/tools/registerGetDtoPatternTool.js +4 -3
  81. package/src/tools/registerGetErrorHandlingPatternTool.d.ts +2 -1
  82. package/src/tools/registerGetErrorHandlingPatternTool.js +4 -3
  83. package/src/tools/registerGetGuardPatternTool.d.ts +2 -1
  84. package/src/tools/registerGetGuardPatternTool.js +4 -3
  85. package/src/tools/registerGetMappingPatternTool.d.ts +2 -1
  86. package/src/tools/registerGetMappingPatternTool.js +5 -4
  87. package/src/tools/registerGetModulePatternTool.d.ts +2 -1
  88. package/src/tools/registerGetModulePatternTool.js +5 -4
  89. package/src/tools/registerGetQueryPatternTool.d.ts +2 -1
  90. package/src/tools/registerGetQueryPatternTool.js +5 -4
  91. package/src/tools/registerGetRepositoryPatternTool.d.ts +2 -1
  92. package/src/tools/registerGetRepositoryPatternTool.js +5 -4
  93. package/src/tools/registerGetTestingPatternTool.d.ts +2 -1
  94. package/src/tools/registerGetTestingPatternTool.js +4 -3
  95. package/data/packages/platform-core/api/Class.BlobResourceStrategy.md +0 -195
  96. package/data/packages/platform-core/api/Class.EmbeddedResourceStrategy.md +0 -215
  97. package/data/packages/platform-core/api/Class.FileResourceStrategy.md +0 -192
  98. package/data/packages/platform-core/api/Class.HealthModule.md +0 -42
  99. package/data/packages/platform-core/api/Class.HealthOrchestrator.md +0 -64
  100. package/data/packages/platform-core/api/Class.MappingBuilder.md +0 -110
  101. package/data/packages/platform-core/api/Class.MappingModule.md +0 -46
  102. package/data/packages/platform-core/api/Class.MappingNotRegisteredError.md +0 -56
  103. package/data/packages/platform-core/api/Class.MappingProfileBase.md +0 -52
  104. package/data/packages/platform-core/api/Class.MappingService.md +0 -284
  105. package/data/packages/platform-core/api/Class.ResourceManager.md +0 -565
  106. package/data/packages/platform-core/api/Class.ResourceModule.md +0 -46
  107. package/data/packages/platform-core/api/Class.TypeMappingNotRegisteredError.md +0 -57
  108. package/data/packages/platform-core/api/Function.createMappingKey.md +0 -39
  109. package/data/packages/platform-core/api/Interface.IBlobResourceStrategyConfig.md +0 -28
  110. package/data/packages/platform-core/api/Interface.IBlobServiceAdapter.md +0 -40
  111. package/data/packages/platform-core/api/Interface.IFileResourceStrategyConfig.md +0 -72
  112. package/data/packages/platform-core/api/Interface.IHealthCheckResult.md +0 -46
  113. package/data/packages/platform-core/api/Interface.IHealthIndicator.md +0 -41
  114. package/data/packages/platform-core/api/Interface.IMappingBuilder.md +0 -76
  115. package/data/packages/platform-core/api/Interface.IMappingKey.md +0 -58
  116. package/data/packages/platform-core/api/Interface.IMappingProfile.md +0 -32
  117. package/data/packages/platform-core/api/Interface.IResourceManagerConfig.md +0 -89
  118. package/data/packages/platform-core/api/Interface.IResourceMetadata.md +0 -94
  119. package/data/packages/platform-core/api/Interface.IResourceResult.md +0 -34
  120. package/data/packages/platform-core/api/Interface.IResourceStrategy.md +0 -134
  121. package/data/packages/platform-core/api/Variable.HEALTH_INDICATORS_TOKEN.md +0 -14
  122. package/data/packages/platform-mailing/api/Class.BlobTemplateFetchStrategy.md +0 -60
  123. package/data/packages/platform-mailing/api/Class.FileTemplateFetchStrategy.md +0 -58
  124. package/data/packages/platform-mailing/api/Class.LogDeliveryStrategy.md +0 -71
  125. package/src/knowledge/configPattern.d.ts +0 -5
  126. package/src/knowledge/dtoPattern.d.ts +0 -5
  127. package/src/knowledge/errorHandlingPattern.d.ts +0 -5
  128. package/src/knowledge/guardPattern.d.ts +0 -5
  129. package/src/knowledge/mappingPattern.d.ts +0 -6
  130. package/src/knowledge/modulePattern.d.ts +0 -6
  131. package/src/knowledge/modulePattern.js +0 -283
  132. package/src/knowledge/queryPattern.d.ts +0 -6
  133. package/src/knowledge/queryPattern.js +0 -215
  134. package/src/knowledge/repositoryPattern.d.ts +0 -6
  135. package/src/knowledge/repositoryPattern.js +0 -367
  136. package/src/knowledge/testingPattern.d.ts +0 -5
@@ -1,42 +0,0 @@
1
- ---
2
- title: 'Class: HealthModule'
3
- generated: true
4
- editUrl: false
5
- ---
6
- # Class: HealthModule
7
-
8
- Defined in: [health/HealthModule.ts:21](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-core/src/health/HealthModule.ts#L21)
9
-
10
- ## Constructors
11
-
12
- ### Constructor
13
-
14
- ```ts
15
- new HealthModule(): HealthModule;
16
- ```
17
-
18
- #### Returns
19
-
20
- `HealthModule`
21
-
22
- ## Methods
23
-
24
- ### withIndicators()
25
-
26
- ```ts
27
- static withIndicators(indicators): DynamicModule;
28
- ```
29
-
30
- Defined in: [health/HealthModule.ts:28](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-core/src/health/HealthModule.ts#L28)
31
-
32
- Registers additional health indicators.
33
-
34
- #### Parameters
35
-
36
- | Parameter | Type | Description |
37
- | ------ | ------ | ------ |
38
- | `indicators` | `Type`\<[`IHealthIndicator`](Interface.IHealthIndicator)\>[] | Array of indicator classes implementing IHealthIndicator |
39
-
40
- #### Returns
41
-
42
- `DynamicModule`
@@ -1,64 +0,0 @@
1
- ---
2
- title: 'Class: HealthOrchestrator'
3
- generated: true
4
- editUrl: false
5
- ---
6
- # Class: HealthOrchestrator
7
-
8
- Defined in: [health/HealthOrchestrator.ts:15](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-core/src/health/HealthOrchestrator.ts#L15)
9
-
10
- Orchestrates execution of all registered health indicators and aggregates their results.
11
-
12
- ## Constructors
13
-
14
- ### Constructor
15
-
16
- ```ts
17
- new HealthOrchestrator(): HealthOrchestrator;
18
- ```
19
-
20
- Defined in: [health/HealthOrchestrator.ts:27](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-core/src/health/HealthOrchestrator.ts#L27)
21
-
22
- #### Returns
23
-
24
- `HealthOrchestrator`
25
-
26
- ## Methods
27
-
28
- ### check()
29
-
30
- ```ts
31
- check(): Promise<IHealthCheckResult[]>;
32
- ```
33
-
34
- Defined in: [health/HealthOrchestrator.ts:67](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-core/src/health/HealthOrchestrator.ts#L67)
35
-
36
- Executes all registered health indicators and aggregates their results.
37
-
38
- #### Returns
39
-
40
- `Promise`\<[`IHealthCheckResult`](Interface.IHealthCheckResult)[]\>
41
-
42
- The aggregated health check results.
43
-
44
- ***
45
-
46
- ### registerIndicator()
47
-
48
- ```ts
49
- registerIndicator(indicator): void;
50
- ```
51
-
52
- Defined in: [health/HealthOrchestrator.ts:41](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-core/src/health/HealthOrchestrator.ts#L41)
53
-
54
- Registers a health indicator.
55
-
56
- #### Parameters
57
-
58
- | Parameter | Type | Description |
59
- | ------ | ------ | ------ |
60
- | `indicator` | [`IHealthIndicator`](Interface.IHealthIndicator) | The health indicator to register. |
61
-
62
- #### Returns
63
-
64
- `void`
@@ -1,110 +0,0 @@
1
- ---
2
- title: 'Class: MappingBuilder'
3
- generated: true
4
- editUrl: false
5
- ---
6
- # Class: MappingBuilder
7
-
8
- Defined in: [mapping/builder/MappingBuilder.ts:15](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-core/src/mapping/builder/MappingBuilder.ts#L15)
9
-
10
- A mapping builder that uses the mapping service to register maps.
11
-
12
- ## Implements
13
-
14
- - [`IMappingBuilder`](Interface.IMappingBuilder)
15
-
16
- ## Constructors
17
-
18
- ### Constructor
19
-
20
- ```ts
21
- new MappingBuilder(service): MappingBuilder;
22
- ```
23
-
24
- Defined in: [mapping/builder/MappingBuilder.ts:31](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-core/src/mapping/builder/MappingBuilder.ts#L31)
25
-
26
- Constructs a new instance of the `MappingBuilder` class.
27
-
28
- #### Parameters
29
-
30
- | Parameter | Type |
31
- | ------ | ------ |
32
- | `service` | [`MappingService`](Class.MappingService) |
33
-
34
- #### Returns
35
-
36
- `MappingBuilder`
37
-
38
- ## Methods
39
-
40
- ### createKeyedMap()
41
-
42
- ```ts
43
- createKeyedMap<TInput, TOutput>(key, fn): this;
44
- ```
45
-
46
- Defined in: [mapping/builder/MappingBuilder.ts:68](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-core/src/mapping/builder/MappingBuilder.ts#L68)
47
-
48
- Creates a keyed mapping between two types with full type safety.
49
- The mapping key encodes both input and output types at compile time.
50
-
51
- #### Type Parameters
52
-
53
- | Type Parameter |
54
- | ------ |
55
- | `TInput` |
56
- | `TOutput` |
57
-
58
- #### Parameters
59
-
60
- | Parameter | Type | Description |
61
- | ------ | ------ | ------ |
62
- | `key` | [`IMappingKey`](Interface.IMappingKey)\<`TInput`, `TOutput`\> | The type-safe mapping key. |
63
- | `fn` | (`source`) => `TOutput` | The mapping function. |
64
-
65
- #### Returns
66
-
67
- `this`
68
-
69
- #### Implementation of
70
-
71
- [`IMappingBuilder`](Interface.IMappingBuilder).[`createKeyedMap`](Interface.IMappingBuilder#createkeyedmap)
72
-
73
- ***
74
-
75
- ### createMap()
76
-
77
- ```ts
78
- createMap<TSource, TDestination>(
79
- source,
80
- destination,
81
- fn): this;
82
- ```
83
-
84
- Defined in: [mapping/builder/MappingBuilder.ts:50](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-core/src/mapping/builder/MappingBuilder.ts#L50)
85
-
86
- Creates a mapping between two types.
87
- Enforces compile-time type compatibility check.
88
-
89
- #### Type Parameters
90
-
91
- | Type Parameter |
92
- | ------ |
93
- | `TSource` |
94
- | `TDestination` |
95
-
96
- #### Parameters
97
-
98
- | Parameter | Type | Description |
99
- | ------ | ------ | ------ |
100
- | `source` | `Constructor`\<`TSource`\> | The source type. |
101
- | `destination` | `Constructor`\<`TDestination`\> | The destination type. |
102
- | `fn` | (`source`) => `TDestination` | The mapping function. |
103
-
104
- #### Returns
105
-
106
- `this`
107
-
108
- #### Implementation of
109
-
110
- [`IMappingBuilder`](Interface.IMappingBuilder).[`createMap`](Interface.IMappingBuilder#createmap)
@@ -1,46 +0,0 @@
1
- ---
2
- title: 'Class: MappingModule'
3
- generated: true
4
- editUrl: false
5
- ---
6
- # Class: MappingModule
7
-
8
- Defined in: [mapping/MappingModule.ts:23](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-core/src/mapping/MappingModule.ts#L23)
9
-
10
- Module that provides mapping services and allows registration of mapping profiles.
11
-
12
- ## Constructors
13
-
14
- ### Constructor
15
-
16
- ```ts
17
- new MappingModule(): MappingModule;
18
- ```
19
-
20
- #### Returns
21
-
22
- `MappingModule`
23
-
24
- ## Methods
25
-
26
- ### withProfiles()
27
-
28
- ```ts
29
- static withProfiles(profiles): DynamicModule;
30
- ```
31
-
32
- Defined in: [mapping/MappingModule.ts:32](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-core/src/mapping/MappingModule.ts#L32)
33
-
34
- Configures the module with the given mapping profiles.
35
-
36
- #### Parameters
37
-
38
- | Parameter | Type | Description |
39
- | ------ | ------ | ------ |
40
- | `profiles` | `Type`\<[`IMappingProfile`](Interface.IMappingProfile)\>[] | An array of mapping profile types to register. |
41
-
42
- #### Returns
43
-
44
- `DynamicModule`
45
-
46
- A dynamic module with the specified profiles registered.
@@ -1,56 +0,0 @@
1
- ---
2
- title: 'Class: MappingNotRegisteredError'
3
- generated: true
4
- editUrl: false
5
- ---
6
- # Class: MappingNotRegisteredError
7
-
8
- Defined in: [mapping/errors/MappingNotRegisteredError.ts:12](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-core/src/mapping/errors/MappingNotRegisteredError.ts#L12)
9
-
10
- Thrown when a keyed mapping is requested but not registered.
11
-
12
- ## Extends
13
-
14
- - `MappingError`
15
-
16
- ## Constructors
17
-
18
- ### Constructor
19
-
20
- ```ts
21
- new MappingNotRegisteredError(key): MappingNotRegisteredError;
22
- ```
23
-
24
- Defined in: [mapping/errors/MappingNotRegisteredError.ts:16](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-core/src/mapping/errors/MappingNotRegisteredError.ts#L16)
25
-
26
- #### Parameters
27
-
28
- | Parameter | Type |
29
- | ------ | ------ |
30
- | `key` | `string` |
31
-
32
- #### Returns
33
-
34
- `MappingNotRegisteredError`
35
-
36
- #### Overrides
37
-
38
- ```ts
39
- MappingError.constructor
40
- ```
41
-
42
- ## Properties
43
-
44
- ### code
45
-
46
- ```ts
47
- readonly code: string;
48
- ```
49
-
50
- Defined in: [mapping/errors/MappingError.ts:11](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-core/src/mapping/errors/MappingError.ts#L11)
51
-
52
- #### Inherited from
53
-
54
- ```ts
55
- MappingError.code
56
- ```
@@ -1,52 +0,0 @@
1
- ---
2
- title: 'Abstract Class: MappingProfileBase'
3
- generated: true
4
- editUrl: false
5
- ---
6
- # Abstract Class: MappingProfileBase
7
-
8
- Defined in: [mapping/profile/MappingProfileBase.ts:13](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-core/src/mapping/profile/MappingProfileBase.ts#L13)
9
-
10
- Base class for mapping profiles to simplify implementation.
11
-
12
- ## Implements
13
-
14
- - [`IMappingProfile`](Interface.IMappingProfile)
15
-
16
- ## Constructors
17
-
18
- ### Constructor
19
-
20
- ```ts
21
- new MappingProfileBase(): MappingProfileBase;
22
- ```
23
-
24
- #### Returns
25
-
26
- `MappingProfileBase`
27
-
28
- ## Methods
29
-
30
- ### configure()
31
-
32
- ```ts
33
- abstract configure(builder): void;
34
- ```
35
-
36
- Defined in: [mapping/profile/MappingProfileBase.ts:25](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-core/src/mapping/profile/MappingProfileBase.ts#L25)
37
-
38
- Configures the mapping profile.
39
-
40
- #### Parameters
41
-
42
- | Parameter | Type | Description |
43
- | ------ | ------ | ------ |
44
- | `builder` | [`IMappingBuilder`](Interface.IMappingBuilder) | The mapping builder. |
45
-
46
- #### Returns
47
-
48
- `void`
49
-
50
- #### Implementation of
51
-
52
- [`IMappingProfile`](Interface.IMappingProfile).[`configure`](Interface.IMappingProfile#configure)
@@ -1,284 +0,0 @@
1
- ---
2
- title: 'Class: MappingService'
3
- generated: true
4
- editUrl: false
5
- ---
6
- # Class: MappingService
7
-
8
- Defined in: [mapping/MappingService.ts:19](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-core/src/mapping/MappingService.ts#L19)
9
-
10
- Central mapping registry supporting keyed & type-based mappings.
11
-
12
- ## Constructors
13
-
14
- ### Constructor
15
-
16
- ```ts
17
- new MappingService(): MappingService;
18
- ```
19
-
20
- Defined in: [mapping/MappingService.ts:37](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-core/src/mapping/MappingService.ts#L37)
21
-
22
- Constructs a new instance of the `MappingService` class.
23
-
24
- #### Returns
25
-
26
- `MappingService`
27
-
28
- ## Methods
29
-
30
- ### map()
31
-
32
- ```ts
33
- map<TInput, TOutput>(key, source): TOutput;
34
- ```
35
-
36
- Defined in: [mapping/MappingService.ts:96](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-core/src/mapping/MappingService.ts#L96)
37
-
38
- Maps a source object to a destination type using a type-safe mapping key.
39
- The key encodes both input and output types, ensuring compile-time type safety.
40
-
41
- #### Type Parameters
42
-
43
- | Type Parameter |
44
- | ------ |
45
- | `TInput` |
46
- | `TOutput` |
47
-
48
- #### Parameters
49
-
50
- | Parameter | Type | Description |
51
- | ------ | ------ | ------ |
52
- | `key` | [`IMappingKey`](Interface.IMappingKey)\<`TInput`, `TOutput`\> | The type-safe mapping key. |
53
- | `source` | `TInput` | The source object to map. |
54
-
55
- #### Returns
56
-
57
- `TOutput`
58
-
59
- The mapped destination object.
60
-
61
- #### Example
62
-
63
- ```typescript
64
- const response = this._mappingService.map(PRODUCT_MAPPING_KEY, productInput);
65
- // response is automatically typed as ProductResponse
66
- ```
67
-
68
- ***
69
-
70
- ### mapTypes()
71
-
72
- ```ts
73
- mapTypes<TSource, TDestination>(source, destination): TDestination;
74
- ```
75
-
76
- Defined in: [mapping/MappingService.ts:126](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-core/src/mapping/MappingService.ts#L126)
77
-
78
- Maps a source object to a destination type using a registered mapping function.
79
-
80
- #### Type Parameters
81
-
82
- | Type Parameter |
83
- | ------ |
84
- | `TSource` |
85
- | `TDestination` |
86
-
87
- #### Parameters
88
-
89
- | Parameter | Type | Description |
90
- | ------ | ------ | ------ |
91
- | `source` | `TSource` | The source object to map. |
92
- | `destination` | `Constructor`\<`TDestination`\> | The constructor of the destination type. |
93
-
94
- #### Returns
95
-
96
- `TDestination`
97
-
98
- The mapped destination object.
99
-
100
- ***
101
-
102
- ### mapTypesArray()
103
-
104
- ```ts
105
- mapTypesArray<TSource, TDestination>(sources, destination): TDestination[];
106
- ```
107
-
108
- Defined in: [mapping/MappingService.ts:155](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-core/src/mapping/MappingService.ts#L155)
109
-
110
- Maps an array of source objects to an array of destination types using a registered mapping function.
111
-
112
- #### Type Parameters
113
-
114
- | Type Parameter |
115
- | ------ |
116
- | `TSource` |
117
- | `TDestination` |
118
-
119
- #### Parameters
120
-
121
- | Parameter | Type | Description |
122
- | ------ | ------ | ------ |
123
- | `sources` | `TSource`[] | The array of source objects to map. |
124
- | `destination` | `Constructor`\<`TDestination`\> | The constructor of the destination type. |
125
-
126
- #### Returns
127
-
128
- `TDestination`[]
129
-
130
- The array of mapped destination objects.
131
-
132
- ***
133
-
134
- ### register()
135
-
136
- ```ts
137
- register<TSource, TDestination>(key, fn): void;
138
- ```
139
-
140
- Defined in: [mapping/MappingService.ts:55](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-core/src/mapping/MappingService.ts#L55)
141
-
142
- Registers a mapping function for a specific key.
143
-
144
- #### Type Parameters
145
-
146
- | Type Parameter |
147
- | ------ |
148
- | `TSource` |
149
- | `TDestination` |
150
-
151
- #### Parameters
152
-
153
- | Parameter | Type | Description |
154
- | ------ | ------ | ------ |
155
- | `key` | `string` | The unique key for the mapping. |
156
- | `fn` | (`source`) => `TDestination` | The mapping function. |
157
-
158
- #### Returns
159
-
160
- `void`
161
-
162
- void
163
-
164
- ***
165
-
166
- ### registerMap()
167
-
168
- ```ts
169
- registerMap<TSource, TDestination>(
170
- source,
171
- destination,
172
- fn): void;
173
- ```
174
-
175
- Defined in: [mapping/MappingService.ts:72](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-core/src/mapping/MappingService.ts#L72)
176
-
177
- Registers a mapping function for a specific source and destination type.
178
-
179
- #### Type Parameters
180
-
181
- | Type Parameter |
182
- | ------ |
183
- | `TSource` |
184
- | `TDestination` |
185
-
186
- #### Parameters
187
-
188
- | Parameter | Type | Description |
189
- | ------ | ------ | ------ |
190
- | `source` | `Constructor`\<`TSource`\> | The constructor of the source type. |
191
- | `destination` | `Constructor`\<`TDestination`\> | The constructor of the destination type. |
192
- | `fn` | (`source`) => `TDestination` | The mapping function. |
193
-
194
- #### Returns
195
-
196
- `void`
197
-
198
- void
199
-
200
- ***
201
-
202
- ### registerProfile()
203
-
204
- ```ts
205
- registerProfile(profile): void;
206
- ```
207
-
208
- Defined in: [mapping/MappingService.ts:166](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-core/src/mapping/MappingService.ts#L166)
209
-
210
- Registers a mapping profile containing multiple mappings.
211
-
212
- #### Parameters
213
-
214
- | Parameter | Type | Description |
215
- | ------ | ------ | ------ |
216
- | `profile` | [`IMappingProfile`](Interface.IMappingProfile) | The mapping profile to register. |
217
-
218
- #### Returns
219
-
220
- `void`
221
-
222
- void
223
-
224
- ***
225
-
226
- ### tryMap()
227
-
228
- ```ts
229
- tryMap<TInput, TOutput>(key, source): TOutput | undefined;
230
- ```
231
-
232
- Defined in: [mapping/MappingService.ts:112](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-core/src/mapping/MappingService.ts#L112)
233
-
234
- Attempts to map returning undefined instead of throwing when mapping is absent.
235
-
236
- #### Type Parameters
237
-
238
- | Type Parameter |
239
- | ------ |
240
- | `TInput` |
241
- | `TOutput` |
242
-
243
- #### Parameters
244
-
245
- | Parameter | Type | Description |
246
- | ------ | ------ | ------ |
247
- | `key` | [`IMappingKey`](Interface.IMappingKey)\<`TInput`, `TOutput`\> | The type-safe mapping key. |
248
- | `source` | `TInput` | The source object to map. |
249
-
250
- #### Returns
251
-
252
- `TOutput` \| `undefined`
253
-
254
- The mapped destination object or undefined if no mapping exists.
255
-
256
- ***
257
-
258
- ### tryMapTypes()
259
-
260
- ```ts
261
- tryMapTypes<TSource, TDestination>(source, destination): TDestination | undefined;
262
- ```
263
-
264
- Defined in: [mapping/MappingService.ts:139](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-core/src/mapping/MappingService.ts#L139)
265
-
266
- Safe variant of [mapTypes](#maptypes) that returns undefined if not registered.
267
-
268
- #### Type Parameters
269
-
270
- | Type Parameter |
271
- | ------ |
272
- | `TSource` |
273
- | `TDestination` |
274
-
275
- #### Parameters
276
-
277
- | Parameter | Type |
278
- | ------ | ------ |
279
- | `source` | `TSource` |
280
- | `destination` | `Constructor`\<`TDestination`\> |
281
-
282
- #### Returns
283
-
284
- `TDestination` \| `undefined`