@nocobase/plugin-data-source-manager 2.1.0-alpha.15 → 2.1.0-alpha.16

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.
@@ -99,6 +99,10 @@ const example2: QueryObject = {
99
99
 
100
100
  const example3: QueryObject = { age: { $lt: 50 } };
101
101
  \`\`\`
102
+
103
+ // Datetime rule
104
+ // If you must provide explicit datetime literals in filters, use UTC ISO 8601 strings with a trailing \`Z\`.
105
+ // Example: \`2026-04-01T00:00:00.000Z\`
102
106
  `),
103
107
  sort: import_zod.z.array(import_zod.z.string()).describe(`{{t("ai.tools.dataQuery.args.sort", { ns: "${import_package.default.name}" })}}`),
104
108
  offset: import_zod.z.number().optional().describe(`{{t("ai.tools.dataQuery.args.offset", { ns: "${import_package.default.name}" })}}`),
@@ -24,9 +24,12 @@ This skill focuses on safe read-only data access.
24
24
  When the user does not provide an exact collection or field name:
25
25
 
26
26
  1. Call `getDataSources` if the target data source is unclear.
27
- 2. Call `getCollectionNames` to find the right collection.
28
- 3. Call `getCollectionMetadata` or `searchFieldMetadata` to confirm field names, relation paths, and data types.
29
- 4. Only then run a data tool.
27
+ 2. If multiple data sources may contain relevant data, inspect each candidate before choosing the query scope.
28
+ 3. Do not silently default to `main` when other relevant data sources are available.
29
+ 4. If you intentionally limit the query to one data source, explain why that data source was chosen and why others were not used.
30
+ 5. Call `getCollectionNames` to find the right collection.
31
+ 6. Call `getCollectionMetadata` or `searchFieldMetadata` to confirm field names, relation paths, and data types.
32
+ 7. Only then run a data tool.
30
33
 
31
34
  Do not guess collection names, measure aliases, or dotted relation paths.
32
35
 
@@ -66,6 +69,10 @@ Use `dataSourceCounting` only for a simple total when grouped output is unnecess
66
69
  5. Use aliases when the user clearly needs stable output keys.
67
70
  6. For dotted relation fields, prefer the exact field path confirmed from metadata, such as `createdBy.nickname`.
68
71
  7. Default row limit is 50 and the tool caps the limit at 100.
72
+ 8. When you must generate explicit datetime filter values yourself, generate them in UTC using ISO 8601 timestamps with a trailing `Z`.
73
+ 9. Do not generate local offsets such as `+09:00` or `-05:00` in AI-authored datetime filter values.
74
+ 10. Do not provide a timezone parameter yourself.
75
+ 11. If a report depends on calendar boundaries such as "this month" or "April", state explicitly that the generated filter values are in UTC when it matters.
69
76
 
70
77
  # Available Tools
71
78
 
@@ -159,7 +159,7 @@ const AggregateQuerySchema = {
159
159
  },
160
160
  filter: {
161
161
  type: "object",
162
- description: "Filter object applied before aggregation.",
162
+ description: "Filter object applied before aggregation. If you must provide explicit datetime literals, use UTC ISO 8601 strings with a trailing Z.",
163
163
  additionalProperties: true
164
164
  },
165
165
  having: {
@@ -174,10 +174,6 @@ const AggregateQuerySchema = {
174
174
  limit: {
175
175
  type: "number",
176
176
  description: `Maximum number of rows to return. Defaults to 50 and is capped at ${import_utils.MAX_QUERY_LIMIT}.`
177
- },
178
- timezone: {
179
- type: "string",
180
- description: "Optional timezone override for date formatting."
181
177
  }
182
178
  }
183
179
  };
@@ -186,15 +182,15 @@ function getDataSourceKey(args) {
186
182
  }
187
183
  function getTimezone(ctx, args) {
188
184
  var _a, _b, _c, _d, _e, _f, _g;
189
- const value = args.timezone || ((_a = ctx.get) == null ? void 0 : _a.call(ctx, "x-timezone")) || ((_c = (_b = ctx.request) == null ? void 0 : _b.get) == null ? void 0 : _c.call(_b, "x-timezone")) || ((_e = (_d = ctx.request) == null ? void 0 : _d.header) == null ? void 0 : _e["x-timezone"]) || ((_g = (_f = ctx.req) == null ? void 0 : _f.headers) == null ? void 0 : _g["x-timezone"]);
185
+ const value = ((_a = ctx.get) == null ? void 0 : _a.call(ctx, "x-timezone")) || ((_c = (_b = ctx.request) == null ? void 0 : _b.get) == null ? void 0 : _c.call(_b, "x-timezone")) || ((_e = (_d = ctx.request) == null ? void 0 : _d.header) == null ? void 0 : _e["x-timezone"]) || ((_g = (_f = ctx.req) == null ? void 0 : _f.headers) == null ? void 0 : _g["x-timezone"]);
190
186
  return Array.isArray(value) ? value[0] : value;
191
187
  }
192
188
  var dataQuery_default = (0, import_ai.defineTools)({
193
189
  scope: "SPECIFIED",
194
190
  defaultPermission: "ALLOW",
195
191
  introduction: {
196
- title: `{{t("ai.tools.dataQueryAggregate.title", { ns: "${import_package.default.name}" })}}`,
197
- about: `{{t("ai.tools.dataQueryAggregate.about", { ns: "${import_package.default.name}" })}}`
192
+ title: `{{t("ai.tools.dataQuery.title", { ns: "${import_package.default.name}" })}}`,
193
+ about: `{{t("ai.tools.dataQuery.about", { ns: "${import_package.default.name}" })}}`
198
194
  },
199
195
  definition: {
200
196
  name: "dataQuery",
@@ -8,27 +8,27 @@
8
8
  */
9
9
 
10
10
  module.exports = {
11
- "@nocobase/client": "2.1.0-alpha.15",
11
+ "@nocobase/client": "2.1.0-alpha.16",
12
12
  "react": "18.2.0",
13
- "@nocobase/plugin-acl": "2.1.0-alpha.15",
14
- "@nocobase/utils": "2.1.0-alpha.15",
15
- "@nocobase/ai": "2.1.0-alpha.15",
16
- "@nocobase/server": "2.1.0-alpha.15",
17
- "@nocobase/data-source-manager": "2.1.0-alpha.15",
13
+ "@nocobase/plugin-acl": "2.1.0-alpha.16",
14
+ "@nocobase/utils": "2.1.0-alpha.16",
15
+ "@nocobase/ai": "2.1.0-alpha.16",
16
+ "@nocobase/server": "2.1.0-alpha.16",
17
+ "@nocobase/data-source-manager": "2.1.0-alpha.16",
18
18
  "lodash": "4.17.21",
19
- "@nocobase/acl": "2.1.0-alpha.15",
20
- "@nocobase/database": "2.1.0-alpha.15",
19
+ "@nocobase/acl": "2.1.0-alpha.16",
20
+ "@nocobase/database": "2.1.0-alpha.16",
21
21
  "@ant-design/icons": "5.6.1",
22
22
  "antd": "5.24.2",
23
23
  "react-router-dom": "6.30.1",
24
- "@nocobase/flow-engine": "2.1.0-alpha.15",
24
+ "@nocobase/flow-engine": "2.1.0-alpha.16",
25
25
  "@formily/shared": "2.3.7",
26
26
  "@formily/react": "2.3.7",
27
27
  "react-i18next": "11.18.6",
28
28
  "@emotion/css": "11.13.0",
29
- "@nocobase/actions": "2.1.0-alpha.15",
29
+ "@nocobase/actions": "2.1.0-alpha.16",
30
30
  "sequelize": "6.35.2",
31
- "@nocobase/test": "2.1.0-alpha.15",
31
+ "@nocobase/test": "2.1.0-alpha.16",
32
32
  "@formily/antd-v5": "1.2.3",
33
33
  "@formily/core": "2.3.7",
34
34
  "@formily/reactive": "2.3.7",
@@ -57,10 +57,10 @@
57
57
  "ai.tools.intentRouter.about": "Route intents to appropriate workflow",
58
58
  "ai.tools.searchFieldMetadata.title": "Search field metadata",
59
59
  "ai.tools.searchFieldMetadata.about": "Search fields in data models by keyword (english first). Returns either search results or a suggested query.",
60
- "ai.tools.dataSourceQuery.title": "Data source query",
61
- "ai.tools.dataSourceQuery.about": "Use dataSource, collectionName, and collection fields to query data from the database",
62
- "ai.tools.dataQueryAggregate.title": "Data query",
63
- "ai.tools.dataQueryAggregate.about": "Run aggregate repository queries with measures, dimensions, orders, filter, and having",
60
+ "ai.tools.dataSourceQuery.title": "Get records",
61
+ "ai.tools.dataSourceQuery.about": "Use dataSource, collectionName, fields, filters, and sorting to get records",
62
+ "ai.tools.dataQuery.title": "Query data",
63
+ "ai.tools.dataQuery.about": "Run aggregate repository queries with measures, dimensions, orders, filter, and having",
64
64
  "ai.tools.dataSourceCounting.title": "Data source records counting",
65
65
  "ai.tools.dataSourceCounting.about": "Use dataSource, collectionName, and collection fields to query data from the database, get total count of records",
66
66
  "ai.tools.dataQuery.args.datasource": "Data source key",
@@ -57,10 +57,10 @@
57
57
  "ai.tools.intentRouter.about": "将意图路由到适当的工作流",
58
58
  "ai.tools.searchFieldMetadata.title": "搜索字段元数据",
59
59
  "ai.tools.searchFieldMetadata.about": "通过关键词搜索数据模型字段(优先英文)。返回搜索结果或建议的查询。",
60
- "ai.tools.dataSourceQuery.title": "数据源查询操作",
61
- "ai.tools.dataSourceQuery.about": "使用 dataSource、collectionName 和 collection fields 从数据库中查询数据。",
62
- "ai.tools.dataQueryAggregate.title": "数据查询",
63
- "ai.tools.dataQueryAggregate.about": "使用 measures、dimensions、orders、filter 和 having 执行聚合查询",
60
+ "ai.tools.dataSourceQuery.title": "获取数据记录",
61
+ "ai.tools.dataSourceQuery.about": "使用 dataSource、collectionName、字段、筛选和排序条件获取数据记录",
62
+ "ai.tools.dataQuery.title": "查询数据",
63
+ "ai.tools.dataQuery.about": "使用 measures、dimensions、orders、filter 和 having 执行聚合查询",
64
64
  "ai.tools.dataSourceCounting.title": "数据源记录数统计",
65
65
  "ai.tools.dataSourceCounting.about": "使用 dataSource、collectionName 和 collection fields 从数据库中获取记录总数",
66
66
  "ai.tools.dataQuery.args.datasource": "数据源标识",
@@ -1 +1 @@
1
- {"name":"zod","version":"4.3.5","type":"module","license":"MIT","author":"Colin McDonnell <zod@colinhacks.com>","description":"TypeScript-first schema declaration and validation library with static type inference","homepage":"https://zod.dev","llms":"https://zod.dev/llms.txt","llmsFull":"https://zod.dev/llms-full.txt","mcpServer":"https://mcp.inkeep.com/zod/mcp","funding":"https://github.com/sponsors/colinhacks","sideEffects":false,"files":["src","**/*.js","**/*.mjs","**/*.cjs","**/*.d.ts","**/*.d.mts","**/*.d.cts","**/package.json"],"keywords":["typescript","schema","validation","type","inference"],"main":"./index.cjs","types":"./index.d.cts","module":"./index.js","zshy":{"exports":{"./package.json":"./package.json",".":"./src/index.ts","./mini":"./src/mini/index.ts","./locales":"./src/locales/index.ts","./v3":"./src/v3/index.ts","./v4":"./src/v4/index.ts","./v4-mini":"./src/v4-mini/index.ts","./v4/mini":"./src/v4/mini/index.ts","./v4/core":"./src/v4/core/index.ts","./v4/locales":"./src/v4/locales/index.ts","./v4/locales/*":"./src/v4/locales/*"},"conditions":{"@zod/source":"src"}},"exports":{"./package.json":"./package.json",".":{"@zod/source":"./src/index.ts","types":"./index.d.cts","import":"./index.js","require":"./index.cjs"},"./mini":{"@zod/source":"./src/mini/index.ts","types":"./mini/index.d.cts","import":"./mini/index.js","require":"./mini/index.cjs"},"./locales":{"@zod/source":"./src/locales/index.ts","types":"./locales/index.d.cts","import":"./locales/index.js","require":"./locales/index.cjs"},"./v3":{"@zod/source":"./src/v3/index.ts","types":"./v3/index.d.cts","import":"./v3/index.js","require":"./v3/index.cjs"},"./v4":{"@zod/source":"./src/v4/index.ts","types":"./v4/index.d.cts","import":"./v4/index.js","require":"./v4/index.cjs"},"./v4-mini":{"@zod/source":"./src/v4-mini/index.ts","types":"./v4-mini/index.d.cts","import":"./v4-mini/index.js","require":"./v4-mini/index.cjs"},"./v4/mini":{"@zod/source":"./src/v4/mini/index.ts","types":"./v4/mini/index.d.cts","import":"./v4/mini/index.js","require":"./v4/mini/index.cjs"},"./v4/core":{"@zod/source":"./src/v4/core/index.ts","types":"./v4/core/index.d.cts","import":"./v4/core/index.js","require":"./v4/core/index.cjs"},"./v4/locales":{"@zod/source":"./src/v4/locales/index.ts","types":"./v4/locales/index.d.cts","import":"./v4/locales/index.js","require":"./v4/locales/index.cjs"},"./v4/locales/*":{"@zod/source":"./src/v4/locales/*","types":"./v4/locales/*","import":"./v4/locales/*","require":"./v4/locales/*"}},"repository":{"type":"git","url":"git+https://github.com/colinhacks/zod.git"},"bugs":{"url":"https://github.com/colinhacks/zod/issues"},"support":{"backing":{"npm-funding":true}},"scripts":{"clean":"git clean -xdf . -e node_modules","build":"zshy --project tsconfig.build.json","postbuild":"tsx ../../scripts/write-stub-package-jsons.ts && pnpm biome check --write .","test:watch":"pnpm vitest","test":"pnpm vitest run","prepublishOnly":"tsx ../../scripts/check-versions.ts"},"_lastModified":"2026-04-10T12:40:12.859Z"}
1
+ {"name":"zod","version":"4.3.5","type":"module","license":"MIT","author":"Colin McDonnell <zod@colinhacks.com>","description":"TypeScript-first schema declaration and validation library with static type inference","homepage":"https://zod.dev","llms":"https://zod.dev/llms.txt","llmsFull":"https://zod.dev/llms-full.txt","mcpServer":"https://mcp.inkeep.com/zod/mcp","funding":"https://github.com/sponsors/colinhacks","sideEffects":false,"files":["src","**/*.js","**/*.mjs","**/*.cjs","**/*.d.ts","**/*.d.mts","**/*.d.cts","**/package.json"],"keywords":["typescript","schema","validation","type","inference"],"main":"./index.cjs","types":"./index.d.cts","module":"./index.js","zshy":{"exports":{"./package.json":"./package.json",".":"./src/index.ts","./mini":"./src/mini/index.ts","./locales":"./src/locales/index.ts","./v3":"./src/v3/index.ts","./v4":"./src/v4/index.ts","./v4-mini":"./src/v4-mini/index.ts","./v4/mini":"./src/v4/mini/index.ts","./v4/core":"./src/v4/core/index.ts","./v4/locales":"./src/v4/locales/index.ts","./v4/locales/*":"./src/v4/locales/*"},"conditions":{"@zod/source":"src"}},"exports":{"./package.json":"./package.json",".":{"@zod/source":"./src/index.ts","types":"./index.d.cts","import":"./index.js","require":"./index.cjs"},"./mini":{"@zod/source":"./src/mini/index.ts","types":"./mini/index.d.cts","import":"./mini/index.js","require":"./mini/index.cjs"},"./locales":{"@zod/source":"./src/locales/index.ts","types":"./locales/index.d.cts","import":"./locales/index.js","require":"./locales/index.cjs"},"./v3":{"@zod/source":"./src/v3/index.ts","types":"./v3/index.d.cts","import":"./v3/index.js","require":"./v3/index.cjs"},"./v4":{"@zod/source":"./src/v4/index.ts","types":"./v4/index.d.cts","import":"./v4/index.js","require":"./v4/index.cjs"},"./v4-mini":{"@zod/source":"./src/v4-mini/index.ts","types":"./v4-mini/index.d.cts","import":"./v4-mini/index.js","require":"./v4-mini/index.cjs"},"./v4/mini":{"@zod/source":"./src/v4/mini/index.ts","types":"./v4/mini/index.d.cts","import":"./v4/mini/index.js","require":"./v4/mini/index.cjs"},"./v4/core":{"@zod/source":"./src/v4/core/index.ts","types":"./v4/core/index.d.cts","import":"./v4/core/index.js","require":"./v4/core/index.cjs"},"./v4/locales":{"@zod/source":"./src/v4/locales/index.ts","types":"./v4/locales/index.d.cts","import":"./v4/locales/index.js","require":"./v4/locales/index.cjs"},"./v4/locales/*":{"@zod/source":"./src/v4/locales/*","types":"./v4/locales/*","import":"./v4/locales/*","require":"./v4/locales/*"}},"repository":{"type":"git","url":"git+https://github.com/colinhacks/zod.git"},"bugs":{"url":"https://github.com/colinhacks/zod/issues"},"support":{"backing":{"npm-funding":true}},"scripts":{"clean":"git clean -xdf . -e node_modules","build":"zshy --project tsconfig.build.json","postbuild":"tsx ../../scripts/write-stub-package-jsons.ts && pnpm biome check --write .","test:watch":"pnpm vitest","test":"pnpm vitest run","prepublishOnly":"tsx ../../scripts/check-versions.ts"},"_lastModified":"2026-04-14T00:04:38.783Z"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nocobase/plugin-data-source-manager",
3
- "version": "2.1.0-alpha.15",
3
+ "version": "2.1.0-alpha.16",
4
4
  "main": "dist/server/index.js",
5
5
  "displayName": "Data source manager",
6
6
  "displayName.ru-RU": "Менеджер управления источниками данных",
@@ -20,6 +20,6 @@
20
20
  "keywords": [
21
21
  "Data model tools"
22
22
  ],
23
- "gitHead": "7c86e75b0af4b9f532c8ebf5ef96a7423b0ab60e",
23
+ "gitHead": "14cf3dbdb9f0a9669602de4ad21a9464fa27c105",
24
24
  "license": "Apache-2.0"
25
25
  }