fakecloud 0.7.0 → 0.8.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.
- package/dist/client.d.ts +9 -1
- package/dist/client.js +25 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -1
- package/dist/types.d.ts +13 -0
- package/package.json +1 -1
package/dist/client.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ApiGatewayV2RequestsResponse, HealthResponse, ResetResponse, ResetServiceResponse, RdsInstancesResponse, ElastiCacheClustersResponse, ElastiCacheReplicationGroupsResponse, ElastiCacheServerlessCachesResponse, LambdaInvocationsResponse, WarmContainersResponse, EvictContainerResponse, SesEmailsResponse, InboundEmailRequest, InboundEmailResponse, SnsMessagesResponse, PendingConfirmationsResponse, ConfirmSubscriptionRequest, ConfirmSubscriptionResponse, SqsMessagesResponse, ExpirationTickResponse, ForceDlqResponse, EventHistoryResponse, FireRuleRequest, FireRuleResponse, S3NotificationsResponse, LifecycleTickResponse, TtlTickResponse, RotationTickResponse, UserConfirmationCodes, ConfirmationCodesResponse, ConfirmUserRequest, ConfirmUserResponse, TokensResponse, ExpireTokensRequest, ExpireTokensResponse, AuthEventsResponse, StepFunctionsExecutionsResponse } from "./types.js";
|
|
1
|
+
import type { ApiGatewayV2RequestsResponse, BedrockInvocationsResponse, BedrockModelResponseConfig, HealthResponse, ResetResponse, ResetServiceResponse, RdsInstancesResponse, ElastiCacheClustersResponse, ElastiCacheReplicationGroupsResponse, ElastiCacheServerlessCachesResponse, LambdaInvocationsResponse, WarmContainersResponse, EvictContainerResponse, SesEmailsResponse, InboundEmailRequest, InboundEmailResponse, SnsMessagesResponse, PendingConfirmationsResponse, ConfirmSubscriptionRequest, ConfirmSubscriptionResponse, SqsMessagesResponse, ExpirationTickResponse, ForceDlqResponse, EventHistoryResponse, FireRuleRequest, FireRuleResponse, S3NotificationsResponse, LifecycleTickResponse, TtlTickResponse, RotationTickResponse, UserConfirmationCodes, ConfirmationCodesResponse, ConfirmUserRequest, ConfirmUserResponse, TokensResponse, ExpireTokensRequest, ExpireTokensResponse, AuthEventsResponse, StepFunctionsExecutionsResponse } from "./types.js";
|
|
2
2
|
export declare class FakeCloudError extends Error {
|
|
3
3
|
readonly status: number;
|
|
4
4
|
readonly body: string;
|
|
@@ -85,6 +85,12 @@ export declare class StepFunctionsClient {
|
|
|
85
85
|
constructor(baseUrl: string);
|
|
86
86
|
getExecutions(): Promise<StepFunctionsExecutionsResponse>;
|
|
87
87
|
}
|
|
88
|
+
export declare class BedrockClient {
|
|
89
|
+
private readonly baseUrl;
|
|
90
|
+
constructor(baseUrl: string);
|
|
91
|
+
getInvocations(): Promise<BedrockInvocationsResponse>;
|
|
92
|
+
setModelResponse(modelId: string, response: string): Promise<BedrockModelResponseConfig>;
|
|
93
|
+
}
|
|
88
94
|
export declare class FakeCloud {
|
|
89
95
|
private readonly baseUrl;
|
|
90
96
|
private readonly _lambda;
|
|
@@ -100,6 +106,7 @@ export declare class FakeCloud {
|
|
|
100
106
|
private readonly _cognito;
|
|
101
107
|
private readonly _apigatewayv2;
|
|
102
108
|
private readonly _stepfunctions;
|
|
109
|
+
private readonly _bedrock;
|
|
103
110
|
constructor(baseUrl?: string);
|
|
104
111
|
health(): Promise<HealthResponse>;
|
|
105
112
|
reset(): Promise<ResetResponse>;
|
|
@@ -117,4 +124,5 @@ export declare class FakeCloud {
|
|
|
117
124
|
get cognito(): CognitoClient;
|
|
118
125
|
get apigatewayv2(): ApiGatewayV2Client;
|
|
119
126
|
get stepfunctions(): StepFunctionsClient;
|
|
127
|
+
get bedrock(): BedrockClient;
|
|
120
128
|
}
|
package/dist/client.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.FakeCloud = exports.StepFunctionsClient = exports.ApiGatewayV2Client = exports.CognitoClient = exports.SecretsManagerClient = exports.DynamoDbClient = exports.S3Client = exports.EventsClient = exports.SqsClient = exports.SnsClient = exports.SesClient = exports.ElastiCacheClient = exports.RdsClient = exports.LambdaClient = exports.FakeCloudError = void 0;
|
|
3
|
+
exports.FakeCloud = exports.BedrockClient = exports.StepFunctionsClient = exports.ApiGatewayV2Client = exports.CognitoClient = exports.SecretsManagerClient = exports.DynamoDbClient = exports.S3Client = exports.EventsClient = exports.SqsClient = exports.SnsClient = exports.SesClient = exports.ElastiCacheClient = exports.RdsClient = exports.LambdaClient = exports.FakeCloudError = void 0;
|
|
4
4
|
class FakeCloudError extends Error {
|
|
5
5
|
status;
|
|
6
6
|
body;
|
|
@@ -252,6 +252,25 @@ class StepFunctionsClient {
|
|
|
252
252
|
}
|
|
253
253
|
}
|
|
254
254
|
exports.StepFunctionsClient = StepFunctionsClient;
|
|
255
|
+
class BedrockClient {
|
|
256
|
+
baseUrl;
|
|
257
|
+
constructor(baseUrl) {
|
|
258
|
+
this.baseUrl = baseUrl;
|
|
259
|
+
}
|
|
260
|
+
async getInvocations() {
|
|
261
|
+
const resp = await fetch(`${this.baseUrl}/_fakecloud/bedrock/invocations`);
|
|
262
|
+
return parse(resp);
|
|
263
|
+
}
|
|
264
|
+
async setModelResponse(modelId, response) {
|
|
265
|
+
const resp = await fetch(`${this.baseUrl}/_fakecloud/bedrock/models/${encodeURIComponent(modelId)}/response`, {
|
|
266
|
+
method: "POST",
|
|
267
|
+
headers: { "Content-Type": "text/plain" },
|
|
268
|
+
body: response,
|
|
269
|
+
});
|
|
270
|
+
return parse(resp);
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
exports.BedrockClient = BedrockClient;
|
|
255
274
|
// ── Main client ────────────────────────────────────────────────────
|
|
256
275
|
class FakeCloud {
|
|
257
276
|
baseUrl;
|
|
@@ -268,6 +287,7 @@ class FakeCloud {
|
|
|
268
287
|
_cognito;
|
|
269
288
|
_apigatewayv2;
|
|
270
289
|
_stepfunctions;
|
|
290
|
+
_bedrock;
|
|
271
291
|
constructor(baseUrl = "http://localhost:4566") {
|
|
272
292
|
this.baseUrl = baseUrl.replace(/\/+$/, "");
|
|
273
293
|
this._lambda = new LambdaClient(this.baseUrl);
|
|
@@ -283,6 +303,7 @@ class FakeCloud {
|
|
|
283
303
|
this._cognito = new CognitoClient(this.baseUrl);
|
|
284
304
|
this._apigatewayv2 = new ApiGatewayV2Client(this.baseUrl);
|
|
285
305
|
this._stepfunctions = new StepFunctionsClient(this.baseUrl);
|
|
306
|
+
this._bedrock = new BedrockClient(this.baseUrl);
|
|
286
307
|
}
|
|
287
308
|
// ── Health & Reset ─────────────────────────────────────────────
|
|
288
309
|
async health() {
|
|
@@ -337,5 +358,8 @@ class FakeCloud {
|
|
|
337
358
|
get stepfunctions() {
|
|
338
359
|
return this._stepfunctions;
|
|
339
360
|
}
|
|
361
|
+
get bedrock() {
|
|
362
|
+
return this._bedrock;
|
|
363
|
+
}
|
|
340
364
|
}
|
|
341
365
|
exports.FakeCloud = FakeCloud;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { FakeCloud, FakeCloudError } from "./client.js";
|
|
2
|
-
export { LambdaClient, RdsClient, ElastiCacheClient, SesClient, SnsClient, SqsClient, EventsClient, S3Client, DynamoDbClient, SecretsManagerClient, CognitoClient, } from "./client.js";
|
|
2
|
+
export { LambdaClient, RdsClient, ElastiCacheClient, SesClient, SnsClient, SqsClient, EventsClient, S3Client, DynamoDbClient, SecretsManagerClient, CognitoClient, BedrockClient, } from "./client.js";
|
|
3
3
|
export type * from "./types.js";
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CognitoClient = exports.SecretsManagerClient = exports.DynamoDbClient = exports.S3Client = exports.EventsClient = exports.SqsClient = exports.SnsClient = exports.SesClient = exports.ElastiCacheClient = exports.RdsClient = exports.LambdaClient = exports.FakeCloudError = exports.FakeCloud = void 0;
|
|
3
|
+
exports.BedrockClient = exports.CognitoClient = exports.SecretsManagerClient = exports.DynamoDbClient = exports.S3Client = exports.EventsClient = exports.SqsClient = exports.SnsClient = exports.SesClient = exports.ElastiCacheClient = exports.RdsClient = exports.LambdaClient = exports.FakeCloudError = exports.FakeCloud = void 0;
|
|
4
4
|
var client_js_1 = require("./client.js");
|
|
5
5
|
Object.defineProperty(exports, "FakeCloud", { enumerable: true, get: function () { return client_js_1.FakeCloud; } });
|
|
6
6
|
Object.defineProperty(exports, "FakeCloudError", { enumerable: true, get: function () { return client_js_1.FakeCloudError; } });
|
|
@@ -16,3 +16,4 @@ Object.defineProperty(exports, "S3Client", { enumerable: true, get: function ()
|
|
|
16
16
|
Object.defineProperty(exports, "DynamoDbClient", { enumerable: true, get: function () { return client_js_2.DynamoDbClient; } });
|
|
17
17
|
Object.defineProperty(exports, "SecretsManagerClient", { enumerable: true, get: function () { return client_js_2.SecretsManagerClient; } });
|
|
18
18
|
Object.defineProperty(exports, "CognitoClient", { enumerable: true, get: function () { return client_js_2.CognitoClient; } });
|
|
19
|
+
Object.defineProperty(exports, "BedrockClient", { enumerable: true, get: function () { return client_js_2.BedrockClient; } });
|
package/dist/types.d.ts
CHANGED
|
@@ -296,6 +296,19 @@ export interface StepFunctionsExecution {
|
|
|
296
296
|
export interface StepFunctionsExecutionsResponse {
|
|
297
297
|
executions: StepFunctionsExecution[];
|
|
298
298
|
}
|
|
299
|
+
export interface BedrockInvocation {
|
|
300
|
+
modelId: string;
|
|
301
|
+
input: string;
|
|
302
|
+
output: string;
|
|
303
|
+
timestamp: string;
|
|
304
|
+
}
|
|
305
|
+
export interface BedrockInvocationsResponse {
|
|
306
|
+
invocations: BedrockInvocation[];
|
|
307
|
+
}
|
|
308
|
+
export interface BedrockModelResponseConfig {
|
|
309
|
+
status: string;
|
|
310
|
+
modelId: string;
|
|
311
|
+
}
|
|
299
312
|
export interface ApiGatewayV2Request {
|
|
300
313
|
requestId: string;
|
|
301
314
|
apiId: string;
|