fakecloud 0.6.0 → 0.7.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/README.md CHANGED
@@ -125,6 +125,32 @@ Top-level client. Defaults to `http://localhost:4566`.
125
125
  | `expireTokens(req)` | Expire tokens (optionally filtered) |
126
126
  | `getAuthEvents()` | List auth events |
127
127
 
128
+ ### `fc.rds`
129
+
130
+ | Method | Description |
131
+ | ---------------- | ---------------------------------------- |
132
+ | `getInstances()` | List RDS instances with runtime metadata |
133
+
134
+ ### `fc.elasticache`
135
+
136
+ | Method | Description |
137
+ | ------------------------ | ----------------------------------- |
138
+ | `getClusters()` | List ElastiCache cache clusters |
139
+ | `getReplicationGroups()` | List ElastiCache replication groups |
140
+ | `getServerlessCaches()` | List ElastiCache serverless caches |
141
+
142
+ ### `fc.stepfunctions`
143
+
144
+ | Method | Description |
145
+ | ----------------- | ---------------------------------------- |
146
+ | `getExecutions()` | List all state machine execution history |
147
+
148
+ ### `fc.apigatewayv2`
149
+
150
+ | Method | Description |
151
+ | --------------- | ----------------------------------- |
152
+ | `getRequests()` | List all HTTP API requests received |
153
+
128
154
  ### Error handling
129
155
 
130
156
  All methods throw `FakeCloudError` on non-2xx responses:
package/dist/client.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { 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 } from "./types.js";
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";
2
2
  export declare class FakeCloudError extends Error {
3
3
  readonly status: number;
4
4
  readonly body: string;
@@ -75,6 +75,16 @@ export declare class CognitoClient {
75
75
  expireTokens(req: ExpireTokensRequest): Promise<ExpireTokensResponse>;
76
76
  getAuthEvents(): Promise<AuthEventsResponse>;
77
77
  }
78
+ export declare class ApiGatewayV2Client {
79
+ private readonly baseUrl;
80
+ constructor(baseUrl: string);
81
+ getRequests(): Promise<ApiGatewayV2RequestsResponse>;
82
+ }
83
+ export declare class StepFunctionsClient {
84
+ private readonly baseUrl;
85
+ constructor(baseUrl: string);
86
+ getExecutions(): Promise<StepFunctionsExecutionsResponse>;
87
+ }
78
88
  export declare class FakeCloud {
79
89
  private readonly baseUrl;
80
90
  private readonly _lambda;
@@ -88,6 +98,8 @@ export declare class FakeCloud {
88
98
  private readonly _dynamodb;
89
99
  private readonly _secretsmanager;
90
100
  private readonly _cognito;
101
+ private readonly _apigatewayv2;
102
+ private readonly _stepfunctions;
91
103
  constructor(baseUrl?: string);
92
104
  health(): Promise<HealthResponse>;
93
105
  reset(): Promise<ResetResponse>;
@@ -103,4 +115,6 @@ export declare class FakeCloud {
103
115
  get dynamodb(): DynamoDbClient;
104
116
  get secretsmanager(): SecretsManagerClient;
105
117
  get cognito(): CognitoClient;
118
+ get apigatewayv2(): ApiGatewayV2Client;
119
+ get stepfunctions(): StepFunctionsClient;
106
120
  }
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.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.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;
@@ -230,6 +230,28 @@ class CognitoClient {
230
230
  }
231
231
  }
232
232
  exports.CognitoClient = CognitoClient;
233
+ class ApiGatewayV2Client {
234
+ baseUrl;
235
+ constructor(baseUrl) {
236
+ this.baseUrl = baseUrl;
237
+ }
238
+ async getRequests() {
239
+ const resp = await fetch(`${this.baseUrl}/_fakecloud/apigatewayv2/requests`);
240
+ return parse(resp);
241
+ }
242
+ }
243
+ exports.ApiGatewayV2Client = ApiGatewayV2Client;
244
+ class StepFunctionsClient {
245
+ baseUrl;
246
+ constructor(baseUrl) {
247
+ this.baseUrl = baseUrl;
248
+ }
249
+ async getExecutions() {
250
+ const resp = await fetch(`${this.baseUrl}/_fakecloud/stepfunctions/executions`);
251
+ return parse(resp);
252
+ }
253
+ }
254
+ exports.StepFunctionsClient = StepFunctionsClient;
233
255
  // ── Main client ────────────────────────────────────────────────────
234
256
  class FakeCloud {
235
257
  baseUrl;
@@ -244,6 +266,8 @@ class FakeCloud {
244
266
  _dynamodb;
245
267
  _secretsmanager;
246
268
  _cognito;
269
+ _apigatewayv2;
270
+ _stepfunctions;
247
271
  constructor(baseUrl = "http://localhost:4566") {
248
272
  this.baseUrl = baseUrl.replace(/\/+$/, "");
249
273
  this._lambda = new LambdaClient(this.baseUrl);
@@ -257,6 +281,8 @@ class FakeCloud {
257
281
  this._dynamodb = new DynamoDbClient(this.baseUrl);
258
282
  this._secretsmanager = new SecretsManagerClient(this.baseUrl);
259
283
  this._cognito = new CognitoClient(this.baseUrl);
284
+ this._apigatewayv2 = new ApiGatewayV2Client(this.baseUrl);
285
+ this._stepfunctions = new StepFunctionsClient(this.baseUrl);
260
286
  }
261
287
  // ── Health & Reset ─────────────────────────────────────────────
262
288
  async health() {
@@ -305,5 +331,11 @@ class FakeCloud {
305
331
  get cognito() {
306
332
  return this._cognito;
307
333
  }
334
+ get apigatewayv2() {
335
+ return this._apigatewayv2;
336
+ }
337
+ get stepfunctions() {
338
+ return this._stepfunctions;
339
+ }
308
340
  }
309
341
  exports.FakeCloud = FakeCloud;
package/dist/types.d.ts CHANGED
@@ -283,3 +283,31 @@ export interface AuthEvent {
283
283
  export interface AuthEventsResponse {
284
284
  events: AuthEvent[];
285
285
  }
286
+ export interface StepFunctionsExecution {
287
+ executionArn: string;
288
+ stateMachineArn: string;
289
+ name: string;
290
+ status: string;
291
+ startDate: string;
292
+ input?: string | null;
293
+ output?: string | null;
294
+ stopDate?: string | null;
295
+ }
296
+ export interface StepFunctionsExecutionsResponse {
297
+ executions: StepFunctionsExecution[];
298
+ }
299
+ export interface ApiGatewayV2Request {
300
+ requestId: string;
301
+ apiId: string;
302
+ stage: string;
303
+ method: string;
304
+ path: string;
305
+ headers: Record<string, string>;
306
+ queryParams: Record<string, string>;
307
+ body?: string | null;
308
+ timestamp: string;
309
+ statusCode: number;
310
+ }
311
+ export interface ApiGatewayV2RequestsResponse {
312
+ requests: ApiGatewayV2Request[];
313
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fakecloud",
3
- "version": "0.6.0",
3
+ "version": "0.7.0",
4
4
  "description": "Client SDK for fakecloud — local AWS cloud emulator",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",