@tachybase/plugin-action-import 1.6.24 → 1.6.26

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,6 +1,6 @@
1
1
  module.exports = {
2
2
  "react": "18.3.1",
3
- "@tachybase/client": "1.6.24",
3
+ "@tachybase/client": "1.6.26",
4
4
  "@tachybase/schema": "1.6.16",
5
5
  "@tego/client": "1.6.16",
6
6
  "react-i18next": "16.2.1",
@@ -1 +1 @@
1
- {"name":"mathjs","version":"10.6.4","description":"Math.js is an extensive math library for JavaScript and Node.js. It features a flexible expression parser with support for symbolic computation, comes with a large set of built-in functions and constants, and offers an integrated solution to work with different data types like numbers, big numbers, complex numbers, fractions, units, and matrices.","author":"Jos de Jong <wjosdejong@gmail.com> (https://github.com/josdejong)","homepage":"https://mathjs.org","repository":{"type":"git","url":"https://github.com/josdejong/mathjs.git"},"license":"Apache-2.0","keywords":["math","mathematics","functions","numeric","algebra","parser","expression","number","bignumber","complex","fraction","matrix","unit"],"dependencies":{"@babel/runtime":"^7.18.6","complex.js":"^2.1.1","decimal.js":"^10.3.1","escape-latex":"^1.2.0","fraction.js":"^4.2.0","javascript-natural-sort":"^0.7.1","seedrandom":"^3.0.5","tiny-emitter":"^2.1.0","typed-function":"^2.1.0"},"devDependencies":{"@babel/core":"7.18.6","@babel/plugin-transform-object-assign":"7.18.6","@babel/plugin-transform-runtime":"7.18.6","@babel/preset-env":"7.18.6","@babel/register":"7.18.6","@types/assert":"1.5.6","@types/mocha":"9.1.1","@typescript-eslint/eslint-plugin":"5.30.0","@typescript-eslint/parser":"5.30.0","assert":"2.0.0","babel-loader":"8.2.5","benchmark":"2.1.4","codecov":"3.8.3","core-js":"3.23.3","del":"6.1.1","dtslint":"4.2.1","eslint":"8.18.0","eslint-config-prettier":"8.5.0","eslint-config-standard":"17.0.0","eslint-plugin-import":"2.26.0","eslint-plugin-mocha":"10.0.5","eslint-plugin-n":"15.2.3","eslint-plugin-prettier":"4.1.0","eslint-plugin-promise":"6.0.0","expect-type":"0.13.0","expr-eval":"2.0.2","fancy-log":"2.0.0","glob":"7.2.0","gulp":"4.0.2","gulp-babel":"8.0.0","handlebars":"4.7.7","istanbul":"0.4.5","jsep":"1.3.6","karma":"6.4.0","karma-browserstack-launcher":"1.6.0","karma-firefox-launcher":"2.1.2","karma-mocha":"2.0.1","karma-mocha-reporter":"2.2.5","karma-webpack":"4.0.2","math-expression-evaluator":"1.3.14","mkdirp":"1.0.4","mocha":"8.4.0","ndarray":"1.0.19","ndarray-determinant":"1.0.0","ndarray-gemm":"1.0.0","ndarray-ops":"1.2.2","ndarray-pack":"1.2.1","numericjs":"1.2.6","nyc":"15.1.0","pad-right":"0.2.2","prettier":"2.7.1","process":"0.11.10","sylvester":"0.0.21","ts-node":"10.8.1","typescript":"4.7.4","webpack":"4.46.0","zeros":"1.0.0"},"type":"module","main":"./lib/cjs","types":"./types/index.d.ts","module":"./lib/esm","unpkg":"./lib/browser/math.js","jsdelivr":"./lib/browser/math.js","exports":{".":{"types":"./types/index.d.ts","import":"./lib/esm/index.js","require":"./lib/cjs/index.js"},"./number":{"types":"./types/index.d.ts","import":"./lib/esm/number.js","require":"./lib/cjs/number.js"},"./lib/esm/number":{"types":"./types/index.d.ts","import":"./lib/esm/number.js","require":"./lib/cjs/number.js"},"./package.json":"./package.json","./lib/browser/math.js":"./lib/browser/math.js","./lib/browser/math.js.map":"./lib/browser/math.js.map","./dist/math.js":"./dist/math.js","./dist/math.min.js":"./dist/math.min.js","./main/es5/index.js":"./main/es5/index.js","./main/es5/number.js":"./main/es5/number.js","./main/esm/index.js":"./main/esm/index.js","./main/esm/number.js":"./main/esm/number.js","./number.js":"./number.cjs"},"files":["bin","dist","lib","main","types","number.cjs","LICENSE","NOTICE","README.md","HISTORY.md","CONTRIBUTING.md"],"directories":{"bin":"./bin","lib":"./lib"},"scripts":{"build":"gulp --gulpfile gulpfile.cjs && npm run update-authors","build-and-test":"npm run build && npm run test:all && npm run lint","build:clean":"gulp --gulpfile gulpfile.cjs clean","build:docs":"gulp --gulpfile gulpfile.cjs docs","compile":"gulp --gulpfile gulpfile.cjs compile","watch":"gulp --gulpfile gulpfile.cjs watch","lint":"eslint --cache --max-warnings 0 src/ test/ types/","format":"npm run lint -- --fix","validate:ascii":"gulp --gulpfile gulpfile.cjs validate:ascii","test":"npm run test:src && npm run lint","test:src":"mocha test/unit-tests","test:generated":"mocha test/generated-code-tests","test:node":"mocha test/node-tests/*.test.js test/node-tests/**/*.test.js","test:all":"npm run test:src && npm run test:generated && npm run test:node && npm run test:types","test:browser":"karma start test/browser-test-config/local-karma.js","test:browserstack":"karma start test/browser-test-config/browserstack-karma.js","test:types":"cd types && node --loader ts-node/esm ./index.ts","coverage":"nyc --reporter=lcov --reporter=text-summary mocha test/unit-tests && echo \"\nDetailed coverage report is available at ./coverage/lcov-report/index.html\"","prepublishOnly":"npm run test:all && npm run lint","prepare":"npm run build","update-authors":"node ./tools/update-authors.js"},"bin":{"mathjs":"./bin/cli.js"},"engines":{"node":">= 14"},"bugs":{"url":"https://github.com/josdejong/mathjs/issues"},"browserslist":["IE 11"],"sideEffects":false,"_lastModified":"2026-07-09T11:40:24.397Z"}
1
+ {"name":"mathjs","version":"10.6.4","description":"Math.js is an extensive math library for JavaScript and Node.js. It features a flexible expression parser with support for symbolic computation, comes with a large set of built-in functions and constants, and offers an integrated solution to work with different data types like numbers, big numbers, complex numbers, fractions, units, and matrices.","author":"Jos de Jong <wjosdejong@gmail.com> (https://github.com/josdejong)","homepage":"https://mathjs.org","repository":{"type":"git","url":"https://github.com/josdejong/mathjs.git"},"license":"Apache-2.0","keywords":["math","mathematics","functions","numeric","algebra","parser","expression","number","bignumber","complex","fraction","matrix","unit"],"dependencies":{"@babel/runtime":"^7.18.6","complex.js":"^2.1.1","decimal.js":"^10.3.1","escape-latex":"^1.2.0","fraction.js":"^4.2.0","javascript-natural-sort":"^0.7.1","seedrandom":"^3.0.5","tiny-emitter":"^2.1.0","typed-function":"^2.1.0"},"devDependencies":{"@babel/core":"7.18.6","@babel/plugin-transform-object-assign":"7.18.6","@babel/plugin-transform-runtime":"7.18.6","@babel/preset-env":"7.18.6","@babel/register":"7.18.6","@types/assert":"1.5.6","@types/mocha":"9.1.1","@typescript-eslint/eslint-plugin":"5.30.0","@typescript-eslint/parser":"5.30.0","assert":"2.0.0","babel-loader":"8.2.5","benchmark":"2.1.4","codecov":"3.8.3","core-js":"3.23.3","del":"6.1.1","dtslint":"4.2.1","eslint":"8.18.0","eslint-config-prettier":"8.5.0","eslint-config-standard":"17.0.0","eslint-plugin-import":"2.26.0","eslint-plugin-mocha":"10.0.5","eslint-plugin-n":"15.2.3","eslint-plugin-prettier":"4.1.0","eslint-plugin-promise":"6.0.0","expect-type":"0.13.0","expr-eval":"2.0.2","fancy-log":"2.0.0","glob":"7.2.0","gulp":"4.0.2","gulp-babel":"8.0.0","handlebars":"4.7.7","istanbul":"0.4.5","jsep":"1.3.6","karma":"6.4.0","karma-browserstack-launcher":"1.6.0","karma-firefox-launcher":"2.1.2","karma-mocha":"2.0.1","karma-mocha-reporter":"2.2.5","karma-webpack":"4.0.2","math-expression-evaluator":"1.3.14","mkdirp":"1.0.4","mocha":"8.4.0","ndarray":"1.0.19","ndarray-determinant":"1.0.0","ndarray-gemm":"1.0.0","ndarray-ops":"1.2.2","ndarray-pack":"1.2.1","numericjs":"1.2.6","nyc":"15.1.0","pad-right":"0.2.2","prettier":"2.7.1","process":"0.11.10","sylvester":"0.0.21","ts-node":"10.8.1","typescript":"4.7.4","webpack":"4.46.0","zeros":"1.0.0"},"type":"module","main":"./lib/cjs","types":"./types/index.d.ts","module":"./lib/esm","unpkg":"./lib/browser/math.js","jsdelivr":"./lib/browser/math.js","exports":{".":{"types":"./types/index.d.ts","import":"./lib/esm/index.js","require":"./lib/cjs/index.js"},"./number":{"types":"./types/index.d.ts","import":"./lib/esm/number.js","require":"./lib/cjs/number.js"},"./lib/esm/number":{"types":"./types/index.d.ts","import":"./lib/esm/number.js","require":"./lib/cjs/number.js"},"./package.json":"./package.json","./lib/browser/math.js":"./lib/browser/math.js","./lib/browser/math.js.map":"./lib/browser/math.js.map","./dist/math.js":"./dist/math.js","./dist/math.min.js":"./dist/math.min.js","./main/es5/index.js":"./main/es5/index.js","./main/es5/number.js":"./main/es5/number.js","./main/esm/index.js":"./main/esm/index.js","./main/esm/number.js":"./main/esm/number.js","./number.js":"./number.cjs"},"files":["bin","dist","lib","main","types","number.cjs","LICENSE","NOTICE","README.md","HISTORY.md","CONTRIBUTING.md"],"directories":{"bin":"./bin","lib":"./lib"},"scripts":{"build":"gulp --gulpfile gulpfile.cjs && npm run update-authors","build-and-test":"npm run build && npm run test:all && npm run lint","build:clean":"gulp --gulpfile gulpfile.cjs clean","build:docs":"gulp --gulpfile gulpfile.cjs docs","compile":"gulp --gulpfile gulpfile.cjs compile","watch":"gulp --gulpfile gulpfile.cjs watch","lint":"eslint --cache --max-warnings 0 src/ test/ types/","format":"npm run lint -- --fix","validate:ascii":"gulp --gulpfile gulpfile.cjs validate:ascii","test":"npm run test:src && npm run lint","test:src":"mocha test/unit-tests","test:generated":"mocha test/generated-code-tests","test:node":"mocha test/node-tests/*.test.js test/node-tests/**/*.test.js","test:all":"npm run test:src && npm run test:generated && npm run test:node && npm run test:types","test:browser":"karma start test/browser-test-config/local-karma.js","test:browserstack":"karma start test/browser-test-config/browserstack-karma.js","test:types":"cd types && node --loader ts-node/esm ./index.ts","coverage":"nyc --reporter=lcov --reporter=text-summary mocha test/unit-tests && echo \"\nDetailed coverage report is available at ./coverage/lcov-report/index.html\"","prepublishOnly":"npm run test:all && npm run lint","prepare":"npm run build","update-authors":"node ./tools/update-authors.js"},"bin":{"mathjs":"./bin/cli.js"},"engines":{"node":">= 14"},"bugs":{"url":"https://github.com/josdejong/mathjs/issues"},"browserslist":["IE 11"],"sideEffects":false,"_lastModified":"2026-08-11T06:21:14.836Z"}
@@ -1 +1 @@
1
- {"name":"node-xlsx","author":"Olivier Louvignes <olivier@mg-crea.com>","version":"0.24.0","description":"NodeJS Excel files parser & builder","type":"module","main":"./dist/index.cjs","exports":{".":{"require":"./dist/index.cjs","import":"./dist/index.js","types":"./dist/index.d.ts"}},"bin":{"node-xlsx":"./dist/bin/cli.js"},"files":["dist"],"scripts":{"start":"npm run spec -- --watch","build":"tsup --entry src/index.ts --format cjs,esm --sourcemap --dts --clean --entry src/bin/cli.ts","lint":"eslint src/ test/","prettycheck":"prettier --check src/ test/","prettify":"prettier --write src/ test/","typecheck":"tsc --noEmit","spec":"DEBUG=node-xlsx* vitest --run","watch":"DEBUG=node-xlsx* vitest --watch","test":"npm run lint && npm run prettycheck && npm run typecheck && npm run spec","prepublishOnly":"npm run build"},"repository":"github:mgcrea/node-xlsx","license":"Apache-2.0","dependencies":{"xlsx":"https://cdn.sheetjs.com/xlsx-0.20.2/xlsx-0.20.2.tgz"},"devDependencies":{"@mgcrea/eslint-config-node":"^0.10.0","@tsconfig/node-lts":"^20.1.1","@types/node":"^20.12.7","eslint":"^8.57.0","prettier":"^3.2.5","prettier-plugin-organize-imports":"^3.2.4","tsup":"^8.0.2","typescript":"^5.4.5","vite-tsconfig-paths":"^4.3.2","vitest":"^1.5.0"},"engines":{"node":">=10.0.0"},"keywords":["excel","parser","builder","xlsx","xls"],"_lastModified":"2026-07-09T11:40:17.046Z"}
1
+ {"name":"node-xlsx","author":"Olivier Louvignes <olivier@mg-crea.com>","version":"0.24.0","description":"NodeJS Excel files parser & builder","type":"module","main":"./dist/index.cjs","exports":{".":{"require":"./dist/index.cjs","import":"./dist/index.js","types":"./dist/index.d.ts"}},"bin":{"node-xlsx":"./dist/bin/cli.js"},"files":["dist"],"scripts":{"start":"npm run spec -- --watch","build":"tsup --entry src/index.ts --format cjs,esm --sourcemap --dts --clean --entry src/bin/cli.ts","lint":"eslint src/ test/","prettycheck":"prettier --check src/ test/","prettify":"prettier --write src/ test/","typecheck":"tsc --noEmit","spec":"DEBUG=node-xlsx* vitest --run","watch":"DEBUG=node-xlsx* vitest --watch","test":"npm run lint && npm run prettycheck && npm run typecheck && npm run spec","prepublishOnly":"npm run build"},"repository":"github:mgcrea/node-xlsx","license":"Apache-2.0","dependencies":{"xlsx":"https://cdn.sheetjs.com/xlsx-0.20.2/xlsx-0.20.2.tgz"},"devDependencies":{"@mgcrea/eslint-config-node":"^0.10.0","@tsconfig/node-lts":"^20.1.1","@types/node":"^20.12.7","eslint":"^8.57.0","prettier":"^3.2.5","prettier-plugin-organize-imports":"^3.2.4","tsup":"^8.0.2","typescript":"^5.4.5","vite-tsconfig-paths":"^4.3.2","vitest":"^1.5.0"},"engines":{"node":">=10.0.0"},"keywords":["excel","parser","builder","xlsx","xls"],"_lastModified":"2026-08-11T06:21:09.444Z"}
@@ -1 +1 @@
1
- {"name":"xlsx","version":"0.18.5","author":"sheetjs","description":"SheetJS Spreadsheet data parser and writer","keywords":["excel","xls","xlsx","xlsb","xlsm","ods","csv","dbf","dif","sylk","office","spreadsheet"],"bin":{"xlsx":"./bin/xlsx.njs"},"main":"xlsx.js","module":"xlsx.mjs","unpkg":"dist/xlsx.full.min.js","jsdelivr":"dist/xlsx.full.min.js","types":"types/index.d.ts","browser":{"buffer":false,"crypto":false,"stream":false,"process":false,"fs":false},"sideEffects":false,"dependencies":{"adler-32":"~1.3.0","cfb":"~1.2.1","codepage":"~1.15.0","crc-32":"~1.2.1","ssf":"~0.11.2","wmf":"~1.0.1","word":"~0.3.0"},"devDependencies":{"@sheetjs/uglify-js":"~2.7.3","@types/node":"^8.5.9","acorn":"7.4.1","alex":"8.1.1","blanket":"~1.2.3","commander":"~2.17.1","dtslint":"^0.1.2","eslint":"7.23.0","eslint-plugin-html":"^6.1.2","eslint-plugin-json":"^2.1.2","exit-on-epipe":"~1.0.1","fflate":"^0.7.1","jsdom":"~11.1.0","markdown-spellcheck":"^1.3.1","mocha":"~2.5.3","sinon":"^1.17.7","typescript":"2.2.0"},"repository":{"type":"git","url":"git://github.com/SheetJS/sheetjs.git"},"scripts":{"pretest":"npm run lint","test":"npm run tests-only","pretest-only":"git submodule init && git submodule update","tests-only":"make travis","build":"make","lint":"make fullint","dtslint":"dtslint types"},"config":{"blanket":{"pattern":"xlsx.js"}},"alex":{"allow":["chinese","special","simple","just","crash","wtf","holes"]},"homepage":"https://sheetjs.com/","bugs":{"url":"https://github.com/SheetJS/sheetjs/issues"},"license":"Apache-2.0","engines":{"node":">=0.8"},"_lastModified":"2026-07-09T11:40:19.146Z"}
1
+ {"name":"xlsx","version":"0.18.5","author":"sheetjs","description":"SheetJS Spreadsheet data parser and writer","keywords":["excel","xls","xlsx","xlsb","xlsm","ods","csv","dbf","dif","sylk","office","spreadsheet"],"bin":{"xlsx":"./bin/xlsx.njs"},"main":"xlsx.js","module":"xlsx.mjs","unpkg":"dist/xlsx.full.min.js","jsdelivr":"dist/xlsx.full.min.js","types":"types/index.d.ts","browser":{"buffer":false,"crypto":false,"stream":false,"process":false,"fs":false},"sideEffects":false,"dependencies":{"adler-32":"~1.3.0","cfb":"~1.2.1","codepage":"~1.15.0","crc-32":"~1.2.1","ssf":"~0.11.2","wmf":"~1.0.1","word":"~0.3.0"},"devDependencies":{"@sheetjs/uglify-js":"~2.7.3","@types/node":"^8.5.9","acorn":"7.4.1","alex":"8.1.1","blanket":"~1.2.3","commander":"~2.17.1","dtslint":"^0.1.2","eslint":"7.23.0","eslint-plugin-html":"^6.1.2","eslint-plugin-json":"^2.1.2","exit-on-epipe":"~1.0.1","fflate":"^0.7.1","jsdom":"~11.1.0","markdown-spellcheck":"^1.3.1","mocha":"~2.5.3","sinon":"^1.17.7","typescript":"2.2.0"},"repository":{"type":"git","url":"git://github.com/SheetJS/sheetjs.git"},"scripts":{"pretest":"npm run lint","test":"npm run tests-only","pretest-only":"git submodule init && git submodule update","tests-only":"make travis","build":"make","lint":"make fullint","dtslint":"dtslint types"},"config":{"blanket":{"pattern":"xlsx.js"}},"alex":{"allow":["chinese","special","simple","just","crash","wtf","holes"]},"homepage":"https://sheetjs.com/","bugs":{"url":"https://github.com/SheetJS/sheetjs/issues"},"license":"Apache-2.0","engines":{"node":">=0.8"},"_lastModified":"2026-08-11T06:21:11.059Z"}
@@ -1,17 +1,29 @@
1
+ /**
2
+ * Transforms imported generic value field values into application values.
3
+ */
1
4
  export declare function _({ value, field }: {
2
5
  value: any;
3
6
  field: any;
4
7
  }): Promise<any>;
8
+ /**
9
+ * Transforms imported email field values into application values.
10
+ */
5
11
  export declare function email({ value, field, ctx }: {
6
12
  value: any;
7
13
  field: any;
8
14
  ctx: any;
9
15
  }): Promise<any>;
16
+ /**
17
+ * Transforms imported password field values into application values.
18
+ */
10
19
  export declare function password({ value, field, ctx }: {
11
20
  value: any;
12
21
  field: any;
13
22
  ctx: any;
14
23
  }): Promise<string>;
24
+ /**
25
+ * Transforms imported o2o field values into application values.
26
+ */
15
27
  export declare function o2o({ value, column, field, ctx }: {
16
28
  value: any;
17
29
  column: any;
@@ -20,39 +32,60 @@ export declare function o2o({ value, column, field, ctx }: {
20
32
  }): Promise<any>;
21
33
  export declare const oho: typeof o2o;
22
34
  export declare const obo: typeof o2o;
35
+ /**
36
+ * Transforms imported o2m field values into application values.
37
+ */
23
38
  export declare function o2m({ value, column, field, ctx }: {
24
39
  value: any;
25
40
  column: any;
26
41
  field: any;
27
42
  ctx: any;
28
43
  }): Promise<any[]>;
44
+ /**
45
+ * Transforms imported m2o field values into application values.
46
+ */
29
47
  export declare function m2o({ value, column, field, ctx }: {
30
48
  value: any;
31
49
  column: any;
32
50
  field: any;
33
51
  ctx: any;
34
52
  }): Promise<any>;
53
+ /**
54
+ * Transforms imported m2m field values into application values.
55
+ */
35
56
  export declare function m2m({ value, column, field, ctx }: {
36
57
  value: any;
37
58
  column: any;
38
59
  field: any;
39
60
  ctx: any;
40
61
  }): Promise<any[]>;
62
+ /**
63
+ * Transforms imported datetime field values into application values.
64
+ */
41
65
  export declare function datetime({ value, field, ctx }: {
42
66
  value: any;
43
67
  field: any;
44
68
  ctx: any;
45
69
  }): Promise<any>;
70
+ /**
71
+ * Transforms imported time field values into application values.
72
+ */
46
73
  export declare function time({ value, field, ctx }: {
47
74
  value: any;
48
75
  field: any;
49
76
  ctx: any;
50
77
  }): Promise<any>;
78
+ /**
79
+ * Transforms imported percent field values into application values.
80
+ */
51
81
  export declare function percent({ value, field, ctx }: {
52
82
  value: any;
53
83
  field: any;
54
84
  ctx: any;
55
85
  }): Promise<number>;
86
+ /**
87
+ * Transforms imported checkbox field values into application values.
88
+ */
56
89
  export declare function checkbox({ value, column, field, ctx }: {
57
90
  value: any;
58
91
  column: any;
@@ -60,6 +93,9 @@ export declare function checkbox({ value, column, field, ctx }: {
60
93
  ctx: any;
61
94
  }): Promise<0 | 1>;
62
95
  export declare const boolean: typeof checkbox;
96
+ /**
97
+ * Transforms imported select field values into application values.
98
+ */
63
99
  export declare function select({ value, column, field, ctx }: {
64
100
  value: any;
65
101
  column: any;
@@ -68,6 +104,9 @@ export declare function select({ value, column, field, ctx }: {
68
104
  }): Promise<any>;
69
105
  export declare const radio: typeof select;
70
106
  export declare const radioGroup: typeof select;
107
+ /**
108
+ * Transforms imported multiple select field values into application values.
109
+ */
71
110
  export declare function multipleSelect({ value, column, field, ctx }: {
72
111
  value: any;
73
112
  column: any;
@@ -76,6 +115,9 @@ export declare function multipleSelect({ value, column, field, ctx }: {
76
115
  }): Promise<any>;
77
116
  export declare const checkboxes: typeof multipleSelect;
78
117
  export declare const checkboxGroup: typeof multipleSelect;
118
+ /**
119
+ * Transforms imported china region field values into application values.
120
+ */
79
121
  export declare function chinaRegion({ value, column, field, ctx }: {
80
122
  value: any;
81
123
  column: any;
@@ -54,6 +54,60 @@ var import_server = require("@tego/server");
54
54
  var import_dayjs = __toESM(require("dayjs"));
55
55
  var math = __toESM(require("mathjs"));
56
56
  var import__ = require("../../");
57
+ const TENANT_ENABLED_MODES = ["tenantScoped", "tenantInherited"];
58
+ function isTenantPluginEnabled(ctx) {
59
+ var _a, _b, _c, _d;
60
+ for (const pluginManager of [(_a = ctx == null ? void 0 : ctx.tego) == null ? void 0 : _a.pm, (_b = ctx == null ? void 0 : ctx.app) == null ? void 0 : _b.pm]) {
61
+ try {
62
+ if (((_d = (_c = pluginManager == null ? void 0 : pluginManager.get) == null ? void 0 : _c.call(pluginManager, "tenant")) == null ? void 0 : _d.enabled) === true) {
63
+ return true;
64
+ }
65
+ } catch {
66
+ }
67
+ }
68
+ return false;
69
+ }
70
+ function appendTenantFilter(filter, tenantFilter) {
71
+ if (!filter || Reflect.ownKeys(filter).length === 0) {
72
+ return tenantFilter;
73
+ }
74
+ return { $and: [filter, tenantFilter] };
75
+ }
76
+ function throwMissingTenantContext(ctx) {
77
+ if (typeof (ctx == null ? void 0 : ctx.throw) === "function") {
78
+ ctx.throw(403, "Tenant context is required");
79
+ }
80
+ const error = new Error("Tenant context is required");
81
+ error.status = 403;
82
+ throw error;
83
+ }
84
+ function getRelationQueryOptions(ctx, target, repository, filter) {
85
+ var _a, _b, _c, _d, _e, _f, _g, _h;
86
+ const collection = ((_b = (_a = ctx.db).getCollection) == null ? void 0 : _b.call(_a, target)) || (repository == null ? void 0 : repository.collection);
87
+ const tenancyMode = (_c = collection == null ? void 0 : collection.options) == null ? void 0 : _c.tenancy;
88
+ if (!TENANT_ENABLED_MODES.includes(tenancyMode)) {
89
+ return { filter, context: ctx };
90
+ }
91
+ const tenantId = ((_e = (_d = ctx.state) == null ? void 0 : _d.currentTenant) == null ? void 0 : _e.id) ?? ((_f = ctx.state) == null ? void 0 : _f.currentTenantId);
92
+ if (tenantId === null || tenantId === void 0) {
93
+ if (isTenantPluginEnabled(ctx)) {
94
+ throwMissingTenantContext(ctx);
95
+ }
96
+ return {
97
+ filter,
98
+ context: ctx
99
+ };
100
+ }
101
+ const tenantIds = tenancyMode === "tenantInherited" ? [tenantId, ...((_g = ctx.state) == null ? void 0 : _g.currentTenantDescendantIds) || []] : null;
102
+ const tenantFilter = tenantIds ? { tenantId: { $in: tenantIds } } : { tenantId };
103
+ const legacyDataTenantIds = ((_h = collection == null ? void 0 : collection.options) == null ? void 0 : _h.legacyDataTenantIds) || [];
104
+ const includeLegacyData = legacyDataTenantIds.some((item) => `${item}` === `${tenantId}`);
105
+ const effectiveTenantFilter = includeLegacyData ? { $or: [tenantFilter, { tenantId: null }] } : tenantFilter;
106
+ return {
107
+ filter: appendTenantFilter(filter, effectiveTenantFilter),
108
+ context: ctx
109
+ };
110
+ }
57
111
  async function _({ value, field }) {
58
112
  return value;
59
113
  }
@@ -80,7 +134,11 @@ async function o2o({ value, column, field, ctx }) {
80
134
  if ((enumData == null ? void 0 : enumData.length) > 0) {
81
135
  enumItem = enumData.find((e) => e.label === value);
82
136
  }
83
- const val = await repository.findOne({ filter: { [dataIndex[1]]: (enumItem == null ? void 0 : enumItem.value) ?? value } });
137
+ const val = await repository.findOne(
138
+ getRelationQueryOptions(ctx, field.options.target, repository, {
139
+ [dataIndex[1]]: (enumItem == null ? void 0 : enumItem.value) ?? value
140
+ })
141
+ );
84
142
  return val;
85
143
  }
86
144
  const oho = o2o;
@@ -98,22 +156,33 @@ async function o2m({ value, column, field, ctx }) {
98
156
  }
99
157
  return v.value;
100
158
  });
101
- results = await repository.find({ filter: { [dataIndex[1]]: enumValues } });
159
+ results = await repository.find(
160
+ getRelationQueryOptions(ctx, field.options.target, repository, { [dataIndex[1]]: enumValues })
161
+ );
102
162
  } else {
103
- results = await repository.find({ filter: { [dataIndex[1]]: values } });
163
+ results = await repository.find(
164
+ getRelationQueryOptions(ctx, field.options.target, repository, { [dataIndex[1]]: values })
165
+ );
104
166
  }
105
167
  return results;
106
168
  }
107
169
  async function m2o({ value, column, field, ctx }) {
108
- var _a;
109
170
  let results = null;
110
171
  const { dataIndex, enum: enumData } = column;
111
172
  const repository = ctx.db.getRepository(field.options.target);
173
+ const normalizedValue = typeof value === "string" ? value.trim() : value;
112
174
  if ((enumData == null ? void 0 : enumData.length) > 0) {
113
- const enumValue = (_a = enumData.find((e) => e.label === (value == null ? void 0 : value.trim()))) == null ? void 0 : _a.value;
114
- results = await repository.findOne({ filter: { [dataIndex[1]]: enumValue } });
175
+ const enumItem = enumData.find((e) => e.label === normalizedValue);
176
+ if (enumItem === void 0) {
177
+ throw new Error(`not found enum value ${value}`);
178
+ }
179
+ results = await repository.findOne(
180
+ getRelationQueryOptions(ctx, field.options.target, repository, { [dataIndex[1]]: enumItem.value })
181
+ );
115
182
  } else {
116
- results = await repository.findOne({ filter: { [dataIndex[1]]: value } });
183
+ results = await repository.findOne(
184
+ getRelationQueryOptions(ctx, field.options.target, repository, { [dataIndex[1]]: normalizedValue })
185
+ );
117
186
  }
118
187
  return results;
119
188
  }
@@ -130,9 +199,13 @@ async function m2m({ value, column, field, ctx }) {
130
199
  }
131
200
  return v.value;
132
201
  });
133
- results = await repository.find({ filter: { [dataIndex[1]]: enumValues } });
202
+ results = await repository.find(
203
+ getRelationQueryOptions(ctx, field.options.target, repository, { [dataIndex[1]]: enumValues })
204
+ );
134
205
  } else {
135
- results = await repository.find({ filter: { [dataIndex[1]]: values } });
206
+ results = await repository.find(
207
+ getRelationQueryOptions(ctx, field.options.target, repository, { [dataIndex[1]]: values })
208
+ );
136
209
  }
137
210
  return results;
138
211
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tachybase/plugin-action-import",
3
3
  "displayName": "Action: Import records",
4
- "version": "1.6.24",
4
+ "version": "1.6.26",
5
5
  "description": "Import records using excel templates. You can configure which fields to import and templates will be generated automatically.",
6
6
  "keywords": [
7
7
  "Actions"
@@ -34,7 +34,7 @@
34
34
  "react-dom": "18.3.1",
35
35
  "react-i18next": "16.2.1",
36
36
  "xlsx": "0.18.5",
37
- "@tachybase/client": "1.6.24"
37
+ "@tachybase/client": "1.6.26"
38
38
  },
39
39
  "description.zh-CN": "使用 Excel 模板导入数据,可以配置导入哪些字段,自动生成模板。",
40
40
  "displayName.zh-CN": "操作:导入记录",