@appsemble/cli 0.23.0 → 0.23.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -5
- package/commands/app/delete.d.ts +10 -0
- package/commands/app/delete.js +21 -0
- package/commands/app/index.js +2 -0
- package/commands/app/publish.d.ts +1 -0
- package/commands/app/publish.js +4 -0
- package/commands/app/update.d.ts +1 -0
- package/commands/app/update.js +4 -0
- package/commands/cleanupDemoUsers.d.ts +6 -0
- package/commands/cleanupDemoUsers.js +40 -0
- package/commands/cleanupTemplateResources.d.ts +6 -0
- package/commands/cleanupTemplateResources.js +40 -0
- package/index.js +4 -0
- package/lib/app.d.ts +8 -0
- package/lib/app.js +41 -22
- package/lib/authentication.js +3 -3
- package/lib/serverImport.d.ts +1 -1
- package/package.json +5 -5
- package/templates/apps/empty/app-definition.yaml +2 -2
- package/templates/blocks/mini-jsx/package.json +1 -1
- package/templates/blocks/preact/package.json +2 -2
- package/templates/blocks/vanilla/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
#  Appsemble CLI
|
|
2
2
|
|
|
3
3
|
> Manage apps and blocks from the command line.
|
|
4
4
|
|
|
5
5
|
[](https://www.npmjs.com/package/@appsemble/cli)
|
|
6
|
-
[](https://gitlab.com/appsemble/appsemble/-/releases/0.23.2)
|
|
7
7
|
[](https://prettier.io)
|
|
8
8
|
|
|
9
9
|
## Table of Contents
|
|
@@ -144,8 +144,8 @@ arguments.
|
|
|
144
144
|
appsemble app create
|
|
145
145
|
```
|
|
146
146
|
|
|
147
|
-
The Appsemble CLI can be used to create and
|
|
148
|
-
`apps/my-app` directory, run:
|
|
147
|
+
The Appsemble CLI can be used to create, update and delete apps. For example, to create an app in
|
|
148
|
+
the `apps/my-app` directory, run:
|
|
149
149
|
|
|
150
150
|
```sh
|
|
151
151
|
appsemble app publish apps/my-app
|
|
@@ -157,6 +157,12 @@ Similarly, to update an app using an app directory, run the following command:
|
|
|
157
157
|
appsemble app update --id <app-id> <path/to/updated app>.
|
|
158
158
|
```
|
|
159
159
|
|
|
160
|
+
To delete an app using the CLI use the following command:
|
|
161
|
+
|
|
162
|
+
```sh
|
|
163
|
+
appsemble app delete --id <appId>
|
|
164
|
+
```
|
|
165
|
+
|
|
160
166
|
For a more in depth explanation of how to build apps, use our
|
|
161
167
|
[app building guide](https://appsemble.app/docs/guide).
|
|
162
168
|
|
|
@@ -282,5 +288,5 @@ appsemble run-cronjobs --interval 30
|
|
|
282
288
|
|
|
283
289
|
## License
|
|
284
290
|
|
|
285
|
-
[LGPL-3.0-only](https://gitlab.com/appsemble/appsemble/-/blob/0.23.
|
|
291
|
+
[LGPL-3.0-only](https://gitlab.com/appsemble/appsemble/-/blob/0.23.2/LICENSE.md) ©
|
|
286
292
|
[Appsemble](https://appsemble.com)
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type Argv } from 'yargs';
|
|
2
|
+
import { type BaseArguments } from '../../types.js';
|
|
3
|
+
interface DeleteAppArguments extends BaseArguments {
|
|
4
|
+
id: number;
|
|
5
|
+
}
|
|
6
|
+
export declare const command = "delete";
|
|
7
|
+
export declare const description = "Delete an app using the app id.";
|
|
8
|
+
export declare function builder(yargs: Argv): Argv<any>;
|
|
9
|
+
export declare function handler({ clientCredentials, id, remote, }: DeleteAppArguments): Promise<void>;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { authenticate, logger } from '@appsemble/node-utils';
|
|
2
|
+
import axios from 'axios';
|
|
3
|
+
export const command = 'delete';
|
|
4
|
+
export const description = 'Delete an app using the app id.';
|
|
5
|
+
export function builder(yargs) {
|
|
6
|
+
return yargs.option('id', {
|
|
7
|
+
describe: 'id of the app to be deleted.',
|
|
8
|
+
demandOption: true,
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
export async function handler({ clientCredentials, id, remote, }) {
|
|
12
|
+
await authenticate(remote, 'apps:delete', clientCredentials);
|
|
13
|
+
const response = await axios.get(`/api/apps/${id}`);
|
|
14
|
+
const { name } = response.data;
|
|
15
|
+
logger.warn(`Deleting app: ${name}`);
|
|
16
|
+
axios.delete(`/api/apps/${id}`, {
|
|
17
|
+
baseURL: remote,
|
|
18
|
+
});
|
|
19
|
+
logger.info(`Successfully deleted ${name} app.`);
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=delete.js.map
|
package/commands/app/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as create from './create.js';
|
|
2
|
+
import * as remove from './delete.js';
|
|
2
3
|
import * as extractMessages from './extract-messages.js';
|
|
3
4
|
import * as publish from './publish.js';
|
|
4
5
|
import * as update from './update.js';
|
|
@@ -9,6 +10,7 @@ export function builder(yargs) {
|
|
|
9
10
|
return yargs
|
|
10
11
|
.command(publish)
|
|
11
12
|
.command(create)
|
|
13
|
+
.command(remove)
|
|
12
14
|
.command(extractMessages)
|
|
13
15
|
.command(update)
|
|
14
16
|
.demandCommand(1);
|
package/commands/app/publish.js
CHANGED
|
@@ -36,6 +36,10 @@ export function builder(yargs) {
|
|
|
36
36
|
.option('template', {
|
|
37
37
|
describe: 'Whether the app should be marked as a template.',
|
|
38
38
|
type: 'boolean',
|
|
39
|
+
})
|
|
40
|
+
.option('demo-mode', {
|
|
41
|
+
describe: 'Whether the app should be used in demo mode.',
|
|
42
|
+
type: 'boolean',
|
|
39
43
|
})
|
|
40
44
|
.option('dry-run', {
|
|
41
45
|
describe: 'Whether the API should be called to run without actually creating the app.',
|
package/commands/app/update.d.ts
CHANGED
package/commands/app/update.js
CHANGED
|
@@ -39,6 +39,10 @@ export function builder(yargs) {
|
|
|
39
39
|
describe: 'Whether the app should be marked as a template.',
|
|
40
40
|
type: 'boolean',
|
|
41
41
|
default: false,
|
|
42
|
+
})
|
|
43
|
+
.option('demo-mode', {
|
|
44
|
+
describe: 'Whether the app should be used in demo mode.',
|
|
45
|
+
type: 'boolean',
|
|
42
46
|
})
|
|
43
47
|
.option('force', {
|
|
44
48
|
describe: 'Whether the lock property should be ignored.',
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type Argv } from 'yargs';
|
|
2
|
+
import { type BaseArguments } from '../types.js';
|
|
3
|
+
export declare const command = "cleanup-demo-users";
|
|
4
|
+
export declare const description = "Deletes all demo users from the database.";
|
|
5
|
+
export declare function builder(yargs: Argv): Argv<any>;
|
|
6
|
+
export declare function handler(argv: BaseArguments): Promise<void>;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { serverImport } from '../lib/serverImport.js';
|
|
2
|
+
export const command = 'cleanup-demo-users';
|
|
3
|
+
export const description = 'Deletes all demo users from the database.';
|
|
4
|
+
export function builder(yargs) {
|
|
5
|
+
return yargs
|
|
6
|
+
.option('database-host', {
|
|
7
|
+
desc: 'The host of the database to connect to. This defaults to the connected database container.',
|
|
8
|
+
})
|
|
9
|
+
.option('database-port', {
|
|
10
|
+
desc: 'The port of the database to connect to.',
|
|
11
|
+
type: 'number',
|
|
12
|
+
default: 5432,
|
|
13
|
+
})
|
|
14
|
+
.option('database-ssl', {
|
|
15
|
+
desc: 'Use SSL to connect to the database.',
|
|
16
|
+
type: 'boolean',
|
|
17
|
+
})
|
|
18
|
+
.option('database-name', {
|
|
19
|
+
desc: 'The name of the database to connect to.',
|
|
20
|
+
implies: ['database-user', 'database-password'],
|
|
21
|
+
})
|
|
22
|
+
.option('database-user', {
|
|
23
|
+
desc: 'The user to use to login to the database.',
|
|
24
|
+
implies: ['database-name', 'database-password'],
|
|
25
|
+
})
|
|
26
|
+
.option('database-password', {
|
|
27
|
+
desc: 'The password to use to login to the database.',
|
|
28
|
+
implies: ['database-name', 'database-user'],
|
|
29
|
+
})
|
|
30
|
+
.option('database-url', {
|
|
31
|
+
desc: 'A connection string for the database to connect to. This is an alternative to the separate database related variables.',
|
|
32
|
+
conflicts: ['database-host', 'database-name', 'database-user', 'database-password'],
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
export async function handler(argv) {
|
|
36
|
+
const { cleanupDemoUsers, setArgv } = await serverImport('setArgv', 'cleanupDemoUsers');
|
|
37
|
+
setArgv(argv);
|
|
38
|
+
return cleanupDemoUsers();
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=cleanupDemoUsers.js.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type Argv } from 'yargs';
|
|
2
|
+
import { type BaseArguments } from '../types.js';
|
|
3
|
+
export declare const command = "cleanup-template-resources";
|
|
4
|
+
export declare const description = "Deletes all non-clonable resources belonging to template apps from the database.";
|
|
5
|
+
export declare function builder(yargs: Argv): Argv<any>;
|
|
6
|
+
export declare function handler(argv: BaseArguments): Promise<void>;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { serverImport } from '../lib/serverImport.js';
|
|
2
|
+
export const command = 'cleanup-template-resources';
|
|
3
|
+
export const description = 'Deletes all non-clonable resources belonging to template apps from the database.';
|
|
4
|
+
export function builder(yargs) {
|
|
5
|
+
return yargs
|
|
6
|
+
.option('database-host', {
|
|
7
|
+
desc: 'The host of the database to connect to. This defaults to the connected database container.',
|
|
8
|
+
})
|
|
9
|
+
.option('database-port', {
|
|
10
|
+
desc: 'The port of the database to connect to.',
|
|
11
|
+
type: 'number',
|
|
12
|
+
default: 5432,
|
|
13
|
+
})
|
|
14
|
+
.option('database-ssl', {
|
|
15
|
+
desc: 'Use SSL to connect to the database.',
|
|
16
|
+
type: 'boolean',
|
|
17
|
+
})
|
|
18
|
+
.option('database-name', {
|
|
19
|
+
desc: 'The name of the database to connect to.',
|
|
20
|
+
implies: ['database-user', 'database-password'],
|
|
21
|
+
})
|
|
22
|
+
.option('database-user', {
|
|
23
|
+
desc: 'The user to use to login to the database.',
|
|
24
|
+
implies: ['database-name', 'database-password'],
|
|
25
|
+
})
|
|
26
|
+
.option('database-password', {
|
|
27
|
+
desc: 'The password to use to login to the database.',
|
|
28
|
+
implies: ['database-name', 'database-user'],
|
|
29
|
+
})
|
|
30
|
+
.option('database-url', {
|
|
31
|
+
desc: 'A connection string for the database to connect to. This is an alternative to the separate database related variables.',
|
|
32
|
+
conflicts: ['database-host', 'database-name', 'database-user', 'database-password'],
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
export async function handler(argv) {
|
|
36
|
+
const { cleanupTemplateResources, setArgv } = await serverImport('setArgv', 'cleanupTemplateResources');
|
|
37
|
+
setArgv(argv);
|
|
38
|
+
return cleanupTemplateResources();
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=cleanupTemplateResources.js.map
|
package/index.js
CHANGED
|
@@ -6,7 +6,9 @@ import yargs from 'yargs';
|
|
|
6
6
|
import * as app from './commands/app/index.js';
|
|
7
7
|
import * as asset from './commands/asset/index.js';
|
|
8
8
|
import * as block from './commands/block/index.js';
|
|
9
|
+
import * as cleanupDemoUsers from './commands/cleanupDemoUsers.js';
|
|
9
10
|
import * as cleanupResources from './commands/cleanupResources.js';
|
|
11
|
+
import * as cleanupTemplateResources from './commands/cleanupTemplateResources.js';
|
|
10
12
|
import * as config from './commands/config/index.js';
|
|
11
13
|
import * as login from './commands/login.js';
|
|
12
14
|
import * as logout from './commands/logout.js';
|
|
@@ -47,6 +49,8 @@ let parser = yargs(process.argv.slice(2))
|
|
|
47
49
|
.command(asset)
|
|
48
50
|
.command(block)
|
|
49
51
|
.command(cleanupResources)
|
|
52
|
+
.command(cleanupDemoUsers)
|
|
53
|
+
.command(cleanupTemplateResources)
|
|
50
54
|
.command(config)
|
|
51
55
|
.command(login)
|
|
52
56
|
.command(logout)
|
package/lib/app.d.ts
CHANGED
|
@@ -32,6 +32,10 @@ interface PublishAppParams {
|
|
|
32
32
|
* Whether the App should be marked as a template.
|
|
33
33
|
*/
|
|
34
34
|
template: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Whether the App should be used in demo mode.
|
|
37
|
+
*/
|
|
38
|
+
demoMode: boolean;
|
|
35
39
|
/**
|
|
36
40
|
* The icon to upload.
|
|
37
41
|
*/
|
|
@@ -99,6 +103,10 @@ interface UpdateAppParams {
|
|
|
99
103
|
* Whether the App should be marked as a template.
|
|
100
104
|
*/
|
|
101
105
|
template: boolean;
|
|
106
|
+
/**
|
|
107
|
+
* Whether the App should be used in demo mode.
|
|
108
|
+
*/
|
|
109
|
+
demoMode: boolean;
|
|
102
110
|
/**
|
|
103
111
|
* Whether the locked property should be ignored.
|
|
104
112
|
*/
|
package/lib/app.js
CHANGED
|
@@ -289,7 +289,7 @@ This block version is not used in the app`);
|
|
|
289
289
|
* @param argv The command line options used for updating the app.
|
|
290
290
|
*/
|
|
291
291
|
export async function updateApp({ clientCredentials, context, force, path, ...options }) {
|
|
292
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
292
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
|
|
293
293
|
const file = await stat(path);
|
|
294
294
|
const formData = new FormData();
|
|
295
295
|
let appsembleContext;
|
|
@@ -303,13 +303,14 @@ export async function updateApp({ clientCredentials, context, force, path, ...op
|
|
|
303
303
|
const remote = (_a = appsembleContext.remote) !== null && _a !== void 0 ? _a : options.remote;
|
|
304
304
|
const id = (_b = appsembleContext.id) !== null && _b !== void 0 ? _b : options.id;
|
|
305
305
|
const template = (_d = (_c = appsembleContext.template) !== null && _c !== void 0 ? _c : options.template) !== null && _d !== void 0 ? _d : false;
|
|
306
|
-
const
|
|
307
|
-
const
|
|
308
|
-
const
|
|
309
|
-
const
|
|
310
|
-
const
|
|
311
|
-
const
|
|
312
|
-
const
|
|
306
|
+
const demoMode = (_f = (_e = appsembleContext.demoMode) !== null && _e !== void 0 ? _e : options.demoMode) !== null && _f !== void 0 ? _f : false;
|
|
307
|
+
const visibility = (_g = appsembleContext.visibility) !== null && _g !== void 0 ? _g : options.visibility;
|
|
308
|
+
const iconBackground = (_h = appsembleContext.iconBackground) !== null && _h !== void 0 ? _h : options.iconBackground;
|
|
309
|
+
const icon = (_j = options.icon) !== null && _j !== void 0 ? _j : appsembleContext.icon;
|
|
310
|
+
const maskableIcon = (_k = options.maskableIcon) !== null && _k !== void 0 ? _k : appsembleContext.maskableIcon;
|
|
311
|
+
const sentryDsn = (_l = appsembleContext.sentryDsn) !== null && _l !== void 0 ? _l : options.sentryDsn;
|
|
312
|
+
const sentryEnvironment = (_m = appsembleContext.sentryEnvironment) !== null && _m !== void 0 ? _m : options.sentryEnvironment;
|
|
313
|
+
const googleAnalyticsId = (_o = appsembleContext.googleAnalyticsId) !== null && _o !== void 0 ? _o : options.googleAnalyticsId;
|
|
313
314
|
logger.info(`App id: ${id}`);
|
|
314
315
|
logger.verbose(`App remote: ${remote}`);
|
|
315
316
|
logger.verbose(`App is template: ${inspect(template, { colors: true })}`);
|
|
@@ -321,16 +322,17 @@ export async function updateApp({ clientCredentials, context, force, path, ...op
|
|
|
321
322
|
}
|
|
322
323
|
formData.append('force', String(force));
|
|
323
324
|
formData.append('template', String(template));
|
|
325
|
+
formData.append('demoMode', String(demoMode));
|
|
324
326
|
formData.append('visibility', visibility);
|
|
325
327
|
formData.append('iconBackground', iconBackground);
|
|
326
328
|
if (icon) {
|
|
327
329
|
const realIcon = typeof icon === 'string' ? createReadStream(icon) : icon;
|
|
328
|
-
logger.info(`Using icon from ${(
|
|
330
|
+
logger.info(`Using icon from ${(_p = realIcon.path) !== null && _p !== void 0 ? _p : 'stdin'}`);
|
|
329
331
|
formData.append('icon', realIcon);
|
|
330
332
|
}
|
|
331
333
|
if (maskableIcon) {
|
|
332
334
|
const realIcon = typeof maskableIcon === 'string' ? createReadStream(maskableIcon) : maskableIcon;
|
|
333
|
-
logger.info(`Using maskable icon from ${(
|
|
335
|
+
logger.info(`Using maskable icon from ${(_q = realIcon.path) !== null && _q !== void 0 ? _q : 'stdin'}`);
|
|
334
336
|
formData.append('maskableIcon', realIcon);
|
|
335
337
|
}
|
|
336
338
|
if (sentryDsn) {
|
|
@@ -345,7 +347,22 @@ export async function updateApp({ clientCredentials, context, force, path, ...op
|
|
|
345
347
|
formData.append('googleAnalyticsID', googleAnalyticsId);
|
|
346
348
|
}
|
|
347
349
|
await authenticate(remote, 'apps:write', clientCredentials);
|
|
348
|
-
|
|
350
|
+
let data;
|
|
351
|
+
try {
|
|
352
|
+
data = await axios
|
|
353
|
+
.patch(`/api/apps/${id}`, formData, { baseURL: remote })
|
|
354
|
+
.then((r) => r.data);
|
|
355
|
+
}
|
|
356
|
+
catch (error) {
|
|
357
|
+
if (!axios.isAxiosError(error)) {
|
|
358
|
+
throw error;
|
|
359
|
+
}
|
|
360
|
+
if (((_s = (_r = error.response) === null || _r === void 0 ? void 0 : _r.data) === null || _s === void 0 ? void 0 : _s.message) !== 'App validation failed') {
|
|
361
|
+
throw error;
|
|
362
|
+
}
|
|
363
|
+
logger.error(error.response.data);
|
|
364
|
+
process.exit(1);
|
|
365
|
+
}
|
|
349
366
|
if (file.isDirectory()) {
|
|
350
367
|
// After uploading the app, upload block styles and messages if they are available
|
|
351
368
|
await traverseBlockThemes(path, data.id, remote, force);
|
|
@@ -362,7 +379,7 @@ export async function updateApp({ clientCredentials, context, force, path, ...op
|
|
|
362
379
|
* @param options The options to use for publishing an app.
|
|
363
380
|
*/
|
|
364
381
|
export async function publishApp({ clientCredentials, context, dryRun, modifyContext, path, resources, ...options }) {
|
|
365
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
|
382
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
|
|
366
383
|
const file = await stat(path);
|
|
367
384
|
const formData = new FormData();
|
|
368
385
|
let appsembleContext;
|
|
@@ -382,13 +399,14 @@ export async function publishApp({ clientCredentials, context, dryRun, modifyCon
|
|
|
382
399
|
const remote = (_a = appsembleContext.remote) !== null && _a !== void 0 ? _a : options.remote;
|
|
383
400
|
const organizationId = (_b = appsembleContext.organization) !== null && _b !== void 0 ? _b : options.organization;
|
|
384
401
|
const template = (_d = (_c = appsembleContext.template) !== null && _c !== void 0 ? _c : options.template) !== null && _d !== void 0 ? _d : false;
|
|
385
|
-
const
|
|
386
|
-
const
|
|
387
|
-
const
|
|
388
|
-
const
|
|
389
|
-
const
|
|
390
|
-
const
|
|
391
|
-
const
|
|
402
|
+
const demoMode = (_f = (_e = appsembleContext.demoMode) !== null && _e !== void 0 ? _e : options.demoMode) !== null && _f !== void 0 ? _f : false;
|
|
403
|
+
const visibility = (_g = appsembleContext.visibility) !== null && _g !== void 0 ? _g : options.visibility;
|
|
404
|
+
const iconBackground = (_h = appsembleContext.iconBackground) !== null && _h !== void 0 ? _h : options.iconBackground;
|
|
405
|
+
const icon = (_j = options.icon) !== null && _j !== void 0 ? _j : appsembleContext.icon;
|
|
406
|
+
const maskableIcon = (_k = options.maskableIcon) !== null && _k !== void 0 ? _k : appsembleContext.maskableIcon;
|
|
407
|
+
const sentryDsn = (_l = appsembleContext.sentryDsn) !== null && _l !== void 0 ? _l : options.sentryDsn;
|
|
408
|
+
const sentryEnvironment = (_m = appsembleContext.sentryEnvironment) !== null && _m !== void 0 ? _m : options.sentryEnvironment;
|
|
409
|
+
const googleAnalyticsId = (_o = appsembleContext.googleAnalyticsId) !== null && _o !== void 0 ? _o : options.googleAnalyticsId;
|
|
392
410
|
logger.verbose(`App remote: ${remote}`);
|
|
393
411
|
logger.verbose(`App organization: ${organizationId}`);
|
|
394
412
|
logger.verbose(`App is template: ${inspect(template, { colors: true })}`);
|
|
@@ -399,16 +417,17 @@ export async function publishApp({ clientCredentials, context, dryRun, modifyCon
|
|
|
399
417
|
}
|
|
400
418
|
formData.append('OrganizationId', organizationId);
|
|
401
419
|
formData.append('template', String(template));
|
|
420
|
+
formData.append('demoMode', String(demoMode));
|
|
402
421
|
formData.append('visibility', visibility);
|
|
403
422
|
formData.append('iconBackground', iconBackground);
|
|
404
423
|
if (icon) {
|
|
405
424
|
const realIcon = typeof icon === 'string' ? createReadStream(icon) : icon;
|
|
406
|
-
logger.info(`Using icon from ${(
|
|
425
|
+
logger.info(`Using icon from ${(_p = realIcon.path) !== null && _p !== void 0 ? _p : 'stdin'}`);
|
|
407
426
|
formData.append('icon', realIcon);
|
|
408
427
|
}
|
|
409
428
|
if (maskableIcon) {
|
|
410
429
|
const realIcon = typeof maskableIcon === 'string' ? createReadStream(maskableIcon) : maskableIcon;
|
|
411
|
-
logger.info(`Using maskable icon from ${(
|
|
430
|
+
logger.info(`Using maskable icon from ${(_q = realIcon.path) !== null && _q !== void 0 ? _q : 'stdin'}`);
|
|
412
431
|
formData.append('maskableIcon', realIcon);
|
|
413
432
|
}
|
|
414
433
|
if (sentryDsn) {
|
|
@@ -434,7 +453,7 @@ export async function publishApp({ clientCredentials, context, dryRun, modifyCon
|
|
|
434
453
|
if (!axios.isAxiosError(error)) {
|
|
435
454
|
throw error;
|
|
436
455
|
}
|
|
437
|
-
if (((
|
|
456
|
+
if (((_s = (_r = error.response) === null || _r === void 0 ? void 0 : _r.data) === null || _s === void 0 ? void 0 : _s.message) !== 'App validation failed') {
|
|
438
457
|
throw error;
|
|
439
458
|
}
|
|
440
459
|
throw new AppsembleError(printAxiosError(filename, yaml, error.response.data.data.errors));
|
package/lib/authentication.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { hostname } from 'node:os';
|
|
2
|
-
import { AppsembleError, getKeytar, getService, logger } from '@appsemble/node-utils';
|
|
2
|
+
import { AppsembleError, assertKoaError, getKeytar, getService, logger, throwKoaError, } from '@appsemble/node-utils';
|
|
3
3
|
import inquirer from 'inquirer';
|
|
4
4
|
import Koa from 'koa';
|
|
5
5
|
import open from 'open';
|
|
@@ -29,9 +29,9 @@ function waitForCredentials(url) {
|
|
|
29
29
|
({ credentials } = JSON.parse(await raw(ctx.req, { encoding: 'utf8' })));
|
|
30
30
|
}
|
|
31
31
|
catch {
|
|
32
|
-
ctx
|
|
32
|
+
throwKoaError(ctx, 400, 'Invalid JSON');
|
|
33
33
|
}
|
|
34
|
-
|
|
34
|
+
assertKoaError(typeof credentials === 'string' && validate(credentials), ctx, 400, 'Invalid client credentials');
|
|
35
35
|
ctx.status = 204;
|
|
36
36
|
server.close();
|
|
37
37
|
resolve(credentials);
|
package/lib/serverImport.d.ts
CHANGED
|
@@ -4,4 +4,4 @@
|
|
|
4
4
|
* @param members The names of the exported member to import.
|
|
5
5
|
* @returns The exported member.
|
|
6
6
|
*/
|
|
7
|
-
export declare function serverImport<T extends 'cleanupResources' | 'migrate' | 'runCronJobs' | 'setArgv' | 'start'>(...members: T[]): Promise<Record<T, any>>;
|
|
7
|
+
export declare function serverImport<T extends 'cleanupDemoUsers' | 'cleanupResources' | 'cleanupTemplateResources' | 'migrate' | 'runCronJobs' | 'setArgv' | 'start'>(...members: T[]): Promise<Record<T, any>>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@appsemble/cli",
|
|
3
|
-
"version": "0.23.
|
|
3
|
+
"version": "0.23.2",
|
|
4
4
|
"description": "The CLI for developing with Appsemble apps and blocks",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"app",
|
|
@@ -42,9 +42,9 @@
|
|
|
42
42
|
"test": "vitest"
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@appsemble/node-utils": "0.23.
|
|
46
|
-
"@appsemble/types": "0.23.
|
|
47
|
-
"@appsemble/utils": "0.23.
|
|
45
|
+
"@appsemble/node-utils": "0.23.2",
|
|
46
|
+
"@appsemble/types": "0.23.2",
|
|
47
|
+
"@appsemble/utils": "0.23.2",
|
|
48
48
|
"@fortawesome/fontawesome-common-types": "^6.0.0",
|
|
49
49
|
"@koa/cors": "^4.0.0",
|
|
50
50
|
"@odata/parser": "^0.2.0",
|
|
@@ -85,7 +85,7 @@
|
|
|
85
85
|
"yargs": "^17.0.0"
|
|
86
86
|
},
|
|
87
87
|
"devDependencies": {
|
|
88
|
-
"@appsemble/types": "0.23.
|
|
88
|
+
"@appsemble/types": "0.23.2",
|
|
89
89
|
"@types/concat-stream": "^2.0.0",
|
|
90
90
|
"@types/inquirer": "^9.0.0",
|
|
91
91
|
"@types/normalize-path": "^3.0.0",
|
|
@@ -6,7 +6,7 @@ pages:
|
|
|
6
6
|
- name: Example Page A
|
|
7
7
|
blocks:
|
|
8
8
|
- type: action-button
|
|
9
|
-
version: 0.23.
|
|
9
|
+
version: 0.23.2
|
|
10
10
|
parameters:
|
|
11
11
|
icon: arrow-right
|
|
12
12
|
actions:
|
|
@@ -17,7 +17,7 @@ pages:
|
|
|
17
17
|
- name: Example Page B
|
|
18
18
|
blocks:
|
|
19
19
|
- type: action-button
|
|
20
|
-
version: 0.23.
|
|
20
|
+
version: 0.23.2
|
|
21
21
|
parameters:
|
|
22
22
|
icon: arrow-left
|
|
23
23
|
actions:
|