@supernova-studio/pulsar-core 1.0.8 → 1.0.10

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 (217) hide show
  1. package/build/browser/pulsar.js +141741 -0
  2. package/build/browser/pulsar.min.js +270 -0
  3. package/build/main/browser-bundle.d.ts +1 -0
  4. package/build/main/browser-bundle.js +17 -0
  5. package/build/main/browser-bundle.js.map +1 -0
  6. package/build/main/engine/ExportEngine.d.ts +17 -0
  7. package/build/main/engine/ExportEngine.js +122 -0
  8. package/build/main/engine/ExportEngine.js.map +1 -0
  9. package/build/main/engine/configuration/ExportConfiguration.d.ts +18 -0
  10. package/build/main/engine/configuration/ExportConfiguration.js +47 -0
  11. package/build/main/engine/configuration/ExportConfiguration.js.map +1 -0
  12. package/build/main/engine/generation/ExportDataProducer.d.ts +15 -0
  13. package/build/main/engine/generation/ExportDataProducer.js +100 -0
  14. package/build/main/engine/generation/ExportDataProducer.js.map +1 -0
  15. package/build/main/engine/generation/queue/ExportDataQueue.d.ts +16 -0
  16. package/build/main/engine/generation/queue/ExportDataQueue.js +72 -0
  17. package/build/main/engine/generation/queue/ExportDataQueue.js.map +1 -0
  18. package/build/main/engine/generation/queue/ExportDataQueueOperation.d.ts +6 -0
  19. package/build/main/engine/generation/queue/ExportDataQueueOperation.js +36 -0
  20. package/build/main/engine/generation/queue/ExportDataQueueOperation.js.map +1 -0
  21. package/build/main/engine/generation/requests/ExportDataEmittedResponseProducer.d.ts +7 -0
  22. package/build/main/engine/generation/requests/ExportDataEmittedResponseProducer.js +54 -0
  23. package/build/main/engine/generation/requests/ExportDataEmittedResponseProducer.js.map +1 -0
  24. package/build/main/engine/generation/requests/ExportDataPrimaryResponseProducer.d.ts +7 -0
  25. package/build/main/engine/generation/requests/ExportDataPrimaryResponseProducer.js +40 -0
  26. package/build/main/engine/generation/requests/ExportDataPrimaryResponseProducer.js.map +1 -0
  27. package/build/main/engine/generation/requests/ExportDataRequest.d.ts +19 -0
  28. package/build/main/engine/generation/requests/ExportDataRequest.js +55 -0
  29. package/build/main/engine/generation/requests/ExportDataRequest.js.map +1 -0
  30. package/build/main/engine/generation/requests/ExportDataRequestDataStore.d.ts +16 -0
  31. package/build/main/engine/generation/requests/ExportDataRequestDataStore.js +57 -0
  32. package/build/main/engine/generation/requests/ExportDataRequestDataStore.js.map +1 -0
  33. package/build/main/engine/generation/requests/ExportDataRequestNameStore.d.ts +22 -0
  34. package/build/main/engine/generation/requests/ExportDataRequestNameStore.js +86 -0
  35. package/build/main/engine/generation/requests/ExportDataRequestNameStore.js.map +1 -0
  36. package/build/main/engine/generation/requests/ExportDataRequestProducer.d.ts +16 -0
  37. package/build/main/engine/generation/requests/ExportDataRequestProducer.js +162 -0
  38. package/build/main/engine/generation/requests/ExportDataRequestProducer.js.map +1 -0
  39. package/build/main/engine/generation/requests/ExportDataResponse.d.ts +13 -0
  40. package/build/main/engine/generation/requests/ExportDataResponse.js +30 -0
  41. package/build/main/engine/generation/requests/ExportDataResponse.js.map +1 -0
  42. package/build/main/engine/generation/requests/specific/dsm/ExportDataRequestBlueprint.d.ts +14 -0
  43. package/build/main/engine/generation/requests/specific/dsm/ExportDataRequestBlueprint.js +77 -0
  44. package/build/main/engine/generation/requests/specific/dsm/ExportDataRequestBlueprint.js.map +1 -0
  45. package/build/main/engine/generation/requests/specific/dsm/ExportDataRequestDSMComponent.d.ts +13 -0
  46. package/build/main/engine/generation/requests/specific/dsm/ExportDataRequestDSMComponent.js +47 -0
  47. package/build/main/engine/generation/requests/specific/dsm/ExportDataRequestDSMComponent.js.map +1 -0
  48. package/build/main/engine/generation/requests/specific/dsm/ExportDataRequestDSMComponentGroup.d.ts +13 -0
  49. package/build/main/engine/generation/requests/specific/dsm/ExportDataRequestDSMComponentGroup.js +47 -0
  50. package/build/main/engine/generation/requests/specific/dsm/ExportDataRequestDSMComponentGroup.js.map +1 -0
  51. package/build/main/engine/generation/requests/specific/dsm/ExportDataRequestDSMGeneric.d.ts +11 -0
  52. package/build/main/engine/generation/requests/specific/dsm/ExportDataRequestDSMGeneric.js +43 -0
  53. package/build/main/engine/generation/requests/specific/dsm/ExportDataRequestDSMGeneric.js.map +1 -0
  54. package/build/main/engine/generation/requests/specific/dsm/ExportDataRequestDSMTheme.d.ts +13 -0
  55. package/build/main/engine/generation/requests/specific/dsm/ExportDataRequestDSMTheme.js +47 -0
  56. package/build/main/engine/generation/requests/specific/dsm/ExportDataRequestDSMTheme.js.map +1 -0
  57. package/build/main/engine/generation/requests/specific/dsm/ExportDataRequestDSMTokenGroup.d.ts +13 -0
  58. package/build/main/engine/generation/requests/specific/dsm/ExportDataRequestDSMTokenGroup.js +47 -0
  59. package/build/main/engine/generation/requests/specific/dsm/ExportDataRequestDSMTokenGroup.js.map +1 -0
  60. package/build/main/engine/generation/requests/specific/dsm/ExportDataRequestDSMTokenType.d.ts +13 -0
  61. package/build/main/engine/generation/requests/specific/dsm/ExportDataRequestDSMTokenType.js +47 -0
  62. package/build/main/engine/generation/requests/specific/dsm/ExportDataRequestDSMTokenType.js.map +1 -0
  63. package/build/main/engine/items/ExportItemProducer.d.ts +14 -0
  64. package/build/main/engine/items/ExportItemProducer.js +70 -0
  65. package/build/main/engine/items/ExportItemProducer.js.map +1 -0
  66. package/build/main/engine/items/construction/ExportItem.d.ts +8 -0
  67. package/build/main/engine/items/construction/ExportItem.js +25 -0
  68. package/build/main/engine/items/construction/ExportItem.js.map +1 -0
  69. package/build/main/engine/items/construction/ExportItemBuilder.d.ts +9 -0
  70. package/build/main/engine/items/construction/ExportItemBuilder.js +47 -0
  71. package/build/main/engine/items/construction/ExportItemBuilder.js.map +1 -0
  72. package/build/main/engine/items/queue/ExportItemQueue.d.ts +16 -0
  73. package/build/main/engine/items/queue/ExportItemQueue.js +70 -0
  74. package/build/main/engine/items/queue/ExportItemQueue.js.map +1 -0
  75. package/build/main/engine/items/queue/ExportItemQueueOperation.d.ts +6 -0
  76. package/build/main/engine/items/queue/ExportItemQueueOperation.js +36 -0
  77. package/build/main/engine/items/queue/ExportItemQueueOperation.js.map +1 -0
  78. package/build/main/engine/items/requests/ExportItemRequest.d.ts +16 -0
  79. package/build/main/engine/items/requests/ExportItemRequest.js +68 -0
  80. package/build/main/engine/items/requests/ExportItemRequest.js.map +1 -0
  81. package/build/main/engine/items/requests/ExportItemRequestProducer.d.ts +8 -0
  82. package/build/main/engine/items/requests/ExportItemRequestProducer.js +24 -0
  83. package/build/main/engine/items/requests/ExportItemRequestProducer.js.map +1 -0
  84. package/build/main/engine/items/requests/ExportItemResponse.d.ts +9 -0
  85. package/build/main/engine/items/requests/ExportItemResponse.js +25 -0
  86. package/build/main/engine/items/requests/ExportItemResponse.js.map +1 -0
  87. package/build/main/engine/items/requests/ExportItemResponseProducer.d.ts +7 -0
  88. package/build/main/engine/items/requests/ExportItemResponseProducer.js +45 -0
  89. package/build/main/engine/items/requests/ExportItemResponseProducer.js.map +1 -0
  90. package/build/main/engine/loaders/BlueprintLoader.d.ts +9 -0
  91. package/build/main/engine/loaders/BlueprintLoader.js +55 -0
  92. package/build/main/engine/loaders/BlueprintLoader.js.map +1 -0
  93. package/build/main/engine/writing/queue/ExportWriterQueue.d.ts +16 -0
  94. package/build/main/engine/writing/queue/ExportWriterQueue.js +70 -0
  95. package/build/main/engine/writing/queue/ExportWriterQueue.js.map +1 -0
  96. package/build/main/engine/writing/queue/ExportWriterQueueOperation.d.ts +6 -0
  97. package/build/main/engine/writing/queue/ExportWriterQueueOperation.js +36 -0
  98. package/build/main/engine/writing/queue/ExportWriterQueueOperation.js.map +1 -0
  99. package/build/main/engine/writing/requests/ExportWriterRequest.d.ts +14 -0
  100. package/build/main/engine/writing/requests/ExportWriterRequest.js +40 -0
  101. package/build/main/engine/writing/requests/ExportWriterRequest.js.map +1 -0
  102. package/build/main/engine/writing/requests/ExportWriterRequestProducer.d.ts +8 -0
  103. package/build/main/engine/writing/requests/ExportWriterRequestProducer.js +30 -0
  104. package/build/main/engine/writing/requests/ExportWriterRequestProducer.js.map +1 -0
  105. package/build/main/engine/writing/requests/ExportWriterResponse.d.ts +9 -0
  106. package/build/main/engine/writing/requests/ExportWriterResponse.js +25 -0
  107. package/build/main/engine/writing/requests/ExportWriterResponse.js.map +1 -0
  108. package/build/main/engine/writing/requests/ExportWriterResponseProducer.d.ts +7 -0
  109. package/build/main/engine/writing/requests/ExportWriterResponseProducer.js +40 -0
  110. package/build/main/engine/writing/requests/ExportWriterResponseProducer.js.map +1 -0
  111. package/build/main/engine/writing/writers/ExportItemWriter.d.ts +14 -0
  112. package/build/main/engine/writing/writers/ExportItemWriter.js +70 -0
  113. package/build/main/engine/writing/writers/ExportItemWriter.js.map +1 -0
  114. package/build/main/engine/writing/writers/ExportWriterRuleProcessor.d.ts +9 -0
  115. package/build/main/engine/writing/writers/ExportWriterRuleProcessor.js +63 -0
  116. package/build/main/engine/writing/writers/ExportWriterRuleProcessor.js.map +1 -0
  117. package/build/main/engine/writing/writers/memory/ExportWriterMemory.d.ts +4 -0
  118. package/build/main/engine/writing/writers/memory/ExportWriterMemory.js +29 -0
  119. package/build/main/engine/writing/writers/memory/ExportWriterMemory.js.map +1 -0
  120. package/build/main/engine/writing/writers/memory/ExportWriterMemoryRequest.d.ts +5 -0
  121. package/build/main/engine/writing/writers/memory/ExportWriterMemoryRequest.js +59 -0
  122. package/build/main/engine/writing/writers/memory/ExportWriterMemoryRequest.js.map +1 -0
  123. package/build/main/engine/writing/writers/memory/ExportWriterStore.d.ts +5 -0
  124. package/build/main/engine/writing/writers/memory/ExportWriterStore.js +33 -0
  125. package/build/main/engine/writing/writers/memory/ExportWriterStore.js.map +1 -0
  126. package/build/main/exports.d.ts +4 -0
  127. package/build/main/exports.js +13 -0
  128. package/build/main/exports.js.map +1 -0
  129. package/build/main/index.d.ts +1 -0
  130. package/build/main/index.js +14 -0
  131. package/build/main/index.js.map +1 -0
  132. package/build/main/model/dsm/DSMReferenceStore.d.ts +28 -0
  133. package/build/main/model/dsm/DSMReferenceStore.js +100 -0
  134. package/build/main/model/dsm/DSMReferenceStore.js.map +1 -0
  135. package/build/main/model/exporters/Exporter.d.ts +50 -0
  136. package/build/main/model/exporters/Exporter.js +88 -0
  137. package/build/main/model/exporters/Exporter.js.map +1 -0
  138. package/build/main/model/maps/ExporterMapBlueprint.d.ts +12 -0
  139. package/build/main/model/maps/ExporterMapBlueprint.js +39 -0
  140. package/build/main/model/maps/ExporterMapBlueprint.js.map +1 -0
  141. package/build/main/model/sources/ExporterSource.d.ts +25 -0
  142. package/build/main/model/sources/ExporterSource.js +58 -0
  143. package/build/main/model/sources/ExporterSource.js.map +1 -0
  144. package/build/main/pulsar/Pulsar.d.ts +105 -0
  145. package/build/main/pulsar/Pulsar.js +351 -0
  146. package/build/main/pulsar/Pulsar.js.map +1 -0
  147. package/build/main/pulsar/PulsarInterface.d.ts +152 -0
  148. package/build/main/pulsar/PulsarInterface.js +37 -0
  149. package/build/main/pulsar/PulsarInterface.js.map +1 -0
  150. package/build/main/pulsar/PulsarStaticAnalysis.d.ts +23 -0
  151. package/build/main/pulsar/PulsarStaticAnalysis.js +47 -0
  152. package/build/main/pulsar/PulsarStaticAnalysis.js.map +1 -0
  153. package/build/main/pulsar/PulsarStaticAnalysisInterface.d.ts +10 -0
  154. package/build/main/pulsar/PulsarStaticAnalysisInterface.js +10 -0
  155. package/build/main/pulsar/PulsarStaticAnalysisInterface.js.map +1 -0
  156. package/build/main/pulsar/managers/PulsarBlueprintManager.d.ts +16 -0
  157. package/build/main/pulsar/managers/PulsarBlueprintManager.js +76 -0
  158. package/build/main/pulsar/managers/PulsarBlueprintManager.js.map +1 -0
  159. package/build/main/pulsar/managers/PulsarCIManager.d.ts +25 -0
  160. package/build/main/pulsar/managers/PulsarCIManager.js +220 -0
  161. package/build/main/pulsar/managers/PulsarCIManager.js.map +1 -0
  162. package/build/main/pulsar/managers/PulsarCodeManager.d.ts +24 -0
  163. package/build/main/pulsar/managers/PulsarCodeManager.js +180 -0
  164. package/build/main/pulsar/managers/PulsarCodeManager.js.map +1 -0
  165. package/build/main/pulsar/managers/PulsarConfigurationManager.d.ts +16 -0
  166. package/build/main/pulsar/managers/PulsarConfigurationManager.js +48 -0
  167. package/build/main/pulsar/managers/PulsarConfigurationManager.js.map +1 -0
  168. package/build/main/pulsar/managers/PulsarExporterManager.d.ts +25 -0
  169. package/build/main/pulsar/managers/PulsarExporterManager.js +121 -0
  170. package/build/main/pulsar/managers/PulsarExporterManager.js.map +1 -0
  171. package/build/main/pulsar/managers/generators/PulsarExporterJSONGenerator.d.ts +16 -0
  172. package/build/main/pulsar/managers/generators/PulsarExporterJSONGenerator.js +275 -0
  173. package/build/main/pulsar/managers/generators/PulsarExporterJSONGenerator.js.map +1 -0
  174. package/build/main/pulsar/managers/generators/PulsarExporterZIPGenerator.d.ts +7 -0
  175. package/build/main/pulsar/managers/generators/PulsarExporterZIPGenerator.js +63 -0
  176. package/build/main/pulsar/managers/generators/PulsarExporterZIPGenerator.js.map +1 -0
  177. package/build/main/pulsar/managers/loaders/PulsarBaseLoader.d.ts +5 -0
  178. package/build/main/pulsar/managers/loaders/PulsarBaseLoader.js +28 -0
  179. package/build/main/pulsar/managers/loaders/PulsarBaseLoader.js.map +1 -0
  180. package/build/main/pulsar/managers/loaders/local/PulsarFSLoader.d.ts +11 -0
  181. package/build/main/pulsar/managers/loaders/local/PulsarFSLoader.js +99 -0
  182. package/build/main/pulsar/managers/loaders/local/PulsarFSLoader.js.map +1 -0
  183. package/build/main/pulsar/managers/loaders/memory/PulsarExporterJSONLoader.d.ts +9 -0
  184. package/build/main/pulsar/managers/loaders/memory/PulsarExporterJSONLoader.js +81 -0
  185. package/build/main/pulsar/managers/loaders/memory/PulsarExporterJSONLoader.js.map +1 -0
  186. package/build/main/pulsar/managers/loaders/memory/PulsarExporterMemoryLoader.d.ts +20 -0
  187. package/build/main/pulsar/managers/loaders/memory/PulsarExporterMemoryLoader.js +194 -0
  188. package/build/main/pulsar/managers/loaders/memory/PulsarExporterMemoryLoader.js.map +1 -0
  189. package/build/main/pulsar/managers/loaders/remote/PulsarExporterGitHubLoader.d.ts +12 -0
  190. package/build/main/pulsar/managers/loaders/remote/PulsarExporterGitHubLoader.js +143 -0
  191. package/build/main/pulsar/managers/loaders/remote/PulsarExporterGitHubLoader.js.map +1 -0
  192. package/build/main/pulsar/managers/loaders/remote/PulsarExporterZIPLoader.d.ts +12 -0
  193. package/build/main/pulsar/managers/loaders/remote/PulsarExporterZIPLoader.js +115 -0
  194. package/build/main/pulsar/managers/loaders/remote/PulsarExporterZIPLoader.js.map +1 -0
  195. package/build/main/tests/TestConfiguration.d.ts +9 -0
  196. package/build/main/tests/TestConfiguration.js +25 -0
  197. package/build/main/tests/TestConfiguration.js.map +1 -0
  198. package/build/main/tests/casebuilders/ci.d.ts +12 -0
  199. package/build/main/tests/casebuilders/ci.js +38 -0
  200. package/build/main/tests/casebuilders/ci.js.map +1 -0
  201. package/build/main/tests/casebuilders/configuration.d.ts +5 -0
  202. package/build/main/tests/casebuilders/configuration.js +25 -0
  203. package/build/main/tests/casebuilders/configuration.js.map +1 -0
  204. package/build/main/tests/casebuilders/dsm.d.ts +7 -0
  205. package/build/main/tests/casebuilders/dsm.js +57 -0
  206. package/build/main/tests/casebuilders/dsm.js.map +1 -0
  207. package/build/main/tests/casebuilders/modelObjects.d.ts +13 -0
  208. package/build/main/tests/casebuilders/modelObjects.js +120 -0
  209. package/build/main/tests/casebuilders/modelObjects.js.map +1 -0
  210. package/build/main/tools/Logger.d.ts +27 -0
  211. package/build/main/tools/Logger.js +98 -0
  212. package/build/main/tools/Logger.js.map +1 -0
  213. package/build/main/tools/LoggerDefaultMessages.d.ts +13 -0
  214. package/build/main/tools/LoggerDefaultMessages.js +41 -0
  215. package/build/main/tools/LoggerDefaultMessages.js.map +1 -0
  216. package/build/tsconfig.tsbuildinfo +2829 -0
  217. package/package.json +2 -2
@@ -0,0 +1,19 @@
1
+ import { PLSExportConfiguration } from '../../configuration/ExportConfiguration';
2
+ import { PLSExporterMapBlueprint } from './../../../model/maps/ExporterMapBlueprint';
3
+ import { PLSExportDataRequestDataStore } from './ExportDataRequestDataStore';
4
+ import { PLSExportDataRequestNameStore } from './ExportDataRequestNameStore';
5
+ import { BLZEmittedContent } from '@supernova-studio/pulsar-language';
6
+ export declare class PLSExportDataRequest {
7
+ dataStore: PLSExportDataRequestDataStore | null;
8
+ nameStore: PLSExportDataRequestNameStore | null;
9
+ emittedContent: Array<BLZEmittedContent> | null;
10
+ map: PLSExporterMapBlueprint;
11
+ configuration: PLSExportConfiguration;
12
+ processingError: Error | null;
13
+ processingFinished: boolean;
14
+ constructor(configuration: PLSExportConfiguration, map: PLSExporterMapBlueprint);
15
+ produceData(): Promise<PLSExportDataRequest>;
16
+ requestSuccesfullGeneratingPlainData(plainData: any, nameData: Map<string, any>, emittedContent: Array<BLZEmittedContent>): void;
17
+ requestSuccessfullGeneratingMultipartData(multipartData: Map<string, any>, multipartNameData: Map<string, Map<string, any>>, emittedContent: Array<BLZEmittedContent>): void;
18
+ requestFailed(error: Error): void;
19
+ }
@@ -0,0 +1,55 @@
1
+ "use strict";
2
+ //
3
+ // PLSExportDataRequest.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.PLSExportDataRequest = void 0;
11
+ const ExportDataRequestDataStore_1 = require("./ExportDataRequestDataStore");
12
+ const ExportDataRequestNameStore_1 = require("./ExportDataRequestNameStore");
13
+ // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
14
+ // MARK: - Definitions
15
+ // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
16
+ // MARK: - Object definition
17
+ class PLSExportDataRequest {
18
+ // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
19
+ // MARK: - Init
20
+ constructor(configuration, map) {
21
+ // States
22
+ this.processingError = null;
23
+ this.processingFinished = false;
24
+ this.map = map;
25
+ this.configuration = configuration;
26
+ }
27
+ // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
28
+ // MARK: - Content production
29
+ produceData() {
30
+ throw Error('Content must be produced by each individual subclass');
31
+ }
32
+ // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
33
+ // MARK: - Request handling
34
+ requestSuccesfullGeneratingPlainData(plainData, nameData, emittedContent) {
35
+ this.processingFinished = true;
36
+ this.dataStore = ExportDataRequestDataStore_1.PLSExportDataRequestDataStore.storeWithPlainData(plainData);
37
+ this.nameStore = ExportDataRequestNameStore_1.PLSExportDataRequestNameStore.storeWithPlainData(nameData);
38
+ this.emittedContent = emittedContent;
39
+ // this.responseHandler?(true, this.dataStore, emittedContent, nil)
40
+ }
41
+ requestSuccessfullGeneratingMultipartData(multipartData, multipartNameData, emittedContent) {
42
+ this.processingFinished = true;
43
+ this.dataStore = ExportDataRequestDataStore_1.PLSExportDataRequestDataStore.storeWithMultipartData(multipartData);
44
+ this.nameStore = ExportDataRequestNameStore_1.PLSExportDataRequestNameStore.storeWithMultipartData(multipartNameData);
45
+ this.emittedContent = emittedContent;
46
+ // this.responseHandler?(true, this.dataStore, emittedContent, nil)
47
+ }
48
+ requestFailed(error) {
49
+ this.processingFinished = true;
50
+ this.processingError = error;
51
+ // this.responseHandler?(false, nil, [], error)
52
+ }
53
+ }
54
+ exports.PLSExportDataRequest = PLSExportDataRequest;
55
+ //# sourceMappingURL=ExportDataRequest.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExportDataRequest.js","sourceRoot":"","sources":["../../../../../src/engine/generation/requests/ExportDataRequest.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,2BAA2B;AAC3B,aAAa;AACb,EAAE;AACF,2BAA2B;AAC3B,sDAAsD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G,KAAK,CAAC;QAC7B,+CAA+C;IACjD,CAAC;CACF;AA3ED,oDA2EC"}
@@ -0,0 +1,16 @@
1
+ export declare enum PLSExportDataRequestDataStoreMode {
2
+ plain = 0,
3
+ multipart = 1
4
+ }
5
+ export declare class PLSExportDataRequestDataStore {
6
+ plainDataKey: string;
7
+ dataStore: Map<string, any>;
8
+ mode: PLSExportDataRequestDataStoreMode;
9
+ static storeWithPlainData(data: any): PLSExportDataRequestDataStore;
10
+ static storeWithMultipartData(data: Map<string, any>): PLSExportDataRequestDataStore;
11
+ constructor(mode: PLSExportDataRequestDataStoreMode);
12
+ /** Plain data. Note that if data was created using "multipart" mode, exception will be thrown */
13
+ plainData(): any;
14
+ /** Multipart data. Note that is data was created using "plain" mode, this will still work. Use .plainDataKey property to access the stored data in that case */
15
+ multipartData(): Map<string, any>;
16
+ }
@@ -0,0 +1,57 @@
1
+ "use strict";
2
+ //
3
+ // PLSExportDataRequestDataStore.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.PLSExportDataRequestDataStore = exports.PLSExportDataRequestDataStoreMode = void 0;
11
+ // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
12
+ // MARK: - Imports
13
+ var PLSExportDataRequestDataStoreMode;
14
+ (function (PLSExportDataRequestDataStoreMode) {
15
+ PLSExportDataRequestDataStoreMode[PLSExportDataRequestDataStoreMode["plain"] = 0] = "plain";
16
+ PLSExportDataRequestDataStoreMode[PLSExportDataRequestDataStoreMode["multipart"] = 1] = "multipart";
17
+ })(PLSExportDataRequestDataStoreMode = exports.PLSExportDataRequestDataStoreMode || (exports.PLSExportDataRequestDataStoreMode = {}));
18
+ // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
19
+ // MARK: - Definitions
20
+ // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
21
+ // MARK: - Object definition
22
+ class PLSExportDataRequestDataStore {
23
+ constructor(mode) {
24
+ // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
25
+ // MARK: - Definitions
26
+ this.plainDataKey = '_plain_data';
27
+ this.mode = mode;
28
+ this.dataStore = new Map();
29
+ }
30
+ // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
31
+ // MARK: - Init
32
+ static storeWithPlainData(data) {
33
+ let store = new PLSExportDataRequestDataStore(PLSExportDataRequestDataStoreMode.plain);
34
+ store.dataStore.set(store.plainDataKey, data);
35
+ return store;
36
+ }
37
+ static storeWithMultipartData(data) {
38
+ let store = new PLSExportDataRequestDataStore(PLSExportDataRequestDataStoreMode.multipart);
39
+ store.dataStore = data;
40
+ return store;
41
+ }
42
+ // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
43
+ // MARK: - Data retrieval
44
+ /** Plain data. Note that if data was created using "multipart" mode, exception will be thrown */
45
+ plainData() {
46
+ if (this.mode === PLSExportDataRequestDataStoreMode.multipart) {
47
+ throw Error('Using plain data in multipart store is prohibited');
48
+ }
49
+ return this.dataStore.get(this.plainDataKey);
50
+ }
51
+ /** Multipart data. Note that is data was created using "plain" mode, this will still work. Use .plainDataKey property to access the stored data in that case */
52
+ multipartData() {
53
+ return this.dataStore;
54
+ }
55
+ }
56
+ exports.PLSExportDataRequestDataStore = PLSExportDataRequestDataStore;
57
+ //# sourceMappingURL=ExportDataRequestDataStore.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExportDataRequestDataStore.js","sourceRoot":"","sources":["../../../../../src/engine/generation/requests/ExportDataRequestDataStore.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,oCAAoC;AACpC,aAAa;AACb,EAAE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IAChK,aAAa;QACX,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;CACF;AAtDD,sEAsDC"}
@@ -0,0 +1,22 @@
1
+ export declare enum PLSExportDataRequestNameStoreMode {
2
+ plain = 0,
3
+ multipart = 1,
4
+ resolved = 2
5
+ }
6
+ export declare class PLSExportDataRequestNameStore {
7
+ plainDataKey: string;
8
+ resolvedDataKey: string;
9
+ nameStore: Map<string, Map<string, any>>;
10
+ mode: PLSExportDataRequestNameStoreMode;
11
+ constructor(mode: PLSExportDataRequestNameStoreMode);
12
+ static storeWithResolvedName(name: string): PLSExportDataRequestNameStore;
13
+ static storeWithPlainData(data: Map<string, any>): PLSExportDataRequestNameStore;
14
+ static storeWithMultipartData(data: Map<string, any>): PLSExportDataRequestNameStore;
15
+ plainData(): Map<string, any>;
16
+ multipartData(): Map<string, Map<string, any>>;
17
+ resolvedData(): string;
18
+ checkInCorrectMode(mode: PLSExportDataRequestNameStoreMode): boolean;
19
+ isPlain(): boolean;
20
+ isMultipart(): boolean;
21
+ isResolved(): boolean;
22
+ }
@@ -0,0 +1,86 @@
1
+ "use strict";
2
+ //
3
+ // PLSExportDataRequestNameStore.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.PLSExportDataRequestNameStore = exports.PLSExportDataRequestNameStoreMode = void 0;
11
+ // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
12
+ // MARK: - Imports
13
+ var PLSExportDataRequestNameStoreMode;
14
+ (function (PLSExportDataRequestNameStoreMode) {
15
+ PLSExportDataRequestNameStoreMode[PLSExportDataRequestNameStoreMode["plain"] = 0] = "plain";
16
+ PLSExportDataRequestNameStoreMode[PLSExportDataRequestNameStoreMode["multipart"] = 1] = "multipart";
17
+ PLSExportDataRequestNameStoreMode[PLSExportDataRequestNameStoreMode["resolved"] = 2] = "resolved";
18
+ })(PLSExportDataRequestNameStoreMode = exports.PLSExportDataRequestNameStoreMode || (exports.PLSExportDataRequestNameStoreMode = {}));
19
+ // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
20
+ // MARK: - Definitions
21
+ // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
22
+ // MARK: - Object definition
23
+ class PLSExportDataRequestNameStore {
24
+ // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
25
+ // MARK: - Init
26
+ constructor(mode) {
27
+ // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
28
+ // MARK: - Definitions
29
+ this.plainDataKey = '_plain_data';
30
+ this.resolvedDataKey = '_resolved_name';
31
+ this.mode = mode;
32
+ this.nameStore = new Map();
33
+ }
34
+ static storeWithResolvedName(name) {
35
+ let store = new PLSExportDataRequestNameStore(PLSExportDataRequestNameStoreMode.resolved);
36
+ let data = new Map();
37
+ data.set(store.plainDataKey, name);
38
+ store.nameStore.set(store.resolvedDataKey, data);
39
+ return store;
40
+ }
41
+ static storeWithPlainData(data) {
42
+ let store = new PLSExportDataRequestNameStore(PLSExportDataRequestNameStoreMode.plain);
43
+ store.nameStore.set(store.plainDataKey, data);
44
+ return store;
45
+ }
46
+ static storeWithMultipartData(data) {
47
+ let store = new PLSExportDataRequestNameStore(PLSExportDataRequestNameStoreMode.multipart);
48
+ store.nameStore = data;
49
+ return store;
50
+ }
51
+ // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
52
+ // MARK: - Data retrieval
53
+ /// Plain data. Note that if data was created using "multipart" mode, exception will be thrown
54
+ plainData() {
55
+ this.checkInCorrectMode(PLSExportDataRequestNameStoreMode.plain);
56
+ return this.nameStore.get(this.plainDataKey);
57
+ }
58
+ /// Multipart data. Note that is data was created using "plain" mode, this will still work. Use .plainDataKey property to
59
+ multipartData() {
60
+ this.checkInCorrectMode(PLSExportDataRequestNameStoreMode.multipart);
61
+ return this.nameStore;
62
+ }
63
+ /// Resolved name. This is only available for mode "resolved" and signifies that store shouldn't be used for partial resolution but instead provides fully resolved data
64
+ resolvedData() {
65
+ this.checkInCorrectMode(PLSExportDataRequestNameStoreMode.resolved);
66
+ let resolvedStore = this.nameStore.get(this.resolvedDataKey);
67
+ return resolvedStore.get(this.plainDataKey);
68
+ }
69
+ checkInCorrectMode(mode) {
70
+ if (this.mode !== mode) {
71
+ throw Error(`Using data mode ${mode} is prohibited in store that was created as ${this.mode}`);
72
+ }
73
+ return true;
74
+ }
75
+ isPlain() {
76
+ return this.mode === PLSExportDataRequestNameStoreMode.plain;
77
+ }
78
+ isMultipart() {
79
+ return this.mode === PLSExportDataRequestNameStoreMode.multipart;
80
+ }
81
+ isResolved() {
82
+ return this.mode === PLSExportDataRequestNameStoreMode.resolved;
83
+ }
84
+ }
85
+ exports.PLSExportDataRequestNameStore = PLSExportDataRequestNameStore;
86
+ //# sourceMappingURL=ExportDataRequestNameStore.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExportDataRequestNameStore.js","sourceRoot":"","sources":["../../../../../src/engine/generation/requests/ExportDataRequestNameStore.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,oCAAoC;AACpC,aAAa;AACb,EAAE;AACF,2BAA2B;AAC3B,sDAAsD;AACtD,EAAE;;;AAEF,8GAA8G;AAC9G,kBAAkB;AAElB,IAAY,iCAIX;AAJD,WAAY,iCAAiC;IAC3C,2FAAK,CAAA;IACL,mGAAS,CAAA;IACT,iGAAQ,CAAA;AACV,CAAC,EAJW,iCAAiC,GAAjC,yCAAiC,KAAjC,yCAAiC,QAI5C;AAED,8GAA8G;AAC9G,sBAAsB;AAEtB,8GAA8G;AAC9G,4BAA4B;AAE5B,MAAa,6BAA6B;IAcxC,8GAA8G;I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AC/C,CAAC;IAED,yHAAyH;IACzH,aAAa;QACX,IAAI,CAAC,kBAAkB,CAAC,iCAAiC,CAAC,SAAS,CAAC,CAAC;QACrE,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;IAED,wKAAwK;IACxK,YAAY;QACV,IAAI,CAAC,kBAAkB,CAAC,iCAAiC,CAAC,QAAQ,CAAC,CAAC;QACpE,IAAI,aAAa,GAAG,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;QAC7D,OAAO,aAAa,CAAC,GAAG,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;IAC9C,CAAC;IAED,kBAAkB,CAAC,IAAuC;QACxD,IAAI,IAAI,CAAC,IAAI,KAAK,IAAI,EAAE;YACtB,MAAM,KAAK,CACT,mBAAmB,IAAI,+CAA+C,IAAI,CAAC,IAAI,EAAE,CAClF,CAAC;SACH;QAED,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO;QACL,OAAO,IAAI,CAAC,IAAI,KAAK,iCAAiC,CAAC,KAAK,CAAC;IAC/D,CAAC;IAED,WAAW;QACT,OAAO,IAAI,CAAC,IAAI,KAAK,iCAAiC,CAAC,SAAS,CAAC;IACnE,CAAC;IAED,UAAU;QACR,OAAO,IAAI,CAAC,IAAI,KAAK,iCAAiC,CAAC,QAAQ,CAAC;IAClE,CAAC;CACF;AAlGD,sEAkGC"}
@@ -0,0 +1,16 @@
1
+ import { PLSExportConfiguration } from '../../configuration/ExportConfiguration';
2
+ import { PLSExportDataRequest } from './ExportDataRequest';
3
+ import { PLSExporterSource } from '../../../model/sources/ExporterSource';
4
+ import { PLSExporterMapBlueprint } from '../../../model/maps/ExporterMapBlueprint';
5
+ export declare class PLSExportDataRequestProducer {
6
+ configuration: PLSExportConfiguration;
7
+ constructor(exportConfiguration: PLSExportConfiguration);
8
+ produceRequestsForMap(map: PLSExporterMapBlueprint): Array<PLSExportDataRequest>;
9
+ createExporterEntryDSMDataRequest(source: PLSExporterSource, map: PLSExporterMapBlueprint): Array<PLSExportDataRequest>;
10
+ createExporterEntryRequestsForDSMGenericOption(source: PLSExporterSource, map: PLSExporterMapBlueprint): Array<PLSExportDataRequest>;
11
+ createExporterEntryRequestsForDSMComponentOption(source: PLSExporterSource, map: PLSExporterMapBlueprint): Array<PLSExportDataRequest>;
12
+ createExporterEntryRequestsForDSMComponentGroupOption(source: PLSExporterSource, map: PLSExporterMapBlueprint): Array<PLSExportDataRequest>;
13
+ createExporterEntryRequestsForDSMTokenGroupOption(source: PLSExporterSource, map: PLSExporterMapBlueprint): Array<PLSExportDataRequest>;
14
+ createExporterEntryRequestsForDSMThemeOption(source: PLSExporterSource, map: PLSExporterMapBlueprint): Array<PLSExportDataRequest>;
15
+ createExporterEntryRequestsForDSMTokenTypeOption(source: PLSExporterSource, map: PLSExporterMapBlueprint): Array<PLSExportDataRequest>;
16
+ }
@@ -0,0 +1,162 @@
1
+ "use strict";
2
+ //
3
+ // ExportDataRequestProducer.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.PLSExportDataRequestProducer = void 0;
11
+ const ExporterSource_1 = require("../../../model/sources/ExporterSource");
12
+ const ExportDataRequestDSMComponent_1 = require("./specific/dsm/ExportDataRequestDSMComponent");
13
+ const ExportDataRequestDSMGeneric_1 = require("./specific/dsm/ExportDataRequestDSMGeneric");
14
+ const ExporterSource_2 = require("../../../model/sources/ExporterSource");
15
+ const ExportDataRequestDSMTheme_1 = require("./specific/dsm/ExportDataRequestDSMTheme");
16
+ const ExportDataRequestDSMTokenGroup_1 = require("./specific/dsm/ExportDataRequestDSMTokenGroup");
17
+ const ExportDataRequestDSMComponentGroup_1 = require("./specific/dsm/ExportDataRequestDSMComponentGroup");
18
+ const ExportDataRequestDSMTokenType_1 = require("./specific/dsm/ExportDataRequestDSMTokenType");
19
+ // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
20
+ // MARK: - Definitions
21
+ // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
22
+ // MARK: - Object definition
23
+ class PLSExportDataRequestProducer {
24
+ // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
25
+ // MARK: - Init
26
+ constructor(exportConfiguration) {
27
+ this.configuration = exportConfiguration;
28
+ }
29
+ // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
30
+ // MARK: - Request creation
31
+ produceRequestsForMap(map) {
32
+ var _a;
33
+ let entry = map;
34
+ let referencedSource = undefined;
35
+ if (entry.write_to) {
36
+ // Inline path defined inside output, so we create temporary source to process it the same as through script
37
+ referencedSource = new ExporterSource_2.PLSExporterSource('map_source', null, entry.write_to);
38
+ }
39
+ else if (entry.write_using) {
40
+ // Invoking script instead
41
+ let definedSource = this.configuration.exporter.sourceById(entry.write_using);
42
+ if (!definedSource) {
43
+ // throw SCPulsarExportDataProducerError.blueprintNotFound(entry.blueprintId ?? "")
44
+ throw Error(`Source ${(_a = entry.write_using) !== null && _a !== void 0 ? _a : ''} defined inside output not found`);
45
+ }
46
+ referencedSource = definedSource;
47
+ }
48
+ else {
49
+ throw Error(`Output doesn't define correct 'write_to' or 'write_using' key`);
50
+ }
51
+ switch (referencedSource.context) {
52
+ case ExporterSource_1.PLSExporterSourceContextType.generic:
53
+ case ExporterSource_1.PLSExporterSourceContextType.component:
54
+ case ExporterSource_1.PLSExporterSourceContextType.componentGroup:
55
+ case ExporterSource_1.PLSExporterSourceContextType.tokenType:
56
+ case ExporterSource_1.PLSExporterSourceContextType.tokenGroup:
57
+ case ExporterSource_1.PLSExporterSourceContextType.theme:
58
+ return this.createExporterEntryDSMDataRequest(referencedSource, entry);
59
+ default:
60
+ return [];
61
+ }
62
+ }
63
+ // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
64
+ // MARK: - Request creation - Supernova loader
65
+ createExporterEntryDSMDataRequest(source, map) {
66
+ switch (source.context) {
67
+ case ExporterSource_1.PLSExporterSourceContextType.generic:
68
+ return this.createExporterEntryRequestsForDSMGenericOption(source, map);
69
+ case ExporterSource_1.PLSExporterSourceContextType.component:
70
+ return this.createExporterEntryRequestsForDSMComponentOption(source, map);
71
+ case ExporterSource_1.PLSExporterSourceContextType.componentGroup:
72
+ return this.createExporterEntryRequestsForDSMComponentGroupOption(source, map);
73
+ case ExporterSource_1.PLSExporterSourceContextType.tokenGroup:
74
+ return this.createExporterEntryRequestsForDSMTokenGroupOption(source, map);
75
+ case ExporterSource_1.PLSExporterSourceContextType.tokenType:
76
+ return this.createExporterEntryRequestsForDSMTokenTypeOption(source, map);
77
+ case ExporterSource_1.PLSExporterSourceContextType.theme:
78
+ return this.createExporterEntryRequestsForDSMThemeOption(source, map);
79
+ default:
80
+ return [];
81
+ }
82
+ }
83
+ createExporterEntryRequestsForDSMGenericOption(source, map) {
84
+ // Create new dsm-enabled execution context
85
+ let executionContext = this.configuration.newExecutionContext(); // TODO: Modify to accept DSM configuration
86
+ // Create request
87
+ let request = new ExportDataRequestDSMGeneric_1.PLSExportDataRequestDSMGeneric(source, map, this.configuration, executionContext);
88
+ return [request];
89
+ }
90
+ createExporterEntryRequestsForDSMComponentOption(source, map) {
91
+ // Get configuration
92
+ let requests = [];
93
+ let components = this.configuration.dsmStore.executableComponents();
94
+ // Generate N requests per number of components in the current dsm context from the store
95
+ for (let component of components) {
96
+ // Create execution context
97
+ let executionContext = this.configuration.newExecutionContext();
98
+ // Create request for specific component
99
+ let request = new ExportDataRequestDSMComponent_1.PLSExportDataRequestDSMComponent(component, source, map, this.configuration, executionContext);
100
+ requests.push(request);
101
+ }
102
+ return requests;
103
+ }
104
+ createExporterEntryRequestsForDSMComponentGroupOption(source, map) {
105
+ // Get configuration
106
+ let requests = [];
107
+ let components = this.configuration.dsmStore.executableComponentGroups();
108
+ // Generate N requests per number of components in the current dsm context from the store
109
+ for (let component of components) {
110
+ // Create execution context
111
+ let executionContext = this.configuration.newExecutionContext();
112
+ // Create request for specific component
113
+ let request = new ExportDataRequestDSMComponentGroup_1.PLSExportDataRequestDSMComponentGroup(component, source, map, this.configuration, executionContext);
114
+ requests.push(request);
115
+ }
116
+ return requests;
117
+ }
118
+ createExporterEntryRequestsForDSMTokenGroupOption(source, map) {
119
+ // Get configuration
120
+ let requests = [];
121
+ let tokenGroups = this.configuration.dsmStore.executableTokenGroups();
122
+ // Generate N requests per number of components in the current dsm context from the store
123
+ for (let tokenGroup of tokenGroups) {
124
+ // Create execution context
125
+ let executionContext = this.configuration.newExecutionContext();
126
+ // Create request for specific component
127
+ let request = new ExportDataRequestDSMTokenGroup_1.PLSExportDataRequestDSMTokenGroup(tokenGroup, source, map, this.configuration, executionContext);
128
+ requests.push(request);
129
+ }
130
+ return requests;
131
+ }
132
+ createExporterEntryRequestsForDSMThemeOption(source, map) {
133
+ // Get configuration
134
+ let requests = [];
135
+ let themes = this.configuration.dsmStore.executableThemes();
136
+ // Generate N requests per number of components in the current dsm context from the store
137
+ for (let theme of themes) {
138
+ // Create execution context
139
+ let executionContext = this.configuration.newExecutionContext();
140
+ // Create request for specific component
141
+ let request = new ExportDataRequestDSMTheme_1.PLSExportDataRequestDSMTheme(theme, source, map, this.configuration, executionContext);
142
+ requests.push(request);
143
+ }
144
+ return requests;
145
+ }
146
+ createExporterEntryRequestsForDSMTokenTypeOption(source, map) {
147
+ // Get configuration
148
+ let requests = [];
149
+ let tokenTypes = this.configuration.dsmStore.executableTokenTypes();
150
+ // Generate N requests per number of components in the current dsm context from the store
151
+ for (let tokenType of tokenTypes) {
152
+ // Create execution context
153
+ let executionContext = this.configuration.newExecutionContext();
154
+ // Create request for specific component
155
+ let request = new ExportDataRequestDSMTokenType_1.PLSExportDataRequestDSMTokenType(tokenType, source, map, this.configuration, executionContext);
156
+ requests.push(request);
157
+ }
158
+ return requests;
159
+ }
160
+ }
161
+ exports.PLSExportDataRequestProducer = PLSExportDataRequestProducer;
162
+ //# sourceMappingURL=ExportDataRequestProducer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExportDataRequestProducer.js","sourceRoot":"","sources":["../../../../../src/engine/generation/requests/ExportDataRequestProducer.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,gCAAgC;AAChC,aAAa;AACb,EAAE;AACF,2BAA2B;AAC3B,sDAAsD;AACtD,EAAE;;;AAOF,0EAAqF;AACrF,gGAAgG;AAChG,4FAA4F;AAC5F,0EAA0E;AAC1E,wFAAwF;AACxF,kGAAkG;AAClG,0GAA0G;AAC1G,gGAAgG;AAGhG,8GAA8G;AAC9G,sBAAsB;AAEtB,8GAA8G;AAC9G,4BAA4B;AAE5B,MAAa,4BAA4B;IAMvC,8GAA8G;IAC9G,eAAe;IAEf,YAAY,mBAA2C;QACrD,IAAI,CAAC,aAAa,GAAG,mBAAmB,CAAC;IAC3C,CAAC;IAED,8GAA8G;IAC9G,2BAA2B;IAE3B,qBAAqB,CACnB,GAA4B;;QAE5B,IAAI,KAAK,GAAG,GAA8B,CAAC;QAC3C,IAAI,gBAAgB,GAAsB,SAAS,CAAC;QAEpD,IAAI,KAAK,CAAC,QAAQ,EAAE;YAClB,4GAA4G;YAC5G,gBAAgB,GAAG,IAAI,kCAAiB,CACtC,YAAY,EACZ,IAAI,EACJ,KAAK,CAAC,QAAQ,CACf,CAAC;SACH;aAAM,IAAI,KAAK,CAAC,WAAW,EAAE;YAC5B,0BAA0B;YAC1B,IAAI,aAAa,GAAG,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,UAAU,CACxD,KAAK,CAAC,WAAW,CAClB,CAAC;YACF,IAAI,CAAC,aAAa,EAAE;gBAClB,mFAAmF;gBACnF,MAAM,KAAK,CACT,UAAU,MAAA,KAAK,CAAC,WAAW,mCAAI,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jB,CAAC;YACF,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;SACxB;QAED,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED,gDAAgD,CAC9C,MAAyB,EACzB,GAA4B;QAE5B,oBAAoB;QACpB,IAAI,QAAQ,GAA4C,EAAE,CAAC;QAC3D,IAAI,UAAU,GAAG,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,oBAAoB,EAAE,CAAC;QAEpE,yFAAyF;QACzF,KAAK,IAAI,SAAS,IAAI,UAAU,EAAE;YAChC,2BAA2B;YAC3B,IAAI,gBAAgB,GAAG,IAAI,CAAC,aAAa,CAAC,mBAAmB,EAAE,CAAC;YAEhE,wCAAwC;YACxC,IAAI,OAAO,GAAG,IAAI,gEAAgC,CAChD,SAAS,EACT,MAAM,EACN,GAAG,EACH,IAAI,CAAC,aAAa,EAClB,gBAAgB,CACjB,CAAC;YACF,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;SACxB;QAED,OAAO,QAAQ,CAAC;IAClB,CAAC;CACF;AAxPD,oEAwPC"}
@@ -0,0 +1,13 @@
1
+ import { PLSExportDataRequest } from './ExportDataRequest';
2
+ import { PLSExporterMapBlueprint } from './../../../model/maps/ExporterMapBlueprint';
3
+ import { PLSExportDataRequestDataStore } from './ExportDataRequestDataStore';
4
+ import { PLSExportDataRequestNameStore } from './ExportDataRequestNameStore';
5
+ import { BLZEmittedContent } from '@supernova-studio/pulsar-language';
6
+ export declare class PLSExportDataResponse {
7
+ dataStore: PLSExportDataRequestDataStore;
8
+ nameStore: PLSExportDataRequestNameStore;
9
+ emittedContent: Array<BLZEmittedContent>;
10
+ map: PLSExporterMapBlueprint;
11
+ request: PLSExportDataRequest;
12
+ constructor(request: PLSExportDataRequest, map: PLSExporterMapBlueprint, dataStore: PLSExportDataRequestDataStore, nameStore: PLSExportDataRequestNameStore, emittedContent: Array<BLZEmittedContent>);
13
+ }
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ //
3
+ // PLSExportDataResponse.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.PLSExportDataResponse = void 0;
11
+ // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
12
+ // MARK: - Definitions
13
+ // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
14
+ // MARK: - Object definition
15
+ class PLSExportDataResponse {
16
+ // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
17
+ // MARK: - Init
18
+ constructor(request, map, dataStore, nameStore, emittedContent) {
19
+ // Request
20
+ this.request = request;
21
+ // Data stores
22
+ this.dataStore = dataStore;
23
+ this.nameStore = nameStore;
24
+ this.emittedContent = emittedContent;
25
+ // Store entry
26
+ this.map = map;
27
+ }
28
+ }
29
+ exports.PLSExportDataResponse = PLSExportDataResponse;
30
+ //# sourceMappingURL=ExportDataResponse.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExportDataResponse.js","sourceRoot":"","sources":["../../../../../src/engine/generation/requests/ExportDataResponse.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,4BAA4B;AAC5B,aAAa;AACb,EAAE;AACF,2BAA2B;AAC3B,sDAAsD;AACtD,EAAE;;;AAWF,8GAA8G;AAC9G,sBAAsB;AAEtB,8GAA8G;AAC9G,4BAA4B;AAE5B,MAAa,qBAAqB;IAahC,8GAA8G;IAC9G,eAAe;IAEf,YACE,OAA6B,EAC7B,GAA4B,EAC5B,SAAwC,EACxC,SAAwC,EACxC,cAAwC;QAExC,UAAU;QACV,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QAEvB,cAAc;QACd,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,cAAc,GAAG,cAAc,CAAC;QAErC,cAAc;QACd,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;IACjB,CAAC;CACF;AAlCD,sDAkCC"}
@@ -0,0 +1,14 @@
1
+ import { PLSExportDataRequest } from '../../ExportDataRequest';
2
+ import { PLSExportConfiguration } from '../../../../configuration/ExportConfiguration';
3
+ import { PLSExporterSource } from '../../../../../model/sources/ExporterSource';
4
+ import { BLZExecutionContext, BLZEmittedContent } from '@supernova-studio/pulsar-language';
5
+ import { PLSExporterMapBlueprint } from '../../../../../model/maps/ExporterMapBlueprint';
6
+ export declare class PLSExportDataRequestBlueprint extends PLSExportDataRequest {
7
+ executionContext: BLZExecutionContext;
8
+ constructor(configuration: PLSExportConfiguration, map: PLSExporterMapBlueprint, executionContext: BLZExecutionContext);
9
+ processBlueprintData(source: PLSExporterSource, context: Map<string, any>, name: string | null): Promise<{
10
+ data: any;
11
+ emittedContext: Array<BLZEmittedContent>;
12
+ }>;
13
+ logBlueprintProcessingFailure(error: Error, source: PLSExporterSource, name: string | null): void;
14
+ }
@@ -0,0 +1,77 @@
1
+ "use strict";
2
+ //
3
+ // PLSExportDataRequestBlueprint.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.PLSExportDataRequestBlueprint = void 0;
11
+ // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
12
+ // MARK: - Imports
13
+ const ExportDataRequest_1 = require("../../ExportDataRequest");
14
+ const pulsar_language_1 = require("@supernova-studio/pulsar-language");
15
+ const pulsar_language_2 = require("@supernova-studio/pulsar-language");
16
+ const pulsar_language_3 = require("@supernova-studio/pulsar-language");
17
+ // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
18
+ // MARK: - Definitions
19
+ // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
20
+ // MARK: - Object definition
21
+ class PLSExportDataRequestBlueprint extends ExportDataRequest_1.PLSExportDataRequest {
22
+ // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
23
+ // MARK: - Init
24
+ constructor(configuration, map, executionContext) {
25
+ super(configuration, map);
26
+ this.executionContext = executionContext;
27
+ }
28
+ // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
29
+ // MARK: - Blueprint processing
30
+ processBlueprintData(source, context, name) {
31
+ return new Promise(async (resolve, reject) => {
32
+ try {
33
+ if (name) {
34
+ this.configuration.logger.logInfo(`Exporting source ${source.id} for ${name}`, '');
35
+ }
36
+ else {
37
+ this.configuration.logger.logInfo(`Exporting source ${source.id}`, '');
38
+ }
39
+ // Create Blazar source from definition
40
+ let definitionBlueprint = pulsar_language_1.BLZBlueprintFactory.blueprint(source.content, source.id, this.executionContext);
41
+ // Render source
42
+ let interpretingContext = new pulsar_language_2.BLZInterpreterContext(context);
43
+ let interpreter = new pulsar_language_3.BLZInterpreter();
44
+ let result = await interpreter.interpret(definitionBlueprint, interpretingContext, this.executionContext);
45
+ // Get emitted content
46
+ let emittedContent = this.executionContext
47
+ .blueprintEmitter.allEmittedContent();
48
+ if (name) {
49
+ this.configuration.logger.logInfo(`Finished exporting source ${source.id} for ${name}`, '');
50
+ }
51
+ else {
52
+ this.configuration.logger.logInfo(`Finished exporting source ${source.id}`, '');
53
+ }
54
+ resolve({
55
+ data: result,
56
+ emittedContext: emittedContent
57
+ });
58
+ }
59
+ catch (error) {
60
+ this.logBlueprintProcessingFailure(error, source, name);
61
+ reject(error);
62
+ }
63
+ });
64
+ }
65
+ logBlueprintProcessingFailure(error, source, name) {
66
+ let reason = error.message;
67
+ if (name) {
68
+ this.configuration.logger.logError(`Export of source ${source.id} for ${name} failed`, '');
69
+ }
70
+ else {
71
+ this.configuration.logger.logError(`Export of source ${source.id} failed`, '');
72
+ }
73
+ this.configuration.logger.logError(`Reason: ${reason}`, '');
74
+ }
75
+ }
76
+ exports.PLSExportDataRequestBlueprint = PLSExportDataRequestBlueprint;
77
+ //# sourceMappingURL=ExportDataRequestBlueprint.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExportDataRequestBlueprint.js","sourceRoot":"","sources":["../../../../../../../src/engine/generation/requests/specific/dsm/ExportDataRequestBlueprint.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,oCAAoC;AACpC,aAAa;AACb,EAAE;AACF,2BAA2B;AAC3B,sDAAsD;AACtD,EAAE;;;AAEF,8GAA8G;AAC9G,kBAAkB;AAElB,+DAA+D;AAQ/D,uEAAwE;AACxE,uEAA0E;AAC1E,uEAAmE;AAInE,8GAA8G;AAC9G,sBAAsB;AAEtB,8GAA8G;AAC9G,4BAA4B;AAE5B,MAAa,6BAA8B,SAAQ,wCAAoB;IAMrE,8GAA8G;IAC9G,eAAe;IAEf,YACE,aAAqC,EACrC,GAA4B,EAC5B,gBAAqC;QAErC,KAAK,CAAC,aAAa,EAAE,GAAG,CAAC,CAAC;QAC1B,IAAI,CAAC,gBAAgB,GAAG,gBAAgB,CAAC;IAC3C,CAAC;IAED,8GAA8G;IAC9G,+BAA+B;IAE/B,oBAAoB,CAClB,MAAyB,EACzB,OAAyB,EACzB,IAAmB;QAEnB,OAAO,IAAI,OAAO,CAAC,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE;YAC3C,IAAI;gBACF,IAAI,IAAI,EAAE;oBACR,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,OAAO,CAC/B,oBAAoB,MAAM,CAAC,EAAE,QAAQ,IAAI,EAAE,EAC3C,EAAE,CACH,CAAC;iBACH;qBAAM;oBACL,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,OAAO,CAC/B,oBAAoB,MAAM,CAAC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AAC,aAAa,CAAC,MAAM,CAAC,QAAQ,CAChC,oBAAoB,MAAM,CAAC,EAAE,QAAQ,IAAI,SAAS,EAClD,EAAE,CACH,CAAC;SACH;aAAM;YACL,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,QAAQ,CAChC,oBAAoB,MAAM,CAAC,EAAE,SAAS,EACtC,EAAE,CACH,CAAC;SACH;QAED,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,QAAQ,CAAC,WAAW,MAAM,EAAE,EAAE,EAAE,CAAC,CAAC;IAC9D,CAAC;CACF;AAxGD,sEAwGC"}
@@ -0,0 +1,13 @@
1
+ import { PLSExportDataRequestBlueprint } from './ExportDataRequestBlueprint';
2
+ import { PLSExporterSource } from '../../../../../model/sources/ExporterSource';
3
+ import { PLSExportConfiguration } from '../../../../configuration/ExportConfiguration';
4
+ import { PLSExporterMapBlueprint } from './../../../../../model/maps/ExporterMapBlueprint';
5
+ import { PLSExportDataRequest } from '../../ExportDataRequest';
6
+ import { BLZExecutionContext } from '@supernova-studio/pulsar-language';
7
+ import { DSMReferenceStoreEntry } from './../../../../../model/dsm/DSMReferenceStore';
8
+ export declare class PLSExportDataRequestDSMComponent extends PLSExportDataRequestBlueprint {
9
+ source: PLSExporterSource;
10
+ entry: DSMReferenceStoreEntry;
11
+ constructor(entry: DSMReferenceStoreEntry, source: PLSExporterSource, map: PLSExporterMapBlueprint, configuration: PLSExportConfiguration, executionContext: BLZExecutionContext);
12
+ produceData(): Promise<PLSExportDataRequest>;
13
+ }