@infra-blocks/aws-dynamodb 0.30.0-alpha.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.
- package/lib/cjs/commands/expressions/update/if-not-exists.d.ts +4 -3
- package/lib/cjs/commands/expressions/update/if-not-exists.js +4 -5
- package/lib/cjs/commands/expressions/update/if-not-exists.js.map +1 -1
- package/lib/cjs/commands/expressions/update/set.d.ts +2 -2
- package/lib/esm/commands/expressions/update/if-not-exists.d.ts +4 -3
- package/lib/esm/commands/expressions/update/if-not-exists.js +2 -3
- package/lib/esm/commands/expressions/update/if-not-exists.js.map +1 -1
- package/lib/esm/commands/expressions/update/set.d.ts +2 -2
- package/package.json +1 -1
|
@@ -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
|
|
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):
|
|
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.
|
|
3
|
+
exports.IfNotExists = void 0;
|
|
4
4
|
exports.ifNotExists = ifNotExists;
|
|
5
5
|
const path_js_1 = require("../operands/path.js");
|
|
6
|
-
|
|
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.
|
|
19
|
+
exports.IfNotExists = IfNotExists;
|
|
21
20
|
function ifNotExists(rawPath, defaultValue) {
|
|
22
21
|
const path = path_js_1.Path.normalize(rawPath);
|
|
23
|
-
return new
|
|
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":";;;
|
|
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 {
|
|
8
|
-
export type SetOperand = Operand |
|
|
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
|
|
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):
|
|
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
|
-
|
|
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
|
|
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":"
|
|
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 {
|
|
8
|
-
export type SetOperand = Operand |
|
|
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 = {
|