@lpdjs/firestore-repo-service 2.6.52 → 2.6.53

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.
@@ -1,11 +1,11 @@
1
1
  import { S as SyncQueue } from './queue-B4uwef6c.js';
2
2
  import { F as FirestoreSyncConfig, S as SyncEvent } from './types-DT7Nypd_.js';
3
- import { O as OpenAPIDocument } from './openapi-b7qM1WGb.js';
3
+ import { O as OpenAPIDocument } from './openapi-BpbfjSHK.js';
4
4
  import * as firebase_functions_v2_https from 'firebase-functions/v2/https';
5
5
  import { onRequest, HttpsOptions } from 'firebase-functions/v2/https';
6
6
  import { H as HistoryTriggersConfig } from './read-CTWZjxyh.js';
7
- import { C as ConfiguredRepository, a as CrudServerOptions, b as CrudRepoConfig } from './types-BBV7SbAk.js';
8
- import { A as AdminServerOptions, a as AdminRepoConfig } from './index-BiPDgqCE.js';
7
+ import { C as ConfiguredRepository, a as CrudServerOptions, b as CrudRepoConfig } from './types-cY03CMya.js';
8
+ import { A as AdminServerOptions, a as AdminRepoConfig } from './index-D47y5giY.js';
9
9
 
10
10
  /** Per-repo admin config with `repo` omitted (auto-bound from the registry key). */
11
11
  type BoundAdminRepoConfig<TRepo extends ConfiguredRepository<any>> = Omit<AdminRepoConfig<TRepo>, "repo">;
@@ -1,11 +1,11 @@
1
1
  import { S as SyncQueue } from './queue-CQyWCQBk.cjs';
2
2
  import { F as FirestoreSyncConfig, S as SyncEvent } from './types-BwH1C-wi.cjs';
3
- import { O as OpenAPIDocument } from './openapi-DA2HQTaL.cjs';
3
+ import { O as OpenAPIDocument } from './openapi-DG7aQUlX.cjs';
4
4
  import * as firebase_functions_v2_https from 'firebase-functions/v2/https';
5
5
  import { onRequest, HttpsOptions } from 'firebase-functions/v2/https';
6
6
  import { H as HistoryTriggersConfig } from './read-CTWZjxyh.cjs';
7
- import { C as ConfiguredRepository, a as CrudServerOptions, b as CrudRepoConfig } from './types-T6CFn4gs.cjs';
8
- import { A as AdminServerOptions, a as AdminRepoConfig } from './index-DY0lmoPn.cjs';
7
+ import { C as ConfiguredRepository, a as CrudServerOptions, b as CrudRepoConfig } from './types-CE-EfugW.cjs';
8
+ import { A as AdminServerOptions, a as AdminRepoConfig } from './index-dW_7jrlK.cjs';
9
9
 
10
10
  /** Per-repo admin config with `repo` omitted (auto-bound from the registry key). */
11
11
  type BoundAdminRepoConfig<TRepo extends ConfiguredRepository<any>> = Omit<AdminRepoConfig<TRepo>, "repo">;
@@ -1,6 +1,6 @@
1
1
  import { z } from 'zod';
2
2
  import { HttpsOptions } from 'firebase-functions/v2/https';
3
- import { C as ConfiguredRepository, f as RepositoryConfig, g as FieldPath, F as FieldRole, S as SecurityHeadersOptions } from './types-BBV7SbAk.js';
3
+ import { C as ConfiguredRepository, f as RepositoryConfig, g as FieldPath, F as FieldRole, S as SecurityHeadersOptions } from './types-cY03CMya.js';
4
4
  import { A as AuthExtension, h as Middleware } from './firebase-auth-DZ8lb2Ec.js';
5
5
 
6
6
  interface PageOptions {
@@ -1,6 +1,6 @@
1
1
  import { z } from 'zod';
2
2
  import { HttpsOptions } from 'firebase-functions/v2/https';
3
- import { C as ConfiguredRepository, f as RepositoryConfig, g as FieldPath, F as FieldRole, S as SecurityHeadersOptions } from './types-T6CFn4gs.cjs';
3
+ import { C as ConfiguredRepository, f as RepositoryConfig, g as FieldPath, F as FieldRole, S as SecurityHeadersOptions } from './types-CE-EfugW.cjs';
4
4
  import { A as AuthExtension, h as Middleware } from './firebase-auth-DZ8lb2Ec.cjs';
5
5
 
6
6
  interface PageOptions {
package/dist/index.d.cts CHANGED
@@ -1,10 +1,10 @@
1
1
  import { d as HistoryConfigForModel } from './read-CTWZjxyh.cjs';
2
2
  import { Query, QuerySnapshot, Firestore } from 'firebase-admin/firestore';
3
3
  import { z } from 'zod';
4
- import { h as QueryOptions, P as PaginationOptions, f as RepositoryConfig, i as RelationConfig, C as ConfiguredRepository } from './types-T6CFn4gs.cjs';
5
- export { A as ApiResponse, b as CrudRepoConfig, a as CrudServerOptions, E as ExtractDocumentRefSignature, j as ExtractUpdateSignature, g as FieldPath, F as FieldRole, t as GenerateGetMethods, u as GenerateQueryMethods, G as GetOptions, k as GetResult, I as IncludeConfigTyped, L as ListResponseData, o as PaginationResult, v as PaginationWithIncludeOptionsTyped, w as PopulateOptionsTyped, Q as QueryRequestBody, l as RelationalKeys, R as RepoFieldPath, e as RepoRelationKeys, p as SystemBackfillFailure, q as SystemBackfillOptions, r as SystemBackfillResult, U as UserFieldPath, W as WhereClause, m as createPaginationIterator, n as executePaginatedQuery } from './types-T6CFn4gs.cjs';
6
- export { B as BoundAdminRepoConfig, a as BoundAdminServerOptions, b as BoundCrudRepoConfig, d as BoundCrudServerOptions, e as BoundFirestoreSyncConfig, C as CreateServersDeps, c as createServers } from './create-servers-BlkEoNpP.cjs';
7
- export { a as AdminRepoConfig, b as AdminRepoEntry, A as AdminServerOptions, B as BasicAuthConfig } from './index-DY0lmoPn.cjs';
4
+ import { h as QueryOptions, P as PaginationOptions, f as RepositoryConfig, i as RelationConfig, C as ConfiguredRepository } from './types-CE-EfugW.cjs';
5
+ export { A as ApiResponse, b as CrudRepoConfig, a as CrudServerOptions, E as ExtractDocumentRefSignature, j as ExtractUpdateSignature, g as FieldPath, F as FieldRole, t as GenerateGetMethods, u as GenerateQueryMethods, G as GetOptions, k as GetResult, I as IncludeConfigTyped, L as ListResponseData, o as PaginationResult, v as PaginationWithIncludeOptionsTyped, w as PopulateOptionsTyped, Q as QueryRequestBody, l as RelationalKeys, R as RepoFieldPath, e as RepoRelationKeys, p as SystemBackfillFailure, q as SystemBackfillOptions, r as SystemBackfillResult, U as UserFieldPath, W as WhereClause, m as createPaginationIterator, n as executePaginatedQuery } from './types-CE-EfugW.cjs';
6
+ export { B as BoundAdminRepoConfig, a as BoundAdminServerOptions, b as BoundCrudRepoConfig, d as BoundCrudServerOptions, e as BoundFirestoreSyncConfig, C as CreateServersDeps, c as createServers } from './create-servers-BxkVVkg9.cjs';
7
+ export { a as AdminRepoConfig, b as AdminRepoEntry, A as AdminServerOptions, B as BasicAuthConfig } from './index-dW_7jrlK.cjs';
8
8
  export { M as MiniRouter } from './firebase-auth-DZ8lb2Ec.cjs';
9
9
  import 'firebase-functions/v2/firestore';
10
10
  import './types-B4dMmfet.cjs';
@@ -13,7 +13,7 @@ import 'firebase-functions/v2/https';
13
13
  import './queue-CQyWCQBk.cjs';
14
14
  import './types-BwH1C-wi.cjs';
15
15
  import 'firebase-functions/v2/pubsub';
16
- import './openapi-DA2HQTaL.cjs';
16
+ import './openapi-DG7aQUlX.cjs';
17
17
 
18
18
  /**
19
19
  * Apply QueryOptions to a Firestore query.
package/dist/index.d.ts CHANGED
@@ -1,10 +1,10 @@
1
1
  import { d as HistoryConfigForModel } from './read-CTWZjxyh.js';
2
2
  import { Query, QuerySnapshot, Firestore } from 'firebase-admin/firestore';
3
3
  import { z } from 'zod';
4
- import { h as QueryOptions, P as PaginationOptions, f as RepositoryConfig, i as RelationConfig, C as ConfiguredRepository } from './types-BBV7SbAk.js';
5
- export { A as ApiResponse, b as CrudRepoConfig, a as CrudServerOptions, E as ExtractDocumentRefSignature, j as ExtractUpdateSignature, g as FieldPath, F as FieldRole, t as GenerateGetMethods, u as GenerateQueryMethods, G as GetOptions, k as GetResult, I as IncludeConfigTyped, L as ListResponseData, o as PaginationResult, v as PaginationWithIncludeOptionsTyped, w as PopulateOptionsTyped, Q as QueryRequestBody, l as RelationalKeys, R as RepoFieldPath, e as RepoRelationKeys, p as SystemBackfillFailure, q as SystemBackfillOptions, r as SystemBackfillResult, U as UserFieldPath, W as WhereClause, m as createPaginationIterator, n as executePaginatedQuery } from './types-BBV7SbAk.js';
6
- export { B as BoundAdminRepoConfig, a as BoundAdminServerOptions, b as BoundCrudRepoConfig, d as BoundCrudServerOptions, e as BoundFirestoreSyncConfig, C as CreateServersDeps, c as createServers } from './create-servers-Cj3GnkyB.js';
7
- export { a as AdminRepoConfig, b as AdminRepoEntry, A as AdminServerOptions, B as BasicAuthConfig } from './index-BiPDgqCE.js';
4
+ import { h as QueryOptions, P as PaginationOptions, f as RepositoryConfig, i as RelationConfig, C as ConfiguredRepository } from './types-cY03CMya.js';
5
+ export { A as ApiResponse, b as CrudRepoConfig, a as CrudServerOptions, E as ExtractDocumentRefSignature, j as ExtractUpdateSignature, g as FieldPath, F as FieldRole, t as GenerateGetMethods, u as GenerateQueryMethods, G as GetOptions, k as GetResult, I as IncludeConfigTyped, L as ListResponseData, o as PaginationResult, v as PaginationWithIncludeOptionsTyped, w as PopulateOptionsTyped, Q as QueryRequestBody, l as RelationalKeys, R as RepoFieldPath, e as RepoRelationKeys, p as SystemBackfillFailure, q as SystemBackfillOptions, r as SystemBackfillResult, U as UserFieldPath, W as WhereClause, m as createPaginationIterator, n as executePaginatedQuery } from './types-cY03CMya.js';
6
+ export { B as BoundAdminRepoConfig, a as BoundAdminServerOptions, b as BoundCrudRepoConfig, d as BoundCrudServerOptions, e as BoundFirestoreSyncConfig, C as CreateServersDeps, c as createServers } from './create-servers-B84cbslf.js';
7
+ export { a as AdminRepoConfig, b as AdminRepoEntry, A as AdminServerOptions, B as BasicAuthConfig } from './index-D47y5giY.js';
8
8
  export { M as MiniRouter } from './firebase-auth-DZ8lb2Ec.js';
9
9
  import 'firebase-functions/v2/firestore';
10
10
  import './types-DyKJJ9UQ.js';
@@ -13,7 +13,7 @@ import 'firebase-functions/v2/https';
13
13
  import './queue-B4uwef6c.js';
14
14
  import './types-DT7Nypd_.js';
15
15
  import 'firebase-functions/v2/pubsub';
16
- import './openapi-b7qM1WGb.js';
16
+ import './openapi-BpbfjSHK.js';
17
17
 
18
18
  /**
19
19
  * Apply QueryOptions to a Firestore query.
@@ -1,4 +1,4 @@
1
- # @lpdjs/firestore-repo-service (v2.6.52) — full documentation
1
+ # @lpdjs/firestore-repo-service (v2.6.53) — full documentation
2
2
 
3
3
  > ⚡ Type-safe Firestore ORM with auto-generated repositories, advanced queries, relations with typed select, pagination with include, batch/bulk operations, aggregations and transactions.
4
4
 
package/dist/llms.txt CHANGED
@@ -1,4 +1,4 @@
1
- # @lpdjs/firestore-repo-service (v2.6.52)
1
+ # @lpdjs/firestore-repo-service (v2.6.53)
2
2
 
3
3
  > ⚡ Type-safe Firestore ORM with auto-generated repositories, advanced queries, relations with typed select, pagination with include, batch/bulk operations, aggregations and transactions.
4
4
 
@@ -1,4 +1,4 @@
1
- import { d as CrudRepoRegistry, O as OpenAPISpecOptions } from './types-BBV7SbAk.js';
1
+ import { d as CrudRepoRegistry, O as OpenAPISpecOptions } from './types-cY03CMya.js';
2
2
 
3
3
  /**
4
4
  * OpenAPI 3.1 specification generator for the CRUD server.
@@ -1,4 +1,4 @@
1
- import { d as CrudRepoRegistry, O as OpenAPISpecOptions } from './types-T6CFn4gs.cjs';
1
+ import { d as CrudRepoRegistry, O as OpenAPISpecOptions } from './types-CE-EfugW.cjs';
2
2
 
3
3
  /**
4
4
  * OpenAPI 3.1 specification generator for the CRUD server.
@@ -1,8 +1,8 @@
1
1
  import 'zod';
2
2
  import 'firebase-functions/v2/https';
3
- import '../../types-T6CFn4gs.cjs';
3
+ import '../../types-CE-EfugW.cjs';
4
4
  export { h as Middleware, M as MiniRouter, R as RouteHandler } from '../../firebase-auth-DZ8lb2Ec.cjs';
5
- export { a as AdminRepoConfig, b as AdminRepoEntry, A as AdminServerOptions, B as BasicAuthConfig, c as RepoRegistry, d as createAdminServer } from '../../index-DY0lmoPn.cjs';
5
+ export { a as AdminRepoConfig, b as AdminRepoEntry, A as AdminServerOptions, B as BasicAuthConfig, c as RepoRegistry, d as createAdminServer } from '../../index-dW_7jrlK.cjs';
6
6
  import '../../types-B4dMmfet.cjs';
7
7
  import 'hono';
8
8
  import '../../read-CTWZjxyh.cjs';
@@ -1,8 +1,8 @@
1
1
  import 'zod';
2
2
  import 'firebase-functions/v2/https';
3
- import '../../types-BBV7SbAk.js';
3
+ import '../../types-cY03CMya.js';
4
4
  export { h as Middleware, M as MiniRouter, R as RouteHandler } from '../../firebase-auth-DZ8lb2Ec.js';
5
- export { a as AdminRepoConfig, b as AdminRepoEntry, A as AdminServerOptions, B as BasicAuthConfig, c as RepoRegistry, d as createAdminServer } from '../../index-BiPDgqCE.js';
5
+ export { a as AdminRepoConfig, b as AdminRepoEntry, A as AdminServerOptions, B as BasicAuthConfig, c as RepoRegistry, d as createAdminServer } from '../../index-D47y5giY.js';
6
6
  import '../../types-DyKJJ9UQ.js';
7
7
  import 'hono';
8
8
  import '../../read-CTWZjxyh.js';
@@ -1,8 +1,8 @@
1
1
  import { HttpsOptions } from 'firebase-functions/v2/https';
2
- import { C as ConfiguredRepository, a as CrudServerOptions } from '../../types-T6CFn4gs.cjs';
3
- export { A as ApiResponse, b as CrudRepoConfig, c as CrudRepoEntry, d as CrudRepoRegistry, F as FieldRole, L as ListResponseData, O as OpenAPISpecOptions, Q as QueryRequestBody, R as RepoFieldPath, e as RepoRelationKeys, U as UserFieldPath } from '../../types-T6CFn4gs.cjs';
4
- import { O as OpenAPIDocument } from '../../openapi-DA2HQTaL.cjs';
5
- export { g as generateOpenAPISpec } from '../../openapi-DA2HQTaL.cjs';
2
+ import { C as ConfiguredRepository, a as CrudServerOptions } from '../../types-CE-EfugW.cjs';
3
+ export { A as ApiResponse, b as CrudRepoConfig, c as CrudRepoEntry, d as CrudRepoRegistry, F as FieldRole, L as ListResponseData, O as OpenAPISpecOptions, Q as QueryRequestBody, R as RepoFieldPath, e as RepoRelationKeys, U as UserFieldPath } from '../../types-CE-EfugW.cjs';
4
+ import { O as OpenAPIDocument } from '../../openapi-DG7aQUlX.cjs';
5
+ export { g as generateOpenAPISpec } from '../../openapi-DG7aQUlX.cjs';
6
6
  import '../../firebase-auth-DZ8lb2Ec.cjs';
7
7
  import '../../types-B4dMmfet.cjs';
8
8
  import 'zod';
@@ -1,8 +1,8 @@
1
1
  import { HttpsOptions } from 'firebase-functions/v2/https';
2
- import { C as ConfiguredRepository, a as CrudServerOptions } from '../../types-BBV7SbAk.js';
3
- export { A as ApiResponse, b as CrudRepoConfig, c as CrudRepoEntry, d as CrudRepoRegistry, F as FieldRole, L as ListResponseData, O as OpenAPISpecOptions, Q as QueryRequestBody, R as RepoFieldPath, e as RepoRelationKeys, U as UserFieldPath } from '../../types-BBV7SbAk.js';
4
- import { O as OpenAPIDocument } from '../../openapi-b7qM1WGb.js';
5
- export { g as generateOpenAPISpec } from '../../openapi-b7qM1WGb.js';
2
+ import { C as ConfiguredRepository, a as CrudServerOptions } from '../../types-cY03CMya.js';
3
+ export { A as ApiResponse, b as CrudRepoConfig, c as CrudRepoEntry, d as CrudRepoRegistry, F as FieldRole, L as ListResponseData, O as OpenAPISpecOptions, Q as QueryRequestBody, R as RepoFieldPath, e as RepoRelationKeys, U as UserFieldPath } from '../../types-cY03CMya.js';
4
+ import { O as OpenAPIDocument } from '../../openapi-BpbfjSHK.js';
5
+ export { g as generateOpenAPISpec } from '../../openapi-BpbfjSHK.js';
6
6
  import '../../firebase-auth-DZ8lb2Ec.js';
7
7
  import '../../types-DyKJJ9UQ.js';
8
8
  import 'zod';
@@ -1,7 +1,7 @@
1
- export { B as BoundAdminRepoConfig, a as BoundAdminServerOptions, b as BoundCrudRepoConfig, d as BoundCrudServerOptions, e as BoundFirestoreSyncConfig, C as CreateServersDeps, c as createServers } from '../create-servers-BlkEoNpP.cjs';
2
- import { P as PageOptions, C as ColumnMeta, F as FilterState, R as RelationalFieldMeta, S as SortState, Q as QueryError } from '../index-DY0lmoPn.cjs';
3
- export { a as AdminRepoConfig, b as AdminRepoEntry, A as AdminServerOptions, B as BasicAuthConfig, c as RepoRegistry } from '../index-DY0lmoPn.cjs';
4
- export { A as ApiResponse, b as CrudRepoConfig, c as CrudRepoEntry, d as CrudRepoRegistry, a as CrudServerOptions, D as DEFAULT_HTML_CSP, F as FieldRole, L as ListResponseData, Q as QueryRequestBody, R as RepoFieldPath, e as RepoRelationKeys, S as SecurityHeadersOptions, U as UserFieldPath, s as securityHeaders } from '../types-T6CFn4gs.cjs';
1
+ export { B as BoundAdminRepoConfig, a as BoundAdminServerOptions, b as BoundCrudRepoConfig, d as BoundCrudServerOptions, e as BoundFirestoreSyncConfig, C as CreateServersDeps, c as createServers } from '../create-servers-BxkVVkg9.cjs';
2
+ import { P as PageOptions, C as ColumnMeta, F as FilterState, R as RelationalFieldMeta, S as SortState, Q as QueryError } from '../index-dW_7jrlK.cjs';
3
+ export { a as AdminRepoConfig, b as AdminRepoEntry, A as AdminServerOptions, B as BasicAuthConfig, c as RepoRegistry } from '../index-dW_7jrlK.cjs';
4
+ export { A as ApiResponse, b as CrudRepoConfig, c as CrudRepoEntry, d as CrudRepoRegistry, a as CrudServerOptions, D as DEFAULT_HTML_CSP, F as FieldRole, L as ListResponseData, Q as QueryRequestBody, R as RepoFieldPath, e as RepoRelationKeys, S as SecurityHeadersOptions, U as UserFieldPath, s as securityHeaders } from '../types-CE-EfugW.cjs';
5
5
  import { z } from 'zod';
6
6
  export { h as Middleware, M as MiniRouter, R as RouteHandler } from '../firebase-auth-DZ8lb2Ec.cjs';
7
7
  import * as hono_jsx_jsx_dev_runtime from 'hono/jsx/jsx-dev-runtime';
@@ -10,7 +10,7 @@ import '../types-BwH1C-wi.cjs';
10
10
  import 'firebase-functions/v2/firestore';
11
11
  import 'firebase-functions/v2/https';
12
12
  import 'firebase-functions/v2/pubsub';
13
- import '../openapi-DA2HQTaL.cjs';
13
+ import '../openapi-DG7aQUlX.cjs';
14
14
  import '../read-CTWZjxyh.cjs';
15
15
  import 'firebase-admin/firestore';
16
16
  import '../types-B4dMmfet.cjs';
@@ -1,7 +1,7 @@
1
- export { B as BoundAdminRepoConfig, a as BoundAdminServerOptions, b as BoundCrudRepoConfig, d as BoundCrudServerOptions, e as BoundFirestoreSyncConfig, C as CreateServersDeps, c as createServers } from '../create-servers-Cj3GnkyB.js';
2
- import { P as PageOptions, C as ColumnMeta, F as FilterState, R as RelationalFieldMeta, S as SortState, Q as QueryError } from '../index-BiPDgqCE.js';
3
- export { a as AdminRepoConfig, b as AdminRepoEntry, A as AdminServerOptions, B as BasicAuthConfig, c as RepoRegistry } from '../index-BiPDgqCE.js';
4
- export { A as ApiResponse, b as CrudRepoConfig, c as CrudRepoEntry, d as CrudRepoRegistry, a as CrudServerOptions, D as DEFAULT_HTML_CSP, F as FieldRole, L as ListResponseData, Q as QueryRequestBody, R as RepoFieldPath, e as RepoRelationKeys, S as SecurityHeadersOptions, U as UserFieldPath, s as securityHeaders } from '../types-BBV7SbAk.js';
1
+ export { B as BoundAdminRepoConfig, a as BoundAdminServerOptions, b as BoundCrudRepoConfig, d as BoundCrudServerOptions, e as BoundFirestoreSyncConfig, C as CreateServersDeps, c as createServers } from '../create-servers-B84cbslf.js';
2
+ import { P as PageOptions, C as ColumnMeta, F as FilterState, R as RelationalFieldMeta, S as SortState, Q as QueryError } from '../index-D47y5giY.js';
3
+ export { a as AdminRepoConfig, b as AdminRepoEntry, A as AdminServerOptions, B as BasicAuthConfig, c as RepoRegistry } from '../index-D47y5giY.js';
4
+ export { A as ApiResponse, b as CrudRepoConfig, c as CrudRepoEntry, d as CrudRepoRegistry, a as CrudServerOptions, D as DEFAULT_HTML_CSP, F as FieldRole, L as ListResponseData, Q as QueryRequestBody, R as RepoFieldPath, e as RepoRelationKeys, S as SecurityHeadersOptions, U as UserFieldPath, s as securityHeaders } from '../types-cY03CMya.js';
5
5
  import { z } from 'zod';
6
6
  export { h as Middleware, M as MiniRouter, R as RouteHandler } from '../firebase-auth-DZ8lb2Ec.js';
7
7
  import * as hono_jsx_jsx_dev_runtime from 'hono/jsx/jsx-dev-runtime';
@@ -10,7 +10,7 @@ import '../types-DT7Nypd_.js';
10
10
  import 'firebase-functions/v2/firestore';
11
11
  import 'firebase-functions/v2/https';
12
12
  import 'firebase-functions/v2/pubsub';
13
- import '../openapi-b7qM1WGb.js';
13
+ import '../openapi-BpbfjSHK.js';
14
14
  import '../read-CTWZjxyh.js';
15
15
  import 'firebase-admin/firestore';
16
16
  import '../types-DyKJJ9UQ.js';
@@ -115,11 +115,18 @@ interface GetOptions<T = any> {
115
115
  /** Return the raw DocumentSnapshot alongside data */
116
116
  returnDoc?: boolean;
117
117
  }
118
+ /**
119
+ * Extracts the boolean value from a ReturnDoc parameter or options object
120
+ * @internal
121
+ */
122
+ type ExtractReturnDoc<O> = O extends true ? true : O extends {
123
+ returnDoc: true;
124
+ } ? true : false;
118
125
  /**
119
126
  * Result type for get operations with optional document snapshot
120
127
  * @internal
121
128
  */
122
- type GetResult<T, ReturnDoc extends boolean> = ReturnDoc extends true ? {
129
+ type GetResult<T, O> = ExtractReturnDoc<O> extends true ? {
123
130
  data: T;
124
131
  doc: DocumentSnapshot;
125
132
  } | null : T | null;
@@ -483,19 +490,13 @@ type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends (
483
490
  * @internal
484
491
  */
485
492
  type GenerateGetMethods<TConfig extends RepositoryConfig<any, any, any, any, any, any, any, any, any, any, any>> = {
486
- [K in TConfig["foreignKeys"][number] as K extends string ? `by${Capitalize<K>}` : never]: K extends TConfig["documentKey"] ? <ReturnDoc extends boolean = false>(...args: [
493
+ [K in TConfig["foreignKeys"][number] as K extends string ? `by${Capitalize<K>}` : never]: K extends TConfig["documentKey"] ? <O extends boolean | GetOptions<TConfig["type"]> = false>(...args: [
487
494
  ...Parameters<TConfig["documentRef"]>,
488
- (ReturnDoc | (GetOptions<TConfig["type"]> & {
489
- returnDoc?: ReturnDoc;
490
- }))?
495
+ O?
491
496
  ] | [
492
497
  TConfig["type"][K extends keyof TConfig["type"] ? K : never],
493
- (ReturnDoc | (GetOptions<TConfig["type"]> & {
494
- returnDoc?: ReturnDoc;
495
- }))?
496
- ]) => Promise<GetResult<TConfig["type"], ReturnDoc>> : <ReturnDoc extends boolean = false>(value: TConfig["type"][K extends keyof TConfig["type"] ? K : never], options?: ReturnDoc | (GetOptions<TConfig["type"]> & {
497
- returnDoc?: ReturnDoc;
498
- })) => Promise<GetResult<TConfig["type"], ReturnDoc>>;
498
+ O?
499
+ ]) => Promise<GetResult<TConfig["type"], O>> : <O extends boolean | GetOptions<TConfig["type"]> = false>(value: TConfig["type"][K extends keyof TConfig["type"] ? K : never], options?: O) => Promise<GetResult<TConfig["type"], O>>;
499
500
  };
500
501
  /**
501
502
  * Generates query.by* methods from query keys
@@ -514,7 +515,7 @@ type ConfiguredRepository<T extends RepositoryConfig<any, any, any, any, any, an
514
515
  readonly _isGroup: T["isGroup"];
515
516
  ref: CollectionReference | Query;
516
517
  get: GenerateGetMethods<T> & {
517
- byList: <K extends keyof T["type"], ReturnDoc extends boolean = false>(key: K, values: T["type"][K][], operator?: "in" | "array-contains-any", returnDoc?: ReturnDoc) => Promise<ReturnDoc extends true ? Array<{
518
+ byList: <K extends keyof T["type"], O extends boolean | GetOptions<T["type"]> = false>(key: K, values: T["type"][K][], operator?: "in" | "array-contains-any", options?: O) => Promise<ExtractReturnDoc<O> extends true ? Array<{
518
519
  data: T["type"];
519
520
  doc: DocumentSnapshot;
520
521
  }> : T["type"][]>;
@@ -115,11 +115,18 @@ interface GetOptions<T = any> {
115
115
  /** Return the raw DocumentSnapshot alongside data */
116
116
  returnDoc?: boolean;
117
117
  }
118
+ /**
119
+ * Extracts the boolean value from a ReturnDoc parameter or options object
120
+ * @internal
121
+ */
122
+ type ExtractReturnDoc<O> = O extends true ? true : O extends {
123
+ returnDoc: true;
124
+ } ? true : false;
118
125
  /**
119
126
  * Result type for get operations with optional document snapshot
120
127
  * @internal
121
128
  */
122
- type GetResult<T, ReturnDoc extends boolean> = ReturnDoc extends true ? {
129
+ type GetResult<T, O> = ExtractReturnDoc<O> extends true ? {
123
130
  data: T;
124
131
  doc: DocumentSnapshot;
125
132
  } | null : T | null;
@@ -483,19 +490,13 @@ type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends (
483
490
  * @internal
484
491
  */
485
492
  type GenerateGetMethods<TConfig extends RepositoryConfig<any, any, any, any, any, any, any, any, any, any, any>> = {
486
- [K in TConfig["foreignKeys"][number] as K extends string ? `by${Capitalize<K>}` : never]: K extends TConfig["documentKey"] ? <ReturnDoc extends boolean = false>(...args: [
493
+ [K in TConfig["foreignKeys"][number] as K extends string ? `by${Capitalize<K>}` : never]: K extends TConfig["documentKey"] ? <O extends boolean | GetOptions<TConfig["type"]> = false>(...args: [
487
494
  ...Parameters<TConfig["documentRef"]>,
488
- (ReturnDoc | (GetOptions<TConfig["type"]> & {
489
- returnDoc?: ReturnDoc;
490
- }))?
495
+ O?
491
496
  ] | [
492
497
  TConfig["type"][K extends keyof TConfig["type"] ? K : never],
493
- (ReturnDoc | (GetOptions<TConfig["type"]> & {
494
- returnDoc?: ReturnDoc;
495
- }))?
496
- ]) => Promise<GetResult<TConfig["type"], ReturnDoc>> : <ReturnDoc extends boolean = false>(value: TConfig["type"][K extends keyof TConfig["type"] ? K : never], options?: ReturnDoc | (GetOptions<TConfig["type"]> & {
497
- returnDoc?: ReturnDoc;
498
- })) => Promise<GetResult<TConfig["type"], ReturnDoc>>;
498
+ O?
499
+ ]) => Promise<GetResult<TConfig["type"], O>> : <O extends boolean | GetOptions<TConfig["type"]> = false>(value: TConfig["type"][K extends keyof TConfig["type"] ? K : never], options?: O) => Promise<GetResult<TConfig["type"], O>>;
499
500
  };
500
501
  /**
501
502
  * Generates query.by* methods from query keys
@@ -514,7 +515,7 @@ type ConfiguredRepository<T extends RepositoryConfig<any, any, any, any, any, an
514
515
  readonly _isGroup: T["isGroup"];
515
516
  ref: CollectionReference | Query;
516
517
  get: GenerateGetMethods<T> & {
517
- byList: <K extends keyof T["type"], ReturnDoc extends boolean = false>(key: K, values: T["type"][K][], operator?: "in" | "array-contains-any", returnDoc?: ReturnDoc) => Promise<ReturnDoc extends true ? Array<{
518
+ byList: <K extends keyof T["type"], O extends boolean | GetOptions<T["type"]> = false>(key: K, values: T["type"][K][], operator?: "in" | "array-contains-any", options?: O) => Promise<ExtractReturnDoc<O> extends true ? Array<{
518
519
  data: T["type"];
519
520
  doc: DocumentSnapshot;
520
521
  }> : T["type"][]>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lpdjs/firestore-repo-service",
3
- "version": "2.6.52",
3
+ "version": "2.6.53",
4
4
  "workspaces": [
5
5
  "test/functions"
6
6
  ],