@appsemble/cli 0.35.14 → 0.35.15

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.35.14/config/assets/logo.svg) Appsemble CLI
1
+ # ![](https://gitlab.com/appsemble/appsemble/-/raw/0.35.15/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.35.14/pipeline.svg)](https://gitlab.com/appsemble/appsemble/-/releases/0.35.14)
6
+ [![GitLab CI](https://gitlab.com/appsemble/appsemble/badges/0.35.15/pipeline.svg)](https://gitlab.com/appsemble/appsemble/-/releases/0.35.15)
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.35.14/LICENSE.md) ©
326
+ [LGPL-3.0-only](https://gitlab.com/appsemble/appsemble/-/blob/0.35.15/LICENSE.md) ©
327
327
  [Appsemble](https://appsemble.com)
@@ -22,6 +22,7 @@ interface PublishAppArguments extends BaseArguments {
22
22
  sentryEnvironment: string;
23
23
  googleAnalyticsId: string;
24
24
  metaPixelId: string;
25
+ msClarityId: string;
25
26
  dbName: string;
26
27
  dbHost: string;
27
28
  dbPort: number;
@@ -76,6 +76,9 @@ export function builder(yargs) {
76
76
  })
77
77
  .option('meta-pixel-id', {
78
78
  describe: 'The ID for Meta Pixel for the app.',
79
+ })
80
+ .option('ms-clarity-id', {
81
+ describe: 'The ID for MS Clarity for the app.',
79
82
  })
80
83
  .option('sentry-dsn', {
81
84
  describe: 'The custom Sentry DSN for the app.',
@@ -20,6 +20,7 @@ interface UpdateAppArguments extends BaseArguments {
20
20
  sentryEnvironment: string;
21
21
  googleAnalyticsId: string;
22
22
  metaPixelId: string;
23
+ msClarityId: string;
23
24
  dbName: string;
24
25
  dbHost: string;
25
26
  dbPort: number;
@@ -76,6 +76,9 @@ export function builder(yargs) {
76
76
  })
77
77
  .option('meta-pixel-id', {
78
78
  describe: 'The ID for Meta Pixel for the app.',
79
+ })
80
+ .option('ms-clarity-id', {
81
+ describe: 'The ID for MS Clarity for the app.',
79
82
  })
80
83
  .option('sentry-dsn', {
81
84
  describe: 'The custom Sentry DSN for the app.',
@@ -0,0 +1,6 @@
1
+ import { type Argv } from 'yargs';
2
+ import { type BaseArguments } from '../types.js';
3
+ export declare const command = "backup-production-data";
4
+ export declare const description = "Backs up data from the main database and app databases.";
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 = 'backup-production-data';
3
+ export const description = 'Backs up data from the main database and app databases.';
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 { backupProductionData, setArgv } = await serverImport('setArgv', 'backupProductionData');
37
+ setArgv(argv);
38
+ return backupProductionData();
39
+ }
40
+ //# sourceMappingURL=backupProductionData.js.map
@@ -0,0 +1,6 @@
1
+ import { type Argv } from 'yargs';
2
+ import { type BaseArguments } from '../types.js';
3
+ export declare const command = "restore-data-from-backup";
4
+ export declare const description = "Restore appsemble data from a specified backup for the main database and app databases";
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 = 'restore-data-from-backup';
3
+ export const description = 'Restore appsemble data from a specified backup for the main database and app databases';
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('appsembleBackupFile', {
35
+ type: 'string',
36
+ describe: 'The appsemble backup file to restore data from, e.g., appsemble_prod_backup_20250101.sql.gz',
37
+ demandOption: true,
38
+ });
39
+ }
40
+ export async function handler(argv) {
41
+ const { restoreDataFromBackup, setArgv } = await serverImport('setArgv', 'restoreDataFromBackup');
42
+ setArgv(argv);
43
+ return restoreDataFromBackup();
44
+ }
45
+ //# sourceMappingURL=restoreDataFromBackup.js.map
package/index.js CHANGED
@@ -5,6 +5,7 @@ import { cosmiconfig } from 'cosmiconfig';
5
5
  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
+ import * as backupProductionData from './commands/backupProductionData.js';
8
9
  import * as block from './commands/block/index.js';
9
10
  import * as chargeOrganizationSubscriptions from './commands/chargeOrganizationSubscriptions.js';
10
11
  import * as checkDownMigrations from './commands/checkDownMigrations.js';
@@ -21,6 +22,7 @@ import * as migrate from './commands/migrate.js';
21
22
  import * as migrateAppDefinitions from './commands/migrateAppDefinitions.js';
22
23
  import * as organization from './commands/organization/index.js';
23
24
  import * as resource from './commands/resource/index.js';
25
+ import * as restoreDataFromBackup from './commands/restoreDataFromBackup.js';
24
26
  import * as runCronJobs from './commands/runCronJobs.js';
25
27
  import * as scaleContainers from './commands/scaleContainers.js';
26
28
  import * as serve from './commands/serve.js';
@@ -57,6 +59,8 @@ let parser = yargs(process.argv.slice(2))
57
59
  .command(asset)
58
60
  .command(block)
59
61
  .command(cleanupResourcesAndAssets)
62
+ .command(backupProductionData)
63
+ .command(restoreDataFromBackup)
60
64
  .command(cleanupDemoAppMembers)
61
65
  .command(cleanupSoftDeletedRecords)
62
66
  .command(checkAppMigrations)
package/lib/app.d.ts CHANGED
@@ -145,6 +145,10 @@ interface PublishAppParams {
145
145
  * The ID to use for Meta Pixel for the app.
146
146
  */
147
147
  metaPixelId?: string;
148
+ /**
149
+ * The ID to use for MS Clarity for the app.
150
+ */
151
+ msClarityId?: string;
148
152
  /**
149
153
  * The custom Sentry DSN for the app.
150
154
  */
@@ -261,6 +265,10 @@ interface UpdateAppParams {
261
265
  * The ID to use for Meta Pixel for the app.
262
266
  */
263
267
  metaPixelId?: string;
268
+ /**
269
+ * The ID to use for MS Clarity for the app.
270
+ */
271
+ msClarityId?: string;
264
272
  /**
265
273
  * The custom Sentry DSN for the app.
266
274
  */
package/lib/app.js CHANGED
@@ -805,6 +805,7 @@ export async function publishApp({ clientCredentials, context, dryRun, modifyCon
805
805
  const sentryEnvironment = appsembleContext.sentryEnvironment ?? options.sentryEnvironment;
806
806
  const googleAnalyticsId = appsembleContext.googleAnalyticsId ?? options.googleAnalyticsId;
807
807
  const metaPixelId = appsembleContext.metaPixelId ?? options.metaPixelId;
808
+ const msClarityId = appsembleContext.msClarityId ?? options.msClarityId;
808
809
  const assets = appsembleContext.assets ?? options.assets;
809
810
  const resources = appsembleContext.resources ?? options.resources;
810
811
  const members = appsembleContext.members ?? options.members;
@@ -872,6 +873,10 @@ export async function publishApp({ clientCredentials, context, dryRun, modifyCon
872
873
  logger.info('Using Meta Pixel');
873
874
  formData.append('metaPixelID', metaPixelId);
874
875
  }
876
+ if (msClarityId) {
877
+ logger.info('Using MS Clarity');
878
+ formData.append('msClarityID', msClarityId);
879
+ }
875
880
  let authScope = 'apps:write';
876
881
  if (resources) {
877
882
  authScope += ' resources:write';
@@ -1012,6 +1017,7 @@ export async function updateApp({ clientCredentials, context, force, path, ...op
1012
1017
  const sentryEnvironment = appsembleContext.sentryEnvironment ?? options.sentryEnvironment;
1013
1018
  const googleAnalyticsId = appsembleContext.googleAnalyticsId ?? options.googleAnalyticsId;
1014
1019
  const metaPixelId = appsembleContext.metaPixelId ?? options.metaPixelId;
1020
+ const msClarityId = appsembleContext.msClarityId ?? options.msClarityId;
1015
1021
  const resources = appsembleContext.resources ?? options.resources;
1016
1022
  const members = appsembleContext.members ?? options.members;
1017
1023
  const supportedLanguages = appsembleContext.supportedLanguages ?? options.supportedLanguages;
@@ -1079,6 +1085,10 @@ export async function updateApp({ clientCredentials, context, force, path, ...op
1079
1085
  logger.info('Using Meta Pixel');
1080
1086
  formData.append('metaPixelID', metaPixelId);
1081
1087
  }
1088
+ if (msClarityId) {
1089
+ logger.info('Using MS Clarity');
1090
+ formData.append('msClarityID', msClarityId);
1091
+ }
1082
1092
  let authScope = 'apps:write';
1083
1093
  if (resources) {
1084
1094
  authScope += ' resources:write';
@@ -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 'chargeOrganizationSubscriptions' | 'checkDownMigrations' | 'checkMigrations' | 'cleanupDemoAppMembers' | 'cleanupResourcesAndAssets' | 'cleanupSoftDeletedRecords' | 'fuzzMigrations' | 'migrate' | 'migrateAppDefinitions' | 'runCronJobs' | 'scaleContainers' | 'setArgv' | 'start' | 'synchronizeTrainings'>(...members: T[]): Promise<Record<T, any>>;
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>>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@appsemble/cli",
3
- "version": "0.35.14",
3
+ "version": "0.35.15",
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.35.14",
48
- "@appsemble/types": "0.35.14",
49
- "@appsemble/lang-sdk": "0.35.14",
50
- "@appsemble/utils": "0.35.14",
47
+ "@appsemble/node-utils": "0.35.15",
48
+ "@appsemble/types": "0.35.15",
49
+ "@appsemble/lang-sdk": "0.35.15",
50
+ "@appsemble/utils": "0.35.15",
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.35.14",
94
- "@appsemble/server": "0.35.14",
93
+ "@appsemble/types": "0.35.15",
94
+ "@appsemble/server": "0.35.15",
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.35.14
9
+ version: 0.35.15
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.35.14
20
+ version: 0.35.15
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.35.14",
8
+ "@appsemble/sdk": "0.35.15",
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.35.14",
9
- "@appsemble/sdk": "0.35.14",
8
+ "@appsemble/preact": "0.35.15",
9
+ "@appsemble/sdk": "0.35.15",
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.35.14"
8
+ "@appsemble/sdk": "0.35.15"
9
9
  }
10
10
  }