@neuralinnovations/dataisland-sdk 0.0.1-dev2 → 0.0.1-dev4
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/.editorconfig +4 -1
- package/.eslintrc.json +1 -1
- package/README.md +91 -2
- package/jest.config.ts +3 -3
- package/jest.setup.ts +2 -2
- package/package.json +3 -2
- package/src/appBuilder.ts +6 -6
- package/src/appSdk.ts +6 -6
- package/src/commands/startCommandHandler.ts +2 -2
- package/src/context.ts +3 -3
- package/src/credentials.ts +29 -7
- package/src/disposable.ts +3 -4
- package/src/dto/accessGroupResponse.ts +35 -0
- package/src/dto/chatResponse.ts +104 -0
- package/src/dto/userInfoResponse.ts +11 -1
- package/src/dto/workspacesResponse.ts +49 -0
- package/src/events.ts +13 -13
- package/src/index.ts +24 -12
- package/src/internal/app.impl.ts +25 -28
- package/src/internal/appBuilder.impl.ts +16 -16
- package/src/internal/createApp.impl.ts +3 -3
- package/src/services/commandService.ts +3 -3
- package/src/services/credentialService.ts +3 -3
- package/src/services/middlewareService.ts +4 -4
- package/src/services/organizationService.ts +18 -116
- package/src/services/requestBuilder.ts +40 -15
- package/src/services/responseUtils.ts +32 -0
- package/src/services/rpcService.ts +28 -11
- package/src/services/service.ts +10 -8
- package/src/services/userProfileService.ts +18 -66
- package/src/storages/chat.ts +21 -0
- package/src/storages/chats.ts +17 -0
- package/src/storages/file.impl.ts +69 -0
- package/src/storages/file.ts +28 -0
- package/src/storages/files.impl.ts +213 -0
- package/src/storages/files.ts +38 -0
- package/src/storages/filesPage.ts +27 -0
- package/src/storages/groups.impl.ts +337 -0
- package/src/storages/groups.ts +43 -0
- package/src/storages/organization.impl.ts +68 -0
- package/src/storages/organization.ts +33 -0
- package/src/storages/organizations.impl.ts +191 -0
- package/src/storages/organizations.ts +8 -28
- package/src/storages/userProfile.impl.ts +56 -0
- package/src/storages/userProfile.ts +2 -2
- package/src/storages/workspace.impl.ts +109 -0
- package/src/storages/workspace.ts +49 -0
- package/src/storages/workspaces.impl.ts +212 -0
- package/src/storages/workspaces.ts +53 -0
- package/test/commands.test.ts +8 -8
- package/test/data/test_file.pdf +0 -0
- package/test/disposable.test.ts +3 -3
- package/test/events.test.ts +4 -4
- package/test/files.test.ts +52 -0
- package/test/index.test.ts +42 -83
- package/test/organization.test.ts +57 -0
- package/test/registry.test.ts +8 -8
- package/test/services.test.ts +15 -15
- package/test/setup.ts +52 -0
- package/test/unitTest.test.ts +2 -2
- package/test/workspace.test.ts +71 -0
- package/src/services/organizationImpl.ts +0 -51
- package/src/services/organizationsImpl.ts +0 -55
- package/src/types.ts +0 -86
package/src/types.ts
DELETED
@@ -1,86 +0,0 @@
|
|
1
|
-
import { type Event } from './events'
|
2
|
-
import { type Disposable } from './disposable'
|
3
|
-
import {
|
4
|
-
Organization,
|
5
|
-
OrganizationEvent,
|
6
|
-
OrganizationId
|
7
|
-
} from './storages/organizations'
|
8
|
-
|
9
|
-
export type WorkspaceId = string
|
10
|
-
export type ChatId = string
|
11
|
-
export type FileId = string
|
12
|
-
|
13
|
-
export enum FileEvent {
|
14
|
-
ADDED,
|
15
|
-
REMOVED,
|
16
|
-
UPDATED
|
17
|
-
}
|
18
|
-
|
19
|
-
export enum ChatEvent {
|
20
|
-
ADDED,
|
21
|
-
REMOVED,
|
22
|
-
UPDATED
|
23
|
-
}
|
24
|
-
|
25
|
-
export enum ChatMessageEvent {
|
26
|
-
ADDED,
|
27
|
-
REMOVED,
|
28
|
-
UPDATED
|
29
|
-
}
|
30
|
-
|
31
|
-
export interface File {
|
32
|
-
id: FileId
|
33
|
-
name: string
|
34
|
-
|
35
|
-
download: () => Promise<void>
|
36
|
-
}
|
37
|
-
|
38
|
-
export interface Files {
|
39
|
-
files: File[]
|
40
|
-
on: (callback: (event: Event<FileEvent, File>) => void) => Disposable
|
41
|
-
fetch: () => Promise<void>
|
42
|
-
upload: (path: string, name: string) => Promise<File>
|
43
|
-
}
|
44
|
-
|
45
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-interface
|
46
|
-
export interface ChatMessage {}
|
47
|
-
|
48
|
-
export interface Chat {
|
49
|
-
id: ChatId
|
50
|
-
name: string
|
51
|
-
on: (
|
52
|
-
callback: (event: Event<ChatMessageEvent, ChatMessage>) => void
|
53
|
-
) => Disposable
|
54
|
-
messages: ChatMessage[]
|
55
|
-
fetch: () => Promise<void>
|
56
|
-
subscribe: () => void
|
57
|
-
unsubscribe: () => void
|
58
|
-
}
|
59
|
-
|
60
|
-
export interface Chats {
|
61
|
-
chats: Chat[]
|
62
|
-
newChat: (name: string) => Promise<Chat>
|
63
|
-
on: (callback: (event: Event<ChatEvent, Chat>) => void) => Disposable
|
64
|
-
fetch: () => Promise<void>
|
65
|
-
}
|
66
|
-
|
67
|
-
export interface Invites {
|
68
|
-
invite: (email: string) => Promise<void>
|
69
|
-
accept: (id: OrganizationId) => Promise<void>
|
70
|
-
decline: (id: OrganizationId) => Promise<void>
|
71
|
-
on: (
|
72
|
-
callback: (organization: Event<OrganizationEvent, Organization>) => void
|
73
|
-
) => Disposable
|
74
|
-
}
|
75
|
-
|
76
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-interface
|
77
|
-
export interface Statistics {}
|
78
|
-
|
79
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-interface
|
80
|
-
export interface Workspace {}
|
81
|
-
|
82
|
-
export interface Workspaces {
|
83
|
-
newWorkspace: (name: string) => Promise<Workspace>
|
84
|
-
|
85
|
-
delete: (id: WorkspaceId) => Promise<void>
|
86
|
-
}
|