@fontoxml/fontoxml-development-tools 3.10.0 → 3.12.0-beta.1
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/npm-shrinkwrap.json +3842 -8330
- package/package.json +13 -19
- package/src/App.js +1 -1
- package/src/FdtCommand.js +3 -3
- package/src/FdtLicense.js +95 -114
- package/src/ModuleRegistrationApi.js +44 -16
- package/src/addCoreModulesToApp.js +8 -0
- package/src/editorVersions.js +19 -5
- package/src/modules/connectors/index.js +109 -16
- package/src/modules/connectors/instanceBuild/Dockerfile.build +1 -1
- package/src/modules/connectors/instanceBuild/Dockerfile.run +1 -1
- package/src/modules/connectors/instanceDevBuild/docker-compose.yml +2 -2
- package/src/modules/content-quality/index.js +101 -20
- package/src/modules/content-quality/instanceBuild/Dockerfile +1 -1
- package/src/modules/content-quality/instanceDevBuild/docker-compose.yml +1 -1
- package/src/modules/core/src/precontroller.help.js +23 -26
- package/src/modules/document-history/index.js +101 -20
- package/src/modules/document-history/instanceBuild/Dockerfile +1 -1
- package/src/modules/document-history/instanceDevBuild/docker-compose.yml +1 -1
- package/src/modules/editor/dev-cms/connectors-cms-standard/configureConnectorsCmsStandardDocumentRouter.js +10 -0
- package/src/modules/editor/dev-cms/connectors-cms-standard/configureDocumentHistoryGetPostRouteHandler.js +51 -0
- package/src/modules/editor/dev-cms/connectors-cms-standard/configureDocumentPostRouteHandler.js +65 -76
- package/src/modules/editor/dev-cms/connectors-cms-standard/configureDocumentPresearchPostRouteHandler.js +10 -7
- package/src/modules/editor/dev-cms/connectors-cms-standard/configureDocumentPreviewRouteHandler.js +10 -0
- package/src/modules/editor/dev-cms/connectors-cms-standard/configureDocumentRevisionGetPostRouteHandler.js +69 -0
- package/src/modules/editor/src/commands/command.convert.editor.controller.js +11 -4
- package/src/modules/editor/src/commands/command.convert.package.controller.js +11 -4
- package/src/modules/editor/src/getAppManifest.js +3 -3
- package/src/modules/editor/src/getWebpackConfig.js +13 -0
- package/src/modules/editor/src/webpackPlugins/CheckDeepImportsResolvePlugin.js +4 -0
- package/src/modules/editor-pre-7-7-0/src/api/downloadEditorSDK.js +16 -12
- package/src/modules/editor-pre-7-7-0/src/api/executeAndLog.js +3 -2
- package/src/modules/editor-pre-7-7-0/src/api/init/createConfigConfiguration.js +86 -48
- package/src/modules/editor-pre-7-7-0/src/api/schema/compile.js +16 -22
- package/src/modules/editor-pre-7-7-0/src/api/schema/createSchemaPackages.js +8 -0
- package/src/modules/editor-pre-7-7-0/src/api/schema/getSchemaFontoJson.js +76 -48
- package/src/modules/editor-pre-7-7-0/src/api/schema/zipHelpers.js +6 -1
- package/src/modules/editor-pre-7-7-0/src/command.schema.compile.controller.js +51 -2
- package/src/modules/editor-pre-7-7-0/test/api/init/createConfigConfiguration.test.js +71 -33
- package/src/modules/editor-pre-7-7-0/test/api/init/fixtures/configjs-7160.js +45 -0
- package/src/modules/editor-pre-7-7-0/test/api/init/fixtures/configjs-800.js +45 -0
- package/src/modules/editor-pre-7-7-0/test/api/init/fixtures/configjs-810.js +32 -0
- package/src/modules/editor-pre-7-7-0/test/api/schema/buildSchemaExperienceConfigurationModel.test.js +70 -79
- package/src/modules/editor-pre-7-7-0/test/api/schema/fixtures/dita-example-schema-bundle/listOfFiles.json +1 -36
- package/src/modules/editor-pre-7-7-0/test/api/schema/fixtures/invalid-fonto-json/fonto.json +1 -0
- package/src/modules/editor-pre-7-7-0/test/api/schema/getSchemaFontoJson.test.js +174 -0
- package/src/modules/editor-pre-7-7-0/test/api/schema/zipSchemaSource.test.js +10 -4
- package/src/modules/editor-pre-7-7-0/test/schemaCompileController.test.js +205 -0
- package/src/modules/localization/index.js +2 -2
- package/src/modules/operations/src/api/getOperations.js +3 -3
- package/src/modules/review/index.js +103 -18
- package/src/modules/review/instanceBuild/Dockerfile +1 -1
- package/src/modules/review/instanceDevBuild/docker-compose.yml +1 -1
- package/src/modules/schema/src/api/getSchemaSummaries.js +2 -2
- package/src/modules/schema/test/getSchemaSummaries.test.js +14 -10
- package/src/modules/schema-compiler/index.js +99 -18
- package/src/modules/schema-compiler/instanceBuild/Dockerfile +1 -1
- package/src/modules/schema-compiler/instanceDevBuild/docker-compose.yml +1 -1
- package/src/modules/shared/index.js +3 -0
- package/src/modules/shared/package.json +14 -0
- package/src/modules/shared/src/addBackendDockerCommands.js +334 -0
- package/src/modules/shared/src/addBackendDownloadSelfContainedCommands.js +78 -0
- package/src/modules/shared/src/addBackendVersionsCommands.js +55 -0
- package/src/modules/shared/src/controller-templates/command.backend.build.controller.factory.js +273 -0
- package/src/modules/shared/src/controller-templates/command.backend.download-self-contained.controller.factory.js +131 -0
- package/src/modules/shared/src/controller-templates/command.backend.init.controller.factory.js +88 -0
- package/src/modules/shared/src/controller-templates/command.backend.run.controller.factory.js +420 -0
- package/src/modules/shared/src/controller-templates/command.backend.upgrade.controller.factory.js +79 -0
- package/src/modules/shared/src/controller-templates/command.backend.versions.controller.factory.js +23 -0
- package/src/modules/shared/src/controller-templates/docker/BackendManifest.js +42 -0
- package/src/modules/shared/src/controller-templates/docker/copyWhitelistedFiles.js +23 -0
- package/src/modules/shared/src/controller-templates/docker/dockerCleanup.js +146 -0
- package/src/modules/shared/src/controller-templates/docker/tryDockerLogout.js +31 -0
- package/src/modules/shared/src/controller-templates/docker/validateBackendInstance.js +48 -0
- package/src/modules/shared/src/ensureDockerCommands.js +61 -0
- package/src/modules/shared/src/executeAndLog.js +113 -0
- package/src/modules/{review/src/utilities/setEntryVisibility.js → shared/src/setFileVisibility.js} +8 -2
- package/src/modules/spell-checker/index.js +101 -18
- package/src/modules/spell-checker/instanceBuild/Dockerfile +1 -1
- package/src/modules/spell-checker/instanceDevBuild/docker-compose.yml +1 -1
- package/test/module.shared.test.js +81 -0
- package/src/modules/connectors/src/command.build.controller.js +0 -256
- package/src/modules/connectors/src/command.build.js +0 -54
- package/src/modules/connectors/src/command.download-self-contained.controller.js +0 -110
- package/src/modules/connectors/src/command.download-self-contained.js +0 -50
- package/src/modules/connectors/src/command.init.controller.js +0 -91
- package/src/modules/connectors/src/command.init.js +0 -42
- package/src/modules/connectors/src/command.run.controller.js +0 -462
- package/src/modules/connectors/src/command.run.js +0 -67
- package/src/modules/connectors/src/command.upgrade.controller.js +0 -52
- package/src/modules/connectors/src/command.upgrade.js +0 -42
- package/src/modules/connectors/src/command.versions.controller.js +0 -14
- package/src/modules/connectors/src/command.versions.js +0 -25
- package/src/modules/connectors/src/utilities/FontoxmlConnectorsManifest.js +0 -32
- package/src/modules/connectors/src/utilities/cleanup.js +0 -70
- package/src/modules/connectors/src/utilities/constants.js +0 -42
- package/src/modules/connectors/src/utilities/copyWhitelistedFiles.js +0 -22
- package/src/modules/connectors/src/utilities/executeAndLog.js +0 -63
- package/src/modules/connectors/src/utilities/getVerbosityLevel.js +0 -11
- package/src/modules/connectors/src/utilities/getWhitelist.js +0 -16
- package/src/modules/connectors/src/utilities/setEntryVisibility.js +0 -22
- package/src/modules/connectors/src/utilities/validateInstance.js +0 -29
- package/src/modules/content-quality/src/command.build.controller.js +0 -260
- package/src/modules/content-quality/src/command.build.js +0 -56
- package/src/modules/content-quality/src/command.download-self-contained.controller.js +0 -110
- package/src/modules/content-quality/src/command.download-self-contained.js +0 -52
- package/src/modules/content-quality/src/command.init.controller.js +0 -91
- package/src/modules/content-quality/src/command.init.js +0 -44
- package/src/modules/content-quality/src/command.run.controller.js +0 -444
- package/src/modules/content-quality/src/command.run.js +0 -64
- package/src/modules/content-quality/src/command.upgrade.controller.js +0 -52
- package/src/modules/content-quality/src/command.upgrade.js +0 -44
- package/src/modules/content-quality/src/command.versions.controller.js +0 -14
- package/src/modules/content-quality/src/command.versions.js +0 -25
- package/src/modules/content-quality/src/utilities/FontoxmlFcqManifest.js +0 -30
- package/src/modules/content-quality/src/utilities/cleanup.js +0 -70
- package/src/modules/content-quality/src/utilities/constants.js +0 -44
- package/src/modules/content-quality/src/utilities/copyWhitelistedFiles.js +0 -22
- package/src/modules/content-quality/src/utilities/executeAndLog.js +0 -63
- package/src/modules/content-quality/src/utilities/getVerbosityLevel.js +0 -11
- package/src/modules/content-quality/src/utilities/getWhitelist.js +0 -16
- package/src/modules/content-quality/src/utilities/setEntryVisibility.js +0 -22
- package/src/modules/content-quality/src/utilities/validateInstance.js +0 -29
- package/src/modules/document-history/src/command.build.controller.js +0 -260
- package/src/modules/document-history/src/command.build.js +0 -56
- package/src/modules/document-history/src/command.download-self-contained.controller.js +0 -110
- package/src/modules/document-history/src/command.download-self-contained.js +0 -50
- package/src/modules/document-history/src/command.init.controller.js +0 -91
- package/src/modules/document-history/src/command.init.js +0 -44
- package/src/modules/document-history/src/command.run.controller.js +0 -444
- package/src/modules/document-history/src/command.run.js +0 -64
- package/src/modules/document-history/src/command.upgrade.controller.js +0 -52
- package/src/modules/document-history/src/command.upgrade.js +0 -44
- package/src/modules/document-history/src/command.versions.controller.js +0 -14
- package/src/modules/document-history/src/command.versions.js +0 -25
- package/src/modules/document-history/src/utilities/FontoxmlFdhManifest.js +0 -30
- package/src/modules/document-history/src/utilities/cleanup.js +0 -70
- package/src/modules/document-history/src/utilities/constants.js +0 -44
- package/src/modules/document-history/src/utilities/copyWhitelistedFiles.js +0 -22
- package/src/modules/document-history/src/utilities/executeAndLog.js +0 -63
- package/src/modules/document-history/src/utilities/getVerbosityLevel.js +0 -11
- package/src/modules/document-history/src/utilities/getWhitelist.js +0 -16
- package/src/modules/document-history/src/utilities/setEntryVisibility.js +0 -22
- package/src/modules/document-history/src/utilities/validateInstance.js +0 -29
- package/src/modules/review/src/command.build.controller.js +0 -256
- package/src/modules/review/src/command.build.js +0 -54
- package/src/modules/review/src/command.download-self-contained.controller.js +0 -107
- package/src/modules/review/src/command.download-self-contained.js +0 -50
- package/src/modules/review/src/command.init.controller.js +0 -89
- package/src/modules/review/src/command.init.js +0 -42
- package/src/modules/review/src/command.run.controller.js +0 -428
- package/src/modules/review/src/command.run.js +0 -60
- package/src/modules/review/src/command.upgrade.controller.js +0 -59
- package/src/modules/review/src/command.upgrade.js +0 -42
- package/src/modules/review/src/command.versions.controller.js +0 -12
- package/src/modules/review/src/command.versions.js +0 -25
- package/src/modules/review/src/utilities/FontoxmlReviewManifest.js +0 -30
- package/src/modules/review/src/utilities/cleanup.js +0 -70
- package/src/modules/review/src/utilities/constants.js +0 -42
- package/src/modules/review/src/utilities/copyWhitelistedFiles.js +0 -22
- package/src/modules/review/src/utilities/executeAndLog.js +0 -63
- package/src/modules/review/src/utilities/getVerbosityLevel.js +0 -11
- package/src/modules/review/src/utilities/getWhitelist.js +0 -16
- package/src/modules/review/src/utilities/validateInstance.js +0 -45
- package/src/modules/schema-compiler/src/command.build.controller.js +0 -256
- package/src/modules/schema-compiler/src/command.build.js +0 -54
- package/src/modules/schema-compiler/src/command.download-self-contained.controller.js +0 -110
- package/src/modules/schema-compiler/src/command.download-self-contained.js +0 -50
- package/src/modules/schema-compiler/src/command.init.controller.js +0 -91
- package/src/modules/schema-compiler/src/command.init.js +0 -42
- package/src/modules/schema-compiler/src/command.run.controller.js +0 -430
- package/src/modules/schema-compiler/src/command.run.js +0 -60
- package/src/modules/schema-compiler/src/command.upgrade.controller.js +0 -64
- package/src/modules/schema-compiler/src/command.upgrade.js +0 -42
- package/src/modules/schema-compiler/src/command.versions.controller.js +0 -14
- package/src/modules/schema-compiler/src/command.versions.js +0 -25
- package/src/modules/schema-compiler/src/utilities/FontoxmlSchemaCompilerManifest.js +0 -32
- package/src/modules/schema-compiler/src/utilities/cleanup.js +0 -70
- package/src/modules/schema-compiler/src/utilities/constants.js +0 -43
- package/src/modules/schema-compiler/src/utilities/copyWhitelistedFiles.js +0 -22
- package/src/modules/schema-compiler/src/utilities/executeAndLog.js +0 -63
- package/src/modules/schema-compiler/src/utilities/getVerbosityLevel.js +0 -11
- package/src/modules/schema-compiler/src/utilities/getWhitelist.js +0 -16
- package/src/modules/schema-compiler/src/utilities/setEntryVisibility.js +0 -22
- package/src/modules/schema-compiler/src/utilities/validateInstance.js +0 -47
- package/src/modules/spell-checker/src/command.build.controller.js +0 -257
- package/src/modules/spell-checker/src/command.build.js +0 -54
- package/src/modules/spell-checker/src/command.download-self-contained.controller.js +0 -110
- package/src/modules/spell-checker/src/command.download-self-contained.js +0 -50
- package/src/modules/spell-checker/src/command.init.controller.js +0 -91
- package/src/modules/spell-checker/src/command.init.js +0 -42
- package/src/modules/spell-checker/src/command.run.controller.js +0 -430
- package/src/modules/spell-checker/src/command.run.js +0 -62
- package/src/modules/spell-checker/src/command.upgrade.controller.js +0 -61
- package/src/modules/spell-checker/src/command.upgrade.js +0 -42
- package/src/modules/spell-checker/src/command.versions.controller.js +0 -14
- package/src/modules/spell-checker/src/command.versions.js +0 -25
- package/src/modules/spell-checker/src/utilities/FontoxmlSpellCheckerManifest.js +0 -32
- package/src/modules/spell-checker/src/utilities/cleanup.js +0 -70
- package/src/modules/spell-checker/src/utilities/constants.js +0 -42
- package/src/modules/spell-checker/src/utilities/copyWhitelistedFiles.js +0 -22
- package/src/modules/spell-checker/src/utilities/executeAndLog.js +0 -63
- package/src/modules/spell-checker/src/utilities/getVerbosityLevel.js +0 -11
- package/src/modules/spell-checker/src/utilities/getWhitelist.js +0 -16
- package/src/modules/spell-checker/src/utilities/setEntryVisibility.js +0 -22
- package/src/modules/spell-checker/src/utilities/validateInstance.js +0 -47
|
@@ -1,23 +1,116 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import commandVersions from './src/command.versions.js';
|
|
1
|
+
import path from 'path';
|
|
2
|
+
import { fileURLToPath, pathToFileURL } from 'url';
|
|
3
|
+
|
|
4
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
5
|
+
const __dirname = path.dirname(__filename);
|
|
7
6
|
|
|
8
7
|
export default async (moduleRegistration) => {
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
const options = {
|
|
9
|
+
licenseProductName: 'connectors',
|
|
10
|
+
licensesRequired: ['connectors'],
|
|
11
|
+
productLabel: 'Fonto Connectors',
|
|
12
|
+
commandPrefix: 'connectors',
|
|
13
|
+
|
|
14
|
+
documentationConfigurationGuide:
|
|
15
|
+
'http://documentation.fontoxml.com/display/FC/Connectors+configuration',
|
|
16
|
+
documentationExecuteError:
|
|
17
|
+
'http://documentation.fontoxml.com/display/FC/Troubleshooting',
|
|
18
|
+
documentationGettingStartedGuide:
|
|
19
|
+
'http://documentation.fontoxml.com/display/FC/Getting+started',
|
|
20
|
+
|
|
21
|
+
defaultHttpPort: 6010,
|
|
22
|
+
defaultHttpsPort: 6011,
|
|
23
|
+
defaultImageName: 'fonto-connectors',
|
|
24
|
+
defaultImageTag: 'latest',
|
|
25
|
+
|
|
26
|
+
manifestFileName: '.fontoxmlConnectorsManifest',
|
|
27
|
+
manifestVersionPropertyName: 'connectorsVersion',
|
|
28
|
+
|
|
29
|
+
instanceBuildDockerfilePath: path.join(
|
|
30
|
+
__dirname,
|
|
31
|
+
'instanceBuild',
|
|
32
|
+
'Dockerfile.build'
|
|
33
|
+
),
|
|
34
|
+
instanceDevBuildDirectoryPath: path.join(__dirname, 'instanceDevBuild'),
|
|
35
|
+
instanceDevBuildDockerfilePath: path.join(
|
|
36
|
+
__dirname,
|
|
37
|
+
'instanceBuild',
|
|
38
|
+
'Dockerfile.run'
|
|
39
|
+
),
|
|
40
|
+
instanceTemplateDirectoryPath: path.join(__dirname, 'instanceTemplate'),
|
|
41
|
+
|
|
42
|
+
requiredConfiguration: [
|
|
43
|
+
'editor',
|
|
44
|
+
'templates',
|
|
45
|
+
'documentProcessing.xml',
|
|
46
|
+
],
|
|
47
|
+
temporaryDirectoryName: '.connectorsTmp',
|
|
48
|
+
temporaryBuildDirectoryName: '.connectorsBuildTmp',
|
|
49
|
+
whitelist: [
|
|
50
|
+
// Required.
|
|
51
|
+
'documentProcessing.xml',
|
|
52
|
+
'editor',
|
|
53
|
+
'processing',
|
|
54
|
+
'templates',
|
|
55
|
+
// Optional
|
|
56
|
+
'initializer-files',
|
|
57
|
+
'nlog.config',
|
|
58
|
+
],
|
|
12
59
|
|
|
13
|
-
|
|
60
|
+
debugEnvEntries: {
|
|
61
|
+
fc__logging__logLevel: 'Trace',
|
|
62
|
+
},
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
const command = moduleRegistration
|
|
66
|
+
.registerHiddenCommand(options.commandPrefix)
|
|
67
|
+
.setDescription(
|
|
68
|
+
`Provides tools for working with ${options.productLabel}.`
|
|
69
|
+
)
|
|
70
|
+
|
|
71
|
+
.addRequiredProductLicenses(options.licensesRequired)
|
|
14
72
|
.setHideIfMissingRequiredProductLicenses()
|
|
15
73
|
.setAsHelpCommand();
|
|
16
74
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
75
|
+
if (options.commandAlias) {
|
|
76
|
+
command.addAlias(options.commandAlias);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
const sharedModulePath = moduleRegistration.getPathToModule(
|
|
80
|
+
'@fontoxml/fontoxml-development-tools-module-shared'
|
|
81
|
+
);
|
|
82
|
+
|
|
83
|
+
// Add the docker based commands.
|
|
84
|
+
const addBackendDockerCommandsPath = pathToFileURL(
|
|
85
|
+
path.resolve(sharedModulePath, 'src/addBackendDockerCommands.js')
|
|
86
|
+
);
|
|
87
|
+
const addBackendDockerCommands = (
|
|
88
|
+
await import(addBackendDockerCommandsPath)
|
|
89
|
+
).default;
|
|
90
|
+
addBackendDockerCommands(moduleRegistration, command, options);
|
|
91
|
+
|
|
92
|
+
// Add the version commands.
|
|
93
|
+
const addBackendVersionsCommandsPath = pathToFileURL(
|
|
94
|
+
path.resolve(sharedModulePath, 'src/addBackendVersionsCommands.js')
|
|
95
|
+
);
|
|
96
|
+
const addBackendVersionsCommands = (
|
|
97
|
+
await import(addBackendVersionsCommandsPath)
|
|
98
|
+
).default;
|
|
99
|
+
addBackendVersionsCommands(moduleRegistration, command, options);
|
|
100
|
+
|
|
101
|
+
// Add the download-self-contained command.
|
|
102
|
+
const addBackendDownloadSelfContainedCommandsPath = pathToFileURL(
|
|
103
|
+
path.resolve(
|
|
104
|
+
sharedModulePath,
|
|
105
|
+
'src/addBackendDownloadSelfContainedCommands.js'
|
|
106
|
+
)
|
|
107
|
+
);
|
|
108
|
+
const addBackendDownloadSelfContainedCommands = (
|
|
109
|
+
await import(addBackendDownloadSelfContainedCommandsPath)
|
|
110
|
+
).default;
|
|
111
|
+
addBackendDownloadSelfContainedCommands(
|
|
112
|
+
moduleRegistration,
|
|
113
|
+
command,
|
|
114
|
+
options
|
|
115
|
+
);
|
|
23
116
|
};
|
|
@@ -1,27 +1,108 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
import path from 'path';
|
|
2
|
+
import { fileURLToPath, pathToFileURL } from 'url';
|
|
3
|
+
|
|
4
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
5
|
+
const __dirname = path.dirname(__filename);
|
|
6
|
+
|
|
7
|
+
export default async (moduleRegistration) => {
|
|
8
|
+
const options = {
|
|
9
|
+
licenseProductName: 'content-quality',
|
|
10
|
+
licensesRequired: ['content-quality'],
|
|
11
|
+
productLabel: 'Fonto Content Quality',
|
|
12
|
+
commandPrefix: 'content-quality',
|
|
13
|
+
commandAlias: 'fcq',
|
|
14
|
+
|
|
15
|
+
documentationConfigurationGuide:
|
|
16
|
+
'https://documentation.fontoxml.com/latest/configuration-f6814dd919fd',
|
|
17
|
+
documentationExecuteError:
|
|
18
|
+
'https://documentation.fontoxml.com/latest/troubleshooting-fc105f9f1e60',
|
|
19
|
+
documentationGettingStartedGuide:
|
|
20
|
+
'https://documentation.fontoxml.com/latest/getting-started-86c3404e841c',
|
|
21
|
+
|
|
22
|
+
defaultHttpPort: 6000,
|
|
23
|
+
defaultImageName: 'fonto-content-quality',
|
|
24
|
+
defaultImageTag: 'latest',
|
|
25
|
+
|
|
26
|
+
manifestFileName: '.fontoxmlFcqManifest',
|
|
27
|
+
manifestVersionPropertyName: 'fcqVersion',
|
|
28
|
+
|
|
29
|
+
instanceBuildDockerfilePath: path.join(
|
|
30
|
+
__dirname,
|
|
31
|
+
'instanceBuild',
|
|
32
|
+
'Dockerfile'
|
|
33
|
+
),
|
|
34
|
+
instanceDevBuildDirectoryPath: path.join(__dirname, 'instanceDevBuild'),
|
|
35
|
+
instanceDevBuildDockerfilePath: path.join(
|
|
36
|
+
__dirname,
|
|
37
|
+
'instanceBuild',
|
|
38
|
+
'Dockerfile'
|
|
39
|
+
),
|
|
40
|
+
instanceTemplateDirectoryPath: path.join(__dirname, 'instanceTemplate'),
|
|
41
|
+
|
|
42
|
+
requiredConfiguration: ['Configuration'],
|
|
43
|
+
temporaryDirectoryName: '.contentQualityTmp',
|
|
44
|
+
temporaryBuildDirectoryName: '.contentQualityBuildTmp',
|
|
45
|
+
whitelist: [
|
|
46
|
+
// Required.
|
|
47
|
+
'Configuration',
|
|
48
|
+
// Optional.
|
|
49
|
+
'nlog.config',
|
|
50
|
+
],
|
|
51
|
+
|
|
52
|
+
debugEnvEntries: {
|
|
53
|
+
Logging__LogLevel__Default: 'Trace',
|
|
54
|
+
},
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
const command = moduleRegistration
|
|
58
|
+
.registerCommand(options.commandPrefix)
|
|
12
59
|
.setDescription(
|
|
13
|
-
|
|
60
|
+
`Provides tools for working with ${options.productLabel}.`
|
|
14
61
|
)
|
|
15
|
-
.addAlias(constants.COMMAND_PREFIX_ALIAS)
|
|
16
62
|
|
|
17
|
-
.addRequiredProductLicenses(
|
|
63
|
+
.addRequiredProductLicenses(options.licensesRequired)
|
|
18
64
|
.setHideIfMissingRequiredProductLicenses()
|
|
19
65
|
.setAsHelpCommand();
|
|
20
66
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
67
|
+
if (options.commandAlias) {
|
|
68
|
+
command.addAlias(options.commandAlias);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
const sharedModulePath = moduleRegistration.getPathToModule(
|
|
72
|
+
'@fontoxml/fontoxml-development-tools-module-shared'
|
|
73
|
+
);
|
|
74
|
+
|
|
75
|
+
// Add the docker based commands.
|
|
76
|
+
const addBackendDockerCommandsPath = pathToFileURL(
|
|
77
|
+
path.resolve(sharedModulePath, 'src/addBackendDockerCommands.js')
|
|
78
|
+
);
|
|
79
|
+
const addBackendDockerCommands = (
|
|
80
|
+
await import(addBackendDockerCommandsPath)
|
|
81
|
+
).default;
|
|
82
|
+
addBackendDockerCommands(moduleRegistration, command, options);
|
|
83
|
+
|
|
84
|
+
// Add the version commands.
|
|
85
|
+
const addBackendVersionsCommandsPath = pathToFileURL(
|
|
86
|
+
path.resolve(sharedModulePath, 'src/addBackendVersionsCommands.js')
|
|
87
|
+
);
|
|
88
|
+
const addBackendVersionsCommands = (
|
|
89
|
+
await import(addBackendVersionsCommandsPath)
|
|
90
|
+
).default;
|
|
91
|
+
addBackendVersionsCommands(moduleRegistration, command, options);
|
|
92
|
+
|
|
93
|
+
// Add the download-self-contained command.
|
|
94
|
+
const addBackendDownloadSelfContainedCommandsPath = pathToFileURL(
|
|
95
|
+
path.resolve(
|
|
96
|
+
sharedModulePath,
|
|
97
|
+
'src/addBackendDownloadSelfContainedCommands.js'
|
|
98
|
+
)
|
|
99
|
+
);
|
|
100
|
+
const addBackendDownloadSelfContainedCommands = (
|
|
101
|
+
await import(addBackendDownloadSelfContainedCommandsPath)
|
|
102
|
+
).default;
|
|
103
|
+
addBackendDownloadSelfContainedCommands(
|
|
104
|
+
moduleRegistration,
|
|
105
|
+
command,
|
|
106
|
+
options
|
|
107
|
+
);
|
|
27
108
|
};
|
|
@@ -64,26 +64,26 @@ export default (moduleRegistration, app) => {
|
|
|
64
64
|
res.debug(command.longDescription);
|
|
65
65
|
}
|
|
66
66
|
|
|
67
|
-
|
|
67
|
+
const visibleChildren = command.children.filter((child) => {
|
|
68
|
+
if (child.hidden) {
|
|
69
|
+
return false;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
if (
|
|
73
|
+
child.hideIfMissingRequiredProductLicenses &&
|
|
74
|
+
!req.fdt.license.hasProductLicenses(
|
|
75
|
+
child.requiredProductLicenses
|
|
76
|
+
)
|
|
77
|
+
) {
|
|
78
|
+
return false;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
return true;
|
|
82
|
+
});
|
|
83
|
+
if (visibleChildren.length) {
|
|
68
84
|
res.caption('Child commands');
|
|
69
|
-
|
|
85
|
+
visibleChildren
|
|
70
86
|
.sort(sortByName)
|
|
71
|
-
.filter((child) => {
|
|
72
|
-
if (child.hidden) {
|
|
73
|
-
return false;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
if (
|
|
77
|
-
child.hideIfMissingRequiredProductLicenses &&
|
|
78
|
-
!req.fdt.license.hasProductLicenses(
|
|
79
|
-
child.requiredProductLicenses
|
|
80
|
-
)
|
|
81
|
-
) {
|
|
82
|
-
return false;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
return true;
|
|
86
|
-
})
|
|
87
87
|
.forEach((child) =>
|
|
88
88
|
res.definition(child.name, child.description)
|
|
89
89
|
);
|
|
@@ -94,15 +94,12 @@ export default (moduleRegistration, app) => {
|
|
|
94
94
|
res.properties(command.parameters.map(toParameterRow));
|
|
95
95
|
}
|
|
96
96
|
|
|
97
|
-
const
|
|
98
|
-
|
|
97
|
+
const visibleOptions = command.options.filter(
|
|
98
|
+
(option) => !option.hidden
|
|
99
|
+
);
|
|
100
|
+
if (visibleOptions.length) {
|
|
99
101
|
res.caption('Options');
|
|
100
|
-
res.properties(
|
|
101
|
-
options
|
|
102
|
-
.filter((option) => !option.hidden)
|
|
103
|
-
.sort(sortByName)
|
|
104
|
-
.map(toOptionRow)
|
|
105
|
-
);
|
|
102
|
+
res.properties(visibleOptions.sort(sortByName).map(toOptionRow));
|
|
106
103
|
}
|
|
107
104
|
|
|
108
105
|
const examples = command.examples;
|
|
@@ -1,27 +1,108 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
import path from 'path';
|
|
2
|
+
import { fileURLToPath, pathToFileURL } from 'url';
|
|
3
|
+
|
|
4
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
5
|
+
const __dirname = path.dirname(__filename);
|
|
6
|
+
|
|
7
|
+
export default async (moduleRegistration) => {
|
|
8
|
+
const options = {
|
|
9
|
+
licenseProductName: 'document-history',
|
|
10
|
+
licensesRequired: ['document-history'],
|
|
11
|
+
productLabel: 'Fonto Document History',
|
|
12
|
+
commandPrefix: 'document-history',
|
|
13
|
+
commandAlias: 'fdh',
|
|
14
|
+
|
|
15
|
+
documentationConfigurationGuide:
|
|
16
|
+
'https://documentation.fontoxml.com/latest/fonto-document-history-5a117c375303',
|
|
17
|
+
documentationExecuteError:
|
|
18
|
+
'https://documentation.fontoxml.com/latest/fonto-document-history-5a117c375303',
|
|
19
|
+
documentationGettingStartedGuide:
|
|
20
|
+
'https://documentation.fontoxml.com/latest/fonto-document-history-5a117c375303',
|
|
21
|
+
|
|
22
|
+
defaultHttpPort: 6030,
|
|
23
|
+
defaultImageName: 'fonto-document-history',
|
|
24
|
+
defaultImageTag: 'latest',
|
|
25
|
+
|
|
26
|
+
manifestFileName: '.fontoxmlFdhManifest',
|
|
27
|
+
manifestVersionPropertyName: 'fdhVersion',
|
|
28
|
+
|
|
29
|
+
instanceBuildDockerfilePath: path.join(
|
|
30
|
+
__dirname,
|
|
31
|
+
'instanceBuild',
|
|
32
|
+
'Dockerfile'
|
|
33
|
+
),
|
|
34
|
+
instanceDevBuildDirectoryPath: path.join(__dirname, 'instanceDevBuild'),
|
|
35
|
+
instanceDevBuildDockerfilePath: path.join(
|
|
36
|
+
__dirname,
|
|
37
|
+
'instanceBuild',
|
|
38
|
+
'Dockerfile'
|
|
39
|
+
),
|
|
40
|
+
instanceTemplateDirectoryPath: path.join(__dirname, 'instanceTemplate'),
|
|
41
|
+
|
|
42
|
+
requiredConfiguration: ['Configuration'],
|
|
43
|
+
temporaryDirectoryName: '.documentHistoryTmp',
|
|
44
|
+
temporaryBuildDirectoryName: '.documentHistoryBuildTmp',
|
|
45
|
+
whitelist: [
|
|
46
|
+
// Required.
|
|
47
|
+
'Configuration',
|
|
48
|
+
// Optional.
|
|
49
|
+
'nlog.config',
|
|
50
|
+
],
|
|
51
|
+
|
|
52
|
+
debugEnvEntries: {
|
|
53
|
+
Logging__LogLevel__Default: 'Trace',
|
|
54
|
+
},
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
const command = moduleRegistration
|
|
58
|
+
.registerCommand(options.commandPrefix)
|
|
12
59
|
.setDescription(
|
|
13
|
-
|
|
60
|
+
`Provides tools for working with ${options.productLabel}.`
|
|
14
61
|
)
|
|
15
|
-
.addAlias(constants.COMMAND_PREFIX_ALIAS)
|
|
16
62
|
|
|
17
|
-
.addRequiredProductLicenses(
|
|
63
|
+
.addRequiredProductLicenses(options.licensesRequired)
|
|
18
64
|
.setHideIfMissingRequiredProductLicenses()
|
|
19
65
|
.setAsHelpCommand();
|
|
20
66
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
67
|
+
if (options.commandAlias) {
|
|
68
|
+
command.addAlias(options.commandAlias);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
const sharedModulePath = moduleRegistration.getPathToModule(
|
|
72
|
+
'@fontoxml/fontoxml-development-tools-module-shared'
|
|
73
|
+
);
|
|
74
|
+
|
|
75
|
+
// Add the docker based commands.
|
|
76
|
+
const addBackendDockerCommandsPath = pathToFileURL(
|
|
77
|
+
path.resolve(sharedModulePath, 'src/addBackendDockerCommands.js')
|
|
78
|
+
);
|
|
79
|
+
const addBackendDockerCommands = (
|
|
80
|
+
await import(addBackendDockerCommandsPath)
|
|
81
|
+
).default;
|
|
82
|
+
addBackendDockerCommands(moduleRegistration, command, options);
|
|
83
|
+
|
|
84
|
+
// Add the version commands.
|
|
85
|
+
const addBackendVersionsCommandsPath = pathToFileURL(
|
|
86
|
+
path.resolve(sharedModulePath, 'src/addBackendVersionsCommands.js')
|
|
87
|
+
);
|
|
88
|
+
const addBackendVersionsCommands = (
|
|
89
|
+
await import(addBackendVersionsCommandsPath)
|
|
90
|
+
).default;
|
|
91
|
+
addBackendVersionsCommands(moduleRegistration, command, options);
|
|
92
|
+
|
|
93
|
+
// Add the download-self-contained command.
|
|
94
|
+
const addBackendDownloadSelfContainedCommandsPath = pathToFileURL(
|
|
95
|
+
path.resolve(
|
|
96
|
+
sharedModulePath,
|
|
97
|
+
'src/addBackendDownloadSelfContainedCommands.js'
|
|
98
|
+
)
|
|
99
|
+
);
|
|
100
|
+
const addBackendDownloadSelfContainedCommands = (
|
|
101
|
+
await import(addBackendDownloadSelfContainedCommandsPath)
|
|
102
|
+
).default;
|
|
103
|
+
addBackendDownloadSelfContainedCommands(
|
|
104
|
+
moduleRegistration,
|
|
105
|
+
command,
|
|
106
|
+
options
|
|
107
|
+
);
|
|
27
108
|
};
|
|
@@ -2,12 +2,14 @@ import express from 'express';
|
|
|
2
2
|
|
|
3
3
|
import configureDocumentCompareRouteHandler from './configureDocumentCompareRouteHandler.js';
|
|
4
4
|
import configureDocumentGetRouteHandler from './configureDocumentGetRouteHandler.js';
|
|
5
|
+
import configureDocumentHistoryGetPostRouteHandler from './configureDocumentHistoryGetPostRouteHandler.js';
|
|
5
6
|
import configureDocumentHistoryGetRouteHandler from './configureDocumentHistoryGetRouteHandler.js';
|
|
6
7
|
import configureDocumentLockPutRouteHandler from './configureDocumentLockPutRouteHandler.js';
|
|
7
8
|
import configureDocumentPostRouteHandler from './configureDocumentPostRouteHandler.js';
|
|
8
9
|
import configureDocumentPresearchPostRouteHandler from './configureDocumentPresearchPostRouteHandler.js';
|
|
9
10
|
import configureDocumentPreviewRouteHandler from './configureDocumentPreviewRouteHandler.js';
|
|
10
11
|
import configureDocumentPutRouteHandler from './configureDocumentPutRouteHandler.js';
|
|
12
|
+
import configureDocumentRevisionGetPostRouteHandler from './configureDocumentRevisionGetPostRouteHandler.js';
|
|
11
13
|
import configureDocumentRevisionGetRouteHandler from './configureDocumentRevisionGetRouteHandler.js';
|
|
12
14
|
import configureDocumentStatePostRouteHandler from './configureDocumentStatePostRouteHandler.js';
|
|
13
15
|
|
|
@@ -25,6 +27,10 @@ function configureConnectorsCmsStandardDocumentRouter(config) {
|
|
|
25
27
|
.route('/connectors/cms/standard/document/history')
|
|
26
28
|
.get(configureDocumentHistoryGetRouteHandler());
|
|
27
29
|
|
|
30
|
+
connectorsCmsStandardDocumentRouter
|
|
31
|
+
.route('/connectors/cms/standard/document/history/get')
|
|
32
|
+
.post(configureDocumentHistoryGetPostRouteHandler());
|
|
33
|
+
|
|
28
34
|
connectorsCmsStandardDocumentRouter
|
|
29
35
|
.route('/connectors/cms/standard/document/compare')
|
|
30
36
|
.get(configureDocumentCompareRouteHandler());
|
|
@@ -49,6 +55,10 @@ function configureConnectorsCmsStandardDocumentRouter(config) {
|
|
|
49
55
|
.route('/connectors/cms/standard/document/revision')
|
|
50
56
|
.get(configureDocumentRevisionGetRouteHandler());
|
|
51
57
|
|
|
58
|
+
connectorsCmsStandardDocumentRouter
|
|
59
|
+
.route('/connectors/cms/standard/document/revision/get')
|
|
60
|
+
.post(configureDocumentRevisionGetPostRouteHandler());
|
|
61
|
+
|
|
52
62
|
return connectorsCmsStandardDocumentRouter;
|
|
53
63
|
}
|
|
54
64
|
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
export default function configureDocumentHistoryGetPostRouteHandler() {
|
|
2
|
+
return (req, res) => {
|
|
3
|
+
const documentIds = req.body.documentIds;
|
|
4
|
+
const correlationIdRepository = req.repositories.correlationId;
|
|
5
|
+
|
|
6
|
+
// Because these requests do not originate from the editor, but from another server, we
|
|
7
|
+
// have no edit session token. We do, however, have an correlationId which we may resolve
|
|
8
|
+
// to the editSessionToken used by the corresponding call to the proxy
|
|
9
|
+
const editSessionToken =
|
|
10
|
+
correlationIdRepository.getEditSessionTokenForRequest(req);
|
|
11
|
+
|
|
12
|
+
const promises = documentIds.map((documentId) => {
|
|
13
|
+
return new Promise((resolve, _) => {
|
|
14
|
+
req.cms.loadHistory(
|
|
15
|
+
documentId,
|
|
16
|
+
editSessionToken,
|
|
17
|
+
(error, revisions) => {
|
|
18
|
+
const historyResponse = { documentId };
|
|
19
|
+
if (error) {
|
|
20
|
+
historyResponse.status = 404;
|
|
21
|
+
} else {
|
|
22
|
+
historyResponse.status = 200;
|
|
23
|
+
|
|
24
|
+
const newestRevision = revisions[0];
|
|
25
|
+
const newestRevisionIsWorkingCopy =
|
|
26
|
+
!!newestRevision &&
|
|
27
|
+
newestRevision._editSessionToken ===
|
|
28
|
+
editSessionToken;
|
|
29
|
+
|
|
30
|
+
historyResponse.history = {
|
|
31
|
+
newestRevisionIsWorkingCopy,
|
|
32
|
+
revisions,
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
resolve(historyResponse);
|
|
36
|
+
}
|
|
37
|
+
);
|
|
38
|
+
});
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
Promise.all(promises).then((results) => {
|
|
42
|
+
const response = {
|
|
43
|
+
results,
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
res.status(200)
|
|
47
|
+
.set('content-type', 'application/json; charset=utf-8')
|
|
48
|
+
.json(response);
|
|
49
|
+
});
|
|
50
|
+
};
|
|
51
|
+
}
|