@reventlessdev/rescript-aws-sdk 3.0.0-alpha.12 → 3.0.0-alpha.14

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,27 @@
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.14 (2026-08-27)
7
+
8
+ ### Bug Fixes
9
+
10
+ * **seed-aws:** a throttled control plane aborts the reset hold and blames IAM ([95af263](https://github.com/ReventlessDev/reventless-core/commit/95af263afba7dfdfa9a7fc45f494b302dba4baf8))
11
+
12
+
13
+ # 3.0.0-alpha.13 (2026-08-23)
14
+
15
+ * feat(aws)!: scope the active-role store to the identity provider ([08e287d](https://github.com/ReventlessDev/reventless-core/commit/08e287db9721977b818bad76671ec4c62be6f9af))
16
+
17
+ ### BREAKING CHANGES
18
+
19
+ * platform:cognitoUserPoolId is now
20
+ platform:identityProviderId (REVENTLESS_IDENTITY_PROVIDER_ID). The old
21
+ spelling is still read and warns — do not drop it until the new secret
22
+ is in place, because an unset provider id is auto mode, and auto mode
23
+ creates a new user pool.
24
+
25
+
26
+
6
27
  # 3.0.0-alpha.12 (2026-08-18)
7
28
 
8
29
  **Note:** Version bump only for package @reventlessdev/rescript-aws-sdk
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reventlessdev/rescript-aws-sdk",
3
- "version": "3.0.0-alpha.12",
3
+ "version": "3.0.0-alpha.14",
4
4
  "description": "ReScript bindings for aws-sdk",
5
5
  "license": "Apache-2.0",
6
6
  "dependencies": {
@@ -151,3 +151,115 @@ module AdminListGroupsForUserCommand = {
151
151
 
152
152
  let send: t => promise<output> = command => Raw.send(client(), command)
153
153
  }
154
+
155
+ module CreateUserPoolCommand = {
156
+ type t
157
+
158
+ type passwordPolicy = {
159
+ @as("MinimumLength") minimumLength?: int,
160
+ @as("RequireLowercase") requireLowercase?: bool,
161
+ @as("RequireUppercase") requireUppercase?: bool,
162
+ @as("RequireNumbers") requireNumbers?: bool,
163
+ @as("RequireSymbols") requireSymbols?: bool,
164
+ }
165
+
166
+ type policies = {@as("PasswordPolicy") passwordPolicy?: passwordPolicy}
167
+
168
+ type adminCreateUserConfig = {
169
+ @as("AllowAdminCreateUserOnly") allowAdminCreateUserOnly?: bool,
170
+ }
171
+
172
+ /** Only the members a Reventless pool is provisioned with. The API accepts far
173
+ more; an operator wanting the rest edits the pool afterwards rather than
174
+ having every setting grow a parameter here. */
175
+ type input = {
176
+ @as("PoolName") poolName: string,
177
+ @as("UsernameAttributes") usernameAttributes?: array<string>,
178
+ @as("MfaConfiguration") mfaConfiguration?: string,
179
+ @as("Policies") policies?: policies,
180
+ @as("AdminCreateUserConfig") adminCreateUserConfig?: adminCreateUserConfig,
181
+ @as("UserPoolTags") userPoolTags?: Dict.t<string>,
182
+ }
183
+
184
+ type userPoolType = {
185
+ @as("Id") id?: string,
186
+ @as("Name") name?: string,
187
+ @as("Arn") arn?: string,
188
+ }
189
+
190
+ type output = {@as("UserPool") userPool?: userPoolType}
191
+
192
+ @new @module("@aws-sdk/client-cognito-identity-provider")
193
+ external make: input => t = "CreateUserPoolCommand"
194
+
195
+ module Raw = {
196
+ /**
197
+ see: https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/cognito-identity-provider/command/CreateUserPoolCommand/
198
+ */
199
+ @send
200
+ external send: (client, t) => promise<output> = "send"
201
+ }
202
+
203
+ let send: t => promise<output> = command => Raw.send(client(), command)
204
+ }
205
+
206
+ module ListUserPoolsCommand = {
207
+ type t
208
+
209
+ /** `MaxResults` caps at 60, so a caller looking for a pool by name has to page.
210
+ Cognito offers no lookup by name and does not enforce name uniqueness. */
211
+ type input = {
212
+ @as("MaxResults") maxResults: int,
213
+ @as("NextToken") nextToken?: string,
214
+ }
215
+
216
+ type userPoolDescription = {
217
+ @as("Id") id?: string,
218
+ @as("Name") name?: string,
219
+ }
220
+
221
+ type output = {
222
+ @as("UserPools") userPools?: array<userPoolDescription>,
223
+ @as("NextToken") nextToken?: string,
224
+ }
225
+
226
+ @new @module("@aws-sdk/client-cognito-identity-provider")
227
+ external make: input => t = "ListUserPoolsCommand"
228
+
229
+ module Raw = {
230
+ /**
231
+ see: https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/cognito-identity-provider/command/ListUserPoolsCommand/
232
+ */
233
+ @send
234
+ external send: (client, t) => promise<output> = "send"
235
+ }
236
+
237
+ let send: t => promise<output> = command => Raw.send(client(), command)
238
+ }
239
+
240
+ module DescribeUserPoolCommand = {
241
+ type t
242
+
243
+ type input = {@as("UserPoolId") userPoolId: string}
244
+
245
+ type userPoolType = {
246
+ @as("Id") id?: string,
247
+ @as("Name") name?: string,
248
+ @as("Arn") arn?: string,
249
+ }
250
+
251
+ type output = {@as("UserPool") userPool?: userPoolType}
252
+
253
+ @new @module("@aws-sdk/client-cognito-identity-provider")
254
+ external make: input => t = "DescribeUserPoolCommand"
255
+
256
+ module Raw = {
257
+ /**
258
+ see: https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/cognito-identity-provider/command/DescribeUserPoolCommand/
259
+ */
260
+ @send
261
+ external send: (client, t) => promise<output> = "send"
262
+ }
263
+
264
+ let send: t => promise<output> = command => Raw.send(client(), command)
265
+ }
@@ -70,6 +70,39 @@ let AdminListGroupsForUserCommand = {
70
70
  send: send$3
71
71
  };
72
72
 
73
+ let Raw$5 = {};
74
+
75
+ function send$4(command) {
76
+ return client().send(command);
77
+ }
78
+
79
+ let CreateUserPoolCommand = {
80
+ Raw: Raw$5,
81
+ send: send$4
82
+ };
83
+
84
+ let Raw$6 = {};
85
+
86
+ function send$5(command) {
87
+ return client().send(command);
88
+ }
89
+
90
+ let ListUserPoolsCommand = {
91
+ Raw: Raw$6,
92
+ send: send$5
93
+ };
94
+
95
+ let Raw$7 = {};
96
+
97
+ function send$6(command) {
98
+ return client().send(command);
99
+ }
100
+
101
+ let DescribeUserPoolCommand = {
102
+ Raw: Raw$7,
103
+ send: send$6
104
+ };
105
+
73
106
  export {
74
107
  Raw,
75
108
  clientInstance,
@@ -78,5 +111,8 @@ export {
78
111
  AdminAddUserToGroupCommand,
79
112
  AdminRemoveUserFromGroupCommand,
80
113
  AdminListGroupsForUserCommand,
114
+ CreateUserPoolCommand,
115
+ ListUserPoolsCommand,
116
+ DescribeUserPoolCommand,
81
117
  }
82
118
  /* @smithy/node-http-handler Not a pure module */
@@ -231,3 +231,70 @@ module UpdateContinuousBackupsCommand = {
231
231
 
232
232
  let send: t => promise<output> = command => Raw.send(client(), command)
233
233
  }
234
+
235
+ module CreateTableCommand = {
236
+ /*** create a table
237
+
238
+ this command is not available in document-client
239
+
240
+ see: https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/dynamodb/command/CreateTableCommand/ */
241
+
242
+ type t
243
+
244
+ type attributeDefinition = {
245
+ @as("AttributeName") attributeName: string,
246
+ /** "S" | "N" | "B" */
247
+ @as("AttributeType")
248
+ attributeType: string,
249
+ }
250
+
251
+ type input = {
252
+ @as("TableName") tableName: string,
253
+ @as("KeySchema") keySchema: array<DescribeTableCommand.keySchemaElement>,
254
+ @as("AttributeDefinitions") attributeDefinitions: array<attributeDefinition>,
255
+ /** "PROVISIONED" | "PAY_PER_REQUEST" */
256
+ @as("BillingMode")
257
+ billingMode?: string,
258
+ @as("Tags") tags?: array<Dict.t<string>>,
259
+ }
260
+
261
+ type output = {@as("$metadata") metadata: Metadata.t}
262
+
263
+ @new @module("@aws-sdk/client-dynamodb")
264
+ external make: input => t = "CreateTableCommand"
265
+
266
+ module Raw = {
267
+ @send
268
+ external send: (client, t) => promise<output> = "send"
269
+ }
270
+
271
+ let send: t => promise<output> = command => Raw.send(client(), command)
272
+ }
273
+
274
+ module TableExistsWaiter = {
275
+ /*** block until a table reports ACTIVE.
276
+
277
+ 🚨 **Does not reject on failure.** The SDK's waiters resolve with a `state` of
278
+ `"SUCCESS"`, `"FAILURE"`, `"TIMEOUT"` or `"RETRY"` — so a caller that only
279
+ awaits this treats a timeout as success. Check [result.state].
280
+
281
+ see: https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/dynamodb/#waiters */
282
+
283
+ type config = {
284
+ client: client,
285
+ /** seconds */
286
+ maxWaitTime: int,
287
+ }
288
+
289
+ type params = {@as("TableName") tableName: string}
290
+
291
+ type result = {state: string}
292
+
293
+ @module("@aws-sdk/client-dynamodb")
294
+ external waitUntilTableExists: (config, params) => promise<result> = "waitUntilTableExists"
295
+
296
+ let succeeded = (result: result): bool => result.state == "SUCCESS"
297
+
298
+ let wait = (~tableName: string, ~maxWaitTime: int=300): promise<result> =>
299
+ waitUntilTableExists({client: client(), maxWaitTime}, {tableName: tableName})
300
+ }
@@ -70,6 +70,36 @@ let UpdateContinuousBackupsCommand = {
70
70
  send: send$3
71
71
  };
72
72
 
73
+ let Raw$5 = {};
74
+
75
+ function send$4(command) {
76
+ return client().send(command);
77
+ }
78
+
79
+ let CreateTableCommand = {
80
+ Raw: Raw$5,
81
+ send: send$4
82
+ };
83
+
84
+ function succeeded(result) {
85
+ return result.state === "SUCCESS";
86
+ }
87
+
88
+ function wait(tableName, maxWaitTimeOpt) {
89
+ let maxWaitTime = maxWaitTimeOpt !== undefined ? maxWaitTimeOpt : 300;
90
+ return ClientDynamodb.waitUntilTableExists({
91
+ client: client(),
92
+ maxWaitTime: maxWaitTime
93
+ }, {
94
+ TableName: tableName
95
+ });
96
+ }
97
+
98
+ let TableExistsWaiter = {
99
+ succeeded: succeeded,
100
+ wait: wait
101
+ };
102
+
73
103
  export {
74
104
  Raw,
75
105
  clientInstance,
@@ -78,5 +108,7 @@ export {
78
108
  UpdateTableCommand,
79
109
  UpdateTimeToLiveCommand,
80
110
  UpdateContinuousBackupsCommand,
111
+ CreateTableCommand,
112
+ TableExistsWaiter,
81
113
  }
82
114
  /* @aws-sdk/client-dynamodb Not a pure module */
package/src/Lambda.res CHANGED
@@ -24,12 +24,23 @@
24
24
  type client
25
25
 
26
26
  module Raw = {
27
- type options = {region?: string}
27
+ type options = {region?: string, maxAttempts?: int, retryMode?: string}
28
28
  @module("@aws-sdk/client-lambda") @new
29
29
  external client: (~options: options=?, unit) => client = "LambdaClient"
30
30
  }
31
31
 
32
- let client = (~region: option<string>=?, ()): client => Raw.client(~options={region: ?region}, ())
32
+ /** The Lambda control plane is rate-limited per account and region, and that
33
+ budget is shared with everything else touching it — a concurrent deploy, an
34
+ inspector sync, a second estate in the same region. A caller that walks every
35
+ function in a stack therefore meets `Rate exceeded` on calls it has every
36
+ right to make, and the SDK default of three attempts in `standard` mode is
37
+ not enough to ride it out.
38
+
39
+ `adaptive` adds a client-side rate limiter that slows the whole client down
40
+ when the service throttles it, rather than retrying into the same wall, which
41
+ is what the control plane wants. */
42
+ let client = (~region: option<string>=?, ()): client =>
43
+ Raw.client(~options={region: ?region, maxAttempts: 10, retryMode: "adaptive"}, ())
33
44
 
34
45
  /** A function's environment variables, in the shape both the get and the update
35
46
  use. `variables` absent and `variables` empty are different: sending an empty
@@ -6,7 +6,9 @@ let Raw = {};
6
6
 
7
7
  function client(region, param) {
8
8
  return new ClientLambda.LambdaClient({
9
- region: region
9
+ region: region,
10
+ maxAttempts: 10,
11
+ retryMode: "adaptive"
10
12
  });
11
13
  }
12
14