@appsemble/cli 0.36.4 → 0.36.5-test.0
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/cleanupExpiredDomains.d.ts +6 -0
- package/commands/cleanupExpiredDomains.js +64 -0
- package/commands/reencryptSecrets.d.ts +6 -0
- package/commands/reencryptSecrets.js +45 -0
- package/commands/restoreDataFromBackup.js +4 -1
- package/index.js +4 -0
- package/lib/serverImport.d.ts +1 -1
- 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/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.36.5-test.0)
|
|
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.36.
|
|
326
|
+
[LGPL-3.0-only](https://gitlab.com/appsemble/appsemble/-/blob/0.36.5-test.0/LICENSE.md) ©
|
|
327
327
|
[Appsemble](https://appsemble.com)
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type Argv } from 'yargs';
|
|
2
|
+
import { type BaseArguments } from '../types.js';
|
|
3
|
+
export declare const command = "cleanup-expired-domains";
|
|
4
|
+
export declare const description = "Sends emails to organization owners for app and app collection domains that have expired more than a week ago and sets the domain to null.";
|
|
5
|
+
export declare function builder(yargs: Argv): Argv<any>;
|
|
6
|
+
export declare function handler(argv: BaseArguments): Promise<void>;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { serverImport } from '../lib/serverImport.js';
|
|
2
|
+
export const command = 'cleanup-expired-domains';
|
|
3
|
+
export const description = 'Sends emails to organization owners for app and app collection domains that have expired more than a week ago and sets the domain to null.';
|
|
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
|
+
.option('smtp-host', {
|
|
35
|
+
desc: 'The host of the SMTP server to connect to.',
|
|
36
|
+
})
|
|
37
|
+
.option('smtp-port', {
|
|
38
|
+
desc: 'The port of the SMTP server to connect to.',
|
|
39
|
+
type: 'number',
|
|
40
|
+
})
|
|
41
|
+
.option('smtp-secure', {
|
|
42
|
+
desc: 'Use TLS when connecting to the SMTP server.',
|
|
43
|
+
type: 'boolean',
|
|
44
|
+
default: false,
|
|
45
|
+
})
|
|
46
|
+
.option('smtp-user', {
|
|
47
|
+
desc: 'The user to use to login to the SMTP server.',
|
|
48
|
+
implies: ['smtp-pass', 'smtp-from'],
|
|
49
|
+
})
|
|
50
|
+
.option('smtp-pass', {
|
|
51
|
+
desc: 'The password to use to login to the SMTP server.',
|
|
52
|
+
implies: ['smtp-user', 'smtp-from'],
|
|
53
|
+
})
|
|
54
|
+
.option('smtp-from', {
|
|
55
|
+
desc: 'The address to use when sending emails.',
|
|
56
|
+
implies: ['smtp-user', 'smtp-pass'],
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
export async function handler(argv) {
|
|
60
|
+
const { cleanupExpiredDomains, setArgv } = await serverImport('setArgv', 'cleanupExpiredDomains');
|
|
61
|
+
setArgv(argv);
|
|
62
|
+
return cleanupExpiredDomains();
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=cleanupExpiredDomains.js.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type Argv } from 'yargs';
|
|
2
|
+
import { type BaseArguments } from '../types.js';
|
|
3
|
+
export declare const command = "reencrypt-secrets";
|
|
4
|
+
export declare const description = "Re-encrypts all secrets in the database using the current AES secret. Use this when rotating from an old AES secret to a new one.";
|
|
5
|
+
export declare function builder(yargs: Argv): Argv<any>;
|
|
6
|
+
export declare function handler(argv: BaseArguments): Promise<void>;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { serverImport } from '../lib/serverImport.js';
|
|
2
|
+
export const command = 'reencrypt-secrets';
|
|
3
|
+
export const description = 'Re-encrypts all secrets in the database using the current AES secret. Use this when rotating from an old AES secret to a new one.';
|
|
4
|
+
export function builder(yargs) {
|
|
5
|
+
return yargs
|
|
6
|
+
.option('old-aes-secret', {
|
|
7
|
+
desc: 'The old AES secret that was used to encrypt the secrets',
|
|
8
|
+
type: 'string',
|
|
9
|
+
demandOption: true,
|
|
10
|
+
})
|
|
11
|
+
.option('database-host', {
|
|
12
|
+
desc: 'The host of the database to connect to. This defaults to the connected database container.',
|
|
13
|
+
})
|
|
14
|
+
.option('database-port', {
|
|
15
|
+
desc: 'The port of the database to connect to.',
|
|
16
|
+
type: 'number',
|
|
17
|
+
default: 5432,
|
|
18
|
+
})
|
|
19
|
+
.option('database-ssl', {
|
|
20
|
+
desc: 'Use SSL to connect to the database.',
|
|
21
|
+
type: 'boolean',
|
|
22
|
+
})
|
|
23
|
+
.option('database-name', {
|
|
24
|
+
desc: 'The name of the database to connect to.',
|
|
25
|
+
implies: ['database-user', 'database-password'],
|
|
26
|
+
})
|
|
27
|
+
.option('database-user', {
|
|
28
|
+
desc: 'The user to use to login to the database.',
|
|
29
|
+
implies: ['database-name', 'database-password'],
|
|
30
|
+
})
|
|
31
|
+
.option('database-password', {
|
|
32
|
+
desc: 'The password to use to login to the database.',
|
|
33
|
+
implies: ['database-name', 'database-user'],
|
|
34
|
+
})
|
|
35
|
+
.option('database-url', {
|
|
36
|
+
desc: 'A connection string for the database to connect to. This is an alternative to the separate database related variables.',
|
|
37
|
+
conflicts: ['database-host', 'database-name', 'database-user', 'database-password'],
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
export async function handler(argv) {
|
|
41
|
+
const { reencryptSecrets, setArgv } = await serverImport('setArgv', 'reencryptSecrets');
|
|
42
|
+
setArgv(argv);
|
|
43
|
+
return reencryptSecrets(argv);
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=reencryptSecrets.js.map
|
|
@@ -3,6 +3,9 @@ export const command = 'restore-data-from-backup';
|
|
|
3
3
|
export const description = 'Restore appsemble data from a specified backup for the main database and app databases';
|
|
4
4
|
export function builder(yargs) {
|
|
5
5
|
return yargs
|
|
6
|
+
.option('aesSecret', {
|
|
7
|
+
desc: 'Aes Secret used for encrypting DB password in the backup DB',
|
|
8
|
+
})
|
|
6
9
|
.option('database-host', {
|
|
7
10
|
desc: 'The host of the database to connect to. This defaults to the connected database container.',
|
|
8
11
|
})
|
|
@@ -31,7 +34,7 @@ export function builder(yargs) {
|
|
|
31
34
|
desc: 'A connection string for the database to connect to. This is an alternative to the separate database related variables.',
|
|
32
35
|
conflicts: ['database-host', 'database-name', 'database-user', 'database-password'],
|
|
33
36
|
})
|
|
34
|
-
.option('
|
|
37
|
+
.option('restoreBackupFilename', {
|
|
35
38
|
type: 'string',
|
|
36
39
|
describe: 'The appsemble backup file to restore data from, e.g., appsemble_prod_backup_20250101.sql.gz',
|
|
37
40
|
demandOption: true,
|
package/index.js
CHANGED
|
@@ -11,6 +11,7 @@ import * as chargeOrganizationSubscriptions from './commands/chargeOrganizationS
|
|
|
11
11
|
import * as checkDownMigrations from './commands/checkDownMigrations.js';
|
|
12
12
|
import * as checkAppMigrations from './commands/checkMigrations.js';
|
|
13
13
|
import * as cleanupDemoAppMembers from './commands/cleanupDemoAppMembers.js';
|
|
14
|
+
import * as cleanupExpiredDomains from './commands/cleanupExpiredDomains.js';
|
|
14
15
|
import * as cleanupResourcesAndAssets from './commands/cleanupResourcesAndAssets.js';
|
|
15
16
|
import * as cleanupSoftDeletedRecords from './commands/cleanupSoftDeletedRecords.js';
|
|
16
17
|
import * as config from './commands/config/index.js';
|
|
@@ -20,6 +21,7 @@ import * as login from './commands/login.js';
|
|
|
20
21
|
import * as logout from './commands/logout.js';
|
|
21
22
|
import * as migrate from './commands/migrate.js';
|
|
22
23
|
import * as migrateAppDefinitions from './commands/migrateAppDefinitions.js';
|
|
24
|
+
import * as reencryptSecrets from './commands/reencryptSecrets.js';
|
|
23
25
|
import * as organization from './commands/organization/index.js';
|
|
24
26
|
import * as resource from './commands/resource/index.js';
|
|
25
27
|
import * as restoreDataFromBackup from './commands/restoreDataFromBackup.js';
|
|
@@ -62,6 +64,7 @@ let parser = yargs(process.argv.slice(2))
|
|
|
62
64
|
.command(backupProductionData)
|
|
63
65
|
.command(restoreDataFromBackup)
|
|
64
66
|
.command(cleanupDemoAppMembers)
|
|
67
|
+
.command(cleanupExpiredDomains)
|
|
65
68
|
.command(cleanupSoftDeletedRecords)
|
|
66
69
|
.command(checkAppMigrations)
|
|
67
70
|
.command(checkDownMigrations)
|
|
@@ -71,6 +74,7 @@ let parser = yargs(process.argv.slice(2))
|
|
|
71
74
|
.command(logout)
|
|
72
75
|
.command(migrate)
|
|
73
76
|
.command(migrateAppDefinitions)
|
|
77
|
+
.command(reencryptSecrets)
|
|
74
78
|
.command(organization)
|
|
75
79
|
.command(resource)
|
|
76
80
|
.command(runCronJobs)
|
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 'backupProductionData' | 'chargeOrganizationSubscriptions' | 'checkDownMigrations' | 'checkMigrations' | 'cleanupDemoAppMembers' | 'cleanupResourcesAndAssets' | 'cleanupSoftDeletedRecords' | 'fuzzMigrations' | 'migrate' | 'migrateAppDefinitions' | 'restoreDataFromBackup' | 'runCronJobs' | 'scaleContainers' | 'setArgv' | 'start' | 'synchronizeTrainings'>(...members: T[]): Promise<Record<T, any>>;
|
|
7
|
+
export declare function serverImport<T extends 'backupProductionData' | 'chargeOrganizationSubscriptions' | 'checkDownMigrations' | 'checkMigrations' | 'cleanupDemoAppMembers' | 'cleanupExpiredDomains' | 'cleanupResourcesAndAssets' | 'cleanupSoftDeletedRecords' | 'fuzzMigrations' | 'migrate' | 'migrateAppDefinitions' | 'reencryptSecrets' | 'restoreDataFromBackup' | 'runCronJobs' | 'scaleContainers' | 'setArgv' | 'start' | 'synchronizeTrainings'>(...members: T[]): Promise<Record<T, any>>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@appsemble/cli",
|
|
3
|
-
"version": "0.36.
|
|
3
|
+
"version": "0.36.5-test.0",
|
|
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.36.
|
|
48
|
-
"@appsemble/types": "0.36.
|
|
49
|
-
"@appsemble/lang-sdk": "0.36.
|
|
50
|
-
"@appsemble/utils": "0.36.
|
|
47
|
+
"@appsemble/node-utils": "0.36.5-test.0",
|
|
48
|
+
"@appsemble/types": "0.36.5-test.0",
|
|
49
|
+
"@appsemble/lang-sdk": "0.36.5-test.0",
|
|
50
|
+
"@appsemble/utils": "0.36.5-test.0",
|
|
51
51
|
"@fortawesome/fontawesome-common-types": "^6.0.0",
|
|
52
52
|
"@inquirer/prompts": "^8.0.0",
|
|
53
53
|
"@koa/cors": "^5.0.0",
|
|
@@ -89,8 +89,8 @@
|
|
|
89
89
|
"yargs": "^17.0.0"
|
|
90
90
|
},
|
|
91
91
|
"devDependencies": {
|
|
92
|
-
"@appsemble/types": "0.36.
|
|
93
|
-
"@appsemble/server": "0.36.
|
|
92
|
+
"@appsemble/types": "0.36.5-test.0",
|
|
93
|
+
"@appsemble/server": "0.36.5-test.0",
|
|
94
94
|
"@types/concat-stream": "2.0.3",
|
|
95
95
|
"@types/koa__cors": "5.0.1",
|
|
96
96
|
"@types/koa-compress": "4.0.7",
|
|
@@ -6,7 +6,7 @@ pages:
|
|
|
6
6
|
- name: Example Page A
|
|
7
7
|
blocks:
|
|
8
8
|
- type: action-button
|
|
9
|
-
version: 0.36.
|
|
9
|
+
version: 0.36.5-test.0
|
|
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.36.
|
|
20
|
+
version: 0.36.5-test.0
|
|
21
21
|
parameters:
|
|
22
22
|
icon: arrow-left
|
|
23
23
|
actions:
|