semanticdb-core 1.1.21 → 1.1.22

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.
@@ -13,6 +13,8 @@ export declare type PropertyTypePrimalType = 'string' | 'number' | 'boolean' | '
13
13
  export interface PropertyTypeDraft {
14
14
  _sid?: string | number;
15
15
  _id?: string;
16
+ sid?: string;
17
+ id?: string;
16
18
  name: string;
17
19
  syno?: string[];
18
20
  description?: string;
@@ -35,10 +35,6 @@ function isSchemaValid(schema, schemasDict) {
35
35
  if (!schema.properties.every((property) => property.name && property.name.trim() !== '' && property.type)) {
36
36
  return { valid: false, message: '每一个属性都必须有名称和类型' };
37
37
  }
38
- // 检查_id
39
- if (!schema._id) {
40
- return { valid: false, message: '错误的schema配置,缺少_id' };
41
- }
42
38
  // 检查db
43
39
  if (!schema.db) {
44
40
  return { valid: false, message: '缺少数据库配置' };
@@ -100,11 +96,11 @@ function isSchemaValid(schema, schemasDict) {
100
96
  seenNames.add(name);
101
97
  }
102
98
  // ==================== 检查属性_id重复 ====================
103
- const propertyIds = schema.properties.map((p) => p._id).filter((id) => !!id);
99
+ const propertyIds = schema.properties.map((p) => p.id).filter((id) => !!id);
104
100
  const seenIds = new Set();
105
101
  for (const id of propertyIds) {
106
102
  if (seenIds.has(id)) {
107
- return { valid: false, message: `${schema.name} 中有两个相同_id的属性:${id}` };
103
+ return { valid: false, message: `${schema.name} 中有两个相同id的属性:${id}` };
108
104
  }
109
105
  seenIds.add(id);
110
106
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "semanticdb-core",
3
- "version": "1.1.21",
3
+ "version": "1.1.22",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "files": [