@effect-aws/client-sts 1.2.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/LICENSE +1 -1
  3. package/STSClientInstance/package.json +6 -0
  4. package/STSService/package.json +6 -0
  5. package/STSServiceConfig/package.json +6 -0
  6. package/{lib → dist/cjs}/Errors.d.ts +6 -11
  7. package/dist/cjs/Errors.d.ts.map +1 -0
  8. package/dist/cjs/Errors.js +16 -0
  9. package/dist/cjs/Errors.js.map +1 -0
  10. package/dist/cjs/STSClientInstance.d.ts +24 -0
  11. package/dist/cjs/STSClientInstance.d.ts.map +1 -0
  12. package/dist/cjs/STSClientInstance.js +50 -0
  13. package/dist/cjs/STSClientInstance.js.map +1 -0
  14. package/{lib → dist/cjs}/STSService.d.ts +16 -38
  15. package/dist/cjs/STSService.d.ts.map +1 -0
  16. package/dist/cjs/STSService.js +65 -0
  17. package/dist/cjs/STSService.js.map +1 -0
  18. package/dist/cjs/STSServiceConfig.d.ts +25 -0
  19. package/dist/cjs/STSServiceConfig.d.ts.map +1 -0
  20. package/dist/cjs/STSServiceConfig.js +35 -0
  21. package/dist/cjs/STSServiceConfig.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 +15 -0
  27. package/dist/dts/Errors.d.ts.map +1 -0
  28. package/dist/dts/STSClientInstance.d.ts +24 -0
  29. package/dist/dts/STSClientInstance.d.ts.map +1 -0
  30. package/dist/dts/STSService.d.ts +88 -0
  31. package/dist/dts/STSService.d.ts.map +1 -0
  32. package/dist/dts/STSServiceConfig.d.ts +25 -0
  33. package/dist/dts/STSServiceConfig.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 +13 -0
  37. package/dist/esm/Errors.js.map +1 -0
  38. package/dist/esm/STSClientInstance.js +23 -0
  39. package/dist/esm/STSClientInstance.js.map +1 -0
  40. package/dist/esm/STSService.js +38 -0
  41. package/dist/esm/STSService.js.map +1 -0
  42. package/dist/esm/STSServiceConfig.js +31 -0
  43. package/dist/esm/STSServiceConfig.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 +35 -0
  49. package/src/STSClientInstance.ts +33 -0
  50. package/src/STSService.ts +227 -0
  51. package/src/STSServiceConfig.ts +51 -0
  52. package/src/index.ts +44 -0
  53. package/CHANGELOG.md +0 -35
  54. package/docgen.json +0 -8
  55. package/lib/Errors.js +0 -16
  56. package/lib/STSClientInstance.d.ts +0 -31
  57. package/lib/STSClientInstance.js +0 -57
  58. package/lib/STSClientInstanceConfig.d.ts +0 -23
  59. package/lib/STSClientInstanceConfig.js +0 -44
  60. package/lib/STSService.js +0 -97
  61. package/lib/esm/Errors.js +0 -13
  62. package/lib/esm/STSClientInstance.js +0 -30
  63. package/lib/esm/STSClientInstanceConfig.js +0 -40
  64. package/lib/esm/STSService.js +0 -93
  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,88 @@
1
+ /**
2
+ * @since 1.0.0
3
+ */
4
+ import { type AssumeRoleCommandInput, type AssumeRoleCommandOutput, type AssumeRoleWithSAMLCommandInput, type AssumeRoleWithSAMLCommandOutput, type AssumeRoleWithWebIdentityCommandInput, type AssumeRoleWithWebIdentityCommandOutput, type AssumeRootCommandInput, type AssumeRootCommandOutput, type DecodeAuthorizationMessageCommandInput, type DecodeAuthorizationMessageCommandOutput, type GetAccessKeyInfoCommandInput, type GetAccessKeyInfoCommandOutput, type GetCallerIdentityCommandInput, type GetCallerIdentityCommandOutput, type GetFederationTokenCommandInput, type GetFederationTokenCommandOutput, type GetSessionTokenCommandInput, type GetSessionTokenCommandOutput, type STSClient, type STSClientConfig } from "@aws-sdk/client-sts";
5
+ import type { HttpHandlerOptions, SdkError, ServiceLogger } from "@effect-aws/commons";
6
+ import { Effect, Layer } from "effect";
7
+ import type { ExpiredTokenError, IDPCommunicationError, IDPRejectedClaimError, InvalidAuthorizationMessageError, InvalidIdentityTokenError, MalformedPolicyDocumentError, PackedPolicyTooLargeError, RegionDisabledError } from "./Errors.js";
8
+ import * as Instance from "./STSClientInstance.js";
9
+ interface STSService$ {
10
+ readonly _: unique symbol;
11
+ /**
12
+ * @see {@link AssumeRoleCommand}
13
+ */
14
+ assumeRole(args: AssumeRoleCommandInput, options?: HttpHandlerOptions): Effect.Effect<AssumeRoleCommandOutput, SdkError | ExpiredTokenError | MalformedPolicyDocumentError | PackedPolicyTooLargeError | RegionDisabledError>;
15
+ /**
16
+ * @see {@link AssumeRoleWithSAMLCommand}
17
+ */
18
+ assumeRoleWithSAML(args: AssumeRoleWithSAMLCommandInput, options?: HttpHandlerOptions): Effect.Effect<AssumeRoleWithSAMLCommandOutput, SdkError | ExpiredTokenError | IDPRejectedClaimError | InvalidIdentityTokenError | MalformedPolicyDocumentError | PackedPolicyTooLargeError | RegionDisabledError>;
19
+ /**
20
+ * @see {@link AssumeRoleWithWebIdentityCommand}
21
+ */
22
+ assumeRoleWithWebIdentity(args: AssumeRoleWithWebIdentityCommandInput, options?: HttpHandlerOptions): Effect.Effect<AssumeRoleWithWebIdentityCommandOutput, SdkError | ExpiredTokenError | IDPCommunicationError | IDPRejectedClaimError | InvalidIdentityTokenError | MalformedPolicyDocumentError | PackedPolicyTooLargeError | RegionDisabledError>;
23
+ /**
24
+ * @see {@link AssumeRootCommand}
25
+ */
26
+ assumeRoot(args: AssumeRootCommandInput, options?: HttpHandlerOptions): Effect.Effect<AssumeRootCommandOutput, SdkError | ExpiredTokenError | RegionDisabledError>;
27
+ /**
28
+ * @see {@link DecodeAuthorizationMessageCommand}
29
+ */
30
+ decodeAuthorizationMessage(args: DecodeAuthorizationMessageCommandInput, options?: HttpHandlerOptions): Effect.Effect<DecodeAuthorizationMessageCommandOutput, SdkError | InvalidAuthorizationMessageError>;
31
+ /**
32
+ * @see {@link GetAccessKeyInfoCommand}
33
+ */
34
+ getAccessKeyInfo(args: GetAccessKeyInfoCommandInput, options?: HttpHandlerOptions): Effect.Effect<GetAccessKeyInfoCommandOutput, SdkError>;
35
+ /**
36
+ * @see {@link GetCallerIdentityCommand}
37
+ */
38
+ getCallerIdentity(args: GetCallerIdentityCommandInput, options?: HttpHandlerOptions): Effect.Effect<GetCallerIdentityCommandOutput, SdkError>;
39
+ /**
40
+ * @see {@link GetFederationTokenCommand}
41
+ */
42
+ getFederationToken(args: GetFederationTokenCommandInput, options?: HttpHandlerOptions): Effect.Effect<GetFederationTokenCommandOutput, SdkError | MalformedPolicyDocumentError | PackedPolicyTooLargeError | RegionDisabledError>;
43
+ /**
44
+ * @see {@link GetSessionTokenCommand}
45
+ */
46
+ getSessionToken(args: GetSessionTokenCommandInput, options?: HttpHandlerOptions): Effect.Effect<GetSessionTokenCommandOutput, SdkError | RegionDisabledError>;
47
+ }
48
+ /**
49
+ * @since 1.0.0
50
+ * @category constructors
51
+ */
52
+ export declare const makeSTSService: Effect.Effect<STSService$, never, Instance.STSClientInstance>;
53
+ declare const STSService_base: import("effect/Context").TagClass<STSService, "@effect-aws/client-sts/STSService", STSService$> & {
54
+ readonly _: Effect.Effect<STSService$["_"], never, STSService>;
55
+ assumeRole: (args: AssumeRoleCommandInput, options?: HttpHandlerOptions | undefined) => Effect.Effect<AssumeRoleCommandOutput, ExpiredTokenError | MalformedPolicyDocumentError | PackedPolicyTooLargeError | RegionDisabledError | SdkError, STSService>;
56
+ assumeRoleWithSAML: (args: AssumeRoleWithSAMLCommandInput, options?: HttpHandlerOptions | undefined) => Effect.Effect<AssumeRoleWithSAMLCommandOutput, ExpiredTokenError | IDPRejectedClaimError | InvalidIdentityTokenError | MalformedPolicyDocumentError | PackedPolicyTooLargeError | RegionDisabledError | SdkError, STSService>;
57
+ assumeRoleWithWebIdentity: (args: AssumeRoleWithWebIdentityCommandInput, options?: HttpHandlerOptions | undefined) => Effect.Effect<AssumeRoleWithWebIdentityCommandOutput, ExpiredTokenError | IDPCommunicationError | IDPRejectedClaimError | InvalidIdentityTokenError | MalformedPolicyDocumentError | PackedPolicyTooLargeError | RegionDisabledError | SdkError, STSService>;
58
+ assumeRoot: (args: AssumeRootCommandInput, options?: HttpHandlerOptions | undefined) => Effect.Effect<AssumeRootCommandOutput, ExpiredTokenError | RegionDisabledError | SdkError, STSService>;
59
+ decodeAuthorizationMessage: (args: DecodeAuthorizationMessageCommandInput, options?: HttpHandlerOptions | undefined) => Effect.Effect<DecodeAuthorizationMessageCommandOutput, InvalidAuthorizationMessageError | SdkError, STSService>;
60
+ getAccessKeyInfo: (args: GetAccessKeyInfoCommandInput, options?: HttpHandlerOptions | undefined) => Effect.Effect<GetAccessKeyInfoCommandOutput, SdkError, STSService>;
61
+ getCallerIdentity: (args: GetCallerIdentityCommandInput, options?: HttpHandlerOptions | undefined) => Effect.Effect<GetCallerIdentityCommandOutput, SdkError, STSService>;
62
+ getFederationToken: (args: GetFederationTokenCommandInput, options?: HttpHandlerOptions | undefined) => Effect.Effect<GetFederationTokenCommandOutput, MalformedPolicyDocumentError | PackedPolicyTooLargeError | RegionDisabledError | SdkError, STSService>;
63
+ getSessionToken: (args: GetSessionTokenCommandInput, options?: HttpHandlerOptions | undefined) => Effect.Effect<GetSessionTokenCommandOutput, RegionDisabledError | SdkError, STSService>;
64
+ } & {
65
+ use: <X>(body: (_: STSService$) => X) => X extends Effect.Effect<infer A, infer E, infer R> ? Effect.Effect<A, E, STSService | R> : Effect.Effect<X, never, STSService>;
66
+ };
67
+ /**
68
+ * @since 1.0.0
69
+ * @category models
70
+ */
71
+ export declare class STSService extends STSService_base {
72
+ static readonly defaultLayer: Layer.Layer<STSService, never, never>;
73
+ static readonly layer: (config: STSService.Config) => Layer.Layer<STSService, never, never>;
74
+ static readonly baseLayer: (evaluate: (defaultConfig: STSClientConfig) => STSClient) => Layer.Layer<STSService, never, never>;
75
+ }
76
+ /**
77
+ * @since 1.0.0
78
+ */
79
+ export declare namespace STSService {
80
+ /**
81
+ * @since 1.0.0
82
+ */
83
+ interface Config extends Omit<STSClientConfig, "logger"> {
84
+ readonly logger?: ServiceLogger.ServiceLoggerConstructorProps | true;
85
+ }
86
+ }
87
+ export {};
88
+ //# sourceMappingURL=STSService.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"STSService.d.ts","sourceRoot":"","sources":["../../src/STSService.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAEL,KAAK,sBAAsB,EAC3B,KAAK,uBAAuB,EAE5B,KAAK,8BAA8B,EACnC,KAAK,+BAA+B,EAEpC,KAAK,qCAAqC,EAC1C,KAAK,sCAAsC,EAE3C,KAAK,sBAAsB,EAC3B,KAAK,uBAAuB,EAE5B,KAAK,sCAAsC,EAC3C,KAAK,uCAAuC,EAE5C,KAAK,4BAA4B,EACjC,KAAK,6BAA6B,EAElC,KAAK,6BAA6B,EAClC,KAAK,8BAA8B,EAEnC,KAAK,8BAA8B,EACnC,KAAK,+BAA+B,EAEpC,KAAK,2BAA2B,EAChC,KAAK,4BAA4B,EACjC,KAAK,SAAS,EACd,KAAK,eAAe,EACrB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,kBAAkB,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEvF,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AACvC,OAAO,KAAK,EACV,iBAAiB,EACjB,qBAAqB,EACrB,qBAAqB,EACrB,gCAAgC,EAChC,yBAAyB,EACzB,4BAA4B,EAC5B,yBAAyB,EACzB,mBAAmB,EACp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er } from "effect";
6
+ import type { STSService } from "./STSService.js";
7
+ /**
8
+ * @since 1.0.0
9
+ * @category sts service config
10
+ */
11
+ export declare const withSTSServiceConfig: {
12
+ (config: STSService.Config): <A, E, R>(effect: Effect.Effect<A, E, R>) => Effect.Effect<A, E, R>;
13
+ <A, E, R>(effect: Effect.Effect<A, E, R>, config: STSService.Config): Effect.Effect<A, E, R>;
14
+ };
15
+ /**
16
+ * @since 1.0.0
17
+ * @category sts service config
18
+ */
19
+ export declare const setSTSServiceConfig: (config: STSService.Config) => Layer.Layer<never, never, never>;
20
+ /**
21
+ * @since 1.0.0
22
+ * @category adapters
23
+ */
24
+ export declare const toSTSClientConfig: Effect.Effect<STSClientConfig>;
25
+ //# sourceMappingURL=STSServiceConfig.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"STSServiceConfig.d.ts","sourceRoot":"","sources":["../../src/STSServiceConfig.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAE3D,OAAO,EAAE,MAAM,EAAY,KAAK,EAAE,MAAM,QAAQ,CAAC;AAGjD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAWlD;;;GAGG;AACH,eAAO,MAAM,oBAAoB,EAAE;IACjC,CAAC,MAAM,EAAE,UAAU,CAAC,MAAM,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,KAAK,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IACjG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,UAAU,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;CAK9F,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,mBAAmB,WAAY,WAAW,MAAM,qCAAyD,CAAC;AAEvH;;;GAGG;AACH,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,MAAM,CAAC,eAAe,CAQ3D,CAAC"}
@@ -0,0 +1,39 @@
1
+ /**
2
+ * @since 1.0.0
3
+ */
4
+ import { STSService } from "./STSService.js";
5
+ /**
6
+ * @since 1.0.0
7
+ */
8
+ export * from "./Errors.js";
9
+ /**
10
+ * @since 1.0.0
11
+ */
12
+ export * as STSClientInstance from "./STSClientInstance.js";
13
+ /**
14
+ * @since 1.0.0
15
+ */
16
+ export * as STSServiceConfig from "./STSServiceConfig.js";
17
+ /**
18
+ * @since 1.0.0
19
+ */
20
+ export * from "./STSService.js";
21
+ /**
22
+ * @since 1.0.0
23
+ * @category exports
24
+ * @alias STSService
25
+ */
26
+ export declare namespace STS {
27
+ /**
28
+ * @since 1.0.0
29
+ * @alias STSService.Config
30
+ */
31
+ type Config = STSService.Config;
32
+ }
33
+ /**
34
+ * @since 1.0.0
35
+ * @category exports
36
+ * @alias STSService
37
+ */
38
+ export declare const STS: typeof STSService;
39
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","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,OAAO,WAAW,GAAG,CAAC;IAC3B;;;OAGG;IACH,KAAY,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;CACxC;AAED;;;;GAIG;AACH,eAAO,MAAM,GAAG,mBAAa,CAAC"}
@@ -0,0 +1,13 @@
1
+ import { SdkError as CommonSdkError } from "@effect-aws/commons";
2
+ export const AllServiceErrors = [
3
+ "ExpiredTokenException",
4
+ "IDPCommunicationErrorException",
5
+ "IDPRejectedClaimException",
6
+ "InvalidAuthorizationMessageException",
7
+ "InvalidIdentityTokenException",
8
+ "MalformedPolicyDocumentException",
9
+ "PackedPolicyTooLargeException",
10
+ "RegionDisabledException",
11
+ ];
12
+ export const SdkError = CommonSdkError;
13
+ //# sourceMappingURL=Errors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Errors.js","sourceRoot":"","sources":["../../src/Errors.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,QAAQ,IAAI,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAEjE,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,uBAAuB;IACvB,gCAAgC;IAChC,2BAA2B;IAC3B,sCAAsC;IACtC,+BAA+B;IAC/B,kCAAkC;IAClC,+BAA+B;IAC/B,yBAAyB;CACjB,CAAC;AAYX,MAAM,CAAC,MAAM,QAAQ,GAAG,cAAc,CAAC"}
@@ -0,0 +1,23 @@
1
+ /**
2
+ * @since 1.0.0
3
+ */
4
+ import { STSClient } from "@aws-sdk/client-sts";
5
+ import { Context, Effect, Layer } from "effect";
6
+ import * as STSServiceConfig from "./STSServiceConfig.js";
7
+ /**
8
+ * @since 1.0.0
9
+ * @category tags
10
+ */
11
+ export class STSClientInstance extends Context.Tag("@effect-aws/client-sts/STSClientInstance")() {
12
+ }
13
+ /**
14
+ * @since 1.0.0
15
+ * @category constructors
16
+ */
17
+ export const make = Effect.flatMap(STSServiceConfig.toSTSClientConfig, (config) => Effect.acquireRelease(Effect.sync(() => new STSClient(config)), (client) => Effect.sync(() => client.destroy())));
18
+ /**
19
+ * @since 1.0.0
20
+ * @category layers
21
+ */
22
+ export const layer = Layer.scoped(STSClientInstance, make);
23
+ //# sourceMappingURL=STSClientInstance.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"STSClientInstance.js","sourceRoot":"","sources":["../../src/STSClientInstance.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,38 @@
1
+ /**
2
+ * @since 1.0.0
3
+ */
4
+ import { AssumeRoleCommand, AssumeRoleWithSAMLCommand, AssumeRoleWithWebIdentityCommand, AssumeRootCommand, DecodeAuthorizationMessageCommand, GetAccessKeyInfoCommand, GetCallerIdentityCommand, GetFederationTokenCommand, GetSessionTokenCommand, } from "@aws-sdk/client-sts";
5
+ import { Service } from "@effect-aws/commons";
6
+ import { Effect, Layer } from "effect";
7
+ import { AllServiceErrors } from "./Errors.js";
8
+ import * as Instance from "./STSClientInstance.js";
9
+ import * as STSServiceConfig from "./STSServiceConfig.js";
10
+ const commands = {
11
+ AssumeRoleCommand,
12
+ AssumeRoleWithSAMLCommand,
13
+ AssumeRoleWithWebIdentityCommand,
14
+ AssumeRootCommand,
15
+ DecodeAuthorizationMessageCommand,
16
+ GetAccessKeyInfoCommand,
17
+ GetCallerIdentityCommand,
18
+ GetFederationTokenCommand,
19
+ GetSessionTokenCommand,
20
+ };
21
+ /**
22
+ * @since 1.0.0
23
+ * @category constructors
24
+ */
25
+ export const makeSTSService = Effect.gen(function* () {
26
+ const client = yield* Instance.STSClientInstance;
27
+ return Service.fromClientAndCommands(client, commands, AllServiceErrors);
28
+ });
29
+ /**
30
+ * @since 1.0.0
31
+ * @category models
32
+ */
33
+ export class STSService extends Effect.Tag("@effect-aws/client-sts/STSService")() {
34
+ static defaultLayer = Layer.effect(this, makeSTSService).pipe(Layer.provide(Instance.layer));
35
+ static layer = (config) => Layer.effect(this, makeSTSService).pipe(Layer.provide(Instance.layer), Layer.provide(STSServiceConfig.setSTSServiceConfig(config)));
36
+ static baseLayer = (evaluate) => Layer.effect(this, makeSTSService).pipe(Layer.provide(Layer.effect(Instance.STSClientInstance, Effect.map(STSServiceConfig.toSTSClientConfig, evaluate))));
37
+ }
38
+ //# sourceMappingURL=STSService.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"STSService.js","sourceRoot":"","sources":["../../src/STSService.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EACL,iBAAiB,EAGjB,yBAAyB,EAGzB,gCAAgC,EAGhC,iBAAiB,EAGjB,iCAAiC,EAGjC,uBAAuB,EAGvB,wBAAwB,EAGxB,yBAAyB,EAGzB,sBAAsB,GAKvB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAWvC,OAAO,EAAE,gB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AC,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 sts service config
8
+ */
9
+ const currentSTSServiceConfig = globalValue("@effect-aws/client-sts/currentSTSServiceConfig", () => FiberRef.unsafeMake({}));
10
+ /**
11
+ * @since 1.0.0
12
+ * @category sts service config
13
+ */
14
+ export const withSTSServiceConfig = dual(2, (effect, config) => Effect.locally(effect, currentSTSServiceConfig, config));
15
+ /**
16
+ * @since 1.0.0
17
+ * @category sts service config
18
+ */
19
+ export const setSTSServiceConfig = (config) => Layer.locallyScoped(currentSTSServiceConfig, config);
20
+ /**
21
+ * @since 1.0.0
22
+ * @category adapters
23
+ */
24
+ export const toSTSClientConfig = Effect.gen(function* () {
25
+ const { logger: serviceLogger, ...config } = yield* FiberRef.get(currentSTSServiceConfig);
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=STSServiceConfig.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"STSServiceConfig.js","sourceRoot":"","sources":["../../src/STSServiceConfig.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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
+ /**
10
+ * @since 1.0.0
11
+ */
12
+ export * as STSClientInstance from "./STSClientInstance.js";
13
+ /**
14
+ * @since 1.0.0
15
+ */
16
+ export * as STSServiceConfig from "./STSServiceConfig.js";
17
+ /**
18
+ * @since 1.0.0
19
+ */
20
+ export * from "./STSService.js";
21
+ /**
22
+ * @since 1.0.0
23
+ * @category exports
24
+ * @alias STSService
25
+ */
26
+ export const STS = STSService;
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-sts",
3
+ "version": "1.9.0",
4
+ "description": "Effectful AWS STS client",
5
+ "license": "MIT",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "github:floydspace/effect-aws",
9
+ "directory": "packages/client-sts"
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-sts",
17
+ "dependencies": {
18
+ "@aws-sdk/client-sts": "^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-sts": "^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
+ "./STSClientInstance": {
40
+ "types": "./dist/dts/STSClientInstance.d.ts",
41
+ "import": "./dist/esm/STSClientInstance.js",
42
+ "default": "./dist/cjs/STSClientInstance.js"
43
+ },
44
+ "./STSService": {
45
+ "types": "./dist/dts/STSService.d.ts",
46
+ "import": "./dist/esm/STSService.js",
47
+ "default": "./dist/cjs/STSService.js"
48
+ },
49
+ "./STSServiceConfig": {
50
+ "types": "./dist/dts/STSServiceConfig.d.ts",
51
+ "import": "./dist/esm/STSServiceConfig.js",
52
+ "default": "./dist/cjs/STSServiceConfig.js"
53
+ }
35
54
  },
36
- "version": "1.2.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
+ "STSClientInstance": [
61
+ "./dist/dts/STSClientInstance.d.ts"
62
+ ],
63
+ "STSService": [
64
+ "./dist/dts/STSService.d.ts"
65
+ ],
66
+ "STSServiceConfig": [
67
+ "./dist/dts/STSServiceConfig.d.ts"
68
+ ]
69
+ }
53
70
  }
54
71
  }
package/src/Errors.ts ADDED
@@ -0,0 +1,35 @@
1
+ import type {
2
+ ExpiredTokenException,
3
+ IDPCommunicationErrorException,
4
+ IDPRejectedClaimException,
5
+ InvalidAuthorizationMessageException,
6
+ InvalidIdentityTokenException,
7
+ MalformedPolicyDocumentException,
8
+ PackedPolicyTooLargeException,
9
+ RegionDisabledException,
10
+ } from "@aws-sdk/client-sts";
11
+ import type { TaggedException } from "@effect-aws/commons";
12
+ import { SdkError as CommonSdkError } from "@effect-aws/commons";
13
+
14
+ export const AllServiceErrors = [
15
+ "ExpiredTokenException",
16
+ "IDPCommunicationErrorException",
17
+ "IDPRejectedClaimException",
18
+ "InvalidAuthorizationMessageException",
19
+ "InvalidIdentityTokenException",
20
+ "MalformedPolicyDocumentException",
21
+ "PackedPolicyTooLargeException",
22
+ "RegionDisabledException",
23
+ ] as const;
24
+
25
+ export type ExpiredTokenError = TaggedException<ExpiredTokenException>;
26
+ export type IDPCommunicationError = TaggedException<IDPCommunicationErrorException>;
27
+ export type IDPRejectedClaimError = TaggedException<IDPRejectedClaimException>;
28
+ export type InvalidAuthorizationMessageError = TaggedException<InvalidAuthorizationMessageException>;
29
+ export type InvalidIdentityTokenError = TaggedException<InvalidIdentityTokenException>;
30
+ export type MalformedPolicyDocumentError = TaggedException<MalformedPolicyDocumentException>;
31
+ export type PackedPolicyTooLargeError = TaggedException<PackedPolicyTooLargeException>;
32
+ export type RegionDisabledError = TaggedException<RegionDisabledException>;
33
+
34
+ export type SdkError = CommonSdkError;
35
+ export const SdkError = CommonSdkError;
@@ -0,0 +1,33 @@
1
+ /**
2
+ * @since 1.0.0
3
+ */
4
+ import { STSClient } from "@aws-sdk/client-sts";
5
+ import { Context, Effect, Layer } from "effect";
6
+ import * as STSServiceConfig from "./STSServiceConfig.js";
7
+
8
+ /**
9
+ * @since 1.0.0
10
+ * @category tags
11
+ */
12
+ export class STSClientInstance extends Context.Tag(
13
+ "@effect-aws/client-sts/STSClientInstance",
14
+ )<STSClientInstance, STSClient>() {}
15
+
16
+ /**
17
+ * @since 1.0.0
18
+ * @category constructors
19
+ */
20
+ export const make = Effect.flatMap(
21
+ STSServiceConfig.toSTSClientConfig,
22
+ (config) =>
23
+ Effect.acquireRelease(
24
+ Effect.sync(() => new STSClient(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(STSClientInstance, make);