@effect-aws/client-sqs 1.7.0 → 1.9.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.
Files changed (68) hide show
  1. package/Errors/package.json +6 -0
  2. package/SQSClientInstance/package.json +6 -0
  3. package/SQSService/package.json +6 -0
  4. package/SQSServiceConfig/package.json +6 -0
  5. package/{lib → dist/cjs}/Errors.d.ts +6 -11
  6. package/dist/cjs/Errors.d.ts.map +1 -0
  7. package/dist/cjs/Errors.js +36 -0
  8. package/dist/cjs/Errors.js.map +1 -0
  9. package/dist/cjs/SQSClientInstance.d.ts +24 -0
  10. package/dist/cjs/SQSClientInstance.d.ts.map +1 -0
  11. package/dist/cjs/SQSClientInstance.js +50 -0
  12. package/dist/cjs/SQSClientInstance.js.map +1 -0
  13. package/{lib → dist/cjs}/SQSService.d.ts +16 -38
  14. package/dist/cjs/SQSService.d.ts.map +1 -0
  15. package/dist/cjs/SQSService.js +79 -0
  16. package/dist/cjs/SQSService.js.map +1 -0
  17. package/dist/cjs/SQSServiceConfig.d.ts +25 -0
  18. package/dist/cjs/SQSServiceConfig.d.ts.map +1 -0
  19. package/dist/cjs/SQSServiceConfig.js +35 -0
  20. package/dist/cjs/SQSServiceConfig.js.map +1 -0
  21. package/dist/cjs/index.d.ts +39 -0
  22. package/dist/cjs/index.d.ts.map +1 -0
  23. package/dist/cjs/index.js +56 -0
  24. package/dist/cjs/index.js.map +1 -0
  25. package/dist/dts/Errors.d.ts +35 -0
  26. package/dist/dts/Errors.d.ts.map +1 -0
  27. package/dist/dts/SQSClientInstance.d.ts +24 -0
  28. package/dist/dts/SQSClientInstance.d.ts.map +1 -0
  29. package/dist/dts/SQSService.d.ts +158 -0
  30. package/dist/dts/SQSService.d.ts.map +1 -0
  31. package/dist/dts/SQSServiceConfig.d.ts +25 -0
  32. package/dist/dts/SQSServiceConfig.d.ts.map +1 -0
  33. package/dist/dts/index.d.ts +39 -0
  34. package/dist/dts/index.d.ts.map +1 -0
  35. package/dist/esm/Errors.js +33 -0
  36. package/dist/esm/Errors.js.map +1 -0
  37. package/dist/esm/SQSClientInstance.js +23 -0
  38. package/dist/esm/SQSClientInstance.js.map +1 -0
  39. package/dist/esm/SQSService.js +52 -0
  40. package/dist/esm/SQSService.js.map +1 -0
  41. package/dist/esm/SQSServiceConfig.js +31 -0
  42. package/dist/esm/SQSServiceConfig.js.map +1 -0
  43. package/dist/esm/index.js +27 -0
  44. package/dist/esm/index.js.map +1 -0
  45. package/dist/esm/package.json +4 -0
  46. package/package.json +60 -43
  47. package/src/Errors.ts +95 -0
  48. package/src/SQSClientInstance.ts +33 -0
  49. package/src/SQSService.ts +603 -0
  50. package/src/SQSServiceConfig.ts +51 -0
  51. package/src/index.ts +44 -0
  52. package/CHANGELOG.md +0 -115
  53. package/docgen.json +0 -8
  54. package/lib/Errors.js +0 -36
  55. package/lib/SQSClientInstance.d.ts +0 -31
  56. package/lib/SQSClientInstance.js +0 -57
  57. package/lib/SQSClientInstanceConfig.d.ts +0 -23
  58. package/lib/SQSClientInstanceConfig.js +0 -44
  59. package/lib/SQSService.js +0 -111
  60. package/lib/esm/Errors.js +0 -33
  61. package/lib/esm/SQSClientInstance.js +0 -30
  62. package/lib/esm/SQSClientInstanceConfig.js +0 -40
  63. package/lib/esm/SQSService.js +0 -107
  64. package/lib/esm/index.js +0 -5
  65. package/lib/index.d.ts +0 -4
  66. package/lib/index.js +0 -21
  67. package/project.json +0 -77
  68. package/vitest.config.ts +0 -3
@@ -0,0 +1,603 @@
1
+ /**
2
+ * @since 1.0.0
3
+ */
4
+ import {
5
+ AddPermissionCommand,
6
+ type AddPermissionCommandInput,
7
+ type AddPermissionCommandOutput,
8
+ CancelMessageMoveTaskCommand,
9
+ type CancelMessageMoveTaskCommandInput,
10
+ type CancelMessageMoveTaskCommandOutput,
11
+ ChangeMessageVisibilityBatchCommand,
12
+ type ChangeMessageVisibilityBatchCommandInput,
13
+ type ChangeMessageVisibilityBatchCommandOutput,
14
+ ChangeMessageVisibilityCommand,
15
+ type ChangeMessageVisibilityCommandInput,
16
+ type ChangeMessageVisibilityCommandOutput,
17
+ CreateQueueCommand,
18
+ type CreateQueueCommandInput,
19
+ type CreateQueueCommandOutput,
20
+ DeleteMessageBatchCommand,
21
+ type DeleteMessageBatchCommandInput,
22
+ type DeleteMessageBatchCommandOutput,
23
+ DeleteMessageCommand,
24
+ type DeleteMessageCommandInput,
25
+ type DeleteMessageCommandOutput,
26
+ DeleteQueueCommand,
27
+ type DeleteQueueCommandInput,
28
+ type DeleteQueueCommandOutput,
29
+ GetQueueAttributesCommand,
30
+ type GetQueueAttributesCommandInput,
31
+ type GetQueueAttributesCommandOutput,
32
+ GetQueueUrlCommand,
33
+ type GetQueueUrlCommandInput,
34
+ type GetQueueUrlCommandOutput,
35
+ ListDeadLetterSourceQueuesCommand,
36
+ type ListDeadLetterSourceQueuesCommandInput,
37
+ type ListDeadLetterSourceQueuesCommandOutput,
38
+ ListMessageMoveTasksCommand,
39
+ type ListMessageMoveTasksCommandInput,
40
+ type ListMessageMoveTasksCommandOutput,
41
+ ListQueuesCommand,
42
+ type ListQueuesCommandInput,
43
+ type ListQueuesCommandOutput,
44
+ ListQueueTagsCommand,
45
+ type ListQueueTagsCommandInput,
46
+ type ListQueueTagsCommandOutput,
47
+ PurgeQueueCommand,
48
+ type PurgeQueueCommandInput,
49
+ type PurgeQueueCommandOutput,
50
+ ReceiveMessageCommand,
51
+ type ReceiveMessageCommandInput,
52
+ type ReceiveMessageCommandOutput,
53
+ RemovePermissionCommand,
54
+ type RemovePermissionCommandInput,
55
+ type RemovePermissionCommandOutput,
56
+ SendMessageBatchCommand,
57
+ type SendMessageBatchCommandInput,
58
+ type SendMessageBatchCommandOutput,
59
+ SendMessageCommand,
60
+ type SendMessageCommandInput,
61
+ type SendMessageCommandOutput,
62
+ SetQueueAttributesCommand,
63
+ type SetQueueAttributesCommandInput,
64
+ type SetQueueAttributesCommandOutput,
65
+ type SQSClient,
66
+ type SQSClientConfig,
67
+ StartMessageMoveTaskCommand,
68
+ type StartMessageMoveTaskCommandInput,
69
+ type StartMessageMoveTaskCommandOutput,
70
+ TagQueueCommand,
71
+ type TagQueueCommandInput,
72
+ type TagQueueCommandOutput,
73
+ UntagQueueCommand,
74
+ type UntagQueueCommandInput,
75
+ type UntagQueueCommandOutput,
76
+ } from "@aws-sdk/client-sqs";
77
+ import type { HttpHandlerOptions, SdkError, ServiceLogger } from "@effect-aws/commons";
78
+ import { Service } from "@effect-aws/commons";
79
+ import { Effect, Layer } from "effect";
80
+ import type {
81
+ BatchEntryIdsNotDistinctError,
82
+ BatchRequestTooLongError,
83
+ EmptyBatchRequestError,
84
+ InvalidAddressError,
85
+ InvalidAttributeNameError,
86
+ InvalidAttributeValueError,
87
+ InvalidBatchEntryIdError,
88
+ InvalidIdFormatError,
89
+ InvalidMessageContentsError,
90
+ InvalidSecurityError,
91
+ KmsAccessDeniedError,
92
+ KmsDisabledError,
93
+ KmsInvalidKeyUsageError,
94
+ KmsInvalidStateError,
95
+ KmsNotFoundError,
96
+ KmsOptInRequiredError,
97
+ KmsThrottledError,
98
+ MessageNotInflightError,
99
+ OverLimitError,
100
+ PurgeQueueInProgressError,
101
+ QueueDeletedRecentlyError,
102
+ QueueDoesNotExistError,
103
+ QueueNameExistsError,
104
+ ReceiptHandleIsInvalidError,
105
+ RequestThrottledError,
106
+ ResourceNotFoundError,
107
+ TooManyEntriesInBatchRequestError,
108
+ UnsupportedOperationError,
109
+ } from "./Errors.js";
110
+ import { AllServiceErrors } from "./Errors.js";
111
+ import * as Instance from "./SQSClientInstance.js";
112
+ import * as SQSServiceConfig from "./SQSServiceConfig.js";
113
+
114
+ const commands = {
115
+ AddPermissionCommand,
116
+ CancelMessageMoveTaskCommand,
117
+ ChangeMessageVisibilityCommand,
118
+ ChangeMessageVisibilityBatchCommand,
119
+ CreateQueueCommand,
120
+ DeleteMessageCommand,
121
+ DeleteMessageBatchCommand,
122
+ DeleteQueueCommand,
123
+ GetQueueAttributesCommand,
124
+ GetQueueUrlCommand,
125
+ ListDeadLetterSourceQueuesCommand,
126
+ ListMessageMoveTasksCommand,
127
+ ListQueueTagsCommand,
128
+ ListQueuesCommand,
129
+ PurgeQueueCommand,
130
+ ReceiveMessageCommand,
131
+ RemovePermissionCommand,
132
+ SendMessageCommand,
133
+ SendMessageBatchCommand,
134
+ SetQueueAttributesCommand,
135
+ StartMessageMoveTaskCommand,
136
+ TagQueueCommand,
137
+ UntagQueueCommand,
138
+ };
139
+
140
+ interface SQSService$ {
141
+ readonly _: unique symbol;
142
+
143
+ /**
144
+ * @see {@link AddPermissionCommand}
145
+ */
146
+ addPermission(
147
+ args: AddPermissionCommandInput,
148
+ options?: HttpHandlerOptions,
149
+ ): Effect.Effect<
150
+ AddPermissionCommandOutput,
151
+ | SdkError
152
+ | InvalidAddressError
153
+ | InvalidSecurityError
154
+ | OverLimitError
155
+ | QueueDoesNotExistError
156
+ | RequestThrottledError
157
+ | UnsupportedOperationError
158
+ >;
159
+
160
+ /**
161
+ * @see {@link CancelMessageMoveTaskCommand}
162
+ */
163
+ cancelMessageMoveTask(
164
+ args: CancelMessageMoveTaskCommandInput,
165
+ options?: HttpHandlerOptions,
166
+ ): Effect.Effect<
167
+ CancelMessageMoveTaskCommandOutput,
168
+ | SdkError
169
+ | InvalidAddressError
170
+ | InvalidSecurityError
171
+ | RequestThrottledError
172
+ | ResourceNotFoundError
173
+ | UnsupportedOperationError
174
+ >;
175
+
176
+ /**
177
+ * @see {@link ChangeMessageVisibilityCommand}
178
+ */
179
+ changeMessageVisibility(
180
+ args: ChangeMessageVisibilityCommandInput,
181
+ options?: HttpHandlerOptions,
182
+ ): Effect.Effect<
183
+ ChangeMessageVisibilityCommandOutput,
184
+ | SdkError
185
+ | InvalidAddressError
186
+ | InvalidSecurityError
187
+ | MessageNotInflightError
188
+ | QueueDoesNotExistError
189
+ | ReceiptHandleIsInvalidError
190
+ | RequestThrottledError
191
+ | UnsupportedOperationError
192
+ >;
193
+
194
+ /**
195
+ * @see {@link ChangeMessageVisibilityBatchCommand}
196
+ */
197
+ changeMessageVisibilityBatch(
198
+ args: ChangeMessageVisibilityBatchCommandInput,
199
+ options?: HttpHandlerOptions,
200
+ ): Effect.Effect<
201
+ ChangeMessageVisibilityBatchCommandOutput,
202
+ | SdkError
203
+ | BatchEntryIdsNotDistinctError
204
+ | EmptyBatchRequestError
205
+ | InvalidAddressError
206
+ | InvalidBatchEntryIdError
207
+ | InvalidSecurityError
208
+ | QueueDoesNotExistError
209
+ | RequestThrottledError
210
+ | TooManyEntriesInBatchRequestError
211
+ | UnsupportedOperationError
212
+ >;
213
+
214
+ /**
215
+ * @see {@link CreateQueueCommand}
216
+ */
217
+ createQueue(
218
+ args: CreateQueueCommandInput,
219
+ options?: HttpHandlerOptions,
220
+ ): Effect.Effect<
221
+ CreateQueueCommandOutput,
222
+ | SdkError
223
+ | InvalidAddressError
224
+ | InvalidAttributeNameError
225
+ | InvalidAttributeValueError
226
+ | InvalidSecurityError
227
+ | QueueDeletedRecentlyError
228
+ | QueueNameExistsError
229
+ | RequestThrottledError
230
+ | UnsupportedOperationError
231
+ >;
232
+
233
+ /**
234
+ * @see {@link DeleteMessageCommand}
235
+ */
236
+ deleteMessage(
237
+ args: DeleteMessageCommandInput,
238
+ options?: HttpHandlerOptions,
239
+ ): Effect.Effect<
240
+ DeleteMessageCommandOutput,
241
+ | SdkError
242
+ | InvalidAddressError
243
+ | InvalidIdFormatError
244
+ | InvalidSecurityError
245
+ | QueueDoesNotExistError
246
+ | ReceiptHandleIsInvalidError
247
+ | RequestThrottledError
248
+ | UnsupportedOperationError
249
+ >;
250
+
251
+ /**
252
+ * @see {@link DeleteMessageBatchCommand}
253
+ */
254
+ deleteMessageBatch(
255
+ args: DeleteMessageBatchCommandInput,
256
+ options?: HttpHandlerOptions,
257
+ ): Effect.Effect<
258
+ DeleteMessageBatchCommandOutput,
259
+ | SdkError
260
+ | BatchEntryIdsNotDistinctError
261
+ | EmptyBatchRequestError
262
+ | InvalidAddressError
263
+ | InvalidBatchEntryIdError
264
+ | InvalidSecurityError
265
+ | QueueDoesNotExistError
266
+ | RequestThrottledError
267
+ | TooManyEntriesInBatchRequestError
268
+ | UnsupportedOperationError
269
+ >;
270
+
271
+ /**
272
+ * @see {@link DeleteQueueCommand}
273
+ */
274
+ deleteQueue(
275
+ args: DeleteQueueCommandInput,
276
+ options?: HttpHandlerOptions,
277
+ ): Effect.Effect<
278
+ DeleteQueueCommandOutput,
279
+ | SdkError
280
+ | InvalidAddressError
281
+ | InvalidSecurityError
282
+ | QueueDoesNotExistError
283
+ | RequestThrottledError
284
+ | UnsupportedOperationError
285
+ >;
286
+
287
+ /**
288
+ * @see {@link GetQueueAttributesCommand}
289
+ */
290
+ getQueueAttributes(
291
+ args: GetQueueAttributesCommandInput,
292
+ options?: HttpHandlerOptions,
293
+ ): Effect.Effect<
294
+ GetQueueAttributesCommandOutput,
295
+ | SdkError
296
+ | InvalidAddressError
297
+ | InvalidAttributeNameError
298
+ | InvalidSecurityError
299
+ | QueueDoesNotExistError
300
+ | RequestThrottledError
301
+ | UnsupportedOperationError
302
+ >;
303
+
304
+ /**
305
+ * @see {@link GetQueueUrlCommand}
306
+ */
307
+ getQueueUrl(
308
+ args: GetQueueUrlCommandInput,
309
+ options?: HttpHandlerOptions,
310
+ ): Effect.Effect<
311
+ GetQueueUrlCommandOutput,
312
+ | SdkError
313
+ | InvalidAddressError
314
+ | InvalidSecurityError
315
+ | QueueDoesNotExistError
316
+ | RequestThrottledError
317
+ | UnsupportedOperationError
318
+ >;
319
+
320
+ /**
321
+ * @see {@link ListDeadLetterSourceQueuesCommand}
322
+ */
323
+ listDeadLetterSourceQueues(
324
+ args: ListDeadLetterSourceQueuesCommandInput,
325
+ options?: HttpHandlerOptions,
326
+ ): Effect.Effect<
327
+ ListDeadLetterSourceQueuesCommandOutput,
328
+ | SdkError
329
+ | InvalidAddressError
330
+ | InvalidSecurityError
331
+ | QueueDoesNotExistError
332
+ | RequestThrottledError
333
+ | UnsupportedOperationError
334
+ >;
335
+
336
+ /**
337
+ * @see {@link ListMessageMoveTasksCommand}
338
+ */
339
+ listMessageMoveTasks(
340
+ args: ListMessageMoveTasksCommandInput,
341
+ options?: HttpHandlerOptions,
342
+ ): Effect.Effect<
343
+ ListMessageMoveTasksCommandOutput,
344
+ | SdkError
345
+ | InvalidAddressError
346
+ | InvalidSecurityError
347
+ | RequestThrottledError
348
+ | ResourceNotFoundError
349
+ | UnsupportedOperationError
350
+ >;
351
+
352
+ /**
353
+ * @see {@link ListQueueTagsCommand}
354
+ */
355
+ listQueueTags(
356
+ args: ListQueueTagsCommandInput,
357
+ options?: HttpHandlerOptions,
358
+ ): Effect.Effect<
359
+ ListQueueTagsCommandOutput,
360
+ | SdkError
361
+ | InvalidAddressError
362
+ | InvalidSecurityError
363
+ | QueueDoesNotExistError
364
+ | RequestThrottledError
365
+ | UnsupportedOperationError
366
+ >;
367
+
368
+ /**
369
+ * @see {@link ListQueuesCommand}
370
+ */
371
+ listQueues(
372
+ args: ListQueuesCommandInput,
373
+ options?: HttpHandlerOptions,
374
+ ): Effect.Effect<
375
+ ListQueuesCommandOutput,
376
+ SdkError | InvalidAddressError | InvalidSecurityError | RequestThrottledError | UnsupportedOperationError
377
+ >;
378
+
379
+ /**
380
+ * @see {@link PurgeQueueCommand}
381
+ */
382
+ purgeQueue(
383
+ args: PurgeQueueCommandInput,
384
+ options?: HttpHandlerOptions,
385
+ ): Effect.Effect<
386
+ PurgeQueueCommandOutput,
387
+ | SdkError
388
+ | InvalidAddressError
389
+ | InvalidSecurityError
390
+ | PurgeQueueInProgressError
391
+ | QueueDoesNotExistError
392
+ | RequestThrottledError
393
+ | UnsupportedOperationError
394
+ >;
395
+
396
+ /**
397
+ * @see {@link ReceiveMessageCommand}
398
+ */
399
+ receiveMessage(
400
+ args: ReceiveMessageCommandInput,
401
+ options?: HttpHandlerOptions,
402
+ ): Effect.Effect<
403
+ ReceiveMessageCommandOutput,
404
+ | SdkError
405
+ | InvalidAddressError
406
+ | InvalidSecurityError
407
+ | KmsAccessDeniedError
408
+ | KmsDisabledError
409
+ | KmsInvalidKeyUsageError
410
+ | KmsInvalidStateError
411
+ | KmsNotFoundError
412
+ | KmsOptInRequiredError
413
+ | KmsThrottledError
414
+ | OverLimitError
415
+ | QueueDoesNotExistError
416
+ | RequestThrottledError
417
+ | UnsupportedOperationError
418
+ >;
419
+
420
+ /**
421
+ * @see {@link RemovePermissionCommand}
422
+ */
423
+ removePermission(
424
+ args: RemovePermissionCommandInput,
425
+ options?: HttpHandlerOptions,
426
+ ): Effect.Effect<
427
+ RemovePermissionCommandOutput,
428
+ | SdkError
429
+ | InvalidAddressError
430
+ | InvalidSecurityError
431
+ | QueueDoesNotExistError
432
+ | RequestThrottledError
433
+ | UnsupportedOperationError
434
+ >;
435
+
436
+ /**
437
+ * @see {@link SendMessageCommand}
438
+ */
439
+ sendMessage(
440
+ args: SendMessageCommandInput,
441
+ options?: HttpHandlerOptions,
442
+ ): Effect.Effect<
443
+ SendMessageCommandOutput,
444
+ | SdkError
445
+ | InvalidAddressError
446
+ | InvalidMessageContentsError
447
+ | InvalidSecurityError
448
+ | KmsAccessDeniedError
449
+ | KmsDisabledError
450
+ | KmsInvalidKeyUsageError
451
+ | KmsInvalidStateError
452
+ | KmsNotFoundError
453
+ | KmsOptInRequiredError
454
+ | KmsThrottledError
455
+ | QueueDoesNotExistError
456
+ | RequestThrottledError
457
+ | UnsupportedOperationError
458
+ >;
459
+
460
+ /**
461
+ * @see {@link SendMessageBatchCommand}
462
+ */
463
+ sendMessageBatch(
464
+ args: SendMessageBatchCommandInput,
465
+ options?: HttpHandlerOptions,
466
+ ): Effect.Effect<
467
+ SendMessageBatchCommandOutput,
468
+ | SdkError
469
+ | BatchEntryIdsNotDistinctError
470
+ | BatchRequestTooLongError
471
+ | EmptyBatchRequestError
472
+ | InvalidAddressError
473
+ | InvalidBatchEntryIdError
474
+ | InvalidSecurityError
475
+ | KmsAccessDeniedError
476
+ | KmsDisabledError
477
+ | KmsInvalidKeyUsageError
478
+ | KmsInvalidStateError
479
+ | KmsNotFoundError
480
+ | KmsOptInRequiredError
481
+ | KmsThrottledError
482
+ | QueueDoesNotExistError
483
+ | RequestThrottledError
484
+ | TooManyEntriesInBatchRequestError
485
+ | UnsupportedOperationError
486
+ >;
487
+
488
+ /**
489
+ * @see {@link SetQueueAttributesCommand}
490
+ */
491
+ setQueueAttributes(
492
+ args: SetQueueAttributesCommandInput,
493
+ options?: HttpHandlerOptions,
494
+ ): Effect.Effect<
495
+ SetQueueAttributesCommandOutput,
496
+ | SdkError
497
+ | InvalidAddressError
498
+ | InvalidAttributeNameError
499
+ | InvalidAttributeValueError
500
+ | InvalidSecurityError
501
+ | OverLimitError
502
+ | QueueDoesNotExistError
503
+ | RequestThrottledError
504
+ | UnsupportedOperationError
505
+ >;
506
+
507
+ /**
508
+ * @see {@link StartMessageMoveTaskCommand}
509
+ */
510
+ startMessageMoveTask(
511
+ args: StartMessageMoveTaskCommandInput,
512
+ options?: HttpHandlerOptions,
513
+ ): Effect.Effect<
514
+ StartMessageMoveTaskCommandOutput,
515
+ | SdkError
516
+ | InvalidAddressError
517
+ | InvalidSecurityError
518
+ | RequestThrottledError
519
+ | ResourceNotFoundError
520
+ | UnsupportedOperationError
521
+ >;
522
+
523
+ /**
524
+ * @see {@link TagQueueCommand}
525
+ */
526
+ tagQueue(
527
+ args: TagQueueCommandInput,
528
+ options?: HttpHandlerOptions,
529
+ ): Effect.Effect<
530
+ TagQueueCommandOutput,
531
+ | SdkError
532
+ | InvalidAddressError
533
+ | InvalidSecurityError
534
+ | QueueDoesNotExistError
535
+ | RequestThrottledError
536
+ | UnsupportedOperationError
537
+ >;
538
+
539
+ /**
540
+ * @see {@link UntagQueueCommand}
541
+ */
542
+ untagQueue(
543
+ args: UntagQueueCommandInput,
544
+ options?: HttpHandlerOptions,
545
+ ): Effect.Effect<
546
+ UntagQueueCommandOutput,
547
+ | SdkError
548
+ | InvalidAddressError
549
+ | InvalidSecurityError
550
+ | QueueDoesNotExistError
551
+ | RequestThrottledError
552
+ | UnsupportedOperationError
553
+ >;
554
+ }
555
+
556
+ /**
557
+ * @since 1.0.0
558
+ * @category constructors
559
+ */
560
+ export const makeSQSService = Effect.gen(function*() {
561
+ const client = yield* Instance.SQSClientInstance;
562
+
563
+ return Service.fromClientAndCommands<SQSService$>(client, commands, AllServiceErrors);
564
+ });
565
+
566
+ /**
567
+ * @since 1.0.0
568
+ * @category models
569
+ */
570
+ export class SQSService extends Effect.Tag("@effect-aws/client-sqs/SQSService")<
571
+ SQSService,
572
+ SQSService$
573
+ >() {
574
+ static readonly defaultLayer = Layer.effect(this, makeSQSService).pipe(Layer.provide(Instance.layer));
575
+ static readonly layer = (config: SQSService.Config) =>
576
+ Layer.effect(this, makeSQSService).pipe(
577
+ Layer.provide(Instance.layer),
578
+ Layer.provide(SQSServiceConfig.setSQSServiceConfig(config)),
579
+ );
580
+ static readonly baseLayer = (
581
+ evaluate: (defaultConfig: SQSClientConfig) => SQSClient,
582
+ ) =>
583
+ Layer.effect(this, makeSQSService).pipe(
584
+ Layer.provide(
585
+ Layer.effect(
586
+ Instance.SQSClientInstance,
587
+ Effect.map(SQSServiceConfig.toSQSClientConfig, evaluate),
588
+ ),
589
+ ),
590
+ );
591
+ }
592
+
593
+ /**
594
+ * @since 1.0.0
595
+ */
596
+ export declare namespace SQSService {
597
+ /**
598
+ * @since 1.0.0
599
+ */
600
+ export interface Config extends Omit<SQSClientConfig, "logger"> {
601
+ readonly logger?: ServiceLogger.ServiceLoggerConstructorProps | true;
602
+ }
603
+ }
@@ -0,0 +1,51 @@
1
+ /**
2
+ * @since 1.0.0
3
+ */
4
+ import type { SQSClientConfig } from "@aws-sdk/client-sqs";
5
+ import { ServiceLogger } from "@effect-aws/commons";
6
+ import { Effect, FiberRef, Layer } from "effect";
7
+ import { dual } from "effect/Function";
8
+ import { globalValue } from "effect/GlobalValue";
9
+ import type { SQSService } from "./SQSService.js";
10
+
11
+ /**
12
+ * @since 1.0.0
13
+ * @category sqs service config
14
+ */
15
+ const currentSQSServiceConfig = globalValue(
16
+ "@effect-aws/client-sqs/currentSQSServiceConfig",
17
+ () => FiberRef.unsafeMake<SQSService.Config>({}),
18
+ );
19
+
20
+ /**
21
+ * @since 1.0.0
22
+ * @category sqs service config
23
+ */
24
+ export const withSQSServiceConfig: {
25
+ (config: SQSService.Config): <A, E, R>(effect: Effect.Effect<A, E, R>) => Effect.Effect<A, E, R>;
26
+ <A, E, R>(effect: Effect.Effect<A, E, R>, config: SQSService.Config): Effect.Effect<A, E, R>;
27
+ } = dual(
28
+ 2,
29
+ <A, E, R>(effect: Effect.Effect<A, E, R>, config: SQSService.Config): Effect.Effect<A, E, R> =>
30
+ Effect.locally(effect, currentSQSServiceConfig, config),
31
+ );
32
+
33
+ /**
34
+ * @since 1.0.0
35
+ * @category sqs service config
36
+ */
37
+ export const setSQSServiceConfig = (config: SQSService.Config) => Layer.locallyScoped(currentSQSServiceConfig, config);
38
+
39
+ /**
40
+ * @since 1.0.0
41
+ * @category adapters
42
+ */
43
+ export const toSQSClientConfig: Effect.Effect<SQSClientConfig> = Effect.gen(function*() {
44
+ const { logger: serviceLogger, ...config } = yield* FiberRef.get(currentSQSServiceConfig);
45
+
46
+ const logger = serviceLogger === true
47
+ ? yield* ServiceLogger.toClientLogger(ServiceLogger.defaultServiceLogger)
48
+ : (serviceLogger ? yield* ServiceLogger.toClientLogger(ServiceLogger.make(serviceLogger)) : undefined);
49
+
50
+ return { logger, ...config };
51
+ });
package/src/index.ts ADDED
@@ -0,0 +1,44 @@
1
+ /**
2
+ * @since 1.0.0
3
+ */
4
+ import { SQSService } from "./SQSService.js";
5
+
6
+ /**
7
+ * @since 1.0.0
8
+ */
9
+ export * from "./Errors.js";
10
+
11
+ /**
12
+ * @since 1.0.0
13
+ */
14
+ export * as SQSClientInstance from "./SQSClientInstance.js";
15
+
16
+ /**
17
+ * @since 1.0.0
18
+ */
19
+ export * as SQSServiceConfig from "./SQSServiceConfig.js";
20
+
21
+ /**
22
+ * @since 1.0.0
23
+ */
24
+ export * from "./SQSService.js";
25
+
26
+ /**
27
+ * @since 1.0.0
28
+ * @category exports
29
+ * @alias SQSService
30
+ */
31
+ export declare namespace SQS {
32
+ /**
33
+ * @since 1.0.0
34
+ * @alias SQSService.Config
35
+ */
36
+ export type Config = SQSService.Config;
37
+ }
38
+
39
+ /**
40
+ * @since 1.0.0
41
+ * @category exports
42
+ * @alias SQSService
43
+ */
44
+ export const SQS = SQSService;