@casual-simulation/aux-vm-browser 2.0.28 → 2.0.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/managers/AuthHelper.d.ts +17 -1
- package/managers/AuthHelper.js +118 -4
- package/managers/AuthHelper.js.map +1 -1
- package/managers/BotManager.d.ts +4 -3
- package/managers/BotManager.js +29 -29
- package/managers/BotManager.js.map +1 -1
- package/managers/BrowserSimulation.d.ts +5 -1
- package/package.json +6 -8
package/managers/AuthHelper.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { AuthHelperInterface } from '@casual-simulation/aux-vm';
|
|
1
|
+
import { AuthHelperInterface, LoginStatus, LoginUIStatus } from '@casual-simulation/aux-vm';
|
|
2
|
+
import { BehaviorSubject } from 'rxjs';
|
|
2
3
|
import { AuthData } from '@casual-simulation/aux-common';
|
|
3
4
|
import { CreatePublicRecordKeyResult } from '@casual-simulation/aux-records';
|
|
4
5
|
/**
|
|
@@ -10,16 +11,27 @@ export declare class AuthHelper implements AuthHelperInterface {
|
|
|
10
11
|
private _channel;
|
|
11
12
|
private _proxy;
|
|
12
13
|
private _initialized;
|
|
14
|
+
private _protocolVersion;
|
|
13
15
|
private _sub;
|
|
16
|
+
private _loginStatus;
|
|
17
|
+
private _loginUIStatus;
|
|
18
|
+
private _initPromise;
|
|
14
19
|
/**
|
|
15
20
|
* Creates a new instance of the AuthHelper class.
|
|
16
21
|
* @param iframeOrigin The URL that the auth iframe should be loaded from.
|
|
17
22
|
*/
|
|
18
23
|
constructor(iframeOrigin?: string);
|
|
24
|
+
get loginStatus(): BehaviorSubject<LoginStatus>;
|
|
25
|
+
get loginUIStatus(): BehaviorSubject<LoginUIStatus>;
|
|
26
|
+
/**
|
|
27
|
+
* Gets whether authentication is supported by this inst.
|
|
28
|
+
*/
|
|
29
|
+
get supportsAuthentication(): boolean;
|
|
19
30
|
get closed(): boolean;
|
|
20
31
|
unsubscribe(): void;
|
|
21
32
|
dispose(): void;
|
|
22
33
|
private _init;
|
|
34
|
+
private _initCore;
|
|
23
35
|
/**
|
|
24
36
|
* Determines if the user is authenticated.
|
|
25
37
|
*/
|
|
@@ -35,5 +47,9 @@ export declare class AuthHelper implements AuthHelperInterface {
|
|
|
35
47
|
authenticateInBackground(): Promise<AuthData>;
|
|
36
48
|
createPublicRecordKey(recordName: string): Promise<CreatePublicRecordKeyResult>;
|
|
37
49
|
getAuthToken(): Promise<string>;
|
|
50
|
+
openAccountPage(): Promise<void>;
|
|
51
|
+
setUseCustomUI(useCustomUI: boolean): Promise<void>;
|
|
52
|
+
provideEmailAddress(email: string, acceptedTermsOfService: boolean): Promise<void>;
|
|
53
|
+
cancelLogin(): Promise<void>;
|
|
38
54
|
}
|
|
39
55
|
//# sourceMappingURL=AuthHelper.d.ts.map
|
package/managers/AuthHelper.js
CHANGED
|
@@ -7,9 +7,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
7
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
|
-
import { wrap } from 'comlink';
|
|
10
|
+
import { wrap, proxy } from 'comlink';
|
|
11
11
|
import { setupChannel, waitForLoad } from '../html/IFrameHelpers';
|
|
12
|
-
import { Subscription } from 'rxjs';
|
|
12
|
+
import { BehaviorSubject, Subscription } from 'rxjs';
|
|
13
13
|
import { hasValue } from '@casual-simulation/aux-common';
|
|
14
14
|
// Save the query string that was used when the site loaded
|
|
15
15
|
const query = typeof location !== 'undefined' ? location.search : null;
|
|
@@ -23,9 +23,26 @@ export class AuthHelper {
|
|
|
23
23
|
*/
|
|
24
24
|
constructor(iframeOrigin) {
|
|
25
25
|
this._initialized = false;
|
|
26
|
+
this._protocolVersion = 1;
|
|
26
27
|
this._sub = new Subscription();
|
|
28
|
+
this._loginStatus = new BehaviorSubject({});
|
|
29
|
+
this._loginUIStatus = new BehaviorSubject({
|
|
30
|
+
page: false,
|
|
31
|
+
});
|
|
27
32
|
this._origin = iframeOrigin;
|
|
28
33
|
}
|
|
34
|
+
get loginStatus() {
|
|
35
|
+
return this._loginStatus;
|
|
36
|
+
}
|
|
37
|
+
get loginUIStatus() {
|
|
38
|
+
return this._loginUIStatus;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Gets whether authentication is supported by this inst.
|
|
42
|
+
*/
|
|
43
|
+
get supportsAuthentication() {
|
|
44
|
+
return hasValue(this._origin);
|
|
45
|
+
}
|
|
29
46
|
get closed() {
|
|
30
47
|
var _a;
|
|
31
48
|
return (_a = this._sub) === null || _a === void 0 ? void 0 : _a.closed;
|
|
@@ -40,10 +57,21 @@ export class AuthHelper {
|
|
|
40
57
|
}
|
|
41
58
|
}
|
|
42
59
|
_init() {
|
|
60
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
61
|
+
if (!this._initPromise) {
|
|
62
|
+
this._initPromise = this._initCore();
|
|
63
|
+
}
|
|
64
|
+
return this._initPromise;
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
_initCore() {
|
|
43
68
|
return __awaiter(this, void 0, void 0, function* () {
|
|
44
69
|
if (!hasValue(this._origin)) {
|
|
45
70
|
throw new Error('Cannot initialize AuthHelper because no iframe origin is set.');
|
|
46
71
|
}
|
|
72
|
+
this._loginStatus.next({
|
|
73
|
+
isLoading: true,
|
|
74
|
+
});
|
|
47
75
|
const iframeUrl = new URL(`/iframe.html${query}`, this._origin).href;
|
|
48
76
|
const iframe = (this._iframe = document.createElement('iframe'));
|
|
49
77
|
this._sub.add(() => {
|
|
@@ -57,6 +85,21 @@ export class AuthHelper {
|
|
|
57
85
|
this._channel = setupChannel(this._iframe.contentWindow);
|
|
58
86
|
const wrapper = wrap(this._channel.port1);
|
|
59
87
|
this._proxy = yield new wrapper();
|
|
88
|
+
try {
|
|
89
|
+
this._protocolVersion = yield this._proxy.getProtocolVersion();
|
|
90
|
+
}
|
|
91
|
+
catch (err) {
|
|
92
|
+
console.log('[AuthHelper] Could not get protocol version. Defaulting to version 1.');
|
|
93
|
+
this._protocolVersion = 1;
|
|
94
|
+
}
|
|
95
|
+
if (this._protocolVersion >= 2) {
|
|
96
|
+
yield this._proxy.addLoginUICallback(proxy((status) => {
|
|
97
|
+
this._loginUIStatus.next(status);
|
|
98
|
+
}));
|
|
99
|
+
yield this._proxy.addLoginStatusCallback(proxy((status) => {
|
|
100
|
+
this._loginStatus.next(status);
|
|
101
|
+
}));
|
|
102
|
+
}
|
|
60
103
|
this._initialized = true;
|
|
61
104
|
});
|
|
62
105
|
}
|
|
@@ -85,7 +128,13 @@ export class AuthHelper {
|
|
|
85
128
|
if (!this._initialized) {
|
|
86
129
|
yield this._init();
|
|
87
130
|
}
|
|
88
|
-
|
|
131
|
+
const result = yield this._proxy.login();
|
|
132
|
+
if (this._protocolVersion < 2) {
|
|
133
|
+
this._loginStatus.next({
|
|
134
|
+
authData: result,
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
return result;
|
|
89
138
|
});
|
|
90
139
|
}
|
|
91
140
|
/**
|
|
@@ -97,10 +146,19 @@ export class AuthHelper {
|
|
|
97
146
|
if (!hasValue(this._origin)) {
|
|
98
147
|
return null;
|
|
99
148
|
}
|
|
149
|
+
this._loginStatus.next({
|
|
150
|
+
isLoggingIn: true,
|
|
151
|
+
});
|
|
100
152
|
if (!this._initialized) {
|
|
101
153
|
yield this._init();
|
|
102
154
|
}
|
|
103
|
-
|
|
155
|
+
const result = yield this._proxy.login(true);
|
|
156
|
+
if (this._protocolVersion < 2) {
|
|
157
|
+
this._loginStatus.next({
|
|
158
|
+
authData: result,
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
return result;
|
|
104
162
|
});
|
|
105
163
|
}
|
|
106
164
|
createPublicRecordKey(recordName) {
|
|
@@ -129,5 +187,61 @@ export class AuthHelper {
|
|
|
129
187
|
return yield this._proxy.getAuthToken();
|
|
130
188
|
});
|
|
131
189
|
}
|
|
190
|
+
openAccountPage() {
|
|
191
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
192
|
+
if (!hasValue(this._origin)) {
|
|
193
|
+
return;
|
|
194
|
+
}
|
|
195
|
+
if (!this._initialized) {
|
|
196
|
+
yield this._init();
|
|
197
|
+
}
|
|
198
|
+
if (this._protocolVersion < 2) {
|
|
199
|
+
return;
|
|
200
|
+
}
|
|
201
|
+
return yield this._proxy.openAccountPage();
|
|
202
|
+
});
|
|
203
|
+
}
|
|
204
|
+
setUseCustomUI(useCustomUI) {
|
|
205
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
206
|
+
if (!hasValue(this._origin)) {
|
|
207
|
+
return;
|
|
208
|
+
}
|
|
209
|
+
if (!this._initialized) {
|
|
210
|
+
yield this._init();
|
|
211
|
+
}
|
|
212
|
+
if (this._protocolVersion < 2) {
|
|
213
|
+
return;
|
|
214
|
+
}
|
|
215
|
+
return yield this._proxy.setUseCustomUI(useCustomUI);
|
|
216
|
+
});
|
|
217
|
+
}
|
|
218
|
+
provideEmailAddress(email, acceptedTermsOfService) {
|
|
219
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
220
|
+
if (!hasValue(this._origin)) {
|
|
221
|
+
return;
|
|
222
|
+
}
|
|
223
|
+
if (!this._initialized) {
|
|
224
|
+
yield this._init();
|
|
225
|
+
}
|
|
226
|
+
if (this._protocolVersion < 2) {
|
|
227
|
+
return;
|
|
228
|
+
}
|
|
229
|
+
return yield this._proxy.provideEmailAddress(email, acceptedTermsOfService);
|
|
230
|
+
});
|
|
231
|
+
}
|
|
232
|
+
cancelLogin() {
|
|
233
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
234
|
+
if (!hasValue(this._origin)) {
|
|
235
|
+
return;
|
|
236
|
+
}
|
|
237
|
+
if (!this._initialized) {
|
|
238
|
+
yield this._init();
|
|
239
|
+
}
|
|
240
|
+
if (this._protocolVersion < 2) {
|
|
241
|
+
return;
|
|
242
|
+
}
|
|
243
|
+
return yield this._proxy.cancelLogin();
|
|
244
|
+
});
|
|
245
|
+
}
|
|
132
246
|
}
|
|
133
247
|
//# sourceMappingURL=AuthHelper.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AuthHelper.js","sourceRoot":"","sources":["AuthHelper.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,IAAI,
|
|
1
|
+
{"version":3,"file":"AuthHelper.js","sourceRoot":"","sources":["AuthHelper.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,IAAI,EAAE,KAAK,EAA4C,MAAM,SAAS,CAAC;AAOhF,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAClE,OAAO,EAAE,eAAe,EAAuB,YAAY,EAAE,MAAM,MAAM,CAAC;AAC1E,OAAO,EAAY,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAGnE,2DAA2D;AAC3D,MAAM,KAAK,GAAG,OAAO,QAAQ,KAAK,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC;AAMvE;;GAEG;AACH,MAAM,OAAO,UAAU;IAgBnB;;;OAGG;IACH,YAAY,YAAqB;QAfzB,iBAAY,GAAY,KAAK,CAAC;QAC9B,qBAAgB,GAAW,CAAC,CAAC;QAC7B,SAAI,GAAiB,IAAI,YAAY,EAAE,CAAC;QACxC,iBAAY,GAChB,IAAI,eAAe,CAAc,EAAE,CAAC,CAAC;QACjC,mBAAc,GAClB,IAAI,eAAe,CAAgB;YAC/B,IAAI,EAAE,KAAK;SACd,CAAC,CAAC;QAQH,IAAI,CAAC,OAAO,GAAG,YAAY,CAAC;IAChC,CAAC;IAED,IAAI,WAAW;QACX,OAAO,IAAI,CAAC,YAAY,CAAC;IAC7B,CAAC;IAED,IAAI,aAAa;QACb,OAAO,IAAI,CAAC,cAAc,CAAC;IAC/B,CAAC;IAED;;OAEG;IACH,IAAI,sBAAsB;QACtB,OAAO,QAA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CAAC,WAAW,CAAC,CAAC;QACzD,CAAC;KAAA;IAEK,mBAAmB,CAAC,KAAa,EAAE,sBAA+B;;YACpE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE;gBACzB,OAAO;aACV;YACD,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE;gBACpB,MAAM,IAAI,CAAC,KAAK,EAAE,CAAC;aACtB;YACD,IAAI,IAAI,CAAC,gBAAgB,GAAG,CAAC,EAAE;gBAC3B,OAAO;aACV;YACD,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,mBAAmB,CACxC,KAAK,EACL,sBAAsB,CACzB,CAAC;QACN,CAAC;KAAA;IAEK,WAAW;;YACb,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE;gBACzB,OAAO;aACV;YACD,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE;gBACpB,MAAM,IAAI,CAAC,KAAK,EAAE,CAAC;aACtB;YACD,IAAI,IAAI,CAAC,gBAAgB,GAAG,CAAC,EAAE;gBAC3B,OAAO;aACV;YACD,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC;QAC3C,CAAC;KAAA;CACJ"}
|
package/managers/BotManager.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Bot, BotTags } from '@casual-simulation/aux-common';
|
|
2
|
-
import { AuxUser, BaseSimulation, LoginManager, AuxConfig } from '@casual-simulation/aux-vm';
|
|
2
|
+
import { AuxUser, AuxVM, BaseSimulation, LoginManager, AuxConfig, RecordsManager } from '@casual-simulation/aux-vm';
|
|
3
3
|
import { BotPanelManager } from './BotPanelManager';
|
|
4
4
|
import { BrowserSimulation } from './BrowserSimulation';
|
|
5
5
|
import { PortalManager, ProgressManager } from '@casual-simulation/aux-vm';
|
|
@@ -30,10 +30,11 @@ export declare class BotManager extends BaseSimulation implements BrowserSimulat
|
|
|
30
30
|
get login(): LoginManager;
|
|
31
31
|
get progress(): ProgressManager;
|
|
32
32
|
get auth(): AuthHelper;
|
|
33
|
+
get records(): RecordsManager;
|
|
33
34
|
get consoleMessages(): Observable<ConsoleMessages>;
|
|
34
35
|
get portals(): PortalManager;
|
|
35
|
-
constructor(user: AuxUser, id: string, config: AuxConfig['config'], defaultHost?: string);
|
|
36
|
+
constructor(user: AuxUser, id: string, config: AuxConfig['config'], defaultHost?: string, createVm?: (user: AuxUser, config: AuxConfig) => AuxVM);
|
|
36
37
|
editBot(bot: Bot | BotTags, tag: string, value: any, space?: string): Promise<void>;
|
|
37
|
-
protected
|
|
38
|
+
protected _beforeVmInit(): void;
|
|
38
39
|
}
|
|
39
40
|
//# sourceMappingURL=BotManager.d.ts.map
|
package/managers/BotManager.js
CHANGED
|
@@ -11,7 +11,7 @@ import { parseSimulationId, createBot, TEMPORARY_BOT_PARTITION_ID, COOKIE_BOT_PA
|
|
|
11
11
|
import { BaseSimulation, LoginManager, RecordsManager, } from '@casual-simulation/aux-vm';
|
|
12
12
|
import { BotPanelManager } from './BotPanelManager';
|
|
13
13
|
import { AuxVMImpl } from '../vm/AuxVMImpl';
|
|
14
|
-
import { PortalManager, ProgressManager
|
|
14
|
+
import { PortalManager, ProgressManager } from '@casual-simulation/aux-vm';
|
|
15
15
|
import { filter, tap } from 'rxjs/operators';
|
|
16
16
|
import { getFinalUrl } from '@casual-simulation/aux-vm-client';
|
|
17
17
|
import { LocalStoragePartitionImpl } from '../partitions/LocalStoragePartition';
|
|
@@ -24,20 +24,22 @@ import { SystemPortalManager } from './SystemPortalManager';
|
|
|
24
24
|
* to reactively edit bots.
|
|
25
25
|
*/
|
|
26
26
|
export class BotManager extends BaseSimulation {
|
|
27
|
-
constructor(user, id, config, defaultHost = location.origin) {
|
|
28
|
-
super(id, config, createPartitions(), (config) =>
|
|
27
|
+
constructor(user, id, config, defaultHost = location.origin, createVm = (user, config) => new AuxVMImpl(user, config)) {
|
|
28
|
+
super(id, config, createPartitions(), (config) => createVm(user, config));
|
|
29
29
|
this.helper.userId = user ? user.id : null;
|
|
30
30
|
this._authHelper = new AuthHelper(config.authOrigin);
|
|
31
31
|
this._login = new LoginManager(this._vm);
|
|
32
32
|
this._progress = new ProgressManager(this._vm);
|
|
33
33
|
function createPartitions() {
|
|
34
|
+
var _a;
|
|
34
35
|
const parsedId = parseSimulationId(id);
|
|
35
36
|
const host = getFinalUrl(defaultHost, parsedId.host);
|
|
36
37
|
const causalRepoHost = getFinalUrl(config.causalRepoConnectionUrl || defaultHost, parsedId.host);
|
|
37
38
|
const protocol = config.causalRepoConnectionProtocol;
|
|
38
39
|
const versions = config.sharedPartitionsVersion;
|
|
39
40
|
const isV2 = versions === 'v2';
|
|
40
|
-
|
|
41
|
+
const isCollaborative = !!((_a = config.device) === null || _a === void 0 ? void 0 : _a.isCollaborative);
|
|
42
|
+
if (!isCollaborative) {
|
|
41
43
|
console.log('[BotManager] Disabling Collaboration Features');
|
|
42
44
|
}
|
|
43
45
|
else {
|
|
@@ -48,7 +50,7 @@ export class BotManager extends BaseSimulation {
|
|
|
48
50
|
let partitions = {
|
|
49
51
|
// Use a memory partition instead of a shared partition
|
|
50
52
|
// when collaboration is disabled.
|
|
51
|
-
shared:
|
|
53
|
+
shared: isCollaborative
|
|
52
54
|
? isV2
|
|
53
55
|
? {
|
|
54
56
|
type: 'remote_yjs',
|
|
@@ -83,7 +85,7 @@ export class BotManager extends BaseSimulation {
|
|
|
83
85
|
}),
|
|
84
86
|
},
|
|
85
87
|
},
|
|
86
|
-
[TEMPORARY_SHARED_PARTITION_ID]:
|
|
88
|
+
[TEMPORARY_SHARED_PARTITION_ID]: isCollaborative
|
|
87
89
|
? isV2
|
|
88
90
|
? {
|
|
89
91
|
type: 'remote_yjs',
|
|
@@ -105,8 +107,7 @@ export class BotManager extends BaseSimulation {
|
|
|
105
107
|
type: 'memory',
|
|
106
108
|
initialState: {},
|
|
107
109
|
},
|
|
108
|
-
[REMOTE_TEMPORARY_SHARED_PARTITION_ID]:
|
|
109
|
-
.isCollaborative
|
|
110
|
+
[REMOTE_TEMPORARY_SHARED_PARTITION_ID]: isCollaborative
|
|
110
111
|
? {
|
|
111
112
|
type: 'other_players_repo',
|
|
112
113
|
branch: parsedId.channel,
|
|
@@ -125,10 +126,10 @@ export class BotManager extends BaseSimulation {
|
|
|
125
126
|
private: true,
|
|
126
127
|
},
|
|
127
128
|
};
|
|
128
|
-
// Enable the admin partition and error partition when using the
|
|
129
|
+
// Enable the admin partition and error partition when using the websocket protocol.
|
|
129
130
|
if (!config.causalRepoConnectionProtocol ||
|
|
130
|
-
config.causalRepoConnectionProtocol === '
|
|
131
|
-
partitions[ADMIN_PARTITION_ID] =
|
|
131
|
+
config.causalRepoConnectionProtocol === 'websocket') {
|
|
132
|
+
partitions[ADMIN_PARTITION_ID] = isCollaborative
|
|
132
133
|
? {
|
|
133
134
|
type: 'remote_causal_repo',
|
|
134
135
|
branch: ADMIN_BRANCH_NAME,
|
|
@@ -163,6 +164,9 @@ export class BotManager extends BaseSimulation {
|
|
|
163
164
|
get auth() {
|
|
164
165
|
return this._authHelper;
|
|
165
166
|
}
|
|
167
|
+
get records() {
|
|
168
|
+
return this._recordsManager;
|
|
169
|
+
}
|
|
166
170
|
get consoleMessages() {
|
|
167
171
|
return (this._vm.connectionStateChanged.pipe(filter((m) => m.type === 'log' ||
|
|
168
172
|
m.type === 'error' ||
|
|
@@ -182,24 +186,20 @@ export class BotManager extends BaseSimulation {
|
|
|
182
186
|
}
|
|
183
187
|
});
|
|
184
188
|
}
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
this.
|
|
198
|
-
|
|
199
|
-
this._subscriptions.push(this._vm.localEvents
|
|
200
|
-
.pipe(tap((e) => this._recordsManager.handleEvents(e)))
|
|
201
|
-
.subscribe());
|
|
202
|
-
});
|
|
189
|
+
_beforeVmInit() {
|
|
190
|
+
super._beforeVmInit();
|
|
191
|
+
this._portals = new PortalManager(this._vm);
|
|
192
|
+
this._botPanel = new BotPanelManager(this._watcher, this._helper);
|
|
193
|
+
this._idePortal = new IdePortalManager(this._watcher, this.helper);
|
|
194
|
+
this._systemPortal = new SystemPortalManager(this._watcher, this.helper);
|
|
195
|
+
this._recordsManager = new RecordsManager(this._config, this._helper, this._authHelper);
|
|
196
|
+
this._subscriptions.push(this._portals);
|
|
197
|
+
this._subscriptions.push(this._botPanel);
|
|
198
|
+
this._subscriptions.push(this._idePortal);
|
|
199
|
+
this._subscriptions.push(this._systemPortal);
|
|
200
|
+
this._subscriptions.push(this._vm.localEvents
|
|
201
|
+
.pipe(tap((e) => this._recordsManager.handleEvents(e)))
|
|
202
|
+
.subscribe());
|
|
203
203
|
}
|
|
204
204
|
}
|
|
205
205
|
//# sourceMappingURL=BotManager.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BotManager.js","sourceRoot":"","sources":["BotManager.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAGH,iBAAiB,EACjB,SAAS,EAIT,0BAA0B,EAC1B,uBAAuB,EAIvB,KAAK,EAEL,kBAAkB,EAClB,iBAAiB,EACjB,6BAA6B,EAC7B,oCAAoC,EACpC,sBAAsB,EACtB,mBAAmB,EACnB,uBAAuB,GAC1B,MAAM,+BAA+B,CAAC;AAEvC,OAAO,EAGH,cAAc,EACd,YAAY,EAIZ,cAAc,GACjB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,
|
|
1
|
+
{"version":3,"file":"BotManager.js","sourceRoot":"","sources":["BotManager.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAGH,iBAAiB,EACjB,SAAS,EAIT,0BAA0B,EAC1B,uBAAuB,E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CAAC;QAClE,IAAI,CAAC,UAAU,GAAG,IAAI,gBAAgB,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;QACnE,IAAI,CAAC,aAAa,GAAG,IAAI,mBAAmB,CACxC,IAAI,CAAC,QAAQ,EACb,IAAI,CAAC,MAAM,CACd,CAAC;QACF,IAAI,CAAC,eAAe,GAAG,IAAI,cAAc,CACrC,IAAI,CAAC,OAAO,EACZ,IAAI,CAAC,OAAO,EACZ,IAAI,CAAC,WAAW,CACnB,CAAC;QAEF,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACxC,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QACzC,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAC1C,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;QAC7C,IAAI,CAAC,cAAc,CAAC,IAAI,CACpB,IAAI,CAAC,GAAG,CAAC,WAAW;aACf,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,eAAe,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC;aACtD,SAAS,EAAE,CACnB,CAAC;IACN,CAAC;CACJ"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BotPanelManager } from './BotPanelManager';
|
|
2
|
-
import { ProgressManager } from '@casual-simulation/aux-vm';
|
|
2
|
+
import { ProgressManager, RecordsManager } from '@casual-simulation/aux-vm';
|
|
3
3
|
import { RemoteSimulation } from '@casual-simulation/aux-vm-client';
|
|
4
4
|
import { ConsoleMessages } from '@casual-simulation/causal-trees';
|
|
5
5
|
import { Bot } from '@casual-simulation/aux-common';
|
|
@@ -35,6 +35,10 @@ export interface BrowserSimulation extends RemoteSimulation {
|
|
|
35
35
|
* The observable list of console messages from the simulation.
|
|
36
36
|
*/
|
|
37
37
|
consoleMessages: Observable<ConsoleMessages>;
|
|
38
|
+
/**
|
|
39
|
+
* Gets the records manager.
|
|
40
|
+
*/
|
|
41
|
+
records: RecordsManager;
|
|
38
42
|
/**
|
|
39
43
|
* Edits the given bot and tag as if the user edited it manually.
|
|
40
44
|
* This means adding the correct recent bot record in addition to actually updating the bot.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@casual-simulation/aux-vm-browser",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.32",
|
|
4
4
|
"description": "A set of utilities required to securely run an AUX in a web browser.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"aux"
|
|
@@ -41,19 +41,17 @@
|
|
|
41
41
|
"url": "https://github.com/casual-simulation/casualos/issues"
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@casual-simulation/aux-common": "^2.0.
|
|
45
|
-
"@casual-simulation/aux-records": "^2.0.
|
|
46
|
-
"@casual-simulation/aux-vm": "^2.0.
|
|
47
|
-
"@casual-simulation/aux-vm-client": "^2.0.
|
|
48
|
-
"@casual-simulation/causal-tree-client-socketio": "^2.0.22",
|
|
44
|
+
"@casual-simulation/aux-common": "^2.0.32",
|
|
45
|
+
"@casual-simulation/aux-records": "^2.0.31",
|
|
46
|
+
"@casual-simulation/aux-vm": "^2.0.32",
|
|
47
|
+
"@casual-simulation/aux-vm-client": "^2.0.32",
|
|
49
48
|
"@casual-simulation/causal-trees": "^2.0.22",
|
|
50
49
|
"@casual-simulation/crypto": "^2.0.22",
|
|
51
50
|
"@casual-simulation/crypto-browser": "^2.0.22",
|
|
52
51
|
"comlink": "^4.0.1",
|
|
53
52
|
"lodash": "4.17.21",
|
|
54
53
|
"rxjs": "^6.5.2",
|
|
55
|
-
"socket.io-client": "2.1.1",
|
|
56
54
|
"uuid": "^8.3.2"
|
|
57
55
|
},
|
|
58
|
-
"gitHead": "
|
|
56
|
+
"gitHead": "9e5eae64b6c00a3787eed045b72a4eaf1fac157c"
|
|
59
57
|
}
|