@travetto/model-firestore 5.0.0-rc.7 → 5.0.0-rc.9

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.
Files changed (2) hide show
  1. package/package.json +5 -5
  2. package/src/service.ts +3 -4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@travetto/model-firestore",
3
- "version": "5.0.0-rc.7",
3
+ "version": "5.0.0-rc.9",
4
4
  "description": "Firestore backing for the travetto model module.",
5
5
  "keywords": [
6
6
  "typescript",
@@ -26,12 +26,12 @@
26
26
  },
27
27
  "dependencies": {
28
28
  "@google-cloud/firestore": "^7.9.0",
29
- "@travetto/runtime": "^5.0.0-rc.7",
30
- "@travetto/config": "^5.0.0-rc.7",
31
- "@travetto/model": "^5.0.0-rc.7"
29
+ "@travetto/runtime": "^5.0.0-rc.9",
30
+ "@travetto/config": "^5.0.0-rc.9",
31
+ "@travetto/model": "^5.0.0-rc.9"
32
32
  },
33
33
  "peerDependencies": {
34
- "@travetto/command": "^5.0.0-rc.7"
34
+ "@travetto/command": "^5.0.0-rc.9"
35
35
  },
36
36
  "peerDependenciesMeta": {
37
37
  "@travetto/command": {
package/src/service.ts CHANGED
@@ -1,10 +1,10 @@
1
- import { DocumentData, FieldValue, Firestore, PartialWithFieldValue, Query, UpdateData } from '@google-cloud/firestore';
1
+ import { DocumentData, FieldValue, Firestore, PartialWithFieldValue, Query } from '@google-cloud/firestore';
2
2
 
3
3
  import { ShutdownManager, type Class, type DeepPartial } from '@travetto/runtime';
4
4
  import { Injectable } from '@travetto/di';
5
5
  import {
6
6
  ModelCrudSupport, ModelRegistry, ModelStorageSupport,
7
- ModelIndexedSupport, ModelType, NotFoundError, OptionalId
7
+ ModelIndexedSupport, ModelType, NotFoundError, OptionalId,
8
8
  } from '@travetto/model';
9
9
 
10
10
  import { ModelCrudUtil } from '@travetto/model/src/internal/service/crud';
@@ -74,8 +74,7 @@ export class FirestoreModelService implements ModelCrudSupport, ModelStorageSupp
74
74
  async update<T extends ModelType>(cls: Class<T>, item: T): Promise<T> {
75
75
  ModelCrudUtil.ensureNotSubType(cls);
76
76
  const prepped = await ModelCrudUtil.preStore(cls, item, this);
77
- // eslint-disable-next-line @typescript-eslint/consistent-type-assertions
78
- await this.#getCollection(cls).doc(item.id).update(clone(prepped) as unknown as UpdateData<DocumentData>);
77
+ await this.#getCollection(cls).doc(item.id).update(clone<DocumentData>(prepped));
79
78
  return prepped;
80
79
  }
81
80