@ftschopp/dynatable-core 2.3.0 → 2.3.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 CHANGED
@@ -1,3 +1,10 @@
1
+ ## @ftschopp/dynatable-core [2.3.1](https://github.com/ftschopp/dynatable/compare/@ftschopp/dynatable-core@2.3.0...@ftschopp/dynatable-core@2.3.1) (2026-06-05)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **core:** stamp _type discriminator on update() so upserts stay visible ([#59](https://github.com/ftschopp/dynatable/issues/59)) ([f5f6116](https://github.com/ftschopp/dynatable/commit/f5f61163c61f298fc45dbf2a32dd7352b5231976))
7
+
1
8
  # @ftschopp/dynatable-core [2.3.0](https://github.com/ftschopp/dynatable/compare/@ftschopp/dynatable-core@2.2.1...@ftschopp/dynatable-core@2.3.0) (2026-06-03)
2
9
 
3
10
 
@@ -1 +1 @@
1
- {"version":3,"file":"create-entity-api.d.ts","sourceRoot":"","sources":["../../src/entity/create-entity-api.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AActF,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAMtD;;;;;;;;;GASG;AACH,eAAO,MAAM,eAAe,GAAI,KAAK,SAAS,eAAe,EAC3D,WAAW,MAAM,EACjB,WAAW,MAAM,EACjB,OAAO,KAAK,EACZ,QAAQ,cAAc,EACtB,UAAS,gBAAqB,KAC7B,SAAS,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE,UAAU,CAAC,KAAK,CAAC,EAAE,aAAa,CAAC,KAAK,CAAC,CA0OtE,CAAC"}
1
+ {"version":3,"file":"create-entity-api.d.ts","sourceRoot":"","sources":["../../src/entity/create-entity-api.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AActF,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAMtD;;;;;;;;;GASG;AACH,eAAO,MAAM,eAAe,GAAI,KAAK,SAAS,eAAe,EAC3D,WAAW,MAAM,EACjB,WAAW,MAAM,EACjB,OAAO,KAAK,EACZ,QAAQ,cAAc,EACtB,UAAS,gBAAqB,KAC7B,SAAS,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE,UAAU,CAAC,KAAK,CAAC,EAAE,aAAa,CAAC,KAAK,CAAC,CA6PtE,CAAC"}
@@ -100,7 +100,27 @@ const createEntityAPI = (tableName, modelName, model, client, options = {}) => {
100
100
  (0, key_validation_1.validateKeyFields)(modelName, model, key, 'update()');
101
101
  // Resolve any key defaults or computed keys
102
102
  const fullKey = (0, model_utils_1.resolveKeys)(model, key);
103
- const builder = (0, builders_1.createUpdateBuilder)(tableName, fullKey, client, [], { set: [], remove: [], add: [], delete: [] }, 'NONE', 0, timestamps, logger,
103
+ const builder = (0, builders_1.createUpdateBuilder)(tableName, fullKey, client, [],
104
+ // Seed a SET for the `_type` discriminator, mirroring how put() stamps
105
+ // it onto the item and how query()/scan() hand-write the `_type` filter.
106
+ // UpdateItem is an upsert — a create-via-update on a non-existent key
107
+ // would otherwise produce an item without `_type`, invisible to the
108
+ // type-filtered query()/scan(). The builder stays agnostic of `_type`:
109
+ // it just processes whatever actions it is handed. A fixed `:_type`
110
+ // placeholder keeps it out of the value-name counter so it never
111
+ // perturbs the numbering of the caller's own actions.
112
+ {
113
+ set: [
114
+ {
115
+ expression: '#_type = :_type',
116
+ names: { '#_type': '_type' },
117
+ values: { ':_type': modelName },
118
+ },
119
+ ],
120
+ remove: [],
121
+ add: [],
122
+ delete: [],
123
+ }, 'NONE', 0, timestamps, logger,
104
124
  // Carry the original template-vars-bearing key (e.g. { username: 'jane' })
105
125
  // so the builder can recompute index keys when .set() touches their template fields.
106
126
  { model, keyVars: key });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ftschopp/dynatable-core",
3
- "version": "2.3.0",
3
+ "version": "2.3.1",
4
4
  "description": "Core library for DynamoDB single table design",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",