@nocobase/plugin-collection-sql 1.3.44-beta → 1.4.0-alpha.0

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.
@@ -8,10 +8,10 @@
8
8
  */
9
9
 
10
10
  module.exports = {
11
- "@nocobase/client": "1.3.44-beta",
12
- "@nocobase/server": "1.3.44-beta",
13
- "@nocobase/database": "1.3.44-beta",
14
- "@nocobase/actions": "1.3.44-beta",
11
+ "@nocobase/client": "1.4.0-alpha.0",
12
+ "@nocobase/server": "1.4.0-alpha.0",
13
+ "@nocobase/database": "1.4.0-alpha.0",
14
+ "@nocobase/actions": "1.4.0-alpha.0",
15
15
  "sequelize": "6.35.2",
16
- "@nocobase/utils": "1.3.44-beta"
16
+ "@nocobase/utils": "1.4.0-alpha.0"
17
17
  };
@@ -10,10 +10,10 @@ import { Collection, CollectionContext, CollectionOptions } from '@nocobase/data
10
10
  import { QueryInterfaceDropTableOptions } from 'sequelize';
11
11
  export declare class SQLCollection extends Collection {
12
12
  constructor(options: CollectionOptions, context: CollectionContext);
13
+ get filterTargetKey(): string | string[];
13
14
  isSql(): boolean;
14
15
  unavailableActions(): Array<string>;
15
16
  collectionSchema(): any;
16
- get filterTargetKey(): string;
17
17
  modelInit(): void;
18
18
  removeFromDb(options?: QueryInterfaceDropTableOptions & {
19
19
  dropCollection?: boolean;
@@ -38,19 +38,13 @@ class SQLCollection extends import_database.Collection {
38
38
  options.underscored = false;
39
39
  super(options, context);
40
40
  }
41
- isSql() {
42
- return true;
43
- }
44
- unavailableActions() {
45
- return ["create", "update", "destroy"];
46
- }
47
- collectionSchema() {
48
- return void 0;
49
- }
50
41
  /* istanbul ignore next -- @preserve */
51
42
  get filterTargetKey() {
52
43
  var _a;
53
44
  const targetKey = ((_a = this.options) == null ? void 0 : _a.filterTargetKey) || "id";
45
+ if (Array.isArray(targetKey)) {
46
+ return targetKey;
47
+ }
54
48
  if (targetKey && this.model.getAttributes()[targetKey]) {
55
49
  return targetKey;
56
50
  }
@@ -59,6 +53,15 @@ class SQLCollection extends import_database.Collection {
59
53
  }
60
54
  return this.model.primaryKeyAttribute;
61
55
  }
56
+ isSql() {
57
+ return true;
58
+ }
59
+ unavailableActions() {
60
+ return ["create", "update", "destroy"];
61
+ }
62
+ collectionSchema() {
63
+ return void 0;
64
+ }
62
65
  modelInit() {
63
66
  const { autoGenId, sql } = this.options;
64
67
  const model = class extends import_sql_model.SQLModel {
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "displayName.zh-CN": "数据表: SQL",
5
5
  "description": "Provides SQL collection template",
6
6
  "description.zh-CN": "提供 SQL 数据表模板",
7
- "version": "1.3.44-beta",
7
+ "version": "1.4.0-alpha.0",
8
8
  "homepage": "https://docs-cn.nocobase.com/handbook/collection-sql",
9
9
  "homepage.zh-CN": "https://docs-cn.nocobase.com/handbook/collection-sql",
10
10
  "main": "dist/server/index.js",
@@ -17,5 +17,5 @@
17
17
  "keywords": [
18
18
  "Collections"
19
19
  ],
20
- "gitHead": "1d5666123ac1e2997e434e38defef963ba0d9f90"
20
+ "gitHead": "8ffa7b54bbaf720c0c9857da4b19a99110dffc4b"
21
21
  }