@supernova-studio/pulsar-core 1.0.32 → 1.0.36

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 (241) hide show
  1. package/build/browser/pulsar-core-dev.js +67725 -0
  2. package/build/browser/pulsar-core-dev.js.map +1 -0
  3. package/build/browser/pulsar-core.js +7 -0
  4. package/build/browser/pulsar-core.js.LICENSE.txt +31 -0
  5. package/build/browser/pulsar-core.js.map +1 -0
  6. package/build/main/pulsar-core.js +22495 -0
  7. package/build/main/pulsar-core.js.map +1 -0
  8. package/build/typings/core/tsconfig.typings.tsbuildinfo +5035 -0
  9. package/package.json +19 -15
  10. package/tsconfig.typings.json +19 -0
  11. package/webpack.config.browser.dev.js +52 -0
  12. package/webpack.config.browser.js +52 -0
  13. package/webpack.config.main.js +45 -0
  14. package/build/browser/pulsar.js +0 -142584
  15. package/build/browser/pulsar.min.js +0 -270
  16. package/build/main/browser-bundle.d.ts +0 -1
  17. package/build/main/browser-bundle.js +0 -16
  18. package/build/main/browser-bundle.js.map +0 -1
  19. package/build/main/engine/ExportEngine.d.ts +0 -17
  20. package/build/main/engine/ExportEngine.js +0 -122
  21. package/build/main/engine/ExportEngine.js.map +0 -1
  22. package/build/main/engine/configuration/ExportConfiguration.d.ts +0 -18
  23. package/build/main/engine/configuration/ExportConfiguration.js +0 -47
  24. package/build/main/engine/configuration/ExportConfiguration.js.map +0 -1
  25. package/build/main/engine/generation/ExportDataProducer.d.ts +0 -15
  26. package/build/main/engine/generation/ExportDataProducer.js +0 -100
  27. package/build/main/engine/generation/ExportDataProducer.js.map +0 -1
  28. package/build/main/engine/generation/queue/ExportDataQueue.d.ts +0 -16
  29. package/build/main/engine/generation/queue/ExportDataQueue.js +0 -72
  30. package/build/main/engine/generation/queue/ExportDataQueue.js.map +0 -1
  31. package/build/main/engine/generation/queue/ExportDataQueueOperation.d.ts +0 -6
  32. package/build/main/engine/generation/queue/ExportDataQueueOperation.js +0 -36
  33. package/build/main/engine/generation/queue/ExportDataQueueOperation.js.map +0 -1
  34. package/build/main/engine/generation/requests/ExportDataEmittedResponseProducer.d.ts +0 -7
  35. package/build/main/engine/generation/requests/ExportDataEmittedResponseProducer.js +0 -54
  36. package/build/main/engine/generation/requests/ExportDataEmittedResponseProducer.js.map +0 -1
  37. package/build/main/engine/generation/requests/ExportDataPrimaryResponseProducer.d.ts +0 -7
  38. package/build/main/engine/generation/requests/ExportDataPrimaryResponseProducer.js +0 -40
  39. package/build/main/engine/generation/requests/ExportDataPrimaryResponseProducer.js.map +0 -1
  40. package/build/main/engine/generation/requests/ExportDataRequest.d.ts +0 -19
  41. package/build/main/engine/generation/requests/ExportDataRequest.js +0 -55
  42. package/build/main/engine/generation/requests/ExportDataRequest.js.map +0 -1
  43. package/build/main/engine/generation/requests/ExportDataRequestDataStore.d.ts +0 -16
  44. package/build/main/engine/generation/requests/ExportDataRequestDataStore.js +0 -57
  45. package/build/main/engine/generation/requests/ExportDataRequestDataStore.js.map +0 -1
  46. package/build/main/engine/generation/requests/ExportDataRequestNameStore.d.ts +0 -22
  47. package/build/main/engine/generation/requests/ExportDataRequestNameStore.js +0 -86
  48. package/build/main/engine/generation/requests/ExportDataRequestNameStore.js.map +0 -1
  49. package/build/main/engine/generation/requests/ExportDataRequestProducer.d.ts +0 -16
  50. package/build/main/engine/generation/requests/ExportDataRequestProducer.js +0 -149
  51. package/build/main/engine/generation/requests/ExportDataRequestProducer.js.map +0 -1
  52. package/build/main/engine/generation/requests/ExportDataResponse.d.ts +0 -13
  53. package/build/main/engine/generation/requests/ExportDataResponse.js +0 -30
  54. package/build/main/engine/generation/requests/ExportDataResponse.js.map +0 -1
  55. package/build/main/engine/generation/requests/specific/dsm/ExportDataRequestBlueprint.d.ts +0 -14
  56. package/build/main/engine/generation/requests/specific/dsm/ExportDataRequestBlueprint.js +0 -76
  57. package/build/main/engine/generation/requests/specific/dsm/ExportDataRequestBlueprint.js.map +0 -1
  58. package/build/main/engine/generation/requests/specific/dsm/ExportDataRequestDSMComponent.d.ts +0 -13
  59. package/build/main/engine/generation/requests/specific/dsm/ExportDataRequestDSMComponent.js +0 -47
  60. package/build/main/engine/generation/requests/specific/dsm/ExportDataRequestDSMComponent.js.map +0 -1
  61. package/build/main/engine/generation/requests/specific/dsm/ExportDataRequestDSMComponentGroup.d.ts +0 -13
  62. package/build/main/engine/generation/requests/specific/dsm/ExportDataRequestDSMComponentGroup.js +0 -47
  63. package/build/main/engine/generation/requests/specific/dsm/ExportDataRequestDSMComponentGroup.js.map +0 -1
  64. package/build/main/engine/generation/requests/specific/dsm/ExportDataRequestDSMGeneric.d.ts +0 -11
  65. package/build/main/engine/generation/requests/specific/dsm/ExportDataRequestDSMGeneric.js +0 -43
  66. package/build/main/engine/generation/requests/specific/dsm/ExportDataRequestDSMGeneric.js.map +0 -1
  67. package/build/main/engine/generation/requests/specific/dsm/ExportDataRequestDSMTheme.d.ts +0 -13
  68. package/build/main/engine/generation/requests/specific/dsm/ExportDataRequestDSMTheme.js +0 -47
  69. package/build/main/engine/generation/requests/specific/dsm/ExportDataRequestDSMTheme.js.map +0 -1
  70. package/build/main/engine/generation/requests/specific/dsm/ExportDataRequestDSMTokenGroup.d.ts +0 -13
  71. package/build/main/engine/generation/requests/specific/dsm/ExportDataRequestDSMTokenGroup.js +0 -47
  72. package/build/main/engine/generation/requests/specific/dsm/ExportDataRequestDSMTokenGroup.js.map +0 -1
  73. package/build/main/engine/generation/requests/specific/dsm/ExportDataRequestDSMTokenType.d.ts +0 -13
  74. package/build/main/engine/generation/requests/specific/dsm/ExportDataRequestDSMTokenType.js +0 -47
  75. package/build/main/engine/generation/requests/specific/dsm/ExportDataRequestDSMTokenType.js.map +0 -1
  76. package/build/main/engine/items/ExportItemProducer.d.ts +0 -14
  77. package/build/main/engine/items/ExportItemProducer.js +0 -70
  78. package/build/main/engine/items/ExportItemProducer.js.map +0 -1
  79. package/build/main/engine/items/construction/ExportItem.d.ts +0 -8
  80. package/build/main/engine/items/construction/ExportItem.js +0 -25
  81. package/build/main/engine/items/construction/ExportItem.js.map +0 -1
  82. package/build/main/engine/items/construction/ExportItemBuilder.d.ts +0 -9
  83. package/build/main/engine/items/construction/ExportItemBuilder.js +0 -43
  84. package/build/main/engine/items/construction/ExportItemBuilder.js.map +0 -1
  85. package/build/main/engine/items/queue/ExportItemQueue.d.ts +0 -16
  86. package/build/main/engine/items/queue/ExportItemQueue.js +0 -70
  87. package/build/main/engine/items/queue/ExportItemQueue.js.map +0 -1
  88. package/build/main/engine/items/queue/ExportItemQueueOperation.d.ts +0 -6
  89. package/build/main/engine/items/queue/ExportItemQueueOperation.js +0 -36
  90. package/build/main/engine/items/queue/ExportItemQueueOperation.js.map +0 -1
  91. package/build/main/engine/items/requests/ExportItemRequest.d.ts +0 -16
  92. package/build/main/engine/items/requests/ExportItemRequest.js +0 -68
  93. package/build/main/engine/items/requests/ExportItemRequest.js.map +0 -1
  94. package/build/main/engine/items/requests/ExportItemRequestProducer.d.ts +0 -8
  95. package/build/main/engine/items/requests/ExportItemRequestProducer.js +0 -24
  96. package/build/main/engine/items/requests/ExportItemRequestProducer.js.map +0 -1
  97. package/build/main/engine/items/requests/ExportItemResponse.d.ts +0 -9
  98. package/build/main/engine/items/requests/ExportItemResponse.js +0 -25
  99. package/build/main/engine/items/requests/ExportItemResponse.js.map +0 -1
  100. package/build/main/engine/items/requests/ExportItemResponseProducer.d.ts +0 -7
  101. package/build/main/engine/items/requests/ExportItemResponseProducer.js +0 -45
  102. package/build/main/engine/items/requests/ExportItemResponseProducer.js.map +0 -1
  103. package/build/main/engine/loaders/BlueprintLoader.d.ts +0 -9
  104. package/build/main/engine/loaders/BlueprintLoader.js +0 -55
  105. package/build/main/engine/loaders/BlueprintLoader.js.map +0 -1
  106. package/build/main/engine/writing/queue/ExportWriterQueue.d.ts +0 -16
  107. package/build/main/engine/writing/queue/ExportWriterQueue.js +0 -70
  108. package/build/main/engine/writing/queue/ExportWriterQueue.js.map +0 -1
  109. package/build/main/engine/writing/queue/ExportWriterQueueOperation.d.ts +0 -6
  110. package/build/main/engine/writing/queue/ExportWriterQueueOperation.js +0 -36
  111. package/build/main/engine/writing/queue/ExportWriterQueueOperation.js.map +0 -1
  112. package/build/main/engine/writing/requests/ExportWriterRequest.d.ts +0 -14
  113. package/build/main/engine/writing/requests/ExportWriterRequest.js +0 -40
  114. package/build/main/engine/writing/requests/ExportWriterRequest.js.map +0 -1
  115. package/build/main/engine/writing/requests/ExportWriterRequestProducer.d.ts +0 -8
  116. package/build/main/engine/writing/requests/ExportWriterRequestProducer.js +0 -30
  117. package/build/main/engine/writing/requests/ExportWriterRequestProducer.js.map +0 -1
  118. package/build/main/engine/writing/requests/ExportWriterResponse.d.ts +0 -9
  119. package/build/main/engine/writing/requests/ExportWriterResponse.js +0 -25
  120. package/build/main/engine/writing/requests/ExportWriterResponse.js.map +0 -1
  121. package/build/main/engine/writing/requests/ExportWriterResponseProducer.d.ts +0 -7
  122. package/build/main/engine/writing/requests/ExportWriterResponseProducer.js +0 -40
  123. package/build/main/engine/writing/requests/ExportWriterResponseProducer.js.map +0 -1
  124. package/build/main/engine/writing/writers/ExportItemWriter.d.ts +0 -14
  125. package/build/main/engine/writing/writers/ExportItemWriter.js +0 -70
  126. package/build/main/engine/writing/writers/ExportItemWriter.js.map +0 -1
  127. package/build/main/engine/writing/writers/ExportWriterRuleProcessor.d.ts +0 -9
  128. package/build/main/engine/writing/writers/ExportWriterRuleProcessor.js +0 -63
  129. package/build/main/engine/writing/writers/ExportWriterRuleProcessor.js.map +0 -1
  130. package/build/main/engine/writing/writers/memory/ExportWriterMemory.d.ts +0 -4
  131. package/build/main/engine/writing/writers/memory/ExportWriterMemory.js +0 -29
  132. package/build/main/engine/writing/writers/memory/ExportWriterMemory.js.map +0 -1
  133. package/build/main/engine/writing/writers/memory/ExportWriterMemoryRequest.d.ts +0 -5
  134. package/build/main/engine/writing/writers/memory/ExportWriterMemoryRequest.js +0 -59
  135. package/build/main/engine/writing/writers/memory/ExportWriterMemoryRequest.js.map +0 -1
  136. package/build/main/engine/writing/writers/memory/ExportWriterStore.d.ts +0 -5
  137. package/build/main/engine/writing/writers/memory/ExportWriterStore.js +0 -33
  138. package/build/main/engine/writing/writers/memory/ExportWriterStore.js.map +0 -1
  139. package/build/main/exports.d.ts +0 -5
  140. package/build/main/exports.js +0 -15
  141. package/build/main/exports.js.map +0 -1
  142. package/build/main/index.d.ts +0 -1
  143. package/build/main/index.js +0 -14
  144. package/build/main/index.js.map +0 -1
  145. package/build/main/model/dsm/DSMReferenceStore.d.ts +0 -28
  146. package/build/main/model/dsm/DSMReferenceStore.js +0 -100
  147. package/build/main/model/dsm/DSMReferenceStore.js.map +0 -1
  148. package/build/main/model/exporters/Exporter.d.ts +0 -53
  149. package/build/main/model/exporters/Exporter.js +0 -106
  150. package/build/main/model/exporters/Exporter.js.map +0 -1
  151. package/build/main/model/maps/ExporterMapBlueprint.d.ts +0 -12
  152. package/build/main/model/maps/ExporterMapBlueprint.js +0 -39
  153. package/build/main/model/maps/ExporterMapBlueprint.js.map +0 -1
  154. package/build/main/model/sources/ExporterSource.d.ts +0 -26
  155. package/build/main/model/sources/ExporterSource.js +0 -64
  156. package/build/main/model/sources/ExporterSource.js.map +0 -1
  157. package/build/main/pulsar/Pulsar.d.ts +0 -105
  158. package/build/main/pulsar/Pulsar.js +0 -353
  159. package/build/main/pulsar/Pulsar.js.map +0 -1
  160. package/build/main/pulsar/PulsarInterface.d.ts +0 -152
  161. package/build/main/pulsar/PulsarInterface.js +0 -37
  162. package/build/main/pulsar/PulsarInterface.js.map +0 -1
  163. package/build/main/pulsar/PulsarStaticAnalysis.d.ts +0 -26
  164. package/build/main/pulsar/PulsarStaticAnalysis.js +0 -69
  165. package/build/main/pulsar/PulsarStaticAnalysis.js.map +0 -1
  166. package/build/main/pulsar/PulsarStaticAnalysisInterface.d.ts +0 -13
  167. package/build/main/pulsar/PulsarStaticAnalysisInterface.js +0 -10
  168. package/build/main/pulsar/PulsarStaticAnalysisInterface.js.map +0 -1
  169. package/build/main/pulsar/managers/PulsarBlueprintManager.d.ts +0 -16
  170. package/build/main/pulsar/managers/PulsarBlueprintManager.js +0 -76
  171. package/build/main/pulsar/managers/PulsarBlueprintManager.js.map +0 -1
  172. package/build/main/pulsar/managers/PulsarCIManager.d.ts +0 -25
  173. package/build/main/pulsar/managers/PulsarCIManager.js +0 -220
  174. package/build/main/pulsar/managers/PulsarCIManager.js.map +0 -1
  175. package/build/main/pulsar/managers/PulsarCodeManager.d.ts +0 -24
  176. package/build/main/pulsar/managers/PulsarCodeManager.js +0 -180
  177. package/build/main/pulsar/managers/PulsarCodeManager.js.map +0 -1
  178. package/build/main/pulsar/managers/PulsarConfigurationManager.d.ts +0 -17
  179. package/build/main/pulsar/managers/PulsarConfigurationManager.js +0 -88
  180. package/build/main/pulsar/managers/PulsarConfigurationManager.js.map +0 -1
  181. package/build/main/pulsar/managers/PulsarExporterManager.d.ts +0 -25
  182. package/build/main/pulsar/managers/PulsarExporterManager.js +0 -121
  183. package/build/main/pulsar/managers/PulsarExporterManager.js.map +0 -1
  184. package/build/main/pulsar/managers/generators/PulsarExporterConfigFileGenerator.d.ts +0 -12
  185. package/build/main/pulsar/managers/generators/PulsarExporterConfigFileGenerator.js +0 -140
  186. package/build/main/pulsar/managers/generators/PulsarExporterConfigFileGenerator.js.map +0 -1
  187. package/build/main/pulsar/managers/generators/PulsarExporterJSONGenerator.d.ts +0 -8
  188. package/build/main/pulsar/managers/generators/PulsarExporterJSONGenerator.js +0 -45
  189. package/build/main/pulsar/managers/generators/PulsarExporterJSONGenerator.js.map +0 -1
  190. package/build/main/pulsar/managers/generators/PulsarExporterSourceFileGenerator.d.ts +0 -9
  191. package/build/main/pulsar/managers/generators/PulsarExporterSourceFileGenerator.js +0 -45
  192. package/build/main/pulsar/managers/generators/PulsarExporterSourceFileGenerator.js.map +0 -1
  193. package/build/main/pulsar/managers/generators/PulsarExporterZIPGenerator.d.ts +0 -7
  194. package/build/main/pulsar/managers/generators/PulsarExporterZIPGenerator.js +0 -63
  195. package/build/main/pulsar/managers/generators/PulsarExporterZIPGenerator.js.map +0 -1
  196. package/build/main/pulsar/managers/generators/PulsarFileGenerator.d.ts +0 -20
  197. package/build/main/pulsar/managers/generators/PulsarFileGenerator.js +0 -77
  198. package/build/main/pulsar/managers/generators/PulsarFileGenerator.js.map +0 -1
  199. package/build/main/pulsar/managers/loaders/PulsarBaseLoader.d.ts +0 -5
  200. package/build/main/pulsar/managers/loaders/PulsarBaseLoader.js +0 -28
  201. package/build/main/pulsar/managers/loaders/PulsarBaseLoader.js.map +0 -1
  202. package/build/main/pulsar/managers/loaders/local/PulsarFSLoader.d.ts +0 -11
  203. package/build/main/pulsar/managers/loaders/local/PulsarFSLoader.js +0 -98
  204. package/build/main/pulsar/managers/loaders/local/PulsarFSLoader.js.map +0 -1
  205. package/build/main/pulsar/managers/loaders/memory/PulsarExporterJSONLoader.d.ts +0 -9
  206. package/build/main/pulsar/managers/loaders/memory/PulsarExporterJSONLoader.js +0 -81
  207. package/build/main/pulsar/managers/loaders/memory/PulsarExporterJSONLoader.js.map +0 -1
  208. package/build/main/pulsar/managers/loaders/memory/PulsarExporterMemoryLoader.d.ts +0 -11
  209. package/build/main/pulsar/managers/loaders/memory/PulsarExporterMemoryLoader.js +0 -106
  210. package/build/main/pulsar/managers/loaders/memory/PulsarExporterMemoryLoader.js.map +0 -1
  211. package/build/main/pulsar/managers/loaders/remote/PulsarExporterGitHubLoader.d.ts +0 -12
  212. package/build/main/pulsar/managers/loaders/remote/PulsarExporterGitHubLoader.js +0 -143
  213. package/build/main/pulsar/managers/loaders/remote/PulsarExporterGitHubLoader.js.map +0 -1
  214. package/build/main/pulsar/managers/loaders/remote/PulsarExporterZIPLoader.d.ts +0 -12
  215. package/build/main/pulsar/managers/loaders/remote/PulsarExporterZIPLoader.js +0 -115
  216. package/build/main/pulsar/managers/loaders/remote/PulsarExporterZIPLoader.js.map +0 -1
  217. package/build/main/pulsar/managers/validators/PulsarExporterConfigFileValidator.d.ts +0 -7
  218. package/build/main/pulsar/managers/validators/PulsarExporterConfigFileValidator.js +0 -124
  219. package/build/main/pulsar/managers/validators/PulsarExporterConfigFileValidator.js.map +0 -1
  220. package/build/main/tests/TestConfiguration.d.ts +0 -9
  221. package/build/main/tests/TestConfiguration.js +0 -25
  222. package/build/main/tests/TestConfiguration.js.map +0 -1
  223. package/build/main/tests/casebuilders/ci.d.ts +0 -12
  224. package/build/main/tests/casebuilders/ci.js +0 -38
  225. package/build/main/tests/casebuilders/ci.js.map +0 -1
  226. package/build/main/tests/casebuilders/configuration.d.ts +0 -5
  227. package/build/main/tests/casebuilders/configuration.js +0 -25
  228. package/build/main/tests/casebuilders/configuration.js.map +0 -1
  229. package/build/main/tests/casebuilders/dsm.d.ts +0 -7
  230. package/build/main/tests/casebuilders/dsm.js +0 -57
  231. package/build/main/tests/casebuilders/dsm.js.map +0 -1
  232. package/build/main/tests/casebuilders/modelObjects.d.ts +0 -13
  233. package/build/main/tests/casebuilders/modelObjects.js +0 -120
  234. package/build/main/tests/casebuilders/modelObjects.js.map +0 -1
  235. package/build/main/tools/Logger.d.ts +0 -27
  236. package/build/main/tools/Logger.js +0 -98
  237. package/build/main/tools/Logger.js.map +0 -1
  238. package/build/main/tools/LoggerDefaultMessages.d.ts +0 -13
  239. package/build/main/tools/LoggerDefaultMessages.js +0 -41
  240. package/build/main/tools/LoggerDefaultMessages.js.map +0 -1
  241. package/build/tsconfig.tsbuildinfo +0 -3045
@@ -1,180 +0,0 @@
1
- "use strict";
2
- //
3
- // PulsarCodeManager.ts
4
- // Supernova
5
- //
6
- // Created by Jiri Trecak.
7
- // Copyright © 2020 Jiri Trecak. All rights reserved.
8
- //
9
- Object.defineProperty(exports, "__esModule", { value: true });
10
- exports.PCPulsarCodeManager = void 0;
11
- const Logger_1 = require("@supernova-studio/pulsar-language/build/main/interpreter/loggers/Logger");
12
- const BlueprintLoader_1 = require("./../../engine/loaders/BlueprintLoader");
13
- const main_1 = require("@supernova-studio/pulsar-language/build/main");
14
- const BlueprintLoader_2 = require("@supernova-studio/pulsar-language/build/main/interpreter/loaders/BlueprintLoader");
15
- const ExporterSource_1 = require("../../model/sources/ExporterSource");
16
- // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
17
- // MARK: - Definitions
18
- // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
19
- // MARK: - Class
20
- class PCPulsarCodeManager {
21
- // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
22
- // MARK: - Setup
23
- constructor(exporter) {
24
- this.exporter = exporter;
25
- // Context is not usable for actual execution, but provides data about all types of functions / flows etc. available in the system
26
- this.codeExecutionContext = new main_1.DSMExecutionContext(new BlueprintLoader_2.PLBlueprintLoader(), new main_1.PLBlueprintEmitter(), new Logger_1.PLLogger(), new main_1.DSMBridge({
27
- accessToken: '',
28
- apiUrl: '',
29
- designSystemId: '',
30
- dsVersionId: '',
31
- apiVersion: '0.2'
32
- }), null);
33
- }
34
- // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
35
- // MARK: - Code editor
36
- /** Execute source code and retrieve the resulting output. This also retrieves any emitted extra files. Throws error when source is not found */
37
- async executeSourceById(sourceId, dsmBridgeConfig, contextKey, contextId) {
38
- //
39
- // Find the source
40
- let source = this.exporter.sourceById(sourceId);
41
- if (!source) {
42
- throw Error(`Unknown source to execute ${sourceId}`);
43
- }
44
- // Create context data
45
- let contextData = this.createContextData(contextKey, contextId);
46
- // Create execution context for the DSM access, with in-memory loaders and emitters
47
- let logger = new Logger_1.PLLogger();
48
- let loader = new BlueprintLoader_1.PCBlueprintLoader(this.exporter);
49
- let emitter = new main_1.PLMemoryBlueprintEmitter(false);
50
- let configuredBridge = new main_1.DSMBridge(dsmBridgeConfig);
51
- let executionContext = new main_1.DSMExecutionContext(loader, emitter, logger, configuredBridge, null);
52
- // Parse sources using custom context with dsm functionality and execute
53
- let parsedSource = await this.parseSource(source.content, executionContext);
54
- let interpretedResult = await this.interpretSource(parsedSource, contextData, executionContext);
55
- // Generate file pack. In case of generated source, one file will be produced as primary and there can be additional files based on emitted content
56
- let producedPrimaryFile = {
57
- name: 'Main',
58
- path: '',
59
- content: interpretedResult,
60
- source: 'primary',
61
- type: 'string'
62
- };
63
- let producedEmittedFiles = new Array();
64
- for (let emittedResult of emitter.allEmittedContent()) {
65
- let producedEmittedFile = {
66
- name: emittedResult.filename,
67
- path: '',
68
- content: emittedResult.content,
69
- source: 'emitter',
70
- type: 'string'
71
- };
72
- producedEmittedFiles.push(producedEmittedFile);
73
- }
74
- // Construct all information into result
75
- return {
76
- sourceId: sourceId,
77
- producedContent: [producedPrimaryFile, ...producedEmittedFiles],
78
- logger: logger
79
- };
80
- }
81
- /** Update source code definition. Content can be anything */
82
- updateSourceCodeDefinitionForSourceId(sourceId, definition) {
83
- // Find the source
84
- let source = this.exporter.sourceById(sourceId);
85
- if (!source) {
86
- throw Error(`Unknown source to update ${sourceId}`);
87
- }
88
- // Update the source definition. Note that even invalid definition should be saved, so we don't validate
89
- source.content = definition;
90
- }
91
- /** Update source code definition. Overview can be empty. Throws error when source is not found */
92
- updateSourceLocation(oldSourceId, newSourceId, newPath) {
93
- // Find the source
94
- let source = this.exporter.sourceById(oldSourceId);
95
- if (!source) {
96
- throw Error(`Unknown source to update ${oldSourceId}`);
97
- }
98
- // Move it
99
- this.exporter.moveBlueprintSource(oldSourceId, newSourceId, newPath);
100
- }
101
- /** Suggest next characters, words or snippets to be inserted into pulsar code as user types */
102
- suggestNextFromSourceCode(code, selectionLocation, selectionLength) {
103
- let suggestionEngine = new main_1.PLBlueprintAutocompleteEngine(this.codeExecutionContext);
104
- suggestionEngine.loadSnippets(new main_1.PLAutocompleteBlueprintSnippets().snippetPool());
105
- let suggestions = suggestionEngine.suggestNextBasedOnString(code, selectionLocation, selectionLength);
106
- return suggestions;
107
- }
108
- /** Apply autocompletion result to specified pulsar code */
109
- applyAutocompletionResultToCode(code, selectionLocation, selectionLength, apply) {
110
- let suggestionEngine = new main_1.PLBlueprintAutocompleteEngine(this.codeExecutionContext);
111
- let result = suggestionEngine.applySuggestion(apply, code, selectionLocation, selectionLength, 0);
112
- return result;
113
- }
114
- /** Compute highlight tokens for the provided pulsar code */
115
- suggestHighlightFromSourceCode(code) {
116
- let suggestionEngine = new main_1.PLBlueprintHighlightEngine(this.codeExecutionContext);
117
- let result = suggestionEngine.tokenize(code);
118
- return result;
119
- }
120
- // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
121
- // MARK: - Context
122
- createContextData(contextKey, contextId) {
123
- let data = new Map();
124
- if (contextId === 'none') {
125
- if (contextKey === ExporterSource_1.PCExporterSourceContextType.generic) {
126
- return data;
127
- }
128
- else if (contextKey === ExporterSource_1.PCExporterSourceContextType.component) {
129
- throw new Error('Source with component context can only be tested against design system with one or more defined components. Create new component and run this source again.');
130
- }
131
- else if (contextKey === ExporterSource_1.PCExporterSourceContextType.componentGroup) {
132
- throw new Error('Source with component group context can only be tested against design system with one or more defined component groups. Create new component group and run this source again.');
133
- }
134
- else if (contextKey === ExporterSource_1.PCExporterSourceContextType.tokenType) {
135
- throw new Error('Source with token type context can only be tested against design system with one or more token types. Create new token and run this source again.');
136
- }
137
- else if (contextKey === ExporterSource_1.PCExporterSourceContextType.tokenGroup) {
138
- throw new Error('Source with token group context can only be tested against design system with one or more defined token groups. Create new token group and run this source again.');
139
- }
140
- else if (contextKey === ExporterSource_1.PCExporterSourceContextType.theme) {
141
- throw new Error('Source with theme context can only be tested against design system with one or more defined themes. Create new theme and run this source again.');
142
- }
143
- }
144
- else {
145
- if (contextKey === ExporterSource_1.PCExporterSourceContextType.generic) {
146
- // Generic ignores context id
147
- return data;
148
- }
149
- else if (contextKey === ExporterSource_1.PCExporterSourceContextType.component) {
150
- data.set('componentId', contextId);
151
- }
152
- else if (contextKey === ExporterSource_1.PCExporterSourceContextType.componentGroup) {
153
- data.set('groupId', contextId);
154
- }
155
- else if (contextKey === ExporterSource_1.PCExporterSourceContextType.tokenType) {
156
- data.set('tokenTypeId', contextId);
157
- }
158
- else if (contextKey === ExporterSource_1.PCExporterSourceContextType.tokenGroup) {
159
- data.set('groupId', contextId);
160
- }
161
- else if (contextKey === ExporterSource_1.PCExporterSourceContextType.theme) {
162
- data.set('themeId', contextId);
163
- }
164
- }
165
- return data;
166
- }
167
- // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
168
- // MARK: - Convenience
169
- async parseSource(declaration, executionContext) {
170
- let source = main_1.PLBlueprintFactory.blueprint(declaration, 'test', executionContext, null);
171
- return source;
172
- }
173
- async interpretSource(source, data, executionContext) {
174
- let renderingContext = new main_1.PLInterpreterContext(data);
175
- let interpreter = new main_1.PLInterpreter();
176
- return interpreter.interpret(source, renderingContext, executionContext);
177
- }
178
- }
179
- exports.PCPulsarCodeManager = PCPulsarCodeManager;
180
- //# sourceMappingURL=PulsarCodeManager.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PulsarCodeManager.js","sourceRoot":"","sources":["../../../../src/pulsar/managers/PulsarCodeManager.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,wBAAwB;AACxB,aAAa;AACb,EAAE;AACF,2BAA2B;AAC3B,sDAAsD;AACtD,EAAE;;;AAMF,oGAAkG;AAClG,4EAA0E;AAC1E,uEAcqD;AAKrD,sHAAoH;AAEpH,uEAAgF;AAEhF,8GAA8G;AAC9G,sBAAsB;AAEtB,8GAA8G;AAC9G,gBAAgB;AAEhB,MAAa,mBAAmB;IAO9B,8GAA8G;IAC9G,gBAAgB;IAEhB,YAAY,QAAoB;QAC9B,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAA;QAExB,kIAAkI;QAClI,IAAI,CAAC,oBAAoB,GAAG,IA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AAE,SAAS,CAAC,CAAA;aAC/B;iBAAM,IAAI,UAAU,KAAK,4CAA2B,CAAC,KAAK,EAAE;gBAC3D,IAAI,CAAC,GAAG,CAAC,SAAS,EAAE,SAAS,CAAC,CAAA;aAC/B;SACF;QAED,OAAO,IAAI,CAAA;IACb,CAAC;IAED,8GAA8G;IAC9G,sBAAsB;IAEtB,KAAK,CAAC,WAAW,CAAC,WAAmB,EAAE,gBAAqC;QAC1E,IAAI,MAAM,GAAG,yBAAkB,CAAC,SAAS,CAAC,WAAW,EAAE,MAAM,EAAE,gBAAgB,EAAE,IAAI,CAAC,CAAA;QACtF,OAAO,MAAM,CAAA;IACf,CAAC;IAED,KAAK,CAAC,eAAe,CACnB,MAAmB,EACnB,IAAsB,EACtB,gBAAqC;QAErC,IAAI,gBAAgB,GAAG,IAAI,2BAAoB,CAAC,IAAI,CAAC,CAAA;QACrD,IAAI,WAAW,GAAG,IAAI,oBAAa,EAAE,CAAA;QACrC,OAAO,WAAW,CAAC,SAAS,CAAC,MAAM,EAAE,gBAAgB,EAAE,gBAAgB,CAAC,CAAA;IAC1E,CAAC;CACF;AApND,kDAoNC"}
@@ -1,17 +0,0 @@
1
- import { PCExporter } from '../../model/exporters/Exporter';
2
- export declare class PCPulsarConfigurationManager {
3
- private exporter;
4
- constructor(exporter: PCExporter);
5
- /** Get exporter configuration JSON */
6
- getExporterConfigurationJSON(): string;
7
- /** Get source configuration JSON */
8
- getSourceConfigurationJSON(): string;
9
- /** Get output configuration JSON */
10
- getOutputConfigurationJSON(): string;
11
- /** Update exporter configuration JSON */
12
- updateExporterConfigurationJSON(content: string): void;
13
- /** Update source configuration JSON */
14
- updateSourceConfigurationJSON(content: string): void;
15
- /** Update output configuration JSON */
16
- updateOutputConfigurationJSON(content: string): void;
17
- }
@@ -1,88 +0,0 @@
1
- "use strict";
2
- //
3
- // PulsarConfigurationManager.ts
4
- // Supernova
5
- //
6
- // Created by Jiri Trecak.
7
- // Copyright © 2020 Jiri Trecak. All rights reserved.
8
- //
9
- Object.defineProperty(exports, "__esModule", { value: true });
10
- exports.PCPulsarConfigurationManager = void 0;
11
- const ExporterMapBlueprint_1 = require("../../model/maps/ExporterMapBlueprint");
12
- const PulsarExporterConfigFileGenerator_1 = require("./generators/PulsarExporterConfigFileGenerator");
13
- const PulsarExporterConfigFileValidator_1 = require("./validators/PulsarExporterConfigFileValidator");
14
- // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
15
- // MARK: - Imports
16
- // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
17
- // MARK: - Definitions
18
- // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
19
- // MARK: - Class
20
- class PCPulsarConfigurationManager {
21
- // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
22
- // MARK: - Setup
23
- constructor(exporter) {
24
- this.exporter = exporter;
25
- }
26
- // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
27
- // MARK: - Configuration manager
28
- /** Get exporter configuration JSON */
29
- getExporterConfigurationJSON() {
30
- let generator = new PulsarExporterConfigFileGenerator_1.PCPulsarExporterConfigurationGenerator(this.exporter);
31
- let payload = generator.exporterConfigurationData();
32
- return JSON.stringify(payload, null, 2);
33
- }
34
- /** Get source configuration JSON */
35
- getSourceConfigurationJSON() {
36
- let generator = new PulsarExporterConfigFileGenerator_1.PCPulsarExporterConfigurationGenerator(this.exporter);
37
- let payload = generator.sourceConfigurationData();
38
- return JSON.stringify(payload, null, 2);
39
- }
40
- /** Get output configuration JSON */
41
- getOutputConfigurationJSON() {
42
- let generator = new PulsarExporterConfigFileGenerator_1.PCPulsarExporterConfigurationGenerator(this.exporter);
43
- let payload = generator.outputConfigurationData();
44
- return JSON.stringify(payload, null, 2);
45
- }
46
- /** Update exporter configuration JSON */
47
- updateExporterConfigurationJSON(content) {
48
- // Parse and validate configuration file
49
- let validator = new PulsarExporterConfigFileValidator_1.PCPulsarExporterConfigurationFileValidator();
50
- let parsedConfiguration = validator.validateExporterConfigFileContent(content);
51
- // Validate that previous ID is still the same. This is a special step specifically for the update routine
52
- if (parsedConfiguration.id !== this.exporter.id) {
53
- throw Error(`Exporter ID must be the same (${this.exporter.id}) and can not be changed by editing the configuration file`);
54
- }
55
- // Re-write configuration of the loaded exporter
56
- this.exporter.applyConfiguration(parsedConfiguration);
57
- }
58
- /** Update source configuration JSON */
59
- updateSourceConfigurationJSON(content) {
60
- // Configuration file must contain source definitions
61
- let validator = new PulsarExporterConfigFileValidator_1.PCPulsarExporterConfigurationFileValidator();
62
- let parsedConfiguration = validator.validateSourceConfigFileContent(content, this.exporter);
63
- // Set all the previous sources to default so the new config doesn't interfere with the old one
64
- this.exporter.sources.forEach(source => {
65
- source.resetToDefault();
66
- });
67
- // Update each source that are already pre-validated
68
- for (const [sourceId, configuration] of Object.entries(parsedConfiguration)) {
69
- let source = this.exporter.sourceById(sourceId);
70
- source.loadBlueprintConfiguration(configuration);
71
- }
72
- }
73
- /** Update output configuration JSON */
74
- updateOutputConfigurationJSON(content) {
75
- // Configuration file must contain source definitions
76
- let parsedConfiguration = JSON.parse(content);
77
- let outputDefinition = parsedConfiguration['blueprints'];
78
- // Remove all previous outputs first so the new config doesn't interfere with the old one
79
- this.exporter.removeOutputs();
80
- // Create output mapping object from each output entry.
81
- for (let configuration of outputDefinition) {
82
- let map = new ExporterMapBlueprint_1.PCExporterMapBlueprint(configuration);
83
- this.exporter.linkOutputs([map]);
84
- }
85
- }
86
- }
87
- exports.PCPulsarConfigurationManager = PCPulsarConfigurationManager;
88
- //# sourceMappingURL=PulsarConfigurationManager.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PulsarConfigurationManager.js","sourceRoot":"","sources":["../../../../src/pulsar/managers/PulsarConfigurationManager.ts"],"names":[],"mappings":";AA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uDAAuD;QACvD,KAAK,IAAI,aAAa,IAAI,gBAAgB,EAAE;YAC1C,IAAI,GAAG,GAAG,IAAI,6CAAsB,CAAC,aAAa,CAAC,CAAA;YACnD,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC,GAAG,CAAC,CAAC,CAAA;SACjC;IACH,CAAC;CACF;AAtFD,oEAsFC"}
@@ -1,25 +0,0 @@
1
- import { PCExporter } from './../../model/exporters/Exporter';
2
- export declare class PCPulsarExporterManager {
3
- private exporter;
4
- constructor(exporter: PCExporter);
5
- /** Retrieve details about currently loaded exporter. Note that this only retrieves settings of the exporter, to request blueprints and mapping, use separate functions */
6
- getExporterDetail(): PCExporter;
7
- /** Update exporter name. Name must be non-empty and contain at least 6 characters */
8
- updateExporterName(name: string): PCExporter;
9
- /** Update exporter description. Description must be non-empty and contain at least 20 characters */
10
- updateExporterDescription(description: string): PCExporter;
11
- /** Update exporter version. Exporter version needs to follow standard major.minor.patch versioning. Patch is optional */
12
- updateExporterVersion(version: string): PCExporter;
13
- /** Update exporter author. Author can be empty. If non-empty, only alpha-numerics and spaces are allowed */
14
- updateExporterAuthor(author: string | null): PCExporter;
15
- /** Update exporter homepage. Homepage can be empty. If non-empty, validates the URL */
16
- updateExporterHomepage(homepage: string): PCExporter;
17
- /** Update exporter tags. Only alpha-numeric are allowed */
18
- updateExporterTags(tags: Array<string>): PCExporter;
19
- /** Update exporter icon. Not available at the moment */
20
- updateExporterIcon(icon: string): PCExporter;
21
- /** Serialize entire exporter into single javascript object. Returns object representation */
22
- getExporterBlob(): Object;
23
- /** Serialize entire exporter into single javascript object. Returns JSON-string representation */
24
- getExporterBlobJSONSerialized(): string;
25
- }
@@ -1,121 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PCPulsarExporterManager = void 0;
4
- const PulsarExporterJSONGenerator_1 = require("./generators/PulsarExporterJSONGenerator");
5
- // https://stackoverflow.com/a/5717133
6
- const URL_REGEX = new RegExp('^(https?:\\/\\/)?' + // protocol
7
- '((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|' + // domain name
8
- '((\\d{1,3}\\.){3}\\d{1,3}))' + // OR ip (v4) address
9
- '(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*' + // port and path
10
- '(\\?[;&a-z\\d%_.~+=-]*)?' + // query string
11
- '(\\#[-a-z\\d_]*)?$', // fragment locator
12
- 'i');
13
- // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
14
- // MARK: - Definitions
15
- // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
16
- // MARK: - Class
17
- class PCPulsarExporterManager {
18
- // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
19
- // MARK: - Setup
20
- constructor(exporter) {
21
- this.exporter = exporter;
22
- }
23
- // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
24
- // MARK: - Exporter manipulation
25
- /** Retrieve details about currently loaded exporter. Note that this only retrieves settings of the exporter, to request blueprints and mapping, use separate functions */
26
- getExporterDetail() {
27
- return this.exporter;
28
- }
29
- /** Update exporter name. Name must be non-empty and contain at least 6 characters */
30
- updateExporterName(name) {
31
- let trimmedName = name.trim();
32
- if (trimmedName.length < 6) {
33
- throw Error('Exporter name must be at least 6 letters long');
34
- }
35
- if (!trimmedName.match(/^[0-9a-zA-Z -]+$/)) {
36
- throw Error('Exporter name must only contain letters, numbers, spaces and hyphens');
37
- }
38
- this.exporter.name = trimmedName;
39
- return this.exporter;
40
- }
41
- /** Update exporter description. Description must be non-empty and contain at least 20 characters */
42
- updateExporterDescription(description) {
43
- let trimmedOverview = description.trim();
44
- if (trimmedOverview.length <= 0) {
45
- throw Error('Exporter description must be at least 20 characters longs');
46
- }
47
- this.exporter.description = trimmedOverview;
48
- return this.exporter;
49
- }
50
- /** Update exporter version. Exporter version needs to follow standard major.minor.patch versioning. Patch is optional */
51
- updateExporterVersion(version) {
52
- let trimmedVersion = version.trim();
53
- if (!trimmedVersion.match(/^\d+(\.\d+){1,2}$/)) {
54
- throw Error('Exporter version must be in formatted as major.minor.patch. Major and minor version is required, patch is optional');
55
- }
56
- this.exporter.version = trimmedVersion;
57
- return this.exporter;
58
- }
59
- /** Update exporter author. Author can be empty. If non-empty, only alpha-numerics and spaces are allowed */
60
- updateExporterAuthor(author) {
61
- let trimmedAuthor = author.trim();
62
- if (!trimmedAuthor || trimmedAuthor.length === 0) {
63
- this.exporter.author = null;
64
- return this.exporter;
65
- }
66
- const NAME_REGEX = /^[\s,.'\-\p{L}]+$/u;
67
- if (!trimmedAuthor.match(NAME_REGEX)) {
68
- throw Error('Exporter author name cannot contain numbers or special characters');
69
- }
70
- this.exporter.author = trimmedAuthor;
71
- return this.exporter;
72
- }
73
- /** Update exporter homepage. Homepage can be empty. If non-empty, validates the URL */
74
- updateExporterHomepage(homepage) {
75
- let trimmedHomepage = homepage.trim();
76
- if (!trimmedHomepage || trimmedHomepage.length === 0) {
77
- this.exporter.homepage = null;
78
- return this.exporter;
79
- }
80
- if (!trimmedHomepage.match(URL_REGEX)) {
81
- throw Error('Exporter home page must be a valid url');
82
- }
83
- this.exporter.homepage = trimmedHomepage;
84
- return this.exporter;
85
- }
86
- /** Update exporter tags. Only alpha-numeric are allowed */
87
- updateExporterTags(tags) {
88
- for (const tag of tags) {
89
- if (!tag.match(/^[0-9a-zA-Z]+$/)) {
90
- throw Error('Exporter tags must only contain letters or numbers');
91
- }
92
- }
93
- this.exporter.tags = tags;
94
- return this.exporter;
95
- }
96
- /** Update exporter icon. Not available at the moment */
97
- updateExporterIcon(icon) {
98
- let trimmedIcon = icon.trim();
99
- if (!trimmedIcon || trimmedIcon.length === 0) {
100
- this.exporter.icon = null;
101
- return this.exporter;
102
- }
103
- if (!trimmedIcon.match(URL_REGEX)) {
104
- throw Error('Exporter icon must be a valid url');
105
- }
106
- this.exporter.icon = trimmedIcon;
107
- return this.exporter;
108
- }
109
- /** Serialize entire exporter into single javascript object. Returns object representation */
110
- getExporterBlob() {
111
- let blobGenerator = new PulsarExporterJSONGenerator_1.PCPulsarExporterJSONGenerator(this.exporter);
112
- return blobGenerator.constructBlob();
113
- }
114
- /** Serialize entire exporter into single javascript object. Returns JSON-string representation */
115
- getExporterBlobJSONSerialized() {
116
- let blobGenerator = new PulsarExporterJSONGenerator_1.PCPulsarExporterJSONGenerator(this.exporter);
117
- return blobGenerator.constructBlobJSON();
118
- }
119
- }
120
- exports.PCPulsarExporterManager = PCPulsarExporterManager;
121
- //# sourceMappingURL=PulsarExporterManager.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PulsarExporterManager.js","sourceRoot":"","sources":["../../../../src/pulsar/managers/PulsarExporterManager.ts"],"names":[],"mappings":";;;AAAA,0FAAwF;AAcxF,sCAAsC;AACtC,MAAM,SAAS,GAAG,IAAI,MAAM,CAC1B,mBAAmB,GAAG,WAAW;IACjC,kDAAkD,GAAG,cAAc;IACnE,6BAA6B,GAAG,qBAAqB;IACrD,iCAAiC,GAAG,gBAAgB;IACpD,0BAA0B,GAAG,eAAe;IAC1C,oBAAoB,EAAE,mBAAmB;AAC3C,GAAG,CACJ,CAAA;AAED,8GAA8G;AAC9G,sBAAsB;AAEtB,8GAA8G;AAC9G,gBAAgB;AAEhB,MAAa,uBAAuB;IAMlC,8GAA8G;IAC9G,gBAAgB;IAEhB,YAAY,QAAoB;QAC9B,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAA;IAC1B,CAAC;IAED,8GAA8G;IAC9G,gCAAgC;IAEhC,0KAA0K;IAC1K,iBAAiB;QACf,OAAO,IAAI,CAAC,QAAQ,CAAA;IACtB,CAAC;IAED,qFAAqF;IACrF,kBAAkB,CAAC,IAAY;QAC7B,IAAI,WAAW,GAAG,IAAI,CAAC,IAAI,EAAE,CAAA;QAC7B,IAAI,WAAW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A;SACrB;QAED,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,SAAS,CAAC,EAAE;YACjC,MAAM,KAAK,CAAC,mCAAmC,CAAC,CAAA;SACjD;QAED,IAAI,CAAC,QAAQ,CAAC,IAAI,GAAG,WAAW,CAAA;QAChC,OAAO,IAAI,CAAC,QAAQ,CAAA;IACtB,CAAC;IAED,6FAA6F;IAC7F,eAAe;QACb,IAAI,aAAa,GAAG,IAAI,2DAA6B,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;QACpE,OAAO,aAAa,CAAC,aAAa,EAAE,CAAA;IACtC,CAAC;IAED,kGAAkG;IAClG,6BAA6B;QAC3B,IAAI,aAAa,GAAG,IAAI,2DAA6B,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;QACpE,OAAO,aAAa,CAAC,iBAAiB,EAAE,CAAA;IAC1C,CAAC;CACF;AArID,0DAqIC"}
@@ -1,12 +0,0 @@
1
- import { PCExporter } from '../../../model/exporters/Exporter';
2
- import { PCPulsarFile } from './PulsarFileGenerator';
3
- export declare class PCPulsarExporterConfigurationGenerator {
4
- exporter: PCExporter;
5
- constructor(exporter: PCExporter);
6
- exporterConfigurationFile(): PCPulsarFile;
7
- exporterConfigurationData(): Object;
8
- sourceConfigurationFile(): PCPulsarFile;
9
- sourceConfigurationData(): Object;
10
- outputConfigurationFile(): PCPulsarFile;
11
- outputConfigurationData(): Object;
12
- }
@@ -1,140 +0,0 @@
1
- "use strict";
2
- //
3
- // PCPulsarExporterConfigurationGenerator.ts
4
- // Supernova
5
- //
6
- // Created by Jiri Trecak.
7
- // Copyright © 2021 Jiri Trecak. All rights reserved.
8
- //
9
- Object.defineProperty(exports, "__esModule", { value: true });
10
- exports.PCPulsarExporterConfigurationGenerator = void 0;
11
- const ExporterSource_1 = require("../../../model/sources/ExporterSource");
12
- const PulsarFileGenerator_1 = require("./PulsarFileGenerator");
13
- // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
14
- // MARK: - Definitions
15
- // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
16
- // MARK: - Class
17
- class PCPulsarExporterConfigurationGenerator {
18
- // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
19
- // MARK: - Setup
20
- constructor(exporter) {
21
- this.exporter = exporter;
22
- }
23
- // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
24
- // MARK: - Exporter Configuration JSON
25
- exporterConfigurationFile() {
26
- // Create description of exporter.json main configuration file
27
- let fileGenerator = new PulsarFileGenerator_1.PCPulsarFileGenerator();
28
- let name = 'exporter';
29
- let extension = 'json';
30
- let directory = '';
31
- let content = this.exporterConfigurationData();
32
- return fileGenerator.pulsarFileDescriptorForFileWrite(name, extension, directory, content);
33
- }
34
- exporterConfigurationData() {
35
- let data = {
36
- id: this.exporter.id,
37
- name: this.exporter.name,
38
- description: this.exporter.description,
39
- source_dir: this.exporter.sourceDirectory,
40
- version: this.exporter.version,
41
- tags: this.exporter.tags
42
- };
43
- if (this.exporter.author) {
44
- data['author'] = this.exporter.author;
45
- }
46
- if (this.exporter.organization) {
47
- data['organization'] = this.exporter.organization;
48
- }
49
- if (this.exporter.homepage) {
50
- data['homepage'] = this.exporter.homepage;
51
- }
52
- if (this.exporter.icon) {
53
- data['icon'] = this.exporter.icon;
54
- }
55
- if (this.exporter.outputConfigFilePath !== null || this.exporter.sourceConfigFilePath !== null) {
56
- let config = {};
57
- if (this.exporter.outputConfigFilePath !== null) {
58
- config['output'] = this.exporter.outputConfigFilePath;
59
- }
60
- if (this.exporter.sourceConfigFilePath !== null) {
61
- config['sources'] = this.exporter.sourceConfigFilePath;
62
- }
63
- data['config'] = config;
64
- }
65
- if (this.exporter.pulsarEngineVersion !== null || this.exporter.supernovaEngineVersion !== null) {
66
- let engines = {};
67
- if (this.exporter.pulsarEngineVersion !== null) {
68
- engines['pulsar'] = this.exporter.pulsarEngineVersion;
69
- }
70
- if (this.exporter.supernovaEngineVersion !== null) {
71
- engines['supernova'] = this.exporter.supernovaEngineVersion;
72
- }
73
- data['engines'] = engines;
74
- }
75
- return data;
76
- }
77
- // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
78
- // MARK: - Source Configuration
79
- sourceConfigurationFile() {
80
- // Create description of source configuration file
81
- let fileGenerator = new PulsarFileGenerator_1.PCPulsarFileGenerator();
82
- let content = this.sourceConfigurationData();
83
- let descriptor = this.exporter.sourceConfigFilePath
84
- ? fileGenerator.pulsarFileDescriptorFromFilePath(this.exporter.sourceConfigFilePath)
85
- : fileGenerator.pulsarFileDescriptorFromFilePath('blueprints.json');
86
- return fileGenerator.pulsarFileDescriptorForFileWrite(descriptor.name, descriptor.extension, descriptor.directory, content);
87
- }
88
- sourceConfigurationData() {
89
- // Create non-default configuration entries for each source
90
- let data = new Object();
91
- for (let source of this.exporter.sources.values()) {
92
- let object = new Object();
93
- if (source.context != ExporterSource_1.PCExporterSourceContextType.generic) {
94
- object['context'] = source.context.toString();
95
- }
96
- if (source.targetsCI) {
97
- object['targets_ci'] = true;
98
- }
99
- if (source.targetsSandbox) {
100
- object['targets_sandbox'] = true;
101
- }
102
- if (source.targetsDocumentation) {
103
- object['targets_documentation'] = true;
104
- }
105
- data[source.id] = object;
106
- }
107
- return data;
108
- }
109
- // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
110
- // MARK: - Source Configuration
111
- outputConfigurationFile() {
112
- // Create description of output configuration file
113
- let fileGenerator = new PulsarFileGenerator_1.PCPulsarFileGenerator();
114
- let content = this.outputConfigurationData();
115
- let descriptor = this.exporter.outputConfigFilePath
116
- ? fileGenerator.pulsarFileDescriptorFromFilePath(this.exporter.outputConfigFilePath)
117
- : fileGenerator.pulsarFileDescriptorFromFilePath('output.json');
118
- return fileGenerator.pulsarFileDescriptorForFileWrite(descriptor.name, descriptor.extension, descriptor.directory, content);
119
- }
120
- outputConfigurationData() {
121
- let blueprintOutput = new Array();
122
- for (let map of this.exporter.outputs) {
123
- let object = {
124
- invoke: map.invoke
125
- };
126
- if (map.write_to !== null) {
127
- object['write_to'] = map.write_to;
128
- }
129
- if (map.write_using !== null) {
130
- object['write_using'] = map.write_using;
131
- }
132
- blueprintOutput.push(object);
133
- }
134
- return {
135
- blueprints: blueprintOutput
136
- };
137
- }
138
- }
139
- exports.PCPulsarExporterConfigurationGenerator = PCPulsarExporterConfigurationGenerator;
140
- //# sourceMappingURL=PulsarExporterConfigFileGenerator.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PulsarExporterConfigFileGenerator.js","sourceRoot":"","sources":["../../../../../src/pulsar/managers/generators/PulsarExporterConfigFileGenerator.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,6CAA6C;AAC7C,aAAa;AACb,EAAE;AACF,2BAA2B;AAC3B,sDAAsD;AACtD,EAAE;;;AAMF,0EAAmF;AACnF,+DAA2E;AAE3E,8GAA8G;AAC9G,sBAAsB;AAEtB,8GAA8G;AAC9G,gBAAgB;AAEhB,MAAa,sCAAsC;IAMjD,8GAA8G;IAC9G,gBAAgB;IAEhB,YAAY,QAAoB;QAC9B,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAA;IAC1B,CAAC;IAED,8GAA8G;IAC9G,sCAAsC;IAEtC,yBAAyB;QACvB,8DAA8D;QAC9D,IAAI,aAAa,GAAG,IAAI,2CAAqB,EAAE,CAAA;QAC/C,IAAI,IAAI,GAAG,UAAU,CAAA;QACrB,IAAI,SAAS,GAAG,MAAM,CAAA;QACtB,IAAI,SAAS,GAAG,EAAE,CAAA;QAClB,IAAI,OAAO,GAAG,IAAI,CAAC,yBAAyB,EAAE,CAAA;QAE9C,OAAO,aAAa,CAAC,gCAAgC,CAAC,IAAI,EAAE,SAAS,EAAE,SAAS,EAAE,OAAO,CAAC,CA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B,IAAI,eAAe,GAAG,IAAI,KAAK,EAAU,CAAA;QACzC,KAAK,IAAI,GAAG,IAAI,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE;YACrC,IAAI,MAAM,GAAG;gBACX,MAAM,EAAE,GAAG,CAAC,MAAM;aACnB,CAAA;YACD,IAAI,GAAG,CAAC,QAAQ,KAAK,IAAI,EAAE;gBACzB,MAAM,CAAC,UAAU,CAAC,GAAG,GAAG,CAAC,QAAQ,CAAA;aAClC;YACD,IAAI,GAAG,CAAC,WAAW,KAAK,IAAI,EAAE;gBAC5B,MAAM,CAAC,aAAa,CAAC,GAAG,GAAG,CAAC,WAAW,CAAA;aACxC;YAED,eAAe,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;SAC7B;QAED,OAAO;YACL,UAAU,EAAE,eAAe;SAC5B,CAAA;IACH,CAAC;CACF;AA7JD,wFA6JC"}
@@ -1,8 +0,0 @@
1
- import { PCExporter } from '../../../model/exporters/Exporter';
2
- import { PCPulsarFile } from './PulsarFileGenerator';
3
- export declare class PCPulsarExporterJSONGenerator {
4
- exporter: PCExporter;
5
- constructor(exporter: PCExporter);
6
- constructBlob(): Array<PCPulsarFile>;
7
- constructBlobJSON(): string;
8
- }