@infra-blocks/aws-dynamodb 0.54.0 → 0.55.0-alpha.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 (77) hide show
  1. package/lib/cjs/client.d.ts +4 -5
  2. package/lib/cjs/client.js +5 -6
  3. package/lib/cjs/client.js.map +1 -1
  4. package/lib/cjs/commands/command/codecs/create-table.d.ts +6 -0
  5. package/lib/cjs/commands/command/codecs/create-table.js +10 -0
  6. package/lib/cjs/commands/command/codecs/create-table.js.map +1 -0
  7. package/lib/cjs/commands/command/command.d.ts +18 -9
  8. package/lib/cjs/commands/command/command.js +9 -5
  9. package/lib/cjs/commands/command/command.js.map +1 -1
  10. package/lib/cjs/commands/command/commands.d.ts +2 -1
  11. package/lib/cjs/commands/command/commands.js.map +1 -1
  12. package/lib/cjs/commands/command/create-table.d.ts +8 -0
  13. package/lib/cjs/commands/command/create-table.js +17 -0
  14. package/lib/cjs/commands/command/create-table.js.map +1 -0
  15. package/lib/cjs/commands/command/delete-item.d.ts +3 -3
  16. package/lib/cjs/commands/command/delete-item.js +1 -1
  17. package/lib/cjs/commands/command/delete-item.js.map +1 -1
  18. package/lib/cjs/commands/command/get-item.d.ts +3 -3
  19. package/lib/cjs/commands/command/get-item.js +1 -1
  20. package/lib/cjs/commands/command/get-item.js.map +1 -1
  21. package/lib/cjs/commands/command/index.d.ts +6 -0
  22. package/lib/cjs/commands/command/index.js +26 -0
  23. package/lib/cjs/commands/command/index.js.map +1 -0
  24. package/lib/cjs/commands/command/inputs/create-table.d.ts +7 -5
  25. package/lib/cjs/commands/command/inputs/create-table.js +75 -0
  26. package/lib/cjs/commands/command/inputs/create-table.js.map +1 -1
  27. package/lib/cjs/commands/command/inputs/index.d.ts +1 -0
  28. package/lib/cjs/commands/command/outputs/create-table.d.ts +3 -0
  29. package/lib/cjs/commands/command/outputs/create-table.js +7 -0
  30. package/lib/cjs/commands/command/outputs/create-table.js.map +1 -0
  31. package/lib/cjs/commands/command/outputs/index.d.ts +1 -0
  32. package/lib/cjs/commands/index.d.ts +1 -3
  33. package/lib/cjs/commands/index.js +1 -2
  34. package/lib/cjs/commands/index.js.map +1 -1
  35. package/lib/cjs/types.d.ts +2 -2
  36. package/lib/esm/client.d.ts +4 -5
  37. package/lib/esm/client.js +5 -6
  38. package/lib/esm/client.js.map +1 -1
  39. package/lib/esm/commands/command/codecs/create-table.d.ts +6 -0
  40. package/lib/esm/commands/command/codecs/create-table.js +7 -0
  41. package/lib/esm/commands/command/codecs/create-table.js.map +1 -0
  42. package/lib/esm/commands/command/command.d.ts +18 -9
  43. package/lib/esm/commands/command/command.js +7 -3
  44. package/lib/esm/commands/command/command.js.map +1 -1
  45. package/lib/esm/commands/command/commands.d.ts +2 -1
  46. package/lib/esm/commands/command/commands.js.map +1 -1
  47. package/lib/esm/commands/command/create-table.d.ts +8 -0
  48. package/lib/esm/commands/command/create-table.js +13 -0
  49. package/lib/esm/commands/command/create-table.js.map +1 -0
  50. package/lib/esm/commands/command/delete-item.d.ts +3 -3
  51. package/lib/esm/commands/command/delete-item.js +3 -3
  52. package/lib/esm/commands/command/delete-item.js.map +1 -1
  53. package/lib/esm/commands/command/get-item.d.ts +3 -3
  54. package/lib/esm/commands/command/get-item.js +3 -3
  55. package/lib/esm/commands/command/get-item.js.map +1 -1
  56. package/lib/esm/commands/command/index.d.ts +6 -0
  57. package/lib/esm/commands/command/index.js +6 -0
  58. package/lib/esm/commands/command/index.js.map +1 -0
  59. package/lib/esm/commands/command/inputs/create-table.d.ts +7 -5
  60. package/lib/esm/commands/command/inputs/create-table.js +74 -1
  61. package/lib/esm/commands/command/inputs/create-table.js.map +1 -1
  62. package/lib/esm/commands/command/inputs/index.d.ts +1 -0
  63. package/lib/esm/commands/command/outputs/create-table.d.ts +3 -0
  64. package/lib/esm/commands/command/outputs/create-table.js +4 -0
  65. package/lib/esm/commands/command/outputs/create-table.js.map +1 -0
  66. package/lib/esm/commands/command/outputs/index.d.ts +1 -0
  67. package/lib/esm/commands/index.d.ts +1 -3
  68. package/lib/esm/commands/index.js +1 -2
  69. package/lib/esm/commands/index.js.map +1 -1
  70. package/lib/esm/types.d.ts +2 -2
  71. package/package.json +2 -1
  72. package/lib/cjs/commands/create-table.d.ts +0 -21
  73. package/lib/cjs/commands/create-table.js +0 -101
  74. package/lib/cjs/commands/create-table.js.map +0 -1
  75. package/lib/esm/commands/create-table.d.ts +0 -21
  76. package/lib/esm/commands/create-table.js +0 -97
  77. package/lib/esm/commands/create-table.js.map +0 -1
@@ -0,0 +1,6 @@
1
+ import { encode } from "../inputs/create-table.js";
2
+ import { decode } from "../outputs/create-table.js";
3
+ export declare const CreateTableCodec: {
4
+ encode: typeof encode;
5
+ decode: typeof decode;
6
+ };
@@ -0,0 +1,7 @@
1
+ import { encode } from "../inputs/create-table.js";
2
+ import { decode } from "../outputs/create-table.js";
3
+ export const CreateTableCodec = {
4
+ encode,
5
+ decode,
6
+ };
7
+ //# sourceMappingURL=create-table.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-table.js","sourceRoot":"","sources":["../../../../../src/commands/command/codecs/create-table.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAEpD,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,MAAM;IACN,MAAM;CACP,CAAC"}
@@ -4,19 +4,28 @@
4
4
  * generic constraints based on their command types, or their client's interface, because they don't work with
5
5
  * each other trolololol. Hence, we use any where necessary as an escape hatch to this typing nightmare.
6
6
  */
7
- import type { DynamoDBDocumentClient, DynamoDBDocumentClientCommand, DynamoDBDocumentClientResolvedConfig } from "@aws-sdk/lib-dynamodb";
7
+ import type { CreateTableCommand } from "@aws-sdk/client-dynamodb";
8
+ import type { DeleteCommand, DynamoDBDocumentClient, GetCommand } from "@aws-sdk/lib-dynamodb";
9
+ import type { GetOutputType } from "@smithy/types";
8
10
  import type { Codec } from "./codecs/codec.js";
9
- type DocumentClientCommandCtor<DCI extends object, DCO extends object> = new (input: DCI) => DynamoDBDocumentClientCommand<DCI, DCO, any, any, DynamoDBDocumentClientResolvedConfig>;
10
- export type CommandOutput<C> = C extends Command<any, infer O, any, any> ? O : never;
11
- export type CommandInput<C extends Command<any, any, any, any>> = C["input"];
12
- export declare abstract class Command<I extends object, O extends object, DCI extends object, DCO extends object> {
11
+ type NativeCommand = DeleteCommand | GetCommand | CreateTableCommand;
12
+ type NativeCommandCtor<C extends NativeCommand> = new (input: C["input"]) => C;
13
+ export type CommandOutput<C extends Command<unknown, unknown>> = Awaited<ReturnType<C["execute"]>>;
14
+ export type CommandInput<C extends Command<unknown, unknown>> = C["input"];
15
+ export type Command<I, O> = {
13
16
  readonly input: I;
14
- protected readonly codec: Codec<I, O, DCI, DCO>;
15
- protected readonly command: DocumentClientCommandCtor<DCI, DCO>;
17
+ execute(params: {
18
+ client: DynamoDBDocumentClient;
19
+ }): Promise<O>;
20
+ };
21
+ export declare abstract class AbstractCommand<I extends object, O extends object, C extends NativeCommand> implements Command<I, O> {
22
+ readonly input: I;
23
+ protected readonly codec: Codec<I, O, C["input"], GetOutputType<C>>;
24
+ protected readonly command: NativeCommandCtor<C>;
16
25
  protected constructor(params: {
17
26
  input: I;
18
- codec: Codec<I, O, DCI, DCO>;
19
- command: DocumentClientCommandCtor<DCI, DCO>;
27
+ codec: Codec<I, O, C["input"], GetOutputType<C>>;
28
+ command: NativeCommandCtor<C>;
20
29
  });
21
30
  execute(params: {
22
31
  client: DynamoDBDocumentClient;
@@ -4,8 +4,9 @@
4
4
  * generic constraints based on their command types, or their client's interface, because they don't work with
5
5
  * each other trolololol. Hence, we use any where necessary as an escape hatch to this typing nightmare.
6
6
  */
7
- // TODO: don't export outside.
8
- export class Command {
7
+ import { trusted } from "@infra-blocks/types";
8
+ // Not exported.
9
+ export class AbstractCommand {
9
10
  input;
10
11
  codec;
11
12
  command;
@@ -17,7 +18,10 @@ export class Command {
17
18
  }
18
19
  async execute(params) {
19
20
  const { client } = params;
20
- return this.codec.decode(await client.send(new this.command(this.codec.encode(this.input))));
21
+ const commandInput = this.codec.encode(this.input);
22
+ const command = new this.command(commandInput);
23
+ const commandOutput = await client.send(command);
24
+ return this.codec.decode(trusted(commandOutput));
21
25
  }
22
26
  }
23
27
  //# sourceMappingURL=command.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"command.js","sourceRoot":"","sources":["../../../../src/commands/command/command.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAyBH,8BAA8B;AAC9B,MAAM,OAAgB,OAAO;IAMlB,KAAK,CAAI;IAEC,KAAK,CAAwB;IAC7B,OAAO,CAAsC;IAEhE,YAAsB,MAIrB;QACC,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,MAAM,CAAC;QACzC,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;IAED,KAAK,CAAC,OAAO,CAAC,MAA0C;QACtD,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC;QAC1B,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CACtB,MAAM,MAAM,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CACnE,CAAC;IACJ,CAAC;CACF"}
1
+ {"version":3,"file":"command.js","sourceRoot":"","sources":["../../../../src/commands/command/command.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAQH,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAoB9C,gBAAgB;AAChB,MAAM,OAAgB,eAAe;IAM1B,KAAK,CAAI;IAEC,KAAK,CAA4C;IACjD,OAAO,CAAuB;IAEjD,YAAsB,MAIrB;QACC,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,MAAM,CAAC;QACzC,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;IAED,KAAK,CAAC,OAAO,CAAC,MAA0C;QACtD,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC;QAC1B,MAAM,YAAY,GAAe,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAC/D,MAAM,OAAO,GAAG,IAAI,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;QAC/C,MAAM,aAAa,GAAG,MAAM,MAAM,CAAC,IAAI,CAAC,OAAc,CAAC,CAAC;QACxD,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC;IACnD,CAAC;CACF"}
@@ -1,3 +1,4 @@
1
+ import type { CreateTable } from "./create-table.js";
1
2
  import type { DeleteItem } from "./delete-item.js";
2
3
  import type { GetItem } from "./get-item.js";
3
- export type DynamoDbClientCommand = DeleteItem | GetItem;
4
+ export type DynamoDbClientCommand = DeleteItem | GetItem | CreateTable;
@@ -1 +1 @@
1
- {"version":3,"file":"commands.js","sourceRoot":"","sources":["../../../../src/commands/command/commands.ts"],"names":[],"mappings":";AAKA,8CAA8C"}
1
+ {"version":3,"file":"commands.js","sourceRoot":"","sources":["../../../../src/commands/command/commands.ts"],"names":[],"mappings":";AAMA,8CAA8C"}
@@ -0,0 +1,8 @@
1
+ import { CreateTableCommand } from "@aws-sdk/client-dynamodb";
2
+ import type { KeySchema } from "../../types.js";
3
+ import { AbstractCommand } from "./command.js";
4
+ import type { CreateTableInput } from "./inputs/create-table.js";
5
+ import type { CreateTableOutput } from "./outputs/create-table.js";
6
+ export declare class CreateTable<KS extends KeySchema = KeySchema> extends AbstractCommand<CreateTableInput<KS>, CreateTableOutput, CreateTableCommand> {
7
+ constructor(input: CreateTableInput<KS>);
8
+ }
@@ -0,0 +1,13 @@
1
+ import { CreateTableCommand } from "@aws-sdk/client-dynamodb";
2
+ import { CreateTableCodec } from "./codecs/create-table.js";
3
+ import { AbstractCommand } from "./command.js";
4
+ export class CreateTable extends AbstractCommand {
5
+ constructor(input) {
6
+ super({
7
+ input,
8
+ codec: CreateTableCodec,
9
+ command: CreateTableCommand,
10
+ });
11
+ }
12
+ }
13
+ //# sourceMappingURL=create-table.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-table.js","sourceRoot":"","sources":["../../../../src/commands/command/create-table.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAE9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAI/C,MAAM,OAAO,WAEX,SAAQ,eAIT;IACC,YAAY,KAA2B;QACrC,KAAK,CAAC;YACJ,KAAK;YACL,KAAK,EAAE,gBAAgB;YACvB,OAAO,EAAE,kBAAkB;SAC5B,CAAC,CAAC;IACL,CAAC;CACF"}
@@ -1,8 +1,8 @@
1
- import { type DeleteCommandInput, type DeleteCommandOutput } from "@aws-sdk/lib-dynamodb";
1
+ import { DeleteCommand } from "@aws-sdk/lib-dynamodb";
2
2
  import type { Attributes, KeyAttributes } from "../../types.js";
3
- import { Command } from "./command.js";
3
+ import { AbstractCommand } from "./command.js";
4
4
  import type { DeleteItemInput } from "./inputs/delete-item.js";
5
5
  import type { DeleteItemOutput } from "./outputs/delete-item.js";
6
- export declare class DeleteItem<T extends Attributes = Attributes, K extends KeyAttributes = KeyAttributes> extends Command<DeleteItemInput<K>, DeleteItemOutput<T>, DeleteCommandInput, DeleteCommandOutput> {
6
+ export declare class DeleteItem<T extends Attributes = Attributes, K extends KeyAttributes = KeyAttributes> extends AbstractCommand<DeleteItemInput<K>, DeleteItemOutput<T>, DeleteCommand> {
7
7
  constructor(input: DeleteItemInput<K>);
8
8
  }
@@ -1,7 +1,7 @@
1
- import { DeleteCommand, } from "@aws-sdk/lib-dynamodb";
1
+ import { DeleteCommand } from "@aws-sdk/lib-dynamodb";
2
2
  import { DeleteItemCodec } from "./codecs/delete-item.js";
3
- import { Command } from "./command.js";
4
- export class DeleteItem extends Command {
3
+ import { AbstractCommand } from "./command.js";
4
+ export class DeleteItem extends AbstractCommand {
5
5
  constructor(input) {
6
6
  super({
7
7
  input,
@@ -1 +1 @@
1
- {"version":3,"file":"delete-item.js","sourceRoot":"","sources":["../../../../src/commands/command/delete-item.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,GAGd,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAIvC,MAAM,OAAO,UAGX,SAAQ,OAKT;IACC,YAAY,KAAyB;QACnC,KAAK,CAAC;YACJ,KAAK;YACL,KAAK,EAAE,eAAe;YACtB,OAAO,EAAE,aAAa;SACvB,CAAC,CAAC;IACL,CAAC;CACF"}
1
+ {"version":3,"file":"delete-item.js","sourceRoot":"","sources":["../../../../src/commands/command/delete-item.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAEtD,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAI/C,MAAM,OAAO,UAGX,SAAQ,eAIT;IACC,YAAY,KAAyB;QACnC,KAAK,CAAC;YACJ,KAAK;YACL,KAAK,EAAE,eAAe;YACtB,OAAO,EAAE,aAAa;SACvB,CAAC,CAAC;IACL,CAAC;CACF"}
@@ -1,8 +1,8 @@
1
- import { type GetCommandInput, type GetCommandOutput } from "@aws-sdk/lib-dynamodb";
1
+ import { GetCommand } from "@aws-sdk/lib-dynamodb";
2
2
  import type { Attributes, KeyAttributes } from "../../types.js";
3
- import { Command } from "./command.js";
3
+ import { AbstractCommand } from "./command.js";
4
4
  import type { GetItemInput } from "./inputs/get-item.js";
5
5
  import type { GetItemOutput } from "./outputs/get-item.js";
6
- export declare class GetItem<T extends Attributes = Attributes, K extends KeyAttributes = KeyAttributes> extends Command<GetItemInput<K>, GetItemOutput<T>, GetCommandInput, GetCommandOutput> {
6
+ export declare class GetItem<T extends Attributes = Attributes, K extends KeyAttributes = KeyAttributes> extends AbstractCommand<GetItemInput<K>, GetItemOutput<T>, GetCommand> {
7
7
  constructor(input: GetItemInput<K>);
8
8
  }
@@ -1,7 +1,7 @@
1
- import { GetCommand, } from "@aws-sdk/lib-dynamodb";
1
+ import { GetCommand } from "@aws-sdk/lib-dynamodb";
2
2
  import { GetItemCodec } from "./codecs/get-item.js";
3
- import { Command } from "./command.js";
4
- export class GetItem extends Command {
3
+ import { AbstractCommand } from "./command.js";
4
+ export class GetItem extends AbstractCommand {
5
5
  constructor(input) {
6
6
  super({
7
7
  input,
@@ -1 +1 @@
1
- {"version":3,"file":"get-item.js","sourceRoot":"","sources":["../../../../src/commands/command/get-item.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,GAGX,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAIvC,MAAM,OAAO,OAGX,SAAQ,OAKT;IACC,YAAY,KAAsB;QAChC,KAAK,CAAC;YACJ,KAAK;YACL,KAAK,EAAE,YAAY;YACnB,OAAO,EAAE,UAAU;SACpB,CAAC,CAAC;IACL,CAAC;CACF"}
1
+ {"version":3,"file":"get-item.js","sourceRoot":"","sources":["../../../../src/commands/command/get-item.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAEnD,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAI/C,MAAM,OAAO,OAGX,SAAQ,eAA8D;IACtE,YAAY,KAAsB;QAChC,KAAK,CAAC;YACJ,KAAK;YACL,KAAK,EAAE,YAAY;YACnB,OAAO,EAAE,UAAU;SACpB,CAAC,CAAC;IACL,CAAC;CACF"}
@@ -0,0 +1,6 @@
1
+ export type { CommandInput, CommandOutput } from "./command.js";
2
+ export { CreateTable } from "./create-table.js";
3
+ export { DeleteItem } from "./delete-item.js";
4
+ export { GetItem } from "./get-item.js";
5
+ export * from "./inputs/index.js";
6
+ export * from "./outputs/index.js";
@@ -0,0 +1,6 @@
1
+ export { CreateTable } from "./create-table.js";
2
+ export { DeleteItem } from "./delete-item.js";
3
+ export { GetItem } from "./get-item.js";
4
+ export * from "./inputs/index.js";
5
+ export * from "./outputs/index.js";
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/commands/command/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC"}
@@ -1,7 +1,9 @@
1
- import type { KeyDefinition } from "../../../types.js";
2
- export interface CreateTableInput<Def extends KeyDefinition = KeyDefinition> {
1
+ import type { CreateTableCommandInput } from "@aws-sdk/client-dynamodb";
2
+ import type { KeySchema } from "../../../types.js";
3
+ export interface CreateTableInput<KS extends KeySchema = KeySchema> {
3
4
  name: string;
4
- keyDefinition: Def;
5
- gsis?: Record<string, KeyDefinition>;
6
- lsis?: Record<string, KeyDefinition>;
5
+ keySchema: KS;
6
+ gsis?: Record<string, KeySchema>;
7
+ lsis?: Record<string, KeySchema>;
7
8
  }
9
+ export declare function encode<Def extends KeySchema = KeySchema>(input: CreateTableInput<Def>): CreateTableCommandInput;
@@ -1,2 +1,75 @@
1
- export {};
1
+ export function encode(input) {
2
+ const attributeDefinitions = new Map();
3
+ const primaryKeySchema = encodeKeySchema({
4
+ attributeDefinitions,
5
+ key: input.keySchema,
6
+ });
7
+ const globalSecondaryIndexes = encodeGsis(attributeDefinitions, input.gsis);
8
+ const localSecondaryIndexes = encodeLsis(attributeDefinitions, input.lsis);
9
+ return {
10
+ AttributeDefinitions: [...attributeDefinitions.entries()].map(([name, type]) => ({
11
+ AttributeName: name,
12
+ AttributeType: type,
13
+ })),
14
+ TableName: input.name,
15
+ KeySchema: primaryKeySchema,
16
+ GlobalSecondaryIndexes: globalSecondaryIndexes.length > 0 ? globalSecondaryIndexes : undefined,
17
+ LocalSecondaryIndexes: localSecondaryIndexes.length > 0 ? localSecondaryIndexes : undefined,
18
+ BillingMode: "PAY_PER_REQUEST", // Use on-demand billing mode by default.
19
+ };
20
+ }
21
+ function encodeKeySchema(params) {
22
+ const { attributeDefinitions, key } = params;
23
+ const keySchema = [];
24
+ attributeDefinitions.set(key.partitionKey.name, key.partitionKey.type);
25
+ keySchema.push({
26
+ AttributeName: key.partitionKey.name,
27
+ KeyType: "HASH",
28
+ });
29
+ if (key.sortKey != null) {
30
+ attributeDefinitions.set(key.sortKey.name, key.sortKey.type);
31
+ keySchema.push({
32
+ AttributeName: key.sortKey.name,
33
+ KeyType: "RANGE",
34
+ });
35
+ }
36
+ return keySchema;
37
+ }
38
+ function encodeGsis(attributeDefinitions, gsis) {
39
+ const globalSecondaryIndexes = [];
40
+ for (const [indexName, field] of Object.entries(gsis ?? {})) {
41
+ const ks = encodeKeySchema({
42
+ attributeDefinitions,
43
+ key: field,
44
+ });
45
+ globalSecondaryIndexes.push({
46
+ IndexName: indexName,
47
+ KeySchema: ks,
48
+ Projection: {
49
+ ProjectionType: "ALL",
50
+ },
51
+ });
52
+ }
53
+ return globalSecondaryIndexes;
54
+ }
55
+ function encodeLsis(attributeDefinitions, lsis) {
56
+ const localSecondaryIndexes = [];
57
+ for (const [indexName, field] of Object.entries(lsis ?? {})) {
58
+ const ks = encodeKeySchema({
59
+ attributeDefinitions,
60
+ key: {
61
+ partitionKey: field.partitionKey,
62
+ sortKey: field.sortKey,
63
+ },
64
+ });
65
+ localSecondaryIndexes.push({
66
+ IndexName: indexName,
67
+ KeySchema: ks,
68
+ Projection: {
69
+ ProjectionType: "ALL",
70
+ },
71
+ });
72
+ }
73
+ return localSecondaryIndexes;
74
+ }
2
75
  //# sourceMappingURL=create-table.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"create-table.js","sourceRoot":"","sources":["../../../../../src/commands/command/inputs/create-table.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"create-table.js","sourceRoot":"","sources":["../../../../../src/commands/command/inputs/create-table.ts"],"names":[],"mappings":"AAgBA,MAAM,UAAU,MAAM,CACpB,KAA4B;IAE5B,MAAM,oBAAoB,GAAkC,IAAI,GAAG,EAAE,CAAC;IACtE,MAAM,gBAAgB,GAAG,eAAe,CAAC;QACvC,oBAAoB;QACpB,GAAG,EAAE,KAAK,CAAC,SAAS;KACrB,CAAC,CAAC;IAEH,MAAM,sBAAsB,GAAG,UAAU,CAAC,oBAAoB,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;IAC5E,MAAM,qBAAqB,GAAG,UAAU,CAAC,oBAAoB,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;IAC3E,OAAO;QACL,oBAAoB,EAAE,CAAC,GAAG,oBAAoB,CAAC,OAAO,EAAE,CAAC,CAAC,GAAG,CAC3D,CAAC,CAAC,IAAI,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC;YACjB,aAAa,EAAE,IAAI;YACnB,aAAa,EAAE,IAAI;SACpB,CAAC,CACH;QACD,SAAS,EAAE,KAAK,CAAC,IAAI;QACrB,SAAS,EAAE,gBAAgB;QAC3B,sBAAsB,EACpB,sBAAsB,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,sBAAsB,CAAC,CAAC,CAAC,SAAS;QACxE,qBAAqB,EACnB,qBAAqB,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,SAAS;QACtE,WAAW,EAAE,iBAAiB,EAAE,yCAAyC;KAC1E,CAAC;AACJ,CAAC;AAED,SAAS,eAAe,CAAC,MAGxB;IACC,MAAM,EAAE,oBAAoB,EAAE,GAAG,EAAE,GAAG,MAAM,CAAC;IAC7C,MAAM,SAAS,GAA4B,EAAE,CAAC;IAC9C,oBAAoB,CAAC,GAAG,CAAC,GAAG,CAAC,YAAY,CAAC,IAAI,EAAE,GAAG,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;IACvE,SAAS,CAAC,IAAI,CAAC;QACb,aAAa,EAAE,GAAG,CAAC,YAAY,CAAC,IAAI;QACpC,OAAO,EAAE,MAAM;KAChB,CAAC,CAAC;IACH,IAAI,GAAG,CAAC,OAAO,IAAI,IAAI,EAAE,CAAC;QACxB,oBAAoB,CAAC,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAC7D,SAAS,CAAC,IAAI,CAAC;YACb,aAAa,EAAE,GAAG,CAAC,OAAO,CAAC,IAAI;YAC/B,OAAO,EAAE,OAAO;SACjB,CAAC,CAAC;IACL,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,SAAS,UAAU,CACjB,oBAAmD,EACnD,IAA8B;IAE9B,MAAM,sBAAsB,GAAgC,EAAE,CAAC;IAC/D,KAAK,MAAM,CAAC,SAAS,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,IAAI,IAAI,EAAE,CAAC,EAAE,CAAC;QAC5D,MAAM,EAAE,GAAG,eAAe,CAAC;YACzB,oBAAoB;YACpB,GAAG,EAAE,KAAK;SACX,CAAC,CAAC;QACH,sBAAsB,CAAC,IAAI,CAAC;YAC1B,SAAS,EAAE,SAAS;YACpB,SAAS,EAAE,EAAE;YACb,UAAU,EAAE;gBACV,cAAc,EAAE,KAAK;aACtB;SACF,CAAC,CAAC;IACL,CAAC;IACD,OAAO,sBAAsB,CAAC;AAChC,CAAC;AAED,SAAS,UAAU,CACjB,oBAAmD,EACnD,IAA8B;IAE9B,MAAM,qBAAqB,GAA+B,EAAE,CAAC;IAC7D,KAAK,MAAM,CAAC,SAAS,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,IAAI,IAAI,EAAE,CAAC,EAAE,CAAC;QAC5D,MAAM,EAAE,GAAG,eAAe,CAAC;YACzB,oBAAoB;YACpB,GAAG,EAAE;gBACH,YAAY,EAAE,KAAK,CAAC,YAAY;gBAChC,OAAO,EAAE,KAAK,CAAC,OAAO;aACvB;SACF,CAAC,CAAC;QACH,qBAAqB,CAAC,IAAI,CAAC;YACzB,SAAS,EAAE,SAAS;YACpB,SAAS,EAAE,EAAE;YACb,UAAU,EAAE;gBACV,cAAc,EAAE,KAAK;aACtB;SACF,CAAC,CAAC;IACL,CAAC;IACD,OAAO,qBAAqB,CAAC;AAC/B,CAAC"}
@@ -1,2 +1,3 @@
1
+ export type { CreateTableInput } from "./create-table.js";
1
2
  export type { DeleteItemInput, DeleteItemReturnValue } from "./delete-item.js";
2
3
  export type { GetItemInput } from "./get-item.js";
@@ -0,0 +1,3 @@
1
+ import type { CreateTableCommandOutput } from "@aws-sdk/client-dynamodb";
2
+ export type CreateTableOutput = Record<string, never>;
3
+ export declare function decode(_: CreateTableCommandOutput): CreateTableOutput;
@@ -0,0 +1,4 @@
1
+ export function decode(_) {
2
+ return {};
3
+ }
4
+ //# sourceMappingURL=create-table.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-table.js","sourceRoot":"","sources":["../../../../../src/commands/command/outputs/create-table.ts"],"names":[],"mappings":"AAIA,MAAM,UAAU,MAAM,CAAC,CAA2B;IAChD,OAAO,EAAE,CAAC;AACZ,CAAC"}
@@ -1,2 +1,3 @@
1
+ export type { CreateTableOutput } from "./create-table.js";
1
2
  export type { DeleteItemOutput } from "./delete-item.js";
2
3
  export type { GetItemOutput } from "./get-item.js";
@@ -1,7 +1,5 @@
1
1
  export type { DeleteItem } from "./command/delete-item.js";
2
- export * from "./command/inputs/index.js";
3
- export * from "./command/outputs/index.js";
4
- export type { CreateTableParams } from "./create-table.js";
2
+ export * from "./command/index.js";
5
3
  export type { DeleteTableParams } from "./delete.table.js";
6
4
  export * from "./expressions/index.js";
7
5
  export type { PutItemParams, PutItemResult, PutItemReturnValue, } from "./put-item.js";
@@ -1,4 +1,3 @@
1
- export * from "./command/inputs/index.js";
2
- export * from "./command/outputs/index.js";
1
+ export * from "./command/index.js";
3
2
  export * from "./expressions/index.js";
4
3
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/index.ts"],"names":[],"mappings":"AACA,cAAc,2BAA2B,CAAC;AAC1C,cAAc,4BAA4B,CAAC;AAG3C,cAAc,wBAAwB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/index.ts"],"names":[],"mappings":"AACA,cAAc,oBAAoB,CAAC;AAEnC,cAAc,wBAAwB,CAAC"}
@@ -91,12 +91,12 @@ export interface KeyAttributeDefinition {
91
91
  type: KeyAttributeType;
92
92
  }
93
93
  /**
94
- * A key definition used when creating tables and indexes.
94
+ * A key schema used when creating tables and indexes.
95
95
  *
96
96
  * The partition key represents the HASH type key, and the optional sort key
97
97
  * represents the RANGE type key.
98
98
  */
99
- export interface KeyDefinition {
99
+ export interface KeySchema {
100
100
  partitionKey: KeyAttributeDefinition;
101
101
  sortKey?: KeyAttributeDefinition;
102
102
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@infra-blocks/aws-dynamodb",
3
- "version": "0.54.0",
3
+ "version": "0.55.0-alpha.0",
4
4
  "description": "A convenience wrapper over @aws-sdk/client-dynamodb and @aws-sdk/lib-dynamodb.",
5
5
  "keywords": [
6
6
  "aws",
@@ -45,6 +45,7 @@
45
45
  "@infra-blocks/iter": "^0.2.7",
46
46
  "@infra-blocks/node-console-logger": "^0.3.1",
47
47
  "@infra-blocks/test": "^0.7.0",
48
+ "@smithy/types": "^4.12.0",
48
49
  "@types/mocha": "^10.0.10",
49
50
  "@types/node": "^24.0.10",
50
51
  "c8": "^10.1.3",
@@ -1,21 +0,0 @@
1
- import { CreateTableCommand, type CreateTableCommandInput } from "@aws-sdk/client-dynamodb";
2
- import type { KeyDefinition } from "../types.js";
3
- import type { Command } from "./types.js";
4
- export interface CreateTableParams {
5
- name: string;
6
- primaryKey: KeyDefinition;
7
- gsis?: Record<string, KeyDefinition>;
8
- lsis?: Record<string, KeyDefinition>;
9
- }
10
- export declare class CreateTable implements Command<CreateTableCommandInput, CreateTableCommand> {
11
- private readonly name;
12
- private readonly primaryKey;
13
- private readonly gsis?;
14
- private readonly lsis?;
15
- private constructor();
16
- toAwsCommandInput(): CreateTableCommandInput;
17
- toAwsCommand(): CreateTableCommand;
18
- private gsiInput;
19
- private lsiInput;
20
- static from(params: CreateTableParams): CreateTable;
21
- }
@@ -1,101 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CreateTable = void 0;
4
- const client_dynamodb_1 = require("@aws-sdk/client-dynamodb");
5
- class CreateTable {
6
- name;
7
- primaryKey;
8
- gsis;
9
- lsis;
10
- constructor(params) {
11
- const { name, primaryKey, gsis, lsis } = params;
12
- this.name = name;
13
- this.primaryKey = primaryKey;
14
- this.gsis = gsis;
15
- this.lsis = lsis;
16
- }
17
- toAwsCommandInput() {
18
- const attributeDefinitions = new Map();
19
- const primaryKeySchema = keySchema({
20
- attributeDefinitions,
21
- key: this.primaryKey,
22
- });
23
- const globalSecondaryIndexes = this.gsiInput(attributeDefinitions);
24
- const localSecondaryIndexes = this.lsiInput(attributeDefinitions);
25
- return {
26
- AttributeDefinitions: [...attributeDefinitions.entries()].map(([name, type]) => ({
27
- AttributeName: name,
28
- AttributeType: type,
29
- })),
30
- TableName: this.name,
31
- KeySchema: primaryKeySchema,
32
- GlobalSecondaryIndexes: globalSecondaryIndexes.length > 0 ? globalSecondaryIndexes : undefined,
33
- LocalSecondaryIndexes: localSecondaryIndexes.length > 0 ? localSecondaryIndexes : undefined,
34
- BillingMode: "PAY_PER_REQUEST", // Use on-demand billing mode by default.
35
- };
36
- }
37
- toAwsCommand() {
38
- return new client_dynamodb_1.CreateTableCommand(this.toAwsCommandInput());
39
- }
40
- gsiInput(attributeDefinitions) {
41
- const gsis = this.gsis ?? {};
42
- const globalSecondaryIndexes = [];
43
- for (const [indexName, field] of Object.entries(gsis)) {
44
- const ks = keySchema({
45
- attributeDefinitions,
46
- key: field,
47
- });
48
- globalSecondaryIndexes.push({
49
- IndexName: indexName,
50
- KeySchema: ks,
51
- Projection: {
52
- ProjectionType: "ALL",
53
- },
54
- });
55
- }
56
- return globalSecondaryIndexes;
57
- }
58
- lsiInput(attributeDefinitions) {
59
- const lsis = this.lsis ?? {};
60
- const localSecondaryIndexes = [];
61
- for (const [indexName, field] of Object.entries(lsis)) {
62
- const ks = keySchema({
63
- attributeDefinitions,
64
- key: {
65
- partitionKey: field.partitionKey,
66
- sortKey: field.sortKey,
67
- },
68
- });
69
- localSecondaryIndexes.push({
70
- IndexName: indexName,
71
- KeySchema: ks,
72
- Projection: {
73
- ProjectionType: "ALL",
74
- },
75
- });
76
- }
77
- return localSecondaryIndexes;
78
- }
79
- static from(params) {
80
- return new CreateTable(params);
81
- }
82
- }
83
- exports.CreateTable = CreateTable;
84
- function keySchema(params) {
85
- const { attributeDefinitions, key } = params;
86
- const keySchema = [];
87
- attributeDefinitions.set(key.partitionKey.name, key.partitionKey.type);
88
- keySchema.push({
89
- AttributeName: key.partitionKey.name,
90
- KeyType: "HASH",
91
- });
92
- if (key.sortKey != null) {
93
- attributeDefinitions.set(key.sortKey.name, key.sortKey.type);
94
- keySchema.push({
95
- AttributeName: key.sortKey.name,
96
- KeyType: "RANGE",
97
- });
98
- }
99
- return keySchema;
100
- }
101
- //# sourceMappingURL=create-table.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"create-table.js","sourceRoot":"","sources":["../../../src/commands/create-table.ts"],"names":[],"mappings":"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"}
@@ -1,21 +0,0 @@
1
- import { CreateTableCommand, type CreateTableCommandInput } from "@aws-sdk/client-dynamodb";
2
- import type { KeyDefinition } from "../types.js";
3
- import type { Command } from "./types.js";
4
- export interface CreateTableParams {
5
- name: string;
6
- primaryKey: KeyDefinition;
7
- gsis?: Record<string, KeyDefinition>;
8
- lsis?: Record<string, KeyDefinition>;
9
- }
10
- export declare class CreateTable implements Command<CreateTableCommandInput, CreateTableCommand> {
11
- private readonly name;
12
- private readonly primaryKey;
13
- private readonly gsis?;
14
- private readonly lsis?;
15
- private constructor();
16
- toAwsCommandInput(): CreateTableCommandInput;
17
- toAwsCommand(): CreateTableCommand;
18
- private gsiInput;
19
- private lsiInput;
20
- static from(params: CreateTableParams): CreateTable;
21
- }