@neuralinnovations/dataisland-sdk 0.0.1-dev4 → 0.0.1-dev41
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/LICENSE +201 -0
- package/README.md +283 -37
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -0
- package/dist/package.json +103 -0
- package/dist/src/appBuilder.d.ts +44 -0
- package/dist/src/appBuilder.d.ts.map +1 -0
- package/dist/src/appBuilder.js +10 -0
- package/dist/src/appBuilder.js.map +1 -0
- package/dist/src/commands/deleteUserFullCommandHandler.d.ts +7 -0
- package/dist/src/commands/deleteUserFullCommandHandler.d.ts.map +1 -0
- package/dist/src/commands/deleteUserFullCommandHandler.js +21 -0
- package/dist/src/commands/deleteUserFullCommandHandler.js.map +1 -0
- package/dist/src/commands/startCommandHandler.d.ts +7 -0
- package/dist/src/commands/startCommandHandler.d.ts.map +1 -0
- package/dist/src/commands/startCommandHandler.js +27 -0
- package/dist/src/commands/startCommandHandler.js.map +1 -0
- package/dist/src/context.d.ts +24 -0
- package/dist/src/context.d.ts.map +1 -0
- package/dist/src/context.js +31 -0
- package/dist/src/context.js.map +1 -0
- package/dist/src/credentials.d.ts +33 -0
- package/dist/src/credentials.d.ts.map +1 -0
- package/dist/src/credentials.js +87 -0
- package/dist/src/credentials.js.map +1 -0
- package/dist/src/dataIslandApp.d.ts +55 -0
- package/dist/src/dataIslandApp.d.ts.map +1 -0
- package/dist/src/dataIslandApp.js +10 -0
- package/dist/src/dataIslandApp.js.map +1 -0
- package/dist/src/disposable.d.ts +84 -0
- package/dist/src/disposable.d.ts.map +1 -0
- package/dist/src/disposable.js +147 -0
- package/dist/src/disposable.js.map +1 -0
- package/dist/src/dto/accessGroupResponse.d.ts +30 -0
- package/dist/src/dto/accessGroupResponse.d.ts.map +1 -0
- package/dist/src/dto/accessGroupResponse.js +3 -0
- package/dist/src/dto/accessGroupResponse.js.map +1 -0
- package/dist/src/dto/acquiringResponse.d.ts +38 -0
- package/dist/src/dto/acquiringResponse.d.ts.map +1 -0
- package/dist/src/dto/acquiringResponse.js +12 -0
- package/dist/src/dto/acquiringResponse.js.map +1 -0
- package/dist/src/dto/badRequestResponse.d.ts +6 -0
- package/dist/src/dto/badRequestResponse.d.ts.map +1 -0
- package/dist/src/dto/badRequestResponse.js +3 -0
- package/dist/src/dto/badRequestResponse.js.map +1 -0
- package/dist/src/dto/chatResponse.d.ts +83 -0
- package/dist/src/dto/chatResponse.d.ts.map +1 -0
- package/dist/src/dto/chatResponse.js +45 -0
- package/dist/src/dto/chatResponse.js.map +1 -0
- package/dist/src/dto/limitsResponse.d.ts +29 -0
- package/dist/src/dto/limitsResponse.d.ts.map +1 -0
- package/dist/src/dto/limitsResponse.js +13 -0
- package/dist/src/dto/limitsResponse.js.map +1 -0
- package/dist/src/dto/statisticsResponse.d.ts +11 -0
- package/dist/src/dto/statisticsResponse.d.ts.map +1 -0
- package/dist/src/dto/statisticsResponse.js +3 -0
- package/dist/src/dto/statisticsResponse.js.map +1 -0
- package/dist/src/dto/userInfoResponse.d.ts +88 -0
- package/dist/src/dto/userInfoResponse.d.ts.map +1 -0
- package/dist/src/dto/userInfoResponse.js +3 -0
- package/dist/src/dto/userInfoResponse.js.map +1 -0
- package/dist/src/dto/workspacesResponse.d.ts +45 -0
- package/dist/src/dto/workspacesResponse.d.ts.map +1 -0
- package/dist/src/dto/workspacesResponse.js +3 -0
- package/dist/src/dto/workspacesResponse.js.map +1 -0
- package/dist/src/events.d.ts +17 -0
- package/dist/src/events.d.ts.map +1 -0
- package/dist/src/events.js +52 -0
- package/dist/src/events.js.map +1 -0
- package/dist/src/index.d.ts +66 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +113 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/internal/app.impl.d.ts +30 -0
- package/dist/src/internal/app.impl.d.ts.map +1 -0
- package/dist/src/internal/app.impl.js +180 -0
- package/dist/src/internal/app.impl.js.map +1 -0
- package/dist/src/internal/appBuilder.impl.d.ts +27 -0
- package/dist/src/internal/appBuilder.impl.d.ts.map +1 -0
- package/dist/src/internal/appBuilder.impl.js +71 -0
- package/dist/src/internal/appBuilder.impl.js.map +1 -0
- package/dist/src/internal/createApp.impl.d.ts +4 -0
- package/dist/src/internal/createApp.impl.d.ts.map +1 -0
- package/dist/src/internal/createApp.impl.js +11 -0
- package/dist/src/internal/createApp.impl.js.map +1 -0
- package/dist/src/internal/registry.d.ts +66 -0
- package/dist/src/internal/registry.d.ts.map +1 -0
- package/dist/src/internal/registry.js +114 -0
- package/dist/src/internal/registry.js.map +1 -0
- package/dist/src/middleware.d.ts +6 -0
- package/dist/src/middleware.d.ts.map +1 -0
- package/dist/src/middleware.js +3 -0
- package/dist/src/middleware.js.map +1 -0
- package/dist/src/services/acquiringService.d.ts +8 -0
- package/dist/src/services/acquiringService.d.ts.map +1 -0
- package/dist/src/services/acquiringService.js +40 -0
- package/dist/src/services/acquiringService.js.map +1 -0
- package/dist/src/services/anonymousService.d.ts +8 -0
- package/dist/src/services/anonymousService.d.ts.map +1 -0
- package/dist/src/services/anonymousService.js +41 -0
- package/dist/src/services/anonymousService.js.map +1 -0
- package/dist/src/services/commandService.d.ts +18 -0
- package/dist/src/services/commandService.d.ts.map +1 -0
- package/dist/src/services/commandService.js +40 -0
- package/dist/src/services/commandService.js.map +1 -0
- package/dist/src/services/cookieService.d.ts +7 -0
- package/dist/src/services/cookieService.d.ts.map +1 -0
- package/dist/src/services/cookieService.js +18 -0
- package/dist/src/services/cookieService.js.map +1 -0
- package/dist/src/services/credentialService.d.ts +9 -0
- package/dist/src/services/credentialService.d.ts.map +1 -0
- package/dist/src/services/credentialService.js +26 -0
- package/dist/src/services/credentialService.js.map +1 -0
- package/dist/src/services/httpMethod.d.ts +2 -0
- package/dist/src/services/httpMethod.d.ts.map +1 -0
- package/dist/src/services/httpMethod.js +3 -0
- package/dist/src/services/httpMethod.js.map +1 -0
- package/dist/src/services/middlewareService.d.ts +10 -0
- package/dist/src/services/middlewareService.d.ts.map +1 -0
- package/dist/src/services/middlewareService.js +34 -0
- package/dist/src/services/middlewareService.js.map +1 -0
- package/dist/src/services/organizationService.d.ts +10 -0
- package/dist/src/services/organizationService.d.ts.map +1 -0
- package/dist/src/services/organizationService.js +19 -0
- package/dist/src/services/organizationService.js.map +1 -0
- package/dist/src/services/requestBuilder.d.ts +17 -0
- package/dist/src/services/requestBuilder.d.ts.map +1 -0
- package/dist/src/services/requestBuilder.js +105 -0
- package/dist/src/services/requestBuilder.js.map +1 -0
- package/dist/src/services/responseUtils.d.ts +8 -0
- package/dist/src/services/responseUtils.d.ts.map +1 -0
- package/dist/src/services/responseUtils.js +40 -0
- package/dist/src/services/responseUtils.js.map +1 -0
- package/dist/src/services/rpcService.d.ts +77 -0
- package/dist/src/services/rpcService.d.ts.map +1 -0
- package/dist/src/services/rpcService.js +125 -0
- package/dist/src/services/rpcService.js.map +1 -0
- package/dist/src/services/service.d.ts +21 -0
- package/dist/src/services/service.d.ts.map +1 -0
- package/dist/src/services/service.js +41 -0
- package/dist/src/services/service.js.map +1 -0
- package/dist/src/services/userProfileService.d.ts +9 -0
- package/dist/src/services/userProfileService.d.ts.map +1 -0
- package/dist/src/services/userProfileService.js +43 -0
- package/dist/src/services/userProfileService.js.map +1 -0
- package/dist/src/storages/chats/answer.d.ts +41 -0
- package/dist/src/storages/chats/answer.d.ts.map +1 -0
- package/dist/src/storages/chats/answer.impl.d.ts +29 -0
- package/dist/src/storages/chats/answer.impl.d.ts.map +1 -0
- package/dist/src/storages/chats/answer.impl.js +116 -0
- package/dist/src/storages/chats/answer.impl.js.map +1 -0
- package/dist/src/storages/chats/answer.js +15 -0
- package/dist/src/storages/chats/answer.js.map +1 -0
- package/dist/src/storages/chats/chat.d.ts +43 -0
- package/dist/src/storages/chats/chat.d.ts.map +1 -0
- package/dist/src/storages/chats/chat.impl.d.ts +25 -0
- package/dist/src/storages/chats/chat.impl.d.ts.map +1 -0
- package/dist/src/storages/chats/chat.impl.js +85 -0
- package/dist/src/storages/chats/chat.impl.js.map +1 -0
- package/dist/src/storages/chats/chat.js +12 -0
- package/dist/src/storages/chats/chat.js.map +1 -0
- package/dist/src/storages/chats/chats.d.ts +45 -0
- package/dist/src/storages/chats/chats.d.ts.map +1 -0
- package/dist/src/storages/chats/chats.impl.d.ts +19 -0
- package/dist/src/storages/chats/chats.impl.d.ts.map +1 -0
- package/dist/src/storages/chats/chats.impl.js +147 -0
- package/dist/src/storages/chats/chats.impl.js.map +1 -0
- package/dist/src/storages/chats/chats.js +16 -0
- package/dist/src/storages/chats/chats.js.map +1 -0
- package/dist/src/storages/files/file.d.ts +47 -0
- package/dist/src/storages/files/file.d.ts.map +1 -0
- package/dist/src/storages/files/file.impl.d.ts +25 -0
- package/dist/src/storages/files/file.impl.d.ts.map +1 -0
- package/dist/src/storages/files/file.impl.js +93 -0
- package/dist/src/storages/files/file.impl.js.map +1 -0
- package/dist/src/storages/files/file.js +17 -0
- package/dist/src/storages/files/file.js.map +1 -0
- package/dist/src/storages/files/files.d.ts +39 -0
- package/dist/src/storages/files/files.d.ts.map +1 -0
- package/dist/src/storages/files/files.impl.d.ts +24 -0
- package/dist/src/storages/files/files.impl.d.ts.map +1 -0
- package/dist/src/storages/files/files.impl.js +168 -0
- package/dist/src/storages/files/files.impl.js.map +1 -0
- package/dist/src/storages/files/files.js +20 -0
- package/dist/src/storages/files/files.js.map +1 -0
- package/dist/src/storages/files/filesPage.d.ts +28 -0
- package/dist/src/storages/files/filesPage.d.ts.map +1 -0
- package/dist/src/storages/files/filesPage.impl.d.ts +15 -0
- package/dist/src/storages/files/filesPage.impl.d.ts.map +1 -0
- package/dist/src/storages/files/filesPage.impl.js +38 -0
- package/dist/src/storages/files/filesPage.impl.js.map +1 -0
- package/dist/src/storages/files/filesPage.js +10 -0
- package/dist/src/storages/files/filesPage.js.map +1 -0
- package/dist/src/storages/groups/group.d.ts +63 -0
- package/dist/src/storages/groups/group.d.ts.map +1 -0
- package/dist/src/storages/groups/group.impl.d.ts +38 -0
- package/dist/src/storages/groups/group.impl.d.ts.map +1 -0
- package/dist/src/storages/groups/group.impl.js +210 -0
- package/dist/src/storages/groups/group.impl.js.map +1 -0
- package/dist/src/storages/groups/group.js +15 -0
- package/dist/src/storages/groups/group.js.map +1 -0
- package/dist/src/storages/groups/groups.d.ts +39 -0
- package/dist/src/storages/groups/groups.d.ts.map +1 -0
- package/dist/src/storages/groups/groups.impl.d.ts +30 -0
- package/dist/src/storages/groups/groups.impl.d.ts.map +1 -0
- package/dist/src/storages/groups/groups.impl.js +132 -0
- package/dist/src/storages/groups/groups.impl.js.map +1 -0
- package/dist/src/storages/groups/groups.js +20 -0
- package/dist/src/storages/groups/groups.js.map +1 -0
- package/dist/src/storages/organizations/organization.d.ts +95 -0
- package/dist/src/storages/organizations/organization.d.ts.map +1 -0
- package/dist/src/storages/organizations/organization.impl.d.ts +42 -0
- package/dist/src/storages/organizations/organization.impl.d.ts.map +1 -0
- package/dist/src/storages/organizations/organization.impl.js +240 -0
- package/dist/src/storages/organizations/organization.impl.js.map +1 -0
- package/dist/src/storages/organizations/organization.js +18 -0
- package/dist/src/storages/organizations/organization.js.map +1 -0
- package/dist/src/storages/organizations/organizations.d.ts +46 -0
- package/dist/src/storages/organizations/organizations.d.ts.map +1 -0
- package/dist/src/storages/organizations/organizations.impl.d.ts +38 -0
- package/dist/src/storages/organizations/organizations.impl.d.ts.map +1 -0
- package/dist/src/storages/organizations/organizations.impl.js +158 -0
- package/dist/src/storages/organizations/organizations.impl.js.map +1 -0
- package/dist/src/storages/organizations/organizations.js +20 -0
- package/dist/src/storages/organizations/organizations.js.map +1 -0
- package/dist/src/storages/user/userProfile.d.ts +54 -0
- package/dist/src/storages/user/userProfile.d.ts.map +1 -0
- package/dist/src/storages/user/userProfile.impl.d.ts +21 -0
- package/dist/src/storages/user/userProfile.impl.d.ts.map +1 -0
- package/dist/src/storages/user/userProfile.impl.js +114 -0
- package/dist/src/storages/user/userProfile.impl.js.map +1 -0
- package/dist/src/storages/user/userProfile.js +12 -0
- package/dist/src/storages/user/userProfile.js.map +1 -0
- package/dist/src/storages/workspaces/workspace.d.ts +44 -0
- package/dist/src/storages/workspaces/workspace.d.ts.map +1 -0
- package/dist/src/storages/workspaces/workspace.impl.d.ts +23 -0
- package/dist/src/storages/workspaces/workspace.impl.d.ts.map +1 -0
- package/dist/src/storages/workspaces/workspace.impl.js +98 -0
- package/dist/src/storages/workspaces/workspace.impl.js.map +1 -0
- package/dist/src/storages/workspaces/workspace.js +18 -0
- package/dist/src/storages/workspaces/workspace.js.map +1 -0
- package/dist/src/storages/workspaces/workspaces.d.ts +47 -0
- package/dist/src/storages/workspaces/workspaces.d.ts.map +1 -0
- package/dist/src/storages/workspaces/workspaces.impl.d.ts +33 -0
- package/dist/src/storages/workspaces/workspaces.impl.d.ts.map +1 -0
- package/dist/src/storages/workspaces/workspaces.impl.js +152 -0
- package/dist/src/storages/workspaces/workspaces.impl.js.map +1 -0
- package/dist/src/storages/workspaces/workspaces.js +19 -0
- package/dist/src/storages/workspaces/workspaces.js.map +1 -0
- package/dist/src/unitTest.d.ts +12 -0
- package/dist/src/unitTest.d.ts.map +1 -0
- package/dist/src/unitTest.js +44 -0
- package/dist/src/unitTest.js.map +1 -0
- package/dist/src/utils/browserUtils.d.ts +4 -0
- package/dist/src/utils/browserUtils.d.ts.map +1 -0
- package/dist/src/utils/browserUtils.js +64 -0
- package/dist/src/utils/browserUtils.js.map +1 -0
- package/dist/src/utils/request.d.ts +6 -0
- package/dist/src/utils/request.d.ts.map +1 -0
- package/dist/src/utils/request.js +3 -0
- package/dist/src/utils/request.js.map +1 -0
- package/dist/src/utils/utils.d.ts +3 -0
- package/dist/src/utils/utils.d.ts.map +1 -0
- package/dist/src/utils/utils.js +13 -0
- package/dist/src/utils/utils.js.map +1 -0
- package/index.d.ts +1 -0
- package/index.js +1 -0
- package/package.json +46 -5
- package/src/commands/deleteUserFullCommandHandler.ts +19 -0
- package/src/commands/startCommandHandler.ts +16 -5
- package/src/context.ts +4 -2
- package/src/credentials.ts +22 -0
- package/src/{appSdk.ts → dataIslandApp.ts} +9 -3
- package/src/disposable.ts +18 -5
- package/src/dto/accessGroupResponse.ts +19 -16
- package/src/dto/acquiringResponse.ts +45 -0
- package/src/dto/badRequestResponse.ts +6 -0
- package/src/dto/chatResponse.ts +59 -54
- package/src/dto/limitsResponse.ts +33 -0
- package/src/dto/statisticsResponse.ts +12 -0
- package/src/dto/userInfoResponse.ts +59 -2
- package/src/dto/workspacesResponse.ts +5 -3
- package/src/index.ts +46 -24
- package/src/internal/app.impl.ts +52 -10
- package/src/internal/createApp.impl.ts +4 -4
- package/src/internal/registry.ts +54 -6
- package/src/middleware.ts +2 -0
- package/src/services/acquiringService.ts +50 -0
- package/src/services/anonymousService.ts +43 -0
- package/src/services/commandService.ts +4 -2
- package/src/services/cookieService.ts +16 -0
- package/src/services/httpMethod.ts +1 -0
- package/src/services/middlewareService.ts +1 -0
- package/src/services/organizationService.ts +2 -2
- package/src/services/requestBuilder.ts +10 -8
- package/src/services/responseUtils.ts +12 -0
- package/src/services/rpcService.ts +1 -0
- package/src/services/userProfileService.ts +18 -4
- package/src/storages/chats/answer.impl.ts +160 -0
- package/src/storages/chats/answer.ts +53 -0
- package/src/storages/chats/chat.impl.ts +107 -0
- package/src/storages/chats/chat.ts +55 -0
- package/src/storages/chats/chats.impl.ts +204 -0
- package/src/storages/chats/chats.ts +53 -0
- package/src/storages/files/file.impl.ts +111 -0
- package/src/storages/files/file.ts +58 -0
- package/src/storages/{files.impl.ts → files/files.impl.ts} +67 -46
- package/src/storages/{files.ts → files/files.ts} +14 -7
- package/src/storages/files/filesPage.impl.ts +37 -0
- package/src/storages/{filesPage.ts → files/filesPage.ts} +6 -0
- package/src/storages/groups/group.impl.ts +276 -0
- package/src/storages/groups/group.ts +73 -0
- package/src/storages/groups/groups.impl.ts +175 -0
- package/src/storages/groups/groups.ts +45 -0
- package/src/storages/organizations/organization.impl.ts +357 -0
- package/src/storages/organizations/organization.ts +118 -0
- package/src/storages/{organizations.impl.ts → organizations/organizations.impl.ts} +31 -13
- package/src/storages/{organizations.ts → organizations/organizations.ts} +1 -1
- package/src/storages/user/userProfile.impl.ts +136 -0
- package/src/storages/user/userProfile.ts +69 -0
- package/src/storages/{workspace.impl.ts → workspaces/workspace.impl.ts} +27 -7
- package/src/storages/{workspace.ts → workspaces/workspace.ts} +8 -3
- package/src/storages/{workspaces.impl.ts → workspaces/workspaces.impl.ts} +27 -32
- package/src/storages/{workspaces.ts → workspaces/workspaces.ts} +6 -2
- package/src/unitTest.ts +14 -3
- package/src/utils/browserUtils.ts +68 -0
- package/src/utils/request.ts +6 -0
- package/src/utils/utils.ts +8 -0
- package/.browserslistrc +0 -5
- package/.editorconfig +0 -25
- package/.eslintrc.json +0 -44
- package/.github/workflows/publish-npm.yml +0 -28
- package/.prettierignore +0 -1
- package/.prettierrc +0 -11
- package/.yarnrc +0 -2
- package/babel.config.js +0 -6
- package/jest.config.ts +0 -199
- package/jest.setup.ts +0 -2
- package/src/storages/chat.ts +0 -21
- package/src/storages/chats.ts +0 -17
- package/src/storages/file.impl.ts +0 -69
- package/src/storages/file.ts +0 -28
- package/src/storages/groups.impl.ts +0 -337
- package/src/storages/groups.ts +0 -43
- package/src/storages/organization.impl.ts +0 -68
- package/src/storages/organization.ts +0 -33
- package/src/storages/userProfile.impl.ts +0 -56
- package/src/storages/userProfile.ts +0 -42
- package/test/commands.test.ts +0 -24
- package/test/data/test_file.pdf +0 -0
- package/test/disposable.test.ts +0 -39
- package/test/events.test.ts +0 -151
- package/test/files.test.ts +0 -52
- package/test/index.test.ts +0 -122
- package/test/organization.test.ts +0 -57
- package/test/registry.test.ts +0 -44
- package/test/services.test.ts +0 -56
- package/test/setup.ts +0 -54
- package/test/unitTest.test.ts +0 -21
- package/test/workspace.test.ts +0 -71
- package/tsconfig.json +0 -31
@@ -0,0 +1,103 @@
|
|
1
|
+
{
|
2
|
+
"name": "@neuralinnovations/dataisland-sdk",
|
3
|
+
"version": "0.0.1-dev41",
|
4
|
+
"description": "SDK for DataIsland project",
|
5
|
+
"licenses": [
|
6
|
+
{
|
7
|
+
"type": "Apache-2.0",
|
8
|
+
"url": "https://www.apache.org/licenses/LICENSE-2.0.html"
|
9
|
+
}
|
10
|
+
],
|
11
|
+
"repository": {
|
12
|
+
"type": "git",
|
13
|
+
"url": "https://github.com/NeuralInnovations/dataisland-client-js-sdk.git"
|
14
|
+
},
|
15
|
+
"scripts": {
|
16
|
+
"build": "tsc",
|
17
|
+
"test": "jest",
|
18
|
+
"lint": "eslint --ext .ts,.tsx src test",
|
19
|
+
"lint:fix": "eslint --fix --ext .ts,.tsx src test",
|
20
|
+
"docs": "typedoc --disableSources --includeVersion --plugin typedoc-plugin-markdown --out docs src/index.ts && node scripts/docs/index.js",
|
21
|
+
"version-up-dev": "node scripts/version/up-dev.js && rm package-lock.json && npm install && npm run build && npm run lint:fix && npm run docs",
|
22
|
+
"release": "rm package-lock.json && npm install && npm run build && npm run lint:fix && npm run docs"
|
23
|
+
},
|
24
|
+
"publishConfig": {
|
25
|
+
"access": "public"
|
26
|
+
},
|
27
|
+
"exports": {
|
28
|
+
".": "./dist/index.js"
|
29
|
+
},
|
30
|
+
"main": "dist/index.js",
|
31
|
+
"types": "dist/index.d.ts",
|
32
|
+
"browser": "dist/index.js",
|
33
|
+
"directories": {
|
34
|
+
"test": "test"
|
35
|
+
},
|
36
|
+
"files": [
|
37
|
+
"dist",
|
38
|
+
"src",
|
39
|
+
"index.js",
|
40
|
+
"index.d.ts"
|
41
|
+
],
|
42
|
+
"engines": {
|
43
|
+
"node": ">=16"
|
44
|
+
},
|
45
|
+
"keywords": [
|
46
|
+
"dataisland",
|
47
|
+
"sdk",
|
48
|
+
"neuralinnovations",
|
49
|
+
"neural innovations",
|
50
|
+
"neural-innovations",
|
51
|
+
"neural"
|
52
|
+
],
|
53
|
+
"author": "Neural Innovations LTD",
|
54
|
+
"license": "Apache-2.0",
|
55
|
+
"bugs": {
|
56
|
+
"url": "https://github.com/NeuralInnovations/dataisland-client-js-sdk/issues"
|
57
|
+
},
|
58
|
+
"homepage": "https://github.com/NeuralInnovations/dataisland-client-js-sdk#readme",
|
59
|
+
"devDependencies": {
|
60
|
+
"@babel/core": "^7.22.11",
|
61
|
+
"@babel/plugin-transform-modules-commonjs": "7.22.11",
|
62
|
+
"@babel/preset-env": "^7.22.10",
|
63
|
+
"@babel/preset-typescript": "^7.23.3",
|
64
|
+
"@babel/register": "7.22.5",
|
65
|
+
"@jest/globals": "^29.7.0",
|
66
|
+
"@types/jest": "^29.5.11",
|
67
|
+
"@types/node": "^20.11.27",
|
68
|
+
"@types/node-fetch": "^2.6.11",
|
69
|
+
"@typescript-eslint/eslint-plugin": "^6.19.0",
|
70
|
+
"@typescript-eslint/parser": "^6.19.0",
|
71
|
+
"babel-jest": "^29.7.0",
|
72
|
+
"babel-loader": "8.3.0",
|
73
|
+
"eslint": "^8.56.0",
|
74
|
+
"eslint-config-semistandard": "^17.0.0",
|
75
|
+
"eslint-config-standard": "^17.1.0",
|
76
|
+
"eslint-config-standard-with-typescript": "^43.0.0",
|
77
|
+
"eslint-config-xo": "^0.43.1",
|
78
|
+
"eslint-config-xo-typescript": "^1.0.1",
|
79
|
+
"eslint-plugin-import": "^2.29.1",
|
80
|
+
"eslint-plugin-n": "^15.7.0",
|
81
|
+
"eslint-plugin-promise": "^6.1.1",
|
82
|
+
"eslint-plugin-react": "^7.33.2",
|
83
|
+
"glob": "7.2.3",
|
84
|
+
"jest": "^29.7.0",
|
85
|
+
"jest-environment-jsdom": "^29.7.0",
|
86
|
+
"prettier": "2.8.7",
|
87
|
+
"ts-jest": "^29.1.1",
|
88
|
+
"ts-loader": "8.4.0",
|
89
|
+
"ts-node": "10.9.1",
|
90
|
+
"tslib": "^2.6.2",
|
91
|
+
"tslint": "6.1.3",
|
92
|
+
"typedoc": "^0.25.7",
|
93
|
+
"typedoc-plugin-markdown": "^3.17.1",
|
94
|
+
"typescript": "^5.3.3",
|
95
|
+
"watch": "^0.13.0",
|
96
|
+
"webpack": "5.76.0",
|
97
|
+
"yargs": "17.7.2"
|
98
|
+
},
|
99
|
+
"dependencies": {
|
100
|
+
"dotenv": "^16.3.2",
|
101
|
+
"jsdom": "^23.2.0"
|
102
|
+
}
|
103
|
+
}
|
@@ -0,0 +1,44 @@
|
|
1
|
+
import type { Middleware } from "./middleware";
|
2
|
+
import type { CredentialBase } from "./credentials";
|
3
|
+
import type { Service, ServiceContext } from "./services/service";
|
4
|
+
import type { Constructor } from "./internal/registry";
|
5
|
+
import { CommandHandler, Command } from "./services/commandService";
|
6
|
+
import { Context } from "./context";
|
7
|
+
/**
|
8
|
+
* DataIsland App builder.
|
9
|
+
*/
|
10
|
+
export declare abstract class AppBuilder {
|
11
|
+
/**
|
12
|
+
* Set custom data.
|
13
|
+
*/
|
14
|
+
abstract get env(): Record<string, any>;
|
15
|
+
/**
|
16
|
+
* Add a middleware to the app.
|
17
|
+
*/
|
18
|
+
abstract registerMiddleware(middleware: Middleware): AppBuilder;
|
19
|
+
/**
|
20
|
+
* Host of the app.
|
21
|
+
*/
|
22
|
+
abstract useHost(host: string): AppBuilder;
|
23
|
+
/**
|
24
|
+
* GDPR compliant
|
25
|
+
*/
|
26
|
+
abstract useAutomaticDataCollectionEnabled(value: boolean): AppBuilder;
|
27
|
+
/**
|
28
|
+
* Credential of the app.
|
29
|
+
*/
|
30
|
+
abstract useCredential(credential: CredentialBase): AppBuilder;
|
31
|
+
/**
|
32
|
+
* Register a service to the app.
|
33
|
+
* @param type
|
34
|
+
* @param factory
|
35
|
+
*/
|
36
|
+
abstract registerService<T extends Service>(type: Constructor<T>, factory: (context: ServiceContext) => T): AppBuilder;
|
37
|
+
/**
|
38
|
+
* Register a command to the app.
|
39
|
+
* @param messageType
|
40
|
+
* @param commandFactory
|
41
|
+
*/
|
42
|
+
abstract registerCommand<T extends Command>(messageType: Constructor<T>, commandFactory: ((context: Context) => CommandHandler<T>) | ((context: Context) => (context: Context) => Promise<void>)): AppBuilder;
|
43
|
+
}
|
44
|
+
//# sourceMappingURL=appBuilder.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"appBuilder.d.ts","sourceRoot":"","sources":["../../src/appBuilder.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAC9C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AACnD,OAAO,KAAK,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AACjE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AACtD,OAAO,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAA;AACnE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAEnC;;GAEG;AACH,8BAAsB,UAAU;IAC9B;;OAEG;IACH,QAAQ,KAAK,GAAG,IAAI,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAEvC;;OAEG;IACH,QAAQ,CAAC,kBAAkB,CAAC,UAAU,EAAE,UAAU,GAAG,UAAU;IAE/D;;OAEG;IACH,QAAQ,CAAC,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU;IAE1C;;OAEG;IACH,QAAQ,CAAC,iCAAiC,CAAC,KAAK,EAAE,OAAO,GAAG,UAAU;IAEtE;;OAEG;IACH,QAAQ,CAAC,aAAa,CAAC,UAAU,EAAE,cAAc,GAAG,UAAU;IAE9D;;;;OAIG;IACH,QAAQ,CAAC,eAAe,CAAC,CAAC,SAAS,OAAO,EACxC,IAAI,EAAE,WAAW,CAAC,CAAC,CAAC,EACpB,OAAO,EAAE,CAAC,OAAO,EAAE,cAAc,KAAK,CAAC,GACtC,UAAU;IAEb;;;;OAIG;IACH,QAAQ,CAAC,eAAe,CAAC,CAAC,SAAS,OAAO,EACxC,WAAW,EAAE,WAAW,CAAC,CAAC,CAAC,EAC3B,cAAc,EACV,CAAC,CAAC,OAAO,EAAE,OAAO,KAAK,cAAc,CAAC,CAAC,CAAC,CAAC,GACzC,CAAC,CAAC,OAAO,EAAE,OAAO,KAAK,CAAC,OAAO,EAAE,OAAO,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC,GAC9D,UAAU;CACd"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"appBuilder.js","sourceRoot":"","sources":["../../src/appBuilder.ts"],"names":[],"mappings":";;;AAOA;;GAEG;AACH,MAAsB,UAAU;CA+C/B;AA/CD,gCA+CC"}
|
@@ -0,0 +1,7 @@
|
|
1
|
+
import { Command, CommandHandler } from "../services/commandService";
|
2
|
+
export declare class DeleteUserFullCommand extends Command {
|
3
|
+
}
|
4
|
+
export declare class DeleteUserFullCommandHandler extends CommandHandler<DeleteUserFullCommand> {
|
5
|
+
execute(message: DeleteUserFullCommand): Promise<void>;
|
6
|
+
}
|
7
|
+
//# sourceMappingURL=deleteUserFullCommandHandler.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"deleteUserFullCommandHandler.d.ts","sourceRoot":"","sources":["../../../src/commands/deleteUserFullCommandHandler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAA;AAIpE,qBAAa,qBAAsB,SAAQ,OAAO;CAEjD;AAED,qBAAa,4BAA6B,SAAQ,cAAc,CAAC,qBAAqB,CAAC;IAE/E,OAAO,CAAC,OAAO,EAAE,qBAAqB,GAAG,OAAO,CAAC,IAAI,CAAC;CAQ7D"}
|
@@ -0,0 +1,21 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.DeleteUserFullCommandHandler = exports.DeleteUserFullCommand = void 0;
|
4
|
+
const commandService_1 = require("../services/commandService");
|
5
|
+
const rpcService_1 = require("../services/rpcService");
|
6
|
+
const responseUtils_1 = require("../services/responseUtils");
|
7
|
+
class DeleteUserFullCommand extends commandService_1.Command {
|
8
|
+
}
|
9
|
+
exports.DeleteUserFullCommand = DeleteUserFullCommand;
|
10
|
+
class DeleteUserFullCommandHandler extends commandService_1.CommandHandler {
|
11
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
12
|
+
async execute(message) {
|
13
|
+
var _a;
|
14
|
+
const response = await ((_a = this.resolve(rpcService_1.RpcService)) === null || _a === void 0 ? void 0 : _a.requestBuilder("/api/v1/Users/self/full").sendDelete());
|
15
|
+
if (responseUtils_1.ResponseUtils.isFail(response)) {
|
16
|
+
await responseUtils_1.ResponseUtils.throwError("Failed to delete user", response);
|
17
|
+
}
|
18
|
+
}
|
19
|
+
}
|
20
|
+
exports.DeleteUserFullCommandHandler = DeleteUserFullCommandHandler;
|
21
|
+
//# sourceMappingURL=deleteUserFullCommandHandler.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"deleteUserFullCommandHandler.js","sourceRoot":"","sources":["../../../src/commands/deleteUserFullCommandHandler.ts"],"names":[],"mappings":";;;AAAA,+DAAoE;AACpE,uDAAmD;AACnD,6DAAyD;AAEzD,MAAa,qBAAsB,SAAQ,wBAAO;CAEjD;AAFD,sDAEC;AAED,MAAa,4BAA6B,SAAQ,+BAAqC;IACrF,6DAA6D;IAC7D,KAAK,CAAC,OAAO,CAAC,OAA8B;;QAC1C,MAAM,QAAQ,GAAG,MAAM,CAAA,MAAA,IAAI,CAAC,OAAO,CAAC,uBAAU,CAAC,0CAAE,cAAc,CAAC,yBAAyB,EACtF,UAAU,EAAE,CAAA,CAAA;QAEf,IAAI,6BAAa,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC;YACnC,MAAM,6BAAa,CAAC,UAAU,CAAC,uBAAuB,EAAE,QAAQ,CAAC,CAAA;QACnE,CAAC;IACH,CAAC;CACF;AAVD,oEAUC"}
|
@@ -0,0 +1,7 @@
|
|
1
|
+
import { CommandHandler, Command } from "../services/commandService";
|
2
|
+
export declare class StartCommand extends Command {
|
3
|
+
}
|
4
|
+
export declare class StartCommandHandler extends CommandHandler<StartCommand> {
|
5
|
+
execute(message: StartCommand): Promise<void>;
|
6
|
+
}
|
7
|
+
//# sourceMappingURL=startCommandHandler.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"startCommandHandler.d.ts","sourceRoot":"","sources":["../../../src/commands/startCommandHandler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;AAKpE,qBAAa,YAAa,SAAQ,OAAO;CACxC;AAED,qBAAa,mBAAoB,SAAQ,cAAc,CAAC,YAAY,CAAC;IAE7D,OAAO,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC;CAcpD"}
|
@@ -0,0 +1,27 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.StartCommandHandler = exports.StartCommand = void 0;
|
4
|
+
const commandService_1 = require("../services/commandService");
|
5
|
+
const userProfileService_1 = require("../services/userProfileService");
|
6
|
+
const cookieService_1 = require("../services/cookieService");
|
7
|
+
const credentials_1 = require("../credentials");
|
8
|
+
class StartCommand extends commandService_1.Command {
|
9
|
+
}
|
10
|
+
exports.StartCommand = StartCommand;
|
11
|
+
class StartCommandHandler extends commandService_1.CommandHandler {
|
12
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
13
|
+
async execute(message) {
|
14
|
+
const userService = this.resolve(userProfileService_1.UserProfileService);
|
15
|
+
// Merge anonymous user if needed
|
16
|
+
if (!(this.context.app.credential instanceof credentials_1.AnonymousCredential)) {
|
17
|
+
const cookie = this.resolve(cookieService_1.CookieService);
|
18
|
+
if (cookie.anonymousTokenIsValid) {
|
19
|
+
await userService.merge(cookie.anonymousToken);
|
20
|
+
cookie.anonymousToken = undefined;
|
21
|
+
}
|
22
|
+
}
|
23
|
+
await userService.fetch();
|
24
|
+
}
|
25
|
+
}
|
26
|
+
exports.StartCommandHandler = StartCommandHandler;
|
27
|
+
//# sourceMappingURL=startCommandHandler.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"startCommandHandler.js","sourceRoot":"","sources":["../../../src/commands/startCommandHandler.ts"],"names":[],"mappings":";;;AAAA,+DAAoE;AACpE,uEAAmE;AACnE,6DAAyD;AACzD,gDAAoD;AAEpD,MAAa,YAAa,SAAQ,wBAAO;CACxC;AADD,oCACC;AAED,MAAa,mBAAoB,SAAQ,+BAA4B;IACnE,6DAA6D;IAC7D,KAAK,CAAC,OAAO,CAAC,OAAqB;QACjC,MAAM,WAAW,GAAG,IAAI,CAAC,OAAO,CAAC,uCAAkB,CAAE,CAAA;QAErD,iCAAiC;QACjC,IAAI,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,UAAU,YAAY,iCAAmB,CAAC,EAAE,CAAC;YAClE,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,6BAAa,CAAE,CAAA;YAC3C,IAAI,MAAM,CAAC,qBAAqB,EAAE,CAAC;gBACjC,MAAM,WAAW,CAAC,KAAK,CAAC,MAAM,CAAC,cAAe,CAAC,CAAA;gBAC/C,MAAM,CAAC,cAAc,GAAG,SAAS,CAAA;YACnC,CAAC;QACH,CAAC;QAED,MAAM,WAAW,CAAC,KAAK,EAAE,CAAA;IAC3B,CAAC;CACF;AAhBD,kDAgBC"}
|
@@ -0,0 +1,24 @@
|
|
1
|
+
import { type Constructor, type Registry } from "./internal/registry";
|
2
|
+
import { type Lifetime } from "./disposable";
|
3
|
+
import { Command } from "./services/commandService";
|
4
|
+
import { DataIslandApp } from "./dataIslandApp";
|
5
|
+
/**
|
6
|
+
* DataIsland App context.
|
7
|
+
*/
|
8
|
+
export declare class Context {
|
9
|
+
private readonly registry;
|
10
|
+
readonly lifetime: Lifetime;
|
11
|
+
readonly app: DataIslandApp;
|
12
|
+
constructor(registry: Registry, lifetime: Lifetime, app: DataIslandApp);
|
13
|
+
/**
|
14
|
+
* Resolve a service from the context.
|
15
|
+
* @param type of the service
|
16
|
+
*/
|
17
|
+
resolve<T>(type: Constructor<T>): T | undefined;
|
18
|
+
/**
|
19
|
+
* Execute a command.
|
20
|
+
* @param command to execute
|
21
|
+
*/
|
22
|
+
execute<T extends Command>(command: T): Promise<void>;
|
23
|
+
}
|
24
|
+
//# sourceMappingURL=context.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,QAAQ,EAAE,MAAM,qBAAqB,CAAA;AACrE,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,cAAc,CAAA;AAC5C,OAAO,EAAE,OAAO,EAAkB,MAAM,2BAA2B,CAAA;AACnE,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAE/C;;GAEG;AACH,qBAAa,OAAO;IAEhB,OAAO,CAAC,QAAQ,CAAC,QAAQ;aACT,QAAQ,EAAE,QAAQ;aAClB,GAAG,EAAE,aAAa;gBAFjB,QAAQ,EAAE,QAAQ,EACnB,QAAQ,EAAE,QAAQ,EAClB,GAAG,EAAE,aAAa;IAIpC;;;OAGG;IACH,OAAO,CAAC,CAAC,EAAE,IAAI,EAAE,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,SAAS;IAI/C;;;OAGG;IACG,OAAO,CAAC,CAAC,SAAS,OAAO,EAAE,OAAO,EAAE,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;CAI5D"}
|
@@ -0,0 +1,31 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.Context = void 0;
|
4
|
+
const commandService_1 = require("./services/commandService");
|
5
|
+
/**
|
6
|
+
* DataIsland App context.
|
7
|
+
*/
|
8
|
+
class Context {
|
9
|
+
constructor(registry, lifetime, app) {
|
10
|
+
this.registry = registry;
|
11
|
+
this.lifetime = lifetime;
|
12
|
+
this.app = app;
|
13
|
+
}
|
14
|
+
/**
|
15
|
+
* Resolve a service from the context.
|
16
|
+
* @param type of the service
|
17
|
+
*/
|
18
|
+
resolve(type) {
|
19
|
+
return this.registry.get(type);
|
20
|
+
}
|
21
|
+
/**
|
22
|
+
* Execute a command.
|
23
|
+
* @param command to execute
|
24
|
+
*/
|
25
|
+
async execute(command) {
|
26
|
+
const service = this.resolve(commandService_1.CommandService);
|
27
|
+
await service.execute(command);
|
28
|
+
}
|
29
|
+
}
|
30
|
+
exports.Context = Context;
|
31
|
+
//# sourceMappingURL=context.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../src/context.ts"],"names":[],"mappings":";;;AAEA,8DAAmE;AAGnE;;GAEG;AACH,MAAa,OAAO;IAClB,YACmB,QAAkB,EACnB,QAAkB,EAClB,GAAkB;QAFjB,aAAQ,GAAR,QAAQ,CAAU;QACnB,aAAQ,GAAR,QAAQ,CAAU;QAClB,QAAG,GAAH,GAAG,CAAe;IAEpC,CAAC;IAED;;;OAGG;IACH,OAAO,CAAI,IAAoB;QAC7B,OAAO,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;IAChC,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,OAAO,CAAoB,OAAU;QACzC,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,+BAAc,CAAmB,CAAA;QAC9D,MAAM,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,CAAA;IAChC,CAAC;CACF;AAxBD,0BAwBC"}
|
@@ -0,0 +1,33 @@
|
|
1
|
+
import { type Lifetime } from "./disposable";
|
2
|
+
import { type Context } from "./context";
|
3
|
+
/**
|
4
|
+
* DataIsland App credential.
|
5
|
+
*/
|
6
|
+
export declare abstract class CredentialBase {
|
7
|
+
abstract onRegister(lifetime: Lifetime, context: Context): void;
|
8
|
+
}
|
9
|
+
export declare class DefaultCredential extends CredentialBase {
|
10
|
+
onRegister(lifetime: Lifetime, context: Context): void;
|
11
|
+
}
|
12
|
+
export declare class BasicCredential extends CredentialBase {
|
13
|
+
readonly email: string;
|
14
|
+
readonly password: string;
|
15
|
+
constructor(email: string, password: string);
|
16
|
+
onRegister(lifetime: Lifetime, context: Context): void;
|
17
|
+
}
|
18
|
+
export declare class DebugCredential extends CredentialBase {
|
19
|
+
readonly token: string;
|
20
|
+
constructor(token: string);
|
21
|
+
onRegister(lifetime: Lifetime, context: Context): void;
|
22
|
+
}
|
23
|
+
export declare class BearerCredential extends CredentialBase {
|
24
|
+
readonly token: string;
|
25
|
+
constructor(token: string);
|
26
|
+
onRegister(lifetime: Lifetime, context: Context): void;
|
27
|
+
}
|
28
|
+
export declare class AnonymousCredential extends CredentialBase {
|
29
|
+
readonly token: string;
|
30
|
+
constructor(token: string);
|
31
|
+
onRegister(lifetime: Lifetime, context: Context): void;
|
32
|
+
}
|
33
|
+
//# sourceMappingURL=credentials.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"credentials.d.ts","sourceRoot":"","sources":["../../src/credentials.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,cAAc,CAAA;AAC5C,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,WAAW,CAAA;AAExC;;GAEG;AACH,8BAAsB,cAAc;IAClC,QAAQ,CAAC,UAAU,CAAC,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,GAAG,IAAI;CAChE;AAED,qBAAa,iBAAkB,SAAQ,cAAc;IAEnD,UAAU,CAAC,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,GAAG,IAAI;CAGvD;AAED,qBAAa,eAAgB,SAAQ,cAAc;IACjD,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;gBAEb,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM;IAM3C,UAAU,CAAC,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,GAAG,IAAI;CAYvD;AAED,qBAAa,eAAgB,SAAQ,cAAc;IACjD,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;gBAEV,KAAK,EAAE,MAAM;IAKzB,UAAU,CAAC,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,GAAG,IAAI;CAYvD;AAED,qBAAa,gBAAiB,SAAQ,cAAc;IAClD,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;gBAEV,KAAK,EAAE,MAAM;IAKzB,UAAU,CAAC,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,GAAG,IAAI;CAYvD;AAED,qBAAa,mBAAoB,SAAQ,cAAc;IACrD,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;gBAEV,KAAK,EAAE,MAAM;IAKzB,UAAU,CAAC,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,GAAG,IAAI;CAYvD"}
|
@@ -0,0 +1,87 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.AnonymousCredential = exports.BearerCredential = exports.DebugCredential = exports.BasicCredential = exports.DefaultCredential = exports.CredentialBase = void 0;
|
4
|
+
const middlewareService_1 = require("./services/middlewareService");
|
5
|
+
/**
|
6
|
+
* DataIsland App credential.
|
7
|
+
*/
|
8
|
+
class CredentialBase {
|
9
|
+
}
|
10
|
+
exports.CredentialBase = CredentialBase;
|
11
|
+
class DefaultCredential extends CredentialBase {
|
12
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
13
|
+
onRegister(lifetime, context) {
|
14
|
+
// Do nothing.
|
15
|
+
}
|
16
|
+
}
|
17
|
+
exports.DefaultCredential = DefaultCredential;
|
18
|
+
class BasicCredential extends CredentialBase {
|
19
|
+
constructor(email, password) {
|
20
|
+
super();
|
21
|
+
this.email = email;
|
22
|
+
this.password = password;
|
23
|
+
}
|
24
|
+
onRegister(lifetime, context) {
|
25
|
+
const service = context.resolve(middlewareService_1.MiddlewareService);
|
26
|
+
if (service === undefined) {
|
27
|
+
throw new Error("MiddlewareService is not registered.");
|
28
|
+
}
|
29
|
+
lifetime.add(service.useMiddleware(async (req, next) => {
|
30
|
+
req.headers.set("Authorization", `Basic ${this.email}:${this.password}`);
|
31
|
+
return await next(req);
|
32
|
+
}));
|
33
|
+
}
|
34
|
+
}
|
35
|
+
exports.BasicCredential = BasicCredential;
|
36
|
+
class DebugCredential extends CredentialBase {
|
37
|
+
constructor(token) {
|
38
|
+
super();
|
39
|
+
this.token = token;
|
40
|
+
}
|
41
|
+
onRegister(lifetime, context) {
|
42
|
+
const service = context.resolve(middlewareService_1.MiddlewareService);
|
43
|
+
if (service === undefined) {
|
44
|
+
throw new Error("MiddlewareService is not registered.");
|
45
|
+
}
|
46
|
+
lifetime.add(service.useMiddleware(async (req, next) => {
|
47
|
+
req.headers.set("Authorization", `Debug ${this.token}`);
|
48
|
+
return await next(req);
|
49
|
+
}));
|
50
|
+
}
|
51
|
+
}
|
52
|
+
exports.DebugCredential = DebugCredential;
|
53
|
+
class BearerCredential extends CredentialBase {
|
54
|
+
constructor(token) {
|
55
|
+
super();
|
56
|
+
this.token = token;
|
57
|
+
}
|
58
|
+
onRegister(lifetime, context) {
|
59
|
+
const service = context.resolve(middlewareService_1.MiddlewareService);
|
60
|
+
if (service === undefined) {
|
61
|
+
throw new Error("MiddlewareService is not registered.");
|
62
|
+
}
|
63
|
+
lifetime.add(service.useMiddleware(async (req, next) => {
|
64
|
+
req.headers.set("Authorization", `Bearer ${this.token}`);
|
65
|
+
return await next(req);
|
66
|
+
}));
|
67
|
+
}
|
68
|
+
}
|
69
|
+
exports.BearerCredential = BearerCredential;
|
70
|
+
class AnonymousCredential extends CredentialBase {
|
71
|
+
constructor(token) {
|
72
|
+
super();
|
73
|
+
this.token = token;
|
74
|
+
}
|
75
|
+
onRegister(lifetime, context) {
|
76
|
+
const service = context.resolve(middlewareService_1.MiddlewareService);
|
77
|
+
if (service === undefined) {
|
78
|
+
throw new Error("MiddlewareService is not registered.");
|
79
|
+
}
|
80
|
+
lifetime.add(service.useMiddleware(async (req, next) => {
|
81
|
+
req.headers.set("Authorization", `InternalJWT ${this.token}`);
|
82
|
+
return await next(req);
|
83
|
+
}));
|
84
|
+
}
|
85
|
+
}
|
86
|
+
exports.AnonymousCredential = AnonymousCredential;
|
87
|
+
//# sourceMappingURL=credentials.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"credentials.js","sourceRoot":"","sources":["../../src/credentials.ts"],"names":[],"mappings":";;;AAAA,oEAAgE;AAIhE;;GAEG;AACH,MAAsB,cAAc;CAEnC;AAFD,wCAEC;AAED,MAAa,iBAAkB,SAAQ,cAAc;IACnD,6DAA6D;IAC7D,UAAU,CAAC,QAAkB,EAAE,OAAgB;QAC7C,cAAc;IAChB,CAAC;CACF;AALD,8CAKC;AAED,MAAa,eAAgB,SAAQ,cAAc;IAIjD,YAAY,KAAa,EAAE,QAAgB;QACzC,KAAK,EAAE,CAAA;QACP,IAAI,CAAC,KAAK,GAAG,KAAK,CAAA;QAClB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAA;IAC1B,CAAC;IAED,UAAU,CAAC,QAAkB,EAAE,OAAgB;QAC7C,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,qCAAiB,CAAC,CAAA;QAClD,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;YAC1B,MAAM,IAAI,KAAK,CAAC,sCAAsC,CAAC,CAAA;QACzD,CAAC;QACD,QAAQ,CAAC,GAAG,CACV,OAAO,CAAC,aAAa,CAAC,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE;YACxC,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,eAAe,EAAE,SAAS,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAA;YACxE,OAAO,MAAM,IAAI,CAAC,GAAG,CAAC,CAAA;QACxB,CAAC,CAAC,CACH,CAAA;IACH,CAAC;CACF;AAtBD,0CAsBC;AAED,MAAa,eAAgB,SAAQ,cAAc;IAGjD,YAAY,KAAa;QACvB,KAAK,EAAE,CAAA;QACP,IAAI,CAAC,KAAK,GAAG,KAAK,CAAA;IACpB,CAAC;IAED,UAAU,CAAC,QAAkB,EAAE,OAAgB;QAC7C,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,qCAAiB,CAAC,CAAA;QAClD,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;YAC1B,MAAM,IAAI,KAAK,CAAC,sCAAsC,CAAC,CAAA;QACzD,CAAC;QACD,QAAQ,CAAC,GAAG,CACV,OAAO,CAAC,aAAa,CAAC,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE;YACxC,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,eAAe,EAAE,SAAS,IAAI,CAAC,KAAK,EAAE,CAAC,CAAA;YACvD,OAAO,MAAM,IAAI,CAAC,GAAG,CAAC,CAAA;QACxB,CAAC,CAAC,CACH,CAAA;IACH,CAAC;CACF;AApBD,0CAoBC;AAED,MAAa,gBAAiB,SAAQ,cAAc;IAGlD,YAAY,KAAa;QACvB,KAAK,EAAE,CAAA;QACP,IAAI,CAAC,KAAK,GAAG,KAAK,CAAA;IACpB,CAAC;IAED,UAAU,CAAC,QAAkB,EAAE,OAAgB;QAC7C,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,qCAAiB,CAAC,CAAA;QAClD,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;YAC1B,MAAM,IAAI,KAAK,CAAC,sCAAsC,CAAC,CAAA;QACzD,CAAC;QACD,QAAQ,CAAC,GAAG,CACV,OAAO,CAAC,aAAa,CAAC,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE;YACxC,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,eAAe,EAAE,UAAU,IAAI,CAAC,KAAK,EAAE,CAAC,CAAA;YACxD,OAAO,MAAM,IAAI,CAAC,GAAG,CAAC,CAAA;QACxB,CAAC,CAAC,CACH,CAAA;IACH,CAAC;CACF;AApBD,4CAoBC;AAED,MAAa,mBAAoB,SAAQ,cAAc;IAGrD,YAAY,KAAa;QACvB,KAAK,EAAE,CAAA;QACP,IAAI,CAAC,KAAK,GAAG,KAAK,CAAA;IACpB,CAAC;IAED,UAAU,CAAC,QAAkB,EAAE,OAAgB;QAC7C,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,qCAAiB,CAAC,CAAA;QAClD,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;YAC1B,MAAM,IAAI,KAAK,CAAC,sCAAsC,CAAC,CAAA;QACzD,CAAC;QACD,QAAQ,CAAC,GAAG,CACV,OAAO,CAAC,aAAa,CAAC,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE;YACxC,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,eAAe,EAAE,eAAe,IAAI,CAAC,KAAK,EAAE,CAAC,CAAA;YAC7D,OAAO,MAAM,IAAI,CAAC,GAAG,CAAC,CAAA;QACxB,CAAC,CAAC,CACH,CAAA;IACH,CAAC;CACF;AApBD,kDAoBC"}
|
@@ -0,0 +1,55 @@
|
|
1
|
+
import type { Lifetime } from "./disposable";
|
2
|
+
import type { CredentialBase } from "./credentials";
|
3
|
+
import { Context } from "./context";
|
4
|
+
import type { Constructor } from "./internal/registry";
|
5
|
+
import { Organizations } from "./storages/organizations/organizations";
|
6
|
+
import { UserProfile } from "./storages/user/userProfile";
|
7
|
+
import { AcquiringService } from "./services/acquiringService";
|
8
|
+
/**
|
9
|
+
* DataIsland App instance.
|
10
|
+
*/
|
11
|
+
export declare abstract class DataIslandApp {
|
12
|
+
/**
|
13
|
+
* The name of this app.
|
14
|
+
*/
|
15
|
+
abstract get name(): string;
|
16
|
+
/**
|
17
|
+
* The host of this app.
|
18
|
+
*/
|
19
|
+
abstract get host(): string;
|
20
|
+
/**
|
21
|
+
* The automaticDataCollectionEnabled of this app.
|
22
|
+
*/
|
23
|
+
abstract get automaticDataCollectionEnabled(): boolean;
|
24
|
+
/**
|
25
|
+
* The lifetime of this app.
|
26
|
+
*/
|
27
|
+
abstract get lifetime(): Lifetime;
|
28
|
+
/**
|
29
|
+
* The credential of this app.
|
30
|
+
*/
|
31
|
+
abstract get credential(): CredentialBase | undefined;
|
32
|
+
abstract set credential(value: CredentialBase);
|
33
|
+
/**
|
34
|
+
* The context of this app.
|
35
|
+
*/
|
36
|
+
abstract get context(): Context;
|
37
|
+
/**
|
38
|
+
* User's organizations.
|
39
|
+
*/
|
40
|
+
abstract get organizations(): Organizations;
|
41
|
+
/**
|
42
|
+
* Acquiring
|
43
|
+
*/
|
44
|
+
abstract get acquiring(): AcquiringService;
|
45
|
+
/**
|
46
|
+
* User's profile.
|
47
|
+
*/
|
48
|
+
abstract get userProfile(): UserProfile;
|
49
|
+
/**
|
50
|
+
* Resolve a service from the app.
|
51
|
+
* @param type
|
52
|
+
*/
|
53
|
+
abstract resolve<T>(type: Constructor<T>): T | undefined;
|
54
|
+
}
|
55
|
+
//# sourceMappingURL=dataIslandApp.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"dataIslandApp.d.ts","sourceRoot":"","sources":["../../src/dataIslandApp.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AAC5C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,wCAAwC,CAAA;AACtE,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAA;AACzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;AAE9D;;GAEG;AACH,8BAAsB,aAAa;IACjC;;OAEG;IACH,QAAQ,KAAK,IAAI,IAAI,MAAM,CAAA;IAE3B;;OAEG;IACH,QAAQ,KAAK,IAAI,IAAI,MAAM,CAAA;IAE3B;;OAEG;IACH,QAAQ,KAAK,8BAA8B,IAAI,OAAO,CAAA;IAEtD;;OAEG;IACH,QAAQ,KAAK,QAAQ,IAAI,QAAQ,CAAA;IAEjC;;OAEG;IACH,QAAQ,KAAK,UAAU,IAAI,cAAc,GAAG,SAAS,CAAA;IAErD,QAAQ,KAAK,UAAU,CAAC,KAAK,EAAE,cAAc,EAAC;IAE9C;;OAEG;IACH,QAAQ,KAAK,OAAO,IAAI,OAAO,CAAA;IAE/B;;OAEG;IACH,QAAQ,KAAK,aAAa,IAAI,aAAa,CAAA;IAE3C;;OAEG;IACH,QAAQ,KAAK,SAAS,IAAI,gBAAgB,CAAA;IAE1C;;OAEG;IACH,QAAQ,KAAK,WAAW,IAAI,WAAW,CAAA;IAEvC;;;OAGG;IACH,QAAQ,CAAC,OAAO,CAAC,CAAC,EAAE,IAAI,EAAE,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,SAAS;CACzD"}
|
@@ -0,0 +1,10 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.DataIslandApp = void 0;
|
4
|
+
/**
|
5
|
+
* DataIsland App instance.
|
6
|
+
*/
|
7
|
+
class DataIslandApp {
|
8
|
+
}
|
9
|
+
exports.DataIslandApp = DataIslandApp;
|
10
|
+
//# sourceMappingURL=dataIslandApp.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"dataIslandApp.js","sourceRoot":"","sources":["../../src/dataIslandApp.ts"],"names":[],"mappings":";;;AAQA;;GAEG;AACH,MAAsB,aAAa;CAqDlC;AArDD,sCAqDC"}
|
@@ -0,0 +1,84 @@
|
|
1
|
+
/**
|
2
|
+
* Represents an object that can be disposed.
|
3
|
+
*/
|
4
|
+
export interface Disposable {
|
5
|
+
dispose(): void;
|
6
|
+
}
|
7
|
+
/**
|
8
|
+
* Represents a lifetime.
|
9
|
+
*/
|
10
|
+
export declare class Lifetime {
|
11
|
+
private readonly container;
|
12
|
+
constructor(container: DisposableContainer);
|
13
|
+
/**
|
14
|
+
* Define a new nested disposable to this lifetime.
|
15
|
+
*/
|
16
|
+
defineNested(): DisposableContainer;
|
17
|
+
/**
|
18
|
+
* Shows whether this lifetime is disposed.
|
19
|
+
*/
|
20
|
+
get isDisposed(): boolean;
|
21
|
+
/**
|
22
|
+
* Adds a disposable to this lifetime.
|
23
|
+
*/
|
24
|
+
add(disposable: Disposable): this;
|
25
|
+
/**
|
26
|
+
* Adds a callback to this lifetime.
|
27
|
+
*/
|
28
|
+
addCallback(callback: () => void, target?: unknown): this;
|
29
|
+
}
|
30
|
+
/**
|
31
|
+
* A container for disposables.
|
32
|
+
* Last added, first disposed.
|
33
|
+
* @example
|
34
|
+
* const container = new DisposableContainer();
|
35
|
+
* container.add(someDisposable);
|
36
|
+
* container.addCallback(() => console.log('disposed'));
|
37
|
+
* container.dispose();
|
38
|
+
*/
|
39
|
+
export declare class DisposableContainer implements Disposable {
|
40
|
+
private _disposables;
|
41
|
+
private _isDisposed;
|
42
|
+
private _lifetime?;
|
43
|
+
/**
|
44
|
+
* Gets whether this container is disposed.
|
45
|
+
*/
|
46
|
+
get isDisposed(): boolean;
|
47
|
+
/**
|
48
|
+
* Define new lifetime.
|
49
|
+
*/
|
50
|
+
get lifetime(): Lifetime;
|
51
|
+
/**
|
52
|
+
* Adds a disposable to this container.
|
53
|
+
* @param disposable The disposable to add.
|
54
|
+
* @returns The disposable container.
|
55
|
+
*/
|
56
|
+
add(disposable: Disposable): Disposable;
|
57
|
+
/**
|
58
|
+
* Adds a callback to be executed when this container is disposed.
|
59
|
+
* @param callback The callback to execute.
|
60
|
+
* @param target The target to bind the callback to.
|
61
|
+
* @returns The disposable container.
|
62
|
+
*/
|
63
|
+
addCallback(callback: () => void, target?: unknown): Disposable;
|
64
|
+
/**
|
65
|
+
* Defines a nested disposable container.
|
66
|
+
*/
|
67
|
+
defineNested(): DisposableContainer;
|
68
|
+
/**
|
69
|
+
* Disposes all disposables in this container. Last added, first disposed.
|
70
|
+
*/
|
71
|
+
dispose(): void;
|
72
|
+
/**
|
73
|
+
* Throws an error if this container is disposed.
|
74
|
+
*/
|
75
|
+
private _throwIfDisposed;
|
76
|
+
}
|
77
|
+
/**
|
78
|
+
* Creates a disposable.
|
79
|
+
* @param action The action to execute when disposed.
|
80
|
+
* @param target The target to bind the action to.
|
81
|
+
* @returns The disposable.
|
82
|
+
*/
|
83
|
+
export declare function disposable(action: () => void, target: unknown): Disposable;
|
84
|
+
//# sourceMappingURL=disposable.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"disposable.d.ts","sourceRoot":"","sources":["../../src/disposable.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,OAAO,IAAI,IAAI,CAAA;CAChB;AAED;;GAEG;AACH,qBAAa,QAAQ;IACP,OAAO,CAAC,QAAQ,CAAC,SAAS;gBAAT,SAAS,EAAE,mBAAmB;IAG3D;;OAEG;IACI,YAAY,IAAI,mBAAmB;IAI1C;;OAEG;IACH,IAAW,UAAU,IAAI,OAAO,CAE/B;IAED;;OAEG;IACI,GAAG,CAAC,UAAU,EAAE,UAAU,GAAG,IAAI;IAKxC;;OAEG;IACI,WAAW,CAAC,QAAQ,EAAE,MAAM,IAAI,EAAE,MAAM,CAAC,EAAE,OAAO,GAAG,IAAI;CAIjE;AAED;;;;;;;;GAQG;AACH,qBAAa,mBAAoB,YAAW,UAAU;IACpD,OAAO,CAAC,YAAY,CAAmB;IACvC,OAAO,CAAC,WAAW,CAAQ;IAC3B,OAAO,CAAC,SAAS,CAAC,CAAU;IAE5B;;OAEG;IACH,IAAW,UAAU,IAAI,OAAO,CAE/B;IAED;;OAEG;IACH,IAAW,QAAQ,IAAI,QAAQ,CAE9B;IAED;;;;OAIG;IACI,GAAG,CAAC,UAAU,EAAE,UAAU,GAAG,UAAU;IAO9C;;;;;OAKG;IACI,WAAW,CAAC,QAAQ,EAAE,MAAM,IAAI,EAAE,MAAM,CAAC,EAAE,OAAO,GAAG,UAAU;IAUtE;;OAEG;IACH,YAAY,IAAI,mBAAmB;IAcnC;;OAEG;IACI,OAAO,IAAI,IAAI;IAqBtB;;OAEG;IACH,OAAO,CAAC,gBAAgB;CAKzB;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,IAAI,EAAE,MAAM,EAAE,OAAO,GAAG,UAAU,CAI1E"}
|