@effect-aws/client-sns 1.6.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.
- package/Errors/package.json +6 -0
- package/SNSClientInstance/package.json +6 -0
- package/SNSService/package.json +6 -0
- package/SNSServiceConfig/package.json +6 -0
- package/{lib → dist/cjs}/Errors.d.ts +6 -11
- package/dist/cjs/Errors.d.ts.map +1 -0
- package/dist/cjs/Errors.js +42 -0
- package/dist/cjs/Errors.js.map +1 -0
- package/dist/cjs/SNSClientInstance.d.ts +24 -0
- package/dist/cjs/SNSClientInstance.d.ts.map +1 -0
- package/dist/cjs/SNSClientInstance.js +50 -0
- package/dist/cjs/SNSClientInstance.js.map +1 -0
- package/{lib → dist/cjs}/SNSService.d.ts +16 -38
- package/dist/cjs/SNSService.d.ts.map +1 -0
- package/dist/cjs/SNSService.js +98 -0
- package/dist/cjs/SNSService.js.map +1 -0
- package/dist/cjs/SNSServiceConfig.d.ts +25 -0
- package/dist/cjs/SNSServiceConfig.d.ts.map +1 -0
- package/dist/cjs/SNSServiceConfig.js +35 -0
- package/dist/cjs/SNSServiceConfig.js.map +1 -0
- package/dist/cjs/index.d.ts +39 -0
- package/dist/cjs/index.d.ts.map +1 -0
- package/dist/cjs/index.js +56 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/dts/Errors.d.ts +41 -0
- package/dist/dts/Errors.d.ts.map +1 -0
- package/dist/dts/SNSClientInstance.d.ts +24 -0
- package/dist/dts/SNSClientInstance.d.ts.map +1 -0
- package/dist/dts/SNSService.d.ts +253 -0
- package/dist/dts/SNSService.d.ts.map +1 -0
- package/dist/dts/SNSServiceConfig.d.ts +25 -0
- package/dist/dts/SNSServiceConfig.d.ts.map +1 -0
- package/dist/dts/index.d.ts +39 -0
- package/dist/dts/index.d.ts.map +1 -0
- package/dist/esm/Errors.js +39 -0
- package/dist/esm/Errors.js.map +1 -0
- package/dist/esm/SNSClientInstance.js +23 -0
- package/dist/esm/SNSClientInstance.js.map +1 -0
- package/dist/esm/SNSService.js +71 -0
- package/dist/esm/SNSService.js.map +1 -0
- package/dist/esm/SNSServiceConfig.js +31 -0
- package/dist/esm/SNSServiceConfig.js.map +1 -0
- package/dist/esm/index.js +27 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/package.json +4 -0
- package/package.json +60 -43
- package/src/Errors.ts +113 -0
- package/src/SNSClientInstance.ts +33 -0
- package/src/SNSService.ts +839 -0
- package/src/SNSServiceConfig.ts +51 -0
- package/src/index.ts +44 -0
- package/CHANGELOG.md +0 -113
- package/docgen.json +0 -8
- package/lib/Errors.js +0 -42
- package/lib/SNSClientInstance.d.ts +0 -31
- package/lib/SNSClientInstance.js +0 -57
- package/lib/SNSClientInstanceConfig.d.ts +0 -23
- package/lib/SNSClientInstanceConfig.js +0 -44
- package/lib/SNSService.js +0 -130
- package/lib/esm/Errors.js +0 -39
- package/lib/esm/SNSClientInstance.js +0 -30
- package/lib/esm/SNSClientInstanceConfig.js +0 -40
- package/lib/esm/SNSService.js +0 -126
- package/lib/esm/index.js +0 -5
- package/lib/index.d.ts +0 -4
- package/lib/index.js +0 -21
- package/project.json +0 -77
- package/vitest.config.ts +0 -3
|
@@ -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,QAAQ,CAAC;AACjD,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAGjD;;;GAGG;AACH,MAAM,uBAAuB,GAAG,WAAW,CACzC,gDAAgD,EAChD,GAAG,EAAE,CAAC,QAAQ,CAAC,UAAU,CAAoB,EAAE,CAAC,CACjD,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAG7B,IAAI,CACN,CAAC,EACD,CAAU,MAA8B,EAAE,MAAyB,EAA0B,EAAE,CAC7F,MAAM,CAAC,OAAO,CAAC,MAAM,EAAE,uBAAuB,EAAE,MAAM,CAAC,CAC1D,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,MAAyB,EAAE,EAAE,CAAC,KAAK,CAAC,aAAa,CAAC,uBAAuB,EAAE,MAAM,CAAC,CAAC;AAEvH;;;GAGG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAmC,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC;IACnF,MAAM,EAAE,MAAM,EAAE,aAAa,EAAE,GAAG,MAAM,EAAE,GAAG,KAAK,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,uBAAuB,CAAC,CAAC;IAE1F,MAAM,MAAM,GAAG,aAAa,KAAK,IAAI;QACnC,CAAC,CAAC,KAAK,CAAC,CAAC,aAAa,CAAC,cAAc,CAAC,aAAa,CAAC,oBAAoB,CAAC;QACzE,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,aAAa,CAAC,cAAc,CAAC,aAAa,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;IAEzG,OAAO,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAAC;AAC/B,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @since 1.0.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"}
|
package/package.json
CHANGED
|
@@ -1,54 +1,71 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@effect-aws/client-sns",
|
|
3
|
+
"version": "1.9.0",
|
|
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
|
-
"
|
|
9
|
-
|
|
10
|
-
"@
|
|
11
|
-
"@
|
|
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.1.0"
|
|
23
20
|
},
|
|
24
21
|
"peerDependencies": {
|
|
25
|
-
"effect": ">=3.0.
|
|
22
|
+
"effect": ">=3.0.4 <4.0.0"
|
|
26
23
|
},
|
|
27
|
-
"
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
"
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
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
|
-
"
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
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);
|