@reventlessdev/rescript-aws-sdk 3.0.0-alpha.0 → 3.0.0-alpha.2

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,20 @@
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.2 (2026-08-02)
7
+
8
+ ### Features
9
+
10
+ * **aws:** S3 GetObject->string binding + structure offload resolver ([1274bcc](https://github.com/ReventlessDev/reventless-core/commit/1274bcce29f8a1b70db362a10585c508710e7b56))
11
+
12
+
13
+ # 3.0.0-alpha.1 (2026-08-02)
14
+
15
+ ### Features
16
+
17
+ * **aws,core,spec,seed-aws:** expire uploads nobody committed a reference to ([f63e84c](https://github.com/ReventlessDev/reventless-core/commit/f63e84c1a11cc350b799a6f69a2e7427cf1ea6e9))
18
+
19
+
6
20
  # 3.0.0-alpha.0 (2026-07-31)
7
21
 
8
22
  * 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.0",
3
+ "version": "3.0.0-alpha.2",
4
4
  "description": "ReScript bindings for aws-sdk",
5
5
  "license": "Apache-2.0",
6
6
  "dependencies": {
@@ -18,7 +18,7 @@
18
18
  "@aws-sdk/lib-dynamodb": "^3.1033.0",
19
19
  "@aws-sdk/lib-storage": "^3.1033.0",
20
20
  "@smithy/node-http-handler": "^4.5.3",
21
- "@reventlessdev/rescript-node": "2.0.0-alpha.0"
21
+ "@reventlessdev/rescript-node": "2.0.0-alpha.1"
22
22
  },
23
23
  "devDependencies": {
24
24
  "rescript": "12.3.0"
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 DeleteObjectsCommand = {
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 PutObjectCommand = {
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$5 = {};
99
+ let Raw$7 = {};
69
100
 
70
101
  let Upload = {
71
- Raw: Raw$5
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,