@opra/common 0.32.5 → 0.32.6
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/browser.js
CHANGED
|
@@ -11358,6 +11358,7 @@ var CollectionClass = class extends CrudResource {
|
|
|
11358
11358
|
if (endpoint) {
|
|
11359
11359
|
endpoint.defineParameter("filter", { type: "string", isBuiltin: true });
|
|
11360
11360
|
endpoint.decodeInput = this.type.generateCodec("decode", {
|
|
11361
|
+
partial: true,
|
|
11361
11362
|
pick: endpoint.options.inputPickFields,
|
|
11362
11363
|
omit: endpoint.options.inputOmitFields,
|
|
11363
11364
|
operation: "write",
|
|
@@ -122,6 +122,7 @@ class CollectionClass extends crud_resource_js_1.CrudResource {
|
|
|
122
122
|
// endpoint.defineParameter('metadata', {enum: MetadataMode, isBuiltin: true, default: 'minimal'});
|
|
123
123
|
endpoint.defineParameter('filter', { type: 'string', isBuiltin: true });
|
|
124
124
|
endpoint.decodeInput = this.type.generateCodec('decode', {
|
|
125
|
+
partial: true,
|
|
125
126
|
pick: endpoint.options.inputPickFields,
|
|
126
127
|
omit: endpoint.options.inputOmitFields,
|
|
127
128
|
operation: 'write',
|
|
@@ -118,6 +118,7 @@ export class CollectionClass extends CrudResource {
|
|
|
118
118
|
// endpoint.defineParameter('metadata', {enum: MetadataMode, isBuiltin: true, default: 'minimal'});
|
|
119
119
|
endpoint.defineParameter('filter', { type: 'string', isBuiltin: true });
|
|
120
120
|
endpoint.decodeInput = this.type.generateCodec('decode', {
|
|
121
|
+
partial: true,
|
|
121
122
|
pick: endpoint.options.inputPickFields,
|
|
122
123
|
omit: endpoint.options.inputOmitFields,
|
|
123
124
|
operation: 'write',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opra/common",
|
|
3
|
-
"version": "0.32.
|
|
3
|
+
"version": "0.32.6",
|
|
4
4
|
"description": "Opra common package",
|
|
5
5
|
"author": "Panates",
|
|
6
6
|
"license": "MIT",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"@types/lodash.omit": "^4.5.9",
|
|
57
57
|
"@types/validator": "^13.11.7",
|
|
58
58
|
"path-browserify": "^1.0.1",
|
|
59
|
-
"ts-gems": "^2.9.
|
|
59
|
+
"ts-gems": "^2.9.3"
|
|
60
60
|
},
|
|
61
61
|
"engines": {
|
|
62
62
|
"node": ">=16.0",
|
package/types/types.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { HighDeepOmitNever, IfNoDeepValue, Type } from 'ts-gems';
|
|
2
|
+
import { IfEquals } from 'ts-gems/lib/type-check';
|
|
2
3
|
export type Thunk<T> = T | (() => T);
|
|
3
4
|
export type ThunkAsync<T> = Thunk<T> | Thunk<Promise<T>>;
|
|
4
5
|
export type TypeThunk<T = any> = Thunk<Type<T>>;
|
|
@@ -7,16 +8,28 @@ export type TypeThunkAsync<T = any> = ThunkAsync<Type<T>>;
|
|
|
7
8
|
* Returns given type as a Data Transfer Object (DTO) interface, Removes symbol keys and function properties.
|
|
8
9
|
* @template T - The type of the data being transferred.
|
|
9
10
|
*/
|
|
10
|
-
export type DTO<T> = _DTO<
|
|
11
|
-
type _DTO<T
|
|
12
|
-
[
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}
|
|
18
|
-
export type
|
|
19
|
-
type
|
|
20
|
-
[
|
|
21
|
-
|
|
11
|
+
export type DTO<T> = HighDeepOmitNever<_DTO<T>>;
|
|
12
|
+
type _DTO<T> = T extends (infer U)[] ? _DTO<U>[] : IfNoDeepValue<T> extends true ? T : {
|
|
13
|
+
[K in keyof T]: K extends symbol ? never : IfEquals<{
|
|
14
|
+
[Q in K]: T[K];
|
|
15
|
+
}, {
|
|
16
|
+
readonly [Q in K]: T[K];
|
|
17
|
+
}> extends true ? never : T[K] extends Function ? never : _DTO<Exclude<T[K], undefined>>;
|
|
18
|
+
};
|
|
19
|
+
export type PartialDTO<T> = HighDeepOmitNever<_PartialDTO<T>>;
|
|
20
|
+
type _PartialDTO<T> = T extends (infer U)[] ? PartialDTO<U>[] : IfNoDeepValue<T> extends true ? T : {
|
|
21
|
+
[K in keyof T]?: K extends symbol ? never : IfEquals<{
|
|
22
|
+
[Q in K]: T[K];
|
|
23
|
+
}, {
|
|
24
|
+
readonly [Q in K]: T[K];
|
|
25
|
+
}> extends true ? never : T[K] extends Function ? never : _PartialDTO<Exclude<T[K], undefined>>;
|
|
26
|
+
};
|
|
27
|
+
export type PatchDTO<T> = HighDeepOmitNever<_PatchDTO<T>>;
|
|
28
|
+
type _PatchDTO<T> = T extends (infer U)[] ? _PatchDTO<U>[] : IfNoDeepValue<T> extends true ? T : {
|
|
29
|
+
[K in keyof T]?: K extends symbol ? never : IfEquals<{
|
|
30
|
+
[Q in K]: T[K];
|
|
31
|
+
}, {
|
|
32
|
+
readonly [Q in K]: T[K];
|
|
33
|
+
}> extends true ? never : T[K] extends Function ? never : _PatchDTO<Exclude<T[K], undefined>> | null;
|
|
34
|
+
};
|
|
22
35
|
export {};
|