@procedures/s3 0.48.0 → 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 CHANGED
@@ -1,5 +1,13 @@
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
+
3
11
  ## 0.48.0
4
12
 
5
13
  ### 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