@webitel/api-services 26.12.29 → 26.12.31
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 +5 -1
- package/src/api/clients/_shared/types.ts +4 -5
- package/src/api/clients/fileServices/__tests__/fileServices.spec.ts +31 -0
- package/src/api/clients/fileServices/fileServices.ts +42 -0
- package/src/api/clients/logs/logs.ts +7 -0
- package/src/api/types/ApiModule.ts +43 -0
- package/src/api/types/index.ts +1 -0
- package/types/.tsbuildinfo +1 -1
- package/types/api/clients/_shared/types.d.ts +3 -5
- package/types/api/clients/fileServices/fileServices.d.ts +6 -0
- package/types/api/types/ApiModule.d.ts +42 -0
- package/types/api/types/index.d.ts +1 -0
|
@@ -1,13 +1,11 @@
|
|
|
1
|
+
import type { Id } from '../../types';
|
|
1
2
|
/**
|
|
2
3
|
* TODO(types): payloads pass through `applyTransform` before reaching a
|
|
3
4
|
* generated client, so the generated request types don't apply here yet.
|
|
4
5
|
*/
|
|
5
6
|
export type ApiParams = Record<string, any>;
|
|
6
|
-
/**
|
|
7
|
-
|
|
8
|
-
* ui-sdk and cannot import from it. tsc catches drift where the two meet.
|
|
9
|
-
*/
|
|
10
|
-
export type ApiId = string | number;
|
|
7
|
+
/** [Claude] same as `Id` from `api/types` (the `ApiModule` contract) */
|
|
8
|
+
export type ApiId = Id;
|
|
11
9
|
export interface GetItemParams {
|
|
12
10
|
itemId: ApiId;
|
|
13
11
|
}
|
|
@@ -8,6 +8,12 @@ export declare const FileServicesAPI: {
|
|
|
8
8
|
items: any;
|
|
9
9
|
next: any;
|
|
10
10
|
}>;
|
|
11
|
+
upload: ({ id, files, channel, }: {
|
|
12
|
+
id: ApiId;
|
|
13
|
+
files: File[];
|
|
14
|
+
/** [Claude] upload channel as the endpoint expects it, e.g. `case` */
|
|
15
|
+
channel?: string;
|
|
16
|
+
}) => Promise<any>;
|
|
11
17
|
delete: (id: string | string[]) => Promise<any>;
|
|
12
18
|
getScreenRecordingsByUser: (params: SearchScreenRecordingsParams & {
|
|
13
19
|
userId: ApiId;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
export type Id = number | string;
|
|
2
|
+
export interface ApiModule<Entity> {
|
|
3
|
+
getList?: (params?: unknown) => Promise<{
|
|
4
|
+
items?: Entity[];
|
|
5
|
+
next?: boolean;
|
|
6
|
+
aggs?: unknown;
|
|
7
|
+
}>;
|
|
8
|
+
getLookup?: (params?: unknown) => Promise<{
|
|
9
|
+
items?: Entity[];
|
|
10
|
+
next?: boolean;
|
|
11
|
+
}>;
|
|
12
|
+
get?: (params: {
|
|
13
|
+
itemId?: Id | null;
|
|
14
|
+
/** preferred over itemId */
|
|
15
|
+
id?: Id | null;
|
|
16
|
+
parentId?: Id | null;
|
|
17
|
+
}) => Promise<Entity>;
|
|
18
|
+
add?: (params: {
|
|
19
|
+
itemInstance?: Entity;
|
|
20
|
+
parentId?: Id | null;
|
|
21
|
+
}) => Promise<Entity>;
|
|
22
|
+
update?: (params: {
|
|
23
|
+
itemId?: Id | null;
|
|
24
|
+
id?: Id;
|
|
25
|
+
itemInstance?: Entity;
|
|
26
|
+
parentId?: Id | null;
|
|
27
|
+
etag?: string;
|
|
28
|
+
}) => Promise<Entity>;
|
|
29
|
+
patch?: (params: {
|
|
30
|
+
id?: Id;
|
|
31
|
+
itemId?: Id | null;
|
|
32
|
+
changes?: Partial<Entity>;
|
|
33
|
+
parentId?: Id | null;
|
|
34
|
+
etag?: string;
|
|
35
|
+
}) => Promise<Entity>;
|
|
36
|
+
delete?: (params: {
|
|
37
|
+
itemId?: Id;
|
|
38
|
+
id?: Id;
|
|
39
|
+
parentId?: Id | null;
|
|
40
|
+
etag?: string;
|
|
41
|
+
}) => Promise<void>;
|
|
42
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type { ApiModule, Id } from './ApiModule';
|