@reventlessdev/reventless-aws 3.0.0-alpha.279 → 3.0.0-alpha.280

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 CHANGED
@@ -3,6 +3,13 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # 3.0.0-alpha.280 (2026-08-10)
7
+
8
+ ### Bug Fixes
9
+
10
+ * **aws:** keep the interceptor data source out of an option ([d908126](https://github.com/ReventlessDev/reventless-core/commit/d90812626d64b5c408c8185ac58a63db448e4082))
11
+
12
+
6
13
  # 3.0.0-alpha.279 (2026-08-10)
7
14
 
8
15
  ### Bug Fixes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reventlessdev/reventless-aws",
3
- "version": "3.0.0-alpha.279",
3
+ "version": "3.0.0-alpha.280",
4
4
  "description": "AWS adapters for Reventless",
5
5
  "license": "Apache-2.0",
6
6
  "dependencies": {
@@ -14,16 +14,16 @@
14
14
  "uuid": "^13.0.0",
15
15
  "@reventlessdev/rescript-aws-sdk": "3.0.0-alpha.6",
16
16
  "@reventlessdev/rescript-effect": "0.1.0-alpha.32",
17
- "@reventlessdev/rescript-node": "2.0.0-alpha.3",
18
17
  "@reventlessdev/rescript-jest": "1.0.0-alpha.10",
18
+ "@reventlessdev/rescript-node": "2.0.0-alpha.3",
19
19
  "@reventlessdev/rescript-pulumi-aws": "2.4.0-alpha.69",
20
20
  "@reventlessdev/rescript-pulumi-pulumi": "2.3.0-alpha.18",
21
21
  "@reventlessdev/rescript-uuid": "2.0.0-alpha.0",
22
22
  "@reventlessdev/reventless-core": "3.0.0-alpha.222",
23
+ "@reventlessdev/reventless-infra": "3.0.0-alpha.132",
23
24
  "@reventlessdev/reventless-interop": "3.0.0-alpha.30",
24
25
  "@reventlessdev/reventless-postgres": "3.0.0-alpha.86",
25
- "@reventlessdev/reventless-spec": "3.0.0-alpha.106",
26
- "@reventlessdev/reventless-infra": "3.0.0-alpha.132"
26
+ "@reventlessdev/reventless-spec": "3.0.0-alpha.106"
27
27
  },
28
28
  "devDependencies": {
29
29
  "rescript": "12.3.0",
@@ -109,15 +109,19 @@ let make: ReventlessCore.QueryDb_Adapter.resolversMaker<api, role> = (
109
109
  // totals because one is queried through an index. A partial pipeline here would
110
110
  // make that skew invisible rather than absent.
111
111
  let interceptorFunction = (~resolverName) =>
112
- QueryInterceptor_Provisioning.dataSourceName(~api, ~opts)->Option.map(interceptorDsName =>
113
- Function.makeJs(
114
- ~name=resolverName ++ "Interceptor",
115
- ~api,
116
- ~dataSource=interceptorDsName,
117
- ~code=interceptorCode(name),
118
- ~opts,
112
+ switch QueryInterceptor_Provisioning.dataSourceName(~api, ~opts) {
113
+ | Off => None
114
+ | On(interceptorDsName) =>
115
+ Some(
116
+ Function.makeJs(
117
+ ~name=resolverName ++ "Interceptor",
118
+ ~api,
119
+ ~dataSource=interceptorDsName,
120
+ ~code=interceptorCode(name),
121
+ ~opts,
122
+ ),
119
123
  )
120
- )
124
+ }
121
125
 
122
126
  // Creates either a unit resolver (no interceptor) or a pipeline resolver
123
127
  // (interceptor Lambda → DynamoDB query), for the Query fields that have no
@@ -66,7 +66,14 @@ function make(name, api, apiRole, dataSourceName, indexes, subIdField, idResolve
66
66
  let fieldNameForSingle = registryEntry !== undefined ? registryEntry.singleFieldName : AppSync_Resolver_Functions$PulumiAws.uncapitalize(name$1);
67
67
  let includeIdParam = registryEntry !== undefined ? registryEntry.includeIdParam : true;
68
68
  let connectionSpec = registryEntry !== undefined ? registryEntry.connectionSpec : true;
69
- let interceptorFunction = resolverName => Stdlib_Option.map(QueryInterceptor_Provisioning$ReventlessAws.dataSourceName(api, opts), interceptorDsName => AppSync_Function$PulumiAws.makeJs(resolverName + "Interceptor", api, interceptorDsName, interceptorCode(name$1), opts));
69
+ let interceptorFunction = resolverName => {
70
+ let interceptorDsName = QueryInterceptor_Provisioning$ReventlessAws.dataSourceName(api, opts);
71
+ if (typeof interceptorDsName !== "object") {
72
+ return;
73
+ } else {
74
+ return AppSync_Function$PulumiAws.makeJs(resolverName + "Interceptor", api, interceptorDsName._0, interceptorCode(name$1), opts);
75
+ }
76
+ };
70
77
  let makeQueryResolver = (resolverName, field, code) => {
71
78
  let interceptorFn = interceptorFunction(resolverName);
72
79
  if (interceptorFn === undefined) {
@@ -138,18 +138,34 @@ let buildInterceptor = (~api: Types.AppSync.api, ~opts) => {
138
138
  dataSource.name->Pulumi.Output.asInput
139
139
  }
140
140
 
141
- /** The data source a Query resolver should put in front of its DynamoDB read, or
142
- `None` when interception is off in which case the caller builds the unit
143
- resolver it always did and nothing here is provisioned. */
144
- let dataSourceName = (~api: Types.AppSync.api, ~opts): option<Pulumi.Input.t<string>> =>
141
+ /** Whether a Query resolver fronts its DynamoDB read with the interceptor, and
142
+ the data source to front it with. `Off` means interception is switched off
143
+ the caller builds the unit resolver it always did and nothing here is
144
+ provisioned.
145
+
146
+ A variant rather than an `option`, and that is load-bearing. The payload is a
147
+ Pulumi `Output`, which is a JS `Proxy` answering *every* property read with a
148
+ derived `Output`. The generic option runtime unwraps by probing the payload
149
+ for `BS_PRIVATE_NESTED_SOME_NONE`; on a `Proxy` that probe never reads
150
+ `undefined`, so it takes the nested-option branch and yields a wrapper object
151
+ where a data-source name belongs. AppSync then rejects the resource with
152
+ "Attribute must be a single value, not a map" — at deploy time, naming a
153
+ field the source never mentions. A variant keeps that runtime off the path
154
+ entirely, so no caller can reintroduce the fault by reaching for
155
+ `Option.map`. */
156
+ type t =
157
+ | Off
158
+ | On(Pulumi.Input.t<string>)
159
+
160
+ let dataSourceName = (~api: Types.AppSync.api, ~opts): t =>
145
161
  if !ReventlessCore.QueryInterception.isEnabled() {
146
- None
162
+ Off
147
163
  } else {
148
164
  switch byApi->Map.get(api) {
149
- | Some(existing) => Some(existing)
165
+ | Some(existing) => On(existing)
150
166
  | None =>
151
167
  let created = buildInterceptor(~api, ~opts)
152
168
  byApi->Map.set(api, created)
153
- Some(created)
169
+ On(created)
154
170
  }
155
171
  }
@@ -71,15 +71,21 @@ function buildInterceptor(api, opts) {
71
71
 
72
72
  function dataSourceName(api, opts) {
73
73
  if (!QueryInterception$ReventlessCore.isEnabled()) {
74
- return;
74
+ return "Off";
75
75
  }
76
76
  let existing = byApi.get(api);
77
77
  if (existing !== undefined) {
78
- return existing;
78
+ return {
79
+ TAG: "On",
80
+ _0: existing
81
+ };
79
82
  }
80
83
  let created = buildInterceptor(api, opts);
81
84
  byApi.set(api, created);
82
- return created;
85
+ return {
86
+ TAG: "On",
87
+ _0: created
88
+ };
83
89
  }
84
90
 
85
91
  export {