@appsemble/cli 0.20.27 → 0.20.29

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.
Files changed (136) hide show
  1. package/README.md +4 -4
  2. package/index.js +0 -0
  3. package/package.json +5 -5
  4. package/__fixtures__/getBlockConfigFromTypeScript/comments/index.ts +0 -40
  5. package/__fixtures__/getBlockConfigFromTypeScript/comments/tsconfig.json +0 -7
  6. package/__fixtures__/getBlockConfigFromTypeScript/duplicateActions/index.ts +0 -34
  7. package/__fixtures__/getBlockConfigFromTypeScript/duplicateActions/tsconfig.json +0 -7
  8. package/__fixtures__/getBlockConfigFromTypeScript/duplicateEventEmitters/index.ts +0 -34
  9. package/__fixtures__/getBlockConfigFromTypeScript/duplicateEventEmitters/tsconfig.json +0 -7
  10. package/__fixtures__/getBlockConfigFromTypeScript/duplicateEventListeners/index.ts +0 -34
  11. package/__fixtures__/getBlockConfigFromTypeScript/duplicateEventListeners/tsconfig.json +0 -7
  12. package/__fixtures__/getBlockConfigFromTypeScript/duplicateParameters/index.ts +0 -34
  13. package/__fixtures__/getBlockConfigFromTypeScript/duplicateParameters/tsconfig.json +0 -7
  14. package/__fixtures__/getBlockConfigFromTypeScript/fontawesomeParameters/index.ts +0 -11
  15. package/__fixtures__/getBlockConfigFromTypeScript/fontawesomeParameters/tsconfig.json +0 -7
  16. package/__fixtures__/getBlockConfigFromTypeScript/tsError/index.ts +0 -4
  17. package/__fixtures__/getBlockConfigFromTypeScript/tsError/tsconfig.json +0 -8
  18. package/__fixtures__/getBlockConfigFromTypeScript/valid/index.ts +0 -28
  19. package/__fixtures__/getBlockConfigFromTypeScript/valid/tsconfig.json +0 -7
  20. package/__fixtures__/makePayload/with-icon/icon.svg +0 -2
  21. package/assets/appsemblerc.schema.json +0 -150
  22. package/changed/added/.gitkeep +0 -0
  23. package/changed/changed/.gitkeep +0 -0
  24. package/changed/deprecated/.gitkeep +0 -0
  25. package/changed/fixed/.gitkeep +0 -0
  26. package/changed/removed/.gitkeep +0 -0
  27. package/changed/security/.gitkeep +0 -0
  28. package/commands/app/create.js.map +0 -1
  29. package/commands/app/create.ts +0 -104
  30. package/commands/app/extract-messages.js.map +0 -1
  31. package/commands/app/extract-messages.ts +0 -56
  32. package/commands/app/index.js.map +0 -1
  33. package/commands/app/index.ts +0 -18
  34. package/commands/app/update.js.map +0 -1
  35. package/commands/app/update.ts +0 -111
  36. package/commands/asset/create.js.map +0 -1
  37. package/commands/asset/create.ts +0 -84
  38. package/commands/asset/index.js.map +0 -1
  39. package/commands/asset/index.ts +0 -12
  40. package/commands/block/build.js.map +0 -1
  41. package/commands/block/build.ts +0 -32
  42. package/commands/block/extract-messages.js.map +0 -1
  43. package/commands/block/extract-messages.ts +0 -41
  44. package/commands/block/index.js.map +0 -1
  45. package/commands/block/index.ts +0 -18
  46. package/commands/block/publish.js.map +0 -1
  47. package/commands/block/publish.ts +0 -58
  48. package/commands/cleanupResources.js.map +0 -1
  49. package/commands/cleanupResources.ts +0 -45
  50. package/commands/config/get.js.map +0 -1
  51. package/commands/config/get.ts +0 -27
  52. package/commands/config/index.js.map +0 -1
  53. package/commands/config/index.ts +0 -16
  54. package/commands/config/set.js.map +0 -1
  55. package/commands/config/set.ts +0 -45
  56. package/commands/login.js.map +0 -1
  57. package/commands/login.ts +0 -5
  58. package/commands/logout.js.map +0 -1
  59. package/commands/logout.ts +0 -5
  60. package/commands/migrate.js.map +0 -1
  61. package/commands/migrate.ts +0 -50
  62. package/commands/organization/create.js.map +0 -1
  63. package/commands/organization/create.ts +0 -65
  64. package/commands/organization/index.js.map +0 -1
  65. package/commands/organization/index.ts +0 -16
  66. package/commands/organization/update.js.map +0 -1
  67. package/commands/organization/update.ts +0 -65
  68. package/commands/resource/create.js.map +0 -1
  69. package/commands/resource/create.ts +0 -78
  70. package/commands/resource/index.js.map +0 -1
  71. package/commands/resource/index.ts +0 -16
  72. package/commands/resource/update.js.map +0 -1
  73. package/commands/resource/update.ts +0 -77
  74. package/commands/runCronJobs.js.map +0 -1
  75. package/commands/runCronJobs.ts +0 -45
  76. package/commands/start.js.map +0 -1
  77. package/commands/start.ts +0 -140
  78. package/commands/team/create.js.map +0 -1
  79. package/commands/team/create.ts +0 -60
  80. package/commands/team/delete.js.map +0 -1
  81. package/commands/team/delete.ts +0 -54
  82. package/commands/team/index.js.map +0 -1
  83. package/commands/team/index.ts +0 -20
  84. package/commands/team/member/delete.js.map +0 -1
  85. package/commands/team/member/delete.ts +0 -61
  86. package/commands/team/member/index.js.map +0 -1
  87. package/commands/team/member/index.ts +0 -18
  88. package/commands/team/member/invite.js.map +0 -1
  89. package/commands/team/member/invite.ts +0 -61
  90. package/commands/team/member/update.js.map +0 -1
  91. package/commands/team/member/update.ts +0 -70
  92. package/commands/team/update.js.map +0 -1
  93. package/commands/team/update.ts +0 -60
  94. package/index.js.map +0 -1
  95. package/index.ts +0 -74
  96. package/jest.config.js +0 -3
  97. package/jest.setup.js.map +0 -1
  98. package/jest.setup.ts +0 -4
  99. package/lib/__snapshots__/getBlockConfigFromTypeScript.test.ts.snap +0 -4241
  100. package/lib/app.js.map +0 -1
  101. package/lib/app.ts +0 -795
  102. package/lib/asset.js.map +0 -1
  103. package/lib/asset.ts +0 -43
  104. package/lib/authentication.js.map +0 -1
  105. package/lib/authentication.ts +0 -194
  106. package/lib/block.js.map +0 -1
  107. package/lib/block.test.js.map +0 -1
  108. package/lib/block.test.ts +0 -103
  109. package/lib/block.ts +0 -384
  110. package/lib/coercers.js.map +0 -1
  111. package/lib/coercers.test.js.map +0 -1
  112. package/lib/coercers.test.ts +0 -27
  113. package/lib/coercers.ts +0 -58
  114. package/lib/getBlockConfigFromTypeScript.js.map +0 -1
  115. package/lib/getBlockConfigFromTypeScript.test.js.map +0 -1
  116. package/lib/getBlockConfigFromTypeScript.test.ts +0 -282
  117. package/lib/getBlockConfigFromTypeScript.ts +0 -356
  118. package/lib/initAxios.js.map +0 -1
  119. package/lib/initAxios.ts +0 -16
  120. package/lib/loadWebpackConfig.js.map +0 -1
  121. package/lib/loadWebpackConfig.ts +0 -52
  122. package/lib/organization.js.map +0 -1
  123. package/lib/organization.ts +0 -105
  124. package/lib/output.js.map +0 -1
  125. package/lib/output.ts +0 -19
  126. package/lib/processCss.js.map +0 -1
  127. package/lib/processCss.ts +0 -24
  128. package/lib/resource.js.map +0 -1
  129. package/lib/resource.ts +0 -128
  130. package/lib/serverImport.js.map +0 -1
  131. package/lib/serverImport.ts +0 -42
  132. package/lib/team.js.map +0 -1
  133. package/lib/team.ts +0 -152
  134. package/tsconfig.json +0 -9
  135. package/types.js.map +0 -1
  136. package/types.ts +0 -110
@@ -1 +0,0 @@
1
- {"version":3,"file":"migrate.js","sourceRoot":"","sources":["migrate.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,GAAG,MAAM,iBAAiB,CAAC,SAAS,IAAI,EAAE,MAAM,EAAE,CAAC;AAG1D,MAAM,CAAC,MAAM,OAAO,GAAG,sBAAsB,CAAC;AAC9C,MAAM,CAAC,MAAM,WAAW,GAAG,gCAAgC,CAAC;AAE5D,MAAM,UAAU,OAAO,CAAC,KAAW;IACjC,OAAO,KAAK;SACT,UAAU,CAAC,YAAY,EAAE;QACxB,IAAI,EAAE,qCAAqC;QAC3C,OAAO,EAAE,GAAG,CAAC,OAAO;KACrB,CAAC;SACD,MAAM,CAAC,eAAe,EAAE;QACvB,IAAI,EAAE,4FAA4F;KACnG,CAAC;SACD,MAAM,CAAC,eAAe,EAAE;QACvB,IAAI,EAAE,yCAAyC;QAC/C,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,IAAI;KACd,CAAC;SACD,MAAM,CAAC,cAAc,EAAE;QACtB,IAAI,EAAE,qCAAqC;QAC3C,IAAI,EAAE,SAAS;KAChB,CAAC;SACD,MAAM,CAAC,eAAe,EAAE;QACvB,IAAI,EAAE,yCAAyC;QAC/C,OAAO,EAAE,CAAC,eAAe,EAAE,mBAAmB,CAAC;KAChD,CAAC;SACD,MAAM,CAAC,eAAe,EAAE;QACvB,IAAI,EAAE,2CAA2C;QACjD,OAAO,EAAE,CAAC,eAAe,EAAE,mBAAmB,CAAC;KAChD,CAAC;SACD,MAAM,CAAC,mBAAmB,EAAE;QAC3B,IAAI,EAAE,+CAA+C;QACrD,OAAO,EAAE,CAAC,eAAe,EAAE,eAAe,CAAC;KAC5C,CAAC;SACD,MAAM,CAAC,cAAc,EAAE;QACtB,IAAI,EAAE,wHAAwH;QAC9H,SAAS,EAAE,CAAC,eAAe,EAAE,eAAe,EAAE,eAAe,EAAE,mBAAmB,CAAC;KACpF,CAAC,CAAC;AACP,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,OAAO,CAAC,IAAmB;IAC/C,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,MAAM,YAAY,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;IACtE,OAAO,CAAC,IAAI,CAAC,CAAC;IACd,OAAO,OAAO,EAAE,CAAC;AACnB,CAAC"}
@@ -1,50 +0,0 @@
1
- import { Argv } from 'yargs';
2
-
3
- import { serverImport } from '../lib/serverImport.js';
4
- import pkg from '../package.json' assert { type: 'json' };
5
- import { BaseArguments } from '../types.js';
6
-
7
- export const command = 'migrate [migrate-to]';
8
- export const description = 'Migrate the Appsemble database';
9
-
10
- export function builder(yargs: Argv): Argv<any> {
11
- return yargs
12
- .positional('migrate-to', {
13
- desc: 'The database version to migrate to.',
14
- default: pkg.version,
15
- })
16
- .option('database-host', {
17
- desc: 'The host of the database to connect to. This defaults to the connected database container.',
18
- })
19
- .option('database-port', {
20
- desc: 'The port of the database to connect to.',
21
- type: 'number',
22
- default: 5432,
23
- })
24
- .option('database-ssl', {
25
- desc: 'Use SSL to connect to the database.',
26
- type: 'boolean',
27
- })
28
- .option('database-name', {
29
- desc: 'The name of the database to connect to.',
30
- implies: ['database-user', 'database-password'],
31
- })
32
- .option('database-user', {
33
- desc: 'The user to use to login to the database.',
34
- implies: ['database-name', 'database-password'],
35
- })
36
- .option('database-password', {
37
- desc: 'The password to use to login to the database.',
38
- implies: ['database-name', 'database-user'],
39
- })
40
- .option('database-url', {
41
- desc: 'A connection string for the database to connect to. This is an alternative to the separate database related variables.',
42
- conflicts: ['database-host', 'database-name', 'database-user', 'database-password'],
43
- });
44
- }
45
-
46
- export async function handler(argv: BaseArguments): Promise<void> {
47
- const { migrate, setArgv } = await serverImport('setArgv', 'migrate');
48
- setArgv(argv);
49
- return migrate();
50
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"create.js","sourceRoot":"","sources":["create.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAY/D,MAAM,CAAC,MAAM,OAAO,GAAG,aAAa,CAAC;AACrC,MAAM,CAAC,MAAM,WAAW,GACtB,6EAA6E,CAAC;AAEhF,MAAM,UAAU,OAAO,CAAC,KAAW;IACjC,OAAO,KAAK;SACT,UAAU,CAAC,IAAI,EAAE;QAChB,QAAQ,EAAE,2CAA2C;KACtD,CAAC;SACD,MAAM,CAAC,MAAM,EAAE;QACd,QAAQ,EAAE,8BAA8B;KACzC,CAAC;SACD,MAAM,CAAC,OAAO,EAAE;QACf,QAAQ,EAAE,6DAA6D;KACxE,CAAC;SACD,MAAM,CAAC,SAAS,EAAE;QACjB,QAAQ,EAAE,iCAAiC;KAC5C,CAAC;SACD,MAAM,CAAC,aAAa,EAAE;QACrB,QAAQ,EAAE,6BAA6B;KACxC,CAAC;SACD,MAAM,CAAC,MAAM,EAAE;QACd,QAAQ,EAAE,8DAA8D;QACxE,MAAM,EAAE,UAAU;KACnB,CAAC,CAAC;AACP,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,OAAO,CAAC,EAC5B,iBAAiB,EACjB,WAAW,EAAE,IAAI,EACjB,KAAK,EACL,IAAI,EACJ,EAAE,EACF,IAAI,EACJ,MAAM,EACN,OAAO,GACqB;IAC5B,MAAM,YAAY,CAAC,MAAM,EAAE,qBAAqB,EAAE,iBAAiB,CAAC,CAAC;IACrE,MAAM,kBAAkB,CAAC;QACvB,WAAW,EAAE,IAAI;QACjB,KAAK;QACL,IAAI;QACJ,EAAE;QACF,IAAI;QACJ,OAAO;KACR,CAAC,CAAC;AACL,CAAC"}
@@ -1,65 +0,0 @@
1
- import { ReadStream } from 'node:fs';
2
-
3
- import { Argv } from 'yargs';
4
-
5
- import { authenticate } from '../../lib/authentication.js';
6
- import { coerceFile } from '../../lib/coercers.js';
7
- import { createOrganization } from '../../lib/organization.js';
8
- import { BaseArguments } from '../../types.js';
9
-
10
- interface CreateOrganizationArguments extends BaseArguments {
11
- description: string;
12
- email: string;
13
- id: string;
14
- name: string;
15
- website: string;
16
- icon: ReadStream;
17
- }
18
-
19
- export const command = 'create <id>';
20
- export const description =
21
- 'Register a new organization. You will be the owner of the new organization.';
22
-
23
- export function builder(yargs: Argv): Argv<any> {
24
- return yargs
25
- .positional('id', {
26
- describe: 'The id for the newly created organization',
27
- })
28
- .option('name', {
29
- describe: 'The name of the organization',
30
- })
31
- .option('email', {
32
- describe: 'The email address users may use to contact the organization',
33
- })
34
- .option('website', {
35
- describe: 'The website of the organization',
36
- })
37
- .option('description', {
38
- describe: 'A short of the organization',
39
- })
40
- .option('icon', {
41
- describe: 'The file location of the icon representing the organization.',
42
- coerce: coerceFile,
43
- });
44
- }
45
-
46
- export async function handler({
47
- clientCredentials,
48
- description: desc,
49
- email,
50
- icon,
51
- id,
52
- name,
53
- remote,
54
- website,
55
- }: CreateOrganizationArguments): Promise<void> {
56
- await authenticate(remote, 'organizations:write', clientCredentials);
57
- await createOrganization({
58
- description: desc,
59
- email,
60
- icon,
61
- id,
62
- name,
63
- website,
64
- });
65
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC;AACtC,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC;AAEtC,OAAO,EAAE,IAAI,IAAI,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAEnD,MAAM,CAAC,MAAM,OAAO,GAAG,cAAc,CAAC;AACtC,MAAM,CAAC,MAAM,WAAW,GAAG,oCAAoC,CAAC;AAEhE,MAAM,UAAU,OAAO,CAAC,KAAW;IACjC,OAAO,KAAK;SACT,OAAO,CAAC,MAAkC,CAAC;SAC3C,OAAO,CAAC,MAAkC,CAAC;SAC3C,aAAa,CAAC,CAAC,CAAC,CAAC;AACtB,CAAC"}
@@ -1,16 +0,0 @@
1
- import { Argv, CommandModule } from 'yargs';
2
-
3
- import * as create from './create.js';
4
- import * as update from './update.js';
5
-
6
- export { noop as handler } from '@appsemble/utils';
7
-
8
- export const command = 'organization';
9
- export const description = 'Commands related to organizations.';
10
-
11
- export function builder(yargs: Argv): Argv {
12
- return yargs
13
- .command(create as unknown as CommandModule)
14
- .command(update as unknown as CommandModule)
15
- .demandCommand(1);
16
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"update.js","sourceRoot":"","sources":["update.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAY/D,MAAM,CAAC,MAAM,OAAO,GAAG,aAAa,CAAC;AACrC,MAAM,CAAC,MAAM,WAAW,GACtB,4EAA4E,CAAC;AAE/E,MAAM,UAAU,OAAO,CAAC,KAAW;IACjC,OAAO,KAAK;SACT,UAAU,CAAC,IAAI,EAAE;QAChB,QAAQ,EAAE,4BAA4B;KACvC,CAAC;SACD,MAAM,CAAC,MAAM,EAAE;QACd,QAAQ,EAAE,+BAA+B;KAC1C,CAAC;SACD,MAAM,CAAC,OAAO,EAAE;QACf,QAAQ,EAAE,6DAA6D;KACxE,CAAC;SACD,MAAM,CAAC,SAAS,EAAE;QACjB,QAAQ,EAAE,iCAAiC;KAC5C,CAAC;SACD,MAAM,CAAC,aAAa,EAAE;QACrB,QAAQ,EAAE,6BAA6B;KACxC,CAAC;SACD,MAAM,CAAC,MAAM,EAAE;QACd,QAAQ,EAAE,8DAA8D;QACxE,MAAM,EAAE,UAAU;KACnB,CAAC,CAAC;AACP,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,OAAO,CAAC,EAC5B,iBAAiB,EACjB,WAAW,EAAE,IAAI,EACjB,KAAK,EACL,IAAI,EACJ,EAAE,EACF,IAAI,EACJ,MAAM,EACN,OAAO,GACqB;IAC5B,MAAM,YAAY,CAAC,MAAM,EAAE,qBAAqB,EAAE,iBAAiB,CAAC,CAAC;IACrE,MAAM,kBAAkB,CAAC;QACvB,WAAW,EAAE,IAAI;QACjB,KAAK;QACL,IAAI;QACJ,EAAE;QACF,IAAI;QACJ,OAAO;KACR,CAAC,CAAC;AACL,CAAC"}
@@ -1,65 +0,0 @@
1
- import { ReadStream } from 'node:fs';
2
-
3
- import { Argv } from 'yargs';
4
-
5
- import { authenticate } from '../../lib/authentication.js';
6
- import { coerceFile } from '../../lib/coercers.js';
7
- import { updateOrganization } from '../../lib/organization.js';
8
- import { BaseArguments } from '../../types.js';
9
-
10
- interface UpdateOrganizationArguments extends BaseArguments {
11
- description: string;
12
- email: string;
13
- id: string;
14
- icon: ReadStream;
15
- name: string;
16
- website: string;
17
- }
18
-
19
- export const command = 'update <id>';
20
- export const description =
21
- 'Update an existing organization. You must be an owner of the organization.';
22
-
23
- export function builder(yargs: Argv): Argv<any> {
24
- return yargs
25
- .positional('id', {
26
- describe: 'The ID of the organization',
27
- })
28
- .option('name', {
29
- describe: 'The name of the organization.',
30
- })
31
- .option('email', {
32
- describe: 'The email address users may use to contact the organization',
33
- })
34
- .option('website', {
35
- describe: 'The website of the organization',
36
- })
37
- .option('description', {
38
- describe: 'A short of the organization',
39
- })
40
- .option('icon', {
41
- describe: 'The file location of the icon representing the organization.',
42
- coerce: coerceFile,
43
- });
44
- }
45
-
46
- export async function handler({
47
- clientCredentials,
48
- description: desc,
49
- email,
50
- icon,
51
- id,
52
- name,
53
- remote,
54
- website,
55
- }: UpdateOrganizationArguments): Promise<void> {
56
- await authenticate(remote, 'organizations:write', clientCredentials);
57
- await updateOrganization({
58
- description: desc,
59
- email,
60
- icon,
61
- id,
62
- name,
63
- website,
64
- });
65
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"create.js","sourceRoot":"","sources":["create.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,EAAE,MAAM,WAAW,CAAC;AAC3B,OAAO,aAAa,MAAM,gBAAgB,CAAC;AAG3C,OAAO,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAWvD,MAAM,CAAC,MAAM,OAAO,GAAG,mCAAmC,CAAC;AAC3D,MAAM,CAAC,MAAM,WAAW,GAAG,+DAA+D,CAAC;AAE3F,MAAM,UAAU,OAAO,CAAC,KAAW;IACjC,OAAO,KAAK;SACT,UAAU,CAAC,eAAe,EAAE;QAC3B,QAAQ,EAAE,kDAAkD;QAC5D,YAAY,EAAE,IAAI;KACnB,CAAC;SACD,UAAU,CAAC,OAAO,EAAE;QACnB,QAAQ,EAAE,qCAAqC;QAC/C,SAAS,EAAE,IAAI;QACf,YAAY,EAAE,IAAI;KACnB,CAAC;SACD,MAAM,CAAC,QAAQ,EAAE;QAChB,QAAQ,EAAE,gDAAgD;QAC1D,IAAI,EAAE,QAAQ;KACf,CAAC;SACD,MAAM,CAAC,KAAK,EAAE;QACb,QAAQ,EAAE,sBAAs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C;KACJ;AACH,CAAC"}
@@ -1,78 +0,0 @@
1
- import { AppsembleError, logger } from '@appsemble/node-utils';
2
- import fg from 'fast-glob';
3
- import normalizePath from 'normalize-path';
4
- import { Argv } from 'yargs';
5
-
6
- import { resolveAppIdAndRemote } from '../../lib/app.js';
7
- import { authenticate } from '../../lib/authentication.js';
8
- import { createResource } from '../../lib/resource.js';
9
- import { BaseArguments } from '../../types.js';
10
-
11
- interface CreateResourceArguments extends BaseArguments {
12
- resourceName: string;
13
- paths: string[];
14
- appId: number;
15
- context: string;
16
- app: string;
17
- }
18
-
19
- export const command = 'create <resource-name> <paths...>';
20
- export const description = 'Create resources based on a specified JSON file or directory.';
21
-
22
- export function builder(yargs: Argv): Argv<any> {
23
- return yargs
24
- .positional('resource-name', {
25
- describe: 'The name of the resource that should be created.',
26
- demandOption: true,
27
- })
28
- .positional('paths', {
29
- describe: 'The path to the resources to create',
30
- normalize: true,
31
- demandOption: true,
32
- })
33
- .option('app-id', {
34
- describe: 'The ID of the app to create the resources for.',
35
- type: 'number',
36
- })
37
- .option('app', {
38
- describe: 'The path to the app.',
39
- demandOption: 'context',
40
- })
41
- .option('context', {
42
- describe: 'If specified, use the specified context from .appsemblerc.yaml',
43
- demandOption: 'app',
44
- });
45
- }
46
-
47
- export async function handler({
48
- app,
49
- appId,
50
- clientCredentials,
51
- context,
52
- paths,
53
- remote,
54
- resourceName,
55
- }: CreateResourceArguments): Promise<void> {
56
- const [resolvedAppId, resolvedRemote] = await resolveAppIdAndRemote(app, context, remote, appId);
57
- await authenticate(resolvedRemote, 'resources:write', clientCredentials);
58
-
59
- const normalizedPaths = paths.map((path) => normalizePath(path));
60
- const files = (await fg(normalizedPaths, { absolute: true, onlyFiles: true })).filter(
61
- (file) => file.endsWith('.json') || file.endsWith('.csv'),
62
- );
63
-
64
- if (!files.length) {
65
- throw new AppsembleError('No .json or .csv files found.');
66
- }
67
-
68
- logger.info(`Creating resources based on ${files.length} files`);
69
- for (const path of files) {
70
- logger.info('');
71
- await createResource({
72
- resourceName,
73
- appId: resolvedAppId,
74
- path,
75
- remote: resolvedRemote,
76
- });
77
- }
78
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC;AACtC,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC;AAEtC,OAAO,EAAE,IAAI,IAAI,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAEnD,MAAM,CAAC,MAAM,OAAO,GAAG,UAAU,CAAC;AAClC,MAAM,CAAC,MAAM,WAAW,GAAG,gCAAgC,CAAC;AAE5D,MAAM,UAAU,OAAO,CAAC,KAAW;IACjC,OAAO,KAAK;SACT,OAAO,CAAC,MAAkC,CAAC;SAC3C,OAAO,CAAC,MAAkC,CAAC;SAC3C,aAAa,CAAC,CAAC,CAAC,CAAC;AACtB,CAAC"}
@@ -1,16 +0,0 @@
1
- import { Argv, CommandModule } from 'yargs';
2
-
3
- import * as create from './create.js';
4
- import * as update from './update.js';
5
-
6
- export { noop as handler } from '@appsemble/utils';
7
-
8
- export const command = 'resource';
9
- export const description = 'Commands related to resources.';
10
-
11
- export function builder(yargs: Argv): Argv {
12
- return yargs
13
- .command(create as unknown as CommandModule)
14
- .command(update as unknown as CommandModule)
15
- .demandCommand(1);
16
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"update.js","sourceRoot":"","sources":["update.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,EAAE,MAAM,WAAW,CAAC;AAC3B,OAAO,aAAa,MAAM,gBAAgB,CAAC;AAG3C,OAAO,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAWvD,MAAM,CAA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,CAAC,MAAM,EAAE;QACjB,MAAM,IAAI,cAAc,CAAC,sBAAsB,CAAC,CAAC;KAClD;IAED,MAAM,CAAC,IAAI,CAAC,+BAA+B,KAAK,CAAC,MAAM,QAAQ,CAAC,CAAC;IACjE,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE;QACxB,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAChB,MAAM,cAAc,CAAC;YACnB,YAAY;YACZ,KAAK,EAAE,aAAa;YACpB,IAAI;YACJ,MAAM,EAAE,cAAc;SACvB,CAAC,CAAC;KACJ;AACH,CAAC"}
@@ -1,77 +0,0 @@
1
- import { AppsembleError, logger } from '@appsemble/node-utils';
2
- import fg from 'fast-glob';
3
- import normalizePath from 'normalize-path';
4
- import { Argv } from 'yargs';
5
-
6
- import { resolveAppIdAndRemote } from '../../lib/app.js';
7
- import { authenticate } from '../../lib/authentication.js';
8
- import { updateResource } from '../../lib/resource.js';
9
- import { BaseArguments } from '../../types.js';
10
-
11
- interface CreateResourceArguments extends BaseArguments {
12
- resourceName: string;
13
- paths: string[];
14
- appId: number;
15
- context: string;
16
- app: string;
17
- }
18
-
19
- export const command = 'update <resource-name> <paths...>';
20
- export const description =
21
- 'Update resources based on a specified JSON file or directory. Entries without the property `id` will be skipped.';
22
-
23
- export function builder(yargs: Argv): Argv<any> {
24
- return yargs
25
- .positional('resource-name', {
26
- describe: 'The name of the resource that should be created.',
27
- demandOption: true,
28
- })
29
- .positional('paths', {
30
- describe: 'The path to the resources to update',
31
- normalize: true,
32
- demandOption: true,
33
- })
34
- .option('app-id', {
35
- describe: 'The ID of the app to create the resources for.',
36
- type: 'number',
37
- })
38
- .option('app', {
39
- describe: 'The path to the app.',
40
- demandOption: 'context',
41
- })
42
- .option('context', {
43
- describe: 'If specified, use the specified context from .appsemblerc.yaml',
44
- demandOption: 'app',
45
- });
46
- }
47
-
48
- export async function handler({
49
- app,
50
- appId,
51
- clientCredentials,
52
- context,
53
- paths,
54
- remote,
55
- resourceName,
56
- }: CreateResourceArguments): Promise<void> {
57
- const [resolvedAppId, resolvedRemote] = await resolveAppIdAndRemote(app, context, remote, appId);
58
- await authenticate(resolvedRemote, 'resources:write', clientCredentials);
59
-
60
- const normalizedPaths = paths.map((path) => normalizePath(path));
61
- const files = await fg(normalizedPaths, { absolute: true, onlyFiles: true });
62
-
63
- if (!files.length) {
64
- throw new AppsembleError('No JSON files found.');
65
- }
66
-
67
- logger.info(`Updating resources based on ${files.length} files`);
68
- for (const path of files) {
69
- logger.info('');
70
- await updateResource({
71
- resourceName,
72
- appId: resolvedAppId,
73
- path,
74
- remote: resolvedRemote,
75
- });
76
- }
77
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"runCronJobs.js","sourceRoot":"","sources":["runCronJobs.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAGtD,MAAM,CAAC,MAAM,OAAO,GAAG,cAAc,CAAC;AACtC,MAAM,CAAC,MAAM,WAAW,GAAG,yCAAyC,CAAC;AAErE,MAAM,UAAU,OAAO,CAAC,KAAW;IACjC,OAAO,KAAK;SACT,MAAM,CAAC,eAAe,EAAE;QACvB,IAAI,EAAE,4FAA4F;KACnG,CAAC;SACD,MAAM,CAAC,eAAe,EAAE;QACvB,IAAI,EAAE,yCAAyC;QAC/C,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,IAAI;KACd,CAAC;SACD,MAAM,CAAC,cAAc,EAAE;QACtB,IAAI,EAAE,qCAAqC;QAC3C,IAAI,EAAE,SAAS;KAChB,CAAC;SACD,MAAM,CAAC,eAAe,EAAE;QACvB,IAAI,EAAE,yCAAyC;QAC/C,OAAO,EAAE,CAAC,eAAe,EAAE,mBAAmB,CAAC;KAChD,CAAC;SACD,MAAM,CAAC,eAAe,EAAE;QACvB,IAAI,EAAE,2CAA2C;QACjD,OAAO,EAAE,CAAC,eAAe,EAAE,mBAAmB,CAAC;KAChD,CAAC;SACD,MAAM,CAAC,mBAAmB,EAAE;QAC3B,IAAI,EAAE,+CAA+C;QACrD,OAAO,EAAE,CAAC,eAAe,EAAE,eAAe,CAAC;KAC5C,CAAC;SACD,MAAM,CAAC,cAAc,EAAE;QACtB,IAAI,EAAE,wHAAwH;QAC9H,SAAS,EAAE,CAAC,eAAe,EAAE,eAAe,EAAE,eAAe,EAAE,mBAAmB,CAAC;KACpF,CAAC,CAAC;AACP,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,OAAO,CAAC,IAAmB;IAC/C,MAAM,EAAE,WAAW,EAAE,OAAO,EAAE,GAAG,MAAM,YAAY,CAAC,SAAS,EAAE,aAAa,CAAC,CAAC;IAC9E,OAAO,CAAC,IAAI,CAAC,CAAC;IACd,OAAO,WAAW,EAAE,CAAC;AACvB,CAAC"}
@@ -1,45 +0,0 @@
1
- import { Argv } from 'yargs';
2
-
3
- import { serverImport } from '../lib/serverImport.js';
4
- import { BaseArguments } from '../types.js';
5
-
6
- export const command = 'run-cronjobs';
7
- export const description = 'Runs all cronjobs associated with apps.';
8
-
9
- export function builder(yargs: Argv): Argv<any> {
10
- return yargs
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
-
41
- export async function handler(argv: BaseArguments): Promise<void> {
42
- const { runCronJobs, setArgv } = await serverImport('setArgv', 'runCronJobs');
43
- setArgv(argv);
44
- return runCronJobs();
45
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"start.js","sourceRoot":"","sources":["start.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAGtD,MAAM,CAAC,MAAM,OAAO,GAAG,OAAO,CAAC;AAC/B,MAAM,CAAC,MAAM,WAAW,GAAG,yCAAyC,CAAC;AAErE,MAAM,UAAU,OAAO,CAAC,KAAW;IACjC,OAAO,KAAK;SACT,MAAM,CAAC,MAAM,EAAE;QACd,IAAI,EAAE,iDAAiD;QACvD,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,IAAI;KACd,CAAC;SACD,MAAM,CAAC,eAAe,EAAE;QACvB,IAAI,EAAE,4FAA4F;KACnG,CAAC;SACD,MAAM,CAAC,eAAe,EAAE;QACvB,IAAI,EAAE,yCAAyC;QAC/C,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,IAAI;KACd,CAAC;SACD,MAAM,CAAC,cAAc,EAAE;QACtB,IAAI,EAAE,qCAAqC;QAC3C,IAAI,EAAE,SAAS;KAChB,CAAC;SACD,MAAM,CAAC,eAAe,EAAE;QACvB,IAAI,EAAE,yCAAyC;QAC/C,OAAO,EAAE,CAAC,eAAe,EAAE,mBAAmB,CAAC;KAChD,CAAC;SACD,MAAM,CAAC,eAAe,EAAE;QACvB,IAAI,EAAE,2CAA2C;QACjD,OAAO,EAAE,CAAC,eAAe,EAAE,mBAAmB,CAAC;KAChD,CAAC;SACD,MAAM,CAAC,mBAAmB,EAAE;QAC3B,IAAI,EAAE,+CAA+C;QACrD,OAAO,EAAE,CAAC,eAAe,EAAE,eAAe,CAAC;KAC5C,CAAC;SACD,MAAM,CAAC,cAAc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AC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;IACnD,MAAM,cAAc,GAAG,MAAM,OAAO,CAAC,GAAG,CACtC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,iBAAiB,CAAC,KAAK,EAAE,aAAa,CAAC,CAAC,CAC/D,CAAC;IACF,OAAO,KAAK,CAAC,EAAE,cAAc,EAAE,CAAC,CAAC;AACnC,CAAC"}
package/commands/start.ts DELETED
@@ -1,140 +0,0 @@
1
- import { Argv } from 'yargs';
2
-
3
- import { discoverBlocks } from '../lib/block.js';
4
- import { loadWebpackConfig } from '../lib/loadWebpackConfig.js';
5
- import { serverImport } from '../lib/serverImport.js';
6
- import { BaseArguments } from '../types.js';
7
-
8
- export const command = 'start';
9
- export const description = 'Start the Appsemble development server.';
10
-
11
- export function builder(yargs: Argv): Argv<any> {
12
- return yargs
13
- .option('port', {
14
- desc: 'The HTTP server port to use. (Development only)',
15
- type: 'number',
16
- default: 9999,
17
- })
18
- .option('database-host', {
19
- desc: 'The host of the database to connect to. This defaults to the connected database container.',
20
- })
21
- .option('database-port', {
22
- desc: 'The port of the database to connect to.',
23
- type: 'number',
24
- default: 5432,
25
- })
26
- .option('database-ssl', {
27
- desc: 'Use SSL to connect to the database.',
28
- type: 'boolean',
29
- })
30
- .option('database-name', {
31
- desc: 'The name of the database to connect to.',
32
- implies: ['database-user', 'database-password'],
33
- })
34
- .option('database-user', {
35
- desc: 'The user to use to login to the database.',
36
- implies: ['database-name', 'database-password'],
37
- })
38
- .option('database-password', {
39
- desc: 'The password to use to login to the database.',
40
- implies: ['database-name', 'database-user'],
41
- })
42
- .option('database-url', {
43
- desc: 'A connection string for the database to connect to. This is an alternative to the separate database related variables.',
44
- conflicts: ['database-host', 'database-name', 'database-user', 'database-password'],
45
- })
46
- .option('migrate-to', {
47
- desc: "To which version to migrate the database. This should be either a semver or 'next'",
48
- })
49
- .option('smtp-host', {
50
- desc: 'The host of the SMTP server to connect to.',
51
- })
52
- .option('smtp-port', {
53
- desc: 'The port of the SMTP server to connect to.',
54
- type: 'number',
55
- })
56
- .option('smtp-secure', {
57
- desc: 'Use TLS when connecting to the SMTP server.',
58
- type: 'boolean',
59
- default: false,
60
- })
61
- .option('smtp-user', {
62
- desc: 'The user to use to login to the SMTP server.',
63
- implies: ['smtp-pass', 'smtp-from'],
64
- })
65
- .option('smtp-pass', {
66
- desc: 'The password to use to login to the SMTP server.',
67
- implies: ['smtp-user', 'smtp-from'],
68
- })
69
- .option('smtp-from', {
70
- desc: 'The address to use when sending emails.',
71
- implies: ['smtp-user', 'smtp-pass'],
72
- })
73
- .option('google-client-id', {
74
- desc: 'The application key to be used for Google OAuth2.',
75
- implies: 'google-client-secret',
76
- })
77
- .option('google-client-secret', {
78
- desc: 'The secret key to be used for Google OAuth2.',
79
- implies: 'google-client-id',
80
- })
81
- .option('github-client-id', {
82
- desc: 'The application key to be used for GitHub OAuth2.',
83
- implies: 'github-client-secret',
84
- })
85
- .option('github-client-secret', {
86
- desc: 'The secret key to be used for GitHub OAuth2.',
87
- implies: 'github-client-id',
88
- })
89
- .option('gitlab-client-id', {
90
- desc: 'The application key to be used for GitLab OAuth2.',
91
- implies: 'gitlab-client-secret',
92
- })
93
- .option('gitlab-client-secret', {
94
- desc: 'The secret key to be used for GitLab OAuth2.',
95
- implies: 'gitlab-client-id',
96
- })
97
- .option('secret', {
98
- desc: 'Secret key used to sign JWTs and cookies',
99
- required: true,
100
- })
101
- .option('aes-secret', {
102
- desc: 'The key used for all the data that is encrypted using AES.',
103
- required: true,
104
- })
105
- .option('oauth-secret', {
106
- desc: 'Secret key used to sign JWTs and cookies',
107
- default: 'appsemble',
108
- })
109
- .option('disable-registration', {
110
- desc: 'If specified, user registration will be disabled on the server',
111
- type: 'boolean',
112
- default: false,
113
- })
114
- .option('host', {
115
- desc: 'The external host on which the server is available. This should include the protocol, hostname, and optionally the port.',
116
- required: true,
117
- })
118
- .option('ssl', {
119
- desc: 'Enable SSL. This is a development flag. It is not the recommended way to use SSL in production.',
120
- implies: ['ssl-key', 'ssl-cert'],
121
- })
122
- .option('ssl-key', {
123
- desc: 'The SSL key to use, either as a string or as a file path.',
124
- implies: ['ssl', 'ssl-cert'],
125
- })
126
- .option('ssl-cert', {
127
- desc: 'The SSL certificate to use, either as a string or as a file path.',
128
- implies: ['ssl', 'ssl-key'],
129
- });
130
- }
131
-
132
- export async function handler(argv: BaseArguments): Promise<void> {
133
- const { setArgv, start } = await serverImport('setArgv', 'start');
134
- setArgv(argv);
135
- const blocks = await discoverBlocks(process.cwd());
136
- const webpackConfigs = await Promise.all(
137
- blocks.map((block) => loadWebpackConfig(block, 'development')),
138
- );
139
- return start({ webpackConfigs });
140
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"create.js","sourceRoot":"","sources":["create.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAW/C,MAAM,CAAC,MAAM,OAAO,GAAG,eAAe,CAAC;AACvC,MAAM,CAAC,MAAM,WAAW,GAAG,+BAA+B,CAAC;AAE3D,MAAM,UAAU,OAAO,CAAC,KAAW;IACjC,OAAO,KAAK;SACT,UAAU,CAAC,MAAM,EAAE;QAClB,QAAQ,EAAE,uBAAuB;QACjC,YAAY,EAAE,IAAI;KACnB,CAAC;SACD,MAAM,CAAC,YAAY,EAAE;QACpB,IAAI,EAAE,OAAO;QACb,QAAQ,EAAE,uDAAuD;KAClE,CAAC;SACD,MAAM,CAAC,QAAQ,EAAE;QAChB,QAAQ,EAAE,2CAA2C;QACrD,IAAI,EAAE,QAAQ;KACf,CAAC;SACD,MAAM,CAAC,KAAK,EAAE;QACb,QAAQ,EAAE,sBAAsB;QAChC,YAAY,EAAE,SAAS;KACxB,CAAC;SACD,MAAM,CAAC,SAAS,EAAE;QACjB,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