@effect-aws/client-bedrock-agentcore 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/BedrockAgentCoreClientInstance/package.json +6 -0
- package/BedrockAgentCoreService/package.json +6 -0
- package/BedrockAgentCoreServiceConfig/package.json +6 -0
- package/Errors/package.json +6 -0
- package/LICENSE +19 -0
- package/README.md +58 -0
- package/dist/cjs/BedrockAgentCoreClientInstance.d.ts +26 -0
- package/dist/cjs/BedrockAgentCoreClientInstance.d.ts.map +1 -0
- package/dist/cjs/BedrockAgentCoreClientInstance.js +52 -0
- package/dist/cjs/BedrockAgentCoreClientInstance.js.map +1 -0
- package/dist/cjs/BedrockAgentCoreService.d.ts +320 -0
- package/dist/cjs/BedrockAgentCoreService.d.ts.map +1 -0
- package/dist/cjs/BedrockAgentCoreService.js +138 -0
- package/dist/cjs/BedrockAgentCoreService.js.map +1 -0
- package/dist/cjs/BedrockAgentCoreServiceConfig.d.ts +26 -0
- package/dist/cjs/BedrockAgentCoreServiceConfig.d.ts.map +1 -0
- package/dist/cjs/BedrockAgentCoreServiceConfig.js +60 -0
- package/dist/cjs/BedrockAgentCoreServiceConfig.js.map +1 -0
- package/dist/cjs/Errors.d.ts +21 -0
- package/dist/cjs/Errors.d.ts.map +1 -0
- package/dist/cjs/Errors.js +20 -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/BedrockAgentCoreClientInstance.d.ts +26 -0
- package/dist/dts/BedrockAgentCoreClientInstance.d.ts.map +1 -0
- package/dist/dts/BedrockAgentCoreService.d.ts +320 -0
- package/dist/dts/BedrockAgentCoreService.d.ts.map +1 -0
- package/dist/dts/BedrockAgentCoreServiceConfig.d.ts +26 -0
- package/dist/dts/BedrockAgentCoreServiceConfig.d.ts.map +1 -0
- package/dist/dts/Errors.d.ts +21 -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/BedrockAgentCoreClientInstance.js +25 -0
- package/dist/esm/BedrockAgentCoreClientInstance.js.map +1 -0
- package/dist/esm/BedrockAgentCoreService.js +111 -0
- package/dist/esm/BedrockAgentCoreService.js.map +1 -0
- package/dist/esm/BedrockAgentCoreServiceConfig.js +33 -0
- package/dist/esm/BedrockAgentCoreServiceConfig.js.map +1 -0
- package/dist/esm/Errors.js +17 -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/BedrockAgentCoreClientInstance.ts +35 -0
- package/src/BedrockAgentCoreService.ts +1710 -0
- package/src/BedrockAgentCoreServiceConfig.ts +54 -0
- package/src/Errors.ts +50 -0
- package/src/index.ts +50 -0
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @since 1.0.0
|
|
3
|
+
*/
|
|
4
|
+
import type { BedrockAgentCoreClientConfig } from "@aws-sdk/client-bedrock-agentcore";
|
|
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 { BedrockAgentCoreService } from "./BedrockAgentCoreService.js";
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* @since 1.0.0
|
|
15
|
+
* @category bedrock-agentcore service config
|
|
16
|
+
*/
|
|
17
|
+
const currentBedrockAgentCoreServiceConfig = globalValue(
|
|
18
|
+
"@effect-aws/client-bedrock-agentcore/currentBedrockAgentCoreServiceConfig",
|
|
19
|
+
() => FiberRef.unsafeMake<BedrockAgentCoreService.Config>({}),
|
|
20
|
+
);
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* @since 1.0.0
|
|
24
|
+
* @category bedrock-agentcore service config
|
|
25
|
+
*/
|
|
26
|
+
export const withBedrockAgentCoreServiceConfig: {
|
|
27
|
+
(config: BedrockAgentCoreService.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: BedrockAgentCoreService.Config): Effect.Effect<A, E, R>;
|
|
29
|
+
} = dual(
|
|
30
|
+
2,
|
|
31
|
+
<A, E, R>(effect: Effect.Effect<A, E, R>, config: BedrockAgentCoreService.Config): Effect.Effect<A, E, R> =>
|
|
32
|
+
Effect.locally(effect, currentBedrockAgentCoreServiceConfig, config),
|
|
33
|
+
);
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* @since 1.0.0
|
|
37
|
+
* @category bedrock-agentcore service config
|
|
38
|
+
*/
|
|
39
|
+
export const setBedrockAgentCoreServiceConfig = (config: BedrockAgentCoreService.Config) =>
|
|
40
|
+
Layer.locallyScoped(currentBedrockAgentCoreServiceConfig, config);
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* @since 1.0.0
|
|
44
|
+
* @category adapters
|
|
45
|
+
*/
|
|
46
|
+
export const toBedrockAgentCoreClientConfig: Effect.Effect<BedrockAgentCoreClientConfig> = Effect.gen(function*() {
|
|
47
|
+
const { logger: serviceLogger, ...config } = yield* FiberRef.get(currentBedrockAgentCoreServiceConfig);
|
|
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,50 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
AccessDeniedException,
|
|
3
|
+
ConflictException,
|
|
4
|
+
DuplicateIdException,
|
|
5
|
+
InternalServerException,
|
|
6
|
+
InvalidInputException,
|
|
7
|
+
ResourceNotFoundException,
|
|
8
|
+
RetryableConflictException,
|
|
9
|
+
RuntimeClientError as RuntimeClientException,
|
|
10
|
+
ServiceException,
|
|
11
|
+
ServiceQuotaExceededException,
|
|
12
|
+
ThrottledException,
|
|
13
|
+
ThrottlingException,
|
|
14
|
+
UnauthorizedException,
|
|
15
|
+
ValidationException,
|
|
16
|
+
} from "@aws-sdk/client-bedrock-agentcore";
|
|
17
|
+
import type { TaggedException } from "@effect-aws/commons/Errors";
|
|
18
|
+
|
|
19
|
+
export const AllServiceErrors = [
|
|
20
|
+
"AccessDeniedException",
|
|
21
|
+
"ConflictException",
|
|
22
|
+
"DuplicateIdException",
|
|
23
|
+
"InternalServerException",
|
|
24
|
+
"InvalidInputException",
|
|
25
|
+
"ResourceNotFoundException",
|
|
26
|
+
"RetryableConflictException",
|
|
27
|
+
"RuntimeClientError",
|
|
28
|
+
"ServiceException",
|
|
29
|
+
"ServiceQuotaExceededException",
|
|
30
|
+
"ThrottledException",
|
|
31
|
+
"ThrottlingException",
|
|
32
|
+
"UnauthorizedException",
|
|
33
|
+
"ValidationException",
|
|
34
|
+
] as const;
|
|
35
|
+
|
|
36
|
+
export type AccessDeniedError = TaggedException<AccessDeniedException>;
|
|
37
|
+
export type ConflictError = TaggedException<ConflictException>;
|
|
38
|
+
export type DuplicateIdError = TaggedException<DuplicateIdException>;
|
|
39
|
+
export type InternalServerError = TaggedException<InternalServerException>;
|
|
40
|
+
export type InvalidInputError = TaggedException<InvalidInputException>;
|
|
41
|
+
export type ResourceNotFoundError = TaggedException<ResourceNotFoundException>;
|
|
42
|
+
export type RetryableConflictError = TaggedException<RetryableConflictException>;
|
|
43
|
+
export type RuntimeClientError = TaggedException<RuntimeClientException>;
|
|
44
|
+
export type ServiceError = TaggedException<ServiceException>;
|
|
45
|
+
export type ServiceQuotaExceededError = TaggedException<ServiceQuotaExceededException>;
|
|
46
|
+
export type ThrottledError = TaggedException<ThrottledException>;
|
|
47
|
+
export type ThrottlingError = TaggedException<ThrottlingException>;
|
|
48
|
+
export type UnauthorizedError = TaggedException<UnauthorizedException>;
|
|
49
|
+
export type ValidationError = TaggedException<ValidationException>;
|
|
50
|
+
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 { BedrockAgentCoreService } from "./BedrockAgentCoreService.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 BedrockAgentCoreClientInstance from "./BedrockAgentCoreClientInstance.js";
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* @since 1.0.0
|
|
18
|
+
*/
|
|
19
|
+
export * as BedrockAgentCoreServiceConfig from "./BedrockAgentCoreServiceConfig.js";
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* @since 1.0.0
|
|
23
|
+
*/
|
|
24
|
+
export * from "./BedrockAgentCoreService.js";
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* @since 1.0.0
|
|
28
|
+
* @category exports
|
|
29
|
+
* @alias BedrockAgentCoreService
|
|
30
|
+
*/
|
|
31
|
+
export declare namespace BedrockAgentCore {
|
|
32
|
+
/**
|
|
33
|
+
* @since 1.0.0
|
|
34
|
+
* @alias BedrockAgentCoreService.Config
|
|
35
|
+
*/
|
|
36
|
+
export type Config = BedrockAgentCoreService.Config;
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* @since 1.0.0
|
|
40
|
+
* @alias BedrockAgentCoreService.Type
|
|
41
|
+
*/
|
|
42
|
+
export type Type = BedrockAgentCoreService.Type;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* @since 1.0.0
|
|
47
|
+
* @category exports
|
|
48
|
+
* @alias BedrockAgentCoreService
|
|
49
|
+
*/
|
|
50
|
+
export const BedrockAgentCore = BedrockAgentCoreService;
|