@kensio/yulin 0.1.2 → 0.3.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.
Files changed (150) hide show
  1. package/README.md +76 -1
  2. package/dist/serve/controller/sim-aws-service-controller-container.d.ts +17 -0
  3. package/dist/serve/controller/sim-aws-service-controller-container.d.ts.map +1 -0
  4. package/dist/serve/controller/sim-aws-service-controller-container.js +29 -0
  5. package/dist/serve/controller/sim-aws-service-controller-container.js.map +1 -0
  6. package/dist/serve/controller/sim-service-controller.d.ts +22 -0
  7. package/dist/serve/controller/sim-service-controller.d.ts.map +1 -0
  8. package/dist/serve/controller/sim-service-controller.js +2 -0
  9. package/dist/serve/controller/sim-service-controller.js.map +1 -0
  10. package/dist/serve/http/sim-aws-http.d.ts +20 -0
  11. package/dist/serve/http/sim-aws-http.d.ts.map +1 -0
  12. package/dist/serve/http/sim-aws-http.js +57 -0
  13. package/dist/serve/http/sim-aws-http.js.map +1 -0
  14. package/dist/serve/http/sim-aws-local-server.d.ts +37 -0
  15. package/dist/serve/http/sim-aws-local-server.d.ts.map +1 -0
  16. package/dist/serve/http/sim-aws-local-server.js +132 -0
  17. package/dist/serve/http/sim-aws-local-server.js.map +1 -0
  18. package/dist/serve/http/sim-aws-local.conf.d.ts +8 -0
  19. package/dist/serve/http/sim-aws-local.conf.d.ts.map +1 -0
  20. package/dist/serve/http/sim-aws-local.conf.js +8 -0
  21. package/dist/serve/http/sim-aws-local.conf.js.map +1 -0
  22. package/dist/serve/index.d.ts +3 -0
  23. package/dist/serve/index.d.ts.map +1 -0
  24. package/dist/serve/index.js +3 -0
  25. package/dist/serve/index.js.map +1 -0
  26. package/dist/serve/resolve/sim-aws-local-service-resolver.d.ts +13 -0
  27. package/dist/serve/resolve/sim-aws-local-service-resolver.d.ts.map +1 -0
  28. package/dist/serve/resolve/sim-aws-local-service-resolver.js +38 -0
  29. package/dist/serve/resolve/sim-aws-local-service-resolver.js.map +1 -0
  30. package/dist/service/aws/arn.d.ts +17 -0
  31. package/dist/service/aws/arn.d.ts.map +1 -0
  32. package/dist/service/aws/arn.js +21 -0
  33. package/dist/service/aws/arn.js.map +1 -0
  34. package/dist/service/aws/sim-aws-account-region-scope.d.ts +38 -0
  35. package/dist/service/aws/sim-aws-account-region-scope.d.ts.map +1 -0
  36. package/dist/service/aws/sim-aws-account-region-scope.js +52 -0
  37. package/dist/service/aws/sim-aws-account-region-scope.js.map +1 -0
  38. package/dist/service/aws/sim-aws-account.d.ts +33 -0
  39. package/dist/service/aws/sim-aws-account.d.ts.map +1 -0
  40. package/dist/service/aws/sim-aws-account.js +38 -0
  41. package/dist/service/aws/sim-aws-account.js.map +1 -0
  42. package/dist/service/aws/sim-aws-region.d.ts +33 -0
  43. package/dist/service/aws/sim-aws-region.d.ts.map +1 -0
  44. package/dist/service/aws/sim-aws-region.js +74 -0
  45. package/dist/service/aws/sim-aws-region.js.map +1 -0
  46. package/dist/service/aws/sim-aws-services.d.ts +21 -0
  47. package/dist/service/aws/sim-aws-services.d.ts.map +1 -0
  48. package/dist/service/aws/sim-aws-services.js +2 -0
  49. package/dist/service/aws/sim-aws-services.js.map +1 -0
  50. package/dist/service/aws/sim-aws.d.ts +50 -0
  51. package/dist/service/aws/sim-aws.d.ts.map +1 -0
  52. package/dist/service/aws/sim-aws.js +82 -0
  53. package/dist/service/aws/sim-aws.js.map +1 -0
  54. package/dist/service/dynamodb/command/create-table/create-table.handler.d.ts +3 -1
  55. package/dist/service/dynamodb/command/create-table/create-table.handler.d.ts.map +1 -1
  56. package/dist/service/dynamodb/command/create-table/create-table.handler.js +9 -6
  57. package/dist/service/dynamodb/command/create-table/create-table.handler.js.map +1 -1
  58. package/dist/service/dynamodb/index.d.ts +1 -1
  59. package/dist/service/dynamodb/index.d.ts.map +1 -1
  60. package/dist/service/dynamodb/index.js +1 -1
  61. package/dist/service/dynamodb/index.js.map +1 -1
  62. package/dist/service/dynamodb/sim-dynamodb.d.ts +29 -0
  63. package/dist/service/dynamodb/sim-dynamodb.d.ts.map +1 -0
  64. package/dist/service/dynamodb/sim-dynamodb.js +47 -0
  65. package/dist/service/dynamodb/sim-dynamodb.js.map +1 -0
  66. package/dist/service/dynamodb/table/dynamodb-table.d.ts +8 -6
  67. package/dist/service/dynamodb/table/dynamodb-table.d.ts.map +1 -1
  68. package/dist/service/dynamodb/table/dynamodb-table.js +16 -9
  69. package/dist/service/dynamodb/table/dynamodb-table.js.map +1 -1
  70. package/dist/service/organizations/sim-aws-account.d.ts +12 -1
  71. package/dist/service/organizations/sim-aws-account.d.ts.map +1 -1
  72. package/dist/service/organizations/sim-aws-account.js +15 -2
  73. package/dist/service/organizations/sim-aws-account.js.map +1 -1
  74. package/dist/service/organizations/sim-aws-region.d.ts +23 -0
  75. package/dist/service/organizations/sim-aws-region.d.ts.map +1 -0
  76. package/dist/service/organizations/sim-aws-region.js +27 -0
  77. package/dist/service/organizations/sim-aws-region.js.map +1 -0
  78. package/dist/service/s3/bucket/s3-bucket.d.ts +30 -0
  79. package/dist/service/s3/bucket/s3-bucket.d.ts.map +1 -0
  80. package/dist/service/s3/bucket/s3-bucket.js +42 -0
  81. package/dist/service/s3/bucket/s3-bucket.js.map +1 -0
  82. package/dist/service/s3/command/create-bucket/create-bucket.handler.d.ts +21 -0
  83. package/dist/service/s3/command/create-bucket/create-bucket.handler.d.ts.map +1 -0
  84. package/dist/service/s3/command/create-bucket/create-bucket.handler.js +58 -0
  85. package/dist/service/s3/command/create-bucket/create-bucket.handler.js.map +1 -0
  86. package/dist/service/s3/command/get-object/get-object.handler.d.ts +17 -0
  87. package/dist/service/s3/command/get-object/get-object.handler.d.ts.map +1 -0
  88. package/dist/service/s3/command/get-object/get-object.handler.js +44 -0
  89. package/dist/service/s3/command/get-object/get-object.handler.js.map +1 -0
  90. package/dist/service/s3/command/list-buckets/list-buckets.handler.d.ts +19 -0
  91. package/dist/service/s3/command/list-buckets/list-buckets.handler.d.ts.map +1 -0
  92. package/dist/service/s3/command/list-buckets/list-buckets.handler.js +52 -0
  93. package/dist/service/s3/command/list-buckets/list-buckets.handler.js.map +1 -0
  94. package/dist/service/s3/command/list-objects/list-objects.handler.d.ts +17 -0
  95. package/dist/service/s3/command/list-objects/list-objects.handler.d.ts.map +1 -0
  96. package/dist/service/s3/command/list-objects/list-objects.handler.js +54 -0
  97. package/dist/service/s3/command/list-objects/list-objects.handler.js.map +1 -0
  98. package/dist/service/s3/command/put-object/put-object.handler.d.ts +19 -0
  99. package/dist/service/s3/command/put-object/put-object.handler.d.ts.map +1 -0
  100. package/dist/service/s3/command/put-object/put-object.handler.js +57 -0
  101. package/dist/service/s3/command/put-object/put-object.handler.js.map +1 -0
  102. package/dist/service/s3/index.d.ts +1 -1
  103. package/dist/service/s3/index.d.ts.map +1 -1
  104. package/dist/service/s3/index.js +1 -2
  105. package/dist/service/s3/index.js.map +1 -1
  106. package/dist/service/s3/object/s3-object.d.ts +17 -0
  107. package/dist/service/s3/object/s3-object.d.ts.map +1 -0
  108. package/dist/service/s3/object/s3-object.js +23 -0
  109. package/dist/service/s3/object/s3-object.js.map +1 -0
  110. package/dist/service/s3/s3.d.ts +33 -0
  111. package/dist/service/s3/s3.d.ts.map +1 -0
  112. package/dist/service/s3/s3.js +56 -0
  113. package/dist/service/s3/s3.js.map +1 -0
  114. package/dist/service/s3/serve/sim-s3-controller.d.ts +15 -0
  115. package/dist/service/s3/serve/sim-s3-controller.d.ts.map +1 -0
  116. package/dist/service/s3/serve/sim-s3-controller.js +29 -0
  117. package/dist/service/s3/serve/sim-s3-controller.js.map +1 -0
  118. package/dist/service/s3/serve/sim-s3-get-obj-controller.d.ts +11 -0
  119. package/dist/service/s3/serve/sim-s3-get-obj-controller.d.ts.map +1 -0
  120. package/dist/service/s3/serve/sim-s3-get-obj-controller.js +35 -0
  121. package/dist/service/s3/serve/sim-s3-get-obj-controller.js.map +1 -0
  122. package/dist/service/s3/serve/sim-s3-req-router.d.ts +26 -0
  123. package/dist/service/s3/serve/sim-s3-req-router.d.ts.map +1 -0
  124. package/dist/service/s3/serve/sim-s3-req-router.js +79 -0
  125. package/dist/service/s3/serve/sim-s3-req-router.js.map +1 -0
  126. package/dist/service/s3/sim-s3-global-registry.d.ts +20 -0
  127. package/dist/service/s3/sim-s3-global-registry.d.ts.map +1 -0
  128. package/dist/service/s3/sim-s3-global-registry.js +22 -0
  129. package/dist/service/s3/sim-s3-global-registry.js.map +1 -0
  130. package/dist/service/s3/sim-s3.d.ts +38 -0
  131. package/dist/service/s3/sim-s3.d.ts.map +1 -0
  132. package/dist/service/s3/sim-s3.js +61 -0
  133. package/dist/service/s3/sim-s3.js.map +1 -0
  134. package/dist/service/s3/storage/s3-body-buffer.d.ts +5 -0
  135. package/dist/service/s3/storage/s3-body-buffer.d.ts.map +1 -0
  136. package/dist/service/s3/storage/s3-body-buffer.js +11 -0
  137. package/dist/service/s3/storage/s3-body-buffer.js.map +1 -0
  138. package/dist/service/s3/storage/s3-bucket-storage.d.ts +20 -0
  139. package/dist/service/s3/storage/s3-bucket-storage.d.ts.map +1 -0
  140. package/dist/service/s3/storage/s3-bucket-storage.js +2 -0
  141. package/dist/service/s3/storage/s3-bucket-storage.js.map +1 -0
  142. package/dist/service/s3/storage/s3-filesystem-storage.d.ts +59 -0
  143. package/dist/service/s3/storage/s3-filesystem-storage.d.ts.map +1 -0
  144. package/dist/service/s3/storage/s3-filesystem-storage.js +266 -0
  145. package/dist/service/s3/storage/s3-filesystem-storage.js.map +1 -0
  146. package/dist/service/s3/storage/s3-memory-storage.d.ts +27 -0
  147. package/dist/service/s3/storage/s3-memory-storage.d.ts.map +1 -0
  148. package/dist/service/s3/storage/s3-memory-storage.js +37 -0
  149. package/dist/service/s3/storage/s3-memory-storage.js.map +1 -0
  150. package/package.json +25 -12
@@ -0,0 +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,KAA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oDb } from "../dynamodb/sim-dynamodb.js";
4
+ import { SimS3 } from "../s3/sim-s3.js";
5
+ import { Memo } from "../../util/memo/memo.js";
6
+ import { SimAws } from "./sim-aws.js";
7
+ import { DynamicFactory } from "@kensio/part-factory";
8
+ /**
9
+ * Combined simulated AWS Account and Region scope.
10
+ */
11
+ export class SimAwsAccountRegionContainer {
12
+ simAws;
13
+ account;
14
+ region;
15
+ s3GlobalRegistry;
16
+ memo = new Memo();
17
+ accountRegionScope;
18
+ constructor(simAws = new SimAws(), account = this.simAws.account(), region = this.simAws.region(), s3GlobalRegistry = this.simAws.s3GlobalRegistry()) {
19
+ this.simAws = simAws;
20
+ this.account = account;
21
+ this.region = region;
22
+ this.s3GlobalRegistry = s3GlobalRegistry;
23
+ this.accountRegionScope = {
24
+ accountId: this.account.accountId,
25
+ regionName: this.region.regionName,
26
+ };
27
+ }
28
+ /**
29
+ * Get the simulated DynamoDB service for this account and region.
30
+ */
31
+ dynamoDb() {
32
+ return this.memo.getOrCreate("dynamoDb", () => {
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
+ });
43
+ }
44
+ }
45
+ /**
46
+ * Generates fake simulated AWS resource scopes.
47
+ */
48
+ export const simAwsAccountRegionScopeFactory = new DynamicFactory(() => ({
49
+ accountId: makeSimAwsAccountId(),
50
+ regionName: makeAwsRegionName(),
51
+ }));
52
+ //# sourceMappingURL=sim-aws-account-region-scope.js.map
@@ -0,0 +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,qBA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I,CAAC,kBAAkB,EAAE,IAAI,CAAC,gBAAgB,CAAC,CAAC;QACnE,CAAC,CAAC,CAAC;IACL,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"}
@@ -0,0 +1,33 @@
1
+ import type { SimDynamoDb } from "../dynamodb/sim-dynamodb.js";
2
+ import type { AwsRegionName } from "./sim-aws-region.js";
3
+ import type { SimS3 } from "../s3/sim-s3.js";
4
+ import type { Brand } from "../../util/brand.type.js";
5
+ import type { SimAwsAccountRegionScopes, SimAwsServices } from "./sim-aws-services.js";
6
+ import type { SimAwsAccountRegionContainer } from "./sim-aws-account-region-scope.js";
7
+ export type SimAwsAccountId = Brand<string, "SimAwsAccountId">;
8
+ export declare const DEFAULT_SIM_AWS_ACCOUNT_ID: SimAwsAccountId;
9
+ /**
10
+ * Container for simulated AWS services in one AWS Account.
11
+ */
12
+ export declare class SimAwsAccount implements SimAwsServices {
13
+ private readonly accountRegionScopes;
14
+ readonly accountId: SimAwsAccountId;
15
+ constructor(accountRegionScopes: SimAwsAccountRegionScopes, accountId?: SimAwsAccountId);
16
+ /**
17
+ * Get a simulated AWS Region scoped for this Account.
18
+ */
19
+ region(regionName?: AwsRegionName): SimAwsAccountRegionContainer;
20
+ /**
21
+ * Get the simulated DynamoDB service for this Account.
22
+ */
23
+ dynamoDb(): SimDynamoDb;
24
+ /**
25
+ * Get the simulated S3 service for this Account.
26
+ */
27
+ s3(): SimS3;
28
+ }
29
+ /**
30
+ * Generate a fake AWS Account ID.
31
+ */
32
+ export declare function makeSimAwsAccountId(): SimAwsAccountId;
33
+ //# sourceMappingURL=sim-aws-account.d.ts.map
@@ -0,0 +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,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,KAAK,EACV,yBAAyB,EACzB,cAAc,EACf,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,aAAc,YAAW,cAAc;IAEhD,OAAO,CAAC,QAAQ,CAAC,mBAAmB;aACpB,SAAS,EAAE,eAAe;gBADzB,mBAAmB,EAAE,yBAAyB,EAC/C,SAAS,GAAE,eAA4C;IAGzE;;OAEG;IACH,MAAM,CAAC,UAAU,CAAC,EAAE,aAAa,GAAG,4BAA4B;IAOhE;;OAEG;IACH,QAAQ,IAAI,WAAW;IAIvB;;OAEG;IACH,EAAE,IAAI,KAAK;CAGZ;AAED;;GAEG;AACH,wBAAgB,mBAAmB,IAAI,eAAe,CAErD"}
@@ -0,0 +1,38 @@
1
+ import { faker } from "@faker-js/faker";
2
+ export const DEFAULT_SIM_AWS_ACCOUNT_ID = "888888888888";
3
+ /**
4
+ * Container for simulated AWS services in one AWS Account.
5
+ */
6
+ export class SimAwsAccount {
7
+ accountRegionScopes;
8
+ accountId;
9
+ constructor(accountRegionScopes, accountId = DEFAULT_SIM_AWS_ACCOUNT_ID) {
10
+ this.accountRegionScopes = accountRegionScopes;
11
+ this.accountId = accountId;
12
+ }
13
+ /**
14
+ * Get a simulated AWS Region scoped for this Account.
15
+ */
16
+ region(regionName) {
17
+ return this.accountRegionScopes.accountRegionScope(this.accountId, regionName);
18
+ }
19
+ /**
20
+ * Get the simulated DynamoDB service for this Account.
21
+ */
22
+ dynamoDb() {
23
+ return this.region().dynamoDb();
24
+ }
25
+ /**
26
+ * Get the simulated S3 service for this Account.
27
+ */
28
+ s3() {
29
+ return this.region().s3();
30
+ }
31
+ }
32
+ /**
33
+ * Generate a fake AWS Account ID.
34
+ */
35
+ export function makeSimAwsAccountId() {
36
+ return faker.string.numeric({ length: 12 });
37
+ }
38
+ //# sourceMappingURL=sim-aws-account.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sim-aws-account.js","sourceRoot":"","sources":["../../../src/service/aws/sim-aws-account.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAIxC,MAAM,CAAC,MAAM,0BAA0B,GAAG,cAAiC,CAAC;AAE5E;;GAEG;AACH,MAAM,OAAO,aAAa;IAEL;IACD;IAFlB,YACmB,mBAA8C,EAC/C,YAA6B,0BAA0B;QADtD,wBAAmB,GAAnB,mBAAmB,CAA2B;QAC/C,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;;OAEG;IACH,QAAQ;QACN,OAAO,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC;IAClC,CAAC;IAED;;OAEG;IACH,EAAE;QACA,OAAO,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;IAC5B,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"}
@@ -0,0 +1,33 @@
1
+ import type { SimAwsAccountId } from "./sim-aws-account.js";
2
+ import type { SimAwsAccountRegionContainer } from "./sim-aws-account-region-scope.js";
3
+ import type { SimAwsAccountRegionScopes, SimAwsServices } from "./sim-aws-services.js";
4
+ import type { SimS3 } from "../s3/sim-s3.js";
5
+ import type { SimDynamoDb } from "../dynamodb/sim-dynamodb.js";
6
+ 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
+ export type AwsRegionName = (typeof AWS_REGION_NAMES)[number];
8
+ export declare const DEFAULT_SIM_AWS_REGION_NAME: "us-east-1";
9
+ /**
10
+ * Simulated AWS Region.
11
+ */
12
+ export declare class SimAwsRegion implements SimAwsServices {
13
+ private readonly accountRegionScopes;
14
+ readonly regionName: AwsRegionName;
15
+ constructor(accountRegionScopes: SimAwsAccountRegionScopes, regionName?: AwsRegionName);
16
+ /**
17
+ * Get a simulated AWS Account scoped for this Region.
18
+ */
19
+ account(accountId?: SimAwsAccountId | string): SimAwsAccountRegionContainer;
20
+ /**
21
+ * Get the simulated DynamoDB service scoped for this Region.
22
+ */
23
+ dynamoDb(): SimDynamoDb;
24
+ /**
25
+ * Get the simulated S3 service scoped for this Region.
26
+ */
27
+ s3(): SimS3;
28
+ }
29
+ /**
30
+ * Choose a random AWS Region name.
31
+ */
32
+ export declare function makeAwsRegionName(): AwsRegionName;
33
+ //# sourceMappingURL=sim-aws-region.d.ts.map
@@ -0,0 +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,cAAc,EACf,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAG/D,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,YAAa,YAAW,cAAc;IAE/C,OAAO,CAAC,QAAQ,CAAC,mBAAmB;aACpB,UAAU,EAAE,aAAa;gBADxB,mBAAmB,EAAE,yBAAyB,EAC/C,UAAU,GAAE,aAA2C;IAGzE;;OAEG;IACH,OAAO,CAAC,SAAS,CAAC,EAAE,eAAe,GAAG,MAAM,GAAG,4BAA4B;IAO3E;;OAEG;IACH,QAAQ,IAAI,WAAW;IAIvB;;OAEG;IACH,EAAE,IAAI,KAAK;CAGZ;AAED;;GAEG;AACH,wBAAgB,iBAAiB,IAAI,aAAa,CAEjD"}
@@ -0,0 +1,74 @@
1
+ import { faker } from "@faker-js/faker";
2
+ export const AWS_REGION_NAMES = [
3
+ "us-east-1",
4
+ "us-east-2",
5
+ "us-west-1",
6
+ "us-west-2",
7
+ "af-south-1",
8
+ "ap-east-1",
9
+ "ap-south-2",
10
+ "ap-southeast-3",
11
+ "ap-southeast-5",
12
+ "ap-southeast-4",
13
+ "ap-south-1",
14
+ "ap-southeast-6",
15
+ "ap-northeast-3",
16
+ "ap-northeast-2",
17
+ "ap-southeast-1",
18
+ "ap-southeast-2",
19
+ "ap-east-2",
20
+ "ap-southeast-7",
21
+ "ap-northeast-1",
22
+ "ca-central-1",
23
+ "ca-west-1",
24
+ "eu-central-1",
25
+ "eu-west-1",
26
+ "eu-west-2",
27
+ "eu-south-1",
28
+ "eu-west-3",
29
+ "eu-south-2",
30
+ "eu-north-1",
31
+ "eu-central-2",
32
+ "il-central-1",
33
+ "mx-central-1",
34
+ "me-south-1",
35
+ "me-central-1",
36
+ "sa-east-1",
37
+ ];
38
+ export const DEFAULT_SIM_AWS_REGION_NAME = "us-east-1";
39
+ /**
40
+ * Simulated AWS Region.
41
+ */
42
+ export class SimAwsRegion {
43
+ accountRegionScopes;
44
+ regionName;
45
+ constructor(accountRegionScopes, regionName = DEFAULT_SIM_AWS_REGION_NAME) {
46
+ this.accountRegionScopes = accountRegionScopes;
47
+ this.regionName = regionName;
48
+ }
49
+ /**
50
+ * Get a simulated AWS Account scoped for this Region.
51
+ */
52
+ account(accountId) {
53
+ return this.accountRegionScopes.accountRegionScope(accountId, this.regionName);
54
+ }
55
+ /**
56
+ * Get the simulated DynamoDB service scoped for this Region.
57
+ */
58
+ dynamoDb() {
59
+ return this.account().dynamoDb();
60
+ }
61
+ /**
62
+ * Get the simulated S3 service scoped for this Region.
63
+ */
64
+ s3() {
65
+ return this.account().s3();
66
+ }
67
+ }
68
+ /**
69
+ * Choose a random AWS Region name.
70
+ */
71
+ export function makeAwsRegionName() {
72
+ return faker.helpers.arrayElement(AWS_REGION_NAMES);
73
+ }
74
+ //# sourceMappingURL=sim-aws-region.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sim-aws-region.js","sourceRoot":"","sources":["../../../src/service/aws/sim-aws-region.ts"],"names":[],"mappings":"AAQA,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;IAEJ;IACD;IAFlB,YACmB,mBAA8C,EAC/C,aAA4B,2BAA2B;QADtD,wBAAmB,GAAnB,mBAAmB,CAA2B;QAC/C,eAAU,GAAV,UAAU,CAA6C;IACtE,CAAC;IAEJ;;OAEG;IACH,OAAO,CAAC,SAAoC;QAC1C,OAAO,IAAI,CAAC,mBAAmB,CAAC,kBAAkB,CAChD,SAA4B,EAC5B,IAAI,CAAC,UAAU,CAChB,CAAC;IACJ,CAAC;IAED;;OAEG;IACH,QAAQ;QACN,OAAO,IAAI,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,CAAC;IACnC,CAAC;IAED;;OAEG;IACH,EAAE;QACA,OAAO,IAAI,CAAC,OAAO,EAAE,CAAC,EAAE,EAAE,CAAC;IAC7B,CAAC;CACF;AAED;;GAEG;AACH,MAAM,UAAU,iBAAiB;IAC/B,OAAO,KAAK,CAAC,OAAO,CAAC,YAAY,CAAC,gBAAgB,CAAC,CAAC;AACtD,CAAC"}
@@ -0,0 +1,21 @@
1
+ import type { SimDynamoDb } from "../dynamodb/index.js";
2
+ import type { SimS3 } from "../s3/sim-s3.js";
3
+ import type { SimAwsAccountId } from "./sim-aws-account.js";
4
+ import type { AwsRegionName } from "./sim-aws-region.js";
5
+ import type { SimAwsAccountRegionContainer } from "./sim-aws-account-region-scope.js";
6
+ /**
7
+ * Interface for accessing AWS services within a simulated AWS.
8
+ */
9
+ export interface SimAwsServices {
10
+ dynamoDb(): SimDynamoDb;
11
+ s3(): SimS3;
12
+ }
13
+ /**
14
+ * Interface for accessing combined simulated AWS Account Region scopes.
15
+ */
16
+ export interface SimAwsAccountRegionScopes {
17
+ accountRegionScope(accountId?: SimAwsAccountId, regionName?: AwsRegionName): SimAwsAccountRegionContainer;
18
+ }
19
+ export declare const SIM_AWS_SERVICE_NAMES: readonly ["dynamodb", "s3"];
20
+ export type SimAwsServiceName = (typeof SIM_AWS_SERVICE_NAMES)[number];
21
+ //# sourceMappingURL=sim-aws-services.d.ts.map
@@ -0,0 +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,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAC7C,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,WAAW,cAAc;IAC7B,QAAQ,IAAI,WAAW,CAAC;IACxB,EAAE,IAAI,KAAK,CAAC;CACb;AAED;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACxC,kBAAkB,CAChB,SAAS,CAAC,EAAE,eAAe,EAC3B,UAAU,CAAC,EAAE,aAAa,GACzB,4BAA4B,CAAC;CACjC;AAED,eAAO,MAAM,qBAAqB,6BAA8B,CAAC;AAEjE,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,qBAAqB,CAAC,CAAC,MAAM,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export const SIM_AWS_SERVICE_NAMES = ["dynamodb", "s3"];
2
+ //# sourceMappingURL=sim-aws-services.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sim-aws-services.js","sourceRoot":"","sources":["../../../src/service/aws/sim-aws-services.ts"],"names":[],"mappings":"AAwBA,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,UAAU,EAAE,IAAI,CAAU,CAAC"}
@@ -0,0 +1,50 @@
1
+ import { SimAwsAccount, type SimAwsAccountId } from "./sim-aws-account.js";
2
+ import { type BackgroundCompleter, type BackgroundScheduler } from "../../util/background/background.js";
3
+ import { SimAwsRegion, type AwsRegionName } from "./sim-aws-region.js";
4
+ import type { SimAwsAccountRegionScopes, SimAwsServices } from "./sim-aws-services.js";
5
+ import type { SimS3 } from "../s3/sim-s3.js";
6
+ import type { SimDynamoDb } from "../dynamodb/sim-dynamodb.js";
7
+ import { SimAwsAccountRegionContainer } from "./sim-aws-account-region-scope.js";
8
+ import { SimS3GlobalRegistry } from "../s3/sim-s3-global-registry.js";
9
+ /**
10
+ * Top-level container for simulated AWS.
11
+ */
12
+ export declare class SimAws implements SimAwsServices, SimAwsAccountRegionScopes {
13
+ readonly defaultAccountId: SimAwsAccountId;
14
+ readonly defaultRegionName: "us-east-1";
15
+ readonly background: BackgroundScheduler & BackgroundCompleter;
16
+ private readonly accounts;
17
+ private readonly regions;
18
+ private readonly accountRegionScopes;
19
+ private readonly memo;
20
+ constructor(defaultAccountId?: SimAwsAccountId, defaultRegionName?: "us-east-1", background?: BackgroundScheduler & BackgroundCompleter);
21
+ /**
22
+ * Get a simulated AWS Account.
23
+ */
24
+ account(accountId?: string): SimAwsAccount;
25
+ /**
26
+ * Get a simulated AWS Account Region scope.
27
+ */
28
+ region(regionName?: AwsRegionName): SimAwsRegion;
29
+ /**
30
+ * Get an Account Region scope in this simulated AWS.
31
+ */
32
+ accountRegionScope(accountId?: SimAwsAccountId, regionName?: AwsRegionName): SimAwsAccountRegionContainer;
33
+ /**
34
+ * Get the simulated global S3 registry for this AWS environment.
35
+ */
36
+ s3GlobalRegistry(): SimS3GlobalRegistry;
37
+ /**
38
+ * Get a simulated DynamoDB service in the default Account Region scope.
39
+ */
40
+ dynamoDb(): SimDynamoDb;
41
+ /**
42
+ * Get a simulated S3 service in the default Account Region scope.
43
+ */
44
+ s3(): SimS3;
45
+ /**
46
+ * Wait for all outstanding background tasks to complete.
47
+ */
48
+ backgroundTasksComplete(): Promise<void>;
49
+ }
50
+ //# sourceMappingURL=sim-aws.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sim-aws.d.ts","sourceRoot":"","sources":["../../../src/service/aws/sim-aws.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,aAAa,EACb,KAAK,eAAe,EACrB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EAEzB,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAEL,YAAY,EACZ,KAAK,aAAa,EACnB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EACV,yBAAyB,EACzB,cAAc,EACf,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAEL,4BAA4B,EAC7B,MAAM,mCAAmC,CAAC;AAE3C,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAEtE;;GAEG;AACH,qBAAa,MAAO,YAAW,cAAc,EAAE,yBAAyB;aAWpD,gBAAgB;aAChB,iBAAiB;aACjB,UAAU,EAAE,mBAAmB,GAC7C,mBAAmB;IAbvB,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAA6C;IACtE,OAAO,CAAC,QAAQ,CAAC,OAAO,CAA0C;IAClE,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAGhC;IAEJ,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAsB;gBAGzB,gBAAgB,kBAA6B,EAC7C,iBAAiB,cAA8B,EAC/C,UAAU,GAAE,mBAAmB,GAC7C,mBAA2C;IAG/C;;OAEG;IACH,OAAO,CAAC,SAAS,GAAE,MAA8B,GAAG,aAAa;IAWjE;;OAEG;IACH,MAAM,CAAC,UAAU,GAAE,aAAsC,GAAG,YAAY;IAWxE;;OAEG;IACH,kBAAkB,CAChB,SAAS,GAAE,eAAuC,EAClD,UAAU,GAAE,aAAsC,GACjD,4BAA4B;IAiB/B;;OAEG;IACH,gBAAgB,IAAI,mBAAmB;IAOvC;;OAEG;IACH,QAAQ,IAAI,WAAW;IAIvB;;OAEG;IACH,EAAE,IAAI,KAAK;IAIX;;OAEG;IACG,uBAAuB,IAAI,OAAO,CAAC,IAAI,CAAC;CAG/C"}
@@ -0,0 +1,82 @@
1
+ import { DEFAULT_SIM_AWS_ACCOUNT_ID, SimAwsAccount, } from "./sim-aws-account.js";
2
+ import { BackgroundTasks, } from "../../util/background/background.js";
3
+ import { DEFAULT_SIM_AWS_REGION_NAME, SimAwsRegion, } from "./sim-aws-region.js";
4
+ import { SimAwsAccountRegionContainer, } from "./sim-aws-account-region-scope.js";
5
+ import { Memo } from "../../util/memo/memo.js";
6
+ import { SimS3GlobalRegistry } from "../s3/sim-s3-global-registry.js";
7
+ /**
8
+ * Top-level container for simulated AWS.
9
+ */
10
+ export class SimAws {
11
+ defaultAccountId;
12
+ defaultRegionName;
13
+ background;
14
+ accounts = new Map();
15
+ regions = new Map();
16
+ accountRegionScopes = new Map();
17
+ memo = new Memo();
18
+ constructor(defaultAccountId = DEFAULT_SIM_AWS_ACCOUNT_ID, defaultRegionName = DEFAULT_SIM_AWS_REGION_NAME, background = new BackgroundTasks()) {
19
+ this.defaultAccountId = defaultAccountId;
20
+ this.defaultRegionName = defaultRegionName;
21
+ this.background = background;
22
+ }
23
+ /**
24
+ * Get a simulated AWS Account.
25
+ */
26
+ account(accountId = this.defaultAccountId) {
27
+ let account = this.accounts.get(accountId);
28
+ if (account === undefined) {
29
+ account = new SimAwsAccount(this, accountId);
30
+ this.accounts.set(accountId, account);
31
+ }
32
+ return account;
33
+ }
34
+ /**
35
+ * Get a simulated AWS Account Region scope.
36
+ */
37
+ region(regionName = this.defaultRegionName) {
38
+ let region = this.regions.get(regionName);
39
+ if (region === undefined) {
40
+ region = new SimAwsRegion(this, regionName);
41
+ this.regions.set(regionName, region);
42
+ }
43
+ return region;
44
+ }
45
+ /**
46
+ * Get an Account Region scope in this simulated AWS.
47
+ */
48
+ accountRegionScope(accountId = this.defaultAccountId, regionName = this.defaultRegionName) {
49
+ const scopeKey = `${accountId}:${regionName}`;
50
+ let accountRegionScope = this.accountRegionScopes.get(scopeKey);
51
+ if (accountRegionScope === undefined) {
52
+ accountRegionScope = new SimAwsAccountRegionContainer(this, this.account(accountId), this.region(regionName), this.s3GlobalRegistry());
53
+ this.accountRegionScopes.set(scopeKey, accountRegionScope);
54
+ }
55
+ return accountRegionScope;
56
+ }
57
+ /**
58
+ * Get the simulated global S3 registry for this AWS environment.
59
+ */
60
+ s3GlobalRegistry() {
61
+ return this.memo.getOrCreate("s3GlobalRegistry", () => new SimS3GlobalRegistry());
62
+ }
63
+ /**
64
+ * Get a simulated DynamoDB service in the default Account Region scope.
65
+ */
66
+ dynamoDb() {
67
+ return this.accountRegionScope().dynamoDb();
68
+ }
69
+ /**
70
+ * Get a simulated S3 service in the default Account Region scope.
71
+ */
72
+ s3() {
73
+ return this.accountRegionScope().s3();
74
+ }
75
+ /**
76
+ * Wait for all outstanding background tasks to complete.
77
+ */
78
+ async backgroundTasksComplete() {
79
+ await this.background.complete();
80
+ }
81
+ }
82
+ //# sourceMappingURL=sim-aws.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sim-aws.js","sourceRoot":"","sources":["../../../src/service/aws/sim-aws.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,0BAA0B,EAC1B,aAAa,GAEd,MAAM,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C,UAAU,CAAC,QAAQ,EAAE,CAAC;IACnC,CAAC;CACF"}
@@ -3,15 +3,17 @@ import { SimDynamoDbTable } from "../../table/dynamodb-table.js";
3
3
  import { type CreateTableCommand, type CreateTableCommandOutput } from "@aws-sdk/client-dynamodb";
4
4
  import type { BackgroundScheduler } from "../../../../util/background/background.js";
5
5
  import type { CommandHandler } from "../../../../command/command-handler.js";
6
+ import type { SimAwsAccountRegionScope } from "../../../aws/sim-aws-account-region-scope.js";
6
7
  /**
7
8
  * DynamoDB CreateTableCommand handler.
8
9
  *
9
10
  * https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/dynamodb/command/CreateTableCommand/
10
11
  */
11
12
  export declare class CreateTableCommandHandler implements CommandHandler<CreateTableCommand, CreateTableCommandOutput> {
13
+ private readonly accountRegionScope;
12
14
  private readonly tables;
13
15
  private readonly background;
14
- constructor(tables: Map<DynamoDbTableName, SimDynamoDbTable>, background: BackgroundScheduler);
16
+ constructor(accountRegionScope: SimAwsAccountRegionScope, tables: Map<DynamoDbTableName, SimDynamoDbTable>, background: BackgroundScheduler);
15
17
  /**
16
18
  * Handle creation of a new DynamoDB Table.
17
19
  */
@@ -1 +1 @@
1
- {"version":3,"file":"create-table.handler.d.ts","sourceRoot":"","sources":["../../../../../src/service/dynamodb/command/create-table/create-table.handler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AACvE,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EACL,KAAK,kBAAkB,EACvB,KAAK,wBAAwB,EAE9B,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2CAA2C,CAAC;AACrF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wCAAwC,CAAC;AAG7E;;;;GAIG;AACH,qBAAa,yBAA0B,YAAW,cAAc,CAC9D,kBAAkB,EAClB,wBAAwB,CACzB;IAEG,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,UAAU;gBADV,MAAM,EAAE,GAAG,CAAC,iBAAiB,EAAE,gBAAgB,CAAC,EAChD,UAAU,EAAE,mBAAmB;IAGlD;;OAEG;IACG,MAAM,CAAC,GAAG,EAAE,kBAAkB,GAAG,OAAO,CAAC,wBAAwB,CAAC;CAgCzE"}
1
+ {"version":3,"file":"create-table.handler.d.ts","sourceRoot":"","sources":["../../../../../src/service/dynamodb/command/create-table/create-table.handler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AACvE,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EACL,KAAK,kBAAkB,EACvB,KAAK,wBAAwB,EAE9B,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2CAA2C,CAAC;AACrF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wCAAwC,CAAC;AAI7E,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,8CAA8C,CAAC;AAE7F;;;;GAIG;AACH,qBAAa,yBAA0B,YAAW,cAAc,CAC9D,kBAAkB,EAClB,wBAAwB,CACzB;IAEG,OAAO,CAAC,QAAQ,CAAC,kBAAkB;IACnC,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,UAAU;gBAFV,kBAAkB,EAAE,wBAAwB,EAC5C,MAAM,EAAE,GAAG,CAAC,iBAAiB,EAAE,gBAAgB,CAAC,EAChD,UAAU,EAAE,mBAAmB;IAGlD;;OAEG;IACG,MAAM,CAAC,GAAG,EAAE,kBAAkB,GAAG,OAAO,CAAC,wBAAwB,CAAC;CAgCzE"}
@@ -1,15 +1,18 @@
1
1
  import { SimDynamoDbTable } from "../../table/dynamodb-table.js";
2
2
  import { ResourceInUseException, } from "@aws-sdk/client-dynamodb";
3
3
  import { jitter } from "../../../../util/sleep.js";
4
+ import { assertDefined } from "../../../../util/defined.js";
4
5
  /**
5
6
  * DynamoDB CreateTableCommand handler.
6
7
  *
7
8
  * https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/dynamodb/command/CreateTableCommand/
8
9
  */
9
10
  export class CreateTableCommandHandler {
11
+ accountRegionScope;
10
12
  tables;
11
13
  background;
12
- constructor(tables, background) {
14
+ constructor(accountRegionScope, tables, background) {
15
+ this.accountRegionScope = accountRegionScope;
13
16
  this.tables = tables;
14
17
  this.background = background;
15
18
  }
@@ -17,9 +20,7 @@ export class CreateTableCommandHandler {
17
20
  * Handle creation of a new DynamoDB Table.
18
21
  */
19
22
  async handle(cmd) {
20
- if (cmd.input.TableName === undefined) {
21
- throw new Error("CreateTableCommand.input.TableName is required");
22
- }
23
+ assertDefined(cmd.input.TableName, "CreateTableCommand.input.TableName");
23
24
  const tableName = cmd.input.TableName;
24
25
  if (this.tables.has(tableName)) {
25
26
  throw new ResourceInUseException({
@@ -28,13 +29,15 @@ export class CreateTableCommandHandler {
28
29
  });
29
30
  }
30
31
  await jitter();
31
- const table = new SimDynamoDbTable(cmd, this.background);
32
+ const tableArn = `arn:aws:dynamodb:${this.accountRegionScope.regionName}:${this.accountRegionScope.accountId}:table/${tableName}`;
33
+ const table = new SimDynamoDbTable(cmd, tableArn, this.background);
32
34
  this.tables.set(tableName, table);
33
35
  this.background.schedule(() => table.activate());
34
36
  return {
35
37
  TableDescription: {
36
38
  AttributeDefinitions: [],
37
- TableName: tableName,
39
+ TableName: table.tableName,
40
+ TableArn: table.simArn,
38
41
  KeySchema: [],
39
42
  TableStatus: table.status,
40
43
  CreationDateTime: table.creationDateTime,
@@ -1 +1 @@
1
- {"version":3,"file":"create-table.handler.js","sourceRoot":"","sources":["../../../../../src/service/dynamodb/command/create-table/create-table.handler.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE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E,EAAE;SACd,CAAC;IACJ,CAAC;CACF"}
1
+ {"version":3,"file":"create-table.handler.js","sourceRoot":"","sources":["../../../../../src/service/dynamodb/command/create-table/create-table.handler.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAGL,sBAAsB,GACvB,MAAM,0BAA0B,CAAC;AAGlC,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAI5D;;;;GAIG;AACH,MAAM,OAAO,yBAAyB;IAKjB;IACA;IACA;IAHnB,YACmB,kBAA4C,EAC5C,MAAgD,EAChD,UAA+B;QAF/B,uBAAkB,GAAlB,kBAAkB,CAA0B;QAC5C,WAAM,GAAN,MAAM,CAA0C;QAChD,eAAU,GAAV,UAAU,CAAqB;IAC/C,CAAC;IAEJ;;OAEG;IACH,KAAK,CAAC,MAAM,CAAC,GAAuB;QAClC,aAAa,CAAC,GAAG,CAAC,KAAK,CAAC,SAAS,EAAE,oCAAoC,CAAC,CAAC;QAEzE,MAAM,SAAS,GAAG,GAAG,CAAC,KAAK,CAAC,SAA8B,CAAC;QAC3D,IAAI,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE,CAAC;YAC/B,MAAM,IAAI,sBAAsB,CAAC;gBAC/B,OAAO,EAAE,kBAAkB,SAAS,iBAAiB;gBACrD,SAAS,EAAE,EAAE;aACd,CAAC,CAAC;QACL,CAAC;QAED,MAAM,MAAM,EAAE,CAAC;QAEf,MAAM,QAAQ,GAAW,oBAAoB,IAAI,CAAC,kBAAkB,CAAC,UAAU,IAAI,IAAI,CAAC,kBAAkB,CAAC,SAAS,UAAU,SAAS,EAAE,CAAC;QAC1I,MAAM,KAAK,GAAG,IAAI,gBAAgB,CAAC,GAAG,EAAE,QAAQ,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;QACnE,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;QAElC,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAC;QAEjD,OAAO;YACL,gBAAgB,EAAE;gBAChB,oBAAoB,EAAE,EAAE;gBACxB,SAAS,EAAE,KAAK,CAAC,SAAS;gBAC1B,QAAQ,EAAE,KAAK,CAAC,MAAM;gBACtB,SAAS,EAAE,EAAE;gBACb,WAAW,EAAE,KAAK,CAAC,MAAM;gBACzB,gBAAgB,EAAE,KAAK,CAAC,gBAAgB;gBACxC,sBAAsB,EAAE,EAAE;aAC3B;YACD,SAAS,EAAE,EAAE;SACd,CAAC;IACJ,CAAC;CACF"}
@@ -1,2 +1,2 @@
1
- export {};
1
+ export { SimDynamoDb } from "./sim-dynamodb.js";
2
2
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/service/dynamodb/index.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/service/dynamodb/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC"}
@@ -1,2 +1,2 @@
1
- export {};
1
+ export { SimDynamoDb } from "./sim-dynamodb.js";
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/service/dynamodb/index.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/service/dynamodb/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC"}
@@ -0,0 +1,29 @@
1
+ import type { CreateTableCommand, CreateTableOutput, DescribeTableCommand, DescribeTableOutput, ListTablesCommand, ListTablesOutput, PutItemCommand, PutItemCommandOutput } from "@aws-sdk/client-dynamodb";
2
+ import { type BackgroundScheduler } from "../../util/background/background.js";
3
+ import { type SimAwsAccountRegionScope } from "../aws/sim-aws-account-region-scope.js";
4
+ /**
5
+ * Simulated DynamoDB. Handles SDK commands. Emulates AWS behaviour and state.
6
+ */
7
+ export declare class SimDynamoDb {
8
+ private readonly accountRegionScope;
9
+ private readonly background;
10
+ private readonly tables;
11
+ constructor(accountRegionScope?: SimAwsAccountRegionScope, background?: BackgroundScheduler);
12
+ /**
13
+ * Handle a Create Table Command from the SDK.
14
+ */
15
+ createTable(cmd: CreateTableCommand): Promise<CreateTableOutput>;
16
+ /**
17
+ * Handle a List Tables Command from the SDK.
18
+ */
19
+ listTables(cmd: ListTablesCommand): Promise<ListTablesOutput>;
20
+ /**
21
+ * Handle a Describe Table Command from the SDK.
22
+ */
23
+ describeTable(cmd: DescribeTableCommand): Promise<DescribeTableOutput>;
24
+ /**
25
+ * Handle a Put Item Command from the SDK.
26
+ */
27
+ putItem(cmd: PutItemCommand): Promise<PutItemCommandOutput>;
28
+ }
29
+ //# sourceMappingURL=sim-dynamodb.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sim-dynamodb.d.ts","sourceRoot":"","sources":["../../../src/service/dynamodb/sim-dynamodb.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,kBAAkB,EAClB,iBAAiB,EACjB,oBAAoB,EACpB,mBAAmB,EACnB,iBAAiB,EACjB,gBAAgB,EAChB,cAAc,EACd,oBAAoB,EACrB,MAAM,0BAA0B,CAAC;AAMlC,OAAO,EACL,KAAK,mBAAmB,EAEzB,MAAM,qCAAqC,CAAC;AAI7C,OAAO,EACL,KAAK,wBAAwB,EAE9B,MAAM,wCAAwC,CAAC;AAEhD;;GAEG;AACH,qBAAa,WAAW;IAIpB,OAAO,CAAC,QAAQ,CAAC,kBAAkB;IACnC,OAAO,CAAC,QAAQ,CAAC,UAAU;IAJ7B,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAkD;gBAGtD,kBAAkB,GAAE,wBAAiE,EACrF,UAAU,GAAE,mBAA2C;IAG1E;;OAEG;IACG,WAAW,CAAC,GAAG,EAAE,kBAAkB,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAStE;;OAEG;IACG,UAAU,CAAC,GAAG,EAAE,iBAAiB,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAKnE;;OAEG;IACG,aAAa,CAAC,GAAG,EAAE,oBAAoB,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAK5E;;OAEG;IACG,OAAO,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,oBAAoB,CAAC;CAIlE"}
@@ -0,0 +1,47 @@
1
+ import { CreateTableCommandHandler } from "./command/create-table/create-table.handler.js";
2
+ import { BackgroundTasks, } from "../../util/background/background.js";
3
+ import { ListTablesCommandHandler } from "./command/list-tables/list-tables.handler.js";
4
+ import { DescribeTableCommandHandler } from "./command/describe-table/describe-table.handler.js";
5
+ import { PutItemCommandHandler } from "./command/put-item/put-item.handler.js";
6
+ import { simAwsAccountRegionScopeFactory, } from "../aws/sim-aws-account-region-scope.js";
7
+ /**
8
+ * Simulated DynamoDB. Handles SDK commands. Emulates AWS behaviour and state.
9
+ */
10
+ export class SimDynamoDb {
11
+ accountRegionScope;
12
+ background;
13
+ tables = new Map();
14
+ constructor(accountRegionScope = simAwsAccountRegionScopeFactory.make(), background = new BackgroundTasks()) {
15
+ this.accountRegionScope = accountRegionScope;
16
+ this.background = background;
17
+ }
18
+ /**
19
+ * Handle a Create Table Command from the SDK.
20
+ */
21
+ async createTable(cmd) {
22
+ const handler = new CreateTableCommandHandler(this.accountRegionScope, this.tables, this.background);
23
+ return await handler.handle(cmd);
24
+ }
25
+ /**
26
+ * Handle a List Tables Command from the SDK.
27
+ */
28
+ async listTables(cmd) {
29
+ const handler = new ListTablesCommandHandler(this.tables);
30
+ return await handler.handle(cmd);
31
+ }
32
+ /**
33
+ * Handle a Describe Table Command from the SDK.
34
+ */
35
+ async describeTable(cmd) {
36
+ const handler = new DescribeTableCommandHandler(this.tables);
37
+ return await handler.handle(cmd);
38
+ }
39
+ /**
40
+ * Handle a Put Item Command from the SDK.
41
+ */
42
+ async putItem(cmd) {
43
+ const handler = new PutItemCommandHandler(this.tables);
44
+ return await handler.handle(cmd);
45
+ }
46
+ }
47
+ //# sourceMappingURL=sim-dynamodb.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sim-dynamodb.js","sourceRoot":"","sources":["../../../src/service/dynamodb/sim-dynamodb.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,yBAAyB,EAAE,MAAM,gDAAgD,CAAC;AAC3F,OAAO,EAEL,eAAe,GAChB,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAAE,wBAAwB,EAAE,MAAM,8CAA8C,CAAC;AACxF,OAAO,EAAE,2BAA2B,EAAE,MAAM,oDAAoD,CAAC;AACjG,OAAO,EAAE,qBAAqB,EAAE,MAAM,wCAAwC,CAAC;AAC/E,OAAO,EAEL,+BAA+B,GAChC,MAAM,wCAAwC,CAAC;AAEhD;;GAEG;AACH,MAAM,OAAO,WAAW;IAIH;IACA;IAJF,MAAM,GAAG,IAAI,GAAG,EAAuC,CAAC;IAEzE,YACmB,qBAA+C,+BAA+B,CAAC,IAAI,EAAE,EACrF,aAAkC,IAAI,eAAe,EAAE;QADvD,uBAAkB,GAAlB,kBAAkB,CAAmE;QACrF,eAAU,GAAV,UAAU,CAA6C;IACvE,CAAC;IAEJ;;OAEG;IACH,KAAK,CAAC,WAAW,CAAC,GAAuB;QACvC,MAAM,OAAO,GAAG,IAAI,yBAAyB,CAC3C,IAAI,CAAC,kBAAkB,EACvB,IAAI,CAAC,MAAM,EACX,IAAI,CAAC,UAAU,CAChB,CAAC;QACF,OAAO,MAAM,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;IACnC,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,UAAU,CAAC,GAAsB;QACrC,MAAM,OAAO,GAAG,IAAI,wBAA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