@reventlessdev/reventless-infra 3.0.0-alpha.81
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/CHANGELOG.md +709 -0
- package/LICENSE +202 -0
- package/package.json +35 -0
- package/rescript.json +28 -0
- package/src/adapter/Adapter.res +88 -0
- package/src/adapter/Adapter.res.mjs +29 -0
- package/src/components/Aggregate.res +73 -0
- package/src/components/Aggregate.res.mjs +2 -0
- package/src/components/Api.res +124 -0
- package/src/components/Api.res.mjs +31 -0
- package/src/components/Api_Adapter.res +39 -0
- package/src/components/Api_Adapter.res.mjs +2 -0
- package/src/components/AutomationSlice.res +48 -0
- package/src/components/AutomationSlice.res.mjs +2 -0
- package/src/components/CommandGenerator.res +8 -0
- package/src/components/CommandGenerator.res.mjs +2 -0
- package/src/components/CommandTopic.res +70 -0
- package/src/components/CommandTopic.res.mjs +2 -0
- package/src/components/Component.js +56 -0
- package/src/components/Component.mjs +10 -0
- package/src/components/Component.res +90 -0
- package/src/components/Component.res.mjs +57 -0
- package/src/components/Component.resi +21 -0
- package/src/components/Counter.res +81 -0
- package/src/components/Counter.res.mjs +2 -0
- package/src/components/DcbEventLog.res +115 -0
- package/src/components/DcbEventLog.res.mjs +2 -0
- package/src/components/EventCollector.res +19 -0
- package/src/components/EventCollector.res.mjs +2 -0
- package/src/components/EventLog.res +24 -0
- package/src/components/EventLog.res.mjs +2 -0
- package/src/components/EventMapper.res +37 -0
- package/src/components/EventMapper.res.mjs +2 -0
- package/src/components/EventTopic.res +51 -0
- package/src/components/EventTopic.res.mjs +2 -0
- package/src/components/Extension.res +64 -0
- package/src/components/Extension.res.mjs +2 -0
- package/src/components/ExtensionPoint.res +62 -0
- package/src/components/ExtensionPoint.res.mjs +2 -0
- package/src/components/Heartbeat.res +7 -0
- package/src/components/Heartbeat.res.mjs +2 -0
- package/src/components/InboundTranslationSlice.res +41 -0
- package/src/components/InboundTranslationSlice.res.mjs +2 -0
- package/src/components/OutboundTranslationSlice.res +44 -0
- package/src/components/OutboundTranslationSlice.res.mjs +2 -0
- package/src/components/Plugin.res +84 -0
- package/src/components/Plugin.res.mjs +2 -0
- package/src/components/QueryDb.res +48 -0
- package/src/components/QueryDb.res.mjs +33 -0
- package/src/components/ReadModel.res +50 -0
- package/src/components/ReadModel.res.mjs +2 -0
- package/src/components/Scheduler.res +32 -0
- package/src/components/Scheduler.res.mjs +2 -0
- package/src/components/StateChangeSlice.res +45 -0
- package/src/components/StateChangeSlice.res.mjs +2 -0
- package/src/components/StateViewSlice.res +38 -0
- package/src/components/StateViewSlice.res.mjs +2 -0
- package/src/components/Task.res +89 -0
- package/src/components/Task.res.mjs +2 -0
- package/src/types/ExtensionMapping.res +448 -0
- package/src/types/ExtensionMapping.res.mjs +252 -0
- package/src/types/ExtensionPointMapping.res +303 -0
- package/src/types/ExtensionPointMapping.res.mjs +116 -0
- package/src/types/Message.res +3 -0
- package/src/types/Message.res.mjs +2 -0
- package/src/types/NoEventMappings.res +25 -0
- package/src/types/NoEventMappings.res.mjs +17 -0
- package/src/types/Platform.res +279 -0
- package/src/types/Platform.res.mjs +2 -0
- package/src/types/PluginExtensionPointSpec.res +43 -0
- package/src/types/PluginExtensionPointSpec.res.mjs +204 -0
- package/src/types/ResourceNaming.res +12 -0
- package/src/types/ResourceNaming.res.mjs +2 -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/package.json
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@reventlessdev/reventless-infra",
|
|
3
|
+
"version": "3.0.0-alpha.81",
|
|
4
|
+
"description": "Infrastructure types for Reventless framework",
|
|
5
|
+
"license": "Apache-2.0",
|
|
6
|
+
"dependencies": {
|
|
7
|
+
"sury": "11.0.0-alpha.4",
|
|
8
|
+
"sury-ppx": "11.0.0-alpha.2",
|
|
9
|
+
"uuid": "^13.0.0",
|
|
10
|
+
"@reventlessdev/rescript-effect": "0.1.0-alpha.23",
|
|
11
|
+
"@reventlessdev/rescript-pulumi-pulumi": "2.3.0-alpha.14",
|
|
12
|
+
"@reventlessdev/rescript-uuid": "1.1.0-alpha.13",
|
|
13
|
+
"@reventlessdev/reventless-spec": "3.0.0-alpha.61"
|
|
14
|
+
},
|
|
15
|
+
"devDependencies": {
|
|
16
|
+
"rescript": "^12.3.0"
|
|
17
|
+
},
|
|
18
|
+
"peerDependencies": {
|
|
19
|
+
"rescript": "^12.3.0"
|
|
20
|
+
},
|
|
21
|
+
"publishConfig": {
|
|
22
|
+
"registry": "https://registry.npmjs.org"
|
|
23
|
+
},
|
|
24
|
+
"repository": {
|
|
25
|
+
"type": "git",
|
|
26
|
+
"url": "git+https://github.com/ReventlessDev/reventless-core.git",
|
|
27
|
+
"directory": "reventless/reventless-infra"
|
|
28
|
+
},
|
|
29
|
+
"scripts": {
|
|
30
|
+
"build": "rescript build",
|
|
31
|
+
"start": "rescript watch",
|
|
32
|
+
"clean": "rescript clean",
|
|
33
|
+
"rebuild": "pnpm run clean && pnpm run build -- -with-deps"
|
|
34
|
+
}
|
|
35
|
+
}
|
package/rescript.json
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
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
|
+
"dependencies": [
|
|
21
|
+
"sury",
|
|
22
|
+
"@reventlessdev/rescript-pulumi-pulumi",
|
|
23
|
+
"@reventlessdev/rescript-effect",
|
|
24
|
+
"@reventlessdev/rescript-uuid",
|
|
25
|
+
"@reventlessdev/reventless-spec"
|
|
26
|
+
],
|
|
27
|
+
"suffix": ".res.mjs"
|
|
28
|
+
}
|
|
@@ -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,124 @@
|
|
|
1
|
+
// --- Sury metadata IDs for API exposure control ---
|
|
2
|
+
|
|
3
|
+
/** Internal sury metadata ID used to mark a schema as excluded from API exposure. */
|
|
4
|
+
let noApiId: S.Metadata.Id.t<bool> = S.Metadata.Id.make(~namespace="api", ~name="noApi")
|
|
5
|
+
|
|
6
|
+
/** Internal sury metadata ID used to mark specific variant names excluded from API exposure. */
|
|
7
|
+
let noApiVariantsId: S.Metadata.Id.t<Set.t<string>> =
|
|
8
|
+
S.Metadata.Id.make(~namespace="api", ~name="noApiVariants")
|
|
9
|
+
|
|
10
|
+
/** Internal sury metadata ID storing per-variant allowed-state lists for AutoUI command filtering.
|
|
11
|
+
Maps variant name → set of status values under which the command is meaningful. */
|
|
12
|
+
let allowedStatesId: S.Metadata.Id.t<dict<array<string>>> =
|
|
13
|
+
S.Metadata.Id.make(~namespace="api", ~name="allowedStates")
|
|
14
|
+
|
|
15
|
+
/** PPX helper: attaches the noApi flag to a command schema. Called by generated code. */
|
|
16
|
+
let markNoApi = (schema: S.t<'a>): S.t<'a> =>
|
|
17
|
+
schema->S.Metadata.set(~id=noApiId, true)
|
|
18
|
+
|
|
19
|
+
/** PPX helper: attaches variant-level exclusions to a command schema. Called by generated code. */
|
|
20
|
+
let markNoApiVariants = (schema: S.t<'a>, variants: array<string>): S.t<'a> =>
|
|
21
|
+
schema->S.Metadata.set(~id=noApiVariantsId, Set.fromArray(variants))
|
|
22
|
+
|
|
23
|
+
/** PPX helper: attaches per-variant allowedStates to a command schema. Called by generated code
|
|
24
|
+
emitted from the @allowedStates([…]) attribute. Each entry is (variantName, allowedStateNames). */
|
|
25
|
+
let markAllowedStates = (
|
|
26
|
+
schema: S.t<'a>,
|
|
27
|
+
entries: array<(string, array<string>)>,
|
|
28
|
+
): S.t<'a> => schema->S.Metadata.set(~id=allowedStatesId, Dict.fromArray(entries))
|
|
29
|
+
|
|
30
|
+
/** Type alias for schema fragments (re-exports Plugin.apiSchemaFragment). */
|
|
31
|
+
type schemaFragment = Reventless.Plugin.apiSchemaFragment
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
Schema entry for a mutation field, derived from an aggregate command schema
|
|
35
|
+
or a DCB StateChangeSlice command schema. Consumed by GraphQL, MCP, and (future) OpenAPI generators.
|
|
36
|
+
`S.t<unknown>` is used for type-erasure — build entries with `Obj.magic`.
|
|
37
|
+
*/
|
|
38
|
+
type mutationSchemaEntry = {
|
|
39
|
+
fieldNames: array<string>,
|
|
40
|
+
commandSchema: S.t<unknown>,
|
|
41
|
+
authorization?: Reventless.ReadModel.authorization,
|
|
42
|
+
/** Spec-level per-field authorization derived from `Spec.commandAuthorization`,
|
|
43
|
+
keyed by mutation field name. Used by AWS to inject
|
|
44
|
+
`@aws_auth(cognito_groups: ...)` per field (Stage E2 in
|
|
45
|
+
`docs/plans/host-ui-login-core.md`). In-memory enforcement still happens
|
|
46
|
+
at the resolver layer via the same `commandAuthorization` function. */
|
|
47
|
+
fieldPermissions?: dict<Reventless.Authorization.permission>,
|
|
48
|
+
description?: string,
|
|
49
|
+
linkedViews?: array<string>,
|
|
50
|
+
consistencyRead?: string,
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
Schema entry for a query field, derived from a ReadModel or StateViewSlice state schema.
|
|
55
|
+
Consumed by GraphQL, MCP, and (future) OpenAPI generators.
|
|
56
|
+
`S.t<unknown>` is used for type-erasure — build entries with `Obj.magic`.
|
|
57
|
+
*/
|
|
58
|
+
type querySchemaEntry = {
|
|
59
|
+
singleFieldName: string,
|
|
60
|
+
listFieldName: string,
|
|
61
|
+
returnTypeName: string,
|
|
62
|
+
stateSchema: S.t<unknown>,
|
|
63
|
+
/** Read-model `Spec.name`. Used as the key for
|
|
64
|
+
`Plugin_Helpers.queryFieldNamesRegistry` / `stateSchemaRegistry`, which
|
|
65
|
+
`QueryDbResolvers_{AppSync,GraphQL}.make` looks up by the same key
|
|
66
|
+
(`Spec.name`). When unset, the admin populator falls back to the
|
|
67
|
+
singular form derived from `returnTypeName` — kept for backward compat
|
|
68
|
+
with read-model specs whose `Spec.name` matches the entity type name.
|
|
69
|
+
Must be set when the read model uses a
|
|
70
|
+
plural `Spec.name` (e.g. `Plugins`) so the registry key still matches. */
|
|
71
|
+
specName?: string,
|
|
72
|
+
authorization: option<Reventless.ReadModel.authorization>,
|
|
73
|
+
/** Spec-level read-model authorization derived from `Spec.authorization`.
|
|
74
|
+
Applies to both the single-id and list query fields. Used by AWS to
|
|
75
|
+
inject `@aws_auth(cognito_groups: ...)` (Stage E2 in
|
|
76
|
+
`docs/plans/host-ui-login-core.md`). In-memory enforcement happens at
|
|
77
|
+
the QueryDb resolver via the same field. */
|
|
78
|
+
permission?: Reventless.Authorization.permission,
|
|
79
|
+
excludeFields?: array<string>,
|
|
80
|
+
description?: string,
|
|
81
|
+
includeIdParam?: bool,
|
|
82
|
+
connectionSpec?: bool,
|
|
83
|
+
/** When set, generates a `{singleFieldName}ById` sort-key query with sort condition args. */
|
|
84
|
+
subIdField?: string,
|
|
85
|
+
/** When set, generates `{singleFieldName}By{Index}` connection query fields for each GSI. */
|
|
86
|
+
indexQueries?: array<Reventless.ReadModel.indexConfig>,
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
Schema entry for an event log, derived from an aggregate EventLog or DCB EventLog.
|
|
91
|
+
Consumed by MCP (event history resources), GraphQL (future subscriptions),
|
|
92
|
+
and (future) OpenAPI/REST event endpoints.
|
|
93
|
+
*/
|
|
94
|
+
type eventLogSchemaEntry = {
|
|
95
|
+
busKey: string,
|
|
96
|
+
displayName: string,
|
|
97
|
+
eventSchema: S.t<unknown>,
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
Deploy-time outputs produced when an `Api` component is provisioned.
|
|
102
|
+
- `apiId` — the cloud API resource identifier (e.g. AppSync API ID)
|
|
103
|
+
*/
|
|
104
|
+
type outputs = {
|
|
105
|
+
apiId: Pulumi.Output.t<string>,
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
Runtime operations for the `Api` component.
|
|
110
|
+
- `updateSchema` — rebuild the stitched schema from the current plugin fragments
|
|
111
|
+
*/
|
|
112
|
+
type operations = {
|
|
113
|
+
updateSchema: array<Reventless.Plugin.apiSchemaFragment> => promise<unit>,
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
type t
|
|
117
|
+
type component = Component.t<t, outputs, operations>
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
Module type produced by `Platform.Api.Make(Config)`.
|
|
121
|
+
*/
|
|
122
|
+
module type T = {
|
|
123
|
+
let make: (~name: string, ~opts: Pulumi.ComponentResource.options=?) => component
|
|
124
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
|
+
|
|
3
|
+
import * as S from "sury/src/S.res.mjs";
|
|
4
|
+
|
|
5
|
+
let noApiId = S.Metadata.Id.make("api", "noApi");
|
|
6
|
+
|
|
7
|
+
let noApiVariantsId = S.Metadata.Id.make("api", "noApiVariants");
|
|
8
|
+
|
|
9
|
+
let allowedStatesId = S.Metadata.Id.make("api", "allowedStates");
|
|
10
|
+
|
|
11
|
+
function markNoApi(schema) {
|
|
12
|
+
return S.Metadata.set(schema, noApiId, true);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
function markNoApiVariants(schema, variants) {
|
|
16
|
+
return S.Metadata.set(schema, noApiVariantsId, new Set(variants));
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function markAllowedStates(schema, entries) {
|
|
20
|
+
return S.Metadata.set(schema, allowedStatesId, Object.fromEntries(entries));
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export {
|
|
24
|
+
noApiId,
|
|
25
|
+
noApiVariantsId,
|
|
26
|
+
allowedStatesId,
|
|
27
|
+
markNoApi,
|
|
28
|
+
markNoApiVariants,
|
|
29
|
+
markAllowedStates,
|
|
30
|
+
}
|
|
31
|
+
/* noApiId Not a pure module */
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
Provider abstraction for the `Api` (GraphQL) component.
|
|
3
|
+
|
|
4
|
+
Concrete providers (AppSync, graphql-yoga in-memory) implement this module type
|
|
5
|
+
so that `Api_Builder.Make` can be parameterised without depending on AWS SDK
|
|
6
|
+
or graphql-yoga directly.
|
|
7
|
+
*/
|
|
8
|
+
module type Provider = {
|
|
9
|
+
type api
|
|
10
|
+
type role
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
Provision the underlying API resource (e.g. AppSync GraphQL API + IAM role).
|
|
14
|
+
Returns the opaque resource handles wrapped in `Output.t`.
|
|
15
|
+
*/
|
|
16
|
+
let makeApiResource: (
|
|
17
|
+
~name: string,
|
|
18
|
+
~opts: Pulumi.ComponentResource.options,
|
|
19
|
+
) => (Pulumi.Output.t<api>, Pulumi.Output.t<role>)
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
Generate a schema fragment for one plugin from its mutation and query entries.
|
|
23
|
+
This is called at deploy-time by `Plugin_Builder`.
|
|
24
|
+
*/
|
|
25
|
+
let generateFragment: (
|
|
26
|
+
~mutationEntries: array<Api.mutationSchemaEntry>,
|
|
27
|
+
~queryEntries: array<Api.querySchemaEntry>,
|
|
28
|
+
) => Reventless.Plugin.apiSchemaFragment
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
Rebuild and publish the full stitched schema whenever the set of plugin
|
|
32
|
+
fragments changes (e.g. on `Connected` / `Disconnected` Plugin events).
|
|
33
|
+
*/
|
|
34
|
+
let updateSchema: (
|
|
35
|
+
~api: Pulumi.Output.t<api>,
|
|
36
|
+
~baseFragment: Reventless.Plugin.apiSchemaFragment,
|
|
37
|
+
~pluginFragments: array<Reventless.Plugin.apiSchemaFragment>,
|
|
38
|
+
) => promise<unit>
|
|
39
|
+
}
|