@goatlab/fluent-firebase 0.7.3 → 0.7.4

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.
File without changes
package/dist/Firebase.js CHANGED
File without changes
@@ -21,7 +21,7 @@ export declare class FirebaseConnector<ModelDTO = AnyObject, InputDTO = ModelDTO
21
21
  rawFirebase(): admin.firestore.Firestore;
22
22
  protected loadRelatedData(data: any[], loadedKeys: AnyObject): Promise<admin.firestore.DocumentData[]>;
23
23
  findMany<T extends FluentQuery<ModelDTO>>(query?: T): Promise<QueryOutput<T, ModelDTO, OutputDTO>>;
24
- loadFirst(query?: FluentQuery<ModelDTO>): FirebaseConnector<ModelDTO, InputDTO, OutputDTO>;
24
+ loadFirst(query?: FluentQuery<ModelDTO>): LoadedResult<this>;
25
25
  private getGeneratedQueries;
26
26
  private getFirebaseWhereQuery;
27
27
  updateById(id: string, data: InputDTO): Promise<OutputDTO>;
@@ -122,13 +122,16 @@ class FirebaseConnector extends fluent_2.BaseConnector {
122
122
  return this.outputSchema?.array().parse(found);
123
123
  }
124
124
  loadFirst(query) {
125
- const detachedClass = Object.assign(Object.create(Object.getPrototypeOf(this)), this);
126
- detachedClass.setRelatedQuery({
125
+ const newInstance = this.clone();
126
+ newInstance.setRelatedQuery({
127
127
  entity: this.entity,
128
128
  repository: this,
129
- query
129
+ query: {
130
+ ...query,
131
+ limit: 1
132
+ }
130
133
  });
131
- return detachedClass;
134
+ return newInstance;
132
135
  }
133
136
  getGeneratedQueries(query) {
134
137
  let { andWhere, orWhere } = this.getFirebaseWhereQuery(query?.where);
File without changes
File without changes
package/dist/index.d.ts CHANGED
File without changes
package/dist/index.js CHANGED
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes