@reventlessdev/reventless-aws 3.0.0-alpha.271 → 3.0.0-alpha.272

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.272 (2026-08-08)
7
+
8
+ ### Bug Fixes
9
+
10
+ * **aws:** ship the admin structure as a code asset, not an env var ([93bc8a4](https://github.com/ReventlessDev/reventless-core/commit/93bc8a4891b54efeb13b99845a96f990dea6d41c))
11
+
12
+
6
13
  # 3.0.0-alpha.271 (2026-08-08)
7
14
 
8
15
  **Note:** Version bump only for package @reventlessdev/reventless-aws
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reventlessdev/reventless-aws",
3
- "version": "3.0.0-alpha.271",
3
+ "version": "3.0.0-alpha.272",
4
4
  "description": "AWS adapters for Reventless",
5
5
  "license": "Apache-2.0",
6
6
  "dependencies": {
@@ -11,18 +11,18 @@
11
11
  "@aws-sdk/s3-request-presigner": "3.970.0",
12
12
  "sury": "11.0.0-alpha.4",
13
13
  "uuid": "^13.0.0",
14
- "@reventlessdev/rescript-aws-sdk": "3.0.0-alpha.4",
15
14
  "@reventlessdev/rescript-jest": "1.0.0-alpha.10",
16
- "@reventlessdev/rescript-node": "2.0.0-alpha.2",
17
15
  "@reventlessdev/rescript-pulumi-aws": "2.4.0-alpha.66",
16
+ "@reventlessdev/rescript-aws-sdk": "3.0.0-alpha.4",
18
17
  "@reventlessdev/rescript-effect": "0.1.0-alpha.32",
19
- "@reventlessdev/reventless-core": "3.0.0-alpha.216",
20
- "@reventlessdev/reventless-interop": "3.0.0-alpha.30",
18
+ "@reventlessdev/rescript-node": "2.0.0-alpha.2",
19
+ "@reventlessdev/rescript-pulumi-pulumi": "2.3.0-alpha.18",
21
20
  "@reventlessdev/rescript-uuid": "2.0.0-alpha.0",
21
+ "@reventlessdev/reventless-interop": "3.0.0-alpha.30",
22
22
  "@reventlessdev/reventless-postgres": "3.0.0-alpha.80",
23
23
  "@reventlessdev/reventless-infra": "3.0.0-alpha.128",
24
- "@reventlessdev/rescript-pulumi-pulumi": "2.3.0-alpha.18",
25
- "@reventlessdev/reventless-spec": "3.0.0-alpha.102"
24
+ "@reventlessdev/reventless-spec": "3.0.0-alpha.102",
25
+ "@reventlessdev/reventless-core": "3.0.0-alpha.216"
26
26
  },
27
27
  "devDependencies": {
28
28
  "rescript": "12.3.0",
@@ -115,14 +115,17 @@ let make = (
115
115
  // Bundle reventless-aws (the compiled `_Ops` handler lives inside it) and
116
116
  // re-export its `handler`; buildCodeArchive also ships the ESM resolve-hook so
117
117
  // the handler's bare @aws-sdk/* specifiers resolve from the managed runtime.
118
- // The admin entry is passed as an env var (ADMIN_ENTRY_JSON) rather than
119
- // interpolated into the source, so the archive hash is stable across deploys.
118
+ // The admin entry rides the archive as `adminEntry.json` rather than an env var:
119
+ // it alone encodes to ~3 KB, which together with the other variables exceeds the
120
+ // 4096-byte UpdateFunctionConfiguration limit. Its content participates in
121
+ // `sourceCodeHash`, so a change to the admin structure redeploys the code.
120
122
  let packageDirs = Dict.fromArray([
121
123
  ("@reventlessdev/reventless-aws", Util_Bundle.resolvePackageRoot("@reventlessdev/reventless-aws")),
122
124
  ])
123
125
  let {code, sourceCodeHash} = Util_Bundle.buildCodeArchive(
124
126
  ~entryPointModule="@reventlessdev/reventless-aws/src/adapter/Api/Platform_ComponentDefinitions_Lambda_Ops.res.mjs",
125
127
  ~packageDirs,
128
+ ~extraStringAssets=Dict.fromArray([("adminEntry.json", adminEntryJson)]),
126
129
  ~bundleRuntimeExtensions=false,
127
130
  )
128
131
 
@@ -150,7 +153,6 @@ let make = (
150
153
  ("Environment", Pulumi.Pulumi.getStackName()->Pulumi.Input.make),
151
154
  ("PLUGIN_RM_TABLE", pluginReadModelTableName->Pulumi.Output.asInput),
152
155
  ("OFFLOAD_BUCKET", offloadBucketName->Pulumi.Output.asInput),
153
- ("ADMIN_ENTRY_JSON", adminEntryJson->Pulumi.Input.make),
154
156
  ("NODE_OPTIONS", Util_Bundle.esmLoaderNodeOptions->Pulumi.Input.make),
155
157
  ("ESM_FALLBACK_DIRS", Util_Bundle.esmFallbackDirs->Pulumi.Input.make),
156
158
  Util_LambdaLogging.logLevelEntry(),
@@ -75,7 +75,10 @@ function make(api, pluginReadModelTableName, offloadBucketName, schemaReady, opt
75
75
  "@reventlessdev/reventless-aws",
76
76
  Util_Bundle$ReventlessAws.resolvePackageRoot(undefined, "@reventlessdev/reventless-aws")
77
77
  ]]);
78
- let match = Util_Bundle$ReventlessAws.buildCodeArchive("@reventlessdev/reventless-aws/src/adapter/Api/Platform_ComponentDefinitions_Lambda_Ops.res.mjs", packageDirs, undefined, false);
78
+ let match = Util_Bundle$ReventlessAws.buildCodeArchive("@reventlessdev/reventless-aws/src/adapter/Api/Platform_ComponentDefinitions_Lambda_Ops.res.mjs", packageDirs, Object.fromEntries([[
79
+ "adminEntry.json",
80
+ adminEntryJson
81
+ ]]), false);
79
82
  let layers = Stdlib_Option.getOr(Stdlib_Option.map(Lambda$PulumiAws.reventlessLayerArn, arn => [arn]), []);
80
83
  let lambda = new (Aws.lambda.Function)(name + "Lambda", {
81
84
  handler: "index.handler",
@@ -100,10 +103,6 @@ function make(api, pluginReadModelTableName, offloadBucketName, schemaReady, opt
100
103
  "OFFLOAD_BUCKET",
101
104
  offloadBucketName
102
105
  ],
103
- [
104
- "ADMIN_ENTRY_JSON",
105
- adminEntryJson
106
- ],
107
106
  [
108
107
  "NODE_OPTIONS",
109
108
  Util_Bundle$ReventlessAws.esmLoaderNodeOptions
@@ -68,17 +68,26 @@ let toEntryWith = (~filter: bool, item: dict<JSON.t>, ~name: string): option<JSO
68
68
  }
69
69
 
70
70
 
71
- // The built-in Platform_Admin entry, injected at deploy time as the
72
- // ADMIN_ENTRY_JSON env var (the admin never Connects to itself, so its structure
73
- // never enters the Plugin read model).
71
+ // The built-in Platform_Admin entry, written at deploy time as an asset file in
72
+ // the code archive (the admin never Connects to itself, so its structure never
73
+ // enters the Plugin read model). It rides the archive rather than an env var
74
+ // because it alone is ~3 KB and the function's variables must fit AWS's 4096-byte
75
+ // UpdateFunctionConfiguration limit. process.cwd() is /var/task in Lambda, where
76
+ // the archive is extracted.
74
77
  //
75
78
  // Shared by both fields. The admin structure has no Internal components and no
76
79
  // extension points, so its filtered and complete encodings carry the same
77
80
  // components; the structure-level fields the complete entry adds are absent from
78
81
  // this JSON and resolve to null, which is what `extensionPoints: None` means.
79
82
  let adminEntry: option<JSON.t> =
80
- switch NodeProcess.env->Dict.get("ADMIN_ENTRY_JSON") {
81
- | Some(s) if s != "" => Some(JSON.parseOrThrow(s))
83
+ try {
84
+ switch NodePath.join([NodeProcess.cwd(), "adminEntry.json"])
85
+ ->NodeFs.readFileSync
86
+ ->JSON.parseOrThrow {
87
+ | JSON.Null => None
88
+ | json => Some(json)
89
+ }
90
+ } catch {
82
91
  | _ => None
83
92
  }
84
93
 
@@ -1,6 +1,8 @@
1
1
  // Generated by ReScript, PLEASE EDIT WITH CARE
2
2
 
3
+ import * as Nodefs from "node:fs";
3
4
  import * as S3$AwsSdk from "@reventlessdev/rescript-aws-sdk/src/S3.res.mjs";
5
+ import * as Nodepath from "node:path";
4
6
  import * as Stdlib_JSON from "@rescript/runtime/lib/es6/Stdlib_JSON.js";
5
7
  import * as Stdlib_Option from "@rescript/runtime/lib/es6/Stdlib_Option.js";
6
8
  import * as Offload$Reventless from "@reventlessdev/reventless-spec/src/semantic/Offload.res.mjs";
@@ -50,9 +52,14 @@ function toEntryWith(filter, item, name) {
50
52
  return entry;
51
53
  }
52
54
 
53
- let s = process.env["ADMIN_ENTRY_JSON"];
55
+ let adminEntry;
54
56
 
55
- let adminEntry = s !== undefined && s !== "" ? JSON.parse(s) : undefined;
57
+ try {
58
+ let json = JSON.parse(Nodefs.readFileSync(Nodepath.join(process.cwd(), "adminEntry.json"), "utf8"));
59
+ adminEntry = json === null ? undefined : json;
60
+ } catch (exn) {
61
+ adminEntry = undefined;
62
+ }
56
63
 
57
64
  function resolveStructure(fetch, item) {
58
65
  let refJson = Stdlib_Option.flatMap(Stdlib_Option.flatMap(item["structure"], Stdlib_JSON.Decode.object), o => o[Offload$Reventless.sentinelKey]);
@@ -112,4 +119,4 @@ export {
112
119
  isComplete,
113
120
  handler,
114
121
  }
115
- /* s Not a pure module */
122
+ /* adminEntry Not a pure module */