@supraio/client-sdk 0.0.1-mz-warmup.4 → 0.0.1-mz-standalone-processes.0

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 (73) hide show
  1. package/dist/browser/src/Firebase/collections.d.ts +8 -7
  2. package/dist/browser/src/Firebase/collections.js +15 -7
  3. package/dist/browser/src/Firebase/collections.js.map +1 -1
  4. package/dist/browser/src/Options.d.ts +55 -0
  5. package/dist/browser/src/Platform/daemonHelper.d.ts +2 -5
  6. package/dist/browser/src/Platform/daemonHelper.js +10 -10
  7. package/dist/browser/src/Platform/daemonHelper.js.map +1 -1
  8. package/dist/browser/src/Platform/pathHelper.d.ts +3 -3
  9. package/dist/browser/src/Platform/pathHelper.js +3 -3
  10. package/dist/browser/src/Platform/pathHelper.js.map +1 -1
  11. package/dist/browser/src/Platform/sshHelper.js.map +1 -1
  12. package/dist/browser/src/Process/Options.d.ts +3 -11
  13. package/dist/browser/src/Process/Process.d.ts +3 -1
  14. package/dist/browser/src/Process/ProcessSdk.d.ts +16 -12
  15. package/dist/browser/src/Process/ProcessSdk.js +77 -38
  16. package/dist/browser/src/Process/ProcessSdk.js.map +1 -1
  17. package/dist/browser/src/Sdk.js +29 -20
  18. package/dist/browser/src/Sdk.js.map +1 -1
  19. package/dist/browser/src/Server/ServerSdk.d.ts +2 -2
  20. package/dist/browser/src/Server/ServerSdk.js +6 -4
  21. package/dist/browser/src/Server/ServerSdk.js.map +1 -1
  22. package/dist/browser/src/Session/FSSessionStorage.js +3 -2
  23. package/dist/browser/src/Session/FSSessionStorage.js.map +1 -1
  24. package/dist/browser/src/Session/RemoteSession.d.ts +2 -4
  25. package/dist/browser/src/Session/SessionSdk.d.ts +10 -2
  26. package/dist/browser/src/Session/SessionSdk.js +35 -7
  27. package/dist/browser/src/Session/SessionSdk.js.map +1 -1
  28. package/dist/browser/src/Session/sessionStorageFactory.js.map +1 -1
  29. package/dist/browser/src/polyfill.d.ts +0 -1
  30. package/dist/browser/src/polyfill.js.map +1 -1
  31. package/dist/node/src/Firebase/collections.d.ts +8 -7
  32. package/dist/node/src/Firebase/collections.js +25 -17
  33. package/dist/node/src/Firebase/collections.js.map +1 -1
  34. package/dist/node/src/Hash/generator.js +4 -5
  35. package/dist/node/src/Hash/generator.js.map +1 -1
  36. package/dist/node/src/Options.d.ts +55 -0
  37. package/dist/node/src/Options.js +2 -2
  38. package/dist/node/src/Options.js.map +1 -1
  39. package/dist/node/src/Platform/daemonHelper.d.ts +2 -5
  40. package/dist/node/src/Platform/daemonHelper.js +16 -16
  41. package/dist/node/src/Platform/daemonHelper.js.map +1 -1
  42. package/dist/node/src/Platform/pathHelper.d.ts +3 -3
  43. package/dist/node/src/Platform/pathHelper.js +15 -16
  44. package/dist/node/src/Platform/pathHelper.js.map +1 -1
  45. package/dist/node/src/Platform/sshHelper.js +4 -5
  46. package/dist/node/src/Platform/sshHelper.js.map +1 -1
  47. package/dist/node/src/Process/Options.d.ts +3 -11
  48. package/dist/node/src/Process/Process.d.ts +3 -1
  49. package/dist/node/src/Process/ProcessSdk.d.ts +16 -12
  50. package/dist/node/src/Process/ProcessSdk.js +83 -44
  51. package/dist/node/src/Process/ProcessSdk.js.map +1 -1
  52. package/dist/node/src/Sdk.js +36 -26
  53. package/dist/node/src/Sdk.js.map +1 -1
  54. package/dist/node/src/Server/Server.js +1 -1
  55. package/dist/node/src/Server/Server.js.map +1 -1
  56. package/dist/node/src/Server/ServerSdk.d.ts +2 -2
  57. package/dist/node/src/Server/ServerSdk.js +8 -6
  58. package/dist/node/src/Server/ServerSdk.js.map +1 -1
  59. package/dist/node/src/Session/FSSessionStorage.js +3 -2
  60. package/dist/node/src/Session/FSSessionStorage.js.map +1 -1
  61. package/dist/node/src/Session/RemoteSession.d.ts +2 -4
  62. package/dist/node/src/Session/SessionSdk.d.ts +10 -2
  63. package/dist/node/src/Session/SessionSdk.js +44 -16
  64. package/dist/node/src/Session/SessionSdk.js.map +1 -1
  65. package/dist/node/src/Session/sessionStorageFactory.js +1 -2
  66. package/dist/node/src/Session/sessionStorageFactory.js.map +1 -1
  67. package/dist/node/src/Timer/wait.js +1 -2
  68. package/dist/node/src/Timer/wait.js.map +1 -1
  69. package/dist/node/src/index.js +5 -1
  70. package/dist/node/src/index.js.map +1 -1
  71. package/dist/node/src/polyfill.d.ts +0 -1
  72. package/dist/node/src/polyfill.js.map +1 -1
  73. package/package.json +4 -4
@@ -1,4 +1,5 @@
1
- import firebase from 'firebase';
1
+ import { FirebaseApp } from '@firebase/app';
2
+ import { DocumentReference, CollectionReference } from '@firebase/firestore';
2
3
  import { ServerApp } from '../Process/App/App';
3
4
  import { Server } from '../Server/Server';
4
5
  import { ServerVolume } from '../Process/Volume/Volume';
@@ -15,9 +16,9 @@ export declare enum UserServerCollection {
15
16
  APP = "apps",
16
17
  VOLUME = "volumes"
17
18
  }
18
- export declare function getUserDocument(firebaseApp: firebase.app.App): Promise<firebase.firestore.DocumentReference<User>>;
19
- export declare function getServerDocument(firebaseApp: firebase.app.App, serverUid: string): Promise<firebase.firestore.DocumentReference<Server>>;
20
- export declare function getServerCollection(firebaseApp: firebase.app.App): Promise<firebase.firestore.CollectionReference<Server>>;
21
- export declare function getSessionCollection(firebaseApp: firebase.app.App): Promise<firebase.firestore.CollectionReference<RemoteSession>>;
22
- export declare function getServerAppCollection(firebaseApp: firebase.app.App, serverUid: string): Promise<firebase.firestore.CollectionReference<ServerApp>>;
23
- export declare function getServerVolumeCollection(firebaseApp: firebase.app.App, serverUid: string): Promise<firebase.firestore.CollectionReference<ServerVolume>>;
19
+ export declare function getUserDocument(firebaseApp: FirebaseApp): Promise<DocumentReference<User>>;
20
+ export declare function getServerDocument(firebaseApp: FirebaseApp, serverUid: string): Promise<DocumentReference<Server>>;
21
+ export declare function getServerCollection(firebaseApp: FirebaseApp): Promise<CollectionReference<Server>>;
22
+ export declare function getSessionCollection(firebaseApp: FirebaseApp): Promise<CollectionReference<RemoteSession>>;
23
+ export declare function getServerAppCollection(firebaseApp: FirebaseApp, serverUid: string): Promise<CollectionReference<ServerApp>>;
24
+ export declare function getServerVolumeCollection(firebaseApp: FirebaseApp, serverUid: string): Promise<CollectionReference<ServerVolume>>;
@@ -1,3 +1,5 @@
1
+ import { getAuth } from '@firebase/auth';
2
+ import { getFirestore, collection, where, query, getDocs, } from '@firebase/firestore';
1
3
  export var MainCollection;
2
4
  (function (MainCollection) {
3
5
  MainCollection["USER"] = "user";
@@ -13,11 +15,13 @@ export var UserServerCollection;
13
15
  UserServerCollection["VOLUME"] = "volumes";
14
16
  })(UserServerCollection || (UserServerCollection = {}));
15
17
  export async function getUserDocument(firebaseApp) {
16
- const user = firebaseApp.auth().currentUser;
18
+ const firebaseAuth = getAuth(firebaseApp);
19
+ const user = firebaseAuth.currentUser;
17
20
  if (!user) {
18
21
  throw new Error(`User is not authenticated`);
19
22
  }
20
- const usersSnapshot = await firebaseApp.firestore().collection(MainCollection.USER).where('uid', '==', user.uid).get();
23
+ const firestore = getFirestore(firebaseApp);
24
+ const usersSnapshot = await getDocs(query(collection(firestore, MainCollection.USER), where('uid', '==', user.uid)));
21
25
  if (usersSnapshot.empty) {
22
26
  throw new Error(`User was not found: ${user.uid}`);
23
27
  }
@@ -26,7 +30,7 @@ export async function getUserDocument(firebaseApp) {
26
30
  }
27
31
  export async function getServerDocument(firebaseApp, serverUid) {
28
32
  const serverCollection = await getServerCollection(firebaseApp);
29
- const serversSnapshot = await serverCollection.where('serverUid', '==', serverUid).get();
33
+ const serversSnapshot = await getDocs(query(serverCollection, where('serverUid', '==', serverUid)));
30
34
  if (serversSnapshot.empty) {
31
35
  throw new Error(`Server was not found: ${serverUid}`);
32
36
  }
@@ -35,18 +39,22 @@ export async function getServerDocument(firebaseApp, serverUid) {
35
39
  }
36
40
  export async function getServerCollection(firebaseApp) {
37
41
  const userDoc = await getUserDocument(firebaseApp);
38
- return userDoc.collection(UserCollection.SERVER);
42
+ const firestore = getFirestore(firebaseApp);
43
+ return collection(firestore, userDoc.path, UserCollection.SERVER);
39
44
  }
40
45
  export async function getSessionCollection(firebaseApp) {
41
46
  const userDoc = await getUserDocument(firebaseApp);
42
- return userDoc.collection(UserCollection.SESSION);
47
+ const firestore = getFirestore(firebaseApp);
48
+ return collection(firestore, userDoc.path, UserCollection.SESSION);
43
49
  }
44
50
  export async function getServerAppCollection(firebaseApp, serverUid) {
45
51
  const serverDoc = await getServerDocument(firebaseApp, serverUid);
46
- return serverDoc.collection(UserServerCollection.APP);
52
+ const firestore = getFirestore(firebaseApp);
53
+ return collection(firestore, serverDoc.path, UserServerCollection.APP);
47
54
  }
48
55
  export async function getServerVolumeCollection(firebaseApp, serverUid) {
49
56
  const serverDoc = await getServerDocument(firebaseApp, serverUid);
50
- return serverDoc.collection(UserServerCollection.VOLUME);
57
+ const firestore = getFirestore(firebaseApp);
58
+ return collection(firestore, serverDoc.path, UserServerCollection.VOLUME);
51
59
  }
52
60
  //# sourceMappingURL=collections.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"collections.js","sourceRoot":"","sources":["../../../../src/Firebase/collections.ts"],"names":[],"mappings":"AAOA,MAAM,CAAN,IAAY,cAEX;AAFD,WAAY,cAAc;IACzB,+BAAa,CAAA;AACd,CAAC,EAFW,cAAc,KAAd,cAAc,QAEzB;AAED,MAAM,CAAN,IAAY,cAGX;AAHD,WAAY,cAAc;IACzB,qCAAmB,CAAA;IACnB,mCAAiB,CAAA;AAClB,CAAC,EAHW,cAAc,KAAd,cAAc,QAGzB;AAED,MAAM,CAAN,IAAY,oBAGX;AAHD,WAAY,oBAAoB;IAC/B,oCAAY,CAAA;IACZ,0CAAkB,CAAA;AACnB,CAAC,EAHW,oBAAoB,KAApB,oBAAoB,QAG/B;AAED,MAAM,CAAC,KAAK,UAAU,eAAe,CAAC,WAA6B;IAClE,MAAM,IAAI,GAAG,WAAW,CAAC,IAAI,EAAE,CAAC,WAAW,CAAC;IAC5C,IAAI,CAAC,IAAI,EAAE;QACV,MAAM,IAAI,KAA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MAAM,SAAS,GAAG,YAAY,CAAC,WAAW,CAAC,CAAC;IAC5C,OAAO,UAAU,CAAC,SAAS,EAAE,OAAO,CAAC,IAAI,EAAE,cAAc,CAAC,MAAM,CAAgC,CAAC;AAClG,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,oBAAoB,CAAC,WAAwB;IAClE,MAAM,OAAO,GAAG,MAAM,eAAe,CAAC,WAAW,CAAC,CAAC;IACnD,MAAM,SAAS,GAAG,YAAY,CAAC,WAAW,CAAC,CAAC;IAC5C,OAAO,UAAU,CAAC,SAAS,EAAE,OAAO,CAAC,IAAI,EAAE,cAAc,CAAC,OAAO,CAAuC,CAAC;AAC1G,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAAC,WAAwB,EAAE,SAAiB;IACvF,MAAM,SAAS,GAAG,MAAM,iBAAiB,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC;IAClE,MAAM,SAAS,GAAG,YAAY,CAAC,WAAW,CAAC,CAAC;IAC5C,OAAO,UAAU,CAAC,SAAS,EAAE,SAAS,CAAC,IAAI,EAAE,oBAAoB,CAAC,GAAG,CAAmC,CAAC;AAC1G,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,yBAAyB,CAAC,WAAwB,EAAE,SAAiB;IAC1F,MAAM,SAAS,GAAG,MAAM,iBAAiB,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC;IAClE,MAAM,SAAS,GAAG,YAAY,CAAC,WAAW,CAAC,CAAC;IAC5C,OAAO,UAAU,CAAC,SAAS,EAAE,SAAS,CAAC,IAAI,EAAE,oBAAoB,CAAC,MAAM,CAAsC,CAAC;AAChH,CAAC"}
@@ -27,6 +27,49 @@ export declare enum NetPacketDriver {
27
27
  /** TCP replacement for simple_udp which prevents loosing packets */
28
28
  DriverSimpleTCP = "simple_tcp"
29
29
  }
30
+ export interface ClientOptions {
31
+ /**
32
+ * The clientID that is used to authenticate the client againts the server.
33
+ */
34
+ id: string;
35
+ /**
36
+ * The clientSecret that is used to authenticate the client againts the server.
37
+ */
38
+ secret: string;
39
+ }
40
+ export interface ServerOptions {
41
+ /**
42
+ * The hostname of the server where the metadata and screen server is located.
43
+ * It's hostname so it doesn't contain protocol or port.
44
+ * I.e. `metadata.example.com` or `192.168.1.2`
45
+ */
46
+ hostname: string;
47
+ /**
48
+ * If the connection to the server should be secured using TLS (https).
49
+ * Default to false.
50
+ */
51
+ secure?: boolean;
52
+ /**
53
+ * The port where the screen server is located.
54
+ * Default to 6113.
55
+ */
56
+ metadataPort?: number;
57
+ /**
58
+ * The port where the metadata server is located.
59
+ * Default to 6116.
60
+ */
61
+ metadataWSPort?: number;
62
+ /**
63
+ * The port where the screen server is located.
64
+ * Default to 6114.
65
+ */
66
+ screenPort?: number;
67
+ /**
68
+ * The port where the screen server is located.
69
+ * Default to 6117.
70
+ */
71
+ screenWSPort?: number;
72
+ }
30
73
  export interface ServiceOptions {
31
74
  /**
32
75
  * Where are the runtime options stored.
@@ -60,6 +103,18 @@ export interface ServiceOptions {
60
103
  * Defaults to NetPacketDriver.DriverSimpleUDP=simple_udp
61
104
  */
62
105
  screenDriver?: NetPacketDriver;
106
+ /**
107
+ * The server where the metadata and screen server is located.
108
+ * If specified, it will use this server prior to the server related to the session.
109
+ * If not specified, it will fetch the best server from the database based on the current firebase session.
110
+ */
111
+ server?: ServerOptions;
112
+ /**
113
+ * The client options that are used to authenticate the client against the server.
114
+ * If specified, it will use this client prior to the client related to the remote session.
115
+ * If not specified, it will fetch the best client from the database based on the current firebase session.
116
+ */
117
+ client?: ClientOptions;
63
118
  }
64
119
  export interface FirebaseOptions {
65
120
  apiKey: string;
@@ -1,7 +1,4 @@
1
- /// <reference types="node" />
2
- import { Server } from '../Server/Server';
3
- import { RemoteSession } from '../Session/RemoteSession';
4
- import { NetPacketDriver, NetStreamDriver, Options } from '../Options';
1
+ import { ClientOptions, NetPacketDriver, NetStreamDriver, ServerOptions, ServiceOptions } from '../Options';
5
2
  export declare enum MsgType {
6
3
  AttachProcess = 36,
7
4
  SuccessResponse = 37,
@@ -35,5 +32,5 @@ export interface IStopProcessInfo extends IServerInfo {
35
32
  export interface IGetProcessInfo extends IServerInfo {
36
33
  ScreenID: string;
37
34
  }
38
- export declare function getServerInfo(server: Server, session: RemoteSession, options: Options | undefined): IServerInfo;
35
+ export declare function getServerInfo(serverOptions: ServerOptions, clientOptions: ClientOptions, options: ServiceOptions | undefined): IServerInfo;
39
36
  export declare function invoke(sockPath: string, msgType: MsgType, msgData: Buffer): Promise<Buffer>;
@@ -19,19 +19,19 @@ const DEFAULT_METADATA_PORT = 6113;
19
19
  const DEFAULT_METADATA_WS_PORT = 6116;
20
20
  const DEFAULT_SCREEN_PORT = 6114;
21
21
  const DEFAULT_SCREEN_WS_PORT = 6117;
22
- export function getServerInfo(server, session, options) {
23
- const metadataDriver = options?.service?.metadataDriver ?? NetStreamDriver.DriverSimpleTCP;
24
- const screenDriver = options?.service?.screenDriver ?? NetPacketDriver.DriverSimpleUDP;
25
- const metadataPort = getMetadataPortForDriver(server, metadataDriver);
26
- const screenPort = getScreenPortForDriver(server, screenDriver);
22
+ export function getServerInfo(serverOptions, clientOptions, options) {
23
+ const metadataDriver = options?.metadataDriver ?? NetStreamDriver.DriverSimpleTCP;
24
+ const screenDriver = options?.screenDriver ?? NetPacketDriver.DriverSimpleUDP;
25
+ const metadataPort = getMetadataPortForDriver(serverOptions, metadataDriver);
26
+ const screenPort = getScreenPortForDriver(serverOptions, screenDriver);
27
27
  return {
28
- ClientID: session.client.id,
29
- ClientSecret: session.client.secret,
28
+ ClientID: clientOptions.id,
29
+ ClientSecret: clientOptions.secret,
30
30
  MetadataDriver: metadataDriver,
31
- MetadataHost: server.hostname + ':' + metadataPort,
31
+ MetadataHost: serverOptions.hostname + ':' + metadataPort,
32
32
  ScreenDriver: screenDriver,
33
- ScreenHost: server.hostname + ':' + screenPort,
34
- Secure: server.secure,
33
+ ScreenHost: serverOptions.hostname + ':' + screenPort,
34
+ Secure: serverOptions.secure ?? false,
35
35
  };
36
36
  }
37
37
  function getMetadataPortForDriver(server, driver) {
@@ -1 +1 @@
1
- {"version":3,"file":"daemonHelper.js","sourceRoot":"","sources":["../../../../src/Platform/daemonHelper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAIvD,OAAO,EAAE,eAAe,EAAE,eAAe,EAAW,MAAM,YAAY,CAAC;AAEvE,MAAM,CAAN,IAAY,OAUX;AAVD,WAAY,OAAO;IAClB,wDAAkB,CAAA;IAClB,4DAAoB,CAAA;IACpB,wDAAkB,CAAA;IAClB,sDAAiB,CAAA;IACjB,oDAAgB,CAAA;IAChB,wDAAkB,CAAA;IAClB,wDAAkB,CAAA;IAClB,0DAAmB,CAAA;IACnB,wEAA0B,CAAA;AAC3B,CAAC,EAVW,OAAO,KAAP,OAAO,QAUlB;AA6BD,MAAM,aAAa,GAAG,CAAC,CAAC;AACxB,MAAM,kBAAkB,GAAG,EAAE,CAAC;AAC9B,MAAM,SAAS,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;AAE7C,MAAM,qBAAqB,GAAG,IAAI,CAAC;AACnC,MAAM,wBAAwB,GAAG,IAAI,CAAC;AACtC,MAAM,mBAAmB,GAAG,IAAI,CAAC;AACjC,MAAM,sBAAsB,GAAG,IAAI,CAAC;AAEpC,MAAM,UAAU,aAAa,CAAC,MAAc,EAAE,OAAsB,EAAE,OAA4B;IACjG,MAAM,cAAc,GAAG,OAAO,EAAE,OAAO,EAAE,cAAc,IAAI,eAAe,CAAC,eAAe,CAAC;IAC3F,MAAM,YAAY,GAAG,OAAO,EAAE,OAAO,EAAE,YAAY,IAAI,eAAe,CAAC,eAAe,CAAC;IAEvF,MAAM,YAAY,GAAG,wBAAwB,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;IACtE,MAAM,UAAU,GAAG,sBAAsB,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;IAEhE,OA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
@@ -1,5 +1,5 @@
1
- import { Options } from "../Options";
2
- export declare function getRunPath(options?: Options): string;
1
+ import { Options, ServiceOptions } from "../Options";
2
+ export declare function getRunPath(options?: ServiceOptions): string;
3
3
  export declare function getLogPath(options?: Options): string;
4
4
  export declare function getClientDaemonBinPath(options?: Options): string;
5
- export declare function getSockPath(options?: Options): string;
5
+ export declare function getSockPath(options?: ServiceOptions): string;
@@ -8,7 +8,7 @@ const CLIENT_DAEMON_BIN = 'supra-client-daemon';
8
8
  const IS_WINDOWS = ['win32', 'cygwin'].includes(platform());
9
9
  const PATH_ENV_DELIMITER = IS_WINDOWS ? ';' : ':';
10
10
  export function getRunPath(options) {
11
- const runPath = options?.service?.runPath ?? join(homedir(), RUN_RELATIVE_DIR);
11
+ const runPath = options?.runPath ?? join(homedir(), RUN_RELATIVE_DIR);
12
12
  return runPath;
13
13
  }
14
14
  export function getLogPath(options) {
@@ -39,12 +39,12 @@ export function getClientDaemonBinPath(options) {
39
39
  export function getSockPath(options) {
40
40
  if (IS_WINDOWS) {
41
41
  // Windows doesn' support UNIX socket
42
- const runPath = options?.service?.sockPath ?? SOCK_HOST;
42
+ const runPath = options?.sockPath ?? SOCK_HOST;
43
43
  return runPath;
44
44
  }
45
45
  else {
46
46
  const runPath = getRunPath(options);
47
- const sockPath = options?.service?.sockPath ?? join(runPath, SOCK_FILENAME);
47
+ const sockPath = options?.sockPath ?? join(runPath, SOCK_FILENAME);
48
48
  return sockPath;
49
49
  }
50
50
  }
@@ -1 +1 @@
1
- {"version":3,"file":"pathHelper.js","sourceRoot":"","sources":["../../../../src/Platform/pathHelper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,MAAM,CAAC;AAInC,MAAM,gBAAgB,GAAG,IAAI,CAAC,QAAQ,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAC;AACzD,MAAM,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AAQ,CAAC;QAChE,MAAM,CAAC,UAAU,EAAE,kBAAkB,CAAC,GAAG,MAAM,eAAe,CAAC,UAAU,CAAC,CAAC;QAC3E,SAAS,GAAG,kBAAkB,CAAC;QAE/B,IAAI,OAAO,CAAC,GAAG,CAAC,MAAM,KAAK,SAAS,EAAE,CAAC;YACtC,MAAM,CAAC,YAAY,CAAC,OAAO,CAAC,cAAc,EAAE,SAAU,CAAC,CAAC,CAAC,+DAA+D;YACxH,MAAM,CAAC,YAAY,CAAC,OAAO,CAAC,eAAe,EAAE,UAAU,CAAC,CAAC;QAC1D,CAAC;aAAM,CAAC;YACP,MAAM,aAAa,GAAG,OAAO,EAAE,GAAG,EAAE,aAAa,IAAI,uBAAuB,CAAC;YAC7E,MAAM,cAAc,GAAG,OAAO,EAAE,GAAG,EAAE,cAAc,IAAI,wBAAwB,CAAC;YAChF,MAAM,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC,UAAU,CAAkB,CAAC,CAAC,kCAAkC;YAC3F,MAAM,EAAE,CAAC,SAAS,CAAC,aAAa,EAAE,SAAU,CAAC,CAAC,CAAC,+DAA+D;YAC9G,MAAM,EAAE,CAAC,SAAS,CAAC,cAAc,EAAE,UAAU,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC;QACjE,CAAC;IACF,CAAC;IAED,OAAO,SAAS,CAAC;AAClB,CAAC"}
@@ -1,14 +1,4 @@
1
- export interface OpenOptions {
2
- /** Identify server where the process will be running */
3
- serverUid: string;
4
- /** Name of application which creating the process */
5
- appName: string;
6
- /** array of args passed to program process when is started */
7
- appArgs: string[];
8
- /** Whether to create new process even if another already running */
9
- createNew?: boolean;
10
- /** If this option is specified, it will fail when process of application not running */
11
- runningOnly?: boolean;
1
+ export interface OpenOptions extends StartOptions {
12
2
  }
13
3
  export interface StartOptions {
14
4
  /** Identify server where the process will be running */
@@ -17,6 +7,8 @@ export interface StartOptions {
17
7
  appName: string;
18
8
  /** array of args passed to program process when is started */
19
9
  appArgs: string[];
10
+ /** Whether to create new process even if another already running */
11
+ createNew?: boolean;
20
12
  }
21
13
  export interface CloseOptions {
22
14
  /** Identify server where the process will be stopped */
@@ -1,5 +1,7 @@
1
1
  export interface Process {
2
2
  appName: string;
3
3
  screenId: string;
4
- serverUid: string;
4
+ }
5
+ export interface ProcessWithServerUid extends Process {
6
+ serverUid?: string;
5
7
  }
@@ -1,23 +1,24 @@
1
1
  import { OpenOptions, CloseOptions, StartOptions, GetProcessesOptions } from "./Options";
2
- import { Process } from './Process';
3
- import { Options } from '../Options';
2
+ import { ProcessWithServerUid } from './Process';
3
+ import { ServiceOptions } from '../Options';
4
4
  import { SessionSdk } from '../Session/SessionSdk';
5
5
  import { ServerSdk } from '../Server/ServerSdk';
6
6
  export declare class ProcessSdk {
7
- private options;
8
- private sessionSdk;
9
- private serverSdk;
7
+ private serviceOptions;
8
+ private sessionSdk?;
9
+ private serverSdk?;
10
10
  private sockPath;
11
- constructor(options: Options | undefined, sessionSdk: SessionSdk, serverSdk: ServerSdk);
11
+ constructor(serviceOptions: ServiceOptions | undefined, sessionSdk?: SessionSdk | undefined, serverSdk?: ServerSdk | undefined);
12
12
  /**
13
- * Open process with given options.
13
+ * Open process with given options. It will start process if it's not running and open it in foreground.
14
14
  * It can open existing process or create new process based on options.
15
- * If not special options specified, try to reuse existing process of app.
15
+ * It does the same as `start` but also opens the process in foreground.
16
16
  */
17
17
  open(openOptions: OpenOptions): Promise<void>;
18
18
  /**
19
- * Start process with given options.
20
- * It's not starting new, when app is already running
19
+ * Start process if it's not running with given options.
20
+ * It can start existing process or create new process based on options.
21
+ * Unlike `open`, it only starts the process and doesn't open it in foreground.
21
22
  */
22
23
  start(startOptions: StartOptions): Promise<{
23
24
  screenDriver: import("../Options").NetPacketDriver;
@@ -37,10 +38,13 @@ export declare class ProcessSdk {
37
38
  /**
38
39
  * Returns all currently running processes remotely
39
40
  */
40
- getProcesses(getProcessesOptions?: GetProcessesOptions): Promise<Process[]>;
41
+ getProcesses(getProcessesOptions?: GetProcessesOptions): Promise<ProcessWithServerUid[]>;
42
+ private getServers;
41
43
  /**
42
44
  * Returns all currently running processes locally attached to this computer
43
45
  */
44
- getAttachedProcesses(getProcessesOptions?: GetProcessesOptions): Promise<Process[]>;
46
+ getAttachedProcesses(getProcessesOptions?: GetProcessesOptions): Promise<ProcessWithServerUid[]>;
47
+ private getServerOptions;
48
+ private getClientOptions;
45
49
  private getServerProcesses;
46
50
  }
@@ -2,47 +2,48 @@ import { getServerInfo, invoke, MsgType, } from '../Platform/daemonHelper';
2
2
  import { getSockPath } from '../Platform/pathHelper';
3
3
  const SCREEN_ID_SIZE = 40;
4
4
  export class ProcessSdk {
5
- constructor(options, sessionSdk, serverSdk) {
6
- this.options = options;
5
+ serviceOptions;
6
+ sessionSdk;
7
+ serverSdk;
8
+ sockPath;
9
+ constructor(serviceOptions, sessionSdk, serverSdk) {
10
+ this.serviceOptions = serviceOptions;
7
11
  this.sessionSdk = sessionSdk;
8
12
  this.serverSdk = serverSdk;
9
- this.sockPath = getSockPath(options);
13
+ this.sockPath = getSockPath(serviceOptions);
10
14
  }
11
15
  /**
12
- * Open process with given options.
16
+ * Open process with given options. It will start process if it's not running and open it in foreground.
13
17
  * It can open existing process or create new process based on options.
14
- * If not special options specified, try to reuse existing process of app.
18
+ * It does the same as `start` but also opens the process in foreground.
15
19
  */
16
20
  async open(openOptions) {
17
- const server = await this.serverSdk.findServer(openOptions);
18
- const serverInfo = getServerInfo(server, await this.sessionSdk.getRemote(), this.options);
19
- const processes = await this.getServerProcesses(server);
20
- const runningProcess = processes.find((process) => process.appName === openOptions.appName);
21
- if (!runningProcess) {
22
- const startInfo = {
23
- ...serverInfo,
24
- AppName: openOptions.appName,
25
- AppArgs: openOptions.appArgs,
26
- };
27
- await invoke(this.sockPath, MsgType.StartProcess, Buffer.from(JSON.stringify(startInfo), 'utf8'));
28
- }
21
+ const serverInfo = await this.start(openOptions);
29
22
  const attachInfo = {
30
- ...serverInfo,
31
- AppName: openOptions.appName,
23
+ MetadataDriver: serverInfo.metadataDriver,
24
+ MetadataHost: serverInfo.metadataHost,
25
+ ScreenDriver: serverInfo.screenDriver,
26
+ ScreenHost: serverInfo.screenHost,
27
+ ClientID: serverInfo.clientID,
28
+ ClientSecret: serverInfo.clientSecret,
29
+ Secure: serverInfo.secure,
30
+ AppName: openOptions.appName, // TODO it should use rather processId instead of appName because of possible name conflicts
32
31
  };
33
32
  await invoke(this.sockPath, MsgType.AttachProcess, Buffer.from(JSON.stringify(attachInfo), 'ascii'));
34
33
  }
35
34
  /**
36
- * Start process with given options.
37
- * It's not starting new, when app is already running
35
+ * Start process if it's not running with given options.
36
+ * It can start existing process or create new process based on options.
37
+ * Unlike `open`, it only starts the process and doesn't open it in foreground.
38
38
  */
39
39
  async start(startOptions) {
40
- const server = await this.serverSdk.findServer(startOptions);
41
- const serverInfo = getServerInfo(server, await this.sessionSdk.getRemote(), this.options);
42
- const processes = await this.getServerProcesses(server);
40
+ const serverOptions = await this.getServerOptions(startOptions);
41
+ const clientOptions = await this.getClientOptions();
42
+ const serverInfo = getServerInfo(serverOptions, clientOptions, this.serviceOptions);
43
+ const processes = await this.getServerProcesses(serverOptions, clientOptions);
43
44
  const runningProcess = processes.find((process) => process.appName === startOptions.appName);
44
45
  let screenID;
45
- if (!runningProcess) {
46
+ if (!runningProcess || startOptions.createNew) {
46
47
  const startInfo = {
47
48
  ...serverInfo,
48
49
  AppName: startOptions.appName,
@@ -70,12 +71,13 @@ export class ProcessSdk {
70
71
  * It closes the given process remotely and locally as well.
71
72
  */
72
73
  async close(closeOptions) {
73
- const server = await this.serverSdk.findServer(closeOptions);
74
- const processes = await this.getServerProcesses(server);
74
+ const serverOptions = await this.getServerOptions(closeOptions);
75
+ const clientOptions = await this.getClientOptions();
76
+ const processes = await this.getServerProcesses(serverOptions, clientOptions);
75
77
  const runningProcess = processes.find((process) => process.appName === closeOptions.appName);
76
78
  if (runningProcess) {
77
79
  const stopInfo = {
78
- ...getServerInfo(server, await this.sessionSdk.getRemote(), this.options),
80
+ ...getServerInfo(serverOptions, clientOptions, this.serviceOptions),
79
81
  AppName: runningProcess.appName,
80
82
  };
81
83
  await invoke(this.sockPath, MsgType.StopProcess, Buffer.from(JSON.stringify(stopInfo), 'ascii'));
@@ -88,18 +90,36 @@ export class ProcessSdk {
88
90
  * Returns all currently running processes remotely
89
91
  */
90
92
  async getProcesses(getProcessesOptions) {
91
- const serverOptions = {};
93
+ const clientOptions = await this.getClientOptions();
94
+ const getServerOptions = {};
92
95
  if (getProcessesOptions?.serverUid) {
93
- serverOptions.serverUids = [getProcessesOptions.serverUid];
96
+ getServerOptions.serverUids = [getProcessesOptions.serverUid];
94
97
  }
95
- const servers = await this.serverSdk.getServers(serverOptions);
98
+ const servers = await this.getServers(getServerOptions);
96
99
  const processes = [];
97
100
  for (const server of servers) {
98
- const serverProcesses = await this.getServerProcesses(server);
99
- processes.push(...serverProcesses);
101
+ const serverProcesses = await this.getServerProcesses(server, clientOptions);
102
+ for (const process of serverProcesses) {
103
+ processes.push({
104
+ ...process,
105
+ serverUid: 'serverUid' in server ? server.serverUid : undefined,
106
+ });
107
+ }
100
108
  }
101
109
  return processes;
102
110
  }
111
+ async getServers(serverOptions) {
112
+ if (this.serviceOptions?.server) {
113
+ if (serverOptions.serverUids) {
114
+ throw new Error(`Cannot get servers by uids when serviceOptions.server is set. It's a single server API.`);
115
+ }
116
+ return [this.serviceOptions.server];
117
+ }
118
+ if (!this.serverSdk) {
119
+ throw new Error(`Server SDK is not set. It requires a service.server options to work with processes`);
120
+ }
121
+ return await this.serverSdk.getServers(serverOptions);
122
+ }
103
123
  /**
104
124
  * Returns all currently running processes locally attached to this computer
105
125
  */
@@ -116,26 +136,45 @@ export class ProcessSdk {
116
136
  .filter((process) => !getProcessesOptions?.serverUid || getProcessesOptions.serverUid === process.serverUid);
117
137
  return attachedProcesses;
118
138
  }
119
- async getServerProcesses(server) {
120
- const serverInfo = getServerInfo(server, await this.sessionSdk.getRemote(), this.options);
139
+ async getServerOptions(findServerOptions) {
140
+ if (this.serviceOptions?.server) {
141
+ return this.serviceOptions?.server;
142
+ }
143
+ if (!this.serverSdk) {
144
+ throw new Error(`Server SDK is not set. It requires a service.server options to work with processes`);
145
+ }
146
+ const server = await this.serverSdk.findServer(findServerOptions);
147
+ return server;
148
+ }
149
+ async getClientOptions() {
150
+ if (this.serviceOptions?.client) {
151
+ return this.serviceOptions?.client;
152
+ }
153
+ if (!this.sessionSdk) {
154
+ throw new Error(`Session SDK is not set. It requires a service.client options to work with processes`);
155
+ }
156
+ const remoteSession = await this.sessionSdk.getRemote();
157
+ return remoteSession.client;
158
+ }
159
+ async getServerProcesses(serverOptions, clientOptions) {
160
+ const serverInfo = getServerInfo(serverOptions, clientOptions, this.serviceOptions);
121
161
  const screenIdsData = await invoke(this.sockPath, MsgType.ListProcesses, Buffer.from(JSON.stringify(serverInfo)));
122
162
  const screenIds = [];
123
163
  for (let i = 0; i < screenIdsData.byteLength; i += SCREEN_ID_SIZE) {
124
- const screenId = screenIdsData.slice(i, i + SCREEN_ID_SIZE).toString('ascii');
164
+ const screenId = screenIdsData.subarray(i, i + SCREEN_ID_SIZE).toString('ascii');
125
165
  screenIds.push(screenId);
126
166
  }
127
167
  const processes = [];
128
168
  for (const screenId of screenIds) {
129
169
  try {
130
170
  const getInfo = {
131
- ...getServerInfo(server, await this.sessionSdk.getRemote(), this.options),
171
+ ...getServerInfo(serverOptions, clientOptions, this.serviceOptions),
132
172
  ScreenID: screenId,
133
173
  };
134
174
  const processInfoData = await invoke(this.sockPath, MsgType.GetProcessInfo, Buffer.from(JSON.stringify(getInfo), 'ascii'));
135
175
  const process = {
136
176
  appName: processInfoData.toString('ascii'),
137
177
  screenId,
138
- serverUid: server.serverUid,
139
178
  };
140
179
  processes.push(process);
141
180
  }