@things-factory/pdf 5.0.1 → 5.0.11

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/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":"f5c28122bee592cfaf5c72ed7bcc47f453b79778ffa6e301f45d21a0970719d4","affectsGlobalScope":true},"dc47c4fa66b9b9890cf076304de2a9c5201e94b740cffdf09f87296d877d71f6","7a387c58583dfca701b6c85e0adaf43fb17d590fb16d5b2dc0a2fbd89f35c467","8a12173c586e95f4433e0c6dc446bc88346be73ffe9ca6eec7aa63c8f3dca7f9","5f4e733ced4e129482ae2186aae29fde948ab7182844c3a5a51dd346182c7b06","e6b724280c694a9f588847f754198fb96c43d805f065c3a5b28bbc9594541c84","1fc5ab7a764205c68fa10d381b08417795fc73111d6dd16b5b1ed36badb743d9",{"version":"3f149f903dd20dfeb7c80e228b659f0e436532de772469980dbd00702cc05cc1","affectsGlobalScope":true},{"version":"adb996790133eb33b33aadb9c09f15c2c575e71fb57a62de8bf74dbf59ec7dfb","affectsGlobalScope":true},{"version":"43fb1d932e4966a39a41b464a12a81899d9ae5f2c829063f5571b6b87e6d2f9c","affectsGlobalScope":true},{"version":"cdccba9a388c2ee3fd6ad4018c640a471a6c060e96f1232062223063b0a5ac6a","affectsGlobalScope":true},{"version":"c5c05907c02476e4bde6b7e76a79ffcd948aedd14b6a8f56e4674221b0417398","affectsGlobalScope":true},{"version":"0d5f52b3174bee6edb81260ebcd792692c32c81fd55499d69531496f3f2b25e7","affectsGlobalScope":true},{"version":"810627a82ac06fb5166da5ada4159c4ec11978dfbb0805fe804c86406dab8357","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":"12a310447c5d23c7d0d5ca2af606e3bd08afda69100166730ab92c62999ebb9d","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":"cd483c056da900716879771893a3c9772b66c3c88f8943b4205aec738a94b1d0","affectsGlobalScope":true},{"version":"b248e32ca52e8f5571390a4142558ae4f203ae2f94d5bac38a3084d529ef4e58","affectsGlobalScope":true},{"version":"c37f8a49593a0030eecb51bbfa270e709bec9d79a6cc3bb851ef348d4e6b26f8","affectsGlobalScope":true},"14a84fbe4ec531dcbaf5d2594fd95df107258e60ae6c6a076404f13c3f66f28e","ad7e61eca7f2f8bf47e72695f9f6663b75e41d87ef49abdb17c0cb843862f8aa","ecba2e44af95b0599c269a92628cec22e752868bce37396740deb51a5c547a26","46a9fb41a8f3bc7539eeebc15a6e04b9e55d7537a081615ad3614220d34c3e0f","05171576e13285d27d2847db571157a1f82c47ba9bac3b0c510a1f17dbf1b216","11a48305199dade58de582c87932c2bbca965874a7b01db7aa9d013d9d7d8c6b","ee3389ef3a8ea9be970adb48f9cbbf5dad4b8cfb2f3f519225eaeb5755e5a8b9","f6144c943d1c134761f023d01b4737c6c1ddfdd4cac7ee13a0a64832473a66e1","9122ed7070e054b73ebab37c2373a196def2d90e7d1a9a7fcd9d46b0e51fae78","a69c09dbea52352f479d3e7ac949fde3d17b195abe90b045d619f747b38d6d1a",{"version":"77f0b5c6a193a699c9f7d7fb0578e64e562d271afa740783665d2a827104a873","affectsGlobalScope":true},"21a167fec8f933752fb8157f06d28fab6817af3ad9b0bdb1908a10762391eab9",{"version":"3e4624c306340ad303cc536a07004e81336c3f088308a9e4a9f4c957a3cda2fd","affectsGlobalScope":true},"0c0cee62cb619aed81133b904f644515ba3064487002a7da83fd8aa07b1b4abd","5a94487653355b56018122d92392beb2e5f4a6c63ba5cef83bbe1c99775ef713",{"version":"d5135ad93b33adcce80b18f8065087934cdc1730d63db58562edcf017e1aad9b","affectsGlobalScope":true},"82408ed3e959ddc60d3e9904481b5a8dc16469928257af22a3f7d1a3bc7fd8c4","34ec1daf3566f26c43dbab380af0de1aac29166e57e4f9ef379a2f154e0cb290","bb9c4ffa5e6290c6980b63c815cdd1625876dadb2efaf77edbe82984be93e55e","75ecef44f126e2ae018b4abbd85b6e8a2e2ba1638ebec56cc64274643ce3567b","f30bb836526d930a74593f7b0f5c1c46d10856415a8f69e5e2fc3db80371e362","14b5aa23c5d0ae1907bc696ac7b6915d88f7d85799cc0dc2dcf98fbce2c5a67c","5c439dafdc09abe4d6c260a96b822fa0ba5be7203c71a63ab1f1423cd9e838ea",{"version":"249a2b90439cdfd51709539fbfa4dfe0791cbae6efce1e9b327ba8f8cd703f49","affectsGlobalScope":true},"acc8fa7e1d03f0d8c4af03c75027086d80bf1cb17edd2d71313bee7bd12dfb91","a9b6b0f7b1e30359283b131ba6d1c51ee2d3601a2f12e1623141e6a1a60c92a5","aeee0090b38de0dd47ca9a79ad5c2d156e3e09d92306719b0b45a3e96098e564","7bac475dcdd9f7e4e9da934d32c305bc889c4ce3c8ac0ef45a93a8d670fff607","09416dd69576b03a3f485adf329a02f043e4a481e060ef5b208194e488d31fd9","8acf99b1c8682276a63ea5bb68433782715892726b97e4604a415e4e56bce41c",{"version":"e8b18c6385ff784228a6f369694fcf1a6b475355ba89090a88de13587a9391d5","affectsGlobalScope":true},"3b145a2351f5cf16abf999c8d5f4481c74dffdc54ec1e9a89992e2622e1226c5","a907bf91df26df2400858ef75f749498fb5cf00062bf90a737ac3949cc07978d","cb92bc2e42b261e4299025756f1beb826b3d9666a3f0d46f8a7254ca512f57e4","4275d5f964e7fc7afc18538e26b3748c207dd772998346d17f409749aa1f3a63",{"version":"59a638a504490fecaacf0020b9814b6abee37edb66047eb1ab9f7c2274bf1da0","affectsGlobalScope":true},"5153a2fd150e46ce57bb3f8db1318d33f6ad3261ed70ceeff92281c0608c74a3","d1a78a3c5708807e8de3e399f91df4797c62e44b02195eefc2209b2e713e54ee","8c4c1a64db28930732033c31418f817dcb9d09d706766707ae6d38f23faf0c53","25846d43937c672bab7e8195f3d881f93495df712ee901860effc109918938cc","556bf5c36deb62cffa1bf697c1789fe008ec82db0273025001db66732714e9d9","1b952304137851e45bc009785de89ada562d9376177c97e37702e39e60c2f1ff",{"version":"806ef4cac3b3d9fa4a48d849c8e084d7c72fcd7b16d76e06049a9ed742ff79c0","affectsGlobalScope":true},"44b8b584a338b190a59f4f6929d072431950c7bd92ec2694821c11bce180c8a5","23b89798789dffbd437c0c423f5d02d11f9736aea73d6abf16db4f812ff36eda","653968fc1b35c5eb3d273d36fac1c1dc66f9537edf28f33485b8776bd956e23d",{"version":"970a90f76d4d219ad60819d61f5994514087ba94c985647a3474a5a3d12714ed","affectsGlobalScope":true},"664d8f2d59164f2e08c543981453893bc7e003e4dfd29651ce09db13e9457980","a381f079c4804442f179d742fdb2e495fe28d67a47cac673485f75ae2e77aeca","3c13ef48634e7b5012fcf7e8fce7496352c2d779a7201389ca96a2a81ee4314d","5d0a25ec910fa36595f85a67ac992d7a53dd4064a1ba6aea1c9f14ab73a023f2",{"version":"bfe39beb986d2a2e512c091cbe924f1c415bc65de54de0e2f6a0dc6f84c183d9","affectsGlobalScope":true},"2af17363f8a062e3a8cd1b26030af0058b3f86e783f4fc6aa9f57247f240ebaa","06d7c42d256f0ce6afe1b2b6cfbc97ab391f29dadb00dd0ae8e8f23f5bc916c3","dfe08140492cdc135fb7fd9c4a652c05207b61a436906079b87da1d3111314bf","e59a892d87e72733e2a9ca21611b9beb52977be2696c7ba4b216cbbb9a48f5aa","089e1f8603cbc35ab977c8dcc662eb754b82fca32ed1dfb16bd682726c2d5432","8a300fa9b698845a1f9c41ecbe2c5966634582a8e2020d51abcace9b55aa959e",{"version":"ab9b9a36e5284fd8d3bf2f7d5fcbc60052f25f27e4d20954782099282c60d23e","affectsGlobalScope":true},"64d5585e08ad1ab194b18bf4e851f22a626eae33ac7312ca4ba90bb7ea7daf64","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":[[94,106,108],[94,107],[94],[50,94],[53,94],[54,59,94],[55,65,66,73,82,93,94],[55,56,65,73,94],[57,94],[58,59,66,74,94],[59,82,90,94],[60,62,65,73,94],[61,94],[62,63,94],[64,65,94],[65,94],[65,66,67,82,93,94],[65,66,67,82,85,94],[94,98],[68,73,82,93,94],[65,66,68,69,73,82,90,93,94],[68,70,82,90,93,94],[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],[65,71,94],[72,93,94],[62,65,73,82,94],[74,94],[75,94],[53,76,94],[77,92,94,98],[78,94],[79,94],[65,80,94],[80,81,94,96],[65,82,83,84,85,94],[82,84,94],[82,83,94],[85,94],[86,94],[65,88,89,94],[88,89,94],[59,73,82,90,94],[91,94],[73,92,94],[54,68,79,93,94],[59,94],[82,94,95],[94,96],[94,97],[54,59,65,67,76,82,93,94,96,98],[82,94,99],[94,102,103],[94,102,103,104,105],[43,44,94],[42,48,94],[42,66,75,79,94],[42,94],[42,46,47,94]],"referencedMap":[[109,1],[108,2],[107,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],[100,3],[68,20],[69,21],[70,22],[101,23],[71,24],[72,25],[73,26],[74,27],[75,28],[76,29],[77,30],[78,31],[79,32],[80,33],[81,34],[82,35],[84,36],[83,37],[85,38],[86,39],[87,3],[88,40],[89,41],[90,42],[91,43],[92,44],[93,45],[94,46],[95,47],[96,48],[97,49],[98,50],[99,51],[102,3],[104,52],[106,53],[105,52],[103,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":[[109,1],[108,2],[107,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],[100,3],[68,20],[69,21],[70,22],[101,23],[71,24],[72,25],[73,26],[74,27],[75,28],[76,29],[77,30],[78,31],[79,32],[80,33],[81,34],[82,35],[84,36],[83,37],[85,38],[86,39],[87,3],[88,40],[89,41],[90,42],[91,43],[92,44],[93,45],[94,46],[95,47],[96,48],[97,49],[98,50],[99,51],[102,3],[104,52],[106,53],[105,52],[103,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":[109,108,107,50,51,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,52,100,68,69,70,101,71,72,73,74,75,76,77,78,79,80,81,82,84,83,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,102,104,106,105,103,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.7.4"}
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.11",
4
4
  "main": "dist-server/index.js",
5
5
  "things-factory": true,
6
6
  "license": "MIT",
@@ -27,5 +27,5 @@
27
27
  "await-spawn": "^4.0.1",
28
28
  "querystring": "^0.2.1"
29
29
  },
30
- "gitHead": "47225f76058999bb8bb075ac960cfb24f058093f"
30
+ "gitHead": "37cd4feb62e062899cae7029588d86a5d4b4036a"
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())