@neuralinnovations/dataisland-sdk 0.0.1-dev74 → 0.0.1-dev76
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/README.md +5 -0
- package/dist/package.json +1 -1
- package/dist/src/commands/startCommandHandler.d.ts.map +1 -1
- package/dist/src/commands/startCommandHandler.js +3 -0
- package/dist/src/commands/startCommandHandler.js.map +1 -1
- package/dist/src/dataIslandApp.d.ts +5 -0
- package/dist/src/dataIslandApp.d.ts.map +1 -1
- package/dist/src/dataIslandApp.js.map +1 -1
- package/dist/src/dto/chatResponse.d.ts +18 -3
- package/dist/src/dto/chatResponse.d.ts.map +1 -1
- package/dist/src/dto/chatResponse.js +12 -1
- package/dist/src/dto/chatResponse.js.map +1 -1
- package/dist/src/dto/libraryResponse.d.ts +41 -0
- package/dist/src/dto/libraryResponse.d.ts.map +1 -0
- package/dist/src/dto/libraryResponse.js +3 -0
- package/dist/src/dto/libraryResponse.js.map +1 -0
- package/dist/src/dto/queryFlowResponse.d.ts +1 -0
- package/dist/src/dto/queryFlowResponse.d.ts.map +1 -1
- package/dist/src/dto/userInfoResponse.d.ts +1 -0
- package/dist/src/dto/userInfoResponse.d.ts.map +1 -1
- package/dist/src/dto/workspacesResponse.d.ts +1 -0
- package/dist/src/dto/workspacesResponse.d.ts.map +1 -1
- package/dist/src/dto/workspacesResponse.js.map +1 -1
- package/dist/src/index.d.ts +4 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +4 -0
- package/dist/src/index.js.map +1 -1
- package/dist/src/internal/app.impl.d.ts +2 -0
- package/dist/src/internal/app.impl.d.ts.map +1 -1
- package/dist/src/internal/app.impl.js +7 -0
- package/dist/src/internal/app.impl.js.map +1 -1
- package/dist/src/services/acquiringService.d.ts.map +1 -1
- package/dist/src/services/acquiringService.js +2 -2
- package/dist/src/services/acquiringService.js.map +1 -1
- package/dist/src/services/librariesService.d.ts +9 -0
- package/dist/src/services/librariesService.d.ts.map +1 -0
- package/dist/src/services/librariesService.js +19 -0
- package/dist/src/services/librariesService.js.map +1 -0
- package/dist/src/storages/chats/chat.d.ts +3 -6
- package/dist/src/storages/chats/chat.d.ts.map +1 -1
- package/dist/src/storages/chats/chat.impl.d.ts +2 -3
- package/dist/src/storages/chats/chat.impl.d.ts.map +1 -1
- package/dist/src/storages/chats/chat.impl.js +2 -6
- package/dist/src/storages/chats/chat.impl.js.map +1 -1
- package/dist/src/storages/chats/chat.js.map +1 -1
- package/dist/src/storages/chats/chats.d.ts +12 -0
- package/dist/src/storages/chats/chats.d.ts.map +1 -1
- package/dist/src/storages/chats/chats.impl.d.ts +2 -0
- package/dist/src/storages/chats/chats.impl.d.ts.map +1 -1
- package/dist/src/storages/chats/chats.impl.js +68 -0
- package/dist/src/storages/chats/chats.impl.js.map +1 -1
- package/dist/src/storages/chats/chats.js.map +1 -1
- package/dist/src/storages/library/libraries.d.ts +12 -0
- package/dist/src/storages/library/libraries.d.ts.map +1 -0
- package/dist/src/storages/library/libraries.impl.d.ts +18 -0
- package/dist/src/storages/library/libraries.impl.d.ts.map +1 -0
- package/dist/src/storages/library/libraries.impl.js +134 -0
- package/dist/src/storages/library/libraries.impl.js.map +1 -0
- package/dist/src/storages/library/libraries.js +7 -0
- package/dist/src/storages/library/libraries.js.map +1 -0
- package/dist/src/storages/library/library.d.ts +10 -0
- package/dist/src/storages/library/library.d.ts.map +1 -0
- package/dist/src/storages/library/library.impl.d.ts +17 -0
- package/dist/src/storages/library/library.impl.d.ts.map +1 -0
- package/dist/src/storages/library/library.impl.js +98 -0
- package/dist/src/storages/library/library.impl.js.map +1 -0
- package/dist/src/storages/library/library.js +7 -0
- package/dist/src/storages/library/library.js.map +1 -0
- package/dist/src/storages/library/libraryFolder.d.ts +16 -0
- package/dist/src/storages/library/libraryFolder.d.ts.map +1 -0
- package/dist/src/storages/library/libraryFolder.impl.d.ts +22 -0
- package/dist/src/storages/library/libraryFolder.impl.d.ts.map +1 -0
- package/dist/src/storages/library/libraryFolder.impl.js +97 -0
- package/dist/src/storages/library/libraryFolder.impl.js.map +1 -0
- package/dist/src/storages/library/libraryFolder.js +7 -0
- package/dist/src/storages/library/libraryFolder.js.map +1 -0
- package/dist/src/storages/library/libraryPage.d.ts +29 -0
- package/dist/src/storages/library/libraryPage.d.ts.map +1 -0
- package/dist/src/storages/library/libraryPage.impl.d.ts +13 -0
- package/dist/src/storages/library/libraryPage.impl.d.ts.map +1 -0
- package/dist/src/storages/library/libraryPage.impl.js +20 -0
- package/dist/src/storages/library/libraryPage.impl.js.map +1 -0
- package/dist/src/storages/library/libraryPage.js +7 -0
- package/dist/src/storages/library/libraryPage.js.map +1 -0
- package/dist/src/storages/organizations/organization.d.ts +4 -0
- package/dist/src/storages/organizations/organization.d.ts.map +1 -1
- package/dist/src/storages/organizations/organization.impl.d.ts +1 -0
- package/dist/src/storages/organizations/organization.impl.d.ts.map +1 -1
- package/dist/src/storages/organizations/organization.impl.js +4 -0
- package/dist/src/storages/organizations/organization.impl.js.map +1 -1
- package/dist/src/storages/organizations/organization.js.map +1 -1
- package/dist/src/storages/queryFlows/queryFlow.d.ts +1 -0
- package/dist/src/storages/queryFlows/queryFlow.d.ts.map +1 -1
- package/dist/src/storages/queryFlows/queryFlow.impl.d.ts +1 -0
- package/dist/src/storages/queryFlows/queryFlow.impl.d.ts.map +1 -1
- package/dist/src/storages/queryFlows/queryFlow.impl.js +7 -1
- package/dist/src/storages/queryFlows/queryFlow.impl.js.map +1 -1
- package/dist/src/storages/queryFlows/queryFlow.js.map +1 -1
- package/dist/src/storages/queryFlows/queryFlows.d.ts +1 -1
- package/dist/src/storages/queryFlows/queryFlows.d.ts.map +1 -1
- package/dist/src/storages/queryFlows/queryFlows.impl.d.ts +1 -1
- package/dist/src/storages/queryFlows/queryFlows.impl.d.ts.map +1 -1
- package/dist/src/storages/queryFlows/queryFlows.impl.js +5 -1
- package/dist/src/storages/queryFlows/queryFlows.impl.js.map +1 -1
- package/dist/src/storages/workspaces/workspace.d.ts +6 -0
- package/dist/src/storages/workspaces/workspace.d.ts.map +1 -1
- package/dist/src/storages/workspaces/workspace.impl.d.ts +2 -0
- package/dist/src/storages/workspaces/workspace.impl.d.ts.map +1 -1
- package/dist/src/storages/workspaces/workspace.impl.js +38 -3
- package/dist/src/storages/workspaces/workspace.impl.js.map +1 -1
- package/dist/src/storages/workspaces/workspace.js.map +1 -1
- package/package.json +1 -1
- package/src/commands/startCommandHandler.ts +3 -0
- package/src/dataIslandApp.ts +6 -0
- package/src/dto/chatResponse.ts +21 -3
- package/src/dto/libraryResponse.ts +49 -0
- package/src/dto/queryFlowResponse.ts +1 -0
- package/src/dto/userInfoResponse.ts +1 -0
- package/src/dto/workspacesResponse.ts +1 -0
- package/src/index.ts +4 -0
- package/src/internal/app.impl.ts +9 -0
- package/src/services/acquiringService.ts +2 -2
- package/src/services/librariesService.ts +22 -0
- package/src/storages/chats/chat.impl.ts +3 -7
- package/src/storages/chats/chat.ts +3 -7
- package/src/storages/chats/chats.impl.ts +92 -0
- package/src/storages/chats/chats.ts +14 -0
- package/src/storages/library/libraries.impl.ts +192 -0
- package/src/storages/library/libraries.ts +20 -0
- package/src/storages/library/library.impl.ts +150 -0
- package/src/storages/library/library.ts +16 -0
- package/src/storages/library/libraryFolder.impl.ts +136 -0
- package/src/storages/library/libraryFolder.ts +25 -0
- package/src/storages/library/libraryPage.impl.ts +23 -0
- package/src/storages/library/libraryPage.ts +37 -0
- package/src/storages/organizations/organization.impl.ts +4 -0
- package/src/storages/organizations/organization.ts +5 -0
- package/src/storages/queryFlows/queryFlow.impl.ts +8 -1
- package/src/storages/queryFlows/queryFlow.ts +2 -0
- package/src/storages/queryFlows/queryFlows.impl.ts +5 -1
- package/src/storages/queryFlows/queryFlows.ts +1 -1
- package/src/storages/workspaces/workspace.impl.ts +45 -5
- package/src/storages/workspaces/workspace.ts +8 -0
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"workspace.impl.js","sourceRoot":"","sources":["../../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X,WAAW,EAAE,IAAI,CAAC,EAAE;YACpB,QAAQ,EAAE,QAAQ;SACnB,CAAC,CAAA,CAAA;QAEJ,IAAI,6BAAa,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC;YACnC,MAAM,6BAAa,CAAC,UAAU,CAAC,yCAAyC,EAAE,QAAQ,CAAC,CAAA;QACrF,CAAC;QAED,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC;YACpB,IAAI,CAAC,UAAU,CAAC,QAAQ,GAAG,QAAQ,CAAA;QACrC,CAAC;QAED,IAAI,CAAC,QAAQ,CAAC;YACZ,IAAI,EAAE,0BAAc,CAAC,OAAO;YAC5B,IAAI,EAAE,IAAI;SACX,CAAC,CAAA;IACJ,CAAC;IAED,KAAK,CAAC,QAAQ,CAAC,SAAuB;QACpC,IAAI,CAAC,UAAU,GAAG,SAAS,CAAA;IAC7B,CAAC;IAED,IAAI,eAAe;QACjB,OAAO,IAAI,CAAC,gBAAgB,CAAA;IAC9B,CAAC;IAED,YAAY;QACV,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAA;IAC9B,CAAC;CACF;AA/JD,sCA+JC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"workspace.js","sourceRoot":"","sources":["../../../../src/storages/workspaces/workspace.ts"],"names":[],"mappings":";;;AAAA,yCAA8C;AAK9C;;GAEG;AACH,IAAY,cAEX;AAFD,WAAY,cAAc;IACxB,qCAAmB,CAAA;AACrB,CAAC,EAFW,cAAc,8BAAd,cAAc,QAEzB;AAED;;GAEG;AACH,MAAsB,SAAU,SAAQ,wBAGvC;
|
1
|
+
{"version":3,"file":"workspace.js","sourceRoot":"","sources":["../../../../src/storages/workspaces/workspace.ts"],"names":[],"mappings":";;;AAAA,yCAA8C;AAK9C;;GAEG;AACH,IAAY,cAEX;AAFD,WAAY,cAAc;IACxB,qCAAmB,CAAA;AACrB,CAAC,EAFW,cAAc,8BAAd,cAAc,QAEzB;AAED;;GAEG;AACH,MAAsB,SAAU,SAAQ,wBAGvC;CA2CA;AA9CD,8BA8CC"}
|
package/package.json
CHANGED
@@ -3,6 +3,7 @@ import { UserProfileService } from "../services/userProfileService"
|
|
3
3
|
import { CookieService } from "../services/cookieService"
|
4
4
|
import { AnonymousCredential } from "../credentials"
|
5
5
|
import { AcquiringService } from "../services/acquiringService"
|
6
|
+
import {LibrariesService} from "../services/librariesService"
|
6
7
|
|
7
8
|
export class StartCommand extends Command {
|
8
9
|
}
|
@@ -12,6 +13,7 @@ export class StartCommandHandler extends CommandHandler<StartCommand> {
|
|
12
13
|
async execute(message: StartCommand): Promise<void> {
|
13
14
|
const userService = this.resolve(UserProfileService)!
|
14
15
|
const acquiringService = this.resolve(AcquiringService)!
|
16
|
+
const librariesService = this.resolve(LibrariesService)!
|
15
17
|
|
16
18
|
// Merge anonymous user if needed
|
17
19
|
if (!(this.context.app.credential instanceof AnonymousCredential)) {
|
@@ -24,5 +26,6 @@ export class StartCommandHandler extends CommandHandler<StartCommand> {
|
|
24
26
|
|
25
27
|
await userService.fetch()
|
26
28
|
await acquiringService.initialize()
|
29
|
+
await librariesService.initialize()
|
27
30
|
}
|
28
31
|
}
|
package/src/dataIslandApp.ts
CHANGED
@@ -5,6 +5,7 @@ import type { Constructor } from "./internal/registry"
|
|
5
5
|
import { Organizations } from "./storages/organizations/organizations"
|
6
6
|
import { UserProfile } from "./storages/user/userProfile"
|
7
7
|
import { Acquiring } from "./storages/acquirings/acquiring"
|
8
|
+
import {Libraries} from "./storages/library/libraries"
|
8
9
|
|
9
10
|
/**
|
10
11
|
* DataIsland App instance.
|
@@ -57,6 +58,11 @@ export abstract class DataIslandApp {
|
|
57
58
|
*/
|
58
59
|
abstract get acquiring(): Acquiring
|
59
60
|
|
61
|
+
/**
|
62
|
+
* Libraries.
|
63
|
+
*/
|
64
|
+
abstract get libraries(): Libraries
|
65
|
+
|
60
66
|
/**
|
61
67
|
* Resolve a service from the app.
|
62
68
|
* @param type
|
package/src/dto/chatResponse.ts
CHANGED
@@ -24,15 +24,33 @@ export interface ChatDto {
|
|
24
24
|
name: string;
|
25
25
|
createdAt: number;
|
26
26
|
modifiedAt: number;
|
27
|
+
resources: ChatResourceDto;
|
27
28
|
userId: UserId;
|
28
|
-
organizationId: string;
|
29
|
-
workspaceIds: string[];
|
30
|
-
fileId: string;
|
31
29
|
model: string;
|
32
30
|
clientContext: string;
|
33
31
|
answers: AnswerDto[];
|
34
32
|
}
|
35
33
|
|
34
|
+
export interface ChatResourceDto {
|
35
|
+
chatType: ChatType
|
36
|
+
libraryId: string
|
37
|
+
organizationId: string
|
38
|
+
workspaceIds: string[]
|
39
|
+
fileId: string
|
40
|
+
}
|
41
|
+
|
42
|
+
export enum ChatType {
|
43
|
+
None = 0,
|
44
|
+
Organization = 1,
|
45
|
+
Workspaces = 2,
|
46
|
+
File = 3,
|
47
|
+
Library = 100,
|
48
|
+
LibraryOrganization = 101,
|
49
|
+
LibraryWorkspaces = 102,
|
50
|
+
LibraryFile = 103
|
51
|
+
|
52
|
+
}
|
53
|
+
|
36
54
|
export interface ChatListResponse {
|
37
55
|
chats: ChatDto[]
|
38
56
|
}
|
@@ -0,0 +1,49 @@
|
|
1
|
+
import {FileDto} from "./workspacesResponse"
|
2
|
+
import {OrganizationId} from "../storages/organizations/organizations"
|
3
|
+
import {LibraryId} from "../storages/library/library"
|
4
|
+
|
5
|
+
export interface LibrariesResponse {
|
6
|
+
libraries: LibraryFolderDto[]
|
7
|
+
}
|
8
|
+
|
9
|
+
export interface LibraryFolderDto {
|
10
|
+
id: string
|
11
|
+
name: string
|
12
|
+
iconId: string
|
13
|
+
createdAt: number
|
14
|
+
modifiedAt: number
|
15
|
+
}
|
16
|
+
|
17
|
+
export interface LibraryPageResponse {
|
18
|
+
parentIds: string[]
|
19
|
+
totalItemsCount: number
|
20
|
+
itemsPerPage: number
|
21
|
+
folders: LibraryFolderDto[]
|
22
|
+
files: FileDto[]
|
23
|
+
}
|
24
|
+
|
25
|
+
export interface LibraryFolderResponse {
|
26
|
+
folder: LibraryFolderDto
|
27
|
+
}
|
28
|
+
|
29
|
+
export interface LibraryOrganizationDto {
|
30
|
+
id: OrganizationId
|
31
|
+
name: string
|
32
|
+
}
|
33
|
+
|
34
|
+
export interface LibraryDto {
|
35
|
+
id: LibraryId
|
36
|
+
name: string
|
37
|
+
region: number
|
38
|
+
isPublic: boolean
|
39
|
+
organizations: LibraryOrganizationDto[]
|
40
|
+
}
|
41
|
+
|
42
|
+
export interface LibraryResponse {
|
43
|
+
libraries: LibraryDto[]
|
44
|
+
}
|
45
|
+
|
46
|
+
export interface CreateLibraryResponse {
|
47
|
+
|
48
|
+
libraryId: LibraryId
|
49
|
+
}
|
package/src/index.ts
CHANGED
@@ -19,6 +19,7 @@ export * from "./dto/userInfoResponse"
|
|
19
19
|
export * from "./dto/workspacesResponse"
|
20
20
|
export * from "./dto/invitesResponse"
|
21
21
|
export * from "./dto/apiKeyResponse"
|
22
|
+
export * from "./dto/libraryResponse"
|
22
23
|
export * from "./dto/queryFlowResponse"
|
23
24
|
export * from "./events"
|
24
25
|
export * from "./middleware"
|
@@ -34,6 +35,9 @@ export * from "./storages/organizations/organizations"
|
|
34
35
|
export * from "./storages/user/userProfile"
|
35
36
|
export * from "./storages/workspaces/workspace"
|
36
37
|
export * from "./storages/workspaces/workspaces"
|
38
|
+
export * from "./storages/library/library"
|
39
|
+
export * from "./storages/library/libraryPage"
|
40
|
+
export * from "./storages/library/libraryFolder"
|
37
41
|
export * from "./storages/queryFlows/queryFlow"
|
38
42
|
export * from "./storages/queryFlows/queryFlows"
|
39
43
|
|
package/src/internal/app.impl.ts
CHANGED
@@ -32,6 +32,8 @@ import { CookieService } from "../services/cookieService"
|
|
32
32
|
import { AnonymousService } from "../services/anonymousService"
|
33
33
|
import { Acquiring } from "../storages/acquirings/acquiring"
|
34
34
|
import { AcquiringService } from "../services/acquiringService"
|
35
|
+
import {Libraries} from "../storages/library/libraries"
|
36
|
+
import {LibrariesService} from "../services/librariesService"
|
35
37
|
|
36
38
|
export class DataIslandAppImpl extends DataIslandApp {
|
37
39
|
readonly name: string
|
@@ -89,6 +91,10 @@ export class DataIslandAppImpl extends DataIslandApp {
|
|
89
91
|
return (this.resolve(AcquiringService) as AcquiringService).acquiring
|
90
92
|
}
|
91
93
|
|
94
|
+
get libraries(): Libraries {
|
95
|
+
return (this.resolve(LibrariesService) as LibrariesService).libraries
|
96
|
+
}
|
97
|
+
|
92
98
|
async initialize(
|
93
99
|
setup: ((builder: AppBuilder) => Promise<void>) | undefined
|
94
100
|
): Promise<void> {
|
@@ -131,6 +137,9 @@ export class DataIslandAppImpl extends DataIslandApp {
|
|
131
137
|
builder.registerService(AcquiringService, (context: ServiceContext) => {
|
132
138
|
return new AcquiringService(context)
|
133
139
|
})
|
140
|
+
builder.registerService(LibrariesService, (context: ServiceContext) => {
|
141
|
+
return new LibrariesService(context)
|
142
|
+
})
|
134
143
|
|
135
144
|
// call customer setup
|
136
145
|
if (setup !== undefined) {
|
@@ -11,8 +11,8 @@ export class AcquiringService extends Service {
|
|
11
11
|
this._acquiring = new AcquiringImpl(serviceContext.context)
|
12
12
|
}
|
13
13
|
|
14
|
-
initialize(): Promise<void> {
|
15
|
-
return this._acquiring.initialize()
|
14
|
+
async initialize(): Promise<void> {
|
15
|
+
return await this._acquiring.initialize()
|
16
16
|
}
|
17
17
|
|
18
18
|
get acquiring(): Acquiring {
|
@@ -0,0 +1,22 @@
|
|
1
|
+
import { Service, ServiceContext } from "./service"
|
2
|
+
import {LibrariesImpl} from "../storages/library/libraries.impl"
|
3
|
+
import {Libraries} from "../storages/library/libraries"
|
4
|
+
|
5
|
+
export class LibrariesService extends Service {
|
6
|
+
private readonly _libraries: LibrariesImpl
|
7
|
+
|
8
|
+
constructor(serviceContext: ServiceContext) {
|
9
|
+
super(serviceContext)
|
10
|
+
|
11
|
+
this._libraries = new LibrariesImpl(serviceContext.context)
|
12
|
+
}
|
13
|
+
|
14
|
+
async initialize(): Promise<void> {
|
15
|
+
return await this._libraries.initialize()
|
16
|
+
}
|
17
|
+
|
18
|
+
get libraries(): Libraries {
|
19
|
+
return this._libraries
|
20
|
+
}
|
21
|
+
|
22
|
+
}
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { Chat, ChatAnswerType } from "./chat"
|
2
2
|
import { Disposable } from "../../disposable"
|
3
3
|
import { Answer, AnswerId } from "./answer"
|
4
|
-
import {ChatDto} from "../../dto/chatResponse"
|
4
|
+
import {ChatDto, ChatResourceDto} from "../../dto/chatResponse"
|
5
5
|
import { Context } from "../../context"
|
6
6
|
import { AnswerImpl } from "./answer.impl"
|
7
7
|
import { RpcService } from "../../services/rpcService"
|
@@ -66,12 +66,8 @@ export class ChatImpl extends Chat implements Disposable {
|
|
66
66
|
return <string>this._content?.name
|
67
67
|
}
|
68
68
|
|
69
|
-
get
|
70
|
-
return
|
71
|
-
}
|
72
|
-
|
73
|
-
get workspaceIds(): string[] {
|
74
|
-
return <string[]>this._content?.workspaceIds
|
69
|
+
get resource(): ChatResourceDto {
|
70
|
+
return <ChatResourceDto>this._content?.resources
|
75
71
|
}
|
76
72
|
|
77
73
|
get model(): string {
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import { Answer } from "./answer"
|
2
2
|
import { Organization } from "../organizations/organization"
|
3
|
+
import {ChatResourceDto} from "../../dto/chatResponse"
|
3
4
|
|
4
5
|
export type ChatId = string
|
5
6
|
|
@@ -26,14 +27,9 @@ export abstract class Chat {
|
|
26
27
|
abstract get name(): string
|
27
28
|
|
28
29
|
/**
|
29
|
-
*
|
30
|
+
* Chat resource info : type ChatType, related entities Ids.
|
30
31
|
*/
|
31
|
-
abstract get
|
32
|
-
|
33
|
-
/**
|
34
|
-
* Connected workspace ID.
|
35
|
-
*/
|
36
|
-
abstract get workspaceIds(): string[]
|
32
|
+
abstract get resource(): ChatResourceDto
|
37
33
|
|
38
34
|
/**
|
39
35
|
* Model.
|
@@ -212,6 +212,98 @@ export class ChatsImpl extends Chats {
|
|
212
212
|
return chat
|
213
213
|
}
|
214
214
|
|
215
|
+
async createWithLibraryFolder(libraryId: string, folderIds: string[] | null = null): Promise<Chat | undefined>{
|
216
|
+
if (libraryId === undefined || libraryId === null || libraryId.trim() === "") {
|
217
|
+
throw new Error("Create chat with library folder, library id is undefined, null or empty")
|
218
|
+
}
|
219
|
+
|
220
|
+
// send create request to the server
|
221
|
+
const response = await this.context
|
222
|
+
.resolve(RpcService)
|
223
|
+
?.requestBuilder("api/v1/chats/library/folders")
|
224
|
+
.sendPostJson({
|
225
|
+
libraryId: libraryId,
|
226
|
+
folderIds: folderIds,
|
227
|
+
model: "search",
|
228
|
+
clientContext: "",
|
229
|
+
})
|
230
|
+
|
231
|
+
// check response status
|
232
|
+
if (ResponseUtils.isFail(response)) {
|
233
|
+
if (await ResponseUtils.isLimitReached()){
|
234
|
+
return undefined
|
235
|
+
}
|
236
|
+
|
237
|
+
await ResponseUtils.throwError(`Failed to create chat in library with folder, library: ${libraryId}`, response)
|
238
|
+
}
|
239
|
+
|
240
|
+
// parse workspace from the server's response
|
241
|
+
const content = (await response!.json() as {
|
242
|
+
chat: ChatDto
|
243
|
+
}).chat as ChatDto
|
244
|
+
|
245
|
+
// create workspace implementation
|
246
|
+
const chat = new ChatImpl(this.context, this.organization)
|
247
|
+
await chat.initFrom(content)
|
248
|
+
|
249
|
+
// add chat to the collection
|
250
|
+
this._chats.push(chat)
|
251
|
+
|
252
|
+
// dispatch event
|
253
|
+
this.dispatch({
|
254
|
+
type: ChatsEvent.ADDED,
|
255
|
+
data: chat
|
256
|
+
})
|
257
|
+
|
258
|
+
return chat
|
259
|
+
}
|
260
|
+
|
261
|
+
async createWithLibraryFile(libraryId: string, fileId: string): Promise<Chat | undefined>{
|
262
|
+
if (libraryId === undefined || libraryId === null || libraryId.trim() === "") {
|
263
|
+
throw new Error("Create chat with library file, library id is undefined, null or empty")
|
264
|
+
}
|
265
|
+
|
266
|
+
// send create request to the server
|
267
|
+
const response = await this.context
|
268
|
+
.resolve(RpcService)
|
269
|
+
?.requestBuilder("api/v1/chats/library/file")
|
270
|
+
.sendPostJson({
|
271
|
+
libraryId: libraryId,
|
272
|
+
fileId: fileId,
|
273
|
+
model: "search",
|
274
|
+
clientContext: "",
|
275
|
+
})
|
276
|
+
|
277
|
+
// check response status
|
278
|
+
if (ResponseUtils.isFail(response)) {
|
279
|
+
if (await ResponseUtils.isLimitReached()){
|
280
|
+
return undefined
|
281
|
+
}
|
282
|
+
|
283
|
+
await ResponseUtils.throwError(`Failed to create chat in library with file, library: ${libraryId}`, response)
|
284
|
+
}
|
285
|
+
|
286
|
+
// parse workspace from the server's response
|
287
|
+
const content = (await response!.json() as {
|
288
|
+
chat: ChatDto
|
289
|
+
}).chat as ChatDto
|
290
|
+
|
291
|
+
// create workspace implementation
|
292
|
+
const chat = new ChatImpl(this.context, this.organization)
|
293
|
+
await chat.initFrom(content)
|
294
|
+
|
295
|
+
// add chat to the collection
|
296
|
+
this._chats.push(chat)
|
297
|
+
|
298
|
+
// dispatch event
|
299
|
+
this.dispatch({
|
300
|
+
type: ChatsEvent.ADDED,
|
301
|
+
data: chat
|
302
|
+
})
|
303
|
+
|
304
|
+
return chat
|
305
|
+
}
|
306
|
+
|
215
307
|
|
216
308
|
|
217
309
|
|
@@ -40,6 +40,20 @@ export abstract class Chats extends EventDispatcher<ChatsEvent, Chat> {
|
|
40
40
|
*/
|
41
41
|
abstract createWithWorkspace(workspaceIds: string[], clientContext: string): Promise<Chat | undefined>
|
42
42
|
|
43
|
+
/**
|
44
|
+
* Create chat with library folders
|
45
|
+
* @param libraryId
|
46
|
+
* @param folderIds
|
47
|
+
*/
|
48
|
+
abstract createWithLibraryFolder(libraryId: string, folderIds: string[]): Promise<Chat | undefined>
|
49
|
+
|
50
|
+
/**
|
51
|
+
* Create chat with library file
|
52
|
+
* @param libraryId
|
53
|
+
* @param fileId
|
54
|
+
*/
|
55
|
+
abstract createWithLibraryFile(libraryId: string, fileId: string): Promise<Chat | undefined>
|
56
|
+
|
43
57
|
/**
|
44
58
|
* Get chat by id.
|
45
59
|
* @param id
|
@@ -0,0 +1,192 @@
|
|
1
|
+
import {Libraries} from "./libraries"
|
2
|
+
import {Library, LibraryId} from "./library"
|
3
|
+
import {LibraryImpl} from "./library.impl"
|
4
|
+
import {Context} from "../../context"
|
5
|
+
import {
|
6
|
+
CreateLibraryResponse,
|
7
|
+
LibrariesResponse, LibraryDto, LibraryResponse
|
8
|
+
} from "../../dto/libraryResponse"
|
9
|
+
import {RpcService} from "../../services/rpcService"
|
10
|
+
import {ResponseUtils} from "../../services/responseUtils"
|
11
|
+
import {OrganizationId} from "../organizations/organizations"
|
12
|
+
|
13
|
+
|
14
|
+
export class LibrariesImpl extends Libraries {
|
15
|
+
private readonly _libraries: LibraryImpl[] = []
|
16
|
+
|
17
|
+
constructor(
|
18
|
+
private readonly context: Context
|
19
|
+
) {
|
20
|
+
super()
|
21
|
+
}
|
22
|
+
|
23
|
+
async initialize(){
|
24
|
+
// fetch limits
|
25
|
+
const response = await this.context.resolve(RpcService)
|
26
|
+
?.requestBuilder("api/v1/libraries")
|
27
|
+
.sendGet()
|
28
|
+
|
29
|
+
// check response status
|
30
|
+
if (ResponseUtils.isFail(response)) {
|
31
|
+
await ResponseUtils.throwError("Failed to get libraries", response)
|
32
|
+
}
|
33
|
+
|
34
|
+
const json = await response!.json()
|
35
|
+
|
36
|
+
// parse limits from the server's response
|
37
|
+
const libraries = (json as LibrariesResponse).libraries
|
38
|
+
|
39
|
+
for (const library of libraries){
|
40
|
+
const impl = new LibraryImpl(this.context)
|
41
|
+
await impl.initFrom(library)
|
42
|
+
this._libraries.push(impl)
|
43
|
+
}
|
44
|
+
}
|
45
|
+
|
46
|
+
|
47
|
+
get collection(): readonly Library[] {
|
48
|
+
return this._libraries
|
49
|
+
}
|
50
|
+
|
51
|
+
async createLibrary(name: string, region: number, isPublic: boolean): Promise<LibraryId>{
|
52
|
+
if (
|
53
|
+
name === undefined ||
|
54
|
+
name === null ||
|
55
|
+
name.trim() === ""
|
56
|
+
) {
|
57
|
+
throw new Error("Name for library is required, must be not empty")
|
58
|
+
}
|
59
|
+
|
60
|
+
if (
|
61
|
+
isPublic === undefined ||
|
62
|
+
isPublic === null
|
63
|
+
) {
|
64
|
+
throw new Error("IsPublic is required, must be not empty")
|
65
|
+
}
|
66
|
+
|
67
|
+
// send create request to the server
|
68
|
+
const response = await this.context
|
69
|
+
.resolve(RpcService)
|
70
|
+
?.requestBuilder("api/v1/libraries/management")
|
71
|
+
.sendPostJson({
|
72
|
+
name: name,
|
73
|
+
region: region,
|
74
|
+
isPublic: isPublic
|
75
|
+
})
|
76
|
+
|
77
|
+
// check response status
|
78
|
+
if (ResponseUtils.isFail(response)) {
|
79
|
+
await ResponseUtils.throwError(`Failed to create library ${name}`, response)
|
80
|
+
}
|
81
|
+
|
82
|
+
|
83
|
+
const library = (await response!.json()) as CreateLibraryResponse
|
84
|
+
|
85
|
+
return library.libraryId
|
86
|
+
}
|
87
|
+
|
88
|
+
async addOrgToLibrary(libraryId: LibraryId, organizationId: OrganizationId): Promise<void>{
|
89
|
+
if (libraryId === undefined || libraryId === null) {
|
90
|
+
throw new Error("Organization add to library, libraryId is undefined or null")
|
91
|
+
}
|
92
|
+
if (libraryId.length === 0 || libraryId.trim().length === 0) {
|
93
|
+
throw new Error("Organization add to from library, libraryId is empty")
|
94
|
+
}
|
95
|
+
if (organizationId === undefined || organizationId === null) {
|
96
|
+
throw new Error("Organization add to from library, organizationId is undefined or null")
|
97
|
+
}
|
98
|
+
if (organizationId.length === 0 || organizationId.trim().length === 0) {
|
99
|
+
throw new Error("Organization add to from library, organizationId is empty")
|
100
|
+
}
|
101
|
+
|
102
|
+
const response = await this.context
|
103
|
+
.resolve(RpcService)
|
104
|
+
?.requestBuilder("api/v1/libraries/management/allowed/organization")
|
105
|
+
.sendPutJson({
|
106
|
+
libraryId: libraryId,
|
107
|
+
organizationId: organizationId
|
108
|
+
})
|
109
|
+
if (ResponseUtils.isFail(response)) {
|
110
|
+
await ResponseUtils.throwError(
|
111
|
+
`Organization ${organizationId} add to library ${libraryId} failed`,
|
112
|
+
response
|
113
|
+
)
|
114
|
+
}
|
115
|
+
}
|
116
|
+
|
117
|
+
async getLibraries(): Promise<LibraryDto[]>{
|
118
|
+
const response = await this.context
|
119
|
+
.resolve(RpcService)
|
120
|
+
?.requestBuilder("api/v1/libraries/management/allowed/organizations")
|
121
|
+
.sendGet()
|
122
|
+
|
123
|
+
// check response status
|
124
|
+
if (ResponseUtils.isFail(response)) {
|
125
|
+
await ResponseUtils.throwError(
|
126
|
+
"Can not get libraries",
|
127
|
+
response
|
128
|
+
)
|
129
|
+
}
|
130
|
+
|
131
|
+
// parse libraries from the server's response
|
132
|
+
const libraries = (await response!.json()) as LibraryResponse
|
133
|
+
|
134
|
+
return libraries.libraries
|
135
|
+
}
|
136
|
+
|
137
|
+
async deleteOrgFromLibrary(libraryId: LibraryId, organizationId: OrganizationId): Promise<void>{
|
138
|
+
if (libraryId === undefined || libraryId === null) {
|
139
|
+
throw new Error("Organization delete from library, libraryId is undefined or null")
|
140
|
+
}
|
141
|
+
if (libraryId.length === 0 || libraryId.trim().length === 0) {
|
142
|
+
throw new Error("Organization delete from library, libraryId is empty")
|
143
|
+
}
|
144
|
+
if (organizationId === undefined || organizationId === null) {
|
145
|
+
throw new Error("Organization delete from library, organizationId is undefined or null")
|
146
|
+
}
|
147
|
+
if (organizationId.length === 0 || organizationId.trim().length === 0) {
|
148
|
+
throw new Error("Organization delete from library, organizationId is empty")
|
149
|
+
}
|
150
|
+
|
151
|
+
// send request to the server
|
152
|
+
const response = await this.context
|
153
|
+
.resolve(RpcService)
|
154
|
+
?.requestBuilder("api/v1/libraries/management/allowed/organization")
|
155
|
+
.searchParam("libraryId", libraryId)
|
156
|
+
.searchParam("organizationId", organizationId)
|
157
|
+
.sendDelete()
|
158
|
+
|
159
|
+
// check response status
|
160
|
+
if (ResponseUtils.isFail(response)) {
|
161
|
+
await ResponseUtils.throwError(
|
162
|
+
`Organization ${organizationId} delete from library ${libraryId}, failed`,
|
163
|
+
response
|
164
|
+
)
|
165
|
+
}
|
166
|
+
}
|
167
|
+
|
168
|
+
async deleteLibrary(libraryId: LibraryId): Promise<void>{
|
169
|
+
if (libraryId === undefined || libraryId === null) {
|
170
|
+
throw new Error("Library delete, libraryId is undefined or null")
|
171
|
+
}
|
172
|
+
if (libraryId.length === 0 || libraryId.trim().length === 0) {
|
173
|
+
throw new Error("Library delete, libraryId is empty")
|
174
|
+
}
|
175
|
+
|
176
|
+
// send request to the server
|
177
|
+
const response = await this.context
|
178
|
+
.resolve(RpcService)
|
179
|
+
?.requestBuilder("api/v1/libraries/management")
|
180
|
+
.searchParam("libraryId", libraryId)
|
181
|
+
.sendDelete()
|
182
|
+
|
183
|
+
// check response status
|
184
|
+
if (ResponseUtils.isFail(response)) {
|
185
|
+
await ResponseUtils.throwError(
|
186
|
+
`Library ${libraryId} delete, failed`,
|
187
|
+
response
|
188
|
+
)
|
189
|
+
}
|
190
|
+
}
|
191
|
+
|
192
|
+
}
|
@@ -0,0 +1,20 @@
|
|
1
|
+
|
2
|
+
import {Library, LibraryId} from "./library"
|
3
|
+
import {OrganizationId} from "../organizations/organizations"
|
4
|
+
import {LibraryDto} from "../../dto/libraryResponse"
|
5
|
+
|
6
|
+
|
7
|
+
export abstract class Libraries {
|
8
|
+
|
9
|
+
abstract get collection(): ReadonlyArray<Library>
|
10
|
+
|
11
|
+
abstract createLibrary(name: string, region: number, isPublic: boolean): Promise<LibraryId>
|
12
|
+
|
13
|
+
abstract addOrgToLibrary(libraryId: LibraryId, organizationId: OrganizationId): Promise<void>
|
14
|
+
|
15
|
+
abstract getLibraries(): Promise<LibraryDto[]>
|
16
|
+
|
17
|
+
abstract deleteOrgFromLibrary(libraryId: LibraryId, organizationId: OrganizationId): Promise<void>
|
18
|
+
|
19
|
+
abstract deleteLibrary(libraryId: LibraryId): Promise<void>
|
20
|
+
}
|