@lpdjs/firestore-repo-service 2.2.2 → 2.2.3

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.
@@ -601,15 +601,18 @@ declare function generateOpenAPISpec(registry: CrudRepoRegistry, basePath: strin
601
601
 
602
602
  /**
603
603
  * Extracts the model type `T` from a `ConfiguredRepository`.
604
+ * Uses a two-step inference so it survives intersection types
605
+ * (e.g. `RepositoryConfig<...> & { schema: ZodObject }` produced by
606
+ * `createRepositoryConfig(schema)`).
604
607
  * @internal
605
608
  */
606
- type RepoModelType<TRepo> = TRepo extends ConfiguredRepository<RepositoryConfig<infer T, any, any, any, any, any, any, any, any, any>> ? T : never;
609
+ type RepoModelType<TRepo> = TRepo extends ConfiguredRepository<infer C> ? C extends RepositoryConfig<infer T, any, any, any, any, any, any, any, any, any> ? T : never : never;
607
610
  /**
608
611
  * Extracts the auto-managed system keys (documentKey, pathKey, createdKey, updatedKey)
609
612
  * from a `ConfiguredRepository`. These keys must never appear in create/update payloads.
610
613
  * @internal
611
614
  */
612
- type RepoSystemKeys<TRepo> = TRepo extends ConfiguredRepository<RepositoryConfig<any, any, any, any, any, any, infer TDocKey, infer TPathKey, infer TCreatedKey, infer TUpdatedKey>> ? (TDocKey extends string ? TDocKey : never) | (TPathKey extends string ? TPathKey : never) | (TCreatedKey extends string ? TCreatedKey : never) | (TUpdatedKey extends string ? TUpdatedKey : never) : never;
615
+ type RepoSystemKeys<TRepo> = TRepo extends ConfiguredRepository<infer C> ? C extends RepositoryConfig<any, any, any, any, any, any, infer TDocKey, infer TPathKey, infer TCreatedKey, infer TUpdatedKey> ? (TDocKey extends string ? TDocKey : never) | (TPathKey extends string ? TPathKey : never) | (TCreatedKey extends string ? TCreatedKey : never) | (TUpdatedKey extends string ? TUpdatedKey : never) : never : never;
613
616
  /**
614
617
  * `true` when `T` is `any` (the `0 extends (1 & T)` trick).
615
618
  * @internal
@@ -601,15 +601,18 @@ declare function generateOpenAPISpec(registry: CrudRepoRegistry, basePath: strin
601
601
 
602
602
  /**
603
603
  * Extracts the model type `T` from a `ConfiguredRepository`.
604
+ * Uses a two-step inference so it survives intersection types
605
+ * (e.g. `RepositoryConfig<...> & { schema: ZodObject }` produced by
606
+ * `createRepositoryConfig(schema)`).
604
607
  * @internal
605
608
  */
606
- type RepoModelType<TRepo> = TRepo extends ConfiguredRepository<RepositoryConfig<infer T, any, any, any, any, any, any, any, any, any>> ? T : never;
609
+ type RepoModelType<TRepo> = TRepo extends ConfiguredRepository<infer C> ? C extends RepositoryConfig<infer T, any, any, any, any, any, any, any, any, any> ? T : never : never;
607
610
  /**
608
611
  * Extracts the auto-managed system keys (documentKey, pathKey, createdKey, updatedKey)
609
612
  * from a `ConfiguredRepository`. These keys must never appear in create/update payloads.
610
613
  * @internal
611
614
  */
612
- type RepoSystemKeys<TRepo> = TRepo extends ConfiguredRepository<RepositoryConfig<any, any, any, any, any, any, infer TDocKey, infer TPathKey, infer TCreatedKey, infer TUpdatedKey>> ? (TDocKey extends string ? TDocKey : never) | (TPathKey extends string ? TPathKey : never) | (TCreatedKey extends string ? TCreatedKey : never) | (TUpdatedKey extends string ? TUpdatedKey : never) : never;
615
+ type RepoSystemKeys<TRepo> = TRepo extends ConfiguredRepository<infer C> ? C extends RepositoryConfig<any, any, any, any, any, any, infer TDocKey, infer TPathKey, infer TCreatedKey, infer TUpdatedKey> ? (TDocKey extends string ? TDocKey : never) | (TPathKey extends string ? TPathKey : never) | (TCreatedKey extends string ? TCreatedKey : never) | (TUpdatedKey extends string ? TUpdatedKey : never) : never : never;
613
616
  /**
614
617
  * `true` when `T` is `any` (the `0 extends (1 & T)` trick).
615
618
  * @internal
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lpdjs/firestore-repo-service",
3
- "version": "2.2.2",
3
+ "version": "2.2.3",
4
4
  "description": "⚡ Type-safe Firestore ORM with auto-generated repositories, advanced queries, relations with typed select, pagination with include, batch/bulk operations, aggregations and transactions.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",