@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 CHANGED
@@ -1,9 +1,9 @@
1
- # ![](https://gitlab.com/appsemble/appsemble/-/raw/0.34.1-test.3/config/assets/logo.svg) Appsemble CLI
1
+ # ![](https://gitlab.com/appsemble/appsemble/-/raw/0.34.4/config/assets/logo.svg) Appsemble CLI
2
2
 
3
3
  > Manage apps and blocks from the command line.
4
4
 
5
5
  [![npm](https://img.shields.io/npm/v/@appsemble/cli)](https://www.npmjs.com/package/@appsemble/cli)
6
- [![GitLab CI](https://gitlab.com/appsemble/appsemble/badges/0.34.1-test.3/pipeline.svg)](https://gitlab.com/appsemble/appsemble/-/releases/0.34.1-test.3)
6
+ [![GitLab CI](https://gitlab.com/appsemble/appsemble/badges/0.34.4/pipeline.svg)](https://gitlab.com/appsemble/appsemble/-/releases/0.34.4)
7
7
  [![Prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](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.1-test.3/LICENSE.md) ©
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.";
@@ -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 }) {
@@ -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.";
@@ -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 }) {
@@ -14,6 +14,7 @@ export function builder(yargs) {
14
14
  .option('database-port', {
15
15
  desc: 'The port of the database to connect to.',
16
16
  type: 'number',
17
+ default: 5432,
17
18
  })
18
19
  .option('database-ssl', {
19
20
  desc: 'Use SSL to connect to the database.',
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 checkAppMigrations from './commands/checkMigrations.js';
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(checkAppMigrations)
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({ appId, clientCredentials, id, remote, }: SharedExistingGroupParams): Promise<void>;
63
- export declare function updateGroup({ annotations, appId, id, name, remote, }: UpdateGroupParams): Promise<void>;
64
- export declare function inviteMember({ appId, id, remote, role, user, }: InviteGroupMemberParams): Promise<void>;
65
- export declare function updateMember({ appId, id, remote, role, user, }: UpdateGroupMemberParams): Promise<void>;
66
- export declare function deleteMember({ appId, id, user }: SharedGroupMemberParams): Promise<void>;
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({ appId, clientCredentials, id, remote, }) {
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/apps/${appId}/groups/${id}`, { baseURL: remote });
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 = [], appId, id, name, remote, }) {
31
+ export async function updateGroup({ annotations = [], id, name, remote, }) {
32
32
  logger.info(`Updating group ${id}`);
33
- await axios.patch(`/api/apps/${appId}/groups/${id}`, {
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({ appId, id, remote, role, user, }) {
39
+ export async function inviteMember({ id, remote, role, user, }) {
40
40
  logger.info(`Inviting ${user} to group ${id}`);
41
- await axios.post(`/api/apps/${appId}/groups/${id}/invites`, [{ email: user, role }], {
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({ appId, id, remote, role, user, }) {
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/apps/${appId}/group-members/${user}/role`, { role }, { baseURL: remote });
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({ appId, id, user }) {
51
+ export async function deleteMember({ id, user }) {
52
52
  logger.info(`Deleting ${user} to group ${id}`);
53
- await axios.delete(`/api/apps/${appId}/group-members/${user}?selectedGroupId=${id}`);
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.1-test.3",
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.1-test.3",
48
- "@appsemble/types": "0.34.1-test.3",
49
- "@appsemble/lang-sdk": "0.34.1-test.3",
50
- "@appsemble/utils": "0.34.1-test.3",
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.1-test.3",
94
- "@appsemble/server": "0.34.1-test.3",
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.1-test.3
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.1-test.3
20
+ version: 0.34.4
21
21
  parameters:
22
22
  icon: arrow-left
23
23
  actions:
@@ -5,7 +5,7 @@
5
5
  "*.css"
6
6
  ],
7
7
  "dependencies": {
8
- "@appsemble/sdk": "0.34.1-test.3",
8
+ "@appsemble/sdk": "0.34.4",
9
9
  "mini-jsx": "^4.0.0"
10
10
  }
11
11
  }
@@ -5,8 +5,8 @@
5
5
  "*.css"
6
6
  ],
7
7
  "dependencies": {
8
- "@appsemble/preact": "0.34.1-test.3",
9
- "@appsemble/sdk": "0.34.1-test.3",
8
+ "@appsemble/preact": "0.34.4",
9
+ "@appsemble/sdk": "0.34.4",
10
10
  "preact": "^10.0.0"
11
11
  }
12
12
  }
@@ -5,6 +5,6 @@
5
5
  "*.css"
6
6
  ],
7
7
  "dependencies": {
8
- "@appsemble/sdk": "0.34.1-test.3"
8
+ "@appsemble/sdk": "0.34.4"
9
9
  }
10
10
  }
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 { getRootDB, models, setupTestDatabase } from '@appsemble/server';
3
+ import { rootDB, setupTestDatabase } from '@appsemble/server';
4
4
  // eslint-disable-next-line import/no-extraneous-dependencies
5
- import { afterAll, afterEach, beforeAll, beforeEach, vi } from 'vitest';
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
- getRootDB().query(`DROP DATABASE ${testDB.getDatabaseName()}`);
30
+ rootDB.query(`DROP DATABASE ${testDB.getDatabaseName()}`);
35
31
  });
36
32
  //# sourceMappingURL=vitest.setup.js.map