@distilled.cloud/aws 0.20.2 → 0.21.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.
@@ -1,143 +1,17 @@
1
- import { type AwsCredentialIdentity } from "@smithy/types";
2
- import * as Effect from "effect/Effect";
1
+ import * as BrowserCredentials from "./credentials.browser.ts";
2
+ export * from "./credentials.browser.ts";
3
3
  import * as Layer from "effect/Layer";
4
- import type { PlatformError } from "effect/PlatformError";
5
- import * as Redacted from "effect/Redacted";
6
- import * as Context from "effect/Context";
7
- import type { HttpClientError } from "effect/unstable/http/HttpClientError";
8
4
  import { Auth } from "./auth.ts";
9
- export * as AWSTypes from "@aws-sdk/types";
10
- export interface AwsCredentials {
11
- readonly accessKeyId: string;
12
- readonly secretAccessKey: string;
13
- readonly sessionToken?: string;
14
- }
15
- /**
16
- * Resolved credential values ready for request signing.
17
- */
18
- export interface ResolvedCredentials {
19
- readonly accessKeyId: Redacted.Redacted<string>;
20
- readonly secretAccessKey: Redacted.Redacted<string>;
21
- readonly sessionToken: Redacted.Redacted<string> | undefined;
22
- readonly expiration?: number;
23
- }
24
- /**
25
- * The requirements for resolving credentials (HttpClient for SSO, FileSystem for cache).
26
- */
27
- /**
28
- * Error types that can occur during credential resolution.
29
- */
30
- export type CredentialsError = AwsCredentialProviderError | ProfileNotFound | InvalidSSOProfile | InvalidSSOToken | ExpiredSSOToken | ConflictingSSORegion | ConflictingSSOStartUrl | SsoPortalError | HttpClientError | PlatformError;
31
- declare const Credentials_base: Context.ServiceClass<Credentials, "AWS::Credentials", Effect.Effect<ResolvedCredentials, CredentialsError, never>>;
32
- export declare class Credentials extends Credentials_base {
33
- }
34
- export declare const mock: Layer.Layer<Credentials, never, never>;
35
- /**
36
- * Create resolved credentials from an AWS credential identity.
37
- */
38
- export declare const fromAwsCredentialIdentity: (identity: AwsCredentialIdentity) => ResolvedCredentials;
39
- type ProviderName = "env" | "ini" | "chain" | "container" | "http" | "process" | "token-file";
40
- export declare const _providerHints: (provider: ProviderName) => ReadonlyArray<string> | undefined;
41
- /**
42
- * Create a credentials provider from static credentials.
43
- * No lazy loading or caching needed since credentials are already available.
44
- */
45
- export declare const fromCredentials: (credentials: AwsCredentialIdentity) => Layer.Layer<Credentials>;
46
- export declare const fromEnv: () => Layer.Layer<Credentials, never, never>;
47
- export declare const fromChain: () => Layer.Layer<Credentials, never, never>;
48
- export declare const fromIni: () => Layer.Layer<Credentials, never, never>;
49
- export declare const fromContainerMetadata: () => Layer.Layer<Credentials, never, never>;
50
- export declare const fromHttp: () => Layer.Layer<Credentials, never, never>;
51
- export declare const fromProcess: () => Layer.Layer<Credentials, never, never>;
52
- export declare const fromTokenFile: () => Layer.Layer<Credentials, never, never>;
53
- export declare const ssoRegion: (region: string) => Layer.Layer<SsoRegion, never, never>;
54
- declare const SsoRegion_base: Context.ServiceClass<SsoRegion, "AWS::SsoRegion", string>;
55
- export declare class SsoRegion extends SsoRegion_base {
56
- }
57
- declare const SsoStartUrl_base: Context.ServiceClass<SsoStartUrl, "AWS::SsoStartUrl", string>;
58
- export declare class SsoStartUrl extends SsoStartUrl_base {
59
- }
60
- declare const ProfileNotFound_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
61
- readonly _tag: "Alchemy::AWS::ProfileNotFound";
62
- } & Readonly<A>;
63
- export declare class ProfileNotFound extends ProfileNotFound_base<{
64
- message: string;
65
- profile: string;
66
- }> {
67
- }
68
- declare const ConflictingSSORegion_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
69
- readonly _tag: "Alchemy::AWS::ConflictingSSORegion";
70
- } & Readonly<A>;
71
- export declare class ConflictingSSORegion extends ConflictingSSORegion_base<{
72
- message: string;
73
- ssoRegion: string;
74
- profile: string;
75
- }> {
76
- }
77
- declare const ConflictingSSOStartUrl_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
78
- readonly _tag: "Alchemy::AWS::ConflictingSSOStartUrl";
79
- } & Readonly<A>;
80
- export declare class ConflictingSSOStartUrl extends ConflictingSSOStartUrl_base<{
81
- message: string;
82
- ssoStartUrl: string;
83
- profile: string;
84
- }> {
85
- }
86
- declare const InvalidSSOProfile_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
87
- readonly _tag: "Alchemy::AWS::InvalidSSOProfile";
88
- } & Readonly<A>;
89
- export declare class InvalidSSOProfile extends InvalidSSOProfile_base<{
90
- message: string;
91
- profile: string;
92
- missingFields: string[];
93
- }> {
94
- }
95
- declare const InvalidSSOToken_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
96
- readonly _tag: "Alchemy::AWS::InvalidSSOToken";
97
- } & Readonly<A>;
98
- export declare class InvalidSSOToken extends InvalidSSOToken_base<{
99
- message: string;
100
- sso_session: string;
101
- }> {
102
- }
103
- declare const ExpiredSSOToken_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
104
- readonly _tag: "Alchemy::AWS::ExpiredSSOToken";
105
- } & Readonly<A>;
106
- export declare class ExpiredSSOToken extends ExpiredSSOToken_base<{
107
- message: string;
108
- profile: string;
109
- }> {
110
- }
111
- declare const AwsCredentialProviderError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
112
- readonly _tag: "AWS::CredentialProviderError";
113
- } & Readonly<A>;
114
- export declare class AwsCredentialProviderError extends AwsCredentialProviderError_base<{
115
- message: string;
116
- provider: string;
117
- cause?: unknown;
118
- hints?: ReadonlyArray<string>;
119
- }> {
120
- }
121
- declare const SsoPortalError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
122
- readonly _tag: "Alchemy::AWS::SsoPortalError";
123
- } & Readonly<A>;
124
- /**
125
- * The AWS SSO portal returned a response with no `roleCredentials`, e.g. a
126
- * `ForbiddenException` when an IAM Identity Center role assignment is in a
127
- * stale state.
128
- */
129
- export declare class SsoPortalError extends SsoPortalError_base<{
130
- message: string;
131
- profile: string;
132
- account_id?: string;
133
- role_name?: string;
134
- status?: number;
135
- }> {
136
- }
5
+ export declare const fromEnv: () => Layer.Layer<BrowserCredentials.Credentials, never, never>;
6
+ export declare const fromChain: () => Layer.Layer<BrowserCredentials.Credentials, never, never>;
7
+ export declare const fromIni: () => Layer.Layer<BrowserCredentials.Credentials, never, never>;
8
+ export declare const fromContainerMetadata: () => Layer.Layer<BrowserCredentials.Credentials, never, never>;
9
+ export declare const fromProcess: () => Layer.Layer<BrowserCredentials.Credentials, never, never>;
10
+ export declare const fromTokenFile: () => Layer.Layer<BrowserCredentials.Credentials, never, never>;
137
11
  /**
138
12
  * Create a lazy, cached SSO credentials provider.
139
13
  * SSO credential resolution is deferred until the Effect is run,
140
14
  * and credentials are cached until they expire.
141
15
  */
142
- export declare const fromSSO: (profileName?: string) => Layer.Layer<Credentials, never, Auth>;
16
+ export declare const fromSSO: (profileName?: string) => Layer.Layer<BrowserCredentials.Credentials, never, Auth>;
143
17
  //# sourceMappingURL=credentials.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"credentials.d.ts","sourceRoot":"","sources":["../src/credentials.ts"],"names":[],"mappings":"A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CAAC;AAE7E,eAAO,MAAM,WAAW,iEACwC,CAAC;AAEjE,eAAO,MAAM,aAAa,iEAC2C,CAAC;AAEtE;;;;GAIG;AACH,eAAO,MAAM,OAAO,iBAAiB,MAAM,6DAUxC,CAAC"}
@@ -1,149 +1,20 @@
1
- import { fromContainerMetadata as _fromContainerMetadata, fromEnv as _fromEnv, fromHttp as _fromHttp, fromIni as _fromIni, fromNodeProviderChain as _fromNodeProviderChain, fromProcess as _fromProcess, fromTokenFile as _fromTokenFile, } from "@aws-sdk/credential-providers";
2
- import {} from "@smithy/types";
3
- import * as Data from "effect/Data";
1
+ import { fromContainerMetadata as _fromContainerMetadata, fromEnv as _fromEnv, fromIni as _fromIni, fromNodeProviderChain as _fromNodeProviderChain, fromProcess as _fromProcess, fromTokenFile as _fromTokenFile, } from "@aws-sdk/credential-providers";
2
+ import * as BrowserCredentials from "./credentials.browser.js";
3
+ export * from "./credentials.browser.js";
4
4
  import * as Effect from "effect/Effect";
5
5
  import * as Layer from "effect/Layer";
6
- import * as Redacted from "effect/Redacted";
7
- import * as Context from "effect/Context";
8
6
  import { Auth } from "./auth.js";
9
- export * as AWSTypes from "@aws-sdk/types";
10
- export class Credentials extends Context.Service()("AWS::Credentials") {
11
- }
12
- export const mock = Layer.succeed(Credentials, Effect.succeed({
13
- accessKeyId: Redacted.make("test"),
14
- secretAccessKey: Redacted.make("test"),
15
- sessionToken: Redacted.make("test"),
16
- }));
17
- /**
18
- * Create resolved credentials from an AWS credential identity.
19
- */
20
- export const fromAwsCredentialIdentity = (identity) => ({
21
- accessKeyId: Redacted.make(identity.accessKeyId),
22
- secretAccessKey: Redacted.make(identity.secretAccessKey),
23
- sessionToken: identity.sessionToken
24
- ? Redacted.make(identity.sessionToken)
25
- : undefined,
26
- expiration: identity.expiration?.getTime(),
27
- });
28
- const providerHints = (provider) => {
29
- switch (provider) {
30
- case "env":
31
- return [
32
- "Set AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY (and AWS_SESSION_TOKEN if needed).",
33
- ];
34
- case "ini":
35
- return ["Check ~/.aws/credentials and ~/.aws/config for the profile."];
36
- case "chain":
37
- return [
38
- "Configure at least one credential source for the default chain.",
39
- "If using SSO, run `aws sso login` for the profile.",
40
- ];
41
- case "container":
42
- return ["Ensure a container credential endpoint is available."];
43
- case "http":
44
- return ["Ensure the configured credential endpoint is reachable."];
45
- case "process":
46
- return [
47
- "Set AWS_CREDENTIAL_PROCESS to a valid command and ensure it exits successfully.",
48
- ];
49
- case "token-file":
50
- return [
51
- "Set AWS_WEB_IDENTITY_TOKEN_FILE and ensure the file is readable.",
52
- ];
53
- default:
54
- return;
55
- }
56
- };
57
- export const _providerHints = providerHints;
58
- /**
59
- * Time window (5 mins) to refresh credentials before they actually expire.
60
- * This prevents using credentials that are about to expire.
61
- */
62
- const CREDENTIAL_REFRESH_WINDOW_MS = 5 * 60 * 1000;
63
- /**
64
- * Create a credentials effect with lazy resolution and expiration-aware caching.
65
- * Uses Effect.cachedWithTTL where the TTL is computed from the credentials' expiration.
66
- */
67
- const createCachedCredentialsEffect = (resolve) => {
68
- let cachedCreds;
69
- let expiresAt;
70
- return Effect.suspend(() => {
71
- const now = Date.now();
72
- if (cachedCreds && expiresAt && now < expiresAt) {
73
- return Effect.succeed(cachedCreds);
74
- }
75
- return Effect.map(resolve, (creds) => {
76
- cachedCreds = creds;
77
- expiresAt = creds.expiration
78
- ? creds.expiration - CREDENTIAL_REFRESH_WINDOW_MS
79
- : undefined;
80
- return creds;
81
- });
82
- });
83
- };
84
- /**
85
- * Create a lazy, cached credentials provider from an AWS SDK credential provider.
86
- * Credentials are resolved on first access and cached based on their expiration time.
87
- */
88
- const createLazyProvider = (provider, providerName) => {
89
- const resolve = Effect.gen(function* () {
90
- const hints = providerHints(providerName);
91
- const identity = yield* Effect.tryPromise({
92
- try: () => provider({})(),
93
- catch: (cause) => new AwsCredentialProviderError({
94
- message: `Failed to resolve credentials from ${providerName}.`,
95
- provider: providerName,
96
- cause,
97
- hints,
98
- }),
99
- });
100
- return fromAwsCredentialIdentity(identity);
101
- });
102
- return Layer.succeed(Credentials, createCachedCredentialsEffect(resolve));
103
- };
104
- /**
105
- * Create a credentials provider from static credentials.
106
- * No lazy loading or caching needed since credentials are already available.
107
- */
108
- export const fromCredentials = (credentials) => Layer.succeed(Credentials, Effect.succeed(fromAwsCredentialIdentity(credentials)));
109
- export const fromEnv = () => createLazyProvider(_fromEnv, "env");
110
- export const fromChain = () => createLazyProvider(() => _fromNodeProviderChain(), "chain");
7
+ export const fromEnv = () => BrowserCredentials.createLazyProvider(_fromEnv, "env");
8
+ export const fromChain = () => BrowserCredentials.createLazyProvider(() => _fromNodeProviderChain(), "chain");
111
9
  // export const fromSSO = () => createLazyProvider(_fromSSO);
112
- export const fromIni = () => createLazyProvider(_fromIni, "ini");
113
- export const fromContainerMetadata = () => createLazyProvider(_fromContainerMetadata, "container");
114
- export const fromHttp = () => createLazyProvider(_fromHttp, "http");
115
- export const fromProcess = () => createLazyProvider(_fromProcess, "process");
116
- export const fromTokenFile = () => createLazyProvider(_fromTokenFile, "token-file");
117
- export const ssoRegion = (region) => Layer.succeed(SsoRegion, region);
118
- export class SsoRegion extends Context.Service()("AWS::SsoRegion") {
119
- }
120
- export class SsoStartUrl extends Context.Service()("AWS::SsoStartUrl") {
121
- }
122
- export class ProfileNotFound extends Data.TaggedError("Alchemy::AWS::ProfileNotFound") {
123
- }
124
- export class ConflictingSSORegion extends Data.TaggedError("Alchemy::AWS::ConflictingSSORegion") {
125
- }
126
- export class ConflictingSSOStartUrl extends Data.TaggedError("Alchemy::AWS::ConflictingSSOStartUrl") {
127
- }
128
- export class InvalidSSOProfile extends Data.TaggedError("Alchemy::AWS::InvalidSSOProfile") {
129
- }
130
- export class InvalidSSOToken extends Data.TaggedError("Alchemy::AWS::InvalidSSOToken") {
131
- }
132
- export class ExpiredSSOToken extends Data.TaggedError("Alchemy::AWS::ExpiredSSOToken") {
133
- }
134
- export class AwsCredentialProviderError extends Data.TaggedError("AWS::CredentialProviderError") {
135
- }
136
- /**
137
- * The AWS SSO portal returned a response with no `roleCredentials`, e.g. a
138
- * `ForbiddenException` when an IAM Identity Center role assignment is in a
139
- * stale state.
140
- */
141
- export class SsoPortalError extends Data.TaggedError("Alchemy::AWS::SsoPortalError") {
142
- }
10
+ export const fromIni = () => BrowserCredentials.createLazyProvider(_fromIni, "ini");
11
+ export const fromContainerMetadata = () => BrowserCredentials.createLazyProvider(_fromContainerMetadata, "container");
12
+ export const fromProcess = () => BrowserCredentials.createLazyProvider(_fromProcess, "process");
13
+ export const fromTokenFile = () => BrowserCredentials.createLazyProvider(_fromTokenFile, "token-file");
143
14
  /**
144
15
  * Create a lazy, cached SSO credentials provider.
145
16
  * SSO credential resolution is deferred until the Effect is run,
146
17
  * and credentials are cached until they expire.
147
18
  */
148
- export const fromSSO = (profileName = "default") => Layer.effect(Credentials, Auth.use((auth) => Effect.succeed(createCachedCredentialsEffect(auth.loadProfileCredentials(profileName)))));
19
+ export const fromSSO = (profileName = "default") => Layer.effect(BrowserCredentials.Credentials, Auth.use((auth) => Effect.succeed(BrowserCredentials.createCachedCredentialsEffect(auth.loadProfileCredentials(profileName)))));
149
20
  //# sourceMappingURL=credentials.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"credentials.js","sourceRoot":"","sources":["../src/credentials.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,IAAI,sBAAsB,EAC/C,OAAO,IAAI,QAAQ,EACnB,QAAQ,IAAI,SAAS,EACrB,OAAO,IAAI,QAAQ,EACnB,qBAAqB,IAAI,sBAAsB,EAC/C,WAAW,IAAI,YAAY,EAC3B,aAAa,IAAI,cAAc,GAChC,MAAM,+BAA+B,CAAC;AAEvC,OAAO,EAGN,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,IAAI,MAAM,aAAa,CAAC;AACpC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AAE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GAAG,GAAG,EAAE,CAC9B,kBAAkB,CAAC,kBAAkB,CAAC,YAAY,EAAE,SAAS,CAAC,CAAC;AAEjE,MAAM,CAAC,MAAM,aAAa,GAAG,GAAG,EAAE,CAChC,kBAAkB,CAAC,kBAAkB,CAAC,cAAc,EAAE,YAAY,CAAC,CAAC;AAEtE;;;;GAIG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,WAAW,GAAW,SAAS,EAAE,EAAE,CACzD,KAAK,CAAC,MAAM,CACV,kBAAkB,CAAC,WAAW,EAC9B,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAChB,MAAM,CAAC,OAAO,CACZ,kBAAkB,CAAC,6BAA6B,CAC9C,IAAI,CAAC,sBAAsB,CAAC,WAAW,CAAC,CACzC,CACF,CACF,CACF,CAAC"}
@@ -0,0 +1,50 @@
1
+ /**
2
+ * AWS Authentication service for loading AWS profiles and credentials.
3
+ *
4
+ * @since 0.0.0
5
+ */
6
+ export * as Auth from "./auth.browser.ts";
7
+ /**
8
+ * AWS Credentials providers for obtaining temporary or long-lived credentials.
9
+ *
10
+ * @since 0.0.0
11
+ */
12
+ export * as Credentials from "./credentials.browser.ts";
13
+ /**
14
+ * AWS Endpoint configuration for custom or local endpoints.
15
+ *
16
+ * @since 0.0.0
17
+ */
18
+ export * as Endpoint from "./endpoint.ts";
19
+ /**
20
+ * Common AWS error types shared across all services.
21
+ *
22
+ * @since 0.0.0
23
+ */
24
+ export * as Errors from "./errors.ts";
25
+ /**
26
+ * AWS Region configuration.
27
+ *
28
+ * @since 0.0.0
29
+ */
30
+ export * as Region from "./region.ts";
31
+ /**
32
+ * Retry policy configuration for AWS API calls.
33
+ *
34
+ * @since 0.0.0
35
+ */
36
+ export * as Retry from "./retry.ts";
37
+ /**
38
+ * Sensitive data schemas for the smithy.api#sensitive trait.
39
+ * Wraps values in Effect's Redacted type to prevent accidental logging.
40
+ *
41
+ * @since 0.0.0
42
+ */
43
+ export * as Sensitive from "./sensitive.ts";
44
+ /**
45
+ * Smithy trait annotations for AWS service schemas.
46
+ *
47
+ * @since 0.0.0
48
+ */
49
+ export * as Traits from "./traits.ts";
50
+ //# sourceMappingURL=index.browser.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.browser.d.ts","sourceRoot":"","sources":["../src/index.browser.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,IAAI,MAAM,mBAAmB,CAAC;AAE1C;;;;GAIG;AACH,OAAO,KAAK,WAAW,MAAM,0BAA0B,CAAC;AAExD;;;;GAIG;AACH,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAC;AAE1C;;;;GAIG;AACH,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC;AAEtC;;;;GAIG;AACH,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC;AAEtC;;;;GAIG;AACH,OAAO,KAAK,KAAK,MAAM,YAAY,CAAC;AAEpC;;;;;GAKG;AACH,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAC;AAE5C;;;;GAIG;AACH,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC"}
@@ -0,0 +1,50 @@
1
+ /**
2
+ * AWS Authentication service for loading AWS profiles and credentials.
3
+ *
4
+ * @since 0.0.0
5
+ */
6
+ export * as Auth from "./auth.browser.js";
7
+ /**
8
+ * AWS Credentials providers for obtaining temporary or long-lived credentials.
9
+ *
10
+ * @since 0.0.0
11
+ */
12
+ export * as Credentials from "./credentials.browser.js";
13
+ /**
14
+ * AWS Endpoint configuration for custom or local endpoints.
15
+ *
16
+ * @since 0.0.0
17
+ */
18
+ export * as Endpoint from "./endpoint.js";
19
+ /**
20
+ * Common AWS error types shared across all services.
21
+ *
22
+ * @since 0.0.0
23
+ */
24
+ export * as Errors from "./errors.js";
25
+ /**
26
+ * AWS Region configuration.
27
+ *
28
+ * @since 0.0.0
29
+ */
30
+ export * as Region from "./region.js";
31
+ /**
32
+ * Retry policy configuration for AWS API calls.
33
+ *
34
+ * @since 0.0.0
35
+ */
36
+ export * as Retry from "./retry.js";
37
+ /**
38
+ * Sensitive data schemas for the smithy.api#sensitive trait.
39
+ * Wraps values in Effect's Redacted type to prevent accidental logging.
40
+ *
41
+ * @since 0.0.0
42
+ */
43
+ export * as Sensitive from "./sensitive.js";
44
+ /**
45
+ * Smithy trait annotations for AWS service schemas.
46
+ *
47
+ * @since 0.0.0
48
+ */
49
+ export * as Traits from "./traits.js";
50
+ //# sourceMappingURL=index.browser.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.browser.js","sourceRoot":"","sources":["../src/index.browser.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,IAAI,MAAM,mBAAmB,CAAC;AAE1C;;;;GAIG;AACH,OAAO,KAAK,WAAW,MAAM,0BAA0B,CAAC;AAExD;;;;GAIG;AACH,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAC;AAE1C;;;;GAIG;AACH,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC;AAEtC;;;;GAIG;AACH,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC;AAEtC;;;;GAIG;AACH,OAAO,KAAK,KAAK,MAAM,YAAY,CAAC;AAEpC;;;;;GAKG;AACH,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAC;AAE5C;;;;GAIG;AACH,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@distilled.cloud/aws",
3
- "version": "0.20.2",
3
+ "version": "0.21.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/alchemy-run/distilled",
@@ -14,6 +14,12 @@
14
14
  "src"
15
15
  ],
16
16
  "exports": {
17
+ ".": {
18
+ "types": "./lib/index.d.ts",
19
+ "bun": "./src/index.ts",
20
+ "browser": "./lib/index.browser.js",
21
+ "default": "./lib/index.js"
22
+ },
17
23
  "./*": {
18
24
  "types": "./lib/services/*.d.ts",
19
25
  "bun": "./src/services/*.ts",
@@ -22,6 +28,7 @@
22
28
  "./Auth": {
23
29
  "types": "./lib/auth.d.ts",
24
30
  "bun": "./src/auth.ts",
31
+ "browser": "./lib/auth.browser.js",
25
32
  "default": "./lib/auth.js"
26
33
  },
27
34
  "./Category": {
@@ -32,6 +39,7 @@
32
39
  "./Credentials": {
33
40
  "types": "./lib/credentials.d.ts",
34
41
  "bun": "./src/credentials.ts",
42
+ "browser": "./lib/credentials.browser.js",
35
43
  "default": "./lib/credentials.js"
36
44
  },
37
45
  "./Errors": {
@@ -58,11 +66,6 @@
58
66
  "types": "./lib/traits.d.ts",
59
67
  "bun": "./src/traits.ts",
60
68
  "default": "./lib/traits.js"
61
- },
62
- ".": {
63
- "types": "./lib/index.d.ts",
64
- "bun": "./src/index.ts",
65
- "default": "./lib/index.js"
66
69
  }
67
70
  },
68
71
  "scripts": {
@@ -82,7 +85,7 @@
82
85
  "@aws-crypto/util": "^5.2.0",
83
86
  "@aws-sdk/credential-providers": "^3.994.0",
84
87
  "@aws-sdk/types": "^3.973.1",
85
- "@distilled.cloud/core": "0.20.2",
88
+ "@distilled.cloud/core": "0.21.0",
86
89
  "@smithy/shared-ini-file-loader": "^4.4.3",
87
90
  "@smithy/types": "^4.12.0",
88
91
  "@smithy/util-base64": "^4.3.0",
@@ -0,0 +1,88 @@
1
+ import * as Context from "effect/Context";
2
+ import * as Effect from "effect/Effect";
3
+ import * as Option from "effect/Option";
4
+ import type {
5
+ CredentialsError,
6
+ ResolvedCredentials,
7
+ } from "./credentials.browser.ts";
8
+
9
+ export class Auth extends Context.Service<
10
+ Auth,
11
+ {
12
+ loadProfile: (
13
+ profileName: string,
14
+ ) => Effect.Effect<AwsProfileConfig, CredentialsError>;
15
+ loadProfileCredentials: (
16
+ profileName: string,
17
+ ) => Effect.Effect<ResolvedCredentials, CredentialsError>;
18
+ }
19
+ >()("distilled-aws/AWS/Auth") {}
20
+
21
+ // This doesn't do anything - it's here so that when building for the browser, you don't get a warning about `Auth.Default` not being exported.
22
+ export const Default = Effect.serviceOption(Auth).pipe(
23
+ Effect.map(Option.getOrThrow),
24
+ );
25
+
26
+ export interface AwsProfileConfig {
27
+ sso_session?: string;
28
+ sso_account_id?: string;
29
+ sso_role_name?: string;
30
+ region?: string;
31
+ output?: string;
32
+ sso_start_url?: string;
33
+ sso_region?: string;
34
+ }
35
+ export interface SsoProfileConfig extends AwsProfileConfig {
36
+ sso_start_url: string;
37
+ sso_region: string;
38
+ sso_account_id: string;
39
+ sso_role_name: string;
40
+ }
41
+
42
+ /**
43
+ * Cached SSO token retrieved from SSO login flow.
44
+ * @public
45
+ */
46
+ export interface SSOToken {
47
+ /**
48
+ * A base64 encoded string returned by the sso-oidc service.
49
+ */
50
+ accessToken: string;
51
+
52
+ /**
53
+ * The expiration time of the accessToken as an RFC 3339 formatted timestamp.
54
+ */
55
+ expiresAt: string;
56
+
57
+ /**
58
+ * The token used to obtain an access token in the event that the accessToken is invalid or expired.
59
+ */
60
+ refreshToken?: string;
61
+
62
+ /**
63
+ * The unique identifier string for each client. The client ID generated when performing the registration
64
+ * portion of the OIDC authorization flow. This is used to refresh the accessToken.
65
+ */
66
+ clientId?: string;
67
+
68
+ /**
69
+ * A secret string generated when performing the registration portion of the OIDC authorization flow.
70
+ * This is used to refresh the accessToken.
71
+ */
72
+ clientSecret?: string;
73
+
74
+ /**
75
+ * The expiration time of the client registration (clientId and clientSecret) as an RFC 3339 formatted timestamp.
76
+ */
77
+ registrationExpiresAt?: string;
78
+
79
+ /**
80
+ * The configured sso_region for the profile that credentials are being resolved for.
81
+ */
82
+ region?: string;
83
+
84
+ /**
85
+ * The configured sso_start_url for the profile that credentials are being resolved for.
86
+ */
87
+ startUrl?: string;
88
+ }