@lpdjs/firestore-repo-service 2.6.30 → 2.6.32
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-BoJrRNI2.d.cts} +3 -3
- package/dist/{create-servers-O2stZ-yF.d.ts → create-servers-nXXPnlJt.d.ts} +3 -3
- package/dist/{index-TTSjUi4p.d.ts → index-BE-Iuye5.d.ts} +3 -2
- package/dist/{index-D0KRndyL.d.cts → index-DZnXSClM.d.cts} +3 -2
- package/dist/index.cjs +26 -26
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +25 -11
- package/dist/index.d.ts +25 -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.cjs +1 -1
- package/dist/servers/admin/index.cjs.map +1 -1
- package/dist/servers/admin/index.d.cts +2 -2
- package/dist/servers/admin/index.d.ts +2 -2
- package/dist/servers/admin/index.js +1 -1
- package/dist/servers/admin/index.js.map +1 -1
- package/dist/servers/crud/index.d.cts +4 -4
- package/dist/servers/crud/index.d.ts +4 -4
- package/dist/servers/index.cjs +1 -1
- package/dist/servers/index.cjs.map +1 -1
- package/dist/servers/index.d.cts +5 -5
- package/dist/servers/index.d.ts +5 -5
- package/dist/servers/index.js +1 -1
- package/dist/servers/index.js.map +1 -1
- 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
|
@@ -133,6 +133,7 @@ interface RelationConfig<TRepoKey extends string = string, TForeignKey extends s
|
|
|
133
133
|
repo: TRepoKey;
|
|
134
134
|
key: TForeignKey;
|
|
135
135
|
type: TType;
|
|
136
|
+
sourceKey?: string;
|
|
136
137
|
targetType?: TTargetModel;
|
|
137
138
|
}
|
|
138
139
|
/**
|
|
@@ -141,17 +142,21 @@ interface RelationConfig<TRepoKey extends string = string, TForeignKey extends s
|
|
|
141
142
|
* @template T - Current model type
|
|
142
143
|
* @template TMapping - All repositories mapping for validation
|
|
143
144
|
* @example { userId: { repo: "users", key: "docId", type: "one" } }
|
|
144
|
-
*
|
|
145
|
-
* IMPORTANT: Keys must exist in T (the current model)
|
|
146
|
-
* This prevents creating relations on non-existent fields
|
|
145
|
+
* @example { events: { repo: "events", key: "residenceId", type: "many", sourceKey: "docId" } }
|
|
147
146
|
*/
|
|
148
147
|
type RelationalKeys<T = any, TMapping = any> = {
|
|
149
|
-
[K in
|
|
150
|
-
[R in keyof TMapping]: TMapping[R] extends RepositoryConfig<any, infer FKeys, any, any, any, any, any, any, any, any, any> ? {
|
|
148
|
+
[K in string]?: TMapping extends Record<string, any> ? {
|
|
149
|
+
[R in keyof TMapping]: TMapping[R] extends RepositoryConfig<any, infer FKeys extends readonly any[], infer QKeys extends readonly any[], any, any, any, any, any, any, any, any> ? ({
|
|
151
150
|
repo: R;
|
|
152
151
|
key: FKeys[number];
|
|
153
|
-
type: "one"
|
|
154
|
-
|
|
152
|
+
type: "one";
|
|
153
|
+
sourceKey?: keyof T;
|
|
154
|
+
} | {
|
|
155
|
+
repo: R;
|
|
156
|
+
key: QKeys[number];
|
|
157
|
+
type: "many";
|
|
158
|
+
sourceKey?: keyof T;
|
|
159
|
+
}) : never;
|
|
155
160
|
}[keyof TMapping] : RelationConfig;
|
|
156
161
|
};
|
|
157
162
|
/**
|
|
@@ -133,6 +133,7 @@ interface RelationConfig<TRepoKey extends string = string, TForeignKey extends s
|
|
|
133
133
|
repo: TRepoKey;
|
|
134
134
|
key: TForeignKey;
|
|
135
135
|
type: TType;
|
|
136
|
+
sourceKey?: string;
|
|
136
137
|
targetType?: TTargetModel;
|
|
137
138
|
}
|
|
138
139
|
/**
|
|
@@ -141,17 +142,21 @@ interface RelationConfig<TRepoKey extends string = string, TForeignKey extends s
|
|
|
141
142
|
* @template T - Current model type
|
|
142
143
|
* @template TMapping - All repositories mapping for validation
|
|
143
144
|
* @example { userId: { repo: "users", key: "docId", type: "one" } }
|
|
144
|
-
*
|
|
145
|
-
* IMPORTANT: Keys must exist in T (the current model)
|
|
146
|
-
* This prevents creating relations on non-existent fields
|
|
145
|
+
* @example { events: { repo: "events", key: "residenceId", type: "many", sourceKey: "docId" } }
|
|
147
146
|
*/
|
|
148
147
|
type RelationalKeys<T = any, TMapping = any> = {
|
|
149
|
-
[K in
|
|
150
|
-
[R in keyof TMapping]: TMapping[R] extends RepositoryConfig<any, infer FKeys, any, any, any, any, any, any, any, any, any> ? {
|
|
148
|
+
[K in string]?: TMapping extends Record<string, any> ? {
|
|
149
|
+
[R in keyof TMapping]: TMapping[R] extends RepositoryConfig<any, infer FKeys extends readonly any[], infer QKeys extends readonly any[], any, any, any, any, any, any, any, any> ? ({
|
|
151
150
|
repo: R;
|
|
152
151
|
key: FKeys[number];
|
|
153
|
-
type: "one"
|
|
154
|
-
|
|
152
|
+
type: "one";
|
|
153
|
+
sourceKey?: keyof T;
|
|
154
|
+
} | {
|
|
155
|
+
repo: R;
|
|
156
|
+
key: QKeys[number];
|
|
157
|
+
type: "many";
|
|
158
|
+
sourceKey?: keyof T;
|
|
159
|
+
}) : never;
|
|
155
160
|
}[keyof TMapping] : RelationConfig;
|
|
156
161
|
};
|
|
157
162
|
/**
|