@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,4 +1,4 @@
1
- import { SecretString, CredentialProvider, Mutation, ConnectionRef } from '@superdurable/connectors-sdk';
1
+ import { SecretString, CredentialProvider, Mutation, Query, ConnectionRef } from '@superdurable/connectors-sdk';
2
2
  import { z } from 'zod';
3
3
 
4
4
  /** Connector configuration; omitted fields use manifest defaults. */
@@ -34,8 +34,34 @@ interface Credentials {
34
34
  /** 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 IAM user keys use. */
35
35
  sessionToken?: SecretString;
36
36
  }
37
+ /** Stored credential material that fails the connector credential checks, so no retry can succeed. */
38
+ declare class CredentialMaterialError extends TypeError {
39
+ constructor(message: string);
40
+ }
41
+ /** Report malformed stored credential material, also behind the SDK provider's decoding TypeError. */
42
+ declare function isCredentialMaterialError(error: unknown): boolean;
43
+ /** Decode private credential fields for the connector. */
44
+ declare function decodeCredentials(value: unknown): Credentials;
37
45
  /** Host-owned source of private connector credentials. */
38
46
  type CredentialSource = CredentialProvider<Credentials>;
47
+ /** SendMessageInput sends one UTF-8 message to a standard or FIFO queue. */
48
+ interface SendMessageInput {
49
+ /** QueueURL is the full URL from SQS Console > Queues > selected queue; blank uses defaultQueueUrl. */
50
+ "queueUrl"?: string | undefined;
51
+ /** Body is nonempty UTF-8 text, at most 256 KiB for the default SQS queue size limit. */
52
+ "body": string;
53
+ /** MessageGroupID is required for FIFO queues and optional for standard fair queues. */
54
+ "messageGroupId"?: string | undefined;
55
+ }
56
+ /** SentMessage identifies the message SQS accepted; delivery to a consumer is asynchronous. */
57
+ interface SentMessage {
58
+ /** QueueURL is the destination queue. */
59
+ "queueUrl": string;
60
+ /** MessageID is the SQS-assigned message identity. */
61
+ "messageId": string;
62
+ /** MD5OfBody is the SQS checksum of the sent body. */
63
+ "md5OfBody": string;
64
+ }
39
65
  /** ReceiveMessagesInput selects one queue and how long and how many messages to wait for. */
40
66
  interface ReceiveMessagesInput {
41
67
  /** QueueURL is the queue URL, such as https://sqs.eu-west-1.amazonaws.com/123456789012/orders; blank uses
@@ -137,6 +163,76 @@ interface ChangedMessageVisibility {
137
163
  /** VisibleAfter is when the message becomes visible again, measured from the Worker clock when SQS answered. */
138
164
  "visibleAfter": string;
139
165
  }
166
+ /** ListQueuesInput selects a bounded page of queue URLs in the connection Region. */
167
+ interface ListQueuesInput {
168
+ /** QueueNamePrefix optionally filters names by their first characters. */
169
+ "queueNamePrefix"?: string | undefined;
170
+ /** MaxResults is 1–1000; zero uses 100. */
171
+ "maxResults"?: number | undefined;
172
+ /** NextToken selects the next page; blank starts at the beginning. */
173
+ "nextToken"?: string | undefined;
174
+ }
175
+ /** QueuePage contains one page of queue URLs. */
176
+ interface QueuePage {
177
+ /** QueueURLs are full URLs for queues in the connection Region. */
178
+ "queueUrls": Array<string> | null;
179
+ /** NextToken is blank after the final page. */
180
+ "nextToken"?: string | undefined;
181
+ }
182
+ /** CreateQueueInput defines a queue by name and bounded creation attributes. */
183
+ interface CreateQueueInput {
184
+ /** QueueName is unique within the account and Region. */
185
+ "queueName": string;
186
+ /** Attributes contains FifoQueue, VisibilityTimeout, ReceiveMessageWaitTimeSeconds, DelaySeconds, or MaximumMessageSize. */
187
+ "attributes"?: {
188
+ [key: string]: string;
189
+ } | undefined;
190
+ }
191
+ /** QueueIdentity is the complete queue URL returned by SQS or used for a queue mutation. */
192
+ interface QueueIdentity {
193
+ /** QueueURL is the complete SQS queue URL. */
194
+ "queueUrl": string;
195
+ }
196
+ /** QueueNameInput identifies one queue by name. */
197
+ interface QueueNameInput {
198
+ /** QueueName is a standard name or a name ending in .fifo. */
199
+ "queueName": string;
200
+ }
201
+ /** QueueURLInput identifies an existing queue; blank uses the connection defaultQueueUrl. */
202
+ interface QueueURLInput {
203
+ /** QueueURL is the complete SQS queue URL. */
204
+ "queueUrl"?: string | undefined;
205
+ }
206
+ /** QueueAttributes contains all settings returned for a queue. */
207
+ interface QueueAttributes {
208
+ /** QueueURL is the requested queue. */
209
+ "queueUrl": string;
210
+ /** Attributes are provider named settings and approximate queue counts. */
211
+ "attributes": {
212
+ [key: string]: string;
213
+ } | null;
214
+ }
215
+ /** SetQueueAttributeInput replaces one bounded queue setting. */
216
+ interface SetQueueAttributeInput {
217
+ /** QueueURL is the target queue; blank uses defaultQueueUrl. */
218
+ "queueUrl"?: string | undefined;
219
+ /** AttributeName is VisibilityTimeout, ReceiveMessageWaitTimeSeconds, DelaySeconds, or MaximumMessageSize. */
220
+ "attributeName": string;
221
+ /** AttributeValue is an integer as decimal text, in seconds or bytes according to AttributeName. */
222
+ "attributeValue": string;
223
+ }
224
+ /** Runtime validator for SendMessageInput. */
225
+ declare const SendMessageInputSchema: z.ZodObject<{
226
+ queueUrl: z.ZodOptional<z.ZodString>;
227
+ body: z.ZodString;
228
+ messageGroupId: z.ZodOptional<z.ZodString>;
229
+ }, z.core.$strict>;
230
+ /** Runtime validator for SentMessage. */
231
+ declare const SentMessageSchema: z.ZodObject<{
232
+ queueUrl: z.ZodString;
233
+ messageId: z.ZodString;
234
+ md5OfBody: z.ZodString;
235
+ }, z.core.$strict>;
140
236
  /** Runtime validator for ReceiveMessagesInput. */
141
237
  declare const ReceiveMessagesInputSchema: z.ZodObject<{
142
238
  queueUrl: z.ZodOptional<z.ZodString>;
@@ -156,8 +252,8 @@ declare const MessageSchema: z.ZodObject<{
156
252
  receiptHandle: z.ZodString;
157
253
  body: z.ZodString;
158
254
  md5OfBody: z.ZodString;
159
- sentAt: z.ZodOptional<z.ZodISODateTime>;
160
- firstReceivedAt: z.ZodOptional<z.ZodISODateTime>;
255
+ sentAt: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
256
+ firstReceivedAt: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
161
257
  receiveCount: z.ZodNumber;
162
258
  messageGroupId: z.ZodOptional<z.ZodString>;
163
259
  messageDeduplicationId: z.ZodOptional<z.ZodString>;
@@ -177,8 +273,8 @@ declare const ReceivedMessagesSchema: z.ZodObject<{
177
273
  receiptHandle: z.ZodString;
178
274
  body: z.ZodString;
179
275
  md5OfBody: z.ZodString;
180
- sentAt: z.ZodOptional<z.ZodISODateTime>;
181
- firstReceivedAt: z.ZodOptional<z.ZodISODateTime>;
276
+ sentAt: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
277
+ firstReceivedAt: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
182
278
  receiveCount: z.ZodNumber;
183
279
  messageGroupId: z.ZodOptional<z.ZodString>;
184
280
  messageDeduplicationId: z.ZodOptional<z.ZodString>;
@@ -213,17 +309,70 @@ declare const ChangedMessageVisibilitySchema: z.ZodObject<{
213
309
  queueUrl: z.ZodString;
214
310
  messageId: z.ZodOptional<z.ZodString>;
215
311
  visibilityTimeoutSeconds: z.ZodNumber;
216
- visibleAfter: z.ZodISODateTime;
312
+ visibleAfter: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
313
+ }, z.core.$strict>;
314
+ /** Runtime validator for ListQueuesInput. */
315
+ declare const ListQueuesInputSchema: z.ZodObject<{
316
+ queueNamePrefix: z.ZodOptional<z.ZodString>;
317
+ maxResults: z.ZodOptional<z.ZodNumber>;
318
+ nextToken: z.ZodOptional<z.ZodString>;
319
+ }, z.core.$strict>;
320
+ /** Runtime validator for QueuePage. */
321
+ declare const QueuePageSchema: z.ZodObject<{
322
+ queueUrls: z.ZodNullable<z.ZodArray<z.ZodString>>;
323
+ nextToken: z.ZodOptional<z.ZodString>;
324
+ }, z.core.$strict>;
325
+ /** Runtime validator for CreateQueueInput. */
326
+ declare const CreateQueueInputSchema: z.ZodObject<{
327
+ queueName: z.ZodString;
328
+ attributes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
329
+ }, z.core.$strict>;
330
+ /** Runtime validator for QueueIdentity. */
331
+ declare const QueueIdentitySchema: z.ZodObject<{
332
+ queueUrl: z.ZodString;
333
+ }, z.core.$strict>;
334
+ /** Runtime validator for QueueNameInput. */
335
+ declare const QueueNameInputSchema: z.ZodObject<{
336
+ queueName: z.ZodString;
337
+ }, z.core.$strict>;
338
+ /** Runtime validator for QueueURLInput. */
339
+ declare const QueueURLInputSchema: z.ZodObject<{
340
+ queueUrl: z.ZodOptional<z.ZodString>;
341
+ }, z.core.$strict>;
342
+ /** Runtime validator for QueueAttributes. */
343
+ declare const QueueAttributesSchema: z.ZodObject<{
344
+ queueUrl: z.ZodString;
345
+ attributes: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodString>>;
346
+ }, z.core.$strict>;
347
+ /** Runtime validator for SetQueueAttributeInput. */
348
+ declare const SetQueueAttributeInputSchema: z.ZodObject<{
349
+ queueUrl: z.ZodOptional<z.ZodString>;
350
+ attributeName: z.ZodString;
351
+ attributeValue: z.ZodString;
217
352
  }, z.core.$strict>;
218
353
 
219
354
  /** Typed operations supplied by a client or mock. */
220
355
  interface Operations {
356
+ /** Invoke sendMessage through this connection. */
357
+ sendMessage(): Mutation<SendMessageInput, SentMessage>;
221
358
  /** Invoke receiveMessages through this connection. */
222
359
  receiveMessages(): Mutation<ReceiveMessagesInput, ReceivedMessages>;
223
360
  /** Invoke deleteMessage through this connection. */
224
361
  deleteMessage(): Mutation<DeleteMessageInput, DeletedMessage>;
225
362
  /** Invoke changeMessageVisibility through this connection. */
226
363
  changeMessageVisibility(): Mutation<ChangeMessageVisibilityInput, ChangedMessageVisibility>;
364
+ /** Invoke listQueues through this connection. */
365
+ listQueues(): Query<ListQueuesInput, QueuePage>;
366
+ /** Invoke createQueue through this connection. */
367
+ createQueue(): Mutation<CreateQueueInput, QueueIdentity>;
368
+ /** Invoke getQueueURL through this connection. */
369
+ getQueueURL(): Query<QueueNameInput, QueueIdentity>;
370
+ /** Invoke getQueueAttributes through this connection. */
371
+ getQueueAttributes(): Query<QueueURLInput, QueueAttributes>;
372
+ /** Invoke setQueueAttribute through this connection. */
373
+ setQueueAttribute(): Mutation<SetQueueAttributeInput, QueueIdentity>;
374
+ /** Invoke deleteQueue through this connection. */
375
+ deleteQueue(): Mutation<QueueURLInput, QueueIdentity>;
227
376
  }
228
377
  /** Named connector connection kept outside Flow state. */
229
378
  declare class Connection<BoundOperations = Operations> {
@@ -239,4 +388,4 @@ declare function newConnection(client: Operations, reference: ConnectionRef): Co
239
388
  /** Bind scripted operations to a named connection. */
240
389
  declare function newConnectionWithOperations(operations: Operations, reference: ConnectionRef): Connection;
241
390
 
242
- export { type ChangeMessageVisibilityInput as C, type DeleteMessageInput as D, type Message as M, type Operations as O, type ReceiveMessagesInput as R, type ChangedMessageVisibility as a, Connection as b, type DeletedMessage as c, type ReceivedMessages as d, type Config as e, type Credentials as f, ChangeMessageVisibilityInputSchema as g, ChangedMessageVisibilitySchema as h, ConfigSchema as i, type CredentialSource as j, DeleteMessageInputSchema as k, DeletedMessageSchema as l, type MessageAttributeValue as m, MessageAttributeValueSchema as n, MessageSchema as o, ReceiveMessagesInputSchema as p, ReceivedMessagesSchema as q, newConnection as r, newConnectionWithOperations as s };
391
+ export { QueueIdentitySchema as A, QueueNameInputSchema as B, type ChangeMessageVisibilityInput as C, type DeleteMessageInput as D, QueuePageSchema as E, QueueURLInputSchema as F, ReceiveMessagesInputSchema as G, ReceivedMessagesSchema as H, SendMessageInputSchema as I, SentMessageSchema as J, SetQueueAttributeInputSchema as K, type ListQueuesInput as L, type Message as M, decodeCredentials as N, type Operations as O, isCredentialMaterialError as P, type QueueIdentity as Q, type ReceiveMessagesInput as R, type SendMessageInput as S, newConnection as T, newConnectionWithOperations as U, type ChangedMessageVisibility as a, Connection as b, type CreateQueueInput as c, type DeletedMessage as d, type QueueURLInput as e, type QueueAttributes as f, type QueueNameInput as g, type QueuePage as h, type ReceivedMessages as i, type SentMessage as j, type SetQueueAttributeInput as k, type Config as l, type Credentials as m, ChangeMessageVisibilityInputSchema as n, ChangedMessageVisibilitySchema as o, ConfigSchema as p, CreateQueueInputSchema as q, CredentialMaterialError as r, type CredentialSource as s, DeleteMessageInputSchema as t, DeletedMessageSchema as u, ListQueuesInputSchema as v, type MessageAttributeValue as w, MessageAttributeValueSchema as x, MessageSchema as y, QueueAttributesSchema as z };