akanjs 2.3.11-rc.0 → 2.3.11-rc.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/document/into.ts CHANGED
@@ -4,7 +4,7 @@ import type { DocumentModel, QueryOf } from "akanjs/constant";
4
4
  import type { FilterCls, FilterQueryOf, FilterSortOf, SchemaOf } from ".";
5
5
  import type { CacheDatabase, QueryMethodPart } from "./database";
6
6
  import type { DataLoader } from "./dataLoader";
7
- import type { DocumentUpdate, DocumentUpdateOptions } from "./documentQuery";
7
+ import type { DocumentQuery, DocumentUpdate, DocumentUpdateOptions } from "./documentQuery";
8
8
  import { type LoaderBuilder, type ModelCls, makeLoaderBuilder } from "./loaderInfo";
9
9
  import type { DocumentProjection } from "./types";
10
10
 
@@ -15,7 +15,7 @@ interface DefaultMdlStats<
15
15
  TDocument,
16
16
  TSchema,
17
17
  _Partial extends Partial<TSchema> = Partial<TSchema>,
18
- _FilterQuery extends QueryOf<TSchema> = QueryOf<TSchema>,
18
+ _FilterQuery extends DocumentQuery<TSchema> = DocumentQuery<TSchema>,
19
19
  _Projection = DocumentProjection<TSchema>,
20
20
  > {
21
21
  pickOneAndWrite: (query: _FilterQuery, rawData: _Partial) => Promise<TDocument>;
@@ -47,7 +47,7 @@ export interface UpdateResult {
47
47
  modifiedCount: number;
48
48
  upsertedId?: string | null;
49
49
  }
50
- export interface BulkWriteOperation<Raw, _RawDoc = DocumentModel<Raw>, _RawQuery = QueryOf<_RawDoc>> {
50
+ export interface BulkWriteOperation<Raw, _RawDoc = DocumentModel<Raw>, _RawQuery = DocumentQuery<_RawDoc>> {
51
51
  updateOne: {
52
52
  filter: _RawQuery;
53
53
  update: DocumentUpdate;
@@ -69,7 +69,7 @@ export type Mdl<
69
69
  Doc,
70
70
  Raw,
71
71
  _RawDoc = DocumentModel<Raw>,
72
- _RawQuery = QueryOf<_RawDoc>,
72
+ _RawQuery extends DocumentQuery<_RawDoc> = DocumentQuery<_RawDoc>,
73
73
  _Projection extends DocumentProjection<Raw> = DocumentProjection<Raw>,
74
74
  > = DefaultMdlStats<Doc, _RawDoc, Partial<_RawDoc>, _RawQuery, _Projection> & {
75
75
  refName: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "akanjs",
3
- "version": "2.3.11-rc.0",
3
+ "version": "2.3.11-rc.1",
4
4
  "sourceType": "module",
5
5
  "type": "module",
6
6
  "publishConfig": {
@@ -3,12 +3,12 @@ import type { DocumentModel, QueryOf } from "akanjs/constant";
3
3
  import type { FilterCls, FilterQueryOf, FilterSortOf } from ".";
4
4
  import type { CacheDatabase, QueryMethodPart } from "./database.d.ts";
5
5
  import type { DataLoader } from "./dataLoader.d.ts";
6
- import type { DocumentUpdate, DocumentUpdateOptions } from "./documentQuery.d.ts";
6
+ import type { DocumentQuery, DocumentUpdate, DocumentUpdateOptions } from "./documentQuery.d.ts";
7
7
  import { type LoaderBuilder, type ModelCls } from "./loaderInfo.d.ts";
8
8
  import type { DocumentProjection } from "./types.d.ts";
9
9
  export type CRUDEventType = "create" | "update" | "remove";
10
10
  export type SaveEventType = "save" | CRUDEventType;
11
- interface DefaultMdlStats<TDocument, TSchema, _Partial extends Partial<TSchema> = Partial<TSchema>, _FilterQuery extends QueryOf<TSchema> = QueryOf<TSchema>, _Projection = DocumentProjection<TSchema>> {
11
+ interface DefaultMdlStats<TDocument, TSchema, _Partial extends Partial<TSchema> = Partial<TSchema>, _FilterQuery extends DocumentQuery<TSchema> = DocumentQuery<TSchema>, _Projection = DocumentProjection<TSchema>> {
12
12
  pickOneAndWrite: (query: _FilterQuery, rawData: _Partial) => Promise<TDocument>;
13
13
  pickAndWrite: (docId: string, rawData: _Partial) => Promise<TDocument>;
14
14
  pickOne: (query: _FilterQuery, projection?: _Projection) => Promise<TDocument>;
@@ -32,7 +32,7 @@ export interface UpdateResult {
32
32
  modifiedCount: number;
33
33
  upsertedId?: string | null;
34
34
  }
35
- export interface BulkWriteOperation<Raw, _RawDoc = DocumentModel<Raw>, _RawQuery = QueryOf<_RawDoc>> {
35
+ export interface BulkWriteOperation<Raw, _RawDoc = DocumentModel<Raw>, _RawQuery = DocumentQuery<_RawDoc>> {
36
36
  updateOne: {
37
37
  filter: _RawQuery;
38
38
  update: DocumentUpdate;
@@ -50,7 +50,7 @@ type FindOneChain<Doc> = Promise<Doc | null> & {
50
50
  skip(skip: number): FindOneChain<Doc>;
51
51
  select(projection?: unknown): FindOneChain<Doc>;
52
52
  };
53
- export type Mdl<Doc, Raw, _RawDoc = DocumentModel<Raw>, _RawQuery = QueryOf<_RawDoc>, _Projection extends DocumentProjection<Raw> = DocumentProjection<Raw>> = DefaultMdlStats<Doc, _RawDoc, Partial<_RawDoc>, _RawQuery, _Projection> & {
53
+ export type Mdl<Doc, Raw, _RawDoc = DocumentModel<Raw>, _RawQuery extends DocumentQuery<_RawDoc> = DocumentQuery<_RawDoc>, _Projection extends DocumentProjection<Raw> = DocumentProjection<Raw>> = DefaultMdlStats<Doc, _RawDoc, Partial<_RawDoc>, _RawQuery, _Projection> & {
54
54
  refName: string;
55
55
  new (data: Partial<_RawDoc> | Partial<Doc>): Doc;
56
56
  find(query: _RawQuery, projection?: _Projection): FindManyChain<Doc>;