@superdurable/connector-amazon-s3 0.0.0-stage → 0.1.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.
@@ -0,0 +1,327 @@
1
+ import { CredentialProvider, SecretString, Query, Mutation, ConnectionRef } from '@superdurable/connectors-sdk';
2
+ import { z } from 'zod';
3
+
4
+ /** Connector configuration; omitted fields use manifest defaults. */
5
+ interface Config {
6
+ /** Signing Region of the bucket, written as a Region code such as eu-west-1. Amazon S3: open https://console.aws.amazon.com/s3/buckets and read the AWS Region column beside the bucket. Cloudflare R2 uses auto. MinIO uses its configured server Region, which a default server does not change. Not secret. A wrong Region selects providerRejected, and an Amazon S3 rejection names the bucket's Region when S3 reports it. Blank uses the displayed default. */
7
+ region?: string;
8
+ /** Base URL of an S3-compatible API, for a store other than Amazon S3. Cloudflare R2: https://<ACCOUNT_ID>.r2.cloudflarestorage.com with the Account ID shown under https://dash.cloudflare.com > R2 object storage > Account Details. MinIO: the server API address, such as https://minio.example.com or http://127.0.0.1:9000 for a server on the Worker's own host. Use HTTPS except for a loopback host; a path is kept as a prefix. The access key is used to sign requests to whatever host this names. Blank uses the Amazon S3 Regional endpoint for region. */
9
+ endpoint?: string;
10
+ /** How a request names its bucket. virtualHosted puts the bucket in the host name, as https://bucket.s3.eu-west-1.amazonaws.com; path puts it first in the path, as https://minio.example.com/bucket. auto uses virtualHosted for Amazon S3 and path for a custom endpoint, and uses path for a bucket name that contains a dot, because the Amazon S3 wildcard certificate cannot match it. Choose virtualHosted for a custom endpoint only when its documentation requires bucket host names. Blank uses the displayed default. */
11
+ addressingStyle?: string;
12
+ /** Bucket an operation uses when its input leaves bucket blank, written as the plain name, such as acme-reports, without s3:// or a path. Amazon S3: copy the name from https://console.aws.amazon.com/s3/buckets. Cloudflare R2: https://dash.cloudflare.com > R2 object storage. MinIO: the server console's Buckets page. Not secret. Blank means every operation input must name its bucket. */
13
+ defaultBucket?: string;
14
+ /** Number of keys and common prefixes listObjects requests per page when its input leaves maxKeys at zero, as a whole number from 1 up to the Amazon S3 page limit of 1,000. Smaller pages keep each Result small; larger pages need fewer Steps. Blank uses the displayed default. */
15
+ listPageSize?: number;
16
+ /** Maximum complete listObjects response in bytes, as a positive integer. A larger page selects invalidResponse; lower maxKeys before raising this, because a page is stored in Dex Flow state. Blank uses the displayed default. */
17
+ maxResponseBytes?: number;
18
+ /** Maximum object size in bytes that getObjectText returns as text, as a positive integer. A larger object selects tooLarge without reading its content. Text is stored in Dex Flow state, so raise it cautiously. Blank uses the displayed default. */
19
+ maxTextBytes?: number;
20
+ /** Maximum object content in bytes that putObject sends in one request, as a positive integer no larger than 5242880. Larger content selects defect before any request. The content travels through Dex Flow state, so the connector caps it well below the Amazon S3 single-request limit. Blank uses the displayed default. */
21
+ maxUploadBytes?: number;
22
+ }
23
+ /** Runtime schema for manifest configuration. */
24
+ declare const ConfigSchema: z.ZodObject<{
25
+ region: z.ZodOptional<z.ZodString>;
26
+ endpoint: z.ZodOptional<z.ZodString>;
27
+ addressingStyle: z.ZodOptional<z.ZodString>;
28
+ defaultBucket: z.ZodOptional<z.ZodString>;
29
+ listPageSize: z.ZodOptional<z.ZodNumber>;
30
+ maxResponseBytes: z.ZodOptional<z.ZodNumber>;
31
+ maxTextBytes: z.ZodOptional<z.ZodNumber>;
32
+ maxUploadBytes: z.ZodOptional<z.ZodNumber>;
33
+ }, z.core.$strip>;
34
+ /** Private connector credentials resolved by the host. */
35
+ interface Credentials {
36
+ /** Secret-stored access key ID that names the key pair. Amazon S3: https://console.aws.amazon.com/iam > Users > the user > Security credentials > Access keys > Create access key; long-term IDs start with AKIA and temporary IDs with ASIA. Cloudflare R2: the Access Key ID shown once after https://dash.cloudflare.com > R2 object storage > Account Details > API Tokens > Manage > Create Account API token. MinIO: the access key of a user or service account. Dex Web stores it as a secret because it identifies the account; blank means no request can be signed. */
37
+ accessKeyId: SecretString;
38
+ /** Secret access key paired with access_key_id, shown only once when the key is created: Amazon S3 shows it on the Retrieve access keys page (choose Show or Download .csv file), and Cloudflare R2 shows the Secret Access Key on the token's confirmation page. It signs every request and never leaves the Worker; Dex keeps it out of Flow state, logs, and Results. Blank means no request can be signed. */
39
+ secretAccessKey: SecretString;
40
+ /** Secret session token, only for temporary AWS credentials whose access key ID starts with ASIA, such as the output of aws sts get-session-token or aws sts assume-role (https://docs.aws.amazon.com/STS/latest/APIReference/API_GetSessionToken.html). Temporary credentials expire, usually within hours, and this connector cannot renew them: replace all three values before they expire, or an expired token selects providerRejected. Blank means long-term credentials, which Amazon S3 IAM user keys, Cloudflare R2, and MinIO use. */
41
+ sessionToken?: SecretString;
42
+ }
43
+ /** Host-owned source of private connector credentials. */
44
+ type CredentialSource = CredentialProvider<Credentials>;
45
+ /** ListObjectsInput selects one page of a bucket listing. Keys are listed in UTF-8 binary order. */
46
+ interface ListObjectsInput {
47
+ /** Bucket is the bucket name; blank uses the connection's defaultBucket. */
48
+ "bucket"?: string | undefined;
49
+ /** Prefix limits the page to keys that begin with it, such as reports/2026/; blank lists every key. */
50
+ "prefix"?: string | undefined;
51
+ /** Delimiter groups keys that contain it after Prefix into CommonPrefixes, usually "/" to list one
52
+ * folder level; blank lists every key under Prefix. */
53
+ "delimiter"?: string | undefined;
54
+ /** StartAfter lists only keys after this key; blank starts at the first key. */
55
+ "startAfter"?: string | undefined;
56
+ /** ContinuationToken is the NextContinuationToken of the previous page; blank reads the first page. */
57
+ "continuationToken"?: string | undefined;
58
+ /** MaxKeys bounds the objects plus common prefixes on the page, from 1 to 1000; zero uses the
59
+ * connection's listPageSize. */
60
+ "maxKeys"?: number | undefined;
61
+ }
62
+ /** ObjectSummary is one object on a listObjects page. */
63
+ interface ObjectSummary {
64
+ /** Key is the object key. */
65
+ "key": string;
66
+ /** SizeBytes is the object size. */
67
+ "sizeBytes": number;
68
+ /** ETag is the entity tag exactly as S3 reports it, including its double quotes. */
69
+ "eTag"?: string | undefined;
70
+ /** LastModified is when the object was last written. */
71
+ "lastModified"?: string | undefined;
72
+ /** StorageClass is the S3 storage class, such as STANDARD. */
73
+ "storageClass"?: string | undefined;
74
+ }
75
+ /** ListObjectsOutput is one page of a bucket listing. */
76
+ interface ListObjectsOutput {
77
+ /** Bucket is the listed bucket. */
78
+ "bucket": string;
79
+ /** Prefix is the requested key prefix. */
80
+ "prefix"?: string | undefined;
81
+ /** Delimiter is the requested delimiter. */
82
+ "delimiter"?: string | undefined;
83
+ /** Objects lists the page's objects in key order. */
84
+ "objects"?: Array<ObjectSummary> | undefined;
85
+ /** CommonPrefixes lists the folder-like key prefixes the delimiter rolled up, each ending in Delimiter. */
86
+ "commonPrefixes"?: Array<string> | undefined;
87
+ /** IsTruncated reports that more keys remain after this page. */
88
+ "isTruncated": boolean;
89
+ /** NextContinuationToken continues the listing when IsTruncated is true; pass it as ContinuationToken. */
90
+ "nextContinuationToken"?: string | undefined;
91
+ }
92
+ /** HeadObjectInput identifies the object whose metadata is read. */
93
+ interface HeadObjectInput {
94
+ /** Bucket is the bucket name; blank uses the connection's defaultBucket. */
95
+ "bucket"?: string | undefined;
96
+ /** Key is the object key, such as reports/2026-09.md. */
97
+ "key": string;
98
+ }
99
+ /** ObjectMetadata is the metadata S3 reports for one object, without its content. */
100
+ interface ObjectMetadata {
101
+ /** Bucket is the object's bucket. */
102
+ "bucket": string;
103
+ /** Key is the object key. */
104
+ "key": string;
105
+ /** SizeBytes is the object size. */
106
+ "sizeBytes": number;
107
+ /** ETag is the entity tag exactly as S3 reports it, including its double quotes. For a single-request
108
+ * upload without SSE-KMS or SSE-C encryption it is the hex MD5 of the content. */
109
+ "eTag"?: string | undefined;
110
+ /** ContentType is the stored Content-Type, such as text/markdown; charset=utf-8. */
111
+ "contentType"?: string | undefined;
112
+ /** ContentEncoding is the stored Content-Encoding, such as gzip; empty means none. */
113
+ "contentEncoding"?: string | undefined;
114
+ /** ContentLanguage is the stored Content-Language. */
115
+ "contentLanguage"?: string | undefined;
116
+ /** ContentDisposition is the stored Content-Disposition. */
117
+ "contentDisposition"?: string | undefined;
118
+ /** CacheControl is the stored Cache-Control. */
119
+ "cacheControl"?: string | undefined;
120
+ /** LastModified is when the object was last written. */
121
+ "lastModified"?: string | undefined;
122
+ /** VersionID is the object version in a versioning-enabled bucket; empty otherwise. */
123
+ "versionId"?: string | undefined;
124
+ /** StorageClass is the storage class; Amazon S3 reports none for STANDARD. */
125
+ "storageClass"?: string | undefined;
126
+ /** ServerSideEncryption is the server-side encryption algorithm, such as AES256 or aws:kms. */
127
+ "serverSideEncryption"?: string | undefined;
128
+ /** Metadata is the user-defined metadata, keyed by lowercase name without the x-amz-meta- prefix. S3
129
+ * returns a non-ASCII value RFC 2047-encoded, and the value is kept as S3 returns it. */
130
+ "metadata"?: {
131
+ [key: string]: string;
132
+ } | undefined;
133
+ /** MissingMetadataCount is the number of metadata entries S3 could not return as HTTP headers. */
134
+ "missingMetadataCount"?: number | undefined;
135
+ }
136
+ /** GetObjectTextInput identifies the object whose text is read. */
137
+ interface GetObjectTextInput {
138
+ /** Bucket is the bucket name; blank uses the connection's defaultBucket. */
139
+ "bucket"?: string | undefined;
140
+ /** Key is the object key, such as reports/2026-09.md. */
141
+ "key": string;
142
+ }
143
+ /** ObjectText is the bounded text of one object. The unsupportedContent and tooLarge branches return the
144
+ * object's identity, content type, and size without Text. */
145
+ interface ObjectText {
146
+ /** Bucket is the object's bucket. */
147
+ "bucket": string;
148
+ /** Key is the object key. */
149
+ "key": string;
150
+ /** ContentType is the stored Content-Type. */
151
+ "contentType"?: string | undefined;
152
+ /** ETag is the entity tag exactly as S3 reports it, including its double quotes. */
153
+ "eTag"?: string | undefined;
154
+ /** VersionID is the object version in a versioning-enabled bucket; empty otherwise. */
155
+ "versionId"?: string | undefined;
156
+ /** LastModified is when the object was last written. */
157
+ "lastModified"?: string | undefined;
158
+ /** SizeBytes is the object size, which equals the UTF-8 byte length of Text when Text is returned. */
159
+ "sizeBytes": number;
160
+ /** Text is the complete object content, unchanged, including any byte order mark. */
161
+ "text"?: string | undefined;
162
+ }
163
+ /** PutObjectInput describes one object to store. Set at most one of TextContent and ByteContent; leaving
164
+ * both empty stores an empty object. */
165
+ interface PutObjectInput {
166
+ /** Bucket is the bucket name; blank uses the connection's defaultBucket. */
167
+ "bucket"?: string | undefined;
168
+ /** Key is the object key, such as reports/2026-09.md. */
169
+ "key": string;
170
+ /** ContentType is the media type S3 stores and returns, such as text/markdown; charset=utf-8. */
171
+ "contentType": string;
172
+ /** TextContent is UTF-8 text content. */
173
+ "textContent"?: string | undefined;
174
+ /** ByteContent is binary content, encoded as base64 in JSON. */
175
+ "byteContent"?: string | undefined;
176
+ /** Metadata is user-defined metadata, keyed by lowercase name without the x-amz-meta- prefix, such as
177
+ * report-id. Values are printable ASCII. The dex-idempotency-key name is reserved. */
178
+ "metadata"?: {
179
+ [key: string]: string;
180
+ } | undefined;
181
+ /** IsCreateOnly stores the object only when no current object exists at the key, by sending
182
+ * If-None-Match: *; an object that this Step execution did not write selects alreadyExists. */
183
+ "isCreateOnly"?: boolean | undefined;
184
+ }
185
+ /** StoredObject identifies the object at the key after putObject. On alreadyExists it describes the
186
+ * existing object, which this Step execution did not write. */
187
+ interface StoredObject {
188
+ /** Bucket is the object's bucket. */
189
+ "bucket": string;
190
+ /** Key is the object key. */
191
+ "key": string;
192
+ /** ETag is the entity tag exactly as S3 reports it, including its double quotes. */
193
+ "eTag"?: string | undefined;
194
+ /** VersionID is the version S3 created in a versioning-enabled bucket; empty otherwise. */
195
+ "versionId"?: string | undefined;
196
+ /** SizeBytes is the object size. */
197
+ "sizeBytes": number;
198
+ /** ContentType is the object's content type. */
199
+ "contentType"?: string | undefined;
200
+ /** LastModified is when the object was written, set when the connector read the object back. */
201
+ "lastModified"?: string | undefined;
202
+ /** IsFromEarlierAttempt reports that a create-only write found the object an earlier attempt of the same
203
+ * Step execution stored, so this attempt wrote nothing. */
204
+ "isFromEarlierAttempt"?: boolean | undefined;
205
+ }
206
+ /** Runtime validator for ListObjectsInput. */
207
+ declare const ListObjectsInputSchema: z.ZodObject<{
208
+ bucket: z.ZodOptional<z.ZodString>;
209
+ prefix: z.ZodOptional<z.ZodString>;
210
+ delimiter: z.ZodOptional<z.ZodString>;
211
+ startAfter: z.ZodOptional<z.ZodString>;
212
+ continuationToken: z.ZodOptional<z.ZodString>;
213
+ maxKeys: z.ZodOptional<z.ZodNumber>;
214
+ }, z.core.$strict>;
215
+ /** Runtime validator for ObjectSummary. */
216
+ declare const ObjectSummarySchema: z.ZodObject<{
217
+ key: z.ZodString;
218
+ sizeBytes: z.ZodNumber;
219
+ eTag: z.ZodOptional<z.ZodString>;
220
+ lastModified: z.ZodOptional<z.ZodISODateTime>;
221
+ storageClass: z.ZodOptional<z.ZodString>;
222
+ }, z.core.$strict>;
223
+ /** Runtime validator for ListObjectsOutput. */
224
+ declare const ListObjectsOutputSchema: z.ZodObject<{
225
+ bucket: z.ZodString;
226
+ prefix: z.ZodOptional<z.ZodString>;
227
+ delimiter: z.ZodOptional<z.ZodString>;
228
+ objects: z.ZodOptional<z.ZodArray<z.ZodObject<{
229
+ key: z.ZodString;
230
+ sizeBytes: z.ZodNumber;
231
+ eTag: z.ZodOptional<z.ZodString>;
232
+ lastModified: z.ZodOptional<z.ZodISODateTime>;
233
+ storageClass: z.ZodOptional<z.ZodString>;
234
+ }, z.core.$strict>>>;
235
+ commonPrefixes: z.ZodOptional<z.ZodArray<z.ZodString>>;
236
+ isTruncated: z.ZodBoolean;
237
+ nextContinuationToken: z.ZodOptional<z.ZodString>;
238
+ }, z.core.$strict>;
239
+ /** Runtime validator for HeadObjectInput. */
240
+ declare const HeadObjectInputSchema: z.ZodObject<{
241
+ bucket: z.ZodOptional<z.ZodString>;
242
+ key: z.ZodString;
243
+ }, z.core.$strict>;
244
+ /** Runtime validator for ObjectMetadata. */
245
+ declare const ObjectMetadataSchema: z.ZodObject<{
246
+ bucket: z.ZodString;
247
+ key: z.ZodString;
248
+ sizeBytes: z.ZodNumber;
249
+ eTag: z.ZodOptional<z.ZodString>;
250
+ contentType: z.ZodOptional<z.ZodString>;
251
+ contentEncoding: z.ZodOptional<z.ZodString>;
252
+ contentLanguage: z.ZodOptional<z.ZodString>;
253
+ contentDisposition: z.ZodOptional<z.ZodString>;
254
+ cacheControl: z.ZodOptional<z.ZodString>;
255
+ lastModified: z.ZodOptional<z.ZodISODateTime>;
256
+ versionId: z.ZodOptional<z.ZodString>;
257
+ storageClass: z.ZodOptional<z.ZodString>;
258
+ serverSideEncryption: z.ZodOptional<z.ZodString>;
259
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
260
+ missingMetadataCount: z.ZodOptional<z.ZodNumber>;
261
+ }, z.core.$strict>;
262
+ /** Runtime validator for GetObjectTextInput. */
263
+ declare const GetObjectTextInputSchema: z.ZodObject<{
264
+ bucket: z.ZodOptional<z.ZodString>;
265
+ key: z.ZodString;
266
+ }, z.core.$strict>;
267
+ /** Runtime validator for ObjectText. */
268
+ declare const ObjectTextSchema: z.ZodObject<{
269
+ bucket: z.ZodString;
270
+ key: z.ZodString;
271
+ contentType: z.ZodOptional<z.ZodString>;
272
+ eTag: z.ZodOptional<z.ZodString>;
273
+ versionId: z.ZodOptional<z.ZodString>;
274
+ lastModified: z.ZodOptional<z.ZodISODateTime>;
275
+ sizeBytes: z.ZodNumber;
276
+ text: z.ZodOptional<z.ZodString>;
277
+ }, z.core.$strict>;
278
+ /** Runtime validator for PutObjectInput. */
279
+ declare const PutObjectInputSchema: z.ZodObject<{
280
+ bucket: z.ZodOptional<z.ZodString>;
281
+ key: z.ZodString;
282
+ contentType: z.ZodString;
283
+ textContent: z.ZodOptional<z.ZodString>;
284
+ byteContent: z.ZodOptional<z.ZodBase64>;
285
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
286
+ isCreateOnly: z.ZodOptional<z.ZodBoolean>;
287
+ }, z.core.$strict>;
288
+ /** Runtime validator for StoredObject. */
289
+ declare const StoredObjectSchema: z.ZodObject<{
290
+ bucket: z.ZodString;
291
+ key: z.ZodString;
292
+ eTag: z.ZodOptional<z.ZodString>;
293
+ versionId: z.ZodOptional<z.ZodString>;
294
+ sizeBytes: z.ZodNumber;
295
+ contentType: z.ZodOptional<z.ZodString>;
296
+ lastModified: z.ZodOptional<z.ZodISODateTime>;
297
+ isFromEarlierAttempt: z.ZodOptional<z.ZodBoolean>;
298
+ }, z.core.$strict>;
299
+
300
+ /** Typed operations supplied by a client or mock. */
301
+ interface Operations {
302
+ /** Invoke listObjects through this connection. */
303
+ listObjects(): Query<ListObjectsInput, ListObjectsOutput>;
304
+ /** Invoke headObject through this connection. */
305
+ headObject(): Query<HeadObjectInput, ObjectMetadata>;
306
+ /** Invoke getObjectText through this connection. */
307
+ getObjectText(): Query<GetObjectTextInput, ObjectText>;
308
+ /** Invoke putObject through this connection. */
309
+ putObject(): Mutation<PutObjectInput, StoredObject>;
310
+ }
311
+ /** Named connector connection kept outside Flow state. */
312
+ declare class Connection<BoundOperations = Operations> {
313
+ /** Stable provider and connection name. */
314
+ readonly reference: ConnectionRef;
315
+ /** Bound provider operations. */
316
+ readonly operations: BoundOperations;
317
+ /** Validate a reference and bind operations. */
318
+ constructor(reference: ConnectionRef, operations: BoundOperations);
319
+ }
320
+ /** Bind a client to a named connection. */
321
+ declare function newConnection(client: Operations, reference: ConnectionRef): Connection;
322
+ /** Bind scripted operations to a named connection. */
323
+ declare function newConnectionWithOperations(operations: Operations, reference: ConnectionRef): Connection;
324
+ /** Provider expected by named connections. */
325
+ declare const ConnectionNameProvider = "amazon-s3";
326
+
327
+ export { type Config as C, type GetObjectTextInput as G, type HeadObjectInput as H, type ListObjectsInput as L, type ObjectText as O, type PutObjectInput as P, type StoredObject as S, type ListObjectsOutput as a, type ObjectMetadata as b, type Credentials as c, Connection as d, type Operations as e, ConfigSchema as f, ConnectionNameProvider as g, type CredentialSource as h, GetObjectTextInputSchema as i, HeadObjectInputSchema as j, ListObjectsInputSchema as k, ListObjectsOutputSchema as l, ObjectMetadataSchema as m, type ObjectSummary as n, ObjectSummarySchema as o, ObjectTextSchema as p, PutObjectInputSchema as q, StoredObjectSchema as r, newConnection as s, newConnectionWithOperations as t };
@@ -0,0 +1,321 @@
1
+ import { G as GetObjectTextInput, O as ObjectText, L as ListObjectsInput, a as ListObjectsOutput, H as HeadObjectInput, b as ObjectMetadata, P as PutObjectInput, S as StoredObject, C as Config, c as Credentials, d as Connection, e as Operations } from './connection-DmewJaUl.js';
2
+ export { f as ConfigSchema, g as ConnectionNameProvider, h as CredentialSource, i as GetObjectTextInputSchema, j as HeadObjectInputSchema, k as ListObjectsInputSchema, l as ListObjectsOutputSchema, m as ObjectMetadataSchema, n as ObjectSummary, o as ObjectSummarySchema, p as ObjectTextSchema, q as PutObjectInputSchema, r as StoredObjectSchema, s as newConnection, t as newConnectionWithOperations } from './connection-DmewJaUl.js';
3
+ import * as _superdurable_connectors_sdk from '@superdurable/connectors-sdk';
4
+ import { QueryDefinition, MutationDefinition, Query, Call, QueryAttempt, Mutation, MutationAttempt, CredentialProvider, ReceiptDraft, QueryStepConfig, QueryResult, MutationStepConfig, MutationResult, QueryStep, MutationStep } from '@superdurable/connectors-sdk';
5
+ import { ProviderRequest, ProviderResponse } from '@superdurable/connectors-sdk/providerhttp';
6
+ import { LoadedProject } from '@superdurable/connectors-sdk/projectconfig';
7
+ import { StepTarget } from '@superdurable/dex';
8
+ import 'zod';
9
+
10
+ /** Stable connector identity. */
11
+ declare const ConnectorID = "amazon-s3";
12
+ /** Provider identity for named connections. */
13
+ declare const ProviderID = "amazon-s3";
14
+ /** Branch IDs for listObjects. */
15
+ declare const ListObjectsBranch: {
16
+ readonly Found: "found";
17
+ readonly NotFound: "notFound";
18
+ readonly ProviderRejected: "providerRejected";
19
+ readonly InvalidResponse: "invalidResponse";
20
+ readonly Defect: "defect";
21
+ };
22
+ /** The page holds objects or common prefixes, or more pages remain. */
23
+ declare const ListObjectsBranchFound: "found";
24
+ /** No object matched the prefix and no further page remains. */
25
+ declare const ListObjectsBranchNotFound: "notFound";
26
+ /** The store conclusively rejected the list, such as a missing bucket, a wrong Region, invalid credentials, or missing s3:ListBucket permission. */
27
+ declare const ListObjectsBranchProviderRejected: "providerRejected";
28
+ /** The store returned an invalid or oversized list page. */
29
+ declare const ListObjectsBranchInvalidResponse: "invalidResponse";
30
+ /** Local input, connection configuration, or connector definition is invalid. */
31
+ declare const ListObjectsBranchDefect: "defect";
32
+ /** Manifest definition for listObjects. */
33
+ declare const ListObjectsDefinition: QueryDefinition;
34
+ /** Manifest metadata for listObjects. */
35
+ declare const ListObjectsMetadata: {
36
+ readonly kind: "query";
37
+ readonly idempotency: "none";
38
+ readonly authorization: "required";
39
+ };
40
+ /** Branch IDs for headObject. */
41
+ declare const HeadObjectBranch: {
42
+ readonly Found: "found";
43
+ readonly NotFound: "notFound";
44
+ readonly ProviderRejected: "providerRejected";
45
+ readonly InvalidResponse: "invalidResponse";
46
+ readonly Defect: "defect";
47
+ };
48
+ /** The store returned the object's metadata. */
49
+ declare const HeadObjectBranchFound: "found";
50
+ /** The object, or its bucket, does not exist; a HEAD response cannot say which. */
51
+ declare const HeadObjectBranchNotFound: "notFound";
52
+ /** The store conclusively rejected the read, such as a wrong Region, invalid credentials, or missing s3:GetObject permission. */
53
+ declare const HeadObjectBranchProviderRejected: "providerRejected";
54
+ /** The store returned metadata without a valid size or modification time. */
55
+ declare const HeadObjectBranchInvalidResponse: "invalidResponse";
56
+ /** Local input, connection configuration, or connector definition is invalid. */
57
+ declare const HeadObjectBranchDefect: "defect";
58
+ /** Manifest definition for headObject. */
59
+ declare const HeadObjectDefinition: QueryDefinition;
60
+ /** Manifest metadata for headObject. */
61
+ declare const HeadObjectMetadata: {
62
+ readonly kind: "query";
63
+ readonly idempotency: "none";
64
+ readonly authorization: "required";
65
+ };
66
+ /** Branch IDs for getObjectText. */
67
+ declare const GetObjectTextBranch: {
68
+ readonly Read: "read";
69
+ readonly NotFound: "notFound";
70
+ readonly UnsupportedContent: "unsupportedContent";
71
+ readonly TooLarge: "tooLarge";
72
+ readonly ProviderRejected: "providerRejected";
73
+ readonly InvalidResponse: "invalidResponse";
74
+ readonly Defect: "defect";
75
+ };
76
+ /** The object's complete text was read within maxTextBytes. */
77
+ declare const GetObjectTextBranchRead: "read";
78
+ /** The object does not exist. */
79
+ declare const GetObjectTextBranchNotFound: "notFound";
80
+ /** The object's content type is not text, its content is encoded such as gzip, or its bytes are not valid UTF-8 text. */
81
+ declare const GetObjectTextBranchUnsupportedContent: "unsupportedContent";
82
+ /** The object is larger than maxTextBytes. */
83
+ declare const GetObjectTextBranchTooLarge: "tooLarge";
84
+ /** The store conclusively rejected the read, such as a missing bucket, a wrong Region, invalid credentials, or missing s3:GetObject permission. */
85
+ declare const GetObjectTextBranchProviderRejected: "providerRejected";
86
+ /** The store returned a response without a valid size or with content that contains the connection's credentials. */
87
+ declare const GetObjectTextBranchInvalidResponse: "invalidResponse";
88
+ /** Local input, connection configuration, or connector definition is invalid. */
89
+ declare const GetObjectTextBranchDefect: "defect";
90
+ /** Manifest definition for getObjectText. */
91
+ declare const GetObjectTextDefinition: QueryDefinition;
92
+ /** Manifest metadata for getObjectText. */
93
+ declare const GetObjectTextMetadata: {
94
+ readonly kind: "query";
95
+ readonly idempotency: "none";
96
+ readonly authorization: "required";
97
+ };
98
+ /** Branch IDs for putObject. */
99
+ declare const PutObjectBranch: {
100
+ readonly Stored: "stored";
101
+ readonly AlreadyExists: "alreadyExists";
102
+ readonly ProviderRejected: "providerRejected";
103
+ readonly Defect: "defect";
104
+ };
105
+ /** The store holds the object this Step execution wrote. */
106
+ declare const PutObjectBranchStored: "stored";
107
+ /** Create-only mode found an object at the key that this Step execution did not write; nothing was written. */
108
+ declare const PutObjectBranchAlreadyExists: "alreadyExists";
109
+ /** The store conclusively rejected the write, such as a missing bucket, a wrong Region, invalid credentials, missing s3:PutObject permission, or a store that does not support create-only writes. */
110
+ declare const PutObjectBranchProviderRejected: "providerRejected";
111
+ /** Local input, connection configuration, or connector definition is invalid. */
112
+ declare const PutObjectBranchDefect: "defect";
113
+ /** Manifest definition for putObject. */
114
+ declare const PutObjectDefinition: MutationDefinition;
115
+ /** Manifest metadata for putObject. */
116
+ declare const PutObjectMetadata: {
117
+ readonly kind: "mutation";
118
+ readonly idempotency: "required";
119
+ readonly authorization: "required";
120
+ };
121
+
122
+ /** List one bounded ListObjectsV2 page. */
123
+ declare class ListObjectsOperation implements Query<ListObjectsInput, ListObjectsOutput> {
124
+ private readonly client;
125
+ /** Bind one client. */ constructor(client: S3Client);
126
+ /** Return the manifest operation identity. */ definition(): _superdurable_connectors_sdk.QueryDefinition;
127
+ /** Send and classify one bucket listing. */
128
+ invoke(call: Call, input: ListObjectsInput): Promise<QueryAttempt<ListObjectsOutput>>;
129
+ }
130
+ /** Read one object's metadata without its body. */
131
+ declare class HeadObjectOperation implements Query<HeadObjectInput, ObjectMetadata> {
132
+ private readonly client;
133
+ /** Bind one client. */ constructor(client: S3Client);
134
+ /** Return the manifest operation identity. */ definition(): _superdurable_connectors_sdk.QueryDefinition;
135
+ /** Send and classify one HEAD request. */
136
+ invoke(call: Call, input: HeadObjectInput): Promise<QueryAttempt<ObjectMetadata>>;
137
+ }
138
+ /** Read bounded UTF-8 text from one object. */
139
+ declare class GetObjectTextOperation implements Query<GetObjectTextInput, ObjectText> {
140
+ private readonly client;
141
+ /** Bind one client. */ constructor(client: S3Client);
142
+ /** Return the manifest operation identity. */ definition(): _superdurable_connectors_sdk.QueryDefinition;
143
+ /** Send and classify one object GET. */
144
+ invoke(call: Call, input: GetObjectTextInput): Promise<QueryAttempt<ObjectText>>;
145
+ }
146
+ /** Replace or create one object with repeat-safe bytes. */
147
+ declare class PutObjectOperation implements Mutation<PutObjectInput, StoredObject> {
148
+ private readonly client;
149
+ /** Bind one client. */ constructor(client: S3Client);
150
+ /** Return the manifest operation identity. */ definition(): _superdurable_connectors_sdk.QueryDefinition;
151
+ /** Use the stable Dex Call ID as the object marker. */ idempotencyKey(callId: string): string;
152
+ /** Send a signed PUT and reconcile create-only precondition failures. */
153
+ invoke(call: Call, input: PutObjectInput): Promise<MutationAttempt<StoredObject>>;
154
+ private readExisting;
155
+ }
156
+
157
+ /** One S3 exchange, including a bounded-body result. */
158
+ interface S3Response {
159
+ /** HTTP status. */ status: number;
160
+ /** Provider headers. */ headers: ProviderResponse['headers'];
161
+ /** Complete bounded response body. */ body: Uint8Array;
162
+ /** True when a successful body exceeded the configured bound. */ isTooLarge: boolean;
163
+ }
164
+ /** Injectable sender for deterministic provider tests. */
165
+ type S3RequestSender = (request: ProviderRequest) => Promise<ProviderResponse>;
166
+ /** Constructor dependencies for request and clock tests. */
167
+ interface S3ClientOptions {
168
+ /** Provider HTTP sender. */ send?: S3RequestSender;
169
+ /** Signing and receipt clock. */ now?: () => Date;
170
+ }
171
+ /** Credentials kept only in one Invoke, outside Dex state. */
172
+ interface S3Session {
173
+ /** Access key ID for signing. */ accessKeyId: string;
174
+ /** Secret key for signing. */ secretAccessKey: string;
175
+ /** Optional temporary session token. */ sessionToken: string;
176
+ }
177
+ /** S3 request data before SigV4 signing. */
178
+ interface S3Request {
179
+ /** HTTP method. */ method: 'GET' | 'HEAD' | 'PUT';
180
+ /** Bucket name. */ bucket: string;
181
+ /** Optional object key. */ key?: string;
182
+ /** Query parameters. */ query?: Record<string, string>;
183
+ /** Request headers. */ headers?: Record<string, string>;
184
+ /** Request body. */ body?: Uint8Array;
185
+ /** Maximum complete body size. */ maxBytes?: number;
186
+ }
187
+ /** Signed, bounded S3 REST client for a single connection. */
188
+ declare class S3Client {
189
+ readonly region: string;
190
+ readonly defaultBucket: string;
191
+ readonly listPageSize: number;
192
+ readonly maxResponseBytes: number;
193
+ readonly maxTextBytes: number;
194
+ readonly maxUploadBytes: number;
195
+ private readonly endpoint;
196
+ private readonly addressingStyle;
197
+ private readonly isAmazonEndpoint;
198
+ private readonly credentials;
199
+ private readonly send;
200
+ private readonly now;
201
+ /** Validate public configuration and bind a private credential source. */
202
+ constructor(config: Config, credentials: CredentialProvider<Credentials>, options?: S3ClientOptions);
203
+ /** Bind the bucket listing query. */ listObjects(): ListObjectsOperation;
204
+ /** Bind the metadata query. */ headObject(): HeadObjectOperation;
205
+ /** Bind the text query. */ getObjectText(): GetObjectTextOperation;
206
+ /** Bind the object write mutation. */ putObject(): PutObjectOperation;
207
+ /** Resolve current credentials once per Invoke without exposing secret-bearing errors. */
208
+ startSession(call: Call): Promise<S3Session | undefined>;
209
+ /** Resolve and validate an input bucket. */
210
+ bucket(inputBucket?: string): string;
211
+ /** Send a SigV4 request once; Dex owns operation retries. */
212
+ exchange(call: Call, session: S3Session, request: S3Request): Promise<S3Response>;
213
+ /** Make a safe receipt from provider correlation metadata. */
214
+ receipt(_call: Call, response: S3Response, bucket: string, key?: string): ReceiptDraft;
215
+ /** Return the clock used for retry headers. */ currentTime(): Date;
216
+ private requestURL;
217
+ }
218
+ /** Read a case-insensitive single response header. */
219
+ declare function header(response: S3Response, name: string): string;
220
+ /** Parse S3 Retry-After using the same operation clock. */
221
+ declare function retryAfter(response: S3Response, now: Date): number;
222
+ /** Validate one general-purpose bucket name. */
223
+ declare function validateBucket(bucket: string): void;
224
+ /** Validate an object key or list filter. */
225
+ declare function validateKey(value: string, field?: string, isPrefix?: boolean): void;
226
+ /** Keep the access key, secret, and session token out of Results. */
227
+ declare function containsCredential(value: string, session: S3Session, includeAccessKey?: boolean): boolean;
228
+ /** Bound a provider header and suppress credential echoes. */
229
+ declare function safeHeader(response: S3Response, name: string, session: S3Session): string;
230
+
231
+ /** Bind one project connection and resolve current S3 secrets only during Invoke. */
232
+ declare function newProjectConnection(project: LoadedProject, connectionName: string, options?: S3ClientOptions): Connection<Operations>;
233
+
234
+ /** Configuration for the listObjects connector Step. */
235
+ interface ListObjectsStepConfig<StepInput, OperationInput = ListObjectsInput, OperationOutput = ListObjectsOutput> extends Omit<QueryStepConfig<StepInput, OperationInput, OperationOutput>, 'operation' | 'connection' | 'branches'> {
236
+ /** Named connection supplying this operation. */
237
+ connection: Connection<{
238
+ listObjects(): Query<OperationInput, OperationOutput>;
239
+ }>;
240
+ /** Name matching the bound connection. */
241
+ connectionName: string;
242
+ /** The page holds objects or common prefixes, or more pages remain. */
243
+ found: StepTarget<QueryResult<OperationOutput>>;
244
+ /** No object matched the prefix and no further page remains. */
245
+ notFound?: StepTarget<QueryResult<OperationOutput>>;
246
+ /** The store conclusively rejected the list, such as a missing bucket, a wrong Region, invalid credentials, or missing s3:ListBucket permission. */
247
+ providerRejected?: StepTarget<QueryResult<OperationOutput>>;
248
+ /** The store returned an invalid or oversized list page. */
249
+ invalidResponse?: StepTarget<QueryResult<OperationOutput>>;
250
+ /** Local input, connection configuration, or connector definition is invalid. */
251
+ defect?: StepTarget<QueryResult<OperationOutput>>;
252
+ }
253
+ /** Build the listObjects Step from a named connection. */
254
+ declare function newListObjectsStep<StepInput, OperationInput = ListObjectsInput, OperationOutput = ListObjectsOutput>(configuration: ListObjectsStepConfig<StepInput, OperationInput, OperationOutput>): QueryStep<StepInput, OperationInput, OperationOutput>;
255
+ /** Configuration for the headObject connector Step. */
256
+ interface HeadObjectStepConfig<StepInput, OperationInput = HeadObjectInput, OperationOutput = ObjectMetadata> extends Omit<QueryStepConfig<StepInput, OperationInput, OperationOutput>, 'operation' | 'connection' | 'branches'> {
257
+ /** Named connection supplying this operation. */
258
+ connection: Connection<{
259
+ headObject(): Query<OperationInput, OperationOutput>;
260
+ }>;
261
+ /** Name matching the bound connection. */
262
+ connectionName: string;
263
+ /** The store returned the object's metadata. */
264
+ found: StepTarget<QueryResult<OperationOutput>>;
265
+ /** The object, or its bucket, does not exist; a HEAD response cannot say which. */
266
+ notFound?: StepTarget<QueryResult<OperationOutput>>;
267
+ /** The store conclusively rejected the read, such as a wrong Region, invalid credentials, or missing s3:GetObject permission. */
268
+ providerRejected?: StepTarget<QueryResult<OperationOutput>>;
269
+ /** The store returned metadata without a valid size or modification time. */
270
+ invalidResponse?: StepTarget<QueryResult<OperationOutput>>;
271
+ /** Local input, connection configuration, or connector definition is invalid. */
272
+ defect?: StepTarget<QueryResult<OperationOutput>>;
273
+ }
274
+ /** Build the headObject Step from a named connection. */
275
+ declare function newHeadObjectStep<StepInput, OperationInput = HeadObjectInput, OperationOutput = ObjectMetadata>(configuration: HeadObjectStepConfig<StepInput, OperationInput, OperationOutput>): QueryStep<StepInput, OperationInput, OperationOutput>;
276
+ /** Configuration for the getObjectText connector Step. */
277
+ interface GetObjectTextStepConfig<StepInput, OperationInput = GetObjectTextInput, OperationOutput = ObjectText> extends Omit<QueryStepConfig<StepInput, OperationInput, OperationOutput>, 'operation' | 'connection' | 'branches'> {
278
+ /** Named connection supplying this operation. */
279
+ connection: Connection<{
280
+ getObjectText(): Query<OperationInput, OperationOutput>;
281
+ }>;
282
+ /** Name matching the bound connection. */
283
+ connectionName: string;
284
+ /** The object's complete text was read within maxTextBytes. */
285
+ read: StepTarget<QueryResult<OperationOutput>>;
286
+ /** The object does not exist. */
287
+ notFound?: StepTarget<QueryResult<OperationOutput>>;
288
+ /** The object's content type is not text, its content is encoded such as gzip, or its bytes are not valid UTF-8 text. */
289
+ unsupportedContent?: StepTarget<QueryResult<OperationOutput>>;
290
+ /** The object is larger than maxTextBytes. */
291
+ tooLarge?: StepTarget<QueryResult<OperationOutput>>;
292
+ /** The store conclusively rejected the read, such as a missing bucket, a wrong Region, invalid credentials, or missing s3:GetObject permission. */
293
+ providerRejected?: StepTarget<QueryResult<OperationOutput>>;
294
+ /** The store returned a response without a valid size or with content that contains the connection's credentials. */
295
+ invalidResponse?: StepTarget<QueryResult<OperationOutput>>;
296
+ /** Local input, connection configuration, or connector definition is invalid. */
297
+ defect?: StepTarget<QueryResult<OperationOutput>>;
298
+ }
299
+ /** Build the getObjectText Step from a named connection. */
300
+ declare function newGetObjectTextStep<StepInput, OperationInput = GetObjectTextInput, OperationOutput = ObjectText>(configuration: GetObjectTextStepConfig<StepInput, OperationInput, OperationOutput>): QueryStep<StepInput, OperationInput, OperationOutput>;
301
+ /** Configuration for the putObject connector Step. */
302
+ interface PutObjectStepConfig<StepInput, OperationInput = PutObjectInput, OperationOutput = StoredObject> extends Omit<MutationStepConfig<StepInput, OperationInput, OperationOutput>, 'operation' | 'connection' | 'branches'> {
303
+ /** Named connection supplying this operation. */
304
+ connection: Connection<{
305
+ putObject(): Mutation<OperationInput, OperationOutput>;
306
+ }>;
307
+ /** Name matching the bound connection. */
308
+ connectionName: string;
309
+ /** The store holds the object this Step execution wrote. */
310
+ stored: StepTarget<MutationResult<OperationOutput>>;
311
+ /** Create-only mode found an object at the key that this Step execution did not write; nothing was written. */
312
+ alreadyExists?: StepTarget<MutationResult<OperationOutput>>;
313
+ /** The store conclusively rejected the write, such as a missing bucket, a wrong Region, invalid credentials, missing s3:PutObject permission, or a store that does not support create-only writes. */
314
+ providerRejected?: StepTarget<MutationResult<OperationOutput>>;
315
+ /** Local input, connection configuration, or connector definition is invalid. */
316
+ defect?: StepTarget<MutationResult<OperationOutput>>;
317
+ }
318
+ /** Build the putObject Step from a named connection. */
319
+ declare function newPutObjectStep<StepInput, OperationInput = PutObjectInput, OperationOutput = StoredObject>(configuration: PutObjectStepConfig<StepInput, OperationInput, OperationOutput>): MutationStep<StepInput, OperationInput, OperationOutput>;
320
+
321
+ export { Config, Connection, ConnectorID, Credentials, GetObjectTextBranch, GetObjectTextBranchDefect, GetObjectTextBranchInvalidResponse, GetObjectTextBranchNotFound, GetObjectTextBranchProviderRejected, GetObjectTextBranchRead, GetObjectTextBranchTooLarge, GetObjectTextBranchUnsupportedContent, GetObjectTextDefinition, GetObjectTextInput, GetObjectTextMetadata, GetObjectTextOperation, type GetObjectTextStepConfig, HeadObjectBranch, HeadObjectBranchDefect, HeadObjectBranchFound, HeadObjectBranchInvalidResponse, HeadObjectBranchNotFound, HeadObjectBranchProviderRejected, HeadObjectDefinition, HeadObjectInput, HeadObjectMetadata, HeadObjectOperation, type HeadObjectStepConfig, ListObjectsBranch, ListObjectsBranchDefect, ListObjectsBranchFound, ListObjectsBranchInvalidResponse, ListObjectsBranchNotFound, ListObjectsBranchProviderRejected, ListObjectsDefinition, ListObjectsInput, ListObjectsMetadata, ListObjectsOperation, ListObjectsOutput, type ListObjectsStepConfig, ObjectMetadata, ObjectText, ProviderID, PutObjectBranch, PutObjectBranchAlreadyExists, PutObjectBranchDefect, PutObjectBranchProviderRejected, PutObjectBranchStored, PutObjectDefinition, PutObjectInput, PutObjectMetadata, PutObjectOperation, type PutObjectStepConfig, S3Client, type S3ClientOptions, type S3Request, type S3RequestSender, type S3Response, type S3Session, StoredObject, containsCredential, header, newGetObjectTextStep, newHeadObjectStep, newListObjectsStep, newProjectConnection, newPutObjectStep, retryAfter, safeHeader, validateBucket, validateKey };