@ftschopp/dynatable-core 1.6.0 → 1.6.1
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/CHANGELOG.md +7 -0
- package/dist/builders/delete/types.d.ts +12 -2
- package/dist/builders/delete/types.d.ts.map +1 -1
- package/dist/builders/put/types.d.ts +12 -2
- package/dist/builders/put/types.d.ts.map +1 -1
- package/dist/builders/update/types.d.ts +12 -2
- package/dist/builders/update/types.d.ts.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
## @ftschopp/dynatable-core [1.6.1](https://github.com/ftschopp/dynatable/compare/@ftschopp/dynatable-core@1.6.0...@ftschopp/dynatable-core@1.6.1) (2026-05-10)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* **core:** preserve concrete builder type through where(), unblock IDE typecheck on tests ([#45](https://github.com/ftschopp/dynatable/issues/45)) ([fb98553](https://github.com/ftschopp/dynatable/commit/fb98553684943291f6d500200bb4b7d32e2fa613))
|
|
7
|
+
|
|
1
8
|
# @ftschopp/dynatable-core [1.6.0](https://github.com/ftschopp/dynatable/compare/@ftschopp/dynatable-core@1.5.2...@ftschopp/dynatable-core@1.6.0) (2026-05-10)
|
|
2
9
|
|
|
3
10
|
|
|
@@ -1,9 +1,19 @@
|
|
|
1
1
|
import type { DeleteCommandInput } from '@aws-sdk/lib-dynamodb';
|
|
2
|
-
import { OperationBuilder } from '../shared';
|
|
2
|
+
import { OperationBuilder, AttrBuilder, OpBuilder, Condition } from '../shared';
|
|
3
3
|
/**
|
|
4
4
|
* Builder interface for DynamoDB DeleteItem operations
|
|
5
5
|
*/
|
|
6
|
-
export interface DeleteBuilder<Model> extends Omit<OperationBuilder<Model>, 'dbParams'> {
|
|
6
|
+
export interface DeleteBuilder<Model> extends Omit<OperationBuilder<Model>, 'dbParams' | 'where'> {
|
|
7
|
+
/**
|
|
8
|
+
* Adds a condition expression to the delete operation. Returns a new
|
|
9
|
+
* immutable builder.
|
|
10
|
+
*
|
|
11
|
+
* Override of `OperationBuilder.where(): this` because `Omit<>` doesn't
|
|
12
|
+
* preserve `this`-polymorphism — chains like `.where(...).returning(...)`
|
|
13
|
+
* would otherwise widen to `OperationBuilder<Model>` and lose the
|
|
14
|
+
* delete-specific methods.
|
|
15
|
+
*/
|
|
16
|
+
where(fn: (attr: AttrBuilder<Model>, op: OpBuilder) => Condition): DeleteBuilder<Model>;
|
|
7
17
|
/**
|
|
8
18
|
* Configures what values should be returned after the delete operation
|
|
9
19
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/builders/delete/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAChE,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/builders/delete/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAChE,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAEhF;;GAEG;AACH,MAAM,WAAW,aAAa,CAAC,KAAK,CAAE,SAAQ,IAAI,CAAC,gBAAgB,CAAC,KAAK,CAAC,EAAE,UAAU,GAAG,OAAO,CAAC;IAC/F;;;;;;;;OAQG;IACH,KAAK,CAAC,EAAE,EAAE,CAAC,IAAI,EAAE,WAAW,CAAC,KAAK,CAAC,EAAE,EAAE,EAAE,SAAS,KAAK,SAAS,GAAG,aAAa,CAAC,KAAK,CAAC,CAAC;IAExF;;OAEG;IACH,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,aAAa,CAAC,KAAK,CAAC,CAAC;IAE1D;;;;;;;OAOG;IACH,sBAAsB,CAAC,IAAI,EAAE,SAAS,GAAG,OAAO,GAAG,MAAM,GAAG,aAAa,CAAC,KAAK,CAAC,CAAC;IAEjF;;OAEG;IACH,QAAQ,IAAI,kBAAkB,CAAC;CAChC"}
|
|
@@ -1,9 +1,19 @@
|
|
|
1
1
|
import type { PutCommandInput } from '@aws-sdk/lib-dynamodb';
|
|
2
|
-
import { OperationBuilder } from '../shared';
|
|
2
|
+
import { OperationBuilder, AttrBuilder, OpBuilder, Condition } from '../shared';
|
|
3
3
|
/**
|
|
4
4
|
* Builder interface for DynamoDB PutItem operations
|
|
5
5
|
*/
|
|
6
|
-
export interface PutBuilder<Model> extends Omit<OperationBuilder<Model>, 'dbParams'> {
|
|
6
|
+
export interface PutBuilder<Model> extends Omit<OperationBuilder<Model>, 'dbParams' | 'where'> {
|
|
7
|
+
/**
|
|
8
|
+
* Adds a condition expression to the put operation. Returns a new
|
|
9
|
+
* immutable builder.
|
|
10
|
+
*
|
|
11
|
+
* Override of `OperationBuilder.where(): this` because `Omit<>` doesn't
|
|
12
|
+
* preserve `this`-polymorphism — chains like `.where(...).ifNotExists()`
|
|
13
|
+
* would otherwise widen to `OperationBuilder<Model>` and lose the
|
|
14
|
+
* put-specific methods.
|
|
15
|
+
*/
|
|
16
|
+
where(fn: (attr: AttrBuilder<Model>, op: OpBuilder) => Condition): PutBuilder<Model>;
|
|
7
17
|
/**
|
|
8
18
|
* Adds a condition that the item must not exist (checks pk and sk)
|
|
9
19
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/builders/put/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/builders/put/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAEhF;;GAEG;AACH,MAAM,WAAW,UAAU,CAAC,KAAK,CAAE,SAAQ,IAAI,CAAC,gBAAgB,CAAC,KAAK,CAAC,EAAE,UAAU,GAAG,OAAO,CAAC;IAC5F;;;;;;;;OAQG;IACH,KAAK,CAAC,EAAE,EAAE,CAAC,IAAI,EAAE,WAAW,CAAC,KAAK,CAAC,EAAE,EAAE,EAAE,SAAS,KAAK,SAAS,GAAG,UAAU,CAAC,KAAK,CAAC,CAAC;IAErF;;OAEG;IACH,WAAW,IAAI,UAAU,CAAC,KAAK,CAAC,CAAC;IAEjC;;;;OAIG;IACH,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,UAAU,CAAC,KAAK,CAAC,CAAC;IAEvD;;;;;;;;OAQG;IACH,sBAAsB,CAAC,IAAI,EAAE,SAAS,GAAG,OAAO,GAAG,MAAM,GAAG,UAAU,CAAC,KAAK,CAAC,CAAC;IAE9E;;OAEG;IACH,QAAQ,IAAI,eAAe,CAAC;CAC7B"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { UpdateCommandInput } from '@aws-sdk/lib-dynamodb';
|
|
2
2
|
import { ModelDefinition } from '../../core/types';
|
|
3
|
-
import { OperationBuilder, AttrRef } from '../shared';
|
|
3
|
+
import { OperationBuilder, AttrRef, AttrBuilder, OpBuilder, Condition } from '../shared';
|
|
4
4
|
/**
|
|
5
5
|
* Update actions that can be performed on attributes
|
|
6
6
|
*/
|
|
@@ -24,7 +24,17 @@ export type IndexContext = {
|
|
|
24
24
|
/**
|
|
25
25
|
* Builder interface for DynamoDB UpdateItem operations
|
|
26
26
|
*/
|
|
27
|
-
export interface UpdateBuilder<Model> extends Omit<OperationBuilder<Model>, 'dbParams'> {
|
|
27
|
+
export interface UpdateBuilder<Model> extends Omit<OperationBuilder<Model>, 'dbParams' | 'where'> {
|
|
28
|
+
/**
|
|
29
|
+
* Adds a condition expression to the update operation. Returns a new
|
|
30
|
+
* immutable builder.
|
|
31
|
+
*
|
|
32
|
+
* Override of `OperationBuilder.where(): this` because `Omit<>` doesn't
|
|
33
|
+
* preserve `this`-polymorphism — chains like `.where(...).set(...)` or
|
|
34
|
+
* `.where(...).returning(...)` would otherwise widen to
|
|
35
|
+
* `OperationBuilder<Model>` and lose the update-specific methods.
|
|
36
|
+
*/
|
|
37
|
+
where(fn: (attr: AttrBuilder<Model>, op: OpBuilder) => Condition): UpdateBuilder<Model>;
|
|
28
38
|
/**
|
|
29
39
|
* Sets an attribute to a specific value, or sets multiple attributes at once
|
|
30
40
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/builders/update/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAChE,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/builders/update/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAChE,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,gBAAgB,EAAE,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAEzF;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG;IACzB,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC/B,MAAM,CAAC,EAAE,MAAM,C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