@effect-aws/client-secrets-manager 1.4.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/SecretsManagerClientInstance/package.json +6 -0
  3. package/SecretsManagerService/package.json +6 -0
  4. package/SecretsManagerServiceConfig/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 +20 -0
  8. package/dist/cjs/Errors.js.map +1 -0
  9. package/dist/cjs/SecretsManagerClientInstance.d.ts +24 -0
  10. package/dist/cjs/SecretsManagerClientInstance.d.ts.map +1 -0
  11. package/dist/cjs/SecretsManagerClientInstance.js +50 -0
  12. package/dist/cjs/SecretsManagerClientInstance.js.map +1 -0
  13. package/{lib → dist/cjs}/SecretsManagerService.d.ts +16 -38
  14. package/dist/cjs/SecretsManagerService.d.ts.map +1 -0
  15. package/dist/cjs/SecretsManagerService.js +79 -0
  16. package/dist/cjs/SecretsManagerService.js.map +1 -0
  17. package/dist/cjs/SecretsManagerServiceConfig.d.ts +25 -0
  18. package/dist/cjs/SecretsManagerServiceConfig.d.ts.map +1 -0
  19. package/dist/cjs/SecretsManagerServiceConfig.js +35 -0
  20. package/dist/cjs/SecretsManagerServiceConfig.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 +19 -0
  26. package/dist/dts/Errors.d.ts.map +1 -0
  27. package/dist/dts/SecretsManagerClientInstance.d.ts +24 -0
  28. package/dist/dts/SecretsManagerClientInstance.d.ts.map +1 -0
  29. package/dist/dts/SecretsManagerService.d.ts +158 -0
  30. package/dist/dts/SecretsManagerService.d.ts.map +1 -0
  31. package/dist/dts/SecretsManagerServiceConfig.d.ts +25 -0
  32. package/dist/dts/SecretsManagerServiceConfig.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 +17 -0
  36. package/dist/esm/Errors.js.map +1 -0
  37. package/dist/esm/SecretsManagerClientInstance.js +23 -0
  38. package/dist/esm/SecretsManagerClientInstance.js.map +1 -0
  39. package/dist/esm/SecretsManagerService.js +52 -0
  40. package/dist/esm/SecretsManagerService.js.map +1 -0
  41. package/dist/esm/SecretsManagerServiceConfig.js +31 -0
  42. package/dist/esm/SecretsManagerServiceConfig.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 +47 -0
  48. package/src/SecretsManagerClientInstance.ts +33 -0
  49. package/src/SecretsManagerService.ts +483 -0
  50. package/src/SecretsManagerServiceConfig.ts +52 -0
  51. package/src/index.ts +44 -0
  52. package/CHANGELOG.md +0 -37
  53. package/docgen.json +0 -8
  54. package/lib/Errors.js +0 -20
  55. package/lib/SecretsManagerClientInstance.d.ts +0 -31
  56. package/lib/SecretsManagerClientInstance.js +0 -57
  57. package/lib/SecretsManagerClientInstanceConfig.d.ts +0 -23
  58. package/lib/SecretsManagerClientInstanceConfig.js +0 -44
  59. package/lib/SecretsManagerService.js +0 -111
  60. package/lib/esm/Errors.js +0 -17
  61. package/lib/esm/SecretsManagerClientInstance.js +0 -30
  62. package/lib/esm/SecretsManagerClientInstanceConfig.js +0 -40
  63. package/lib/esm/SecretsManagerService.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,33 @@
1
+ /**
2
+ * @since 1.0.0
3
+ */
4
+ import { SecretsManagerClient } from "@aws-sdk/client-secrets-manager";
5
+ import { Context, Effect, Layer } from "effect";
6
+ import * as SecretsManagerServiceConfig from "./SecretsManagerServiceConfig.js";
7
+
8
+ /**
9
+ * @since 1.0.0
10
+ * @category tags
11
+ */
12
+ export class SecretsManagerClientInstance extends Context.Tag(
13
+ "@effect-aws/client-secrets-manager/SecretsManagerClientInstance",
14
+ )<SecretsManagerClientInstance, SecretsManagerClient>() {}
15
+
16
+ /**
17
+ * @since 1.0.0
18
+ * @category constructors
19
+ */
20
+ export const make = Effect.flatMap(
21
+ SecretsManagerServiceConfig.toSecretsManagerClientConfig,
22
+ (config) =>
23
+ Effect.acquireRelease(
24
+ Effect.sync(() => new SecretsManagerClient(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(SecretsManagerClientInstance, make);
@@ -0,0 +1,483 @@
1
+ /**
2
+ * @since 1.0.0
3
+ */
4
+ import {
5
+ BatchGetSecretValueCommand,
6
+ type BatchGetSecretValueCommandInput,
7
+ type BatchGetSecretValueCommandOutput,
8
+ CancelRotateSecretCommand,
9
+ type CancelRotateSecretCommandInput,
10
+ type CancelRotateSecretCommandOutput,
11
+ CreateSecretCommand,
12
+ type CreateSecretCommandInput,
13
+ type CreateSecretCommandOutput,
14
+ DeleteResourcePolicyCommand,
15
+ type DeleteResourcePolicyCommandInput,
16
+ type DeleteResourcePolicyCommandOutput,
17
+ DeleteSecretCommand,
18
+ type DeleteSecretCommandInput,
19
+ type DeleteSecretCommandOutput,
20
+ DescribeSecretCommand,
21
+ type DescribeSecretCommandInput,
22
+ type DescribeSecretCommandOutput,
23
+ GetRandomPasswordCommand,
24
+ type GetRandomPasswordCommandInput,
25
+ type GetRandomPasswordCommandOutput,
26
+ GetResourcePolicyCommand,
27
+ type GetResourcePolicyCommandInput,
28
+ type GetResourcePolicyCommandOutput,
29
+ GetSecretValueCommand,
30
+ type GetSecretValueCommandInput,
31
+ type GetSecretValueCommandOutput,
32
+ ListSecretsCommand,
33
+ type ListSecretsCommandInput,
34
+ type ListSecretsCommandOutput,
35
+ ListSecretVersionIdsCommand,
36
+ type ListSecretVersionIdsCommandInput,
37
+ type ListSecretVersionIdsCommandOutput,
38
+ PutResourcePolicyCommand,
39
+ type PutResourcePolicyCommandInput,
40
+ type PutResourcePolicyCommandOutput,
41
+ PutSecretValueCommand,
42
+ type PutSecretValueCommandInput,
43
+ type PutSecretValueCommandOutput,
44
+ RemoveRegionsFromReplicationCommand,
45
+ type RemoveRegionsFromReplicationCommandInput,
46
+ type RemoveRegionsFromReplicationCommandOutput,
47
+ ReplicateSecretToRegionsCommand,
48
+ type ReplicateSecretToRegionsCommandInput,
49
+ type ReplicateSecretToRegionsCommandOutput,
50
+ RestoreSecretCommand,
51
+ type RestoreSecretCommandInput,
52
+ type RestoreSecretCommandOutput,
53
+ RotateSecretCommand,
54
+ type RotateSecretCommandInput,
55
+ type RotateSecretCommandOutput,
56
+ type SecretsManagerClient,
57
+ type SecretsManagerClientConfig,
58
+ StopReplicationToReplicaCommand,
59
+ type StopReplicationToReplicaCommandInput,
60
+ type StopReplicationToReplicaCommandOutput,
61
+ TagResourceCommand,
62
+ type TagResourceCommandInput,
63
+ type TagResourceCommandOutput,
64
+ UntagResourceCommand,
65
+ type UntagResourceCommandInput,
66
+ type UntagResourceCommandOutput,
67
+ UpdateSecretCommand,
68
+ type UpdateSecretCommandInput,
69
+ type UpdateSecretCommandOutput,
70
+ UpdateSecretVersionStageCommand,
71
+ type UpdateSecretVersionStageCommandInput,
72
+ type UpdateSecretVersionStageCommandOutput,
73
+ ValidateResourcePolicyCommand,
74
+ type ValidateResourcePolicyCommandInput,
75
+ type ValidateResourcePolicyCommandOutput,
76
+ } from "@aws-sdk/client-secrets-manager";
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
+ DecryptionError,
82
+ EncryptionError,
83
+ InternalServiceError,
84
+ InvalidNextTokenError,
85
+ InvalidParameterError,
86
+ InvalidRequestError,
87
+ LimitExceededError,
88
+ MalformedPolicyDocumentError,
89
+ PreconditionNotMetError,
90
+ PublicPolicyError,
91
+ ResourceExistsError,
92
+ ResourceNotFoundError,
93
+ } from "./Errors.js";
94
+ import { AllServiceErrors } from "./Errors.js";
95
+ import * as Instance from "./SecretsManagerClientInstance.js";
96
+ import * as SecretsManagerServiceConfig from "./SecretsManagerServiceConfig.js";
97
+
98
+ const commands = {
99
+ BatchGetSecretValueCommand,
100
+ CancelRotateSecretCommand,
101
+ CreateSecretCommand,
102
+ DeleteResourcePolicyCommand,
103
+ DeleteSecretCommand,
104
+ DescribeSecretCommand,
105
+ GetRandomPasswordCommand,
106
+ GetResourcePolicyCommand,
107
+ GetSecretValueCommand,
108
+ ListSecretVersionIdsCommand,
109
+ ListSecretsCommand,
110
+ PutResourcePolicyCommand,
111
+ PutSecretValueCommand,
112
+ RemoveRegionsFromReplicationCommand,
113
+ ReplicateSecretToRegionsCommand,
114
+ RestoreSecretCommand,
115
+ RotateSecretCommand,
116
+ StopReplicationToReplicaCommand,
117
+ TagResourceCommand,
118
+ UntagResourceCommand,
119
+ UpdateSecretCommand,
120
+ UpdateSecretVersionStageCommand,
121
+ ValidateResourcePolicyCommand,
122
+ };
123
+
124
+ interface SecretsManagerService$ {
125
+ readonly _: unique symbol;
126
+
127
+ /**
128
+ * @see {@link BatchGetSecretValueCommand}
129
+ */
130
+ batchGetSecretValue(
131
+ args: BatchGetSecretValueCommandInput,
132
+ options?: HttpHandlerOptions,
133
+ ): Effect.Effect<
134
+ BatchGetSecretValueCommandOutput,
135
+ | SdkError
136
+ | DecryptionError
137
+ | InternalServiceError
138
+ | InvalidNextTokenError
139
+ | InvalidParameterError
140
+ | InvalidRequestError
141
+ | ResourceNotFoundError
142
+ >;
143
+
144
+ /**
145
+ * @see {@link CancelRotateSecretCommand}
146
+ */
147
+ cancelRotateSecret(
148
+ args: CancelRotateSecretCommandInput,
149
+ options?: HttpHandlerOptions,
150
+ ): Effect.Effect<
151
+ CancelRotateSecretCommandOutput,
152
+ SdkError | InternalServiceError | InvalidParameterError | InvalidRequestError | ResourceNotFoundError
153
+ >;
154
+
155
+ /**
156
+ * @see {@link CreateSecretCommand}
157
+ */
158
+ createSecret(
159
+ args: CreateSecretCommandInput,
160
+ options?: HttpHandlerOptions,
161
+ ): Effect.Effect<
162
+ CreateSecretCommandOutput,
163
+ | SdkError
164
+ | DecryptionError
165
+ | EncryptionError
166
+ | InternalServiceError
167
+ | InvalidParameterError
168
+ | InvalidRequestError
169
+ | LimitExceededError
170
+ | MalformedPolicyDocumentError
171
+ | PreconditionNotMetError
172
+ | ResourceExistsError
173
+ | ResourceNotFoundError
174
+ >;
175
+
176
+ /**
177
+ * @see {@link DeleteResourcePolicyCommand}
178
+ */
179
+ deleteResourcePolicy(
180
+ args: DeleteResourcePolicyCommandInput,
181
+ options?: HttpHandlerOptions,
182
+ ): Effect.Effect<
183
+ DeleteResourcePolicyCommandOutput,
184
+ SdkError | InternalServiceError | InvalidParameterError | InvalidRequestError | ResourceNotFoundError
185
+ >;
186
+
187
+ /**
188
+ * @see {@link DeleteSecretCommand}
189
+ */
190
+ deleteSecret(
191
+ args: DeleteSecretCommandInput,
192
+ options?: HttpHandlerOptions,
193
+ ): Effect.Effect<
194
+ DeleteSecretCommandOutput,
195
+ SdkError | InternalServiceError | InvalidParameterError | InvalidRequestError | ResourceNotFoundError
196
+ >;
197
+
198
+ /**
199
+ * @see {@link DescribeSecretCommand}
200
+ */
201
+ describeSecret(
202
+ args: DescribeSecretCommandInput,
203
+ options?: HttpHandlerOptions,
204
+ ): Effect.Effect<
205
+ DescribeSecretCommandOutput,
206
+ SdkError | InternalServiceError | InvalidParameterError | ResourceNotFoundError
207
+ >;
208
+
209
+ /**
210
+ * @see {@link GetRandomPasswordCommand}
211
+ */
212
+ getRandomPassword(
213
+ args: GetRandomPasswordCommandInput,
214
+ options?: HttpHandlerOptions,
215
+ ): Effect.Effect<
216
+ GetRandomPasswordCommandOutput,
217
+ SdkError | InternalServiceError | InvalidParameterError | InvalidRequestError
218
+ >;
219
+
220
+ /**
221
+ * @see {@link GetResourcePolicyCommand}
222
+ */
223
+ getResourcePolicy(
224
+ args: GetResourcePolicyCommandInput,
225
+ options?: HttpHandlerOptions,
226
+ ): Effect.Effect<
227
+ GetResourcePolicyCommandOutput,
228
+ SdkError | InternalServiceError | InvalidParameterError | InvalidRequestError | ResourceNotFoundError
229
+ >;
230
+
231
+ /**
232
+ * @see {@link GetSecretValueCommand}
233
+ */
234
+ getSecretValue(
235
+ args: GetSecretValueCommandInput,
236
+ options?: HttpHandlerOptions,
237
+ ): Effect.Effect<
238
+ GetSecretValueCommandOutput,
239
+ | SdkError
240
+ | DecryptionError
241
+ | InternalServiceError
242
+ | InvalidParameterError
243
+ | InvalidRequestError
244
+ | ResourceNotFoundError
245
+ >;
246
+
247
+ /**
248
+ * @see {@link ListSecretVersionIdsCommand}
249
+ */
250
+ listSecretVersionIds(
251
+ args: ListSecretVersionIdsCommandInput,
252
+ options?: HttpHandlerOptions,
253
+ ): Effect.Effect<
254
+ ListSecretVersionIdsCommandOutput,
255
+ SdkError | InternalServiceError | InvalidNextTokenError | InvalidParameterError | ResourceNotFoundError
256
+ >;
257
+
258
+ /**
259
+ * @see {@link ListSecretsCommand}
260
+ */
261
+ listSecrets(
262
+ args: ListSecretsCommandInput,
263
+ options?: HttpHandlerOptions,
264
+ ): Effect.Effect<
265
+ ListSecretsCommandOutput,
266
+ SdkError | InternalServiceError | InvalidNextTokenError | InvalidParameterError | InvalidRequestError
267
+ >;
268
+
269
+ /**
270
+ * @see {@link PutResourcePolicyCommand}
271
+ */
272
+ putResourcePolicy(
273
+ args: PutResourcePolicyCommandInput,
274
+ options?: HttpHandlerOptions,
275
+ ): Effect.Effect<
276
+ PutResourcePolicyCommandOutput,
277
+ | SdkError
278
+ | InternalServiceError
279
+ | InvalidParameterError
280
+ | InvalidRequestError
281
+ | MalformedPolicyDocumentError
282
+ | PublicPolicyError
283
+ | ResourceNotFoundError
284
+ >;
285
+
286
+ /**
287
+ * @see {@link PutSecretValueCommand}
288
+ */
289
+ putSecretValue(
290
+ args: PutSecretValueCommandInput,
291
+ options?: HttpHandlerOptions,
292
+ ): Effect.Effect<
293
+ PutSecretValueCommandOutput,
294
+ | SdkError
295
+ | DecryptionError
296
+ | EncryptionError
297
+ | InternalServiceError
298
+ | InvalidParameterError
299
+ | InvalidRequestError
300
+ | LimitExceededError
301
+ | ResourceExistsError
302
+ | ResourceNotFoundError
303
+ >;
304
+
305
+ /**
306
+ * @see {@link RemoveRegionsFromReplicationCommand}
307
+ */
308
+ removeRegionsFromReplication(
309
+ args: RemoveRegionsFromReplicationCommandInput,
310
+ options?: HttpHandlerOptions,
311
+ ): Effect.Effect<
312
+ RemoveRegionsFromReplicationCommandOutput,
313
+ SdkError | InternalServiceError | InvalidParameterError | InvalidRequestError | ResourceNotFoundError
314
+ >;
315
+
316
+ /**
317
+ * @see {@link ReplicateSecretToRegionsCommand}
318
+ */
319
+ replicateSecretToRegions(
320
+ args: ReplicateSecretToRegionsCommandInput,
321
+ options?: HttpHandlerOptions,
322
+ ): Effect.Effect<
323
+ ReplicateSecretToRegionsCommandOutput,
324
+ SdkError | InternalServiceError | InvalidParameterError | InvalidRequestError | ResourceNotFoundError
325
+ >;
326
+
327
+ /**
328
+ * @see {@link RestoreSecretCommand}
329
+ */
330
+ restoreSecret(
331
+ args: RestoreSecretCommandInput,
332
+ options?: HttpHandlerOptions,
333
+ ): Effect.Effect<
334
+ RestoreSecretCommandOutput,
335
+ SdkError | InternalServiceError | InvalidParameterError | InvalidRequestError | ResourceNotFoundError
336
+ >;
337
+
338
+ /**
339
+ * @see {@link RotateSecretCommand}
340
+ */
341
+ rotateSecret(
342
+ args: RotateSecretCommandInput,
343
+ options?: HttpHandlerOptions,
344
+ ): Effect.Effect<
345
+ RotateSecretCommandOutput,
346
+ SdkError | InternalServiceError | InvalidParameterError | InvalidRequestError | ResourceNotFoundError
347
+ >;
348
+
349
+ /**
350
+ * @see {@link StopReplicationToReplicaCommand}
351
+ */
352
+ stopReplicationToReplica(
353
+ args: StopReplicationToReplicaCommandInput,
354
+ options?: HttpHandlerOptions,
355
+ ): Effect.Effect<
356
+ StopReplicationToReplicaCommandOutput,
357
+ SdkError | InternalServiceError | InvalidParameterError | InvalidRequestError | ResourceNotFoundError
358
+ >;
359
+
360
+ /**
361
+ * @see {@link TagResourceCommand}
362
+ */
363
+ tagResource(
364
+ args: TagResourceCommandInput,
365
+ options?: HttpHandlerOptions,
366
+ ): Effect.Effect<
367
+ TagResourceCommandOutput,
368
+ SdkError | InternalServiceError | InvalidParameterError | InvalidRequestError | ResourceNotFoundError
369
+ >;
370
+
371
+ /**
372
+ * @see {@link UntagResourceCommand}
373
+ */
374
+ untagResource(
375
+ args: UntagResourceCommandInput,
376
+ options?: HttpHandlerOptions,
377
+ ): Effect.Effect<
378
+ UntagResourceCommandOutput,
379
+ SdkError | InternalServiceError | InvalidParameterError | InvalidRequestError | ResourceNotFoundError
380
+ >;
381
+
382
+ /**
383
+ * @see {@link UpdateSecretCommand}
384
+ */
385
+ updateSecret(
386
+ args: UpdateSecretCommandInput,
387
+ options?: HttpHandlerOptions,
388
+ ): Effect.Effect<
389
+ UpdateSecretCommandOutput,
390
+ | SdkError
391
+ | DecryptionError
392
+ | EncryptionError
393
+ | InternalServiceError
394
+ | InvalidParameterError
395
+ | InvalidRequestError
396
+ | LimitExceededError
397
+ | MalformedPolicyDocumentError
398
+ | PreconditionNotMetError
399
+ | ResourceExistsError
400
+ | ResourceNotFoundError
401
+ >;
402
+
403
+ /**
404
+ * @see {@link UpdateSecretVersionStageCommand}
405
+ */
406
+ updateSecretVersionStage(
407
+ args: UpdateSecretVersionStageCommandInput,
408
+ options?: HttpHandlerOptions,
409
+ ): Effect.Effect<
410
+ UpdateSecretVersionStageCommandOutput,
411
+ | SdkError
412
+ | InternalServiceError
413
+ | InvalidParameterError
414
+ | InvalidRequestError
415
+ | LimitExceededError
416
+ | ResourceNotFoundError
417
+ >;
418
+
419
+ /**
420
+ * @see {@link ValidateResourcePolicyCommand}
421
+ */
422
+ validateResourcePolicy(
423
+ args: ValidateResourcePolicyCommandInput,
424
+ options?: HttpHandlerOptions,
425
+ ): Effect.Effect<
426
+ ValidateResourcePolicyCommandOutput,
427
+ | SdkError
428
+ | InternalServiceError
429
+ | InvalidParameterError
430
+ | InvalidRequestError
431
+ | MalformedPolicyDocumentError
432
+ | ResourceNotFoundError
433
+ >;
434
+ }
435
+
436
+ /**
437
+ * @since 1.0.0
438
+ * @category constructors
439
+ */
440
+ export const makeSecretsManagerService = Effect.gen(function*() {
441
+ const client = yield* Instance.SecretsManagerClientInstance;
442
+
443
+ return Service.fromClientAndCommands<SecretsManagerService$>(client, commands, AllServiceErrors);
444
+ });
445
+
446
+ /**
447
+ * @since 1.0.0
448
+ * @category models
449
+ */
450
+ export class SecretsManagerService extends Effect.Tag("@effect-aws/client-secrets-manager/SecretsManagerService")<
451
+ SecretsManagerService,
452
+ SecretsManagerService$
453
+ >() {
454
+ static readonly defaultLayer = Layer.effect(this, makeSecretsManagerService).pipe(Layer.provide(Instance.layer));
455
+ static readonly layer = (config: SecretsManagerService.Config) =>
456
+ Layer.effect(this, makeSecretsManagerService).pipe(
457
+ Layer.provide(Instance.layer),
458
+ Layer.provide(SecretsManagerServiceConfig.setSecretsManagerServiceConfig(config)),
459
+ );
460
+ static readonly baseLayer = (
461
+ evaluate: (defaultConfig: SecretsManagerClientConfig) => SecretsManagerClient,
462
+ ) =>
463
+ Layer.effect(this, makeSecretsManagerService).pipe(
464
+ Layer.provide(
465
+ Layer.effect(
466
+ Instance.SecretsManagerClientInstance,
467
+ Effect.map(SecretsManagerServiceConfig.toSecretsManagerClientConfig, evaluate),
468
+ ),
469
+ ),
470
+ );
471
+ }
472
+
473
+ /**
474
+ * @since 1.0.0
475
+ */
476
+ export declare namespace SecretsManagerService {
477
+ /**
478
+ * @since 1.0.0
479
+ */
480
+ export interface Config extends Omit<SecretsManagerClientConfig, "logger"> {
481
+ readonly logger?: ServiceLogger.ServiceLoggerConstructorProps | true;
482
+ }
483
+ }
@@ -0,0 +1,52 @@
1
+ /**
2
+ * @since 1.0.0
3
+ */
4
+ import type { SecretsManagerClientConfig } from "@aws-sdk/client-secrets-manager";
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 { SecretsManagerService } from "./SecretsManagerService.js";
10
+
11
+ /**
12
+ * @since 1.0.0
13
+ * @category secrets-manager service config
14
+ */
15
+ const currentSecretsManagerServiceConfig = globalValue(
16
+ "@effect-aws/client-secrets-manager/currentSecretsManagerServiceConfig",
17
+ () => FiberRef.unsafeMake<SecretsManagerService.Config>({}),
18
+ );
19
+
20
+ /**
21
+ * @since 1.0.0
22
+ * @category secrets-manager service config
23
+ */
24
+ export const withSecretsManagerServiceConfig: {
25
+ (config: SecretsManagerService.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: SecretsManagerService.Config): Effect.Effect<A, E, R>;
27
+ } = dual(
28
+ 2,
29
+ <A, E, R>(effect: Effect.Effect<A, E, R>, config: SecretsManagerService.Config): Effect.Effect<A, E, R> =>
30
+ Effect.locally(effect, currentSecretsManagerServiceConfig, config),
31
+ );
32
+
33
+ /**
34
+ * @since 1.0.0
35
+ * @category secrets-manager service config
36
+ */
37
+ export const setSecretsManagerServiceConfig = (config: SecretsManagerService.Config) =>
38
+ Layer.locallyScoped(currentSecretsManagerServiceConfig, config);
39
+
40
+ /**
41
+ * @since 1.0.0
42
+ * @category adapters
43
+ */
44
+ export const toSecretsManagerClientConfig: Effect.Effect<SecretsManagerClientConfig> = Effect.gen(function*() {
45
+ const { logger: serviceLogger, ...config } = yield* FiberRef.get(currentSecretsManagerServiceConfig);
46
+
47
+ const logger = serviceLogger === true
48
+ ? yield* ServiceLogger.toClientLogger(ServiceLogger.defaultServiceLogger)
49
+ : (serviceLogger ? yield* ServiceLogger.toClientLogger(ServiceLogger.make(serviceLogger)) : undefined);
50
+
51
+ return { logger, ...config };
52
+ });
package/src/index.ts ADDED
@@ -0,0 +1,44 @@
1
+ /**
2
+ * @since 1.0.0
3
+ */
4
+ import { SecretsManagerService } from "./SecretsManagerService.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 SecretsManagerClientInstance from "./SecretsManagerClientInstance.js";
15
+
16
+ /**
17
+ * @since 1.0.0
18
+ */
19
+ export * as SecretsManagerServiceConfig from "./SecretsManagerServiceConfig.js";
20
+
21
+ /**
22
+ * @since 1.0.0
23
+ */
24
+ export * from "./SecretsManagerService.js";
25
+
26
+ /**
27
+ * @since 1.0.0
28
+ * @category exports
29
+ * @alias SecretsManagerService
30
+ */
31
+ export declare namespace SecretsManager {
32
+ /**
33
+ * @since 1.0.0
34
+ * @alias SecretsManagerService.Config
35
+ */
36
+ export type Config = SecretsManagerService.Config;
37
+ }
38
+
39
+ /**
40
+ * @since 1.0.0
41
+ * @category exports
42
+ * @alias SecretsManagerService
43
+ */
44
+ export const SecretsManager = SecretsManagerService;
package/CHANGELOG.md DELETED
@@ -1,37 +0,0 @@
1
- # @effect-aws/client-secrets-manager
2
-
3
- ## 1.4.0
4
-
5
- ### Minor Changes
6
-
7
- - [#93](https://github.com/floydspace/effect-aws/pull/93) [`a96fbd8`](https://github.com/floydspace/effect-aws/commit/a96fbd8840a7a6cfb795a2a6ab96aa32d32a3525) Thanks [@godu](https://github.com/godu)! - Destroy client after layer lifecycle to release idle connections.
8
-
9
- ## 1.3.0
10
-
11
- ### Minor Changes
12
-
13
- - [#80](https://github.com/floydspace/effect-aws/pull/80) [`4b16fbe`](https://github.com/floydspace/effect-aws/commit/4b16fbebce8131df7798ee92f43cf6b7df3e907c) Thanks [@floydspace](https://github.com/floydspace)! - simplify layers configuration (closes #78)
14
-
15
- ## 1.2.1
16
-
17
- ### Patch Changes
18
-
19
- - [#75](https://github.com/floydspace/effect-aws/pull/75) [`9dc170d`](https://github.com/floydspace/effect-aws/commit/9dc170d975c04888bbc7ca7b241b4b5265668fb5) Thanks [@godu](https://github.com/godu)! - export the HttpHandlerOptions type
20
-
21
- ## 1.2.0
22
-
23
- ### Minor Changes
24
-
25
- - [`e540420`](https://github.com/floydspace/effect-aws/commit/e5404208c2438e1e1546637a8edbbdc1c9468850) Thanks [@floydspace](https://github.com/floydspace)! - integrate aws-sdk abort signal with effect interruption
26
-
27
- ## 1.1.0
28
-
29
- ### Minor Changes
30
-
31
- - [#58](https://github.com/floydspace/effect-aws/pull/58) [`888dc8c`](https://github.com/floydspace/effect-aws/commit/888dc8ca0d7104e33a24426a1aacedb48e8fc3ac) Thanks [@floydspace](https://github.com/floydspace)! - use Effect.Tag instead of Context.GenericTag for service, handle only known errors
32
-
33
- ## 1.0.0
34
-
35
- ### Major Changes
36
-
37
- - [`ef7b1ce`](https://github.com/floydspace/effect-aws/commit/ef7b1ce2f5eee8dd5e2cf509da18e162fad8b22a) Thanks [@floydspace](https://github.com/floydspace)! - implement effectful secrets manager client
package/docgen.json DELETED
@@ -1,8 +0,0 @@
1
- {
2
- "$schema": "../../node_modules/@effect/docgen/schema.json",
3
- "exclude": [
4
- "src/index.ts",
5
- "src/Errors.ts"
6
- ],
7
- "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"npx projen\"."
8
- }
package/lib/Errors.js DELETED
@@ -1,20 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SdkError = exports.AllServiceErrors = void 0;
4
- const effect_1 = require("effect");
5
- exports.AllServiceErrors = [
6
- "DecryptionFailure",
7
- "EncryptionFailure",
8
- "InternalServiceError",
9
- "InvalidNextTokenException",
10
- "InvalidParameterException",
11
- "InvalidRequestException",
12
- "LimitExceededException",
13
- "MalformedPolicyDocumentException",
14
- "PreconditionNotMetException",
15
- "PublicPolicyException",
16
- "ResourceExistsException",
17
- "ResourceNotFoundException",
18
- ];
19
- exports.SdkError = effect_1.Data.tagged("SdkError");
20
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiRXJyb3JzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vc3JjL0Vycm9ycy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFjQSxtQ0FBOEI7QUFFakIsUUFBQSxnQkFBZ0IsR0FBRztJQUM5QixtQkFBbUI7SUFDbkIsbUJBQW1CO0lBQ25CLHNCQUFzQjtJQUN0QiwyQkFBMkI7SUFDM0IsMkJBQTJCO0lBQzNCLHlCQUF5QjtJQUN6Qix3QkFBd0I7SUFDeEIsa0NBQWtDO0lBQ2xDLDZCQUE2QjtJQUM3Qix1QkFBdUI7SUFDdkIseUJBQXlCO0lBQ3pCLDJCQUEyQjtDQUM1QixDQUFDO0FBc0JXLFFBQUEsUUFBUSxHQUFHLGFBQUksQ0FBQyxNQUFNLENBQVcsVUFBVSxDQUFDLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgdHlwZSB7XG4gIERlY3J5cHRpb25GYWlsdXJlLFxuICBFbmNyeXB0aW9uRmFpbHVyZSxcbiAgSW50ZXJuYWxTZXJ2aWNlRXJyb3IgYXMgSW50ZXJuYWxTZXJ2aWNlRXhjZXB0aW9uLFxuICBJbnZhbGlkTmV4dFRva2VuRXhjZXB0aW9uLFxuICBJbnZhbGlkUGFyYW1ldGVyRXhjZXB0aW9uLFxuICBJbnZhbGlkUmVxdWVzdEV4Y2VwdGlvbixcbiAgTGltaXRFeGNlZWRlZEV4Y2VwdGlvbixcbiAgTWFsZm9ybWVkUG9saWN5RG9jdW1lbnR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