@e22m4u/js-repository 0.6.0 → 0.6.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/package.json
CHANGED
|
@@ -55,7 +55,7 @@ export declare class Repository<
|
|
|
55
55
|
* @param filter
|
|
56
56
|
*/
|
|
57
57
|
create(
|
|
58
|
-
data:
|
|
58
|
+
data: WithOptionalId<FlatData, IdName>,
|
|
59
59
|
filter?: ItemFilterClause<FlatData>,
|
|
60
60
|
): Promise<FlatData>;
|
|
61
61
|
|
|
@@ -79,7 +79,7 @@ export declare class Repository<
|
|
|
79
79
|
* @param filter
|
|
80
80
|
*/
|
|
81
81
|
replaceOrCreate(
|
|
82
|
-
data:
|
|
82
|
+
data: WithOptionalId<FlatData, IdName>,
|
|
83
83
|
filter?: ItemFilterClause<FlatData>,
|
|
84
84
|
): Promise<FlatData>;
|
|
85
85
|
|
|
@@ -177,7 +177,7 @@ export declare type PartialWithoutId<
|
|
|
177
177
|
/**
|
|
178
178
|
* Makes the required id field as optional.
|
|
179
179
|
*/
|
|
180
|
-
export declare type
|
|
181
|
-
IdName extends string,
|
|
180
|
+
export declare type WithOptionalId<
|
|
182
181
|
Data extends object,
|
|
182
|
+
IdName extends string = 'id',
|
|
183
183
|
> = Flatten<Data extends {[K in IdName]: any} ? PartialBy<Data, IdName> : Data>;
|