@appsemble/cli 0.18.27 → 0.18.31

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 (130) hide show
  1. package/dist/commands/app/create.d.ts +2 -1
  2. package/dist/commands/app/create.js +9 -3
  3. package/dist/commands/app/create.js.map +1 -1
  4. package/dist/commands/app/update.js +4 -2
  5. package/dist/commands/app/update.js.map +1 -1
  6. package/dist/commands/asset/create.d.ts +15 -0
  7. package/dist/commands/asset/create.js +66 -0
  8. package/dist/commands/asset/create.js.map +1 -0
  9. package/dist/commands/asset.d.ts +4 -0
  10. package/dist/commands/asset.js +11 -0
  11. package/dist/commands/asset.js.map +1 -0
  12. package/dist/commands/block/build.js +3 -4
  13. package/dist/commands/block/build.js.map +1 -1
  14. package/dist/commands/block/extract-messages.js +3 -4
  15. package/dist/commands/block/extract-messages.js.map +1 -1
  16. package/dist/commands/block/publish.js +4 -6
  17. package/dist/commands/block/publish.js.map +1 -1
  18. package/dist/commands/config/get.js +2 -1
  19. package/dist/commands/config/get.js.map +1 -1
  20. package/dist/commands/config/set.js +2 -1
  21. package/dist/commands/config/set.js.map +1 -1
  22. package/dist/commands/organization/create.js +9 -31
  23. package/dist/commands/organization/create.js.map +1 -1
  24. package/dist/commands/organization/update.js +9 -30
  25. package/dist/commands/organization/update.js.map +1 -1
  26. package/dist/commands/resource/create.d.ts +3 -1
  27. package/dist/commands/resource/create.js +17 -7
  28. package/dist/commands/resource/create.js.map +1 -1
  29. package/dist/commands/resource/update.d.ts +3 -1
  30. package/dist/commands/resource/update.js +18 -8
  31. package/dist/commands/resource/update.js.map +1 -1
  32. package/dist/commands/start.js +2 -2
  33. package/dist/commands/start.js.map +1 -1
  34. package/dist/commands/{app/team → team}/create.d.ts +5 -2
  35. package/dist/commands/team/create.js +44 -0
  36. package/dist/commands/team/create.js.map +1 -0
  37. package/dist/commands/{app/team → team}/delete.d.ts +4 -2
  38. package/dist/commands/team/delete.js +39 -0
  39. package/dist/commands/team/delete.js.map +1 -0
  40. package/dist/commands/{app/team → team}/member/delete.d.ts +4 -2
  41. package/dist/commands/{app/team → team}/member/delete.js +16 -6
  42. package/dist/commands/team/member/delete.js.map +1 -0
  43. package/dist/commands/{app/team → team}/member/invite.d.ts +4 -2
  44. package/dist/commands/{app/team → team}/member/invite.js +16 -6
  45. package/dist/commands/team/member/invite.js.map +1 -0
  46. package/dist/commands/{app/team → team}/member/update.d.ts +4 -2
  47. package/dist/commands/{app/team → team}/member/update.js +16 -6
  48. package/dist/commands/team/member/update.js.map +1 -0
  49. package/dist/commands/{app/team → team}/member.d.ts +0 -0
  50. package/dist/commands/{app/team → team}/member.js +0 -0
  51. package/dist/commands/team/member.js.map +1 -0
  52. package/dist/commands/{app/team → team}/update.d.ts +4 -2
  53. package/dist/commands/{app/team → team}/update.js +7 -10
  54. package/dist/commands/team/update.js.map +1 -0
  55. package/dist/commands/{app/team.d.ts → team.d.ts} +0 -0
  56. package/dist/commands/{app/team.js → team.js} +0 -0
  57. package/dist/commands/team.js.map +1 -0
  58. package/dist/lib/app.d.ts +146 -0
  59. package/dist/lib/app.js +332 -9
  60. package/dist/lib/app.js.map +1 -1
  61. package/dist/lib/{createResource.d.ts → asset.d.ts} +5 -4
  62. package/dist/lib/asset.js +23 -0
  63. package/dist/lib/asset.js.map +1 -0
  64. package/dist/lib/block.d.ts +61 -0
  65. package/dist/lib/block.js +297 -0
  66. package/dist/lib/block.js.map +1 -0
  67. package/dist/lib/getBlockConfigFromTypeScript.js +4 -3
  68. package/dist/lib/getBlockConfigFromTypeScript.js.map +1 -1
  69. package/dist/lib/organization.d.ts +21 -0
  70. package/dist/lib/organization.js +65 -0
  71. package/dist/lib/organization.js.map +1 -0
  72. package/dist/lib/{updateResource.d.ts → resource.d.ts} +19 -0
  73. package/dist/lib/{updateResource.js → resource.js} +17 -2
  74. package/dist/lib/resource.js.map +1 -0
  75. package/dist/lib/serverImport.js +4 -3
  76. package/dist/lib/serverImport.js.map +1 -1
  77. package/dist/lib/team.d.ts +6 -1
  78. package/dist/lib/team.js +17 -8
  79. package/dist/lib/team.js.map +1 -1
  80. package/dist/types.d.ts +2 -2
  81. package/package.json +5 -5
  82. package/dist/commands/app/team/create.js +0 -29
  83. package/dist/commands/app/team/create.js.map +0 -1
  84. package/dist/commands/app/team/delete.js +0 -29
  85. package/dist/commands/app/team/delete.js.map +0 -1
  86. package/dist/commands/app/team/member/delete.js.map +0 -1
  87. package/dist/commands/app/team/member/invite.js.map +0 -1
  88. package/dist/commands/app/team/member/update.js.map +0 -1
  89. package/dist/commands/app/team/member.js.map +0 -1
  90. package/dist/commands/app/team/update.js.map +0 -1
  91. package/dist/commands/app/team.js.map +0 -1
  92. package/dist/lib/buildBlock.d.ts +0 -9
  93. package/dist/lib/buildBlock.js +0 -39
  94. package/dist/lib/buildBlock.js.map +0 -1
  95. package/dist/lib/createApp.d.ts +0 -59
  96. package/dist/lib/createApp.js +0 -120
  97. package/dist/lib/createApp.js.map +0 -1
  98. package/dist/lib/createResource.js +0 -25
  99. package/dist/lib/createResource.js.map +0 -1
  100. package/dist/lib/discoverBlocks.d.ts +0 -10
  101. package/dist/lib/discoverBlocks.js +0 -24
  102. package/dist/lib/discoverBlocks.js.map +0 -1
  103. package/dist/lib/getBlockConfig.d.ts +0 -8
  104. package/dist/lib/getBlockConfig.js +0 -45
  105. package/dist/lib/getBlockConfig.js.map +0 -1
  106. package/dist/lib/makePayload.d.ts +0 -9
  107. package/dist/lib/makePayload.js +0 -94
  108. package/dist/lib/makePayload.js.map +0 -1
  109. package/dist/lib/processBlockMessages.d.ts +0 -2
  110. package/dist/lib/processBlockMessages.js +0 -43
  111. package/dist/lib/processBlockMessages.js.map +0 -1
  112. package/dist/lib/publishBlock.d.ts +0 -8
  113. package/dist/lib/publishBlock.js +0 -32
  114. package/dist/lib/publishBlock.js.map +0 -1
  115. package/dist/lib/traverseAppDirectory.d.ts +0 -11
  116. package/dist/lib/traverseAppDirectory.js +0 -94
  117. package/dist/lib/traverseAppDirectory.js.map +0 -1
  118. package/dist/lib/traverseBlockThemes.d.ts +0 -9
  119. package/dist/lib/traverseBlockThemes.js +0 -40
  120. package/dist/lib/traverseBlockThemes.js.map +0 -1
  121. package/dist/lib/updateApp.d.ts +0 -55
  122. package/dist/lib/updateApp.js +0 -78
  123. package/dist/lib/updateApp.js.map +0 -1
  124. package/dist/lib/updateResource.js.map +0 -1
  125. package/dist/lib/uploadAppBlockTheme.d.ts +0 -11
  126. package/dist/lib/uploadAppBlockTheme.js +0 -33
  127. package/dist/lib/uploadAppBlockTheme.js.map +0 -1
  128. package/dist/lib/uploadMessages.d.ts +0 -9
  129. package/dist/lib/uploadMessages.js +0 -39
  130. package/dist/lib/uploadMessages.js.map +0 -1
@@ -1,94 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.makePayload = void 0;
7
- const fs_1 = require("fs");
8
- const path_1 = require("path");
9
- const util_1 = require("util");
10
- const node_utils_1 = require("@appsemble/node-utils");
11
- const utils_1 = require("@appsemble/utils");
12
- const form_data_1 = __importDefault(require("form-data"));
13
- const getBlockConfigFromTypeScript_1 = require("./getBlockConfigFromTypeScript");
14
- /**
15
- * Configure the payload for a new block version upload.
16
- *
17
- * @param config - The block configuration
18
- * @returns The payload that should be sent to the version endpoint.
19
- */
20
- async function makePayload(config) {
21
- const { dir, output } = config;
22
- const distPath = path_1.resolve(dir, output);
23
- const form = new form_data_1.default();
24
- const { description, layout, longDescription, name, version } = config;
25
- const { actions, events, messages, parameters } = getBlockConfigFromTypeScript_1.getBlockConfigFromTypeScript(config);
26
- const files = await fs_1.promises.readdir(dir);
27
- const icon = files.find((entry) => entry.match(/^icon\.(png|svg)$/));
28
- function append(field, value) {
29
- if (value) {
30
- const serialized = typeof value === 'string' ? value : JSON.stringify(value);
31
- node_utils_1.logger.verbose(`Using ${field}: ${util_1.inspect(value, { colors: true, depth: 20 })}`);
32
- form.append(field, serialized);
33
- }
34
- else {
35
- node_utils_1.logger.silly(`Skipping parameter ${field}`);
36
- }
37
- }
38
- append('actions', actions);
39
- append('description', description);
40
- append('longDescription', longDescription);
41
- append('events', events);
42
- append('layout', layout);
43
- append('name', name);
44
- append('parameters', parameters);
45
- append('version', version);
46
- if (icon) {
47
- const iconPath = path_1.join(dir, icon);
48
- node_utils_1.logger.info(`Using icon: ${iconPath}`);
49
- form.append('icon', fs_1.createReadStream(iconPath));
50
- }
51
- if (messages) {
52
- if (!files.includes('i18n')) {
53
- throw new node_utils_1.AppsembleError('This block has messages defined, but the message files could not be found. Try running extract-messages');
54
- }
55
- const messageKeys = Object.keys(messages).sort(utils_1.compareStrings);
56
- const messagesResult = {};
57
- const messagesPath = path_1.join(dir, 'i18n');
58
- const translations = (await fs_1.promises.readdir(messagesPath)).map((language) => language.toLowerCase());
59
- if (!translations.includes('en.json')) {
60
- throw new node_utils_1.AppsembleError('Could not find ‘en.json’. Try running extract-messages');
61
- }
62
- const duplicates = translations.filter((language, index) => translations.indexOf(language) !== index);
63
- if (duplicates.length) {
64
- throw new node_utils_1.AppsembleError(`Found duplicate language codes: ‘${duplicates.join('’, ')}`);
65
- }
66
- for (const languageFile of translations.filter((t) => t.endsWith('.json'))) {
67
- const language = path_1.basename(languageFile, '.json');
68
- const languagePath = path_1.join(messagesPath, languageFile);
69
- const [m] = await node_utils_1.readData(languagePath);
70
- const languageKeys = Object.keys(m).sort(utils_1.compareStrings);
71
- if (languageKeys.length !== messageKeys.length ||
72
- languageKeys.some((key) => !messageKeys.includes(key))) {
73
- throw new node_utils_1.AppsembleError(`‘${languagePath}’ contains mismatching message keys. Try running extract-messages`);
74
- }
75
- node_utils_1.logger.info(`Including ${language} translations from ‘${languagePath}’`);
76
- messagesResult[language] = m;
77
- }
78
- form.append('messages', JSON.stringify(messagesResult));
79
- }
80
- await node_utils_1.opendirSafe(distPath, (fullpath, stat) => {
81
- if (!stat.isFile()) {
82
- return;
83
- }
84
- const relativePath = path_1.relative(distPath, fullpath);
85
- const realPath = path_1.relative(process.cwd(), fullpath);
86
- node_utils_1.logger.info(`Adding file: “${realPath}” as “${relativePath}”`);
87
- form.append('files', fs_1.createReadStream(fullpath), {
88
- filename: encodeURIComponent(relativePath),
89
- });
90
- }, { recursive: true });
91
- return form;
92
- }
93
- exports.makePayload = makePayload;
94
- //# sourceMappingURL=makePayload.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"makePayload.js","sourceRoot":"","sources":["../../src/lib/makePayload.ts"],"names":[],"mappings":";;;;;;AAAA,2BAAsD;AACtD,+BAAyD;AACzD,+BAA+B;AAE/B,sDAAsF;AAEtF,4CAAkD;AAClD,0DAAiC;AAEjC,iFAA8E;AAE9E;;;;;GAKG;AACI,KAAK,UAAU,WAAW,CAAC,MAAmB;IACnD,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC;IAC/B,MAAM,QAAQ,GAAG,cAAO,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;IACtC,MAAM,IAAI,GAAG,IAAI,mBAAQ,EAAE,CAAC;IAC5B,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,eAAe,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,MAAM,CAAC;IACvE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,GAAG,2DAA4B,CAAC,MAAM,CAAC,CAAC;IACvF,MAAM,KAAK,GAAG,MAAM,aAAE,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACpC,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,mBAAmB,CAAC,CAAC,CAAC;IAErE,SAAS,MAAM,CAAC,KAAa,EAAE,KAAU;QACvC,IAAI,KAAK,EAAE;YACT,MAAM,UAAU,GAAG,OAAO,KAAK,K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,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,WAAW,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,EACtD;gBACA,MAAM,IAAI,2BAAc,CACtB,IAAI,YAAY,mEAAmE,CACpF,CAAC;aACH;YAED,mBAAM,CAAC,IAAI,CAAC,aAAa,QAAQ,uBAAuB,YAAY,GAAG,CAAC,CAAC;YACzE,cAAc,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;SAC9B;QAED,IAAI,CAAC,MAAM,CAAC,UAAU,EAAE,IAAI,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC,CAAC;KACzD;IAED,MAAM,wBAAW,CACf,QAAQ,EACR,CAAC,QAAQ,EAAE,IAAI,EAAE,EAAE;QACjB,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,EAAE;YAClB,OAAO;SACR;QACD,MAAM,YAAY,GAAG,eAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;QAClD,MAAM,QAAQ,GAAG,eAAQ,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,QAAQ,CAAC,CAAC;QACnD,mBAAM,CAAC,IAAI,CAAC,iBAAiB,QAAQ,SAAS,YAAY,GAAG,CAAC,CAAC;QAC/D,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,qBAAgB,CAAC,QAAQ,CAAC,EAAE;YAC/C,QAAQ,EAAE,kBAAkB,CAAC,YAAY,CAAC;SAC3C,CAAC,CAAC;IACL,CAAC,EACD,EAAE,SAAS,EAAE,IAAI,EAAE,CACpB,CAAC;IAEF,OAAO,IAAI,CAAC;AACd,CAAC;AAjGD,kCAiGC"}
@@ -1,2 +0,0 @@
1
- import { BlockConfig } from '@appsemble/types';
2
- export declare function processBlockMessages(config: BlockConfig, languages: string[]): Promise<void>;
@@ -1,43 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.processBlockMessages = void 0;
4
- const fs_1 = require("fs");
5
- const path_1 = require("path");
6
- const node_utils_1 = require("@appsemble/node-utils");
7
- const utils_1 = require("@appsemble/utils");
8
- const getBlockConfigFromTypeScript_1 = require("./getBlockConfigFromTypeScript");
9
- async function processBlockMessages(config, languages) {
10
- const path = path_1.join(config.dir, 'i18n');
11
- await fs_1.promises.mkdir(path, { recursive: true });
12
- const dir = await fs_1.promises.readdir(path);
13
- const { messages } = getBlockConfigFromTypeScript_1.getBlockConfigFromTypeScript(config);
14
- if (!messages) {
15
- node_utils_1.logger.warn(`Block ${config.name} has no messages.`);
16
- return;
17
- }
18
- const keys = Object.keys(messages).sort(utils_1.compareStrings);
19
- const base = Object.fromEntries(keys.map((key) => [key, '']));
20
- const existingLanguages = dir
21
- .filter((filename) => filename.endsWith('.json'))
22
- .map((filename) => path_1.basename(filename, '.json'));
23
- for (const language of [...new Set([...languages, ...existingLanguages])]) {
24
- const existingMessages = { ...base };
25
- const name = `${language}.json`;
26
- const langPath = path_1.join(path, name);
27
- if (dir.includes(name)) {
28
- const [m] = await node_utils_1.readData(langPath);
29
- Object.assign(existingMessages, m);
30
- }
31
- const extraKeys = Object.keys(existingMessages).filter((key) => !keys.includes(key));
32
- if (extraKeys.length) {
33
- node_utils_1.logger.info(`Found ${extraKeys.length} keys too many. Removing: ${extraKeys.join(', ')}`);
34
- extraKeys.forEach((key) => delete existingMessages[key]);
35
- }
36
- await node_utils_1.writeData(langPath, existingMessages);
37
- node_utils_1.logger.info(`Wrote to file ‘${langPath}’`);
38
- }
39
- node_utils_1.logger.info(`Finished extracting messages for ${config.name}.`);
40
- node_utils_1.logger.info('');
41
- }
42
- exports.processBlockMessages = processBlockMessages;
43
- //# sourceMappingURL=processBlockMessages.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"processBlockMessages.js","sourceRoot":"","sources":["../../src/lib/processBlockMessages.ts"],"names":[],"mappings":";;;AAAA,2BAAoC;AACpC,+BAAsC;AAEtC,sDAAoE;AAEpE,4CAAkD;AAElD,iFAA8E;AAEvE,KAAK,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,IAAI,CAAC,CAAC;QAElC,IAAI,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE;YACtB,MAAM,CAAC,CAAC,CAAC,GAAG,MAAM,qBAAQ,CAAyB,QAAQ,CAAC,CAAC;YAC7D,MAAM,CAAC,MAAM,CAAC,gBAAgB,EAAE,CAAC,CAAC,CAAC;SACpC;QAED,MAAM,SAAS,GAAG,MAAM,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC;QACrF,IAAI,SAAS,CAAC,MAAM,EAAE;YACpB,mBAAM,CAAC,IAAI,CAAC,SAAS,SAAS,CAAC,MAAM,6BAA6B,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;YAC1F,SAAS,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,OAAO,gBAAgB,CAAC,GAAG,CAAC,CAAC,CAAC;SAC1D;QAED,MAAM,sBAAS,CAAC,QAAQ,EAAE,gBAAgB,CAAC,CAAC;QAC5C,mBAAM,CAAC,IAAI,CAAC,kBAAkB,QAAQ,GAAG,CAAC,CAAC;KAC5C;IACD,mBAAM,CAAC,IAAI,CAAC,oCAAoC,MAAM,CAAC,IAAI,GAAG,CAAC,CAAC;IAChE,mBAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAClB,CAAC;AAzCD,oDAyCC"}
@@ -1,8 +0,0 @@
1
- import { BlockConfig } from '@appsemble/types';
2
- /**
3
- * Publish a new block version.
4
- *
5
- * @param config - The block configuration
6
- * @param ignoreConflict - Prevent the command from crashing when a conflict has been detected.
7
- */
8
- export declare function publishBlock(config: BlockConfig, ignoreConflict: boolean): Promise<void>;
@@ -1,32 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.publishBlock = void 0;
7
- const node_utils_1 = require("@appsemble/node-utils");
8
- const axios_1 = __importDefault(require("axios"));
9
- const makePayload_1 = require("./makePayload");
10
- /**
11
- * Publish a new block version.
12
- *
13
- * @param config - The block configuration
14
- * @param ignoreConflict - Prevent the command from crashing when a conflict has been detected.
15
- */
16
- async function publishBlock(config, ignoreConflict) {
17
- node_utils_1.logger.info(`Publishing ${config.name}@${config.version}…`);
18
- const form = await makePayload_1.makePayload(config);
19
- try {
20
- await axios_1.default.post('/api/blocks', form);
21
- node_utils_1.logger.info(`Successfully published ${config.name}@${config.version} 🎉`);
22
- }
23
- catch (err) {
24
- if (ignoreConflict && axios_1.default.isAxiosError(err) && err.response.status === 409) {
25
- node_utils_1.logger.warn(`${config.name}@${config.version} was already published.`);
26
- return;
27
- }
28
- throw err;
29
- }
30
- }
31
- exports.publishBlock = publishBlock;
32
- //# sourceMappingURL=publishBlock.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"publishBlock.js","sourceRoot":"","sources":["../../src/lib/publishBlock.ts"],"names":[],"mappings":";;;;;;AAAA,sDAA+C;AAE/C,kDAA0B;AAE1B,+CAA4C;AAE5C;;;;;GAKG;AACI,KAAK,UAAU,YAAY,CAAC,MAAmB,EAAE,cAAuB;IAC7E,mBAAM,CAAC,IAAI,CAAC,cAAc,MAAM,CAAC,IAAI,IAAI,MAAM,CAAC,OAAO,GAAG,CAAC,CAAC;IAC5D,MAAM,IAAI,GAAG,MAAM,yBAAW,CAAC,MAAM,CAAC,CAAC;IAEvC,IAAI;QACF,MAAM,eAAK,CAAC,IAAI,CAAC,aAAa,EAAE,IAAI,CAAC,CAAC;QACtC,mBAAM,CAAC,IAAI,CAAC,0BAA0B,MAAM,CAAC,IAAI,IAAI,MAAM,CAAC,OAAO,KAAK,CAAC,CAAC;KAC3E;IAAC,OAAO,GAAY,EAAE;QACrB,IAAI,cAAc,IAAI,eAAK,CAAC,YAAY,CAAC,GAAG,CAAC,IAAI,GAAG,CAAC,QAAQ,CAAC,MAAM,KAAK,GAAG,EAAE;YAC5E,mBAAM,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC,IAAI,IAAI,MAAM,CAAC,OAAO,yBAAyB,CAAC,CAAC;YACvE,OAAO;SACR;QACD,MAAM,GAAG,CAAC;KACX;AACH,CAAC;AAdD,oCAcC"}
@@ -1,11 +0,0 @@
1
- import FormData from 'form-data';
2
- import { AppsembleContext } from '../types';
3
- /**
4
- * Traverses an app directory and appends the files it finds to the given FormData object.
5
- *
6
- * @param path - The path of the app directory to traverse.
7
- * @param context - The Context to use from `.appsemblerc.yaml`.
8
- * @param formData - The FormData object to append the results into..
9
- * @returns The context from `.appsemblerc.yaml` if a match was found.
10
- */
11
- export declare function traverseAppDirectory(path: string, context: string, formData: FormData): Promise<AppsembleContext>;
@@ -1,94 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.traverseAppDirectory = void 0;
4
- const fs_1 = require("fs");
5
- const path_1 = require("path");
6
- const util_1 = require("util");
7
- const node_utils_1 = require("@appsemble/node-utils");
8
- const processCss_1 = require("./processCss");
9
- /**
10
- * Traverses an app directory and appends the files it finds to the given FormData object.
11
- *
12
- * @param path - The path of the app directory to traverse.
13
- * @param context - The Context to use from `.appsemblerc.yaml`.
14
- * @param formData - The FormData object to append the results into..
15
- * @returns The context from `.appsemblerc.yaml` if a match was found.
16
- */
17
- async function traverseAppDirectory(path, context, formData) {
18
- let appFound;
19
- let discoveredContext;
20
- let iconPath;
21
- let maskableIconPath;
22
- node_utils_1.logger.info(`Traversing directory for App files in ${path} 🕵`);
23
- await node_utils_1.opendirSafe(path, async (filepath, stat) => {
24
- switch (stat.name.toLowerCase()) {
25
- case '.appsemblerc.yaml': {
26
- node_utils_1.logger.info(`Reading app settings from ${filepath}`);
27
- const [rc] = await node_utils_1.readData(filepath);
28
- if ('iconBackground' in rc) {
29
- formData.append('iconBackground', rc.iconBackground);
30
- }
31
- if (context && 'context' in rc && Object.hasOwnProperty.call(rc.context, context)) {
32
- discoveredContext = rc.context[context];
33
- node_utils_1.logger.verbose(`Using context: ${util_1.inspect(discoveredContext, { colors: true })}`);
34
- }
35
- break;
36
- }
37
- case 'app-definition.yaml': {
38
- node_utils_1.logger.info(`Using app definition from ${filepath}`);
39
- if (appFound) {
40
- throw new node_utils_1.AppsembleError('Found duplicate app definition');
41
- }
42
- appFound = filepath;
43
- const [app, data] = await node_utils_1.readData(filepath);
44
- formData.append('yaml', data);
45
- formData.append('definition', JSON.stringify(app));
46
- return;
47
- }
48
- case 'icon.png':
49
- case 'icon.svg':
50
- iconPath = filepath;
51
- return;
52
- case 'maskable-icon.png':
53
- maskableIconPath = filepath;
54
- return;
55
- case 'readme.md':
56
- node_utils_1.logger.info(`Including longDescription from ${filepath}`);
57
- formData.append('longDescription', await fs_1.promises.readFile(filepath, 'utf8'));
58
- return;
59
- case 'screenshots':
60
- return node_utils_1.opendirSafe(filepath, (screenshotPath, screenshotStat) => {
61
- node_utils_1.logger.info(`Adding screenshot ${screenshotPath} 🖼️`);
62
- if (!screenshotStat.isFile()) {
63
- throw new node_utils_1.AppsembleError(`Expected ${screenshotPath} to be an image file`);
64
- }
65
- formData.append('screenshots', fs_1.createReadStream(screenshotPath));
66
- }, { allowMissing: true });
67
- case 'theme':
68
- return node_utils_1.opendirSafe(filepath, async (themeDir, themeStat) => {
69
- const name = themeStat.name.toLowerCase();
70
- if (name !== 'core' && name !== 'shared') {
71
- return;
72
- }
73
- if (!themeStat.isDirectory()) {
74
- throw new node_utils_1.AppsembleError(`Expected ${themeDir} to be a directory`);
75
- }
76
- const css = await processCss_1.processCss(path_1.join(themeDir, 'index.css'));
77
- formData.append(`${name}Style`, Buffer.from(css), `${name}.css`);
78
- });
79
- default:
80
- node_utils_1.logger.warn(`Found unused file ${filepath}`);
81
- }
82
- });
83
- if (!appFound) {
84
- throw new node_utils_1.AppsembleError('No app definition found');
85
- }
86
- discoveredContext || (discoveredContext = {});
87
- discoveredContext.icon = discoveredContext.icon
88
- ? path_1.resolve(path, discoveredContext.icon)
89
- : iconPath;
90
- discoveredContext.maskableIcon || (discoveredContext.maskableIcon = maskableIconPath);
91
- return discoveredContext;
92
- }
93
- exports.traverseAppDirectory = traverseAppDirectory;
94
- //# sourceMappingURL=traverseAppDirectory.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"traverseAppDirectory.js","sourceRoot":"","sources":["../../src/lib/traverseAppDirectory.ts"],"names":[],"mappings":";;;AAAA,2BAAsD;AACtD,+BAAqC;AACrC,+BAA+B;AAE/B,sDAAsF;AAItF,6CAA0C;AAE1C;;;;;;;GAOG;AACI,KAAK,UAAU,oBAAoB,CACxC,IAAY,EACZ,OAAe,EACf,QAAkB;IAElB,IAAI,QAAgB,CAAC;IACrB,IAAI,iBAAmC,CAAC;IACxC,IAAI,QAAgB,CAAC;IACrB,IAAI,gBAAwB,CAAC;IAE7B,mBAAM,CAAC,IAAI,CAAC,yCAAyC,IAAI,KAAK,CAAC,CAAC;IAChE,MAAM,wBAAW,CAAC,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE;QAC/C,QAAQ,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,EAAE;YAC/B,KAAK,mBAAmB,CAAC,CAAC;gBACxB,mBAAM,CAAC,IAAI,CAAC,6BAA6B,QAAQ,EAAE,CAAC,CAAC;gBACrD,MAAM,CAAC,EAAE,CAAC,GAAG,MAAM,qBAAQ,CAAc,QAAQ,CAAC,CAAC;gBACnD,IAAI,gBAAgB,IAAI,EAAE,EAAE;oBAC1B,QAAQ,CAAC,MAAM,CAAC,gBAAgB,EAAE,EAAE,CAAC,cAAc,CAAC,CAAC;iBACtD;gBACD,IAAI,OAAO,IAAI,SAAS,IAAI,EAAE,IAAI,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,EAAE;oBACjF,i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,CAAC,QAAQ,CAAC;IACb,iBAAiB,CAAC,YAAY,KAA9B,iBAAiB,CAAC,YAAY,GAAK,gBAAgB,EAAC;IACpD,OAAO,iBAAiB,CAAC;AAC3B,CAAC;AA5FD,oDA4FC"}
@@ -1,9 +0,0 @@
1
- /**
2
- * Traverses the directory at a given path for app block themes and uploads them.
3
- *
4
- * @param path - The path of the app.
5
- * @param appId - The ID of the app.
6
- * @param remote - The HTTP origin to upload the themes to.
7
- * @param force - Force update the theme if the app is locked.
8
- */
9
- export declare function traverseBlockThemes(path: string, appId: number, remote: string, force: boolean): Promise<void>;
@@ -1,40 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.traverseBlockThemes = void 0;
4
- const path_1 = require("path");
5
- const node_utils_1 = require("@appsemble/node-utils");
6
- const uploadAppBlockTheme_1 = require("./uploadAppBlockTheme");
7
- /**
8
- * Traverses the directory at a given path for app block themes and uploads them.
9
- *
10
- * @param path - The path of the app.
11
- * @param appId - The ID of the app.
12
- * @param remote - The HTTP origin to upload the themes to.
13
- * @param force - Force update the theme if the app is locked.
14
- */
15
- async function traverseBlockThemes(path, appId, remote, force) {
16
- node_utils_1.logger.verbose(`Searching themes in ${path}`);
17
- await node_utils_1.opendirSafe(path_1.join(path, 'theme'), async (orgDir, orgStats) => {
18
- const organizationId = orgStats.name.toLowerCase();
19
- if (organizationId === 'core' || organizationId === 'shared') {
20
- return;
21
- }
22
- if (!organizationId.startsWith('@')) {
23
- node_utils_1.logger.warn('Block theme directories should be named “@organizationId/blockId”');
24
- return;
25
- }
26
- if (!orgStats.isDirectory()) {
27
- node_utils_1.logger.warn(`Expected ${orgDir} to be a directory`);
28
- return;
29
- }
30
- await node_utils_1.opendirSafe(orgDir, async (blockThemeDir, blockThemeStats) => {
31
- if (!blockThemeStats.isDirectory()) {
32
- node_utils_1.logger.warn(`Expected ${orgDir} to be a directory`);
33
- return;
34
- }
35
- await uploadAppBlockTheme_1.uploadAppBlockTheme(path_1.join(blockThemeDir, 'index.css'), organizationId, appId, blockThemeStats.name.toLowerCase(), remote, force);
36
- });
37
- }, { allowMissing: true });
38
- }
39
- exports.traverseBlockThemes = traverseBlockThemes;
40
- //# sourceMappingURL=traverseBlockThemes.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"traverseBlockThemes.js","sourceRoot":"","sources":["../../src/lib/traverseBlockThemes.ts"],"names":[],"mappings":";;;AAAA,+BAA4B;AAE5B,sDAA4D;AAE5D,+DAA4D;AAE5D;;;;;;;GAOG;AACI,KAAK,UAAU,mBAAmB,CACvC,IAAY,EACZ,KAAa,EACb,MAAc,EACd,KAAc;IAEd,mBAAM,CAAC,OAAO,CAAC,uBAAuB,IAAI,EAAE,CAAC,CAAC;IAC9C,MAAM,wBAAW,CACf,WAAI,CAAC,IAAI,EAAE,OAAO,CAAC,EACnB,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE;QACzB,MAAM,cAAc,GAAG,QAAQ,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC;QACnD,IAAI,cAAc,KAAK,MAAM,IAAI,cAAc,KAAK,QAAQ,EAAE;YAC5D,OAAO;SACR;QACD,IAAI,CAAC,cAAc,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE;YACnC,mBAAM,CAAC,IAAI,CAAC,mEAAmE,CAAC,CAAC;YACjF,OAAO;SACR;QACD,IAAI,CAAC,QAAQ,CAAC,WAAW,EAAE,EAAE;YAC3B,mBAAM,CAAC,IAAI,CAAC,YAAY,MAAM,oBAAoB,CAAC,CAAC;YACpD,OAAO;SACR;QACD,MAAM,wBAAW,CAAC,MAAM,EAAE,KAAK,EAAE,aAAa,EAAE,eAAe,EAAE,EAAE;YACjE,IAAI,CAAC,eAAe,CAAC,WAAW,EAAE,EAAE;gBAClC,mBAAM,CAAC,IAAI,CAAC,YAAY,MAAM,oBAAoB,CAAC,CAAC;gBACpD,OAAO;aACR;YACD,MAAM,yCAAmB,CACvB,WAAI,CAAC,aAAa,EAAE,WAAW,CAAC,EAChC,cAAc,EACd,KAAK,EACL,eAAe,CAAC,IAAI,CAAC,WAAW,EAAE,EAClC,MAAM,EACN,KAAK,CACN,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC,EACD,EAAE,YAAY,EAAE,IAAI,EAAE,CACvB,CAAC;AACJ,CAAC;AAvCD,kDAuCC"}
@@ -1,55 +0,0 @@
1
- /// <reference types="node" />
2
- import { ReadStream } from 'fs';
3
- interface UpdateAppParams {
4
- /**
5
- * The OAuth2 client credentials to use.
6
- */
7
- clientCredentials: string;
8
- /**
9
- * If specified, the context matching this name is used, overriding command line flags.
10
- */
11
- context?: string;
12
- /**
13
- * The ID of the app to update.
14
- */
15
- id?: number;
16
- /**
17
- * The path in which the App YAML is located.
18
- */
19
- path: string;
20
- /**
21
- * Whether the App should be marked as private.
22
- */
23
- private: boolean;
24
- /**
25
- * The remote server to create the app on.
26
- */
27
- remote: string;
28
- /**
29
- * Whether the App should be marked as a template.
30
- */
31
- template: boolean;
32
- /**
33
- * Whether the locked property should be ignored.
34
- */
35
- force: boolean;
36
- /**
37
- * The icon to upload.
38
- */
39
- icon: NodeJS.ReadStream | ReadStream;
40
- /**
41
- * The background color to use for the icon in opaque contexts.
42
- */
43
- iconBackground: string;
44
- /**
45
- * The maskable icon to upload.
46
- */
47
- maskableIcon: NodeJS.ReadStream | ReadStream;
48
- }
49
- /**
50
- * Create a new App.
51
- *
52
- * @param argv - The command line options used for updating the app.
53
- */
54
- export declare function updateApp({ clientCredentials, context, force, path, ...options }: UpdateAppParams): Promise<void>;
55
- export {};
@@ -1,78 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.updateApp = void 0;
7
- const fs_1 = require("fs");
8
- const url_1 = require("url");
9
- const util_1 = require("util");
10
- const node_utils_1 = require("@appsemble/node-utils");
11
- const axios_1 = __importDefault(require("axios"));
12
- const form_data_1 = __importDefault(require("form-data"));
13
- const authentication_1 = require("./authentication");
14
- const traverseAppDirectory_1 = require("./traverseAppDirectory");
15
- const traverseBlockThemes_1 = require("./traverseBlockThemes");
16
- const uploadMessages_1 = require("./uploadMessages");
17
- /**
18
- * Create a new App.
19
- *
20
- * @param argv - The command line options used for updating the app.
21
- */
22
- async function updateApp({ clientCredentials, context, force, path, ...options }) {
23
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
24
- const file = await fs_1.promises.stat(path);
25
- const formData = new form_data_1.default();
26
- let appsembleContext;
27
- if (file.isFile()) {
28
- const [app, data] = await node_utils_1.readData(path);
29
- formData.append('yaml', data);
30
- formData.append('definition', JSON.stringify(app));
31
- }
32
- else {
33
- appsembleContext = await traverseAppDirectory_1.traverseAppDirectory(path, context, formData);
34
- }
35
- const remote = (_a = appsembleContext.remote) !== null && _a !== void 0 ? _a : options.remote;
36
- const id = (_b = appsembleContext.id) !== null && _b !== void 0 ? _b : options.id;
37
- const template = (_d = (_c = appsembleContext.template) !== null && _c !== void 0 ? _c : options.template) !== null && _d !== void 0 ? _d : false;
38
- const isPrivate = (_e = appsembleContext.private) !== null && _e !== void 0 ? _e : options.private;
39
- const iconBackground = (_f = appsembleContext.iconBackground) !== null && _f !== void 0 ? _f : options.iconBackground;
40
- const icon = (_g = options.icon) !== null && _g !== void 0 ? _g : appsembleContext.icon;
41
- const maskableIcon = (_h = options.maskableIcon) !== null && _h !== void 0 ? _h : appsembleContext.maskableIcon;
42
- node_utils_1.logger.info(`App id: ${id}`);
43
- node_utils_1.logger.verbose(`App remote: ${remote}`);
44
- node_utils_1.logger.verbose(`App is template: ${util_1.inspect(template, { colors: true })}`);
45
- node_utils_1.logger.verbose(`App is private: ${util_1.inspect(isPrivate, { colors: true })}`);
46
- node_utils_1.logger.verbose(`Icon background: ${iconBackground}`);
47
- node_utils_1.logger.verbose(`Force update: ${util_1.inspect(force, { colors: true })}`);
48
- if (!id) {
49
- throw new node_utils_1.AppsembleError('The app id must be passed as a command line flag or in the context');
50
- }
51
- formData.append('force', String(force));
52
- formData.append('template', String(template));
53
- formData.append('private', String(isPrivate));
54
- formData.append('iconBackground', iconBackground);
55
- if (icon) {
56
- const realIcon = typeof icon === 'string' ? fs_1.createReadStream(icon) : icon;
57
- node_utils_1.logger.info(`Using icon from ${(_j = realIcon.path) !== null && _j !== void 0 ? _j : 'stdin'}`);
58
- formData.append('icon', realIcon);
59
- }
60
- if (maskableIcon) {
61
- const realIcon = typeof maskableIcon === 'string' ? fs_1.createReadStream(maskableIcon) : maskableIcon;
62
- node_utils_1.logger.info(`Using icon from ${(_k = realIcon.path) !== null && _k !== void 0 ? _k : 'stdin'}`);
63
- formData.append('icon', realIcon);
64
- }
65
- await authentication_1.authenticate(remote, 'apps:write', clientCredentials);
66
- const { data } = await axios_1.default.patch(`/api/apps/${id}`, formData, { baseURL: remote });
67
- if (file.isDirectory()) {
68
- // After uploading the app, upload block styles and messages if they are available
69
- await traverseBlockThemes_1.traverseBlockThemes(path, data.id, remote, force);
70
- await uploadMessages_1.uploadMessages(path, data.id, remote, force);
71
- }
72
- const { host, protocol } = new url_1.URL(remote);
73
- node_utils_1.logger.info(`Successfully updated app ${data.definition.name}! 🙌`);
74
- node_utils_1.logger.info(`App URL: ${protocol}//${data.path}.${data.OrganizationId}.${host}`);
75
- node_utils_1.logger.info(`App store page: ${new url_1.URL(`/apps/${data.id}`, remote)}`);
76
- }
77
- exports.updateApp = updateApp;
78
- //# sourceMappingURL=updateApp.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"updateApp.js","sourceRoot":"","sources":["../../src/lib/updateApp.ts"],"names":[],"mappings":";;;;;;AAAA,2BAAkE;AAClE,6BAA0B;AAC1B,+BAA+B;AAE/B,sDAAyE;AACzE,kDAA0B;AAC1B,0DAAiC;AAGjC,qDAAgD;AAChD,iEAA8D;AAC9D,+DAA4D;AAC5D,qDAAkD;AA2DlD;;;;GAIG;AACI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,8BAgEC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"updateResource.js","sourceRoot":"","sources":["../../src/lib/updateResource.ts"],"names":[],"mappings":";;;;;;AAAA,6BAA0B;AAE1B,sDAAyE;AAEzE,kDAA0B;AAwBnB,KAAK,UAAU,cAAc,CAAC,EACnC,KAAK,EACL,IAAI,EACJ,MAAM,EACN,YAAY,GACS;IACrB,MAAM,CAAC,IAAI,CAAC,GAAG,MAAM,qBAAQ,CAAW,IAAI,CAAC,CAAC;IAE9C,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE;QAC5B,MAAM,IAAI,2BAAc,CAAC,WAAW,IAAI,iDAAiD,CAAC,CAAC;KAC5F;IAED,MAAM,SAAS,GAAG,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAClC,mBAAM,CAAC,IAAI,CAAC,YAAY,SAAS,CAAC,MAAM,qBAAqB,IAAI,EAAE,CAAC,CAAC;IAErE,KAAK,MAAM,QAAQ,IAAI,SAAS,EAAE;QAChC,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE;YAChB,mBAAM,CAAC,IAAI,CAAC,qBAAqB,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAC,wBAAwB,CAAC,CAAC;YACtF,SAAS;SACV;QAED,MAAM,EACJ,IAAI,EAAE,EAAE,EAAE,EAAE,GACb,GAAG,MAAM,eAAK,CAAC,GAAG,CACjB,aAAa,KAAK,cAAc,YAAY,IAAI,QAAQ,CAAC,EAAE,EAAE,EAC7D,QAAQ,EACR;YACE,OAAO,EAAE,MAAM;SAChB,CACF,CAAC;QAEF,mBAAM,CAAC,IAAI,CACT,iCAAiC,EAAE,OAAO,IAAI,SAAG,CAC/C,SAAS,KAAK,cAAc,YAAY,IAAI,EAAE,EAAE,EAChD,MAAM,CACP,EAAE,CACJ,CAAC;KACH;AACH,CAAC;AAtCD,wCAsCC"}
@@ -1,11 +0,0 @@
1
- /**
2
- * Uploads an app block theme
3
- *
4
- * @param filePath - The path of the index.css file
5
- * @param organization - The ID of the organization the block belongs to.
6
- * @param appId - The ID of the app to upload the theme for.
7
- * @param block - The name of the block.
8
- * @param remote - The HTTP origin to upload the theme to.
9
- * @param force - Force update the theme if the app is locked.
10
- */
11
- export declare function uploadAppBlockTheme(filePath: string, organization: string, appId: number, block: string, remote: string, force: boolean): Promise<void>;
@@ -1,33 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.uploadAppBlockTheme = void 0;
7
- const node_utils_1 = require("@appsemble/node-utils");
8
- const axios_1 = __importDefault(require("axios"));
9
- const form_data_1 = __importDefault(require("form-data"));
10
- const processCss_1 = require("./processCss");
11
- /**
12
- * Uploads an app block theme
13
- *
14
- * @param filePath - The path of the index.css file
15
- * @param organization - The ID of the organization the block belongs to.
16
- * @param appId - The ID of the app to upload the theme for.
17
- * @param block - The name of the block.
18
- * @param remote - The HTTP origin to upload the theme to.
19
- * @param force - Force update the theme if the app is locked.
20
- */
21
- async function uploadAppBlockTheme(filePath, organization, appId, block, remote, force) {
22
- node_utils_1.logger.info(`Upload ${organization}/${block} stylesheet for app ${appId}`);
23
- const css = await processCss_1.processCss(filePath);
24
- const formData = new form_data_1.default();
25
- formData.append('force', String(force));
26
- formData.append('style', Buffer.from(css), 'style.css');
27
- await axios_1.default.post(`/api/apps/${appId}/style/block/${organization}/${block}`, formData, {
28
- baseURL: remote,
29
- });
30
- node_utils_1.logger.info(`Upload of ${organization}/${block} stylesheet successful! 🎉`);
31
- }
32
- exports.uploadAppBlockTheme = uploadAppBlockTheme;
33
- //# sourceMappingURL=uploadAppBlockTheme.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"uploadAppBlockTheme.js","sourceRoot":"","sources":["../../src/lib/uploadAppBlockTheme.ts"],"names":[],"mappings":";;;;;;AAAA,sDAA+C;AAC/C,kDAA0B;AAC1B,0DAAiC;AAEjC,6CAA0C;AAE1C;;;;;;;;;GASG;AACI,KAAK,UAAU,mBAAmB,CACvC,QAAgB,EAChB,YAAoB,EACpB,KAAa,EACb,KAAa,EACb,MAAc,EACd,KAAc;IAEd,mBAAM,CAAC,IAAI,CAAC,UAAU,YAAY,IAAI,KAAK,uBAAuB,KAAK,EAAE,CAAC,CAAC;IAE3E,MAAM,GAAG,GAAG,MAAM,uBAAU,CAAC,QAAQ,CAAC,CAAC;IACvC,MAAM,QAAQ,GAAG,IAAI,mBAAQ,EAAE,CAAC;IAChC,QAAQ,CAAC,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;IACxC,QAAQ,CAAC,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,WAAW,CAAC,CAAC;IAExD,MAAM,eAAK,CAAC,IAAI,CAAC,aAAa,KAAK,gBAAgB,YAAY,IAAI,KAAK,EAAE,EAAE,QAAQ,EAAE;QACpF,OAAO,EAAE,MAAM;KAChB,CAAC,CAAC;IAEH,mBAAM,CAAC,IAAI,CAAC,aAAa,YAAY,IAAI,KAAK,4BAA4B,CAAC,CAAC;AAC9E,CAAC;AApBD,kDAoBC"}
@@ -1,9 +0,0 @@
1
- /**
2
- * Upload messages for an app.
3
- *
4
- * @param path - The path to the app directory.
5
- * @param appId - The app id to upload the messages for.
6
- * @param remote - The remote to upload the messages to.
7
- * @param force - Whether or not to force the update for locked apps.
8
- */
9
- export declare function uploadMessages(path: string, appId: string, remote: string, force: boolean): Promise<void>;
@@ -1,39 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.uploadMessages = void 0;
7
- const path_1 = require("path");
8
- const node_utils_1 = require("@appsemble/node-utils");
9
- const axios_1 = __importDefault(require("axios"));
10
- /**
11
- * Upload messages for an app.
12
- *
13
- * @param path - The path to the app directory.
14
- * @param appId - The app id to upload the messages for.
15
- * @param remote - The remote to upload the messages to.
16
- * @param force - Whether or not to force the update for locked apps.
17
- */
18
- async function uploadMessages(path, appId, remote, force) {
19
- const result = [];
20
- node_utils_1.logger.info('Searching for translations 🕵');
21
- await node_utils_1.opendirSafe(path_1.join(path, 'i18n'), async (messageFile) => {
22
- node_utils_1.logger.verbose(`Processing ${messageFile} ⚙️`);
23
- const { name: language } = path_1.parse(messageFile);
24
- if (result.some((entry) => entry.language === language)) {
25
- throw new node_utils_1.AppsembleError(`Found duplicate language “${language}”. Make sure each language only exists once in the directory.`);
26
- }
27
- const [messages] = await node_utils_1.readData(messageFile);
28
- result.push({ force, language, messages });
29
- }, { allowMissing: true });
30
- if (!result.length) {
31
- node_utils_1.logger.info('No translations found 🤷');
32
- }
33
- for (const language of result) {
34
- await axios_1.default.post(`/api/apps/${appId}/messages`, language, { baseURL: remote });
35
- node_utils_1.logger.info(`Successfully uploaded messages for language “${language.language}” 🎉`);
36
- }
37
- }
38
- exports.uploadMessages = uploadMessages;
39
- //# sourceMappingURL=uploadMessages.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"uploadMessages.js","sourceRoot":"","sources":["../../src/lib/uploadMessages.ts"],"names":[],"mappings":";;;;;;AAAA,+BAAmC;AAEnC,sDAAsF;AAEtF,kDAA0B;AAE1B;;;;;;;GAOG;AACI,KAAK,UAAU,cAAc,CAClC,IAAY,EACZ,KAAa,EACb,MAAc,EACd,KAAc;IAEd,MAAM,MAAM,GAAe,EAAE,CAAC;IAE9B,mBAAM,CAAC,IAAI,CAAC,+BAA+B,CAAC,CAAC;IAC7C,MAAM,wBAAW,CACf,WAAI,CAAC,IAAI,EAAE,MAAM,CAAC,EAClB,KAAK,EAAE,WAAW,EAAE,EAAE;QACpB,mBAAM,CAAC,OAAO,CAAC,cAAc,WAAW,KAAK,CAAC,CAAC;QAC/C,MAAM,EAAE,IAAI,EAAE,QAAQ,EA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