orator-conversion 1.0.6 → 1.0.8
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "orator-conversion",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.8",
|
|
4
4
|
"description": "File format conversion endpoints for Orator service servers.",
|
|
5
5
|
"main": "source/Orator-File-Translation.js",
|
|
6
6
|
"scripts": {
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"dependencies": {
|
|
44
44
|
"fable-serviceproviderbase": "^3.0.19",
|
|
45
45
|
"sharp": "^0.34.5",
|
|
46
|
-
"ultravisor-beacon": "^0.0.
|
|
46
|
+
"ultravisor-beacon": "^0.0.8",
|
|
47
47
|
"ws": "^8.20.0"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
@@ -46,6 +46,13 @@ class OratorConversionBeaconProvider extends libBeaconCapabilityProvider
|
|
|
46
46
|
this.Name = 'OratorConversion';
|
|
47
47
|
this.Capability = 'MediaConversion';
|
|
48
48
|
|
|
49
|
+
this.log = (this._ProviderConfig && this._ProviderConfig.Log) || {
|
|
50
|
+
trace: (...pArgs) => { console.log(...pArgs); },
|
|
51
|
+
info: (...pArgs) => { console.log(...pArgs); },
|
|
52
|
+
warn: (...pArgs) => { console.warn(...pArgs); },
|
|
53
|
+
error: (...pArgs) => { console.error(...pArgs); }
|
|
54
|
+
};
|
|
55
|
+
|
|
49
56
|
this._Core = new libConversionCore({
|
|
50
57
|
PdftkPath: this._ProviderConfig.PdftkPath || 'pdftk',
|
|
51
58
|
PdftoppmPath: this._ProviderConfig.PdftoppmPath || 'pdftoppm',
|
|
@@ -233,27 +240,27 @@ class OratorConversionBeaconProvider extends libBeaconCapabilityProvider
|
|
|
233
240
|
return fCallback(new Error(`OratorConversion provider requires Sharp: ${pSharpError.message}`));
|
|
234
241
|
}
|
|
235
242
|
this._SharpAvailable = true;
|
|
236
|
-
|
|
243
|
+
this.log.info(` [OratorConversion] Sharp: available`);
|
|
237
244
|
|
|
238
245
|
this._Core.checkPdftoppm((pPdftoppmError, pPdftoppmAvailable) =>
|
|
239
246
|
{
|
|
240
247
|
this._PdftoppmAvailable = !pPdftoppmError;
|
|
241
|
-
|
|
248
|
+
this.log.info(` [OratorConversion] pdftoppm: ${this._PdftoppmAvailable ? 'available' : 'not found (PDF actions disabled)'}`);
|
|
242
249
|
|
|
243
250
|
this._Core.checkPdftk((pPdftkError, pPdftkAvailable) =>
|
|
244
251
|
{
|
|
245
252
|
this._PdftkAvailable = !pPdftkError;
|
|
246
|
-
|
|
253
|
+
this.log.info(` [OratorConversion] pdftk: ${this._PdftkAvailable ? 'available' : 'not found (PDF extraction disabled)'}`);
|
|
247
254
|
|
|
248
255
|
this._Core.checkFfmpeg((pFfmpegError, pFfmpegAvailable) =>
|
|
249
256
|
{
|
|
250
257
|
this._FfmpegAvailable = !pFfmpegError;
|
|
251
|
-
|
|
258
|
+
this.log.info(` [OratorConversion] ffmpeg: ${this._FfmpegAvailable ? 'available' : 'not found (video/audio actions disabled)'}`);
|
|
252
259
|
|
|
253
260
|
this._Core.checkFfprobe((pFfprobeError, pFfprobeAvailable) =>
|
|
254
261
|
{
|
|
255
262
|
this._FfprobeAvailable = !pFfprobeError;
|
|
256
|
-
|
|
263
|
+
this.log.info(` [OratorConversion] ffprobe: ${this._FfprobeAvailable ? 'available' : 'not found (media probe disabled)'}`);
|
|
257
264
|
|
|
258
265
|
return fCallback(null);
|
|
259
266
|
});
|
|
@@ -268,7 +275,7 @@ class OratorConversionBeaconProvider extends libBeaconCapabilityProvider
|
|
|
268
275
|
*/
|
|
269
276
|
execute(pAction, pWorkItem, pContext, fCallback, fReportProgress)
|
|
270
277
|
{
|
|
271
|
-
let tmpLog = pContext && pContext.log ? pContext.log :
|
|
278
|
+
let tmpLog = pContext && pContext.log ? pContext.log : this.log;
|
|
272
279
|
tmpLog.info(`[OratorConversion] execute: action="${pAction}" workItem=${pWorkItem.WorkItemHash || '?'} settings=${JSON.stringify(pWorkItem.Settings || {}).substring(0, 200)}`);
|
|
273
280
|
let tmpSettings = pWorkItem.Settings || {};
|
|
274
281
|
let tmpStagingPath = pContext.StagingPath || process.cwd();
|
|
@@ -529,6 +529,10 @@ class OratorFileTranslation extends libFableServiceProviderBase
|
|
|
529
529
|
* - MaxConcurrent {number} Max concurrent work items (default: 2)
|
|
530
530
|
* - StagingPath {string} Local staging directory (default: cwd)
|
|
531
531
|
* - Tags {object} Beacon tags (default: {})
|
|
532
|
+
* - HostID {string} Override for the host identity (default: os.hostname())
|
|
533
|
+
* - SharedMounts {Array<{MountID, Root}>} Shared filesystem mounts to advertise
|
|
534
|
+
* so the reachability matrix can detect zero-copy paths between this
|
|
535
|
+
* beacon and other beacons on the same host
|
|
532
536
|
* @param {Function} fCallback Called with (pError, pBeaconInfo)
|
|
533
537
|
*/
|
|
534
538
|
connectBeacon(pBeaconConfig, fCallback)
|
|
@@ -560,8 +564,10 @@ class OratorFileTranslation extends libFableServiceProviderBase
|
|
|
560
564
|
// Already exists — fine
|
|
561
565
|
}
|
|
562
566
|
|
|
563
|
-
//
|
|
564
|
-
|
|
567
|
+
// Build the beacon service options. SharedMounts is forwarded as-is so
|
|
568
|
+
// the caller controls which mounts get advertised — and matches the
|
|
569
|
+
// MountID computation done by other beacons on the same host.
|
|
570
|
+
let tmpBeaconOptions =
|
|
565
571
|
{
|
|
566
572
|
ServerURL: pBeaconConfig.ServerURL,
|
|
567
573
|
Name: pBeaconConfig.Name || 'orator-conversion',
|
|
@@ -570,7 +576,18 @@ class OratorFileTranslation extends libFableServiceProviderBase
|
|
|
570
576
|
StagingPath: tmpStagingPath,
|
|
571
577
|
Tags: pBeaconConfig.Tags || {},
|
|
572
578
|
BindAddresses: pBeaconConfig.BindAddresses || []
|
|
573
|
-
}
|
|
579
|
+
};
|
|
580
|
+
if (pBeaconConfig.HostID)
|
|
581
|
+
{
|
|
582
|
+
tmpBeaconOptions.HostID = pBeaconConfig.HostID;
|
|
583
|
+
}
|
|
584
|
+
if (Array.isArray(pBeaconConfig.SharedMounts) && pBeaconConfig.SharedMounts.length > 0)
|
|
585
|
+
{
|
|
586
|
+
tmpBeaconOptions.SharedMounts = pBeaconConfig.SharedMounts;
|
|
587
|
+
}
|
|
588
|
+
|
|
589
|
+
// Instantiate the beacon service with the provided config
|
|
590
|
+
this._BeaconService = this.fable.instantiateServiceProviderWithoutRegistration('UltravisorBeacon', tmpBeaconOptions);
|
|
574
591
|
|
|
575
592
|
// Create the MediaConversion capability provider and register it
|
|
576
593
|
let tmpProvider = new libOratorConversionBeaconProvider(
|