@effect-aws/client-athena 1.9.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AthenaClientInstance/package.json +6 -0
- package/AthenaService/package.json +6 -0
- package/AthenaServiceConfig/package.json +6 -0
- package/Errors/package.json +6 -0
- package/LICENSE +19 -0
- package/README.md +58 -0
- package/dist/cjs/AthenaClientInstance.d.ts +24 -0
- package/dist/cjs/AthenaClientInstance.d.ts.map +1 -0
- package/dist/cjs/AthenaClientInstance.js +50 -0
- package/dist/cjs/AthenaClientInstance.js.map +1 -0
- package/dist/cjs/AthenaService.d.ts +313 -0
- package/dist/cjs/AthenaService.d.ts.map +1 -0
- package/dist/cjs/AthenaService.js +127 -0
- package/dist/cjs/AthenaService.js.map +1 -0
- package/dist/cjs/AthenaServiceConfig.d.ts +25 -0
- package/dist/cjs/AthenaServiceConfig.d.ts.map +1 -0
- package/dist/cjs/AthenaServiceConfig.js +35 -0
- package/dist/cjs/AthenaServiceConfig.js.map +1 -0
- package/dist/cjs/Errors.d.ts +13 -0
- package/dist/cjs/Errors.d.ts.map +1 -0
- package/dist/cjs/Errors.js +14 -0
- package/dist/cjs/Errors.js.map +1 -0
- package/dist/cjs/index.d.ts +39 -0
- package/dist/cjs/index.d.ts.map +1 -0
- package/dist/cjs/index.js +56 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/dts/AthenaClientInstance.d.ts +24 -0
- package/dist/dts/AthenaClientInstance.d.ts.map +1 -0
- package/dist/dts/AthenaService.d.ts +313 -0
- package/dist/dts/AthenaService.d.ts.map +1 -0
- package/dist/dts/AthenaServiceConfig.d.ts +25 -0
- package/dist/dts/AthenaServiceConfig.d.ts.map +1 -0
- package/dist/dts/Errors.d.ts +13 -0
- package/dist/dts/Errors.d.ts.map +1 -0
- package/dist/dts/index.d.ts +39 -0
- package/dist/dts/index.d.ts.map +1 -0
- package/dist/esm/AthenaClientInstance.js +23 -0
- package/dist/esm/AthenaClientInstance.js.map +1 -0
- package/dist/esm/AthenaService.js +100 -0
- package/dist/esm/AthenaService.js.map +1 -0
- package/dist/esm/AthenaServiceConfig.js +31 -0
- package/dist/esm/AthenaServiceConfig.js.map +1 -0
- package/dist/esm/Errors.js +11 -0
- package/dist/esm/Errors.js.map +1 -0
- package/dist/esm/index.js +27 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/package.json +4 -0
- package/package.json +71 -0
- package/src/AthenaClientInstance.ts +33 -0
- package/src/AthenaService.ts +1109 -0
- package/src/AthenaServiceConfig.ts +52 -0
- package/src/Errors.ts +29 -0
- package/src/index.ts +44 -0
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @since 1.0.0
|
|
3
|
+
*/
|
|
4
|
+
import type { AthenaClientConfig } from "@aws-sdk/client-athena";
|
|
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 { AthenaService } from "./AthenaService.js";
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* @since 1.0.0
|
|
13
|
+
* @category athena service config
|
|
14
|
+
*/
|
|
15
|
+
const currentAthenaServiceConfig = globalValue(
|
|
16
|
+
"@effect-aws/client-athena/currentAthenaServiceConfig",
|
|
17
|
+
() => FiberRef.unsafeMake<AthenaService.Config>({}),
|
|
18
|
+
);
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* @since 1.0.0
|
|
22
|
+
* @category athena service config
|
|
23
|
+
*/
|
|
24
|
+
export const withAthenaServiceConfig: {
|
|
25
|
+
(config: AthenaService.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: AthenaService.Config): Effect.Effect<A, E, R>;
|
|
27
|
+
} = dual(
|
|
28
|
+
2,
|
|
29
|
+
<A, E, R>(effect: Effect.Effect<A, E, R>, config: AthenaService.Config): Effect.Effect<A, E, R> =>
|
|
30
|
+
Effect.locally(effect, currentAthenaServiceConfig, config),
|
|
31
|
+
);
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* @since 1.0.0
|
|
35
|
+
* @category athena service config
|
|
36
|
+
*/
|
|
37
|
+
export const setAthenaServiceConfig = (config: AthenaService.Config) =>
|
|
38
|
+
Layer.locallyScoped(currentAthenaServiceConfig, config);
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* @since 1.0.0
|
|
42
|
+
* @category adapters
|
|
43
|
+
*/
|
|
44
|
+
export const toAthenaClientConfig: Effect.Effect<AthenaClientConfig> = Effect.gen(function*() {
|
|
45
|
+
const { logger: serviceLogger, ...config } = yield* FiberRef.get(currentAthenaServiceConfig);
|
|
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/Errors.ts
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
InternalServerException,
|
|
3
|
+
InvalidRequestException,
|
|
4
|
+
MetadataException,
|
|
5
|
+
ResourceNotFoundException,
|
|
6
|
+
SessionAlreadyExistsException,
|
|
7
|
+
TooManyRequestsException,
|
|
8
|
+
} from "@aws-sdk/client-athena";
|
|
9
|
+
import type { TaggedException } from "@effect-aws/commons";
|
|
10
|
+
import { SdkError as CommonSdkError } from "@effect-aws/commons";
|
|
11
|
+
|
|
12
|
+
export const AllServiceErrors = [
|
|
13
|
+
"InternalServerException",
|
|
14
|
+
"InvalidRequestException",
|
|
15
|
+
"MetadataException",
|
|
16
|
+
"ResourceNotFoundException",
|
|
17
|
+
"SessionAlreadyExistsException",
|
|
18
|
+
"TooManyRequestsException",
|
|
19
|
+
] as const;
|
|
20
|
+
|
|
21
|
+
export type InternalServerError = TaggedException<InternalServerException>;
|
|
22
|
+
export type InvalidRequestError = TaggedException<InvalidRequestException>;
|
|
23
|
+
export type MetadataError = TaggedException<MetadataException>;
|
|
24
|
+
export type ResourceNotFoundError = TaggedException<ResourceNotFoundException>;
|
|
25
|
+
export type SessionAlreadyExistsError = TaggedException<SessionAlreadyExistsException>;
|
|
26
|
+
export type TooManyRequestsError = TaggedException<TooManyRequestsException>;
|
|
27
|
+
|
|
28
|
+
export type SdkError = CommonSdkError;
|
|
29
|
+
export const SdkError = CommonSdkError;
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @since 1.0.0
|
|
3
|
+
*/
|
|
4
|
+
import { AthenaService } from "./AthenaService.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 AthenaClientInstance from "./AthenaClientInstance.js";
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* @since 1.0.0
|
|
18
|
+
*/
|
|
19
|
+
export * as AthenaServiceConfig from "./AthenaServiceConfig.js";
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* @since 1.0.0
|
|
23
|
+
*/
|
|
24
|
+
export * from "./AthenaService.js";
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* @since 1.0.0
|
|
28
|
+
* @category exports
|
|
29
|
+
* @alias AthenaService
|
|
30
|
+
*/
|
|
31
|
+
export declare namespace Athena {
|
|
32
|
+
/**
|
|
33
|
+
* @since 1.0.0
|
|
34
|
+
* @alias AthenaService.Config
|
|
35
|
+
*/
|
|
36
|
+
export type Config = AthenaService.Config;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* @since 1.0.0
|
|
41
|
+
* @category exports
|
|
42
|
+
* @alias AthenaService
|
|
43
|
+
*/
|
|
44
|
+
export const Athena = AthenaService;
|