@reventlessdev/reventless-infra 3.0.0-alpha.100

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 (78) hide show
  1. package/CHANGELOG.md +853 -0
  2. package/LICENSE +202 -0
  3. package/README.md +92 -0
  4. package/package.json +46 -0
  5. package/rescript.json +34 -0
  6. package/src/adapter/Adapter.res +88 -0
  7. package/src/adapter/Adapter.res.mjs +29 -0
  8. package/src/components/Aggregate.res +73 -0
  9. package/src/components/Aggregate.res.mjs +2 -0
  10. package/src/components/Api.res +120 -0
  11. package/src/components/Api.res.mjs +31 -0
  12. package/src/components/Api_Adapter.res +29 -0
  13. package/src/components/Api_Adapter.res.mjs +2 -0
  14. package/src/components/AutomationSlice.res +48 -0
  15. package/src/components/AutomationSlice.res.mjs +2 -0
  16. package/src/components/CommandGenerator.res +8 -0
  17. package/src/components/CommandGenerator.res.mjs +2 -0
  18. package/src/components/CommandTopic.res +70 -0
  19. package/src/components/CommandTopic.res.mjs +2 -0
  20. package/src/components/Component.js +56 -0
  21. package/src/components/Component.mjs +10 -0
  22. package/src/components/Component.res +90 -0
  23. package/src/components/Component.res.mjs +57 -0
  24. package/src/components/Component.resi +21 -0
  25. package/src/components/Counter.res +81 -0
  26. package/src/components/Counter.res.mjs +2 -0
  27. package/src/components/DcbEventLog.res +130 -0
  28. package/src/components/DcbEventLog.res.mjs +2 -0
  29. package/src/components/DeployBootstrap.res +83 -0
  30. package/src/components/DeployBootstrap.res.mjs +69 -0
  31. package/src/components/EventCollector.res +19 -0
  32. package/src/components/EventCollector.res.mjs +2 -0
  33. package/src/components/EventLog.res +24 -0
  34. package/src/components/EventLog.res.mjs +2 -0
  35. package/src/components/EventMapper.res +37 -0
  36. package/src/components/EventMapper.res.mjs +2 -0
  37. package/src/components/EventTopic.res +51 -0
  38. package/src/components/EventTopic.res.mjs +2 -0
  39. package/src/components/Extension.res +64 -0
  40. package/src/components/Extension.res.mjs +2 -0
  41. package/src/components/ExtensionPoint.res +62 -0
  42. package/src/components/ExtensionPoint.res.mjs +2 -0
  43. package/src/components/Heartbeat.res +7 -0
  44. package/src/components/Heartbeat.res.mjs +2 -0
  45. package/src/components/InboundTranslationSlice.res +41 -0
  46. package/src/components/InboundTranslationSlice.res.mjs +2 -0
  47. package/src/components/OutboundTranslationSlice.res +44 -0
  48. package/src/components/OutboundTranslationSlice.res.mjs +2 -0
  49. package/src/components/Plugin.res +93 -0
  50. package/src/components/Plugin.res.mjs +2 -0
  51. package/src/components/QueryDb.res +48 -0
  52. package/src/components/QueryDb.res.mjs +33 -0
  53. package/src/components/ReadModel.res +56 -0
  54. package/src/components/ReadModel.res.mjs +2 -0
  55. package/src/components/Scheduler.res +32 -0
  56. package/src/components/Scheduler.res.mjs +2 -0
  57. package/src/components/StateChangeSlice.res +45 -0
  58. package/src/components/StateChangeSlice.res.mjs +2 -0
  59. package/src/components/StateViewSlice.res +38 -0
  60. package/src/components/StateViewSlice.res.mjs +2 -0
  61. package/src/components/Task.res +89 -0
  62. package/src/components/Task.res.mjs +2 -0
  63. package/src/types/ExtensionMapping.res +448 -0
  64. package/src/types/ExtensionMapping.res.mjs +252 -0
  65. package/src/types/ExtensionPointMapping.res +303 -0
  66. package/src/types/ExtensionPointMapping.res.mjs +116 -0
  67. package/src/types/Message.res +3 -0
  68. package/src/types/Message.res.mjs +2 -0
  69. package/src/types/NoEventMappings.res +25 -0
  70. package/src/types/NoEventMappings.res.mjs +17 -0
  71. package/src/types/Platform.res +269 -0
  72. package/src/types/Platform.res.mjs +2 -0
  73. package/src/types/PluginExtensionPointSpec.res +55 -0
  74. package/src/types/PluginExtensionPointSpec.res.mjs +209 -0
  75. package/src/types/ResourceNaming.res +12 -0
  76. package/src/types/ResourceNaming.res.mjs +2 -0
  77. package/tests/DeployBootstrapTest.res +72 -0
  78. package/tests/DeployBootstrapTest.res.mjs +100 -0
package/LICENSE ADDED
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright 2019-2026 Martin Lorenz
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
package/README.md ADDED
@@ -0,0 +1,92 @@
1
+ [![npm](https://img.shields.io/npm/v/@reventlessdev/reventless-infra.svg?label=npm)](https://www.npmjs.com/package/@reventlessdev/reventless-infra)
2
+ [![License: Apache-2.0](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
3
+ [![Docs](https://img.shields.io/badge/docs-reventless.dev-blue)](https://docs.reventless.dev)
4
+
5
+ # @reventlessdev/reventless-infra
6
+
7
+ > ⚠️ **Alpha.** APIs and on-disk formats can change without notice between releases.
8
+ > Pin exact versions and expect breaking changes.
9
+
10
+ The **infrastructure type layer** of [Reventless](https://docs.reventless.dev) — a
11
+ spec-driven, event-sourced CQRS framework written in [ReScript](https://rescript-lang.org).
12
+ This package defines the deploy-time infrastructure types and abstract `Platform` interface
13
+ that are shared across storage/cloud adapters, so plugin-assembly code can be written once
14
+ against provider-agnostic types and satisfied by any concrete adapter. It uses
15
+ [Pulumi](https://www.pulumi.com) types for deploy-time resource references. Modules are
16
+ exposed under the `ReventlessInfra` namespace.
17
+
18
+ ## What it provides
19
+
20
+ ReScript modules, consumed by adding the package to your `rescript.json` `dependencies`.
21
+
22
+ **Platform interface & adapters (`types/`, `adapter/`)**
23
+
24
+ - **`Platform`** — the abstract factory interface for platform-agnostic component assembly.
25
+ Plugin code takes a `Platform.T` as a functor argument; a concrete adapter (e.g.
26
+ `reventless-aws`) supplies the implementation at the composition root.
27
+ - **`Adapter`** — deploy-time infrastructure primitives: `resource` (fields wrapped in
28
+ `Pulumi.Output.t`), `resolvedResource` (runtime values), and `resourceInfo` describing a
29
+ resource's structural role (storage keys, stream source, API resolver).
30
+ - **`ResourceNaming`** — provider-agnostic operations for validating and deriving
31
+ URN-safe resource names.
32
+ - **`ExtensionMapping`** / **`ExtensionPointMapping`** — the action types that route commands
33
+ and events between an extension and the extension point it wraps.
34
+ - **`Message`**, **`PluginExtensionPointSpec`**, **`NoEventMappings`** — supporting types for
35
+ message identity and plugin/extension wiring.
36
+
37
+ **Component types (`components/`)**
38
+
39
+ Deploy-time `outputs` (infrastructure references) and runtime `operations` for each Reventless
40
+ component kind — **`Component`** (the typed wrapper around a Pulumi `ComponentResource`),
41
+ **`Plugin`**, **`Aggregate`**, **`ReadModel`**, **`EventLog`** / **`DcbEventLog`**,
42
+ **`CommandTopic`** / **`EventTopic`**, **`CommandGenerator`**, **`EventCollector`**,
43
+ **`EventMapper`**, **`QueryDb`**, **`Api`**, **`Task`**, **`ExtensionPoint`** / **`Extension`**,
44
+ **`Scheduler`**, **`Heartbeat`**, and the DCB slices.
45
+
46
+ ## Where it fits
47
+
48
+ `reventless-infra` sits between the specification layer and the concrete adapters:
49
+
50
+ ```
51
+ reventless-spec (specifications)
52
+
53
+ reventless-infra (shared infrastructure types) ← this package
54
+
55
+ reventless-aws / reventless-postgres / reventless-local (storage & deployment adapters)
56
+ ```
57
+
58
+ - It builds on
59
+ [`@reventlessdev/reventless-spec`](https://www.npmjs.com/package/@reventlessdev/reventless-spec)
60
+ for the domain contracts.
61
+ - Adapters such as
62
+ [`@reventlessdev/reventless-aws`](https://www.npmjs.com/package/@reventlessdev/reventless-aws)
63
+ provide the concrete `Platform.T` implementation these types describe.
64
+
65
+ You normally obtain `reventless-infra` transitively by scaffolding an app rather than
66
+ installing it on its own.
67
+
68
+ ## Install
69
+
70
+ ```bash
71
+ pnpm add @reventlessdev/reventless-infra
72
+ ```
73
+
74
+ Then register it as a ReScript dependency in `rescript.json`:
75
+
76
+ ```json
77
+ {
78
+ "dependencies": ["@reventlessdev/reventless-infra"]
79
+ }
80
+ ```
81
+
82
+ Requires ReScript `^12.3.0` (peer dependency).
83
+
84
+ ## Links
85
+
86
+ - 📚 Documentation — [docs.reventless.dev](https://docs.reventless.dev)
87
+ - 📦 Repository — [ReventlessDev/reventless-core](https://github.com/ReventlessDev/reventless-core)
88
+ - 📋 [Changelog](./CHANGELOG.md)
89
+
90
+ ## License
91
+
92
+ [Apache-2.0](https://opensource.org/licenses/Apache-2.0)
package/package.json ADDED
@@ -0,0 +1,46 @@
1
+ {
2
+ "name": "@reventlessdev/reventless-infra",
3
+ "version": "3.0.0-alpha.100",
4
+ "description": "Infrastructure types for Reventless framework",
5
+ "license": "Apache-2.0",
6
+ "jest": {
7
+ "testMatch": [
8
+ "<rootDir>/tests/**/*Test.res.mjs"
9
+ ],
10
+ "moduleFileExtensions": [
11
+ "js",
12
+ "mjs"
13
+ ]
14
+ },
15
+ "dependencies": {
16
+ "sury": "11.0.0-alpha.4",
17
+ "sury-ppx": "11.0.0-alpha.2",
18
+ "uuid": "^13.0.0",
19
+ "@reventlessdev/rescript-effect": "0.1.0-alpha.27",
20
+ "@reventlessdev/rescript-pulumi-pulumi": "2.3.0-alpha.15",
21
+ "@reventlessdev/rescript-uuid": "1.1.0-alpha.15",
22
+ "@reventlessdev/reventless-spec": "3.0.0-alpha.77"
23
+ },
24
+ "devDependencies": {
25
+ "rescript": "^12.3.0",
26
+ "@reventlessdev/rescript-jest": "1.0.0-alpha.7"
27
+ },
28
+ "peerDependencies": {
29
+ "rescript": "^12.3.0"
30
+ },
31
+ "publishConfig": {
32
+ "registry": "https://registry.npmjs.org"
33
+ },
34
+ "repository": {
35
+ "type": "git",
36
+ "url": "git+https://github.com/ReventlessDev/reventless-core.git",
37
+ "directory": "reventless/reventless-infra"
38
+ },
39
+ "scripts": {
40
+ "build": "rescript build",
41
+ "start": "rescript watch",
42
+ "clean": "rescript clean",
43
+ "rebuild": "pnpm run clean && pnpm run build",
44
+ "test": "NODE_OPTIONS='--experimental-vm-modules' jest"
45
+ }
46
+ }
package/rescript.json ADDED
@@ -0,0 +1,34 @@
1
+ {
2
+ "name": "@reventlessdev/reventless-infra",
3
+ "package-specs": {
4
+ "module": "esmodule",
5
+ "in-source": true
6
+ },
7
+ "namespace": "ReventlessInfra",
8
+ "ppx-flags": [
9
+ "sury-ppx/bin"
10
+ ],
11
+ "warnings": {
12
+ "error": "-44+101"
13
+ },
14
+ "sources": [
15
+ {
16
+ "dir": "src",
17
+ "subdirs": true
18
+ },
19
+ {
20
+ "dir": "tests",
21
+ "subdirs": true,
22
+ "type": "dev"
23
+ }
24
+ ],
25
+ "dependencies": [
26
+ "sury",
27
+ "@reventlessdev/rescript-pulumi-pulumi",
28
+ "@reventlessdev/rescript-effect",
29
+ "@reventlessdev/rescript-uuid",
30
+ "@reventlessdev/reventless-spec",
31
+ "@reventlessdev/rescript-jest"
32
+ ],
33
+ "suffix": ".res.mjs"
34
+ }
@@ -0,0 +1,88 @@
1
+ /** Platform-agnostic metadata for a resource's structural role. */
2
+ type resourceInfo =
3
+ | StorageKeys({partitionKey: string, sortKey: option<string>})
4
+ | StreamSource({sourceUrn: string})
5
+ | ApiResolver({typeName: string, fieldName: string})
6
+ | NoInfo
7
+
8
+ /**
9
+ A deploy-time infrastructure resource with all fields wrapped in `Pulumi.Output.t`.
10
+
11
+ At deploy time (Pulumi program) resource identifiers are not yet known — they
12
+ exist as `Output.t` promises that resolve once the resource is provisioned.
13
+ Use `resolvedResource` at runtime (inside Lambda handlers) once values are available.
14
+ */
15
+ type resource = {
16
+ name: Pulumi.Output.t<string>,
17
+ id: Pulumi.Output.t<string>,
18
+ urn: Pulumi.Output.t<string>,
19
+ /** Typed metadata describing the resource's structural characteristics. */
20
+ resourceInfo: Pulumi.Output.t<resourceInfo>,
21
+ /** Cloud service type identifier (e.g. "aws:DynamoDb", "aws:Lambda"). */
22
+ service: Pulumi.Output.t<string>,
23
+ /** Functional role within a component (e.g. "eventLog", "commandTopic", "queryDb"). */
24
+ role: Pulumi.Output.t<string>,
25
+ /** Cloud region (e.g. "eu-west-1", "local"). */
26
+ region: Pulumi.Output.t<string>,
27
+ /** Full cloud resource type (e.g. "aws:dynamodb:Table", "aws:lambda:Function"). */
28
+ resourceType: Pulumi.Output.t<string>,
29
+ /** Key infrastructure configuration properties (informational, not used at runtime). */
30
+ configuration: Pulumi.Output.t<dict<string>>,
31
+ /** AWS resource tags applied at provisioning time. */
32
+ tags: Pulumi.Output.t<dict<string>>,
33
+ }
34
+
35
+ /** Create a deploy-time resource with sensible defaults for metadata fields. */
36
+ let make = (
37
+ ~name,
38
+ ~id,
39
+ ~urn,
40
+ ~service,
41
+ ~resourceInfo=NoInfo->Pulumi.Output.make,
42
+ ~role=""->Pulumi.Output.make,
43
+ ~region=""->Pulumi.Output.make,
44
+ ~resourceType=""->Pulumi.Output.make,
45
+ ~configuration=Dict.make()->Pulumi.Output.make,
46
+ ~tags=Dict.make()->Pulumi.Output.make,
47
+ ): resource => {
48
+ name,
49
+ id,
50
+ urn,
51
+ resourceInfo,
52
+ service,
53
+ role,
54
+ region,
55
+ resourceType,
56
+ configuration,
57
+ tags,
58
+ }
59
+
60
+ /** A named dictionary of deploy-time infrastructure resources. */
61
+ type resources = dict<resource>
62
+
63
+ /**
64
+ A runtime infrastructure resource with all fields resolved to plain strings.
65
+
66
+ Passed to runtime operations (e.g. `Scheduler.operations`) that run inside
67
+ Lambda handlers, where `Pulumi.Output.t` values have already been resolved
68
+ from environment variables or SSM parameters.
69
+ */
70
+ type resolvedResource = {
71
+ name: string,
72
+ id: string,
73
+ urn: string,
74
+ /** Typed metadata describing the resource's structural characteristics. */
75
+ resourceInfo: resourceInfo,
76
+ /** Cloud service type identifier (e.g. "aws:DynamoDb", "aws:Lambda"). */
77
+ service: string,
78
+ /** Functional role within a component (e.g. "eventLog", "commandTopic", "queryDb"). */
79
+ role: string,
80
+ /** Cloud region (e.g. "eu-west-1", "local"). */
81
+ region: string,
82
+ /** Full cloud resource type (e.g. "aws:dynamodb:Table", "aws:lambda:Function"). */
83
+ resourceType: string,
84
+ /** Key infrastructure configuration properties (informational, not used at runtime). */
85
+ configuration: dict<string>,
86
+ /** AWS resource tags applied at provisioning time. */
87
+ tags: dict<string>,
88
+ }
@@ -0,0 +1,29 @@
1
+ // Generated by ReScript, PLEASE EDIT WITH CARE
2
+
3
+ import * as Pulumi from "@pulumi/pulumi";
4
+
5
+ function make(name, id, urn, service, resourceInfoOpt, roleOpt, regionOpt, resourceTypeOpt, configurationOpt, tagsOpt) {
6
+ let resourceInfo = resourceInfoOpt !== undefined ? resourceInfoOpt : Pulumi.output("NoInfo");
7
+ let role = roleOpt !== undefined ? roleOpt : Pulumi.output("");
8
+ let region = regionOpt !== undefined ? regionOpt : Pulumi.output("");
9
+ let resourceType = resourceTypeOpt !== undefined ? resourceTypeOpt : Pulumi.output("");
10
+ let configuration = configurationOpt !== undefined ? configurationOpt : Pulumi.output({});
11
+ let tags = tagsOpt !== undefined ? tagsOpt : Pulumi.output({});
12
+ return {
13
+ name: name,
14
+ id: id,
15
+ urn: urn,
16
+ resourceInfo: resourceInfo,
17
+ service: service,
18
+ role: role,
19
+ region: region,
20
+ resourceType: resourceType,
21
+ configuration: configuration,
22
+ tags: tags
23
+ };
24
+ }
25
+
26
+ export {
27
+ make,
28
+ }
29
+ /* @pulumi/pulumi Not a pure module */
@@ -0,0 +1,73 @@
1
+ /**
2
+ A function that attaches an additional `EventMapper` to this aggregate after it has
3
+ been provisioned. Used by the plugin assembly to wire cross-aggregate event routing.
4
+ */
5
+ type rec addEventMapper = (EventTopic.allOutputs, Reventless.QueryEngine.operations) => outputs
6
+
7
+ /**
8
+ Deploy-time outputs produced when an `Aggregate` is provisioned.
9
+
10
+ - `name` — the aggregate's logical name
11
+ - `commandGenerator` — the internal command dispatcher component
12
+ - `commandTopic` — the SQS FIFO queue for inbound commands
13
+ - `eventLog` — the DynamoDB event store
14
+ - `eventMapper` — optional: the event-to-command router (present when mappings are configured)
15
+ - `addEventMapper` — callback used by the plugin to attach late-bound event mappers
16
+ */
17
+ and outputs = {
18
+ name: string,
19
+ commandGenerator: Pulumi.Output.t<CommandGenerator.outputs>,
20
+ commandTopic: Pulumi.Output.t<CommandTopic.outputs>,
21
+ eventLog: EventLog.outputs,
22
+ eventMapper?: Pulumi.Output.t<EventMapper.outputs>,
23
+ addEventMapper: addEventMapper,
24
+ }
25
+
26
+ /** A dictionary of aggregate outputs keyed by aggregate name. */
27
+ type allOutputs = dict<outputs>
28
+
29
+ /**
30
+ Runtime operations exposed by an `Aggregate` component.
31
+
32
+ Obtained via `Component.operations(aggregate)`. Available inside Lambda handlers.
33
+ */
34
+ type operations = {
35
+ /** Publish a batch of serialized commands to this aggregate's command topic. */
36
+ publishJsons: CommandTopic.publishJsons,
37
+ /** Publish a stream of serialized commands (for high-throughput pipelines). */
38
+ publishJsonsStream: CommandTopic.publishJsonsStream,
39
+ }
40
+
41
+ /**
42
+ Module type produced by `Platform.Aggregate.Make(Spec, Behavior, Mappings)`.
43
+
44
+ The resulting module exposes `make` for instantiating the aggregate at deploy time
45
+ and `operations` for publishing commands at runtime.
46
+
47
+ @example
48
+ ```rescript
49
+ // CatalogPlugin.res
50
+ module CategoryAggregate = Platform.Aggregate.Make(
51
+ Category,
52
+ CategoryBehavior,
53
+ NoEventMappings.Make(Category),
54
+ )
55
+
56
+ // Deploy time
57
+ let category = CategoryAggregate.make(~api, ~opts=?)
58
+
59
+ // Runtime — inside a Lambda handler
60
+ let ops = await category->Component.operations->TestRunner.resolve
61
+ await ops.publishJsons([{id: "cat-1", meta, commandJson: json}])
62
+ ```
63
+ */
64
+ module type T = {
65
+ module Spec: Reventless.Aggregate.Spec
66
+ type api
67
+ type component
68
+ let make: (~api: api, ~opts: Pulumi.ComponentResource.options=?) => component
69
+ let outputs: component => outputs
70
+ let operations: component => Pulumi.Output.t<operations>
71
+ /** Signal that all event mappers have been attached; finalises the aggregate. */
72
+ let finish: unit => unit
73
+ }
@@ -0,0 +1,2 @@
1
+ // Generated by ReScript, PLEASE EDIT WITH CARE
2
+ /* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */