@infra-blocks/aws-dynamodb 0.26.0-alpha.0 → 0.27.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 (121) hide show
  1. package/lib/cjs/commands/attributes/index.d.ts +2 -0
  2. package/lib/cjs/commands/attributes/index.js +19 -0
  3. package/lib/cjs/commands/attributes/index.js.map +1 -0
  4. package/lib/cjs/commands/attributes/names.d.ts +4 -4
  5. package/lib/cjs/commands/attributes/names.js.map +1 -1
  6. package/lib/cjs/commands/attributes/values.d.ts +6 -3
  7. package/lib/cjs/commands/attributes/values.js.map +1 -1
  8. package/lib/cjs/commands/expressions/condition/comparisons.d.ts +22 -0
  9. package/lib/cjs/commands/expressions/condition/comparisons.js +204 -0
  10. package/lib/cjs/commands/expressions/condition/comparisons.js.map +1 -0
  11. package/lib/cjs/commands/expressions/condition/condition.d.ts +24 -0
  12. package/lib/cjs/commands/expressions/condition/condition.js +27 -0
  13. package/lib/cjs/commands/expressions/condition/condition.js.map +1 -0
  14. package/lib/cjs/commands/expressions/condition/expression.d.ts +19 -0
  15. package/lib/cjs/commands/expressions/condition/expression.js +28 -0
  16. package/lib/cjs/commands/expressions/condition/expression.js.map +1 -0
  17. package/lib/cjs/commands/expressions/condition/functions.d.ts +70 -0
  18. package/lib/cjs/commands/expressions/condition/functions.js +80 -0
  19. package/lib/cjs/commands/expressions/condition/functions.js.map +1 -0
  20. package/lib/cjs/commands/expressions/condition/index.d.ts +5 -0
  21. package/lib/cjs/commands/expressions/condition/index.js +21 -0
  22. package/lib/cjs/commands/expressions/condition/index.js.map +1 -0
  23. package/lib/cjs/commands/expressions/condition/logic.d.ts +34 -0
  24. package/lib/cjs/commands/expressions/condition/logic.js +68 -0
  25. package/lib/cjs/commands/expressions/condition/logic.js.map +1 -0
  26. package/lib/cjs/commands/expressions/condition/size.d.ts +37 -0
  27. package/lib/cjs/commands/expressions/condition/size.js +35 -0
  28. package/lib/cjs/commands/expressions/condition/size.js.map +1 -0
  29. package/lib/cjs/commands/expressions/expression.d.ts +4 -0
  30. package/lib/cjs/commands/expressions/index.d.ts +1 -1
  31. package/lib/cjs/commands/expressions/index.js +1 -1
  32. package/lib/cjs/commands/expressions/index.js.map +1 -1
  33. package/lib/cjs/commands/expressions/key-condition.d.ts +2 -2
  34. package/lib/cjs/commands/expressions/operands/index.d.ts +1 -1
  35. package/lib/cjs/commands/expressions/operands/index.js +1 -1
  36. package/lib/cjs/commands/expressions/operands/{name.js → path.js} +1 -1
  37. package/lib/cjs/commands/expressions/operands/{name.js.map → path.js.map} +1 -1
  38. package/lib/cjs/commands/expressions/operands/type.d.ts +1 -1
  39. package/lib/cjs/commands/expressions/operands/value.js +0 -1
  40. package/lib/cjs/commands/expressions/operands/value.js.map +1 -1
  41. package/lib/cjs/commands/expressions/update/add.d.ts +1 -1
  42. package/lib/cjs/commands/expressions/update/delete.d.ts +1 -1
  43. package/lib/cjs/commands/expressions/update/if-not-exists.d.ts +1 -1
  44. package/lib/cjs/commands/expressions/update/remove.d.ts +1 -1
  45. package/lib/cjs/commands/expressions/update/set.d.ts +1 -1
  46. package/lib/cjs/commands/put-item.d.ts +2 -2
  47. package/lib/cjs/commands/put-item.js +5 -1
  48. package/lib/cjs/commands/put-item.js.map +1 -1
  49. package/lib/cjs/commands/query.js +5 -1
  50. package/lib/cjs/commands/query.js.map +1 -1
  51. package/lib/cjs/commands/update-item.d.ts +2 -2
  52. package/lib/cjs/commands/update-item.js +5 -1
  53. package/lib/cjs/commands/update-item.js.map +1 -1
  54. package/lib/cjs/types.d.ts +3 -2
  55. package/lib/cjs/types.js +13 -0
  56. package/lib/cjs/types.js.map +1 -1
  57. package/lib/esm/commands/attributes/index.d.ts +2 -0
  58. package/lib/esm/commands/attributes/index.js +3 -0
  59. package/lib/esm/commands/attributes/index.js.map +1 -0
  60. package/lib/esm/commands/attributes/names.d.ts +4 -4
  61. package/lib/esm/commands/attributes/names.js.map +1 -1
  62. package/lib/esm/commands/attributes/values.d.ts +6 -3
  63. package/lib/esm/commands/attributes/values.js.map +1 -1
  64. package/lib/esm/commands/expressions/condition/comparisons.d.ts +22 -0
  65. package/lib/esm/commands/expressions/condition/comparisons.js +200 -0
  66. package/lib/esm/commands/expressions/condition/comparisons.js.map +1 -0
  67. package/lib/esm/commands/expressions/condition/condition.d.ts +24 -0
  68. package/lib/esm/commands/expressions/condition/condition.js +22 -0
  69. package/lib/esm/commands/expressions/condition/condition.js.map +1 -0
  70. package/lib/esm/commands/expressions/condition/expression.d.ts +19 -0
  71. package/lib/esm/commands/expressions/condition/expression.js +23 -0
  72. package/lib/esm/commands/expressions/condition/expression.js.map +1 -0
  73. package/lib/esm/commands/expressions/condition/functions.d.ts +70 -0
  74. package/lib/esm/commands/expressions/condition/functions.js +73 -0
  75. package/lib/esm/commands/expressions/condition/functions.js.map +1 -0
  76. package/lib/esm/commands/expressions/condition/index.d.ts +5 -0
  77. package/lib/esm/commands/expressions/condition/index.js +5 -0
  78. package/lib/esm/commands/expressions/condition/index.js.map +1 -0
  79. package/lib/esm/commands/expressions/condition/logic.d.ts +34 -0
  80. package/lib/esm/commands/expressions/condition/logic.js +63 -0
  81. package/lib/esm/commands/expressions/condition/logic.js.map +1 -0
  82. package/lib/esm/commands/expressions/condition/size.d.ts +37 -0
  83. package/lib/esm/commands/expressions/condition/size.js +30 -0
  84. package/lib/esm/commands/expressions/condition/size.js.map +1 -0
  85. package/lib/esm/commands/expressions/expression.d.ts +4 -0
  86. package/lib/esm/commands/expressions/index.d.ts +1 -1
  87. package/lib/esm/commands/expressions/index.js +1 -1
  88. package/lib/esm/commands/expressions/index.js.map +1 -1
  89. package/lib/esm/commands/expressions/key-condition.d.ts +2 -2
  90. package/lib/esm/commands/expressions/operands/index.d.ts +1 -1
  91. package/lib/esm/commands/expressions/operands/index.js +1 -1
  92. package/lib/esm/commands/expressions/operands/{name.js → path.js} +1 -1
  93. package/lib/esm/commands/expressions/operands/{name.js.map → path.js.map} +1 -1
  94. package/lib/esm/commands/expressions/operands/type.d.ts +1 -1
  95. package/lib/esm/commands/expressions/operands/value.js +0 -1
  96. package/lib/esm/commands/expressions/operands/value.js.map +1 -1
  97. package/lib/esm/commands/expressions/update/add.d.ts +1 -1
  98. package/lib/esm/commands/expressions/update/delete.d.ts +1 -1
  99. package/lib/esm/commands/expressions/update/if-not-exists.d.ts +1 -1
  100. package/lib/esm/commands/expressions/update/remove.d.ts +1 -1
  101. package/lib/esm/commands/expressions/update/set.d.ts +1 -1
  102. package/lib/esm/commands/put-item.d.ts +2 -2
  103. package/lib/esm/commands/put-item.js +5 -1
  104. package/lib/esm/commands/put-item.js.map +1 -1
  105. package/lib/esm/commands/query.js +5 -1
  106. package/lib/esm/commands/query.js.map +1 -1
  107. package/lib/esm/commands/update-item.d.ts +2 -2
  108. package/lib/esm/commands/update-item.js +5 -1
  109. package/lib/esm/commands/update-item.js.map +1 -1
  110. package/lib/esm/types.d.ts +3 -2
  111. package/lib/esm/types.js +12 -1
  112. package/lib/esm/types.js.map +1 -1
  113. package/package.json +2 -2
  114. package/lib/cjs/commands/expressions/condition.d.ts +0 -224
  115. package/lib/cjs/commands/expressions/condition.js +0 -360
  116. package/lib/cjs/commands/expressions/condition.js.map +0 -1
  117. package/lib/esm/commands/expressions/condition.d.ts +0 -224
  118. package/lib/esm/commands/expressions/condition.js +0 -350
  119. package/lib/esm/commands/expressions/condition.js.map +0 -1
  120. /package/lib/cjs/commands/expressions/operands/{name.d.ts → path.d.ts} +0 -0
  121. /package/lib/esm/commands/expressions/operands/{name.d.ts → path.d.ts} +0 -0
@@ -1,5 +1,9 @@
1
1
  import type { AttributeNames } from "../attributes/names.js";
2
2
  import type { AttributeValues } from "../attributes/values.js";
3
+ export type Stringifier = (params: {
4
+ names: AttributeNames;
5
+ values: AttributeValues;
6
+ }) => string;
3
7
  export interface IExpression {
4
8
  stringify(params: {
5
9
  names: AttributeNames;
@@ -1,4 +1,4 @@
1
- export * from "./condition.js";
1
+ export * from "./condition/index.js";
2
2
  export * from "./key-condition.js";
3
3
  export * from "./operands/index.js";
4
4
  export * from "./update/index.js";
@@ -1,4 +1,4 @@
1
- export * from "./condition.js";
1
+ export * from "./condition/index.js";
2
2
  export * from "./key-condition.js";
3
3
  export * from "./operands/index.js";
4
4
  export * from "./update/index.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/commands/expressions/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAElC;;;;;GAKG"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/commands/expressions/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAElC;;;;;GAKG"}
@@ -1,2 +1,2 @@
1
- import type { Condition } from "./condition.js";
2
- export type KeyConditionExpression = Condition;
1
+ import type { ConditionParams } from "./condition/index.js";
2
+ export type KeyConditionExpression = ConditionParams;
@@ -1,3 +1,3 @@
1
- export * from "./name.js";
1
+ export * from "./path.js";
2
2
  export * from "./type.js";
3
3
  export * from "./value.js";
@@ -1,4 +1,4 @@
1
- export * from "./name.js";
1
+ export * from "./path.js";
2
2
  export * from "./type.js";
3
3
  export * from "./value.js";
4
4
  //# sourceMappingURL=index.js.map
@@ -25,4 +25,4 @@ export class PathOperand {
25
25
  export function path(path) {
26
26
  return new PathOperand(path);
27
27
  }
28
- //# sourceMappingURL=name.js.map
28
+ //# sourceMappingURL=path.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"name.js","sourceRoot":"","sources":["../../../../../src/commands/expressions/operands/name.ts"],"names":[],"mappings":"AAIA;;;;;;GAMG;AACH,MAAM,OAAO,WAAW;IACL,IAAI,CAAgB;IAErC,YAAY,IAAmB;QAC7B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;IAED,UAAU,CAAC,MAAiC;QAC1C,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,CAAC;QACzB,OAAO,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACrC,CAAC;CACF;AAED;;;;;;GAMG;AACH,MAAM,UAAU,IAAI,CAAC,IAAmB;IACtC,OAAO,IAAI,WAAW,CAAC,IAAI,CAAC,CAAC;AAC/B,CAAC"}
1
+ {"version":3,"file":"path.js","sourceRoot":"","sources":["../../../../../src/commands/expressions/operands/path.ts"],"names":[],"mappings":"AAIA;;;;;;GAMG;AACH,MAAM,OAAO,WAAW;IACL,IAAI,CAAgB;IAErC,YAAY,IAAmB;QAC7B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;IAED,UAAU,CAAC,MAAiC;QAC1C,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,CAAC;QACzB,OAAO,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACrC,CAAC;CACF;AAED;;;;;;GAMG;AACH,MAAM,UAAU,IAAI,CAAC,IAAmB;IACtC,OAAO,IAAI,WAAW,CAAC,IAAI,CAAC,CAAC;AAC/B,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import type { AttributeValue } from "../../../types.js";
2
2
  import type { AttributeNames } from "../../attributes/names.js";
3
3
  import type { AttributeValues } from "../../attributes/values.js";
4
- import type { PathOperand } from "./name.js";
4
+ import type { PathOperand } from "./path.js";
5
5
  import type { ValueOperand } from "./value.js";
6
6
  export type Operand<T extends AttributeValue = AttributeValue> = PathOperand | ValueOperand<T>;
7
7
  export interface IOperand {
@@ -10,7 +10,6 @@ export class ValueOperand {
10
10
  constructor(value) {
11
11
  this.value = value;
12
12
  }
13
- // TODO: make the names optional
14
13
  substitute(params) {
15
14
  const { values } = params;
16
15
  return values.substitute(this.value);
@@ -1 +1 @@
1
- {"version":3,"file":"value.js","sourceRoot":"","sources":["../../../../../src/commands/expressions/operands/value.ts"],"names":[],"mappings":"AAIA;;;;;;GAMG;AACH,MAAM,OAAO,YAAY;IAGN,KAAK,CAAI;IAE1B,YAAY,KAAQ;QAClB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;IAED,gCAAgC;IAChC,UAAU,CAAC,MAAmC;QAC5C,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC;QAC1B,OAAO,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACvC,CAAC;CACF;AAED;;;;;;GAMG;AACH,MAAM,UAAU,KAAK,CACnB,KAAQ;IAER,OAAO,IAAI,YAAY,CAAC,KAAK,CAAC,CAAC;AACjC,CAAC"}
1
+ {"version":3,"file":"value.js","sourceRoot":"","sources":["../../../../../src/commands/expressions/operands/value.ts"],"names":[],"mappings":"AAIA;;;;;;GAMG;AACH,MAAM,OAAO,YAAY;IAGN,KAAK,CAAI;IAE1B,YAAY,KAAQ;QAClB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;IAED,UAAU,CAAC,MAAmC;QAC5C,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC;QAC1B,OAAO,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACvC,CAAC;CACF;AAED;;;;;;GAMG;AACH,MAAM,UAAU,KAAK,CACnB,KAAQ;IAER,OAAO,IAAI,YAAY,CAAC,KAAK,CAAC,CAAC;AACjC,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import type { NativeNumber, NativeSet } from "../../../types.js";
2
2
  import type { AttributeNames } from "../../attributes/names.js";
3
3
  import type { AttributeValues } from "../../attributes/values.js";
4
- import type { PathOperand } from "../operands/name.js";
4
+ import type { PathOperand } from "../operands/path.js";
5
5
  import type { ValueOperand } from "../operands/value.js";
6
6
  import type { IUpdateAction, UpdateAction } from "./action.js";
7
7
  import type { UpdateExpressionClauses } from "./clauses.js";
@@ -1,7 +1,7 @@
1
1
  import type { NativeSet } from "../../../types.js";
2
2
  import type { AttributeNames } from "../../attributes/names.js";
3
3
  import type { AttributeValues } from "../../attributes/values.js";
4
- import type { PathOperand } from "../operands/name.js";
4
+ import type { PathOperand } from "../operands/path.js";
5
5
  import type { ValueOperand } from "../operands/value.js";
6
6
  import type { IUpdateAction, UpdateAction } from "./action.js";
7
7
  import type { UpdateExpressionClauses } from "./clauses.js";
@@ -1,6 +1,6 @@
1
1
  import type { AttributeNames } from "../../attributes/names.js";
2
2
  import type { AttributeValues } from "../../attributes/values.js";
3
- import type { PathOperand } from "../operands/name.js";
3
+ import type { PathOperand } from "../operands/path.js";
4
4
  import type { IOperand, Operand } from "../operands/type.js";
5
5
  export declare class IfNotExistsOperand implements IOperand {
6
6
  private readonly path;
@@ -1,5 +1,5 @@
1
1
  import type { AttributeNames } from "../../attributes/names.js";
2
- import type { PathOperand } from "../operands/name.js";
2
+ import type { PathOperand } from "../operands/path.js";
3
3
  import type { IUpdateAction, UpdateAction } from "./action.js";
4
4
  import type { UpdateExpressionClauses } from "./clauses.js";
5
5
  export declare class RemoveAction implements IUpdateAction {
@@ -1,6 +1,6 @@
1
1
  import type { AttributeNames } from "../../attributes/names.js";
2
2
  import type { AttributeValues } from "../../attributes/values.js";
3
- import type { PathOperand } from "../operands/name.js";
3
+ import type { PathOperand } from "../operands/path.js";
4
4
  import type { Operand } from "../operands/type.js";
5
5
  import type { IUpdateAction, UpdateAction } from "./action.js";
6
6
  import type { UpdateExpressionClauses } from "./clauses.js";
@@ -1,11 +1,11 @@
1
1
  import { PutCommand, type PutCommandInput } from "@aws-sdk/lib-dynamodb";
2
2
  import type { Attributes } from "../types.js";
3
- import type { Condition } from "./expressions/condition.js";
3
+ import type { ConditionParams } from "./expressions/index.js";
4
4
  import type { Command } from "./types.js";
5
5
  export interface PutItemParams {
6
6
  table: string;
7
7
  item: Attributes;
8
- condition?: Condition;
8
+ condition?: ConditionParams;
9
9
  }
10
10
  export declare class PutItem implements Command<PutCommandInput, PutCommand> {
11
11
  private readonly table;
@@ -1,6 +1,7 @@
1
1
  import { PutCommand } from "@aws-sdk/lib-dynamodb";
2
2
  import { AttributeNames } from "./attributes/names.js";
3
3
  import { AttributeValues } from "./attributes/values.js";
4
+ import { conditionExpression } from "./expressions/condition/expression.js";
4
5
  export class PutItem {
5
6
  table;
6
7
  item;
@@ -24,7 +25,10 @@ export class PutItem {
24
25
  const names = AttributeNames.create();
25
26
  const values = AttributeValues.create();
26
27
  // Ask the expression to stringify itself, applying the substitutions by itself.
27
- const expression = this.condition.stringify({ names, values });
28
+ const expression = conditionExpression(this.condition).stringify({
29
+ names,
30
+ values,
31
+ });
28
32
  return {
29
33
  ...input,
30
34
  ConditionExpression: expression,
@@ -1 +1 @@
1
- {"version":3,"file":"put-item.js","sourceRoot":"","sources":["../../../src/commands/put-item.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAwB,MAAM,uBAAuB,CAAC;AAEzE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAUzD,MAAM,OAAO,OAAO;IACD,KAAK,CAAS;IACd,IAAI,CAAa;IACjB,SAAS,CAAa;IAEvC,YAAoB,MAAqB;QACvC,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,MAAM,CAAC;QAC1C,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;IAC7B,CAAC;IAED,iBAAiB;QACf,MAAM,KAAK,GAAoB;YAC7B,SAAS,EAAE,IAAI,CAAC,KAAK;YACrB,IAAI,EAAE,IAAI,CAAC,IAAI;SAChB,CAAC;QAEF,4FAA4F;QAC5F,qBAAqB;QACrB,IAAI,IAAI,CAAC,SAAS,I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IAC7B,CAAC;IAED,iBAAiB;QACf,MAAM,KAAK,GAAoB;YAC7B,SAAS,EAAE,IAAI,CAAC,KAAK;YACrB,IAAI,EAAE,IAAI,CAAC,IAAI;SAChB,CAAC;QAEF,4FAA4F;QAC5F,qBAAqB;QACrB,IAAI,IAAI,CAAC,SAAS,IAAI,IAAI,EAAE,CAAC;YAC3B,OAAO,KAAK,CAAC;QACf,CAAC;QAED,MAAM,KAAK,GAAG,cAAc,CAAC,MAAM,EAAE,CAAC;QACtC,MAAM,MAAM,GAAG,eAAe,CAAC,MAAM,EAAE,CAAC;QACxC,gFAAgF;QAChF,MAAM,UAAU,GAAG,mBAAmB,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,SAAS,CAAC;YAC/D,KAAK;YACL,MAAM;SACP,CAAC,CAAC;QAEH,OAAO;YACL,GAAG,KAAK;YACR,mBAAmB,EAAE,UAAU;YAC/B,wBAAwB,EAAE,KAAK,CAAC,gBAAgB,EAAE;YAClD,yBAAyB,EAAE,MAAM,CAAC,gBAAgB,EAAE;SACrD,CAAC;IACJ,CAAC;IAED,YAAY;QACV,OAAO,IAAI,UAAU,CAAC,IAAI,CAAC,iBAAiB,EAAE,CAAC,CAAC;IAClD,CAAC;IAED,MAAM,CAAC,IAAI,CAAC,MAAqB;QAC/B,OAAO,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;IAC7B,CAAC;CACF"}
@@ -1,6 +1,7 @@
1
1
  import { QueryCommand } from "@aws-sdk/lib-dynamodb";
2
2
  import { AttributeNames } from "./attributes/names.js";
3
3
  import { AttributeValues } from "./attributes/values.js";
4
+ import { conditionExpression } from "./expressions/condition/expression.js";
4
5
  export class Query {
5
6
  table;
6
7
  index;
@@ -16,7 +17,10 @@ export class Query {
16
17
  toAwsCommandInput() {
17
18
  const names = AttributeNames.create();
18
19
  const values = AttributeValues.create();
19
- const expression = this.condition.stringify({ names, values });
20
+ const expression = conditionExpression(this.condition).stringify({
21
+ names,
22
+ values,
23
+ });
20
24
  return {
21
25
  TableName: this.table,
22
26
  IndexName: this.index,
@@ -1 +1 @@
1
- {"version":3,"file":"query.js","sourceRoot":"","sources":["../../../src/commands/query.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAA0B,MAAM,uBAAuB,CAAC;AAE7E,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAWzD,MAAM,OAAO,KAAK;IACC,KAAK,CAAS;IACd,KAAK,CAAU;IACf,SAAS,CAAyB;IAClC,iBAAiB,CAAkC;IAEpE,YAAoB,MAAmB;QACrC,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,iBAAiB,EAAE,GAAG,MAAM,CAAC;QAC9D,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,iBAAiB,GAAG,iBAAiB,CAAC;IAC7C,CAAC;IAED,iBAAiB;QACf,MAAM,KAAK,GAAG,cAAc,CAAC,MAAM,EAAE,CAAC;QACtC,MAAM,MAAM,GAAG,eAAe,CAAC,MAAM,EAAE,CAAC;QACxC,MAAM,UAAU,GAAG,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC;QAC/D,OAAO;YACL,SAAS,EAAE,IAAI,CAAC,KAAK;YACrB,SAAS,EAAE,IAAI,CAAC,KAAK;YACrB,sBAAsB,EAAE,UAAU;YAClC,wBAAwB,EAAE,KAAK,CAAC,gBAAgB,EAAE;YAClD,yBAAyB,EAAE,MAAM,CAAC,gBAAgB,EAAE;YACpD,iBAAiB,EAAE,IAAI,CAAC,iBAAiB;SAC1C,CAAC;IACJ,CAAC;IAED,YAAY;QACV,OAAO,IAAI,YAAY,CAAC,IAAI,CAAC,iBAAiB,EAAE,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AAgB,EAAE;YACpD,iBAAiB,EAAE,IAAI,CAAC,iBAAiB;SAC1C,CAAC;IACJ,CAAC;IAED,YAAY;QACV,OAAO,IAAI,YAAY,CAAC,IAAI,CAAC,iBAAiB,EAAE,CAAC,CAAC;IACpD,CAAC;IAED,MAAM,CAAC,IAAI,CAAC,MAAmB;QAC7B,OAAO,IAAI,KAAK,CAAC,MAAM,CAAC,CAAC;IAC3B,CAAC;CACF"}
@@ -1,11 +1,11 @@
1
1
  import { UpdateCommand, type UpdateCommandInput } from "@aws-sdk/lib-dynamodb";
2
2
  import type { Attributes } from "../types.js";
3
- import { type Condition, type UpdateExpressionParams } from "./expressions/index.js";
3
+ import { type ConditionParams, type UpdateExpressionParams } from "./expressions/index.js";
4
4
  import type { Command } from "./types.js";
5
5
  export interface UpdateItemParams {
6
6
  table: string;
7
7
  key: Attributes;
8
- condition?: Condition;
8
+ condition?: ConditionParams;
9
9
  update: UpdateExpressionParams;
10
10
  }
11
11
  export declare class UpdateItem implements Command<UpdateCommandInput, UpdateCommand> {
@@ -1,6 +1,7 @@
1
1
  import { UpdateCommand } from "@aws-sdk/lib-dynamodb";
2
2
  import { AttributeNames } from "./attributes/names.js";
3
3
  import { AttributeValues } from "./attributes/values.js";
4
+ import { conditionExpression } from "./expressions/condition/expression.js";
4
5
  import { UpdateExpression, } from "./expressions/index.js";
5
6
  export class UpdateItem {
6
7
  params;
@@ -29,7 +30,10 @@ export class UpdateItem {
29
30
  }
30
31
  // Otherwise, we need to stringify the condition, reusing the same names and values
31
32
  // as before.
32
- input.ConditionExpression = condition.stringify({ names, values });
33
+ input.ConditionExpression = conditionExpression(condition).stringify({
34
+ names,
35
+ values,
36
+ });
33
37
  input.ExpressionAttributeNames = names.getSubstitutions();
34
38
  input.ExpressionAttributeValues = values.getSubstitutions();
35
39
  return input;
@@ -1 +1 @@
1
- {"version":3,"file":"update-item.js","sourceRoot":"","sources":["../../../src/commands/update-item.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,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C;QACtC,IAAI,SAAS,IAAI,IAAI,EAAE,CAAC;YACtB,KAAK,CAAC,wBAAwB,GAAG,KAAK,CAAC,gBAAgB,EAAE,CAAC;YAC1D,KAAK,CAAC,yBAAyB,GAAG,MAAM,CAAC,gBAAgB,EAAE,CAAC;YAC5D,OAAO,KAAK,CAAC;QACf,CAAC;QAED,mFAAmF;QACnF,aAAa;QACb,KAAK,CAAC,mBAAmB,GAAG,mBAAmB,CAAC,SAAS,CAAC,CAAC,SAAS,CAAC;YACnE,KAAK;YACL,MAAM;SACP,CAAC,CAAC;QACH,KAAK,CAAC,wBAAwB,GAAG,KAAK,CAAC,gBAAgB,EAAE,CAAC;QAC1D,KAAK,CAAC,yBAAyB,GAAG,MAAM,CAAC,gBAAgB,EAAE,CAAC;QAC5D,OAAO,KAAK,CAAC;IACf,CAAC;IAED,YAAY;QACV,OAAO,IAAI,aAAa,CAAC,IAAI,CAAC,iBAAiB,EAAE,CAAC,CAAC;IACrD,CAAC;IAED,MAAM,CAAC,IAAI,CAAC,MAAwB;QAClC,OAAO,IAAI,UAAU,CAAC,MAAM,CAAC,CAAC;IAChC,CAAC;CACF"}
@@ -1,3 +1,5 @@
1
+ export type NativeType = "B" | "BS" | "BOOL" | "L" | "M" | "N" | "NS" | "NULL" | "S" | "SS";
2
+ export declare const NATIVE_TYPES: readonly ["B", "BS", "BOOL", "L", "M", "N", "NS", "NULL", "S", "SS"];
1
3
  export type NativeBinary = Buffer;
2
4
  export type NativeBinarySet = Set<NativeBinary>;
3
5
  export type NativeBoolean = boolean;
@@ -30,10 +32,9 @@ export type AttributeName = string;
30
32
  * @see AttributeName
31
33
  */
32
34
  export type AttributePath = AttributeName;
33
- export type AttributeType = "S" | "N" | "B" | "BOOL" | "NULL" | "M" | "L" | "SS" | "NS" | "BS";
34
35
  export type AttributeValue = NativeBinary | NativeBinarySet | NativeBoolean | NativeList | NativeMap | NativeNull | NativeNumber | NativeNumberSet | NativeSet | NativeString | NativeStringSet;
35
36
  export type Attributes = Record<AttributeName, AttributeValue>;
36
- export type IndexAttributeType = Extract<AttributeType, "B" | "N" | "S">;
37
+ export type IndexAttributeType = Extract<NativeType, "B" | "N" | "S">;
37
38
  export interface IndexAttributeDefinition {
38
39
  name: string;
39
40
  type: IndexAttributeType;
package/lib/esm/types.js CHANGED
@@ -1,2 +1,13 @@
1
- export {};
1
+ export const NATIVE_TYPES = [
2
+ "B",
3
+ "BS",
4
+ "BOOL",
5
+ "L",
6
+ "M",
7
+ "N",
8
+ "NS",
9
+ "NULL",
10
+ "S",
11
+ "SS",
12
+ ];
2
13
  //# sourceMappingURL=types.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAYA,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,GAAG;IACH,IAAI;IACJ,MAAM;IACN,GAAG;IACH,GAAG;IACH,GAAG;IACH,IAAI;IACJ,MAAM;IACN,GAAG;IACH,IAAI;CACI,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@infra-blocks/aws-dynamodb",
3
- "version": "0.26.0-alpha.0",
3
+ "version": "0.27.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,7 +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.4.0",
48
- "@infra-blocks/types": "^0.10.0",
48
+ "@infra-blocks/types": "^0.13.1",
49
49
  "@types/mocha": "^10.0.10",
50
50
  "@types/node": "^24.0.10",
51
51
  "c8": "^10.1.3",
@@ -1,224 +0,0 @@
1
- import type { AttributeType } from "../../types.js";
2
- import type { AttributeNames } from "../attributes/names.js";
3
- import type { AttributeValues } from "../attributes/values.js";
4
- import type { IExpression } from "./expression.js";
5
- import { type IOperand, type Operand, PathOperand, type ValueOperand } from "./operands/index.js";
6
- export type ConditionOperand = Operand | SizeOperand;
7
- export type Stringifier = (params: {
8
- names: AttributeNames;
9
- values: AttributeValues;
10
- }) => string;
11
- export interface ConditionParams {
12
- stringify: Stringifier;
13
- }
14
- export declare class Condition implements IExpression {
15
- private readonly stringifier;
16
- private constructor();
17
- stringify(params: {
18
- names: AttributeNames;
19
- values: AttributeValues;
20
- }): string;
21
- /**
22
- * Returns a condition that combines this one with the provided condition using the `AND` operator.
23
- *
24
- * @param other - The other condition to combine with this one.
25
- *
26
- * @returns A {@link Condition} that evaluates to true only if both conditions evaluate to true.
27
- *
28
- * @see https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.OperatorsAndFunctions.html#Expressions.OperatorsAndFunctions.LogicalEvaluations
29
- */
30
- and(other: Condition): Condition;
31
- /**
32
- * Returns a condition that combines this one with the provided condition using the `OR` operator.
33
- *
34
- * @param other - The other condition to combine with this one.
35
- *
36
- * @returns A {@link Condition} that evaluates to true if any conditions evaluate to true.
37
- *
38
- * @see https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.OperatorsAndFunctions.html#Expressions.OperatorsAndFunctions.LogicalEvaluations
39
- */
40
- or(other: Condition): Condition;
41
- /**
42
- * Factory method to create a new {@link Condition} instance.
43
- *
44
- * This is not meant to be called outside this package.
45
- *
46
- * @param params - The parameters to create the condition.
47
- *
48
- * @returns A new {@link Condition} instance.
49
- */
50
- static from(params: ConditionParams): Condition;
51
- }
52
- /**
53
- * Negates the provided condition using the `NOT` operator.
54
- *
55
- * @param inner - The condition to negate.
56
- *
57
- * @returns A {@link Condition} that evaluates to the opposite of what the provided condition evaluates to.
58
- *
59
- * @see https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.OperatorsAndFunctions.html#Expressions.OperatorsAndFunctions.LogicalEvaluations
60
- */
61
- export declare function not(inner: Condition): Condition;
62
- export declare class OperandConditionBuilder<T extends Operand> {
63
- protected readonly operand: T;
64
- constructor(operand: T);
65
- /**
66
- * Returns a condition that uses the `begins_with` function.
67
- *
68
- * @param rhs - The right hand side operand.
69
- *
70
- * @returns A {@link Condition} that evaluates to true if this operand begins with the provided one.
71
- *
72
- * @see https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.OperatorsAndFunctions.html#Expressions.OperatorsAndFunctions.Functions
73
- */
74
- beginsWith(rhs: Operand<string>): Condition;
75
- /**
76
- * Returns a condition that uses the `BETWEEN` operator.
77
- *
78
- * Both bounds are inclusive, meaning that the returned condition corresponds to `lower <= this <= upper`.
79
- *
80
- * @param lower - The lower inclusive bound of the range.
81
- * @param upper - The upper inclusive bound of the range.
82
- *
83
- * @returns A {@link Condition} that evaluates to true if this operand is within the provided bounds.
84
- *
85
- * @see https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.OperatorsAndFunctions.html#Expressions.OperatorsAndFunctions.Comparators
86
- */
87
- between(lower: ConditionOperand, upper: ConditionOperand): Condition;
88
- /**
89
- * Returns a condition that uses the `contains` function.
90
- *
91
- * @param rhs - The right hand side operand.
92
- *
93
- * @returns A {@link Condition} that evaluates to true if this operand contains the provided one.
94
- *
95
- * @see https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.OperatorsAndFunctions.html#Expressions.OperatorsAndFunctions.Functions
96
- */
97
- contains(rhs: ConditionOperand): Condition;
98
- /**
99
- * Returns a condition that uses the `=` operator.
100
- *
101
- * @param rhs - The right hand side operand.
102
- *
103
- * @returns A {@link Condition} that evaluates to true if this operand is equal to the provided one.
104
- *
105
- * @see https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.OperatorsAndFunctions.html#Expressions.OperatorsAndFunctions.Comparators
106
- */
107
- equals(rhs: ConditionOperand): Condition;
108
- /**
109
- * An alias for {@link equals}.
110
- */
111
- eq: (rhs: ConditionOperand) => Condition;
112
- /**
113
- * Returns a condition that uses the `>` operator.
114
- *
115
- * @param rhs - The right hand side operand.
116
- *
117
- * @returns A {@link Condition} that evaluates to true if this operand is greater than the provided one.
118
- *
119
- * @see https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.OperatorsAndFunctions.html#Expressions.OperatorsAndFunctions.Comparators
120
- */
121
- greaterThan(rhs: ConditionOperand): Condition;
122
- /**
123
- * An alias for {@link greaterThan}.
124
- */
125
- gt: (rhs: ConditionOperand) => Condition;
126
- /**
127
- * Returns a condition that uses the `>=` operator.
128
- *
129
- * @param rhs - The right hand side operand.
130
- *
131
- * @returns A {@link Condition} that evaluates to true if this operand is greater than or equal to the provided one.
132
- *
133
- * @see https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.OperatorsAndFunctions.html#Expressions.OperatorsAndFunctions.Comparators
134
- */
135
- greaterThanOrEquals(rhs: ConditionOperand): Condition;
136
- /**
137
- * An alias for {@link greaterThanOrEquals}
138
- */
139
- gte: (rhs: ConditionOperand) => Condition;
140
- /**
141
- * Returns a condition that uses the `IN` operator.
142
- *
143
- * @param operands - The list of operands to check against. This function throws if the list is
144
- * empty or contains more than 100 operands.
145
- *
146
- * @returns A {@link Condition} that evaluates to true if this operand is equal to any of the provided ones.
147
- *
148
- * @see https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.OperatorsAndFunctions.html#Expressions.OperatorsAndFunctions.Comparators
149
- */
150
- in(...operands: ConditionOperand[]): Condition;
151
- /**
152
- * Returns a condition that uses the `<` operator
153
- *
154
- * @param rhs - The right hand side operand.
155
- *
156
- * @returns A {@link Condition} that evaluates to true if this operand is lower than the provided one.
157
- *
158
- * @see https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.OperatorsAndFunctions.html#Expressions.OperatorsAndFunctions.Comparators
159
- */
160
- lowerThan(rhs: ConditionOperand): Condition;
161
- /**
162
- * An alias for {@link lowerThan}.
163
- */
164
- lt: (rhs: ConditionOperand) => Condition;
165
- /**
166
- * Returns a condition that uses the `<=` operator.
167
- *
168
- * @param rhs - The right hand side operand.
169
- *
170
- * @returns A {@link Condition} that evaluates to true if this operand is lower than or equal to the provided one.
171
- *
172
- * @see https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.OperatorsAndFunctions.html#Expressions.OperatorsAndFunctions.Comparators
173
- */
174
- lowerThanOrEquals(rhs: ConditionOperand): Condition;
175
- /**
176
- * An alias for {@link lowerThanOrEquals}
177
- */
178
- lte: (rhs: ConditionOperand) => Condition;
179
- /**
180
- * Returns a condition that uses the `<>` operator.
181
- *
182
- * @param rhs - The right hand side operand.
183
- *
184
- * @returns A {@link Condition} that evaluates to true if this operand is not equal to the provided one.
185
- *
186
- * @see https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.OperatorsAndFunctions.html#Expressions.OperatorsAndFunctions.Comparators
187
- */
188
- notEquals(rhs: ConditionOperand): Condition;
189
- /**
190
- * An alias for {@link notEquals}.
191
- */
192
- ne: (rhs: ConditionOperand) => Condition;
193
- protected substitute(params: {
194
- names: AttributeNames;
195
- values: AttributeValues;
196
- }): string;
197
- }
198
- export declare class AttributeConditionBuilder extends OperandConditionBuilder<PathOperand> {
199
- /**
200
- * @returns A {@link Condition} that evaluates to true if the provided attribute path exists.
201
- */
202
- exists(): Condition;
203
- /**
204
- * @returns A {@link Condition} that evaluates to true if the provided attribute path does not exist.
205
- */
206
- notExists(): Condition;
207
- /**
208
- * @param type - The type to check against.
209
- * @returns A {@link Condition} that evaluates to true if there exists an attribute at
210
- * the provided path of the given type.
211
- */
212
- isType(type: ValueOperand<AttributeType>): Condition;
213
- }
214
- export declare function where(attrribute: PathOperand): AttributeConditionBuilder;
215
- export declare function where(operand: Exclude<Operand, PathOperand>): OperandConditionBuilder<Exclude<Operand, PathOperand>>;
216
- export declare class SizeOperand implements IOperand {
217
- private readonly inner;
218
- constructor(operand: Operand);
219
- substitute(params: {
220
- names: AttributeNames;
221
- values: AttributeValues;
222
- }): string;
223
- }
224
- export declare function size(operand: Operand): SizeOperand;