shinkansen-transmission 2.2.234 → 2.3.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/babel.config.cjs +1 -0
- package/eslint.config.mjs +28 -30
- package/index.d.mts +321 -16
- package/package.json +8 -8
- package/src/index.cjs +2 -0
- package/src/index.d.mts +10 -9
- package/src/transmission/common/index.d.mts +152 -87
- package/src/transmission/common/index.mjs +627 -193
- package/src/transmission/from-document-to-hash/array/index.mjs +20 -4
- package/src/transmission/from-document-to-hash/boolean/index.mjs +25 -9
- package/src/transmission/from-document-to-hash/index.d.mts +8 -19
- package/src/transmission/from-document-to-hash/index.mjs +102 -16
- package/src/transmission/from-document-to-hash/null/index.mjs +25 -9
- package/src/transmission/from-document-to-hash/number/index.mjs +25 -9
- package/src/transmission/from-document-to-hash/object/index.mjs +22 -6
- package/src/transmission/from-document-to-hash/string/index.mjs +25 -9
- package/src/transmission/from-hash-to-document/array/index.mjs +22 -5
- package/src/transmission/from-hash-to-document/boolean/index.mjs +21 -4
- package/src/transmission/from-hash-to-document/index.d.mts +24 -26
- package/src/transmission/from-hash-to-document/index.mjs +264 -142
- package/src/transmission/from-hash-to-document/null/index.mjs +21 -4
- package/src/transmission/from-hash-to-document/number/index.mjs +21 -4
- package/src/transmission/from-hash-to-document/object/index.mjs +22 -5
- package/src/transmission/from-hash-to-document/string/index.mjs +26 -4
- package/src/transmission/index.d.mts +4 -10
- package/src/transmission/to-zashiki/index.d.mts +5 -13
- package/src/transmission/to-zashiki/params/index.mjs +430 -0
- package/src/transmission/to-zashiki/render/array/index.mjs +737 -0
- package/src/transmission/to-zashiki/render/boolean/index.mjs +794 -0
- package/src/transmission/to-zashiki/render/index.mjs +157 -0
- package/src/transmission/to-zashiki/render/null/index.mjs +796 -0
- package/src/transmission/to-zashiki/render/number/index.mjs +940 -0
- package/src/transmission/to-zashiki/render/object/index.mjs +653 -0
- package/src/transmission/to-zashiki/render/string/index.mjs +910 -0
- package/src/transmission/to-zashiki/render-params/root-schema/index.mjs +212 -0
- package/src/transmission/to-zashiki/render-params/schema/index.mjs +731 -0
- package/src/transmission/to-zashiki/transform-root-schema.mjs +485 -421
- package/src/transmission/to-zashiki/transform-schema.mjs +1988 -4663
@@ -1,123 +1,188 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
1
|
+
type ObjectLiteralType = TransmissionTypes.ObjectLiteralType
|
2
|
+
type ObjectType = TransmissionTypes.ObjectType
|
3
|
+
|
4
|
+
type ItemsType = TransmissionTypes.ItemsType
|
5
|
+
|
6
|
+
type TransmissionStringMetaType = TransmissionTypes.Transmission.StringMetaType
|
7
|
+
type TransmissionNumberMetaType = TransmissionTypes.Transmission.NumberMetaType
|
8
|
+
type TransmissionArrayMetaType = TransmissionTypes.Transmission.ArrayMetaType
|
9
|
+
type TransmissionObjectMetaType = TransmissionTypes.Transmission.ObjectMetaType
|
10
|
+
type TransmissionBooleanMetaType = TransmissionTypes.Transmission.BooleanMetaType
|
11
|
+
type TransmissionNullMetaType = TransmissionTypes.Transmission.NullMetaType
|
12
|
+
|
13
|
+
type TransmissionStringElementsType = TransmissionTypes.Transmission.StringElementsType
|
14
|
+
type TransmissionNumberElementsType = TransmissionTypes.Transmission.NumberElementsType
|
15
|
+
type TransmissionArrayElementsType = TransmissionTypes.Transmission.ArrayElementsType
|
16
|
+
type TransmissionObjectElementsType = TransmissionTypes.Transmission.ObjectElementsType
|
17
|
+
type TransmissionBooleanElementsType = TransmissionTypes.Transmission.BooleanElementsType
|
18
|
+
type TransmissionNullElementsType = TransmissionTypes.Transmission.NullElementsType
|
19
|
+
|
20
|
+
type EnumType = TransmissionTypes.EnumType
|
21
|
+
type OneOfType = TransmissionTypes.OneOfType
|
22
|
+
type AnyOfType = TransmissionTypes.AnyOfType
|
23
|
+
type FieldType = TransmissionTypes.FieldType
|
24
|
+
|
25
|
+
type SchemaType = TransmissionTypes.SchemaType
|
6
26
|
|
7
|
-
|
27
|
+
type StringSchemaType = TransmissionTypes.StringSchemaType
|
28
|
+
type NumberSchemaType = TransmissionTypes.NumberSchemaType
|
29
|
+
type ArraySchemaType = TransmissionTypes.ArraySchemaType
|
30
|
+
type ObjectSchemaType = TransmissionTypes.ObjectSchemaType
|
31
|
+
type BooleanSchemaType = TransmissionTypes.BooleanSchemaType
|
32
|
+
type NullSchemaType = TransmissionTypes.NullSchemaType
|
8
33
|
|
9
|
-
|
10
|
-
|
11
|
-
export function isPrimitive (v: unknown): boolean
|
12
|
-
export function isSchema (v: SchemaType | undefined): boolean
|
13
|
-
export function isStringSchema (schema: SchemaType | undefined): boolean
|
14
|
-
export function isNumberSchema (schema: SchemaType | undefined): boolean
|
15
|
-
export function isArraySchema (schema: SchemaType | undefined): boolean
|
16
|
-
export function isObjectSchema (schema: SchemaType | undefined): boolean
|
17
|
-
export function isBooleanSchema (schema: SchemaType | undefined): boolean
|
18
|
-
export function isNullSchema (schema: SchemaType | undefined): boolean
|
34
|
+
type ValuesType = TransmissionTypes.ValuesType
|
35
|
+
type ParamsType = TransmissionTypes.ParamsType
|
19
36
|
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
export function getIsWriteOnly (schema: SchemaType | undefined): { writeOnly: boolean } | ObjectLiteralType
|
37
|
+
export function isObject (v?: unknown): v is (Record<PropertyKey, string | number | object | boolean | null | string[] | number[] | object[] | boolean[] | null[]> | Record<PropertyKey, never>)
|
38
|
+
export function isArray (v?: unknown): v is (string[] | number[] | object[] | boolean[] | null[])
|
39
|
+
export function isPrimitive (v?: unknown): v is string | number | boolean | null
|
24
40
|
|
25
|
-
|
41
|
+
export function isSchema (v?: SchemaType | object): v is SchemaType
|
42
|
+
export function isStringSchema (schema?: SchemaType): schema is StringSchemaType
|
43
|
+
export function isNumberSchema (schema?: SchemaType): schema is NumberSchemaType
|
44
|
+
export function isArraySchema (schema?: SchemaType): schema is ArraySchemaType
|
45
|
+
export function isObjectSchema (schema?: SchemaType): schema is ObjectSchemaType
|
46
|
+
export function isBooleanSchema (schema?: SchemaType): schema is BooleanSchemaType
|
47
|
+
export function isNullSchema (schema?: SchemaType): schema is NullSchemaType
|
26
48
|
|
27
|
-
|
49
|
+
export function getTitle (schema?: SchemaType): { title: string } | ObjectLiteralType
|
50
|
+
export function getDescription (schema?: SchemaType): { description: string } | ObjectLiteralType
|
51
|
+
export function getIsReadOnly (schema?: SchemaType): { readOnly: boolean } | ObjectLiteralType
|
52
|
+
export function getIsWriteOnly (schema?: SchemaType): { writeOnly: boolean } | ObjectLiteralType
|
28
53
|
|
29
|
-
|
30
|
-
export function getMetaDefaultValue (schema: SchemaType | undefined): { defaultValue: string } | ObjectLiteralType
|
31
|
-
export function hasMetaValue (values: ObjectType | ObjectLiteralType, uri: string | undefined, schema: SchemaType | undefined): boolean
|
32
|
-
export function getMetaValue (values: ObjectType | ObjectLiteralType, uri: string | undefined, schema: SchemaType | undefined): { value: string } | ObjectLiteralType
|
54
|
+
export function getSelectedItems (values?: ValuesType, uri?: string): Array<string | number | boolean | null>
|
33
55
|
|
34
|
-
|
56
|
+
export function isParentUri (parentUri?: string, uri?: string): boolean
|
35
57
|
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
58
|
+
export function getMetaProps (params?: ParamsType, uri?: string): TransmissionStringMetaType | TransmissionNumberMetaType | TransmissionArrayMetaType | TransmissionObjectMetaType | TransmissionBooleanMetaType | TransmissionNullMetaType | Record<string, never>
|
59
|
+
export function hasMetaDefaultValue (schema?: SchemaType): boolean
|
60
|
+
export function getMetaDefaultValue (schema?: SchemaType): { defaultValue: string } | ObjectLiteralType
|
61
|
+
export function hasMetaValue (values?: ValuesType, uri?: string, schema?: SchemaType): boolean
|
62
|
+
export function getMetaValue (values?: ValuesType, uri?: string, schema?: SchemaType): { value: string } | ObjectLiteralType
|
40
63
|
|
41
|
-
|
64
|
+
export function transformToValue (schema?: string | number | object | boolean | null): string | number | object | boolean | null | undefined
|
42
65
|
|
43
|
-
|
44
|
-
|
45
|
-
|
66
|
+
export function findByUri (parentUri: string, uri: string): (key: string | number) => boolean
|
67
|
+
export function findByValue (value?: string | number | object | boolean | null): (item?: string | number | object | boolean | null | string[] | number[] | object[] | boolean[] | null[]) => boolean
|
68
|
+
export function findByEqual (value?: string | number | object | boolean | null): (item?: string | number | object | boolean | null | string[] | number[] | object[] | boolean[] | null[]) => boolean
|
46
69
|
|
47
|
-
|
48
|
-
export function transformEqualIndexFor (array: ArrayType, value: unknown): string
|
70
|
+
export function toString (value?: string | number | object | boolean | null): string
|
49
71
|
|
50
|
-
|
51
|
-
|
72
|
+
export function getArray (schema?: { items?: SchemaType | SchemaType[] }, parentUri?: string, uri?: string): SchemaType | undefined
|
73
|
+
export function getObject (schema?: { properties?: Record<string, SchemaType> }, parentUri?: string, uri?: string): SchemaType | undefined
|
52
74
|
|
53
|
-
|
54
|
-
|
75
|
+
declare function getSchema (
|
76
|
+
schema: (
|
77
|
+
StringSchemaType |
|
78
|
+
NumberSchemaType |
|
79
|
+
ArraySchemaType |
|
80
|
+
ObjectSchemaType |
|
81
|
+
BooleanSchemaType |
|
82
|
+
NullSchemaType
|
83
|
+
),
|
84
|
+
parentUri?: string,
|
85
|
+
uri?: string
|
86
|
+
): SchemaType | undefined
|
55
87
|
|
56
|
-
|
57
|
-
|
88
|
+
declare function getSchema (
|
89
|
+
schema?: ObjectLiteralType | ObjectType,
|
90
|
+
parentUri?: string,
|
91
|
+
uri?: string
|
92
|
+
): SchemaType | undefined
|
58
93
|
|
59
|
-
|
60
|
-
export function getIndexForOneOf (values: ObjectType | ObjectLiteralType, parentUri: string | undefined, uri: string | undefined, schema: SchemaType | undefined): number
|
94
|
+
export { getSchema }
|
61
95
|
|
62
|
-
|
63
|
-
|
64
|
-
export function getElementsDescriptionProps (params: ObjectType | ObjectLiteralType, uri: string | undefined): ObjectType | ObjectLiteralType
|
96
|
+
export function transformValueIndexFor (array: string[] | number[] | object[] | boolean[] | null[], value?: string | number | object | boolean | null): string
|
97
|
+
export function transformEqualIndexFor (array: string[] | number[] | object[] | boolean[] | null[], value?: string | number | object | boolean | null): string
|
65
98
|
|
66
|
-
|
67
|
-
|
68
|
-
export function getElementsFieldPropsForAnyOf (params: ObjectType | ObjectLiteralType, uri: string | undefined): ObjectType | ObjectLiteralType
|
69
|
-
export function getElementsFieldPropsForAllOf (params: ObjectType | ObjectLiteralType, uri: string | undefined): ObjectType | ObjectLiteralType
|
99
|
+
export function hasValue (values?: ValuesType, uri?: string, schema?: SchemaType): boolean
|
100
|
+
export function getValue (values?: ValuesType, uri?: string, schema?: SchemaType): string
|
70
101
|
|
71
|
-
|
72
|
-
|
102
|
+
export function getValueForEnum (v: string | number, schema?: { enum?: ItemsType }): string
|
103
|
+
export function getIndexForEnum (values?: ValuesType, parentUri?: string, uri?: string, schema?: SchemaType): number
|
73
104
|
|
74
|
-
|
75
|
-
|
105
|
+
export function getValueForAnyOf (v: string | number, schema?: { anyOf?: ItemsType }): string
|
106
|
+
export function getIndexForAnyOf (values?: ValuesType, parentUri?: string, uri?: string, schema?: SchemaType): number
|
76
107
|
|
77
|
-
|
78
|
-
|
108
|
+
export function getValueForOneOf (v: string | number, schema?: { oneOf?: ItemsType }): string
|
109
|
+
export function getIndexForOneOf (values: ValuesType, parentUri?: string, uri?: string, schema?: SchemaType): number
|
79
110
|
|
80
|
-
|
81
|
-
export function getDefault (schema: SchemaType | undefined): unknown
|
111
|
+
export function getElementsProps (params?: ParamsType, uri?: string): TransmissionStringElementsType | TransmissionNumberElementsType | TransmissionArrayElementsType | TransmissionObjectElementsType | TransmissionBooleanElementsType | TransmissionNullElementsType | Record<string, never>
|
82
112
|
|
83
|
-
|
84
|
-
|
113
|
+
export function getElementsFieldPropsForEnum (params?: ParamsType, uri?: string): EnumType | ObjectLiteralType
|
114
|
+
export function getElementsFieldPropsForOneOf (params?: ParamsType, uri?: string): OneOfType | ObjectLiteralType
|
115
|
+
export function getElementsFieldPropsForAnyOf (params?: ParamsType, uri?: string): AnyOfType | ObjectLiteralType
|
116
|
+
export function getElementsFieldPropsForAllOf (params?: ParamsType, uri?: string): FieldType | ObjectLiteralType
|
117
|
+
export function getElementsFieldProps (params?: ParamsType, uri?: string): FieldType | ObjectLiteralType
|
118
|
+
export function getElementsFieldValue (values?: ValuesType, uri?: string, schema?: SchemaType): { value: string } | ObjectLiteralType
|
85
119
|
|
86
|
-
|
87
|
-
export function getOneOf (schema: SchemaType | undefined): ObjectType | ObjectLiteralType | ArrayType | ArrayLiteralType
|
120
|
+
export function hasEnum (schema?: { enum?: ItemsType }): schema is { enum: ItemsType }
|
88
121
|
|
89
|
-
|
90
|
-
|
122
|
+
declare function getEnum (schema: { enum: ItemsType }): ItemsType
|
123
|
+
declare function getEnum (schema?: { enum?: ItemsType }): ItemsType | undefined
|
91
124
|
|
92
|
-
|
125
|
+
export { getEnum }
|
93
126
|
|
94
|
-
|
127
|
+
export function hasConst (schema?: { const?: string | number | object | boolean | null }): schema is { const: string | number | object | boolean | null }
|
95
128
|
|
96
|
-
|
97
|
-
|
129
|
+
declare function getConst (schema: { const: string | number | object | boolean | null }): string | number | object | boolean | null
|
130
|
+
declare function getConst (schema?: { const?: string | number | object | boolean | null }): string | number | object | boolean | null | undefined
|
98
131
|
|
99
|
-
|
100
|
-
export function getMaxLength (schema: SchemaType | undefined): { maxLength: number } | ObjectLiteralType
|
132
|
+
export { getConst }
|
101
133
|
|
102
|
-
|
103
|
-
export function getMaxItems (schema: SchemaType | undefined): { maxItems: number } | ObjectLiteralType
|
134
|
+
export function hasDefault (schema?: { default?: string | number | object | boolean | null }): schema is { default: string | number | object | boolean | null }
|
104
135
|
|
105
|
-
|
136
|
+
declare function getDefault (schema: { default: string | number | object | boolean | null }): string | number | object | boolean | null
|
137
|
+
declare function getDefault (schema?: { default?: string | number | object | boolean | null }): string | number | object | boolean | null | undefined
|
106
138
|
|
107
|
-
|
108
|
-
export function getMaxContains (schema: SchemaType | undefined): { maxContains: number } | ObjectLiteralType
|
139
|
+
export { getDefault }
|
109
140
|
|
110
|
-
|
111
|
-
export function getMaxProperties (schema: SchemaType | undefined): { maxProperties: number } | ObjectLiteralType
|
141
|
+
export function hasAnyOf (schema?: { anyOf?: ItemsType }): schema is { anyOf: ItemsType }
|
112
142
|
|
113
|
-
|
114
|
-
|
143
|
+
declare function getAnyOf (schema: { anyOf: ItemsType }): ItemsType
|
144
|
+
declare function getAnyOf (schema?: { anyOf?: ItemsType }): ItemsType | undefined
|
115
145
|
|
116
|
-
|
146
|
+
export { getAnyOf }
|
117
147
|
|
118
|
-
|
119
|
-
}
|
148
|
+
export function hasOneOf (schema?: { oneOf?: ItemsType }): schema is { oneOf: ItemsType }
|
120
149
|
|
121
|
-
declare
|
122
|
-
|
123
|
-
|
150
|
+
declare function getOneOf (schema: { oneOf: ItemsType }): ItemsType
|
151
|
+
declare function getOneOf (schema?: { oneOf?: ItemsType }): ItemsType | undefined
|
152
|
+
|
153
|
+
export { getOneOf }
|
154
|
+
|
155
|
+
export function hasAllOf (schema?: { allOf?: ItemsType }): schema is { allOf: ItemsType }
|
156
|
+
|
157
|
+
declare function getAllOf (schema: { allOf: ItemsType }): ItemsType
|
158
|
+
declare function getAllOf (schema?: { allOf?: ItemsType }): ItemsType | undefined
|
159
|
+
|
160
|
+
export { getAllOf }
|
161
|
+
|
162
|
+
export function getUri (uri?: string, resource?: string | number): string
|
163
|
+
|
164
|
+
export function normaliseUri (uri?: string): string
|
165
|
+
|
166
|
+
export function getMin (schema?: { minimum?: number }): { min: number } | ObjectLiteralType
|
167
|
+
export function getMax (schema?: { maximum?: number }): { max: number } | ObjectLiteralType
|
168
|
+
|
169
|
+
export function getMinLength (schema?: { minLength?: number }): { minLength: number } | ObjectLiteralType
|
170
|
+
export function getMaxLength (schema?: { maxLength?: number }): { maxLength: number } | ObjectLiteralType
|
171
|
+
|
172
|
+
export function getMinItems (schema?: { minItems?: number }): { minItems: number } | ObjectLiteralType
|
173
|
+
export function getMaxItems (schema?: { maxItems?: number }): { maxItems: number } | ObjectLiteralType
|
174
|
+
|
175
|
+
export function getHasUniqueItems (schema?: { uniqueItems?: boolean }): { hasUniqueItems: boolean } | ObjectLiteralType
|
176
|
+
|
177
|
+
export function getMinContains (schema?: { minContains?: number }): { minContains: number } | ObjectLiteralType
|
178
|
+
export function getMaxContains (schema?: { maxContains?: number }): { maxContains: number } | ObjectLiteralType
|
179
|
+
|
180
|
+
export function getMinProperties (schema?: { minProperties?: number }): { minProperties: number } | ObjectLiteralType
|
181
|
+
export function getMaxProperties (schema?: { maxProperties?: number }): { maxProperties: number } | ObjectLiteralType
|
182
|
+
|
183
|
+
export function getIsExclusiveMin (schema?: { exclusiveMinimum?: boolean }): { isExclusiveMin: boolean } | ObjectLiteralType
|
184
|
+
export function getIsExclusiveMax (schema?: { exclusiveMaximum?: boolean }): { isExclusiveMax: boolean } | ObjectLiteralType
|
185
|
+
|
186
|
+
export function getPattern (schema?: { pattern?: RegExp }): { pattern: RegExp } | ObjectLiteralType
|
187
|
+
|
188
|
+
export function getStep (schema?: { multipleOf?: number }): { step: number } | ObjectLiteralType
|