@neuralinnovations/dataisland-sdk 0.0.1-dev2 → 0.0.1-dev21

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.
Files changed (286) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +306 -1
  3. package/dist/index.d.ts +3 -0
  4. package/dist/index.d.ts.map +1 -0
  5. package/dist/index.js +3 -0
  6. package/dist/index.js.map +1 -0
  7. package/dist/package.json +100 -0
  8. package/dist/src/appBuilder.d.ts +44 -0
  9. package/dist/src/appBuilder.d.ts.map +1 -0
  10. package/dist/src/appBuilder.js +10 -0
  11. package/dist/src/appBuilder.js.map +1 -0
  12. package/dist/src/commands/startCommandHandler.d.ts +7 -0
  13. package/dist/src/commands/startCommandHandler.d.ts.map +1 -0
  14. package/dist/src/commands/startCommandHandler.js +17 -0
  15. package/dist/src/commands/startCommandHandler.js.map +1 -0
  16. package/dist/src/context.d.ts +23 -0
  17. package/dist/src/context.d.ts.map +1 -0
  18. package/dist/src/context.js +31 -0
  19. package/dist/src/context.js.map +1 -0
  20. package/dist/src/credentials.d.ts +28 -0
  21. package/dist/src/credentials.d.ts.map +1 -0
  22. package/dist/src/credentials.js +70 -0
  23. package/dist/src/credentials.js.map +1 -0
  24. package/dist/src/dataIslandApp.d.ts +50 -0
  25. package/dist/src/dataIslandApp.d.ts.map +1 -0
  26. package/dist/src/dataIslandApp.js +10 -0
  27. package/dist/src/dataIslandApp.js.map +1 -0
  28. package/dist/src/disposable.d.ts +84 -0
  29. package/dist/src/disposable.d.ts.map +1 -0
  30. package/dist/src/disposable.js +147 -0
  31. package/dist/src/disposable.js.map +1 -0
  32. package/dist/src/dto/accessGroupResponse.d.ts +27 -0
  33. package/dist/src/dto/accessGroupResponse.d.ts.map +1 -0
  34. package/dist/src/dto/accessGroupResponse.js +3 -0
  35. package/dist/src/dto/accessGroupResponse.js.map +1 -0
  36. package/dist/src/dto/chatResponse.d.ts +78 -0
  37. package/dist/src/dto/chatResponse.d.ts.map +1 -0
  38. package/dist/src/dto/chatResponse.js +45 -0
  39. package/dist/src/dto/chatResponse.js.map +1 -0
  40. package/dist/src/dto/userInfoResponse.d.ts +42 -0
  41. package/dist/src/dto/userInfoResponse.d.ts.map +1 -0
  42. package/dist/src/dto/userInfoResponse.js +3 -0
  43. package/dist/src/dto/userInfoResponse.js.map +1 -0
  44. package/dist/src/dto/workspacesResponse.d.ts +43 -0
  45. package/dist/src/dto/workspacesResponse.d.ts.map +1 -0
  46. package/dist/src/dto/workspacesResponse.js +3 -0
  47. package/dist/src/dto/workspacesResponse.js.map +1 -0
  48. package/dist/src/events.d.ts +17 -0
  49. package/dist/src/events.d.ts.map +1 -0
  50. package/dist/src/events.js +52 -0
  51. package/dist/src/events.js.map +1 -0
  52. package/dist/src/index.d.ts +58 -0
  53. package/dist/src/index.d.ts.map +1 -0
  54. package/dist/src/index.js +91 -0
  55. package/dist/src/index.js.map +1 -0
  56. package/dist/src/internal/app.impl.d.ts +28 -0
  57. package/dist/src/internal/app.impl.d.ts.map +1 -0
  58. package/dist/src/internal/app.impl.js +151 -0
  59. package/dist/src/internal/app.impl.js.map +1 -0
  60. package/dist/src/internal/appBuilder.impl.d.ts +27 -0
  61. package/dist/src/internal/appBuilder.impl.d.ts.map +1 -0
  62. package/dist/src/internal/appBuilder.impl.js +71 -0
  63. package/dist/src/internal/appBuilder.impl.js.map +1 -0
  64. package/dist/src/internal/createApp.impl.d.ts +4 -0
  65. package/dist/src/internal/createApp.impl.d.ts.map +1 -0
  66. package/dist/src/internal/createApp.impl.js +11 -0
  67. package/dist/src/internal/createApp.impl.js.map +1 -0
  68. package/dist/src/internal/registry.d.ts +66 -0
  69. package/dist/src/internal/registry.d.ts.map +1 -0
  70. package/dist/src/internal/registry.js +114 -0
  71. package/dist/src/internal/registry.js.map +1 -0
  72. package/dist/src/middleware.d.ts +5 -0
  73. package/dist/src/middleware.d.ts.map +1 -0
  74. package/dist/src/middleware.js +3 -0
  75. package/dist/src/middleware.js.map +1 -0
  76. package/dist/src/services/commandService.d.ts +18 -0
  77. package/dist/src/services/commandService.d.ts.map +1 -0
  78. package/dist/src/services/commandService.js +40 -0
  79. package/dist/src/services/commandService.js.map +1 -0
  80. package/dist/src/services/credentialService.d.ts +9 -0
  81. package/dist/src/services/credentialService.d.ts.map +1 -0
  82. package/dist/src/services/credentialService.js +26 -0
  83. package/dist/src/services/credentialService.js.map +1 -0
  84. package/dist/src/services/middlewareService.d.ts +9 -0
  85. package/dist/src/services/middlewareService.d.ts.map +1 -0
  86. package/dist/src/services/middlewareService.js +34 -0
  87. package/dist/src/services/middlewareService.js.map +1 -0
  88. package/dist/src/services/organizationService.d.ts +10 -0
  89. package/dist/src/services/organizationService.d.ts.map +1 -0
  90. package/dist/src/services/organizationService.js +19 -0
  91. package/dist/src/services/organizationService.js.map +1 -0
  92. package/dist/src/services/requestBuilder.d.ts +17 -0
  93. package/dist/src/services/requestBuilder.d.ts.map +1 -0
  94. package/dist/src/services/requestBuilder.js +104 -0
  95. package/dist/src/services/requestBuilder.js.map +1 -0
  96. package/dist/src/services/responseUtils.d.ts +6 -0
  97. package/dist/src/services/responseUtils.d.ts.map +1 -0
  98. package/dist/src/services/responseUtils.js +32 -0
  99. package/dist/src/services/responseUtils.js.map +1 -0
  100. package/dist/src/services/rpcService.d.ts +77 -0
  101. package/dist/src/services/rpcService.d.ts.map +1 -0
  102. package/dist/src/services/rpcService.js +125 -0
  103. package/dist/src/services/rpcService.js.map +1 -0
  104. package/dist/src/services/service.d.ts +21 -0
  105. package/dist/src/services/service.d.ts.map +1 -0
  106. package/dist/src/services/service.js +41 -0
  107. package/dist/src/services/service.js.map +1 -0
  108. package/dist/src/services/userProfileService.d.ts +8 -0
  109. package/dist/src/services/userProfileService.d.ts.map +1 -0
  110. package/dist/src/services/userProfileService.js +32 -0
  111. package/dist/src/services/userProfileService.js.map +1 -0
  112. package/dist/src/storages/chats/answer.d.ts +40 -0
  113. package/dist/src/storages/chats/answer.d.ts.map +1 -0
  114. package/dist/src/storages/chats/answer.impl.d.ts +24 -0
  115. package/dist/src/storages/chats/answer.impl.d.ts.map +1 -0
  116. package/dist/src/storages/chats/answer.impl.js +130 -0
  117. package/dist/src/storages/chats/answer.impl.js.map +1 -0
  118. package/dist/src/storages/chats/answer.js +14 -0
  119. package/dist/src/storages/chats/answer.js.map +1 -0
  120. package/dist/src/storages/chats/chat.d.ts +39 -0
  121. package/dist/src/storages/chats/chat.d.ts.map +1 -0
  122. package/dist/src/storages/chats/chat.impl.d.ts +24 -0
  123. package/dist/src/storages/chats/chat.impl.d.ts.map +1 -0
  124. package/dist/src/storages/chats/chat.impl.js +98 -0
  125. package/dist/src/storages/chats/chat.impl.js.map +1 -0
  126. package/dist/src/storages/chats/chat.js +12 -0
  127. package/dist/src/storages/chats/chat.js.map +1 -0
  128. package/dist/src/storages/chats/chats.d.ts +40 -0
  129. package/dist/src/storages/chats/chats.d.ts.map +1 -0
  130. package/dist/src/storages/chats/chats.impl.d.ts +18 -0
  131. package/dist/src/storages/chats/chats.impl.d.ts.map +1 -0
  132. package/dist/src/storages/chats/chats.impl.js +102 -0
  133. package/dist/src/storages/chats/chats.impl.js.map +1 -0
  134. package/dist/src/storages/chats/chats.js +16 -0
  135. package/dist/src/storages/chats/chats.js.map +1 -0
  136. package/dist/src/storages/files/file.d.ts +31 -0
  137. package/dist/src/storages/files/file.d.ts.map +1 -0
  138. package/dist/src/storages/files/file.impl.d.ts +21 -0
  139. package/dist/src/storages/files/file.impl.d.ts.map +1 -0
  140. package/dist/src/storages/files/file.impl.js +64 -0
  141. package/dist/src/storages/files/file.impl.js.map +1 -0
  142. package/dist/src/storages/files/file.js +11 -0
  143. package/dist/src/storages/files/file.js.map +1 -0
  144. package/dist/src/storages/files/files.d.ts +34 -0
  145. package/dist/src/storages/files/files.d.ts.map +1 -0
  146. package/dist/src/storages/files/files.impl.d.ts +22 -0
  147. package/dist/src/storages/files/files.impl.d.ts.map +1 -0
  148. package/dist/src/storages/files/files.impl.js +140 -0
  149. package/dist/src/storages/files/files.impl.js.map +1 -0
  150. package/dist/src/storages/files/files.js +20 -0
  151. package/dist/src/storages/files/files.js.map +1 -0
  152. package/dist/src/storages/files/filesPage.d.ts +28 -0
  153. package/dist/src/storages/files/filesPage.d.ts.map +1 -0
  154. package/dist/src/storages/files/filesPage.impl.d.ts +15 -0
  155. package/dist/src/storages/files/filesPage.impl.d.ts.map +1 -0
  156. package/dist/src/storages/files/filesPage.impl.js +38 -0
  157. package/dist/src/storages/files/filesPage.impl.js.map +1 -0
  158. package/dist/src/storages/files/filesPage.js +10 -0
  159. package/dist/src/storages/files/filesPage.js.map +1 -0
  160. package/dist/src/storages/groups/groups.d.ts +91 -0
  161. package/dist/src/storages/groups/groups.d.ts.map +1 -0
  162. package/dist/src/storages/groups/groups.impl.d.ts +61 -0
  163. package/dist/src/storages/groups/groups.impl.d.ts.map +1 -0
  164. package/dist/src/storages/groups/groups.impl.js +293 -0
  165. package/dist/src/storages/groups/groups.impl.js.map +1 -0
  166. package/dist/src/storages/groups/groups.js +26 -0
  167. package/dist/src/storages/groups/groups.js.map +1 -0
  168. package/dist/src/storages/organizations/organization.d.ts +54 -0
  169. package/dist/src/storages/organizations/organization.d.ts.map +1 -0
  170. package/dist/src/storages/organizations/organization.impl.d.ts +32 -0
  171. package/dist/src/storages/organizations/organization.impl.d.ts.map +1 -0
  172. package/dist/src/storages/organizations/organization.impl.js +120 -0
  173. package/dist/src/storages/organizations/organization.impl.js.map +1 -0
  174. package/dist/src/storages/organizations/organization.js +18 -0
  175. package/dist/src/storages/organizations/organization.js.map +1 -0
  176. package/dist/src/storages/organizations/organizations.d.ts +46 -0
  177. package/dist/src/storages/organizations/organizations.d.ts.map +1 -0
  178. package/dist/src/storages/organizations/organizations.impl.d.ts +38 -0
  179. package/dist/src/storages/organizations/organizations.impl.d.ts.map +1 -0
  180. package/dist/src/storages/organizations/organizations.impl.js +151 -0
  181. package/dist/src/storages/organizations/organizations.impl.js.map +1 -0
  182. package/dist/src/storages/organizations/organizations.js +20 -0
  183. package/dist/src/storages/organizations/organizations.js.map +1 -0
  184. package/dist/src/storages/user/userProfile.d.ts +32 -0
  185. package/dist/src/storages/user/userProfile.d.ts.map +1 -0
  186. package/dist/src/storages/user/userProfile.impl.d.ts +13 -0
  187. package/dist/src/storages/user/userProfile.impl.d.ts.map +1 -0
  188. package/dist/src/storages/user/userProfile.impl.js +51 -0
  189. package/dist/src/storages/user/userProfile.impl.js.map +1 -0
  190. package/dist/src/storages/user/userProfile.js +12 -0
  191. package/dist/src/storages/user/userProfile.js.map +1 -0
  192. package/dist/src/storages/workspaces/workspace.d.ts +44 -0
  193. package/dist/src/storages/workspaces/workspace.d.ts.map +1 -0
  194. package/dist/src/storages/workspaces/workspace.impl.d.ts +23 -0
  195. package/dist/src/storages/workspaces/workspace.impl.d.ts.map +1 -0
  196. package/dist/src/storages/workspaces/workspace.impl.js +98 -0
  197. package/dist/src/storages/workspaces/workspace.impl.js.map +1 -0
  198. package/dist/src/storages/workspaces/workspace.js +18 -0
  199. package/dist/src/storages/workspaces/workspace.js.map +1 -0
  200. package/dist/src/storages/workspaces/workspaces.d.ts +47 -0
  201. package/dist/src/storages/workspaces/workspaces.d.ts.map +1 -0
  202. package/dist/src/storages/workspaces/workspaces.impl.d.ts +33 -0
  203. package/dist/src/storages/workspaces/workspaces.impl.d.ts.map +1 -0
  204. package/dist/src/storages/workspaces/workspaces.impl.js +157 -0
  205. package/dist/src/storages/workspaces/workspaces.impl.js.map +1 -0
  206. package/dist/src/storages/workspaces/workspaces.js +19 -0
  207. package/dist/src/storages/workspaces/workspaces.js.map +1 -0
  208. package/dist/src/unitTest.d.ts +12 -0
  209. package/dist/src/unitTest.d.ts.map +1 -0
  210. package/dist/src/unitTest.js +44 -0
  211. package/dist/src/unitTest.js.map +1 -0
  212. package/index.d.ts +1 -0
  213. package/index.js +1 -0
  214. package/package.json +43 -4
  215. package/src/appBuilder.ts +6 -6
  216. package/src/commands/startCommandHandler.ts +2 -2
  217. package/src/context.ts +5 -4
  218. package/src/credentials.ts +29 -7
  219. package/src/{appSdk.ts → dataIslandApp.ts} +7 -7
  220. package/src/disposable.ts +20 -8
  221. package/src/dto/accessGroupResponse.ts +35 -0
  222. package/src/dto/chatResponse.ts +103 -0
  223. package/src/dto/userInfoResponse.ts +15 -3
  224. package/src/dto/workspacesResponse.ts +49 -0
  225. package/src/events.ts +13 -13
  226. package/src/index.ts +41 -20
  227. package/src/internal/app.impl.ts +28 -31
  228. package/src/internal/appBuilder.impl.ts +16 -16
  229. package/src/internal/createApp.impl.ts +5 -5
  230. package/src/internal/registry.ts +54 -6
  231. package/src/services/commandService.ts +3 -3
  232. package/src/services/credentialService.ts +3 -3
  233. package/src/services/middlewareService.ts +4 -4
  234. package/src/services/organizationService.ts +18 -116
  235. package/src/services/requestBuilder.ts +40 -15
  236. package/src/services/responseUtils.ts +32 -0
  237. package/src/services/rpcService.ts +28 -11
  238. package/src/services/service.ts +10 -8
  239. package/src/services/userProfileService.ts +18 -66
  240. package/src/storages/chats/answer.impl.ts +186 -0
  241. package/src/storages/chats/answer.ts +55 -0
  242. package/src/storages/chats/chat.impl.ts +126 -0
  243. package/src/storages/chats/chat.ts +49 -0
  244. package/src/storages/chats/chats.impl.ts +142 -0
  245. package/src/storages/chats/chats.ts +47 -0
  246. package/src/storages/files/file.impl.ts +87 -0
  247. package/src/storages/files/file.ts +40 -0
  248. package/src/storages/files/files.impl.ts +191 -0
  249. package/src/storages/files/files.ts +39 -0
  250. package/src/storages/files/filesPage.impl.ts +37 -0
  251. package/src/storages/files/filesPage.ts +33 -0
  252. package/src/storages/groups/groups.impl.ts +386 -0
  253. package/src/storages/groups/groups.ts +106 -0
  254. package/src/storages/organizations/organization.impl.ts +163 -0
  255. package/src/storages/organizations/organization.ts +67 -0
  256. package/src/storages/organizations/organizations.impl.ts +197 -0
  257. package/src/storages/{organizations.ts → organizations/organizations.ts} +8 -28
  258. package/src/storages/user/userProfile.impl.ts +56 -0
  259. package/src/storages/{userProfile.ts → user/userProfile.ts} +2 -2
  260. package/src/storages/workspaces/workspace.impl.ts +129 -0
  261. package/src/storages/workspaces/workspace.ts +54 -0
  262. package/src/storages/workspaces/workspaces.impl.ts +212 -0
  263. package/src/storages/workspaces/workspaces.ts +53 -0
  264. package/src/unitTest.ts +12 -1
  265. package/.browserslistrc +0 -5
  266. package/.editorconfig +0 -22
  267. package/.eslintrc.json +0 -44
  268. package/.github/workflows/publish-npm.yml +0 -28
  269. package/.prettierignore +0 -1
  270. package/.prettierrc +0 -11
  271. package/.yarnrc +0 -2
  272. package/babel.config.js +0 -6
  273. package/jest.config.ts +0 -199
  274. package/jest.setup.ts +0 -2
  275. package/src/services/organizationImpl.ts +0 -51
  276. package/src/services/organizationsImpl.ts +0 -55
  277. package/src/types.ts +0 -86
  278. package/test/commands.test.ts +0 -24
  279. package/test/disposable.test.ts +0 -39
  280. package/test/events.test.ts +0 -151
  281. package/test/index.test.ts +0 -163
  282. package/test/registry.test.ts +0 -44
  283. package/test/services.test.ts +0 -56
  284. package/test/setup.ts +0 -2
  285. package/test/unitTest.test.ts +0 -21
  286. package/tsconfig.json +0 -31
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.StepTypeInfo = exports.StepType = exports.StepStatus = exports.AnswerStatus = void 0;
4
+ var AnswerStatus;
5
+ (function (AnswerStatus) {
6
+ AnswerStatus[AnswerStatus["RUNNING"] = 0] = "RUNNING";
7
+ AnswerStatus[AnswerStatus["SUCCESS"] = 1] = "SUCCESS";
8
+ AnswerStatus[AnswerStatus["CANCELED"] = 2] = "CANCELED";
9
+ AnswerStatus[AnswerStatus["FAIL"] = 3] = "FAIL";
10
+ })(AnswerStatus || (exports.AnswerStatus = AnswerStatus = {}));
11
+ var StepStatus;
12
+ (function (StepStatus) {
13
+ StepStatus[StepStatus["RUNNING"] = 0] = "RUNNING";
14
+ StepStatus[StepStatus["SUCCESS"] = 1] = "SUCCESS";
15
+ StepStatus[StepStatus["FAIL"] = 2] = "FAIL";
16
+ StepStatus[StepStatus["CANCELED"] = 3] = "CANCELED";
17
+ })(StepStatus || (exports.StepStatus = StepStatus = {}));
18
+ var StepType;
19
+ (function (StepType) {
20
+ StepType[StepType["PREPARE"] = 0] = "PREPARE";
21
+ StepType[StepType["SOURCES"] = 1] = "SOURCES";
22
+ StepType[StepType["GENERATE_ANSWER"] = 6] = "GENERATE_ANSWER";
23
+ StepType[StepType["FINALIZE_RESULT"] = 9] = "FINALIZE_RESULT";
24
+ StepType[StepType["DONE"] = 10] = "DONE";
25
+ })(StepType || (exports.StepType = StepType = {}));
26
+ class StepTypeInfo {
27
+ static hasTokens(type) {
28
+ switch (type) {
29
+ case StepType.GENERATE_ANSWER:
30
+ case StepType.DONE:
31
+ case StepType.FINALIZE_RESULT:
32
+ return true;
33
+ }
34
+ return false;
35
+ }
36
+ static hasSources(type) {
37
+ switch (type) {
38
+ case StepType.SOURCES:
39
+ return true;
40
+ }
41
+ return false;
42
+ }
43
+ }
44
+ exports.StepTypeInfo = StepTypeInfo;
45
+ //# sourceMappingURL=chatResponse.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chatResponse.js","sourceRoot":"","sources":["../../../src/dto/chatResponse.ts"],"names":[],"mappings":";;;AAgCA,IAAY,YAKX;AALD,WAAY,YAAY;IACtB,qDAAW,CAAA;IACX,qDAAW,CAAA;IACX,uDAAY,CAAA;IACZ,+CAAQ,CAAA;AACV,CAAC,EALW,YAAY,4BAAZ,YAAY,QAKvB;AAgCD,IAAY,UAKX;AALD,WAAY,UAAU;IACpB,iDAAW,CAAA;IACX,iDAAW,CAAA;IACX,2CAAQ,CAAA;IACR,mDAAY,CAAA;AACd,CAAC,EALW,UAAU,0BAAV,UAAU,QAKrB;AAED,IAAY,QAMX;AAND,WAAY,QAAQ;IAClB,6CAAW,CAAA;IACX,6CAAW,CAAA;IACX,6DAAmB,CAAA;IACnB,6DAAmB,CAAA;IACnB,wCAAS,CAAA;AACX,CAAC,EANW,QAAQ,wBAAR,QAAQ,QAMnB;AAED,MAAa,YAAY;IAChB,MAAM,CAAC,SAAS,CAAC,IAAc;QACpC,QAAQ,IAAI,EAAE,CAAC;YACf,KAAK,QAAQ,CAAC,eAAe,CAAC;YAC9B,KAAK,QAAQ,CAAC,IAAI,CAAC;YACnB,KAAK,QAAQ,CAAC,eAAe;gBAC3B,OAAO,IAAI,CAAA;QACb,CAAC;QACD,OAAO,KAAK,CAAA;IACd,CAAC;IAEM,MAAM,CAAC,UAAU,CAAC,IAAc;QACrC,QAAQ,IAAI,EAAE,CAAC;YACf,KAAK,QAAQ,CAAC,OAAO;gBACnB,OAAO,IAAI,CAAA;QACb,CAAC;QACD,OAAO,KAAK,CAAA;IACd,CAAC;CACF;AAlBD,oCAkBC"}
@@ -0,0 +1,42 @@
1
+ import { WorkspaceDto } from "./workspacesResponse";
2
+ import { UserId } from "../storages/user/userProfile";
3
+ import { OrganizationId } from "../storages/organizations/organizations";
4
+ export interface UserInfoResponse {
5
+ adminInOrganization: string[];
6
+ organizations: OrganizationDto[];
7
+ user: UserDto;
8
+ }
9
+ export interface UserDto {
10
+ id: UserId;
11
+ isDeleted: boolean;
12
+ created_at: number;
13
+ modified_at: number;
14
+ profile: ProfileDto;
15
+ settings?: UserSettings | null;
16
+ }
17
+ export interface ProfileDto {
18
+ name: string;
19
+ email: string;
20
+ }
21
+ export interface UserSettings {
22
+ activeOrganizationId: string;
23
+ activeWorkspaceId: string;
24
+ }
25
+ export interface OrganizationProfileDto {
26
+ name: string;
27
+ description: string;
28
+ }
29
+ export interface OrganizationDto {
30
+ id: OrganizationId;
31
+ createdAt: number;
32
+ modifiedAt: number;
33
+ membersCount: number;
34
+ profile: OrganizationProfileDto;
35
+ }
36
+ export interface OrganizationWorkspaces extends OrganizationDto {
37
+ workspaces: WorkspaceDto[];
38
+ }
39
+ export interface MembersResponse {
40
+ members: UserDto;
41
+ }
42
+ //# sourceMappingURL=userInfoResponse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"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=userInfoResponse.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"userInfoResponse.js","sourceRoot":"","sources":["../../../src/dto/userInfoResponse.ts"],"names":[],"mappings":""}
@@ -0,0 +1,43 @@
1
+ import { WorkspaceId } from "../storages/workspaces/workspaces";
2
+ import { FileId } from "../storages/files/file";
3
+ export interface WorkspaceProfileDto {
4
+ name: string;
5
+ description: string;
6
+ }
7
+ export interface WorkspaceDto {
8
+ id: WorkspaceId;
9
+ createdAt: number;
10
+ modifiedAt: number;
11
+ profile: WorkspaceProfileDto;
12
+ }
13
+ export interface WorkspacesResponse {
14
+ workspaces: WorkspaceDto[];
15
+ }
16
+ export interface FileUrlDto {
17
+ url: string;
18
+ }
19
+ export interface FileProgressDto {
20
+ file_id: FileId;
21
+ file_parts_count: number;
22
+ completed_parts_count: number;
23
+ success: boolean;
24
+ error?: string;
25
+ }
26
+ export interface FileDto {
27
+ id: string;
28
+ createdAt: number;
29
+ modifiedAt: number;
30
+ name: string;
31
+ description: string;
32
+ url: string;
33
+ hash: string;
34
+ organizationId: string;
35
+ workspaceId: string;
36
+ isProcessedSuccessfully: boolean;
37
+ }
38
+ export interface FileListResponse {
39
+ files: FileDto[];
40
+ totalFilesCount: number;
41
+ filesPerPage: number;
42
+ }
43
+ //# sourceMappingURL=workspacesResponse.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workspacesResponse.d.ts","sourceRoot":"","sources":["../../../src/dto/workspacesResponse.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAA;AAC/D,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAA;AAE/C,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,EAAE,MAAM,CAAA;CACpB;AAED,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,WAAW,CAAA;IACf,SAAS,EAAE,MAAM,CAAA;IACjB,UAAU,EAAE,MAAM,CAAA;IAClB,OAAO,EAAE,mBAAmB,CAAA;CAC7B;AAED,MAAM,WAAW,kBAAkB;IACjC,UAAU,EAAE,YAAY,EAAE,CAAA;CAC3B;AAED,MAAM,WAAW,UAAU;IACzB,GAAG,EAAE,MAAM,CAAA;CACZ;AAED,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,MAAM,CAAA;IACf,gBAAgB,EAAE,MAAM,CAAA;IACxB,qBAAqB,EAAE,MAAM,CAAA;IAC7B,OAAO,EAAE,OAAO,CAAA;IAChB,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED,MAAM,WAAW,OAAO;IACtB,EAAE,EAAE,MAAM,CAAA;IACV,SAAS,EAAE,MAAM,CAAA;IACjB,UAAU,EAAE,MAAM,CAAA;IAClB,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,EAAE,MAAM,CAAA;IACnB,GAAG,EAAE,MAAM,CAAA;IACX,IAAI,EAAE,MAAM,CAAA;IACZ,cAAc,EAAE,MAAM,CAAA;IACtB,WAAW,EAAE,MAAM,CAAA;IACnB,uBAAuB,EAAE,OAAO,CAAA;CACjC;AAED,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,OAAO,EAAE,CAAA;IAChB,eAAe,EAAE,MAAM,CAAA;IACvB,YAAY,EAAE,MAAM,CAAA;CACrB"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=workspacesResponse.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workspacesResponse.js","sourceRoot":"","sources":["../../../src/dto/workspacesResponse.ts"],"names":[],"mappings":""}
@@ -0,0 +1,17 @@
1
+ import { type Disposable } from "./disposable";
2
+ export interface Input<EventType, DataType> {
3
+ type?: EventType;
4
+ data: DataType;
5
+ }
6
+ export interface Event<EventType, DataType> extends Input<EventType, DataType> {
7
+ unsubscribe: () => void;
8
+ }
9
+ export interface EventSubscriber<EventType, DataType> {
10
+ subscribe: (callback: (event: Event<EventType, DataType>) => void, type?: EventType) => Disposable;
11
+ }
12
+ export declare class EventDispatcher<EventType, DataType> implements EventSubscriber<EventType, DataType> {
13
+ private _listeners;
14
+ dispatch(input: Input<EventType, DataType>): void;
15
+ subscribe(callback: (event: Event<EventType, DataType>) => void, type?: EventType): Disposable;
16
+ }
17
+ //# sourceMappingURL=events.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../src/events.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,UAAU,EAAuB,MAAM,cAAc,CAAA;AAEnE,MAAM,WAAW,KAAK,CAAC,SAAS,EAAE,QAAQ;IACxC,IAAI,CAAC,EAAE,SAAS,CAAA;IAChB,IAAI,EAAE,QAAQ,CAAA;CACf;AAED,MAAM,WAAW,KAAK,CAAC,SAAS,EAAE,QAAQ,CAAE,SAAQ,KAAK,CAAC,SAAS,EAAE,QAAQ,CAAC;IAC5E,WAAW,EAAE,MAAM,IAAI,CAAA;CACxB;AAED,MAAM,WAAW,eAAe,CAAC,SAAS,EAAE,QAAQ;IAClD,SAAS,EAAE,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,SAAS,EAAE,QAAQ,CAAC,KAAK,IAAI,EAAE,IAAI,CAAC,EAAE,SAAS,KAAK,UAAU,CAAA;CACnG;AAED,qBAAa,eAAe,CAAC,SAAS,EAAE,QAAQ,CAAE,YAAW,eAAe,CAAC,SAAS,EAAE,QAAQ,CAAC;IAC/F,OAAO,CAAC,UAAU,CAGX;IAEP,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC,SAAS,EAAE,QAAQ,CAAC,GAAG,IAAI;IAajD,SAAS,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,SAAS,EAAE,QAAQ,CAAC,KAAK,IAAI,EAAE,IAAI,CAAC,EAAE,SAAS,GAAG,UAAU;CAgC/F"}
@@ -0,0 +1,52 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.EventDispatcher = void 0;
4
+ const disposable_1 = require("./disposable");
5
+ class EventDispatcher {
6
+ constructor() {
7
+ this._listeners = [];
8
+ }
9
+ dispatch(input) {
10
+ this._listeners.slice().forEach(it => {
11
+ const value = {
12
+ type: input.type,
13
+ data: input.data,
14
+ unsubscribe: () => {
15
+ it.disposable.dispose();
16
+ }
17
+ };
18
+ it.callback(value);
19
+ });
20
+ }
21
+ subscribe(callback, type) {
22
+ const container = new disposable_1.DisposableContainer();
23
+ if (type !== undefined) {
24
+ const cb = callback;
25
+ const listener = (evt) => {
26
+ if (evt.type === type) {
27
+ cb(evt);
28
+ }
29
+ };
30
+ const value = {
31
+ callback: listener,
32
+ disposable: container
33
+ };
34
+ container.addCallback(() => {
35
+ this._listeners = this._listeners.filter(it => it !== value);
36
+ }, this);
37
+ this._listeners.push(value);
38
+ return container;
39
+ }
40
+ const value = {
41
+ callback,
42
+ disposable: container
43
+ };
44
+ container.addCallback(() => {
45
+ this._listeners = this._listeners.filter(it => it !== value);
46
+ }, this);
47
+ this._listeners.push(value);
48
+ return container;
49
+ }
50
+ }
51
+ exports.EventDispatcher = EventDispatcher;
52
+ //# sourceMappingURL=events.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"events.js","sourceRoot":"","sources":["../../src/events.ts"],"names":[],"mappings":";;;AAAA,6CAAmE;AAenE,MAAa,eAAe;IAA5B;QACU,eAAU,GAGb,EAAE,CAAA;IA+CT,CAAC;IA7CC,QAAQ,CAAC,KAAiC;QACxC,IAAI,CAAC,UAAU,CAAC,KAAK,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE;YACnC,MAAM,KAAK,GAAG;gBACZ,IAAI,EAAE,KAAK,CAAC,IAAI;gBAChB,IAAI,EAAE,KAAK,CAAC,IAAI;gBAChB,WAA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AA;QAC3B,OAAO,SAAS,CAAA;IAClB,CAAC;CACF;AAnDD,0CAmDC"}
@@ -0,0 +1,58 @@
1
+ import { type AppBuilder } from "./appBuilder";
2
+ import { type DataIslandApp } from "./dataIslandApp";
3
+ export * from "./events";
4
+ export * from "./disposable";
5
+ export * from "./credentials";
6
+ export * from "./dataIslandApp";
7
+ export * from "./appBuilder";
8
+ export * from "./context";
9
+ export * from "./middleware";
10
+ export * from "./dto/chatResponse";
11
+ export * from "./dto/accessGroupResponse";
12
+ export * from "./dto/userInfoResponse";
13
+ export * from "./dto/workspacesResponse";
14
+ export * from "./storages/organizations/organizations";
15
+ export * from "./storages/organizations/organization";
16
+ export * from "./storages/workspaces/workspaces";
17
+ export * from "./storages/workspaces/workspace";
18
+ export * from "./storages/groups/groups";
19
+ export * from "./storages/user/userProfile";
20
+ export * from "./storages/files/files";
21
+ export * from "./storages/files/file";
22
+ export * from "./storages/files/filesPage";
23
+ export * from "./storages/chats/chats";
24
+ export * from "./storages/chats/chat";
25
+ /**
26
+ * Current SDK version.
27
+ */
28
+ export declare const SDK_VERSION: string;
29
+ /**
30
+ * Default DataIsland App name.
31
+ */
32
+ export declare const DEFAULT_NAME = "[DEFAULT]";
33
+ /**
34
+ * Default DataIsland App host.
35
+ */
36
+ export declare const DEFAULT_HOST = "https://api.dataisland.com.ua";
37
+ /**
38
+ * Returns a list of DataIsland App instances.
39
+ */
40
+ export declare function dataIslandInstances(): DataIslandApp[];
41
+ /**
42
+ * Returns a DataIsland App instance.
43
+ * @param name Optional The name of the app.
44
+ * @param setup Optional setup function.
45
+ * @returns A DataIsland App instance.
46
+ * @example
47
+ * ```js
48
+ * import { dataIslandApp, DEFAULT_NAME } from '@neuralinnovations/dataisland-sdk'
49
+ *
50
+ * const app = await dataIslandApp(DEFAULT_NAME, builder => {
51
+ * builder.useHost("https://dataisland.com.ua")
52
+ * builder.useAutomaticDataCollectionEnabled(true)
53
+ * builder.useCredential(new BasicCredential("email", "password"))
54
+ * })
55
+ * ```
56
+ */
57
+ export declare function dataIslandApp(name?: string, setup?: (builder: AppBuilder) => Promise<void>): Promise<DataIslandApp>;
58
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,cAAc,CAAA;AAC9C,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAEpD,cAAc,UAAU,CAAA;AACxB,cAAc,cAAc,CAAA;AAC5B,cAAc,eAAe,CAAA;AAC7B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,cAAc,CAAA;AAC5B,cAAc,WAAW,CAAA;AACzB,cAAc,cAAc,CAAA;AAC5B,cAAc,oBAAoB,CAAA;AAClC,cAAc,2BAA2B,CAAA;AACzC,cAAc,wBAAwB,CAAA;AACtC,cAAc,0BAA0B,CAAA;AACxC,cAAc,wCAAwC,CAAA;AACtD,cAAc,uCAAuC,CAAA;AACrD,cAAc,kCAAkC,CAAA;AAChD,cAAc,iCAAiC,CAAA;AAC/C,cAAc,0BAA0B,CAAA;AACxC,cAAc,6BAA6B,CAAA;AAC3C,cAAc,wBAAwB,CAAA;AACtC,cAAc,uBAAuB,CAAA;AACrC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,wBAAwB,CAAA;AACtC,cAAc,uBAAuB,CAAA;AAOrC;;GAEG;AACH,eAAO,MAAM,WAAW,QAAU,CAAA;AAElC;;GAEG;AACH,eAAO,MAAM,YAAY,cAAc,CAAA;AAEvC;;GAEG;AACH,eAAO,MAAM,YAAY,kCAAkC,CAAA;AAE3D;;GAEG;AACH,wBAAgB,mBAAmB,IAAI,aAAa,EAAE,CAErD;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAsB,aAAa,CACjC,IAAI,CAAC,EAAE,MAAM,EACb,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,UAAU,KAAK,OAAO,CAAC,IAAI,CAAC,GAC7C,OAAO,CAAC,aAAa,CAAC,CAuBxB"}
@@ -0,0 +1,91 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.dataIslandApp = exports.dataIslandInstances = exports.DEFAULT_HOST = exports.DEFAULT_NAME = exports.SDK_VERSION = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const package_json_1 = require("../package.json");
6
+ const createApp_impl_1 = require("./internal/createApp.impl");
7
+ tslib_1.__exportStar(require("./events"), exports);
8
+ tslib_1.__exportStar(require("./disposable"), exports);
9
+ tslib_1.__exportStar(require("./credentials"), exports);
10
+ tslib_1.__exportStar(require("./dataIslandApp"), exports);
11
+ tslib_1.__exportStar(require("./appBuilder"), exports);
12
+ tslib_1.__exportStar(require("./context"), exports);
13
+ tslib_1.__exportStar(require("./middleware"), exports);
14
+ tslib_1.__exportStar(require("./dto/chatResponse"), exports);
15
+ tslib_1.__exportStar(require("./dto/accessGroupResponse"), exports);
16
+ tslib_1.__exportStar(require("./dto/userInfoResponse"), exports);
17
+ tslib_1.__exportStar(require("./dto/workspacesResponse"), exports);
18
+ tslib_1.__exportStar(require("./storages/organizations/organizations"), exports);
19
+ tslib_1.__exportStar(require("./storages/organizations/organization"), exports);
20
+ tslib_1.__exportStar(require("./storages/workspaces/workspaces"), exports);
21
+ tslib_1.__exportStar(require("./storages/workspaces/workspace"), exports);
22
+ tslib_1.__exportStar(require("./storages/groups/groups"), exports);
23
+ tslib_1.__exportStar(require("./storages/user/userProfile"), exports);
24
+ tslib_1.__exportStar(require("./storages/files/files"), exports);
25
+ tslib_1.__exportStar(require("./storages/files/file"), exports);
26
+ tslib_1.__exportStar(require("./storages/files/filesPage"), exports);
27
+ tslib_1.__exportStar(require("./storages/chats/chats"), exports);
28
+ tslib_1.__exportStar(require("./storages/chats/chat"), exports);
29
+ // map of apps that are not ready to be used
30
+ const _appsNotReady = new Map();
31
+ // map of apps that are ready to be used
32
+ const _appsReady = new Map();
33
+ /**
34
+ * Current SDK version.
35
+ */
36
+ exports.SDK_VERSION = package_json_1.version;
37
+ /**
38
+ * Default DataIsland App name.
39
+ */
40
+ exports.DEFAULT_NAME = "[DEFAULT]";
41
+ /**
42
+ * Default DataIsland App host.
43
+ */
44
+ exports.DEFAULT_HOST = "https://api.dataisland.com.ua";
45
+ /**
46
+ * Returns a list of DataIsland App instances.
47
+ */
48
+ function dataIslandInstances() {
49
+ return Array.from(_appsReady.values());
50
+ }
51
+ exports.dataIslandInstances = dataIslandInstances;
52
+ /**
53
+ * Returns a DataIsland App instance.
54
+ * @param name Optional The name of the app.
55
+ * @param setup Optional setup function.
56
+ * @returns A DataIsland App instance.
57
+ * @example
58
+ * ```js
59
+ * import { dataIslandApp, DEFAULT_NAME } from '@neuralinnovations/dataisland-sdk'
60
+ *
61
+ * const app = await dataIslandApp(DEFAULT_NAME, builder => {
62
+ * builder.useHost("https://dataisland.com.ua")
63
+ * builder.useAutomaticDataCollectionEnabled(true)
64
+ * builder.useCredential(new BasicCredential("email", "password"))
65
+ * })
66
+ * ```
67
+ */
68
+ async function dataIslandApp(name, setup) {
69
+ name = name !== null && name !== void 0 ? name : exports.DEFAULT_NAME;
70
+ let appPromise = _appsNotReady.get(name);
71
+ if (appPromise === undefined) {
72
+ appPromise = (0, createApp_impl_1._createApp)(name, setup);
73
+ appPromise
74
+ .then(app => {
75
+ _appsReady.set(name !== null && name !== void 0 ? name : exports.DEFAULT_NAME, app);
76
+ })
77
+ .catch(reason => {
78
+ console.error(`Error: ${reason}`);
79
+ _appsNotReady.delete(name !== null && name !== void 0 ? name : exports.DEFAULT_NAME);
80
+ });
81
+ _appsNotReady.set(name, appPromise);
82
+ }
83
+ else {
84
+ if (setup !== undefined) {
85
+ throw new Error(`DataIsland ${name} is initializing. You can't setup the same again.`);
86
+ }
87
+ }
88
+ return await appPromise;
89
+ }
90
+ exports.dataIslandApp = dataIslandApp;
91
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"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,aAAJ,IAAI,cAAJ,IAAI,GAAI,oBAAY,EAAE,GAAG,CAAC,CAAA;QAC3C,CAAC,CAAC;aACD,KAAK,CAAC,MAAM,CAAC,EAAE;YACd,OAAO,CAAC,KAAK,CAAC,UAAU,MAAM,EAAE,CAAC,CAAA;YACjC,aAAa,CAAC,MAAM,CAAC,IAAI,aAAJ,IAAI,cAAJ,IAAI,GAAI,oBAAY,CAAC,CAAA;QAC5C,CAAC,CAAC,CAAA;QACJ,aAAa,CAAC,GAAG,CAAC,IAAI,EAAE,UAAU,CAAC,CAAA;IACrC,CAAC;SAAM,CAAC;QACN,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YACxB,MAAM,IAAI,KAAK,CACb,cAAc,IAAI,mDAAmD,CACtE,CAAA;QACH,CAAC;IACH,CAAC;IACD,OAAO,MAAM,UAAU,CAAA;AACzB,CAAC;AA1BD,sCA0BC"}
@@ -0,0 +1,28 @@
1
+ import { type AppBuilder } from "../appBuilder";
2
+ import { type Constructor } from "./registry";
3
+ import { Context } from "../context";
4
+ import { type Lifetime } from "../disposable";
5
+ import { type CredentialBase } from "../credentials";
6
+ import { DataIslandApp } from "../dataIslandApp";
7
+ import { Organizations } from "../storages/organizations/organizations";
8
+ import { UserProfile } from "../storages/user/userProfile";
9
+ export declare class DataIslandAppImpl extends DataIslandApp {
10
+ readonly name: string;
11
+ private _host;
12
+ private _automaticDataCollectionEnabled;
13
+ private readonly _registry;
14
+ private readonly _context;
15
+ private readonly _disposable;
16
+ constructor(name: string);
17
+ get context(): Context;
18
+ get credential(): CredentialBase | undefined;
19
+ set credential(value: CredentialBase);
20
+ get lifetime(): Lifetime;
21
+ resolve: <T>(type: Constructor<T>) => T | undefined;
22
+ get automaticDataCollectionEnabled(): boolean;
23
+ get host(): string;
24
+ get organizations(): Organizations;
25
+ get userProfile(): UserProfile;
26
+ initialize(setup: ((builder: AppBuilder) => Promise<void>) | undefined): Promise<void>;
27
+ }
28
+ //# sourceMappingURL=app.impl.d.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AO,CAAC,IAAI,CAAC,CAAC,GAAG,SAAS,GAC1D,OAAO,CAAC,IAAI,CAAC;CA0GjB"}
@@ -0,0 +1,151 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DataIslandAppImpl = void 0;
4
+ const index_1 = require("../index");
5
+ const appBuilder_impl_1 = require("./appBuilder.impl");
6
+ const registry_1 = require("./registry");
7
+ const context_1 = require("../context");
8
+ const disposable_1 = require("../disposable");
9
+ const service_1 = require("../services/service");
10
+ const credentialService_1 = require("../services/credentialService");
11
+ const middlewareService_1 = require("../services/middlewareService");
12
+ const dataIslandApp_1 = require("../dataIslandApp");
13
+ const rpcService_1 = require("../services/rpcService");
14
+ const commandService_1 = require("../services/commandService");
15
+ const startCommandHandler_1 = require("../commands/startCommandHandler");
16
+ const userProfileService_1 = require("../services/userProfileService");
17
+ const organizationService_1 = require("../services/organizationService");
18
+ const unitTest_1 = require("../unitTest");
19
+ class DataIslandAppImpl extends dataIslandApp_1.DataIslandApp {
20
+ constructor(name) {
21
+ super();
22
+ this._host = index_1.DEFAULT_HOST;
23
+ this._automaticDataCollectionEnabled = true;
24
+ this.resolve = (type) => this._registry.get(type);
25
+ this.name = name;
26
+ this._registry = new registry_1.Registry();
27
+ this._disposable = new disposable_1.DisposableContainer();
28
+ this._context = new context_1.Context(this._registry, this._disposable.lifetime, name);
29
+ this._registry.map(context_1.Context).asValue(this._context);
30
+ }
31
+ get context() {
32
+ return this._context;
33
+ }
34
+ get credential() {
35
+ var _a;
36
+ return (_a = this.resolve(credentialService_1.CredentialService)) === null || _a === void 0 ? void 0 : _a.credential;
37
+ }
38
+ set credential(value) {
39
+ var _a;
40
+ (_a = this.resolve(credentialService_1.CredentialService)) === null || _a === void 0 ? void 0 : _a.useCredential(value);
41
+ }
42
+ get lifetime() {
43
+ return this._disposable.lifetime;
44
+ }
45
+ get automaticDataCollectionEnabled() {
46
+ return this._automaticDataCollectionEnabled;
47
+ }
48
+ get host() {
49
+ return this._host;
50
+ }
51
+ get organizations() {
52
+ var _a;
53
+ return (_a = this.resolve(organizationService_1.OrganizationService)) === null || _a === void 0 ? void 0 : _a.organizations;
54
+ }
55
+ get userProfile() {
56
+ var _a;
57
+ return (_a = this.resolve(userProfileService_1.UserProfileService)) === null || _a === void 0 ? void 0 : _a.userProfile;
58
+ }
59
+ async initialize(setup) {
60
+ // create app builder
61
+ const builder = new appBuilder_impl_1.AppBuilderImplementation();
62
+ // register commands
63
+ builder.registerCommand(startCommandHandler_1.StartCommand, (context) => {
64
+ return new startCommandHandler_1.StartCommandHandler(context);
65
+ });
66
+ // register services
67
+ builder.registerService(credentialService_1.CredentialService, (context) => {
68
+ return new credentialService_1.CredentialService(context);
69
+ });
70
+ builder.registerService(middlewareService_1.MiddlewareService, (context) => {
71
+ return new middlewareService_1.MiddlewareService(context);
72
+ });
73
+ builder.registerService(rpcService_1.RpcService, (context) => {
74
+ return new rpcService_1.RpcService(context, builder.host);
75
+ });
76
+ builder.registerService(commandService_1.CommandService, (context) => {
77
+ return new commandService_1.CommandService(context);
78
+ });
79
+ builder.registerService(userProfileService_1.UserProfileService, (context) => {
80
+ return new userProfileService_1.UserProfileService(context);
81
+ });
82
+ builder.registerService(organizationService_1.OrganizationService, (context) => {
83
+ return new organizationService_1.OrganizationService(context);
84
+ });
85
+ // call customer setup
86
+ if (setup !== undefined) {
87
+ await setup(builder);
88
+ }
89
+ // host
90
+ this._host = builder.host;
91
+ // automaticDataCollectionEnabled
92
+ this._automaticDataCollectionEnabled =
93
+ builder.automaticDataCollectionEnabled;
94
+ // register services
95
+ const services = [];
96
+ builder.services.forEach(serviceFactory => {
97
+ const serviceContext = new service_1.ServiceContext(this._context, this._disposable.defineNested());
98
+ serviceContext.lifetime.addCallback(() => {
99
+ serviceContext.onUnregister();
100
+ }, serviceContext);
101
+ const serviceInstance = serviceFactory[1](serviceContext);
102
+ services.push([serviceContext, serviceInstance]);
103
+ this._registry.map(serviceFactory[0]).asValue(serviceInstance);
104
+ });
105
+ builder.middlewares.forEach(middleware => {
106
+ var _a;
107
+ (_a = this.resolve(middlewareService_1.MiddlewareService)) === null || _a === void 0 ? void 0 : _a.useMiddleware(middleware);
108
+ });
109
+ builder.commands.forEach(command => {
110
+ var _a;
111
+ (_a = this.resolve(commandService_1.CommandService)) === null || _a === void 0 ? void 0 : _a.register(command[0], command[1]);
112
+ });
113
+ this.credential = builder.credential;
114
+ //-------------------------------------------------------------------------
115
+ // register services
116
+ //-------------------------------------------------------------------------
117
+ const waitList = [];
118
+ // call onRegister service's callback
119
+ services.forEach(([serviceContext]) => {
120
+ if (typeof serviceContext.onRegister === "function") {
121
+ waitList.push(serviceContext.onRegister());
122
+ }
123
+ });
124
+ // wait for all services to register
125
+ await Promise.all(waitList);
126
+ //-------------------------------------------------------------------------
127
+ //-------------------------------------------------------------------------
128
+ // start services
129
+ //-------------------------------------------------------------------------
130
+ waitList.length = 0;
131
+ // call onStart service's callback
132
+ services.forEach(([serviceContext]) => {
133
+ if (typeof serviceContext.onStart === "function") {
134
+ waitList.push(serviceContext.onStart());
135
+ }
136
+ });
137
+ // wait for all services to start
138
+ await Promise.all(waitList);
139
+ //-------------------------------------------------------------------------
140
+ // start app, execute start command
141
+ if (!(0, unitTest_1.isUnitTest)(unitTest_1.UnitTest.DO_NOT_START)) {
142
+ await this.context.execute(new startCommandHandler_1.StartCommand());
143
+ }
144
+ // log app initialized
145
+ if (!(0, unitTest_1.isUnitTest)(unitTest_1.UnitTest.DO_NOT_PRINT_INITIALIZED_LOG)) {
146
+ console.log(`DataIsland ${this.name} initialized`);
147
+ }
148
+ }
149
+ }
150
+ exports.DataIslandAppImpl = DataIslandAppImpl;
151
+ //# sourceMappingURL=app.impl.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"app.impl.js","sourceRoot":"","sources":["../../../src/internal/app.impl.ts"],"names":[],"mappings":";;;AAAA,oCAAuC;AAEvC,uDAA4D;AAC5D,yCAAuD;AACvD,wCAAoC;AACpC,8CAAk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,CAAC,YAAY,CAAC,EAAE,CAAC;YACvC,MAAM,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,kCAAY,EAAE,CAAC,CAAA;QAChD,CAAC;QAED,sBAAsB;QACtB,IAAI,CAAC,IAAA,qBAAU,EAAC,mBAAQ,CAAC,4BAA4B,CAAC,EAAE,CAAC;YACvD,OAAO,CAAC,GAAG,CAAC,cAAc,IAAI,CAAC,IAAI,cAAc,CAAC,CAAA;QACpD,CAAC;IACH,CAAC;CACF;AAhKD,8CAgKC"}
@@ -0,0 +1,27 @@
1
+ import { AppBuilder } from "../appBuilder";
2
+ import { type CredentialBase } from "../credentials";
3
+ import type { Middleware } from "../middleware";
4
+ import { type Service, type ServiceContext } from "../services/service";
5
+ import { type Constructor } from "./registry";
6
+ import { Command, CommandHandler } from "../services/commandService";
7
+ import { Context } from "../context";
8
+ export declare class AppBuilderImplementation extends AppBuilder {
9
+ envData: Record<string, any>;
10
+ host: string;
11
+ automaticDataCollectionEnabled: boolean;
12
+ credential: CredentialBase;
13
+ middlewares: Middleware[];
14
+ services: Array<[Constructor<any>, (context: ServiceContext) => Service]>;
15
+ commands: Array<[
16
+ Constructor<any>,
17
+ (context: Context) => CommandHandler<any>
18
+ ]>;
19
+ get env(): Record<string, any>;
20
+ useHost(host: string): AppBuilder;
21
+ useAutomaticDataCollectionEnabled(value: boolean): AppBuilder;
22
+ useCredential(credential: CredentialBase): AppBuilder;
23
+ registerMiddleware(middleware: Middleware): AppBuilder;
24
+ registerService<T extends Service>(type: Constructor<T>, factory: (context: ServiceContext) => T): AppBuilder;
25
+ registerCommand<T extends Command>(messageType: Constructor<T>, commandFactory: (context: Context) => CommandHandler<T>): AppBuilder;
26
+ }
27
+ //# sourceMappingURL=appBuilder.impl.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"appBuilder.impl.d.ts","sourceRoot":"","sources":["../../../src/internal/appBuilder.impl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EA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