@tachybase/plugin-ocr-convert 1.6.0 → 1.6.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.
@@ -1 +1 @@
1
- {"name":"exceljs","version":"4.4.0","description":"Excel Workbook Manager - Read and Write xlsx and csv Files.","private":false,"license":"MIT","author":{"name":"Guyon Roche","email":"guyon@live.com"},"repository":{"type":"git","url":"https://github.com/exceljs/exceljs.git"},"engines":{"node":">=8.3.0"},"main":"./excel.js","browser":"./dist/exceljs.min.js","types":"./index.d.ts","files":["dist","lib","excel.js","LICENSE","README.md","README_zh.md","index.ts","index.d.ts"],"scripts":{"test":"npm run test:full","test:es5":"export EXCEL_BUILD=es5 && npm run test:full","test:full":"npm run build && npm run test:unit && npm run test:integration && npm run test:end-to-end && npm run test:jasmine","test:version":"npm run build && npm run test:unit && npm run test:integration && npm run test:end-to-end && npm run test:browser && npm run test:dist","test:all":"npm run test:native && npm run test:es5","test:native":"npm run test:full","test:unit":"mocha --require spec/config/setup --require spec/config/setup-unit spec/unit --recursive","test:integration":"mocha --require spec/config/setup spec/integration --recursive","test:end-to-end":"mocha --require spec/config/setup spec/end-to-end --recursive","test:browser":"if [ ! -f .disable-test-browser ]; then npm run build && npm run test:jasmine; fi","test:jasmine":"grunt jasmine","test:unit:es5":"export EXCEL_BUILD=es5 && npm run test:unit","test:integration:es5":"export EXCEL_BUILD=es5 && npm run test:integration","test:end-to-end:es5":"export EXCEL_BUILD=es5 && npm run test:end-to-end","test:dist":"mocha --require spec/config/setup spec/dist --recursive","test:manual":"node spec/manual/app.js","test:typescript":"mocha -r ts-node/register spec/typescript/**/*.spec.ts","clean-build":"npm run clean && npm run build","lint":"eslint --format node_modules/eslint-friendly-formatter .","lint:fix":"prettier-eslint --write $(pwd)'/**/*.js'","lint:staged":"lint-staged","clean":"rm -rf build/ && rm -rf dist","benchmark":"node --expose-gc benchmark","benchmark:debug":"node --expose-gc --inspect-brk --trace-deopt benchmark","build":"grunt build","install-build":"npm install && grunt build","preversion":"npm run clean && npm run build && npm run test:version","postversion":"git push --no-verify && git push --tags --no-verify"},"husky":{"hooks":{"pre-commit":"lint-staged"}},"lint-staged":{"*.js":["prettier-eslint --write","eslint --format node_modules/eslint-friendly-formatter","git add"]},"keywords":["xlsx","json","csv","excel","font","border","fill","number","format","number format","alignment","office","spreadsheet","workbook","defined names","data validations","rich text","in-cell format","outlineLevel","views","frozen","split","pageSetup"],"dependencies":{"archiver":"^5.0.0","dayjs":"^1.8.34","fast-csv":"^4.3.1","jszip":"^3.10.1","readable-stream":"^3.6.0","saxes":"^5.0.1","tmp":"^0.2.0","unzipper":"^0.10.11","uuid":"^8.3.0"},"devDependencies":{"@babel/cli":"^7.10.5","@babel/core":"^7.11.4","@babel/preset-env":"^7.11.0","@types/chai":"^4.2.12","@types/mocha":"^8.0.3","@types/node":"^14.11.2","babelify":"^10.0.0","browserify":"^16.5.2","chai":"^4.2.0","chai-datetime":"^1.7.0","chai-xml":"^0.3.2","core-js":"^3.6.5","dirty-chai":"^2.0.1","eslint":"^6.5.1","eslint-config-airbnb-base":"^14.2.0","eslint-config-prettier":"^6.12.0","eslint-friendly-formatter":"^4.0.1","eslint-plugin-import":"^2.22.0","eslint-plugin-node":"^11.1.0","express":"^4.16.4","got":"^9.0.0","grunt":"^1.3.0","grunt-babel":"^8.0.0","grunt-browserify":"^5.3.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-jasmine":"^2.2.0","grunt-contrib-watch":"^1.1.0","grunt-exorcise":"^2.1.1","grunt-terser":"^1.0.0","husky":"^4.3.0","lint-staged":"^10.2.13","mocha":"^7.2.0","prettier-eslint":"^11.0.0","prettier-eslint-cli":"^5.0.0","regenerator-runtime":"^0.13.7","sax":"^1.2.4","ts-node":"^8.10.2","typescript":"^3.9.7"},"_lastModified":"2025-11-20T08:14:40.443Z"}
1
+ {"name":"exceljs","version":"4.4.0","description":"Excel Workbook Manager - Read and Write xlsx and csv Files.","private":false,"license":"MIT","author":{"name":"Guyon Roche","email":"guyon@live.com"},"repository":{"type":"git","url":"https://github.com/exceljs/exceljs.git"},"engines":{"node":">=8.3.0"},"main":"./excel.js","browser":"./dist/exceljs.min.js","types":"./index.d.ts","files":["dist","lib","excel.js","LICENSE","README.md","README_zh.md","index.ts","index.d.ts"],"scripts":{"test":"npm run test:full","test:es5":"export EXCEL_BUILD=es5 && npm run test:full","test:full":"npm run build && npm run test:unit && npm run test:integration && npm run test:end-to-end && npm run test:jasmine","test:version":"npm run build && npm run test:unit && npm run test:integration && npm run test:end-to-end && npm run test:browser && npm run test:dist","test:all":"npm run test:native && npm run test:es5","test:native":"npm run test:full","test:unit":"mocha --require spec/config/setup --require spec/config/setup-unit spec/unit --recursive","test:integration":"mocha --require spec/config/setup spec/integration --recursive","test:end-to-end":"mocha --require spec/config/setup spec/end-to-end --recursive","test:browser":"if [ ! -f .disable-test-browser ]; then npm run build && npm run test:jasmine; fi","test:jasmine":"grunt jasmine","test:unit:es5":"export EXCEL_BUILD=es5 && npm run test:unit","test:integration:es5":"export EXCEL_BUILD=es5 && npm run test:integration","test:end-to-end:es5":"export EXCEL_BUILD=es5 && npm run test:end-to-end","test:dist":"mocha --require spec/config/setup spec/dist --recursive","test:manual":"node spec/manual/app.js","test:typescript":"mocha -r ts-node/register spec/typescript/**/*.spec.ts","clean-build":"npm run clean && npm run build","lint":"eslint --format node_modules/eslint-friendly-formatter .","lint:fix":"prettier-eslint --write $(pwd)'/**/*.js'","lint:staged":"lint-staged","clean":"rm -rf build/ && rm -rf dist","benchmark":"node --expose-gc benchmark","benchmark:debug":"node --expose-gc --inspect-brk --trace-deopt benchmark","build":"grunt build","install-build":"npm install && grunt build","preversion":"npm run clean && npm run build && npm run test:version","postversion":"git push --no-verify && git push --tags --no-verify"},"husky":{"hooks":{"pre-commit":"lint-staged"}},"lint-staged":{"*.js":["prettier-eslint --write","eslint --format node_modules/eslint-friendly-formatter","git add"]},"keywords":["xlsx","json","csv","excel","font","border","fill","number","format","number format","alignment","office","spreadsheet","workbook","defined names","data validations","rich text","in-cell format","outlineLevel","views","frozen","split","pageSetup"],"dependencies":{"archiver":"^5.0.0","dayjs":"^1.8.34","fast-csv":"^4.3.1","jszip":"^3.10.1","readable-stream":"^3.6.0","saxes":"^5.0.1","tmp":"^0.2.0","unzipper":"^0.10.11","uuid":"^8.3.0"},"devDependencies":{"@babel/cli":"^7.10.5","@babel/core":"^7.11.4","@babel/preset-env":"^7.11.0","@types/chai":"^4.2.12","@types/mocha":"^8.0.3","@types/node":"^14.11.2","babelify":"^10.0.0","browserify":"^16.5.2","chai":"^4.2.0","chai-datetime":"^1.7.0","chai-xml":"^0.3.2","core-js":"^3.6.5","dirty-chai":"^2.0.1","eslint":"^6.5.1","eslint-config-airbnb-base":"^14.2.0","eslint-config-prettier":"^6.12.0","eslint-friendly-formatter":"^4.0.1","eslint-plugin-import":"^2.22.0","eslint-plugin-node":"^11.1.0","express":"^4.16.4","got":"^9.0.0","grunt":"^1.3.0","grunt-babel":"^8.0.0","grunt-browserify":"^5.3.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-jasmine":"^2.2.0","grunt-contrib-watch":"^1.1.0","grunt-exorcise":"^2.1.1","grunt-terser":"^1.0.0","husky":"^4.3.0","lint-staged":"^10.2.13","mocha":"^7.2.0","prettier-eslint":"^11.0.0","prettier-eslint-cli":"^5.0.0","regenerator-runtime":"^0.13.7","sax":"^1.2.4","ts-node":"^8.10.2","typescript":"^3.9.7"},"_lastModified":"2025-12-05T07:15:44.681Z"}
@@ -1 +1 @@
1
- {"name":"pizzip","version":"3.1.7","author":"Edgar Hipp","description":"Create, read and edit .zip files synchronously with Javascript","scripts":{"lint:fix":"npm run prettier:fix && npm run eslint:fix","eslint:fix":"eslint --cache 'es6/**/*.js' --fix","prettier:fix":"prettier --cache --write '*.js' 'es6/**/*.js' 'test/test.js' test/node.js 'utils/*.js' 'utils/es6/**/*.js'","browserify:lib":"webpack","babel":"babel es6 --out-dir js","babel:watch":"npm run babel -- --watch","build":"npm run browserify:lib && npm run browserify:lib:min","browserify:lib:min":"cross-env MIN=true webpack","preversion":"npm run babel && npm run build && npm test && npm run utils:build && cp utils/dist/* dist && npm run test:typings","test":"mocha test/test.js","test:watch":"mocha test/test.js --watch","test:typings":"cp es6/*.ts js && tsd js && tsd utils","utils:build":"cd utils && cross-env MIN=true ../node_modules/.bin/webpack && ../node_modules/.bin/webpack && IE=true cross-env MIN=true ../node_modules/.bin/webpack && IE=true ../node_modules/.bin/webpack"},"contributors":[{"name":"Stuart Knightley"},{"name":"Franz Buchinger"},{"name":"António Afonso"},{"name":"David Duponchel"},{"name":"yiminghe"},{"name":"Edgar Hipp"}],"main":"./js/index.js","repository":{"type":"git","url":"https://github.com/open-xml-templating/pizzip"},"keywords":["zip","deflate","inflate"],"devDependencies":{"@babel/cli":"^7.23.4","@babel/core":"^7.23.7","@babel/eslint-parser":"^7.23.3","@babel/plugin-proposal-object-rest-spread":"^7.20.7","@babel/preset-env":"^7.23.8","acorn":"^8.11.3","babel-loader":"^9.1.3","chai":"^4.3.7","cross-env":"^7.0.3","eslint":"^8.56.0","eslint_d":"^13.1.2","eslint-plugin-import":"^2.29.1","mocha":"^10.2.0","prettier":"^3.2.4","tsd":"^0.30.4","webpack":"^5.89.0","webpack-cli":"^5.1.4"},"dependencies":{"pako":"^2.1.0"},"license":"(MIT OR GPL-3.0)","_lastModified":"2025-11-20T08:14:41.470Z"}
1
+ {"name":"pizzip","version":"3.1.7","author":"Edgar Hipp","description":"Create, read and edit .zip files synchronously with Javascript","scripts":{"lint:fix":"npm run prettier:fix && npm run eslint:fix","eslint:fix":"eslint --cache 'es6/**/*.js' --fix","prettier:fix":"prettier --cache --write '*.js' 'es6/**/*.js' 'test/test.js' test/node.js 'utils/*.js' 'utils/es6/**/*.js'","browserify:lib":"webpack","babel":"babel es6 --out-dir js","babel:watch":"npm run babel -- --watch","build":"npm run browserify:lib && npm run browserify:lib:min","browserify:lib:min":"cross-env MIN=true webpack","preversion":"npm run babel && npm run build && npm test && npm run utils:build && cp utils/dist/* dist && npm run test:typings","test":"mocha test/test.js","test:watch":"mocha test/test.js --watch","test:typings":"cp es6/*.ts js && tsd js && tsd utils","utils:build":"cd utils && cross-env MIN=true ../node_modules/.bin/webpack && ../node_modules/.bin/webpack && IE=true cross-env MIN=true ../node_modules/.bin/webpack && IE=true ../node_modules/.bin/webpack"},"contributors":[{"name":"Stuart Knightley"},{"name":"Franz Buchinger"},{"name":"António Afonso"},{"name":"David Duponchel"},{"name":"yiminghe"},{"name":"Edgar Hipp"}],"main":"./js/index.js","repository":{"type":"git","url":"https://github.com/open-xml-templating/pizzip"},"keywords":["zip","deflate","inflate"],"devDependencies":{"@babel/cli":"^7.23.4","@babel/core":"^7.23.7","@babel/eslint-parser":"^7.23.3","@babel/plugin-proposal-object-rest-spread":"^7.20.7","@babel/preset-env":"^7.23.8","acorn":"^8.11.3","babel-loader":"^9.1.3","chai":"^4.3.7","cross-env":"^7.0.3","eslint":"^8.56.0","eslint_d":"^13.1.2","eslint-plugin-import":"^2.29.1","mocha":"^10.2.0","prettier":"^3.2.4","tsd":"^0.30.4","webpack":"^5.89.0","webpack-cli":"^5.1.4"},"dependencies":{"pako":"^2.1.0"},"license":"(MIT OR GPL-3.0)","_lastModified":"2025-12-05T07:15:45.117Z"}
@@ -1 +1 @@
1
- {"name":"tencentcloud-sdk-nodejs","version":"4.0.996","description":"腾讯云 API NODEJS SDK","main":"tencentcloud/index.js","scripts":{"test":"mocha -t 10000","build":"tsc","prettier":"prettier --config prettier.config.js --write 'src/**/*.{tsx,ts,jsx,js,css,json,vue}'"},"engines":{"node":">=10"},"keywords":["tencentcloudapi","tencentcloud","qcloud","sdk","js","nodejs"],"author":"tencentcloudapi","license":"Apache-2.0","dependencies":{"form-data":"^3.0.0","get-stream":"^6.0.0","https-proxy-agent":"^5.0.0","is-stream":"^2.0.0","json-bigint":"^1.0.0","node-fetch":"^2.2.0","tslib":"1.13.0","uuid":"^9.0.1"},"directories":{"example":"examples","lib":"lib"},"repository":{"type":"git","url":"https://github.com/tencentcloud/tencentcloud-sdk-nodejs"},"devDependencies":{"@types/form-data":"^2.5.0","@types/json-bigint":"^1.0.1","@types/node":"^14.0.26","@types/node-fetch":"^2.5.7","@types/uuid":"^9.0.8","@typescript-eslint/eslint-plugin":"^2.34.0","@typescript-eslint/parser":"^2.34.0","babel-eslint":"^10.0.2","chai":"^4.2.0","eslint":"^6.8.0","eslint-plugin-react":"^7.17.0","mocha":"^8.1.1","prettier":"^2.3.0","ts-node":"^8.10.2","typescript":"^3.9.7"},"_lastModified":"2025-11-20T08:14:47.717Z"}
1
+ {"name":"tencentcloud-sdk-nodejs","version":"4.0.996","description":"腾讯云 API NODEJS SDK","main":"tencentcloud/index.js","scripts":{"test":"mocha -t 10000","build":"tsc","prettier":"prettier --config prettier.config.js --write 'src/**/*.{tsx,ts,jsx,js,css,json,vue}'"},"engines":{"node":">=10"},"keywords":["tencentcloudapi","tencentcloud","qcloud","sdk","js","nodejs"],"author":"tencentcloudapi","license":"Apache-2.0","dependencies":{"form-data":"^3.0.0","get-stream":"^6.0.0","https-proxy-agent":"^5.0.0","is-stream":"^2.0.0","json-bigint":"^1.0.0","node-fetch":"^2.2.0","tslib":"1.13.0","uuid":"^9.0.1"},"directories":{"example":"examples","lib":"lib"},"repository":{"type":"git","url":"https://github.com/tencentcloud/tencentcloud-sdk-nodejs"},"devDependencies":{"@types/form-data":"^2.5.0","@types/json-bigint":"^1.0.1","@types/node":"^14.0.26","@types/node-fetch":"^2.5.7","@types/uuid":"^9.0.8","@typescript-eslint/eslint-plugin":"^2.34.0","@typescript-eslint/parser":"^2.34.0","babel-eslint":"^10.0.2","chai":"^4.2.0","eslint":"^6.8.0","eslint-plugin-react":"^7.17.0","mocha":"^8.1.1","prettier":"^2.3.0","ts-node":"^8.10.2","typescript":"^3.9.7"},"_lastModified":"2025-12-05T07:15:51.500Z"}
@@ -1,3 +1,3 @@
1
1
  import { Context, Next } from '@tego/server';
2
- export declare function convertToWord(context: Context, next: Next): Promise<void>;
3
- export declare function convertToExcel(context: Context, next: Next): Promise<void>;
2
+ export declare function convertToWord(ctx: Context, next: Next): Promise<void>;
3
+ export declare function convertToExcel(ctx: Context, next: Next): Promise<void>;
@@ -53,8 +53,8 @@ async function getTemplateContent(template) {
53
53
  return await (0, import_node_util.promisify)(import_node_fs.default.readFile)(template);
54
54
  }
55
55
  }
56
- async function convertToWord(context, next) {
57
- const { values } = context.action.params;
56
+ async function convertToWord(ctx, next) {
57
+ const { values } = ctx.action.params;
58
58
  const { template, data, saveType, fileName } = values;
59
59
  try {
60
60
  const templateContent = await getTemplateContent(template);
@@ -65,18 +65,18 @@ async function convertToWord(context, next) {
65
65
  if (saveType === "file") {
66
66
  import_node_fs.default.writeFileSync(fileName, buffer);
67
67
  } else {
68
- context.body = buffer;
68
+ ctx.body = buffer;
69
69
  }
70
70
  } catch (error) {
71
- context.status = 500;
72
- context.body = {
71
+ ctx.status = 500;
72
+ ctx.body = {
73
73
  success: false,
74
74
  message: `\u8F6C\u6362Word\u6587\u6863\u5931\u8D25: ${error.message}`
75
75
  };
76
76
  }
77
77
  }
78
- async function convertToExcel(context, next) {
79
- const { values } = context.action.params;
78
+ async function convertToExcel(ctx, next) {
79
+ const { values } = ctx.action.params;
80
80
  const { template, data, saveType, fileName } = values;
81
81
  try {
82
82
  const workbook = new import_exceljs.default.Workbook();
@@ -97,11 +97,11 @@ async function convertToExcel(context, next) {
97
97
  if (saveType === "file") {
98
98
  await workbook.xlsx.writeFile(fileName);
99
99
  } else {
100
- context.body = await workbook.xlsx.writeBuffer();
100
+ ctx.body = await workbook.xlsx.writeBuffer();
101
101
  }
102
102
  } catch (error) {
103
- context.status = 500;
104
- context.body = {
103
+ ctx.status = 500;
104
+ ctx.body = {
105
105
  success: false,
106
106
  message: `\u8F6C\u6362Excel\u6587\u6863\u5931\u8D25: ${error.message}`
107
107
  };
@@ -42,7 +42,7 @@ function make(name, mod) {
42
42
  );
43
43
  }
44
44
  function initActions(app) {
45
- app.actions({
45
+ app.resourcer.registerActions({
46
46
  ...make("ocr_providers", { ...ocrConvert, ...fileConvert })
47
47
  });
48
48
  }
@@ -1,2 +1,2 @@
1
1
  import { Context, Next } from '@tego/server';
2
- export declare function recognize(context: Context, next: Next): Promise<never>;
2
+ export declare function recognize(ctx: Context, next: Next): Promise<never>;
@@ -21,22 +21,22 @@ __export(ocrConvert_exports, {
21
21
  });
22
22
  module.exports = __toCommonJS(ocrConvert_exports);
23
23
  var import_plugin = require("../plugin");
24
- async function recognize(context, next) {
25
- const plugin = context.app.getPlugin(import_plugin.PluginOcrConvert);
26
- const { values } = context.action.params;
24
+ async function recognize(ctx, next) {
25
+ const plugin = ctx.tego.pm.get(import_plugin.PluginOcrConvert);
26
+ const { values } = ctx.action.params;
27
27
  const providerItem = await plugin.getDefault();
28
28
  if (!providerItem) {
29
29
  console.error(`[ocr-convert] no provider for action (${values.type}) provided`);
30
- return context.throw(500, "no provider for action provided");
30
+ return ctx.throw(500, "no provider for action provided");
31
31
  }
32
32
  const ProviderType = plugin.providers.get(providerItem.get("type"));
33
33
  if (!ProviderType) {
34
34
  console.error("[ocr-convert] invalid provider type:", providerItem.get("type"));
35
- return context.throw(500, "invalid provider type");
35
+ return ctx.throw(500, "invalid provider type");
36
36
  }
37
37
  const provider = new ProviderType(plugin, providerItem.get("options"));
38
- const result = await provider.recognize(context, values.image, values.type);
39
- context.body = result;
38
+ const result = await provider.recognize(ctx, values.image, values.type);
39
+ ctx.body = result;
40
40
  }
41
41
  // Annotate the CommonJS export names for ESM import in node:
42
42
  0 && (module.exports = {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tachybase/plugin-ocr-convert",
3
3
  "displayName": "OCR Conversion Plugin",
4
- "version": "1.6.0",
4
+ "version": "1.6.1",
5
5
  "description": "OCR Conversion Plugin",
6
6
  "keywords": [
7
7
  "System management"
@@ -9,10 +9,10 @@
9
9
  "main": "dist/server/index.js",
10
10
  "dependencies": {},
11
11
  "devDependencies": {
12
- "@tachybase/schema": "1.3.52",
13
- "@tachybase/test": "1.3.52",
14
- "@tego/client": "1.3.52",
15
- "@tego/server": "1.3.52",
12
+ "@tachybase/schema": "1.6.0-alpha.9",
13
+ "@tachybase/test": "1.6.0-alpha.9",
14
+ "@tego/client": "1.6.0-alpha.9",
15
+ "@tego/server": "1.6.0-alpha.9",
16
16
  "@vercel/ncc": "0.38.3",
17
17
  "antd": "5.22.5",
18
18
  "axios": "1.13.0",
@@ -24,7 +24,7 @@
24
24
  "react": "18.3.1",
25
25
  "react-i18next": "16.2.1",
26
26
  "tencentcloud-sdk-nodejs": "^4.0.996",
27
- "@tachybase/client": "1.6.0"
27
+ "@tachybase/client": "1.6.1"
28
28
  },
29
29
  "description.zh-CN": "OCR 转换插件",
30
30
  "displayName.zh-CN": "OCR 转换"