fakecloud 0.5.0 → 0.6.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 CHANGED
@@ -1,4 +1,4 @@
1
- import type { HealthResponse, ResetResponse, ResetServiceResponse, 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 { 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";
2
2
  export declare class FakeCloudError extends Error {
3
3
  readonly status: number;
4
4
  readonly body: string;
@@ -11,6 +11,18 @@ export declare class LambdaClient {
11
11
  getWarmContainers(): Promise<WarmContainersResponse>;
12
12
  evictContainer(functionName: string): Promise<EvictContainerResponse>;
13
13
  }
14
+ export declare class RdsClient {
15
+ private baseUrl;
16
+ constructor(baseUrl: string);
17
+ getInstances(): Promise<RdsInstancesResponse>;
18
+ }
19
+ export declare class ElastiCacheClient {
20
+ private baseUrl;
21
+ constructor(baseUrl: string);
22
+ getClusters(): Promise<ElastiCacheClustersResponse>;
23
+ getReplicationGroups(): Promise<ElastiCacheReplicationGroupsResponse>;
24
+ getServerlessCaches(): Promise<ElastiCacheServerlessCachesResponse>;
25
+ }
14
26
  export declare class SesClient {
15
27
  private baseUrl;
16
28
  constructor(baseUrl: string);
@@ -66,6 +78,8 @@ export declare class CognitoClient {
66
78
  export declare class FakeCloud {
67
79
  private readonly baseUrl;
68
80
  private readonly _lambda;
81
+ private readonly _rds;
82
+ private readonly _elasticache;
69
83
  private readonly _ses;
70
84
  private readonly _sns;
71
85
  private readonly _sqs;
@@ -79,6 +93,8 @@ export declare class FakeCloud {
79
93
  reset(): Promise<ResetResponse>;
80
94
  resetService(service: string): Promise<ResetServiceResponse>;
81
95
  get lambda(): LambdaClient;
96
+ get rds(): RdsClient;
97
+ get elasticache(): ElastiCacheClient;
82
98
  get ses(): SesClient;
83
99
  get sns(): SnsClient;
84
100
  get sqs(): SqsClient;
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.LambdaClient = exports.FakeCloudError = void 0;
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;
4
4
  class FakeCloudError extends Error {
5
5
  status;
6
6
  body;
@@ -39,6 +39,36 @@ class LambdaClient {
39
39
  }
40
40
  }
41
41
  exports.LambdaClient = LambdaClient;
42
+ class RdsClient {
43
+ baseUrl;
44
+ constructor(baseUrl) {
45
+ this.baseUrl = baseUrl;
46
+ }
47
+ async getInstances() {
48
+ const resp = await fetch(`${this.baseUrl}/_fakecloud/rds/instances`);
49
+ return parse(resp);
50
+ }
51
+ }
52
+ exports.RdsClient = RdsClient;
53
+ class ElastiCacheClient {
54
+ baseUrl;
55
+ constructor(baseUrl) {
56
+ this.baseUrl = baseUrl;
57
+ }
58
+ async getClusters() {
59
+ const resp = await fetch(`${this.baseUrl}/_fakecloud/elasticache/clusters`);
60
+ return parse(resp);
61
+ }
62
+ async getReplicationGroups() {
63
+ const resp = await fetch(`${this.baseUrl}/_fakecloud/elasticache/replication-groups`);
64
+ return parse(resp);
65
+ }
66
+ async getServerlessCaches() {
67
+ const resp = await fetch(`${this.baseUrl}/_fakecloud/elasticache/serverless-caches`);
68
+ return parse(resp);
69
+ }
70
+ }
71
+ exports.ElastiCacheClient = ElastiCacheClient;
42
72
  class SesClient {
43
73
  baseUrl;
44
74
  constructor(baseUrl) {
@@ -204,6 +234,8 @@ exports.CognitoClient = CognitoClient;
204
234
  class FakeCloud {
205
235
  baseUrl;
206
236
  _lambda;
237
+ _rds;
238
+ _elasticache;
207
239
  _ses;
208
240
  _sns;
209
241
  _sqs;
@@ -215,6 +247,8 @@ class FakeCloud {
215
247
  constructor(baseUrl = "http://localhost:4566") {
216
248
  this.baseUrl = baseUrl.replace(/\/+$/, "");
217
249
  this._lambda = new LambdaClient(this.baseUrl);
250
+ this._rds = new RdsClient(this.baseUrl);
251
+ this._elasticache = new ElastiCacheClient(this.baseUrl);
218
252
  this._ses = new SesClient(this.baseUrl);
219
253
  this._sns = new SnsClient(this.baseUrl);
220
254
  this._sqs = new SqsClient(this.baseUrl);
@@ -241,6 +275,12 @@ class FakeCloud {
241
275
  get lambda() {
242
276
  return this._lambda;
243
277
  }
278
+ get rds() {
279
+ return this._rds;
280
+ }
281
+ get elasticache() {
282
+ return this._elasticache;
283
+ }
244
284
  get ses() {
245
285
  return this._ses;
246
286
  }
package/dist/index.d.ts CHANGED
@@ -1,3 +1,3 @@
1
1
  export { FakeCloud, FakeCloudError } from "./client.js";
2
- export { LambdaClient, SesClient, SnsClient, SqsClient, EventsClient, S3Client, DynamoDbClient, SecretsManagerClient, CognitoClient, } from "./client.js";
2
+ export { LambdaClient, RdsClient, ElastiCacheClient, SesClient, SnsClient, SqsClient, EventsClient, S3Client, DynamoDbClient, SecretsManagerClient, CognitoClient, } from "./client.js";
3
3
  export type * from "./types.js";
package/dist/index.js CHANGED
@@ -1,11 +1,13 @@
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.LambdaClient = exports.FakeCloudError = exports.FakeCloud = void 0;
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;
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; } });
7
7
  var client_js_2 = require("./client.js");
8
8
  Object.defineProperty(exports, "LambdaClient", { enumerable: true, get: function () { return client_js_2.LambdaClient; } });
9
+ Object.defineProperty(exports, "RdsClient", { enumerable: true, get: function () { return client_js_2.RdsClient; } });
10
+ Object.defineProperty(exports, "ElastiCacheClient", { enumerable: true, get: function () { return client_js_2.ElastiCacheClient; } });
9
11
  Object.defineProperty(exports, "SesClient", { enumerable: true, get: function () { return client_js_2.SesClient; } });
10
12
  Object.defineProperty(exports, "SnsClient", { enumerable: true, get: function () { return client_js_2.SnsClient; } });
11
13
  Object.defineProperty(exports, "SqsClient", { enumerable: true, get: function () { return client_js_2.SqsClient; } });
package/dist/types.d.ts CHANGED
@@ -9,6 +9,73 @@ export interface ResetResponse {
9
9
  export interface ResetServiceResponse {
10
10
  reset: string;
11
11
  }
12
+ export interface RdsTag {
13
+ key: string;
14
+ value: string;
15
+ }
16
+ export interface RdsInstance {
17
+ dbInstanceIdentifier: string;
18
+ dbInstanceArn: string;
19
+ dbInstanceClass: string;
20
+ engine: string;
21
+ engineVersion: string;
22
+ dbInstanceStatus: string;
23
+ masterUsername: string;
24
+ dbName: string | null;
25
+ endpointAddress: string;
26
+ port: number;
27
+ allocatedStorage: number;
28
+ publiclyAccessible: boolean;
29
+ deletionProtection: boolean;
30
+ createdAt: string;
31
+ dbiResourceId: string;
32
+ containerId: string;
33
+ hostPort: number;
34
+ tags: RdsTag[];
35
+ }
36
+ export interface RdsInstancesResponse {
37
+ instances: RdsInstance[];
38
+ }
39
+ export interface ElastiCacheCluster {
40
+ cacheClusterId: string;
41
+ cacheClusterStatus: string;
42
+ engine: string;
43
+ engineVersion: string;
44
+ cacheNodeType: string;
45
+ numCacheNodes: number;
46
+ replicationGroupId: string | null;
47
+ port: number | null;
48
+ hostPort: number | null;
49
+ containerId: string | null;
50
+ }
51
+ export interface ElastiCacheClustersResponse {
52
+ clusters: ElastiCacheCluster[];
53
+ }
54
+ export interface ElastiCacheReplicationGroupIntrospection {
55
+ replicationGroupId: string;
56
+ status: string;
57
+ description: string;
58
+ memberClusters: string[];
59
+ automaticFailover: boolean;
60
+ multiAz: boolean;
61
+ engine: string;
62
+ engineVersion: string;
63
+ cacheNodeType: string;
64
+ numCacheClusters: number;
65
+ }
66
+ export interface ElastiCacheReplicationGroupsResponse {
67
+ replicationGroups: ElastiCacheReplicationGroupIntrospection[];
68
+ }
69
+ export interface ElastiCacheServerlessCacheIntrospection {
70
+ serverlessCacheName: string;
71
+ status: string;
72
+ engine: string;
73
+ engineVersion: string;
74
+ cacheNodeType: string | null;
75
+ }
76
+ export interface ElastiCacheServerlessCachesResponse {
77
+ serverlessCaches: ElastiCacheServerlessCacheIntrospection[];
78
+ }
12
79
  export interface LambdaInvocation {
13
80
  functionArn: string;
14
81
  payload: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fakecloud",
3
- "version": "0.5.0",
3
+ "version": "0.6.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",
@@ -12,7 +12,9 @@
12
12
  "devDependencies": {
13
13
  "@aws-sdk/client-cognito-identity-provider": "^3.750.0",
14
14
  "@aws-sdk/client-dynamodb": "^3.750.0",
15
+ "@aws-sdk/client-elasticache": "^3.1028.0",
15
16
  "@aws-sdk/client-eventbridge": "^3.750.0",
17
+ "@aws-sdk/client-rds": "^3.750.0",
16
18
  "@aws-sdk/client-s3": "^3.750.0",
17
19
  "@aws-sdk/client-sesv2": "^3.750.0",
18
20
  "@aws-sdk/client-sns": "^3.750.0",