@procedures/s3 0.47.2 → 0.48.1
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 +23 -0
- package/README.md +26 -1
- package/dist/.tsbuildinfo +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/module.d.ts.map +1 -1
- package/dist/module.js +11 -7
- package/dist/module.js.map +1 -1
- package/dist/procedures/s3/upload.d.ts +20 -3
- package/dist/procedures/s3/upload.d.ts.map +1 -1
- package/dist/procedures/s3/upload.js +115 -20
- package/dist/procedures/s3/upload.js.map +1 -1
- package/dist/types.d.ts +30 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +29 -0
- package/dist/types.js.map +1 -1
- package/package.json +4 -4
- package/src/index.ts +4 -0
- package/src/module.ts +16 -11
- package/src/procedures/s3/upload.ts +132 -26
- package/src/types.ts +52 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,28 @@
|
|
|
1
1
|
# @procedures/s3
|
|
2
2
|
|
|
3
|
+
## 0.48.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- dd1a84b: `s3.upload` takes a new input `sourcePath`, the path of a file. The upload reads one part at a time, so the memory stays bounded, and the object is whole or absent. This is a PATCH by the rule for a new feature before 1.0.0: `S3UploadInput` and `S3UploadInputSchema` do not change. The new exports are `S3UploadFileInput` with its schema, `S3UploadCall` and `S3UploadCallSchema`. A call with `body` and `sourcePath`, or with neither, fails at the type and at run time. `s3Upload` takes `S3UploadCall`, so a value of `S3UploadInput` is still a call. Under the root of a host, `sourcePath` is in the root. The effects of `s3.upload` now name `fs` in `reads`.
|
|
8
|
+
- Updated dependencies [2d7edae]
|
|
9
|
+
- @procedures/client@0.48.1
|
|
10
|
+
|
|
11
|
+
## 0.48.0
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- 17a18ec: The source now uses only syntax that a type stripper erases, so the setting `erasableSyntaxOnly` of `@mark1russell7/cue` 2.1.1 stays on. Each enum is now a constant object with a type of the same name. Each parameter property is now a field and an assignment in the constructor.
|
|
16
|
+
|
|
17
|
+
**Breaking.** MINOR before 1.0.0: `ErrorCategory`, `ErrorSeverity` and `WebSocketState` are now constant objects. Their names and values stay the same, and each member stays usable as a type. A member is no longer a constant expression: `enum E { A = ErrorSeverity.WARNING }` gives TS18033, and a `const enum` gives TS2474. Also, a string with the value of a member now fits the type of the set.
|
|
18
|
+
|
|
19
|
+
**Migration.** In an enum initializer, write the value in place of the member, for example `"warning"`, or use a constant object. Other uses need no change. The site and the known apps need no change.
|
|
20
|
+
- Updated dependencies [17a18ec]
|
|
21
|
+
- Updated dependencies [06088f9]
|
|
22
|
+
- Updated dependencies [71f9c6e]
|
|
23
|
+
- Updated dependencies [c839add]
|
|
24
|
+
- @procedures/client@0.48.0
|
|
25
|
+
|
|
3
26
|
## 0.47.2
|
|
4
27
|
|
|
5
28
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -175,8 +175,25 @@ console.log(result.etag);
|
|
|
175
175
|
console.log(result.location); // s3://my-bucket/files/document.pdf
|
|
176
176
|
```
|
|
177
177
|
|
|
178
|
+
To send a large file, give `sourcePath` in place of `body`:
|
|
179
|
+
|
|
180
|
+
```typescript
|
|
181
|
+
await client.exec(["s3", "upload"], {
|
|
182
|
+
bucket: "my-bucket",
|
|
183
|
+
key: "backups/archive.tar.gz",
|
|
184
|
+
sourcePath: "/var/backups/archive.tar.gz",
|
|
185
|
+
});
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
- The memory that the upload holds is one part: 8 MiB. For a file above 80,000 MiB, a part is the size of the file divided by 10,000.
|
|
189
|
+
- A file of one part or less goes in one put. A larger file goes in a multipart upload, one part at a time.
|
|
190
|
+
- The object is whole or absent. On a failure, the upload aborts and the call gives the first error.
|
|
191
|
+
- When the abort also fails, S3 keeps the parts. A lifecycle rule of the bucket removes them.
|
|
192
|
+
- The call fails when the size or the modification time of the file changes during the upload.
|
|
193
|
+
|
|
178
194
|
**Input:**
|
|
179
195
|
```typescript
|
|
196
|
+
// A call gives one of these two forms. A call with body and sourcePath, or with neither, fails.
|
|
180
197
|
interface S3UploadInput {
|
|
181
198
|
bucket: string; // S3 bucket name
|
|
182
199
|
key: string; // Object key (path in bucket)
|
|
@@ -185,6 +202,14 @@ interface S3UploadInput {
|
|
|
185
202
|
base64?: boolean; // If true, body is base64 encoded
|
|
186
203
|
metadata?: Record<string, string>; // Custom metadata
|
|
187
204
|
}
|
|
205
|
+
|
|
206
|
+
interface S3UploadFileInput {
|
|
207
|
+
bucket: string; // S3 bucket name
|
|
208
|
+
key: string; // Object key (path in bucket)
|
|
209
|
+
sourcePath: string; // The path of a file to upload
|
|
210
|
+
contentType?: string; // MIME type
|
|
211
|
+
metadata?: Record<string, string>; // Custom metadata
|
|
212
|
+
}
|
|
188
213
|
```
|
|
189
214
|
|
|
190
215
|
**Output:**
|
|
@@ -922,7 +947,7 @@ npm run clean
|
|
|
922
947
|
|
|
923
948
|
## The root of the files
|
|
924
949
|
|
|
925
|
-
Under the root of a host (`mark --fs-root`, `procedure-server --fs-root`, `MCP_FS_ROOT`), `s3.download` writes its `destPath` only in the root. A relative `destPath` starts at the root. `s3.presign` has no path input, and the other procedures reach no file. The AWS SDK reads the credentials of the host, also under a root.
|
|
950
|
+
Under the root of a host (`mark --fs-root`, `procedure-server --fs-root`, `MCP_FS_ROOT`), `s3.download` writes its `destPath` only in the root, and `s3.upload` reads its `sourcePath` only in the root. A relative `destPath` or `sourcePath` starts at the root. `s3.presign` has no path input, and the other procedures reach no file. The AWS SDK reads the credentials of the host, also under a root.
|
|
926
951
|
|
|
927
952
|
The rules and the table of the procedures are in [CAPABILITIES-2026-10.md](../documentation/CAPABILITIES-2026-10.md#the-root-of-the-files-roadmap-r33).
|
|
928
953
|
|