@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.
- package/build/browser/pulsar.js +141741 -0
- package/build/browser/pulsar.min.js +270 -0
- package/build/main/browser-bundle.d.ts +1 -0
- package/build/main/browser-bundle.js +17 -0
- package/build/main/browser-bundle.js.map +1 -0
- package/build/main/engine/ExportEngine.d.ts +17 -0
- package/build/main/engine/ExportEngine.js +122 -0
- package/build/main/engine/ExportEngine.js.map +1 -0
- package/build/main/engine/configuration/ExportConfiguration.d.ts +18 -0
- package/build/main/engine/configuration/ExportConfiguration.js +47 -0
- package/build/main/engine/configuration/ExportConfiguration.js.map +1 -0
- package/build/main/engine/generation/ExportDataProducer.d.ts +15 -0
- package/build/main/engine/generation/ExportDataProducer.js +100 -0
- package/build/main/engine/generation/ExportDataProducer.js.map +1 -0
- package/build/main/engine/generation/queue/ExportDataQueue.d.ts +16 -0
- package/build/main/engine/generation/queue/ExportDataQueue.js +72 -0
- package/build/main/engine/generation/queue/ExportDataQueue.js.map +1 -0
- package/build/main/engine/generation/queue/ExportDataQueueOperation.d.ts +6 -0
- package/build/main/engine/generation/queue/ExportDataQueueOperation.js +36 -0
- package/build/main/engine/generation/queue/ExportDataQueueOperation.js.map +1 -0
- package/build/main/engine/generation/requests/ExportDataEmittedResponseProducer.d.ts +7 -0
- package/build/main/engine/generation/requests/ExportDataEmittedResponseProducer.js +54 -0
- package/build/main/engine/generation/requests/ExportDataEmittedResponseProducer.js.map +1 -0
- package/build/main/engine/generation/requests/ExportDataPrimaryResponseProducer.d.ts +7 -0
- package/build/main/engine/generation/requests/ExportDataPrimaryResponseProducer.js +40 -0
- package/build/main/engine/generation/requests/ExportDataPrimaryResponseProducer.js.map +1 -0
- package/build/main/engine/generation/requests/ExportDataRequest.d.ts +19 -0
- package/build/main/engine/generation/requests/ExportDataRequest.js +55 -0
- package/build/main/engine/generation/requests/ExportDataRequest.js.map +1 -0
- package/build/main/engine/generation/requests/ExportDataRequestDataStore.d.ts +16 -0
- package/build/main/engine/generation/requests/ExportDataRequestDataStore.js +57 -0
- package/build/main/engine/generation/requests/ExportDataRequestDataStore.js.map +1 -0
- package/build/main/engine/generation/requests/ExportDataRequestNameStore.d.ts +22 -0
- package/build/main/engine/generation/requests/ExportDataRequestNameStore.js +86 -0
- package/build/main/engine/generation/requests/ExportDataRequestNameStore.js.map +1 -0
- package/build/main/engine/generation/requests/ExportDataRequestProducer.d.ts +16 -0
- package/build/main/engine/generation/requests/ExportDataRequestProducer.js +162 -0
- package/build/main/engine/generation/requests/ExportDataRequestProducer.js.map +1 -0
- package/build/main/engine/generation/requests/ExportDataResponse.d.ts +13 -0
- package/build/main/engine/generation/requests/ExportDataResponse.js +30 -0
- package/build/main/engine/generation/requests/ExportDataResponse.js.map +1 -0
- package/build/main/engine/generation/requests/specific/dsm/ExportDataRequestBlueprint.d.ts +14 -0
- package/build/main/engine/generation/requests/specific/dsm/ExportDataRequestBlueprint.js +77 -0
- package/build/main/engine/generation/requests/specific/dsm/ExportDataRequestBlueprint.js.map +1 -0
- package/build/main/engine/generation/requests/specific/dsm/ExportDataRequestDSMComponent.d.ts +13 -0
- package/build/main/engine/generation/requests/specific/dsm/ExportDataRequestDSMComponent.js +47 -0
- package/build/main/engine/generation/requests/specific/dsm/ExportDataRequestDSMComponent.js.map +1 -0
- package/build/main/engine/generation/requests/specific/dsm/ExportDataRequestDSMComponentGroup.d.ts +13 -0
- package/build/main/engine/generation/requests/specific/dsm/ExportDataRequestDSMComponentGroup.js +47 -0
- package/build/main/engine/generation/requests/specific/dsm/ExportDataRequestDSMComponentGroup.js.map +1 -0
- package/build/main/engine/generation/requests/specific/dsm/ExportDataRequestDSMGeneric.d.ts +11 -0
- package/build/main/engine/generation/requests/specific/dsm/ExportDataRequestDSMGeneric.js +43 -0
- package/build/main/engine/generation/requests/specific/dsm/ExportDataRequestDSMGeneric.js.map +1 -0
- package/build/main/engine/generation/requests/specific/dsm/ExportDataRequestDSMTheme.d.ts +13 -0
- package/build/main/engine/generation/requests/specific/dsm/ExportDataRequestDSMTheme.js +47 -0
- package/build/main/engine/generation/requests/specific/dsm/ExportDataRequestDSMTheme.js.map +1 -0
- package/build/main/engine/generation/requests/specific/dsm/ExportDataRequestDSMTokenGroup.d.ts +13 -0
- package/build/main/engine/generation/requests/specific/dsm/ExportDataRequestDSMTokenGroup.js +47 -0
- package/build/main/engine/generation/requests/specific/dsm/ExportDataRequestDSMTokenGroup.js.map +1 -0
- package/build/main/engine/generation/requests/specific/dsm/ExportDataRequestDSMTokenType.d.ts +13 -0
- package/build/main/engine/generation/requests/specific/dsm/ExportDataRequestDSMTokenType.js +47 -0
- package/build/main/engine/generation/requests/specific/dsm/ExportDataRequestDSMTokenType.js.map +1 -0
- package/build/main/engine/items/ExportItemProducer.d.ts +14 -0
- package/build/main/engine/items/ExportItemProducer.js +70 -0
- package/build/main/engine/items/ExportItemProducer.js.map +1 -0
- package/build/main/engine/items/construction/ExportItem.d.ts +8 -0
- package/build/main/engine/items/construction/ExportItem.js +25 -0
- package/build/main/engine/items/construction/ExportItem.js.map +1 -0
- package/build/main/engine/items/construction/ExportItemBuilder.d.ts +9 -0
- package/build/main/engine/items/construction/ExportItemBuilder.js +47 -0
- package/build/main/engine/items/construction/ExportItemBuilder.js.map +1 -0
- package/build/main/engine/items/queue/ExportItemQueue.d.ts +16 -0
- package/build/main/engine/items/queue/ExportItemQueue.js +70 -0
- package/build/main/engine/items/queue/ExportItemQueue.js.map +1 -0
- package/build/main/engine/items/queue/ExportItemQueueOperation.d.ts +6 -0
- package/build/main/engine/items/queue/ExportItemQueueOperation.js +36 -0
- package/build/main/engine/items/queue/ExportItemQueueOperation.js.map +1 -0
- package/build/main/engine/items/requests/ExportItemRequest.d.ts +16 -0
- package/build/main/engine/items/requests/ExportItemRequest.js +68 -0
- package/build/main/engine/items/requests/ExportItemRequest.js.map +1 -0
- package/build/main/engine/items/requests/ExportItemRequestProducer.d.ts +8 -0
- package/build/main/engine/items/requests/ExportItemRequestProducer.js +24 -0
- package/build/main/engine/items/requests/ExportItemRequestProducer.js.map +1 -0
- package/build/main/engine/items/requests/ExportItemResponse.d.ts +9 -0
- package/build/main/engine/items/requests/ExportItemResponse.js +25 -0
- package/build/main/engine/items/requests/ExportItemResponse.js.map +1 -0
- package/build/main/engine/items/requests/ExportItemResponseProducer.d.ts +7 -0
- package/build/main/engine/items/requests/ExportItemResponseProducer.js +45 -0
- package/build/main/engine/items/requests/ExportItemResponseProducer.js.map +1 -0
- package/build/main/engine/loaders/BlueprintLoader.d.ts +9 -0
- package/build/main/engine/loaders/BlueprintLoader.js +55 -0
- package/build/main/engine/loaders/BlueprintLoader.js.map +1 -0
- package/build/main/engine/writing/queue/ExportWriterQueue.d.ts +16 -0
- package/build/main/engine/writing/queue/ExportWriterQueue.js +70 -0
- package/build/main/engine/writing/queue/ExportWriterQueue.js.map +1 -0
- package/build/main/engine/writing/queue/ExportWriterQueueOperation.d.ts +6 -0
- package/build/main/engine/writing/queue/ExportWriterQueueOperation.js +36 -0
- package/build/main/engine/writing/queue/ExportWriterQueueOperation.js.map +1 -0
- package/build/main/engine/writing/requests/ExportWriterRequest.d.ts +14 -0
- package/build/main/engine/writing/requests/ExportWriterRequest.js +40 -0
- package/build/main/engine/writing/requests/ExportWriterRequest.js.map +1 -0
- package/build/main/engine/writing/requests/ExportWriterRequestProducer.d.ts +8 -0
- package/build/main/engine/writing/requests/ExportWriterRequestProducer.js +30 -0
- package/build/main/engine/writing/requests/ExportWriterRequestProducer.js.map +1 -0
- package/build/main/engine/writing/requests/ExportWriterResponse.d.ts +9 -0
- package/build/main/engine/writing/requests/ExportWriterResponse.js +25 -0
- package/build/main/engine/writing/requests/ExportWriterResponse.js.map +1 -0
- package/build/main/engine/writing/requests/ExportWriterResponseProducer.d.ts +7 -0
- package/build/main/engine/writing/requests/ExportWriterResponseProducer.js +40 -0
- package/build/main/engine/writing/requests/ExportWriterResponseProducer.js.map +1 -0
- package/build/main/engine/writing/writers/ExportItemWriter.d.ts +14 -0
- package/build/main/engine/writing/writers/ExportItemWriter.js +70 -0
- package/build/main/engine/writing/writers/ExportItemWriter.js.map +1 -0
- package/build/main/engine/writing/writers/ExportWriterRuleProcessor.d.ts +9 -0
- package/build/main/engine/writing/writers/ExportWriterRuleProcessor.js +63 -0
- package/build/main/engine/writing/writers/ExportWriterRuleProcessor.js.map +1 -0
- package/build/main/engine/writing/writers/memory/ExportWriterMemory.d.ts +4 -0
- package/build/main/engine/writing/writers/memory/ExportWriterMemory.js +29 -0
- package/build/main/engine/writing/writers/memory/ExportWriterMemory.js.map +1 -0
- package/build/main/engine/writing/writers/memory/ExportWriterMemoryRequest.d.ts +5 -0
- package/build/main/engine/writing/writers/memory/ExportWriterMemoryRequest.js +59 -0
- package/build/main/engine/writing/writers/memory/ExportWriterMemoryRequest.js.map +1 -0
- package/build/main/engine/writing/writers/memory/ExportWriterStore.d.ts +5 -0
- package/build/main/engine/writing/writers/memory/ExportWriterStore.js +33 -0
- package/build/main/engine/writing/writers/memory/ExportWriterStore.js.map +1 -0
- package/build/main/exports.d.ts +4 -0
- package/build/main/exports.js +13 -0
- package/build/main/exports.js.map +1 -0
- package/build/main/index.d.ts +1 -0
- package/build/main/index.js +14 -0
- package/build/main/index.js.map +1 -0
- package/build/main/model/dsm/DSMReferenceStore.d.ts +28 -0
- package/build/main/model/dsm/DSMReferenceStore.js +100 -0
- package/build/main/model/dsm/DSMReferenceStore.js.map +1 -0
- package/build/main/model/exporters/Exporter.d.ts +50 -0
- package/build/main/model/exporters/Exporter.js +88 -0
- package/build/main/model/exporters/Exporter.js.map +1 -0
- package/build/main/model/maps/ExporterMapBlueprint.d.ts +12 -0
- package/build/main/model/maps/ExporterMapBlueprint.js +39 -0
- package/build/main/model/maps/ExporterMapBlueprint.js.map +1 -0
- package/build/main/model/sources/ExporterSource.d.ts +25 -0
- package/build/main/model/sources/ExporterSource.js +58 -0
- package/build/main/model/sources/ExporterSource.js.map +1 -0
- package/build/main/pulsar/Pulsar.d.ts +105 -0
- package/build/main/pulsar/Pulsar.js +351 -0
- package/build/main/pulsar/Pulsar.js.map +1 -0
- package/build/main/pulsar/PulsarInterface.d.ts +152 -0
- package/build/main/pulsar/PulsarInterface.js +37 -0
- package/build/main/pulsar/PulsarInterface.js.map +1 -0
- package/build/main/pulsar/PulsarStaticAnalysis.d.ts +23 -0
- package/build/main/pulsar/PulsarStaticAnalysis.js +47 -0
- package/build/main/pulsar/PulsarStaticAnalysis.js.map +1 -0
- package/build/main/pulsar/PulsarStaticAnalysisInterface.d.ts +10 -0
- package/build/main/pulsar/PulsarStaticAnalysisInterface.js +10 -0
- package/build/main/pulsar/PulsarStaticAnalysisInterface.js.map +1 -0
- package/build/main/pulsar/managers/PulsarBlueprintManager.d.ts +16 -0
- package/build/main/pulsar/managers/PulsarBlueprintManager.js +76 -0
- package/build/main/pulsar/managers/PulsarBlueprintManager.js.map +1 -0
- package/build/main/pulsar/managers/PulsarCIManager.d.ts +25 -0
- package/build/main/pulsar/managers/PulsarCIManager.js +220 -0
- package/build/main/pulsar/managers/PulsarCIManager.js.map +1 -0
- package/build/main/pulsar/managers/PulsarCodeManager.d.ts +24 -0
- package/build/main/pulsar/managers/PulsarCodeManager.js +180 -0
- package/build/main/pulsar/managers/PulsarCodeManager.js.map +1 -0
- package/build/main/pulsar/managers/PulsarConfigurationManager.d.ts +16 -0
- package/build/main/pulsar/managers/PulsarConfigurationManager.js +48 -0
- package/build/main/pulsar/managers/PulsarConfigurationManager.js.map +1 -0
- package/build/main/pulsar/managers/PulsarExporterManager.d.ts +25 -0
- package/build/main/pulsar/managers/PulsarExporterManager.js +121 -0
- package/build/main/pulsar/managers/PulsarExporterManager.js.map +1 -0
- package/build/main/pulsar/managers/generators/PulsarExporterJSONGenerator.d.ts +16 -0
- package/build/main/pulsar/managers/generators/PulsarExporterJSONGenerator.js +275 -0
- package/build/main/pulsar/managers/generators/PulsarExporterJSONGenerator.js.map +1 -0
- package/build/main/pulsar/managers/generators/PulsarExporterZIPGenerator.d.ts +7 -0
- package/build/main/pulsar/managers/generators/PulsarExporterZIPGenerator.js +63 -0
- package/build/main/pulsar/managers/generators/PulsarExporterZIPGenerator.js.map +1 -0
- package/build/main/pulsar/managers/loaders/PulsarBaseLoader.d.ts +5 -0
- package/build/main/pulsar/managers/loaders/PulsarBaseLoader.js +28 -0
- package/build/main/pulsar/managers/loaders/PulsarBaseLoader.js.map +1 -0
- package/build/main/pulsar/managers/loaders/local/PulsarFSLoader.d.ts +11 -0
- package/build/main/pulsar/managers/loaders/local/PulsarFSLoader.js +99 -0
- package/build/main/pulsar/managers/loaders/local/PulsarFSLoader.js.map +1 -0
- package/build/main/pulsar/managers/loaders/memory/PulsarExporterJSONLoader.d.ts +9 -0
- package/build/main/pulsar/managers/loaders/memory/PulsarExporterJSONLoader.js +81 -0
- package/build/main/pulsar/managers/loaders/memory/PulsarExporterJSONLoader.js.map +1 -0
- package/build/main/pulsar/managers/loaders/memory/PulsarExporterMemoryLoader.d.ts +20 -0
- package/build/main/pulsar/managers/loaders/memory/PulsarExporterMemoryLoader.js +194 -0
- package/build/main/pulsar/managers/loaders/memory/PulsarExporterMemoryLoader.js.map +1 -0
- package/build/main/pulsar/managers/loaders/remote/PulsarExporterGitHubLoader.d.ts +12 -0
- package/build/main/pulsar/managers/loaders/remote/PulsarExporterGitHubLoader.js +143 -0
- package/build/main/pulsar/managers/loaders/remote/PulsarExporterGitHubLoader.js.map +1 -0
- package/build/main/pulsar/managers/loaders/remote/PulsarExporterZIPLoader.d.ts +12 -0
- package/build/main/pulsar/managers/loaders/remote/PulsarExporterZIPLoader.js +115 -0
- package/build/main/pulsar/managers/loaders/remote/PulsarExporterZIPLoader.js.map +1 -0
- package/build/main/tests/TestConfiguration.d.ts +9 -0
- package/build/main/tests/TestConfiguration.js +25 -0
- package/build/main/tests/TestConfiguration.js.map +1 -0
- package/build/main/tests/casebuilders/ci.d.ts +12 -0
- package/build/main/tests/casebuilders/ci.js +38 -0
- package/build/main/tests/casebuilders/ci.js.map +1 -0
- package/build/main/tests/casebuilders/configuration.d.ts +5 -0
- package/build/main/tests/casebuilders/configuration.js +25 -0
- package/build/main/tests/casebuilders/configuration.js.map +1 -0
- package/build/main/tests/casebuilders/dsm.d.ts +7 -0
- package/build/main/tests/casebuilders/dsm.js +57 -0
- package/build/main/tests/casebuilders/dsm.js.map +1 -0
- package/build/main/tests/casebuilders/modelObjects.d.ts +13 -0
- package/build/main/tests/casebuilders/modelObjects.js +120 -0
- package/build/main/tests/casebuilders/modelObjects.js.map +1 -0
- package/build/main/tools/Logger.d.ts +27 -0
- package/build/main/tools/Logger.js +98 -0
- package/build/main/tools/Logger.js.map +1 -0
- package/build/main/tools/LoggerDefaultMessages.d.ts +13 -0
- package/build/main/tools/LoggerDefaultMessages.js +41 -0
- package/build/main/tools/LoggerDefaultMessages.js.map +1 -0
- package/build/tsconfig.tsbuildinfo +2829 -0
- package/package.json +2 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
// import { DSMReferenceStore } from './model/dsm/DSMReferenceStore'
|
|
4
|
+
const Pulsar_1 = require("./pulsar/Pulsar");
|
|
5
|
+
const PulsarStaticAnalysis_1 = require("./pulsar/PulsarStaticAnalysis");
|
|
6
|
+
// import { PLSEngineSourceDetail, PLSEngineBlueprintGroup, PLSEngineExporterDetail, PLSEngineMapDetail, PLSEngineMapGroup } from './pulsar/PulsarInterface'
|
|
7
|
+
window.PLSPulsar = Pulsar_1.PLSPulsar;
|
|
8
|
+
window.PLSPulsarStaticAnalysis = PulsarStaticAnalysis_1.PLSPulsarStaticAnalysis;
|
|
9
|
+
/*
|
|
10
|
+
(window as any).PLSEngineExporterDetail = PLSEngineExporterDetail;
|
|
11
|
+
(window as any).PLSEngineSourceDetail = PLSEngineSourceDetail;
|
|
12
|
+
(window as any).PLSEngineMapDetail = PLSEngineMapDetail;
|
|
13
|
+
(window as any).PLSEngineBlueprintGroup = PLSEngineBlueprintGroup;
|
|
14
|
+
(window as any).PLSEngineMapGroup = PLSEngineMapGroup;
|
|
15
|
+
(window as any).DSMReferenceStore = DSMReferenceStore;
|
|
16
|
+
*/
|
|
17
|
+
//# sourceMappingURL=browser-bundle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"browser-bundle.js","sourceRoot":"","sources":["../../src/browser-bundle.ts"],"names":[],"mappings":";;AAAA,oEAAoE;AACpE,4CAA4C;AAC5C,wEAAwE;AACxE,4JAA4J;AAE3J,MAAc,CAAC,SAAS,GAAG,kBAAS,CAAC;AACrC,MAAc,CAAC,uBAAuB,GAAG,8CAAuB,CAAC;AAClE;;;;;;;EAOE"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { PLSExportConfiguration } from './configuration/ExportConfiguration';
|
|
2
|
+
import { PLSExportItemWriter } from './writing/writers/ExportItemWriter';
|
|
3
|
+
import { PLSExportItemProducer } from './items/ExportItemProducer';
|
|
4
|
+
import { PLSExportDataProducer } from './generation/ExportDataProducer';
|
|
5
|
+
import { PLSExportWriterResponse } from './writing/requests/ExportWriterResponse';
|
|
6
|
+
import { PLSExportWriterMemoryStore } from './writing/writers/memory/ExportWriterStore';
|
|
7
|
+
export declare class PLSExportEngine {
|
|
8
|
+
dataProducer: PLSExportDataProducer;
|
|
9
|
+
itemProducer: PLSExportItemProducer;
|
|
10
|
+
itemWriter: PLSExportItemWriter;
|
|
11
|
+
configuration: PLSExportConfiguration;
|
|
12
|
+
runId: string;
|
|
13
|
+
constructor(configuration: PLSExportConfiguration);
|
|
14
|
+
processExportValidate(): Promise<boolean>;
|
|
15
|
+
processExport(): Promise<PLSExportWriterMemoryStore>;
|
|
16
|
+
processExportValidated(): Promise<Array<PLSExportWriterResponse>>;
|
|
17
|
+
}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
//
|
|
3
|
+
// ExportEngine.ts
|
|
4
|
+
// Pulsar
|
|
5
|
+
//
|
|
6
|
+
// Created by Jiri Trecak.
|
|
7
|
+
// Copyright © 2020 Supernova. All rights reserved.
|
|
8
|
+
//
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.PLSExportEngine = void 0;
|
|
11
|
+
const ExportItemWriter_1 = require("./writing/writers/ExportItemWriter");
|
|
12
|
+
const ExportItemProducer_1 = require("./items/ExportItemProducer");
|
|
13
|
+
const ExportDataProducer_1 = require("./generation/ExportDataProducer");
|
|
14
|
+
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
|
|
15
|
+
// MARK: - Definitions
|
|
16
|
+
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
|
|
17
|
+
// MARK: - Interpreter Definition
|
|
18
|
+
class PLSExportEngine {
|
|
19
|
+
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
|
|
20
|
+
// MARK: - Setup
|
|
21
|
+
constructor(configuration) {
|
|
22
|
+
this.configuration = configuration;
|
|
23
|
+
// Create managers
|
|
24
|
+
this.dataProducer = new ExportDataProducer_1.PLSExportDataProducer(configuration);
|
|
25
|
+
this.itemProducer = new ExportItemProducer_1.PLSExportItemProducer(configuration);
|
|
26
|
+
this.itemWriter = new ExportItemWriter_1.PLSExportItemWriter(configuration);
|
|
27
|
+
this.runId = 'random-id'; // TODO:
|
|
28
|
+
}
|
|
29
|
+
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
|
|
30
|
+
// MARK: - Validation
|
|
31
|
+
processExportValidate() {
|
|
32
|
+
// this.progressLogger.log(systemMessage: .validationStarted, id: "")
|
|
33
|
+
// Validate the entire procedure
|
|
34
|
+
// - It is possible to create data based on the configuration of custom exporter
|
|
35
|
+
// - It is possible to convert raw data into write requests
|
|
36
|
+
// - It is possible to write data into final destination
|
|
37
|
+
// Validate data producer
|
|
38
|
+
return new Promise((response, reject) => {
|
|
39
|
+
this.dataProducer
|
|
40
|
+
.validateCanProduceData()
|
|
41
|
+
.then(() => {
|
|
42
|
+
this.itemProducer
|
|
43
|
+
.validateCanProduceItems()
|
|
44
|
+
.then(() => {
|
|
45
|
+
this.itemWriter
|
|
46
|
+
.validateCanWriteItems()
|
|
47
|
+
.then(() => {
|
|
48
|
+
response(true);
|
|
49
|
+
})
|
|
50
|
+
.catch(error => {
|
|
51
|
+
reject(error);
|
|
52
|
+
});
|
|
53
|
+
})
|
|
54
|
+
.catch(error => {
|
|
55
|
+
reject(error);
|
|
56
|
+
});
|
|
57
|
+
})
|
|
58
|
+
.catch(error => {
|
|
59
|
+
reject(error);
|
|
60
|
+
});
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
|
|
64
|
+
// MARK: - Export
|
|
65
|
+
processExport() {
|
|
66
|
+
return new Promise((resolve, reject) => {
|
|
67
|
+
// Validate both writer, content producer and context loader whether they can produce items
|
|
68
|
+
this.processExportValidate()
|
|
69
|
+
.then(() => {
|
|
70
|
+
// this.progressLogger.log(systemMessage: .validationFinished, id: "")
|
|
71
|
+
// Validation successful, proceed with export
|
|
72
|
+
this.processExportValidated()
|
|
73
|
+
.then(() => {
|
|
74
|
+
resolve(this.configuration.outputStore);
|
|
75
|
+
})
|
|
76
|
+
.catch(error => {
|
|
77
|
+
// Export failed, error out
|
|
78
|
+
reject(error);
|
|
79
|
+
});
|
|
80
|
+
})
|
|
81
|
+
.catch(error => {
|
|
82
|
+
// Validation failed, error out
|
|
83
|
+
reject(error);
|
|
84
|
+
});
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
processExportValidated() {
|
|
88
|
+
return new Promise((resolve, reject) => {
|
|
89
|
+
// this.progressLogger.log(systemMessage: .exportStarted, id: "")
|
|
90
|
+
// Generate data pieces out of the context / configuration using content producer
|
|
91
|
+
this.dataProducer
|
|
92
|
+
.produceData()
|
|
93
|
+
.then(dataProducerResponses => {
|
|
94
|
+
// Convert responses into items that have all the information to write them into their final destination
|
|
95
|
+
this.itemProducer
|
|
96
|
+
.produceItemsFromResponses(dataProducerResponses)
|
|
97
|
+
.then(itemProducerResponses => {
|
|
98
|
+
// Write items to their final destinations using one of the writers
|
|
99
|
+
this.itemWriter
|
|
100
|
+
.write(itemProducerResponses)
|
|
101
|
+
.then(writerResponses => {
|
|
102
|
+
resolve(writerResponses);
|
|
103
|
+
})
|
|
104
|
+
.catch(error => {
|
|
105
|
+
// Write failed, reject
|
|
106
|
+
reject(error);
|
|
107
|
+
});
|
|
108
|
+
})
|
|
109
|
+
.catch(error => {
|
|
110
|
+
// Item production failed, reject
|
|
111
|
+
reject(error);
|
|
112
|
+
});
|
|
113
|
+
})
|
|
114
|
+
.catch(error => {
|
|
115
|
+
// Context generation failed, reject
|
|
116
|
+
reject(error);
|
|
117
|
+
});
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
exports.PLSExportEngine = PLSExportEngine;
|
|
122
|
+
//# sourceMappingURL=ExportEngine.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExportEngine.js","sourceRoot":"","sources":["../../../src/engine/ExportEngine.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,mBAAmB;AACnB,UAAU;AACV,EAAE;AACF,2BAA2B;AAC3B,oDAAoD;AACpD,EAAE;;;AAMF,yEAAyE;AACzE,mEAAmE;AACnE,wEAAwE;AAIxE,8GAA8G;AAC9G,sBAAsB;AAEtB,8GAA8G;AAC9G,iCAAiC;AAEjC,MAAa,eAAe;IAU1B,8GAA8G;IAC9G,gBAAgB;IAEhB,YAAY,aAAqC;QAC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;oBACb,iCAAiC;oBACjC,MAAM,CAAC,KAAK,CAAC,CAAC;gBAChB,CAAC,CAAC,CAAC;YACP,CAAC,CAAC;iBACD,KAAK,CAAC,KAAK,CAAC,EAAE;gBACb,oCAAoC;gBACpC,MAAM,CAAC,KAAK,CAAC,CAAC;YAChB,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AAxHD,0CAwHC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { PLSExporter } from './../../model/exporters/Exporter';
|
|
2
|
+
import { PLSLogger } from '../../tools/Logger';
|
|
3
|
+
import { DSMReferenceStore } from './../../model/dsm/DSMReferenceStore';
|
|
4
|
+
import { PLSExportWriterMemoryStore } from './../writing/writers/memory/ExportWriterStore';
|
|
5
|
+
import { DSMBridgeConfiguration, DSMExecutionContext } from '@supernova-studio/pulsar-language';
|
|
6
|
+
import { PLSPulsarExporterMode } from '../../pulsar/Pulsar';
|
|
7
|
+
export declare class PLSExportConfiguration {
|
|
8
|
+
exporter: PLSExporter;
|
|
9
|
+
exportMode: PLSPulsarExporterMode;
|
|
10
|
+
logger: PLSLogger;
|
|
11
|
+
dsmStore: DSMReferenceStore;
|
|
12
|
+
dsmBridgeConfig: DSMBridgeConfiguration;
|
|
13
|
+
outputStore: PLSExportWriterMemoryStore;
|
|
14
|
+
outputPathPrefix: string;
|
|
15
|
+
sandboxData: Object;
|
|
16
|
+
constructor(exporter: PLSExporter, logger: PLSLogger, dsmStore: DSMReferenceStore, dsmBridgeConfig: DSMBridgeConfiguration, exportMode: PLSPulsarExporterMode, sandboxData: Object);
|
|
17
|
+
newExecutionContext(): DSMExecutionContext;
|
|
18
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
//
|
|
3
|
+
// PLSExportConfiguration.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.PLSExportConfiguration = void 0;
|
|
11
|
+
const ExportWriterStore_1 = require("./../writing/writers/memory/ExportWriterStore");
|
|
12
|
+
const pulsar_language_1 = require("@supernova-studio/pulsar-language");
|
|
13
|
+
const BlueprintLoader_1 = require("../loaders/BlueprintLoader");
|
|
14
|
+
const Logger_1 = require("@supernova-studio/pulsar-language/build/main/interpreter/loggers/Logger");
|
|
15
|
+
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
|
|
16
|
+
// MARK: - Class
|
|
17
|
+
class PLSExportConfiguration {
|
|
18
|
+
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
|
|
19
|
+
// MARK: - Setup
|
|
20
|
+
constructor(exporter, logger, dsmStore, dsmBridgeConfig, exportMode, sandboxData) {
|
|
21
|
+
this.outputPathPrefix = '';
|
|
22
|
+
this.exporter = exporter;
|
|
23
|
+
this.exportMode = exportMode;
|
|
24
|
+
// Core output pipes
|
|
25
|
+
this.logger = logger;
|
|
26
|
+
this.outputStore = new ExportWriterStore_1.PLSExportWriterMemoryStore();
|
|
27
|
+
// DSM configuration
|
|
28
|
+
this.dsmStore = dsmStore;
|
|
29
|
+
this.dsmBridgeConfig = dsmBridgeConfig;
|
|
30
|
+
// Sandbox data
|
|
31
|
+
this.sandboxData = sandboxData;
|
|
32
|
+
}
|
|
33
|
+
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
|
|
34
|
+
// MARK: - Convenience
|
|
35
|
+
newExecutionContext() {
|
|
36
|
+
// Create new loaders, emitters, loggers and bridge for execution of every source. Each request has its own separate execution context
|
|
37
|
+
let blueprintLoader = new BlueprintLoader_1.PLSBlueprintLoader(this.exporter);
|
|
38
|
+
let blueprintEmitter = new pulsar_language_1.BLZMemoryBlueprintEmitter(false);
|
|
39
|
+
let logger = new Logger_1.BLZLogger();
|
|
40
|
+
let bridge = new pulsar_language_1.DSMBridge(this.dsmBridgeConfig);
|
|
41
|
+
// Retrieve context
|
|
42
|
+
let context = new pulsar_language_1.DSMExecutionContext(blueprintLoader, blueprintEmitter, logger, bridge, this.sandboxData);
|
|
43
|
+
return context;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
exports.PLSExportConfiguration = PLSExportConfiguration;
|
|
47
|
+
//# sourceMappingURL=ExportConfiguration.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExportConfiguration.js","sourceRoot":"","sources":["../../../../src/engine/configuration/ExportConfiguration.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,6BAA6B;AAC7B,aAAa;AACb,EAAE;AACF,2BAA2B;AAC3B,sDAAsD;AACtD,EAAE;;;AAQF,qFAA2F;AAC3F,uEAK2C;AAC3C,gEAAgE;AAChE,oGAAoG;AAGpG,8GAA8G;AAC9G,gBAAgB;AAEhB,MAAa,sBAAsB;IAgBjC,8GAA8G;IAC9G,gBAAgB;IAEhB,YACE,QAAqB,EACrB,MAAiB,EACjB,QAA2B,EAC3B,eAAuC,EACvC,UAAiC,EACjC,WAAmB;QAbrB,qBAAgB,GAAW,EAAE,CAAC;QAe5B,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAE7B,oBAAoB;QACpB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,WAAW,GAAG,IAAI,8CAA0B,EAAE,CAAC;QAEpD,oBAAoB;QACpB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,eAAe,GAAG,eAAe,CAAC;QAEvC,eAAe;QACf,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;IACjC,CAAC;IAED,8GAA8G;IAC9G,sBAAsB;IAEtB,mBAAmB;QACjB,sIAAsI;QACtI,IAAI,eAAe,GAAG,IAAI,oCAAkB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAC5D,IAAI,gBAAgB,GAAG,IAAI,2CAAyB,CAAC,KAAK,CAAC,CAAC;QAC5D,IAAI,MAAM,GAAG,IAAI,kBAAS,EAAE,CAAC;QAC7B,IAAI,MAAM,GAAG,IAAI,2BAAS,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;QAEjD,mBAAmB;QACnB,IAAI,OAAO,GAAG,IAAI,qCAAmB,CACnC,eAAe,EACf,gBAAgB,EAChB,MAAM,EACN,MAAM,EACN,IAAI,CAAC,WAAW,CACjB,CAAC;QACF,OAAO,OAAO,CAAC;IACjB,CAAC;CACF;AA9DD,wDA8DC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { PLSExportDataQueue } from './queue/ExportDataQueue';
|
|
2
|
+
import { PLSExportConfiguration } from '../configuration/ExportConfiguration';
|
|
3
|
+
import { PLSExportDataResponse } from './requests/ExportDataResponse';
|
|
4
|
+
import { PLSExporterMapBlueprint } from './../../model/maps/ExporterMapBlueprint';
|
|
5
|
+
import { PLSExportDataRequest } from './requests/ExportDataRequest';
|
|
6
|
+
export declare class PLSExportDataProducer {
|
|
7
|
+
configuration: PLSExportConfiguration;
|
|
8
|
+
processingQueue: PLSExportDataQueue;
|
|
9
|
+
constructor(exportConfiguration: PLSExportConfiguration);
|
|
10
|
+
validateCanProduceData(): Promise<void>;
|
|
11
|
+
produceData(): Promise<Array<PLSExportDataResponse>>;
|
|
12
|
+
generateRequestsForMap(map: PLSExporterMapBlueprint): Array<PLSExportDataRequest>;
|
|
13
|
+
generatePrimaryResponsesFromFinishedRequests(requests: Array<PLSExportDataRequest>): Array<PLSExportDataResponse>;
|
|
14
|
+
generateEmittedResponsesFromFinishedRequests(requests: Array<PLSExportDataRequest>): Array<PLSExportDataResponse>;
|
|
15
|
+
}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
//
|
|
3
|
+
// PLSExportDataProducer.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.PLSExportDataProducer = void 0;
|
|
11
|
+
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
|
|
12
|
+
// MARK: - Imports
|
|
13
|
+
const ExportDataQueue_1 = require("./queue/ExportDataQueue");
|
|
14
|
+
const ExportDataEmittedResponseProducer_1 = require("./requests/ExportDataEmittedResponseProducer");
|
|
15
|
+
const ExportDataPrimaryResponseProducer_1 = require("./requests/ExportDataPrimaryResponseProducer");
|
|
16
|
+
const ExportDataRequestProducer_1 = require("./requests/ExportDataRequestProducer");
|
|
17
|
+
const Pulsar_1 = require("../../pulsar/Pulsar");
|
|
18
|
+
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
|
|
19
|
+
// MARK: - Definitions
|
|
20
|
+
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --O- --- --- --- --- --- --- --- --- --- ---
|
|
21
|
+
// MARK: - Object definition
|
|
22
|
+
class PLSExportDataProducer {
|
|
23
|
+
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
|
|
24
|
+
// MARK: - Init
|
|
25
|
+
constructor(exportConfiguration) {
|
|
26
|
+
this.configuration = exportConfiguration;
|
|
27
|
+
this.processingQueue = new ExportDataQueue_1.PLSExportDataQueue(exportConfiguration);
|
|
28
|
+
}
|
|
29
|
+
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
|
|
30
|
+
// MARK: - Validation
|
|
31
|
+
validateCanProduceData() {
|
|
32
|
+
// It is always possible to produce data for now, no validation
|
|
33
|
+
return new Promise((resolve, _) => {
|
|
34
|
+
resolve();
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
|
|
38
|
+
// MARK: - Content creation
|
|
39
|
+
produceData() {
|
|
40
|
+
return new Promise((resolve, reject) => {
|
|
41
|
+
// Create queue with all processed operations
|
|
42
|
+
for (let map of this.configuration.exporter.outputs.values()) {
|
|
43
|
+
// Filter generated results based on the mode of the exporter. Only allow maps that have appropriate target
|
|
44
|
+
let skipGeneration = false;
|
|
45
|
+
let source = this.configuration.exporter.sourceById(map.invoke);
|
|
46
|
+
if (!source) {
|
|
47
|
+
throw `Output defines unknown source '${map.invoke}'`;
|
|
48
|
+
}
|
|
49
|
+
switch (this.configuration.exportMode) {
|
|
50
|
+
case Pulsar_1.PLSPulsarExporterMode.ci:
|
|
51
|
+
skipGeneration = !source.targetsCI;
|
|
52
|
+
break;
|
|
53
|
+
case Pulsar_1.PLSPulsarExporterMode.docs:
|
|
54
|
+
skipGeneration = !source.targetsDocumentation;
|
|
55
|
+
break;
|
|
56
|
+
case Pulsar_1.PLSPulsarExporterMode.sandbox:
|
|
57
|
+
skipGeneration = !source.targetsSandbox;
|
|
58
|
+
break;
|
|
59
|
+
}
|
|
60
|
+
if (!skipGeneration) {
|
|
61
|
+
let requests = this.generateRequestsForMap(map);
|
|
62
|
+
this.processingQueue.addQueuedRequests(requests);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
// Process all items at once
|
|
66
|
+
this.processingQueue
|
|
67
|
+
.processQueue()
|
|
68
|
+
.then(processedRequests => {
|
|
69
|
+
let primaryResponses = this.generatePrimaryResponsesFromFinishedRequests(processedRequests);
|
|
70
|
+
let emittedResponses = this.generateEmittedResponsesFromFinishedRequests(processedRequests);
|
|
71
|
+
let result = primaryResponses.concat(emittedResponses);
|
|
72
|
+
resolve(result);
|
|
73
|
+
})
|
|
74
|
+
.catch(error => {
|
|
75
|
+
reject(error);
|
|
76
|
+
});
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
|
|
80
|
+
// MARK: - Request processing
|
|
81
|
+
generateRequestsForMap(map) {
|
|
82
|
+
// Generate array of requests from the source-entry configuration
|
|
83
|
+
let requestProducer = new ExportDataRequestProducer_1.PLSExportDataRequestProducer(this.configuration);
|
|
84
|
+
return requestProducer.produceRequestsForMap(map);
|
|
85
|
+
}
|
|
86
|
+
generatePrimaryResponsesFromFinishedRequests(requests) {
|
|
87
|
+
// Generate responses from finished requests. This generates content from primary response, but not potentially emitted files
|
|
88
|
+
// Note: at this point, all requests will have the data, otherwise this is not called. No additional checks are neccessary
|
|
89
|
+
let responseProducer = new ExportDataPrimaryResponseProducer_1.PLSExportDataPrimaryResponseProducer();
|
|
90
|
+
return responseProducer.producePrimaryResponsesFromRequests(requests);
|
|
91
|
+
}
|
|
92
|
+
generateEmittedResponsesFromFinishedRequests(requests) {
|
|
93
|
+
// Generate responses from finished requests. This generates content from emitted responses but not from primary content
|
|
94
|
+
// Note: at this point, all requests will have the data, otherwise this is not called. No additional checks are neccessary
|
|
95
|
+
let responseProducer = new ExportDataEmittedResponseProducer_1.PLSExportDataEmittedResponseProducer();
|
|
96
|
+
return responseProducer.produceEmittedResponsesFromRequests(requests);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
exports.PLSExportDataProducer = PLSExportDataProducer;
|
|
100
|
+
//# sourceMappingURL=ExportDataProducer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExportDataProducer.js","sourceRoot":"","sources":["../../../../src/engine/generation/ExportDataProducer.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,4BAA4B;AAC5B,aAAa;AACb,EAAE;AACF,2BAA2B;AAC3B,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,CAAC;IAED,4CAA4C,CAC1C,QAAqC;QAErC,wHAAwH;QACxH,0HAA0H;QAC1H,IAAI,gBAAgB,GAAG,IAAI,wEAAoC,EAAE,CAAC;QAClE,OAAO,gBAAgB,CAAC,mCAAmC,CAAC,QAAQ,CAAC,CAAC;IACxE,CAAC;CACF;AAxGD,sDAwGC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { PLSExportDataQueueOperation } from './ExportDataQueueOperation';
|
|
2
|
+
import { PLSExportDataRequest } from '../requests/ExportDataRequest';
|
|
3
|
+
import { PLSExportConfiguration } from './../../configuration/ExportConfiguration';
|
|
4
|
+
export declare class PLSExportDataQueue {
|
|
5
|
+
configuration: PLSExportConfiguration;
|
|
6
|
+
waitingOperations: Array<PLSExportDataQueueOperation>;
|
|
7
|
+
isLockedForChanges: boolean;
|
|
8
|
+
isFinished: boolean;
|
|
9
|
+
requests: Array<PLSExportDataRequest>;
|
|
10
|
+
requestsCompleted: number;
|
|
11
|
+
constructor(configuration: PLSExportConfiguration);
|
|
12
|
+
addQueuedRequest(request: PLSExportDataRequest): void;
|
|
13
|
+
addQueuedRequests(requests: Array<PLSExportDataRequest>): void;
|
|
14
|
+
clearQueue(): void;
|
|
15
|
+
processQueue(): Promise<Array<PLSExportDataRequest>>;
|
|
16
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
//
|
|
3
|
+
// PLSExportDataQueue.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.PLSExportDataQueue = void 0;
|
|
11
|
+
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
|
|
12
|
+
// MARK: - Imports
|
|
13
|
+
const ExportDataQueueOperation_1 = require("./ExportDataQueueOperation");
|
|
14
|
+
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
|
|
15
|
+
// MARK: - Definitions
|
|
16
|
+
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
|
|
17
|
+
// MARK: - Object definition
|
|
18
|
+
class PLSExportDataQueue {
|
|
19
|
+
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
|
|
20
|
+
// MARK: - Init
|
|
21
|
+
constructor(configuration) {
|
|
22
|
+
this.isLockedForChanges = false;
|
|
23
|
+
this.isFinished = false;
|
|
24
|
+
this.configuration = configuration;
|
|
25
|
+
this.waitingOperations = new Array();
|
|
26
|
+
this.requests = new Array();
|
|
27
|
+
this.requestsCompleted = 0;
|
|
28
|
+
}
|
|
29
|
+
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
|
|
30
|
+
// MARK: - Queue management
|
|
31
|
+
addQueuedRequest(request) {
|
|
32
|
+
// Create operation
|
|
33
|
+
let operation = new ExportDataQueueOperation_1.PLSExportDataQueueOperation(request);
|
|
34
|
+
// Add operation to queue
|
|
35
|
+
this.requests.push(request);
|
|
36
|
+
this.waitingOperations.push(operation);
|
|
37
|
+
}
|
|
38
|
+
addQueuedRequests(requests) {
|
|
39
|
+
requests.forEach(r => {
|
|
40
|
+
this.addQueuedRequest(r);
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
clearQueue() {
|
|
44
|
+
this.requestsCompleted = 0;
|
|
45
|
+
this.waitingOperations = [];
|
|
46
|
+
}
|
|
47
|
+
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
|
|
48
|
+
// MARK: - Processing
|
|
49
|
+
processQueue() {
|
|
50
|
+
// Sort the files and add them to export buffer
|
|
51
|
+
this.isLockedForChanges = true;
|
|
52
|
+
this.requestsCompleted = 0;
|
|
53
|
+
// Create new queue promise, processing all items at once
|
|
54
|
+
return new Promise((resolve, reject) => {
|
|
55
|
+
let queue = new Array();
|
|
56
|
+
for (let operation of this.waitingOperations) {
|
|
57
|
+
let promise = operation.processOperation();
|
|
58
|
+
queue.push(promise);
|
|
59
|
+
}
|
|
60
|
+
// When one queue item fails, immediately cancel
|
|
61
|
+
Promise.all(queue)
|
|
62
|
+
.then(result => {
|
|
63
|
+
resolve(result);
|
|
64
|
+
})
|
|
65
|
+
.catch(error => {
|
|
66
|
+
reject(error);
|
|
67
|
+
});
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
exports.PLSExportDataQueue = PLSExportDataQueue;
|
|
72
|
+
//# sourceMappingURL=ExportDataQueue.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExportDataQueue.js","sourceRoot":"","sources":["../../../../../src/engine/generation/queue/ExportDataQueue.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,yBAAyB;AACzB,aAAa;AACb,EAAE;AACF,2BAA2B;AAC3B,sDAAsD;AACtD,EAAE;;;AAEF,8GAA8G;AAC9G,kBAAkB;AAElB,yEAAyE;AAIzE,8GAA8G;AAC9G,sBAAsB;AAEtB,8GAA8G;AAC9G,4BAA4B;AAE5B,MAAa,kBAAkB;IAgB7B,8GAA8G;IAC9G,eAAe;IAEf,YAAY,aAAqC;QAVjD,uBAAkB,GAAY,KAAK,CAAC;QACpC,eAAU,GAAY,KAAK,CAAC;QAU1B,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;QACnC,IAAI,CAAC,iBAAiB,GAAG,IAAI,KAAK,EAA+B,CAAC;QAClE,IAAI,CAAC,QAAQ,GAAG,IAAI,KAAK,EAAwB,CAAC;QAClD,IAAI,CAAC,iBAAiB,GAAG,CAAC,CAAC;IAC7B,CAAC;IAED,8GAA8G;IAC9G,2BAA2B;IAE3B,gBA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CAAC;IACL,CAAC;CACF;AA3ED,gDA2EC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
//
|
|
3
|
+
// PLSExportDataQueueOperation.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.PLSExportDataQueueOperation = void 0;
|
|
11
|
+
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
|
|
12
|
+
// MARK: - Definitions
|
|
13
|
+
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
|
|
14
|
+
// MARK: - Object definition
|
|
15
|
+
class PLSExportDataQueueOperation {
|
|
16
|
+
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
|
|
17
|
+
// MARK: - Init
|
|
18
|
+
constructor(request) {
|
|
19
|
+
this.request = request;
|
|
20
|
+
}
|
|
21
|
+
processOperation() {
|
|
22
|
+
return new Promise((respond, reject) => {
|
|
23
|
+
// Generate request data, then resolve the promise
|
|
24
|
+
this.request
|
|
25
|
+
.produceData()
|
|
26
|
+
.then(response => {
|
|
27
|
+
respond(response);
|
|
28
|
+
})
|
|
29
|
+
.catch(error => {
|
|
30
|
+
reject(error);
|
|
31
|
+
});
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
exports.PLSExportDataQueueOperation = PLSExportDataQueueOperation;
|
|
36
|
+
//# sourceMappingURL=ExportDataQueueOperation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExportDataQueueOperation.js","sourceRoot":"","sources":["../../../../../src/engine/generation/queue/ExportDataQueueOperation.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,kCAAkC;AAClC,aAAa;AACb,EAAE;AACF,2BAA2B;AAC3B,sDAAsD;AACtD,EAAE;;;AAOF,8GAA8G;AAC9G,sBAAsB;AAEtB,8GAA8G;AAC9G,4BAA4B;AAE5B,MAAa,2BAA2B;IAOtC,8GAA8G;IAC9G,eAAe;IAEf,YAAY,OAA6B;QACvC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;IAED,gBAAgB;QACd,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YACrC,kDAAkD;YAClD,IAAI,CAAC,OAAO;iBACT,WAAW,EAAE;iBACb,IAAI,CAAC,QAAQ,CAAC,EAAE;gBACf,OAAO,CAAC,QAAQ,CAAC,CAAC;YACpB,CAAC,CAAC;iBACD,KAAK,CAAC,KAAK,CAAC,EAAE;gBACb,MAAM,CAAC,KAAK,CAAC,CAAC;YAChB,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AA3BD,kEA2BC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { PLSExportDataRequest } from './ExportDataRequest';
|
|
2
|
+
import { PLSExportDataResponse } from './ExportDataResponse';
|
|
3
|
+
export declare class PLSExportDataEmittedResponseProducer {
|
|
4
|
+
constructor();
|
|
5
|
+
produceEmittedResponsesFromRequests(requests: Array<PLSExportDataRequest>): Array<PLSExportDataResponse>;
|
|
6
|
+
produceEmittedResponsesFromRequest(request: PLSExportDataRequest): Array<PLSExportDataResponse>;
|
|
7
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
//
|
|
3
|
+
// PLSExportDataEmittedResponseProducer.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.PLSExportDataEmittedResponseProducer = void 0;
|
|
11
|
+
const ExportDataResponse_1 = require("./ExportDataResponse");
|
|
12
|
+
const ExportDataRequestDataStore_1 = require("./ExportDataRequestDataStore");
|
|
13
|
+
const ExportDataRequestNameStore_1 = require("./ExportDataRequestNameStore");
|
|
14
|
+
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
|
|
15
|
+
// MARK: - Imports
|
|
16
|
+
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
|
|
17
|
+
// MARK: - Definitions
|
|
18
|
+
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
|
|
19
|
+
// MARK: - Object definition
|
|
20
|
+
class PLSExportDataEmittedResponseProducer {
|
|
21
|
+
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
|
|
22
|
+
// MARK: - Properties
|
|
23
|
+
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
|
|
24
|
+
// MARK: - Init
|
|
25
|
+
constructor() { }
|
|
26
|
+
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
|
|
27
|
+
// MARK: - Response production
|
|
28
|
+
produceEmittedResponsesFromRequests(requests) {
|
|
29
|
+
let result = [];
|
|
30
|
+
for (let request of requests) {
|
|
31
|
+
let responses = this.produceEmittedResponsesFromRequest(request);
|
|
32
|
+
for (let response of responses) {
|
|
33
|
+
result.push(response);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
return result;
|
|
37
|
+
}
|
|
38
|
+
produceEmittedResponsesFromRequest(request) {
|
|
39
|
+
let responses = [];
|
|
40
|
+
// Create response for each emitted content - each emitted content produces exactly one file
|
|
41
|
+
for (let emittedContent of request.emittedContent) {
|
|
42
|
+
let filename = emittedContent.filename;
|
|
43
|
+
let content = emittedContent.content;
|
|
44
|
+
// Create data and name store from the emitted data
|
|
45
|
+
let dataStore = ExportDataRequestDataStore_1.PLSExportDataRequestDataStore.storeWithPlainData(content);
|
|
46
|
+
let nameStore = ExportDataRequestNameStore_1.PLSExportDataRequestNameStore.storeWithResolvedName(filename);
|
|
47
|
+
let response = new ExportDataResponse_1.PLSExportDataResponse(request, request.map, dataStore, nameStore, []);
|
|
48
|
+
responses.push(response);
|
|
49
|
+
}
|
|
50
|
+
return responses;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
exports.PLSExportDataEmittedResponseProducer = PLSExportDataEmittedResponseProducer;
|
|
54
|
+
//# sourceMappingURL=ExportDataEmittedResponseProducer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExportDataEmittedResponseProducer.js","sourceRoot":"","sources":["../../../../../src/engine/generation/requests/ExportDataEmittedResponseProducer.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,2CAA2C;AAC3C,aAAa;AACb,EAAE;AACF,2BAA2B;AAC3B,sDAAsD;AACtD,EAAE;;;AAGF,6DAA6D;AAC7D,6EAA6E;AAC7E,6EAA6E;AAE7E,8GAA8G;AAC9G,kBAAkB;AAElB,8GAA8G;AAC9G,sBAAsB;AAEtB,8GAA8G;AAC9G,4BAA4B;AAE5B,MAAa,oCAAoC;IAC/C,8GAA8G;IAC9G,qBAAqB;IAErB,8GAA8G;IAC9G,eAAe;IAEf,gBAAe,CAAC;IAEhB,8GAA8G;IAC9G,8BAA8B;IAE9B,mCAAmC,CACjC,QAAqC;QAErC,IAAI,MAAM,GAAiC,EAAE,CAAC;QAC9C,KAAK,IAAI,OAAO,IAAI,QAAQ,EAAE;YAC5B,IAAI,SAAS,GAAG,IAAI,CAAC,kCAAkC,CAAC,OAAO,CAAC,CAAC;YACjE,KAAK,IAAI,QAAQ,IAAI,SAAS,EAAE;gBAC9B,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;aACvB;SACF;QAED,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,kCAAkC,CAChC,OAA6B;QAE7B,IAAI,SAAS,GAAiC,EAAE,CAAC;QAEjD,4FAA4F;QAC5F,KAAK,IAAI,cAAc,IAAI,OAAO,CAAC,cAAc,EAAE;YACjD,IAAI,QAAQ,GAAG,cAAc,CAAC,QAAQ,CAAC;YACvC,IAAI,OAAO,GAAG,cAAc,CAAC,OAAO,CAAC;YAErC,mDAAmD;YACnD,IAAI,SAAS,GAAG,0DAA6B,CAAC,kBAAkB,CAAC,OAAO,CAAC,CAAC;YAC1E,IAAI,SAAS,GAAG,0DAA6B,CAAC,qBAAqB,CACjE,QAAQ,CACT,CAAC;YACF,IAAI,QAAQ,GAAG,IAAI,0CAAqB,CACtC,OAAO,EACP,OAAO,CAAC,GAAG,EACX,SAAS,EACT,SAAS,EACT,EAAE,CACH,CAAC;YACF,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;SAC1B;QAED,OAAO,SAAS,CAAC;IACnB,CAAC;CACF;AArDD,oFAqDC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { PLSExportDataResponse } from './ExportDataResponse';
|
|
2
|
+
import { PLSExportDataRequest } from './ExportDataRequest';
|
|
3
|
+
export declare class PLSExportDataPrimaryResponseProducer {
|
|
4
|
+
constructor();
|
|
5
|
+
producePrimaryResponsesFromRequests(requests: Array<PLSExportDataRequest>): Array<PLSExportDataResponse>;
|
|
6
|
+
producePrimaryResponseFromRequest(request: PLSExportDataRequest): PLSExportDataResponse;
|
|
7
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
//
|
|
3
|
+
// PLSExportDataPrimaryResponseProducer.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.PLSExportDataPrimaryResponseProducer = void 0;
|
|
11
|
+
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
|
|
12
|
+
// MARK: - Imports
|
|
13
|
+
const ExportDataResponse_1 = require("./ExportDataResponse");
|
|
14
|
+
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
|
|
15
|
+
// MARK: - Definitions
|
|
16
|
+
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
|
|
17
|
+
// MARK: - Object definition
|
|
18
|
+
class PLSExportDataPrimaryResponseProducer {
|
|
19
|
+
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
|
|
20
|
+
// MARK: - Properties
|
|
21
|
+
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
|
|
22
|
+
// MARK: - Init
|
|
23
|
+
constructor() { }
|
|
24
|
+
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
|
|
25
|
+
// MARK: - Response production
|
|
26
|
+
producePrimaryResponsesFromRequests(requests) {
|
|
27
|
+
let responses = [];
|
|
28
|
+
for (let request of requests) {
|
|
29
|
+
let response = this.producePrimaryResponseFromRequest(request);
|
|
30
|
+
responses.push(response);
|
|
31
|
+
}
|
|
32
|
+
return responses;
|
|
33
|
+
}
|
|
34
|
+
producePrimaryResponseFromRequest(request) {
|
|
35
|
+
let response = new ExportDataResponse_1.PLSExportDataResponse(request, request.map, request.dataStore, request.nameStore, request.emittedContent);
|
|
36
|
+
return response;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
exports.PLSExportDataPrimaryResponseProducer = PLSExportDataPrimaryResponseProducer;
|
|
40
|
+
//# sourceMappingURL=ExportDataPrimaryResponseProducer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExportDataPrimaryResponseProducer.js","sourceRoot":"","sources":["../../../../../src/engine/generation/requests/ExportDataPrimaryResponseProducer.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,2CAA2C;AAC3C,aAAa;AACb,EAAE;AACF,2BAA2B;AAC3B,sDAAsD;AACtD,EAAE;;;AAEF,8GAA8G;AAC9G,kBAAkB;AAElB,6DAA6D;AAG7D,8GAA8G;AAC9G,sBAAsB;AAEtB,8GAA8G;AAC9G,4BAA4B;AAE5B,MAAa,oCAAoC;IAC/C,8GAA8G;IAC9G,qBAAqB;IAErB,8GAA8G;IAC9G,eAAe;IAEf,gBAAe,CAAC;IAEhB,8GAA8G;IAC9G,8BAA8B;IAE9B,mCAAmC,CACjC,QAAqC;QAErC,IAAI,SAAS,GAAiC,EAAE,CAAC;QACjD,KAAK,IAAI,OAAO,IAAI,QAAQ,EAAE;YAC5B,IAAI,QAAQ,GAAG,IAAI,CAAC,iCAAiC,CAAC,OAAO,CAAC,CAAC;YAC/D,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;SAC1B;QAED,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,iCAAiC,CAC/B,OAA6B;QAE7B,IAAI,QAAQ,GAAG,IAAI,0CAAqB,CACtC,OAAO,EACP,OAAO,CAAC,GAAG,EACX,OAAO,CAAC,SAAS,EACjB,OAAO,CAAC,SAAS,EACjB,OAAO,CAAC,cAAc,CACvB,CAAC;QACF,OAAO,QAAQ,CAAC;IAClB,CAAC;CACF;AApCD,oFAoCC"}
|