@effect-aws/client-sns 1.6.0 → 1.9.3

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 (69) hide show
  1. package/Errors/package.json +6 -0
  2. package/SNSClientInstance/package.json +6 -0
  3. package/SNSService/package.json +6 -0
  4. package/SNSServiceConfig/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 +42 -0
  8. package/dist/cjs/Errors.js.map +1 -0
  9. package/dist/cjs/SNSClientInstance.d.ts +24 -0
  10. package/dist/cjs/SNSClientInstance.d.ts.map +1 -0
  11. package/dist/cjs/SNSClientInstance.js +50 -0
  12. package/dist/cjs/SNSClientInstance.js.map +1 -0
  13. package/dist/cjs/SNSService.d.ts +209 -0
  14. package/dist/cjs/SNSService.d.ts.map +1 -0
  15. package/dist/cjs/SNSService.js +101 -0
  16. package/dist/cjs/SNSService.js.map +1 -0
  17. package/dist/cjs/SNSServiceConfig.d.ts +25 -0
  18. package/dist/cjs/SNSServiceConfig.d.ts.map +1 -0
  19. package/dist/cjs/SNSServiceConfig.js +35 -0
  20. package/dist/cjs/SNSServiceConfig.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 +41 -0
  26. package/dist/dts/Errors.d.ts.map +1 -0
  27. package/dist/dts/SNSClientInstance.d.ts +24 -0
  28. package/dist/dts/SNSClientInstance.d.ts.map +1 -0
  29. package/dist/dts/SNSService.d.ts +209 -0
  30. package/dist/dts/SNSService.d.ts.map +1 -0
  31. package/dist/dts/SNSServiceConfig.d.ts +25 -0
  32. package/dist/dts/SNSServiceConfig.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 +39 -0
  36. package/dist/esm/Errors.js.map +1 -0
  37. package/dist/esm/SNSClientInstance.js +23 -0
  38. package/dist/esm/SNSClientInstance.js.map +1 -0
  39. package/dist/esm/SNSService.js +74 -0
  40. package/dist/esm/SNSService.js.map +1 -0
  41. package/dist/esm/SNSServiceConfig.js +31 -0
  42. package/dist/esm/SNSServiceConfig.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 +113 -0
  48. package/src/SNSClientInstance.ts +33 -0
  49. package/src/SNSService.ts +846 -0
  50. package/src/SNSServiceConfig.ts +51 -0
  51. package/src/index.ts +44 -0
  52. package/CHANGELOG.md +0 -113
  53. package/docgen.json +0 -8
  54. package/lib/Errors.js +0 -42
  55. package/lib/SNSClientInstance.d.ts +0 -31
  56. package/lib/SNSClientInstance.js +0 -57
  57. package/lib/SNSClientInstanceConfig.d.ts +0 -23
  58. package/lib/SNSClientInstanceConfig.js +0 -44
  59. package/lib/SNSService.d.ts +0 -275
  60. package/lib/SNSService.js +0 -130
  61. package/lib/esm/Errors.js +0 -39
  62. package/lib/esm/SNSClientInstance.js +0 -30
  63. package/lib/esm/SNSClientInstanceConfig.js +0 -40
  64. package/lib/esm/SNSService.js +0 -126
  65. package/lib/esm/index.js +0 -5
  66. package/lib/index.d.ts +0 -4
  67. package/lib/index.js +0 -21
  68. package/project.json +0 -77
  69. package/vitest.config.ts +0 -3
@@ -0,0 +1,74 @@
1
+ /**
2
+ * @since 1.0.0
3
+ */
4
+ import { AddPermissionCommand, CheckIfPhoneNumberIsOptedOutCommand, ConfirmSubscriptionCommand, CreatePlatformApplicationCommand, CreatePlatformEndpointCommand, CreateSMSSandboxPhoneNumberCommand, CreateTopicCommand, DeleteEndpointCommand, DeletePlatformApplicationCommand, DeleteSMSSandboxPhoneNumberCommand, DeleteTopicCommand, GetDataProtectionPolicyCommand, GetEndpointAttributesCommand, GetPlatformApplicationAttributesCommand, GetSMSAttributesCommand, GetSMSSandboxAccountStatusCommand, GetSubscriptionAttributesCommand, GetTopicAttributesCommand, ListEndpointsByPlatformApplicationCommand, ListOriginationNumbersCommand, ListPhoneNumbersOptedOutCommand, ListPlatformApplicationsCommand, ListSMSSandboxPhoneNumbersCommand, ListSubscriptionsByTopicCommand, ListSubscriptionsCommand, ListTagsForResourceCommand, ListTopicsCommand, OptInPhoneNumberCommand, PublishBatchCommand, PublishCommand, PutDataProtectionPolicyCommand, RemovePermissionCommand, SetEndpointAttributesCommand, SetPlatformApplicationAttributesCommand, SetSMSAttributesCommand, SetSubscriptionAttributesCommand, SetTopicAttributesCommand, SubscribeCommand, TagResourceCommand, UnsubscribeCommand, UntagResourceCommand, VerifySMSSandboxPhoneNumberCommand, } from "@aws-sdk/client-sns";
5
+ import { Service } from "@effect-aws/commons";
6
+ import { Effect, Layer } from "effect";
7
+ import { AllServiceErrors } from "./Errors.js";
8
+ import * as Instance from "./SNSClientInstance.js";
9
+ import * as SNSServiceConfig from "./SNSServiceConfig.js";
10
+ const commands = {
11
+ AddPermissionCommand,
12
+ CheckIfPhoneNumberIsOptedOutCommand,
13
+ ConfirmSubscriptionCommand,
14
+ CreatePlatformApplicationCommand,
15
+ CreatePlatformEndpointCommand,
16
+ CreateSMSSandboxPhoneNumberCommand,
17
+ CreateTopicCommand,
18
+ DeleteEndpointCommand,
19
+ DeletePlatformApplicationCommand,
20
+ DeleteSMSSandboxPhoneNumberCommand,
21
+ DeleteTopicCommand,
22
+ GetDataProtectionPolicyCommand,
23
+ GetEndpointAttributesCommand,
24
+ GetPlatformApplicationAttributesCommand,
25
+ GetSMSAttributesCommand,
26
+ GetSMSSandboxAccountStatusCommand,
27
+ GetSubscriptionAttributesCommand,
28
+ GetTopicAttributesCommand,
29
+ ListEndpointsByPlatformApplicationCommand,
30
+ ListOriginationNumbersCommand,
31
+ ListPhoneNumbersOptedOutCommand,
32
+ ListPlatformApplicationsCommand,
33
+ ListSMSSandboxPhoneNumbersCommand,
34
+ ListSubscriptionsCommand,
35
+ ListSubscriptionsByTopicCommand,
36
+ ListTagsForResourceCommand,
37
+ ListTopicsCommand,
38
+ OptInPhoneNumberCommand,
39
+ PublishCommand,
40
+ PublishBatchCommand,
41
+ PutDataProtectionPolicyCommand,
42
+ RemovePermissionCommand,
43
+ SetEndpointAttributesCommand,
44
+ SetPlatformApplicationAttributesCommand,
45
+ SetSMSAttributesCommand,
46
+ SetSubscriptionAttributesCommand,
47
+ SetTopicAttributesCommand,
48
+ SubscribeCommand,
49
+ TagResourceCommand,
50
+ UnsubscribeCommand,
51
+ UntagResourceCommand,
52
+ VerifySMSSandboxPhoneNumberCommand,
53
+ };
54
+ /**
55
+ * @since 1.0.0
56
+ * @category constructors
57
+ */
58
+ export const makeSNSService = Effect.gen(function* () {
59
+ const client = yield* Instance.SNSClientInstance;
60
+ return Service.fromClientAndCommands(client, commands, {
61
+ errorTags: AllServiceErrors,
62
+ resolveClientConfig: SNSServiceConfig.toSNSClientConfig,
63
+ });
64
+ });
65
+ /**
66
+ * @since 1.0.0
67
+ * @category models
68
+ */
69
+ export class SNSService extends Effect.Tag("@effect-aws/client-sns/SNSService")() {
70
+ static defaultLayer = Layer.effect(this, makeSNSService).pipe(Layer.provide(Instance.layer));
71
+ static layer = (config) => Layer.effect(this, makeSNSService).pipe(Layer.provide(Instance.layer), Layer.provide(SNSServiceConfig.setSNSServiceConfig(config)));
72
+ static baseLayer = (evaluate) => Layer.effect(this, makeSNSService).pipe(Layer.provide(Layer.effect(Instance.SNSClientInstance, Effect.map(SNSServiceConfig.toSNSClientConfig, evaluate))));
73
+ }
74
+ //# sourceMappingURL=SNSService.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SNSService.js","sourceRoot":"","sources":["../../src/SNSService.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EACL,oBAAoB,EAGpB,mCAAmC,EAGnC,0BAA0B,EAG1B,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AM,CAAC,IAAI,EAAE,cAAc,CAAC,CAAC,IAAI,CACrC,KAAK,CAAC,OAAO,CACX,KAAK,CAAC,MAAM,CACV,QAAQ,CAAC,iBAAiB,EAC1B,MAAM,CAAC,GAAG,CAAC,gBAAgB,CAAC,iBAAiB,EAAE,QAAQ,CAAC,CACzD,CACF,CACF,CAAC"}
@@ -0,0 +1,31 @@
1
+ import { ServiceLogger } from "@effect-aws/commons";
2
+ import { Effect, FiberRef, Layer } from "effect";
3
+ import { dual } from "effect/Function";
4
+ import { globalValue } from "effect/GlobalValue";
5
+ /**
6
+ * @since 1.0.0
7
+ * @category sns service config
8
+ */
9
+ const currentSNSServiceConfig = globalValue("@effect-aws/client-sns/currentSNSServiceConfig", () => FiberRef.unsafeMake({}));
10
+ /**
11
+ * @since 1.0.0
12
+ * @category sns service config
13
+ */
14
+ export const withSNSServiceConfig = dual(2, (effect, config) => Effect.locally(effect, currentSNSServiceConfig, config));
15
+ /**
16
+ * @since 1.0.0
17
+ * @category sns service config
18
+ */
19
+ export const setSNSServiceConfig = (config) => Layer.locallyScoped(currentSNSServiceConfig, config);
20
+ /**
21
+ * @since 1.0.0
22
+ * @category adapters
23
+ */
24
+ export const toSNSClientConfig = Effect.gen(function* () {
25
+ const { logger: serviceLogger, ...config } = yield* FiberRef.get(currentSNSServiceConfig);
26
+ const logger = serviceLogger === true
27
+ ? yield* ServiceLogger.toClientLogger(ServiceLogger.defaultServiceLogger)
28
+ : (serviceLogger ? yield* ServiceLogger.toClientLogger(ServiceLogger.make(serviceLogger)) : undefined);
29
+ return { logger, ...config };
30
+ });
31
+ //# sourceMappingURL=SNSServiceConfig.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SNSServiceConfig.js","sourceRoot":"","sources":["../../src/SNSServiceConfig.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,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0
3
+ */
4
+ import { SNSService } from "./SNSService.js";
5
+ /**
6
+ * @since 1.0.0
7
+ */
8
+ export * from "./Errors.js";
9
+ /**
10
+ * @since 1.0.0
11
+ */
12
+ export * as SNSClientInstance from "./SNSClientInstance.js";
13
+ /**
14
+ * @since 1.0.0
15
+ */
16
+ export * as SNSServiceConfig from "./SNSServiceConfig.js";
17
+ /**
18
+ * @since 1.0.0
19
+ */
20
+ export * from "./SNSService.js";
21
+ /**
22
+ * @since 1.0.0
23
+ * @category exports
24
+ * @alias SNSService
25
+ */
26
+ export const SNS = SNSService;
27
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C;;GAEG;AACH,cAAc,aAAa,CAAC;AAE5B;;GAEG;AACH,OAAO,KAAK,iBAAiB,MAAM,wBAAwB,CAAC;AAE5D;;GAEG;AACH,OAAO,KAAK,gBAAgB,MAAM,uBAAuB,CAAC;AAE1D;;GAEG;AACH,cAAc,iBAAiB,CAAC;AAehC;;;;GAIG;AACH,MAAM,CAAC,MAAM,GAAG,GAAG,UAAU,CAAC"}
@@ -0,0 +1,4 @@
1
+ {
2
+ "type": "module",
3
+ "sideEffects": []
4
+ }
package/package.json CHANGED
@@ -1,54 +1,71 @@
1
1
  {
2
2
  "name": "@effect-aws/client-sns",
3
+ "version": "1.9.3",
4
+ "description": "Effectful AWS SNS client",
5
+ "license": "MIT",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "github:floydspace/effect-aws",
9
+ "directory": "packages/client-sns"
10
+ },
11
+ "sideEffects": [],
3
12
  "author": {
4
13
  "name": "Victor Korzunin",
5
- "email": "ifloydrose@gmail.com",
6
- "organization": false
14
+ "email": "ifloydrose@gmail.com"
7
15
  },
8
- "devDependencies": {
9
- "@types/node": "^18",
10
- "@typescript-eslint/eslint-plugin": "^7",
11
- "@typescript-eslint/parser": "^7",
12
- "aws-sdk-client-mock": "^4.0.2",
13
- "aws-sdk-client-mock-vitest": "^4.0.0",
14
- "effect": "3.0.0",
15
- "eslint": "^8",
16
- "eslint-config-prettier": "^9.1.0",
17
- "eslint-import-resolver-typescript": "^3.6.1",
18
- "eslint-plugin-import": "^2.29.1",
19
- "eslint-plugin-prettier": "^5.2.1",
20
- "prettier": "^3.2.5",
21
- "typescript": "^5.4.2",
22
- "vitest": "^2.0.5"
16
+ "homepage": "https://floydspace.github.io/effect-aws/docs/client-sns",
17
+ "dependencies": {
18
+ "@aws-sdk/client-sns": "^3",
19
+ "@effect-aws/commons": "^0.2.0"
23
20
  },
24
21
  "peerDependencies": {
25
- "effect": ">=3.0.0 <4.0.0"
22
+ "effect": ">=3.0.4 <4.0.0"
26
23
  },
27
- "dependencies": {
28
- "@aws-sdk/client-sns": "^3"
29
- },
30
- "main": "lib/index.js",
31
- "license": "MIT",
32
- "homepage": "https://floydspace.github.io/effect-aws",
33
- "publishConfig": {
34
- "access": "public"
24
+ "main": "./dist/cjs/index.js",
25
+ "module": "./dist/esm/index.js",
26
+ "types": "./dist/dts/index.d.ts",
27
+ "exports": {
28
+ "./package.json": "./package.json",
29
+ ".": {
30
+ "types": "./dist/dts/index.d.ts",
31
+ "import": "./dist/esm/index.js",
32
+ "default": "./dist/cjs/index.js"
33
+ },
34
+ "./Errors": {
35
+ "types": "./dist/dts/Errors.d.ts",
36
+ "import": "./dist/esm/Errors.js",
37
+ "default": "./dist/cjs/Errors.js"
38
+ },
39
+ "./SNSClientInstance": {
40
+ "types": "./dist/dts/SNSClientInstance.d.ts",
41
+ "import": "./dist/esm/SNSClientInstance.js",
42
+ "default": "./dist/cjs/SNSClientInstance.js"
43
+ },
44
+ "./SNSService": {
45
+ "types": "./dist/dts/SNSService.d.ts",
46
+ "import": "./dist/esm/SNSService.js",
47
+ "default": "./dist/cjs/SNSService.js"
48
+ },
49
+ "./SNSServiceConfig": {
50
+ "types": "./dist/dts/SNSServiceConfig.d.ts",
51
+ "import": "./dist/esm/SNSServiceConfig.js",
52
+ "default": "./dist/cjs/SNSServiceConfig.js"
53
+ }
35
54
  },
36
- "version": "1.6.0",
37
- "types": "lib/index.d.ts",
38
- "module": "lib/esm/index.js",
39
- "sideEffects": [],
40
- "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"npx projen\".",
41
- "scripts": {
42
- "build": "npx projen build",
43
- "compile": "npx projen compile",
44
- "default": "npx projen default",
45
- "eslint": "npx projen eslint",
46
- "package": "npx projen package",
47
- "post-compile": "npx projen post-compile",
48
- "pre-compile": "npx projen pre-compile",
49
- "test": "npx projen test",
50
- "test:watch": "npx projen test:watch",
51
- "watch": "npx projen watch",
52
- "docgen": "docgen"
55
+ "typesVersions": {
56
+ "*": {
57
+ "Errors": [
58
+ "./dist/dts/Errors.d.ts"
59
+ ],
60
+ "SNSClientInstance": [
61
+ "./dist/dts/SNSClientInstance.d.ts"
62
+ ],
63
+ "SNSService": [
64
+ "./dist/dts/SNSService.d.ts"
65
+ ],
66
+ "SNSServiceConfig": [
67
+ "./dist/dts/SNSServiceConfig.d.ts"
68
+ ]
69
+ }
53
70
  }
54
71
  }
package/src/Errors.ts ADDED
@@ -0,0 +1,113 @@
1
+ import type {
2
+ AuthorizationErrorException,
3
+ BatchEntryIdsNotDistinctException,
4
+ BatchRequestTooLongException,
5
+ ConcurrentAccessException,
6
+ EmptyBatchRequestException,
7
+ EndpointDisabledException,
8
+ FilterPolicyLimitExceededException,
9
+ InternalErrorException,
10
+ InvalidBatchEntryIdException,
11
+ InvalidParameterException,
12
+ InvalidParameterValueException,
13
+ InvalidSecurityException,
14
+ InvalidStateException,
15
+ KMSAccessDeniedException,
16
+ KMSDisabledException,
17
+ KMSInvalidStateException,
18
+ KMSNotFoundException,
19
+ KMSOptInRequired,
20
+ KMSThrottlingException,
21
+ NotFoundException,
22
+ OptedOutException,
23
+ PlatformApplicationDisabledException,
24
+ ReplayLimitExceededException,
25
+ ResourceNotFoundException,
26
+ StaleTagException,
27
+ SubscriptionLimitExceededException,
28
+ TagLimitExceededException,
29
+ TagPolicyException,
30
+ ThrottledException,
31
+ TooManyEntriesInBatchRequestException,
32
+ TopicLimitExceededException,
33
+ UserErrorException,
34
+ ValidationException,
35
+ VerificationException,
36
+ } from "@aws-sdk/client-sns";
37
+ import type { TaggedException } from "@effect-aws/commons";
38
+ import { SdkError as CommonSdkError } from "@effect-aws/commons";
39
+
40
+ export const AllServiceErrors = [
41
+ "AuthorizationErrorException",
42
+ "BatchEntryIdsNotDistinctException",
43
+ "BatchRequestTooLongException",
44
+ "ConcurrentAccessException",
45
+ "EmptyBatchRequestException",
46
+ "EndpointDisabledException",
47
+ "FilterPolicyLimitExceededException",
48
+ "InternalErrorException",
49
+ "InvalidBatchEntryIdException",
50
+ "InvalidParameterException",
51
+ "InvalidParameterValueException",
52
+ "InvalidSecurityException",
53
+ "InvalidStateException",
54
+ "KMSAccessDeniedException",
55
+ "KMSDisabledException",
56
+ "KMSInvalidStateException",
57
+ "KMSNotFoundException",
58
+ "KMSOptInRequired",
59
+ "KMSThrottlingException",
60
+ "NotFoundException",
61
+ "OptedOutException",
62
+ "PlatformApplicationDisabledException",
63
+ "ReplayLimitExceededException",
64
+ "ResourceNotFoundException",
65
+ "StaleTagException",
66
+ "SubscriptionLimitExceededException",
67
+ "TagLimitExceededException",
68
+ "TagPolicyException",
69
+ "ThrottledException",
70
+ "TooManyEntriesInBatchRequestException",
71
+ "TopicLimitExceededException",
72
+ "UserErrorException",
73
+ "ValidationException",
74
+ "VerificationException",
75
+ ] as const;
76
+
77
+ export type AuthorizationError = TaggedException<AuthorizationErrorException>;
78
+ export type BatchEntryIdsNotDistinctError = TaggedException<BatchEntryIdsNotDistinctException>;
79
+ export type BatchRequestTooLongError = TaggedException<BatchRequestTooLongException>;
80
+ export type ConcurrentAccessError = TaggedException<ConcurrentAccessException>;
81
+ export type EmptyBatchRequestError = TaggedException<EmptyBatchRequestException>;
82
+ export type EndpointDisabledError = TaggedException<EndpointDisabledException>;
83
+ export type FilterPolicyLimitExceededError = TaggedException<FilterPolicyLimitExceededException>;
84
+ export type InternalError = TaggedException<InternalErrorException>;
85
+ export type InvalidBatchEntryIdError = TaggedException<InvalidBatchEntryIdException>;
86
+ export type InvalidParameterError = TaggedException<InvalidParameterException>;
87
+ export type InvalidParameterValueError = TaggedException<InvalidParameterValueException>;
88
+ export type InvalidSecurityError = TaggedException<InvalidSecurityException>;
89
+ export type InvalidStateError = TaggedException<InvalidStateException>;
90
+ export type KMSAccessDeniedError = TaggedException<KMSAccessDeniedException>;
91
+ export type KMSDisabledError = TaggedException<KMSDisabledException>;
92
+ export type KMSInvalidStateError = TaggedException<KMSInvalidStateException>;
93
+ export type KMSNotFoundError = TaggedException<KMSNotFoundException>;
94
+ export type KMSOptInRequiredError = TaggedException<KMSOptInRequired>;
95
+ export type KMSThrottlingError = TaggedException<KMSThrottlingException>;
96
+ export type NotFoundError = TaggedException<NotFoundException>;
97
+ export type OptedOutError = TaggedException<OptedOutException>;
98
+ export type PlatformApplicationDisabledError = TaggedException<PlatformApplicationDisabledException>;
99
+ export type ReplayLimitExceededError = TaggedException<ReplayLimitExceededException>;
100
+ export type ResourceNotFoundError = TaggedException<ResourceNotFoundException>;
101
+ export type StaleTagError = TaggedException<StaleTagException>;
102
+ export type SubscriptionLimitExceededError = TaggedException<SubscriptionLimitExceededException>;
103
+ export type TagLimitExceededError = TaggedException<TagLimitExceededException>;
104
+ export type TagPolicyError = TaggedException<TagPolicyException>;
105
+ export type ThrottledError = TaggedException<ThrottledException>;
106
+ export type TooManyEntriesInBatchRequestError = TaggedException<TooManyEntriesInBatchRequestException>;
107
+ export type TopicLimitExceededError = TaggedException<TopicLimitExceededException>;
108
+ export type UserError = TaggedException<UserErrorException>;
109
+ export type ValidationError = TaggedException<ValidationException>;
110
+ export type VerificationError = TaggedException<VerificationException>;
111
+
112
+ export type SdkError = CommonSdkError;
113
+ export const SdkError = CommonSdkError;
@@ -0,0 +1,33 @@
1
+ /**
2
+ * @since 1.0.0
3
+ */
4
+ import { SNSClient } from "@aws-sdk/client-sns";
5
+ import { Context, Effect, Layer } from "effect";
6
+ import * as SNSServiceConfig from "./SNSServiceConfig.js";
7
+
8
+ /**
9
+ * @since 1.0.0
10
+ * @category tags
11
+ */
12
+ export class SNSClientInstance extends Context.Tag(
13
+ "@effect-aws/client-sns/SNSClientInstance",
14
+ )<SNSClientInstance, SNSClient>() {}
15
+
16
+ /**
17
+ * @since 1.0.0
18
+ * @category constructors
19
+ */
20
+ export const make = Effect.flatMap(
21
+ SNSServiceConfig.toSNSClientConfig,
22
+ (config) =>
23
+ Effect.acquireRelease(
24
+ Effect.sync(() => new SNSClient(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(SNSClientInstance, make);