@appsemble/cli 0.34.1-test.3 → 0.34.4
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 +3 -3
- package/commands/app/publish.d.ts +0 -5
- package/commands/app/publish.js +0 -16
- package/commands/app/update.d.ts +0 -5
- package/commands/app/update.js +0 -16
- package/commands/migrate.js +1 -0
- package/index.js +2 -2
- package/lib/app.d.ts +0 -40
- package/lib/app.js +0 -40
- package/lib/group.d.ts +5 -5
- package/lib/group.js +10 -10
- package/package.json +7 -7
- 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/vitest.setup.js +3 -7
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.34.4)
|
|
7
7
|
[](https://prettier.io)
|
|
8
8
|
|
|
9
9
|
## Table of Contents
|
|
@@ -323,5 +323,5 @@ appsemble run-cronjobs --interval 30
|
|
|
323
323
|
|
|
324
324
|
## License
|
|
325
325
|
|
|
326
|
-
[LGPL-3.0-only](https://gitlab.com/appsemble/appsemble/-/blob/0.34.
|
|
326
|
+
[LGPL-3.0-only](https://gitlab.com/appsemble/appsemble/-/blob/0.34.4/LICENSE.md) ©
|
|
327
327
|
[Appsemble](https://appsemble.com)
|
|
@@ -21,11 +21,6 @@ interface PublishAppArguments extends BaseArguments {
|
|
|
21
21
|
sentryDsn: string;
|
|
22
22
|
sentryEnvironment: string;
|
|
23
23
|
googleAnalyticsId: string;
|
|
24
|
-
dbName: string;
|
|
25
|
-
dbHost: string;
|
|
26
|
-
dbPort: number;
|
|
27
|
-
dbUser: string;
|
|
28
|
-
dbPassword: string;
|
|
29
24
|
}
|
|
30
25
|
export declare const command = "publish <paths...>";
|
|
31
26
|
export declare const description = "Publish a new App to a remote based on a specified YAML file or directory.";
|
package/commands/app/publish.js
CHANGED
|
@@ -76,22 +76,6 @@ export function builder(yargs) {
|
|
|
76
76
|
.option('sentry-environment', {
|
|
77
77
|
describe: 'The environment for the custom Sentry DSN for the app.',
|
|
78
78
|
implies: ['sentry-dsn'],
|
|
79
|
-
})
|
|
80
|
-
.option('db-name', {
|
|
81
|
-
describe: 'The name of the external app database.',
|
|
82
|
-
})
|
|
83
|
-
.option('db-host', {
|
|
84
|
-
describe: 'The host of the external app database.',
|
|
85
|
-
})
|
|
86
|
-
.option('db-port', {
|
|
87
|
-
describe: 'The port of the external app database.',
|
|
88
|
-
type: 'number',
|
|
89
|
-
})
|
|
90
|
-
.option('db-user', {
|
|
91
|
-
describe: 'The user of the external app database.',
|
|
92
|
-
})
|
|
93
|
-
.option('db-password', {
|
|
94
|
-
describe: 'The password of the external app database.',
|
|
95
79
|
});
|
|
96
80
|
}
|
|
97
81
|
export async function handler({ paths, ...args }) {
|
package/commands/app/update.d.ts
CHANGED
|
@@ -19,11 +19,6 @@ interface UpdateAppArguments extends BaseArguments {
|
|
|
19
19
|
sentryDsn: string;
|
|
20
20
|
sentryEnvironment: string;
|
|
21
21
|
googleAnalyticsId: string;
|
|
22
|
-
dbName: string;
|
|
23
|
-
dbHost: string;
|
|
24
|
-
dbPort: number;
|
|
25
|
-
dbUser: string;
|
|
26
|
-
dbPassword: string;
|
|
27
22
|
}
|
|
28
23
|
export declare const command = "update <paths...>";
|
|
29
24
|
export declare const description = "Update an app based on a specified YAML file or directory.";
|
package/commands/app/update.js
CHANGED
|
@@ -76,22 +76,6 @@ export function builder(yargs) {
|
|
|
76
76
|
.option('sentry-environment', {
|
|
77
77
|
describe: 'The environment for the custom Sentry DSN for the app.',
|
|
78
78
|
implies: ['sentry-dsn'],
|
|
79
|
-
})
|
|
80
|
-
.option('db-name', {
|
|
81
|
-
describe: 'The name of the external app database.',
|
|
82
|
-
})
|
|
83
|
-
.option('db-host', {
|
|
84
|
-
describe: 'The host of the external app database.',
|
|
85
|
-
})
|
|
86
|
-
.option('db-port', {
|
|
87
|
-
describe: 'The port of the external app database.',
|
|
88
|
-
type: 'number',
|
|
89
|
-
})
|
|
90
|
-
.option('db-user', {
|
|
91
|
-
describe: 'The user of the external app database.',
|
|
92
|
-
})
|
|
93
|
-
.option('db-password', {
|
|
94
|
-
describe: 'The password of the external app database.',
|
|
95
79
|
});
|
|
96
80
|
}
|
|
97
81
|
export async function handler({ clientCredentials, id, paths, remote, ...args }) {
|
package/commands/migrate.js
CHANGED
package/index.js
CHANGED
|
@@ -7,7 +7,7 @@ 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
9
|
import * as checkDownMigrations from './commands/checkDownMigrations.js';
|
|
10
|
-
import * as
|
|
10
|
+
import * as checkMigrations from './commands/checkMigrations.js';
|
|
11
11
|
import * as cleanupDemoAppMembers from './commands/cleanupDemoAppMembers.js';
|
|
12
12
|
import * as cleanupResourcesAndAssets from './commands/cleanupResourcesAndAssets.js';
|
|
13
13
|
import * as cleanupSoftDeletedRecords from './commands/cleanupSoftDeletedRecords.js';
|
|
@@ -58,7 +58,7 @@ let parser = yargs(process.argv.slice(2))
|
|
|
58
58
|
.command(cleanupResourcesAndAssets)
|
|
59
59
|
.command(cleanupDemoAppMembers)
|
|
60
60
|
.command(cleanupSoftDeletedRecords)
|
|
61
|
-
.command(
|
|
61
|
+
.command(checkMigrations)
|
|
62
62
|
.command(checkDownMigrations)
|
|
63
63
|
.command(fuzzMigrations)
|
|
64
64
|
.command(config)
|
package/lib/app.d.ts
CHANGED
|
@@ -140,26 +140,6 @@ interface PublishAppParams {
|
|
|
140
140
|
* The environment for the custom Sentry DSN for the app.
|
|
141
141
|
*/
|
|
142
142
|
sentryEnvironment?: string;
|
|
143
|
-
/**
|
|
144
|
-
* The name of the external app database.
|
|
145
|
-
*/
|
|
146
|
-
dbName?: string;
|
|
147
|
-
/**
|
|
148
|
-
* The host of the external app database.
|
|
149
|
-
*/
|
|
150
|
-
dbHost?: string;
|
|
151
|
-
/**
|
|
152
|
-
* The port of the external app database.
|
|
153
|
-
*/
|
|
154
|
-
dbPort?: number;
|
|
155
|
-
/**
|
|
156
|
-
* The user of the external app database.
|
|
157
|
-
*/
|
|
158
|
-
dbUser?: string;
|
|
159
|
-
/**
|
|
160
|
-
* The password of the external app database.
|
|
161
|
-
*/
|
|
162
|
-
dbPassword?: string;
|
|
163
143
|
}
|
|
164
144
|
/**
|
|
165
145
|
* Publish a new app.
|
|
@@ -244,26 +224,6 @@ interface UpdateAppParams {
|
|
|
244
224
|
* The environment for the custom Sentry DSN for the app.
|
|
245
225
|
*/
|
|
246
226
|
sentryEnvironment?: string;
|
|
247
|
-
/**
|
|
248
|
-
* The name of the external app database.
|
|
249
|
-
*/
|
|
250
|
-
dbName?: string;
|
|
251
|
-
/**
|
|
252
|
-
* The host of the external app database.
|
|
253
|
-
*/
|
|
254
|
-
dbHost?: string;
|
|
255
|
-
/**
|
|
256
|
-
* The port of the external app database.
|
|
257
|
-
*/
|
|
258
|
-
dbPort?: number;
|
|
259
|
-
/**
|
|
260
|
-
* The user of the external app database.
|
|
261
|
-
*/
|
|
262
|
-
dbUser?: string;
|
|
263
|
-
/**
|
|
264
|
-
* The password of the external app database.
|
|
265
|
-
*/
|
|
266
|
-
dbPassword?: string;
|
|
267
227
|
}
|
|
268
228
|
/**
|
|
269
229
|
* Update an existing app.
|
package/lib/app.js
CHANGED
|
@@ -783,11 +783,6 @@ export async function publishApp({ clientCredentials, context, dryRun, modifyCon
|
|
|
783
783
|
const assets = appsembleContext.assets ?? options.assets;
|
|
784
784
|
const resources = appsembleContext.resources ?? options.resources;
|
|
785
785
|
const appLock = appsembleContext.appLock || 'unlocked';
|
|
786
|
-
const dbName = appsembleContext.dbName ?? options.dbName;
|
|
787
|
-
const dbHost = appsembleContext.dbHost ?? options.dbHost;
|
|
788
|
-
const dbPort = appsembleContext.dbPort ?? options.dbPort;
|
|
789
|
-
const dbUser = appsembleContext.dbUser ?? options.dbUser;
|
|
790
|
-
const { dbPassword } = options;
|
|
791
786
|
logger.verbose(`App remote: ${remote}`);
|
|
792
787
|
logger.verbose(`App organization: ${organizationId}`);
|
|
793
788
|
logger.verbose(`App is template: ${inspect(template, { colors: true })}`);
|
|
@@ -802,21 +797,6 @@ export async function publishApp({ clientCredentials, context, dryRun, modifyCon
|
|
|
802
797
|
formData.append('visibility', visibility);
|
|
803
798
|
formData.append('iconBackground', iconBackground);
|
|
804
799
|
formData.append('locked', appLock);
|
|
805
|
-
if (dbName) {
|
|
806
|
-
formData.append('dbName', dbName);
|
|
807
|
-
}
|
|
808
|
-
if (dbHost) {
|
|
809
|
-
formData.append('dbHost', dbHost);
|
|
810
|
-
}
|
|
811
|
-
if (dbPort) {
|
|
812
|
-
formData.append('dbPort', dbPort);
|
|
813
|
-
}
|
|
814
|
-
if (dbUser) {
|
|
815
|
-
formData.append('dbUser', dbUser);
|
|
816
|
-
}
|
|
817
|
-
if (dbPassword) {
|
|
818
|
-
formData.append('dbPassword', dbPassword);
|
|
819
|
-
}
|
|
820
800
|
if (icon) {
|
|
821
801
|
const realIcon = typeof icon === 'string' ? createReadStream(icon) : icon;
|
|
822
802
|
logger.info(`Using icon from ${realIcon.path ?? 'stdin'}`);
|
|
@@ -977,11 +957,6 @@ export async function updateApp({ clientCredentials, context, force, path, ...op
|
|
|
977
957
|
const resources = appsembleContext.resources ?? options.resources;
|
|
978
958
|
const assets = appsembleContext.assets ?? options.assets;
|
|
979
959
|
const { appLock } = appsembleContext;
|
|
980
|
-
const dbName = appsembleContext.dbName ?? options.dbName;
|
|
981
|
-
const dbHost = appsembleContext.dbHost ?? options.dbHost;
|
|
982
|
-
const dbPort = appsembleContext.dbPort ?? options.dbPort;
|
|
983
|
-
const dbUser = appsembleContext.dbUser ?? options.dbUser;
|
|
984
|
-
const { dbPassword } = options;
|
|
985
960
|
logger.info(`App id: ${id}`);
|
|
986
961
|
logger.verbose(`App remote: ${remote}`);
|
|
987
962
|
logger.verbose(`App is template: ${inspect(template, { colors: true })}`);
|
|
@@ -996,21 +971,6 @@ export async function updateApp({ clientCredentials, context, force, path, ...op
|
|
|
996
971
|
formData.append('demoMode', String(demoMode));
|
|
997
972
|
formData.append('visibility', visibility);
|
|
998
973
|
formData.append('iconBackground', iconBackground);
|
|
999
|
-
if (dbName) {
|
|
1000
|
-
formData.append('dbName', dbName);
|
|
1001
|
-
}
|
|
1002
|
-
if (dbHost) {
|
|
1003
|
-
formData.append('dbHost', dbHost);
|
|
1004
|
-
}
|
|
1005
|
-
if (dbPort) {
|
|
1006
|
-
formData.append('dbPort', dbPort);
|
|
1007
|
-
}
|
|
1008
|
-
if (dbUser) {
|
|
1009
|
-
formData.append('dbUser', dbUser);
|
|
1010
|
-
}
|
|
1011
|
-
if (dbPassword) {
|
|
1012
|
-
formData.append('dbPassword', dbPassword);
|
|
1013
|
-
}
|
|
1014
974
|
if (icon) {
|
|
1015
975
|
const realIcon = typeof icon === 'string' ? createReadStream(icon) : icon;
|
|
1016
976
|
logger.info(`Using icon from ${realIcon.path ?? 'stdin'}`);
|
package/lib/group.d.ts
CHANGED
|
@@ -59,9 +59,9 @@ interface CreateGroupParams extends SharedGroupParams {
|
|
|
59
59
|
}
|
|
60
60
|
export declare function resolveAnnotations(annotations: string[]): Record<string, string> | undefined;
|
|
61
61
|
export declare function createGroup({ annotations, appId, clientCredentials, name, remote, }: CreateGroupParams): Promise<void>;
|
|
62
|
-
export declare function deleteGroup({
|
|
63
|
-
export declare function updateGroup({ annotations,
|
|
64
|
-
export declare function inviteMember({
|
|
65
|
-
export declare function updateMember({
|
|
66
|
-
export declare function deleteMember({
|
|
62
|
+
export declare function deleteGroup({ clientCredentials, id, remote, }: SharedExistingGroupParams): Promise<void>;
|
|
63
|
+
export declare function updateGroup({ annotations, id, name, remote, }: UpdateGroupParams): Promise<void>;
|
|
64
|
+
export declare function inviteMember({ id, remote, role, user, }: InviteGroupMemberParams): Promise<void>;
|
|
65
|
+
export declare function updateMember({ id, remote, role, user, }: UpdateGroupMemberParams): Promise<void>;
|
|
66
|
+
export declare function deleteMember({ id, user }: SharedGroupMemberParams): Promise<void>;
|
|
67
67
|
export {};
|
package/lib/group.js
CHANGED
|
@@ -22,35 +22,35 @@ export async function createGroup({ annotations = [], appId, clientCredentials,
|
|
|
22
22
|
}, { baseURL: remote });
|
|
23
23
|
logger.info(`Successfully created group ${name} with ID ${id}`);
|
|
24
24
|
}
|
|
25
|
-
export async function deleteGroup({
|
|
25
|
+
export async function deleteGroup({ clientCredentials, id, remote, }) {
|
|
26
26
|
await authenticate(remote, 'groups:write', clientCredentials);
|
|
27
27
|
logger.info(`Deleting group ${id}`);
|
|
28
|
-
await axios.delete(`/api/
|
|
28
|
+
await axios.delete(`/api/groups/${id}`, { baseURL: remote });
|
|
29
29
|
logger.info(`Successfully deleted group ${id}`);
|
|
30
30
|
}
|
|
31
|
-
export async function updateGroup({ annotations = [],
|
|
31
|
+
export async function updateGroup({ annotations = [], id, name, remote, }) {
|
|
32
32
|
logger.info(`Updating group ${id}`);
|
|
33
|
-
await axios.patch(`/api/
|
|
33
|
+
await axios.patch(`/api/groups/${id}`, {
|
|
34
34
|
name,
|
|
35
35
|
annotations: resolveAnnotations(annotations),
|
|
36
36
|
}, { baseURL: remote });
|
|
37
37
|
logger.info(`Successfully updated group ${id}`);
|
|
38
38
|
}
|
|
39
|
-
export async function inviteMember({
|
|
39
|
+
export async function inviteMember({ id, remote, role, user, }) {
|
|
40
40
|
logger.info(`Inviting ${user} to group ${id}`);
|
|
41
|
-
await axios.post(`/api/
|
|
41
|
+
await axios.post(`/api/groups/${id}/invites`, [{ email: user, role }], {
|
|
42
42
|
baseURL: remote,
|
|
43
43
|
});
|
|
44
44
|
logger.info(`Successfully invited ${user} to group ${id}`);
|
|
45
45
|
}
|
|
46
|
-
export async function updateMember({
|
|
46
|
+
export async function updateMember({ id, remote, role, user, }) {
|
|
47
47
|
logger.info(`Updating ${user}’s role in group ${id} to ${role}`);
|
|
48
|
-
await axios.put(`/api/
|
|
48
|
+
await axios.put(`/api/group-members/${user}/role`, { role }, { baseURL: remote });
|
|
49
49
|
logger.info(`Successfully updated ${user} in group ${id}`);
|
|
50
50
|
}
|
|
51
|
-
export async function deleteMember({
|
|
51
|
+
export async function deleteMember({ id, user }) {
|
|
52
52
|
logger.info(`Deleting ${user} to group ${id}`);
|
|
53
|
-
await axios.delete(`/api/
|
|
53
|
+
await axios.delete(`/api/group-members/${user}?selectedGroupId=${id}`);
|
|
54
54
|
logger.info(`Successfully deleted ${user} from group ${id}`);
|
|
55
55
|
}
|
|
56
56
|
//# sourceMappingURL=group.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@appsemble/cli",
|
|
3
|
-
"version": "0.34.
|
|
3
|
+
"version": "0.34.4",
|
|
4
4
|
"description": "The CLI for developing with Appsemble apps and blocks",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"app",
|
|
@@ -44,10 +44,10 @@
|
|
|
44
44
|
"test": "vitest"
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@appsemble/node-utils": "0.34.
|
|
48
|
-
"@appsemble/types": "0.34.
|
|
49
|
-
"@appsemble/lang-sdk": "0.34.
|
|
50
|
-
"@appsemble/utils": "0.34.
|
|
47
|
+
"@appsemble/node-utils": "0.34.4",
|
|
48
|
+
"@appsemble/types": "0.34.4",
|
|
49
|
+
"@appsemble/lang-sdk": "0.34.4",
|
|
50
|
+
"@appsemble/utils": "0.34.4",
|
|
51
51
|
"@fortawesome/fontawesome-common-types": "^6.0.0",
|
|
52
52
|
"@koa/cors": "^5.0.0",
|
|
53
53
|
"@odata/parser": "^0.2.0",
|
|
@@ -90,8 +90,8 @@
|
|
|
90
90
|
"yargs": "^17.0.0"
|
|
91
91
|
},
|
|
92
92
|
"devDependencies": {
|
|
93
|
-
"@appsemble/types": "0.34.
|
|
94
|
-
"@appsemble/server": "0.34.
|
|
93
|
+
"@appsemble/types": "0.34.4",
|
|
94
|
+
"@appsemble/server": "0.34.4",
|
|
95
95
|
"bcrypt": "5.1.1",
|
|
96
96
|
"axios-test-instance": "7.0.0",
|
|
97
97
|
"@types/concat-stream": "2.0.3",
|
|
@@ -6,7 +6,7 @@ pages:
|
|
|
6
6
|
- name: Example Page A
|
|
7
7
|
blocks:
|
|
8
8
|
- type: action-button
|
|
9
|
-
version: 0.34.
|
|
9
|
+
version: 0.34.4
|
|
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.34.
|
|
20
|
+
version: 0.34.4
|
|
21
21
|
parameters:
|
|
22
22
|
icon: arrow-left
|
|
23
23
|
actions:
|
package/vitest.setup.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { randomUUID } from 'node:crypto';
|
|
2
2
|
import { clearAllS3Buckets, CREDENTIALS_ENV_VAR, initS3Client, setFixtureBase, setLogLevel, } from '@appsemble/node-utils';
|
|
3
|
-
import {
|
|
3
|
+
import { rootDB, setupTestDatabase } from '@appsemble/server';
|
|
4
4
|
// eslint-disable-next-line import/no-extraneous-dependencies
|
|
5
|
-
import { afterAll,
|
|
5
|
+
import { afterAll, beforeAll, beforeEach, vi } from 'vitest';
|
|
6
6
|
setFixtureBase(import.meta);
|
|
7
7
|
delete process.env[CREDENTIALS_ENV_VAR];
|
|
8
8
|
setLogLevel(0);
|
|
@@ -19,18 +19,14 @@ beforeAll(async () => {
|
|
|
19
19
|
});
|
|
20
20
|
});
|
|
21
21
|
beforeEach(async () => {
|
|
22
|
-
await models.dropAndCloseAllAppDBs();
|
|
23
22
|
await testDB.truncate({ truncate: true, cascade: true, force: true, restartIdentity: true });
|
|
24
23
|
vi.useRealTimers();
|
|
25
24
|
await clearAllS3Buckets();
|
|
26
25
|
});
|
|
27
|
-
afterEach(async () => {
|
|
28
|
-
await models.dropAndCloseAllAppDBs();
|
|
29
|
-
});
|
|
30
26
|
afterAll(() => {
|
|
31
27
|
testDB.close();
|
|
32
28
|
// We need to drop the test database from the root database
|
|
33
29
|
// testDB.drop() doesn't actually delete the database
|
|
34
|
-
|
|
30
|
+
rootDB.query(`DROP DATABASE ${testDB.getDatabaseName()}`);
|
|
35
31
|
});
|
|
36
32
|
//# sourceMappingURL=vitest.setup.js.map
|