@content-island/vscode-api-client 0.1.4 → 0.1.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/dist/index.d.ts +9 -8
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as vscode from 'vscode';
|
|
2
2
|
|
|
3
|
-
declare type
|
|
4
|
-
[K in keyof M as IsPrimitive<NonNullable<M[K]>> extends true ? `fields.${string & K}` : never]?:
|
|
3
|
+
declare type AllowedFields<M extends Model, Type extends 'sort' | 'filter'> = Partial<Omit<{
|
|
4
|
+
[K in keyof M as IsPrimitive<NonNullable<M[K]>> extends true ? `fields.${string & K}` : never]?: Type extends 'sort' ? SortOrder : ClientFilter<NonNullable<M[K]>>;
|
|
5
5
|
}, 'fields.id' | 'fields.language'>>;
|
|
6
6
|
|
|
7
7
|
declare interface ApiClient {
|
|
@@ -20,9 +20,10 @@ declare interface BaseModel {
|
|
|
20
20
|
type: ModelType;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
export declare type ClientFilter<Type = string | boolean> = Type | {
|
|
23
|
+
export declare type ClientFilter<Type = string | boolean | number> = Type | {
|
|
24
24
|
in?: Type[];
|
|
25
25
|
ne?: Type;
|
|
26
|
+
nin?: Type[];
|
|
26
27
|
};
|
|
27
28
|
|
|
28
29
|
export declare interface Content {
|
|
@@ -99,12 +100,12 @@ export declare type FieldType =
|
|
|
99
100
|
| RelatedModelType;
|
|
100
101
|
|
|
101
102
|
declare type FilterableFields<M extends Model = Model> = {
|
|
102
|
-
id?: ClientFilter
|
|
103
|
-
lastUpdate?: ClientFilter
|
|
103
|
+
id?: ClientFilter<string>;
|
|
104
|
+
lastUpdate?: ClientFilter<string>;
|
|
104
105
|
language?: M['language'];
|
|
105
|
-
contentType?: ClientFilter
|
|
106
|
+
contentType?: ClientFilter<string>;
|
|
106
107
|
includeRelatedContent?: boolean;
|
|
107
|
-
} &
|
|
108
|
+
} & AllowedFields<M, 'filter'>;
|
|
108
109
|
|
|
109
110
|
declare type IsPrimitive<T> = [T] extends [string | number | boolean] ? true : false;
|
|
110
111
|
|
|
@@ -344,7 +345,7 @@ declare type RelatedModelType = `${string}|${string}`;
|
|
|
344
345
|
declare type SortableFields<M extends Model> = {
|
|
345
346
|
contentType?: SortOrder;
|
|
346
347
|
lastUpdate?: SortOrder;
|
|
347
|
-
} &
|
|
348
|
+
} & AllowedFields<M, 'sort'>;
|
|
348
349
|
|
|
349
350
|
declare type SortOrder = 'asc' | 'desc';
|
|
350
351
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@content-island/vscode-api-client",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.6",
|
|
4
4
|
"description": "Content Island - VSCode Extension API Client",
|
|
5
5
|
"private": false,
|
|
6
6
|
"sideEffects": false,
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"test:watch": "vitest -c ./config/test/config.ts"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@content-island/api-client": "0.
|
|
35
|
+
"@content-island/api-client": "0.18.0"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@content-island/common-backend": "*",
|