@infra-blocks/aws-dynamodb 0.30.0 → 0.31.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.
@@ -1,17 +1,18 @@
1
+ import type { AttributeValue } from "../../../types.js";
1
2
  import type { AttributeNames } from "../../attributes/names.js";
2
3
  import type { AttributeValues } from "../../attributes/values.js";
3
4
  import { Path, type RawPath } from "../operands/path.js";
4
5
  import type { IOperand, Operand } from "../operands/type.js";
5
- export declare class IfNotExistsOperand implements IOperand {
6
+ export declare class IfNotExists<T extends AttributeValue = AttributeValue> implements IOperand {
6
7
  private readonly path;
7
8
  private readonly defaultValue;
8
9
  constructor(params: {
9
10
  path: Path;
10
- defaultValue: Operand;
11
+ defaultValue: Operand<T>;
11
12
  });
12
13
  substitute(params: {
13
14
  names: AttributeNames;
14
15
  values: AttributeValues;
15
16
  }): string;
16
17
  }
17
- export declare function ifNotExists(rawPath: RawPath, defaultValue: Operand): IfNotExistsOperand;
18
+ export declare function ifNotExists<T extends AttributeValue = AttributeValue>(rawPath: RawPath, defaultValue: Operand<T>): IfNotExists<T>;
@@ -1,10 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.IfNotExistsOperand = void 0;
3
+ exports.IfNotExists = void 0;
4
4
  exports.ifNotExists = ifNotExists;
5
5
  const path_js_1 = require("../operands/path.js");
6
- // TODO: generic type on this bitch.
7
- class IfNotExistsOperand {
6
+ class IfNotExists {
8
7
  path;
9
8
  defaultValue;
10
9
  constructor(params) {
@@ -17,9 +16,9 @@ class IfNotExistsOperand {
17
16
  return `if_not_exists(${this.path.substitute({ names })}, ${this.defaultValue.substitute({ names, values })})`;
18
17
  }
19
18
  }
20
- exports.IfNotExistsOperand = IfNotExistsOperand;
19
+ exports.IfNotExists = IfNotExists;
21
20
  function ifNotExists(rawPath, defaultValue) {
22
21
  const path = path_js_1.Path.normalize(rawPath);
23
- return new IfNotExistsOperand({ path, defaultValue });
22
+ return new IfNotExists({ path, defaultValue });
24
23
  }
25
24
  //# sourceMappingURL=if-not-exists.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"if-not-exists.js","sourceRoot":"","sources":["../../../../../src/commands/expressions/update/if-not-exists.ts"],"names":[],"mappings":";;;AAyBA,kCAMC;AA7BD,iDAAyD;AAGzD,oCAAoC;AACpC,MAAa,kBAAkB;IACZ,IAAI,CAAO;IACX,YAAY,CAAU;IAEvC,YAAY,MAA6C;QACvD,MAAM,EAAE,IAAI,EAAE,YAAY,EAAE,GAAG,MAAM,CAAC;QACtC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;IACnC,CAAC;IAED,UAAU,CAAC,MAGV;QACC,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC;QACjC,OAAO,iBAAiB,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,KAAK,EAAE,CAAC,KAAK,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,GAAG,CAAC;IACjH,CAAC;CACF;AAjBD,gDAiBC;AAED,SAAgB,WAAW,CACzB,OAAgB,EAChB,YAAqB;IAErB,MAAM,IAAI,GAAG,cAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;IACrC,OAAO,IAAI,kBAAkB,CAAC,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC,CAAC;AACxD,CAAC"}
1
+ {"version":3,"file":"if-not-exists.js","sourceRoot":"","sources":["../../../../../src/commands/expressions/update/if-not-exists.ts"],"names":[],"mappings":";;;AA2BA,kCAMC;AA9BD,iDAAyD;AAGzD,MAAa,WAAW;IAGL,IAAI,CAAO;IACX,YAAY,CAAa;IAE1C,YAAY,MAAgD;QAC1D,MAAM,EAAE,IAAI,EAAE,YAAY,EAAE,GAAG,MAAM,CAAC;QACtC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;IACnC,CAAC;IAED,UAAU,CAAC,MAGV;QACC,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC;QACjC,OAAO,iBAAiB,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,KAAK,EAAE,CAAC,KAAK,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,GAAG,CAAC;IACjH,CAAC;CACF;AAnBD,kCAmBC;AAED,SAAgB,WAAW,CACzB,OAAgB,EAChB,YAAwB;IAExB,MAAM,IAAI,GAAG,cAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;IACrC,OAAO,IAAI,WAAW,CAAC,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC,CAAC;AACjD,CAAC"}
@@ -4,8 +4,8 @@ import { Path, type RawPath } 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";
7
- import type { IfNotExistsOperand } from "./if-not-exists.js";
8
- export type SetOperand = Operand | IfNotExistsOperand;
7
+ import type { IfNotExists } from "./if-not-exists.js";
8
+ export type SetOperand = Operand | IfNotExists;
9
9
  export type SetOperator = "+" | "-";
10
10
  type SetActionParams = SetToParams | SetToExpressionParams;
11
11
  type SetToParams = {
@@ -1,17 +1,18 @@
1
+ import type { AttributeValue } from "../../../types.js";
1
2
  import type { AttributeNames } from "../../attributes/names.js";
2
3
  import type { AttributeValues } from "../../attributes/values.js";
3
4
  import { Path, type RawPath } from "../operands/path.js";
4
5
  import type { IOperand, Operand } from "../operands/type.js";
5
- export declare class IfNotExistsOperand implements IOperand {
6
+ export declare class IfNotExists<T extends AttributeValue = AttributeValue> implements IOperand {
6
7
  private readonly path;
7
8
  private readonly defaultValue;
8
9
  constructor(params: {
9
10
  path: Path;
10
- defaultValue: Operand;
11
+ defaultValue: Operand<T>;
11
12
  });
12
13
  substitute(params: {
13
14
  names: AttributeNames;
14
15
  values: AttributeValues;
15
16
  }): string;
16
17
  }
17
- export declare function ifNotExists(rawPath: RawPath, defaultValue: Operand): IfNotExistsOperand;
18
+ export declare function ifNotExists<T extends AttributeValue = AttributeValue>(rawPath: RawPath, defaultValue: Operand<T>): IfNotExists<T>;
@@ -1,6 +1,5 @@
1
1
  import { Path } from "../operands/path.js";
2
- // TODO: generic type on this bitch.
3
- export class IfNotExistsOperand {
2
+ export class IfNotExists {
4
3
  path;
5
4
  defaultValue;
6
5
  constructor(params) {
@@ -15,6 +14,6 @@ export class IfNotExistsOperand {
15
14
  }
16
15
  export function ifNotExists(rawPath, defaultValue) {
17
16
  const path = Path.normalize(rawPath);
18
- return new IfNotExistsOperand({ path, defaultValue });
17
+ return new IfNotExists({ path, defaultValue });
19
18
  }
20
19
  //# sourceMappingURL=if-not-exists.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"if-not-exists.js","sourceRoot":"","sources":["../../../../../src/commands/expressions/update/if-not-exists.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAgB,MAAM,qBAAqB,CAAC;AAGzD,oCAAoC;AACpC,MAAM,OAAO,kBAAkB;IACZ,IAAI,CAAO;IACX,YAAY,CAAU;IAEvC,YAAY,MAA6C;QACvD,MAAM,EAAE,IAAI,EAAE,YAAY,EAAE,GAAG,MAAM,CAAC;QACtC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;IACnC,CAAC;IAED,UAAU,CAAC,MAGV;QACC,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC;QACjC,OAAO,iBAAiB,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,KAAK,EAAE,CAAC,KAAK,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,GAAG,CAAC;IACjH,CAAC;CACF;AAED,MAAM,UAAU,WAAW,CACzB,OAAgB,EAChB,YAAqB;IAErB,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;IACrC,OAAO,IAAI,kBAAkB,CAAC,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC,CAAC;AACxD,CAAC"}
1
+ {"version":3,"file":"if-not-exists.js","sourceRoot":"","sources":["../../../../../src/commands/expressions/update/if-not-exists.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,IAAI,EAAgB,MAAM,qBAAqB,CAAC;AAGzD,MAAM,OAAO,WAAW;IAGL,IAAI,CAAO;IACX,YAAY,CAAa;IAE1C,YAAY,MAAgD;QAC1D,MAAM,EAAE,IAAI,EAAE,YAAY,EAAE,GAAG,MAAM,CAAC;QACtC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;IACnC,CAAC;IAED,UAAU,CAAC,MAGV;QACC,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC;QACjC,OAAO,iBAAiB,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,KAAK,EAAE,CAAC,KAAK,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,GAAG,CAAC;IACjH,CAAC;CACF;AAED,MAAM,UAAU,WAAW,CACzB,OAAgB,EAChB,YAAwB;IAExB,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;IACrC,OAAO,IAAI,WAAW,CAAC,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC,CAAC;AACjD,CAAC"}
@@ -4,8 +4,8 @@ import { Path, type RawPath } 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";
7
- import type { IfNotExistsOperand } from "./if-not-exists.js";
8
- export type SetOperand = Operand | IfNotExistsOperand;
7
+ import type { IfNotExists } from "./if-not-exists.js";
8
+ export type SetOperand = Operand | IfNotExists;
9
9
  export type SetOperator = "+" | "-";
10
10
  type SetActionParams = SetToParams | SetToExpressionParams;
11
11
  type SetToParams = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@infra-blocks/aws-dynamodb",
3
- "version": "0.30.0",
3
+ "version": "0.31.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",