casualos 3.3.0-alpha.8545776335

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/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Casual Simulation, Inc.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,118 @@
1
+ # CasualOS CLI
2
+
3
+ [![npm (scoped)](https://img.shields.io/npm/v/casualos.svg)](https://www.npmjs.com/package/casualos)
4
+
5
+ ## Installation
6
+
7
+ Install to your global package directory:
8
+
9
+ ```bash
10
+ $ npm install -g casualos
11
+ ```
12
+
13
+ Or, execute directly from NPM:
14
+
15
+ ```bash
16
+ $ npx casualos
17
+ ```
18
+
19
+ ## Usage
20
+
21
+ ```
22
+ Usage: casualos [options] [command]
23
+
24
+ A CLI for CasualOS
25
+
26
+ Options:
27
+ -V, --version output the version number
28
+ -e, --endpoint <url> The endpoint to use for queries. Can be used to override the current endpoint.
29
+ -h, --help display help for command
30
+
31
+ Commands:
32
+ login Login to the CasualOS API
33
+ logout Logout of the CasualOS API
34
+ set-endpoint [endpoint] Set the endpoint that is currently in use.
35
+ status Get the status of the current session.
36
+ query [options] [procedure] [input] Query the CasualOS API
37
+ repl [options] Start a REPL for the CasualOS API
38
+ help [command] display help for command
39
+ ```
40
+
41
+ ### Commands
42
+
43
+ #### `login`
44
+
45
+ ```
46
+ $ casualos help login
47
+
48
+ Usage: casualos login [options]
49
+
50
+ Login to the CasualOS API
51
+
52
+ Options:
53
+ -h, --help display help for command
54
+ ```
55
+
56
+ #### `logout`
57
+
58
+ ```
59
+ $ casualos help logout
60
+
61
+ Usage: casualos logout [options]
62
+
63
+ Logout of the CasualOS API
64
+
65
+ Options:
66
+ -h, --help display help for command
67
+ ```
68
+
69
+ #### `set-endpoint`
70
+
71
+ ```
72
+ $ casualos help set-endpoint
73
+
74
+ Usage: casualos set-endpoint [options] [endpoint]
75
+
76
+ Set the endpoint that is currently in use.
77
+
78
+ Arguments:
79
+ endpoint The endpoint to use for queries. If omitted, then you will be prompted to enter an endpoint.
80
+
81
+ Options:
82
+ -h, --help display help for command
83
+ ```
84
+
85
+ #### `query`
86
+
87
+ ```
88
+ $ casualos help query
89
+
90
+ Usage: casualos query [options] [procedure] [input]
91
+
92
+ Query the CasualOS API
93
+
94
+ Arguments:
95
+ procedure The procedure to execute. If omitted, then you will be prompted to select a procedure.
96
+ input The input to the procedure. If specified, then it will be parsed as JSON. If omitted, then you will be prompted to enter the input.
97
+
98
+ Options:
99
+ -k, --key <key> The session key to use for the query. If not specified, then the current session key will be used.
100
+ -h, --help display help for command
101
+ ```
102
+
103
+ #### `repl`
104
+
105
+ ```
106
+ $ casualos help repl
107
+
108
+ Usage: casualos repl [options]
109
+
110
+ Start a REPL for the CasualOS API
111
+
112
+ Options:
113
+ -k, --key <key> The session key to use for the session. If omitted, then the current session key will be used.
114
+ -h, --help display help for command
115
+
116
+ The CasualOS REPL allows you to interact with the CasualOS API using a Read-Eval-Print Loop (REPL).
117
+ It supports JavaScript and has a special function, query([procedure], [input]), that can be used to query the API.
118
+ ```
package/cli.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=cli.d.ts.map
package/cli.js ADDED
@@ -0,0 +1,496 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ import prompts from 'prompts';
11
+ import { Command } from 'commander';
12
+ import { createRecordsClient, } from '@casual-simulation/aux-records/RecordsClient';
13
+ import { askForInputs } from './schema';
14
+ import repl from 'node:repl';
15
+ // @ts-ignore
16
+ import Conf from 'conf';
17
+ import { parseSessionKey } from '@casual-simulation/aux-records/AuthUtils';
18
+ import { PassThrough } from 'node:stream';
19
+ const REFRESH_LIFETIME_MS = 1000 * 60 * 60 * 24 * 7; // 1 week
20
+ const config = new Conf({
21
+ projectName: 'casualos-cli',
22
+ });
23
+ const program = new Command();
24
+ program
25
+ .name('casualos')
26
+ .description('A CLI for CasualOS')
27
+ .version('0.0.1')
28
+ .option('-e, --endpoint <url>', 'The endpoint to use for queries. Can be used to override the current endpoint.');
29
+ program
30
+ .command('login')
31
+ .description('Login to the CasualOS API')
32
+ .action(() => __awaiter(void 0, void 0, void 0, function* () {
33
+ const opts = program.optsWithGlobals();
34
+ const endpoint = yield getEndpoint(opts.endpoint);
35
+ const client = yield getClient(endpoint, getSessionKey(endpoint));
36
+ yield login(client);
37
+ }));
38
+ program
39
+ .command('logout')
40
+ .description('Logout of the CasualOS API')
41
+ .action(() => __awaiter(void 0, void 0, void 0, function* () {
42
+ const opts = program.optsWithGlobals();
43
+ const endpoint = yield getEndpoint(opts.endpoint);
44
+ saveSessionKey(endpoint, null);
45
+ console.log('Logged out!');
46
+ }));
47
+ program
48
+ .command('set-endpoint')
49
+ .argument('[endpoint]', 'The endpoint to use for queries. If omitted, then you will be prompted to enter an endpoint.')
50
+ .description('Set the endpoint that is currently in use.')
51
+ .action((endpoint) => __awaiter(void 0, void 0, void 0, function* () {
52
+ if (endpoint) {
53
+ saveCurrentEndpoint(endpoint);
54
+ }
55
+ else {
56
+ yield updateEndpoint();
57
+ }
58
+ }));
59
+ program
60
+ .command('status')
61
+ .description('Get the status of the current session.')
62
+ .action(() => __awaiter(void 0, void 0, void 0, function* () {
63
+ const endpoint = getCurrentEndpoint();
64
+ printStatus(endpoint);
65
+ }));
66
+ program
67
+ .command('query')
68
+ .description('Query the CasualOS API')
69
+ .argument('[procedure]', 'The procedure to execute. If omitted, then you will be prompted to select a procedure.')
70
+ .argument('[input]', 'The input to the procedure. If specified, then it will be parsed as JSON. If omitted, then you will be prompted to enter the input.')
71
+ .option('-k, --key <key>', 'The session key to use for the query. If not specified, then the current session key will be used.')
72
+ .action((procedure, input, options) => __awaiter(void 0, void 0, void 0, function* () {
73
+ var _a;
74
+ const opts = program.optsWithGlobals();
75
+ const endpoint = yield getEndpoint(opts.endpoint);
76
+ const client = yield getClient(endpoint, (_a = opts.key) !== null && _a !== void 0 ? _a : (yield getOrRefreshSessionKey(endpoint)));
77
+ yield query(client, procedure, input);
78
+ }));
79
+ program
80
+ .command('repl')
81
+ .description('Start a REPL for the CasualOS API')
82
+ .option('-k, --key <key>', 'The session key to use for the session. If omitted, then the current session key will be used.')
83
+ .addHelpText('after', `\nThe CasualOS REPL allows you to interact with the CasualOS API using a Read-Eval-Print Loop (REPL).\nIt supports JavaScript and has a special function, query([procedure], [input]), that can be used to query the API.`)
84
+ .action((options) => __awaiter(void 0, void 0, void 0, function* () {
85
+ var _b;
86
+ const opts = program.optsWithGlobals();
87
+ const endpoint = yield getEndpoint(opts.endpoint);
88
+ const client = yield getClient(endpoint, (_b = opts.key) !== null && _b !== void 0 ? _b : (yield getOrRefreshSessionKey(endpoint)));
89
+ const replIn = new PassThrough();
90
+ process.stdin.pipe(replIn);
91
+ function pauseRepl(func) {
92
+ return (...args) => __awaiter(this, void 0, void 0, function* () {
93
+ process.stdin.unpipe(replIn);
94
+ replIn.pause();
95
+ try {
96
+ return yield func(...args);
97
+ }
98
+ finally {
99
+ replIn.resume();
100
+ process.stdin.pipe(replIn);
101
+ }
102
+ });
103
+ }
104
+ const replServer = repl.start({
105
+ prompt: 'casualos > ',
106
+ input: replIn,
107
+ output: process.stdout,
108
+ });
109
+ replServer.on('exit', () => {
110
+ process.stdin.unpipe(replIn);
111
+ });
112
+ replServer.defineCommand('login', {
113
+ help: 'Login to the CasualOS API',
114
+ action(cmd) {
115
+ console.log('command: ', cmd);
116
+ const _this = this;
117
+ function loginImpl() {
118
+ return __awaiter(this, void 0, void 0, function* () {
119
+ try {
120
+ _this.pause();
121
+ yield login(client);
122
+ }
123
+ finally {
124
+ _this.resume();
125
+ _this.displayPrompt();
126
+ }
127
+ });
128
+ }
129
+ loginImpl();
130
+ },
131
+ });
132
+ Object.defineProperties(replServer.context, {
133
+ query: {
134
+ configurable: false,
135
+ writable: false,
136
+ enumerable: true,
137
+ value: pauseRepl((procedure, input) => __awaiter(void 0, void 0, void 0, function* () {
138
+ return yield query(client, procedure, input, false, true);
139
+ })),
140
+ },
141
+ });
142
+ }));
143
+ function query(client, procedure, input, shouldConfirm = true, isJavaScriptInput = false) {
144
+ return __awaiter(this, void 0, void 0, function* () {
145
+ const availableOperations = yield client.listProcedures({});
146
+ if (!procedure) {
147
+ const response = yield prompts({
148
+ type: 'select',
149
+ name: 'procedure',
150
+ message: 'Select the procedure to execute',
151
+ choices: availableOperations.procedures.map((op) => ({
152
+ title: op.name,
153
+ value: op.name,
154
+ })),
155
+ });
156
+ procedure = response.procedure;
157
+ }
158
+ const operation = availableOperations.procedures.find((p) => p.name === procedure);
159
+ if (!operation) {
160
+ console.error(`Could not find operation ${procedure}!`);
161
+ return;
162
+ }
163
+ console.log('Your selected operation:', operation);
164
+ if (!input) {
165
+ input = yield askForInputs(operation.inputs, operation.name);
166
+ }
167
+ else if (!isJavaScriptInput) {
168
+ input = JSON.parse(input);
169
+ }
170
+ console.log('Your input:', input);
171
+ let continueRequest = true;
172
+ if (shouldConfirm) {
173
+ const confirm = yield prompts({
174
+ type: 'confirm',
175
+ name: 'continue',
176
+ message: 'Do you want to continue?',
177
+ initial: true,
178
+ });
179
+ continueRequest = confirm.continue;
180
+ }
181
+ if (continueRequest) {
182
+ const result = yield callProcedure(client, operation.name, input);
183
+ if (shouldConfirm) {
184
+ console.log('Result:', result);
185
+ }
186
+ return result;
187
+ }
188
+ else {
189
+ console.log('Cancelled.');
190
+ }
191
+ });
192
+ }
193
+ function callProcedure(client, operation, input) {
194
+ return __awaiter(this, void 0, void 0, function* () {
195
+ while (true) {
196
+ const result = yield client.callProcedure(operation, input, {
197
+ headers: getHeaders(client),
198
+ });
199
+ if (result.success === false && result.errorCode === 'not_logged_in') {
200
+ const loginResponse = yield prompts({
201
+ type: 'confirm',
202
+ name: 'login',
203
+ message: 'You are not logged in. Do you want to log in and try again?',
204
+ initial: true,
205
+ });
206
+ if (loginResponse.login) {
207
+ const key = yield login(client);
208
+ if (!key) {
209
+ return result;
210
+ }
211
+ }
212
+ else {
213
+ return result;
214
+ }
215
+ }
216
+ else {
217
+ return result;
218
+ }
219
+ }
220
+ });
221
+ }
222
+ function getClient(endpoint, key) {
223
+ return __awaiter(this, void 0, void 0, function* () {
224
+ printStatus(endpoint);
225
+ const client = createRecordsClient(endpoint);
226
+ if (key) {
227
+ client.sessionKey = key;
228
+ }
229
+ return client;
230
+ });
231
+ }
232
+ function getOrRefreshSessionKey(endpoint) {
233
+ return __awaiter(this, void 0, void 0, function* () {
234
+ const key = getSessionKey(endpoint);
235
+ if (isExpired(key)) {
236
+ return null;
237
+ }
238
+ else if (willExpire(key)) {
239
+ return yield replaceSessionKey(endpoint, key);
240
+ }
241
+ return key;
242
+ });
243
+ }
244
+ function getSessionKey(endpoint) {
245
+ return convertToString(config.get(`${endpoint}:sessionKey`));
246
+ }
247
+ function saveSessionKey(endpoint, key) {
248
+ config.set(`${endpoint}:sessionKey`, key);
249
+ }
250
+ function saveLoginResult(client, result) {
251
+ if (!result) {
252
+ saveSessionKey(client.endpoint, null);
253
+ client.sessionKey = null;
254
+ }
255
+ else {
256
+ saveSessionKey(client.endpoint, result.sessionKey);
257
+ client.sessionKey = result.sessionKey;
258
+ }
259
+ }
260
+ function getExpiration(key) {
261
+ const parsed = parseSessionKey(key);
262
+ if (!parsed) {
263
+ return 0;
264
+ }
265
+ const [userId, sessionId, secret, expireTimeMs] = parsed;
266
+ return expireTimeMs;
267
+ }
268
+ function isExpired(key) {
269
+ const expireTimeMs = getExpiration(key);
270
+ return expireTimeMs < Date.now();
271
+ }
272
+ function willExpire(key) {
273
+ const expireTimeMs = getExpiration(key);
274
+ const lifetimeMs = expireTimeMs - Date.now();
275
+ const refreshTimeMs = Math.max(lifetimeMs - REFRESH_LIFETIME_MS, 0);
276
+ return refreshTimeMs < 0;
277
+ }
278
+ function login(client) {
279
+ return __awaiter(this, void 0, void 0, function* () {
280
+ const response = yield prompts([
281
+ {
282
+ type: 'select',
283
+ name: 'type',
284
+ message: 'Select the type of address to use for login.',
285
+ choices: [
286
+ {
287
+ title: 'Email',
288
+ value: 'email',
289
+ },
290
+ {
291
+ title: 'Phone',
292
+ value: 'phone',
293
+ },
294
+ {
295
+ title: 'Privo',
296
+ value: 'privo',
297
+ },
298
+ ],
299
+ },
300
+ ]);
301
+ if (response.type === 'privo') {
302
+ return yield loginWithPrivo(client);
303
+ }
304
+ else if (response.type === 'email' || response.type === 'phone') {
305
+ const addressResponse = yield prompts({
306
+ type: 'text',
307
+ name: 'address',
308
+ message: 'Enter your address.',
309
+ });
310
+ const addressType = response.type;
311
+ const address = addressResponse.address;
312
+ return yield loginWithCode(client, address, addressType);
313
+ }
314
+ });
315
+ }
316
+ function loginWithCode(client, address, addressType) {
317
+ return __awaiter(this, void 0, void 0, function* () {
318
+ const result = yield client.requestLogin({
319
+ address: address,
320
+ addressType: addressType,
321
+ }, {
322
+ headers: getHeaders(client),
323
+ });
324
+ if (result.success) {
325
+ const response = yield prompts({
326
+ type: 'text',
327
+ name: 'code',
328
+ message: 'Enter the code that was sent to your address.',
329
+ });
330
+ const code = response.code;
331
+ const loginResult = yield client.completeLogin({
332
+ code: code,
333
+ requestId: result.requestId,
334
+ userId: result.userId,
335
+ }, {
336
+ headers: getHeaders(client),
337
+ });
338
+ if (loginResult.success === true) {
339
+ saveLoginResult(client, loginResult);
340
+ console.log('Login successful!');
341
+ return loginResult.sessionKey;
342
+ }
343
+ else {
344
+ saveLoginResult(client, null);
345
+ console.log('Failed to complete login:');
346
+ console.log(loginResult);
347
+ return null;
348
+ }
349
+ }
350
+ else {
351
+ saveLoginResult(client, null);
352
+ console.log('Failed to create login request:');
353
+ console.log(result);
354
+ return null;
355
+ }
356
+ });
357
+ }
358
+ function loginWithPrivo(client) {
359
+ return __awaiter(this, void 0, void 0, function* () {
360
+ const result = yield client.requestPrivoLogin({}, {
361
+ headers: getHeaders(client),
362
+ });
363
+ if (result.success === false) {
364
+ saveLoginResult(client, null);
365
+ console.log('Failed to request Privo login:');
366
+ console.log(result);
367
+ return null;
368
+ }
369
+ const open = (yield import('open')).default;
370
+ yield open(result.authorizationUrl);
371
+ const startTime = Date.now();
372
+ const timeout = 1000 * 60 * 5; // 5 minutes
373
+ while (Date.now() - startTime < timeout) {
374
+ const loginResult = yield client.completeOAuthLogin({
375
+ requestId: result.requestId,
376
+ }, {
377
+ headers: getHeaders(client),
378
+ });
379
+ if (loginResult.success === true) {
380
+ saveLoginResult(client, loginResult);
381
+ console.log('Login successful!');
382
+ return loginResult.sessionKey;
383
+ }
384
+ else {
385
+ if (loginResult.errorCode === 'not_completed') {
386
+ // Wait for a second before trying again.
387
+ yield new Promise((resolve) => setTimeout(resolve, 1000));
388
+ }
389
+ else {
390
+ saveLoginResult(client, null);
391
+ console.log('Failed to complete login:');
392
+ console.log(loginResult);
393
+ return null;
394
+ }
395
+ }
396
+ }
397
+ saveLoginResult(client, null);
398
+ console.log('Failed to complete login:');
399
+ console.log('Timed out');
400
+ return null;
401
+ });
402
+ }
403
+ function replaceSessionKey(endpoint, key) {
404
+ return __awaiter(this, void 0, void 0, function* () {
405
+ const client = yield getClient(endpoint, key);
406
+ const result = yield client.replaceSession(undefined, {
407
+ sessionKey: key,
408
+ });
409
+ if (result.success === true) {
410
+ saveSessionKey(endpoint, result.sessionKey);
411
+ console.log('Session key replaced!');
412
+ return result.sessionKey;
413
+ }
414
+ saveSessionKey(endpoint, null);
415
+ console.log('Failed to replace session key:');
416
+ console.log(result);
417
+ return null;
418
+ });
419
+ }
420
+ function getEndpoint(endpoint) {
421
+ return __awaiter(this, void 0, void 0, function* () {
422
+ if (endpoint) {
423
+ return endpoint;
424
+ }
425
+ let savedEndpoint = getCurrentEndpoint();
426
+ console.log('saved endpoint', savedEndpoint);
427
+ if (!savedEndpoint) {
428
+ savedEndpoint = yield updateEndpoint();
429
+ }
430
+ return savedEndpoint;
431
+ });
432
+ }
433
+ function getCurrentEndpoint() {
434
+ return convertToString(config.get('currentEndpoint'));
435
+ }
436
+ function updateEndpoint() {
437
+ return __awaiter(this, void 0, void 0, function* () {
438
+ const response = yield prompts({
439
+ type: 'text',
440
+ name: 'endpoint',
441
+ message: 'Enter the endpoint to use for queries.',
442
+ });
443
+ const savedEndpoint = response.endpoint;
444
+ saveCurrentEndpoint(savedEndpoint);
445
+ return savedEndpoint;
446
+ });
447
+ }
448
+ function saveCurrentEndpoint(endpoint) {
449
+ config.set('currentEndpoint', endpoint);
450
+ console.log('Endpoint updated to:', endpoint);
451
+ }
452
+ function getHeaders(client) {
453
+ return {
454
+ origin: client.endpoint,
455
+ };
456
+ }
457
+ function printStatus(endpoint) {
458
+ if (!endpoint) {
459
+ console.log('No endpoint is currently set.');
460
+ console.log('Set an endpoint using the set-endpoint command.');
461
+ return;
462
+ }
463
+ console.log('Current endpoint:', endpoint);
464
+ const key = getSessionKey(endpoint);
465
+ if (key) {
466
+ const expire = getExpiration(key);
467
+ if (expire < Date.now()) {
468
+ console.log('The current session has expired.');
469
+ }
470
+ else {
471
+ console.log('You are logged in.');
472
+ console.log('Session expires at:', new Date(expire).toString());
473
+ }
474
+ }
475
+ else {
476
+ console.log('You are not logged in.');
477
+ }
478
+ }
479
+ function main() {
480
+ return __awaiter(this, void 0, void 0, function* () {
481
+ try {
482
+ yield program.parseAsync(process.argv);
483
+ }
484
+ catch (err) {
485
+ console.error(err);
486
+ }
487
+ });
488
+ }
489
+ function convertToString(str) {
490
+ if (typeof str === 'undefined' || str === null) {
491
+ return str;
492
+ }
493
+ return String(str);
494
+ }
495
+ main();
496
+ //# sourceMappingURL=cli.js.map
package/cli.js.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli.js","sourceRoot":"","sources":["cli.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,OAAO,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAEH,mBAAmB,GACtB,MAAM,8CAA8C,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACxC,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,aAAa;AACb,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,eAAe,EAAE,MAAM,0CAA0C,CAAC;AAQ3E,OAAO,EAAU,WAAW,EAAY,MAAM,aAAa,CAAC;AAE5D,MAAM,mBAAmB,GAAG,IAAI,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CA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,CAAC;QAC7C,OAAO,CAAC,GAAG,CAAC,iDAAiD,CAAC,CAAC;QAC/D,OAAO;IACX,CAAC;IAED,OAAO,CAAC,GAAG,CAAC,mBAAmB,EAAE,QAAQ,CAAC,CAAC;IAE3C,MAAM,GAAG,GAAG,aAAa,CAAC,QAAQ,CAAC,CAAC;IACpC,IAAI,GAAG,EAAE,CAAC;QACN,MAAM,MAAM,GAAG,aAAa,CAAC,GAAG,CAAC,CAAC;QAClC,IAAI,MAAM,GAAG,IAAI,CAAC,GAAG,EAAE,EAAE,CAAC;YACtB,OAAO,CAAC,GAAG,CAAC,kCAAkC,CAAC,CAAC;QACpD,CAAC;aAAM,CAAC;YACJ,OAAO,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC;YAClC,OAAO,CAAC,GAAG,CAAC,qBAAqB,EAAE,IAAI,IAAI,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC;QACpE,CAAC;IACL,CAAC;SAAM,CAAC;QACJ,OAAO,CAAC,GAAG,CAAC,wBAAwB,CAAC,CAAC;IAC1C,CAAC;AACL,CAAC;AAED,SAAe,IAAI;;QACf,IAAI,CAAC;YACD,MAAM,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAC3C,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACX,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACvB,CAAC;IACL,CAAC;CAAA;AAED,SAAS,eAAe,CAAC,GAAY;IACjC,IAAI,OAAO,GAAG,KAAK,WAAW,IAAI,GAAG,KAAK,IAAI,EAAE,CAAC;QAC7C,OAAO,GAAa,CAAC;IACzB,CAAC;IACD,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC;AACvB,CAAC;AAED,IAAI,EAAE,CAAC"}
package/index.d.ts ADDED
@@ -0,0 +1,3 @@
1
+ import { RecordsClient } from '@casual-simulation/aux-records/RecordsClient';
2
+ export { RecordsClient };
3
+ //# sourceMappingURL=index.d.ts.map
package/index.js ADDED
@@ -0,0 +1,3 @@
1
+ import { RecordsClient } from '@casual-simulation/aux-records/RecordsClient';
2
+ export { RecordsClient };
3
+ //# sourceMappingURL=index.js.map
package/index.js.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,8CAA8C,CAAC;AAE7E,OAAO,EAAE,aAAa,EAAE,CAAC"}
package/package.json ADDED
@@ -0,0 +1,58 @@
1
+ {
2
+ "name": "casualos",
3
+ "version": "3.3.0-alpha.8545776335",
4
+ "description": "Common library for AUX Vue components and Misc",
5
+ "main": "./dist/index.js",
6
+ "types": "index.d.ts",
7
+ "module": "./dist/index.js",
8
+ "bin": {
9
+ "casualos": "./dist/cli.js"
10
+ },
11
+ "scripts": {
12
+ "start": "node ./dist/cli.js",
13
+ "dev": "npm run build && npm start",
14
+ "build": "node ./script/build-cli.mjs",
15
+ "test": "jest",
16
+ "test:watch": "jest --watchAll"
17
+ },
18
+ "repository": {
19
+ "type": "git",
20
+ "url": "git+https://github.com/casual-simulation/casualos.git"
21
+ },
22
+ "keywords": [
23
+ "aux",
24
+ "so4",
25
+ "realtime",
26
+ "crdt"
27
+ ],
28
+ "author": "Casual Simulation, Inc.",
29
+ "license": "MIT",
30
+ "bugs": {
31
+ "url": "https://github.com/casual-simulation/casualos/issues"
32
+ },
33
+ "homepage": "https://github.com/casual-simulation/casualos#readme",
34
+ "publishConfig": {
35
+ "access": "public"
36
+ },
37
+ "dependencies": {
38
+ "@casual-simulation/aux-common": "^3.3.0-alpha.8545776335",
39
+ "@casual-simulation/aux-records": "^3.3.0-alpha.8545776335",
40
+ "axios": "1.6.2",
41
+ "commander": "12.0.0",
42
+ "conf": "12.0.0",
43
+ "open": "10.1.0",
44
+ "prompts": "2.4.2"
45
+ },
46
+ "devDependencies": {
47
+ "@types/prompts": "^2.4.9"
48
+ },
49
+ "files": [
50
+ "/README.md",
51
+ "/LICENSE.txt",
52
+ "**/*.js",
53
+ "**/*.js.map",
54
+ "**/*.d.ts",
55
+ "**/*.def"
56
+ ],
57
+ "gitHead": "7b486be99c67a5dffcb401ebe8fa098bfa9aa7bc"
58
+ }
package/schema.d.ts ADDED
@@ -0,0 +1,3 @@
1
+ import type { SchemaMetadata } from '../aux-common';
2
+ export declare function askForInputs(inputs: SchemaMetadata, name: string): Promise<any>;
3
+ //# sourceMappingURL=schema.d.ts.map
package/schema.js ADDED
@@ -0,0 +1,213 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ import prompts from 'prompts';
11
+ export function askForInputs(inputs, name) {
12
+ var _a, _b, _c, _d;
13
+ return __awaiter(this, void 0, void 0, function* () {
14
+ if (inputs) {
15
+ if (inputs.type === 'object') {
16
+ return yield askForObjectInputs(inputs, name);
17
+ }
18
+ else if (inputs.type === 'string') {
19
+ const response = yield prompts({
20
+ type: 'text',
21
+ name: 'value',
22
+ message: `Enter a value for ${name}.`,
23
+ initial: (_a = inputs.defaultValue) !== null && _a !== void 0 ? _a : undefined,
24
+ });
25
+ return response.value || undefined;
26
+ }
27
+ else if (inputs.type === 'number') {
28
+ const response = yield prompts({
29
+ type: 'number',
30
+ name: 'value',
31
+ message: `Enter a number for ${name}.`,
32
+ initial: (_b = inputs.defaultValue) !== null && _b !== void 0 ? _b : undefined,
33
+ });
34
+ return typeof response.value === 'number'
35
+ ? response.value
36
+ : undefined;
37
+ }
38
+ else if (inputs.type === 'boolean') {
39
+ const response = yield prompts({
40
+ type: 'toggle',
41
+ name: 'value',
42
+ message: `Enable ${name}?`,
43
+ initial: (_c = inputs.defaultValue) !== null && _c !== void 0 ? _c : undefined,
44
+ active: 'yes',
45
+ inactive: 'no',
46
+ });
47
+ return typeof response.value === 'boolean'
48
+ ? response.value
49
+ : undefined;
50
+ }
51
+ else if (inputs.type === 'date') {
52
+ const response = yield prompts({
53
+ type: 'date',
54
+ name: 'value',
55
+ message: `Enter a date for ${name}.`,
56
+ initial: (_d = inputs.defaultValue) !== null && _d !== void 0 ? _d : undefined,
57
+ });
58
+ return response.value || undefined;
59
+ }
60
+ else if (inputs.type === 'literal') {
61
+ return inputs.value;
62
+ }
63
+ else if (inputs.type === 'array') {
64
+ return yield askForArrayInputs(inputs, name);
65
+ }
66
+ else if (inputs.type === 'enum') {
67
+ return yield askForEnumInputs(inputs, name);
68
+ }
69
+ else if (inputs.type === 'union') {
70
+ return yield askForUnionInputs(inputs, name);
71
+ }
72
+ }
73
+ return undefined;
74
+ });
75
+ }
76
+ function askForObjectInputs(inputs, name) {
77
+ return __awaiter(this, void 0, void 0, function* () {
78
+ const result = {};
79
+ for (let key in inputs.schema) {
80
+ const prop = inputs.schema[key];
81
+ const value = yield askForInputs(prop, `${name}.${key}`);
82
+ result[key] = value;
83
+ }
84
+ return result;
85
+ });
86
+ }
87
+ function askForArrayInputs(inputs, name) {
88
+ var _a, _b;
89
+ return __awaiter(this, void 0, void 0, function* () {
90
+ const result = [];
91
+ if (inputs.optional || inputs.nullable) {
92
+ const response = yield prompts({
93
+ type: 'confirm',
94
+ name: 'continue',
95
+ message: `Do you want to enter an array for ${name}?`,
96
+ });
97
+ if (!response.continue) {
98
+ if (inputs.nullable) {
99
+ return null;
100
+ }
101
+ else {
102
+ return undefined;
103
+ }
104
+ }
105
+ }
106
+ let length = 0;
107
+ if (typeof inputs.exactLength === 'number') {
108
+ length = inputs.exactLength;
109
+ }
110
+ else {
111
+ const response = yield prompts({
112
+ type: 'number',
113
+ name: 'length',
114
+ message: `Enter the length of the array for ${name}.`,
115
+ min: (_a = inputs.minLength) !== null && _a !== void 0 ? _a : undefined,
116
+ max: (_b = inputs.maxLength) !== null && _b !== void 0 ? _b : undefined,
117
+ });
118
+ length = response.length;
119
+ }
120
+ for (let i = 0; i < length; i++) {
121
+ const value = yield askForInputs(inputs.schema, `${name}[${i}]`);
122
+ result.push(value);
123
+ }
124
+ return result;
125
+ });
126
+ }
127
+ function askForEnumInputs(inputs, name) {
128
+ return __awaiter(this, void 0, void 0, function* () {
129
+ let choices = inputs.values.map((value) => ({
130
+ title: value,
131
+ value: value,
132
+ }));
133
+ if (inputs.nullable) {
134
+ choices = [
135
+ {
136
+ title: '(null)',
137
+ value: '',
138
+ },
139
+ ...choices,
140
+ ];
141
+ }
142
+ if (inputs.optional) {
143
+ choices = [
144
+ {
145
+ title: '(undefined)',
146
+ value: '',
147
+ },
148
+ ...choices,
149
+ ];
150
+ }
151
+ const response = yield prompts({
152
+ type: 'select',
153
+ name: 'value',
154
+ message: `Select a value for ${name}.`,
155
+ choices: choices,
156
+ });
157
+ if (response.value === '') {
158
+ if (inputs.nullable) {
159
+ return null;
160
+ }
161
+ else {
162
+ return undefined;
163
+ }
164
+ }
165
+ return response.value;
166
+ });
167
+ }
168
+ function askForUnionInputs(inputs, name) {
169
+ return __awaiter(this, void 0, void 0, function* () {
170
+ if ('discriminator' in inputs) {
171
+ return yield askForDiscriminatedUnionInputs(inputs, name);
172
+ }
173
+ else {
174
+ const kind = yield prompts({
175
+ type: 'select',
176
+ name: 'kind',
177
+ message: `Select a kind for ${name}.`,
178
+ choices: inputs.options.map((option) => ({
179
+ title: option.type,
180
+ description: option.description,
181
+ value: option,
182
+ })),
183
+ });
184
+ return yield askForInputs(kind.kind, name);
185
+ }
186
+ });
187
+ }
188
+ function askForDiscriminatedUnionInputs(inputs, name) {
189
+ return __awaiter(this, void 0, void 0, function* () {
190
+ const kind = yield prompts({
191
+ type: 'select',
192
+ name: 'kind',
193
+ message: `Select a ${inputs.discriminator} for ${name}.`,
194
+ choices: inputs.options.map((option) => {
195
+ const prop = option.schema[inputs.discriminator];
196
+ if (prop.type !== 'literal') {
197
+ return {
198
+ title: option.type,
199
+ description: option.description,
200
+ value: option,
201
+ };
202
+ }
203
+ return {
204
+ title: prop.value,
205
+ description: option.description,
206
+ value: option,
207
+ };
208
+ }),
209
+ });
210
+ return yield askForInputs(kind.kind, name);
211
+ });
212
+ }
213
+ //# sourceMappingURL=schema.js.map
package/schema.js.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.js","sourceRoot":"","sources":["schema.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,OAAO,MAAM,SAAS,CAAC;AAU9B,MAAM,UAAgB,YAAY,CAC9B,MAAsB,EACtB,IAAY;;;QAEZ,IAAI,MAAM,EAAE,CAAC;YACT,IAAI,MAAM,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;gBAC3B,OAAO,MAAM,kBAAkB,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;YAClD,CAAC;iBAAM,IAAI,MAAM,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;gBAClC,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC;oBAC3B,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,OAAO;oBACb,OAAO,EAAE,qBAAqB,IAAI,GAAG;oBACrC,OAAO,EAAE,MAAA,MAAM,CAAC,YAAY,mCAAI,SAAS;iBAC5C,CAAC,CAAC;gBAEH,OAAO,QAAQ,CAAC,KAAK,IAAI,SAAS,CAAC;YACvC,CAAC;iBAAM,IAAI,MAAM,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;gBAClC,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC;oBAC3B,IAAI,EAAE,QAAQ;oBACd,IAAI,EAAE,OAAO;oBACb,OAAO,EAAE,sBAAsB,IAAI,GAAG;oBACtC,OAAO,EAAE,MAAA,MAAM,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