@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.
@@ -1,192 +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
- "defaultQueueUrl": z.string().optional(),
7
- "maxMessagesPerReceive": z.number().int().optional(),
8
- "receiveWaitSeconds": z.number().int().optional(),
9
- "maxResponseBytes": z.number().int().optional()
10
- });
11
- var ReceiveMessagesInputSchema = z.strictObject({
12
- "queueUrl": z.string().optional(),
13
- "maxMessages": z.number().int().optional(),
14
- "waitTimeSeconds": z.number().int().optional(),
15
- "visibilityTimeoutSeconds": z.number().int().optional()
16
- });
17
- var MessageAttributeValueSchema = z.strictObject({
18
- "dataType": z.string(),
19
- "stringValue": z.string().optional(),
20
- "binaryValue": z.base64().optional()
21
- });
22
- var MessageSchema = z.strictObject({
23
- "messageId": z.string(),
24
- "receiptHandle": z.string(),
25
- "body": z.string(),
26
- "md5OfBody": z.string(),
27
- "sentAt": z.iso.datetime({ offset: true }).optional(),
28
- "firstReceivedAt": z.iso.datetime({ offset: true }).optional(),
29
- "receiveCount": z.number().int(),
30
- "messageGroupId": z.string().optional(),
31
- "messageDeduplicationId": z.string().optional(),
32
- "sequenceNumber": z.string().optional(),
33
- "messageAttributes": z.record(z.string(), MessageAttributeValueSchema).optional()
34
- });
35
- var ReceivedMessagesSchema = z.strictObject({
36
- "queueUrl": z.string(),
37
- "isFifo": z.boolean().optional(),
38
- "messages": z.array(MessageSchema).optional()
39
- });
40
- var DeleteMessageInputSchema = z.strictObject({
41
- "queueUrl": z.string().optional(),
42
- "receiptHandle": z.string(),
43
- "messageId": z.string().optional()
44
- });
45
- var DeletedMessageSchema = z.strictObject({
46
- "queueUrl": z.string(),
47
- "messageId": z.string().optional()
48
- });
49
- var ChangeMessageVisibilityInputSchema = z.strictObject({
50
- "queueUrl": z.string().optional(),
51
- "receiptHandle": z.string(),
52
- "messageId": z.string().optional(),
53
- "visibilityTimeoutSeconds": z.number().int()
54
- });
55
- var ChangedMessageVisibilitySchema = z.strictObject({
56
- "queueUrl": z.string(),
57
- "messageId": z.string().optional(),
58
- "visibilityTimeoutSeconds": z.number().int(),
59
- "visibleAfter": z.iso.datetime({ offset: true })
60
- });
61
-
62
- // src/generated/definitions.ts
63
- var ConnectorID = "amazon-sqs";
64
- var ProviderID = "amazon-sqs";
65
- var ReceiveMessagesBranch = {
66
- Received: "received",
67
- Empty: "empty",
68
- ProviderRejected: "providerRejected",
69
- InvalidResponse: "invalidResponse",
70
- Defect: "defect"
71
- };
72
- var ReceiveMessagesBranchReceived = ReceiveMessagesBranch.Received;
73
- var ReceiveMessagesBranchEmpty = ReceiveMessagesBranch.Empty;
74
- var ReceiveMessagesBranchProviderRejected = ReceiveMessagesBranch.ProviderRejected;
75
- var ReceiveMessagesBranchInvalidResponse = ReceiveMessagesBranch.InvalidResponse;
76
- var ReceiveMessagesBranchDefect = ReceiveMessagesBranch.Defect;
77
- var ReceiveMessagesDefinition = {
78
- operation: { connectorId: ConnectorID, operationId: "receiveMessages" },
79
- branches: [
80
- { id: "received", description: "SQS returned at least one message." },
81
- { id: "empty", description: "No message arrived within the wait time.", optional: true },
82
- { 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 },
83
- { 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 },
84
- { id: "defect", description: "Local input, connection configuration, or connector definition is invalid.", optional: true }
85
- ],
86
- stepDefaults: { executeMethodTimeoutMs: 3e4, executeDurability: "sync", executeRetry: { initialIntervalMs: 1e3, backoffCoefficient: 2, maximumIntervalMs: 3e4, maximumAttempts: 5, totalDurationMs: 12e4 } }
87
- };
88
- var ReceiveMessagesMetadata = { kind: "mutation", idempotency: "required", authorization: "required" };
89
- var DeleteMessageBranch = {
90
- Deleted: "deleted",
91
- ReceiptHandleInvalid: "receiptHandleInvalid",
92
- ProviderRejected: "providerRejected",
93
- Defect: "defect"
94
- };
95
- var DeleteMessageBranchDeleted = DeleteMessageBranch.Deleted;
96
- var DeleteMessageBranchReceiptHandleInvalid = DeleteMessageBranch.ReceiptHandleInvalid;
97
- var DeleteMessageBranchProviderRejected = DeleteMessageBranch.ProviderRejected;
98
- var DeleteMessageBranchDefect = DeleteMessageBranch.Defect;
99
- var DeleteMessageDefinition = {
100
- operation: { connectorId: ConnectorID, operationId: "deleteMessage" },
101
- branches: [
102
- { 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." },
103
- { 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 },
104
- { 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 },
105
- { id: "defect", description: "Local input, connection configuration, or connector definition is invalid.", optional: true }
106
- ],
107
- stepDefaults: { executeMethodTimeoutMs: 3e4, executeDurability: "async" }
108
- };
109
- var DeleteMessageMetadata = { kind: "mutation", idempotency: "required", authorization: "required" };
110
- var ChangeMessageVisibilityBranch = {
111
- Changed: "changed",
112
- ReceiptHandleInvalid: "receiptHandleInvalid",
113
- ProviderRejected: "providerRejected",
114
- Defect: "defect"
115
- };
116
- var ChangeMessageVisibilityBranchChanged = ChangeMessageVisibilityBranch.Changed;
117
- var ChangeMessageVisibilityBranchReceiptHandleInvalid = ChangeMessageVisibilityBranch.ReceiptHandleInvalid;
118
- var ChangeMessageVisibilityBranchProviderRejected = ChangeMessageVisibilityBranch.ProviderRejected;
119
- var ChangeMessageVisibilityBranchDefect = ChangeMessageVisibilityBranch.Defect;
120
- var ChangeMessageVisibilityDefinition = {
121
- operation: { connectorId: ConnectorID, operationId: "changeMessageVisibility" },
122
- branches: [
123
- { id: "changed", description: "SQS set the message's visibility timeout." },
124
- { 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 },
125
- { 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 },
126
- { id: "defect", description: "Local input, connection configuration, or connector definition is invalid.", optional: true }
127
- ],
128
- stepDefaults: { executeMethodTimeoutMs: 3e4, executeDurability: "async", executeRetry: { initialIntervalMs: 1e3, backoffCoefficient: 2, maximumIntervalMs: 3e4, maximumAttempts: 5, totalDurationMs: 12e4 } }
129
- };
130
- var ChangeMessageVisibilityMetadata = { kind: "mutation", idempotency: "required", authorization: "required" };
131
-
132
- // src/generated/connection.ts
133
- import { ConnectionRefSchema } from "@superdurable/connectors-sdk";
134
- var Connection = class {
135
- /** Stable provider and connection name. */
136
- reference;
137
- /** Bound provider operations. */
138
- operations;
139
- /** Validate a reference and bind operations. */
140
- constructor(reference, operations) {
141
- this.reference = ConnectionRefSchema.parse(reference);
142
- if (this.reference.provider !== ProviderID) throw new TypeError("connection provider differs from the manifest");
143
- if (!operations) throw new TypeError("connector operations are required");
144
- this.operations = operations;
145
- }
146
- };
147
- function newConnection(client, reference) {
148
- if (!client) throw new TypeError("connector client is required");
149
- return new Connection(reference, client);
150
- }
151
- function newConnectionWithOperations(operations, reference) {
152
- return new Connection(reference, operations);
153
- }
154
-
155
- export {
156
- ConfigSchema,
157
- ReceiveMessagesInputSchema,
158
- MessageAttributeValueSchema,
159
- MessageSchema,
160
- ReceivedMessagesSchema,
161
- DeleteMessageInputSchema,
162
- DeletedMessageSchema,
163
- ChangeMessageVisibilityInputSchema,
164
- ChangedMessageVisibilitySchema,
165
- ConnectorID,
166
- ProviderID,
167
- ReceiveMessagesBranch,
168
- ReceiveMessagesBranchReceived,
169
- ReceiveMessagesBranchEmpty,
170
- ReceiveMessagesBranchProviderRejected,
171
- ReceiveMessagesBranchInvalidResponse,
172
- ReceiveMessagesBranchDefect,
173
- ReceiveMessagesDefinition,
174
- ReceiveMessagesMetadata,
175
- DeleteMessageBranch,
176
- DeleteMessageBranchDeleted,
177
- DeleteMessageBranchReceiptHandleInvalid,
178
- DeleteMessageBranchProviderRejected,
179
- DeleteMessageBranchDefect,
180
- DeleteMessageDefinition,
181
- DeleteMessageMetadata,
182
- ChangeMessageVisibilityBranch,
183
- ChangeMessageVisibilityBranchChanged,
184
- ChangeMessageVisibilityBranchReceiptHandleInvalid,
185
- ChangeMessageVisibilityBranchProviderRejected,
186
- ChangeMessageVisibilityBranchDefect,
187
- ChangeMessageVisibilityDefinition,
188
- ChangeMessageVisibilityMetadata,
189
- Connection,
190
- newConnection,
191
- newConnectionWithOperations
192
- };