@procedures/s3 0.33.0 → 0.34.0
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 +25 -0
- package/dist/.tsbuildinfo +1 -1
- package/dist/module.d.ts.map +1 -1
- package/dist/module.js +25 -25
- package/dist/module.js.map +1 -1
- package/package.json +3 -3
- package/src/module.ts +25 -25
package/dist/module.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../src/module.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../src/module.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAmD,KAAK,eAAe,EAAuC,KAAK,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAqRxK;;;GAGG;AACH,eAAO,MAAM,QAAQ,EAAE,eAanB,CAAC;eAEU,QAAQ;AAEvB;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,GAAE,iBAAsC,GAAG,IAAI,CAE3F"}
|
package/dist/module.js
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* s3.multipart.* procedures.
|
|
8
8
|
* Credentials are loaded from environment variables (AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY).
|
|
9
9
|
*/
|
|
10
|
-
import { createProcedure,
|
|
10
|
+
import { createProcedure, defineModule, PROCEDURE_REGISTRY, registerModules } from "@procedures/client";
|
|
11
11
|
import { s3Upload, s3Download, s3List, s3ListAll, s3Delete, s3MultipartInit, s3MultipartUpload, s3MultipartComplete, s3MultipartAbort, } from "./procedures/s3/index.js";
|
|
12
12
|
import { S3UploadInputSchema, S3DownloadInputSchema, S3ListInputSchema, S3ListAllInputSchema, S3DeleteInputSchema, S3MultipartInitInputSchema, S3MultipartUploadInputSchema, S3MultipartCompleteInputSchema, S3MultipartAbortInputSchema, S3UploadOutputSchema, S3DownloadOutputSchema, S3ListOutputSchema, S3ListAllOutputSchema, S3DeleteOutputSchema, S3MultipartInitOutputSchema, S3MultipartUploadOutputSchema, S3MultipartCompleteOutputSchema, S3MultipartAbortOutputSchema, } from "./types.js";
|
|
13
13
|
import { s3Head } from "./procedures/s3/head.js";
|
|
@@ -19,8 +19,8 @@ import { S3HeadInputSchema, S3HeadOutputSchema, S3CopyInputSchema, S3CopyOutputS
|
|
|
19
19
|
// =============================================================================
|
|
20
20
|
const s3UploadProcedure = createProcedure()
|
|
21
21
|
.path(["s3", "upload"])
|
|
22
|
-
.input(
|
|
23
|
-
.output(
|
|
22
|
+
.input(S3UploadInputSchema)
|
|
23
|
+
.output(S3UploadOutputSchema)
|
|
24
24
|
.meta({
|
|
25
25
|
description: "Upload content to S3 bucket",
|
|
26
26
|
// A put replaces the object of an existing key
|
|
@@ -44,8 +44,8 @@ const DOWNLOAD_IN_A_ROOT = { paths: ["destPath"] };
|
|
|
44
44
|
const PRESIGN_IN_A_ROOT = {};
|
|
45
45
|
const s3DownloadProcedure = createProcedure()
|
|
46
46
|
.path(["s3", "download"])
|
|
47
|
-
.input(
|
|
48
|
-
.output(
|
|
47
|
+
.input(S3DownloadInputSchema)
|
|
48
|
+
.output(S3DownloadOutputSchema)
|
|
49
49
|
.meta({
|
|
50
50
|
description: "Download content from S3 bucket",
|
|
51
51
|
// With destPath, it replaces the file at that path
|
|
@@ -60,8 +60,8 @@ const s3DownloadProcedure = createProcedure()
|
|
|
60
60
|
.build();
|
|
61
61
|
const s3ListProcedure = createProcedure()
|
|
62
62
|
.path(["s3", "list"])
|
|
63
|
-
.input(
|
|
64
|
-
.output(
|
|
63
|
+
.input(S3ListInputSchema)
|
|
64
|
+
.output(S3ListOutputSchema)
|
|
65
65
|
.meta({
|
|
66
66
|
description: "List objects in S3 bucket",
|
|
67
67
|
effects: { reads: ["s3", "network"], writes: [] },
|
|
@@ -74,8 +74,8 @@ const s3ListProcedure = createProcedure()
|
|
|
74
74
|
.build();
|
|
75
75
|
const s3ListAllProcedure = createProcedure()
|
|
76
76
|
.path(["s3", "listAll"])
|
|
77
|
-
.input(
|
|
78
|
-
.output(
|
|
77
|
+
.input(S3ListAllInputSchema)
|
|
78
|
+
.output(S3ListAllOutputSchema)
|
|
79
79
|
.meta({
|
|
80
80
|
description: "List ALL objects in S3 bucket, following continuation tokens (unbounded by 1000)",
|
|
81
81
|
effects: { reads: ["s3", "network"], writes: [] },
|
|
@@ -88,8 +88,8 @@ const s3ListAllProcedure = createProcedure()
|
|
|
88
88
|
.build();
|
|
89
89
|
const s3DeleteProcedure = createProcedure()
|
|
90
90
|
.path(["s3", "delete"])
|
|
91
|
-
.input(
|
|
92
|
-
.output(
|
|
91
|
+
.input(S3DeleteInputSchema)
|
|
92
|
+
.output(S3DeleteOutputSchema)
|
|
93
93
|
.meta({
|
|
94
94
|
description: "Delete object from S3 bucket",
|
|
95
95
|
effects: { reads: ["s3", "network"], writes: ["s3", "network"] },
|
|
@@ -102,8 +102,8 @@ const s3DeleteProcedure = createProcedure()
|
|
|
102
102
|
.build();
|
|
103
103
|
const s3MultipartInitProcedure = createProcedure()
|
|
104
104
|
.path(["s3", "multipart", "init"])
|
|
105
|
-
.input(
|
|
106
|
-
.output(
|
|
105
|
+
.input(S3MultipartInitInputSchema)
|
|
106
|
+
.output(S3MultipartInitOutputSchema)
|
|
107
107
|
.meta({
|
|
108
108
|
description: "Initialize multipart upload for large files",
|
|
109
109
|
// It starts a new upload: the object of the key does not change before the completion
|
|
@@ -117,8 +117,8 @@ const s3MultipartInitProcedure = createProcedure()
|
|
|
117
117
|
.build();
|
|
118
118
|
const s3MultipartUploadProcedure = createProcedure()
|
|
119
119
|
.path(["s3", "multipart", "upload"])
|
|
120
|
-
.input(
|
|
121
|
-
.output(
|
|
120
|
+
.input(S3MultipartUploadInputSchema)
|
|
121
|
+
.output(S3MultipartUploadOutputSchema)
|
|
122
122
|
.meta({
|
|
123
123
|
description: "Upload a part in multipart upload",
|
|
124
124
|
// A part replaces the earlier part with the same number
|
|
@@ -132,8 +132,8 @@ const s3MultipartUploadProcedure = createProcedure()
|
|
|
132
132
|
.build();
|
|
133
133
|
const s3MultipartCompleteProcedure = createProcedure()
|
|
134
134
|
.path(["s3", "multipart", "complete"])
|
|
135
|
-
.input(
|
|
136
|
-
.output(
|
|
135
|
+
.input(S3MultipartCompleteInputSchema)
|
|
136
|
+
.output(S3MultipartCompleteOutputSchema)
|
|
137
137
|
.meta({
|
|
138
138
|
description: "Complete multipart upload by assembling parts",
|
|
139
139
|
// The assembled object replaces the object of an existing key
|
|
@@ -147,8 +147,8 @@ const s3MultipartCompleteProcedure = createProcedure()
|
|
|
147
147
|
.build();
|
|
148
148
|
const s3MultipartAbortProcedure = createProcedure()
|
|
149
149
|
.path(["s3", "multipart", "abort"])
|
|
150
|
-
.input(
|
|
151
|
-
.output(
|
|
150
|
+
.input(S3MultipartAbortInputSchema)
|
|
151
|
+
.output(S3MultipartAbortOutputSchema)
|
|
152
152
|
.meta({
|
|
153
153
|
description: "Abort multipart upload and clean up parts",
|
|
154
154
|
effects: { reads: ["s3", "network"], writes: ["s3", "network"] },
|
|
@@ -162,8 +162,8 @@ const s3MultipartAbortProcedure = createProcedure()
|
|
|
162
162
|
// s3.head, s3.copy and s3.presign (roadmap R44)
|
|
163
163
|
const s3HeadProcedure = createProcedure()
|
|
164
164
|
.path(["s3", "head"])
|
|
165
|
-
.input(
|
|
166
|
-
.output(
|
|
165
|
+
.input(S3HeadInputSchema)
|
|
166
|
+
.output(S3HeadOutputSchema)
|
|
167
167
|
.meta({
|
|
168
168
|
description: "The metadata of an object, without its content (exists: false for a 404)",
|
|
169
169
|
effects: { reads: ["s3", "network"], writes: [] },
|
|
@@ -174,8 +174,8 @@ const s3HeadProcedure = createProcedure()
|
|
|
174
174
|
.build();
|
|
175
175
|
const s3CopyProcedure = createProcedure()
|
|
176
176
|
.path(["s3", "copy"])
|
|
177
|
-
.input(
|
|
178
|
-
.output(
|
|
177
|
+
.input(S3CopyInputSchema)
|
|
178
|
+
.output(S3CopyOutputSchema)
|
|
179
179
|
.meta({
|
|
180
180
|
description: "Copy an object inside S3 (it replaces the destination, unless overwrite is false)",
|
|
181
181
|
// The copy replaces the object of the destination key: destructive. The same input gives the
|
|
@@ -188,8 +188,8 @@ const s3CopyProcedure = createProcedure()
|
|
|
188
188
|
.build();
|
|
189
189
|
const s3PresignProcedure = createProcedure()
|
|
190
190
|
.path(["s3", "presign"])
|
|
191
|
-
.input(
|
|
192
|
-
.output(
|
|
191
|
+
.input(S3PresignInputSchema)
|
|
192
|
+
.output(S3PresignOutputSchema)
|
|
193
193
|
.meta({
|
|
194
194
|
description: "A presigned URL for a GET or a PUT of an object, with an expiry in seconds",
|
|
195
195
|
// It sends no request to S3. It reads the credentials: the environment, the AWS files of the
|
package/dist/module.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module.js","sourceRoot":"","sources":["../src/module.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,eAAe,EAAE,
|
|
1
|
+
{"version":3,"file":"module.js","sourceRoot":"","sources":["../src/module.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,eAAe,EAAE,YAAY,EAA0C,kBAAkB,EAAE,eAAe,EAA0B,MAAM,oBAAoB,CAAC;AACxK,OAAO,EACL,QAAQ,EACR,UAAU,EACV,MAAM,EACN,SAAS,EACT,QAAQ,EACR,eAAe,EACf,iBAAiB,EACjB,mBAAmB,EACnB,gBAAgB,GACjB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,mBAAmB,EACnB,qBAAqB,EACrB,iBAAiB,EACjB,oBAAoB,EACpB,mBAAmB,EACnB,0BAA0B,EAC1B,4BAA4B,EAC5B,8BAA8B,EAC9B,2BAA2B,EAmB3B,oBAAoB,EACpB,sBAAsB,EACtB,kBAAkB,EAClB,qBAAqB,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K,EAAE,CAAC,IAAI,EAAE,SAAS,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE;IACjD,MAAM,EAAE,iBAAiB;IACzB,MAAM,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG,EAAE;IAC9D,MAAM,EAAE,MAAM;CACf,CAAC;KACD,OAAO,CAAC,KAAK,EAAE,KAAqB,EAAE,GAAG,EAA4B,EAAE,CAAC,SAAS,CAAC,KAAK,EAAE,GAAG,CAAC,UAAU,CAAC,CAAC;KACzG,KAAK,EAAE,CAAC;AAEX,gFAAgF;AAChF,eAAe;AACf,gFAAgF;AAEhF;;;GAGG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAoB,YAAY,CAAC,gBAAgB,EAAE;IACpE,iBAAiB;IACjB,mBAAmB;IACnB,eAAe;IACf,kBAAkB;IAClB,iBAAiB;IACjB,wBAAwB;IACxB,0BAA0B;IAC1B,4BAA4B;IAC5B,yBAAyB;IACzB,eAAe;IACf,eAAe;IACf,kBAAkB;CACnB,CAAC,CAAC;AAEL,eAAe,QAAQ,CAAC;AAExB;;;;GAIG;AACH,MAAM,UAAU,oBAAoB,CAAC,QAAQ,GAAsB,kBAAkB;IACnF,eAAe,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;AACxC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/package",
|
|
3
3
|
"name": "@procedures/s3",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.34.0",
|
|
5
5
|
"description": "AWS S3 as typed procedures: upload, download with safe part files, list, head, copy, presigned URLs, delete and multipart uploads.",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"s3",
|
|
@@ -62,11 +62,11 @@
|
|
|
62
62
|
"dependencies": {
|
|
63
63
|
"@aws-sdk/client-s3": "^3.705.0",
|
|
64
64
|
"@aws-sdk/s3-request-presigner": "3.1147.0",
|
|
65
|
-
"@procedures/client": "0.
|
|
65
|
+
"@procedures/client": "0.34.0",
|
|
66
66
|
"zod": "^4.6.5"
|
|
67
67
|
},
|
|
68
68
|
"devDependencies": {
|
|
69
|
-
"@procedures/fs": "0.
|
|
69
|
+
"@procedures/fs": "0.34.0",
|
|
70
70
|
"typescript": "^7.0.2",
|
|
71
71
|
"@types/node": "^22.0.0",
|
|
72
72
|
"@mark1russell7/cue": "^1.0.0",
|
package/src/module.ts
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* Credentials are loaded from environment variables (AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY).
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
import { createProcedure,
|
|
11
|
+
import { createProcedure, defineModule, type FsRootRules, type ProcedureModule, PROCEDURE_REGISTRY, registerModules, type ProcedureRegistry } from "@procedures/client";
|
|
12
12
|
import {
|
|
13
13
|
s3Upload,
|
|
14
14
|
s3Download,
|
|
@@ -82,8 +82,8 @@ import {
|
|
|
82
82
|
|
|
83
83
|
const s3UploadProcedure = createProcedure()
|
|
84
84
|
.path(["s3", "upload"])
|
|
85
|
-
.input(
|
|
86
|
-
.output(
|
|
85
|
+
.input(S3UploadInputSchema)
|
|
86
|
+
.output(S3UploadOutputSchema)
|
|
87
87
|
.meta({
|
|
88
88
|
description: "Upload content to S3 bucket",
|
|
89
89
|
// A put replaces the object of an existing key
|
|
@@ -111,8 +111,8 @@ const PRESIGN_IN_A_ROOT: FsRootRules = {};
|
|
|
111
111
|
|
|
112
112
|
const s3DownloadProcedure = createProcedure()
|
|
113
113
|
.path(["s3", "download"])
|
|
114
|
-
.input(
|
|
115
|
-
.output(
|
|
114
|
+
.input(S3DownloadInputSchema)
|
|
115
|
+
.output(S3DownloadOutputSchema)
|
|
116
116
|
.meta({
|
|
117
117
|
description: "Download content from S3 bucket",
|
|
118
118
|
// With destPath, it replaces the file at that path
|
|
@@ -128,8 +128,8 @@ const s3DownloadProcedure = createProcedure()
|
|
|
128
128
|
|
|
129
129
|
const s3ListProcedure = createProcedure()
|
|
130
130
|
.path(["s3", "list"])
|
|
131
|
-
.input(
|
|
132
|
-
.output(
|
|
131
|
+
.input(S3ListInputSchema)
|
|
132
|
+
.output(S3ListOutputSchema)
|
|
133
133
|
.meta({
|
|
134
134
|
description: "List objects in S3 bucket",
|
|
135
135
|
effects: { reads: ["s3", "network"], writes: [] },
|
|
@@ -143,8 +143,8 @@ const s3ListProcedure = createProcedure()
|
|
|
143
143
|
|
|
144
144
|
const s3ListAllProcedure = createProcedure()
|
|
145
145
|
.path(["s3", "listAll"])
|
|
146
|
-
.input(
|
|
147
|
-
.output(
|
|
146
|
+
.input(S3ListAllInputSchema)
|
|
147
|
+
.output(S3ListAllOutputSchema)
|
|
148
148
|
.meta({
|
|
149
149
|
description: "List ALL objects in S3 bucket, following continuation tokens (unbounded by 1000)",
|
|
150
150
|
effects: { reads: ["s3", "network"], writes: [] },
|
|
@@ -158,8 +158,8 @@ const s3ListAllProcedure = createProcedure()
|
|
|
158
158
|
|
|
159
159
|
const s3DeleteProcedure = createProcedure()
|
|
160
160
|
.path(["s3", "delete"])
|
|
161
|
-
.input(
|
|
162
|
-
.output(
|
|
161
|
+
.input(S3DeleteInputSchema)
|
|
162
|
+
.output(S3DeleteOutputSchema)
|
|
163
163
|
.meta({
|
|
164
164
|
description: "Delete object from S3 bucket",
|
|
165
165
|
effects: { reads: ["s3", "network"], writes: ["s3", "network"] },
|
|
@@ -173,8 +173,8 @@ const s3DeleteProcedure = createProcedure()
|
|
|
173
173
|
|
|
174
174
|
const s3MultipartInitProcedure = createProcedure()
|
|
175
175
|
.path(["s3", "multipart", "init"])
|
|
176
|
-
.input(
|
|
177
|
-
.output(
|
|
176
|
+
.input(S3MultipartInitInputSchema)
|
|
177
|
+
.output(S3MultipartInitOutputSchema)
|
|
178
178
|
.meta({
|
|
179
179
|
description: "Initialize multipart upload for large files",
|
|
180
180
|
// It starts a new upload: the object of the key does not change before the completion
|
|
@@ -189,8 +189,8 @@ const s3MultipartInitProcedure = createProcedure()
|
|
|
189
189
|
|
|
190
190
|
const s3MultipartUploadProcedure = createProcedure()
|
|
191
191
|
.path(["s3", "multipart", "upload"])
|
|
192
|
-
.input(
|
|
193
|
-
.output(
|
|
192
|
+
.input(S3MultipartUploadInputSchema)
|
|
193
|
+
.output(S3MultipartUploadOutputSchema)
|
|
194
194
|
.meta({
|
|
195
195
|
description: "Upload a part in multipart upload",
|
|
196
196
|
// A part replaces the earlier part with the same number
|
|
@@ -205,8 +205,8 @@ const s3MultipartUploadProcedure = createProcedure()
|
|
|
205
205
|
|
|
206
206
|
const s3MultipartCompleteProcedure = createProcedure()
|
|
207
207
|
.path(["s3", "multipart", "complete"])
|
|
208
|
-
.input(
|
|
209
|
-
.output(
|
|
208
|
+
.input(S3MultipartCompleteInputSchema)
|
|
209
|
+
.output(S3MultipartCompleteOutputSchema)
|
|
210
210
|
.meta({
|
|
211
211
|
description: "Complete multipart upload by assembling parts",
|
|
212
212
|
// The assembled object replaces the object of an existing key
|
|
@@ -221,8 +221,8 @@ const s3MultipartCompleteProcedure = createProcedure()
|
|
|
221
221
|
|
|
222
222
|
const s3MultipartAbortProcedure = createProcedure()
|
|
223
223
|
.path(["s3", "multipart", "abort"])
|
|
224
|
-
.input(
|
|
225
|
-
.output(
|
|
224
|
+
.input(S3MultipartAbortInputSchema)
|
|
225
|
+
.output(S3MultipartAbortOutputSchema)
|
|
226
226
|
.meta({
|
|
227
227
|
description: "Abort multipart upload and clean up parts",
|
|
228
228
|
effects: { reads: ["s3", "network"], writes: ["s3", "network"] },
|
|
@@ -238,8 +238,8 @@ const s3MultipartAbortProcedure = createProcedure()
|
|
|
238
238
|
|
|
239
239
|
const s3HeadProcedure = createProcedure()
|
|
240
240
|
.path(["s3", "head"])
|
|
241
|
-
.input(
|
|
242
|
-
.output(
|
|
241
|
+
.input(S3HeadInputSchema)
|
|
242
|
+
.output(S3HeadOutputSchema)
|
|
243
243
|
.meta({
|
|
244
244
|
description: "The metadata of an object, without its content (exists: false for a 404)",
|
|
245
245
|
effects: { reads: ["s3", "network"], writes: [] },
|
|
@@ -251,8 +251,8 @@ const s3HeadProcedure = createProcedure()
|
|
|
251
251
|
|
|
252
252
|
const s3CopyProcedure = createProcedure()
|
|
253
253
|
.path(["s3", "copy"])
|
|
254
|
-
.input(
|
|
255
|
-
.output(
|
|
254
|
+
.input(S3CopyInputSchema)
|
|
255
|
+
.output(S3CopyOutputSchema)
|
|
256
256
|
.meta({
|
|
257
257
|
description: "Copy an object inside S3 (it replaces the destination, unless overwrite is false)",
|
|
258
258
|
// The copy replaces the object of the destination key: destructive. The same input gives the
|
|
@@ -266,8 +266,8 @@ const s3CopyProcedure = createProcedure()
|
|
|
266
266
|
|
|
267
267
|
const s3PresignProcedure = createProcedure()
|
|
268
268
|
.path(["s3", "presign"])
|
|
269
|
-
.input(
|
|
270
|
-
.output(
|
|
269
|
+
.input(S3PresignInputSchema)
|
|
270
|
+
.output(S3PresignOutputSchema)
|
|
271
271
|
.meta({
|
|
272
272
|
description: "A presigned URL for a GET or a PUT of an object, with an expiry in seconds",
|
|
273
273
|
// It sends no request to S3. It reads the credentials: the environment, the AWS files of the
|