@things-factory/pdf 5.0.1 → 5.0.15

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.
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../server/index.ts"],"names":[],"mappings":";;AAAA,oBAAiB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../server/index.ts"],"names":[],"mappings":";;AAAA,oBAAiB","sourcesContent":["import './routes'\n"]}
@@ -1,27 +1,22 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
3
  exports.pdfRouter = void 0;
7
- const await_spawn_1 = __importDefault(require("await-spawn"));
4
+ const tslib_1 = require("tslib");
5
+ const await_spawn_1 = tslib_1.__importDefault(require("await-spawn"));
8
6
  const fs_1 = require("fs");
9
- const koa_router_1 = __importDefault(require("koa-router"));
10
- const path_1 = __importDefault(require("path"));
11
- const querystring_1 = __importDefault(require("querystring"));
7
+ const koa_router_1 = tslib_1.__importDefault(require("koa-router"));
8
+ const path_1 = tslib_1.__importDefault(require("path"));
9
+ const querystring_1 = tslib_1.__importDefault(require("querystring"));
12
10
  const utils_1 = require("@things-factory/utils");
13
- const debug = require('debug')('things-factory:pdf-base:pdf-router');
14
11
  exports.pdfRouter = new koa_router_1.default();
15
12
  /* to-png */
16
13
  exports.pdfRouter.get('/to-png', async (context, next) => {
17
14
  const { url } = context.query;
18
- debug('get:/to-png', url);
19
15
  const images = await (0, utils_1.withTempDir)(async (tmpDir) => {
20
16
  const curl = (0, await_spawn_1.default)('curl', ['-s', url]);
21
17
  await (0, await_spawn_1.default)('gs', ['-q', '-sDEVICE=png16m', '-o', `${tmpDir}/%d.png`, '-r300', '-'], {
22
18
  stdio: [curl.child.stdout, 'pipe', 'pipe']
23
19
  });
24
- debug('get:/to-png', 'ghosting done.');
25
20
  const files = await fs_1.promises.readdir(tmpDir);
26
21
  return Promise.all(files
27
22
  .sort(new Intl.Collator(undefined, { numeric: true }).compare)
@@ -39,7 +34,6 @@ const mergePDFfiles = async (urls) => {
39
34
  const inputs = sources.map((source, idx) => path_1.default.join(tmpdir, `${idx}.pdf`));
40
35
  try {
41
36
  await Promise.all(sources.map((source, idx) => (0, await_spawn_1.default)('curl', ['-sSL', source, '-o', path_1.default.join(tmpdir, `${idx}.pdf`)])));
42
- debug('mergePDFfiles', 'fetched all sources');
43
37
  await (0, await_spawn_1.default)('gs', [
44
38
  '-q',
45
39
  '-sDEVICE=pdfwrite',
@@ -53,7 +47,7 @@ const mergePDFfiles = async (urls) => {
53
47
  return await fs_1.promises.readFile(output);
54
48
  }
55
49
  catch (e) {
56
- debug('mergePDFfiles', 'error', e);
50
+ console.error('mergePDFfiles', 'error', e);
57
51
  }
58
52
  });
59
53
  };
@@ -62,14 +56,12 @@ exports.pdfRouter.get('/merge', async (context, next) => {
62
56
  const { urls } = querystring_1.default.parse(context.querystring, '&', '=', {
63
57
  decodeURIComponent: str => str
64
58
  });
65
- debug('get:/merge', urls);
66
59
  const pdf = await mergePDFfiles(urls);
67
60
  context.type = 'application/pdf';
68
61
  context.body = pdf;
69
62
  });
70
63
  exports.pdfRouter.post('/merge', async (context, next) => {
71
64
  const { urls } = context.request.body;
72
- debug('post:/merge', urls);
73
65
  const pdf = await mergePDFfiles(urls);
74
66
  context.type = 'application/pdf';
75
67
  context.body = pdf;
@@ -1 +1 @@
1
- {"version":3,"file":"pdf-router.js","sourceRoot":"","sources":["../../server/routers/pdf-router.ts"],"names":[],"mappings":";;;;;;AAAA,8DAAqC;AACrC,2BAAmC;AACnC,4DAA+B;AAC/B,gDAAuB;AACvB,8DAAqC;AAErC,iDAAmD;AAEnD,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC,oCAAoC,CAAC,CAAA;AAEvD,QAAA,SAAS,GAAG,IAAI,oBAAM,EAAE,CAAA;A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,OAAO,CAAC,IAAI,GAAG,iBAAiB,CAAA;IAChC,OAAO,CAAC,IAAI,GAAG,GAAG,CAAA;AACpB,CAAC,CAAC,CAAA;AAEF,iBAAS,CAAC,IAAI,CAAC,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE;IAC/C,MAAM,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC,OAAO,CAAC,IAAI,CAAA;IAErC,MAAM,GAAG,GAAG,MAAM,aAAa,CAAC,IAAI,CAAC,CAAA;IAErC,OAAO,CAAC,IAAI,GAAG,iBAAiB,CAAA;IAChC,OAAO,CAAC,IAAI,GAAG,GAAG,CAAA;AACpB,CAAC,CAAC,CAAA","sourcesContent":["import await_spawn from 'await-spawn'\nimport { promises as fs } from 'fs'\nimport Router from 'koa-router'\nimport path from 'path'\nimport querystring from 'querystring'\n\nimport { withTempDir } from '@things-factory/utils'\n\nexport const pdfRouter = new Router()\n\n/* to-png */\npdfRouter.get('/to-png', async (context, next) => {\n const { url } = context.query\n\n const images = await withTempDir(async tmpDir => {\n const curl = await_spawn('curl', ['-s', url])\n\n await await_spawn('gs', ['-q', '-sDEVICE=png16m', '-o', `${tmpDir}/%d.png`, '-r300', '-'], {\n stdio: [curl.child.stdout, 'pipe', 'pipe']\n })\n\n const files = await fs.readdir(tmpDir)\n return Promise.all(\n files\n .sort(new Intl.Collator(undefined, { numeric: true }).compare)\n .map(filename => fs.readFile(path.join(tmpDir, filename)))\n )\n })\n\n /* TODO make it possible to return multiple images */\n context.type = 'image/png'\n context.body = images[0]\n})\n\n/* merge-pdf */\nconst mergePDFfiles = async urls => {\n return await withTempDir(async tmpdir => {\n const sources = typeof urls == 'string' ? [urls] : urls\n const output = path.join(tmpdir, 'output.pdf')\n const inputs = sources.map((source, idx) => path.join(tmpdir, `${idx}.pdf`))\n\n try {\n await Promise.all(\n sources.map((source, idx) => await_spawn('curl', ['-sSL', source, '-o', path.join(tmpdir, `${idx}.pdf`)]))\n )\n\n await await_spawn('gs', [\n '-q',\n '-sDEVICE=pdfwrite',\n '-dAutoRotatePages=/None',\n '-dNOPAUSE',\n '-dBATCH',\n '-dSAFER',\n `-sOutputFile=${output}`,\n ...inputs\n ])\n\n return await fs.readFile(output)\n } catch (e) {\n console.error('mergePDFfiles', 'error', e)\n }\n })\n}\n\npdfRouter.get('/merge', async (context, next) => {\n // don't use context.query to prevent from decoding URLs\n const { urls } = querystring.parse(context.querystring, '&', '=', {\n decodeURIComponent: str => str\n })\n\n const pdf = await mergePDFfiles(urls)\n\n context.type = 'application/pdf'\n context.body = pdf\n})\n\npdfRouter.post('/merge', async (context, next) => {\n const { urls } = context.request.body\n\n const pdf = await mergePDFfiles(urls)\n\n context.type = 'application/pdf'\n context.body = pdf\n})\n"]}
@@ -1,12 +1,9 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
3
  exports.proxyRouter = void 0;
7
- const koa_router_1 = __importDefault(require("koa-router"));
8
- const request_1 = __importDefault(require("request"));
9
- const debug = require('debug')('things-factory:pdf-base:proxy-router');
4
+ const tslib_1 = require("tslib");
5
+ const koa_router_1 = tslib_1.__importDefault(require("koa-router"));
6
+ const request_1 = tslib_1.__importDefault(require("request"));
10
7
  exports.proxyRouter = new koa_router_1.default();
11
8
  exports.proxyRouter.get('/', async (context, next) => {
12
9
  const { url } = context.query;
@@ -1 +1 @@
1
- {"version":3,"file":"proxy-router.js","sourceRoot":"","sources":["../../server/routers/proxy-router.ts"],"names":[],"mappings":";;;;;;AAAA,4DAA+B;AAC/B,sDAA6B;AAE7B,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC,sCAAsC,CAAC,CAAA;AAEzD,QAAA,WAAW,GAAG,IAAI,oBAAM,EAAE,CAAA;AAEvC,mBAAW,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE;IAC3C,MAAM,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;IAC7B,OAAO,CAAC,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,IAAA,iBAAO,EAAC,GAAG,CAAC,CAAC,CAAA;AAC/C,CAAC,CAAC,CAAA"}
1
+ {"version":3,"file":"proxy-router.js","sourceRoot":"","sources":["../../server/routers/proxy-router.ts"],"names":[],"mappings":";;;;AAAA,oEAA+B;AAC/B,8DAA6B;AAEhB,QAAA,WAAW,GAAG,IAAI,oBAAM,EAAE,CAAA;AAEvC,mBAAW,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE;IAC3C,MAAM,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;IAC7B,OAAO,CAAC,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,IAAA,iBAAO,EAAC,GAAG,CAAC,CAAC,CAAA;AAC/C,CAAC,CAAC,CAAA","sourcesContent":["import Router from 'koa-router'\nimport request from 'request'\n\nexport const proxyRouter = new Router()\n\nproxyRouter.get('/', async (context, next) => {\n const { url } = context.query\n context.body = context.req.pipe(request(url))\n})\n"]}
@@ -2,7 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const pdf_router_1 = require("./routers/pdf-router");
4
4
  const proxy_router_1 = require("./routers/proxy-router");
5
- const debug = require('debug')('things-factory:pdf-base:router');
6
5
  process.on('bootstrap-module-global-public-route', (app, globalPublicRouter) => {
7
6
  globalPublicRouter.use('/pdf', pdf_router_1.pdfRouter.routes(), pdf_router_1.pdfRouter.allowedMethods());
8
7
  globalPublicRouter.use('/proxy', proxy_router_1.proxyRouter.routes(), proxy_router_1.proxyRouter.allowedMethods());
@@ -1 +1 @@
1
- {"version":3,"file":"routes.js","sourceRoot":"","sources":["../server/routes.ts"],"names":[],"mappings":";;AAAA,qDAAgD;AAChD,yDAAoD;AAEpD,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC,gCAAgC,CAAC,CAAA;AAEhE,OAAO,CAAC,EAAE,CAAC,sCAA6C,EAAE,CAAC,GAAG,EAAE,kBAAkB,EAAE,EAAE;IACpF,kBAAkB,CAAC,GAAG,CAAC,MAAM,EAAE,sBAAS,CAAC,MAAM,EAAE,EAAE,sBAAS,CAAC,cAAc,EAAE,CAAC,CAAA;IAC9E,kBAAkB,CAAC,GAAG,CAAC,QAAQ,EAAE,0BAAW,CAAC,MAAM,EAAE,EAAE,0BAAW,CAAC,cAAc,EAAE,CAAC,CAAA;AACtF,CAAC,CAAC,CAAA"}
1
+ {"version":3,"file":"routes.js","sourceRoot":"","sources":["../server/routes.ts"],"names":[],"mappings":";;AAAA,qDAAgD;AAChD,yDAAoD;AAEpD,OAAO,CAAC,EAAE,CAAC,sCAA6C,EAAE,CAAC,GAAG,EAAE,kBAAkB,EAAE,EAAE;IACpF,kBAAkB,CAAC,GAAG,CAAC,MAAM,EAAE,sBAAS,CAAC,MAAM,EAAE,EAAE,sBAAS,CAAC,cAAc,EAAE,CAAC,CAAA;IAC9E,kBAAkB,CAAC,GAAG,CAAC,QAAQ,EAAE,0BAAW,CAAC,MAAM,EAAE,EAAE,0BAAW,CAAC,cAAc,EAAE,CAAC,CAAA;AACtF,CAAC,CAAC,CAAA","sourcesContent":["import { pdfRouter } from './routers/pdf-router'\nimport { proxyRouter } from './routers/proxy-router'\n\nprocess.on('bootstrap-module-global-public-route' as any, (app, globalPublicRouter) => {\n globalPublicRouter.use('/pdf', pdfRouter.routes(), pdfRouter.allowedMethods())\n globalPublicRouter.use('/proxy', proxyRouter.routes(), proxyRouter.allowedMethods())\n})\n"]}
@@ -0,0 +1 @@
1
+ {"program":{"fileNames":["../../../node_modules/typescript/lib/lib.es5.d.ts","../../../node_modules/typescript/lib/lib.es2015.d.ts","../../../node_modules/typescript/lib/lib.es2016.d.ts","../../../node_modules/typescript/lib/lib.es2017.d.ts","../../../node_modules/typescript/lib/lib.es2018.d.ts","../../../node_modules/typescript/lib/lib.es2019.d.ts","../../../node_modules/typescript/lib/lib.es2020.d.ts","../../../node_modules/typescript/lib/lib.dom.d.ts","../../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../../node_modules/typescript/lib/lib.es2020.date.d.ts","../../../node_modules/typescript/lib/lib.es2020.promise.d.ts","../../../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../../node_modules/typescript/lib/lib.es2020.string.d.ts","../../../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../../node_modules/typescript/lib/lib.es2020.intl.d.ts","../../../node_modules/typescript/lib/lib.es2020.number.d.ts","../../../node_modules/typescript/lib/lib.esnext.intl.d.ts","../../../node_modules/tslib/tslib.d.ts","../node_modules/querystring/decode.d.ts","../node_modules/querystring/encode.d.ts","../node_modules/querystring/index.d.ts","../server/routers/pdf-router.ts","../server/routers/proxy-router.ts","../server/routes.ts","../server/index.ts","../../../node_modules/@types/node/assert.d.ts","../../../node_modules/@types/node/assert/strict.d.ts","../../../node_modules/@types/node/globals.d.ts","../../../node_modules/@types/node/async_hooks.d.ts","../../../node_modules/@types/node/buffer.d.ts","../../../node_modules/@types/node/child_process.d.ts","../../../node_modules/@types/node/cluster.d.ts","../../../node_modules/@types/node/console.d.ts","../../../node_modules/@types/node/constants.d.ts","../../../node_modules/@types/node/crypto.d.ts","../../../node_modules/@types/node/dgram.d.ts","../../../node_modules/@types/node/diagnostics_channel.d.ts","../../../node_modules/@types/node/dns.d.ts","../../../node_modules/@types/node/dns/promises.d.ts","../../../node_modules/@types/node/domain.d.ts","../../../node_modules/@types/node/events.d.ts","../../../node_modules/@types/node/fs.d.ts","../../../node_modules/@types/node/fs/promises.d.ts","../../../node_modules/@types/node/http.d.ts","../../../node_modules/@types/node/http2.d.ts","../../../node_modules/@types/node/https.d.ts","../../../node_modules/@types/node/inspector.d.ts","../../../node_modules/@types/node/module.d.ts","../../../node_modules/@types/node/net.d.ts","../../../node_modules/@types/node/os.d.ts","../../../node_modules/@types/node/path.d.ts","../../../node_modules/@types/node/perf_hooks.d.ts","../../../node_modules/@types/node/process.d.ts","../../../node_modules/@types/node/punycode.d.ts","../../../node_modules/@types/node/querystring.d.ts","../../../node_modules/@types/node/readline.d.ts","../../../node_modules/@types/node/readline/promises.d.ts","../../../node_modules/@types/node/repl.d.ts","../../../node_modules/@types/node/stream.d.ts","../../../node_modules/@types/node/stream/promises.d.ts","../../../node_modules/@types/node/stream/consumers.d.ts","../../../node_modules/@types/node/stream/web.d.ts","../../../node_modules/@types/node/string_decoder.d.ts","../../../node_modules/@types/node/test.d.ts","../../../node_modules/@types/node/timers.d.ts","../../../node_modules/@types/node/timers/promises.d.ts","../../../node_modules/@types/node/tls.d.ts","../../../node_modules/@types/node/trace_events.d.ts","../../../node_modules/@types/node/tty.d.ts","../../../node_modules/@types/node/url.d.ts","../../../node_modules/@types/node/util.d.ts","../../../node_modules/@types/node/v8.d.ts","../../../node_modules/@types/node/vm.d.ts","../../../node_modules/@types/node/wasi.d.ts","../../../node_modules/@types/node/worker_threads.d.ts","../../../node_modules/@types/node/zlib.d.ts","../../../node_modules/@types/node/globals.global.d.ts","../../../node_modules/@types/node/index.d.ts","../../../node_modules/jest-diff/build/cleanupsemantic.d.ts","../../../node_modules/jest-diff/build/types.d.ts","../../../node_modules/jest-diff/build/difflines.d.ts","../../../node_modules/jest-diff/build/printdiffs.d.ts","../../../node_modules/jest-diff/build/index.d.ts","../../../node_modules/@types/jest/node_modules/pretty-format/build/types.d.ts","../../../node_modules/@types/jest/node_modules/pretty-format/build/index.d.ts","../../../node_modules/@types/jest/index.d.ts"],"fileInfos":[{"version":"f20c05dbfe50a208301d2a1da37b9931bce0466eb5a1f4fe240971b4ecc82b67","affectsGlobalScope":true},"dc47c4fa66b9b9890cf076304de2a9c5201e94b740cffdf09f87296d877d71f6","7a387c58583dfca701b6c85e0adaf43fb17d590fb16d5b2dc0a2fbd89f35c467","8a12173c586e95f4433e0c6dc446bc88346be73ffe9ca6eec7aa63c8f3dca7f9","5f4e733ced4e129482ae2186aae29fde948ab7182844c3a5a51dd346182c7b06","e6b724280c694a9f588847f754198fb96c43d805f065c3a5b28bbc9594541c84","1fc5ab7a764205c68fa10d381b08417795fc73111d6dd16b5b1ed36badb743d9",{"version":"9b087de7268e4efc5f215347a62656663933d63c0b1d7b624913240367b999ea","affectsGlobalScope":true},{"version":"adb996790133eb33b33aadb9c09f15c2c575e71fb57a62de8bf74dbf59ec7dfb","affectsGlobalScope":true},{"version":"8cc8c5a3bac513368b0157f3d8b31cfdcfe78b56d3724f30f80ed9715e404af8","affectsGlobalScope":true},{"version":"cdccba9a388c2ee3fd6ad4018c640a471a6c060e96f1232062223063b0a5ac6a","affectsGlobalScope":true},{"version":"c5c05907c02476e4bde6b7e76a79ffcd948aedd14b6a8f56e4674221b0417398","affectsGlobalScope":true},{"version":"0d5f52b3174bee6edb81260ebcd792692c32c81fd55499d69531496f3f2b25e7","affectsGlobalScope":true},{"version":"55f400eec64d17e888e278f4def2f254b41b89515d3b88ad75d5e05f019daddd","affectsGlobalScope":true},{"version":"181f1784c6c10b751631b24ce60c7f78b20665db4550b335be179217bacc0d5f","affectsGlobalScope":true},{"version":"3013574108c36fd3aaca79764002b3717da09725a36a6fc02eac386593110f93","affectsGlobalScope":true},{"version":"75ec0bdd727d887f1b79ed6619412ea72ba3c81d92d0787ccb64bab18d261f14","affectsGlobalScope":true},{"version":"3be5a1453daa63e031d266bf342f3943603873d890ab8b9ada95e22389389006","affectsGlobalScope":true},{"version":"17bb1fc99591b00515502d264fa55dc8370c45c5298f4a5c2083557dccba5a2a","affectsGlobalScope":true},{"version":"7ce9f0bde3307ca1f944119f6365f2d776d281a393b576a18a2f2893a2d75c98","affectsGlobalScope":true},{"version":"6a6b173e739a6a99629a8594bfb294cc7329bfb7b227f12e1f7c11bc163b8577","affectsGlobalScope":true},{"version":"81cac4cbc92c0c839c70f8ffb94eb61e2d32dc1c3cf6d95844ca099463cf37ea","affectsGlobalScope":true},{"version":"b0124885ef82641903d232172577f2ceb5d3e60aed4da1153bab4221e1f6dd4e","affectsGlobalScope":true},{"version":"0eb85d6c590b0d577919a79e0084fa1744c1beba6fd0d4e951432fa1ede5510a","affectsGlobalScope":true},{"version":"da233fc1c8a377ba9e0bed690a73c290d843c2c3d23a7bd7ec5cd3d7d73ba1e0","affectsGlobalScope":true},{"version":"d154ea5bb7f7f9001ed9153e876b2d5b8f5c2bb9ec02b3ae0d239ec769f1f2ae","affectsGlobalScope":true},{"version":"bb2d3fb05a1d2ffbca947cc7cbc95d23e1d053d6595391bd325deb265a18d36c","affectsGlobalScope":true},{"version":"c80df75850fea5caa2afe43b9949338ce4e2de086f91713e9af1a06f973872b8","affectsGlobalScope":true},{"version":"9d57b2b5d15838ed094aa9ff1299eecef40b190722eb619bac4616657a05f951","affectsGlobalScope":true},{"version":"6c51b5dd26a2c31dbf37f00cfc32b2aa6a92e19c995aefb5b97a3a64f1ac99de","affectsGlobalScope":true},{"version":"6e7997ef61de3132e4d4b2250e75343f487903ddf5370e7ce33cf1b9db9a63ed","affectsGlobalScope":true},{"version":"2ad234885a4240522efccd77de6c7d99eecf9b4de0914adb9a35c0c22433f993","affectsGlobalScope":true},{"version":"09aa50414b80c023553090e2f53827f007a301bc34b0495bfb2c3c08ab9ad1eb","affectsGlobalScope":true},{"version":"d7f680a43f8cd12a6b6122c07c54ba40952b0c8aa140dcfcf32eb9e6cb028596","affectsGlobalScope":true},{"version":"3787b83e297de7c315d55d4a7c546ae28e5f6c0a361b7a1dcec1f1f50a54ef11","affectsGlobalScope":true},{"version":"e7e8e1d368290e9295ef18ca23f405cf40d5456fa9f20db6373a61ca45f75f40","affectsGlobalScope":true},{"version":"faf0221ae0465363c842ce6aa8a0cbda5d9296940a8e26c86e04cc4081eea21e","affectsGlobalScope":true},{"version":"06393d13ea207a1bfe08ec8d7be562549c5e2da8983f2ee074e00002629d1871","affectsGlobalScope":true},{"version":"775d9c9fd150d5de79e0450f35bc8b8f94ae64e3eb5da12725ff2a649dccc777","affectsGlobalScope":true},{"version":"b248e32ca52e8f5571390a4142558ae4f203ae2f94d5bac38a3084d529ef4e58","affectsGlobalScope":true},{"version":"52d1bb7ab7a3306fd0375c8bff560feed26ed676a5b0457fa8027b563aecb9a4","affectsGlobalScope":true},"14a84fbe4ec531dcbaf5d2594fd95df107258e60ae6c6a076404f13c3f66f28e","ad7e61eca7f2f8bf47e72695f9f6663b75e41d87ef49abdb17c0cb843862f8aa","ecba2e44af95b0599c269a92628cec22e752868bce37396740deb51a5c547a26","46a9fb41a8f3bc7539eeebc15a6e04b9e55d7537a081615ad3614220d34c3e0f","05171576e13285d27d2847db571157a1f82c47ba9bac3b0c510a1f17dbf1b216","11a48305199dade58de582c87932c2bbca965874a7b01db7aa9d013d9d7d8c6b","ee3389ef3a8ea9be970adb48f9cbbf5dad4b8cfb2f3f519225eaeb5755e5a8b9","f6144c943d1c134761f023d01b4737c6c1ddfdd4cac7ee13a0a64832473a66e1","9122ed7070e054b73ebab37c2373a196def2d90e7d1a9a7fcd9d46b0e51fae78","a69c09dbea52352f479d3e7ac949fde3d17b195abe90b045d619f747b38d6d1a",{"version":"77f0b5c6a193a699c9f7d7fb0578e64e562d271afa740783665d2a827104a873","affectsGlobalScope":true},"21a167fec8f933752fb8157f06d28fab6817af3ad9b0bdb1908a10762391eab9",{"version":"002d6d5f044365b3fbfba0ba9be3bb57cac09b81547c8df4b0795755d2081d90","affectsGlobalScope":true},"0c0cee62cb619aed81133b904f644515ba3064487002a7da83fd8aa07b1b4abd","5a94487653355b56018122d92392beb2e5f4a6c63ba5cef83bbe1c99775ef713",{"version":"d5135ad93b33adcce80b18f8065087934cdc1730d63db58562edcf017e1aad9b","affectsGlobalScope":true},"82408ed3e959ddc60d3e9904481b5a8dc16469928257af22a3f7d1a3bc7fd8c4","c4cfc9a6e2ebb8bc8c0e2392dfc4056993ced3b35069ebf132ac18ca7a562881","bb9c4ffa5e6290c6980b63c815cdd1625876dadb2efaf77edbe82984be93e55e","75ecef44f126e2ae018b4abbd85b6e8a2e2ba1638ebec56cc64274643ce3567b","f30bb836526d930a74593f7b0f5c1c46d10856415a8f69e5e2fc3db80371e362","14b5aa23c5d0ae1907bc696ac7b6915d88f7d85799cc0dc2dcf98fbce2c5a67c","5c439dafdc09abe4d6c260a96b822fa0ba5be7203c71a63ab1f1423cd9e838ea",{"version":"bae4ea23beb8397755b935cb84d3cdc6cdb0b1b4a329b90de9fc6c8774d71994","affectsGlobalScope":true},"cec36af22f514322f870e81d30675c78df82ae8bf4863f5fd4e4424c040c678d","df36874d9e56aff601e921c4b3971d37cf66d14f6455935ce821e6cad13b1823","3c135ff5bda0355f6b52a10ea931736ec7c5a80b7fb8772019054e0eaa0fd6b6","1abb206a4ecd13b21536b677d7d5f66e0d7316f0d44610197cfcc5776f78884a","dbe5aa5a5dd8bd1c6a8d11b1310c3f0cdabaacc78a37b394a8c7b14faeb5fb84","2c828a5405191d006115ab34e191b8474bc6c86ffdc401d1a9864b1b6e088a58",{"version":"e8b18c6385ff784228a6f369694fcf1a6b475355ba89090a88de13587a9391d5","affectsGlobalScope":true},"76527127c8b749bee5977408861ce3ee56ec19ddcea8704c628f98ca610283e6","7fc5b4377d39edbbd127cdc84805bd85da1ec2fc55412213912cd6f67b66399b","b68bd7bef90dab08b1866a9fee24f03d9fee10bcb3f587b074e96e61abf6d3f0","cb4f3f03480e1727eae46400606cecaa97f550186ff8fa909ebc00db4180531b",{"version":"b3624aed92dab6da8484280d3cb3e2f4130ec3f4ef3f8201c95144ae9e898bb6","affectsGlobalScope":true},"5153a2fd150e46ce57bb3f8db1318d33f6ad3261ed70ceeff92281c0608c74a3","d1a78a3c5708807e8de3e399f91df4797c62e44b02195eefc2209b2e713e54ee","36b03690b628eab08703d63f04eaa89c5df202e5f1edf3989f13ad389cd2c091","0effadd232a20498b11308058e334d3339cc5bf8c4c858393e38d9d4c0013dcf","25846d43937c672bab7e8195f3d881f93495df712ee901860effc109918938cc","556bf5c36deb62cffa1bf697c1789fe008ec82db0273025001db66732714e9d9","1b952304137851e45bc009785de89ada562d9376177c97e37702e39e60c2f1ff",{"version":"806ef4cac3b3d9fa4a48d849c8e084d7c72fcd7b16d76e06049a9ed742ff79c0","affectsGlobalScope":true},"44b8b584a338b190a59f4f6929d072431950c7bd92ec2694821c11bce180c8a5","23b89798789dffbd437c0c423f5d02d11f9736aea73d6abf16db4f812ff36eda","0830071706fa0e477fb5e95f0955cc1062b5948b146b7d4e03a126f12ad6085f",{"version":"970a90f76d4d219ad60819d61f5994514087ba94c985647a3474a5a3d12714ed","affectsGlobalScope":true},"664d8f2d59164f2e08c543981453893bc7e003e4dfd29651ce09db13e9457980","4c8525f256873c7ba3135338c647eaf0ca7115a1a2805ae2d0056629461186ce","3c13ef48634e7b5012fcf7e8fce7496352c2d779a7201389ca96a2a81ee4314d","5d0a25ec910fa36595f85a67ac992d7a53dd4064a1ba6aea1c9f14ab73a023f2",{"version":"bfe39beb986d2a2e512c091cbe924f1c415bc65de54de0e2f6a0dc6f84c183d9","affectsGlobalScope":true},"2d526e6f21d8cc66ac11ada32874e95ae88d870c6c9d3d9d4e03b1d1f9ad7b8e","06d7c42d256f0ce6afe1b2b6cfbc97ab391f29dadb00dd0ae8e8f23f5bc916c3","ec4bd1b200670fb567920db572d6701ed42a9641d09c4ff6869768c8f81b404c","e59a892d87e72733e2a9ca21611b9beb52977be2696c7ba4b216cbbb9a48f5aa","d2ec52f565f0570e90b659811347bd689f8c6039b11eaaccd0f243759d46da6e","8a300fa9b698845a1f9c41ecbe2c5966634582a8e2020d51abcace9b55aa959e",{"version":"ab9b9a36e5284fd8d3bf2f7d5fcbc60052f25f27e4d20954782099282c60d23e","affectsGlobalScope":true},"a12806a1bde5e9f137bb79728d87a4ceaedf04e95efc9967d3288a3c252d9a7b","d8aab31ba8e618cc3eea10b0945de81cb93b7e8150a013a482332263b9305322","69da61a7b5093dac77fa3bec8be95dcf9a74c95a0e9161edb98bb24e30e439d2","561eca7a381b96d6ccac6e4061e6d2ae53f5bc44203f3fd9f5b26864c32ae6e9","62ea38627e3ebab429f7616812a9394d327c2bc271003dfba985de9b4137369f","b4439890c168d646357928431100daac5cbdee1d345a34e6bf6eca9f3abe22bc","5d72971a459517c44c1379dab9ed248e87a61ba0a1e0f25c9d67e1e640cd9a09","02d734976af36f4273d930bea88b3e62adf6b078cf120c1c63d49aa8d8427c5c",{"version":"516a426e3960379f310107635b8f3a7e8c307c6c665080b128039d9299ec4087","affectsGlobalScope":true}],"options":{"allowSyntheticDefaultImports":true,"declaration":false,"emitDecoratorMetadata":true,"esModuleInterop":true,"experimentalDecorators":true,"importHelpers":true,"inlineSources":true,"module":1,"noEmitOnError":true,"noImplicitAny":false,"outDir":"./","sourceMap":true,"strict":false,"target":4,"useDefineForClassFields":false},"fileIdsList":[[95,107,109],[95,108],[95],[50,95],[53,95],[54,59,95],[55,65,66,73,83,94,95],[55,56,65,73,95],[57,95],[58,59,66,74,95],[59,83,91,95],[60,62,65,73,95],[61,95],[62,63,95],[64,65,95],[65,95],[65,66,67,83,94,95],[65,66,67,83,86,95],[95,99],[68,73,83,94,95],[65,66,68,69,73,83,91,94,95],[68,70,83,91,94,95],[50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101],[65,71,95],[72,94,95],[62,65,73,83,95],[74,95],[75,95],[53,76,95],[77,93,95,99],[78,95],[79,95],[65,80,81,95],[80,82,95,97],[65,83,84,85,86,95],[83,85,95],[83,84,95],[86,95],[87,95],[65,89,90,95],[89,90,95],[59,73,83,91,95],[92,95],[73,93,95],[54,68,79,94,95],[59,95],[83,95,96],[95,97],[95,98],[54,59,65,67,76,83,94,95,97,99],[83,95,100],[95,103,104],[95,103,104,105,106],[43,44,95],[42,48,95],[42,66,75,79,95],[42,95],[42,46,47,95]],"referencedMap":[[110,1],[109,2],[108,3],[50,4],[51,4],[53,5],[54,6],[55,7],[56,8],[57,9],[58,10],[59,11],[60,12],[61,13],[62,14],[63,14],[64,15],[65,16],[66,17],[67,18],[52,19],[101,3],[68,20],[69,21],[70,22],[102,23],[71,24],[72,25],[73,26],[74,27],[75,28],[76,29],[77,30],[78,31],[79,32],[80,33],[81,33],[82,34],[83,35],[85,36],[84,37],[86,38],[87,39],[88,3],[89,40],[90,41],[91,42],[92,43],[93,44],[94,45],[95,46],[96,47],[97,48],[98,49],[99,50],[100,51],[103,3],[105,52],[107,53],[106,52],[104,3],[42,3],[8,3],[10,3],[9,3],[2,3],[11,3],[12,3],[13,3],[14,3],[15,3],[16,3],[17,3],[18,3],[3,3],[4,3],[22,3],[19,3],[20,3],[21,3],[23,3],[24,3],[25,3],[5,3],[26,3],[27,3],[28,3],[29,3],[6,3],[30,3],[31,3],[32,3],[33,3],[7,3],[34,3],[39,3],[40,3],[35,3],[36,3],[37,3],[38,3],[1,3],[41,3],[43,3],[44,3],[45,54],[49,55],[46,56],[47,57],[48,58]],"exportedModulesMap":[[110,1],[109,2],[108,3],[50,4],[51,4],[53,5],[54,6],[55,7],[56,8],[57,9],[58,10],[59,11],[60,12],[61,13],[62,14],[63,14],[64,15],[65,16],[66,17],[67,18],[52,19],[101,3],[68,20],[69,21],[70,22],[102,23],[71,24],[72,25],[73,26],[74,27],[75,28],[76,29],[77,30],[78,31],[79,32],[80,33],[81,33],[82,34],[83,35],[85,36],[84,37],[86,38],[87,39],[88,3],[89,40],[90,41],[91,42],[92,43],[93,44],[94,45],[95,46],[96,47],[97,48],[98,49],[99,50],[100,51],[103,3],[105,52],[107,53],[106,52],[104,3],[42,3],[8,3],[10,3],[9,3],[2,3],[11,3],[12,3],[13,3],[14,3],[15,3],[16,3],[17,3],[18,3],[3,3],[4,3],[22,3],[19,3],[20,3],[21,3],[23,3],[24,3],[25,3],[5,3],[26,3],[27,3],[28,3],[29,3],[6,3],[30,3],[31,3],[32,3],[33,3],[7,3],[34,3],[39,3],[40,3],[35,3],[36,3],[37,3],[38,3],[1,3],[41,3],[43,3],[44,3],[45,54],[49,55],[46,56],[47,57],[48,58]],"semanticDiagnosticsPerFile":[110,109,108,50,51,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,52,101,68,69,70,102,71,72,73,74,75,76,77,78,79,80,81,82,83,85,84,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,103,105,107,106,104,42,8,10,9,2,11,12,13,14,15,16,17,18,3,4,22,19,20,21,23,24,25,5,26,27,28,29,6,30,31,32,33,7,34,39,40,35,36,37,38,1,41,43,44,45,49,46,47,48]},"version":"4.8.3"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@things-factory/pdf",
3
- "version": "5.0.1",
3
+ "version": "5.0.15",
4
4
  "main": "dist-server/index.js",
5
5
  "things-factory": true,
6
6
  "license": "MIT",
@@ -23,9 +23,9 @@
23
23
  "migration:create": "node ../../node_modules/typeorm/cli.js migration:create -d ./server/migrations"
24
24
  },
25
25
  "dependencies": {
26
- "@things-factory/utils": "^5.0.1",
26
+ "@things-factory/utils": "^5.0.15",
27
27
  "await-spawn": "^4.0.1",
28
28
  "querystring": "^0.2.1"
29
29
  },
30
- "gitHead": "47225f76058999bb8bb075ac960cfb24f058093f"
30
+ "gitHead": "87b738da786f92983d009d72548918be93e4ae2c"
31
31
  }
@@ -6,16 +6,12 @@ import querystring from 'querystring'
6
6
 
7
7
  import { withTempDir } from '@things-factory/utils'
8
8
 
9
- const debug = require('debug')('things-factory:pdf-base:pdf-router')
10
-
11
9
  export const pdfRouter = new Router()
12
10
 
13
11
  /* to-png */
14
12
  pdfRouter.get('/to-png', async (context, next) => {
15
13
  const { url } = context.query
16
14
 
17
- debug('get:/to-png', url)
18
-
19
15
  const images = await withTempDir(async tmpDir => {
20
16
  const curl = await_spawn('curl', ['-s', url])
21
17
 
@@ -23,8 +19,6 @@ pdfRouter.get('/to-png', async (context, next) => {
23
19
  stdio: [curl.child.stdout, 'pipe', 'pipe']
24
20
  })
25
21
 
26
- debug('get:/to-png', 'ghosting done.')
27
-
28
22
  const files = await fs.readdir(tmpDir)
29
23
  return Promise.all(
30
24
  files
@@ -50,8 +44,6 @@ const mergePDFfiles = async urls => {
50
44
  sources.map((source, idx) => await_spawn('curl', ['-sSL', source, '-o', path.join(tmpdir, `${idx}.pdf`)]))
51
45
  )
52
46
 
53
- debug('mergePDFfiles', 'fetched all sources')
54
-
55
47
  await await_spawn('gs', [
56
48
  '-q',
57
49
  '-sDEVICE=pdfwrite',
@@ -65,7 +57,7 @@ const mergePDFfiles = async urls => {
65
57
 
66
58
  return await fs.readFile(output)
67
59
  } catch (e) {
68
- debug('mergePDFfiles', 'error', e)
60
+ console.error('mergePDFfiles', 'error', e)
69
61
  }
70
62
  })
71
63
  }
@@ -76,7 +68,6 @@ pdfRouter.get('/merge', async (context, next) => {
76
68
  decodeURIComponent: str => str
77
69
  })
78
70
 
79
- debug('get:/merge', urls)
80
71
  const pdf = await mergePDFfiles(urls)
81
72
 
82
73
  context.type = 'application/pdf'
@@ -86,8 +77,6 @@ pdfRouter.get('/merge', async (context, next) => {
86
77
  pdfRouter.post('/merge', async (context, next) => {
87
78
  const { urls } = context.request.body
88
79
 
89
- debug('post:/merge', urls)
90
-
91
80
  const pdf = await mergePDFfiles(urls)
92
81
 
93
82
  context.type = 'application/pdf'
@@ -1,8 +1,6 @@
1
1
  import Router from 'koa-router'
2
2
  import request from 'request'
3
3
 
4
- const debug = require('debug')('things-factory:pdf-base:proxy-router')
5
-
6
4
  export const proxyRouter = new Router()
7
5
 
8
6
  proxyRouter.get('/', async (context, next) => {
package/server/routes.ts CHANGED
@@ -1,8 +1,6 @@
1
1
  import { pdfRouter } from './routers/pdf-router'
2
2
  import { proxyRouter } from './routers/proxy-router'
3
3
 
4
- const debug = require('debug')('things-factory:pdf-base:router')
5
-
6
4
  process.on('bootstrap-module-global-public-route' as any, (app, globalPublicRouter) => {
7
5
  globalPublicRouter.use('/pdf', pdfRouter.routes(), pdfRouter.allowedMethods())
8
6
  globalPublicRouter.use('/proxy', proxyRouter.routes(), proxyRouter.allowedMethods())