@superdurable/connector-amazon-s3 0.1.1 → 0.2.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/README.md +5 -16
- package/dex-connector.json +621 -6
- package/dist/chunk-6LKGFP44.js +755 -0
- package/dist/{connection-DmewJaUl.d.ts → connection-CmMVOLxi.d.ts} +343 -8
- package/dist/index.d.ts +495 -7
- package/dist/index.js +958 -26
- package/dist/mock.d.ts +182 -2
- package/dist/mock.js +454 -12
- package/package.json +4 -3
- package/dist/chunk-OCSVX3FX.js +0 -269
package/dist/chunk-OCSVX3FX.js
DELETED
|
@@ -1,269 +0,0 @@
|
|
|
1
|
-
// src/generated/models.ts
|
|
2
|
-
import { z } from "zod";
|
|
3
|
-
var ConfigSchema = z.object({
|
|
4
|
-
"region": z.string().optional(),
|
|
5
|
-
"endpoint": z.string().optional(),
|
|
6
|
-
"addressingStyle": z.string().optional(),
|
|
7
|
-
"defaultBucket": z.string().optional(),
|
|
8
|
-
"listPageSize": z.number().int().optional(),
|
|
9
|
-
"maxResponseBytes": z.number().int().optional(),
|
|
10
|
-
"maxTextBytes": z.number().int().optional(),
|
|
11
|
-
"maxUploadBytes": z.number().int().optional()
|
|
12
|
-
});
|
|
13
|
-
var ListObjectsInputSchema = z.strictObject({
|
|
14
|
-
"bucket": z.string().optional(),
|
|
15
|
-
"prefix": z.string().optional(),
|
|
16
|
-
"delimiter": z.string().optional(),
|
|
17
|
-
"startAfter": z.string().optional(),
|
|
18
|
-
"continuationToken": z.string().optional(),
|
|
19
|
-
"maxKeys": z.number().int().optional()
|
|
20
|
-
});
|
|
21
|
-
var ObjectSummarySchema = z.strictObject({
|
|
22
|
-
"key": z.string(),
|
|
23
|
-
"sizeBytes": z.number().int(),
|
|
24
|
-
"eTag": z.string().optional(),
|
|
25
|
-
"lastModified": z.iso.datetime({ offset: true }).optional(),
|
|
26
|
-
"storageClass": z.string().optional()
|
|
27
|
-
});
|
|
28
|
-
var ListObjectsOutputSchema = z.strictObject({
|
|
29
|
-
"bucket": z.string(),
|
|
30
|
-
"prefix": z.string().optional(),
|
|
31
|
-
"delimiter": z.string().optional(),
|
|
32
|
-
"objects": z.array(ObjectSummarySchema).optional(),
|
|
33
|
-
"commonPrefixes": z.array(z.string()).optional(),
|
|
34
|
-
"isTruncated": z.boolean(),
|
|
35
|
-
"nextContinuationToken": z.string().optional()
|
|
36
|
-
});
|
|
37
|
-
var HeadObjectInputSchema = z.strictObject({
|
|
38
|
-
"bucket": z.string().optional(),
|
|
39
|
-
"key": z.string()
|
|
40
|
-
});
|
|
41
|
-
var ObjectMetadataSchema = z.strictObject({
|
|
42
|
-
"bucket": z.string(),
|
|
43
|
-
"key": z.string(),
|
|
44
|
-
"sizeBytes": z.number().int(),
|
|
45
|
-
"eTag": z.string().optional(),
|
|
46
|
-
"contentType": z.string().optional(),
|
|
47
|
-
"contentEncoding": z.string().optional(),
|
|
48
|
-
"contentLanguage": z.string().optional(),
|
|
49
|
-
"contentDisposition": z.string().optional(),
|
|
50
|
-
"cacheControl": z.string().optional(),
|
|
51
|
-
"lastModified": z.iso.datetime({ offset: true }).optional(),
|
|
52
|
-
"versionId": z.string().optional(),
|
|
53
|
-
"storageClass": z.string().optional(),
|
|
54
|
-
"serverSideEncryption": z.string().optional(),
|
|
55
|
-
"metadata": z.record(z.string(), z.string()).optional(),
|
|
56
|
-
"missingMetadataCount": z.number().int().optional()
|
|
57
|
-
});
|
|
58
|
-
var GetObjectTextInputSchema = z.strictObject({
|
|
59
|
-
"bucket": z.string().optional(),
|
|
60
|
-
"key": z.string()
|
|
61
|
-
});
|
|
62
|
-
var ObjectTextSchema = z.strictObject({
|
|
63
|
-
"bucket": z.string(),
|
|
64
|
-
"key": z.string(),
|
|
65
|
-
"contentType": z.string().optional(),
|
|
66
|
-
"eTag": z.string().optional(),
|
|
67
|
-
"versionId": z.string().optional(),
|
|
68
|
-
"lastModified": z.iso.datetime({ offset: true }).optional(),
|
|
69
|
-
"sizeBytes": z.number().int(),
|
|
70
|
-
"text": z.string().optional()
|
|
71
|
-
});
|
|
72
|
-
var PutObjectInputSchema = z.strictObject({
|
|
73
|
-
"bucket": z.string().optional(),
|
|
74
|
-
"key": z.string(),
|
|
75
|
-
"contentType": z.string(),
|
|
76
|
-
"textContent": z.string().optional(),
|
|
77
|
-
"byteContent": z.base64().optional(),
|
|
78
|
-
"metadata": z.record(z.string(), z.string()).optional(),
|
|
79
|
-
"isCreateOnly": z.boolean().optional()
|
|
80
|
-
});
|
|
81
|
-
var StoredObjectSchema = z.strictObject({
|
|
82
|
-
"bucket": z.string(),
|
|
83
|
-
"key": z.string(),
|
|
84
|
-
"eTag": z.string().optional(),
|
|
85
|
-
"versionId": z.string().optional(),
|
|
86
|
-
"sizeBytes": z.number().int(),
|
|
87
|
-
"contentType": z.string().optional(),
|
|
88
|
-
"lastModified": z.iso.datetime({ offset: true }).optional(),
|
|
89
|
-
"isFromEarlierAttempt": z.boolean().optional()
|
|
90
|
-
});
|
|
91
|
-
|
|
92
|
-
// src/generated/definitions.ts
|
|
93
|
-
var ConnectorID = "amazon-s3";
|
|
94
|
-
var ProviderID = "amazon-s3";
|
|
95
|
-
var ListObjectsBranch = {
|
|
96
|
-
Found: "found",
|
|
97
|
-
NotFound: "notFound",
|
|
98
|
-
ProviderRejected: "providerRejected",
|
|
99
|
-
InvalidResponse: "invalidResponse",
|
|
100
|
-
Defect: "defect"
|
|
101
|
-
};
|
|
102
|
-
var ListObjectsBranchFound = ListObjectsBranch.Found;
|
|
103
|
-
var ListObjectsBranchNotFound = ListObjectsBranch.NotFound;
|
|
104
|
-
var ListObjectsBranchProviderRejected = ListObjectsBranch.ProviderRejected;
|
|
105
|
-
var ListObjectsBranchInvalidResponse = ListObjectsBranch.InvalidResponse;
|
|
106
|
-
var ListObjectsBranchDefect = ListObjectsBranch.Defect;
|
|
107
|
-
var ListObjectsDefinition = {
|
|
108
|
-
operation: { connectorId: ConnectorID, operationId: "listObjects" },
|
|
109
|
-
branches: [
|
|
110
|
-
{ id: "found", description: "The page holds objects or common prefixes, or more pages remain." },
|
|
111
|
-
{ id: "notFound", description: "No object matched the prefix and no further page remains.", optional: true },
|
|
112
|
-
{ id: "providerRejected", description: "The store conclusively rejected the list, such as a missing bucket, a wrong Region, invalid credentials, or missing s3:ListBucket permission.", optional: true },
|
|
113
|
-
{ id: "invalidResponse", description: "The store returned an invalid or oversized list page.", optional: true },
|
|
114
|
-
{ id: "defect", description: "Local input, connection configuration, or connector definition is invalid.", optional: true }
|
|
115
|
-
],
|
|
116
|
-
stepDefaults: { executeMethodTimeoutMs: 3e4, executeDurability: "async" }
|
|
117
|
-
};
|
|
118
|
-
var ListObjectsMetadata = { kind: "query", idempotency: "none", authorization: "required" };
|
|
119
|
-
var HeadObjectBranch = {
|
|
120
|
-
Found: "found",
|
|
121
|
-
NotFound: "notFound",
|
|
122
|
-
ProviderRejected: "providerRejected",
|
|
123
|
-
InvalidResponse: "invalidResponse",
|
|
124
|
-
Defect: "defect"
|
|
125
|
-
};
|
|
126
|
-
var HeadObjectBranchFound = HeadObjectBranch.Found;
|
|
127
|
-
var HeadObjectBranchNotFound = HeadObjectBranch.NotFound;
|
|
128
|
-
var HeadObjectBranchProviderRejected = HeadObjectBranch.ProviderRejected;
|
|
129
|
-
var HeadObjectBranchInvalidResponse = HeadObjectBranch.InvalidResponse;
|
|
130
|
-
var HeadObjectBranchDefect = HeadObjectBranch.Defect;
|
|
131
|
-
var HeadObjectDefinition = {
|
|
132
|
-
operation: { connectorId: ConnectorID, operationId: "headObject" },
|
|
133
|
-
branches: [
|
|
134
|
-
{ id: "found", description: "The store returned the object's metadata." },
|
|
135
|
-
{ id: "notFound", description: "The object, or its bucket, does not exist; a HEAD response cannot say which.", optional: true },
|
|
136
|
-
{ id: "providerRejected", description: "The store conclusively rejected the read, such as a wrong Region, invalid credentials, or missing s3:GetObject permission.", optional: true },
|
|
137
|
-
{ id: "invalidResponse", description: "The store returned metadata without a valid size or modification time.", optional: true },
|
|
138
|
-
{ id: "defect", description: "Local input, connection configuration, or connector definition is invalid.", optional: true }
|
|
139
|
-
],
|
|
140
|
-
stepDefaults: { executeMethodTimeoutMs: 3e4, executeDurability: "async" }
|
|
141
|
-
};
|
|
142
|
-
var HeadObjectMetadata = { kind: "query", idempotency: "none", authorization: "required" };
|
|
143
|
-
var GetObjectTextBranch = {
|
|
144
|
-
Read: "read",
|
|
145
|
-
NotFound: "notFound",
|
|
146
|
-
UnsupportedContent: "unsupportedContent",
|
|
147
|
-
TooLarge: "tooLarge",
|
|
148
|
-
ProviderRejected: "providerRejected",
|
|
149
|
-
InvalidResponse: "invalidResponse",
|
|
150
|
-
Defect: "defect"
|
|
151
|
-
};
|
|
152
|
-
var GetObjectTextBranchRead = GetObjectTextBranch.Read;
|
|
153
|
-
var GetObjectTextBranchNotFound = GetObjectTextBranch.NotFound;
|
|
154
|
-
var GetObjectTextBranchUnsupportedContent = GetObjectTextBranch.UnsupportedContent;
|
|
155
|
-
var GetObjectTextBranchTooLarge = GetObjectTextBranch.TooLarge;
|
|
156
|
-
var GetObjectTextBranchProviderRejected = GetObjectTextBranch.ProviderRejected;
|
|
157
|
-
var GetObjectTextBranchInvalidResponse = GetObjectTextBranch.InvalidResponse;
|
|
158
|
-
var GetObjectTextBranchDefect = GetObjectTextBranch.Defect;
|
|
159
|
-
var GetObjectTextDefinition = {
|
|
160
|
-
operation: { connectorId: ConnectorID, operationId: "getObjectText" },
|
|
161
|
-
branches: [
|
|
162
|
-
{ id: "read", description: "The object's complete text was read within maxTextBytes." },
|
|
163
|
-
{ id: "notFound", description: "The object does not exist.", optional: true },
|
|
164
|
-
{ id: "unsupportedContent", description: "The object's content type is not text, its content is encoded such as gzip, or its bytes are not valid UTF-8 text.", optional: true },
|
|
165
|
-
{ id: "tooLarge", description: "The object is larger than maxTextBytes.", optional: true },
|
|
166
|
-
{ id: "providerRejected", description: "The store conclusively rejected the read, such as a missing bucket, a wrong Region, invalid credentials, or missing s3:GetObject permission.", optional: true },
|
|
167
|
-
{ id: "invalidResponse", description: "The store returned a response without a valid size or with content that contains the connection's credentials.", optional: true },
|
|
168
|
-
{ id: "defect", description: "Local input, connection configuration, or connector definition is invalid.", optional: true }
|
|
169
|
-
],
|
|
170
|
-
stepDefaults: { executeMethodTimeoutMs: 3e4, executeDurability: "async" }
|
|
171
|
-
};
|
|
172
|
-
var GetObjectTextMetadata = { kind: "query", idempotency: "none", authorization: "required" };
|
|
173
|
-
var PutObjectBranch = {
|
|
174
|
-
Stored: "stored",
|
|
175
|
-
AlreadyExists: "alreadyExists",
|
|
176
|
-
ProviderRejected: "providerRejected",
|
|
177
|
-
Defect: "defect"
|
|
178
|
-
};
|
|
179
|
-
var PutObjectBranchStored = PutObjectBranch.Stored;
|
|
180
|
-
var PutObjectBranchAlreadyExists = PutObjectBranch.AlreadyExists;
|
|
181
|
-
var PutObjectBranchProviderRejected = PutObjectBranch.ProviderRejected;
|
|
182
|
-
var PutObjectBranchDefect = PutObjectBranch.Defect;
|
|
183
|
-
var PutObjectDefinition = {
|
|
184
|
-
operation: { connectorId: ConnectorID, operationId: "putObject" },
|
|
185
|
-
branches: [
|
|
186
|
-
{ id: "stored", description: "The store holds the object this Step execution wrote." },
|
|
187
|
-
{ id: "alreadyExists", description: "Create-only mode found an object at the key that this Step execution did not write; nothing was written.", optional: true },
|
|
188
|
-
{ id: "providerRejected", description: "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.", optional: true },
|
|
189
|
-
{ id: "defect", description: "Local input, connection configuration, or connector definition is invalid.", optional: true }
|
|
190
|
-
],
|
|
191
|
-
stepDefaults: { executeMethodTimeoutMs: 3e4, executeDurability: "async" }
|
|
192
|
-
};
|
|
193
|
-
var PutObjectMetadata = { kind: "mutation", idempotency: "required", authorization: "required" };
|
|
194
|
-
|
|
195
|
-
// src/generated/connection.ts
|
|
196
|
-
import { ConnectionRefSchema } from "@superdurable/connectors-sdk";
|
|
197
|
-
var Connection = class {
|
|
198
|
-
/** Stable provider and connection name. */
|
|
199
|
-
reference;
|
|
200
|
-
/** Bound provider operations. */
|
|
201
|
-
operations;
|
|
202
|
-
/** Validate a reference and bind operations. */
|
|
203
|
-
constructor(reference, operations) {
|
|
204
|
-
this.reference = ConnectionRefSchema.parse(reference);
|
|
205
|
-
if (this.reference.provider !== ProviderID) throw new TypeError("connection provider differs from the manifest");
|
|
206
|
-
if (!operations) throw new TypeError("connector operations are required");
|
|
207
|
-
this.operations = operations;
|
|
208
|
-
}
|
|
209
|
-
};
|
|
210
|
-
function newConnection(client, reference) {
|
|
211
|
-
if (!client) throw new TypeError("connector client is required");
|
|
212
|
-
return new Connection(reference, client);
|
|
213
|
-
}
|
|
214
|
-
function newConnectionWithOperations(operations, reference) {
|
|
215
|
-
return new Connection(reference, operations);
|
|
216
|
-
}
|
|
217
|
-
var ConnectionNameProvider = "amazon-s3";
|
|
218
|
-
|
|
219
|
-
export {
|
|
220
|
-
ConfigSchema,
|
|
221
|
-
ListObjectsInputSchema,
|
|
222
|
-
ObjectSummarySchema,
|
|
223
|
-
ListObjectsOutputSchema,
|
|
224
|
-
HeadObjectInputSchema,
|
|
225
|
-
ObjectMetadataSchema,
|
|
226
|
-
GetObjectTextInputSchema,
|
|
227
|
-
ObjectTextSchema,
|
|
228
|
-
PutObjectInputSchema,
|
|
229
|
-
StoredObjectSchema,
|
|
230
|
-
ConnectorID,
|
|
231
|
-
ProviderID,
|
|
232
|
-
ListObjectsBranch,
|
|
233
|
-
ListObjectsBranchFound,
|
|
234
|
-
ListObjectsBranchNotFound,
|
|
235
|
-
ListObjectsBranchProviderRejected,
|
|
236
|
-
ListObjectsBranchInvalidResponse,
|
|
237
|
-
ListObjectsBranchDefect,
|
|
238
|
-
ListObjectsDefinition,
|
|
239
|
-
ListObjectsMetadata,
|
|
240
|
-
HeadObjectBranch,
|
|
241
|
-
HeadObjectBranchFound,
|
|
242
|
-
HeadObjectBranchNotFound,
|
|
243
|
-
HeadObjectBranchProviderRejected,
|
|
244
|
-
HeadObjectBranchInvalidResponse,
|
|
245
|
-
HeadObjectBranchDefect,
|
|
246
|
-
HeadObjectDefinition,
|
|
247
|
-
HeadObjectMetadata,
|
|
248
|
-
GetObjectTextBranch,
|
|
249
|
-
GetObjectTextBranchRead,
|
|
250
|
-
GetObjectTextBranchNotFound,
|
|
251
|
-
GetObjectTextBranchUnsupportedContent,
|
|
252
|
-
GetObjectTextBranchTooLarge,
|
|
253
|
-
GetObjectTextBranchProviderRejected,
|
|
254
|
-
GetObjectTextBranchInvalidResponse,
|
|
255
|
-
GetObjectTextBranchDefect,
|
|
256
|
-
GetObjectTextDefinition,
|
|
257
|
-
GetObjectTextMetadata,
|
|
258
|
-
PutObjectBranch,
|
|
259
|
-
PutObjectBranchStored,
|
|
260
|
-
PutObjectBranchAlreadyExists,
|
|
261
|
-
PutObjectBranchProviderRejected,
|
|
262
|
-
PutObjectBranchDefect,
|
|
263
|
-
PutObjectDefinition,
|
|
264
|
-
PutObjectMetadata,
|
|
265
|
-
Connection,
|
|
266
|
-
newConnection,
|
|
267
|
-
newConnectionWithOperations,
|
|
268
|
-
ConnectionNameProvider
|
|
269
|
-
};
|