ajsc 1.0.10 → 2.0.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.
- package/dist/JSONSchemaConverter.js +76 -0
- package/dist/JSONSchemaConverter.js.map +1 -1
- package/dist/Typebox.test.js +28 -2
- package/dist/Typebox.test.js.map +1 -1
- package/dist/TypescriptBaseConverter.js +31 -4
- package/dist/TypescriptBaseConverter.js.map +1 -1
- package/dist/TypescriptConverter.js +39 -13
- package/dist/TypescriptConverter.js.map +1 -1
- package/dist/TypescriptConverter.test.js +90 -0
- package/dist/TypescriptConverter.test.js.map +1 -1
- package/dist/TypescriptProcedureConverter.d.ts +2 -2
- package/dist/TypescriptProcedureConverter.js +18 -10
- package/dist/TypescriptProcedureConverter.js.map +1 -1
- package/dist/TypescriptProceduresConverter.test.js +12 -0
- package/dist/TypescriptProceduresConverter.test.js.map +1 -1
- package/dist/types.d.ts +6 -1
- package/package.json +1 -1
- package/src/JSONSchemaConverter.ts +87 -0
- package/src/Typebox.test.ts +41 -7
- package/src/TypescriptBaseConverter.ts +33 -4
- package/src/TypescriptConverter.test.ts +126 -2
- package/src/TypescriptConverter.ts +41 -13
- package/src/TypescriptProcedureConverter.ts +24 -13
- package/src/TypescriptProceduresConverter.test.ts +15 -0
- package/src/types.ts +8 -1
package/src/types.ts
CHANGED
|
@@ -10,7 +10,8 @@ export type IRType =
|
|
|
10
10
|
| "enum"
|
|
11
11
|
| "union"
|
|
12
12
|
| "intersection"
|
|
13
|
-
| "literal"
|
|
13
|
+
| "literal"
|
|
14
|
+
| "any";
|
|
14
15
|
|
|
15
16
|
export interface IRNode {
|
|
16
17
|
signature?: string;
|
|
@@ -40,6 +41,10 @@ export interface IRNode {
|
|
|
40
41
|
* For object types: a mapping of property names to their IR node definitions.
|
|
41
42
|
*/
|
|
42
43
|
properties?: { [key: string]: IRNode };
|
|
44
|
+
/**
|
|
45
|
+
* For object types: indicates whether additional properties are allowed and their type if so.
|
|
46
|
+
*/
|
|
47
|
+
additionalProperties?: IRNode | boolean;
|
|
43
48
|
|
|
44
49
|
/**
|
|
45
50
|
* For array types: the IR node representing the type of items in the array.
|
|
@@ -94,6 +99,8 @@ export interface LanguagePlugin {
|
|
|
94
99
|
|
|
95
100
|
// allow configuration options that affect the conversion process
|
|
96
101
|
export interface ConverterOptions {
|
|
102
|
+
// allow additional properties in objects by default
|
|
103
|
+
additionalProperties?: boolean;
|
|
97
104
|
// For example, whether to perform strict schema validation
|
|
98
105
|
validateSchema?: boolean;
|
|
99
106
|
// Any custom transformations on the IR
|