@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
package/src/Errors.ts ADDED
@@ -0,0 +1,95 @@
1
+ import type {
2
+ BatchEntryIdsNotDistinct,
3
+ BatchRequestTooLong,
4
+ EmptyBatchRequest,
5
+ InvalidAddress,
6
+ InvalidAttributeName,
7
+ InvalidAttributeValue,
8
+ InvalidBatchEntryId,
9
+ InvalidIdFormat,
10
+ InvalidMessageContents,
11
+ InvalidSecurity,
12
+ KmsAccessDenied,
13
+ KmsDisabled,
14
+ KmsInvalidKeyUsage,
15
+ KmsInvalidState,
16
+ KmsNotFound,
17
+ KmsOptInRequired,
18
+ KmsThrottled,
19
+ MessageNotInflight,
20
+ OverLimit,
21
+ PurgeQueueInProgress,
22
+ QueueDeletedRecently,
23
+ QueueDoesNotExist,
24
+ QueueNameExists,
25
+ ReceiptHandleIsInvalid,
26
+ RequestThrottled,
27
+ ResourceNotFoundException,
28
+ TooManyEntriesInBatchRequest,
29
+ UnsupportedOperation,
30
+ } from "@aws-sdk/client-sqs";
31
+ import type { TaggedException } from "@effect-aws/commons";
32
+ import { SdkError as CommonSdkError } from "@effect-aws/commons";
33
+
34
+ export const AllServiceErrors = [
35
+ "BatchEntryIdsNotDistinct",
36
+ "BatchRequestTooLong",
37
+ "EmptyBatchRequest",
38
+ "InvalidAddress",
39
+ "InvalidAttributeName",
40
+ "InvalidAttributeValue",
41
+ "InvalidBatchEntryId",
42
+ "InvalidIdFormat",
43
+ "InvalidMessageContents",
44
+ "InvalidSecurity",
45
+ "KmsAccessDenied",
46
+ "KmsDisabled",
47
+ "KmsInvalidKeyUsage",
48
+ "KmsInvalidState",
49
+ "KmsNotFound",
50
+ "KmsOptInRequired",
51
+ "KmsThrottled",
52
+ "MessageNotInflight",
53
+ "OverLimit",
54
+ "PurgeQueueInProgress",
55
+ "QueueDeletedRecently",
56
+ "QueueDoesNotExist",
57
+ "QueueNameExists",
58
+ "ReceiptHandleIsInvalid",
59
+ "RequestThrottled",
60
+ "ResourceNotFoundException",
61
+ "TooManyEntriesInBatchRequest",
62
+ "UnsupportedOperation",
63
+ ] as const;
64
+
65
+ export type BatchEntryIdsNotDistinctError = TaggedException<BatchEntryIdsNotDistinct>;
66
+ export type BatchRequestTooLongError = TaggedException<BatchRequestTooLong>;
67
+ export type EmptyBatchRequestError = TaggedException<EmptyBatchRequest>;
68
+ export type InvalidAddressError = TaggedException<InvalidAddress>;
69
+ export type InvalidAttributeNameError = TaggedException<InvalidAttributeName>;
70
+ export type InvalidAttributeValueError = TaggedException<InvalidAttributeValue>;
71
+ export type InvalidBatchEntryIdError = TaggedException<InvalidBatchEntryId>;
72
+ export type InvalidIdFormatError = TaggedException<InvalidIdFormat>;
73
+ export type InvalidMessageContentsError = TaggedException<InvalidMessageContents>;
74
+ export type InvalidSecurityError = TaggedException<InvalidSecurity>;
75
+ export type KmsAccessDeniedError = TaggedException<KmsAccessDenied>;
76
+ export type KmsDisabledError = TaggedException<KmsDisabled>;
77
+ export type KmsInvalidKeyUsageError = TaggedException<KmsInvalidKeyUsage>;
78
+ export type KmsInvalidStateError = TaggedException<KmsInvalidState>;
79
+ export type KmsNotFoundError = TaggedException<KmsNotFound>;
80
+ export type KmsOptInRequiredError = TaggedException<KmsOptInRequired>;
81
+ export type KmsThrottledError = TaggedException<KmsThrottled>;
82
+ export type MessageNotInflightError = TaggedException<MessageNotInflight>;
83
+ export type OverLimitError = TaggedException<OverLimit>;
84
+ export type PurgeQueueInProgressError = TaggedException<PurgeQueueInProgress>;
85
+ export type QueueDeletedRecentlyError = TaggedException<QueueDeletedRecently>;
86
+ export type QueueDoesNotExistError = TaggedException<QueueDoesNotExist>;
87
+ export type QueueNameExistsError = TaggedException<QueueNameExists>;
88
+ export type ReceiptHandleIsInvalidError = TaggedException<ReceiptHandleIsInvalid>;
89
+ export type RequestThrottledError = TaggedException<RequestThrottled>;
90
+ export type ResourceNotFoundError = TaggedException<ResourceNotFoundException>;
91
+ export type TooManyEntriesInBatchRequestError = TaggedException<TooManyEntriesInBatchRequest>;
92
+ export type UnsupportedOperationError = TaggedException<UnsupportedOperation>;
93
+
94
+ export type SdkError = CommonSdkError;
95
+ export const SdkError = CommonSdkError;
@@ -0,0 +1,33 @@
1
+ /**
2
+ * @since 1.0.0
3
+ */
4
+ import { SQSClient } from "@aws-sdk/client-sqs";
5
+ import { Context, Effect, Layer } from "effect";
6
+ import * as SQSServiceConfig from "./SQSServiceConfig.js";
7
+
8
+ /**
9
+ * @since 1.0.0
10
+ * @category tags
11
+ */
12
+ export class SQSClientInstance extends Context.Tag(
13
+ "@effect-aws/client-sqs/SQSClientInstance",
14
+ )<SQSClientInstance, SQSClient>() {}
15
+
16
+ /**
17
+ * @since 1.0.0
18
+ * @category constructors
19
+ */
20
+ export const make = Effect.flatMap(
21
+ SQSServiceConfig.toSQSClientConfig,
22
+ (config) =>
23
+ Effect.acquireRelease(
24
+ Effect.sync(() => new SQSClient(config)),
25
+ (client) => Effect.sync(() => client.destroy()),
26
+ ),
27
+ );
28
+
29
+ /**
30
+ * @since 1.0.0
31
+ * @category layers
32
+ */
33
+ export const layer = Layer.scoped(SQSClientInstance, make);