@effect-aws/client-bedrock-agent 1.11.2
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/BedrockAgentClientInstance/package.json +6 -0
- package/BedrockAgentService/package.json +6 -0
- package/BedrockAgentServiceConfig/package.json +6 -0
- package/Errors/package.json +6 -0
- package/LICENSE +19 -0
- package/README.md +58 -0
- package/dist/cjs/BedrockAgentClientInstance.d.ts +26 -0
- package/dist/cjs/BedrockAgentClientInstance.d.ts.map +1 -0
- package/dist/cjs/BedrockAgentClientInstance.js +52 -0
- package/dist/cjs/BedrockAgentClientInstance.js.map +1 -0
- package/dist/cjs/BedrockAgentService.d.ts +351 -0
- package/dist/cjs/BedrockAgentService.d.ts.map +1 -0
- package/dist/cjs/BedrockAgentService.js +148 -0
- package/dist/cjs/BedrockAgentService.js.map +1 -0
- package/dist/cjs/BedrockAgentServiceConfig.d.ts +26 -0
- package/dist/cjs/BedrockAgentServiceConfig.d.ts.map +1 -0
- package/dist/cjs/BedrockAgentServiceConfig.js +60 -0
- package/dist/cjs/BedrockAgentServiceConfig.js.map +1 -0
- package/dist/cjs/Errors.d.ts +14 -0
- package/dist/cjs/Errors.d.ts.map +1 -0
- package/dist/cjs/Errors.js +13 -0
- package/dist/cjs/Errors.js.map +1 -0
- package/dist/cjs/index.d.ts +44 -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/BedrockAgentClientInstance.d.ts +26 -0
- package/dist/dts/BedrockAgentClientInstance.d.ts.map +1 -0
- package/dist/dts/BedrockAgentService.d.ts +351 -0
- package/dist/dts/BedrockAgentService.d.ts.map +1 -0
- package/dist/dts/BedrockAgentServiceConfig.d.ts +26 -0
- package/dist/dts/BedrockAgentServiceConfig.d.ts.map +1 -0
- package/dist/dts/Errors.d.ts +14 -0
- package/dist/dts/Errors.d.ts.map +1 -0
- package/dist/dts/index.d.ts +44 -0
- package/dist/dts/index.d.ts.map +1 -0
- package/dist/esm/BedrockAgentClientInstance.js +25 -0
- package/dist/esm/BedrockAgentClientInstance.js.map +1 -0
- package/dist/esm/BedrockAgentService.js +121 -0
- package/dist/esm/BedrockAgentService.js.map +1 -0
- package/dist/esm/BedrockAgentServiceConfig.js +33 -0
- package/dist/esm/BedrockAgentServiceConfig.js.map +1 -0
- package/dist/esm/Errors.js +10 -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/BedrockAgentClientInstance.ts +35 -0
- package/src/BedrockAgentService.ts +1854 -0
- package/src/BedrockAgentServiceConfig.ts +54 -0
- package/src/Errors.ts +29 -0
- package/src/index.ts +50 -0
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @since 1.0.0
|
|
3
|
+
*/
|
|
4
|
+
import type { BedrockAgentClientConfig } from "@aws-sdk/client-bedrock-agent";
|
|
5
|
+
import * as ServiceLogger from "@effect-aws/commons/ServiceLogger";
|
|
6
|
+
import * as Effect from "effect/Effect";
|
|
7
|
+
import * as FiberRef from "effect/FiberRef";
|
|
8
|
+
import { dual } from "effect/Function";
|
|
9
|
+
import { globalValue } from "effect/GlobalValue";
|
|
10
|
+
import * as Layer from "effect/Layer";
|
|
11
|
+
import type { BedrockAgentService } from "./BedrockAgentService.js";
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* @since 1.0.0
|
|
15
|
+
* @category bedrock-agent service config
|
|
16
|
+
*/
|
|
17
|
+
const currentBedrockAgentServiceConfig = globalValue(
|
|
18
|
+
"@effect-aws/client-bedrock-agent/currentBedrockAgentServiceConfig",
|
|
19
|
+
() => FiberRef.unsafeMake<BedrockAgentService.Config>({}),
|
|
20
|
+
);
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* @since 1.0.0
|
|
24
|
+
* @category bedrock-agent service config
|
|
25
|
+
*/
|
|
26
|
+
export const withBedrockAgentServiceConfig: {
|
|
27
|
+
(config: BedrockAgentService.Config): <A, E, R>(effect: Effect.Effect<A, E, R>) => Effect.Effect<A, E, R>;
|
|
28
|
+
<A, E, R>(effect: Effect.Effect<A, E, R>, config: BedrockAgentService.Config): Effect.Effect<A, E, R>;
|
|
29
|
+
} = dual(
|
|
30
|
+
2,
|
|
31
|
+
<A, E, R>(effect: Effect.Effect<A, E, R>, config: BedrockAgentService.Config): Effect.Effect<A, E, R> =>
|
|
32
|
+
Effect.locally(effect, currentBedrockAgentServiceConfig, config),
|
|
33
|
+
);
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* @since 1.0.0
|
|
37
|
+
* @category bedrock-agent service config
|
|
38
|
+
*/
|
|
39
|
+
export const setBedrockAgentServiceConfig = (config: BedrockAgentService.Config) =>
|
|
40
|
+
Layer.locallyScoped(currentBedrockAgentServiceConfig, config);
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* @since 1.0.0
|
|
44
|
+
* @category adapters
|
|
45
|
+
*/
|
|
46
|
+
export const toBedrockAgentClientConfig: Effect.Effect<BedrockAgentClientConfig> = Effect.gen(function*() {
|
|
47
|
+
const { logger: serviceLogger, ...config } = yield* FiberRef.get(currentBedrockAgentServiceConfig);
|
|
48
|
+
|
|
49
|
+
const logger = serviceLogger === true
|
|
50
|
+
? yield* ServiceLogger.toClientLogger(ServiceLogger.defaultServiceLogger)
|
|
51
|
+
: (serviceLogger ? yield* ServiceLogger.toClientLogger(ServiceLogger.make(serviceLogger)) : undefined);
|
|
52
|
+
|
|
53
|
+
return { logger, ...config };
|
|
54
|
+
});
|
package/src/Errors.ts
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
AccessDeniedException,
|
|
3
|
+
ConflictException,
|
|
4
|
+
InternalServerException,
|
|
5
|
+
ResourceNotFoundException,
|
|
6
|
+
ServiceQuotaExceededException,
|
|
7
|
+
ThrottlingException,
|
|
8
|
+
ValidationException,
|
|
9
|
+
} from "@aws-sdk/client-bedrock-agent";
|
|
10
|
+
import type { TaggedException } from "@effect-aws/commons/Errors";
|
|
11
|
+
|
|
12
|
+
export const AllServiceErrors = [
|
|
13
|
+
"AccessDeniedException",
|
|
14
|
+
"ConflictException",
|
|
15
|
+
"InternalServerException",
|
|
16
|
+
"ResourceNotFoundException",
|
|
17
|
+
"ServiceQuotaExceededException",
|
|
18
|
+
"ThrottlingException",
|
|
19
|
+
"ValidationException",
|
|
20
|
+
] as const;
|
|
21
|
+
|
|
22
|
+
export type AccessDeniedError = TaggedException<AccessDeniedException>;
|
|
23
|
+
export type ConflictError = TaggedException<ConflictException>;
|
|
24
|
+
export type InternalServerError = TaggedException<InternalServerException>;
|
|
25
|
+
export type ResourceNotFoundError = TaggedException<ResourceNotFoundException>;
|
|
26
|
+
export type ServiceQuotaExceededError = TaggedException<ServiceQuotaExceededException>;
|
|
27
|
+
export type ThrottlingError = TaggedException<ThrottlingException>;
|
|
28
|
+
export type ValidationError = TaggedException<ValidationException>;
|
|
29
|
+
export type SdkError = TaggedException<Error & { name: "SdkError" }>;
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @since 1.0.0
|
|
3
|
+
*/
|
|
4
|
+
import { BedrockAgentService } from "./BedrockAgentService.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 BedrockAgentClientInstance from "./BedrockAgentClientInstance.js";
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* @since 1.0.0
|
|
18
|
+
*/
|
|
19
|
+
export * as BedrockAgentServiceConfig from "./BedrockAgentServiceConfig.js";
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* @since 1.0.0
|
|
23
|
+
*/
|
|
24
|
+
export * from "./BedrockAgentService.js";
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* @since 1.0.0
|
|
28
|
+
* @category exports
|
|
29
|
+
* @alias BedrockAgentService
|
|
30
|
+
*/
|
|
31
|
+
export declare namespace BedrockAgent {
|
|
32
|
+
/**
|
|
33
|
+
* @since 1.0.0
|
|
34
|
+
* @alias BedrockAgentService.Config
|
|
35
|
+
*/
|
|
36
|
+
export type Config = BedrockAgentService.Config;
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* @since 1.0.0
|
|
40
|
+
* @alias BedrockAgentService.Type
|
|
41
|
+
*/
|
|
42
|
+
export type Type = BedrockAgentService.Type;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* @since 1.0.0
|
|
47
|
+
* @category exports
|
|
48
|
+
* @alias BedrockAgentService
|
|
49
|
+
*/
|
|
50
|
+
export const BedrockAgent = BedrockAgentService;
|