@content-island/api-client 0.9.0 → 0.10.0
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 +6 -14
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
declare type AllowedQueryKeys<M extends Model = Model> = keyof Pick<
|
|
2
|
-
Query<M>,
|
|
3
|
-
'id' | 'contentType' | 'language' | 'includeRelatedContent' | Extract<keyof Query<M>, `fields.${string}`>
|
|
4
|
-
>;
|
|
5
|
-
|
|
6
1
|
export declare interface ApiClient {
|
|
7
2
|
getProject: () => Promise<Project>;
|
|
8
3
|
getContentList: <M extends Model = Model & Record<string, any>>(queryParam?: QueryParams<M>) => Promise<M[]>;
|
|
@@ -11,7 +6,9 @@ export declare interface ApiClient {
|
|
|
11
6
|
getRawContent: <M extends Model = Model & Record<string, any>>(queryParam: QueryParams<M>) => Promise<Content>;
|
|
12
7
|
}
|
|
13
8
|
|
|
14
|
-
export declare type ClientFilter<Type = string | boolean> = Type | {
|
|
9
|
+
export declare type ClientFilter<Type = string | boolean> = Type | {
|
|
10
|
+
in?: Type[];
|
|
11
|
+
};
|
|
15
12
|
|
|
16
13
|
export declare interface Content {
|
|
17
14
|
id: string;
|
|
@@ -92,15 +89,10 @@ declare type Query<M extends Model = Model> = {
|
|
|
92
89
|
language?: ClientFilter<M['language'] extends undefined ? string : M['language']>;
|
|
93
90
|
contentType?: ClientFilter;
|
|
94
91
|
includeRelatedContent?: boolean;
|
|
95
|
-
} & Partial<
|
|
96
|
-
Omit<
|
|
97
|
-
{
|
|
92
|
+
} & Partial<Omit<{
|
|
98
93
|
[K in keyof M as `fields.${string & K}`]: ClientFilter;
|
|
99
|
-
},
|
|
100
|
-
'fields.id' | 'fields.language'
|
|
101
|
-
>
|
|
102
|
-
>;
|
|
94
|
+
}, 'fields.id' | 'fields.language'>>;
|
|
103
95
|
|
|
104
|
-
export declare type QueryParams<M extends Model = Model & Record<string, any>> =
|
|
96
|
+
export declare type QueryParams<M extends Model = Model & Record<string, any>> = Query<M>;
|
|
105
97
|
|
|
106
98
|
export { }
|