@lpdjs/firestore-repo-service 2.6.29 → 2.6.31
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/dist/{create-servers-C3CIViuc.d.cts → create-servers-DlVgnO_m.d.cts} +3 -3
- package/dist/{create-servers-O2stZ-yF.d.ts → create-servers-n4q5BhVK.d.ts} +3 -3
- package/dist/{index-D0KRndyL.d.cts → index-BfTEw4r1.d.cts} +1 -1
- package/dist/{index-TTSjUi4p.d.ts → index-Da_8eLPb.d.ts} +1 -1
- package/dist/index.cjs +26 -26
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +29 -11
- package/dist/index.d.ts +29 -11
- package/dist/index.js +26 -26
- package/dist/index.js.map +1 -1
- package/dist/llms-full.txt +14 -8
- package/dist/llms.txt +1 -1
- package/dist/{openapi-BdatGOqK.d.cts → openapi-BHW1HViI.d.cts} +1 -1
- package/dist/{openapi-uTAic4s0.d.ts → openapi-BupSdudk.d.ts} +1 -1
- package/dist/servers/admin/index.d.cts +2 -2
- package/dist/servers/admin/index.d.ts +2 -2
- package/dist/servers/crud/index.d.cts +4 -4
- package/dist/servers/crud/index.d.ts +4 -4
- package/dist/servers/index.d.cts +5 -5
- package/dist/servers/index.d.ts +5 -5
- package/dist/{types-wzqw45jH.d.ts → types-BcT92G9B.d.ts} +12 -7
- package/dist/{types-Qd4tuEq9.d.cts → types-CpkQQn4b.d.cts} +12 -7
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
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-
|
|
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-
|
|
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-
|
|
7
|
-
export { a as AdminRepoConfig, b as AdminRepoEntry, A as AdminServerOptions, B as BasicAuthConfig } from './index-
|
|
4
|
+
import { h as QueryOptions, P as PaginationOptions, f as RepositoryConfig, i as RelationConfig, C as ConfiguredRepository } from './types-CpkQQn4b.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-CpkQQn4b.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-DlVgnO_m.cjs';
|
|
7
|
+
export { a as AdminRepoConfig, b as AdminRepoEntry, A as AdminServerOptions, B as BasicAuthConfig } from './index-BfTEw4r1.cjs';
|
|
8
8
|
export { M as MiniRouter } from './firebase-auth-DZ8lb2Ec.cjs';
|
|
9
9
|
import 'firebase-functions/v2/firestore';
|
|
10
10
|
import 'firebase-functions/v2/https';
|
|
11
11
|
import './queue-CQyWCQBk.cjs';
|
|
12
12
|
import './types-BwH1C-wi.cjs';
|
|
13
13
|
import 'firebase-functions/v2/pubsub';
|
|
14
|
-
import './openapi-
|
|
14
|
+
import './openapi-BHW1HViI.cjs';
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
17
|
* Apply QueryOptions to a Firestore query.
|
|
@@ -162,7 +162,13 @@ type ResolveRelation<TMapping, TRelationConfig> = TRelationConfig extends {
|
|
|
162
162
|
*
|
|
163
163
|
* const mappingWithRelations = buildRepositoryRelations(mapping, {
|
|
164
164
|
* posts: {
|
|
165
|
-
*
|
|
165
|
+
* // Using the property name directly as the relation key (sourceKey is inferred)
|
|
166
|
+
* userId: { repo: "users", key: "docId", type: "one" }
|
|
167
|
+
* },
|
|
168
|
+
* users: {
|
|
169
|
+
* // Using an arbitrary name with a specific sourceKey (useful for multiple relations from same field)
|
|
170
|
+
* userPosts: { repo: "posts", key: "userId", type: "many", sourceKey: "docId" },
|
|
171
|
+
* userDrafts: { repo: "posts", key: "userId", type: "many", sourceKey: "docId" }
|
|
166
172
|
* }
|
|
167
173
|
* });
|
|
168
174
|
*
|
|
@@ -171,13 +177,25 @@ type ResolveRelation<TMapping, TRelationConfig> = TRelationConfig extends {
|
|
|
171
177
|
*/
|
|
172
178
|
declare function buildRepositoryRelations<TMapping extends Record<string, any>, const TRelations extends {
|
|
173
179
|
[K in keyof TMapping]?: TMapping[K] extends RepositoryConfig<infer T, any, any, any, any, any, any, any, any, any, any> ? {
|
|
174
|
-
[RK in keyof TRelations[K]]?:
|
|
175
|
-
[R in keyof TMapping]: TMapping[R] extends RepositoryConfig<infer TTargetModel, infer TForeignKeys, any, any, any, any, any, any, any, any, any> ? {
|
|
180
|
+
[RK in keyof TRelations[K]]?: {
|
|
181
|
+
[R in keyof TMapping]: TMapping[R] extends RepositoryConfig<infer TTargetModel, infer TForeignKeys extends readonly any[], infer TQueryKeys extends readonly any[], any, any, any, any, any, any, any, any> ? (({
|
|
176
182
|
repo: R;
|
|
177
183
|
key: TForeignKeys[number];
|
|
178
|
-
type: "one"
|
|
179
|
-
}
|
|
180
|
-
|
|
184
|
+
type: "one";
|
|
185
|
+
} & (RK extends keyof T ? {
|
|
186
|
+
sourceKey?: keyof T;
|
|
187
|
+
} : {
|
|
188
|
+
sourceKey: keyof T;
|
|
189
|
+
})) | ({
|
|
190
|
+
repo: R;
|
|
191
|
+
key: TQueryKeys[number];
|
|
192
|
+
type: "many";
|
|
193
|
+
} & (RK extends keyof T ? {
|
|
194
|
+
sourceKey?: keyof T;
|
|
195
|
+
} : {
|
|
196
|
+
sourceKey: keyof T;
|
|
197
|
+
}))) : never;
|
|
198
|
+
}[keyof TMapping];
|
|
181
199
|
} : never;
|
|
182
200
|
}>(mapping: TMapping, relations: TRelations): {
|
|
183
201
|
[K in keyof TMapping]: K extends keyof TRelations ? TMapping[K] extends RepositoryConfig<infer T, infer TForeignKeys, infer TQueryKeys, infer TIsGroup, infer TRefCb, any, infer TDocumentKey, infer TPathKey, infer TCreatedKey, infer TUpdatedKey, infer THistoryEnabled> ? RepositoryConfig<T, TForeignKeys, TQueryKeys, TIsGroup, TRefCb, {
|
package/dist/index.d.ts
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
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-
|
|
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-
|
|
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-
|
|
7
|
-
export { a as AdminRepoConfig, b as AdminRepoEntry, A as AdminServerOptions, B as BasicAuthConfig } from './index-
|
|
4
|
+
import { h as QueryOptions, P as PaginationOptions, f as RepositoryConfig, i as RelationConfig, C as ConfiguredRepository } from './types-BcT92G9B.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-BcT92G9B.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-n4q5BhVK.js';
|
|
7
|
+
export { a as AdminRepoConfig, b as AdminRepoEntry, A as AdminServerOptions, B as BasicAuthConfig } from './index-Da_8eLPb.js';
|
|
8
8
|
export { M as MiniRouter } from './firebase-auth-DZ8lb2Ec.js';
|
|
9
9
|
import 'firebase-functions/v2/firestore';
|
|
10
10
|
import 'firebase-functions/v2/https';
|
|
11
11
|
import './queue-B4uwef6c.js';
|
|
12
12
|
import './types-DT7Nypd_.js';
|
|
13
13
|
import 'firebase-functions/v2/pubsub';
|
|
14
|
-
import './openapi-
|
|
14
|
+
import './openapi-BupSdudk.js';
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
17
|
* Apply QueryOptions to a Firestore query.
|
|
@@ -162,7 +162,13 @@ type ResolveRelation<TMapping, TRelationConfig> = TRelationConfig extends {
|
|
|
162
162
|
*
|
|
163
163
|
* const mappingWithRelations = buildRepositoryRelations(mapping, {
|
|
164
164
|
* posts: {
|
|
165
|
-
*
|
|
165
|
+
* // Using the property name directly as the relation key (sourceKey is inferred)
|
|
166
|
+
* userId: { repo: "users", key: "docId", type: "one" }
|
|
167
|
+
* },
|
|
168
|
+
* users: {
|
|
169
|
+
* // Using an arbitrary name with a specific sourceKey (useful for multiple relations from same field)
|
|
170
|
+
* userPosts: { repo: "posts", key: "userId", type: "many", sourceKey: "docId" },
|
|
171
|
+
* userDrafts: { repo: "posts", key: "userId", type: "many", sourceKey: "docId" }
|
|
166
172
|
* }
|
|
167
173
|
* });
|
|
168
174
|
*
|
|
@@ -171,13 +177,25 @@ type ResolveRelation<TMapping, TRelationConfig> = TRelationConfig extends {
|
|
|
171
177
|
*/
|
|
172
178
|
declare function buildRepositoryRelations<TMapping extends Record<string, any>, const TRelations extends {
|
|
173
179
|
[K in keyof TMapping]?: TMapping[K] extends RepositoryConfig<infer T, any, any, any, any, any, any, any, any, any, any> ? {
|
|
174
|
-
[RK in keyof TRelations[K]]?:
|
|
175
|
-
[R in keyof TMapping]: TMapping[R] extends RepositoryConfig<infer TTargetModel, infer TForeignKeys, any, any, any, any, any, any, any, any, any> ? {
|
|
180
|
+
[RK in keyof TRelations[K]]?: {
|
|
181
|
+
[R in keyof TMapping]: TMapping[R] extends RepositoryConfig<infer TTargetModel, infer TForeignKeys extends readonly any[], infer TQueryKeys extends readonly any[], any, any, any, any, any, any, any, any> ? (({
|
|
176
182
|
repo: R;
|
|
177
183
|
key: TForeignKeys[number];
|
|
178
|
-
type: "one"
|
|
179
|
-
}
|
|
180
|
-
|
|
184
|
+
type: "one";
|
|
185
|
+
} & (RK extends keyof T ? {
|
|
186
|
+
sourceKey?: keyof T;
|
|
187
|
+
} : {
|
|
188
|
+
sourceKey: keyof T;
|
|
189
|
+
})) | ({
|
|
190
|
+
repo: R;
|
|
191
|
+
key: TQueryKeys[number];
|
|
192
|
+
type: "many";
|
|
193
|
+
} & (RK extends keyof T ? {
|
|
194
|
+
sourceKey?: keyof T;
|
|
195
|
+
} : {
|
|
196
|
+
sourceKey: keyof T;
|
|
197
|
+
}))) : never;
|
|
198
|
+
}[keyof TMapping];
|
|
181
199
|
} : never;
|
|
182
200
|
}>(mapping: TMapping, relations: TRelations): {
|
|
183
201
|
[K in keyof TMapping]: K extends keyof TRelations ? TMapping[K] extends RepositoryConfig<infer T, infer TForeignKeys, infer TQueryKeys, infer TIsGroup, infer TRefCb, any, infer TDocumentKey, infer TPathKey, infer TCreatedKey, infer TUpdatedKey, infer THistoryEnabled> ? RepositoryConfig<T, TForeignKeys, TQueryKeys, TIsGroup, TRefCb, {
|