@api-client/core 0.11.10 → 0.12.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/Testing.md +1 -1
- package/bin/plugins/events/EventPlugin.ts +61 -0
- package/bin/plugins/events/assert.ts +193 -0
- package/bin/plugins/events/types.ts +6 -0
- package/bin/test.ts +8 -1
- package/build/src/amf/AmfShapeGenerator.d.ts +6 -3
- package/build/src/amf/AmfShapeGenerator.d.ts.map +1 -1
- package/build/src/amf/AmfShapeGenerator.js +4 -1
- package/build/src/amf/AmfShapeGenerator.js.map +1 -1
- package/build/src/amf/AmfTypes.d.ts +2 -2
- package/build/src/amf/AmfTypes.d.ts.map +1 -1
- package/build/src/amf/AmfTypes.js.map +1 -1
- package/build/src/amf/DataValueGenerator.d.ts +15 -15
- package/build/src/amf/DataValueGenerator.d.ts.map +1 -1
- package/build/src/amf/DataValueGenerator.js +14 -14
- package/build/src/amf/DataValueGenerator.js.map +1 -1
- package/build/src/browser.d.ts +12 -9
- package/build/src/browser.d.ts.map +1 -1
- package/build/src/browser.js +11 -8
- package/build/src/browser.js.map +1 -1
- package/build/src/exceptions/attach_exception.d.ts +11 -0
- package/build/src/exceptions/attach_exception.d.ts.map +1 -0
- package/build/src/exceptions/attach_exception.js +11 -0
- package/build/src/exceptions/attach_exception.js.map +1 -0
- package/build/src/exceptions/detach_exception.d.ts +11 -0
- package/build/src/exceptions/detach_exception.d.ts.map +1 -0
- package/build/src/exceptions/detach_exception.js +11 -0
- package/build/src/exceptions/detach_exception.js.map +1 -0
- package/build/src/exceptions/remove_model_exception.d.ts +8 -0
- package/build/src/exceptions/remove_model_exception.d.ts.map +1 -0
- package/build/src/exceptions/remove_model_exception.js +8 -0
- package/build/src/exceptions/remove_model_exception.js.map +1 -0
- package/build/src/exceptions/remove_namespace_exception.d.ts +8 -0
- package/build/src/exceptions/remove_namespace_exception.d.ts.map +1 -0
- package/build/src/exceptions/remove_namespace_exception.js +8 -0
- package/build/src/exceptions/remove_namespace_exception.js.map +1 -0
- package/build/src/index.d.ts +12 -9
- package/build/src/index.d.ts.map +1 -1
- package/build/src/index.js +11 -8
- package/build/src/index.js.map +1 -1
- package/build/src/legacy.d.ts +8 -0
- package/build/src/legacy.d.ts.map +1 -1
- package/build/src/legacy.js +9 -0
- package/build/src/legacy.js.map +1 -1
- package/build/src/modeling/Bindings.d.ts +2 -2
- package/build/src/modeling/Bindings.d.ts.map +1 -1
- package/build/src/modeling/Bindings.js.map +1 -1
- package/build/src/modeling/DataDomain.d.ts +601 -0
- package/build/src/modeling/DataDomain.d.ts.map +1 -0
- package/build/src/modeling/DataDomain.js +1142 -0
- package/build/src/modeling/DataDomain.js.map +1 -0
- package/build/src/modeling/DataFormat.d.ts +42 -41
- package/build/src/modeling/DataFormat.d.ts.map +1 -1
- package/build/src/modeling/DataFormat.js +30 -131
- package/build/src/modeling/DataFormat.js.map +1 -1
- package/build/src/modeling/DomainAssociation.d.ts +281 -0
- package/build/src/modeling/DomainAssociation.d.ts.map +1 -0
- package/build/src/modeling/DomainAssociation.js +440 -0
- package/build/src/modeling/DomainAssociation.js.map +1 -0
- package/build/src/modeling/DomainElement.d.ts +33 -0
- package/build/src/modeling/DomainElement.d.ts.map +1 -0
- package/build/src/modeling/DomainElement.js +32 -0
- package/build/src/modeling/DomainElement.js.map +1 -0
- package/build/src/modeling/DomainEntity.d.ts +383 -0
- package/build/src/modeling/DomainEntity.d.ts.map +1 -0
- package/build/src/modeling/DomainEntity.js +718 -0
- package/build/src/modeling/DomainEntity.js.map +1 -0
- package/build/src/modeling/DomainFile.d.ts +25 -0
- package/build/src/modeling/DomainFile.d.ts.map +1 -0
- package/build/src/modeling/DomainFile.js +86 -0
- package/build/src/modeling/DomainFile.js.map +1 -0
- package/build/src/modeling/DomainImpactAnalysis.d.ts +60 -47
- package/build/src/modeling/DomainImpactAnalysis.d.ts.map +1 -1
- package/build/src/modeling/DomainImpactAnalysis.js +201 -132
- package/build/src/modeling/DomainImpactAnalysis.js.map +1 -1
- package/build/src/modeling/DomainModel.d.ts +226 -0
- package/build/src/modeling/DomainModel.d.ts.map +1 -0
- package/build/src/modeling/DomainModel.js +401 -0
- package/build/src/modeling/DomainModel.js.map +1 -0
- package/build/src/modeling/DomainNamespace.d.ts +268 -0
- package/build/src/modeling/DomainNamespace.d.ts.map +1 -0
- package/build/src/modeling/DomainNamespace.js +512 -0
- package/build/src/modeling/DomainNamespace.js.map +1 -0
- package/build/src/modeling/DomainProperty.d.ts +281 -0
- package/build/src/modeling/DomainProperty.d.ts.map +1 -0
- package/build/src/modeling/DomainProperty.js +560 -0
- package/build/src/modeling/DomainProperty.js.map +1 -0
- package/build/src/modeling/DomainSerialization.d.ts +40 -0
- package/build/src/modeling/DomainSerialization.d.ts.map +1 -0
- package/build/src/modeling/DomainSerialization.js +288 -0
- package/build/src/modeling/DomainSerialization.js.map +1 -0
- package/build/src/modeling/DomainVersioning.d.ts +17 -0
- package/build/src/modeling/DomainVersioning.d.ts.map +1 -0
- package/build/src/modeling/DomainVersioning.js +124 -0
- package/build/src/modeling/DomainVersioning.js.map +1 -0
- package/build/src/modeling/GraphUtils.d.ts +8 -0
- package/build/src/modeling/GraphUtils.d.ts.map +1 -0
- package/build/src/modeling/GraphUtils.js +26 -0
- package/build/src/modeling/GraphUtils.js.map +1 -0
- package/build/src/modeling/amf/ShapeGenerator.d.ts +164 -0
- package/build/src/modeling/amf/ShapeGenerator.d.ts.map +1 -0
- package/build/src/modeling/amf/ShapeGenerator.js +492 -0
- package/build/src/modeling/amf/ShapeGenerator.js.map +1 -0
- package/build/src/modeling/{DataAssociation.d.ts → legacy/DataAssociation.d.ts} +10 -5
- package/build/src/modeling/legacy/DataAssociation.d.ts.map +1 -0
- package/build/src/modeling/{DataAssociation.js → legacy/DataAssociation.js} +9 -6
- package/build/src/modeling/legacy/DataAssociation.js.map +1 -0
- package/build/src/modeling/{DataEntity.d.ts → legacy/DataEntity.d.ts} +12 -7
- package/build/src/modeling/legacy/DataEntity.d.ts.map +1 -0
- package/build/src/modeling/{DataEntity.js → legacy/DataEntity.js} +19 -18
- package/build/src/modeling/legacy/DataEntity.js.map +1 -0
- package/build/src/modeling/{DataEntityBuilder.d.ts → legacy/DataEntityBuilder.d.ts} +3 -2
- package/build/src/modeling/legacy/DataEntityBuilder.d.ts.map +1 -0
- package/build/src/modeling/{DataEntityBuilder.js → legacy/DataEntityBuilder.js} +3 -2
- package/build/src/modeling/legacy/DataEntityBuilder.js.map +1 -0
- package/build/src/modeling/legacy/DataImpactAnalysis.d.ts +298 -0
- package/build/src/modeling/legacy/DataImpactAnalysis.d.ts.map +1 -0
- package/build/src/modeling/legacy/DataImpactAnalysis.js +441 -0
- package/build/src/modeling/legacy/DataImpactAnalysis.js.map +1 -0
- package/build/src/modeling/{DataModel.d.ts → legacy/DataModel.d.ts} +6 -4
- package/build/src/modeling/legacy/DataModel.d.ts.map +1 -0
- package/build/src/modeling/{DataModel.js → legacy/DataModel.js} +7 -6
- package/build/src/modeling/legacy/DataModel.js.map +1 -0
- package/build/src/modeling/{DataNamespace.d.ts → legacy/DataNamespace.d.ts} +22 -3
- package/build/src/modeling/legacy/DataNamespace.d.ts.map +1 -0
- package/build/src/modeling/{DataNamespace.js → legacy/DataNamespace.js} +7 -3
- package/build/src/modeling/legacy/DataNamespace.js.map +1 -0
- package/build/src/modeling/{DataProperty.d.ts → legacy/DataProperty.d.ts} +13 -5
- package/build/src/modeling/legacy/DataProperty.d.ts.map +1 -0
- package/build/src/modeling/{DataProperty.js → legacy/DataProperty.js} +8 -5
- package/build/src/modeling/legacy/DataProperty.js.map +1 -0
- package/build/src/modeling/observed.d.ts +67 -0
- package/build/src/modeling/observed.d.ts.map +1 -0
- package/build/src/modeling/observed.js +230 -0
- package/build/src/modeling/observed.js.map +1 -0
- package/build/src/modeling/types.d.ts +165 -1
- package/build/src/modeling/types.d.ts.map +1 -1
- package/build/src/modeling/types.js.map +1 -1
- package/build/src/models/Thing.d.ts +26 -5
- package/build/src/models/Thing.d.ts.map +1 -1
- package/build/src/models/Thing.js +193 -91
- package/build/src/models/Thing.js.map +1 -1
- package/build/src/models/kinds.d.ts +31 -6
- package/build/src/models/kinds.d.ts.map +1 -1
- package/build/src/models/kinds.js +31 -6
- package/build/src/models/kinds.js.map +1 -1
- package/build/src/models/store/DataFile.d.ts +3 -1
- package/build/src/models/store/DataFile.d.ts.map +1 -1
- package/build/src/models/store/DataFile.js +2 -0
- package/build/src/models/store/DataFile.js.map +1 -1
- package/build/src/models/types.d.ts +12 -0
- package/build/src/models/types.d.ts.map +1 -0
- package/build/src/models/types.js +2 -0
- package/build/src/models/types.js.map +1 -0
- package/build/src/runtime/store/FilesSdk.d.ts +2 -2
- package/build/src/runtime/store/FilesSdk.d.ts.map +1 -1
- package/build/src/runtime/store/FilesSdk.js.map +1 -1
- package/data/models/example-generator-api.json +26 -26
- package/package.json +20 -6
- package/readme.md +1 -1
- package/src/amf/AmfShapeGenerator.ts +7 -4
- package/src/amf/AmfTypes.ts +2 -2
- package/src/amf/DataValueGenerator.ts +21 -21
- package/src/exceptions/attach_exception.ts +11 -0
- package/src/exceptions/detach_exception.ts +11 -0
- package/src/exceptions/remove_model_exception.ts +8 -0
- package/src/exceptions/remove_namespace_exception.ts +8 -0
- package/src/modeling/Bindings.ts +2 -2
- package/src/modeling/DataDomain.ts +1221 -0
- package/src/modeling/DataFormat.ts +54 -163
- package/src/modeling/DomainAssociation.ts +476 -0
- package/src/modeling/DomainElement.ts +50 -0
- package/src/modeling/DomainEntity.ts +769 -0
- package/src/modeling/DomainFile.ts +94 -0
- package/src/modeling/DomainImpactAnalysis.ts +218 -144
- package/src/modeling/DomainModel.ts +421 -0
- package/src/modeling/DomainNamespace.ts +537 -0
- package/src/modeling/DomainProperty.ts +548 -0
- package/src/modeling/DomainSerialization.ts +312 -0
- package/src/modeling/DomainVersioning.ts +144 -0
- package/src/modeling/GraphUtils.ts +28 -0
- package/src/modeling/amf/ShapeGenerator.ts +552 -0
- package/src/modeling/graph.md +115 -0
- package/src/modeling/{DataAssociation.ts → legacy/DataAssociation.ts} +13 -8
- package/src/modeling/{DataEntity.ts → legacy/DataEntity.ts} +28 -23
- package/src/modeling/{DataEntityBuilder.ts → legacy/DataEntityBuilder.ts} +4 -3
- package/src/modeling/legacy/DataImpactAnalysis.ts +530 -0
- package/src/modeling/{DataModel.ts → legacy/DataModel.ts} +10 -8
- package/src/modeling/{DataNamespace.ts → legacy/DataNamespace.ts} +23 -5
- package/src/modeling/{DataProperty.ts → legacy/DataProperty.ts} +15 -7
- package/src/modeling/observed.ts +267 -0
- package/src/modeling/types.ts +174 -1
- package/src/models/Thing.ts +70 -5
- package/src/models/kinds.ts +32 -6
- package/src/models/store/DataFile.ts +3 -1
- package/src/models/types.ts +11 -0
- package/src/runtime/store/FilesSdk.ts +2 -6
- package/tests/unit/amf/data_value_generator.spec.ts +15 -15
- package/tests/unit/legacy-transformers/ARC-legacy-import.spec.ts +1 -1
- package/tests/unit/modeling/amf/shape_generator.spec.ts +1174 -0
- package/tests/unit/modeling/data_domain.spec.ts +444 -0
- package/tests/unit/modeling/data_domain_associations.spec.ts +279 -0
- package/tests/unit/modeling/data_domain_change_observers.spec.ts +681 -0
- package/tests/unit/modeling/data_domain_entities.spec.ts +449 -0
- package/tests/unit/modeling/data_domain_foreign.spec.ts +355 -0
- package/tests/unit/modeling/data_domain_models.spec.ts +658 -0
- package/tests/unit/modeling/data_domain_namespaces.spec.ts +668 -0
- package/tests/unit/modeling/data_domain_property.spec.ts +264 -0
- package/tests/unit/modeling/data_domain_serialization.spec.ts +294 -0
- package/tests/unit/modeling/domain.property.spec.ts +822 -0
- package/tests/unit/modeling/domain_asociation.spec.ts +643 -0
- package/tests/unit/modeling/domain_asociation_targets.spec.ts +350 -0
- package/tests/unit/modeling/domain_entity.spec.ts +730 -0
- package/tests/unit/modeling/domain_entity_associations.spec.ts +330 -0
- package/tests/unit/modeling/domain_entity_example_generator_json.spec.ts +988 -0
- package/tests/unit/modeling/domain_entity_example_generator_xml.spec.ts +1451 -0
- package/tests/unit/modeling/domain_entity_fields.spec.ts +113 -0
- package/tests/unit/modeling/domain_entity_generators.spec.ts +20 -0
- package/tests/unit/modeling/domain_entity_parents.spec.ts +291 -0
- package/tests/unit/modeling/domain_entity_properties.spec.ts +305 -0
- package/tests/unit/modeling/{data_file.spec.ts → domain_file.spec.ts} +29 -85
- package/tests/unit/modeling/domain_impact_analysis.spec.ts +452 -0
- package/tests/unit/modeling/domain_model.spec.ts +568 -0
- package/tests/unit/modeling/domain_model_entities.spec.ts +408 -0
- package/tests/unit/modeling/domain_namespace.spec.ts +514 -0
- package/tests/unit/modeling/domain_namespace_models.spec.ts +324 -0
- package/tests/unit/modeling/domain_namespace_namespaces.spec.ts +404 -0
- package/tests/unit/modeling/domain_versioning.spec.ts +140 -0
- package/tests/unit/{amf → modeling/legacy}/amf_shape_generator.spec.ts +11 -11
- package/tests/unit/modeling/{data_association.spec.ts → legacy/data_association.spec.ts} +3 -11
- package/tests/unit/modeling/{data_entity.spec.ts → legacy/data_entity.spec.ts} +10 -8
- package/tests/unit/modeling/{data_entity_generator_json.spec.ts → legacy/data_entity_generator_json.spec.ts} +1 -1
- package/tests/unit/modeling/{data_entity_generator_xml.spec.ts → legacy/data_entity_generator_xml.spec.ts} +1 -1
- package/tests/unit/modeling/{data_model.spec.ts → legacy/data_model.spec.ts} +3 -3
- package/tests/unit/modeling/{data_namespace.spec.ts → legacy/data_namespace.spec.ts} +3 -10
- package/tests/unit/modeling/{data_property.spec.ts → legacy/data_property.spec.ts} +3 -6
- package/tests/unit/modeling/{impact_analysis.spec.ts → legacy/impact_analysis.spec.ts} +9 -9
- package/tests/unit/models/File/new.spec.ts +1 -1
- package/tests/unit/models/HttpProject.spec.ts +3 -3
- package/tsconfig.node.json +35 -0
- package/build/src/modeling/DataAssociation.d.ts.map +0 -1
- package/build/src/modeling/DataAssociation.js.map +0 -1
- package/build/src/modeling/DataEntity.d.ts.map +0 -1
- package/build/src/modeling/DataEntity.js.map +0 -1
- package/build/src/modeling/DataEntityBuilder.d.ts.map +0 -1
- package/build/src/modeling/DataEntityBuilder.js.map +0 -1
- package/build/src/modeling/DataModel.d.ts.map +0 -1
- package/build/src/modeling/DataModel.js.map +0 -1
- package/build/src/modeling/DataNamespace.d.ts.map +0 -1
- package/build/src/modeling/DataNamespace.js.map +0 -1
- package/build/src/modeling/DataProperty.d.ts.map +0 -1
- package/build/src/modeling/DataProperty.js.map +0 -1
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
import type { DataProperty } from './DataProperty.js'
|
|
3
|
-
|
|
4
|
-
export type DataPropertyType =
|
|
1
|
+
export type DomainPropertyType =
|
|
5
2
|
| 'string'
|
|
6
3
|
| 'number'
|
|
7
4
|
// | 'nil'
|
|
@@ -11,7 +8,13 @@ export type DataPropertyType =
|
|
|
11
8
|
| 'time'
|
|
12
9
|
// | 'any'
|
|
13
10
|
| 'binary'
|
|
14
|
-
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* @deprecated Use the {@link DomainPropertyType} instead.
|
|
14
|
+
*/
|
|
15
|
+
export type DataPropertyType = DomainPropertyType
|
|
16
|
+
|
|
17
|
+
export const DomainPropertyTypes: DomainPropertyType[] = [
|
|
15
18
|
'string',
|
|
16
19
|
'number',
|
|
17
20
|
// 'nil',
|
|
@@ -33,6 +36,26 @@ export const DataPropertyTypes: DataPropertyType[] = [
|
|
|
33
36
|
'binary',
|
|
34
37
|
]
|
|
35
38
|
|
|
39
|
+
/**
|
|
40
|
+
* @deprecated Use the {@link DomainPropertyTypes} instead.
|
|
41
|
+
*/
|
|
42
|
+
export const DataPropertyTypes: DataPropertyType[] = DomainPropertyTypes
|
|
43
|
+
|
|
44
|
+
export enum DomainPropertyList {
|
|
45
|
+
string = 'string',
|
|
46
|
+
number = 'number',
|
|
47
|
+
// nil = 'nil',
|
|
48
|
+
boolean = 'boolean',
|
|
49
|
+
date = 'date',
|
|
50
|
+
datetime = 'datetime',
|
|
51
|
+
time = 'time',
|
|
52
|
+
// any = 'any',
|
|
53
|
+
file = 'binary',
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* @deprecated Use the {@link DomainPropertyList} instead.
|
|
58
|
+
*/
|
|
36
59
|
export enum DataPropertyList {
|
|
37
60
|
string = 'string',
|
|
38
61
|
number = 'number',
|
|
@@ -48,7 +71,7 @@ export enum DataPropertyList {
|
|
|
48
71
|
/**
|
|
49
72
|
* The data property "attributes".
|
|
50
73
|
*/
|
|
51
|
-
export type
|
|
74
|
+
export type DomainPropertyAttribute =
|
|
52
75
|
| 'required'
|
|
53
76
|
| 'multiple'
|
|
54
77
|
| 'primary'
|
|
@@ -57,7 +80,12 @@ export type DataPropertyAttribute =
|
|
|
57
80
|
| 'writeOnly'
|
|
58
81
|
| 'deprecated'
|
|
59
82
|
|
|
60
|
-
|
|
83
|
+
/**
|
|
84
|
+
* @deprecated Use the {@link DomainPropertyAttribute} instead.
|
|
85
|
+
*/
|
|
86
|
+
export type DataPropertyAttribute = DomainPropertyAttribute
|
|
87
|
+
|
|
88
|
+
export const DomainPropertyAttributes: DomainPropertyAttribute[] = [
|
|
61
89
|
'required',
|
|
62
90
|
'multiple',
|
|
63
91
|
'primary',
|
|
@@ -67,12 +95,26 @@ export const DataPropertyAttributes: DataPropertyAttribute[] = [
|
|
|
67
95
|
'deprecated',
|
|
68
96
|
]
|
|
69
97
|
|
|
98
|
+
/**
|
|
99
|
+
* @deprecated Use the {@link DomainPropertyAttributes} instead.
|
|
100
|
+
*/
|
|
101
|
+
export const DataPropertyAttributes: DataPropertyAttribute[] = DomainPropertyAttributes
|
|
102
|
+
|
|
70
103
|
/**
|
|
71
104
|
* The data attribute "attributes".
|
|
72
105
|
*/
|
|
73
|
-
export type
|
|
106
|
+
export type DomainAttributeAttribute = 'required' | 'multiple'
|
|
74
107
|
|
|
75
|
-
|
|
108
|
+
/**
|
|
109
|
+
* @deprecated Use the {@link DomainAttributeAttribute} instead.
|
|
110
|
+
*/
|
|
111
|
+
export type DataAttributeAttribute = DomainAttributeAttribute
|
|
112
|
+
|
|
113
|
+
export const DomainAttributeAttributes: DomainAttributeAttribute[] = ['required', 'multiple']
|
|
114
|
+
/**
|
|
115
|
+
* @deprecated Use the {@link DomainAttributeAttributes} instead.
|
|
116
|
+
*/
|
|
117
|
+
export const DataAttributeAttributes: DataAttributeAttribute[] = DomainAttributeAttributes
|
|
76
118
|
|
|
77
119
|
/**
|
|
78
120
|
* Note, OAS supports the `integer` data type and not format.
|
|
@@ -95,159 +137,8 @@ export type BinaryFormat = 'hex' | 'base64'
|
|
|
95
137
|
|
|
96
138
|
export const BinaryFormats: BinaryFormat[] = ['hex', 'base64']
|
|
97
139
|
|
|
98
|
-
export type
|
|
99
|
-
|
|
100
|
-
export function getFormatInfo(format: DataPropertyFormat): { label: string; help: string } {
|
|
101
|
-
if (format === 'float') {
|
|
102
|
-
return { label: 'Float', help: '32-bit number with decimals' }
|
|
103
|
-
}
|
|
104
|
-
if (format === 'double') {
|
|
105
|
-
return { label: 'Double', help: '64-bit number with decimals' }
|
|
106
|
-
}
|
|
107
|
-
if (format === 'int32') {
|
|
108
|
-
return { label: 'Integer (32-bit)', help: '-2,147,483,648…+2,147,483,647' }
|
|
109
|
-
}
|
|
110
|
-
if (format === 'int64') {
|
|
111
|
-
return { label: 'Integer (64-bit)', help: 'Negative or positive 64-bit integer' }
|
|
112
|
-
}
|
|
113
|
-
if (format === 'hex') {
|
|
114
|
-
return { label: 'Hex', help: 'Hex-encoded binary data' }
|
|
115
|
-
}
|
|
116
|
-
if (format === 'base64') {
|
|
117
|
-
return { label: 'Base64', help: 'Base64-encoded binary data' }
|
|
118
|
-
}
|
|
119
|
-
return { label: 'Unknown', help: 'An error occured...' }
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
export interface DataPropertyInputConfig {
|
|
123
|
-
/**
|
|
124
|
-
* The input's type
|
|
125
|
-
*/
|
|
126
|
-
type: TextFieldType
|
|
127
|
-
/**
|
|
128
|
-
* The `pattern` to set on the input.
|
|
129
|
-
*/
|
|
130
|
-
pattern?: string
|
|
131
|
-
/**
|
|
132
|
-
* The `min` to set on the input.
|
|
133
|
-
*/
|
|
134
|
-
min?: number
|
|
135
|
-
/**
|
|
136
|
-
* The `max` to set on the input.
|
|
137
|
-
*/
|
|
138
|
-
max?: number
|
|
139
|
-
/**
|
|
140
|
-
* The `step` to set on the input.
|
|
141
|
-
*/
|
|
142
|
-
step?: number
|
|
143
|
-
/**
|
|
144
|
-
* The `supportingText` to set on the Material Text Field.
|
|
145
|
-
*/
|
|
146
|
-
help?: string
|
|
147
|
-
}
|
|
148
|
-
|
|
140
|
+
export type DomainPropertyFormat = NumberFormat | BinaryFormat
|
|
149
141
|
/**
|
|
150
|
-
*
|
|
151
|
-
*
|
|
152
|
-
* @param model The data property model to gather HTML input's configuration for.
|
|
153
|
-
* @returns Input attributes to set.
|
|
142
|
+
* @deprecated Use the {@link DomainPropertyFormat} instead.
|
|
154
143
|
*/
|
|
155
|
-
export
|
|
156
|
-
const result: DataPropertyInputConfig = { type: 'text' }
|
|
157
|
-
const wb = model.getWebBinding()
|
|
158
|
-
if (!wb) {
|
|
159
|
-
return result
|
|
160
|
-
}
|
|
161
|
-
const format = wb.format
|
|
162
|
-
// if (format === 'no-tz') {
|
|
163
|
-
// result.pattern = '^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}$'
|
|
164
|
-
// result.help = 'yyyy-mm-ddThh:mm:ss.sss'
|
|
165
|
-
// } else if (format === 'utc') {
|
|
166
|
-
// result.pattern = '^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$'
|
|
167
|
-
// result.help = 'yyyy-mm-ddThh:mm:ss.sssZ'
|
|
168
|
-
// } else if (format === 'offset') {
|
|
169
|
-
// result.pattern = '^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}[+-]\\d{2}$'
|
|
170
|
-
// result.help = 'yyyy-mm-ddThh:mm:ss.sss±hh'
|
|
171
|
-
// } else if (format === 'time-offset') {
|
|
172
|
-
// result.pattern = '^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}[+-]\\d{2}:\\d{2}$'
|
|
173
|
-
// result.help = 'yyyy-mm-ddThh:mm:ss.sss±hh:mm'
|
|
174
|
-
// } else if (format === 'timestamp') {
|
|
175
|
-
// result.type = 'number'
|
|
176
|
-
// result.min = 0
|
|
177
|
-
// result.step = 1
|
|
178
|
-
// result.help = `Example: ${Date.now()}`
|
|
179
|
-
// } else if (format === 'integer') {
|
|
180
|
-
// result.type = 'number'
|
|
181
|
-
// result.step = 1
|
|
182
|
-
// result.help = 'Arbitrary-size integer numbers'
|
|
183
|
-
// } else if (format === 'decimal') {
|
|
184
|
-
// result.type = 'number'
|
|
185
|
-
// result.step = 0.01
|
|
186
|
-
// result.help = 'Arbitrary-precision decimal numbers'
|
|
187
|
-
// } else if (format === 'double') {
|
|
188
|
-
// else if (format === 'byte') {
|
|
189
|
-
// result.type = 'number'
|
|
190
|
-
// result.step = 1
|
|
191
|
-
// result.help = '-128…+127 (8 bit)'
|
|
192
|
-
// result.min = -128
|
|
193
|
-
// result.max = 127
|
|
194
|
-
// } else if (format === 'short') {
|
|
195
|
-
// result.type = 'number'
|
|
196
|
-
// result.step = 1
|
|
197
|
-
// result.help = '-32,768…+32,767 (16 bit)'
|
|
198
|
-
// result.min = -32768
|
|
199
|
-
// result.max = 32767
|
|
200
|
-
// }
|
|
201
|
-
// else if (format === 'long') {
|
|
202
|
-
// result.type = 'number'
|
|
203
|
-
// result.step = 1
|
|
204
|
-
// result.help = 'Signed 64 bit number'
|
|
205
|
-
// } else if (format === 'unsignedByte') {
|
|
206
|
-
// result.type = 'number'
|
|
207
|
-
// result.step = 1
|
|
208
|
-
// result.help = '0…255 (8 bit)'
|
|
209
|
-
// result.min = 0
|
|
210
|
-
// result.max = 255
|
|
211
|
-
// } else if (format === 'unsignedShort') {
|
|
212
|
-
// result.type = 'number'
|
|
213
|
-
// result.step = 1
|
|
214
|
-
// result.help = '0…65,535 (16 bit)'
|
|
215
|
-
// result.min = 0
|
|
216
|
-
// result.max = 65535
|
|
217
|
-
// } else if (format === 'unsignedInt') {
|
|
218
|
-
// result.type = 'number'
|
|
219
|
-
// result.step = 1
|
|
220
|
-
// result.help = '0…4,294,967,295 (32 bit)'
|
|
221
|
-
// result.min = 0
|
|
222
|
-
// result.max = 4294967295
|
|
223
|
-
// } else if (format === 'unsignedLong') {
|
|
224
|
-
// result.type = 'number'
|
|
225
|
-
// result.step = 1
|
|
226
|
-
// result.help = 'Unsigned 64 bit number'
|
|
227
|
-
// }
|
|
228
|
-
if (format === 'float') {
|
|
229
|
-
result.type = 'number'
|
|
230
|
-
result.step = 0.000001
|
|
231
|
-
result.help = '32-bit number with decimals'
|
|
232
|
-
return result
|
|
233
|
-
}
|
|
234
|
-
if (format === 'double') {
|
|
235
|
-
result.type = 'number'
|
|
236
|
-
result.step = 0.000001
|
|
237
|
-
result.help = '64-bit number with decimals'
|
|
238
|
-
return result
|
|
239
|
-
} else if (format === 'int32') {
|
|
240
|
-
result.type = 'number'
|
|
241
|
-
result.step = 1
|
|
242
|
-
result.help = '-2,147,483,648…+2,147,483,647 (32 bit)'
|
|
243
|
-
result.min = -2147483648
|
|
244
|
-
result.max = 2147483647
|
|
245
|
-
return result
|
|
246
|
-
} else if (format === 'int64') {
|
|
247
|
-
result.type = 'number'
|
|
248
|
-
result.step = 1
|
|
249
|
-
result.help = 'Negative or positive 64-bit integer'
|
|
250
|
-
return result
|
|
251
|
-
}
|
|
252
|
-
return result
|
|
253
|
-
}
|
|
144
|
+
export type DataPropertyFormat = NumberFormat | BinaryFormat
|