@kensio/yulin 0.5.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 +9 -5
- package/dist/index.d.ts +8 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -1
- package/dist/index.js.map +1 -1
- package/dist/serve/controller/sim-aws-service-controller-container.d.ts +1 -3
- package/dist/serve/controller/sim-aws-service-controller-container.d.ts.map +1 -1
- package/dist/serve/controller/sim-aws-service-controller-container.js +1 -12
- package/dist/serve/controller/sim-aws-service-controller-container.js.map +1 -1
- package/dist/serve/controller/sim-service-controller.d.ts +1 -2
- package/dist/serve/controller/sim-service-controller.d.ts.map +1 -1
- package/dist/service/aws/arn.d.ts +3 -3
- package/dist/service/aws/arn.d.ts.map +1 -1
- package/dist/service/aws/arn.js +2 -2
- package/dist/service/aws/arn.js.map +1 -1
- package/dist/service/aws/sim-aws-account-region-scope.d.ts +11 -16
- package/dist/service/aws/sim-aws-account-region-scope.d.ts.map +1 -1
- package/dist/service/aws/sim-aws-account-region-scope.js +7 -18
- package/dist/service/aws/sim-aws-account-region-scope.js.map +1 -1
- package/dist/service/aws/sim-aws-account.d.ts +8 -12
- package/dist/service/aws/sim-aws-account.d.ts.map +1 -1
- package/dist/service/aws/sim-aws-account.js +5 -9
- package/dist/service/aws/sim-aws-account.js.map +1 -1
- package/dist/service/aws/sim-aws-region.d.ts +8 -12
- package/dist/service/aws/sim-aws-region.d.ts.map +1 -1
- package/dist/service/aws/sim-aws-region.js +5 -9
- package/dist/service/aws/sim-aws-region.js.map +1 -1
- package/dist/service/aws/sim-aws-services.d.ts +12 -11
- package/dist/service/aws/sim-aws-services.d.ts.map +1 -1
- package/dist/service/aws/sim-aws-services.js +1 -1
- package/dist/service/aws/sim-aws-services.js.map +1 -1
- package/dist/service/aws/sim-aws.d.ts +25 -15
- package/dist/service/aws/sim-aws.d.ts.map +1 -1
- package/dist/service/aws/sim-aws.js +35 -13
- package/dist/service/aws/sim-aws.js.map +1 -1
- package/dist/service/dynamodb/index.d.ts +1 -0
- package/dist/service/dynamodb/index.d.ts.map +1 -1
- package/dist/service/dynamodb/index.js +1 -0
- package/dist/service/dynamodb/index.js.map +1 -1
- package/dist/service/dynamodb/install/install-sim-dynamodb.d.ts +12 -0
- package/dist/service/dynamodb/install/install-sim-dynamodb.d.ts.map +1 -0
- package/dist/service/dynamodb/install/install-sim-dynamodb.js +11 -0
- package/dist/service/dynamodb/install/install-sim-dynamodb.js.map +1 -0
- package/dist/service/dynamodb/install-sim-dynamodb.d.ts +12 -0
- package/dist/service/dynamodb/install-sim-dynamodb.d.ts.map +1 -0
- package/dist/service/dynamodb/install-sim-dynamodb.js +11 -0
- package/dist/service/dynamodb/install-sim-dynamodb.js.map +1 -0
- package/dist/service/s3/index.d.ts +1 -0
- package/dist/service/s3/index.d.ts.map +1 -1
- package/dist/service/s3/index.js +1 -0
- package/dist/service/s3/index.js.map +1 -1
- package/dist/service/s3/install/install-sim-s3.d.ts +12 -0
- package/dist/service/s3/install/install-sim-s3.d.ts.map +1 -0
- package/dist/service/s3/install/install-sim-s3.js +17 -0
- package/dist/service/s3/install/install-sim-s3.js.map +1 -0
- package/dist/service/s3/install-sim-s3.d.ts +12 -0
- package/dist/service/s3/install-sim-s3.d.ts.map +1 -0
- package/dist/service/s3/install-sim-s3.js +17 -0
- package/dist/service/s3/install-sim-s3.js.map +1 -0
- package/dist/service/s3/serve/sim-s3-controller.d.ts +2 -1
- package/dist/service/s3/serve/sim-s3-controller.d.ts.map +1 -1
- package/dist/service/s3/serve/sim-s3-controller.js.map +1 -1
- package/dist/service/s3/serve/sim-s3-req-router.d.ts +2 -1
- package/dist/service/s3/serve/sim-s3-req-router.d.ts.map +1 -1
- package/dist/service/s3/serve/sim-s3-req-router.js +2 -4
- package/dist/service/s3/serve/sim-s3-req-router.js.map +1 -1
- package/dist/service/s3/sim-s3.d.ts +6 -0
- package/dist/service/s3/sim-s3.d.ts.map +1 -1
- package/dist/service/s3/sim-s3.js +8 -0
- package/dist/service/s3/sim-s3.js.map +1 -1
- package/package.json +5 -3
package/README.md
CHANGED
|
@@ -16,12 +16,14 @@ Create and interact directly with a simulated AWS:
|
|
|
16
16
|
|
|
17
17
|
```typescript
|
|
18
18
|
import { SimAws } from "@kensio/yulin";
|
|
19
|
+
import { installSimDynamoDb } from "@kensio/yulin/dynamodb"
|
|
19
20
|
import { CreateTableCommand } from "@aws-sdk/client-dynamodb";
|
|
20
21
|
|
|
21
22
|
const simAws = new SimAws();
|
|
23
|
+
installSimDynamoDb(simAws);
|
|
22
24
|
|
|
23
25
|
// Default Account and Region.
|
|
24
|
-
await simAws.dynamoDb
|
|
26
|
+
await simAws.service("dynamoDb").createTable(
|
|
25
27
|
new CreateTableCommand({
|
|
26
28
|
TableName: "FoobarTable",
|
|
27
29
|
KeySchema: [{ AttributeName: "id", KeyType: "HASH" }],
|
|
@@ -29,13 +31,13 @@ await simAws.dynamoDb().createTable(
|
|
|
29
31
|
);
|
|
30
32
|
|
|
31
33
|
// Specify Account.
|
|
32
|
-
await simAws.account("111111111111").dynamoDb
|
|
34
|
+
await simAws.account("111111111111").service("dynamoDb").createTable({ ... });
|
|
33
35
|
|
|
34
36
|
// Specify Region.
|
|
35
|
-
await simAws.region("eu-west-2").dynamoDb
|
|
37
|
+
await simAws.region("eu-west-2").service("dynamoDb").createTable({ ... });
|
|
36
38
|
|
|
37
39
|
// Specify Account and Region.
|
|
38
|
-
await simAws.account("111111111111").region("eu-west-2").dynamoDb
|
|
40
|
+
await simAws.account("111111111111").region("eu-west-2").service("dynamoDb").createTable({ ... });
|
|
39
41
|
```
|
|
40
42
|
|
|
41
43
|
AWS state is simulated internally, so you can test realistic interactions with multiple AWS
|
|
@@ -63,6 +65,7 @@ You can listen on a port to serve your simulated AWS on localhost:
|
|
|
63
65
|
|
|
64
66
|
```typescript
|
|
65
67
|
import { SimAws } from "@kensio/yulin";
|
|
68
|
+
import { installSimS3 } from "@kensio/yulin/s3";
|
|
66
69
|
import { serveSimAws } from "@kensio/yulin/serve";
|
|
67
70
|
import {
|
|
68
71
|
CreateBucketCommand,
|
|
@@ -71,9 +74,10 @@ import {
|
|
|
71
74
|
} from "@aws-sdk/client-s3";
|
|
72
75
|
|
|
73
76
|
const simAws = new SimAws();
|
|
77
|
+
installSimS3(simAws);
|
|
74
78
|
const srv = await serveSimAws(simAws); // Chooses available port on localhost.
|
|
75
79
|
|
|
76
|
-
const simS3 =
|
|
80
|
+
const simS3 = simAws.region("eu-west-2").service("s3");
|
|
77
81
|
await simS3.createBucket(new CreateBucketCommand({ Bucket: "foo-site" }));
|
|
78
82
|
await simS3.putBucketWebsite(new PutBucketWebsiteCommand({
|
|
79
83
|
Bucket: "foo-site",
|
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,9 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export { SimAws } from "./service/aws/sim-aws.js";
|
|
2
|
+
export { SimAwsAccount } from "./service/aws/sim-aws-account.js";
|
|
3
|
+
export { SimAwsRegion } from "./service/aws/sim-aws-region.js";
|
|
4
|
+
export { SimAwsAccountRegionContainer } from "./service/aws/sim-aws-account-region-scope.js";
|
|
5
|
+
export type { NoSimAwsServices, SimAwsAccountRegionScopes, SimAwsServiceMap, } from "./service/aws/sim-aws-services.js";
|
|
6
|
+
export type { AwsRegionName } from "./service/aws/sim-aws-region.js";
|
|
7
|
+
export type { SimAwsAccountId } from "./service/aws/sim-aws-account.js";
|
|
8
|
+
export type { SimAwsAccountRegionScope } from "./service/aws/sim-aws-account-region-scope.js";
|
|
2
9
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AACjE,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC/D,OAAO,EAAE,4BAA4B,EAAE,MAAM,+CAA+C,CAAC;AAC7F,YAAY,EACV,gBAAgB,EAChB,yBAAyB,EACzB,gBAAgB,GACjB,MAAM,mCAAmC,CAAC;AAC3C,YAAY,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AACrE,YAAY,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AACxE,YAAY,EAAE,wBAAwB,EAAE,MAAM,+CAA+C,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,5 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export { SimAws } from "./service/aws/sim-aws.js";
|
|
2
|
+
export { SimAwsAccount } from "./service/aws/sim-aws-account.js";
|
|
3
|
+
export { SimAwsRegion } from "./service/aws/sim-aws-region.js";
|
|
4
|
+
export { SimAwsAccountRegionContainer } from "./service/aws/sim-aws-account-region-scope.js";
|
|
2
5
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AACjE,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC/D,OAAO,EAAE,4BAA4B,EAAE,MAAM,+CAA+C,CAAC"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { SimAws } from "../../service/aws/sim-aws.js";
|
|
2
|
-
import type { SimAwsServiceName } from "../../service/aws/sim-aws-services.js";
|
|
3
2
|
import type { SimAwsServiceController } from "./sim-service-controller.js";
|
|
4
3
|
/**
|
|
5
4
|
* Registry for simulated AWS localhost service controllers.
|
|
@@ -7,11 +6,10 @@ import type { SimAwsServiceController } from "./sim-service-controller.js";
|
|
|
7
6
|
export declare class SimAwsServiceControllerContainer {
|
|
8
7
|
private readonly simAws;
|
|
9
8
|
private readonly controllers;
|
|
10
|
-
private readonly controllerFactories;
|
|
11
9
|
constructor(simAws: SimAws);
|
|
12
10
|
/**
|
|
13
11
|
* Get the singleton controller for a simulated AWS service.
|
|
14
12
|
*/
|
|
15
|
-
controllerForService(service:
|
|
13
|
+
controllerForService(service: string): SimAwsServiceController;
|
|
16
14
|
}
|
|
17
15
|
//# sourceMappingURL=sim-aws-service-controller-container.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sim-aws-service-controller-container.d.ts","sourceRoot":"","sources":["../../../src/serve/controller/sim-aws-service-controller-container.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"sim-aws-service-controller-container.d.ts","sourceRoot":"","sources":["../../../src/serve/controller/sim-aws-service-controller-container.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAC;AAE3D,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AAE3E;;GAEG;AACH,qBAAa,gCAAgC;IAG/B,OAAO,CAAC,QAAQ,CAAC,MAAM;IAFnC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAuC;gBAEtC,MAAM,EAAE,MAAM;IAE3C;;OAEG;IACH,oBAAoB,CAAC,OAAO,EAAE,MAAM,GAAG,uBAAuB;CAK/D"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { SimS3ServiceController } from "../../service/s3/serve/sim-s3-controller.js";
|
|
2
1
|
import { Memo } from "../../util/memo/memo.js";
|
|
3
2
|
/**
|
|
4
3
|
* Registry for simulated AWS localhost service controllers.
|
|
@@ -6,12 +5,6 @@ import { Memo } from "../../util/memo/memo.js";
|
|
|
6
5
|
export class SimAwsServiceControllerContainer {
|
|
7
6
|
simAws;
|
|
8
7
|
controllers = new Memo();
|
|
9
|
-
controllerFactories = new Map([
|
|
10
|
-
[
|
|
11
|
-
"s3",
|
|
12
|
-
(simAws) => new SimS3ServiceController(simAws),
|
|
13
|
-
],
|
|
14
|
-
]);
|
|
15
8
|
constructor(simAws) {
|
|
16
9
|
this.simAws = simAws;
|
|
17
10
|
}
|
|
@@ -19,11 +12,7 @@ export class SimAwsServiceControllerContainer {
|
|
|
19
12
|
* Get the singleton controller for a simulated AWS service.
|
|
20
13
|
*/
|
|
21
14
|
controllerForService(service) {
|
|
22
|
-
|
|
23
|
-
if (factory === undefined) {
|
|
24
|
-
throw new Error(`No controller implemented for simulated AWS service ${service}`);
|
|
25
|
-
}
|
|
26
|
-
return this.controllers.getOrCreate(service, () => factory(this.simAws));
|
|
15
|
+
return this.controllers.getOrCreate(service, () => this.simAws.createServiceController(service));
|
|
27
16
|
}
|
|
28
17
|
}
|
|
29
18
|
//# sourceMappingURL=sim-aws-service-controller-container.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sim-aws-service-controller-container.js","sourceRoot":"","sources":["../../../src/serve/controller/sim-aws-service-controller-container.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"sim-aws-service-controller-container.js","sourceRoot":"","sources":["../../../src/serve/controller/sim-aws-service-controller-container.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAG/C;;GAEG;AACH,MAAM,OAAO,gCAAgC;IAGd;IAFZ,WAAW,GAAG,IAAI,IAAI,EAA2B,CAAC;IAEnE,YAA6B,MAAc;QAAd,WAAM,GAAN,MAAM,CAAQ;IAAG,CAAC;IAE/C;;OAEG;IACH,oBAAoB,CAAC,OAAe;QAClC,OAAO,IAAI,CAAC,WAAW,CAAC,WAAW,CAAC,OAAO,EAAE,GAAG,EAAE,CAChD,IAAI,CAAC,MAAM,CAAC,uBAAuB,CAAC,OAAO,CAAC,CAC7C,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import type { SimAwsServiceName } from "../../service/aws/sim-aws-services.js";
|
|
2
1
|
import type { AwsRegionName } from "../../service/aws/sim-aws-region.js";
|
|
3
2
|
import type { SimAws } from "../../service/aws/sim-aws.js";
|
|
4
3
|
export interface SimAwsServiceTarget {
|
|
5
|
-
readonly service:
|
|
4
|
+
readonly service: string;
|
|
6
5
|
readonly resourceName: string;
|
|
7
6
|
readonly regionName?: AwsRegionName;
|
|
8
7
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sim-service-controller.d.ts","sourceRoot":"","sources":["../../../src/serve/controller/sim-service-controller.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"sim-service-controller.d.ts","sourceRoot":"","sources":["../../../src/serve/controller/sim-service-controller.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AACzE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAC;AAE3D,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,UAAU,CAAC,EAAE,aAAa,CAAC;CACrC;AAED;;GAEG;AACH,MAAM,MAAM,8BAA8B,GAAG,CAC3C,MAAM,EAAE,MAAM,KACX,uBAAuB,CAAC;AAE7B;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC;;OAEG;IACH,aAAa,CACX,MAAM,EAAE,mBAAmB,EAC3B,OAAO,EAAE,OAAO,GACf,OAAO,CAAC,QAAQ,CAAC,CAAC;CACtB"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { type AwsRegionName } from "./sim-aws-region.js";
|
|
2
2
|
import { type SimAwsAccountId } from "./sim-aws-account.js";
|
|
3
|
-
|
|
4
|
-
export type SimArn = `arn:aws:${
|
|
3
|
+
export type SimArnServiceName = string;
|
|
4
|
+
export type SimArn = `arn:aws:${SimArnServiceName}:${AwsRegionName}:${SimAwsAccountId}:${string}/${string}`;
|
|
5
5
|
export interface SimArnComponents {
|
|
6
6
|
partition: "aws";
|
|
7
|
-
service:
|
|
7
|
+
service: SimArnServiceName;
|
|
8
8
|
region: AwsRegionName;
|
|
9
9
|
accountId: SimAwsAccountId;
|
|
10
10
|
resourceType: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"arn.d.ts","sourceRoot":"","sources":["../../../src/service/aws/arn.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,aAAa,EAAqB,MAAM,qBAAqB,CAAC;AAC5E,OAAO,EAEL,KAAK,eAAe,EACrB,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"arn.d.ts","sourceRoot":"","sources":["../../../src/service/aws/arn.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,aAAa,EAAqB,MAAM,qBAAqB,CAAC;AAC5E,OAAO,EAEL,KAAK,eAAe,EACrB,MAAM,sBAAsB,CAAC;AAI9B,MAAM,MAAM,iBAAiB,GAAG,MAAM,CAAC;AAEvC,MAAM,MAAM,MAAM,GAChB,WAAW,iBAAiB,IAAI,aAAa,IAAI,eAAe,IAAI,MAAM,IAAI,MAAM,EAAE,CAAC;AAEzF,MAAM,WAAW,gBAAgB;IAC/B,SAAS,EAAE,KAAK,CAAC;IACjB,OAAO,EAAE,iBAAiB,CAAC;IAC3B,MAAM,EAAE,aAAa,CAAC;IACtB,SAAS,EAAE,eAAe,CAAC;IAC3B,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;CACpB;AAaD;;GAEG;AACH,wBAAgB,UAAU,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC,gBAAgB,CAAC,GAAG,MAAM,CAGxE"}
|
package/dist/service/aws/arn.js
CHANGED
|
@@ -2,10 +2,10 @@ import { makeAwsRegionName } from "./sim-aws-region.js";
|
|
|
2
2
|
import { makeSimAwsAccountId, } from "./sim-aws-account.js";
|
|
3
3
|
import { DynamicFactory } from "@kensio/part-factory";
|
|
4
4
|
import { faker } from "@faker-js/faker";
|
|
5
|
-
|
|
5
|
+
const defaultSimArnServiceNames = ["s3", "dynamodb"];
|
|
6
6
|
const simArnComponentsFactory = new DynamicFactory(() => ({
|
|
7
7
|
partition: "aws",
|
|
8
|
-
service: faker.helpers.arrayElement(
|
|
8
|
+
service: faker.helpers.arrayElement(defaultSimArnServiceNames),
|
|
9
9
|
region: makeAwsRegionName(),
|
|
10
10
|
accountId: makeSimAwsAccountId(),
|
|
11
11
|
resourceType: "resource",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"arn.js","sourceRoot":"","sources":["../../../src/service/aws/arn.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAC5E,OAAO,EACL,mBAAmB,GAEpB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"arn.js","sourceRoot":"","sources":["../../../src/service/aws/arn.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAC5E,OAAO,EACL,mBAAmB,GAEpB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAgBxC,MAAM,yBAAyB,GAAG,CAAC,IAAI,EAAE,UAAU,CAAU,CAAC;AAE9D,MAAM,uBAAuB,GAAG,IAAI,cAAc,CAAmB,GAAG,EAAE,CAAC,CAAC;IAC1E,SAAS,EAAE,KAAK;IAChB,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,YAAY,CAAC,yBAAyB,CAAC;IAC9D,MAAM,EAAE,iBAAiB,EAAE;IAC3B,SAAS,EAAE,mBAAmB,EAAE;IAChC,YAAY,EAAE,UAAU;IACxB,UAAU,EAAE,KAAK,CAAC,MAAM,CAAC,YAAY,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC;CACtD,CAAC,CAAC,CAAC;AAEJ;;GAEG;AACH,MAAM,UAAU,UAAU,CAAC,SAAqC;IAC9D,MAAM,UAAU,GAAG,uBAAuB,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IAC3D,OAAO,OAAO,UAAU,CAAC,SAAS,IAAI,UAAU,CAAC,OAAO,IAAI,UAAU,CAAC,MAAM,IAAI,UAAU,CAAC,SAAS,IAAI,UAAU,CAAC,YAAY,IAAI,UAAU,CAAC,UAAU,EAAE,CAAC;AAC9J,CAAC"}
|
|
@@ -1,31 +1,26 @@
|
|
|
1
1
|
import { type SimAwsAccount, type SimAwsAccountId } from "./sim-aws-account.js";
|
|
2
2
|
import { type AwsRegionName, type SimAwsRegion } from "./sim-aws-region.js";
|
|
3
|
-
import type {
|
|
4
|
-
import { SimDynamoDb } from "../dynamodb/sim-dynamodb.js";
|
|
5
|
-
import { SimS3 } from "../s3/sim-s3.js";
|
|
3
|
+
import type { NoSimAwsServices, SimAwsServiceMap } from "./sim-aws-services.js";
|
|
6
4
|
import { SimAws } from "./sim-aws.js";
|
|
7
5
|
import { DynamicFactory } from "@kensio/part-factory";
|
|
8
|
-
import type { SimS3GlobalRegistry } from "../s3/sim-s3-global-registry.js";
|
|
9
6
|
export type SimAccountRegionScopeKey = `${SimAwsAccountId}:${AwsRegionName}`;
|
|
10
7
|
/**
|
|
11
8
|
* Combined simulated AWS Account and Region scope.
|
|
9
|
+
* This is the real container for simulated services.
|
|
12
10
|
*/
|
|
13
|
-
export declare class SimAwsAccountRegionContainer
|
|
11
|
+
export declare class SimAwsAccountRegionContainer<TServices extends SimAwsServiceMap = NoSimAwsServices> {
|
|
14
12
|
private readonly simAws;
|
|
15
|
-
readonly account: SimAwsAccount
|
|
16
|
-
readonly region: SimAwsRegion
|
|
17
|
-
private readonly s3GlobalRegistry;
|
|
13
|
+
readonly account: SimAwsAccount<TServices>;
|
|
14
|
+
readonly region: SimAwsRegion<TServices>;
|
|
18
15
|
private readonly memo;
|
|
19
|
-
|
|
20
|
-
constructor(simAws?: SimAws
|
|
16
|
+
readonly accountRegionScope: SimAwsAccountRegionScope;
|
|
17
|
+
constructor(simAws?: SimAws<TServices>, account?: SimAwsAccount<TServices>, region?: SimAwsRegion<TServices>);
|
|
21
18
|
/**
|
|
22
|
-
* Get
|
|
19
|
+
* Get an installed simulated AWS service for this account and region.
|
|
20
|
+
* The service must be installed with the appropriate installer function
|
|
21
|
+
* first.
|
|
23
22
|
*/
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Get the simulated S3 service for this account and region.
|
|
27
|
-
*/
|
|
28
|
-
s3(): SimS3;
|
|
23
|
+
service<TKey extends keyof TServices>(serviceName: TKey): TServices[TKey];
|
|
29
24
|
}
|
|
30
25
|
export interface SimAwsAccountRegionScope {
|
|
31
26
|
accountId: SimAwsAccountId;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sim-aws-account-region-scope.d.ts","sourceRoot":"","sources":["../../../src/service/aws/sim-aws-account-region-scope.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,aAAa,EAClB,KAAK,eAAe,EACrB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,KAAK,aAAa,EAElB,KAAK,YAAY,EAClB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"sim-aws-account-region-scope.d.ts","sourceRoot":"","sources":["../../../src/service/aws/sim-aws-account-region-scope.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,aAAa,EAClB,KAAK,eAAe,EACrB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,KAAK,aAAa,EAElB,KAAK,YAAY,EAClB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAEhF,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD,MAAM,MAAM,wBAAwB,GAAG,GAAG,eAAe,IAAI,aAAa,EAAE,CAAC;AAE7E;;;GAGG;AACH,qBAAa,4BAA4B,CACvC,SAAS,SAAS,gBAAgB,GAAG,gBAAgB;IAOnD,OAAO,CAAC,QAAQ,CAAC,MAAM;aACP,OAAO,EAAE,aAAa,CAAC,SAAS,CAAC;aACjC,MAAM,EAAE,YAAY,CAAC,SAAS,CAAC;IAPjD,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAuB;IAE5C,SAAgB,kBAAkB,EAAE,wBAAwB,CAAC;gBAG1C,MAAM,GAAE,MAAM,CAAC,SAAS,CAA2B,EACpD,OAAO,GAAE,aAAa,CAAC,SAAS,CAAyB,EACzD,MAAM,GAAE,YAAY,CAAC,SAAS,CAAwB;IAQxE;;;;OAIG;IACH,OAAO,CAAC,IAAI,SAAS,MAAM,SAAS,EAAE,WAAW,EAAE,IAAI,GAAG,SAAS,CAAC,IAAI,CAAC;CAK1E;AAED,MAAM,WAAW,wBAAwB;IACvC,SAAS,EAAE,eAAe,CAAC;IAC3B,UAAU,EAAE,aAAa,CAAC;CAC3B;AAED;;GAEG;AACH,eAAO,MAAM,+BAA+B,0CAIvC,CAAC"}
|
|
@@ -1,45 +1,34 @@
|
|
|
1
1
|
import { makeSimAwsAccountId, } from "./sim-aws-account.js";
|
|
2
2
|
import { makeAwsRegionName, } from "./sim-aws-region.js";
|
|
3
|
-
import { SimDynamoDb } from "../dynamodb/sim-dynamodb.js";
|
|
4
|
-
import { SimS3 } from "../s3/sim-s3.js";
|
|
5
3
|
import { Memo } from "../../util/memo/memo.js";
|
|
6
4
|
import { SimAws } from "./sim-aws.js";
|
|
7
5
|
import { DynamicFactory } from "@kensio/part-factory";
|
|
8
6
|
/**
|
|
9
7
|
* Combined simulated AWS Account and Region scope.
|
|
8
|
+
* This is the real container for simulated services.
|
|
10
9
|
*/
|
|
11
10
|
export class SimAwsAccountRegionContainer {
|
|
12
11
|
simAws;
|
|
13
12
|
account;
|
|
14
13
|
region;
|
|
15
|
-
s3GlobalRegistry;
|
|
16
14
|
memo = new Memo();
|
|
17
15
|
accountRegionScope;
|
|
18
|
-
constructor(simAws = new SimAws(), account = this.simAws.account(), region = this.simAws.region()
|
|
16
|
+
constructor(simAws = new SimAws(), account = this.simAws.account(), region = this.simAws.region()) {
|
|
19
17
|
this.simAws = simAws;
|
|
20
18
|
this.account = account;
|
|
21
19
|
this.region = region;
|
|
22
|
-
this.s3GlobalRegistry = s3GlobalRegistry;
|
|
23
20
|
this.accountRegionScope = {
|
|
24
21
|
accountId: this.account.accountId,
|
|
25
22
|
regionName: this.region.regionName,
|
|
26
23
|
};
|
|
27
24
|
}
|
|
28
25
|
/**
|
|
29
|
-
* Get
|
|
26
|
+
* Get an installed simulated AWS service for this account and region.
|
|
27
|
+
* The service must be installed with the appropriate installer function
|
|
28
|
+
* first.
|
|
30
29
|
*/
|
|
31
|
-
|
|
32
|
-
return this.memo.getOrCreate(
|
|
33
|
-
return new SimDynamoDb(this.accountRegionScope, this.simAws.background);
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* Get the simulated S3 service for this account and region.
|
|
38
|
-
*/
|
|
39
|
-
s3() {
|
|
40
|
-
return this.memo.getOrCreate("s3", () => {
|
|
41
|
-
return new SimS3(this.accountRegionScope, this.s3GlobalRegistry);
|
|
42
|
-
});
|
|
30
|
+
service(serviceName) {
|
|
31
|
+
return this.memo.getOrCreate(String(serviceName), () => this.simAws.createService(serviceName, this));
|
|
43
32
|
}
|
|
44
33
|
}
|
|
45
34
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sim-aws-account-region-scope.js","sourceRoot":"","sources":["../../../src/service/aws/sim-aws-account-region-scope.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,GAGpB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAEL,iBAAiB,GAElB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"sim-aws-account-region-scope.js","sourceRoot":"","sources":["../../../src/service/aws/sim-aws-account-region-scope.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,GAGpB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAEL,iBAAiB,GAElB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAItD;;;GAGG;AACH,MAAM,OAAO,4BAA4B;IAQpB;IACD;IACA;IAPD,IAAI,GAAG,IAAI,IAAI,EAAW,CAAC;IAE5B,kBAAkB,CAA2B;IAE7D,YACmB,SAA4B,IAAI,MAAM,EAAa,EACpD,UAAoC,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,EACzD,SAAkC,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE;QAFrD,WAAM,GAAN,MAAM,CAA6C;QACpD,YAAO,GAAP,OAAO,CAAkD;QACzD,WAAM,GAAN,MAAM,CAAgD;QAEtE,IAAI,CAAC,kBAAkB,GAAG;YACxB,SAAS,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS;YACjC,UAAU,EAAE,IAAI,CAAC,MAAM,CAAC,UAAU;SACnC,CAAC;IACJ,CAAC;IAED;;;;OAIG;IACH,OAAO,CAA+B,WAAiB;QACrD,OAAO,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,WAAW,CAAC,EAAE,GAAG,EAAE,CACrD,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,WAAW,EAAE,IAAI,CAAC,CAC7C,CAAC;IACJ,CAAC;CACF;AAOD;;GAEG;AACH,MAAM,CAAC,MAAM,+BAA+B,GAC1C,IAAI,cAAc,CAA2B,GAAG,EAAE,CAAC,CAAC;IAClD,SAAS,EAAE,mBAAmB,EAAE;IAChC,UAAU,EAAE,iBAAiB,EAAE;CAChC,CAAC,CAAC,CAAC"}
|
|
@@ -1,30 +1,26 @@
|
|
|
1
|
-
import type { SimDynamoDb } from "../dynamodb/sim-dynamodb.js";
|
|
2
1
|
import type { AwsRegionName } from "./sim-aws-region.js";
|
|
3
|
-
import type { SimS3 } from "../s3/sim-s3.js";
|
|
4
2
|
import type { Brand } from "../../util/brand.type.js";
|
|
5
|
-
import type { SimAwsAccountRegionScopes,
|
|
3
|
+
import type { NoSimAwsServices, SimAwsAccountRegionScopes, SimAwsServiceMap } from "./sim-aws-services.js";
|
|
6
4
|
import type { SimAwsAccountRegionContainer } from "./sim-aws-account-region-scope.js";
|
|
7
5
|
export type SimAwsAccountId = Brand<string, "SimAwsAccountId">;
|
|
8
6
|
export declare const DEFAULT_SIM_AWS_ACCOUNT_ID: SimAwsAccountId;
|
|
9
7
|
/**
|
|
10
8
|
* Container for simulated AWS services in one AWS Account.
|
|
11
9
|
*/
|
|
12
|
-
export declare class SimAwsAccount
|
|
10
|
+
export declare class SimAwsAccount<TServices extends SimAwsServiceMap = NoSimAwsServices> {
|
|
13
11
|
private readonly accountRegionScopes;
|
|
14
12
|
readonly accountId: SimAwsAccountId;
|
|
15
|
-
constructor(accountRegionScopes: SimAwsAccountRegionScopes
|
|
13
|
+
constructor(accountRegionScopes: SimAwsAccountRegionScopes<TServices>, accountId?: SimAwsAccountId);
|
|
16
14
|
/**
|
|
17
15
|
* Get a simulated AWS Region scoped for this Account.
|
|
18
16
|
*/
|
|
19
|
-
region(regionName?: AwsRegionName): SimAwsAccountRegionContainer
|
|
17
|
+
region(regionName?: AwsRegionName): SimAwsAccountRegionContainer<TServices>;
|
|
20
18
|
/**
|
|
21
|
-
* Get
|
|
19
|
+
* Get an installed simulated AWS service for this Account's default Region.
|
|
20
|
+
* The service must be installed with the appropriate installer function
|
|
21
|
+
* first.
|
|
22
22
|
*/
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* Get the simulated S3 service for this Account.
|
|
26
|
-
*/
|
|
27
|
-
s3(): SimS3;
|
|
23
|
+
service<TKey extends keyof TServices>(serviceName: TKey): TServices[TKey];
|
|
28
24
|
}
|
|
29
25
|
/**
|
|
30
26
|
* Generate a fake AWS Account ID.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sim-aws-account.d.ts","sourceRoot":"","sources":["../../../src/service/aws/sim-aws-account.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"sim-aws-account.d.ts","sourceRoot":"","sources":["../../../src/service/aws/sim-aws-account.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,KAAK,EACV,gBAAgB,EAChB,yBAAyB,EACzB,gBAAgB,EACjB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,mCAAmC,CAAC;AAGtF,MAAM,MAAM,eAAe,GAAG,KAAK,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC;AAE/D,eAAO,MAAM,0BAA0B,EAAqB,eAAe,CAAC;AAE5E;;GAEG;AACH,qBAAa,aAAa,CACxB,SAAS,SAAS,gBAAgB,GAAG,gBAAgB;IAGnD,OAAO,CAAC,QAAQ,CAAC,mBAAmB;aACpB,SAAS,EAAE,eAAe;gBADzB,mBAAmB,EAAE,yBAAyB,CAAC,SAAS,CAAC,EAC1D,SAAS,GAAE,eAA4C;IAGzE;;OAEG;IACH,MAAM,CAAC,UAAU,CAAC,EAAE,aAAa,GAAG,4BAA4B,CAAC,SAAS,CAAC;IAO3E;;;;OAIG;IACH,OAAO,CAAC,IAAI,SAAS,MAAM,SAAS,EAAE,WAAW,EAAE,IAAI,GAAG,SAAS,CAAC,IAAI,CAAC;CAG1E;AAED;;GAEG;AACH,wBAAgB,mBAAmB,IAAI,eAAe,CAErD"}
|
|
@@ -17,16 +17,12 @@ export class SimAwsAccount {
|
|
|
17
17
|
return this.accountRegionScopes.accountRegionScope(this.accountId, regionName);
|
|
18
18
|
}
|
|
19
19
|
/**
|
|
20
|
-
* Get
|
|
20
|
+
* Get an installed simulated AWS service for this Account's default Region.
|
|
21
|
+
* The service must be installed with the appropriate installer function
|
|
22
|
+
* first.
|
|
21
23
|
*/
|
|
22
|
-
|
|
23
|
-
return this.region().
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Get the simulated S3 service for this Account.
|
|
27
|
-
*/
|
|
28
|
-
s3() {
|
|
29
|
-
return this.region().s3();
|
|
24
|
+
service(serviceName) {
|
|
25
|
+
return this.region().service(serviceName);
|
|
30
26
|
}
|
|
31
27
|
}
|
|
32
28
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sim-aws-account.js","sourceRoot":"","sources":["../../../src/service/aws/sim-aws-account.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"sim-aws-account.js","sourceRoot":"","sources":["../../../src/service/aws/sim-aws-account.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAIxC,MAAM,CAAC,MAAM,0BAA0B,GAAG,cAAiC,CAAC;AAE5E;;GAEG;AACH,MAAM,OAAO,aAAa;IAIL;IACD;IAFlB,YACmB,mBAAyD,EAC1D,YAA6B,0BAA0B;QADtD,wBAAmB,GAAnB,mBAAmB,CAAsC;QAC1D,cAAS,GAAT,SAAS,CAA8C;IACtE,CAAC;IAEJ;;OAEG;IACH,MAAM,CAAC,UAA0B;QAC/B,OAAO,IAAI,CAAC,mBAAmB,CAAC,kBAAkB,CAChD,IAAI,CAAC,SAAS,EACd,UAAU,CACX,CAAC;IACJ,CAAC;IAED;;;;OAIG;IACH,OAAO,CAA+B,WAAiB;QACrD,OAAO,IAAI,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;IAC5C,CAAC;CACF;AAED;;GAEG;AACH,MAAM,UAAU,mBAAmB;IACjC,OAAO,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,CAAoB,CAAC;AACjE,CAAC"}
|
|
@@ -1,30 +1,26 @@
|
|
|
1
1
|
import type { SimAwsAccountId } from "./sim-aws-account.js";
|
|
2
2
|
import type { SimAwsAccountRegionContainer } from "./sim-aws-account-region-scope.js";
|
|
3
|
-
import type { SimAwsAccountRegionScopes,
|
|
4
|
-
import type { SimS3 } from "../s3/sim-s3.js";
|
|
5
|
-
import type { SimDynamoDb } from "../dynamodb/sim-dynamodb.js";
|
|
3
|
+
import type { NoSimAwsServices, SimAwsAccountRegionScopes, SimAwsServiceMap } from "./sim-aws-services.js";
|
|
6
4
|
export declare const AWS_REGION_NAMES: readonly ["us-east-1", "us-east-2", "us-west-1", "us-west-2", "af-south-1", "ap-east-1", "ap-south-2", "ap-southeast-3", "ap-southeast-5", "ap-southeast-4", "ap-south-1", "ap-southeast-6", "ap-northeast-3", "ap-northeast-2", "ap-southeast-1", "ap-southeast-2", "ap-east-2", "ap-southeast-7", "ap-northeast-1", "ca-central-1", "ca-west-1", "eu-central-1", "eu-west-1", "eu-west-2", "eu-south-1", "eu-west-3", "eu-south-2", "eu-north-1", "eu-central-2", "il-central-1", "mx-central-1", "me-south-1", "me-central-1", "sa-east-1"];
|
|
7
5
|
export type AwsRegionName = (typeof AWS_REGION_NAMES)[number];
|
|
8
6
|
export declare const DEFAULT_SIM_AWS_REGION_NAME: "us-east-1";
|
|
9
7
|
/**
|
|
10
8
|
* Simulated AWS Region.
|
|
11
9
|
*/
|
|
12
|
-
export declare class SimAwsRegion
|
|
10
|
+
export declare class SimAwsRegion<TServices extends SimAwsServiceMap = NoSimAwsServices> {
|
|
13
11
|
private readonly accountRegionScopes;
|
|
14
12
|
readonly regionName: AwsRegionName;
|
|
15
|
-
constructor(accountRegionScopes: SimAwsAccountRegionScopes
|
|
13
|
+
constructor(accountRegionScopes: SimAwsAccountRegionScopes<TServices>, regionName?: AwsRegionName);
|
|
16
14
|
/**
|
|
17
15
|
* Get a simulated AWS Account scoped for this Region.
|
|
18
16
|
*/
|
|
19
|
-
account(accountId?: SimAwsAccountId | string): SimAwsAccountRegionContainer
|
|
17
|
+
account(accountId?: SimAwsAccountId | string): SimAwsAccountRegionContainer<TServices>;
|
|
20
18
|
/**
|
|
21
|
-
* Get
|
|
19
|
+
* Get an installed simulated AWS service for this Region's default Account.
|
|
20
|
+
* The service must be installed with the appropriate installer function
|
|
21
|
+
* first.
|
|
22
22
|
*/
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* Get the simulated S3 service scoped for this Region.
|
|
26
|
-
*/
|
|
27
|
-
s3(): SimS3;
|
|
23
|
+
service<TKey extends keyof TServices>(serviceName: TKey): TServices[TKey];
|
|
28
24
|
}
|
|
29
25
|
/**
|
|
30
26
|
* Choose a random AWS Region name.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sim-aws-region.d.ts","sourceRoot":"","sources":["../../../src/service/aws/sim-aws-region.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,mCAAmC,CAAC;AACtF,OAAO,KAAK,EACV,yBAAyB,EACzB,
|
|
1
|
+
{"version":3,"file":"sim-aws-region.d.ts","sourceRoot":"","sources":["../../../src/service/aws/sim-aws-region.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,mCAAmC,CAAC;AACtF,OAAO,KAAK,EACV,gBAAgB,EAChB,yBAAyB,EACzB,gBAAgB,EACjB,MAAM,uBAAuB,CAAC;AAG/B,eAAO,MAAM,gBAAgB,ghBAmCnB,CAAC;AAEX,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE9D,eAAO,MAAM,2BAA2B,EAAG,WAAoB,CAAC;AAEhE;;GAEG;AACH,qBAAa,YAAY,CACvB,SAAS,SAAS,gBAAgB,GAAG,gBAAgB;IAGnD,OAAO,CAAC,QAAQ,CAAC,mBAAmB;aACpB,UAAU,EAAE,aAAa;gBADxB,mBAAmB,EAAE,yBAAyB,CAAC,SAAS,CAAC,EAC1D,UAAU,GAAE,aAA2C;IAGzE;;OAEG;IACH,OAAO,CACL,SAAS,CAAC,EAAE,eAAe,GAAG,MAAM,GACnC,4BAA4B,CAAC,SAAS,CAAC;IAO1C;;;;OAIG;IACH,OAAO,CAAC,IAAI,SAAS,MAAM,SAAS,EAAE,WAAW,EAAE,IAAI,GAAG,SAAS,CAAC,IAAI,CAAC;CAG1E;AAED;;GAEG;AACH,wBAAgB,iBAAiB,IAAI,aAAa,CAEjD"}
|
|
@@ -53,16 +53,12 @@ export class SimAwsRegion {
|
|
|
53
53
|
return this.accountRegionScopes.accountRegionScope(accountId, this.regionName);
|
|
54
54
|
}
|
|
55
55
|
/**
|
|
56
|
-
* Get
|
|
56
|
+
* Get an installed simulated AWS service for this Region's default Account.
|
|
57
|
+
* The service must be installed with the appropriate installer function
|
|
58
|
+
* first.
|
|
57
59
|
*/
|
|
58
|
-
|
|
59
|
-
return this.account().
|
|
60
|
-
}
|
|
61
|
-
/**
|
|
62
|
-
* Get the simulated S3 service scoped for this Region.
|
|
63
|
-
*/
|
|
64
|
-
s3() {
|
|
65
|
-
return this.account().s3();
|
|
60
|
+
service(serviceName) {
|
|
61
|
+
return this.account().service(serviceName);
|
|
66
62
|
}
|
|
67
63
|
}
|
|
68
64
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sim-aws-region.js","sourceRoot":"","sources":["../../../src/service/aws/sim-aws-region.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"sim-aws-region.js","sourceRoot":"","sources":["../../../src/service/aws/sim-aws-region.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAExC,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,WAAW;IACX,WAAW;IACX,WAAW;IACX,WAAW;IACX,YAAY;IACZ,WAAW;IACX,YAAY;IACZ,gBAAgB;IAChB,gBAAgB;IAChB,gBAAgB;IAChB,YAAY;IACZ,gBAAgB;IAChB,gBAAgB;IAChB,gBAAgB;IAChB,gBAAgB;IAChB,gBAAgB;IAChB,WAAW;IACX,gBAAgB;IAChB,gBAAgB;IAChB,cAAc;IACd,WAAW;IACX,cAAc;IACd,WAAW;IACX,WAAW;IACX,YAAY;IACZ,WAAW;IACX,YAAY;IACZ,YAAY;IACZ,cAAc;IACd,cAAc;IACd,cAAc;IACd,YAAY;IACZ,cAAc;IACd,WAAW;CACH,CAAC;AAIX,MAAM,CAAC,MAAM,2BAA2B,GAAG,WAAoB,CAAC;AAEhE;;GAEG;AACH,MAAM,OAAO,YAAY;IAIJ;IACD;IAFlB,YACmB,mBAAyD,EAC1D,aAA4B,2BAA2B;QADtD,wBAAmB,GAAnB,mBAAmB,CAAsC;QAC1D,eAAU,GAAV,UAAU,CAA6C;IACtE,CAAC;IAEJ;;OAEG;IACH,OAAO,CACL,SAAoC;QAEpC,OAAO,IAAI,CAAC,mBAAmB,CAAC,kBAAkB,CAChD,SAA4B,EAC5B,IAAI,CAAC,UAAU,CAChB,CAAC;IACJ,CAAC;IAED;;;;OAIG;IACH,OAAO,CAA+B,WAAiB;QACrD,OAAO,IAAI,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;IAC7C,CAAC;CACF;AAED;;GAEG;AACH,MAAM,UAAU,iBAAiB;IAC/B,OAAO,KAAK,CAAC,OAAO,CAAC,YAAY,CAAC,gBAAgB,CAAC,CAAC;AACtD,CAAC"}
|
|
@@ -1,21 +1,22 @@
|
|
|
1
|
-
import type { SimDynamoDb } from "../dynamodb/index.js";
|
|
2
|
-
import type { SimS3 } from "../s3/sim-s3.js";
|
|
3
1
|
import type { SimAwsAccountId } from "./sim-aws-account.js";
|
|
4
2
|
import type { AwsRegionName } from "./sim-aws-region.js";
|
|
5
3
|
import type { SimAwsAccountRegionContainer } from "./sim-aws-account-region-scope.js";
|
|
6
4
|
/**
|
|
7
|
-
*
|
|
5
|
+
* Empty installed service map for a simulated AWS environment.
|
|
8
6
|
*/
|
|
9
|
-
export
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
7
|
+
export type NoSimAwsServices = Record<never, never>;
|
|
8
|
+
/**
|
|
9
|
+
* Installed service map for a simulated AWS environment.
|
|
10
|
+
*/
|
|
11
|
+
export type SimAwsServiceMap = object;
|
|
12
|
+
/**
|
|
13
|
+
* Runtime factory for creating a simulated AWS service in an Account Region scope.
|
|
14
|
+
*/
|
|
15
|
+
export type SimAwsServiceFactory = (scope: SimAwsAccountRegionContainer<SimAwsServiceMap>) => unknown;
|
|
13
16
|
/**
|
|
14
17
|
* Interface for accessing combined simulated AWS Account Region scopes.
|
|
15
18
|
*/
|
|
16
|
-
export interface SimAwsAccountRegionScopes {
|
|
17
|
-
accountRegionScope(accountId?: SimAwsAccountId, regionName?: AwsRegionName): SimAwsAccountRegionContainer
|
|
19
|
+
export interface SimAwsAccountRegionScopes<TServices extends SimAwsServiceMap = NoSimAwsServices> {
|
|
20
|
+
accountRegionScope(accountId?: SimAwsAccountId, regionName?: AwsRegionName): SimAwsAccountRegionContainer<TServices>;
|
|
18
21
|
}
|
|
19
|
-
export declare const SIM_AWS_SERVICE_NAMES: readonly ["dynamodb", "s3"];
|
|
20
|
-
export type SimAwsServiceName = (typeof SIM_AWS_SERVICE_NAMES)[number];
|
|
21
22
|
//# sourceMappingURL=sim-aws-services.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sim-aws-services.d.ts","sourceRoot":"","sources":["../../../src/service/aws/sim-aws-services.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"sim-aws-services.d.ts","sourceRoot":"","sources":["../../../src/service/aws/sim-aws-services.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,mCAAmC,CAAC;AAEtF;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;AAEpD;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,MAAM,CAAC;AAEtC;;GAEG;AACH,MAAM,MAAM,oBAAoB,GAAG,CACjC,KAAK,EAAE,4BAA4B,CAAC,gBAAgB,CAAC,KAClD,OAAO,CAAC;AAEb;;GAEG;AACH,MAAM,WAAW,yBAAyB,CACxC,SAAS,SAAS,gBAAgB,GAAG,gBAAgB;IAErD,kBAAkB,CAChB,SAAS,CAAC,EAAE,eAAe,EAC3B,UAAU,CAAC,EAAE,aAAa,GACzB,4BAA4B,CAAC,SAAS,CAAC,CAAC;CAC5C"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export
|
|
1
|
+
export {};
|
|
2
2
|
//# sourceMappingURL=sim-aws-services.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sim-aws-services.js","sourceRoot":"","sources":["../../../src/service/aws/sim-aws-services.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"sim-aws-services.js","sourceRoot":"","sources":["../../../src/service/aws/sim-aws-services.ts"],"names":[],"mappings":""}
|