@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,52 +0,0 @@
1
- import { stat } from 'node:fs/promises';
2
- import { join } from 'node:path';
3
-
4
- import { logger } from '@appsemble/node-utils';
5
- import { BlockConfig } from '@appsemble/types';
6
- import { Configuration } from 'webpack';
7
-
8
- /**
9
- * Load a webpack configuration file.
10
- *
11
- * A webpack configuration file may export either an webpack configuration object, or a synchronous
12
- * or asynchronous function which returns a webpack configuration object. This function supports
13
- * all 3 use cases.
14
- *
15
- * @param block The path to the webpack configuration file.
16
- * @param mode The env that would be passed to webpack by invoking `webpack --env $env`.
17
- * @param outputPath The path where the build will be output on disk.
18
- * @returns The webpack configuration as exposed by the webpack configuration file.
19
- */
20
- export async function loadWebpackConfig(
21
- block: BlockConfig,
22
- mode?: 'development' | 'production',
23
- outputPath?: string,
24
- ): Promise<Configuration> {
25
- let configPath: string;
26
- if (block.webpack) {
27
- configPath = join(block.dir, block.webpack);
28
- } else {
29
- configPath = join(block.dir, 'webpack.config.js');
30
- try {
31
- await stat(configPath);
32
- } catch {
33
- configPath = '@appsemble/webpack-config';
34
- }
35
- }
36
- logger.info(`Using webpack config from ${configPath}`);
37
- const publicPath = `/api/blocks/${block.name}/versions/${block.version}/`;
38
- let config = await import(String(configPath));
39
- config = await (config.default || config);
40
- config = config instanceof Function ? await config(block, { mode, publicPath }) : config;
41
-
42
- // Koa-webpack serves assets on the `output.path` path. Normally this field describes where to
43
- // output the files on the file system. This is monkey patched to support usage with our dev
44
- // server.
45
- config.output = config.output || {};
46
- config.output.path = outputPath || publicPath;
47
- logger.verbose(`Patched webpack config output.path to ${config.output.path}`);
48
- config.output.publicPath = publicPath;
49
- logger.verbose(`Patched webpack config output.publicPath to ${config.output.publicPath}`);
50
-
51
- return config;
52
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"organization.js","sourceRoot":"","sources":["organization.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC/C,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,QAAQ,MAAM,WAAW,CAAC;AAoBjC,MAAM,CAAC,KAAK,UAAU,kBAAkB,CAAC,EACvC,WAAW,EACX,KAAK,EACL,IAAI,EACJ,EAAE,EACF,IAAI,EACJ,OAAO,GACqB;IAC5B,MAAM,QAAQ,GAAG,IAAI,QAAQ,EAAE,CAAC;IAChC,QAAQ,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;IAE1B,IAAI,WAAW,EAAE;QACf,MAAM,CAAC,IAAI,CAAC,0BAA0B,WAAW,EAAE,CAAC,CAAC;QACrD,QAAQ,CAAC,MAAM,CAAC,aAAa,EAAE,WAAW,CAAC,CAAC;KAC7C;IAED,IAAI,KAAK,EAAE;QACT,MAAM,CAAC,IAAI,CAAC,oBAAoB,KAAK,EAAE,CAAC,CAAC;QACzC,QAAQ,CAAC,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;KACjC;IAED,IAAI,IAAI,EAAE;QACR,MAAM,CAAC,IAAI,CAAC,kBAAkB,IAAI,CAAC,IAAI,IAAI,YAAY,EAAE,CAAC,CAAC;QAC3D,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;KAC/B;IAED,IAAI,IAAI,EAAE;QACR,MAAM,CAAC,IAAI,CAAC,mBAAmB,IAAI,EAAE,CAAC,CAA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CAAC,kBAAkB,IAAI,CAAC,IAAI,IAAI,YAAY,EAAE,CAAC,CAAC;QAC3D,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;KAC/B;IAED,IAAI,IAAI,EAAE;QACR,MAAM,CAAC,IAAI,CAAC,mBAAmB,IAAI,EAAE,CAAC,CAAC;QACvC,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;KAC/B;IAED,IAAI,OAAO,EAAE;QACX,MAAM,CAAC,IAAI,CAAC,sBAAsB,OAAO,EAAE,CAAC,CAAC;QAC7C,QAAQ,CAAC,MAAM,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;KACrC;IAED,MAAM,KAAK,CAAC,KAAK,CAAC,sBAAsB,EAAE,EAAE,EAAE,QAAQ,CAAC,CAAC;IACxD,MAAM,CAAC,IAAI,CAAC,qCAAqC,EAAE,GAAG,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;AACpF,CAAC"}
@@ -1,105 +0,0 @@
1
- import { ReadStream } from 'node:fs';
2
-
3
- import { logger } from '@appsemble/node-utils';
4
- import axios from 'axios';
5
- import FormData from 'form-data';
6
-
7
- interface CreateOrganizationArguments {
8
- description: string;
9
- email: string;
10
- id: string;
11
- name: string;
12
- website: string;
13
- icon: ReadStream;
14
- }
15
-
16
- interface UpdateOrganizationArguments {
17
- description: string;
18
- email: string;
19
- id: string;
20
- icon: ReadStream;
21
- name: string;
22
- website: string;
23
- }
24
-
25
- export async function createOrganization({
26
- description,
27
- email,
28
- icon,
29
- id,
30
- name,
31
- website,
32
- }: CreateOrganizationArguments): Promise<void> {
33
- const formData = new FormData();
34
- formData.append('id', id);
35
-
36
- if (description) {
37
- logger.info(`Setting description to ${description}`);
38
- formData.append('description', description);
39
- }
40
-
41
- if (email) {
42
- logger.info(`Setting email to ${email}`);
43
- formData.append('email', email);
44
- }
45
-
46
- if (icon) {
47
- logger.info(`Including icon ${icon.path || 'from stdin'}`);
48
- formData.append('icon', icon);
49
- }
50
-
51
- if (name) {
52
- logger.info(`Setting name to ${name}`);
53
- formData.append('name', name);
54
- }
55
-
56
- if (website) {
57
- logger.info(`Setting website to ${website}`);
58
- formData.append('website', website);
59
- }
60
-
61
- logger.info(`Creating organization ${id}${name ? ` (${name})` : ''}`);
62
- await axios.post('/api/organizations', formData);
63
- logger.info(`Successfully created organization ${id}${name ? ` (${name})` : ''}`);
64
- }
65
-
66
- export async function updateOrganization({
67
- description,
68
- email,
69
- icon,
70
- id,
71
- name,
72
- website,
73
- }: UpdateOrganizationArguments): Promise<void> {
74
- logger.info(`Updating organization ${id}${name ? ` (${name})` : ''}`);
75
-
76
- const formData = new FormData();
77
-
78
- if (description) {
79
- logger.info(`Setting description to ${description}`);
80
- formData.append('description', description);
81
- }
82
-
83
- if (email) {
84
- logger.info(`Setting email to ${email}`);
85
- formData.append('email', email);
86
- }
87
-
88
- if (icon) {
89
- logger.info(`Including icon ${icon.path || 'from stdin'}`);
90
- formData.append('icon', icon);
91
- }
92
-
93
- if (name) {
94
- logger.info(`Setting name to ${name}`);
95
- formData.append('name', name);
96
- }
97
-
98
- if (website) {
99
- logger.info(`Setting website to ${website}`);
100
- formData.append('website', website);
101
- }
102
-
103
- await axios.patch(`/api/organizations/${id}`, formData);
104
- logger.info(`Successfully updated organization ${id}${name ? ` (${name})` : ''}`);
105
- }
package/lib/output.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"output.js","sourceRoot":"","sources":["output.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,MAAM,CAAC;AAE1D,MAAM,UAAU,eAAe,CAAC,QAAgB,EAAE,IAAY,EAAE,MAAyB;IACvF,MAAM,WAAW,GAAG,IAAI,WAAW,EAAE,CAAC;IACtC,MAAM,GAAG,GAAG,aAAa,CAAC,IAAI,EAAE,EAAE,WAAW,EAAE,CAAC,CAAC;IAEjD,OAAO,MAAM;SACV,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE;QACb,MAAM,IAAI,GAAG,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QACzC,IAAI,MAAM,GAAG,QAAQ,CAAC;QACtB,IAAI,MAAM,CAAC,IAAI,CAAC,EAAE;YAChB,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,WAAW,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;YACzD,MAAM,IAAI,IAAI,IAAI,IAAI,GAAG,EAAE,CAAC;SAC7B;QACD,OAAO,GAAG,MAAM,IAAI,KAAK,CAAC,OAAO,EAAE,CAAC;IACtC,CAAC,CAAC;SACD,IAAI,CAAC,IAAI,CAAC,CAAC;AAChB,CAAC"}
package/lib/output.ts DELETED
@@ -1,19 +0,0 @@
1
- import { ValidationError } from 'jsonschema';
2
- import { isNode, LineCounter, parseDocument } from 'yaml';
3
-
4
- export function printAxiosError(filename: string, yaml: string, errors: ValidationError[]): string {
5
- const lineCounter = new LineCounter();
6
- const doc = parseDocument(yaml, { lineCounter });
7
-
8
- return errors
9
- .map((error) => {
10
- const node = doc.getIn(error.path, true);
11
- let result = filename;
12
- if (isNode(node)) {
13
- const { col, line } = lineCounter.linePos(node.range[0]);
14
- result += `:${line}:${col}`;
15
- }
16
- return `${result} ${error.message}`;
17
- })
18
- .join('\n');
19
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"processCss.js","sourceRoot":"","sources":["processCss.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE5C,OAAO,OAAO,MAAM,SAAS,CAAC;AAC9B,OAAO,aAAa,MAAM,gBAAgB,CAAC;AAC3C,OAAO,SAAS,MAAM,qBAAqB,CAAC;AAC5C,OAAO,UAAU,MAAM,aAAa,CAAC;AAErC;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,IAAY;IAC3C,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IAE1C,MAAM,aAAa,GAAG,MAAM,SAAS,EAAE,CAAC;IACxC,MAAM,OAAO,GAAG,OAAO,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;IAC/C,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC;IAC3C,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,EAAE,OAAO,EAAE,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;IAEzD,MAAM,EAAE,GAAG,EAAE,GAAG,MAAM,OAAO,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC;IACtE,OAAO,GAAG,CAAC;AACb,CAAC"}
package/lib/processCss.ts DELETED
@@ -1,24 +0,0 @@
1
- import { readFile } from 'node:fs/promises';
2
-
3
- import postcss from 'postcss';
4
- import postcssImport from 'postcss-import';
5
- import postcssrc from 'postcss-load-config';
6
- import postcssUrl from 'postcss-url';
7
-
8
- /**
9
- * Verifies and processes a CSS file using PostCSS.
10
- *
11
- * @param path Filepath of the CSS file
12
- * @returns Processed CSS files concatenated into a single value.
13
- */
14
- export async function processCss(path: string): Promise<string> {
15
- const data = await readFile(path, 'utf8');
16
-
17
- const postcssConfig = await postcssrc();
18
- const postCss = postcss(postcssConfig.plugins);
19
- postCss.use(postcssUrl({ url: 'inline' }));
20
- postCss.use(postcssImport({ plugins: postCss.plugins }));
21
-
22
- const { css } = await postCss.process(data, { from: path, to: null });
23
- return css;
24
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"resource.js","sourceRoot":"","sources":["resource.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,C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CACJ,CAAC;KACH;AACH,CAAC"}
package/lib/resource.ts DELETED
@@ -1,128 +0,0 @@
1
- import { readFile } from 'node:fs/promises';
2
-
3
- import { AppsembleError, logger, readData } from '@appsemble/node-utils';
4
- import { Resource } from '@appsemble/types';
5
- import axios from 'axios';
6
-
7
- interface UpdateResourceParams {
8
- /**
9
- * The name of the resource that a new entry is being created of.
10
- */
11
- resourceName: string;
12
-
13
- /**
14
- * The path in which the resource JSON is located.
15
- */
16
- path: string;
17
-
18
- /**
19
- * The ID of the app to create a resource entry for.
20
- */
21
- appId: number;
22
-
23
- /**
24
- * The remote server to create the app on.
25
- */
26
- remote: string;
27
- }
28
-
29
- interface CreateResourceParams {
30
- /**
31
- * The name of the resource that a new entry is being created of.
32
- */
33
- resourceName: string;
34
-
35
- /**
36
- * The path in which the resource JSON is located.
37
- */
38
- path: string;
39
-
40
- /**
41
- * The ID of the app to create a resource entry for.
42
- */
43
- appId: number;
44
-
45
- /**
46
- * The remote server to create the app on.
47
- */
48
- remote: string;
49
- }
50
-
51
- export async function createResource({
52
- appId,
53
- path,
54
- remote,
55
- resourceName,
56
- }: CreateResourceParams): Promise<void> {
57
- const csv = path.endsWith('.csv');
58
- let resources: Buffer | Resource[];
59
-
60
- if (csv) {
61
- resources = await readFile(path);
62
- } else {
63
- const [file] = await readData<Resource>(path);
64
-
65
- if (typeof file !== 'object') {
66
- throw new AppsembleError(`File at ${path} does not contain an object or array of objects`);
67
- }
68
-
69
- resources = [].concat(file);
70
- }
71
-
72
- logger.info(`Creating resource(s) from ${path}`);
73
- const { data } = await axios.post<Resource | Resource[]>(
74
- `/api/apps/${appId}/resources/${resourceName}`,
75
- resources,
76
- {
77
- baseURL: remote,
78
- headers: { 'content-type': csv ? 'text/csv' : 'application/json' },
79
- },
80
- );
81
- const ids: number[] = [].concat(data).map((d: Resource) => d.id);
82
- const url = new URL(`/apps/${appId}/resources/${resourceName}/`, remote);
83
- logger.info(
84
- `Successfully created ${ids.length} resource${resources.length === 1 ? '' : 's'} at: \n${ids
85
- .map((id) => `${url}${id}`)
86
- .join('\n')}`,
87
- );
88
- }
89
-
90
- export async function updateResource({
91
- appId,
92
- path,
93
- remote,
94
- resourceName,
95
- }: UpdateResourceParams): Promise<void> {
96
- const [file] = await readData<Resource>(path);
97
-
98
- if (typeof file !== 'object') {
99
- throw new AppsembleError(`File at ${path} does not contain an object or array of objects`);
100
- }
101
-
102
- const resources = [].concat(file);
103
- logger.info(`Updating ${resources.length} resource(s) from ${path}`);
104
-
105
- for (const resource of resources) {
106
- if (!resource.id) {
107
- logger.info(`Skipping resource ${resources.indexOf(resource)} because it has no ID.`);
108
- continue;
109
- }
110
-
111
- const {
112
- data: { id },
113
- } = await axios.put<Resource>(
114
- `/api/apps/${appId}/resources/${resourceName}/${resource.id}`,
115
- resource,
116
- {
117
- baseURL: remote,
118
- },
119
- );
120
-
121
- logger.info(
122
- `Successfully updated resource ${id} at ${new URL(
123
- `/apps/${appId}/resources/${resourceName}/${id}`,
124
- remote,
125
- )}`,
126
- );
127
- }
128
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"serverImport.js","sourceRoot":"","sources":["serverImport.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AAEvC,MAAM,MAAM,GAAG,OAAO,CAAC,QAAQ,KAAK,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC;AACxD,MAAM,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC;IACnD,CAAC,CAAC,8CAA8C;IAChD,CAAC,CAAC,wBAAwB,CAAC;AAC7B,MAAM,eAAe,GAAG;;EAEtB,MAAM,IAAI,OAAO;CAClB,CAAC;AAEF;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,YAAY,CAEhC,GAAG,OAAY;;IACf,IAAI;QACF,qEAAqE;QACrE,4FAA4F;QAC5F,uCAAuC;QACvC,MAAM,GAAG,GAAG,MAAM,MAAM,CAAC,mBAAmB,CAAC,CAAC;QAC9C,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE;YAC5B,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,MAAM,CAAC,EAAE;gBACrB,MAAM,IAAI,KAAK,CAAC,qCAAqC,MAAM,EAAE,CAAC,CAAC;aAChE;SACF;QACD,OAAO,GAAG,CAAC;KACZ;IAAC,OAAO,KAAc,EAAE;QACvB,IACG,KAAa,CAAC,IAAI,KAAK,kBAAkB;YAC1C,CAAA,MAAC,KAAa,CAAC,YAAY,0CAAG,CAAC,CAAC,MAAK,UAAU,EAC/C;YACA,MAAM,KAAK,CAAC;SACb;QACD,MAAM,IAAI,cAAc,CAAC,eAAe,CAAC,CAAC;KAC3C;AACH,CAAC"}
@@ -1,42 +0,0 @@
1
- import { AppsembleError } from '@appsemble/node-utils';
2
- import { has } from '@appsemble/utils';
3
-
4
- const PROMPT = process.platform === 'win32' ? '>' : '$';
5
- const COMMAND = /yarn/.test(process.env.npm_execpath)
6
- ? 'yarn add --dev --ignore-workspace-root-check'
7
- : 'npm install --save-dev';
8
- const INSTALL_MESSAGE = `This command requires the Appsemble server to be installed. It can be installed by running the following command:
9
-
10
- ${PROMPT} ${COMMAND} @appsemble/server
11
- `;
12
-
13
- /**
14
- * Import an exported member of @appsemble/server.
15
- *
16
- * @param members The names of the exported member to import.
17
- * @returns The exported member.
18
- */
19
- export async function serverImport<
20
- T extends 'cleanupResources' | 'migrate' | 'runCronJobs' | 'setArgv' | 'start',
21
- >(...members: T[]): Promise<Record<T, any>> {
22
- try {
23
- // eslint-disable-next-line @typescript-eslint/prefer-ts-expect-error
24
- // @ts-ignore Because the the server isn’t built and published, an error is expected here at
25
- // build time, but while type checking.
26
- const mod = await import('@appsemble/server');
27
- for (const member of members) {
28
- if (!has(mod, member)) {
29
- throw new Error(`@appsemble/server does not export ${member}`);
30
- }
31
- }
32
- return mod;
33
- } catch (error: unknown) {
34
- if (
35
- (error as any).code !== 'MODULE_NOT_FOUND' ||
36
- (error as any).requireStack?.[0] !== __filename
37
- ) {
38
- throw error;
39
- }
40
- throw new AppsembleError(INSTALL_MESSAGE);
41
- }
42
- }
package/lib/team.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"team.js","sourceRoot":"","sources":["team.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAG/D,OAAO,KAAK,MAAM,OAAO,CAAC;AA2D1B,MAAM,UAAU,kBAAkB,CAAC,WAAqB;IACtD,MAAM,eAAe,GAAG,UAAU,CAAC;IAEnC,IAAI,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE;QACrD,MAAM,IAAI,cAAc,CAAC,gEAAgE,CAAC,CAAC;KAC5F;IAED,OAAO,WAAW,CAAC,MAAM;QACvB,CAAC,CAAC,MAAM,CAAC,WAAW,CAChB,WAAW,CAAC,GAAG,CAAC,CAAC,UAAU,EAAE,EAAE;YAC7B,MAAM,CAAC,GAAG,EAAE,GAAG,KAAK,CAAC,GAAG,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;YAC9C,OAAO,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;QAChC,CAAC,CAAC,CACH;QACH,CAAC,CAAC,SAAS,CAAC;AAChB,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,EAC/B,KAAK,EACL,IAAI,EACJ,MAAM,EACN,WAAW,GAAG,EAAE,GACC;IACjB,MAAM,CAAC,IAAI,CAAC,iBAAiB,IAAI,EAAE,CAAC,CAAC;IACrC,MAAM,EACJ,IAAI,EAAE,EAAE,EAAE,EAAE,GACb,GAAG,MAAM,KAAK,CAA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AAU,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC,CAAC;IAC9F,MAAM,CAAC,IAAI,CAAC,wBAAwB,IAAI,YAAY,EAAE,EAAE,CAAC,CAAC;AAC5D,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,YAAY,CAAC,EACjC,KAAK,EACL,EAAE,EACF,MAAM,EACN,IAAI,EACJ,IAAI,GACmB;IACvB,MAAM,CAAC,IAAI,CAAC,YAAY,IAAI,mBAAmB,EAAE,OAAO,IAAI,EAAE,CAAC,CAAC;IAChE,MAAM,KAAK,CAAC,GAAG,CAAC,aAAa,KAAK,UAAU,EAAE,YAAY,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC,CAAC;IACjG,MAAM,CAAC,IAAI,CAAC,wBAAwB,IAAI,YAAY,EAAE,EAAE,CAAC,CAAC;AAC5D,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,YAAY,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,IAAI,EAA0B;IAC5E,MAAM,CAAC,IAAI,CAAC,YAAY,IAAI,YAAY,EAAE,EAAE,CAAC,CAAC;IAC9C,MAAM,KAAK,CAAC,MAAM,CAAC,aAAa,KAAK,UAAU,EAAE,YAAY,IAAI,EAAE,CAAC,CAAC;IACrE,MAAM,CAAC,IAAI,CAAC,wBAAwB,IAAI,cAAc,EAAE,EAAE,CAAC,CAAC;AAC9D,CAAC"}
package/lib/team.ts DELETED
@@ -1,152 +0,0 @@
1
- import { AppsembleError, logger } from '@appsemble/node-utils';
2
- import { Team } from '@appsemble/types';
3
- import { TeamRole } from '@appsemble/utils';
4
- import axios from 'axios';
5
-
6
- interface SharedTeamParams {
7
- /**
8
- * The ID of the app to create the team for.
9
- */
10
- appId: number;
11
-
12
- /**
13
- * The remote server to create the team on.
14
- */
15
- remote: string;
16
- }
17
-
18
- interface SharedExistingTeamParams extends SharedTeamParams {
19
- /**
20
- * The ID of the team.
21
- */
22
- id: number;
23
- }
24
-
25
- interface SharedTeamMemberParams extends SharedExistingTeamParams {
26
- /**
27
- * The ID or email address of the team member.
28
- */
29
- user: string;
30
- }
31
-
32
- interface UpdateTeamMemberParams extends SharedTeamMemberParams {
33
- /**
34
- * The new role of the team member.
35
- */
36
- role: TeamRole;
37
- }
38
-
39
- interface UpdateTeamParams extends SharedExistingTeamParams {
40
- /**
41
- * The new name of the team.
42
- */
43
- name?: string;
44
-
45
- /**
46
- * The list of annotations to apply in key=value format.
47
- */
48
- annotations?: string[];
49
- }
50
-
51
- interface CreateTeamParams extends SharedTeamParams {
52
- /**
53
- * The name of the team.
54
- */
55
- name: string;
56
-
57
- /**
58
- * The list of annotations to apply in key=value format.
59
- */
60
- annotations?: string[];
61
- }
62
-
63
- export function resolveAnnotations(annotations: string[]): Record<string, string> {
64
- const annotationRegex = /^\w+=.+$/;
65
-
66
- if (annotations.some((a) => !annotationRegex.test(a))) {
67
- throw new AppsembleError('One of the annotations did not follow the pattern of key=value');
68
- }
69
-
70
- return annotations.length
71
- ? Object.fromEntries(
72
- annotations.map((annotation) => {
73
- const [key, ...value] = annotation.split('=');
74
- return [key, value.join('=')];
75
- }),
76
- )
77
- : undefined;
78
- }
79
-
80
- export async function createTeam({
81
- appId,
82
- name,
83
- remote,
84
- annotations = [],
85
- }: CreateTeamParams): Promise<void> {
86
- logger.info(`Creating team ${name}`);
87
- const {
88
- data: { id },
89
- } = await axios.post<Team>(
90
- `/api/apps/${appId}/teams`,
91
- {
92
- name,
93
- annotations: resolveAnnotations(annotations),
94
- },
95
- { baseURL: remote },
96
- );
97
- logger.info(`Successfully created team ${name} with ID ${id}`);
98
- }
99
-
100
- export async function deleteTeam({ appId, id, remote }: SharedExistingTeamParams): Promise<void> {
101
- logger.info(`Deleting team ${id}`);
102
- await axios.delete(`/api/apps/${appId}/teams/${id}`, { baseURL: remote });
103
- logger.info(`Successfully deleted team ${id}`);
104
- }
105
-
106
- export async function updateTeam({
107
- appId,
108
- id,
109
- name,
110
- remote,
111
- annotations = [],
112
- }: UpdateTeamParams): Promise<void> {
113
- logger.info(`Updating team ${id}`);
114
- await axios.put(
115
- `/api/apps/${appId}/teams/${id}`,
116
- {
117
- name,
118
- annotations: resolveAnnotations(annotations),
119
- },
120
- { baseURL: remote },
121
- );
122
- logger.info(`Successfully updated team ${id}`);
123
- }
124
-
125
- export async function inviteMember({
126
- appId,
127
- id,
128
- remote,
129
- user,
130
- }: SharedTeamMemberParams): Promise<void> {
131
- logger.info(`Inviting ${user} to team ${id}`);
132
- await axios.post(`/api/apps/${appId}/teams/${id}/members`, { id: user }, { baseURL: remote });
133
- logger.info(`Successfully invited ${user} to team ${id}`);
134
- }
135
-
136
- export async function updateMember({
137
- appId,
138
- id,
139
- remote,
140
- role,
141
- user,
142
- }: UpdateTeamMemberParams): Promise<void> {
143
- logger.info(`Updating ${user}’s role in team ${id} to ${role}`);
144
- await axios.put(`/api/apps/${appId}/teams/${id}/members/${user}`, { role }, { baseURL: remote });
145
- logger.info(`Successfully updated ${user} in team ${id}`);
146
- }
147
-
148
- export async function deleteMember({ appId, id, user }: SharedTeamMemberParams): Promise<void> {
149
- logger.info(`Deleting ${user} to team ${id}`);
150
- await axios.delete(`/api/apps/${appId}/teams/${id}/members/${user}`);
151
- logger.info(`Successfully deleted ${user} from team ${id}`);
152
- }
package/tsconfig.json DELETED
@@ -1,9 +0,0 @@
1
- {
2
- "extends": "../../tsconfig",
3
- "compilerOptions": {
4
- "jsx": "react",
5
- "jsxFactory": "h",
6
- "jsxFragmentFactory": "null",
7
- "types": ["jest", "node"]
8
- }
9
- }
package/types.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["types.ts"],"names":[],"mappings":""}
package/types.ts DELETED
@@ -1,110 +0,0 @@
1
- import { AppVisibility } from '@appsemble/types';
2
- import { PackageJson } from 'read-pkg-up';
3
- import { JsonObject } from 'type-fest';
4
-
5
- /**
6
- * The base arguments from the command line.
7
- *
8
- * See {@link ./index.js}.
9
- */
10
- export interface BaseArguments {
11
- verbose?: number;
12
- quiet?: number;
13
- remote: string;
14
- clientCredentials?: string;
15
- }
16
-
17
- /**
18
- * The arguments passed to `appsemble app update`.
19
- *
20
- * See {@link ./commands/app/update.js}.
21
- */
22
- export interface UpdateAppArguments extends BaseArguments {
23
- /**
24
- * The ID of the app to update.
25
- */
26
- appId: number;
27
-
28
- /**
29
- * The path in which the app YAML is located.
30
- */
31
- path: string;
32
-
33
- /**
34
- * Visibility of the app in the public app store.
35
- */
36
- visibility: AppVisibility;
37
-
38
- /**
39
- * Whether the app should be marked as a template.
40
- */
41
- template: boolean;
42
-
43
- /**
44
- * Whether the locked property should be ignored.
45
- */
46
- force: boolean;
47
- }
48
-
49
- export interface MonoRepoPackageJson extends PackageJson {
50
- appsembleServer?: JsonObject;
51
- }
52
-
53
- export interface AppsembleContext {
54
- /**
55
- * If `remote` is specified, this will override `--remote` passed by the command line.
56
- */
57
- remote?: string;
58
-
59
- /**
60
- * If `organization` is specified, this will override `--organization` passed by the command line
61
- * when creating apps.
62
- */
63
- organization?: string;
64
-
65
- icon?: string;
66
-
67
- iconBackground?: string;
68
-
69
- maskableIcon?: string;
70
-
71
- /**
72
- * If `id` is specified, this will override `--id` passed by the command line when
73
- * updating an app.
74
- */
75
- id?: number;
76
-
77
- /**
78
- * The Google Analytics ID that should be used for the app.
79
- */
80
- googleAnalyticsId?: string;
81
-
82
- /**
83
- * The custom Sentry DSN for the app.
84
- */
85
- sentryDsn?: string;
86
-
87
- /**
88
- * The environment for the custom Sentry DSN for the app.
89
- */
90
- sentryEnvironment?: string;
91
-
92
- /**
93
- * If `visibility` is specified, this will override `--visibility` passed on the command line.
94
- */
95
- visibility?: AppVisibility;
96
-
97
- /**
98
- * If `template` is specified, this will override `--template` passed on the command line.
99
- */
100
- template?: boolean;
101
- }
102
-
103
- export interface AppsembleRC {
104
- /**
105
- * The background color to use for maskable icons.
106
- */
107
- iconBackground?: string;
108
-
109
- context?: Record<string, AppsembleContext>;
110
- }