@basictech/schema 0.5.0 → 0.7.0-beta.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.
@@ -1,6 +1,6 @@
1
1
 
2
2
  
3
- > @basictech/schema@0.1.0-beta.1 build
3
+ > @basictech/schema@0.5.0 build
4
4
  > tsup
5
5
 
6
6
  CLI Building entry: ./index.ts
@@ -11,13 +11,13 @@
11
11
  CLI Cleaning output folder
12
12
  CJS Build start
13
13
  ESM Build start
14
- ESM dist/index.mjs 8.36 KB
15
- ESM dist/index.mjs.map 19.00 KB
16
- ESM ⚡️ Build success in 8ms
17
- CJS dist/index.js 10.11 KB
18
- CJS dist/index.js.map 19.08 KB
19
- CJS ⚡️ Build success in 8ms
14
+ CJS dist/index.js 13.75 KB
15
+ CJS dist/index.js.map 26.36 KB
16
+ CJS ⚡️ Build success in 9ms
17
+ ESM dist/index.mjs 11.93 KB
18
+ ESM dist/index.mjs.map 26.28 KB
19
+ ESM ⚡️ Build success in 9ms
20
20
  DTS Build start
21
- DTS ⚡️ Build success in 751ms
22
- DTS dist/index.d.ts 2.67 KB
23
- DTS dist/index.d.mts 2.67 KB
21
+ DTS ⚡️ Build success in 1166ms
22
+ DTS dist/index.d.ts 7.04 KB
23
+ DTS dist/index.d.mts 7.04 KB
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @basictech/schema
2
2
 
3
+ ## 0.7.0-beta.0
4
+
5
+ ### Minor Changes
6
+
7
+ - update schema
8
+
9
+ ## 0.6.0
10
+
11
+ ### Minor Changes
12
+
13
+ - update schema rules
14
+
3
15
  ## 0.5.0
4
16
 
5
17
  ### Minor Changes
package/dist/index.d.mts CHANGED
@@ -1,3 +1,5 @@
1
+ import { ErrorObject as ErrorObject$1 } from 'ajv';
2
+
1
3
  declare function generateEmptySchema(project_id?: string, version?: number): {
2
4
  project_id: string;
3
5
  version: number;
@@ -39,7 +41,7 @@ declare function compareSchemas(oldSchema: any, newSchema: any): {
39
41
  */
40
42
  declare function validateSchema(schema: Schema): {
41
43
  valid: boolean;
42
- errors: ErrorObject[];
44
+ errors: ErrorObject$1[];
43
45
  };
44
46
  type ErrorObject = {
45
47
  keyword?: string;
@@ -79,7 +81,28 @@ type SchemaChange = {
79
81
  };
80
82
  declare function validateUpdateSchema(oldSchema: any, newSchema: any): {
81
83
  valid: boolean;
82
- errors: ErrorObject[];
84
+ errors: ErrorObject$1<string, Record<string, any>, unknown>[];
85
+ message: string;
86
+ changes?: undefined;
87
+ } | {
88
+ valid: boolean;
89
+ errors: {
90
+ change: {
91
+ type: string;
92
+ property: string;
93
+ old: any;
94
+ new: any;
95
+ };
96
+ message: string;
97
+ }[];
98
+ message: string;
99
+ changes?: undefined;
100
+ } | {
101
+ valid: boolean;
102
+ errors: {
103
+ change: SchemaChange;
104
+ message: string;
105
+ }[];
83
106
  message: string;
84
107
  changes?: undefined;
85
108
  } | {
@@ -115,7 +138,7 @@ declare function getJsonSchema(): {
115
138
  type: string;
116
139
  };
117
140
  patternProperties: {
118
- "^[a-zA-Z0-9_]+$": {
141
+ "^(?!id$|ID$|Id$|iD$)[a-zA-Z0-9][a-zA-Z0-9_]*$": {
119
142
  type: string;
120
143
  propertyNames: {
121
144
  pattern: string;
@@ -168,7 +191,7 @@ declare function getJsonSchema(): {
168
191
  type: string;
169
192
  };
170
193
  patternProperties: {
171
- "^[a-zA-Z0-9_]+$": {
194
+ "^(?!id$|ID$|Id$|iD$)[a-zA-Z0-9][a-zA-Z0-9_]*$": {
172
195
  type: string;
173
196
  properties: {
174
197
  type: {
package/dist/index.d.ts CHANGED
@@ -1,3 +1,5 @@
1
+ import { ErrorObject as ErrorObject$1 } from 'ajv';
2
+
1
3
  declare function generateEmptySchema(project_id?: string, version?: number): {
2
4
  project_id: string;
3
5
  version: number;
@@ -39,7 +41,7 @@ declare function compareSchemas(oldSchema: any, newSchema: any): {
39
41
  */
40
42
  declare function validateSchema(schema: Schema): {
41
43
  valid: boolean;
42
- errors: ErrorObject[];
44
+ errors: ErrorObject$1[];
43
45
  };
44
46
  type ErrorObject = {
45
47
  keyword?: string;
@@ -79,7 +81,28 @@ type SchemaChange = {
79
81
  };
80
82
  declare function validateUpdateSchema(oldSchema: any, newSchema: any): {
81
83
  valid: boolean;
82
- errors: ErrorObject[];
84
+ errors: ErrorObject$1<string, Record<string, any>, unknown>[];
85
+ message: string;
86
+ changes?: undefined;
87
+ } | {
88
+ valid: boolean;
89
+ errors: {
90
+ change: {
91
+ type: string;
92
+ property: string;
93
+ old: any;
94
+ new: any;
95
+ };
96
+ message: string;
97
+ }[];
98
+ message: string;
99
+ changes?: undefined;
100
+ } | {
101
+ valid: boolean;
102
+ errors: {
103
+ change: SchemaChange;
104
+ message: string;
105
+ }[];
83
106
  message: string;
84
107
  changes?: undefined;
85
108
  } | {
@@ -115,7 +138,7 @@ declare function getJsonSchema(): {
115
138
  type: string;
116
139
  };
117
140
  patternProperties: {
118
- "^[a-zA-Z0-9_]+$": {
141
+ "^(?!id$|ID$|Id$|iD$)[a-zA-Z0-9][a-zA-Z0-9_]*$": {
119
142
  type: string;
120
143
  propertyNames: {
121
144
  pattern: string;
@@ -168,7 +191,7 @@ declare function getJsonSchema(): {
168
191
  type: string;
169
192
  };
170
193
  patternProperties: {
171
- "^[a-zA-Z0-9_]+$": {
194
+ "^(?!id$|ID$|Id$|iD$)[a-zA-Z0-9][a-zA-Z0-9_]*$": {
172
195
  type: string;
173
196
  properties: {
174
197
  type: {