@appsemble/cli 0.36.3-test.5 → 0.36.3

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.36.3-test.5/config/assets/logo.svg) Appsemble CLI
1
+ # ![](https://gitlab.com/appsemble/appsemble/-/raw/0.36.3/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.36.3-test.5/pipeline.svg)](https://gitlab.com/appsemble/appsemble/-/releases/0.36.3-test.5)
6
+ [![GitLab CI](https://gitlab.com/appsemble/appsemble/badges/0.36.3/pipeline.svg)](https://gitlab.com/appsemble/appsemble/-/releases/0.36.3)
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.36.3-test.5/LICENSE.md) ©
326
+ [LGPL-3.0-only](https://gitlab.com/appsemble/appsemble/-/blob/0.36.3/LICENSE.md) ©
327
327
  [Appsemble](https://appsemble.com)
@@ -1,4 +1,4 @@
1
- import { type AppLock, type AppVisibility } from '@appsemble/types';
1
+ import { type AppLock, type AppTotp, type AppVisibility } from '@appsemble/types';
2
2
  import { type Argv } from 'yargs';
3
3
  import { type BaseArguments } from '../../types.js';
4
4
  interface PatchAppArguments extends BaseArguments {
@@ -11,6 +11,7 @@ interface PatchAppArguments extends BaseArguments {
11
11
  template?: boolean;
12
12
  demoMode?: boolean;
13
13
  locked?: AppLock;
14
+ totp?: AppTotp;
14
15
  showAppsembleOAuth2Login?: boolean;
15
16
  showAppsembleLogin?: boolean;
16
17
  displayAppMemberName?: boolean;
@@ -34,6 +34,11 @@ export function builder(yargs) {
34
34
  description: 'Change the value of AppLock for your app.',
35
35
  type: 'string',
36
36
  choices: ['fullLock', 'studioLock', 'unlocked'],
37
+ })
38
+ .option('totp', {
39
+ description: 'The TOTP (two-factor authentication) setting for the app. Use "disabled" to turn off, "enabled" to make it optional, or "required" to enforce for all app members. WARNING: Setting "required" will lock out existing users who have not yet enabled 2FA.',
40
+ type: 'string',
41
+ choices: ['disabled', 'enabled', 'required'],
37
42
  })
38
43
  .option('showAppsembleOAuth2Login', {
39
44
  description: 'Whether the Appsemble OAuth2 login method should be shown',
@@ -1,5 +1,5 @@
1
1
  import { type ReadStream } from 'node:fs';
2
- import { type AppVisibility } from '@appsemble/types';
2
+ import { type AppTotp, type AppVisibility } from '@appsemble/types';
3
3
  import { type Argv } from 'yargs';
4
4
  import { type BaseArguments } from '../../types.js';
5
5
  interface PublishAppArguments extends BaseArguments {
@@ -18,6 +18,7 @@ interface PublishAppArguments extends BaseArguments {
18
18
  assetsClonable: boolean;
19
19
  modifyContext: boolean;
20
20
  visibility: AppVisibility;
21
+ totp: AppTotp;
21
22
  sentryDsn: string;
22
23
  sentryEnvironment: string;
23
24
  googleAnalyticsId: string;
@@ -43,6 +43,10 @@ export function builder(yargs) {
43
43
  .option('demo-mode', {
44
44
  describe: 'Whether the app should be used in demo mode.',
45
45
  type: 'boolean',
46
+ })
47
+ .option('totp', {
48
+ describe: 'The TOTP (two-factor authentication) setting for the app. Use "disabled" to turn off, "enabled" to make it optional, or "required" to enforce for all app members. WARNING: Setting "required" will lock out existing users who have not yet enabled 2FA.',
49
+ choices: ['disabled', 'enabled', 'required'],
46
50
  })
47
51
  .option('dry-run', {
48
52
  describe: 'Whether the API should be called to run without actually creating the app.',
@@ -1,5 +1,5 @@
1
1
  import { type ReadStream } from 'node:fs';
2
- import { type AppVisibility } from '@appsemble/types';
2
+ import { type AppTotp, type AppVisibility } from '@appsemble/types';
3
3
  import { type Argv } from 'yargs';
4
4
  import { type BaseArguments } from '../../types.js';
5
5
  interface UpdateAppArguments extends BaseArguments {
@@ -11,6 +11,7 @@ interface UpdateAppArguments extends BaseArguments {
11
11
  id: number;
12
12
  template: boolean;
13
13
  demoMode: boolean;
14
+ totp: AppTotp;
14
15
  resources: boolean;
15
16
  assets: boolean;
16
17
  assetsClonable: boolean;
@@ -46,6 +46,10 @@ export function builder(yargs) {
46
46
  .option('demo-mode', {
47
47
  describe: 'Whether the app should be used in demo mode.',
48
48
  type: 'boolean',
49
+ })
50
+ .option('totp', {
51
+ describe: 'The TOTP (two-factor authentication) setting for the app. Use "disabled" to turn off, "enabled" to make it optional, or "required" to enforce for all app members. WARNING: Setting "required" will lock out existing users who have not yet enabled 2FA.',
52
+ choices: ['disabled', 'enabled', 'required'],
49
53
  })
50
54
  .option('resources', {
51
55
  describe: 'Whether the resources from the `resources` directory should replace the seed resources of the app being updated. The names of sub-directories are used as the name of the resource, otherwise the names of top level resource .json files are used instead.',
package/lib/app.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { type ReadStream } from 'node:fs';
2
- import { type App, type AppLock, type AppsembleContext, type AppsembleRC, type AppVisibility, type ValueFromDefinition, type ValueFromProcess } from '@appsemble/types';
2
+ import { type App, type AppLock, type AppsembleContext, type AppsembleRC, type AppTotp, type AppVisibility, type ValueFromDefinition, type ValueFromProcess } from '@appsemble/types';
3
3
  import FormData from 'form-data';
4
4
  /**
5
5
  * Traverses an app directory and appends the files it finds to the given FormData object.
@@ -181,6 +181,10 @@ interface PublishAppParams {
181
181
  * The password of the external app database.
182
182
  */
183
183
  dbPassword?: string;
184
+ /**
185
+ * The TOTP (two-factor authentication) setting for the app.
186
+ */
187
+ totp?: AppTotp;
184
188
  }
185
189
  /**
186
190
  * Publish a new app.
@@ -305,6 +309,10 @@ interface UpdateAppParams {
305
309
  * The password of the external app database.
306
310
  */
307
311
  dbPassword?: string;
312
+ /**
313
+ * The TOTP (two-factor authentication) setting for the app.
314
+ */
315
+ totp?: AppTotp;
308
316
  }
309
317
  /**
310
318
  * Update an existing app.
@@ -381,6 +389,10 @@ interface PatchAppParams {
381
389
  * Whether the app is currently locked.
382
390
  */
383
391
  locked?: AppLock;
392
+ /**
393
+ * The TOTP (two-factor authentication) setting for the app.
394
+ */
395
+ totp?: AppTotp;
384
396
  }
385
397
  export declare function patchApp({ id, remote, ...options }: PatchAppParams): Promise<void>;
386
398
  export {};
package/lib/app.js CHANGED
@@ -820,6 +820,7 @@ export async function publishApp({ clientCredentials, context, dryRun, modifyCon
820
820
  const dbPort = appsembleContext.dbPort ?? options.dbPort;
821
821
  const dbUser = appsembleContext.dbUser ?? options.dbUser;
822
822
  const skipGroupInvites = appsembleContext.skipGroupInvites ?? options.skipGroupInvites ?? false;
823
+ const totp = appsembleContext.totp ?? options.totp;
823
824
  const { dbPassword } = options;
824
825
  logger.verbose(`App remote: ${remote}`);
825
826
  logger.verbose(`App organization: ${organizationId}`);
@@ -883,6 +884,10 @@ export async function publishApp({ clientCredentials, context, dryRun, modifyCon
883
884
  logger.info('Using MS Clarity');
884
885
  formData.append('msClarityID', msClarityId);
885
886
  }
887
+ if (totp) {
888
+ logger.info(`Setting TOTP to ${totp}`);
889
+ formData.append('totp', totp);
890
+ }
886
891
  let authScope = 'apps:write';
887
892
  if (resources) {
888
893
  authScope += ' resources:write';
@@ -1033,6 +1038,7 @@ export async function updateApp({ clientCredentials, context, force, path, ...op
1033
1038
  const dbHost = appsembleContext.dbHost ?? options.dbHost;
1034
1039
  const dbPort = appsembleContext.dbPort ?? options.dbPort;
1035
1040
  const dbUser = appsembleContext.dbUser ?? options.dbUser;
1041
+ const totp = appsembleContext.totp ?? options.totp;
1036
1042
  const { dbPassword } = options;
1037
1043
  logger.info(`App id: ${id}`);
1038
1044
  logger.verbose(`App remote: ${remote}`);
@@ -1098,6 +1104,10 @@ export async function updateApp({ clientCredentials, context, force, path, ...op
1098
1104
  logger.info('Using MS Clarity');
1099
1105
  formData.append('msClarityID', msClarityId);
1100
1106
  }
1107
+ if (totp) {
1108
+ logger.info(`Setting TOTP to ${totp}`);
1109
+ formData.append('totp', totp);
1110
+ }
1101
1111
  let authScope = 'apps:write';
1102
1112
  if (resources) {
1103
1113
  authScope += ' resources:write';
@@ -1216,6 +1226,10 @@ export async function patchApp({ id, remote, ...options }) {
1216
1226
  logger.info(`Setting enableSelfRegistration to ${options.enableSelfRegistration}`);
1217
1227
  formData.append('enableSelfRegistration', String(options.enableSelfRegistration));
1218
1228
  }
1229
+ if (options.totp !== undefined) {
1230
+ logger.info(`Setting totp to ${options.totp}`);
1231
+ formData.append('totp', options.totp);
1232
+ }
1219
1233
  try {
1220
1234
  if (!formData.getLengthSync() && options.locked === undefined) {
1221
1235
  logger.warn('Nothing to patch. Need at least one additional argument to patch app.');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@appsemble/cli",
3
- "version": "0.36.3-test.5",
3
+ "version": "0.36.3",
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.3-test.5",
48
- "@appsemble/types": "0.36.3-test.5",
49
- "@appsemble/lang-sdk": "0.36.3-test.5",
50
- "@appsemble/utils": "0.36.3-test.5",
47
+ "@appsemble/node-utils": "0.36.3",
48
+ "@appsemble/types": "0.36.3",
49
+ "@appsemble/lang-sdk": "0.36.3",
50
+ "@appsemble/utils": "0.36.3",
51
51
  "@fortawesome/fontawesome-common-types": "^6.0.0",
52
52
  "@koa/cors": "^5.0.0",
53
53
  "@odata/parser": "^0.2.0",
@@ -89,8 +89,8 @@
89
89
  "yargs": "^17.0.0"
90
90
  },
91
91
  "devDependencies": {
92
- "@appsemble/types": "0.36.3-test.5",
93
- "@appsemble/server": "0.36.3-test.5",
92
+ "@appsemble/types": "0.36.3",
93
+ "@appsemble/server": "0.36.3",
94
94
  "axios-test-instance": "7.0.0",
95
95
  "bcrypt": "5.1.1",
96
96
  "big-integer": "1.6.52",
@@ -6,7 +6,7 @@ pages:
6
6
  - name: Example Page A
7
7
  blocks:
8
8
  - type: action-button
9
- version: 0.36.3-test.5
9
+ version: 0.36.3
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.3-test.5
20
+ version: 0.36.3
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.36.3-test.5",
8
+ "@appsemble/sdk": "0.36.3",
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.36.3-test.5",
9
- "@appsemble/sdk": "0.36.3-test.5",
8
+ "@appsemble/preact": "0.36.3",
9
+ "@appsemble/sdk": "0.36.3",
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.36.3-test.5"
8
+ "@appsemble/sdk": "0.36.3"
9
9
  }
10
10
  }