@effect-aws/client-kms 1.1.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 (69) hide show
  1. package/Errors/package.json +6 -0
  2. package/KMSClientInstance/package.json +6 -0
  3. package/KMSService/package.json +6 -0
  4. package/KMSServiceConfig/package.json +6 -0
  5. package/LICENSE +1 -1
  6. package/{lib → dist/cjs}/Errors.d.ts +7 -12
  7. package/dist/cjs/Errors.d.ts.map +1 -0
  8. package/dist/cjs/Errors.js +56 -0
  9. package/dist/cjs/Errors.js.map +1 -0
  10. package/dist/cjs/KMSClientInstance.d.ts +24 -0
  11. package/dist/cjs/KMSClientInstance.d.ts.map +1 -0
  12. package/dist/cjs/KMSClientInstance.js +50 -0
  13. package/dist/cjs/KMSClientInstance.js.map +1 -0
  14. package/{lib → dist/cjs}/KMSService.d.ts +16 -38
  15. package/dist/cjs/KMSService.d.ts.map +1 -0
  16. package/dist/cjs/KMSService.js +109 -0
  17. package/dist/cjs/KMSService.js.map +1 -0
  18. package/dist/cjs/KMSServiceConfig.d.ts +25 -0
  19. package/dist/cjs/KMSServiceConfig.d.ts.map +1 -0
  20. package/dist/cjs/KMSServiceConfig.js +35 -0
  21. package/dist/cjs/KMSServiceConfig.js.map +1 -0
  22. package/dist/cjs/index.d.ts +39 -0
  23. package/dist/cjs/index.d.ts.map +1 -0
  24. package/dist/cjs/index.js +56 -0
  25. package/dist/cjs/index.js.map +1 -0
  26. package/dist/dts/Errors.d.ts +55 -0
  27. package/dist/dts/Errors.d.ts.map +1 -0
  28. package/dist/dts/KMSClientInstance.d.ts +24 -0
  29. package/dist/dts/KMSClientInstance.d.ts.map +1 -0
  30. package/dist/dts/KMSService.d.ts +308 -0
  31. package/dist/dts/KMSService.d.ts.map +1 -0
  32. package/dist/dts/KMSServiceConfig.d.ts +25 -0
  33. package/dist/dts/KMSServiceConfig.d.ts.map +1 -0
  34. package/dist/dts/index.d.ts +39 -0
  35. package/dist/dts/index.d.ts.map +1 -0
  36. package/dist/esm/Errors.js +53 -0
  37. package/dist/esm/Errors.js.map +1 -0
  38. package/dist/esm/KMSClientInstance.js +23 -0
  39. package/dist/esm/KMSClientInstance.js.map +1 -0
  40. package/dist/esm/KMSService.js +82 -0
  41. package/dist/esm/KMSService.js.map +1 -0
  42. package/dist/esm/KMSServiceConfig.js +31 -0
  43. package/dist/esm/KMSServiceConfig.js.map +1 -0
  44. package/dist/esm/index.js +27 -0
  45. package/dist/esm/index.js.map +1 -0
  46. package/dist/esm/package.json +4 -0
  47. package/package.json +60 -43
  48. package/src/Errors.ts +159 -0
  49. package/src/KMSClientInstance.ts +33 -0
  50. package/src/KMSService.ts +1224 -0
  51. package/src/KMSServiceConfig.ts +51 -0
  52. package/src/index.ts +44 -0
  53. package/CHANGELOG.md +0 -29
  54. package/docgen.json +0 -8
  55. package/lib/Errors.js +0 -56
  56. package/lib/KMSClientInstance.d.ts +0 -31
  57. package/lib/KMSClientInstance.js +0 -57
  58. package/lib/KMSClientInstanceConfig.d.ts +0 -23
  59. package/lib/KMSClientInstanceConfig.js +0 -44
  60. package/lib/KMSService.js +0 -141
  61. package/lib/esm/Errors.js +0 -53
  62. package/lib/esm/KMSClientInstance.js +0 -30
  63. package/lib/esm/KMSClientInstanceConfig.js +0 -40
  64. package/lib/esm/KMSService.js +0 -137
  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,53 @@
1
+ import { SdkError as CommonSdkError } from "@effect-aws/commons";
2
+ export const AllServiceErrors = [
3
+ "AlreadyExistsException",
4
+ "CloudHsmClusterInUseException",
5
+ "CloudHsmClusterInvalidConfigurationException",
6
+ "CloudHsmClusterNotActiveException",
7
+ "CloudHsmClusterNotFoundException",
8
+ "CloudHsmClusterNotRelatedException",
9
+ "ConflictException",
10
+ "CustomKeyStoreHasCMKsException",
11
+ "CustomKeyStoreInvalidStateException",
12
+ "CustomKeyStoreNameInUseException",
13
+ "CustomKeyStoreNotFoundException",
14
+ "DependencyTimeoutException",
15
+ "DisabledException",
16
+ "DryRunOperationException",
17
+ "ExpiredImportTokenException",
18
+ "IncorrectKeyException",
19
+ "IncorrectKeyMaterialException",
20
+ "IncorrectTrustAnchorException",
21
+ "InvalidAliasNameException",
22
+ "InvalidArnException",
23
+ "InvalidCiphertextException",
24
+ "InvalidGrantIdException",
25
+ "InvalidGrantTokenException",
26
+ "InvalidImportTokenException",
27
+ "InvalidKeyUsageException",
28
+ "InvalidMarkerException",
29
+ "KMSInternalException",
30
+ "KMSInvalidMacException",
31
+ "KMSInvalidSignatureException",
32
+ "KMSInvalidStateException",
33
+ "KeyUnavailableException",
34
+ "LimitExceededException",
35
+ "MalformedPolicyDocumentException",
36
+ "NotFoundException",
37
+ "TagException",
38
+ "UnsupportedOperationException",
39
+ "XksKeyAlreadyInUseException",
40
+ "XksKeyInvalidConfigurationException",
41
+ "XksKeyNotFoundException",
42
+ "XksProxyIncorrectAuthenticationCredentialException",
43
+ "XksProxyInvalidConfigurationException",
44
+ "XksProxyInvalidResponseException",
45
+ "XksProxyUriEndpointInUseException",
46
+ "XksProxyUriInUseException",
47
+ "XksProxyUriUnreachableException",
48
+ "XksProxyVpcEndpointServiceInUseException",
49
+ "XksProxyVpcEndpointServiceInvalidConfigurationException",
50
+ "XksProxyVpcEndpointServiceNotFoundException",
51
+ ];
52
+ export const SdkError = CommonSdkError;
53
+ //# sourceMappingURL=Errors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Errors.js","sourceRoot":"","sources":["../../src/Errors.ts"],"names":[],"mappings":"AAmDA,OAAO,EAAE,QAAQ,IAAI,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAEjE,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,wBAAwB;IACxB,+BAA+B;IAC/B,8CAA8C;IAC9C,mCAAmC;IACnC,kCAAkC;IAClC,oCAAoC;IACpC,mBAAmB;IACnB,gCAAgC;IAChC,qCAAqC;IACrC,kCAAkC;IAClC,iCAAiC;IACjC,4BAA4B;IAC5B,mBAAmB;IACnB,0BAA0B;IAC1B,6BAA6B;IAC7B,uBAAuB;IACvB,+BAA+B;IAC/B,+BAA+B;IAC/B,2BAA2B;IAC3B,qBAAqB;IACrB,4BAA4B;IAC5B,yBAAyB;IACzB,4BAA4B;IAC5B,6BAA6B;IAC7B,0BAA0B;IAC1B,wBAAwB;IACxB,sBAAsB;IACtB,wBAAwB;IACxB,8BAA8B;IAC9B,0BAA0B;IAC1B,yBAAyB;IACzB,wBAAwB;IACxB,kCAAkC;IAClC,mBAAmB;IACnB,cAAc;IACd,+BAA+B;IAC/B,6BAA6B;IAC7B,qCAAqC;IACrC,yBAAyB;IACzB,oDAAoD;IACpD,uCAAuC;IACvC,kCAAkC;IAClC,mCAAmC;IACnC,2BAA2B;IAC3B,iCAAiC;IACjC,0CAA0C;IAC1C,yDAAyD;IACzD,6CAA6C;CACrC,CAAC;AAwDX,MAAM,CAAC,MAAM,QAAQ,GAAG,cAAc,CAAC"}
@@ -0,0 +1,23 @@
1
+ /**
2
+ * @since 1.0.0
3
+ */
4
+ import { KMSClient } from "@aws-sdk/client-kms";
5
+ import { Context, Effect, Layer } from "effect";
6
+ import * as KMSServiceConfig from "./KMSServiceConfig.js";
7
+ /**
8
+ * @since 1.0.0
9
+ * @category tags
10
+ */
11
+ export class KMSClientInstance extends Context.Tag("@effect-aws/client-kms/KMSClientInstance")() {
12
+ }
13
+ /**
14
+ * @since 1.0.0
15
+ * @category constructors
16
+ */
17
+ export const make = Effect.flatMap(KMSServiceConfig.toKMSClientConfig, (config) => Effect.acquireRelease(Effect.sync(() => new KMSClient(config)), (client) => Effect.sync(() => client.destroy())));
18
+ /**
19
+ * @since 1.0.0
20
+ * @category layers
21
+ */
22
+ export const layer = Layer.scoped(KMSClientInstance, make);
23
+ //# sourceMappingURL=KMSClientInstance.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"KMSClientInstance.js","sourceRoot":"","sources":["../../src/KMSClientInstance.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAChD,OAAO,KAAK,gBAAgB,MAAM,uBAAuB,CAAC;AAE1D;;;GAGG;AACH,MAAM,OAAO,iBAAkB,SAAQ,OAAO,CAAC,GAAG,CAChD,0CAA0C,CAC3C,EAAgC;CAAG;AAEpC;;;GAGG;AACH,MAAM,CAAC,MAAM,IAAI,GAAG,MAAM,CAAC,OAAO,CAChC,gBAAgB,CAAC,iBAAiB,EAClC,CAAC,MAAM,EAAE,EAAE,CACT,MAAM,CAAC,cAAc,CACnB,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,IAAI,SAAS,CAAC,MAAM,CAAC,CAAC,EACxC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC,CAChD,CACJ,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,iBAAiB,EAAE,IAAI,CAAC,CAAC"}
@@ -0,0 +1,82 @@
1
+ /**
2
+ * @since 1.0.0
3
+ */
4
+ import { CancelKeyDeletionCommand, ConnectCustomKeyStoreCommand, CreateAliasCommand, CreateCustomKeyStoreCommand, CreateGrantCommand, CreateKeyCommand, DecryptCommand, DeleteAliasCommand, DeleteCustomKeyStoreCommand, DeleteImportedKeyMaterialCommand, DeriveSharedSecretCommand, DescribeCustomKeyStoresCommand, DescribeKeyCommand, DisableKeyCommand, DisableKeyRotationCommand, DisconnectCustomKeyStoreCommand, EnableKeyCommand, EnableKeyRotationCommand, EncryptCommand, GenerateDataKeyCommand, GenerateDataKeyPairCommand, GenerateDataKeyPairWithoutPlaintextCommand, GenerateDataKeyWithoutPlaintextCommand, GenerateMacCommand, GenerateRandomCommand, GetKeyPolicyCommand, GetKeyRotationStatusCommand, GetParametersForImportCommand, GetPublicKeyCommand, ImportKeyMaterialCommand, ListAliasesCommand, ListGrantsCommand, ListKeyPoliciesCommand, ListKeyRotationsCommand, ListKeysCommand, ListResourceTagsCommand, ListRetirableGrantsCommand, PutKeyPolicyCommand, ReEncryptCommand, ReplicateKeyCommand, RetireGrantCommand, RevokeGrantCommand, RotateKeyOnDemandCommand, ScheduleKeyDeletionCommand, SignCommand, TagResourceCommand, UntagResourceCommand, UpdateAliasCommand, UpdateCustomKeyStoreCommand, UpdateKeyDescriptionCommand, UpdatePrimaryRegionCommand, VerifyCommand, VerifyMacCommand, } from "@aws-sdk/client-kms";
5
+ import { Service } from "@effect-aws/commons";
6
+ import { Effect, Layer } from "effect";
7
+ import { AllServiceErrors } from "./Errors.js";
8
+ import * as Instance from "./KMSClientInstance.js";
9
+ import * as KMSServiceConfig from "./KMSServiceConfig.js";
10
+ const commands = {
11
+ CancelKeyDeletionCommand,
12
+ ConnectCustomKeyStoreCommand,
13
+ CreateAliasCommand,
14
+ CreateCustomKeyStoreCommand,
15
+ CreateGrantCommand,
16
+ CreateKeyCommand,
17
+ DecryptCommand,
18
+ DeleteAliasCommand,
19
+ DeleteCustomKeyStoreCommand,
20
+ DeleteImportedKeyMaterialCommand,
21
+ DeriveSharedSecretCommand,
22
+ DescribeCustomKeyStoresCommand,
23
+ DescribeKeyCommand,
24
+ DisableKeyCommand,
25
+ DisableKeyRotationCommand,
26
+ DisconnectCustomKeyStoreCommand,
27
+ EnableKeyCommand,
28
+ EnableKeyRotationCommand,
29
+ EncryptCommand,
30
+ GenerateDataKeyCommand,
31
+ GenerateDataKeyPairCommand,
32
+ GenerateDataKeyPairWithoutPlaintextCommand,
33
+ GenerateDataKeyWithoutPlaintextCommand,
34
+ GenerateMacCommand,
35
+ GenerateRandomCommand,
36
+ GetKeyPolicyCommand,
37
+ GetKeyRotationStatusCommand,
38
+ GetParametersForImportCommand,
39
+ GetPublicKeyCommand,
40
+ ImportKeyMaterialCommand,
41
+ ListAliasesCommand,
42
+ ListGrantsCommand,
43
+ ListKeyPoliciesCommand,
44
+ ListKeyRotationsCommand,
45
+ ListKeysCommand,
46
+ ListResourceTagsCommand,
47
+ ListRetirableGrantsCommand,
48
+ PutKeyPolicyCommand,
49
+ ReEncryptCommand,
50
+ ReplicateKeyCommand,
51
+ RetireGrantCommand,
52
+ RevokeGrantCommand,
53
+ RotateKeyOnDemandCommand,
54
+ ScheduleKeyDeletionCommand,
55
+ SignCommand,
56
+ TagResourceCommand,
57
+ UntagResourceCommand,
58
+ UpdateAliasCommand,
59
+ UpdateCustomKeyStoreCommand,
60
+ UpdateKeyDescriptionCommand,
61
+ UpdatePrimaryRegionCommand,
62
+ VerifyCommand,
63
+ VerifyMacCommand,
64
+ };
65
+ /**
66
+ * @since 1.0.0
67
+ * @category constructors
68
+ */
69
+ export const makeKMSService = Effect.gen(function* () {
70
+ const client = yield* Instance.KMSClientInstance;
71
+ return Service.fromClientAndCommands(client, commands, AllServiceErrors);
72
+ });
73
+ /**
74
+ * @since 1.0.0
75
+ * @category models
76
+ */
77
+ export class KMSService extends Effect.Tag("@effect-aws/client-kms/KMSService")() {
78
+ static defaultLayer = Layer.effect(this, makeKMSService).pipe(Layer.provide(Instance.layer));
79
+ static layer = (config) => Layer.effect(this, makeKMSService).pipe(Layer.provide(Instance.layer), Layer.provide(KMSServiceConfig.setKMSServiceConfig(config)));
80
+ static baseLayer = (evaluate) => Layer.effect(this, makeKMSService).pipe(Layer.provide(Layer.effect(Instance.KMSClientInstance, Effect.map(KMSServiceConfig.toKMSClientConfig, evaluate))));
81
+ }
82
+ //# sourceMappingURL=KMSService.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"KMSService.js","sourceRoot":"","sources":["../../src/KMSService.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO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EAAE,CACpD,KAAK,CAAC,MAAM,CAAC,IAAI,EAAE,cAAc,CAAC,CAAC,IAAI,CACrC,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,EAC7B,KAAK,CAAC,OAAO,CAAC,gBAAgB,CAAC,mBAAmB,CAAC,MAAM,CAAC,CAAC,CAC5D,CAAC;IACJ,MAAM,CAAU,SAAS,GAAG,CAC1B,QAAuD,EACvD,EAAE,CACF,KAAK,CAAC,MAAM,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 kms service config
8
+ */
9
+ const currentKMSServiceConfig = globalValue("@effect-aws/client-kms/currentKMSServiceConfig", () => FiberRef.unsafeMake({}));
10
+ /**
11
+ * @since 1.0.0
12
+ * @category kms service config
13
+ */
14
+ export const withKMSServiceConfig = dual(2, (effect, config) => Effect.locally(effect, currentKMSServiceConfig, config));
15
+ /**
16
+ * @since 1.0.0
17
+ * @category kms service config
18
+ */
19
+ export const setKMSServiceConfig = (config) => Layer.locallyScoped(currentKMSServiceConfig, config);
20
+ /**
21
+ * @since 1.0.0
22
+ * @category adapters
23
+ */
24
+ export const toKMSClientConfig = Effect.gen(function* () {
25
+ const { logger: serviceLogger, ...config } = yield* FiberRef.get(currentKMSServiceConfig);
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=KMSServiceConfig.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"KMSServiceConfig.js","sourceRoot":"","sources":["../../src/KMSServiceConfig.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 { KMSService } from "./KMSService.js";
5
+ /**
6
+ * @since 1.0.0
7
+ */
8
+ export * from "./Errors.js";
9
+ /**
10
+ * @since 1.0.0
11
+ */
12
+ export * as KMSClientInstance from "./KMSClientInstance.js";
13
+ /**
14
+ * @since 1.0.0
15
+ */
16
+ export * as KMSServiceConfig from "./KMSServiceConfig.js";
17
+ /**
18
+ * @since 1.0.0
19
+ */
20
+ export * from "./KMSService.js";
21
+ /**
22
+ * @since 1.0.0
23
+ * @category exports
24
+ * @alias KMSService
25
+ */
26
+ export const KMS = KMSService;
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-kms",
3
+ "version": "1.9.0",
4
+ "description": "Effectful AWS KMS client",
5
+ "license": "MIT",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "github:floydspace/effect-aws",
9
+ "directory": "packages/client-kms"
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-kms",
17
+ "dependencies": {
18
+ "@aws-sdk/client-kms": "^3",
19
+ "@effect-aws/commons": "^0.1.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-kms": "^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
+ "./KMSClientInstance": {
40
+ "types": "./dist/dts/KMSClientInstance.d.ts",
41
+ "import": "./dist/esm/KMSClientInstance.js",
42
+ "default": "./dist/cjs/KMSClientInstance.js"
43
+ },
44
+ "./KMSService": {
45
+ "types": "./dist/dts/KMSService.d.ts",
46
+ "import": "./dist/esm/KMSService.js",
47
+ "default": "./dist/cjs/KMSService.js"
48
+ },
49
+ "./KMSServiceConfig": {
50
+ "types": "./dist/dts/KMSServiceConfig.d.ts",
51
+ "import": "./dist/esm/KMSServiceConfig.js",
52
+ "default": "./dist/cjs/KMSServiceConfig.js"
53
+ }
35
54
  },
36
- "version": "1.1.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
+ "KMSClientInstance": [
61
+ "./dist/dts/KMSClientInstance.d.ts"
62
+ ],
63
+ "KMSService": [
64
+ "./dist/dts/KMSService.d.ts"
65
+ ],
66
+ "KMSServiceConfig": [
67
+ "./dist/dts/KMSServiceConfig.d.ts"
68
+ ]
69
+ }
53
70
  }
54
71
  }
package/src/Errors.ts ADDED
@@ -0,0 +1,159 @@
1
+ import type {
2
+ AlreadyExistsException,
3
+ CloudHsmClusterInUseException,
4
+ CloudHsmClusterInvalidConfigurationException,
5
+ CloudHsmClusterNotActiveException,
6
+ CloudHsmClusterNotFoundException,
7
+ CloudHsmClusterNotRelatedException,
8
+ ConflictException,
9
+ CustomKeyStoreHasCMKsException,
10
+ CustomKeyStoreInvalidStateException,
11
+ CustomKeyStoreNameInUseException,
12
+ CustomKeyStoreNotFoundException,
13
+ DependencyTimeoutException,
14
+ DisabledException,
15
+ DryRunOperationException,
16
+ ExpiredImportTokenException,
17
+ IncorrectKeyException,
18
+ IncorrectKeyMaterialException,
19
+ IncorrectTrustAnchorException,
20
+ InvalidAliasNameException,
21
+ InvalidArnException,
22
+ InvalidCiphertextException,
23
+ InvalidGrantIdException,
24
+ InvalidGrantTokenException,
25
+ InvalidImportTokenException,
26
+ InvalidKeyUsageException,
27
+ InvalidMarkerException,
28
+ KeyUnavailableException,
29
+ KMSInternalException,
30
+ KMSInvalidMacException,
31
+ KMSInvalidSignatureException,
32
+ KMSInvalidStateException,
33
+ LimitExceededException,
34
+ MalformedPolicyDocumentException,
35
+ NotFoundException,
36
+ TagException,
37
+ UnsupportedOperationException,
38
+ XksKeyAlreadyInUseException,
39
+ XksKeyInvalidConfigurationException,
40
+ XksKeyNotFoundException,
41
+ XksProxyIncorrectAuthenticationCredentialException,
42
+ XksProxyInvalidConfigurationException,
43
+ XksProxyInvalidResponseException,
44
+ XksProxyUriEndpointInUseException,
45
+ XksProxyUriInUseException,
46
+ XksProxyUriUnreachableException,
47
+ XksProxyVpcEndpointServiceInUseException,
48
+ XksProxyVpcEndpointServiceInvalidConfigurationException,
49
+ XksProxyVpcEndpointServiceNotFoundException,
50
+ } from "@aws-sdk/client-kms";
51
+ import type { TaggedException } from "@effect-aws/commons";
52
+ import { SdkError as CommonSdkError } from "@effect-aws/commons";
53
+
54
+ export const AllServiceErrors = [
55
+ "AlreadyExistsException",
56
+ "CloudHsmClusterInUseException",
57
+ "CloudHsmClusterInvalidConfigurationException",
58
+ "CloudHsmClusterNotActiveException",
59
+ "CloudHsmClusterNotFoundException",
60
+ "CloudHsmClusterNotRelatedException",
61
+ "ConflictException",
62
+ "CustomKeyStoreHasCMKsException",
63
+ "CustomKeyStoreInvalidStateException",
64
+ "CustomKeyStoreNameInUseException",
65
+ "CustomKeyStoreNotFoundException",
66
+ "DependencyTimeoutException",
67
+ "DisabledException",
68
+ "DryRunOperationException",
69
+ "ExpiredImportTokenException",
70
+ "IncorrectKeyException",
71
+ "IncorrectKeyMaterialException",
72
+ "IncorrectTrustAnchorException",
73
+ "InvalidAliasNameException",
74
+ "InvalidArnException",
75
+ "InvalidCiphertextException",
76
+ "InvalidGrantIdException",
77
+ "InvalidGrantTokenException",
78
+ "InvalidImportTokenException",
79
+ "InvalidKeyUsageException",
80
+ "InvalidMarkerException",
81
+ "KMSInternalException",
82
+ "KMSInvalidMacException",
83
+ "KMSInvalidSignatureException",
84
+ "KMSInvalidStateException",
85
+ "KeyUnavailableException",
86
+ "LimitExceededException",
87
+ "MalformedPolicyDocumentException",
88
+ "NotFoundException",
89
+ "TagException",
90
+ "UnsupportedOperationException",
91
+ "XksKeyAlreadyInUseException",
92
+ "XksKeyInvalidConfigurationException",
93
+ "XksKeyNotFoundException",
94
+ "XksProxyIncorrectAuthenticationCredentialException",
95
+ "XksProxyInvalidConfigurationException",
96
+ "XksProxyInvalidResponseException",
97
+ "XksProxyUriEndpointInUseException",
98
+ "XksProxyUriInUseException",
99
+ "XksProxyUriUnreachableException",
100
+ "XksProxyVpcEndpointServiceInUseException",
101
+ "XksProxyVpcEndpointServiceInvalidConfigurationException",
102
+ "XksProxyVpcEndpointServiceNotFoundException",
103
+ ] as const;
104
+
105
+ export type AlreadyExistsError = TaggedException<AlreadyExistsException>;
106
+ export type CloudHsmClusterInUseError = TaggedException<CloudHsmClusterInUseException>;
107
+ export type CloudHsmClusterInvalidConfigurationError = TaggedException<CloudHsmClusterInvalidConfigurationException>;
108
+ export type CloudHsmClusterNotActiveError = TaggedException<CloudHsmClusterNotActiveException>;
109
+ export type CloudHsmClusterNotFoundError = TaggedException<CloudHsmClusterNotFoundException>;
110
+ export type CloudHsmClusterNotRelatedError = TaggedException<CloudHsmClusterNotRelatedException>;
111
+ export type ConflictError = TaggedException<ConflictException>;
112
+ export type CustomKeyStoreHasCMKsError = TaggedException<CustomKeyStoreHasCMKsException>;
113
+ export type CustomKeyStoreInvalidStateError = TaggedException<CustomKeyStoreInvalidStateException>;
114
+ export type CustomKeyStoreNameInUseError = TaggedException<CustomKeyStoreNameInUseException>;
115
+ export type CustomKeyStoreNotFoundError = TaggedException<CustomKeyStoreNotFoundException>;
116
+ export type DependencyTimeoutError = TaggedException<DependencyTimeoutException>;
117
+ export type DisabledError = TaggedException<DisabledException>;
118
+ export type DryRunOperationError = TaggedException<DryRunOperationException>;
119
+ export type ExpiredImportTokenError = TaggedException<ExpiredImportTokenException>;
120
+ export type IncorrectKeyError = TaggedException<IncorrectKeyException>;
121
+ export type IncorrectKeyMaterialError = TaggedException<IncorrectKeyMaterialException>;
122
+ export type IncorrectTrustAnchorError = TaggedException<IncorrectTrustAnchorException>;
123
+ export type InvalidAliasNameError = TaggedException<InvalidAliasNameException>;
124
+ export type InvalidArnError = TaggedException<InvalidArnException>;
125
+ export type InvalidCiphertextError = TaggedException<InvalidCiphertextException>;
126
+ export type InvalidGrantIdError = TaggedException<InvalidGrantIdException>;
127
+ export type InvalidGrantTokenError = TaggedException<InvalidGrantTokenException>;
128
+ export type InvalidImportTokenError = TaggedException<InvalidImportTokenException>;
129
+ export type InvalidKeyUsageError = TaggedException<InvalidKeyUsageException>;
130
+ export type InvalidMarkerError = TaggedException<InvalidMarkerException>;
131
+ export type KMSInternalError = TaggedException<KMSInternalException>;
132
+ export type KMSInvalidMacError = TaggedException<KMSInvalidMacException>;
133
+ export type KMSInvalidSignatureError = TaggedException<KMSInvalidSignatureException>;
134
+ export type KMSInvalidStateError = TaggedException<KMSInvalidStateException>;
135
+ export type KeyUnavailableError = TaggedException<KeyUnavailableException>;
136
+ export type LimitExceededError = TaggedException<LimitExceededException>;
137
+ export type MalformedPolicyDocumentError = TaggedException<MalformedPolicyDocumentException>;
138
+ export type NotFoundError = TaggedException<NotFoundException>;
139
+ export type TagError = TaggedException<TagException>;
140
+ export type UnsupportedOperationError = TaggedException<UnsupportedOperationException>;
141
+ export type XksKeyAlreadyInUseError = TaggedException<XksKeyAlreadyInUseException>;
142
+ export type XksKeyInvalidConfigurationError = TaggedException<XksKeyInvalidConfigurationException>;
143
+ export type XksKeyNotFoundError = TaggedException<XksKeyNotFoundException>;
144
+ export type XksProxyIncorrectAuthenticationCredentialError = TaggedException<
145
+ XksProxyIncorrectAuthenticationCredentialException
146
+ >;
147
+ export type XksProxyInvalidConfigurationError = TaggedException<XksProxyInvalidConfigurationException>;
148
+ export type XksProxyInvalidResponseError = TaggedException<XksProxyInvalidResponseException>;
149
+ export type XksProxyUriEndpointInUseError = TaggedException<XksProxyUriEndpointInUseException>;
150
+ export type XksProxyUriInUseError = TaggedException<XksProxyUriInUseException>;
151
+ export type XksProxyUriUnreachableError = TaggedException<XksProxyUriUnreachableException>;
152
+ export type XksProxyVpcEndpointServiceInUseError = TaggedException<XksProxyVpcEndpointServiceInUseException>;
153
+ export type XksProxyVpcEndpointServiceInvalidConfigurationError = TaggedException<
154
+ XksProxyVpcEndpointServiceInvalidConfigurationException
155
+ >;
156
+ export type XksProxyVpcEndpointServiceNotFoundError = TaggedException<XksProxyVpcEndpointServiceNotFoundException>;
157
+
158
+ export type SdkError = CommonSdkError;
159
+ export const SdkError = CommonSdkError;
@@ -0,0 +1,33 @@
1
+ /**
2
+ * @since 1.0.0
3
+ */
4
+ import { KMSClient } from "@aws-sdk/client-kms";
5
+ import { Context, Effect, Layer } from "effect";
6
+ import * as KMSServiceConfig from "./KMSServiceConfig.js";
7
+
8
+ /**
9
+ * @since 1.0.0
10
+ * @category tags
11
+ */
12
+ export class KMSClientInstance extends Context.Tag(
13
+ "@effect-aws/client-kms/KMSClientInstance",
14
+ )<KMSClientInstance, KMSClient>() {}
15
+
16
+ /**
17
+ * @since 1.0.0
18
+ * @category constructors
19
+ */
20
+ export const make = Effect.flatMap(
21
+ KMSServiceConfig.toKMSClientConfig,
22
+ (config) =>
23
+ Effect.acquireRelease(
24
+ Effect.sync(() => new KMSClient(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(KMSClientInstance, make);