dynamo-document-builder 0.2.0 → 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 (66) hide show
  1. package/dist/attributes/attribute-map.d.ts +11 -7
  2. package/dist/attributes/index.d.ts +1 -1
  3. package/dist/commands/base-command.d.ts +13 -10
  4. package/dist/commands/batch-get.d.ts +11 -7
  5. package/dist/commands/batch-write.d.ts +17 -11
  6. package/dist/commands/condition-check.d.ts +12 -8
  7. package/dist/commands/conditional-delete.d.ts +14 -10
  8. package/dist/commands/conditional-put.d.ts +17 -11
  9. package/dist/commands/conditional-update.d.ts +14 -10
  10. package/dist/commands/delete.d.ts +12 -8
  11. package/dist/commands/get.d.ts +11 -7
  12. package/dist/commands/index.d.ts +18 -18
  13. package/dist/commands/projected-get.d.ts +13 -9
  14. package/dist/commands/projected-query.d.ts +14 -10
  15. package/dist/commands/projected-scan.d.ts +14 -10
  16. package/dist/commands/put.d.ts +15 -9
  17. package/dist/commands/query.d.ts +14 -10
  18. package/dist/commands/scan.d.ts +14 -10
  19. package/dist/commands/transact-get.d.ts +11 -7
  20. package/dist/commands/transact-write.d.ts +12 -8
  21. package/dist/commands/update.d.ts +13 -9
  22. package/dist/conditions/and.d.ts +5 -2
  23. package/dist/conditions/begins-with.d.ts +5 -2
  24. package/dist/conditions/between.d.ts +5 -2
  25. package/dist/conditions/condition-parser.d.ts +8 -4
  26. package/dist/conditions/condition-symbols.d.ts +13 -11
  27. package/dist/conditions/condition-types.d.ts +34 -31
  28. package/dist/conditions/contains.d.ts +6 -3
  29. package/dist/conditions/equals.d.ts +5 -2
  30. package/dist/conditions/exists.d.ts +5 -2
  31. package/dist/conditions/greater-than-or-equal.d.ts +5 -2
  32. package/dist/conditions/greater-than.d.ts +5 -2
  33. package/dist/conditions/index.d.ts +19 -19
  34. package/dist/conditions/is-in.d.ts +5 -2
  35. package/dist/conditions/less-than-or-equal.d.ts +5 -2
  36. package/dist/conditions/less-than.d.ts +5 -2
  37. package/dist/conditions/not-equals.d.ts +5 -2
  38. package/dist/conditions/not-exists.d.ts +5 -2
  39. package/dist/conditions/not.d.ts +5 -2
  40. package/dist/conditions/or.d.ts +5 -2
  41. package/dist/conditions/size.d.ts +5 -2
  42. package/dist/conditions/type-is.d.ts +5 -2
  43. package/dist/core/core-types.d.ts +17 -14
  44. package/dist/core/entity.d.ts +12 -8
  45. package/dist/core/index.d.ts +4 -4
  46. package/dist/core/key.d.ts +11 -7
  47. package/dist/core/table.d.ts +8 -4
  48. package/dist/errors.d.ts +3 -1
  49. package/dist/index.d.ts +55 -7
  50. package/dist/internal-constants.d.ts +10 -8
  51. package/dist/projections/index.d.ts +2 -2
  52. package/dist/projections/projection-parser.d.ts +8 -4
  53. package/dist/projections/projection-types.d.ts +3 -1
  54. package/dist/updates/add-to-set.d.ts +6 -3
  55. package/dist/updates/add.d.ts +5 -2
  56. package/dist/updates/append.d.ts +6 -3
  57. package/dist/updates/index.d.ts +10 -10
  58. package/dist/updates/prepend.d.ts +6 -3
  59. package/dist/updates/ref.d.ts +6 -3
  60. package/dist/updates/remove-from-set.d.ts +6 -3
  61. package/dist/updates/remove.d.ts +5 -2
  62. package/dist/updates/subtract.d.ts +5 -2
  63. package/dist/updates/update-parser.d.ts +8 -4
  64. package/dist/updates/update-symbols.d.ts +12 -10
  65. package/dist/updates/update-types.d.ts +16 -13
  66. package/package.json +1 -1
@@ -1,13 +1,14 @@
1
- import type { NativeAttributeValue } from '@aws-sdk/lib-dynamodb';
2
- export type AttributeValues = Record<string, NativeAttributeValue>;
3
- export type AttributeNames = Record<string, string>;
4
- export type DynamoAttributeExpression = {
1
+ import { NativeAttributeValue } from '@aws-sdk/lib-dynamodb';
2
+
3
+ type AttributeValues = Record<string, NativeAttributeValue>;
4
+ type AttributeNames = Record<string, string>;
5
+ type DynamoAttributeExpression = {
5
6
  ExpressionAttributeValues?: AttributeValues | undefined;
6
7
  ExpressionAttributeNames?: AttributeNames | undefined;
7
8
  };
8
- export type AttributeValuePlaceholder = `:${string}`;
9
- export type AttributeNamePlaceholder = `#${string}`;
10
- export declare class AttributeExpressionMap {
9
+ type AttributeValuePlaceholder = `:${string}`;
10
+ type AttributeNamePlaceholder = `#${string}`;
11
+ declare class AttributeExpressionMap {
11
12
  private attributeNames;
12
13
  private reverseLookupNames;
13
14
  private names;
@@ -30,3 +31,6 @@ export declare class AttributeExpressionMap {
30
31
  getNameCount(): number;
31
32
  getValueCount(): number;
32
33
  }
34
+
35
+ export { AttributeExpressionMap };
36
+ export type { AttributeNamePlaceholder, AttributeNames, AttributeValuePlaceholder, AttributeValues, DynamoAttributeExpression };
@@ -1 +1 @@
1
- export * from './attribute-map';
1
+ export { AttributeExpressionMap, AttributeNamePlaceholder, AttributeNames, AttributeValuePlaceholder, AttributeValues, DynamoAttributeExpression } from './attribute-map.js';
@@ -1,24 +1,27 @@
1
- import type { TransactWriteOperation } from '@/core/core-types';
2
- import type { DynamoEntity } from '@/core/entity';
3
- import type { ConsumedCapacity, ReturnConsumedCapacity } from '@aws-sdk/client-dynamodb';
4
- import type { ResponseMetadata } from '@aws-sdk/types';
5
- import type { ZodObject } from 'zod/v4';
6
- export type BaseCommand<Output, Schema extends ZodObject> = {
1
+ import { TransactWriteOperation } from '../core/core-types.js';
2
+ import { DynamoEntity } from '../core/entity.js';
3
+ import { ReturnConsumedCapacity, ConsumedCapacity } from '@aws-sdk/client-dynamodb';
4
+ import { ResponseMetadata } from '@aws-sdk/types';
5
+ import { ZodObject } from 'zod/v4';
6
+
7
+ type BaseCommand<Output, Schema extends ZodObject> = {
7
8
  execute(entity: DynamoEntity<Schema>): Promise<Output>;
8
9
  };
9
- export type BasePaginatable<Output, Schema extends ZodObject> = {
10
+ type BasePaginatable<Output, Schema extends ZodObject> = {
10
11
  executePaginated(entity: DynamoEntity<Schema>): AsyncGenerator<Output, void, unknown>;
11
12
  };
12
- export type WriteTransactable<Schema extends ZodObject> = {
13
+ type WriteTransactable<Schema extends ZodObject> = {
13
14
  prepareWriteTransaction(entity: DynamoEntity<Schema>): Promise<TransactWriteOperation>;
14
15
  };
15
- export type BaseConfig = {
16
+ type BaseConfig = {
16
17
  skipValidation?: boolean;
17
18
  returnConsumedCapacity?: ReturnConsumedCapacity;
18
19
  abortController?: AbortController;
19
20
  timeoutMs?: number;
20
21
  };
21
- export type BaseResult = {
22
+ type BaseResult = {
22
23
  responseMetadata?: ResponseMetadata;
23
24
  consumedCapacity?: ConsumedCapacity | undefined;
24
25
  };
26
+
27
+ export type { BaseCommand, BaseConfig, BasePaginatable, BaseResult, WriteTransactable };
@@ -1,17 +1,21 @@
1
- import type { BaseConfig, BaseCommand, BaseResult } from '@/commands/base-command';
2
- import type { DynamoEntity } from '@/core/entity';
3
- import type { EntitySchema } from '@/core/core-types';
4
- import type { ZodObject } from 'zod/v4';
5
- export type BatchGetConfig<Schema extends ZodObject> = BaseConfig & {
1
+ import { BaseConfig, BaseResult, BaseCommand } from './base-command.js';
2
+ import { DynamoEntity } from '../core/entity.js';
3
+ import { EntitySchema } from '../core/core-types.js';
4
+ import { ZodObject } from 'zod/v4';
5
+
6
+ type BatchGetConfig<Schema extends ZodObject> = BaseConfig & {
6
7
  keys: Array<Partial<EntitySchema<Schema>>>;
7
8
  consistent?: boolean;
8
9
  };
9
- export type BatchGetResult<Schema extends ZodObject> = BaseResult & {
10
+ type BatchGetResult<Schema extends ZodObject> = BaseResult & {
10
11
  items: Array<EntitySchema<Schema>>;
11
12
  unprocessedKeys?: Array<Partial<EntitySchema<Schema>>>;
12
13
  };
13
- export declare class BatchGet<Schema extends ZodObject> implements BaseCommand<BatchGetResult<Schema>, Schema> {
14
+ declare class BatchGet<Schema extends ZodObject> implements BaseCommand<BatchGetResult<Schema>, Schema> {
14
15
  #private;
15
16
  constructor(config: BatchGetConfig<Schema>);
16
17
  execute(entity: DynamoEntity<Schema>): Promise<BatchGetResult<Schema>>;
17
18
  }
19
+
20
+ export { BatchGet };
21
+ export type { BatchGetConfig, BatchGetResult };
@@ -1,34 +1,40 @@
1
- import type { BaseConfig, BaseCommand, BaseResult } from '@/commands/base-command';
2
- import type { DynamoEntity } from '@/core/entity';
3
- import type { EntitySchema } from '@/core/core-types';
4
- import type { ItemCollectionMetrics, ReturnItemCollectionMetrics } from '@aws-sdk/client-dynamodb';
5
- import type { ZodObject } from 'zod/v4';
6
- export type BatchWriteConfig<Schema extends ZodObject> = BaseConfig & {
1
+ import { DynamoKey } from '../core/key.js';
2
+ import * as zod_v4 from 'zod/v4';
3
+ import { ZodObject } from 'zod/v4';
4
+ import { BaseConfig, BaseResult, BaseCommand } from './base-command.js';
5
+ import { DynamoEntity } from '../core/entity.js';
6
+ import { EntitySchema } from '../core/core-types.js';
7
+ import { ReturnItemCollectionMetrics, ItemCollectionMetrics } from '@aws-sdk/client-dynamodb';
8
+
9
+ type BatchWriteConfig<Schema extends ZodObject> = BaseConfig & {
7
10
  items?: Array<EntitySchema<Schema>>;
8
11
  deletes?: Array<Partial<EntitySchema<Schema>>>;
9
12
  returnItemCollectionMetrics?: ReturnItemCollectionMetrics;
10
13
  };
11
- export type BatchWriteResult<Schema extends ZodObject> = BaseResult & {
14
+ type BatchWriteResult<Schema extends ZodObject> = BaseResult & {
12
15
  unprocessedPuts?: Array<EntitySchema<Schema>>;
13
16
  unprocessedDeletes?: Array<Partial<EntitySchema<Schema>>>;
14
17
  itemColectionMetrics?: ItemCollectionMetrics;
15
18
  };
16
- export declare class BatchWrite<Schema extends ZodObject> implements BaseCommand<BatchWriteResult<Schema>, Schema> {
19
+ declare class BatchWrite<Schema extends ZodObject> implements BaseCommand<BatchWriteResult<Schema>, Schema> {
17
20
  #private;
18
21
  constructor(config: BatchWriteConfig<Schema>);
19
22
  buildPutRequests(entity: DynamoEntity<Schema>): Promise<{
20
23
  PutRequest: {
21
- Item: import("zod/v4").infer<Schema> & import("..").DynamoKey;
24
+ Item: zod_v4.infer<Schema> & DynamoKey;
22
25
  };
23
26
  }[] | {
24
27
  PutRequest: {
25
- Item: import("zod/v4").input<Schema> & import("..").DynamoKey;
28
+ Item: zod_v4.input<Schema> & DynamoKey;
26
29
  };
27
30
  }[]>;
28
31
  buildDeleteRequests(entity: DynamoEntity<Schema>): Promise<{
29
32
  DeleteRequest: {
30
- Key: import("..").DynamoKey;
33
+ Key: DynamoKey;
31
34
  };
32
35
  }[]>;
33
36
  execute(entity: DynamoEntity<Schema>): Promise<BatchWriteResult<Schema>>;
34
37
  }
38
+
39
+ export { BatchWrite };
40
+ export type { BatchWriteConfig, BatchWriteResult };
@@ -1,16 +1,20 @@
1
- import type { Condition } from '@/conditions/condition-types';
2
- import type { DynamoEntity } from '@/core/entity';
3
- import type { EntitySchema, TransactWriteOperation } from '@/core/core-types';
4
- import type { ReturnValuesOnConditionCheckFailure } from '@aws-sdk/client-dynamodb';
5
- import type { WriteTransactable } from '@/commands/base-command';
6
- import type { ZodObject } from 'zod/v4';
7
- export type ConditionCheckConfig<Schema extends ZodObject> = {
1
+ import { Condition } from '../conditions/condition-types.js';
2
+ import { DynamoEntity } from '../core/entity.js';
3
+ import { EntitySchema, TransactWriteOperation } from '../core/core-types.js';
4
+ import { ReturnValuesOnConditionCheckFailure } from '@aws-sdk/client-dynamodb';
5
+ import { WriteTransactable } from './base-command.js';
6
+ import { ZodObject } from 'zod/v4';
7
+
8
+ type ConditionCheckConfig<Schema extends ZodObject> = {
8
9
  key: Partial<EntitySchema<Schema>>;
9
10
  condition: Condition;
10
11
  returnValuesOnConditionCheckFailure?: ReturnValuesOnConditionCheckFailure;
11
12
  };
12
- export declare class ConditionCheck<Schema extends ZodObject> implements WriteTransactable<Schema> {
13
+ declare class ConditionCheck<Schema extends ZodObject> implements WriteTransactable<Schema> {
13
14
  #private;
14
15
  constructor(config: ConditionCheckConfig<Schema>);
15
16
  prepareWriteTransaction(entity: DynamoEntity<Schema>): Promise<TransactWriteOperation>;
16
17
  }
18
+
19
+ export { ConditionCheck };
20
+ export type { ConditionCheckConfig };
@@ -1,21 +1,25 @@
1
- import type { Condition } from '@/conditions/condition-types';
2
- import type { DeleteConfig } from '@/commands/delete';
3
- import type { DynamoEntity } from '@/core/entity';
4
- import type { EntitySchema, TransactWriteOperation } from '@/core/core-types';
5
- import type { ItemCollectionMetrics, ReturnValuesOnConditionCheckFailure } from '@aws-sdk/client-dynamodb';
6
- import type { ZodObject } from 'zod/v4';
7
- import type { BaseResult, BaseCommand, WriteTransactable } from '@/commands/base-command';
8
- export type ConditionalDeleteConfig<Schema extends ZodObject> = DeleteConfig<Schema> & {
1
+ import { Condition } from '../conditions/condition-types.js';
2
+ import { DeleteConfig } from './delete.js';
3
+ import { DynamoEntity } from '../core/entity.js';
4
+ import { EntitySchema, TransactWriteOperation } from '../core/core-types.js';
5
+ import { ReturnValuesOnConditionCheckFailure, ItemCollectionMetrics } from '@aws-sdk/client-dynamodb';
6
+ import { ZodObject } from 'zod/v4';
7
+ import { BaseResult, BaseCommand, WriteTransactable } from './base-command.js';
8
+
9
+ type ConditionalDeleteConfig<Schema extends ZodObject> = DeleteConfig<Schema> & {
9
10
  condition: Condition;
10
11
  returnValuesOnConditionCheckFailure?: ReturnValuesOnConditionCheckFailure;
11
12
  };
12
- export type ConditionalDeleteResult<Schema extends ZodObject> = BaseResult & {
13
+ type ConditionalDeleteResult<Schema extends ZodObject> = BaseResult & {
13
14
  deletedItem?: Partial<EntitySchema<Schema>> | undefined;
14
15
  itemCollectionMetrics?: ItemCollectionMetrics;
15
16
  };
16
- export declare class ConditionalDelete<Schema extends ZodObject> implements BaseCommand<ConditionalDeleteResult<Schema>, Schema>, WriteTransactable<Schema> {
17
+ declare class ConditionalDelete<Schema extends ZodObject> implements BaseCommand<ConditionalDeleteResult<Schema>, Schema>, WriteTransactable<Schema> {
17
18
  #private;
18
19
  constructor(config: ConditionalDeleteConfig<Schema>);
19
20
  execute(entity: DynamoEntity<Schema>): Promise<ConditionalDeleteResult<Schema>>;
20
21
  prepareWriteTransaction(entity: DynamoEntity<Schema>): Promise<TransactWriteOperation>;
21
22
  }
23
+
24
+ export { ConditionalDelete };
25
+ export type { ConditionalDeleteConfig, ConditionalDeleteResult };
@@ -1,22 +1,28 @@
1
- import type { Condition } from '@/conditions/condition-types';
2
- import type { DynamoEntity } from '@/core/entity';
3
- import type { EntitySchema, TransactWriteOperation } from '@/core/core-types';
4
- import type { ItemCollectionMetrics, ReturnValuesOnConditionCheckFailure } from '@aws-sdk/client-dynamodb';
5
- import type { PutConfig } from '@/commands/put';
6
- import type { ZodObject } from 'zod/v4';
7
- import type { BaseResult, BaseCommand, WriteTransactable } from '@/commands/base-command';
8
- export type ConditionalPutConfig<Schema extends ZodObject> = PutConfig<Schema> & {
1
+ import { DynamoKey } from '../core/key.js';
2
+ import * as zod_v4 from 'zod/v4';
3
+ import { ZodObject } from 'zod/v4';
4
+ import { Condition } from '../conditions/condition-types.js';
5
+ import { DynamoEntity } from '../core/entity.js';
6
+ import { EntitySchema, TransactWriteOperation } from '../core/core-types.js';
7
+ import { ReturnValuesOnConditionCheckFailure, ItemCollectionMetrics } from '@aws-sdk/client-dynamodb';
8
+ import { PutConfig } from './put.js';
9
+ import { BaseResult, BaseCommand, WriteTransactable } from './base-command.js';
10
+
11
+ type ConditionalPutConfig<Schema extends ZodObject> = PutConfig<Schema> & {
9
12
  condition: Condition;
10
13
  returnValuesOnConditionCheckFailure?: ReturnValuesOnConditionCheckFailure;
11
14
  };
12
- export type ConditionalPutResult<Schema extends ZodObject> = BaseResult & {
15
+ type ConditionalPutResult<Schema extends ZodObject> = BaseResult & {
13
16
  returnItem: EntitySchema<Schema> | undefined;
14
17
  itemCollectionMetrics: ItemCollectionMetrics | undefined;
15
18
  };
16
- export declare class ConditionalPut<Schema extends ZodObject> implements BaseCommand<ConditionalPutResult<Schema>, Schema>, WriteTransactable<Schema> {
19
+ declare class ConditionalPut<Schema extends ZodObject> implements BaseCommand<ConditionalPutResult<Schema>, Schema>, WriteTransactable<Schema> {
17
20
  #private;
18
21
  constructor(config: ConditionalPutConfig<Schema>);
19
- buildItem(entity: DynamoEntity<Schema>): Promise<(import("zod/v4").infer<Schema> & import("..").DynamoKey) | (import("zod/v4").input<Schema> & import("..").DynamoKey)>;
22
+ buildItem(entity: DynamoEntity<Schema>): Promise<(zod_v4.infer<Schema> & DynamoKey) | (zod_v4.input<Schema> & DynamoKey)>;
20
23
  execute(entity: DynamoEntity<Schema>): Promise<ConditionalPutResult<Schema>>;
21
24
  prepareWriteTransaction(entity: DynamoEntity<Schema>): Promise<TransactWriteOperation>;
22
25
  }
26
+
27
+ export { ConditionalPut };
28
+ export type { ConditionalPutConfig, ConditionalPutResult };
@@ -1,21 +1,25 @@
1
- import type { Condition } from '@/conditions/condition-types';
2
- import type { DynamoEntity } from '@/core/entity';
3
- import type { EntitySchema, TransactWriteOperation } from '@/core/core-types';
4
- import type { ItemCollectionMetrics, ReturnValuesOnConditionCheckFailure } from '@aws-sdk/client-dynamodb';
5
- import type { UpdateConfig } from '@/commands/update';
6
- import type { ZodObject } from 'zod/v4';
7
- import type { BaseResult, BaseCommand, WriteTransactable } from '@/commands/base-command';
8
- export type ConditionalUpdateConfig<Schema extends ZodObject> = UpdateConfig<Schema> & {
1
+ import { Condition } from '../conditions/condition-types.js';
2
+ import { DynamoEntity } from '../core/entity.js';
3
+ import { EntitySchema, TransactWriteOperation } from '../core/core-types.js';
4
+ import { ReturnValuesOnConditionCheckFailure, ItemCollectionMetrics } from '@aws-sdk/client-dynamodb';
5
+ import { UpdateConfig } from './update.js';
6
+ import { ZodObject } from 'zod/v4';
7
+ import { BaseResult, BaseCommand, WriteTransactable } from './base-command.js';
8
+
9
+ type ConditionalUpdateConfig<Schema extends ZodObject> = UpdateConfig<Schema> & {
9
10
  condition: Condition;
10
11
  returnValuesOnConditionCheckFailure?: ReturnValuesOnConditionCheckFailure;
11
12
  };
12
- export type ConditionalUpdateResult<Schema extends ZodObject> = BaseResult & {
13
+ type ConditionalUpdateResult<Schema extends ZodObject> = BaseResult & {
13
14
  updatedItem?: EntitySchema<Schema> | undefined;
14
15
  itemCollectionMetrics?: ItemCollectionMetrics;
15
16
  };
16
- export declare class ConditionalUpdate<Schema extends ZodObject> implements BaseCommand<ConditionalUpdateResult<Schema>, Schema>, WriteTransactable<Schema> {
17
+ declare class ConditionalUpdate<Schema extends ZodObject> implements BaseCommand<ConditionalUpdateResult<Schema>, Schema>, WriteTransactable<Schema> {
17
18
  #private;
18
19
  constructor(config: ConditionalUpdateConfig<Schema>);
19
20
  execute(entity: DynamoEntity<Schema>): Promise<ConditionalUpdateResult<Schema>>;
20
21
  prepareWriteTransaction(entity: DynamoEntity<Schema>): Promise<TransactWriteOperation>;
21
22
  }
23
+
24
+ export { ConditionalUpdate };
25
+ export type { ConditionalUpdateConfig, ConditionalUpdateResult };
@@ -1,20 +1,24 @@
1
- import type { DynamoEntity } from '@/core/entity';
2
- import type { EntitySchema, TransactWriteOperation } from '@/core/core-types';
3
- import type { ItemCollectionMetrics, ReturnItemCollectionMetrics, ReturnValue } from '@aws-sdk/client-dynamodb';
4
- import type { ZodObject } from 'zod/v4';
5
- import type { BaseConfig, BaseCommand, BaseResult, WriteTransactable } from '@/commands/base-command';
6
- export type DeleteConfig<Schema extends ZodObject> = BaseConfig & {
1
+ import { DynamoEntity } from '../core/entity.js';
2
+ import { EntitySchema, TransactWriteOperation } from '../core/core-types.js';
3
+ import { ReturnValue, ReturnItemCollectionMetrics, ItemCollectionMetrics } from '@aws-sdk/client-dynamodb';
4
+ import { ZodObject } from 'zod/v4';
5
+ import { BaseConfig, BaseResult, BaseCommand, WriteTransactable } from './base-command.js';
6
+
7
+ type DeleteConfig<Schema extends ZodObject> = BaseConfig & {
7
8
  key: Partial<EntitySchema<Schema>>;
8
9
  returnValues?: ReturnValue;
9
10
  returnItemCollectionMetrics?: ReturnItemCollectionMetrics;
10
11
  };
11
- export type DeleteResult<Schema extends ZodObject> = BaseResult & {
12
+ type DeleteResult<Schema extends ZodObject> = BaseResult & {
12
13
  deletedItem?: Partial<EntitySchema<Schema>> | undefined;
13
14
  itemCollectionMetrics?: ItemCollectionMetrics;
14
15
  };
15
- export declare class Delete<Schema extends ZodObject> implements BaseCommand<DeleteResult<Schema>, Schema>, WriteTransactable<Schema> {
16
+ declare class Delete<Schema extends ZodObject> implements BaseCommand<DeleteResult<Schema>, Schema>, WriteTransactable<Schema> {
16
17
  #private;
17
18
  constructor(config: DeleteConfig<Schema>);
18
19
  execute(entity: DynamoEntity<Schema>): Promise<DeleteResult<Schema>>;
19
20
  prepareWriteTransaction(entity: DynamoEntity<Schema>): Promise<TransactWriteOperation>;
20
21
  }
22
+
23
+ export { Delete };
24
+ export type { DeleteConfig, DeleteResult };
@@ -1,16 +1,20 @@
1
- import type { DynamoEntity } from '@/core/entity';
2
- import type { BaseConfig, BaseCommand, BaseResult } from '@/commands/base-command';
3
- import type { ZodObject } from 'zod/v4';
4
- import type { EntitySchema } from '@/core/core-types';
5
- export type GetConfig<Schema extends ZodObject> = BaseConfig & {
1
+ import { DynamoEntity } from '../core/entity.js';
2
+ import { BaseConfig, BaseResult, BaseCommand } from './base-command.js';
3
+ import { ZodObject } from 'zod/v4';
4
+ import { EntitySchema } from '../core/core-types.js';
5
+
6
+ type GetConfig<Schema extends ZodObject> = BaseConfig & {
6
7
  key: Partial<EntitySchema<Schema>>;
7
8
  consistent?: boolean;
8
9
  };
9
- export type GetResult<Schema extends ZodObject> = BaseResult & {
10
+ type GetResult<Schema extends ZodObject> = BaseResult & {
10
11
  item: EntitySchema<Schema> | undefined;
11
12
  };
12
- export declare class Get<Schema extends ZodObject> implements BaseCommand<GetResult<Schema>, Schema> {
13
+ declare class Get<Schema extends ZodObject> implements BaseCommand<GetResult<Schema>, Schema> {
13
14
  #private;
14
15
  constructor(config: GetConfig<Schema>);
15
16
  execute(entity: DynamoEntity<Schema>): Promise<GetResult<Schema>>;
16
17
  }
18
+
19
+ export { Get };
20
+ export type { GetConfig, GetResult };
@@ -1,18 +1,18 @@
1
- export * from './base-command';
2
- export * from './get';
3
- export * from './query';
4
- export * from './scan';
5
- export * from './projected-get';
6
- export * from './projected-query';
7
- export * from './projected-scan';
8
- export * from './batch-get';
9
- export * from './transact-get';
10
- export * from './put';
11
- export * from './update';
12
- export * from './delete';
13
- export * from './conditional-put';
14
- export * from './conditional-update';
15
- export * from './conditional-delete';
16
- export * from './batch-write';
17
- export * from './transact-write';
18
- export * from './condition-check';
1
+ export { BaseCommand, BaseConfig, BasePaginatable, BaseResult, WriteTransactable } from './base-command.js';
2
+ export { Get, GetConfig, GetResult } from './get.js';
3
+ export { Query, QueryConfig, QueryResult } from './query.js';
4
+ export { Scan, ScanConfig, ScanResult } from './scan.js';
5
+ export { ProjectedGet, ProjectedGetConfig, ProjectedGetResult } from './projected-get.js';
6
+ export { ProjectedQuery, ProjectedQueryConfig, ProjectedQueryResult } from './projected-query.js';
7
+ export { ProjectedScan, ProjectedScanConfig, ProjectedScanResult } from './projected-scan.js';
8
+ export { BatchGet, BatchGetConfig, BatchGetResult } from './batch-get.js';
9
+ export { TransactGet, TransactGetConfig, TransactGetResult } from './transact-get.js';
10
+ export { Put, PutConfig, PutResult } from './put.js';
11
+ export { Update, UpdateConfig, UpdateResult } from './update.js';
12
+ export { Delete, DeleteConfig, DeleteResult } from './delete.js';
13
+ export { ConditionalPut, ConditionalPutConfig, ConditionalPutResult } from './conditional-put.js';
14
+ export { ConditionalUpdate, ConditionalUpdateConfig, ConditionalUpdateResult } from './conditional-update.js';
15
+ export { ConditionalDelete, ConditionalDeleteConfig, ConditionalDeleteResult } from './conditional-delete.js';
16
+ export { BatchWrite, BatchWriteConfig, BatchWriteResult } from './batch-write.js';
17
+ export { TransactWrite, TransactWriteConfig, TransactWriteResult } from './transact-write.js';
18
+ export { ConditionCheck, ConditionCheckConfig } from './condition-check.js';
@@ -1,18 +1,22 @@
1
- import type { DynamoEntity } from '@/core/entity';
2
- import type { EntitySchema } from '@/core/core-types';
3
- import type { GetConfig } from '@/commands/get';
4
- import type { Projection } from '@/projections/projection-types';
5
- import type { ZodObject } from 'zod/v4';
6
- import type { BaseResult, BaseCommand } from '@/commands/base-command';
7
- export type ProjectedGetConfig<Schema extends ZodObject, ProjectionSchema extends ZodObject> = GetConfig<Schema> & {
1
+ import { DynamoEntity } from '../core/entity.js';
2
+ import { EntitySchema } from '../core/core-types.js';
3
+ import { GetConfig } from './get.js';
4
+ import { Projection } from '../projections/projection-types.js';
5
+ import { ZodObject } from 'zod/v4';
6
+ import { BaseResult, BaseCommand } from './base-command.js';
7
+
8
+ type ProjectedGetConfig<Schema extends ZodObject, ProjectionSchema extends ZodObject> = GetConfig<Schema> & {
8
9
  projection: Projection;
9
10
  projectionSchema: ProjectionSchema;
10
11
  };
11
- export type ProjectedGetResult<ProjectionSchema extends ZodObject> = BaseResult & {
12
+ type ProjectedGetResult<ProjectionSchema extends ZodObject> = BaseResult & {
12
13
  item: EntitySchema<ProjectionSchema> | undefined;
13
14
  };
14
- export declare class ProjectedGet<Schema extends ZodObject, ProjectionSchema extends ZodObject> implements BaseCommand<ProjectedGetResult<ProjectionSchema>, Schema> {
15
+ declare class ProjectedGet<Schema extends ZodObject, ProjectionSchema extends ZodObject> implements BaseCommand<ProjectedGetResult<ProjectionSchema>, Schema> {
15
16
  #private;
16
17
  constructor(config: ProjectedGetConfig<Schema, ProjectionSchema>);
17
18
  execute(entity: DynamoEntity<Schema>): Promise<ProjectedGetResult<ProjectionSchema>>;
18
19
  }
20
+
21
+ export { ProjectedGet };
22
+ export type { ProjectedGetConfig, ProjectedGetResult };
@@ -1,21 +1,22 @@
1
- import type { DynamoEntity } from '@/core/entity';
2
- import type { EntitySchema } from '@/core/core-types';
3
- import type { Projection } from '@/projections/projection-types';
4
- import type { QueryConfig } from '@/commands/query';
5
- import type { ZodObject } from 'zod/v4';
6
- import type { BaseResult, BaseCommand, BasePaginatable } from '@/commands/base-command';
7
- import { type NativeAttributeValue, type QueryCommandInput, type QueryCommandOutput } from '@aws-sdk/lib-dynamodb';
8
- export type ProjectedQueryConfig<Schema extends ZodObject, ProjectionSchema extends ZodObject> = QueryConfig<Schema> & {
1
+ import { DynamoEntity } from '../core/entity.js';
2
+ import { EntitySchema } from '../core/core-types.js';
3
+ import { Projection } from '../projections/projection-types.js';
4
+ import { QueryConfig } from './query.js';
5
+ import { ZodObject } from 'zod/v4';
6
+ import { BaseResult, BaseCommand, BasePaginatable } from './base-command.js';
7
+ import { QueryCommandInput, NativeAttributeValue, QueryCommandOutput } from '@aws-sdk/lib-dynamodb';
8
+
9
+ type ProjectedQueryConfig<Schema extends ZodObject, ProjectionSchema extends ZodObject> = QueryConfig<Schema> & {
9
10
  projection: Projection;
10
11
  projectionSchema: ProjectionSchema;
11
12
  };
12
- export type ProjectedQueryResult<Schema extends ZodObject, ProjectionSchema extends ZodObject> = BaseResult & {
13
+ type ProjectedQueryResult<Schema extends ZodObject, ProjectionSchema extends ZodObject> = BaseResult & {
13
14
  items: EntitySchema<ProjectionSchema>[];
14
15
  count: number;
15
16
  scannedCount: number;
16
17
  lastEvaluatedKey?: Partial<EntitySchema<Schema>> | undefined;
17
18
  };
18
- export declare class ProjectedQuery<Schema extends ZodObject, ProjectedSchema extends ZodObject> implements BaseCommand<ProjectedQueryResult<Schema, ProjectedSchema>, Schema>, BasePaginatable<ProjectedQueryResult<Schema, ProjectedSchema>, Schema> {
19
+ declare class ProjectedQuery<Schema extends ZodObject, ProjectedSchema extends ZodObject> implements BaseCommand<ProjectedQueryResult<Schema, ProjectedSchema>, Schema>, BasePaginatable<ProjectedQueryResult<Schema, ProjectedSchema>, Schema> {
19
20
  #private;
20
21
  constructor(config: ProjectedQueryConfig<Schema, ProjectedSchema>);
21
22
  buildCommandInput(entity: DynamoEntity<Schema>): QueryCommandInput;
@@ -24,3 +25,6 @@ export declare class ProjectedQuery<Schema extends ZodObject, ProjectedSchema ex
24
25
  execute(entity: DynamoEntity<Schema>): Promise<ProjectedQueryResult<Schema, ProjectedSchema>>;
25
26
  executePaginated(entity: DynamoEntity<Schema>): AsyncGenerator<ProjectedQueryResult<Schema, ProjectedSchema>, void, unknown>;
26
27
  }
28
+
29
+ export { ProjectedQuery };
30
+ export type { ProjectedQueryConfig, ProjectedQueryResult };
@@ -1,21 +1,22 @@
1
- import type { DynamoEntity } from '@/core/entity';
2
- import type { EntitySchema } from '@/core/core-types';
3
- import type { ScanConfig } from '@/commands/scan';
4
- import type { Projection } from '@/projections/projection-types';
5
- import type { ZodObject } from 'zod/v4';
6
- import type { BaseCommand, BasePaginatable, BaseResult } from '@/commands/base-command';
7
- import { type NativeAttributeValue, type ScanCommandInput, type ScanCommandOutput } from '@aws-sdk/lib-dynamodb';
8
- export type ProjectedScanConfig<ProjectionSchema extends ZodObject> = ScanConfig<ProjectionSchema> & {
1
+ import { DynamoEntity } from '../core/entity.js';
2
+ import { EntitySchema } from '../core/core-types.js';
3
+ import { ScanConfig } from './scan.js';
4
+ import { Projection } from '../projections/projection-types.js';
5
+ import { ZodObject } from 'zod/v4';
6
+ import { BaseResult, BaseCommand, BasePaginatable } from './base-command.js';
7
+ import { ScanCommandInput, NativeAttributeValue, ScanCommandOutput } from '@aws-sdk/lib-dynamodb';
8
+
9
+ type ProjectedScanConfig<ProjectionSchema extends ZodObject> = ScanConfig<ProjectionSchema> & {
9
10
  projection: Projection;
10
11
  projectionSchema: ProjectionSchema;
11
12
  };
12
- export type ProjectedScanResult<Schema extends ZodObject, ProjectionSchema extends ZodObject> = BaseResult & {
13
+ type ProjectedScanResult<Schema extends ZodObject, ProjectionSchema extends ZodObject> = BaseResult & {
13
14
  items: EntitySchema<ProjectionSchema>[];
14
15
  count: number;
15
16
  scannedCount: number;
16
17
  lastEvaluatedKey?: Partial<EntitySchema<Schema>> | undefined;
17
18
  };
18
- export declare class ProjectedScan<Schema extends ZodObject, ProjectedSchema extends ZodObject> implements BaseCommand<ProjectedScanResult<Schema, ProjectedSchema>, Schema>, BasePaginatable<ProjectedScanResult<Schema, ProjectedSchema>, Schema> {
19
+ declare class ProjectedScan<Schema extends ZodObject, ProjectedSchema extends ZodObject> implements BaseCommand<ProjectedScanResult<Schema, ProjectedSchema>, Schema>, BasePaginatable<ProjectedScanResult<Schema, ProjectedSchema>, Schema> {
19
20
  #private;
20
21
  constructor(config: ProjectedScanConfig<ProjectedSchema>);
21
22
  buildCommandInput(entity: DynamoEntity<Schema>): ScanCommandInput;
@@ -24,3 +25,6 @@ export declare class ProjectedScan<Schema extends ZodObject, ProjectedSchema ext
24
25
  execute(entity: DynamoEntity<Schema>): Promise<ProjectedScanResult<Schema, ProjectedSchema>>;
25
26
  executePaginated(entity: DynamoEntity<Schema>): AsyncGenerator<ProjectedScanResult<Schema, ProjectedSchema>, void, unknown>;
26
27
  }
28
+
29
+ export { ProjectedScan };
30
+ export type { ProjectedScanConfig, ProjectedScanResult };
@@ -1,21 +1,27 @@
1
- import type { DynamoEntity } from '@/core/entity';
2
- import type { EntitySchema, TransactWriteOperation } from '@/core/core-types';
3
- import type { ItemCollectionMetrics, ReturnItemCollectionMetrics, ReturnValue } from '@aws-sdk/client-dynamodb';
4
- import type { ZodObject } from 'zod/v4';
5
- import type { BaseConfig, BaseCommand, BaseResult, WriteTransactable } from '@/commands/base-command';
6
- export type PutConfig<Schema extends ZodObject> = BaseConfig & {
1
+ import { DynamoKey } from '../core/key.js';
2
+ import * as zod_v4 from 'zod/v4';
3
+ import { ZodObject } from 'zod/v4';
4
+ import { DynamoEntity } from '../core/entity.js';
5
+ import { EntitySchema, TransactWriteOperation } from '../core/core-types.js';
6
+ import { ReturnValue, ReturnItemCollectionMetrics, ItemCollectionMetrics } from '@aws-sdk/client-dynamodb';
7
+ import { BaseConfig, BaseResult, BaseCommand, WriteTransactable } from './base-command.js';
8
+
9
+ type PutConfig<Schema extends ZodObject> = BaseConfig & {
7
10
  item: EntitySchema<Schema>;
8
11
  returnValues?: ReturnValue;
9
12
  returnItemCollectionMetrics?: ReturnItemCollectionMetrics;
10
13
  };
11
- export type PutResult<Schema extends ZodObject> = BaseResult & {
14
+ type PutResult<Schema extends ZodObject> = BaseResult & {
12
15
  returnItem: Partial<EntitySchema<Schema>> | undefined;
13
16
  itemCollectionMetrics?: ItemCollectionMetrics;
14
17
  };
15
- export declare class Put<Schema extends ZodObject> implements BaseCommand<PutResult<Schema>, Schema>, WriteTransactable<Schema> {
18
+ declare class Put<Schema extends ZodObject> implements BaseCommand<PutResult<Schema>, Schema>, WriteTransactable<Schema> {
16
19
  #private;
17
20
  constructor(config: PutConfig<Schema>);
18
- buildItem(entity: DynamoEntity<Schema>): Promise<(import("zod/v4").infer<Schema> & import("..").DynamoKey) | (import("zod/v4").input<Schema> & import("..").DynamoKey)>;
21
+ buildItem(entity: DynamoEntity<Schema>): Promise<(zod_v4.infer<Schema> & DynamoKey) | (zod_v4.input<Schema> & DynamoKey)>;
19
22
  execute(entity: DynamoEntity<Schema>): Promise<PutResult<Schema>>;
20
23
  prepareWriteTransaction(entity: DynamoEntity<Schema>): Promise<TransactWriteOperation>;
21
24
  }
25
+
26
+ export { Put };
27
+ export type { PutConfig, PutResult };
@@ -1,11 +1,12 @@
1
- import type { Condition } from '@/conditions/condition-types';
2
- import type { DynamoEntity, EntityKeyInput } from '@/core/entity';
3
- import type { EntitySchema } from '@/core/core-types';
4
- import type { Select } from '@aws-sdk/client-dynamodb';
5
- import type { ZodObject } from 'zod/v4';
6
- import type { BaseConfig, BaseCommand, BasePaginatable, BaseResult } from '@/commands/base-command';
7
- import { type QueryCommandInput, type NativeAttributeValue, type QueryCommandOutput } from '@aws-sdk/lib-dynamodb';
8
- export type QueryConfig<Schema extends ZodObject> = BaseConfig & EntityKeyInput<EntitySchema<Schema>> & {
1
+ import { Condition } from '../conditions/condition-types.js';
2
+ import { EntityKeyInput, DynamoEntity } from '../core/entity.js';
3
+ import { EntitySchema } from '../core/core-types.js';
4
+ import { Select } from '@aws-sdk/client-dynamodb';
5
+ import { ZodObject } from 'zod/v4';
6
+ import { BaseConfig, BaseResult, BaseCommand, BasePaginatable } from './base-command.js';
7
+ import { QueryCommandInput, NativeAttributeValue, QueryCommandOutput } from '@aws-sdk/lib-dynamodb';
8
+
9
+ type QueryConfig<Schema extends ZodObject> = BaseConfig & EntityKeyInput<EntitySchema<Schema>> & {
9
10
  sortKeyCondition?: Condition;
10
11
  filter?: Condition;
11
12
  limit?: number;
@@ -16,13 +17,13 @@ export type QueryConfig<Schema extends ZodObject> = BaseConfig & EntityKeyInput<
16
17
  exclusiveStartKey?: Partial<EntitySchema<Schema>>;
17
18
  pageSize?: number;
18
19
  };
19
- export type QueryResult<Schema extends ZodObject> = BaseResult & {
20
+ type QueryResult<Schema extends ZodObject> = BaseResult & {
20
21
  items: EntitySchema<Schema>[];
21
22
  count: number;
22
23
  scannedCount: number;
23
24
  lastEvaluatedKey?: Partial<EntitySchema<Schema>> | undefined;
24
25
  };
25
- export declare class Query<Schema extends ZodObject> implements BaseCommand<QueryResult<Schema>, Schema>, BasePaginatable<QueryResult<Schema>, Schema> {
26
+ declare class Query<Schema extends ZodObject> implements BaseCommand<QueryResult<Schema>, Schema>, BasePaginatable<QueryResult<Schema>, Schema> {
26
27
  #private;
27
28
  constructor(config: QueryConfig<Schema>);
28
29
  buildCommandInput(entity: DynamoEntity<Schema>): QueryCommandInput;
@@ -31,3 +32,6 @@ export declare class Query<Schema extends ZodObject> implements BaseCommand<Quer
31
32
  execute(entity: DynamoEntity<Schema>): Promise<QueryResult<Schema>>;
32
33
  executePaginated(entity: DynamoEntity<Schema>): AsyncGenerator<QueryResult<Schema>, void, unknown>;
33
34
  }
35
+
36
+ export { Query };
37
+ export type { QueryConfig, QueryResult };