@superdurable/connector-amazon-sqs 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.
@@ -0,0 +1,504 @@
1
+ // src/generated/models.ts
2
+ import { z } from "zod";
3
+ import { SecretString } from "@superdurable/connectors-sdk";
4
+ var goTimeJSONPattern = /^(\d{4})-(\d{2})-(\d{2})T(\d{1,2}):(\d{2}):(\d{2})(?:[.,](\d+))?(Z|([+-])(\d{2}):(\d{2}))$/;
5
+ function isGoTimeJSON(value) {
6
+ const match = goTimeJSONPattern.exec(value);
7
+ if (!match) return false;
8
+ const [, yearText, monthText, dayText, hourText, minuteText, secondText, , zone, , zoneHourText, zoneMinuteText] = match;
9
+ const year = Number(yearText);
10
+ const month = Number(monthText);
11
+ const day = Number(dayText);
12
+ const isLeap = year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0);
13
+ const monthDays = [31, isLeap ? 29 : 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
14
+ return month >= 1 && month <= 12 && day >= 1 && day <= monthDays[month - 1] && Number(hourText) <= 23 && Number(minuteText) <= 59 && Number(secondText) <= 59 && (zone === "Z" || Number(zoneHourText) <= 24 && Number(zoneMinuteText) <= 60);
15
+ }
16
+ function canonicalGoTimeJSON(value) {
17
+ const match = goTimeJSONPattern.exec(value);
18
+ const [, year, month, day, hour, minute, second, fraction, zone, sign, zoneHour, zoneMinute] = match;
19
+ const clock = year + "-" + month + "-" + day + "T" + hour.padStart(2, "0") + ":" + minute + ":" + second;
20
+ const digits = (fraction ?? "").slice(0, 9).replace(/0+$/, "");
21
+ const offsetMinutes = zone === "Z" ? 0 : (Number(zoneHour) * 60 + Number(zoneMinute)) * (sign === "+" ? 1 : -1);
22
+ if (Math.abs(offsetMinutes) >= 1440) return value;
23
+ const offset = offsetMinutes === 0 ? "Z" : (offsetMinutes > 0 ? "+" : "-") + String(Math.floor(Math.abs(offsetMinutes) / 60)).padStart(2, "0") + ":" + String(Math.abs(offsetMinutes) % 60).padStart(2, "0");
24
+ return clock + (digits ? "." + digits : "") + offset;
25
+ }
26
+ var GoTimeJSONSchema = z.string().refine(isGoTimeJSON, "invalid Go time.Time JSON timestamp").transform(canonicalGoTimeJSON);
27
+ var ConfigSchema = z.object({
28
+ "region": z.string().optional(),
29
+ "endpoint": z.string().optional(),
30
+ "defaultQueueUrl": z.string().optional(),
31
+ "maxMessagesPerReceive": z.number().int().optional(),
32
+ "receiveWaitSeconds": z.number().int().optional(),
33
+ "maxResponseBytes": z.number().int().optional()
34
+ });
35
+ var CredentialMaterialError = class extends TypeError {
36
+ constructor(message) {
37
+ super(message);
38
+ this.name = "CredentialMaterialError";
39
+ }
40
+ };
41
+ var sdkCredentialDecodingFailureMessages = /* @__PURE__ */ new Set([
42
+ "project credential decoding failed",
43
+ "shared project credential decoding failed",
44
+ "project credential decoding failed: this connector version does not support shared credentials"
45
+ ]);
46
+ function isCredentialMaterialError(error) {
47
+ return error instanceof CredentialMaterialError || error instanceof TypeError && sdkCredentialDecodingFailureMessages.has(error.message);
48
+ }
49
+ function decodeCredentials(value) {
50
+ if (!value || typeof value !== "object" || Array.isArray(value)) throw new CredentialMaterialError("credential fields are invalid");
51
+ const fields = value;
52
+ const allowed = /* @__PURE__ */ new Set(["access_key_id", "secret_access_key", "session_token"]);
53
+ if (Object.keys(fields).some((key) => !allowed.has(key))) throw new CredentialMaterialError("stored credential does not match the connector credential fields");
54
+ if (fields["access_key_id"] != null && !(typeof fields["access_key_id"] === "string")) throw new CredentialMaterialError("credential access_key_id has an invalid type");
55
+ if (fields["secret_access_key"] != null && !(typeof fields["secret_access_key"] === "string")) throw new CredentialMaterialError("credential secret_access_key has an invalid type");
56
+ if (fields["session_token"] != null && !(typeof fields["session_token"] === "string")) throw new CredentialMaterialError("credential session_token has an invalid type");
57
+ const credentials = {};
58
+ if (!fields["access_key_id"]) throw new CredentialMaterialError("credential access_key_id is required");
59
+ credentials.accessKeyId = new SecretString(fields["access_key_id"] ?? "");
60
+ if (!fields["secret_access_key"]) throw new CredentialMaterialError("credential secret_access_key is required");
61
+ credentials.secretAccessKey = new SecretString(fields["secret_access_key"] ?? "");
62
+ credentials.sessionToken = new SecretString(fields["session_token"] ?? "");
63
+ return credentials;
64
+ }
65
+ var SendMessageInputSchema = z.strictObject({
66
+ "queueUrl": z.string().optional(),
67
+ "body": z.string(),
68
+ "messageGroupId": z.string().optional()
69
+ });
70
+ var SentMessageSchema = z.strictObject({
71
+ "queueUrl": z.string(),
72
+ "messageId": z.string(),
73
+ "md5OfBody": z.string()
74
+ });
75
+ var ReceiveMessagesInputSchema = z.strictObject({
76
+ "queueUrl": z.string().optional(),
77
+ "maxMessages": z.number().int().optional(),
78
+ "waitTimeSeconds": z.number().int().optional(),
79
+ "visibilityTimeoutSeconds": z.number().int().optional()
80
+ });
81
+ var MessageAttributeValueSchema = z.strictObject({
82
+ "dataType": z.string(),
83
+ "stringValue": z.string().optional(),
84
+ "binaryValue": z.base64().optional()
85
+ });
86
+ var MessageSchema = z.strictObject({
87
+ "messageId": z.string(),
88
+ "receiptHandle": z.string(),
89
+ "body": z.string(),
90
+ "md5OfBody": z.string(),
91
+ "sentAt": GoTimeJSONSchema.optional(),
92
+ "firstReceivedAt": GoTimeJSONSchema.optional(),
93
+ "receiveCount": z.number().int(),
94
+ "messageGroupId": z.string().optional(),
95
+ "messageDeduplicationId": z.string().optional(),
96
+ "sequenceNumber": z.string().optional(),
97
+ "messageAttributes": z.record(z.string(), MessageAttributeValueSchema).optional()
98
+ });
99
+ var ReceivedMessagesSchema = z.strictObject({
100
+ "queueUrl": z.string(),
101
+ "isFifo": z.boolean().optional(),
102
+ "messages": z.array(MessageSchema).optional()
103
+ });
104
+ var DeleteMessageInputSchema = z.strictObject({
105
+ "queueUrl": z.string().optional(),
106
+ "receiptHandle": z.string(),
107
+ "messageId": z.string().optional()
108
+ });
109
+ var DeletedMessageSchema = z.strictObject({
110
+ "queueUrl": z.string(),
111
+ "messageId": z.string().optional()
112
+ });
113
+ var ChangeMessageVisibilityInputSchema = z.strictObject({
114
+ "queueUrl": z.string().optional(),
115
+ "receiptHandle": z.string(),
116
+ "messageId": z.string().optional(),
117
+ "visibilityTimeoutSeconds": z.number().int()
118
+ });
119
+ var ChangedMessageVisibilitySchema = z.strictObject({
120
+ "queueUrl": z.string(),
121
+ "messageId": z.string().optional(),
122
+ "visibilityTimeoutSeconds": z.number().int(),
123
+ "visibleAfter": GoTimeJSONSchema
124
+ });
125
+ var ListQueuesInputSchema = z.strictObject({
126
+ "queueNamePrefix": z.string().optional(),
127
+ "maxResults": z.number().int().optional(),
128
+ "nextToken": z.string().optional()
129
+ });
130
+ var QueuePageSchema = z.strictObject({
131
+ "queueUrls": z.array(z.string()).nullable(),
132
+ "nextToken": z.string().optional()
133
+ });
134
+ var CreateQueueInputSchema = z.strictObject({
135
+ "queueName": z.string(),
136
+ "attributes": z.record(z.string(), z.string()).optional()
137
+ });
138
+ var QueueIdentitySchema = z.strictObject({
139
+ "queueUrl": z.string()
140
+ });
141
+ var QueueNameInputSchema = z.strictObject({
142
+ "queueName": z.string()
143
+ });
144
+ var QueueURLInputSchema = z.strictObject({
145
+ "queueUrl": z.string().optional()
146
+ });
147
+ var QueueAttributesSchema = z.strictObject({
148
+ "queueUrl": z.string(),
149
+ "attributes": z.record(z.string(), z.string()).nullable()
150
+ });
151
+ var SetQueueAttributeInputSchema = z.strictObject({
152
+ "queueUrl": z.string().optional(),
153
+ "attributeName": z.string(),
154
+ "attributeValue": z.string()
155
+ });
156
+
157
+ // src/generated/definitions.ts
158
+ var ConnectorID = "amazon-sqs";
159
+ var ProviderID = "amazon-sqs";
160
+ var SendMessageBranch = {
161
+ Sent: "sent",
162
+ ProviderRejected: "providerRejected",
163
+ Uncertain: "uncertain",
164
+ Defect: "defect"
165
+ };
166
+ var SendMessageBranchSent = SendMessageBranch.Sent;
167
+ var SendMessageBranchProviderRejected = SendMessageBranch.ProviderRejected;
168
+ var SendMessageBranchUncertain = SendMessageBranch.Uncertain;
169
+ var SendMessageBranchDefect = SendMessageBranch.Defect;
170
+ var SendMessageDefinition = {
171
+ operation: { connectorId: ConnectorID, operationId: "sendMessage" },
172
+ branches: [
173
+ { id: "sent", description: "SQS accepted the message and returned its message ID." },
174
+ { id: "providerRejected", description: "SQS conclusively rejected the queue or message.", optional: true },
175
+ { id: "uncertain", description: "SQS may have accepted the message but did not return a usable response before the send cap.", optional: true },
176
+ { id: "defect", description: "The queue URL, message, or connection is invalid.", optional: true }
177
+ ],
178
+ stepDefaults: { executeMethodTimeoutMs: 3e4, executeDurability: "sync" },
179
+ repeatOnUnknown: "limited",
180
+ maxSends: 3
181
+ };
182
+ var SendMessageMetadata = { kind: "mutation", idempotency: "required", authorization: "required" };
183
+ var ReceiveMessagesBranch = {
184
+ Received: "received",
185
+ Empty: "empty",
186
+ ProviderRejected: "providerRejected",
187
+ InvalidResponse: "invalidResponse",
188
+ Defect: "defect"
189
+ };
190
+ var ReceiveMessagesBranchReceived = ReceiveMessagesBranch.Received;
191
+ var ReceiveMessagesBranchEmpty = ReceiveMessagesBranch.Empty;
192
+ var ReceiveMessagesBranchProviderRejected = ReceiveMessagesBranch.ProviderRejected;
193
+ var ReceiveMessagesBranchInvalidResponse = ReceiveMessagesBranch.InvalidResponse;
194
+ var ReceiveMessagesBranchDefect = ReceiveMessagesBranch.Defect;
195
+ var ReceiveMessagesDefinition = {
196
+ operation: { connectorId: ConnectorID, operationId: "receiveMessages" },
197
+ branches: [
198
+ { id: "received", description: "SQS returned at least one message." },
199
+ { id: "empty", description: "No message arrived within the wait time.", optional: true },
200
+ { id: "providerRejected", description: "SQS conclusively rejected the receive, such as a missing queue, a wrong Region, invalid credentials, missing sqs:ReceiveMessage or kms:Decrypt permission, or too many in-flight messages.", optional: true },
201
+ { id: "invalidResponse", description: "SQS returned an invalid or oversized batch, or a message whose body does not match its MD5 digest; the batch's messages reappear when their visibility timeout ends.", optional: true },
202
+ { id: "defect", description: "Local input, connection configuration, or connector definition is invalid.", optional: true }
203
+ ],
204
+ stepDefaults: { executeMethodTimeoutMs: 3e4, executeDurability: "sync", executeRetry: { initialIntervalMs: 1e3, backoffCoefficient: 2, maximumIntervalMs: 3e4, maximumAttempts: 5, totalDurationMs: 12e4 } },
205
+ repeatOnUnknown: "safe"
206
+ };
207
+ var ReceiveMessagesMetadata = { kind: "mutation", idempotency: "required", authorization: "required" };
208
+ var DeleteMessageBranch = {
209
+ Deleted: "deleted",
210
+ ReceiptHandleInvalid: "receiptHandleInvalid",
211
+ ProviderRejected: "providerRejected",
212
+ Defect: "defect"
213
+ };
214
+ var DeleteMessageBranchDeleted = DeleteMessageBranch.Deleted;
215
+ var DeleteMessageBranchReceiptHandleInvalid = DeleteMessageBranch.ReceiptHandleInvalid;
216
+ var DeleteMessageBranchProviderRejected = DeleteMessageBranch.ProviderRejected;
217
+ var DeleteMessageBranchDefect = DeleteMessageBranch.Defect;
218
+ var DeleteMessageDefinition = {
219
+ operation: { connectorId: ConnectorID, operationId: "deleteMessage" },
220
+ branches: [
221
+ { id: "deleted", description: "SQS accepted the deletion. Amazon SQS also accepts an outdated receipt handle from an earlier delivery without deleting the message, which is then delivered again." },
222
+ { id: "receiptHandleInvalid", description: "SQS no longer accepts the receipt handle, such as an expired FIFO receipt handle or a malformed one, or, on a compatible server such as ElasticMQ, a handle whose message an earlier attempt already deleted; the message may be delivered again.", optional: true },
223
+ { id: "providerRejected", description: "SQS conclusively rejected the deletion, such as a missing queue, a wrong Region, invalid credentials, or missing sqs:DeleteMessage permission.", optional: true },
224
+ { id: "defect", description: "Local input, connection configuration, or connector definition is invalid.", optional: true }
225
+ ],
226
+ stepDefaults: { executeMethodTimeoutMs: 3e4, executeDurability: "async" },
227
+ repeatOnUnknown: "safe"
228
+ };
229
+ var DeleteMessageMetadata = { kind: "mutation", idempotency: "required", authorization: "required" };
230
+ var ChangeMessageVisibilityBranch = {
231
+ Changed: "changed",
232
+ ReceiptHandleInvalid: "receiptHandleInvalid",
233
+ ProviderRejected: "providerRejected",
234
+ Defect: "defect"
235
+ };
236
+ var ChangeMessageVisibilityBranchChanged = ChangeMessageVisibilityBranch.Changed;
237
+ var ChangeMessageVisibilityBranchReceiptHandleInvalid = ChangeMessageVisibilityBranch.ReceiptHandleInvalid;
238
+ var ChangeMessageVisibilityBranchProviderRejected = ChangeMessageVisibilityBranch.ProviderRejected;
239
+ var ChangeMessageVisibilityBranchDefect = ChangeMessageVisibilityBranch.Defect;
240
+ var ChangeMessageVisibilityDefinition = {
241
+ operation: { connectorId: ConnectorID, operationId: "changeMessageVisibility" },
242
+ branches: [
243
+ { id: "changed", description: "SQS set the message's visibility timeout." },
244
+ { id: "receiptHandleInvalid", description: "SQS no longer accepts the receipt handle, because the message is no longer in flight, was deleted, or the handle is expired or malformed.", optional: true },
245
+ { id: "providerRejected", description: "SQS conclusively rejected the change, such as a missing queue, a wrong Region, invalid credentials, missing sqs:ChangeMessageVisibility permission, or a timeout above the 12-hour limit.", optional: true },
246
+ { id: "defect", description: "Local input, connection configuration, or connector definition is invalid.", optional: true }
247
+ ],
248
+ stepDefaults: { executeMethodTimeoutMs: 3e4, executeDurability: "async", executeRetry: { initialIntervalMs: 1e3, backoffCoefficient: 2, maximumIntervalMs: 3e4, maximumAttempts: 5, totalDurationMs: 12e4 } },
249
+ repeatOnUnknown: "safe"
250
+ };
251
+ var ChangeMessageVisibilityMetadata = { kind: "mutation", idempotency: "required", authorization: "required" };
252
+ var ListQueuesBranch = {
253
+ Page: "page",
254
+ ProviderRejected: "providerRejected",
255
+ InvalidResponse: "invalidResponse",
256
+ Defect: "defect"
257
+ };
258
+ var ListQueuesBranchPage = ListQueuesBranch.Page;
259
+ var ListQueuesBranchProviderRejected = ListQueuesBranch.ProviderRejected;
260
+ var ListQueuesBranchInvalidResponse = ListQueuesBranch.InvalidResponse;
261
+ var ListQueuesBranchDefect = ListQueuesBranch.Defect;
262
+ var ListQueuesDefinition = {
263
+ operation: { connectorId: ConnectorID, operationId: "listQueues" },
264
+ branches: [
265
+ { id: "page", description: "SQS returned a page of queue URLs." },
266
+ { id: "providerRejected", description: "SQS refused the list.", optional: true },
267
+ { id: "invalidResponse", description: "SQS returned invalid queue data.", optional: true },
268
+ { id: "defect", description: "Queue filter or credentials are invalid.", optional: true }
269
+ ],
270
+ stepDefaults: { executeMethodTimeoutMs: 3e4, executeDurability: "async" }
271
+ };
272
+ var ListQueuesMetadata = { kind: "query", idempotency: "none", authorization: "required" };
273
+ var CreateQueueBranch = {
274
+ Created: "created",
275
+ ProviderRejected: "providerRejected",
276
+ InvalidResponse: "invalidResponse",
277
+ Defect: "defect"
278
+ };
279
+ var CreateQueueBranchCreated = CreateQueueBranch.Created;
280
+ var CreateQueueBranchProviderRejected = CreateQueueBranch.ProviderRejected;
281
+ var CreateQueueBranchInvalidResponse = CreateQueueBranch.InvalidResponse;
282
+ var CreateQueueBranchDefect = CreateQueueBranch.Defect;
283
+ var CreateQueueDefinition = {
284
+ operation: { connectorId: ConnectorID, operationId: "createQueue" },
285
+ branches: [
286
+ { id: "created", description: "SQS returned the queue URL." },
287
+ { id: "providerRejected", description: "SQS refused the creation or the name already has different attributes.", optional: true },
288
+ { id: "invalidResponse", description: "SQS returned an invalid queue URL.", optional: true },
289
+ { id: "defect", description: "Queue name, attributes, or credentials are invalid.", optional: true }
290
+ ],
291
+ stepDefaults: { executeMethodTimeoutMs: 3e4, executeDurability: "async" },
292
+ repeatOnUnknown: "safe"
293
+ };
294
+ var CreateQueueMetadata = { kind: "mutation", idempotency: "required", authorization: "required" };
295
+ var GetQueueURLBranch = {
296
+ Found: "found",
297
+ Missing: "missing",
298
+ ProviderRejected: "providerRejected",
299
+ InvalidResponse: "invalidResponse",
300
+ Defect: "defect"
301
+ };
302
+ var GetQueueURLBranchFound = GetQueueURLBranch.Found;
303
+ var GetQueueURLBranchMissing = GetQueueURLBranch.Missing;
304
+ var GetQueueURLBranchProviderRejected = GetQueueURLBranch.ProviderRejected;
305
+ var GetQueueURLBranchInvalidResponse = GetQueueURLBranch.InvalidResponse;
306
+ var GetQueueURLBranchDefect = GetQueueURLBranch.Defect;
307
+ var GetQueueURLDefinition = {
308
+ operation: { connectorId: ConnectorID, operationId: "getQueueURL" },
309
+ branches: [
310
+ { id: "found", description: "SQS returned the queue URL." },
311
+ { id: "missing", description: "The queue does not exist.", optional: true },
312
+ { id: "providerRejected", description: "SQS refused the lookup.", optional: true },
313
+ { id: "invalidResponse", description: "SQS returned an invalid queue URL.", optional: true },
314
+ { id: "defect", description: "Queue name or credentials are invalid.", optional: true }
315
+ ],
316
+ stepDefaults: { executeMethodTimeoutMs: 3e4, executeDurability: "async" }
317
+ };
318
+ var GetQueueURLMetadata = { kind: "query", idempotency: "none", authorization: "required" };
319
+ var GetQueueAttributesBranch = {
320
+ Found: "found",
321
+ Missing: "missing",
322
+ ProviderRejected: "providerRejected",
323
+ InvalidResponse: "invalidResponse",
324
+ Defect: "defect"
325
+ };
326
+ var GetQueueAttributesBranchFound = GetQueueAttributesBranch.Found;
327
+ var GetQueueAttributesBranchMissing = GetQueueAttributesBranch.Missing;
328
+ var GetQueueAttributesBranchProviderRejected = GetQueueAttributesBranch.ProviderRejected;
329
+ var GetQueueAttributesBranchInvalidResponse = GetQueueAttributesBranch.InvalidResponse;
330
+ var GetQueueAttributesBranchDefect = GetQueueAttributesBranch.Defect;
331
+ var GetQueueAttributesDefinition = {
332
+ operation: { connectorId: ConnectorID, operationId: "getQueueAttributes" },
333
+ branches: [
334
+ { id: "found", description: "SQS returned queue attributes." },
335
+ { id: "missing", description: "The queue does not exist.", optional: true },
336
+ { id: "providerRejected", description: "SQS refused the read.", optional: true },
337
+ { id: "invalidResponse", description: "SQS returned invalid attributes.", optional: true },
338
+ { id: "defect", description: "Queue URL or credentials are invalid.", optional: true }
339
+ ],
340
+ stepDefaults: { executeMethodTimeoutMs: 3e4, executeDurability: "async" }
341
+ };
342
+ var GetQueueAttributesMetadata = { kind: "query", idempotency: "none", authorization: "required" };
343
+ var SetQueueAttributeBranch = {
344
+ Updated: "updated",
345
+ ProviderRejected: "providerRejected",
346
+ Defect: "defect"
347
+ };
348
+ var SetQueueAttributeBranchUpdated = SetQueueAttributeBranch.Updated;
349
+ var SetQueueAttributeBranchProviderRejected = SetQueueAttributeBranch.ProviderRejected;
350
+ var SetQueueAttributeBranchDefect = SetQueueAttributeBranch.Defect;
351
+ var SetQueueAttributeDefinition = {
352
+ operation: { connectorId: ConnectorID, operationId: "setQueueAttribute" },
353
+ branches: [
354
+ { id: "updated", description: "SQS accepted the new setting." },
355
+ { id: "providerRejected", description: "SQS refused the setting.", optional: true },
356
+ { id: "defect", description: "Queue URL, setting, or credentials are invalid.", optional: true }
357
+ ],
358
+ stepDefaults: { executeMethodTimeoutMs: 3e4, executeDurability: "async" },
359
+ repeatOnUnknown: "safe"
360
+ };
361
+ var SetQueueAttributeMetadata = { kind: "mutation", idempotency: "required", authorization: "required" };
362
+ var DeleteQueueBranch = {
363
+ Deleted: "deleted",
364
+ ProviderRejected: "providerRejected",
365
+ Defect: "defect"
366
+ };
367
+ var DeleteQueueBranchDeleted = DeleteQueueBranch.Deleted;
368
+ var DeleteQueueBranchProviderRejected = DeleteQueueBranch.ProviderRejected;
369
+ var DeleteQueueBranchDefect = DeleteQueueBranch.Defect;
370
+ var DeleteQueueDefinition = {
371
+ operation: { connectorId: ConnectorID, operationId: "deleteQueue" },
372
+ branches: [
373
+ { id: "deleted", description: "SQS accepted queue deletion." },
374
+ { id: "providerRejected", description: "SQS refused queue deletion.", optional: true },
375
+ { id: "defect", description: "Queue URL or credentials are invalid.", optional: true }
376
+ ],
377
+ stepDefaults: { executeMethodTimeoutMs: 3e4, executeDurability: "async" },
378
+ repeatOnUnknown: "safe"
379
+ };
380
+ var DeleteQueueMetadata = { kind: "mutation", idempotency: "required", authorization: "required" };
381
+
382
+ // src/generated/connection.ts
383
+ import { ConnectionRefSchema } from "@superdurable/connectors-sdk";
384
+ var Connection = class {
385
+ /** Stable provider and connection name. */
386
+ reference;
387
+ /** Bound provider operations. */
388
+ operations;
389
+ /** Validate a reference and bind operations. */
390
+ constructor(reference, operations) {
391
+ this.reference = ConnectionRefSchema.parse(reference);
392
+ if (this.reference.provider !== ProviderID) throw new TypeError("connection provider differs from the manifest");
393
+ if (!operations) throw new TypeError("connector operations are required");
394
+ this.operations = operations;
395
+ }
396
+ };
397
+ function newConnection(client, reference) {
398
+ if (!client) throw new TypeError("connector client is required");
399
+ return new Connection(reference, client);
400
+ }
401
+ function newConnectionWithOperations(operations, reference) {
402
+ return new Connection(reference, operations);
403
+ }
404
+
405
+ export {
406
+ ConfigSchema,
407
+ CredentialMaterialError,
408
+ isCredentialMaterialError,
409
+ decodeCredentials,
410
+ SendMessageInputSchema,
411
+ SentMessageSchema,
412
+ ReceiveMessagesInputSchema,
413
+ MessageAttributeValueSchema,
414
+ MessageSchema,
415
+ ReceivedMessagesSchema,
416
+ DeleteMessageInputSchema,
417
+ DeletedMessageSchema,
418
+ ChangeMessageVisibilityInputSchema,
419
+ ChangedMessageVisibilitySchema,
420
+ ListQueuesInputSchema,
421
+ QueuePageSchema,
422
+ CreateQueueInputSchema,
423
+ QueueIdentitySchema,
424
+ QueueNameInputSchema,
425
+ QueueURLInputSchema,
426
+ QueueAttributesSchema,
427
+ SetQueueAttributeInputSchema,
428
+ ConnectorID,
429
+ ProviderID,
430
+ SendMessageBranch,
431
+ SendMessageBranchSent,
432
+ SendMessageBranchProviderRejected,
433
+ SendMessageBranchUncertain,
434
+ SendMessageBranchDefect,
435
+ SendMessageDefinition,
436
+ SendMessageMetadata,
437
+ ReceiveMessagesBranch,
438
+ ReceiveMessagesBranchReceived,
439
+ ReceiveMessagesBranchEmpty,
440
+ ReceiveMessagesBranchProviderRejected,
441
+ ReceiveMessagesBranchInvalidResponse,
442
+ ReceiveMessagesBranchDefect,
443
+ ReceiveMessagesDefinition,
444
+ ReceiveMessagesMetadata,
445
+ DeleteMessageBranch,
446
+ DeleteMessageBranchDeleted,
447
+ DeleteMessageBranchReceiptHandleInvalid,
448
+ DeleteMessageBranchProviderRejected,
449
+ DeleteMessageBranchDefect,
450
+ DeleteMessageDefinition,
451
+ DeleteMessageMetadata,
452
+ ChangeMessageVisibilityBranch,
453
+ ChangeMessageVisibilityBranchChanged,
454
+ ChangeMessageVisibilityBranchReceiptHandleInvalid,
455
+ ChangeMessageVisibilityBranchProviderRejected,
456
+ ChangeMessageVisibilityBranchDefect,
457
+ ChangeMessageVisibilityDefinition,
458
+ ChangeMessageVisibilityMetadata,
459
+ ListQueuesBranch,
460
+ ListQueuesBranchPage,
461
+ ListQueuesBranchProviderRejected,
462
+ ListQueuesBranchInvalidResponse,
463
+ ListQueuesBranchDefect,
464
+ ListQueuesDefinition,
465
+ ListQueuesMetadata,
466
+ CreateQueueBranch,
467
+ CreateQueueBranchCreated,
468
+ CreateQueueBranchProviderRejected,
469
+ CreateQueueBranchInvalidResponse,
470
+ CreateQueueBranchDefect,
471
+ CreateQueueDefinition,
472
+ CreateQueueMetadata,
473
+ GetQueueURLBranch,
474
+ GetQueueURLBranchFound,
475
+ GetQueueURLBranchMissing,
476
+ GetQueueURLBranchProviderRejected,
477
+ GetQueueURLBranchInvalidResponse,
478
+ GetQueueURLBranchDefect,
479
+ GetQueueURLDefinition,
480
+ GetQueueURLMetadata,
481
+ GetQueueAttributesBranch,
482
+ GetQueueAttributesBranchFound,
483
+ GetQueueAttributesBranchMissing,
484
+ GetQueueAttributesBranchProviderRejected,
485
+ GetQueueAttributesBranchInvalidResponse,
486
+ GetQueueAttributesBranchDefect,
487
+ GetQueueAttributesDefinition,
488
+ GetQueueAttributesMetadata,
489
+ SetQueueAttributeBranch,
490
+ SetQueueAttributeBranchUpdated,
491
+ SetQueueAttributeBranchProviderRejected,
492
+ SetQueueAttributeBranchDefect,
493
+ SetQueueAttributeDefinition,
494
+ SetQueueAttributeMetadata,
495
+ DeleteQueueBranch,
496
+ DeleteQueueBranchDeleted,
497
+ DeleteQueueBranchProviderRejected,
498
+ DeleteQueueBranchDefect,
499
+ DeleteQueueDefinition,
500
+ DeleteQueueMetadata,
501
+ Connection,
502
+ newConnection,
503
+ newConnectionWithOperations
504
+ };