askui 0.1.6 → 0.2.2

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 (223) hide show
  1. package/README.md +6 -0
  2. package/bin/askui-postinstall +35 -0
  3. package/dist/cjs/core/model/test-case-dto/custom-element.d.ts +2 -2
  4. package/dist/cjs/core/model/test-case-dto/custom-element.js +2 -2
  5. package/dist/cjs/core/model/test-case-dto/custom-element.spec.js +7 -6
  6. package/dist/cjs/core/model/test-case-dto/index.js +1 -3
  7. package/dist/cjs/core/model/test-case-dto/test-step.d.ts +3 -7
  8. package/dist/cjs/core/model/test-case-dto/test-step.js +0 -12
  9. package/dist/cjs/core/ui-control-commands/control-command.d.ts +1 -0
  10. package/dist/cjs/core/ui-control-commands/control-command.js +5 -0
  11. package/dist/cjs/core/ui-control-commands/input-event.d.ts +1 -2
  12. package/dist/cjs/core/ui-control-commands/input-event.js +0 -1
  13. package/dist/cjs/execution/dsl.d.ts +6 -17
  14. package/dist/cjs/execution/dsl.js +4 -21
  15. package/dist/cjs/execution/execution-runtime.d.ts +7 -5
  16. package/dist/cjs/execution/execution-runtime.js +35 -23
  17. package/dist/cjs/execution/index.d.ts +2 -1
  18. package/dist/cjs/execution/index.js +5 -3
  19. package/dist/cjs/execution/{control-your-ui-api.d.ts → inference-client.d.ts} +4 -4
  20. package/dist/cjs/execution/{control-your-ui-api.js → inference-client.js} +9 -9
  21. package/dist/cjs/execution/ui-control-client-error.d.ts +2 -0
  22. package/dist/cjs/execution/ui-control-client-error.js +6 -0
  23. package/dist/cjs/execution/ui-control-client.d.ts +79 -0
  24. package/dist/cjs/execution/ui-control-client.js +185 -0
  25. package/dist/cjs/execution/{client-connection-state.d.ts → ui-controller-client-connection-state.d.ts} +1 -1
  26. package/dist/cjs/execution/ui-controller-client-connection-state.js +10 -0
  27. package/dist/cjs/execution/ui-controller-client-interface.d.ts +27 -0
  28. package/dist/cjs/execution/{client-interface.js → ui-controller-client-interface.js} +0 -0
  29. package/dist/cjs/execution/{control-your-ui-client.d.ts → ui-controller-client.d.ts} +6 -6
  30. package/dist/cjs/execution/{control-your-ui-client.js → ui-controller-client.js} +28 -28
  31. package/dist/cjs/lib/copy-example-project.js +2 -1
  32. package/dist/cjs/lib/download-binaries.js +10 -9
  33. package/dist/cjs/lib/index.d.ts +1 -1
  34. package/dist/cjs/lib/index.js +3 -3
  35. package/dist/cjs/lib/libfuse-error.d.ts +2 -0
  36. package/dist/cjs/lib/libfuse-error.js +6 -0
  37. package/dist/cjs/lib/logger.js +1 -1
  38. package/dist/cjs/lib/timeout-error.d.ts +0 -2
  39. package/dist/cjs/lib/timeout-error.js +0 -5
  40. package/dist/cjs/lib/ui-controller-args.d.ts +47 -0
  41. package/dist/cjs/lib/{control-ui-server-args.js → ui-controller-args.js} +0 -0
  42. package/dist/cjs/lib/{control-ui-server-args.spec.d.ts → ui-controller-args.spec.d.ts} +0 -0
  43. package/dist/cjs/lib/{control-ui-server-args.spec.js → ui-controller-args.spec.js} +7 -7
  44. package/dist/cjs/lib/ui-controller-darwin.d.ts +6 -0
  45. package/dist/cjs/lib/{control-ui-server-darwin.js → ui-controller-darwin.js} +8 -8
  46. package/dist/cjs/lib/ui-controller-facade.d.ts +17 -0
  47. package/dist/cjs/lib/{control-ui-server-facade.js → ui-controller-facade.js} +22 -16
  48. package/dist/cjs/lib/ui-controller-linux.d.ts +5 -0
  49. package/dist/cjs/lib/ui-controller-linux.js +52 -0
  50. package/dist/cjs/lib/ui-controller-win32.d.ts +3 -0
  51. package/dist/cjs/lib/ui-controller-win32.js +7 -0
  52. package/dist/cjs/lib/ui-controller.d.ts +8 -0
  53. package/dist/cjs/lib/{askui-control-server.js → ui-controller.js} +9 -9
  54. package/dist/cjs/lib/unkown-error.d.ts +0 -2
  55. package/dist/cjs/lib/unkown-error.js +0 -5
  56. package/dist/cjs/lib/wayland-error.d.ts +2 -0
  57. package/dist/cjs/lib/wayland-error.js +6 -0
  58. package/dist/cjs/main.d.ts +3 -2
  59. package/dist/cjs/main.js +6 -3
  60. package/dist/cjs/shared/index.d.ts +1 -0
  61. package/dist/cjs/shared/index.js +5 -0
  62. package/dist/cjs/utils/analytics/analytics-interface.d.ts +3 -0
  63. package/dist/cjs/utils/analytics/analytics-interface.js +2 -0
  64. package/dist/cjs/utils/analytics/analytics.d.ts +5 -0
  65. package/dist/cjs/utils/analytics/analytics.js +38 -0
  66. package/dist/cjs/utils/analytics/index.d.ts +1 -0
  67. package/dist/cjs/utils/analytics/index.js +5 -0
  68. package/dist/cjs/utils/analytics/installation-timestamp-create-error.d.ts +4 -0
  69. package/dist/cjs/utils/analytics/installation-timestamp-create-error.js +9 -0
  70. package/dist/cjs/utils/analytics/installation-timestamp-get-error.d.ts +4 -0
  71. package/dist/cjs/utils/analytics/installation-timestamp-get-error.js +9 -0
  72. package/dist/cjs/utils/analytics/installation-timestamp.d.ts +7 -0
  73. package/dist/cjs/utils/analytics/installation-timestamp.js +68 -0
  74. package/dist/cjs/utils/analytics/user-identifier-interface.d.ts +3 -0
  75. package/dist/cjs/utils/analytics/user-identifier-interface.js +2 -0
  76. package/dist/cjs/utils/analytics/user-identifier.d.ts +4 -0
  77. package/dist/cjs/utils/analytics/user-identifier.js +22 -0
  78. package/dist/cjs/utils/base_64_image/base-64-image-error.d.ts +2 -0
  79. package/dist/cjs/utils/base_64_image/base-64-image-error.js +6 -0
  80. package/dist/cjs/utils/base_64_image/base-64-image-string-error.d.ts +4 -0
  81. package/dist/cjs/utils/base_64_image/base-64-image-string-error.js +11 -0
  82. package/dist/cjs/utils/base_64_image/base-64-image.d.ts +18 -0
  83. package/dist/cjs/utils/base_64_image/base-64-image.js +86 -0
  84. package/dist/cjs/utils/http/custom-errors/http-client-error.d.ts +0 -2
  85. package/dist/cjs/utils/http/custom-errors/http-client-error.js +0 -5
  86. package/dist/cjs/utils/http/http-client-got.d.ts +6 -5
  87. package/dist/cjs/utils/http/http-client-got.js +11 -11
  88. package/dist/cjs/utils/image-resize-errors/image-resizing-base-error.d.ts +0 -2
  89. package/dist/cjs/utils/image-resize-errors/image-resizing-base-error.js +0 -5
  90. package/dist/cjs/utils/image-resize-errors/index.d.ts +0 -1
  91. package/dist/cjs/utils/image-resize-errors/index.js +1 -3
  92. package/dist/cjs/utils/path.d.ts +1 -0
  93. package/dist/cjs/utils/path.js +11 -0
  94. package/dist/cjs/utils/transformations.d.ts +0 -2
  95. package/dist/cjs/utils/transformations.js +11 -44
  96. package/dist/esm/core/model/test-case-dto/custom-element.d.ts +2 -2
  97. package/dist/esm/core/model/test-case-dto/custom-element.js +2 -2
  98. package/dist/esm/core/model/test-case-dto/custom-element.spec.js +7 -6
  99. package/dist/esm/core/model/test-case-dto/index.js +0 -1
  100. package/dist/esm/core/model/test-case-dto/test-step.d.ts +3 -7
  101. package/dist/esm/core/model/test-case-dto/test-step.js +1 -10
  102. package/dist/esm/core/ui-control-commands/control-command.d.ts +1 -0
  103. package/dist/esm/core/ui-control-commands/control-command.js +5 -0
  104. package/dist/esm/core/ui-control-commands/input-event.d.ts +1 -2
  105. package/dist/esm/core/ui-control-commands/input-event.js +0 -1
  106. package/dist/esm/execution/dsl.d.ts +6 -17
  107. package/dist/esm/execution/dsl.js +3 -21
  108. package/dist/esm/execution/execution-runtime.d.ts +7 -5
  109. package/dist/esm/execution/execution-runtime.js +35 -23
  110. package/dist/esm/execution/index.d.ts +2 -1
  111. package/dist/esm/execution/index.js +2 -1
  112. package/dist/esm/execution/{control-your-ui-api.d.ts → inference-client.d.ts} +4 -4
  113. package/dist/esm/execution/{control-your-ui-api.js → inference-client.js} +7 -7
  114. package/dist/esm/execution/ui-control-client-error.d.ts +2 -0
  115. package/dist/esm/execution/ui-control-client-error.js +2 -0
  116. package/dist/esm/execution/ui-control-client.d.ts +79 -0
  117. package/dist/esm/execution/ui-control-client.js +181 -0
  118. package/dist/esm/execution/{client-connection-state.d.ts → ui-controller-client-connection-state.d.ts} +1 -1
  119. package/dist/esm/execution/ui-controller-client-connection-state.js +7 -0
  120. package/dist/esm/execution/ui-controller-client-interface.d.ts +27 -0
  121. package/dist/esm/execution/{client-interface.js → ui-controller-client-interface.js} +0 -0
  122. package/dist/esm/execution/{control-your-ui-client.d.ts → ui-controller-client.d.ts} +6 -6
  123. package/dist/esm/execution/{control-your-ui-client.js → ui-controller-client.js} +26 -26
  124. package/dist/esm/lib/copy-example-project.js +2 -1
  125. package/dist/esm/lib/download-binaries.js +10 -9
  126. package/dist/esm/lib/index.d.ts +1 -1
  127. package/dist/esm/lib/index.js +1 -1
  128. package/dist/esm/lib/libfuse-error.d.ts +2 -0
  129. package/dist/esm/lib/libfuse-error.js +2 -0
  130. package/dist/esm/lib/logger.js +1 -1
  131. package/dist/esm/lib/timeout-error.d.ts +0 -2
  132. package/dist/esm/lib/timeout-error.js +0 -5
  133. package/dist/esm/lib/ui-controller-args.d.ts +47 -0
  134. package/dist/esm/lib/{control-ui-server-args.js → ui-controller-args.js} +0 -0
  135. package/dist/esm/lib/{control-ui-server-args.spec.d.ts → ui-controller-args.spec.d.ts} +0 -0
  136. package/dist/esm/lib/{control-ui-server-args.spec.js → ui-controller-args.spec.js} +1 -1
  137. package/dist/esm/lib/ui-controller-darwin.d.ts +6 -0
  138. package/dist/esm/lib/{control-ui-server-darwin.js → ui-controller-darwin.js} +6 -6
  139. package/dist/esm/lib/ui-controller-facade.d.ts +17 -0
  140. package/dist/esm/lib/{control-ui-server-facade.js → ui-controller-facade.js} +17 -11
  141. package/dist/esm/lib/ui-controller-linux.d.ts +5 -0
  142. package/dist/esm/lib/ui-controller-linux.js +48 -0
  143. package/dist/esm/lib/ui-controller-win32.d.ts +3 -0
  144. package/dist/esm/lib/ui-controller-win32.js +3 -0
  145. package/dist/esm/lib/ui-controller.d.ts +8 -0
  146. package/dist/esm/lib/{askui-control-server.js → ui-controller.js} +7 -7
  147. package/dist/esm/lib/unkown-error.d.ts +0 -2
  148. package/dist/esm/lib/unkown-error.js +0 -5
  149. package/dist/esm/lib/wayland-error.d.ts +2 -0
  150. package/dist/esm/lib/wayland-error.js +2 -0
  151. package/dist/esm/main.d.ts +3 -2
  152. package/dist/esm/main.js +3 -2
  153. package/dist/esm/shared/index.d.ts +1 -0
  154. package/dist/esm/shared/index.js +1 -0
  155. package/dist/esm/utils/analytics/analytics-interface.d.ts +3 -0
  156. package/dist/esm/utils/analytics/analytics-interface.js +1 -0
  157. package/dist/esm/utils/analytics/analytics.d.ts +5 -0
  158. package/dist/esm/utils/analytics/analytics.js +31 -0
  159. package/dist/esm/utils/analytics/index.d.ts +1 -0
  160. package/dist/esm/utils/analytics/index.js +1 -0
  161. package/dist/esm/utils/analytics/installation-timestamp-create-error.d.ts +4 -0
  162. package/dist/esm/utils/analytics/installation-timestamp-create-error.js +5 -0
  163. package/dist/esm/utils/analytics/installation-timestamp-get-error.d.ts +4 -0
  164. package/dist/esm/utils/analytics/installation-timestamp-get-error.js +5 -0
  165. package/dist/esm/utils/analytics/installation-timestamp.d.ts +7 -0
  166. package/dist/esm/utils/analytics/installation-timestamp.js +61 -0
  167. package/dist/esm/utils/analytics/user-identifier-interface.d.ts +3 -0
  168. package/dist/esm/utils/analytics/user-identifier-interface.js +1 -0
  169. package/dist/esm/utils/analytics/user-identifier.d.ts +4 -0
  170. package/dist/esm/utils/analytics/user-identifier.js +18 -0
  171. package/dist/esm/utils/base_64_image/base-64-image-error.d.ts +2 -0
  172. package/dist/esm/utils/base_64_image/base-64-image-error.js +2 -0
  173. package/dist/esm/utils/base_64_image/base-64-image-string-error.d.ts +4 -0
  174. package/dist/esm/utils/base_64_image/base-64-image-string-error.js +7 -0
  175. package/dist/esm/utils/base_64_image/base-64-image.d.ts +18 -0
  176. package/dist/esm/utils/base_64_image/base-64-image.js +79 -0
  177. package/dist/esm/utils/http/custom-errors/http-client-error.d.ts +0 -2
  178. package/dist/esm/utils/http/custom-errors/http-client-error.js +0 -5
  179. package/dist/esm/utils/http/http-client-got.d.ts +6 -5
  180. package/dist/esm/utils/http/http-client-got.js +11 -11
  181. package/dist/esm/utils/image-resize-errors/image-resizing-base-error.d.ts +0 -2
  182. package/dist/esm/utils/image-resize-errors/image-resizing-base-error.js +0 -5
  183. package/dist/esm/utils/image-resize-errors/index.d.ts +0 -1
  184. package/dist/esm/utils/image-resize-errors/index.js +0 -1
  185. package/dist/esm/utils/path.d.ts +1 -0
  186. package/dist/esm/utils/path.js +4 -0
  187. package/dist/esm/utils/transformations.d.ts +0 -2
  188. package/dist/esm/utils/transformations.js +11 -39
  189. package/dist/example_projects_templates/typescript_jest/test/helper/jest.setup.ts +7 -7
  190. package/dist/example_projects_templates/typescript_jest/test/jest.config.ts +3 -0
  191. package/package.json +15 -8
  192. package/dist/cjs/execution/client-connection-state.js +0 -10
  193. package/dist/cjs/execution/client-error.d.ts +0 -2
  194. package/dist/cjs/execution/client-error.js +0 -6
  195. package/dist/cjs/execution/client-interface.d.ts +0 -13
  196. package/dist/cjs/execution/client.d.ts +0 -25
  197. package/dist/cjs/execution/client.js +0 -116
  198. package/dist/cjs/lib/askui-control-server.d.ts +0 -8
  199. package/dist/cjs/lib/control-ui-server-args.d.ts +0 -21
  200. package/dist/cjs/lib/control-ui-server-darwin.d.ts +0 -6
  201. package/dist/cjs/lib/control-ui-server-facade.d.ts +0 -16
  202. package/dist/cjs/lib/control-ui-server-linux.d.ts +0 -4
  203. package/dist/cjs/lib/control-ui-server-linux.js +0 -13
  204. package/dist/cjs/lib/control-ui-server-win32.d.ts +0 -3
  205. package/dist/cjs/lib/control-ui-server-win32.js +0 -7
  206. package/dist/cjs/utils/image-resize-errors/invalid-base64-image-error.d.ts +0 -3
  207. package/dist/cjs/utils/image-resize-errors/invalid-base64-image-error.js +0 -7
  208. package/dist/esm/execution/client-connection-state.js +0 -7
  209. package/dist/esm/execution/client-error.d.ts +0 -2
  210. package/dist/esm/execution/client-error.js +0 -2
  211. package/dist/esm/execution/client-interface.d.ts +0 -13
  212. package/dist/esm/execution/client.d.ts +0 -25
  213. package/dist/esm/execution/client.js +0 -112
  214. package/dist/esm/lib/askui-control-server.d.ts +0 -8
  215. package/dist/esm/lib/control-ui-server-args.d.ts +0 -21
  216. package/dist/esm/lib/control-ui-server-darwin.d.ts +0 -6
  217. package/dist/esm/lib/control-ui-server-facade.d.ts +0 -16
  218. package/dist/esm/lib/control-ui-server-linux.d.ts +0 -4
  219. package/dist/esm/lib/control-ui-server-linux.js +0 -9
  220. package/dist/esm/lib/control-ui-server-win32.d.ts +0 -3
  221. package/dist/esm/lib/control-ui-server-win32.js +0 -3
  222. package/dist/esm/utils/image-resize-errors/invalid-base64-image-error.d.ts +0 -3
  223. package/dist/esm/utils/image-resize-errors/invalid-base64-image-error.js +0 -3
@@ -1,23 +1,23 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const control_ui_server_args_1 = require("./control-ui-server-args");
3
+ const ui_controller_args_1 = require("./ui-controller-args");
4
4
  describe('createCliFlagsFromArgs()', () => {
5
5
  test('test createCliFlagsFromArgs should return -d 0 as default output', () => {
6
6
  const expected = ['-d 0', '-p 6769', '--host 127.0.0.1', '-m ', '--log-level debug'];
7
- const argsWithDefaults = (0, control_ui_server_args_1.createArgsWithDefaults)();
8
- const actual = (0, control_ui_server_args_1.createCliFlagsFromArgs)(argsWithDefaults);
7
+ const argsWithDefaults = (0, ui_controller_args_1.createArgsWithDefaults)();
8
+ const actual = (0, ui_controller_args_1.createCliFlagsFromArgs)(argsWithDefaults);
9
9
  expect(actual).toStrictEqual(expected);
10
10
  });
11
11
  test('test createCliFlagsFromArgs output should include -d 0 when no display was selected', () => {
12
12
  const expected = ['-d 0', '-p 6777', '--host 0.0.0.0', '-m ', '--log-level debug'];
13
- const argsWithDefaults = (0, control_ui_server_args_1.createArgsWithDefaults)({ port: 6777, host: '0.0.0.0' });
14
- const actual = (0, control_ui_server_args_1.createCliFlagsFromArgs)(argsWithDefaults);
13
+ const argsWithDefaults = (0, ui_controller_args_1.createArgsWithDefaults)({ port: 6777, host: '0.0.0.0' });
14
+ const actual = (0, ui_controller_args_1.createCliFlagsFromArgs)(argsWithDefaults);
15
15
  expect(actual).toStrictEqual(expected);
16
16
  });
17
17
  test('test createCliFlagsFromArgs output should include the display that was selected ', () => {
18
18
  const expected = ['-d 99', '-p 6777', '--host 0.0.0.0', '-m ', '--log-level debug'];
19
- const argsWithDefaults = (0, control_ui_server_args_1.createArgsWithDefaults)({ port: 6777, host: '0.0.0.0', display: 99 });
20
- const actual = (0, control_ui_server_args_1.createCliFlagsFromArgs)(argsWithDefaults);
19
+ const argsWithDefaults = (0, ui_controller_args_1.createArgsWithDefaults)({ port: 6777, host: '0.0.0.0', display: 99 });
20
+ const actual = (0, ui_controller_args_1.createCliFlagsFromArgs)(argsWithDefaults);
21
21
  expect(actual).toStrictEqual(expected);
22
22
  });
23
23
  });
@@ -0,0 +1,6 @@
1
+ import { UiControllerFacade } from './ui-controller-facade';
2
+ export declare class UiControllerDarwin extends UiControllerFacade {
3
+ protected makeBinaryExecutable(): void;
4
+ protected getStartingCommand(): string;
5
+ private makeDiskImageExecutable;
6
+ }
@@ -3,18 +3,18 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.ControlUiServerDarwin = void 0;
6
+ exports.UiControllerDarwin = void 0;
7
7
  const child_process_1 = require("child_process");
8
8
  const fs_extra_1 = __importDefault(require("fs-extra"));
9
9
  const path_1 = __importDefault(require("path"));
10
- const control_ui_server_facade_1 = require("./control-ui-server-facade");
10
+ const ui_controller_facade_1 = require("./ui-controller-facade");
11
11
  const logger_1 = require("./logger");
12
- class ControlUiServerDarwin extends control_ui_server_facade_1.ControlUiServerFacade {
12
+ class UiControllerDarwin extends ui_controller_facade_1.UiControllerFacade {
13
13
  makeBinaryExecutable() {
14
14
  this.makeDiskImageExecutable();
15
15
  }
16
16
  getStartingCommand() {
17
- return `${path_1.default.dirname(this.binaryPath)}/controlui-server.app/Contents/MacOS/controlui-server`;
17
+ return `"${path_1.default.dirname(this.binaryPath)}/controlui-server.app/Contents/MacOS/controlui-server"`;
18
18
  }
19
19
  makeDiskImageExecutable() {
20
20
  const mountPoint = '/Volumes/controlui-server.dmg';
@@ -24,15 +24,15 @@ class ControlUiServerDarwin extends control_ui_server_facade_1.ControlUiServerFa
24
24
  '-quiet',
25
25
  '-noautofsck',
26
26
  '-noautoopen',
27
- `-mountpoint ${mountPoint}`,
28
- this.binaryPath,
27
+ `-mountpoint "${mountPoint}"`,
28
+ `"${this.binaryPath}"`,
29
29
  ].join(' '));
30
30
  const appBaseName = 'controlui-server.app';
31
31
  const appSrcPath = `${mountPoint}/${appBaseName}`;
32
32
  const appDestPath = `${path_1.default.dirname(this.binaryPath)}/${appBaseName}`;
33
33
  fs_extra_1.default.removeSync(appDestPath);
34
34
  fs_extra_1.default.copySync(appSrcPath, appDestPath);
35
- (0, child_process_1.exec)(`hdiutil detach ${mountPoint}`, (_exception, stdout) => logger_1.logger.debug(stdout));
35
+ (0, child_process_1.exec)(`hdiutil detach "${mountPoint}"`, (_exception, stdout) => logger_1.logger.debug(stdout));
36
36
  }
37
37
  }
38
- exports.ControlUiServerDarwin = ControlUiServerDarwin;
38
+ exports.UiControllerDarwin = UiControllerDarwin;
@@ -0,0 +1,17 @@
1
+ import { UiControllerArgs, UiControllerArgsWithDefaults } from './ui-controller-args';
2
+ export declare abstract class UiControllerFacade {
3
+ protected binaryPath: string;
4
+ protected serverLogFile: string;
5
+ protected readonly DefaultmaxWaitingForStartingInMs: number;
6
+ start(args?: UiControllerArgs, maxWaitingForStartingInSeconds?: number): Promise<void>;
7
+ stop(args?: UiControllerArgs, forceStop?: boolean): Promise<void>;
8
+ protected serverLogFilePath(args?: UiControllerArgsWithDefaults): UiControllerArgsWithDefaults;
9
+ protected killPort(port: number, forceStop?: boolean): Promise<void>;
10
+ protected getStartingCommand(): string;
11
+ protected makeBinaryExecutable(): void;
12
+ protected runPreStartChecks(): Promise<void>;
13
+ protected waitUntilStarted(args: UiControllerArgsWithDefaults, maxWaitingForStartingInSeconds?: number): Promise<void>;
14
+ private isBinaryValid;
15
+ private getBinary;
16
+ private startWithDefaults;
17
+ }
@@ -12,42 +12,43 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
12
12
  return (mod && mod.__esModule) ? mod : { "default": mod };
13
13
  };
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.ControlUiServerFacade = void 0;
15
+ exports.UiControllerFacade = void 0;
16
16
  const child_process_1 = require("child_process");
17
17
  const fs_extra_1 = __importDefault(require("fs-extra"));
18
18
  const wait_port_1 = __importDefault(require("wait-port"));
19
19
  const fkill_1 = __importDefault(require("fkill"));
20
20
  const os_1 = __importDefault(require("os"));
21
21
  const path_1 = __importDefault(require("path"));
22
- const control_ui_server_args_1 = require("./control-ui-server-args");
22
+ const ui_controller_args_1 = require("./ui-controller-args");
23
23
  const download_binaries_1 = require("./download-binaries");
24
24
  const logger_1 = require("./logger");
25
25
  const timeout_error_1 = require("./timeout-error");
26
26
  const unkown_error_1 = require("./unkown-error");
27
- class ControlUiServerFacade {
27
+ class UiControllerFacade {
28
28
  constructor() {
29
29
  this.binaryPath = (0, download_binaries_1.getBinaryPath)('latest');
30
30
  this.DefaultmaxWaitingForStartingInMs = 30 * 1000;
31
31
  }
32
32
  start(args, maxWaitingForStartingInSeconds) {
33
33
  return __awaiter(this, void 0, void 0, function* () {
34
- const argsWithDefaults = (0, control_ui_server_args_1.createArgsWithDefaults)(args);
34
+ yield this.runPreStartChecks();
35
+ const argsWithDefaults = (0, ui_controller_args_1.createArgsWithDefaults)(args);
35
36
  const argsWithLogPath = this.serverLogFilePath(argsWithDefaults);
36
37
  this.binaryPath = (0, download_binaries_1.getBinaryPath)(argsWithLogPath.binaryVersion);
37
38
  yield this.getBinary(argsWithLogPath.binaryVersion, argsWithLogPath.overWriteBinary);
38
39
  this.makeBinaryExecutable();
39
- logger_1.logger.debug(`AskuiServer log path "${this.serverLogFile}"`);
40
+ logger_1.logger.debug(`UI Controller log path "${this.serverLogFile}"`);
40
41
  yield this.startWithDefaults(argsWithLogPath, maxWaitingForStartingInSeconds);
41
42
  });
42
43
  }
43
44
  stop(args, forceStop) {
44
45
  return __awaiter(this, void 0, void 0, function* () {
45
46
  try {
46
- const argsWithDefaults = (0, control_ui_server_args_1.createArgsWithDefaults)(args);
47
+ const argsWithDefaults = (0, ui_controller_args_1.createArgsWithDefaults)(args);
47
48
  yield this.killPort(argsWithDefaults.port, forceStop);
48
49
  }
49
50
  catch (err) {
50
- throw new Error(`An unknown error occured while closing of the askui server. Log file: "${this.serverLogFile}". ErrorReason: ${err}`);
51
+ throw new Error(`An unknown error occured while closing of the UI Controller. Log file: "${this.serverLogFile}". ErrorReason: ${err}`);
51
52
  }
52
53
  });
53
54
  }
@@ -57,7 +58,7 @@ class ControlUiServerFacade {
57
58
  return args;
58
59
  }
59
60
  const tmpDir = fs_extra_1.default.mkdtempSync(path_1.default.join(os_1.default.tmpdir(), 'askui'));
60
- this.serverLogFile = path_1.default.join(tmpDir, 'askui-server.log');
61
+ this.serverLogFile = path_1.default.join(tmpDir, 'askui-ui-controller.log');
61
62
  const argPath = { logFilePath: this.serverLogFile };
62
63
  return Object.assign(argPath, args);
63
64
  }
@@ -69,13 +70,17 @@ class ControlUiServerFacade {
69
70
  });
70
71
  }
71
72
  getStartingCommand() {
72
- return this.binaryPath;
73
+ return `"${this.binaryPath}"`;
73
74
  }
74
75
  // eslint-disable-next-line class-methods-use-this
75
76
  makeBinaryExecutable() {
76
77
  /* Executable out of the box */
77
78
  }
78
79
  // eslint-disable-next-line class-methods-use-this
80
+ runPreStartChecks() {
81
+ return Promise.resolve();
82
+ }
83
+ // eslint-disable-next-line class-methods-use-this
79
84
  waitUntilStarted(args, maxWaitingForStartingInSeconds) {
80
85
  return new Promise((resolve, reject) => {
81
86
  try {
@@ -95,7 +100,7 @@ class ControlUiServerFacade {
95
100
  });
96
101
  }
97
102
  catch (err) {
98
- reject(new unkown_error_1.UnkownError(`An unknown error occured while waiting for the askui server: ${err}`));
103
+ reject(new unkown_error_1.UnkownError(`An unknown error occured while waiting for the UI Controller: ${err}`));
99
104
  }
100
105
  });
101
106
  }
@@ -107,25 +112,26 @@ class ControlUiServerFacade {
107
112
  getBinary(binaryVersion, overWriteBinary = false) {
108
113
  return __awaiter(this, void 0, void 0, function* () {
109
114
  if (!fs_extra_1.default.existsSync(this.binaryPath) || overWriteBinary || !this.isBinaryValid()) {
110
- logger_1.logger.debug(`Currently, no binary of the Control UI Server is available at "${this.binaryPath}"`);
115
+ logger_1.logger.debug(`Currently, no binary of the UI Controller is available at "${this.binaryPath}"`);
111
116
  yield (0, download_binaries_1.downloadServerBinaries)(binaryVersion);
112
117
  }
113
118
  else {
114
- logger_1.logger.debug(`Binary of Control UI Server is already present at "${this.binaryPath}".`);
119
+ logger_1.logger.debug(`Binary of UI Controller is already present at "${this.binaryPath}".`);
115
120
  }
116
121
  });
117
122
  }
118
123
  startWithDefaults(args, maxWaitingForStartingInSeconds) {
119
124
  return __awaiter(this, void 0, void 0, function* () {
120
125
  try {
121
- logger_1.logger.debug('Starting the Control UI Server...');
122
- (0, child_process_1.spawn)(this.getStartingCommand(), (0, control_ui_server_args_1.createCliFlagsFromArgs)(args), { shell: true });
126
+ logger_1.logger.debug('Starting the UI Controller...');
127
+ (0, child_process_1.spawn)(this.getStartingCommand(), (0, ui_controller_args_1.createCliFlagsFromArgs)(args), { shell: true });
123
128
  yield this.waitUntilStarted(args, maxWaitingForStartingInSeconds);
124
129
  }
125
130
  catch (err) {
126
- throw new Error(`The Control UI Server could not be started. Log file : ${this.serverLogFile}. ErrorReason: ${err}`);
131
+ throw new Error(`The UI Controller could not be started. Log file : ${this.serverLogFile}. ErrorReason: ${err}
132
+ Check this website for more information: https://docs.askui.com/docs/general/Troubleshooting/askui-ui-controller-starting-problems`);
127
133
  }
128
134
  });
129
135
  }
130
136
  }
131
- exports.ControlUiServerFacade = ControlUiServerFacade;
137
+ exports.UiControllerFacade = UiControllerFacade;
@@ -0,0 +1,5 @@
1
+ import { UiControllerFacade } from './ui-controller-facade';
2
+ export declare class UiControllerLinux extends UiControllerFacade {
3
+ protected makeBinaryExecutable(): void;
4
+ protected runPreStartChecks(): Promise<void>;
5
+ }
@@ -0,0 +1,52 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.UiControllerLinux = void 0;
13
+ const child_process_1 = require("child_process");
14
+ const util_1 = require("util");
15
+ const ui_controller_facade_1 = require("./ui-controller-facade");
16
+ const logger_1 = require("./logger");
17
+ const wayland_error_1 = require("./wayland-error");
18
+ const libfuse_error_1 = require("./libfuse-error");
19
+ class UiControllerLinux extends ui_controller_facade_1.UiControllerFacade {
20
+ // eslint-disable-next-line class-methods-use-this
21
+ makeBinaryExecutable() {
22
+ (0, child_process_1.exec)(`chmod +x "${this.binaryPath}"`, (_exception, stdout) => logger_1.logger.debug(stdout));
23
+ }
24
+ // eslint-disable-next-line class-methods-use-this
25
+ runPreStartChecks() {
26
+ return __awaiter(this, void 0, void 0, function* () {
27
+ const runCommand = (0, util_1.promisify)(child_process_1.exec);
28
+ const waylandStatus = yield runCommand('echo $WAYLAND_DISPLAY');
29
+ if (waylandStatus.stdout.trim().includes('wayland')) {
30
+ throw new wayland_error_1.WaylandError('Wayland is not supported: https://docs.askui.com/docs/general/Troubleshooting/askui-ui-controller#wayland');
31
+ }
32
+ /* First we want to check if the user is using a debian distribution.
33
+ * and in the following if libfuse2 is installed.
34
+ * With Ubunutu 22.04 libfuse2 is not installed per default.
35
+ * For more information: https://discourse.joplinapp.org/t/appimage-incompatibility-in-ubuntu-22-04/25173
36
+ */
37
+ try {
38
+ yield runCommand('dpkg --version');
39
+ }
40
+ catch (err) {
41
+ return;
42
+ }
43
+ try {
44
+ yield runCommand('dpkg -s libfuse2 | grep Status');
45
+ }
46
+ catch (_a) {
47
+ throw new libfuse_error_1.LibfuseError('Libfuse2 package is missing: https://docs.askui.com/docs/general/Troubleshooting/askui-ui-controller#libfuse2');
48
+ }
49
+ });
50
+ }
51
+ }
52
+ exports.UiControllerLinux = UiControllerLinux;
@@ -0,0 +1,3 @@
1
+ import { UiControllerFacade } from './ui-controller-facade';
2
+ export declare class UiControllerWin32 extends UiControllerFacade {
3
+ }
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.UiControllerWin32 = void 0;
4
+ const ui_controller_facade_1 = require("./ui-controller-facade");
5
+ class UiControllerWin32 extends ui_controller_facade_1.UiControllerFacade {
6
+ }
7
+ exports.UiControllerWin32 = UiControllerWin32;
@@ -0,0 +1,8 @@
1
+ import { UiControllerArgs } from './ui-controller-args';
2
+ export declare class UiController {
3
+ private args?;
4
+ private server;
5
+ constructor(args?: UiControllerArgs | undefined);
6
+ start(timeoutInSeconds?: number): Promise<void>;
7
+ stop(forceStop?: boolean): Promise<void>;
8
+ }
@@ -9,23 +9,23 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  });
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.AskuiControlServer = void 0;
13
- const control_ui_server_darwin_1 = require("./control-ui-server-darwin");
14
- const control_ui_server_linux_1 = require("./control-ui-server-linux");
15
- const control_ui_server_win32_1 = require("./control-ui-server-win32");
12
+ exports.UiController = void 0;
13
+ const ui_controller_darwin_1 = require("./ui-controller-darwin");
14
+ const ui_controller_linux_1 = require("./ui-controller-linux");
15
+ const ui_controller_win32_1 = require("./ui-controller-win32");
16
16
  const download_binaries_1 = require("./download-binaries");
17
- class AskuiControlServer {
17
+ class UiController {
18
18
  constructor(args) {
19
19
  this.args = args;
20
20
  switch ((0, download_binaries_1.platform)()) {
21
21
  case 'darwin':
22
- this.server = new control_ui_server_darwin_1.ControlUiServerDarwin();
22
+ this.server = new ui_controller_darwin_1.UiControllerDarwin();
23
23
  break;
24
24
  case 'linux':
25
- this.server = new control_ui_server_linux_1.ControlUiServerLinux();
25
+ this.server = new ui_controller_linux_1.UiControllerLinux();
26
26
  break;
27
27
  case 'win32':
28
- this.server = new control_ui_server_win32_1.ControlUiServerWin32();
28
+ this.server = new ui_controller_win32_1.UiControllerWin32();
29
29
  break;
30
30
  default:
31
31
  throw new Error(`Platform "${(0, download_binaries_1.platform)()}" not supported.`);
@@ -42,4 +42,4 @@ class AskuiControlServer {
42
42
  });
43
43
  }
44
44
  }
45
- exports.AskuiControlServer = AskuiControlServer;
45
+ exports.UiController = UiController;
@@ -1,4 +1,2 @@
1
1
  export declare class UnkownError extends Error {
2
- contructorName: string;
3
- constructor(message: string);
4
2
  }
@@ -2,10 +2,5 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.UnkownError = void 0;
4
4
  class UnkownError extends Error {
5
- constructor(message) {
6
- super(message);
7
- this.contructorName = this.constructor.name;
8
- this.name = this.contructorName;
9
- }
10
5
  }
11
6
  exports.UnkownError = UnkownError;
@@ -0,0 +1,2 @@
1
+ export declare class WaylandError extends Error {
2
+ }
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.WaylandError = void 0;
4
+ class WaylandError extends Error {
5
+ }
6
+ exports.WaylandError = WaylandError;
@@ -1,2 +1,3 @@
1
- export { AskuiControlServer } from './lib';
2
- export { AskuiClient } from './execution';
1
+ export { UiController } from './lib';
2
+ export { UiControlClient, AnnotationLevel } from './execution';
3
+ export { LogLevels } from './shared';
package/dist/cjs/main.js CHANGED
@@ -1,7 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.AskuiClient = exports.AskuiControlServer = void 0;
3
+ exports.LogLevels = exports.AnnotationLevel = exports.UiControlClient = exports.UiController = void 0;
4
4
  var lib_1 = require("./lib");
5
- Object.defineProperty(exports, "AskuiControlServer", { enumerable: true, get: function () { return lib_1.AskuiControlServer; } });
5
+ Object.defineProperty(exports, "UiController", { enumerable: true, get: function () { return lib_1.UiController; } });
6
6
  var execution_1 = require("./execution");
7
- Object.defineProperty(exports, "AskuiClient", { enumerable: true, get: function () { return execution_1.AskuiClient; } });
7
+ Object.defineProperty(exports, "UiControlClient", { enumerable: true, get: function () { return execution_1.UiControlClient; } });
8
+ Object.defineProperty(exports, "AnnotationLevel", { enumerable: true, get: function () { return execution_1.AnnotationLevel; } });
9
+ var shared_1 = require("./shared");
10
+ Object.defineProperty(exports, "LogLevels", { enumerable: true, get: function () { return shared_1.LogLevels; } });
@@ -0,0 +1 @@
1
+ export { LogLevels } from './log-levels';
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LogLevels = void 0;
4
+ var log_levels_1 = require("./log-levels");
5
+ Object.defineProperty(exports, "LogLevels", { enumerable: true, get: function () { return log_levels_1.LogLevels; } });
@@ -0,0 +1,3 @@
1
+ export interface AnalyticsInterface {
2
+ getAnalyticsHeaders(): Promise<Record<string, string>>;
3
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,5 @@
1
+ import { AnalyticsInterface } from './analytics-interface';
2
+ export declare class Analytics implements AnalyticsInterface {
3
+ private userIdentifier;
4
+ getAnalyticsHeaders(): Promise<Record<string, string>>;
5
+ }
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __importDefault = (this && this.__importDefault) || function (mod) {
12
+ return (mod && mod.__esModule) ? mod : { "default": mod };
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.Analytics = void 0;
16
+ const os_1 = __importDefault(require("os"));
17
+ const user_identifier_1 = require("./user-identifier");
18
+ const installation_timestamp_1 = require("./installation-timestamp");
19
+ class Analytics {
20
+ constructor() {
21
+ this.userIdentifier = new user_identifier_1.UserIdentifier();
22
+ }
23
+ getAnalyticsHeaders() {
24
+ return __awaiter(this, void 0, void 0, function* () {
25
+ const userID = yield this.userIdentifier.userId();
26
+ const headers = {
27
+ 'askui-user-id': userID,
28
+ 'askui-user-agent': `os:${os_1.default.platform()};arch:${os_1.default.arch()}`,
29
+ };
30
+ const askuiInstalledAt = yield installation_timestamp_1.InstallationTimestamp.get();
31
+ if (askuiInstalledAt) {
32
+ headers['askui-installed-at'] = askuiInstalledAt.toISOString();
33
+ }
34
+ return headers;
35
+ });
36
+ }
37
+ }
38
+ exports.Analytics = Analytics;
@@ -0,0 +1 @@
1
+ export { Analytics } from './analytics';
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Analytics = void 0;
4
+ var analytics_1 = require("./analytics");
5
+ Object.defineProperty(exports, "Analytics", { enumerable: true, get: function () { return analytics_1.Analytics; } });
@@ -0,0 +1,4 @@
1
+ /// <reference types="node" />
2
+ export declare class InstallationTimestampCreateError extends Error {
3
+ constructor(err: NodeJS.ErrnoException);
4
+ }
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.InstallationTimestampCreateError = void 0;
4
+ class InstallationTimestampCreateError extends Error {
5
+ constructor(err) {
6
+ super(`Installation timestamp could not be created. \n${err.message}`);
7
+ }
8
+ }
9
+ exports.InstallationTimestampCreateError = InstallationTimestampCreateError;
@@ -0,0 +1,4 @@
1
+ /// <reference types="node" />
2
+ export declare class InstallationTimestampGetError extends Error {
3
+ constructor(err: NodeJS.ErrnoException);
4
+ }
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.InstallationTimestampGetError = void 0;
4
+ class InstallationTimestampGetError extends Error {
5
+ constructor(err) {
6
+ super(`Installation timestamp does not exist. Try reinstalling the lib to create it. \n${err.message}`);
7
+ }
8
+ }
9
+ exports.InstallationTimestampGetError = InstallationTimestampGetError;
@@ -0,0 +1,7 @@
1
+ export declare abstract class InstallationTimestamp {
2
+ private static fileName;
3
+ private static value?;
4
+ static create(): Promise<void>;
5
+ static get(): Promise<Date | null>;
6
+ private static getFromFile;
7
+ }
@@ -0,0 +1,68 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __importDefault = (this && this.__importDefault) || function (mod) {
12
+ return (mod && mod.__esModule) ? mod : { "default": mod };
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.InstallationTimestamp = void 0;
16
+ const fs_1 = __importDefault(require("fs"));
17
+ const path_1 = __importDefault(require("path"));
18
+ const lib_1 = require("../../lib");
19
+ const installation_timestamp_create_error_1 = require("./installation-timestamp-create-error");
20
+ const installation_timestamp_get_error_1 = require("./installation-timestamp-get-error");
21
+ const path_2 = require("../path");
22
+ class InstallationTimestamp {
23
+ static create() {
24
+ return __awaiter(this, void 0, void 0, function* () {
25
+ const timestamp = new Date().toISOString();
26
+ return new Promise((resolve, reject) => {
27
+ fs_1.default.writeFile(InstallationTimestamp.fileName, timestamp, { encoding: 'utf-8' }, (err) => {
28
+ if (err) {
29
+ reject(new installation_timestamp_create_error_1.InstallationTimestampCreateError(err));
30
+ }
31
+ else {
32
+ resolve();
33
+ }
34
+ });
35
+ });
36
+ });
37
+ }
38
+ static get() {
39
+ return __awaiter(this, void 0, void 0, function* () {
40
+ if (InstallationTimestamp.value === undefined) {
41
+ try {
42
+ InstallationTimestamp.value = yield this.getFromFile();
43
+ }
44
+ catch (err) {
45
+ InstallationTimestamp.value = null;
46
+ lib_1.logger.warn(err.message);
47
+ }
48
+ }
49
+ return InstallationTimestamp.value;
50
+ });
51
+ }
52
+ static getFromFile() {
53
+ return __awaiter(this, void 0, void 0, function* () {
54
+ return new Promise((resolve, reject) => {
55
+ fs_1.default.readFile(InstallationTimestamp.fileName, 'utf-8', (err, isoDateStr) => {
56
+ if (err) {
57
+ reject(new installation_timestamp_get_error_1.InstallationTimestampGetError(err));
58
+ }
59
+ else {
60
+ resolve(new Date(isoDateStr));
61
+ }
62
+ });
63
+ });
64
+ });
65
+ }
66
+ }
67
+ exports.InstallationTimestamp = InstallationTimestamp;
68
+ InstallationTimestamp.fileName = path_1.default.join((0, path_2.getPathToNodeModulesRoot)(), 'install-timestamp');
@@ -0,0 +1,3 @@
1
+ export interface UserIdentifierInterface {
2
+ userId(): Promise<string>;
3
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,4 @@
1
+ import { UserIdentifierInterface } from './user-identifier-interface';
2
+ export declare class UserIdentifier implements UserIdentifierInterface {
3
+ userId(): Promise<string>;
4
+ }
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.UserIdentifier = void 0;
13
+ const node_machine_id_1 = require("node-machine-id");
14
+ class UserIdentifier {
15
+ // eslint-disable-next-line class-methods-use-this
16
+ userId() {
17
+ return __awaiter(this, void 0, void 0, function* () {
18
+ return (0, node_machine_id_1.machineId)();
19
+ });
20
+ }
21
+ }
22
+ exports.UserIdentifier = UserIdentifier;
@@ -0,0 +1,2 @@
1
+ export declare class Base64ImageError extends Error {
2
+ }