inanis 0.0.7-beta.16 → 0.0.7-beta.18

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.
@@ -256,10 +256,12 @@ export class DynamoDbTable {
256
256
  '#updatedAt': 'updatedAt'
257
257
  };
258
258
  for (let key in data) {
259
- let [mode, value] = data[key];
260
- ExpressionAttributeValues[`:${key}`] = value;
261
- ExpressionAttributeNames[`#${key}`] = key;
262
- UpdateExpressions.push(`#${key} = #${key} ${mode} :${key}`);
259
+ if (data[key] != null) {
260
+ let [mode, value] = data[key];
261
+ ExpressionAttributeValues[`:${key}`] = value;
262
+ ExpressionAttributeNames[`#${key}`] = key;
263
+ UpdateExpressions.push(`#${key} = #${key} ${mode} :${key}`);
264
+ }
263
265
  }
264
266
  await service.update({
265
267
  TableName: this.tableName,
@@ -279,7 +281,8 @@ export class DynamoDbTable {
279
281
  '#updatedAt': 'updatedAt'
280
282
  };
281
283
  for (let key in data) {
282
- ExpressionAttributeValues[`:${key}`] = data[key];
284
+ const value = data[key] == null ? null : data[key];
285
+ ExpressionAttributeValues[`:${key}`] = value;
283
286
  ExpressionAttributeNames[`#${key}`] = key;
284
287
  UpdateExpressions.push(`#${key} = :${key}`);
285
288
  }
@@ -304,7 +307,8 @@ export class DynamoDbTable {
304
307
  '#updatedAt': 'updatedAt'
305
308
  };
306
309
  for (let key in data) {
307
- ExpressionAttributeValues[`:${key}`] = data[key];
310
+ const value = data[key] == null ? null : data[key];
311
+ ExpressionAttributeValues[`:${key}`] = value;
308
312
  ExpressionAttributeNames[`#${key}`] = key;
309
313
  UpdateExpressions.push(`#${key} = :${key}`);
310
314
  }
@@ -58,6 +58,8 @@ export declare class DataModel<T extends DataModelConfig<any, any, any>, D exten
58
58
  data: D;
59
59
  constructor(config: T, data: T['_initData']);
60
60
  getPublic(): Pick<D, PublicKey>;
61
+ getCreateAt(): any;
62
+ getUpdateAt(): any;
61
63
  copy(): this;
62
64
  from(source: Partial<D> | DataModel<T, D, PublicKey>): void;
63
65
  save(reader?: (_data: D) => Partial<D>): Promise<void>;
@@ -96,6 +96,12 @@ export class DataModel {
96
96
  }
97
97
  return output;
98
98
  }
99
+ getCreateAt() {
100
+ return this.data.createdAt;
101
+ }
102
+ getUpdateAt() {
103
+ return this.data.updatedAt;
104
+ }
99
105
  copy() {
100
106
  const newData = structuredClone(this.data);
101
107
  const model = new DataModel(this._config, newData);
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "inanis",
3
3
  "type": "module",
4
- "version": "0.0.7-beta.16",
4
+ "version": "0.0.7-beta.18",
5
5
  "description": "Micro Service Best Tools.",
6
6
  "main": "./dist/index.js",
7
7
  "scripts": {
8
8
  "test": "nyc mocha ./lib/**/*.test.ts ./lib/*.test.ts",
9
9
  "build": "eslint 'src/**/*.{ts,tsx}' --fix && tsc",
10
- "deploy": "ts-node ./deploy.ts"
10
+ "deploy": "esno ./deploy.ts"
11
11
  },
12
12
  "bin": {
13
13
  "ms-be-lib": "cli/index.js"
@@ -36,13 +36,13 @@
36
36
  "cross-env": "^10.0.0",
37
37
  "debug": "^4.4.1",
38
38
  "eslint": "^9.32.0",
39
+ "esno": "^4.8.0",
39
40
  "mocha": "^11.7.1",
40
41
  "nyc": "^17.1.0",
41
42
  "openapi-types": "^12.1.3",
42
43
  "semver": "^7.7.2",
43
44
  "supports-color": "^10.0.0",
44
45
  "ts-loader": "^9.5.2",
45
- "ts-node": "^10.9.2",
46
46
  "typescript": "^5.8.3",
47
47
  "typescript-eslint": "^8.38.0"
48
48
  },
@@ -77,4 +77,4 @@
77
77
  "zod": "^4.2.1"
78
78
  },
79
79
  "packageManager": "yarn@4.1.1"
80
- }
80
+ }