frida 16.7.13 → 16.7.15

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 (172) hide show
  1. package/README.md +1 -10
  2. package/build/BSDmakefile +6 -0
  3. package/build/Makefile +10 -0
  4. package/build/src/frida.d.ts +364 -0
  5. package/build/src/frida.js +962 -0
  6. package/build/src/frida_binding.d.ts +938 -0
  7. package/meson.build +34 -67
  8. package/package.json +30 -20
  9. package/scripts/fetch-abi-bits.py +15 -65
  10. package/scripts/install.js +5 -4
  11. package/src/addon.def +3 -0
  12. package/src/addon.symbols +2 -1
  13. package/src/addon.version +4 -0
  14. package/src/frida_bindgen/__init__.py +0 -0
  15. package/src/frida_bindgen/__main__.py +4 -0
  16. package/src/frida_bindgen/__pycache__/__init__.cpython-312.pyc +0 -0
  17. package/src/frida_bindgen/__pycache__/__main__.cpython-312.pyc +0 -0
  18. package/src/frida_bindgen/__pycache__/cli.cpython-312.pyc +0 -0
  19. package/src/frida_bindgen/__pycache__/codegen.cpython-312.pyc +0 -0
  20. package/src/frida_bindgen/__pycache__/customization.cpython-312.pyc +0 -0
  21. package/src/frida_bindgen/__pycache__/loader.cpython-312.pyc +0 -0
  22. package/src/frida_bindgen/__pycache__/model.cpython-312.pyc +0 -0
  23. package/src/frida_bindgen/assets/codegen_helpers.c +1970 -0
  24. package/src/frida_bindgen/assets/codegen_helpers.ts +100 -0
  25. package/src/frida_bindgen/assets/codegen_prototypes.h +78 -0
  26. package/src/frida_bindgen/assets/codegen_types.h +57 -0
  27. package/src/frida_bindgen/assets/customization_facade.exports +13 -0
  28. package/src/frida_bindgen/assets/customization_facade.ts +157 -0
  29. package/src/frida_bindgen/assets/customization_helpers.imports +2 -0
  30. package/src/frida_bindgen/assets/customization_helpers.ts +396 -0
  31. package/src/frida_bindgen/cli.py +96 -0
  32. package/src/frida_bindgen/codegen.py +2233 -0
  33. package/src/frida_bindgen/customization.py +924 -0
  34. package/src/frida_bindgen/loader.py +60 -0
  35. package/src/frida_bindgen/model.py +1357 -0
  36. package/src/meson.build +92 -27
  37. package/{lib/build.py → src/tsc.py} +12 -12
  38. package/src/win_delay_load_hook.c +56 -0
  39. package/subprojects/frida-core.wrap +1 -1
  40. package/test/data/index.ts +2 -2
  41. package/test/device.ts +1 -2
  42. package/test/device_manager.ts +1 -2
  43. package/test/labrat.ts +2 -2
  44. package/test/script.ts +12 -12
  45. package/test/session.ts +3 -3
  46. package/tsconfig.json +6 -11
  47. package/dist/application.d.ts +0 -81
  48. package/dist/application.js +0 -2
  49. package/dist/authentication.d.ts +0 -3
  50. package/dist/authentication.js +0 -2
  51. package/dist/bus.d.ts +0 -16
  52. package/dist/bus.js +0 -23
  53. package/dist/cancellable.d.ts +0 -15
  54. package/dist/cancellable.js +0 -41
  55. package/dist/child.d.ts +0 -16
  56. package/dist/child.js +0 -9
  57. package/dist/crash.d.ts +0 -10
  58. package/dist/crash.js +0 -2
  59. package/dist/device.d.ts +0 -156
  60. package/dist/device.js +0 -188
  61. package/dist/device_manager.d.ts +0 -25
  62. package/dist/device_manager.js +0 -42
  63. package/dist/endpoint_parameters.d.ts +0 -26
  64. package/dist/endpoint_parameters.js +0 -24
  65. package/dist/icon.d.ts +0 -14
  66. package/dist/icon.js +0 -2
  67. package/dist/index.d.ts +0 -161
  68. package/dist/index.js +0 -170
  69. package/dist/iostream.d.ts +0 -13
  70. package/dist/iostream.js +0 -73
  71. package/dist/native.d.ts +0 -1
  72. package/dist/native.js +0 -11
  73. package/dist/portal_membership.d.ts +0 -6
  74. package/dist/portal_membership.js +0 -12
  75. package/dist/portal_service.d.ts +0 -48
  76. package/dist/portal_service.js +0 -52
  77. package/dist/process.d.ts +0 -47
  78. package/dist/process.js +0 -2
  79. package/dist/relay.d.ts +0 -22
  80. package/dist/relay.js +0 -32
  81. package/dist/script.d.ts +0 -70
  82. package/dist/script.js +0 -266
  83. package/dist/service.d.ts +0 -16
  84. package/dist/service.js +0 -26
  85. package/dist/session.d.ts +0 -45
  86. package/dist/session.js +0 -73
  87. package/dist/signals.d.ts +0 -20
  88. package/dist/signals.js +0 -40
  89. package/dist/socket_address.d.ts +0 -25
  90. package/dist/socket_address.js +0 -2
  91. package/dist/spawn.d.ts +0 -4
  92. package/dist/spawn.js +0 -2
  93. package/dist/system_parameters.d.ts +0 -84
  94. package/dist/system_parameters.js +0 -2
  95. package/lib/application.ts +0 -98
  96. package/lib/authentication.ts +0 -3
  97. package/lib/bus.ts +0 -30
  98. package/lib/cancellable.ts +0 -48
  99. package/lib/child.ts +0 -15
  100. package/lib/crash.ts +0 -11
  101. package/lib/device.ts +0 -331
  102. package/lib/device_manager.ts +0 -69
  103. package/lib/endpoint_parameters.ts +0 -56
  104. package/lib/icon.ts +0 -15
  105. package/lib/index.ts +0 -316
  106. package/lib/iostream.ts +0 -78
  107. package/lib/meson.build +0 -53
  108. package/lib/native.ts +0 -9
  109. package/lib/portal_membership.ts +0 -10
  110. package/lib/portal_service.ts +0 -105
  111. package/lib/process.ts +0 -57
  112. package/lib/relay.ts +0 -44
  113. package/lib/script.ts +0 -361
  114. package/lib/service.ts +0 -34
  115. package/lib/session.ts +0 -113
  116. package/lib/signals.ts +0 -45
  117. package/lib/socket_address.ts +0 -35
  118. package/lib/spawn.ts +0 -4
  119. package/lib/system_parameters.ts +0 -103
  120. package/meson.options +0 -11
  121. package/src/addon.cc +0 -78
  122. package/src/application.cc +0 -148
  123. package/src/application.h +0 -31
  124. package/src/authentication.cc +0 -174
  125. package/src/authentication.h +0 -24
  126. package/src/bus.cc +0 -167
  127. package/src/bus.h +0 -33
  128. package/src/cancellable.cc +0 -117
  129. package/src/cancellable.h +0 -31
  130. package/src/child.cc +0 -150
  131. package/src/child.h +0 -32
  132. package/src/crash.cc +0 -122
  133. package/src/crash.h +0 -30
  134. package/src/device.cc +0 -1350
  135. package/src/device.h +0 -56
  136. package/src/device_manager.cc +0 -362
  137. package/src/device_manager.h +0 -35
  138. package/src/endpoint_parameters.cc +0 -171
  139. package/src/endpoint_parameters.h +0 -28
  140. package/src/glib_context.cc +0 -62
  141. package/src/glib_context.h +0 -29
  142. package/src/glib_object.cc +0 -25
  143. package/src/glib_object.h +0 -37
  144. package/src/iostream.cc +0 -243
  145. package/src/iostream.h +0 -30
  146. package/src/operation.h +0 -94
  147. package/src/portal_membership.cc +0 -100
  148. package/src/portal_membership.h +0 -26
  149. package/src/portal_service.cc +0 -401
  150. package/src/portal_service.h +0 -40
  151. package/src/process.cc +0 -135
  152. package/src/process.h +0 -30
  153. package/src/relay.cc +0 -139
  154. package/src/relay.h +0 -31
  155. package/src/runtime.cc +0 -568
  156. package/src/runtime.h +0 -69
  157. package/src/script.cc +0 -301
  158. package/src/script.h +0 -36
  159. package/src/service.cc +0 -224
  160. package/src/service.h +0 -36
  161. package/src/session.cc +0 -860
  162. package/src/session.h +0 -42
  163. package/src/signals.cc +0 -334
  164. package/src/signals.h +0 -47
  165. package/src/spawn.cc +0 -95
  166. package/src/spawn.h +0 -27
  167. package/src/usage_monitor.h +0 -117
  168. package/src/uv_context.cc +0 -118
  169. package/src/uv_context.h +0 -40
  170. package/src/win_delay_load_hook.cc +0 -63
  171. package/subprojects/nan.wrap +0 -9
  172. package/subprojects/packagefiles/nan.patch +0 -13
package/dist/index.js DELETED
@@ -1,170 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getDevice = exports.getUsbDevice = exports.getRemoteDevice = exports.getLocalDevice = exports.getDeviceManager = exports.enumerateDevices = exports.injectLibraryBlob = exports.injectLibraryFile = exports.attach = exports.kill = exports.resume = exports.spawn = exports.querySystemParameters = exports.Service = exports.Bus = exports.ChildOrigin = exports.Cancellable = exports.IOStream = exports.EndpointParameters = exports.PortalService = exports.PortalMembership = exports.RelayKind = exports.Relay = exports.LogLevel = exports.MessageType = exports.ScriptRuntime = exports.Script = exports.SessionDetachReason = exports.Session = exports.Realm = exports.Stdio = exports.Scope = exports.DeviceType = exports.Device = exports.DeviceManager = void 0;
4
- const busModule = require("./bus");
5
- const cancellableModule = require("./cancellable");
6
- const childModule = require("./child");
7
- const deviceManagerModule = require("./device_manager");
8
- const deviceModule = require("./device");
9
- const endpointParametersModule = require("./endpoint_parameters");
10
- const iostreamModule = require("./iostream");
11
- const portalMembershipModule = require("./portal_membership");
12
- const portalServiceModule = require("./portal_service");
13
- const relayModule = require("./relay");
14
- const scriptModule = require("./script");
15
- const serviceModule = require("./service");
16
- const sessionModule = require("./session");
17
- exports.DeviceManager = deviceManagerModule.DeviceManager;
18
- exports.Device = deviceModule.Device;
19
- exports.DeviceType = deviceModule.DeviceType;
20
- exports.Scope = deviceModule.Scope;
21
- exports.Stdio = deviceModule.Stdio;
22
- exports.Realm = deviceModule.Realm;
23
- exports.Session = sessionModule.Session;
24
- exports.SessionDetachReason = sessionModule.SessionDetachReason;
25
- exports.Script = scriptModule.Script;
26
- exports.ScriptRuntime = scriptModule.ScriptRuntime;
27
- exports.MessageType = scriptModule.MessageType;
28
- exports.LogLevel = scriptModule.LogLevel;
29
- exports.Relay = relayModule.Relay;
30
- exports.RelayKind = relayModule.RelayKind;
31
- exports.PortalMembership = portalMembershipModule.PortalMembership;
32
- exports.PortalService = portalServiceModule.PortalService;
33
- exports.EndpointParameters = endpointParametersModule.EndpointParameters;
34
- exports.IOStream = iostreamModule.IOStream;
35
- exports.Cancellable = cancellableModule.Cancellable;
36
- exports.ChildOrigin = childModule.ChildOrigin;
37
- exports.Bus = busModule.Bus;
38
- exports.Service = serviceModule.Service;
39
- let sharedDeviceManager = null;
40
- async function querySystemParameters(cancellable) {
41
- const device = await getLocalDevice(cancellable);
42
- return await device.querySystemParameters(cancellable);
43
- }
44
- exports.querySystemParameters = querySystemParameters;
45
- async function spawn(program, options = {}, cancellable) {
46
- const device = await getLocalDevice(cancellable);
47
- return await device.spawn(program, options, cancellable);
48
- }
49
- exports.spawn = spawn;
50
- async function resume(target, cancellable) {
51
- const device = await getLocalDevice(cancellable);
52
- await device.resume(target, cancellable);
53
- }
54
- exports.resume = resume;
55
- async function kill(target, cancellable) {
56
- const device = await getLocalDevice(cancellable);
57
- await device.kill(target, cancellable);
58
- }
59
- exports.kill = kill;
60
- async function attach(target, options = {}, cancellable) {
61
- const device = await getLocalDevice(cancellable);
62
- return await device.attach(target, options, cancellable);
63
- }
64
- exports.attach = attach;
65
- async function injectLibraryFile(target, path, entrypoint, data, cancellable) {
66
- const device = await getLocalDevice(cancellable);
67
- return await device.injectLibraryFile(target, path, entrypoint, data, cancellable);
68
- }
69
- exports.injectLibraryFile = injectLibraryFile;
70
- async function injectLibraryBlob(target, blob, entrypoint, data, cancellable) {
71
- const device = await getLocalDevice(cancellable);
72
- return await device.injectLibraryBlob(target, blob, entrypoint, data, cancellable);
73
- }
74
- exports.injectLibraryBlob = injectLibraryBlob;
75
- async function enumerateDevices(cancellable) {
76
- const deviceManager = getDeviceManager();
77
- return await deviceManager.enumerateDevices(cancellable);
78
- }
79
- exports.enumerateDevices = enumerateDevices;
80
- ;
81
- function getDeviceManager() {
82
- if (sharedDeviceManager === null) {
83
- sharedDeviceManager = new deviceManagerModule.DeviceManager();
84
- }
85
- return sharedDeviceManager;
86
- }
87
- exports.getDeviceManager = getDeviceManager;
88
- function getLocalDevice(cancellable) {
89
- return getMatchingDevice(device => device.type === exports.DeviceType.Local, {}, cancellable);
90
- }
91
- exports.getLocalDevice = getLocalDevice;
92
- function getRemoteDevice(cancellable) {
93
- return getMatchingDevice(device => device.type === exports.DeviceType.Remote, {}, cancellable);
94
- }
95
- exports.getRemoteDevice = getRemoteDevice;
96
- function getUsbDevice(options, cancellable) {
97
- return getMatchingDevice(device => device.type === exports.DeviceType.Usb, options, cancellable);
98
- }
99
- exports.getUsbDevice = getUsbDevice;
100
- function getDevice(id, options, cancellable) {
101
- return getMatchingDevice(device => device.id === id, options, cancellable);
102
- }
103
- exports.getDevice = getDevice;
104
- async function getMatchingDevice(predicate, options = {}, cancellable) {
105
- const device = await findMatchingDevice(predicate, cancellable);
106
- if (device !== null) {
107
- return device;
108
- }
109
- const { timeout = 0 } = options;
110
- if (timeout === 0) {
111
- throw new Error("Device not found");
112
- }
113
- const getDeviceEventually = new Promise((resolve, reject) => {
114
- const deviceManager = getDeviceManager();
115
- deviceManager.added.connect(onDeviceAdded);
116
- const timer = (timeout !== null) ? setTimeout(onTimeout, timeout) : null;
117
- if (cancellable !== undefined) {
118
- cancellable.cancelled.connect(onCancel);
119
- if (cancellable.isCancelled) {
120
- onCancel();
121
- return;
122
- }
123
- }
124
- findMatchingDevice(predicate, cancellable)
125
- .then(device => {
126
- if (device !== null) {
127
- onSuccess(device);
128
- }
129
- })
130
- .catch(onError);
131
- function onDeviceAdded(device) {
132
- if (predicate(device)) {
133
- onSuccess(device);
134
- }
135
- }
136
- function onSuccess(device) {
137
- stopMonitoring();
138
- resolve(device);
139
- }
140
- function onError(error) {
141
- stopMonitoring();
142
- reject(error);
143
- }
144
- function onTimeout() {
145
- onError(new Error("Timed out while waiting for device to appear"));
146
- }
147
- function onCancel() {
148
- onError(new Error("Operation was cancelled"));
149
- }
150
- function stopMonitoring() {
151
- if (cancellable !== undefined) {
152
- cancellable.cancelled.disconnect(onCancel);
153
- }
154
- if (timer !== null) {
155
- clearTimeout(timer);
156
- }
157
- deviceManager.added.disconnect(onDeviceAdded);
158
- }
159
- });
160
- return await getDeviceEventually;
161
- }
162
- async function findMatchingDevice(predicate, cancellable) {
163
- const deviceManager = getDeviceManager();
164
- const devices = await deviceManager.enumerateDevices(cancellable);
165
- const matching = devices.filter(predicate);
166
- if (matching.length === 0) {
167
- return null;
168
- }
169
- return matching[0];
170
- }
@@ -1,13 +0,0 @@
1
- /// <reference types="node" />
2
- /// <reference types="node" />
3
- import { Duplex } from "stream";
4
- export declare class IOStream extends Duplex {
5
- private impl;
6
- private pending;
7
- private cancellable;
8
- constructor(impl: any);
9
- _destroy(error: Error | null, callback: (error: Error | null) => void): Promise<void>;
10
- _read(size: number): void;
11
- _write(chunk: any, encoding: BufferEncoding, callback: (error?: Error | null) => void): void;
12
- private track;
13
- }
package/dist/iostream.js DELETED
@@ -1,73 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.IOStream = void 0;
4
- const cancellable_1 = require("./cancellable");
5
- const stream_1 = require("stream");
6
- class IOStream extends stream_1.Duplex {
7
- constructor(impl) {
8
- super({});
9
- this.impl = impl;
10
- this.pending = new Set();
11
- this.cancellable = new cancellable_1.Cancellable();
12
- }
13
- async _destroy(error, callback) {
14
- this.cancellable.cancel();
15
- for (const operation of this.pending) {
16
- try {
17
- await operation;
18
- }
19
- catch (e) {
20
- }
21
- }
22
- try {
23
- await this.impl.close();
24
- }
25
- catch (e) {
26
- }
27
- callback(error);
28
- }
29
- _read(size) {
30
- const operation = this.impl.read(size, this.cancellable)
31
- .then((data) => {
32
- const isEof = data.length === 0;
33
- if (isEof) {
34
- this.push(null);
35
- return;
36
- }
37
- this.push(data);
38
- })
39
- .catch((error) => {
40
- if (this.impl.isClosed) {
41
- this.push(null);
42
- }
43
- this.emit("error", error);
44
- });
45
- this.track(operation);
46
- }
47
- _write(chunk, encoding, callback) {
48
- let data;
49
- if (Buffer.isBuffer(chunk)) {
50
- data = chunk;
51
- }
52
- else {
53
- data = Buffer.from(chunk, encoding);
54
- }
55
- const operation = this.impl.write(data, this.cancellable)
56
- .then(() => {
57
- callback(null);
58
- })
59
- .catch((error) => {
60
- callback(error);
61
- });
62
- this.track(operation);
63
- }
64
- track(operation) {
65
- this.pending.add(operation);
66
- operation
67
- .catch(_ => { })
68
- .finally(() => {
69
- this.pending.delete(operation);
70
- });
71
- }
72
- }
73
- exports.IOStream = IOStream;
package/dist/native.d.ts DELETED
@@ -1 +0,0 @@
1
- export declare const binding: any;
package/dist/native.js DELETED
@@ -1,11 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.binding = void 0;
4
- const bindings = require("bindings");
5
- exports.binding = bindings({
6
- bindings: "frida_binding",
7
- try: [
8
- ["module_root", "build", "bindings"],
9
- [process.cwd(), "bindings"],
10
- ]
11
- });
@@ -1,6 +0,0 @@
1
- import { Cancellable } from "./cancellable";
2
- export declare class PortalMembership {
3
- private impl;
4
- constructor(impl: any);
5
- terminate(cancellable?: Cancellable): Promise<void>;
6
- }
@@ -1,12 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PortalMembership = void 0;
4
- class PortalMembership {
5
- constructor(impl) {
6
- this.impl = impl;
7
- }
8
- terminate(cancellable) {
9
- return this.impl.terminate(cancellable);
10
- }
11
- }
12
- exports.PortalMembership = PortalMembership;
@@ -1,48 +0,0 @@
1
- /// <reference types="node" />
2
- /// <reference types="node" />
3
- import { Application } from "./application";
4
- import { AuthenticatedSessionInfo } from "./authentication";
5
- import { Cancellable } from "./cancellable";
6
- import { Device } from "./device";
7
- import { EndpointParameters } from "./endpoint_parameters";
8
- import { Signal } from "./signals";
9
- import { SocketAddress } from "./socket_address";
10
- import { inspect } from "util";
11
- export declare class PortalService {
12
- nodeConnected: Signal<PortalNodeConnectedHandler>;
13
- nodeJoined: Signal<PortalNodeJoinedHandler>;
14
- nodeLeft: Signal<PortalNodeLeftHandler>;
15
- nodeDisconnected: Signal<PortalNodeDisconnectedHandler>;
16
- controllerConnected: Signal<PortalControllerConnectedHandler>;
17
- controllerDisconnected: Signal<PortalControllerDisconnectedHandler>;
18
- authenticated: Signal<PortalAuthenticatedHandler>;
19
- subscribe: Signal<PortalSubscribeHandler>;
20
- message: Signal<PortalMessageHandler>;
21
- device: Device;
22
- private impl;
23
- constructor({ clusterParams, controlParams }?: PortalServiceOptions);
24
- start(cancellable?: Cancellable): Promise<void>;
25
- stop(cancellable?: Cancellable): Promise<void>;
26
- post(connectionId: PortalConnectionId, message: any, data?: Buffer | null): void;
27
- narrowcast(tag: PortalConnectionTag, message: any, data?: Buffer | null): void;
28
- broadcast(message: any, data?: Buffer | null): void;
29
- enumerateTags(connectionId: PortalConnectionId): Promise<PortalConnectionTag[]>;
30
- tag(connectionId: PortalConnectionId, tag: PortalConnectionTag): void;
31
- untag(connectionId: PortalConnectionId, tag: PortalConnectionTag): void;
32
- [inspect.custom](): string;
33
- }
34
- export interface PortalServiceOptions {
35
- clusterParams?: EndpointParameters;
36
- controlParams?: EndpointParameters;
37
- }
38
- export type PortalConnectionId = number;
39
- export type PortalConnectionTag = string;
40
- export type PortalNodeConnectedHandler = (connectionId: PortalConnectionId, remoteAddress: SocketAddress) => void;
41
- export type PortalNodeJoinedHandler = (connectionId: PortalConnectionId, application: Application) => void;
42
- export type PortalNodeLeftHandler = (connectionId: PortalConnectionId, application: Application) => void;
43
- export type PortalNodeDisconnectedHandler = (connectionId: PortalConnectionId, remoteAddress: SocketAddress) => void;
44
- export type PortalControllerConnectedHandler = (connectionId: PortalConnectionId, remoteAddress: SocketAddress) => void;
45
- export type PortalControllerDisconnectedHandler = (connectionId: PortalConnectionId, remoteAddress: SocketAddress) => void;
46
- export type PortalAuthenticatedHandler = (connectionId: PortalConnectionId, sessionInfo: AuthenticatedSessionInfo) => void;
47
- export type PortalSubscribeHandler = (connectionId: PortalConnectionId) => void;
48
- export type PortalMessageHandler = (connectionId: PortalConnectionId, message: any, data: Buffer | null) => void;
@@ -1,52 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PortalService = void 0;
4
- const device_1 = require("./device");
5
- const native_1 = require("./native");
6
- const signals_1 = require("./signals");
7
- const util_1 = require("util");
8
- class PortalService {
9
- constructor({ clusterParams = null, controlParams = null } = {}) {
10
- const impl = new native_1.binding.PortalService(clusterParams, controlParams);
11
- this.impl = impl;
12
- this.device = new device_1.Device(impl.device);
13
- const { signals } = impl;
14
- this.nodeConnected = new signals_1.Signal(signals, "node-connected");
15
- this.nodeJoined = new signals_1.Signal(signals, "node-joined");
16
- this.nodeLeft = new signals_1.Signal(signals, "node-left");
17
- this.nodeDisconnected = new signals_1.Signal(signals, "node-disconnected");
18
- this.controllerConnected = new signals_1.Signal(signals, "controller-connected");
19
- this.controllerDisconnected = new signals_1.Signal(signals, "controller-disconnected");
20
- this.authenticated = new signals_1.Signal(signals, "authenticated");
21
- this.subscribe = new signals_1.Signal(signals, "subscribe");
22
- this.message = new signals_1.Signal(signals, "message");
23
- }
24
- start(cancellable) {
25
- return this.impl.start(cancellable);
26
- }
27
- stop(cancellable) {
28
- return this.impl.stop(cancellable);
29
- }
30
- post(connectionId, message, data = null) {
31
- this.impl.post(connectionId, message, data);
32
- }
33
- narrowcast(tag, message, data = null) {
34
- this.impl.narrowcast(tag, message, data);
35
- }
36
- broadcast(message, data = null) {
37
- this.impl.broadcast(message, data);
38
- }
39
- enumerateTags(connectionId) {
40
- return this.impl.enumerateTags(connectionId);
41
- }
42
- tag(connectionId, tag) {
43
- this.impl.tag(connectionId, tag);
44
- }
45
- untag(connectionId, tag) {
46
- this.impl.untag(connectionId, tag);
47
- }
48
- [util_1.inspect.custom]() {
49
- return "PortalService {}";
50
- }
51
- }
52
- exports.PortalService = PortalService;
package/dist/process.d.ts DELETED
@@ -1,47 +0,0 @@
1
- import { Icon } from "./icon";
2
- import { SystemParameters } from "./system_parameters";
3
- export interface Process {
4
- pid: number;
5
- name: string;
6
- parameters: ProcessParameters;
7
- }
8
- /**
9
- * Process parameters typically obtained through `enumerateProcesses({ scope })`, where
10
- * `scope` is either `Scope.Metadata` or `Scope.Full`. The default of `Scope.Minimal`
11
- * means no parameters will be included.
12
- */
13
- export interface ProcessParameters {
14
- /**
15
- * Filesystem path of program.
16
- */
17
- path?: string;
18
- /**
19
- * Name of user that the process is running as.
20
- */
21
- user?: string;
22
- /**
23
- * Parent process ID.
24
- */
25
- ppid?: number;
26
- /**
27
- * When the process was started.
28
- */
29
- started?: Date;
30
- /**
31
- * Application IDs that have code running inside this process.
32
- */
33
- applications?: string[];
34
- /**
35
- * Whether the process is currently frontmost.
36
- */
37
- frontmost?: boolean;
38
- /**
39
- * One or more icons. Only included when `scope` is set to `Scope.Full`.
40
- */
41
- icons?: Icon[];
42
- /**
43
- * System parameters, available for processes accessed through a portal.
44
- */
45
- system?: SystemParameters;
46
- [name: string]: any;
47
- }
package/dist/process.js DELETED
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
package/dist/relay.d.ts DELETED
@@ -1,22 +0,0 @@
1
- /// <reference types="node" />
2
- import { inspect } from "util";
3
- export declare class Relay {
4
- private impl;
5
- constructor({ address, username, password, kind }: RelayProperties);
6
- get address(): string;
7
- get username(): string;
8
- get password(): string;
9
- get kind(): RelayKind;
10
- [inspect.custom](depth: any, options: any): string;
11
- }
12
- export interface RelayProperties {
13
- address: string;
14
- username: string;
15
- password: string;
16
- kind: RelayKind;
17
- }
18
- export declare enum RelayKind {
19
- TurnUDP = "turn-udp",
20
- TurnTCP = "turn-tcp",
21
- TurnTLS = "turn-tls"
22
- }
package/dist/relay.js DELETED
@@ -1,32 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.RelayKind = exports.Relay = void 0;
4
- const native_1 = require("./native");
5
- const util_1 = require("util");
6
- class Relay {
7
- constructor({ address, username, password, kind }) {
8
- this.impl = new native_1.binding.Relay(address, username, password, kind);
9
- }
10
- get address() {
11
- return this.impl.address;
12
- }
13
- get username() {
14
- return this.impl.username;
15
- }
16
- get password() {
17
- return this.impl.password;
18
- }
19
- get kind() {
20
- return this.impl.kind;
21
- }
22
- [util_1.inspect.custom](depth, options) {
23
- return (0, util_1.inspect)(this.impl, Object.assign(Object.assign({}, options), { depth }));
24
- }
25
- }
26
- exports.Relay = Relay;
27
- var RelayKind;
28
- (function (RelayKind) {
29
- RelayKind["TurnUDP"] = "turn-udp";
30
- RelayKind["TurnTCP"] = "turn-tcp";
31
- RelayKind["TurnTLS"] = "turn-tls";
32
- })(RelayKind || (exports.RelayKind = RelayKind = {}));
package/dist/script.d.ts DELETED
@@ -1,70 +0,0 @@
1
- /// <reference types="node" />
2
- /// <reference types="node" />
3
- import { Cancellable } from "./cancellable";
4
- import { Signal } from "./signals";
5
- import { inspect } from "util";
6
- export declare class Script {
7
- private impl;
8
- destroyed: Signal<ScriptDestroyedHandler>;
9
- message: Signal<ScriptMessageHandler>;
10
- private exportsProxy;
11
- private logHandlerImpl;
12
- constructor(impl: any);
13
- get isDestroyed(): boolean;
14
- get exports(): ScriptExports;
15
- get logHandler(): ScriptLogHandler;
16
- set logHandler(handler: ScriptLogHandler);
17
- get defaultLogHandler(): ScriptLogHandler;
18
- load(cancellable?: Cancellable): Promise<void>;
19
- unload(cancellable?: Cancellable): Promise<void>;
20
- eternalize(cancellable?: Cancellable): Promise<void>;
21
- post(message: any, data?: Buffer | null): void;
22
- enableDebugger(options?: EnableDebuggerOptions, cancellable?: Cancellable): Promise<void>;
23
- disableDebugger(cancellable?: Cancellable): Promise<void>;
24
- [inspect.custom](depth: any, options: any): string;
25
- }
26
- export interface ScriptOptions {
27
- name?: string;
28
- snapshot?: Buffer;
29
- runtime?: ScriptRuntime;
30
- }
31
- export interface SnapshotOptions {
32
- warmupScript?: string;
33
- runtime?: ScriptRuntime;
34
- }
35
- export declare enum ScriptRuntime {
36
- Default = "default",
37
- QJS = "qjs",
38
- V8 = "v8"
39
- }
40
- export type ScriptDestroyedHandler = () => void;
41
- export type ScriptMessageHandler = (message: Message, data: Buffer | null) => void;
42
- export type ScriptLogHandler = (level: LogLevel, text: string) => void;
43
- export type Message = SendMessage | ErrorMessage;
44
- export declare enum MessageType {
45
- Send = "send",
46
- Error = "error"
47
- }
48
- export interface SendMessage {
49
- type: MessageType.Send;
50
- payload: any;
51
- }
52
- export interface ErrorMessage {
53
- type: MessageType.Error;
54
- description: string;
55
- stack?: string;
56
- fileName?: string;
57
- lineNumber?: number;
58
- columnNumber?: number;
59
- }
60
- export interface ScriptExports {
61
- [name: string]: (...args: any[]) => Promise<any>;
62
- }
63
- export declare enum LogLevel {
64
- Info = "info",
65
- Warning = "warning",
66
- Error = "error"
67
- }
68
- export interface EnableDebuggerOptions {
69
- port?: number;
70
- }