@reventlessdev/rescript-aws-sdk 3.0.0-alpha.0 → 3.0.0-alpha.10
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 +75 -0
- package/package.json +4 -2
- package/src/CognitoIdentityServiceProvider.res +36 -0
- package/src/CognitoIdentityServiceProvider.res.mjs +12 -0
- package/src/Lambda.res +150 -0
- package/src/Lambda.res.mjs +32 -0
- package/src/Location.res +80 -0
- package/src/Location.res.mjs +39 -0
- package/src/S3.res +69 -0
- package/src/S3.res.mjs +38 -5
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,81 @@
|
|
|
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.10 (2026-08-14)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @reventlessdev/rescript-aws-sdk
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
# 3.0.0-alpha.9 (2026-08-13)
|
|
15
|
+
|
|
16
|
+
### Features
|
|
17
|
+
|
|
18
|
+
* **aws:** narrow the token to the role a caller chose to act as ([194332f](https://github.com/ReventlessDev/reventless-core/commit/194332fa0af8e13417f72d57904e2ed469747dde))
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
# 3.0.0-alpha.8 (2026-08-13)
|
|
22
|
+
|
|
23
|
+
**Note:** Version bump only for package @reventlessdev/rescript-aws-sdk
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
# 3.0.0-alpha.7 (2026-08-11)
|
|
30
|
+
|
|
31
|
+
**Note:** Version bump only for package @reventlessdev/rescript-aws-sdk
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
# 3.0.0-alpha.6 (2026-08-09)
|
|
38
|
+
|
|
39
|
+
**Note:** Version bump only for package @reventlessdev/rescript-aws-sdk
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
# 3.0.0-alpha.5 (2026-08-09)
|
|
46
|
+
|
|
47
|
+
### Bug Fixes
|
|
48
|
+
|
|
49
|
+
* **seed-aws:** hold and recycle a stack's runtimes so a reset stays empty ([4baaa38](https://github.com/ReventlessDev/reventless-core/commit/4baaa3827ef30a0adccdef5d2bccc688e7b6686f))
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
# 3.0.0-alpha.4 (2026-08-05)
|
|
53
|
+
|
|
54
|
+
**Note:** Version bump only for package @reventlessdev/rescript-aws-sdk
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
# 3.0.0-alpha.3 (2026-08-03)
|
|
61
|
+
|
|
62
|
+
### Features
|
|
63
|
+
|
|
64
|
+
* **outbound:** let an outbound slice read an aggregate, and geocode addresses with it ([867e63e](https://github.com/ReventlessDev/reventless-core/commit/867e63e774ebc8b78b2b19c78645c8a12a8d06f6))
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
# 3.0.0-alpha.2 (2026-08-02)
|
|
68
|
+
|
|
69
|
+
### Features
|
|
70
|
+
|
|
71
|
+
* **aws:** S3 GetObject->string binding + structure offload resolver ([1274bcc](https://github.com/ReventlessDev/reventless-core/commit/1274bcce29f8a1b70db362a10585c508710e7b56))
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
# 3.0.0-alpha.1 (2026-08-02)
|
|
75
|
+
|
|
76
|
+
### Features
|
|
77
|
+
|
|
78
|
+
* **aws,core,spec,seed-aws:** expire uploads nobody committed a reference to ([f63e84c](https://github.com/ReventlessDev/reventless-core/commit/f63e84c1a11cc350b799a6f69a2e7427cf1ea6e9))
|
|
79
|
+
|
|
80
|
+
|
|
6
81
|
# 3.0.0-alpha.0 (2026-07-31)
|
|
7
82
|
|
|
8
83
|
* feat(rescript)!: one Node bindings package, not two ([1258d8c](https://github.com/ReventlessDev/reventless-core/commit/1258d8c2b2ff2636b36a849fc5bdf9005c6fb0eb))
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reventlessdev/rescript-aws-sdk",
|
|
3
|
-
"version": "3.0.0-alpha.
|
|
3
|
+
"version": "3.0.0-alpha.10",
|
|
4
4
|
"description": "ReScript bindings for aws-sdk",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"dependencies": {
|
|
@@ -9,6 +9,8 @@
|
|
|
9
9
|
"@aws-sdk/client-dynamodb": "^3.1033.0",
|
|
10
10
|
"@aws-sdk/client-ecs": "^3.1033.0",
|
|
11
11
|
"@aws-sdk/client-kinesis": "^3.1033.0",
|
|
12
|
+
"@aws-sdk/client-lambda": "^3.1033.0",
|
|
13
|
+
"@aws-sdk/client-location": "^3.970.0",
|
|
12
14
|
"@aws-sdk/client-resource-groups-tagging-api": "^3.1033.0",
|
|
13
15
|
"@aws-sdk/client-s3": "^3.1033.0",
|
|
14
16
|
"@aws-sdk/client-secrets-manager": "^3.1033.0",
|
|
@@ -18,7 +20,7 @@
|
|
|
18
20
|
"@aws-sdk/lib-dynamodb": "^3.1033.0",
|
|
19
21
|
"@aws-sdk/lib-storage": "^3.1033.0",
|
|
20
22
|
"@smithy/node-http-handler": "^4.5.3",
|
|
21
|
-
"@reventlessdev/rescript-node": "2.0.0-alpha.
|
|
23
|
+
"@reventlessdev/rescript-node": "2.0.0-alpha.6"
|
|
22
24
|
},
|
|
23
25
|
"devDependencies": {
|
|
24
26
|
"rescript": "12.3.0"
|
|
@@ -115,3 +115,39 @@ module AdminRemoveUserFromGroupCommand = {
|
|
|
115
115
|
|
|
116
116
|
let send: t => promise<unit> = command => Raw.send(client(), command)
|
|
117
117
|
}
|
|
118
|
+
|
|
119
|
+
module AdminListGroupsForUserCommand = {
|
|
120
|
+
type t
|
|
121
|
+
|
|
122
|
+
/** `Username` takes the username, any alias attribute, or — for a local user —
|
|
123
|
+
their `sub`, which is the one identifier a verified token always carries.
|
|
124
|
+
A value the pool cannot resolve raises `UserNotFoundException` rather than
|
|
125
|
+
returning an empty group list, so a caller is never mistaken for one holding
|
|
126
|
+
no groups. */
|
|
127
|
+
type input = {
|
|
128
|
+
@as("Username") username: string,
|
|
129
|
+
@as("UserPoolId") userPoolId: string,
|
|
130
|
+
@as("Limit") limit?: int,
|
|
131
|
+
@as("NextToken") nextToken?: string,
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
type group = {@as("GroupName") groupName?: string}
|
|
135
|
+
|
|
136
|
+
type output = {
|
|
137
|
+
@as("Groups") groups?: array<group>,
|
|
138
|
+
@as("NextToken") nextToken?: string,
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
@new @module("@aws-sdk/client-cognito-identity-provider")
|
|
142
|
+
external make: input => t = "AdminListGroupsForUserCommand"
|
|
143
|
+
|
|
144
|
+
module Raw = {
|
|
145
|
+
/**
|
|
146
|
+
see: https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/cognito-identity-provider/command/AdminListGroupsForUserCommand/
|
|
147
|
+
*/
|
|
148
|
+
@send
|
|
149
|
+
external send: (client, t) => promise<output> = "send"
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
let send: t => promise<output> = command => Raw.send(client(), command)
|
|
153
|
+
}
|
|
@@ -59,6 +59,17 @@ let AdminRemoveUserFromGroupCommand = {
|
|
|
59
59
|
send: send$2
|
|
60
60
|
};
|
|
61
61
|
|
|
62
|
+
let Raw$4 = {};
|
|
63
|
+
|
|
64
|
+
function send$3(command) {
|
|
65
|
+
return client().send(command);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
let AdminListGroupsForUserCommand = {
|
|
69
|
+
Raw: Raw$4,
|
|
70
|
+
send: send$3
|
|
71
|
+
};
|
|
72
|
+
|
|
62
73
|
export {
|
|
63
74
|
Raw,
|
|
64
75
|
clientInstance,
|
|
@@ -66,5 +77,6 @@ export {
|
|
|
66
77
|
SignUpCommand,
|
|
67
78
|
AdminAddUserToGroupCommand,
|
|
68
79
|
AdminRemoveUserFromGroupCommand,
|
|
80
|
+
AdminListGroupsForUserCommand,
|
|
69
81
|
}
|
|
70
82
|
/* @smithy/node-http-handler Not a pure module */
|
package/src/Lambda.res
ADDED
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
/*** @aws-sdk/client-lambda
|
|
2
|
+
see: https://docs.aws.amazon.com/lambda/latest/api/Welcome.html
|
|
3
|
+
|
|
4
|
+
Control-plane bindings only — enough to take a function out of service and put
|
|
5
|
+
it back. The seed reset uses them to quiesce a stack's runtimes for the length
|
|
6
|
+
of a wipe: a live runtime that holds state across invocations will write that
|
|
7
|
+
state back over a truncated table, so the wipe has to remove the contention
|
|
8
|
+
rather than race it.
|
|
9
|
+
|
|
10
|
+
Two distinct powers, deliberately kept apart:
|
|
11
|
+
|
|
12
|
+
- `PutFunctionConcurrency`/`DeleteFunctionConcurrency` stop *new* invocations.
|
|
13
|
+
Reserving 0 does not consume account concurrency, and it does not terminate
|
|
14
|
+
an execution environment that already exists — it only stops it being
|
|
15
|
+
invoked again.
|
|
16
|
+
- `UpdateFunctionConfiguration` is what actually discards existing execution
|
|
17
|
+
environments: after a configuration change, later invocations run in new
|
|
18
|
+
ones. That is the documented way to drop whatever a warm container was
|
|
19
|
+
holding; a concurrency change is not.
|
|
20
|
+
|
|
21
|
+
Like `ResourceGroupsTaggingApi` and unlike the memoised clients here, the
|
|
22
|
+
caller passes a client so the region is explicit.
|
|
23
|
+
*/
|
|
24
|
+
type client
|
|
25
|
+
|
|
26
|
+
module Raw = {
|
|
27
|
+
type options = {region?: string}
|
|
28
|
+
@module("@aws-sdk/client-lambda") @new
|
|
29
|
+
external client: (~options: options=?, unit) => client = "LambdaClient"
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
let client = (~region: option<string>=?, ()): client => Raw.client(~options={region: ?region}, ())
|
|
33
|
+
|
|
34
|
+
/** A function's environment variables, in the shape both the get and the update
|
|
35
|
+
use. `variables` absent and `variables` empty are different: sending an empty
|
|
36
|
+
map on an update CLEARS every variable. */
|
|
37
|
+
type environment = {@as("Variables") variables?: dict<string>}
|
|
38
|
+
|
|
39
|
+
module GetFunctionConfigurationCommand = {
|
|
40
|
+
/*** see: https://docs.aws.amazon.com/lambda/latest/api/API_GetFunctionConfiguration.html */
|
|
41
|
+
|
|
42
|
+
type t
|
|
43
|
+
|
|
44
|
+
type input = {@as("FunctionName") functionName: string}
|
|
45
|
+
|
|
46
|
+
type output = {
|
|
47
|
+
@as("$metadata") metadata: Metadata.t,
|
|
48
|
+
@as("FunctionName") functionName?: string,
|
|
49
|
+
@as("Environment") environment?: environment,
|
|
50
|
+
/** "Successful" | "Failed" | "InProgress" — absent on a function that has
|
|
51
|
+
never been updated. A second update while this reads "InProgress" is
|
|
52
|
+
rejected with ResourceConflictException, so callers poll it. */
|
|
53
|
+
@as("LastUpdateStatus")
|
|
54
|
+
lastUpdateStatus?: string,
|
|
55
|
+
@as("LastUpdateStatusReason") lastUpdateStatusReason?: string,
|
|
56
|
+
@as("State") state?: string,
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
@new @module("@aws-sdk/client-lambda")
|
|
60
|
+
external make: input => t = "GetFunctionConfigurationCommand"
|
|
61
|
+
|
|
62
|
+
@send external send: (client, t) => promise<output> = "send"
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
module UpdateFunctionConfigurationCommand = {
|
|
66
|
+
/*** see: https://docs.aws.amazon.com/lambda/latest/api/API_UpdateFunctionConfiguration.html
|
|
67
|
+
|
|
68
|
+
Only the fields a caller sends are changed. Sending `environment` replaces
|
|
69
|
+
the whole variable map, so an update that means to add one variable must
|
|
70
|
+
send the existing ones alongside it. */
|
|
71
|
+
|
|
72
|
+
type t
|
|
73
|
+
|
|
74
|
+
type input = {
|
|
75
|
+
@as("FunctionName") functionName: string,
|
|
76
|
+
@as("Environment") environment?: environment,
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
type output = {
|
|
80
|
+
@as("$metadata") metadata: Metadata.t,
|
|
81
|
+
@as("FunctionName") functionName?: string,
|
|
82
|
+
@as("LastUpdateStatus") lastUpdateStatus?: string,
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
@new @module("@aws-sdk/client-lambda")
|
|
86
|
+
external make: input => t = "UpdateFunctionConfigurationCommand"
|
|
87
|
+
|
|
88
|
+
@send external send: (client, t) => promise<output> = "send"
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
module GetFunctionConcurrencyCommand = {
|
|
92
|
+
/*** see: https://docs.aws.amazon.com/lambda/latest/api/API_GetFunctionConcurrency.html
|
|
93
|
+
|
|
94
|
+
`reservedConcurrentExecutions` is absent when the function has no reservation
|
|
95
|
+
at all — which is a different state from a reservation of 0, and the one a
|
|
96
|
+
restore has to be able to put back. */
|
|
97
|
+
|
|
98
|
+
type t
|
|
99
|
+
|
|
100
|
+
type input = {@as("FunctionName") functionName: string}
|
|
101
|
+
|
|
102
|
+
type output = {
|
|
103
|
+
@as("$metadata") metadata: Metadata.t,
|
|
104
|
+
@as("ReservedConcurrentExecutions") reservedConcurrentExecutions?: int,
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
@new @module("@aws-sdk/client-lambda")
|
|
108
|
+
external make: input => t = "GetFunctionConcurrencyCommand"
|
|
109
|
+
|
|
110
|
+
@send external send: (client, t) => promise<output> = "send"
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
module PutFunctionConcurrencyCommand = {
|
|
114
|
+
/*** see: https://docs.aws.amazon.com/lambda/latest/api/API_PutFunctionConcurrency.html */
|
|
115
|
+
|
|
116
|
+
type t
|
|
117
|
+
|
|
118
|
+
type input = {
|
|
119
|
+
@as("FunctionName") functionName: string,
|
|
120
|
+
@as("ReservedConcurrentExecutions") reservedConcurrentExecutions: int,
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
type output = {
|
|
124
|
+
@as("$metadata") metadata: Metadata.t,
|
|
125
|
+
@as("ReservedConcurrentExecutions") reservedConcurrentExecutions?: int,
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
@new @module("@aws-sdk/client-lambda")
|
|
129
|
+
external make: input => t = "PutFunctionConcurrencyCommand"
|
|
130
|
+
|
|
131
|
+
@send external send: (client, t) => promise<output> = "send"
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
module DeleteFunctionConcurrencyCommand = {
|
|
135
|
+
/*** see: https://docs.aws.amazon.com/lambda/latest/api/API_DeleteFunctionConcurrency.html
|
|
136
|
+
|
|
137
|
+
Removes the reservation entirely, returning the function to the account's
|
|
138
|
+
unreserved pool — the restore for a function that had no reservation before. */
|
|
139
|
+
|
|
140
|
+
type t
|
|
141
|
+
|
|
142
|
+
type input = {@as("FunctionName") functionName: string}
|
|
143
|
+
|
|
144
|
+
type output = {@as("$metadata") metadata: Metadata.t}
|
|
145
|
+
|
|
146
|
+
@new @module("@aws-sdk/client-lambda")
|
|
147
|
+
external make: input => t = "DeleteFunctionConcurrencyCommand"
|
|
148
|
+
|
|
149
|
+
@send external send: (client, t) => promise<output> = "send"
|
|
150
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
|
+
|
|
3
|
+
import * as ClientLambda from "@aws-sdk/client-lambda";
|
|
4
|
+
|
|
5
|
+
let Raw = {};
|
|
6
|
+
|
|
7
|
+
function client(region, param) {
|
|
8
|
+
return new ClientLambda.LambdaClient({
|
|
9
|
+
region: region
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
let GetFunctionConfigurationCommand = {};
|
|
14
|
+
|
|
15
|
+
let UpdateFunctionConfigurationCommand = {};
|
|
16
|
+
|
|
17
|
+
let GetFunctionConcurrencyCommand = {};
|
|
18
|
+
|
|
19
|
+
let PutFunctionConcurrencyCommand = {};
|
|
20
|
+
|
|
21
|
+
let DeleteFunctionConcurrencyCommand = {};
|
|
22
|
+
|
|
23
|
+
export {
|
|
24
|
+
Raw,
|
|
25
|
+
client,
|
|
26
|
+
GetFunctionConfigurationCommand,
|
|
27
|
+
UpdateFunctionConfigurationCommand,
|
|
28
|
+
GetFunctionConcurrencyCommand,
|
|
29
|
+
PutFunctionConcurrencyCommand,
|
|
30
|
+
DeleteFunctionConcurrencyCommand,
|
|
31
|
+
}
|
|
32
|
+
/* @aws-sdk/client-lambda Not a pure module */
|
package/src/Location.res
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
// Bindings for Amazon Location Service (`@aws-sdk/client-location`).
|
|
2
|
+
//
|
|
3
|
+
// Both callers of this service want different things from the same call, which
|
|
4
|
+
// is why the bindings live here rather than inside either of them: the browser's
|
|
5
|
+
// geocoder Function URL wants a best-effort list to show a human, and an
|
|
6
|
+
// unattended translator wants to know *how sure* the service is before it writes
|
|
7
|
+
// a coordinate into an event log.
|
|
8
|
+
|
|
9
|
+
type client
|
|
10
|
+
|
|
11
|
+
module Raw = {
|
|
12
|
+
@module("@aws-sdk/client-location") @new
|
|
13
|
+
external client: unit => client = "LocationClient"
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
let clientInstance = ref(None)
|
|
17
|
+
|
|
18
|
+
let client = () => {
|
|
19
|
+
switch clientInstance.contents {
|
|
20
|
+
| None =>
|
|
21
|
+
let c = Raw.client()
|
|
22
|
+
clientInstance := Some(c)
|
|
23
|
+
c
|
|
24
|
+
| Some(c) => c
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
module SearchPlaceIndexForTextCommand = {
|
|
29
|
+
/*** see: https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/location/command/SearchPlaceIndexForTextCommand/ */
|
|
30
|
+
|
|
31
|
+
type t
|
|
32
|
+
|
|
33
|
+
/** GeoJSON order — `[lng, lat]`, longitude first. Read it through
|
|
34
|
+
`Geometry.point` rather than indexing it at a call site; the order is the
|
|
35
|
+
single most reliable source of wrong-hemisphere markers in this domain. */
|
|
36
|
+
type point = array<float>
|
|
37
|
+
|
|
38
|
+
type geometry = {@as("Point") point?: point}
|
|
39
|
+
|
|
40
|
+
type place = {
|
|
41
|
+
@as("Label") label?: string,
|
|
42
|
+
@as("Geometry") geometry?: geometry,
|
|
43
|
+
@as("Country") country?: string,
|
|
44
|
+
@as("PostalCode") postalCode?: string,
|
|
45
|
+
@as("Municipality") municipality?: string,
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
type result = {
|
|
49
|
+
@as("Place") place?: place,
|
|
50
|
+
/** How well this result matches the query, 0…1 — present on results from
|
|
51
|
+
Esri and HERE index configurations and absent on some others, which is
|
|
52
|
+
why it is optional rather than defaulted. A caller that treats an absent
|
|
53
|
+
relevance as a perfect match is asserting something the service did not
|
|
54
|
+
say. */
|
|
55
|
+
@as("Relevance") relevance?: float,
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
type input = {
|
|
59
|
+
@as("IndexName") indexName: string,
|
|
60
|
+
@as("Text") text: string,
|
|
61
|
+
@as("MaxResults") maxResults?: int,
|
|
62
|
+
@as("Language") language?: string,
|
|
63
|
+
@as("FilterCountries") filterCountries?: array<string>,
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
type output = {
|
|
67
|
+
@as("$metadata") metadata: Metadata.t,
|
|
68
|
+
@as("Results") results?: array<result>,
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
@new @module("@aws-sdk/client-location")
|
|
72
|
+
external make: input => t = "SearchPlaceIndexForTextCommand"
|
|
73
|
+
|
|
74
|
+
module Raw = {
|
|
75
|
+
@send
|
|
76
|
+
external send: (client, t) => promise<output> = "send"
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
let send: t => promise<output> = input => Raw.send(client(), input)
|
|
80
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
|
+
|
|
3
|
+
import * as Primitive_option from "@rescript/runtime/lib/es6/Primitive_option.js";
|
|
4
|
+
import * as ClientLocation from "@aws-sdk/client-location";
|
|
5
|
+
|
|
6
|
+
let Raw = {};
|
|
7
|
+
|
|
8
|
+
let clientInstance = {
|
|
9
|
+
contents: undefined
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
function client() {
|
|
13
|
+
let c = clientInstance.contents;
|
|
14
|
+
if (c !== undefined) {
|
|
15
|
+
return Primitive_option.valFromOption(c);
|
|
16
|
+
}
|
|
17
|
+
let c$1 = new ClientLocation.LocationClient();
|
|
18
|
+
clientInstance.contents = Primitive_option.some(c$1);
|
|
19
|
+
return c$1;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
let Raw$1 = {};
|
|
23
|
+
|
|
24
|
+
function send(input) {
|
|
25
|
+
return client().send(input);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
let SearchPlaceIndexForTextCommand = {
|
|
29
|
+
Raw: Raw$1,
|
|
30
|
+
send: send
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export {
|
|
34
|
+
Raw,
|
|
35
|
+
clientInstance,
|
|
36
|
+
client,
|
|
37
|
+
SearchPlaceIndexForTextCommand,
|
|
38
|
+
}
|
|
39
|
+
/* @aws-sdk/client-location Not a pure module */
|
package/src/S3.res
CHANGED
|
@@ -46,6 +46,16 @@ module GetObjectCommand = {
|
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
let send: t => promise<output> = input => Raw.send(client(), input)
|
|
49
|
+
|
|
50
|
+
// AWS SDK v3 returns the object body as an SdkStream that adds
|
|
51
|
+
// `transformToString()` (UTF-8 by default) on top of the Node Readable the
|
|
52
|
+
// output type reflects. Bind the method here rather than inline at the call site.
|
|
53
|
+
@send
|
|
54
|
+
external transformToString: NodeStreams.Readable.t => promise<string> = "transformToString"
|
|
55
|
+
|
|
56
|
+
/** Fetch an object and return its body as a UTF-8 string. */
|
|
57
|
+
let getString: (~bucket: string, ~key: string) => promise<string> = (~bucket, ~key) =>
|
|
58
|
+
make({bucket, key})->send->Promise.then(output => output.body->transformToString)
|
|
49
59
|
}
|
|
50
60
|
|
|
51
61
|
module ListObjectVersionsCommand = {
|
|
@@ -95,6 +105,65 @@ module ListObjectVersionsCommand = {
|
|
|
95
105
|
let send: t => promise<output> = input => Raw.send(client(), input)
|
|
96
106
|
}
|
|
97
107
|
|
|
108
|
+
/** An object tag. Shared by the get/put tagging commands, which exchange the
|
|
109
|
+
same `TagSet` — reading, filtering and writing back is the only way to remove
|
|
110
|
+
one tag without discarding the rest. */
|
|
111
|
+
type tag = {
|
|
112
|
+
@as("Key") key: string,
|
|
113
|
+
@as("Value") value: string,
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
module GetObjectTaggingCommand = {
|
|
117
|
+
type t
|
|
118
|
+
|
|
119
|
+
type input = {
|
|
120
|
+
@as("Bucket") bucket: string,
|
|
121
|
+
@as("Key") key: string,
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
/** An object with no tags returns an empty `TagSet`, not an absent one — but
|
|
125
|
+
the field is optional here anyway, since a caller that treats "absent" and
|
|
126
|
+
"empty" differently would be reading a distinction S3 does not make. */
|
|
127
|
+
type output = {@as("TagSet") tagSet?: array<tag>}
|
|
128
|
+
|
|
129
|
+
@new @module("@aws-sdk/client-s3")
|
|
130
|
+
external make: input => t = "GetObjectTaggingCommand"
|
|
131
|
+
|
|
132
|
+
module Raw = {
|
|
133
|
+
@send
|
|
134
|
+
external send: (client, t) => promise<output> = "send"
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
let send: t => promise<output> = input => Raw.send(client(), input)
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
module PutObjectTaggingCommand = {
|
|
141
|
+
type t
|
|
142
|
+
|
|
143
|
+
/** Replaces the object's whole tag set — there is no partial update, so
|
|
144
|
+
removing one tag means putting back the others. An empty `tagSet` clears
|
|
145
|
+
every tag and is a valid, idempotent call on an already-untagged object. */
|
|
146
|
+
type tagging = {@as("TagSet") tagSet: array<tag>}
|
|
147
|
+
|
|
148
|
+
type input = {
|
|
149
|
+
@as("Bucket") bucket: string,
|
|
150
|
+
@as("Key") key: string,
|
|
151
|
+
@as("Tagging") tagging: tagging,
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
type output = {@as("VersionId") versionId?: string}
|
|
155
|
+
|
|
156
|
+
@new @module("@aws-sdk/client-s3")
|
|
157
|
+
external make: input => t = "PutObjectTaggingCommand"
|
|
158
|
+
|
|
159
|
+
module Raw = {
|
|
160
|
+
@send
|
|
161
|
+
external send: (client, t) => promise<output> = "send"
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
let send: t => promise<output> = input => Raw.send(client(), input)
|
|
165
|
+
}
|
|
166
|
+
|
|
98
167
|
module DeleteObjectsCommand = {
|
|
99
168
|
/*** delete up to 1000 objects (each by key, optionally a specific version) in
|
|
100
169
|
one call. Used by the seed reset to empty a bucket page by page.
|
package/src/S3.res.mjs
CHANGED
|
@@ -25,9 +25,18 @@ function send(input) {
|
|
|
25
25
|
return client().send(input);
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
+
function getString(bucket, key) {
|
|
29
|
+
let input = new ClientS3.GetObjectCommand({
|
|
30
|
+
Bucket: bucket,
|
|
31
|
+
Key: key
|
|
32
|
+
});
|
|
33
|
+
return client().send(input).then(output => output.Body.transformToString());
|
|
34
|
+
}
|
|
35
|
+
|
|
28
36
|
let GetObjectCommand = {
|
|
29
37
|
Raw: Raw$1,
|
|
30
|
-
send: send
|
|
38
|
+
send: send,
|
|
39
|
+
getString: getString
|
|
31
40
|
};
|
|
32
41
|
|
|
33
42
|
let Raw$2 = {};
|
|
@@ -47,7 +56,7 @@ function send$2(input) {
|
|
|
47
56
|
return client().send(input);
|
|
48
57
|
}
|
|
49
58
|
|
|
50
|
-
let
|
|
59
|
+
let GetObjectTaggingCommand = {
|
|
51
60
|
Raw: Raw$3,
|
|
52
61
|
send: send$2
|
|
53
62
|
};
|
|
@@ -58,17 +67,39 @@ function send$3(input) {
|
|
|
58
67
|
return client().send(input);
|
|
59
68
|
}
|
|
60
69
|
|
|
61
|
-
let
|
|
70
|
+
let PutObjectTaggingCommand = {
|
|
62
71
|
Raw: Raw$4,
|
|
63
72
|
send: send$3
|
|
64
73
|
};
|
|
65
74
|
|
|
75
|
+
let Raw$5 = {};
|
|
76
|
+
|
|
77
|
+
function send$4(input) {
|
|
78
|
+
return client().send(input);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
let DeleteObjectsCommand = {
|
|
82
|
+
Raw: Raw$5,
|
|
83
|
+
send: send$4
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
let Raw$6 = {};
|
|
87
|
+
|
|
88
|
+
function send$5(input) {
|
|
89
|
+
return client().send(input);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
let PutObjectCommand = {
|
|
93
|
+
Raw: Raw$6,
|
|
94
|
+
send: send$5
|
|
95
|
+
};
|
|
96
|
+
|
|
66
97
|
let CompleteMultipartUploadCommand = {};
|
|
67
98
|
|
|
68
|
-
let Raw$
|
|
99
|
+
let Raw$7 = {};
|
|
69
100
|
|
|
70
101
|
let Upload = {
|
|
71
|
-
Raw: Raw$
|
|
102
|
+
Raw: Raw$7
|
|
72
103
|
};
|
|
73
104
|
|
|
74
105
|
export {
|
|
@@ -77,6 +108,8 @@ export {
|
|
|
77
108
|
client,
|
|
78
109
|
GetObjectCommand,
|
|
79
110
|
ListObjectVersionsCommand,
|
|
111
|
+
GetObjectTaggingCommand,
|
|
112
|
+
PutObjectTaggingCommand,
|
|
80
113
|
DeleteObjectsCommand,
|
|
81
114
|
PutObjectCommand,
|
|
82
115
|
CompleteMultipartUploadCommand,
|