@appsemble/cli 0.20.13 → 0.20.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 +4 -4
- package/__fixtures__/getBlockConfigFromTypeScript/comments/tsconfig.json +1 -1
- package/__fixtures__/getBlockConfigFromTypeScript/duplicateActions/tsconfig.json +1 -1
- package/__fixtures__/getBlockConfigFromTypeScript/duplicateEventEmitters/tsconfig.json +1 -1
- package/__fixtures__/getBlockConfigFromTypeScript/duplicateEventListeners/tsconfig.json +1 -1
- package/__fixtures__/getBlockConfigFromTypeScript/duplicateParameters/tsconfig.json +1 -1
- package/__fixtures__/getBlockConfigFromTypeScript/fontawesomeParameters/tsconfig.json +1 -1
- package/__fixtures__/getBlockConfigFromTypeScript/tsError/tsconfig.json +1 -1
- package/__fixtures__/getBlockConfigFromTypeScript/valid/tsconfig.json +1 -1
- package/commands/app/create.d.ts +1 -1
- package/commands/app/create.js +16 -24
- package/commands/app/create.js.map +1 -1
- package/commands/app/create.ts +3 -3
- package/commands/app/extract-messages.d.ts +1 -1
- package/commands/app/extract-messages.js +12 -20
- package/commands/app/extract-messages.js.map +1 -1
- package/commands/app/extract-messages.ts +2 -2
- package/commands/app/index.js +12 -36
- package/commands/app/index.js.map +1 -1
- package/commands/app/index.ts +9 -5
- package/commands/app/update.d.ts +1 -1
- package/commands/app/update.js +18 -26
- package/commands/app/update.js.map +1 -1
- package/commands/app/update.ts +4 -4
- package/commands/asset/create.d.ts +1 -1
- package/commands/asset/create.js +20 -28
- package/commands/asset/create.js.map +1 -1
- package/commands/asset/create.ts +4 -4
- package/commands/asset/index.js +5 -33
- package/commands/asset/index.js.map +1 -1
- package/commands/asset/index.ts +3 -3
- package/commands/block/build.d.ts +1 -1
- package/commands/block/build.js +14 -22
- package/commands/block/build.js.map +1 -1
- package/commands/block/build.ts +2 -2
- package/commands/block/extract-messages.d.ts +1 -1
- package/commands/block/extract-messages.js +15 -23
- package/commands/block/extract-messages.js.map +1 -1
- package/commands/block/extract-messages.ts +2 -2
- package/commands/block/index.js +12 -36
- package/commands/block/index.js.map +1 -1
- package/commands/block/index.ts +9 -5
- package/commands/block/publish.d.ts +1 -1
- package/commands/block/publish.js +17 -25
- package/commands/block/publish.js.map +1 -1
- package/commands/block/publish.ts +3 -3
- package/commands/cleanupResources.d.ts +1 -1
- package/commands/cleanupResources.js +6 -11
- package/commands/cleanupResources.js.map +1 -1
- package/commands/cleanupResources.ts +2 -2
- package/commands/config/get.d.ts +1 -1
- package/commands/config/get.js +10 -17
- package/commands/config/get.js.map +1 -1
- package/commands/config/get.ts +6 -5
- package/commands/config/index.js +10 -35
- package/commands/config/index.js.map +1 -1
- package/commands/config/index.ts +7 -4
- package/commands/config/set.d.ts +1 -1
- package/commands/config/set.js +15 -22
- package/commands/config/set.js.map +1 -1
- package/commands/config/set.ts +7 -6
- package/commands/login.d.ts +1 -1
- package/commands/login.js +3 -7
- package/commands/login.js.map +1 -1
- package/commands/login.ts +1 -1
- package/commands/logout.d.ts +1 -1
- package/commands/logout.js +3 -7
- package/commands/logout.js.map +1 -1
- package/commands/logout.ts +1 -1
- package/commands/migrate.d.ts +1 -1
- package/commands/migrate.js +8 -16
- package/commands/migrate.js.map +1 -1
- package/commands/migrate.ts +3 -3
- package/commands/organization/create.d.ts +1 -1
- package/commands/organization/create.js +10 -15
- package/commands/organization/create.js.map +1 -1
- package/commands/organization/create.ts +4 -4
- package/commands/organization/index.js +10 -35
- package/commands/organization/index.js.map +1 -1
- package/commands/organization/index.ts +7 -4
- package/commands/organization/update.d.ts +1 -1
- package/commands/organization/update.js +10 -15
- package/commands/organization/update.js.map +1 -1
- package/commands/organization/update.ts +4 -4
- package/commands/resource/create.d.ts +1 -1
- package/commands/resource/create.js +18 -26
- package/commands/resource/create.js.map +1 -1
- package/commands/resource/create.ts +4 -4
- package/commands/resource/index.js +10 -35
- package/commands/resource/index.js.map +1 -1
- package/commands/resource/index.ts +7 -4
- package/commands/resource/update.d.ts +1 -1
- package/commands/resource/update.js +18 -26
- package/commands/resource/update.js.map +1 -1
- package/commands/resource/update.ts +4 -4
- package/commands/runCronJobs.d.ts +1 -1
- package/commands/runCronJobs.js +6 -11
- package/commands/runCronJobs.js.map +1 -1
- package/commands/runCronJobs.ts +2 -2
- package/commands/start.d.ts +1 -1
- package/commands/start.js +10 -15
- package/commands/start.js.map +1 -1
- package/commands/start.ts +4 -4
- package/commands/team/create.d.ts +1 -1
- package/commands/team/create.js +10 -15
- package/commands/team/create.js.map +1 -1
- package/commands/team/create.ts +4 -4
- package/commands/team/delete.d.ts +1 -1
- package/commands/team/delete.js +10 -15
- package/commands/team/delete.js.map +1 -1
- package/commands/team/delete.ts +4 -4
- package/commands/team/index.js +14 -37
- package/commands/team/index.js.map +1 -1
- package/commands/team/index.ts +11 -6
- package/commands/team/member/delete.d.ts +1 -1
- package/commands/team/member/delete.js +10 -15
- package/commands/team/member/delete.js.map +1 -1
- package/commands/team/member/delete.ts +4 -4
- package/commands/team/member/index.js +12 -36
- package/commands/team/member/index.js.map +1 -1
- package/commands/team/member/index.ts +9 -5
- package/commands/team/member/invite.d.ts +1 -1
- package/commands/team/member/invite.js +10 -15
- package/commands/team/member/invite.js.map +1 -1
- package/commands/team/member/invite.ts +4 -4
- package/commands/team/member/update.d.ts +1 -1
- package/commands/team/member/update.js +12 -17
- package/commands/team/member/update.js.map +1 -1
- package/commands/team/member/update.ts +4 -4
- package/commands/team/update.d.ts +1 -1
- package/commands/team/update.js +10 -15
- package/commands/team/update.js.map +1 -1
- package/commands/team/update.ts +4 -4
- package/index.js +66 -94
- package/index.js.map +1 -1
- package/index.ts +65 -65
- package/jest.config.js +3 -1
- package/jest.setup.js +3 -5
- package/jest.setup.js.map +1 -1
- package/jest.setup.ts +1 -1
- package/lib/__snapshots__/getBlockConfigFromTypeScript.test.ts.snap +42 -6
- package/lib/app.d.ts +1 -1
- package/lib/app.js +151 -163
- package/lib/app.js.map +1 -1
- package/lib/app.ts +7 -7
- package/lib/asset.js +11 -18
- package/lib/asset.js.map +1 -1
- package/lib/authentication.d.ts +1 -1
- package/lib/authentication.js +34 -65
- package/lib/authentication.js.map +1 -1
- package/lib/authentication.ts +3 -2
- package/lib/block.js +99 -113
- package/lib/block.js.map +1 -1
- package/lib/block.test.js +9 -14
- package/lib/block.test.js.map +1 -1
- package/lib/block.test.ts +1 -1
- package/lib/block.ts +5 -5
- package/lib/coercers.js +5 -13
- package/lib/coercers.js.map +1 -1
- package/lib/coercers.test.js +2 -4
- package/lib/coercers.test.js.map +1 -1
- package/lib/coercers.test.ts +1 -1
- package/lib/getBlockConfigFromTypeScript.js +49 -56
- package/lib/getBlockConfigFromTypeScript.js.map +1 -1
- package/lib/getBlockConfigFromTypeScript.test.js +42 -46
- package/lib/getBlockConfigFromTypeScript.test.js.map +1 -1
- package/lib/getBlockConfigFromTypeScript.test.ts +7 -6
- package/lib/initAxios.d.ts +1 -1
- package/lib/initAxios.js +7 -14
- package/lib/initAxios.js.map +1 -1
- package/lib/initAxios.ts +2 -2
- package/lib/loadWebpackConfig.js +14 -45
- package/lib/loadWebpackConfig.js.map +1 -1
- package/lib/loadWebpackConfig.ts +10 -17
- package/lib/organization.js +23 -31
- package/lib/organization.js.map +1 -1
- package/lib/output.js +5 -9
- package/lib/output.js.map +1 -1
- package/lib/processCss.js +11 -18
- package/lib/processCss.js.map +1 -1
- package/lib/resource.js +17 -25
- package/lib/resource.js.map +1 -1
- package/lib/serverImport.js +6 -34
- package/lib/serverImport.js.map +1 -1
- package/lib/serverImport.ts +0 -1
- package/lib/team.js +28 -41
- package/lib/team.js.map +1 -1
- package/package.json +11 -10
- package/tsconfig.json +0 -1
- package/types.js +1 -2
package/index.ts
CHANGED
|
@@ -1,74 +1,74 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
import process from 'process';
|
|
3
|
+
|
|
2
4
|
import { configureLogger, handleError } from '@appsemble/node-utils';
|
|
3
5
|
import { cosmiconfig } from 'cosmiconfig';
|
|
4
|
-
import yargs from 'yargs';
|
|
6
|
+
import yargs, { CommandModule } from 'yargs';
|
|
5
7
|
|
|
6
|
-
import * as app from './commands/app';
|
|
7
|
-
import * as asset from './commands/asset';
|
|
8
|
-
import * as block from './commands/block';
|
|
9
|
-
import * as cleanupResources from './commands/cleanupResources';
|
|
10
|
-
import * as config from './commands/config';
|
|
11
|
-
import * as login from './commands/login';
|
|
12
|
-
import * as logout from './commands/logout';
|
|
13
|
-
import * as migrate from './commands/migrate';
|
|
14
|
-
import * as organization from './commands/organization';
|
|
15
|
-
import * as resource from './commands/resource';
|
|
16
|
-
import * as runCronJobs from './commands/runCronJobs';
|
|
17
|
-
import * as start from './commands/start';
|
|
18
|
-
import * as team from './commands/team';
|
|
19
|
-
import { CREDENTIALS_ENV_VAR } from './lib/authentication';
|
|
20
|
-
import { coerceRemote } from './lib/coercers';
|
|
21
|
-
import { initAxios } from './lib/initAxios';
|
|
8
|
+
import * as app from './commands/app/index.js';
|
|
9
|
+
import * as asset from './commands/asset/index.js';
|
|
10
|
+
import * as block from './commands/block/index.js';
|
|
11
|
+
import * as cleanupResources from './commands/cleanupResources.js';
|
|
12
|
+
import * as config from './commands/config/index.js';
|
|
13
|
+
import * as login from './commands/login.js';
|
|
14
|
+
import * as logout from './commands/logout.js';
|
|
15
|
+
import * as migrate from './commands/migrate.js';
|
|
16
|
+
import * as organization from './commands/organization/index.js';
|
|
17
|
+
import * as resource from './commands/resource/index.js';
|
|
18
|
+
import * as runCronJobs from './commands/runCronJobs.js';
|
|
19
|
+
import * as start from './commands/start.js';
|
|
20
|
+
import * as team from './commands/team/index.js';
|
|
21
|
+
import { CREDENTIALS_ENV_VAR } from './lib/authentication.js';
|
|
22
|
+
import { coerceRemote } from './lib/coercers.js';
|
|
23
|
+
import { initAxios } from './lib/initAxios.js';
|
|
24
|
+
import pkg from './package.json' assert { type: 'json' };
|
|
22
25
|
|
|
23
26
|
process.title = 'appsemble';
|
|
24
27
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
const found = await explorer.search(process.cwd());
|
|
28
|
+
const explorer = cosmiconfig('appsembleServer');
|
|
29
|
+
const found = await explorer.search(process.cwd());
|
|
28
30
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
parser.parse(argv);
|
|
31
|
+
let parser = yargs(process.argv.slice(2))
|
|
32
|
+
.version(pkg.version)
|
|
33
|
+
.option('verbose', {
|
|
34
|
+
alias: 'v',
|
|
35
|
+
describe: 'Increase verbosity',
|
|
36
|
+
type: 'count',
|
|
37
|
+
})
|
|
38
|
+
.option('quiet', {
|
|
39
|
+
alias: 'q',
|
|
40
|
+
describe: 'Decrease verbosity',
|
|
41
|
+
type: 'count',
|
|
42
|
+
})
|
|
43
|
+
.option('remote', {
|
|
44
|
+
description: 'The Appsemble host that should be used.',
|
|
45
|
+
default: 'https://appsemble.app',
|
|
46
|
+
coerce: coerceRemote,
|
|
47
|
+
})
|
|
48
|
+
.option('client-credentials', {
|
|
49
|
+
description: `OAuth2 client credentials formatted as "client_id:client_secret". This may also be defined in the ${CREDENTIALS_ENV_VAR} environment variable.`,
|
|
50
|
+
})
|
|
51
|
+
.middleware([configureLogger, initAxios])
|
|
52
|
+
.command(app)
|
|
53
|
+
.command(asset)
|
|
54
|
+
.command(block)
|
|
55
|
+
.command(cleanupResources as unknown as CommandModule)
|
|
56
|
+
.command(config)
|
|
57
|
+
.command(login as unknown as CommandModule)
|
|
58
|
+
.command(logout as unknown as CommandModule)
|
|
59
|
+
.command(migrate as unknown as CommandModule)
|
|
60
|
+
.command(organization)
|
|
61
|
+
.command(resource)
|
|
62
|
+
.command(runCronJobs as unknown as CommandModule)
|
|
63
|
+
.command(start as unknown as CommandModule)
|
|
64
|
+
.command(team)
|
|
65
|
+
.demandCommand(1)
|
|
66
|
+
// .strict() isn’t used because of https://github.com/yargs/yargs/issues/2058
|
|
67
|
+
.strictCommands()
|
|
68
|
+
.fail(handleError)
|
|
69
|
+
.help()
|
|
70
|
+
.completion();
|
|
71
|
+
if (found) {
|
|
72
|
+
parser = parser.config(found.config);
|
|
72
73
|
}
|
|
73
|
-
|
|
74
|
-
main(process.argv.slice(2));
|
|
74
|
+
parser.parse();
|
package/jest.config.js
CHANGED
package/jest.setup.js
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
(0, node_utils_1.setFixtureBase)(__dirname);
|
|
5
|
-
(0, node_utils_1.setLogLevel)(0);
|
|
1
|
+
import { setFixtureBase, setLogLevel } from '@appsemble/node-utils';
|
|
2
|
+
setFixtureBase(import.meta);
|
|
3
|
+
setLogLevel(0);
|
|
6
4
|
//# sourceMappingURL=jest.setup.js.map
|
package/jest.setup.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jest.setup.js","sourceRoot":"","sources":["jest.setup.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"jest.setup.js","sourceRoot":"","sources":["jest.setup.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEpE,cAAc,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;AAC5B,WAAW,CAAC,CAAC,CAAC,CAAC"}
|
package/jest.setup.ts
CHANGED
|
@@ -217,7 +217,7 @@ Refer to the block description for more information on the supported data format
|
|
|
217
217
|
"definitions": {
|
|
218
218
|
"Color": {
|
|
219
219
|
"description": "A hexadecimal color.",
|
|
220
|
-
"pattern": "^#[a-fA-F
|
|
220
|
+
"pattern": "^#[a-fA-F\\d]{6}$",
|
|
221
221
|
"type": "string",
|
|
222
222
|
},
|
|
223
223
|
"YAxis": {
|
|
@@ -1054,7 +1054,7 @@ exports[`getBlockConfigFromTypeScript official blocks filter 1`] = `
|
|
|
1054
1054
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
1055
1055
|
"additionalProperties": false,
|
|
1056
1056
|
"definitions": {
|
|
1057
|
-
"AbstractField
|
|
1057
|
+
"AbstractField<"date",string>": {
|
|
1058
1058
|
"additionalProperties": false,
|
|
1059
1059
|
"properties": {
|
|
1060
1060
|
"defaultValue": {
|
|
@@ -2667,7 +2667,7 @@ Note that for \`integer\` type fields are rounded _down_.",
|
|
|
2667
2667
|
|
|
2668
2668
|
For example, the [\`regex\`](#RegexRequirement) requirement type allows you to validate a field using [Regular Expressions](https://learnxinyminutes.com/docs/pcre/). So for example if you want a string field that requires a field to be an email address that ends with “@appsemble.com”, you could enforce this like so:
|
|
2669
2669
|
|
|
2670
|
-
\`\`\`yaml type: string requirements: - regex:
|
|
2670
|
+
\`\`\`yaml type: string requirements: - regex: \\w+@appsemble\\.com errorMessage: Value does not end with “@appsemble.com” \`\`\`",
|
|
2671
2671
|
"properties": {
|
|
2672
2672
|
"defaultValue": {
|
|
2673
2673
|
"description": "The default value of the field.",
|
|
@@ -2824,13 +2824,13 @@ Replaces the optional label if the field is optional. Won’t display if the fie
|
|
|
2824
2824
|
"maxTime": {
|
|
2825
2825
|
"default": "23:59",
|
|
2826
2826
|
"description": "The maximum time that can be selected.",
|
|
2827
|
-
"pattern": "^([01]
|
|
2827
|
+
"pattern": "^([01]\\d|2[0-3]):([0-5]\\d)$",
|
|
2828
2828
|
"type": "string",
|
|
2829
2829
|
},
|
|
2830
2830
|
"minTime": {
|
|
2831
2831
|
"default": "00:00",
|
|
2832
2832
|
"description": "The minimum time that can be selected.",
|
|
2833
|
-
"pattern": "^([01]
|
|
2833
|
+
"pattern": "^([01]\\d|2[0-3]):([0-5]\\d)$",
|
|
2834
2834
|
"type": "string",
|
|
2835
2835
|
},
|
|
2836
2836
|
},
|
|
@@ -3330,6 +3330,43 @@ If defined, a loader will be shown until this event is triggered.",
|
|
|
3330
3330
|
}
|
|
3331
3331
|
`;
|
|
3332
3332
|
|
|
3333
|
+
exports[`getBlockConfigFromTypeScript official blocks qr-scan 1`] = `
|
|
3334
|
+
{
|
|
3335
|
+
"actions": undefined,
|
|
3336
|
+
"events": {
|
|
3337
|
+
"emit": {
|
|
3338
|
+
"foundQr": {
|
|
3339
|
+
"description": "Event that gets emitted once the qr scanner has identified and resolved a QR code.
|
|
3340
|
+
|
|
3341
|
+
foundQr event only holds the string of the QR.",
|
|
3342
|
+
},
|
|
3343
|
+
},
|
|
3344
|
+
"listen": undefined,
|
|
3345
|
+
},
|
|
3346
|
+
"messages": undefined,
|
|
3347
|
+
"parameters": {
|
|
3348
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3349
|
+
"additionalProperties": false,
|
|
3350
|
+
"properties": {
|
|
3351
|
+
"drawQr": {
|
|
3352
|
+
"default": false,
|
|
3353
|
+
"description": "If true, the block will draw a rectangle around the QR code when it’s found.",
|
|
3354
|
+
"type": "boolean",
|
|
3355
|
+
},
|
|
3356
|
+
"height": {
|
|
3357
|
+
"description": "Video element height",
|
|
3358
|
+
"type": "number",
|
|
3359
|
+
},
|
|
3360
|
+
"width": {
|
|
3361
|
+
"description": "Video element width",
|
|
3362
|
+
"type": "number",
|
|
3363
|
+
},
|
|
3364
|
+
},
|
|
3365
|
+
"type": "object",
|
|
3366
|
+
},
|
|
3367
|
+
}
|
|
3368
|
+
`;
|
|
3369
|
+
|
|
3333
3370
|
exports[`getBlockConfigFromTypeScript official blocks stats 1`] = `
|
|
3334
3371
|
{
|
|
3335
3372
|
"actions": undefined,
|
|
@@ -3740,7 +3777,6 @@ exports[`getBlockConfigFromTypeScript official blocks tiles 1`] = `
|
|
|
3740
3777
|
"additionalProperties": false,
|
|
3741
3778
|
"properties": {
|
|
3742
3779
|
"color": {
|
|
3743
|
-
"default": "primary",
|
|
3744
3780
|
"description": "This color is used to fill the background of the tile.
|
|
3745
3781
|
|
|
3746
3782
|
Takes either a hex color or a [Bulma color](https://bulma.io/documentation/helpers/color-helpers)",
|
package/lib/app.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { ReadStream } from 'fs';
|
|
3
3
|
import { AppVisibility } from '@appsemble/types';
|
|
4
4
|
import FormData from 'form-data';
|
|
5
|
-
import { AppsembleContext, AppsembleRC } from '../types';
|
|
5
|
+
import { AppsembleContext, AppsembleRC } from '../types.js';
|
|
6
6
|
interface CreateAppParams {
|
|
7
7
|
/**
|
|
8
8
|
* The OAuth2 client credentials to use.
|