@osdk/maker 0.15.0-beta.6 → 0.15.0-beta.8
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/CHANGELOG.md +22 -0
- package/README.md +26 -22
- package/build/browser/api/action/ActionParameter.js.map +1 -1
- package/build/browser/api/action/ActionParameterConfiguration.js.map +1 -1
- package/build/browser/api/defineAction.js +65 -22
- package/build/browser/api/defineAction.js.map +1 -1
- package/build/browser/api/defineCreateInterfaceObjectAction.js +28 -8
- package/build/browser/api/defineCreateInterfaceObjectAction.js.map +1 -1
- package/build/browser/api/defineInterface.js +40 -34
- package/build/browser/api/defineInterface.js.map +1 -1
- package/build/browser/api/defineModifyInterfaceObjectAction.js +31 -8
- package/build/browser/api/defineModifyInterfaceObjectAction.js.map +1 -1
- package/build/browser/api/defineObject.js +13 -9
- package/build/browser/api/defineObject.js.map +1 -1
- package/build/browser/api/defineOntology.js +6 -0
- package/build/browser/api/defineOntology.js.map +1 -1
- package/build/browser/api/defineSpt.js.map +1 -1
- package/build/browser/api/defineValueType.js +17 -4
- package/build/browser/api/defineValueType.js.map +1 -1
- package/build/browser/api/interface/InterfacePropertyType.js +22 -1
- package/build/browser/api/interface/InterfacePropertyType.js.map +1 -1
- package/build/browser/api/interface/InterfaceType.js.map +1 -1
- package/build/browser/api/interface/getFlattenedInterfaceProperties.js +9 -3
- package/build/browser/api/interface/getFlattenedInterfaceProperties.js.map +1 -1
- package/build/browser/api/interface/mapSimplifiedStatusToInterfaceTypeStatus.js +5 -0
- package/build/browser/api/interface/mapSimplifiedStatusToInterfaceTypeStatus.js.map +1 -1
- package/build/browser/api/links/LinkType.js.map +1 -1
- package/build/browser/api/object/ObjectType.js.map +1 -1
- package/build/browser/api/object/ObjectTypeDefinition.js.map +1 -1
- package/build/browser/api/object/ObjectTypeStatus.js.map +1 -1
- package/build/browser/api/properties/PropertyTypeType.js +1 -1
- package/build/browser/api/properties/PropertyTypeType.js.map +1 -1
- package/build/browser/api/properties/SharedPropertyType.js.map +1 -1
- package/build/browser/api/test/actions.test.js +6105 -5850
- package/build/browser/api/test/actions.test.js.map +1 -1
- package/build/browser/api/test/interfaces.test.js +757 -492
- package/build/browser/api/test/interfaces.test.js.map +1 -1
- package/build/browser/api/test/links.test.js +1334 -1325
- package/build/browser/api/test/links.test.js.map +1 -1
- package/build/browser/api/test/misc.test.js +262 -11
- package/build/browser/api/test/misc.test.js.map +1 -1
- package/build/browser/api/test/objects.test.js +1019 -960
- package/build/browser/api/test/objects.test.js.map +1 -1
- package/build/browser/api/test/spt.test.js +250 -103
- package/build/browser/api/test/spt.test.js.map +1 -1
- package/build/browser/api/test/valueTypes.test.js +69 -0
- package/build/browser/api/test/valueTypes.test.js.map +1 -1
- package/build/browser/cli/main.js +1 -1
- package/build/browser/conversion/toMarketplace/convertActionValidation.js +1 -1
- package/build/browser/conversion/toMarketplace/convertActionValidation.js.map +1 -1
- package/build/browser/conversion/toMarketplace/convertInterface.js +2 -2
- package/build/browser/conversion/toMarketplace/convertInterface.js.map +1 -1
- package/build/browser/conversion/toMarketplace/convertInterfacePropertyType.js +66 -0
- package/build/browser/conversion/toMarketplace/convertInterfacePropertyType.js.map +1 -0
- package/build/browser/conversion/toMarketplace/convertLink.js +30 -4
- package/build/browser/conversion/toMarketplace/convertLink.js.map +1 -1
- package/build/browser/conversion/toMarketplace/convertMappingValue.js +35 -0
- package/build/browser/conversion/toMarketplace/convertMappingValue.js.map +1 -1
- package/build/browser/conversion/toMarketplace/convertObject.js +4 -2
- package/build/browser/conversion/toMarketplace/convertObject.js.map +1 -1
- package/build/browser/conversion/toMarketplace/convertObjectPropertyType.js +2 -1
- package/build/browser/conversion/toMarketplace/convertObjectPropertyType.js.map +1 -1
- package/build/browser/conversion/toMarketplace/convertSpt.js +4 -2
- package/build/browser/conversion/toMarketplace/convertSpt.js.map +1 -1
- package/build/browser/conversion/toMarketplace/propertyTypeTypeToOntologyIrInterfaceType.js +143 -0
- package/build/browser/conversion/toMarketplace/propertyTypeTypeToOntologyIrInterfaceType.js.map +1 -0
- package/build/browser/conversion/toMarketplace/propertyTypeTypeToOntologyIrType.js +4 -0
- package/build/browser/conversion/toMarketplace/propertyTypeTypeToOntologyIrType.js.map +1 -1
- package/build/browser/index.js.map +1 -1
- package/build/cjs/index.cjs +444 -117
- package/build/cjs/index.cjs.map +1 -1
- package/build/cjs/index.d.cts +53 -17
- package/build/esm/api/action/ActionParameter.js.map +1 -1
- package/build/esm/api/action/ActionParameterConfiguration.js.map +1 -1
- package/build/esm/api/defineAction.js +65 -22
- package/build/esm/api/defineAction.js.map +1 -1
- package/build/esm/api/defineCreateInterfaceObjectAction.js +28 -8
- package/build/esm/api/defineCreateInterfaceObjectAction.js.map +1 -1
- package/build/esm/api/defineInterface.js +40 -34
- package/build/esm/api/defineInterface.js.map +1 -1
- package/build/esm/api/defineModifyInterfaceObjectAction.js +31 -8
- package/build/esm/api/defineModifyInterfaceObjectAction.js.map +1 -1
- package/build/esm/api/defineObject.js +13 -9
- package/build/esm/api/defineObject.js.map +1 -1
- package/build/esm/api/defineOntology.js +6 -0
- package/build/esm/api/defineOntology.js.map +1 -1
- package/build/esm/api/defineSpt.js.map +1 -1
- package/build/esm/api/defineValueType.js +17 -4
- package/build/esm/api/defineValueType.js.map +1 -1
- package/build/esm/api/interface/InterfacePropertyType.js +22 -1
- package/build/esm/api/interface/InterfacePropertyType.js.map +1 -1
- package/build/esm/api/interface/InterfaceType.js.map +1 -1
- package/build/esm/api/interface/getFlattenedInterfaceProperties.js +9 -3
- package/build/esm/api/interface/getFlattenedInterfaceProperties.js.map +1 -1
- package/build/esm/api/interface/mapSimplifiedStatusToInterfaceTypeStatus.js +5 -0
- package/build/esm/api/interface/mapSimplifiedStatusToInterfaceTypeStatus.js.map +1 -1
- package/build/esm/api/links/LinkType.js.map +1 -1
- package/build/esm/api/object/ObjectType.js.map +1 -1
- package/build/esm/api/object/ObjectTypeDefinition.js.map +1 -1
- package/build/esm/api/object/ObjectTypeStatus.js.map +1 -1
- package/build/esm/api/properties/PropertyTypeType.js +1 -1
- package/build/esm/api/properties/PropertyTypeType.js.map +1 -1
- package/build/esm/api/properties/SharedPropertyType.js.map +1 -1
- package/build/esm/api/test/actions.test.js +6105 -5850
- package/build/esm/api/test/actions.test.js.map +1 -1
- package/build/esm/api/test/interfaces.test.js +757 -492
- package/build/esm/api/test/interfaces.test.js.map +1 -1
- package/build/esm/api/test/links.test.js +1334 -1325
- package/build/esm/api/test/links.test.js.map +1 -1
- package/build/esm/api/test/misc.test.js +262 -11
- package/build/esm/api/test/misc.test.js.map +1 -1
- package/build/esm/api/test/objects.test.js +1019 -960
- package/build/esm/api/test/objects.test.js.map +1 -1
- package/build/esm/api/test/spt.test.js +250 -103
- package/build/esm/api/test/spt.test.js.map +1 -1
- package/build/esm/api/test/valueTypes.test.js +69 -0
- package/build/esm/api/test/valueTypes.test.js.map +1 -1
- package/build/esm/cli/main.js +1 -1
- package/build/esm/conversion/toMarketplace/convertActionValidation.js +1 -1
- package/build/esm/conversion/toMarketplace/convertActionValidation.js.map +1 -1
- package/build/esm/conversion/toMarketplace/convertInterface.js +2 -2
- package/build/esm/conversion/toMarketplace/convertInterface.js.map +1 -1
- package/build/esm/conversion/toMarketplace/convertInterfacePropertyType.js +66 -0
- package/build/esm/conversion/toMarketplace/convertInterfacePropertyType.js.map +1 -0
- package/build/esm/conversion/toMarketplace/convertLink.js +30 -4
- package/build/esm/conversion/toMarketplace/convertLink.js.map +1 -1
- package/build/esm/conversion/toMarketplace/convertMappingValue.js +35 -0
- package/build/esm/conversion/toMarketplace/convertMappingValue.js.map +1 -1
- package/build/esm/conversion/toMarketplace/convertObject.js +4 -2
- package/build/esm/conversion/toMarketplace/convertObject.js.map +1 -1
- package/build/esm/conversion/toMarketplace/convertObjectPropertyType.js +2 -1
- package/build/esm/conversion/toMarketplace/convertObjectPropertyType.js.map +1 -1
- package/build/esm/conversion/toMarketplace/convertSpt.js +4 -2
- package/build/esm/conversion/toMarketplace/convertSpt.js.map +1 -1
- package/build/esm/conversion/toMarketplace/propertyTypeTypeToOntologyIrInterfaceType.js +143 -0
- package/build/esm/conversion/toMarketplace/propertyTypeTypeToOntologyIrInterfaceType.js.map +1 -0
- package/build/esm/conversion/toMarketplace/propertyTypeTypeToOntologyIrType.js +4 -0
- package/build/esm/conversion/toMarketplace/propertyTypeTypeToOntologyIrType.js.map +1 -1
- package/build/esm/index.js.map +1 -1
- package/build/types/api/action/ActionParameter.d.ts +2 -1
- package/build/types/api/action/ActionParameter.d.ts.map +1 -1
- package/build/types/api/action/ActionParameterConfiguration.d.ts +2 -1
- package/build/types/api/action/ActionParameterConfiguration.d.ts.map +1 -1
- package/build/types/api/defineAction.d.ts +4 -3
- package/build/types/api/defineAction.d.ts.map +1 -1
- package/build/types/api/defineCreateInterfaceObjectAction.d.ts.map +1 -1
- package/build/types/api/defineInterface.d.ts +7 -5
- package/build/types/api/defineInterface.d.ts.map +1 -1
- package/build/types/api/defineModifyInterfaceObjectAction.d.ts.map +1 -1
- package/build/types/api/defineObject.d.ts.map +1 -1
- package/build/types/api/defineOntology.d.ts.map +1 -1
- package/build/types/api/defineSpt.d.ts +3 -0
- package/build/types/api/defineSpt.d.ts.map +1 -1
- package/build/types/api/defineValueType.d.ts +9 -0
- package/build/types/api/defineValueType.d.ts.map +1 -1
- package/build/types/api/interface/InterfacePropertyType.d.ts +12 -2
- package/build/types/api/interface/InterfacePropertyType.d.ts.map +1 -1
- package/build/types/api/interface/InterfaceType.d.ts +3 -2
- package/build/types/api/interface/InterfaceType.d.ts.map +1 -1
- package/build/types/api/interface/getFlattenedInterfaceProperties.d.ts +1 -1
- package/build/types/api/interface/getFlattenedInterfaceProperties.d.ts.map +1 -1
- package/build/types/api/links/LinkType.d.ts +16 -4
- package/build/types/api/links/LinkType.d.ts.map +1 -1
- package/build/types/api/object/ObjectType.d.ts +1 -0
- package/build/types/api/object/ObjectType.d.ts.map +1 -1
- package/build/types/api/object/ObjectTypeDefinition.d.ts +1 -0
- package/build/types/api/object/ObjectTypeDefinition.d.ts.map +1 -1
- package/build/types/api/object/ObjectTypeStatus.d.ts +1 -1
- package/build/types/api/object/ObjectTypeStatus.d.ts.map +1 -1
- package/build/types/api/properties/PropertyTypeType.d.ts +1 -0
- package/build/types/api/properties/PropertyTypeType.d.ts.map +1 -1
- package/build/types/api/properties/SharedPropertyType.d.ts +1 -0
- package/build/types/api/properties/SharedPropertyType.d.ts.map +1 -1
- package/build/types/conversion/toMarketplace/convertInterface.d.ts.map +1 -1
- package/build/types/conversion/toMarketplace/convertInterfacePropertyType.d.ts +3 -0
- package/build/types/conversion/toMarketplace/convertInterfacePropertyType.d.ts.map +1 -0
- package/build/types/conversion/toMarketplace/convertLink.d.ts +3 -2
- package/build/types/conversion/toMarketplace/convertLink.d.ts.map +1 -1
- package/build/types/conversion/toMarketplace/convertMappingValue.d.ts +2 -1
- package/build/types/conversion/toMarketplace/convertMappingValue.d.ts.map +1 -1
- package/build/types/conversion/toMarketplace/convertObject.d.ts.map +1 -1
- package/build/types/conversion/toMarketplace/convertSpt.d.ts +1 -1
- package/build/types/conversion/toMarketplace/convertSpt.d.ts.map +1 -1
- package/build/types/conversion/toMarketplace/propertyTypeTypeToOntologyIrInterfaceType.d.ts +3 -0
- package/build/types/conversion/toMarketplace/propertyTypeTypeToOntologyIrInterfaceType.d.ts.map +1 -0
- package/build/types/index.d.ts +1 -0
- package/build/types/index.d.ts.map +1 -1
- package/package.json +3 -3
|
@@ -51,121 +51,162 @@ describe("SPTs", () => {
|
|
|
51
51
|
}
|
|
52
52
|
});
|
|
53
53
|
expect(dumpOntologyFullMetadata().ontology).toMatchInlineSnapshot(`
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
54
|
+
{
|
|
55
|
+
"actionTypes": {},
|
|
56
|
+
"blockPermissionInformation": {
|
|
57
|
+
"actionTypes": {},
|
|
58
|
+
"linkTypes": {},
|
|
59
|
+
"objectTypes": {},
|
|
60
|
+
},
|
|
61
|
+
"interfaceTypes": {
|
|
62
|
+
"com.palantir.FooInterface": {
|
|
63
|
+
"interfaceType": {
|
|
64
|
+
"apiName": "com.palantir.FooInterface",
|
|
65
|
+
"displayMetadata": {
|
|
66
|
+
"description": "Foo Interface",
|
|
67
|
+
"displayName": "Foo Interface",
|
|
68
|
+
"icon": {
|
|
69
|
+
"blueprint": {
|
|
70
|
+
"color": "#00000",
|
|
71
|
+
"locator": "airplane",
|
|
72
|
+
},
|
|
73
|
+
"type": "blueprint",
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
"extendsInterfaces": [],
|
|
77
|
+
"links": [],
|
|
78
|
+
"properties": [],
|
|
79
|
+
"propertiesV2": {
|
|
80
|
+
"com.palantir.fooSpt": {
|
|
81
|
+
"required": true,
|
|
82
|
+
"sharedPropertyType": {
|
|
83
|
+
"aliases": [],
|
|
84
|
+
"apiName": "com.palantir.fooSpt",
|
|
85
|
+
"baseFormatter": undefined,
|
|
86
|
+
"dataConstraints": undefined,
|
|
87
|
+
"displayMetadata": {
|
|
88
|
+
"description": undefined,
|
|
89
|
+
"displayName": "fooSpt",
|
|
90
|
+
"visibility": "NORMAL",
|
|
91
|
+
},
|
|
92
|
+
"gothamMapping": undefined,
|
|
93
|
+
"indexedForSearch": true,
|
|
94
|
+
"type": {
|
|
95
|
+
"string": {
|
|
96
|
+
"analyzerOverride": undefined,
|
|
97
|
+
"enableAsciiFolding": undefined,
|
|
98
|
+
"isLongText": false,
|
|
99
|
+
"supportsEfficientLeadingWildcard": false,
|
|
100
|
+
"supportsExactMatching": true,
|
|
72
101
|
},
|
|
73
|
-
"type": "
|
|
102
|
+
"type": "string",
|
|
74
103
|
},
|
|
104
|
+
"typeClasses": [
|
|
105
|
+
{
|
|
106
|
+
"kind": "render_hint",
|
|
107
|
+
"name": "SELECTABLE",
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
"kind": "render_hint",
|
|
111
|
+
"name": "SORTABLE",
|
|
112
|
+
},
|
|
113
|
+
],
|
|
114
|
+
"valueType": undefined,
|
|
75
115
|
},
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
},
|
|
102
|
-
"type": "string",
|
|
116
|
+
},
|
|
117
|
+
},
|
|
118
|
+
"propertiesV3": {
|
|
119
|
+
"com.palantir.fooSpt": {
|
|
120
|
+
"sharedPropertyBasedPropertyType": {
|
|
121
|
+
"requireImplementation": true,
|
|
122
|
+
"sharedPropertyType": {
|
|
123
|
+
"aliases": [],
|
|
124
|
+
"apiName": "com.palantir.fooSpt",
|
|
125
|
+
"baseFormatter": undefined,
|
|
126
|
+
"dataConstraints": undefined,
|
|
127
|
+
"displayMetadata": {
|
|
128
|
+
"description": undefined,
|
|
129
|
+
"displayName": "fooSpt",
|
|
130
|
+
"visibility": "NORMAL",
|
|
131
|
+
},
|
|
132
|
+
"gothamMapping": undefined,
|
|
133
|
+
"indexedForSearch": true,
|
|
134
|
+
"type": {
|
|
135
|
+
"string": {
|
|
136
|
+
"analyzerOverride": undefined,
|
|
137
|
+
"enableAsciiFolding": undefined,
|
|
138
|
+
"isLongText": false,
|
|
139
|
+
"supportsEfficientLeadingWildcard": false,
|
|
140
|
+
"supportsExactMatching": true,
|
|
103
141
|
},
|
|
104
|
-
"
|
|
105
|
-
{
|
|
106
|
-
"kind": "render_hint",
|
|
107
|
-
"name": "SELECTABLE",
|
|
108
|
-
},
|
|
109
|
-
{
|
|
110
|
-
"kind": "render_hint",
|
|
111
|
-
"name": "SORTABLE",
|
|
112
|
-
},
|
|
113
|
-
],
|
|
114
|
-
"valueType": undefined,
|
|
142
|
+
"type": "string",
|
|
115
143
|
},
|
|
144
|
+
"typeClasses": [
|
|
145
|
+
{
|
|
146
|
+
"kind": "render_hint",
|
|
147
|
+
"name": "SELECTABLE",
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
"kind": "render_hint",
|
|
151
|
+
"name": "SORTABLE",
|
|
152
|
+
},
|
|
153
|
+
],
|
|
154
|
+
"valueType": undefined,
|
|
116
155
|
},
|
|
117
156
|
},
|
|
118
|
-
"
|
|
119
|
-
"searchable": true,
|
|
120
|
-
"status": {
|
|
121
|
-
"active": {},
|
|
122
|
-
"type": "active",
|
|
123
|
-
},
|
|
157
|
+
"type": "sharedPropertyBasedPropertyType",
|
|
124
158
|
},
|
|
125
159
|
},
|
|
160
|
+
"searchable": true,
|
|
161
|
+
"status": {
|
|
162
|
+
"active": {},
|
|
163
|
+
"type": "active",
|
|
164
|
+
},
|
|
126
165
|
},
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
},
|
|
153
|
-
"typeClasses": [
|
|
154
|
-
{
|
|
155
|
-
"kind": "render_hint",
|
|
156
|
-
"name": "SELECTABLE",
|
|
157
|
-
},
|
|
158
|
-
{
|
|
159
|
-
"kind": "render_hint",
|
|
160
|
-
"name": "SORTABLE",
|
|
161
|
-
},
|
|
162
|
-
],
|
|
163
|
-
"valueType": undefined,
|
|
166
|
+
},
|
|
167
|
+
},
|
|
168
|
+
"linkTypes": {},
|
|
169
|
+
"objectTypes": {},
|
|
170
|
+
"sharedPropertyTypes": {
|
|
171
|
+
"com.palantir.fooSpt": {
|
|
172
|
+
"sharedPropertyType": {
|
|
173
|
+
"aliases": [],
|
|
174
|
+
"apiName": "com.palantir.fooSpt",
|
|
175
|
+
"baseFormatter": undefined,
|
|
176
|
+
"dataConstraints": undefined,
|
|
177
|
+
"displayMetadata": {
|
|
178
|
+
"description": undefined,
|
|
179
|
+
"displayName": "fooSpt",
|
|
180
|
+
"visibility": "NORMAL",
|
|
181
|
+
},
|
|
182
|
+
"gothamMapping": undefined,
|
|
183
|
+
"indexedForSearch": true,
|
|
184
|
+
"type": {
|
|
185
|
+
"string": {
|
|
186
|
+
"analyzerOverride": undefined,
|
|
187
|
+
"enableAsciiFolding": undefined,
|
|
188
|
+
"isLongText": false,
|
|
189
|
+
"supportsEfficientLeadingWildcard": false,
|
|
190
|
+
"supportsExactMatching": true,
|
|
164
191
|
},
|
|
192
|
+
"type": "string",
|
|
165
193
|
},
|
|
194
|
+
"typeClasses": [
|
|
195
|
+
{
|
|
196
|
+
"kind": "render_hint",
|
|
197
|
+
"name": "SELECTABLE",
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
"kind": "render_hint",
|
|
201
|
+
"name": "SORTABLE",
|
|
202
|
+
},
|
|
203
|
+
],
|
|
204
|
+
"valueType": undefined,
|
|
166
205
|
},
|
|
167
|
-
}
|
|
168
|
-
|
|
206
|
+
},
|
|
207
|
+
},
|
|
208
|
+
}
|
|
209
|
+
`);
|
|
169
210
|
});
|
|
170
211
|
it("properly serializes both types of struct SPTs", () => {
|
|
171
212
|
defineSharedPropertyType({
|
|
@@ -332,7 +373,49 @@ describe("SPTs", () => {
|
|
|
332
373
|
},
|
|
333
374
|
},
|
|
334
375
|
},
|
|
335
|
-
"propertiesV3": {
|
|
376
|
+
"propertiesV3": {
|
|
377
|
+
"com.palantir.foo": {
|
|
378
|
+
"sharedPropertyBasedPropertyType": {
|
|
379
|
+
"requireImplementation": true,
|
|
380
|
+
"sharedPropertyType": {
|
|
381
|
+
"aliases": [],
|
|
382
|
+
"apiName": "com.palantir.foo",
|
|
383
|
+
"baseFormatter": undefined,
|
|
384
|
+
"dataConstraints": undefined,
|
|
385
|
+
"displayMetadata": {
|
|
386
|
+
"description": undefined,
|
|
387
|
+
"displayName": "foo",
|
|
388
|
+
"visibility": "NORMAL",
|
|
389
|
+
},
|
|
390
|
+
"gothamMapping": undefined,
|
|
391
|
+
"indexedForSearch": true,
|
|
392
|
+
"type": {
|
|
393
|
+
"string": {
|
|
394
|
+
"analyzerOverride": undefined,
|
|
395
|
+
"enableAsciiFolding": undefined,
|
|
396
|
+
"isLongText": true,
|
|
397
|
+
"supportsEfficientLeadingWildcard": true,
|
|
398
|
+
"supportsExactMatching": false,
|
|
399
|
+
"supportsFullTextRegex": undefined,
|
|
400
|
+
},
|
|
401
|
+
"type": "string",
|
|
402
|
+
},
|
|
403
|
+
"typeClasses": [
|
|
404
|
+
{
|
|
405
|
+
"kind": "render_hint",
|
|
406
|
+
"name": "SELECTABLE",
|
|
407
|
+
},
|
|
408
|
+
{
|
|
409
|
+
"kind": "render_hint",
|
|
410
|
+
"name": "SORTABLE",
|
|
411
|
+
},
|
|
412
|
+
],
|
|
413
|
+
"valueType": undefined,
|
|
414
|
+
},
|
|
415
|
+
},
|
|
416
|
+
"type": "sharedPropertyBasedPropertyType",
|
|
417
|
+
},
|
|
418
|
+
},
|
|
336
419
|
"searchable": true,
|
|
337
420
|
"status": {
|
|
338
421
|
"active": {},
|
|
@@ -571,5 +654,69 @@ describe("SPTs", () => {
|
|
|
571
654
|
}
|
|
572
655
|
`);
|
|
573
656
|
});
|
|
657
|
+
it("Aliases properly set", () => {
|
|
658
|
+
defineSharedPropertyType({
|
|
659
|
+
apiName: "foo",
|
|
660
|
+
type: {
|
|
661
|
+
type: "string"
|
|
662
|
+
},
|
|
663
|
+
aliases: ["alias1", "alias2"]
|
|
664
|
+
});
|
|
665
|
+
expect(dumpOntologyFullMetadata().ontology).toMatchInlineSnapshot(`
|
|
666
|
+
{
|
|
667
|
+
"actionTypes": {},
|
|
668
|
+
"blockPermissionInformation": {
|
|
669
|
+
"actionTypes": {},
|
|
670
|
+
"linkTypes": {},
|
|
671
|
+
"objectTypes": {},
|
|
672
|
+
},
|
|
673
|
+
"interfaceTypes": {},
|
|
674
|
+
"linkTypes": {},
|
|
675
|
+
"objectTypes": {},
|
|
676
|
+
"sharedPropertyTypes": {
|
|
677
|
+
"com.palantir.foo": {
|
|
678
|
+
"sharedPropertyType": {
|
|
679
|
+
"aliases": [
|
|
680
|
+
"alias1",
|
|
681
|
+
"alias2",
|
|
682
|
+
],
|
|
683
|
+
"apiName": "com.palantir.foo",
|
|
684
|
+
"baseFormatter": undefined,
|
|
685
|
+
"dataConstraints": undefined,
|
|
686
|
+
"displayMetadata": {
|
|
687
|
+
"description": undefined,
|
|
688
|
+
"displayName": "foo",
|
|
689
|
+
"visibility": "NORMAL",
|
|
690
|
+
},
|
|
691
|
+
"gothamMapping": undefined,
|
|
692
|
+
"indexedForSearch": true,
|
|
693
|
+
"type": {
|
|
694
|
+
"string": {
|
|
695
|
+
"analyzerOverride": undefined,
|
|
696
|
+
"enableAsciiFolding": undefined,
|
|
697
|
+
"isLongText": false,
|
|
698
|
+
"supportsEfficientLeadingWildcard": false,
|
|
699
|
+
"supportsExactMatching": true,
|
|
700
|
+
"supportsFullTextRegex": undefined,
|
|
701
|
+
},
|
|
702
|
+
"type": "string",
|
|
703
|
+
},
|
|
704
|
+
"typeClasses": [
|
|
705
|
+
{
|
|
706
|
+
"kind": "render_hint",
|
|
707
|
+
"name": "SELECTABLE",
|
|
708
|
+
},
|
|
709
|
+
{
|
|
710
|
+
"kind": "render_hint",
|
|
711
|
+
"name": "SORTABLE",
|
|
712
|
+
},
|
|
713
|
+
],
|
|
714
|
+
"valueType": undefined,
|
|
715
|
+
},
|
|
716
|
+
},
|
|
717
|
+
},
|
|
718
|
+
}
|
|
719
|
+
`);
|
|
720
|
+
});
|
|
574
721
|
});
|
|
575
722
|
//# sourceMappingURL=spt.test.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spt.test.js","names":["beforeEach","describe","expect","it","defineInterface","defineOntology","dumpOntologyFullMetadata","defineSharedPropertyType","apiName","type","toThrowErrorMatchingInlineSnapshot","fooSpt","displayName","properties","icon","color","locator","ontology","toMatchInlineSnapshot","structDefinition","fieldType","displayMetadata","description","undefined","spt","isLongText","supportsEfficientLeadingWildcard","supportsExactMatching","foo","precision","scale","baseFormatter","number","base","maximumFractionDigits"],"sources":["spt.test.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { beforeEach, describe, expect, it } from \"vitest\";\nimport { defineInterface } from \"../defineInterface.js\";\nimport { defineOntology, dumpOntologyFullMetadata } from \"../defineOntology.js\";\nimport { defineSharedPropertyType } from \"../defineSpt.js\";\ndescribe(\"SPTs\", () => {\n beforeEach(async () => {\n await defineOntology(\"com.palantir.\", () => {}, \"/tmp/\");\n });\n\n it(\"doesn't let you create the same spt twice\", () => {\n defineSharedPropertyType({\n apiName: \"foo\",\n type: \"string\",\n });\n\n expect(() => {\n defineSharedPropertyType({\n apiName: \"foo\",\n type: \"string\",\n });\n }).toThrowErrorMatchingInlineSnapshot(\n `[Error: Invariant failed: Shared property type com.palantir.foo already exists]`,\n );\n });\n\n it(\"uses a predefined spt\", () => {\n const fooSpt = defineSharedPropertyType({\n apiName: \"fooSpt\",\n type: \"string\",\n });\n\n const FooInterface = defineInterface({\n apiName: \"FooInterface\",\n displayName: \"Foo Interface\",\n properties: {\n fooSpt,\n },\n icon: { color: \"#00000\", locator: \"airplane\" },\n });\n\n expect(dumpOntologyFullMetadata().ontology).toMatchInlineSnapshot(`\n {\n \"actionTypes\": {},\n \"blockPermissionInformation\": {\n \"actionTypes\": {},\n \"linkTypes\": {},\n \"objectTypes\": {},\n },\n \"interfaceTypes\": {\n \"com.palantir.FooInterface\": {\n \"interfaceType\": {\n \"apiName\": \"com.palantir.FooInterface\",\n \"displayMetadata\": {\n \"description\": \"Foo Interface\",\n \"displayName\": \"Foo Interface\",\n \"icon\": {\n \"blueprint\": {\n \"color\": \"#00000\",\n \"locator\": \"airplane\",\n },\n \"type\": \"blueprint\",\n },\n },\n \"extendsInterfaces\": [],\n \"links\": [],\n \"properties\": [],\n \"propertiesV2\": {\n \"com.palantir.fooSpt\": {\n \"required\": true,\n \"sharedPropertyType\": {\n \"aliases\": [],\n \"apiName\": \"com.palantir.fooSpt\",\n \"baseFormatter\": undefined,\n \"dataConstraints\": undefined,\n \"displayMetadata\": {\n \"description\": undefined,\n \"displayName\": \"fooSpt\",\n \"visibility\": \"NORMAL\",\n },\n \"gothamMapping\": undefined,\n \"indexedForSearch\": true,\n \"type\": {\n \"string\": {\n \"analyzerOverride\": undefined,\n \"enableAsciiFolding\": undefined,\n \"isLongText\": false,\n \"supportsEfficientLeadingWildcard\": false,\n \"supportsExactMatching\": true,\n },\n \"type\": \"string\",\n },\n \"typeClasses\": [\n {\n \"kind\": \"render_hint\",\n \"name\": \"SELECTABLE\",\n },\n {\n \"kind\": \"render_hint\",\n \"name\": \"SORTABLE\",\n },\n ],\n \"valueType\": undefined,\n },\n },\n },\n \"propertiesV3\": {},\n \"searchable\": true,\n \"status\": {\n \"active\": {},\n \"type\": \"active\",\n },\n },\n },\n },\n \"linkTypes\": {},\n \"objectTypes\": {},\n \"sharedPropertyTypes\": {\n \"com.palantir.fooSpt\": {\n \"sharedPropertyType\": {\n \"aliases\": [],\n \"apiName\": \"com.palantir.fooSpt\",\n \"baseFormatter\": undefined,\n \"dataConstraints\": undefined,\n \"displayMetadata\": {\n \"description\": undefined,\n \"displayName\": \"fooSpt\",\n \"visibility\": \"NORMAL\",\n },\n \"gothamMapping\": undefined,\n \"indexedForSearch\": true,\n \"type\": {\n \"string\": {\n \"analyzerOverride\": undefined,\n \"enableAsciiFolding\": undefined,\n \"isLongText\": false,\n \"supportsEfficientLeadingWildcard\": false,\n \"supportsExactMatching\": true,\n },\n \"type\": \"string\",\n },\n \"typeClasses\": [\n {\n \"kind\": \"render_hint\",\n \"name\": \"SELECTABLE\",\n },\n {\n \"kind\": \"render_hint\",\n \"name\": \"SORTABLE\",\n },\n ],\n \"valueType\": undefined,\n },\n },\n },\n }\n `);\n });\n\n it(\"properly serializes both types of struct SPTs\", () => {\n const fooSpt = defineSharedPropertyType({\n apiName: \"fooSpt\",\n type: {\n type: \"struct\",\n structDefinition: {\n \"simpleProperty\": \"boolean\",\n \"complexProperty\": {\n fieldType: \"date\",\n displayMetadata: {\n displayName: \"complex property\",\n description: undefined,\n },\n },\n },\n },\n });\n\n expect(dumpOntologyFullMetadata().ontology).toMatchInlineSnapshot(`\n {\n \"actionTypes\": {},\n \"blockPermissionInformation\": {\n \"actionTypes\": {},\n \"linkTypes\": {},\n \"objectTypes\": {},\n },\n \"interfaceTypes\": {},\n \"linkTypes\": {},\n \"objectTypes\": {},\n \"sharedPropertyTypes\": {\n \"com.palantir.fooSpt\": {\n \"sharedPropertyType\": {\n \"aliases\": [],\n \"apiName\": \"com.palantir.fooSpt\",\n \"baseFormatter\": undefined,\n \"dataConstraints\": undefined,\n \"displayMetadata\": {\n \"description\": undefined,\n \"displayName\": \"fooSpt\",\n \"visibility\": \"NORMAL\",\n },\n \"gothamMapping\": undefined,\n \"indexedForSearch\": true,\n \"type\": {\n \"struct\": {\n \"structFields\": [\n {\n \"aliases\": [],\n \"apiName\": \"simpleProperty\",\n \"displayMetadata\": {\n \"description\": undefined,\n \"displayName\": \"simpleProperty\",\n },\n \"fieldType\": {\n \"boolean\": {},\n \"type\": \"boolean\",\n },\n \"typeClasses\": [],\n },\n {\n \"aliases\": [],\n \"apiName\": \"complexProperty\",\n \"displayMetadata\": {\n \"description\": undefined,\n \"displayName\": \"complex property\",\n },\n \"fieldType\": {\n \"date\": {},\n \"type\": \"date\",\n },\n \"typeClasses\": [],\n },\n ],\n },\n \"type\": \"struct\",\n },\n \"typeClasses\": [],\n \"valueType\": undefined,\n },\n },\n },\n }\n `);\n });\n\n it(\"Custom string fields properly set\", () => {\n const spt = defineSharedPropertyType({\n apiName: \"foo\",\n type: {\n type: \"string\",\n isLongText: true,\n supportsEfficientLeadingWildcard: true,\n supportsExactMatching: false,\n },\n });\n\n defineInterface({\n apiName: \"interface\",\n properties: { foo: spt },\n });\n\n expect(dumpOntologyFullMetadata().ontology).toMatchInlineSnapshot(`\n {\n \"actionTypes\": {},\n \"blockPermissionInformation\": {\n \"actionTypes\": {},\n \"linkTypes\": {},\n \"objectTypes\": {},\n },\n \"interfaceTypes\": {\n \"com.palantir.interface\": {\n \"interfaceType\": {\n \"apiName\": \"com.palantir.interface\",\n \"displayMetadata\": {\n \"description\": \"interface\",\n \"displayName\": \"interface\",\n \"icon\": {\n \"blueprint\": {\n \"color\": \"#4C90F0\",\n \"locator\": \"layout-hierarchy\",\n },\n \"type\": \"blueprint\",\n },\n },\n \"extendsInterfaces\": [],\n \"links\": [],\n \"properties\": [],\n \"propertiesV2\": {\n \"com.palantir.foo\": {\n \"required\": true,\n \"sharedPropertyType\": {\n \"aliases\": [],\n \"apiName\": \"com.palantir.foo\",\n \"baseFormatter\": undefined,\n \"dataConstraints\": undefined,\n \"displayMetadata\": {\n \"description\": undefined,\n \"displayName\": \"foo\",\n \"visibility\": \"NORMAL\",\n },\n \"gothamMapping\": undefined,\n \"indexedForSearch\": true,\n \"type\": {\n \"string\": {\n \"analyzerOverride\": undefined,\n \"enableAsciiFolding\": undefined,\n \"isLongText\": true,\n \"supportsEfficientLeadingWildcard\": true,\n \"supportsExactMatching\": false,\n \"supportsFullTextRegex\": undefined,\n },\n \"type\": \"string\",\n },\n \"typeClasses\": [\n {\n \"kind\": \"render_hint\",\n \"name\": \"SELECTABLE\",\n },\n {\n \"kind\": \"render_hint\",\n \"name\": \"SORTABLE\",\n },\n ],\n \"valueType\": undefined,\n },\n },\n },\n \"propertiesV3\": {},\n \"searchable\": true,\n \"status\": {\n \"active\": {},\n \"type\": \"active\",\n },\n },\n },\n },\n \"linkTypes\": {},\n \"objectTypes\": {},\n \"sharedPropertyTypes\": {\n \"com.palantir.foo\": {\n \"sharedPropertyType\": {\n \"aliases\": [],\n \"apiName\": \"com.palantir.foo\",\n \"baseFormatter\": undefined,\n \"dataConstraints\": undefined,\n \"displayMetadata\": {\n \"description\": undefined,\n \"displayName\": \"foo\",\n \"visibility\": \"NORMAL\",\n },\n \"gothamMapping\": undefined,\n \"indexedForSearch\": true,\n \"type\": {\n \"string\": {\n \"analyzerOverride\": undefined,\n \"enableAsciiFolding\": undefined,\n \"isLongText\": true,\n \"supportsEfficientLeadingWildcard\": true,\n \"supportsExactMatching\": false,\n \"supportsFullTextRegex\": undefined,\n },\n \"type\": \"string\",\n },\n \"typeClasses\": [\n {\n \"kind\": \"render_hint\",\n \"name\": \"SELECTABLE\",\n },\n {\n \"kind\": \"render_hint\",\n \"name\": \"SORTABLE\",\n },\n ],\n \"valueType\": undefined,\n },\n },\n },\n }\n `);\n });\n\n it(\"Custom decimal fields properly set\", () => {\n const spt1 = defineSharedPropertyType({\n apiName: \"precision\",\n type: {\n type: \"decimal\",\n precision: 10,\n },\n });\n const spt2 = defineSharedPropertyType({\n apiName: \"scale\",\n type: {\n type: \"decimal\",\n scale: 5,\n },\n });\n\n expect(dumpOntologyFullMetadata().ontology).toMatchInlineSnapshot(`\n {\n \"actionTypes\": {},\n \"blockPermissionInformation\": {\n \"actionTypes\": {},\n \"linkTypes\": {},\n \"objectTypes\": {},\n },\n \"interfaceTypes\": {},\n \"linkTypes\": {},\n \"objectTypes\": {},\n \"sharedPropertyTypes\": {\n \"com.palantir.precision\": {\n \"sharedPropertyType\": {\n \"aliases\": [],\n \"apiName\": \"com.palantir.precision\",\n \"baseFormatter\": undefined,\n \"dataConstraints\": undefined,\n \"displayMetadata\": {\n \"description\": undefined,\n \"displayName\": \"precision\",\n \"visibility\": \"NORMAL\",\n },\n \"gothamMapping\": undefined,\n \"indexedForSearch\": true,\n \"type\": {\n \"decimal\": {\n \"precision\": 10,\n \"scale\": undefined,\n },\n \"type\": \"decimal\",\n },\n \"typeClasses\": [\n {\n \"kind\": \"render_hint\",\n \"name\": \"SELECTABLE\",\n },\n {\n \"kind\": \"render_hint\",\n \"name\": \"SORTABLE\",\n },\n ],\n \"valueType\": undefined,\n },\n },\n \"com.palantir.scale\": {\n \"sharedPropertyType\": {\n \"aliases\": [],\n \"apiName\": \"com.palantir.scale\",\n \"baseFormatter\": undefined,\n \"dataConstraints\": undefined,\n \"displayMetadata\": {\n \"description\": undefined,\n \"displayName\": \"scale\",\n \"visibility\": \"NORMAL\",\n },\n \"gothamMapping\": undefined,\n \"indexedForSearch\": true,\n \"type\": {\n \"decimal\": {\n \"precision\": undefined,\n \"scale\": 5,\n },\n \"type\": \"decimal\",\n },\n \"typeClasses\": [\n {\n \"kind\": \"render_hint\",\n \"name\": \"SELECTABLE\",\n },\n {\n \"kind\": \"render_hint\",\n \"name\": \"SORTABLE\",\n },\n ],\n \"valueType\": undefined,\n },\n },\n },\n }\n `);\n });\n it(\"Number formatting works\", () => {\n const spt = defineSharedPropertyType({\n apiName: \"foo\",\n type: \"double\",\n baseFormatter: {\n type: \"number\",\n number: {\n type: \"base\",\n base: {\n maximumFractionDigits: 1,\n },\n },\n },\n });\n expect(dumpOntologyFullMetadata()).toMatchInlineSnapshot(`\n {\n \"importedOntology\": {\n \"actionTypes\": {},\n \"blockPermissionInformation\": {\n \"actionTypes\": {},\n \"linkTypes\": {},\n \"objectTypes\": {},\n },\n \"interfaceTypes\": {},\n \"linkTypes\": {},\n \"objectTypes\": {},\n \"sharedPropertyTypes\": {},\n },\n \"importedValueTypes\": {\n \"valueTypes\": [],\n },\n \"ontology\": {\n \"actionTypes\": {},\n \"blockPermissionInformation\": {\n \"actionTypes\": {},\n \"linkTypes\": {},\n \"objectTypes\": {},\n },\n \"interfaceTypes\": {},\n \"linkTypes\": {},\n \"objectTypes\": {},\n \"sharedPropertyTypes\": {\n \"com.palantir.foo\": {\n \"sharedPropertyType\": {\n \"aliases\": [],\n \"apiName\": \"com.palantir.foo\",\n \"baseFormatter\": {\n \"number\": {\n \"base\": {\n \"maximumFractionDigits\": 1,\n },\n \"type\": \"base\",\n },\n \"type\": \"number\",\n },\n \"dataConstraints\": undefined,\n \"displayMetadata\": {\n \"description\": undefined,\n \"displayName\": \"foo\",\n \"visibility\": \"NORMAL\",\n },\n \"gothamMapping\": undefined,\n \"indexedForSearch\": true,\n \"type\": {\n \"double\": {},\n \"type\": \"double\",\n },\n \"typeClasses\": [\n {\n \"kind\": \"render_hint\",\n \"name\": \"SELECTABLE\",\n },\n {\n \"kind\": \"render_hint\",\n \"name\": \"SORTABLE\",\n },\n ],\n \"valueType\": undefined,\n },\n },\n },\n },\n \"randomnessKey\": undefined,\n \"valueTypes\": {\n \"valueTypes\": [],\n },\n }\n `);\n });\n});\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,UAAU,EAAEC,QAAQ,EAAEC,MAAM,EAAEC,EAAE,QAAQ,QAAQ;AACzD,SAASC,eAAe,QAAQ,uBAAuB;AACvD,SAASC,cAAc,EAAEC,wBAAwB,QAAQ,sBAAsB;AAC/E,SAASC,wBAAwB,QAAQ,iBAAiB;AAC1DN,QAAQ,CAAC,MAAM,EAAE,MAAM;EACrBD,UAAU,CAAC,YAAY;IACrB,MAAMK,cAAc,CAAC,eAAe,EAAE,MAAM,CAAC,CAAC,EAAE,OAAO,CAAC;EAC1D,CAAC,CAAC;EAEFF,EAAE,CAAC,2CAA2C,EAAE,MAAM;IACpDI,wBAAwB,CAAC;MACvBC,OAAO,EAAE,KAAK;MACdC,IAAI,EAAE;IACR,CAAC,CAAC;IAEFP,MAAM,CAAC,MAAM;MACXK,wBAAwB,CAAC;QACvBC,OAAO,EAAE,KAAK;QACdC,IAAI,EAAE;MACR,CAAC,CAAC;IACJ,CAAC,CAAC,CAACC,kCAAkC,CACnC,iFACF,CAAC;EACH,CAAC,CAAC;EAEFP,EAAE,CAAC,uBAAuB,EAAE,MAAM;IAChC,MAAMQ,MAAM,GAAGJ,wBAAwB,CAAC;MACtCC,OAAO,EAAE,QAAQ;MACjBC,IAAI,EAAE;IACR,CAAC,CAAC;IAEmBL,eAAe,CAAC;MACnCI,OAAO,EAAE,cAAc;MACvBI,WAAW,EAAE,eAAe;MAC5BC,UAAU,EAAE;QACVF;MACF,CAAC;MACDG,IAAI,EAAE;QAAEC,KAAK,EAAE,QAAQ;QAAEC,OAAO,EAAE;MAAW;IAC/C,CAAC,CAAC;IAEFd,MAAM,CAACI,wBAAwB,CAAC,CAAC,CAACW,QAAQ,CAAC,CAACC,qBAAqB,CAAC;AACtE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,CAAC;EACR,CAAC,CAAC;EAEFf,EAAE,CAAC,+CAA+C,EAAE,MAAM;IACzCI,wBAAwB,CAAC;MACtCC,OAAO,EAAE,QAAQ;MACjBC,IAAI,EAAE;QACJA,IAAI,EAAE,QAAQ;QACdU,gBAAgB,EAAE;UAChB,gBAAgB,EAAE,SAAS;UAC3B,iBAAiB,EAAE;YACjBC,SAAS,EAAE,MAAM;YACjBC,eAAe,EAAE;cACfT,WAAW,EAAE,kBAAkB;cAC/BU,WAAW,EAAEC;YACf;UACF;QACF;MACF;IACF,CAAC,CAAC;IAEFrB,MAAM,CAACI,wBAAwB,CAAC,CAAC,CAACW,QAAQ,CAAC,CAACC,qBAAqB,CAAC;AACtE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,CAAC;EACV,CAAC,CAAC;EAEFf,EAAE,CAAC,mCAAmC,EAAE,MAAM;IAC5C,MAAMqB,GAAG,GAAGjB,wBAAwB,CAAC;MACnCC,OAAO,EAAE,KAAK;MACdC,IAAI,EAAE;QACJA,IAAI,EAAE,QAAQ;QACdgB,UAAU,EAAE,IAAI;QAChBC,gCAAgC,EAAE,IAAI;QACtCC,qBAAqB,EAAE;MACzB;IACF,CAAC,CAAC;IAEFvB,eAAe,CAAC;MACdI,OAAO,EAAE,WAAW;MACpBK,UAAU,EAAE;QAAEe,GAAG,EAAEJ;MAAI;IACzB,CAAC,CAAC;IAEFtB,MAAM,CAACI,wBAAwB,CAAC,CAAC,CAACW,QAAQ,CAAC,CAACC,qBAAqB,CAAC;AACtE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK,CAAC;EACJ,CAAC,CAAC;EAEFf,EAAE,CAAC,oCAAoC,EAAE,MAAM;IAChCI,wBAAwB,CAAC;MACpCC,OAAO,EAAE,WAAW;MACpBC,IAAI,EAAE;QACJA,IAAI,EAAE,SAAS;QACfoB,SAAS,EAAE;MACb;IACF,CAAC,CAAC;IACWtB,wBAAwB,CAAC;MACpCC,OAAO,EAAE,OAAO;MAChBC,IAAI,EAAE;QACJA,IAAI,EAAE,SAAS;QACfqB,KAAK,EAAE;MACT;IACF,CAAC,CAAC;IAEF5B,MAAM,CAACI,wBAAwB,CAAC,CAAC,CAACW,QAAQ,CAAC,CAACC,qBAAqB,CAAC;AACtE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK,CAAC;EACJ,CAAC,CAAC;EACFf,EAAE,CAAC,yBAAyB,EAAE,MAAM;IACtBI,wBAAwB,CAAC;MACnCC,OAAO,EAAE,KAAK;MACdC,IAAI,EAAE,QAAQ;MACdsB,aAAa,EAAE;QACbtB,IAAI,EAAE,QAAQ;QACduB,MAAM,EAAE;UACNvB,IAAI,EAAE,MAAM;UACZwB,IAAI,EAAE;YACJC,qBAAqB,EAAE;UACzB;QACF;MACF;IACF,CAAC,CAAC;IACFhC,MAAM,CAACI,wBAAwB,CAAC,CAAC,CAAC,CAACY,qBAAqB,CAAC;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK,CAAC;EACJ,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"spt.test.js","names":["beforeEach","describe","expect","it","defineInterface","defineOntology","dumpOntologyFullMetadata","defineSharedPropertyType","apiName","type","toThrowErrorMatchingInlineSnapshot","fooSpt","displayName","properties","icon","color","locator","ontology","toMatchInlineSnapshot","structDefinition","fieldType","displayMetadata","description","undefined","spt","isLongText","supportsEfficientLeadingWildcard","supportsExactMatching","foo","precision","scale","baseFormatter","number","base","maximumFractionDigits","aliases"],"sources":["spt.test.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { beforeEach, describe, expect, it } from \"vitest\";\nimport { defineInterface } from \"../defineInterface.js\";\nimport { defineOntology, dumpOntologyFullMetadata } from \"../defineOntology.js\";\nimport { defineSharedPropertyType } from \"../defineSpt.js\";\ndescribe(\"SPTs\", () => {\n beforeEach(async () => {\n await defineOntology(\"com.palantir.\", () => {}, \"/tmp/\");\n });\n\n it(\"doesn't let you create the same spt twice\", () => {\n defineSharedPropertyType({\n apiName: \"foo\",\n type: \"string\",\n });\n\n expect(() => {\n defineSharedPropertyType({\n apiName: \"foo\",\n type: \"string\",\n });\n }).toThrowErrorMatchingInlineSnapshot(\n `[Error: Invariant failed: Shared property type com.palantir.foo already exists]`,\n );\n });\n\n it(\"uses a predefined spt\", () => {\n const fooSpt = defineSharedPropertyType({\n apiName: \"fooSpt\",\n type: \"string\",\n });\n\n const FooInterface = defineInterface({\n apiName: \"FooInterface\",\n displayName: \"Foo Interface\",\n properties: {\n fooSpt,\n },\n icon: { color: \"#00000\", locator: \"airplane\" },\n });\n\n expect(dumpOntologyFullMetadata().ontology).toMatchInlineSnapshot(`\n {\n \"actionTypes\": {},\n \"blockPermissionInformation\": {\n \"actionTypes\": {},\n \"linkTypes\": {},\n \"objectTypes\": {},\n },\n \"interfaceTypes\": {\n \"com.palantir.FooInterface\": {\n \"interfaceType\": {\n \"apiName\": \"com.palantir.FooInterface\",\n \"displayMetadata\": {\n \"description\": \"Foo Interface\",\n \"displayName\": \"Foo Interface\",\n \"icon\": {\n \"blueprint\": {\n \"color\": \"#00000\",\n \"locator\": \"airplane\",\n },\n \"type\": \"blueprint\",\n },\n },\n \"extendsInterfaces\": [],\n \"links\": [],\n \"properties\": [],\n \"propertiesV2\": {\n \"com.palantir.fooSpt\": {\n \"required\": true,\n \"sharedPropertyType\": {\n \"aliases\": [],\n \"apiName\": \"com.palantir.fooSpt\",\n \"baseFormatter\": undefined,\n \"dataConstraints\": undefined,\n \"displayMetadata\": {\n \"description\": undefined,\n \"displayName\": \"fooSpt\",\n \"visibility\": \"NORMAL\",\n },\n \"gothamMapping\": undefined,\n \"indexedForSearch\": true,\n \"type\": {\n \"string\": {\n \"analyzerOverride\": undefined,\n \"enableAsciiFolding\": undefined,\n \"isLongText\": false,\n \"supportsEfficientLeadingWildcard\": false,\n \"supportsExactMatching\": true,\n },\n \"type\": \"string\",\n },\n \"typeClasses\": [\n {\n \"kind\": \"render_hint\",\n \"name\": \"SELECTABLE\",\n },\n {\n \"kind\": \"render_hint\",\n \"name\": \"SORTABLE\",\n },\n ],\n \"valueType\": undefined,\n },\n },\n },\n \"propertiesV3\": {\n \"com.palantir.fooSpt\": {\n \"sharedPropertyBasedPropertyType\": {\n \"requireImplementation\": true,\n \"sharedPropertyType\": {\n \"aliases\": [],\n \"apiName\": \"com.palantir.fooSpt\",\n \"baseFormatter\": undefined,\n \"dataConstraints\": undefined,\n \"displayMetadata\": {\n \"description\": undefined,\n \"displayName\": \"fooSpt\",\n \"visibility\": \"NORMAL\",\n },\n \"gothamMapping\": undefined,\n \"indexedForSearch\": true,\n \"type\": {\n \"string\": {\n \"analyzerOverride\": undefined,\n \"enableAsciiFolding\": undefined,\n \"isLongText\": false,\n \"supportsEfficientLeadingWildcard\": false,\n \"supportsExactMatching\": true,\n },\n \"type\": \"string\",\n },\n \"typeClasses\": [\n {\n \"kind\": \"render_hint\",\n \"name\": \"SELECTABLE\",\n },\n {\n \"kind\": \"render_hint\",\n \"name\": \"SORTABLE\",\n },\n ],\n \"valueType\": undefined,\n },\n },\n \"type\": \"sharedPropertyBasedPropertyType\",\n },\n },\n \"searchable\": true,\n \"status\": {\n \"active\": {},\n \"type\": \"active\",\n },\n },\n },\n },\n \"linkTypes\": {},\n \"objectTypes\": {},\n \"sharedPropertyTypes\": {\n \"com.palantir.fooSpt\": {\n \"sharedPropertyType\": {\n \"aliases\": [],\n \"apiName\": \"com.palantir.fooSpt\",\n \"baseFormatter\": undefined,\n \"dataConstraints\": undefined,\n \"displayMetadata\": {\n \"description\": undefined,\n \"displayName\": \"fooSpt\",\n \"visibility\": \"NORMAL\",\n },\n \"gothamMapping\": undefined,\n \"indexedForSearch\": true,\n \"type\": {\n \"string\": {\n \"analyzerOverride\": undefined,\n \"enableAsciiFolding\": undefined,\n \"isLongText\": false,\n \"supportsEfficientLeadingWildcard\": false,\n \"supportsExactMatching\": true,\n },\n \"type\": \"string\",\n },\n \"typeClasses\": [\n {\n \"kind\": \"render_hint\",\n \"name\": \"SELECTABLE\",\n },\n {\n \"kind\": \"render_hint\",\n \"name\": \"SORTABLE\",\n },\n ],\n \"valueType\": undefined,\n },\n },\n },\n }\n `);\n });\n\n it(\"properly serializes both types of struct SPTs\", () => {\n const fooSpt = defineSharedPropertyType({\n apiName: \"fooSpt\",\n type: {\n type: \"struct\",\n structDefinition: {\n \"simpleProperty\": \"boolean\",\n \"complexProperty\": {\n fieldType: \"date\",\n displayMetadata: {\n displayName: \"complex property\",\n description: undefined,\n },\n },\n },\n },\n });\n\n expect(dumpOntologyFullMetadata().ontology).toMatchInlineSnapshot(`\n {\n \"actionTypes\": {},\n \"blockPermissionInformation\": {\n \"actionTypes\": {},\n \"linkTypes\": {},\n \"objectTypes\": {},\n },\n \"interfaceTypes\": {},\n \"linkTypes\": {},\n \"objectTypes\": {},\n \"sharedPropertyTypes\": {\n \"com.palantir.fooSpt\": {\n \"sharedPropertyType\": {\n \"aliases\": [],\n \"apiName\": \"com.palantir.fooSpt\",\n \"baseFormatter\": undefined,\n \"dataConstraints\": undefined,\n \"displayMetadata\": {\n \"description\": undefined,\n \"displayName\": \"fooSpt\",\n \"visibility\": \"NORMAL\",\n },\n \"gothamMapping\": undefined,\n \"indexedForSearch\": true,\n \"type\": {\n \"struct\": {\n \"structFields\": [\n {\n \"aliases\": [],\n \"apiName\": \"simpleProperty\",\n \"displayMetadata\": {\n \"description\": undefined,\n \"displayName\": \"simpleProperty\",\n },\n \"fieldType\": {\n \"boolean\": {},\n \"type\": \"boolean\",\n },\n \"typeClasses\": [],\n },\n {\n \"aliases\": [],\n \"apiName\": \"complexProperty\",\n \"displayMetadata\": {\n \"description\": undefined,\n \"displayName\": \"complex property\",\n },\n \"fieldType\": {\n \"date\": {},\n \"type\": \"date\",\n },\n \"typeClasses\": [],\n },\n ],\n },\n \"type\": \"struct\",\n },\n \"typeClasses\": [],\n \"valueType\": undefined,\n },\n },\n },\n }\n `);\n });\n\n it(\"Custom string fields properly set\", () => {\n const spt = defineSharedPropertyType({\n apiName: \"foo\",\n type: {\n type: \"string\",\n isLongText: true,\n supportsEfficientLeadingWildcard: true,\n supportsExactMatching: false,\n },\n });\n\n defineInterface({\n apiName: \"interface\",\n properties: { foo: spt },\n });\n\n expect(dumpOntologyFullMetadata().ontology).toMatchInlineSnapshot(`\n {\n \"actionTypes\": {},\n \"blockPermissionInformation\": {\n \"actionTypes\": {},\n \"linkTypes\": {},\n \"objectTypes\": {},\n },\n \"interfaceTypes\": {\n \"com.palantir.interface\": {\n \"interfaceType\": {\n \"apiName\": \"com.palantir.interface\",\n \"displayMetadata\": {\n \"description\": \"interface\",\n \"displayName\": \"interface\",\n \"icon\": {\n \"blueprint\": {\n \"color\": \"#4C90F0\",\n \"locator\": \"layout-hierarchy\",\n },\n \"type\": \"blueprint\",\n },\n },\n \"extendsInterfaces\": [],\n \"links\": [],\n \"properties\": [],\n \"propertiesV2\": {\n \"com.palantir.foo\": {\n \"required\": true,\n \"sharedPropertyType\": {\n \"aliases\": [],\n \"apiName\": \"com.palantir.foo\",\n \"baseFormatter\": undefined,\n \"dataConstraints\": undefined,\n \"displayMetadata\": {\n \"description\": undefined,\n \"displayName\": \"foo\",\n \"visibility\": \"NORMAL\",\n },\n \"gothamMapping\": undefined,\n \"indexedForSearch\": true,\n \"type\": {\n \"string\": {\n \"analyzerOverride\": undefined,\n \"enableAsciiFolding\": undefined,\n \"isLongText\": true,\n \"supportsEfficientLeadingWildcard\": true,\n \"supportsExactMatching\": false,\n \"supportsFullTextRegex\": undefined,\n },\n \"type\": \"string\",\n },\n \"typeClasses\": [\n {\n \"kind\": \"render_hint\",\n \"name\": \"SELECTABLE\",\n },\n {\n \"kind\": \"render_hint\",\n \"name\": \"SORTABLE\",\n },\n ],\n \"valueType\": undefined,\n },\n },\n },\n \"propertiesV3\": {\n \"com.palantir.foo\": {\n \"sharedPropertyBasedPropertyType\": {\n \"requireImplementation\": true,\n \"sharedPropertyType\": {\n \"aliases\": [],\n \"apiName\": \"com.palantir.foo\",\n \"baseFormatter\": undefined,\n \"dataConstraints\": undefined,\n \"displayMetadata\": {\n \"description\": undefined,\n \"displayName\": \"foo\",\n \"visibility\": \"NORMAL\",\n },\n \"gothamMapping\": undefined,\n \"indexedForSearch\": true,\n \"type\": {\n \"string\": {\n \"analyzerOverride\": undefined,\n \"enableAsciiFolding\": undefined,\n \"isLongText\": true,\n \"supportsEfficientLeadingWildcard\": true,\n \"supportsExactMatching\": false,\n \"supportsFullTextRegex\": undefined,\n },\n \"type\": \"string\",\n },\n \"typeClasses\": [\n {\n \"kind\": \"render_hint\",\n \"name\": \"SELECTABLE\",\n },\n {\n \"kind\": \"render_hint\",\n \"name\": \"SORTABLE\",\n },\n ],\n \"valueType\": undefined,\n },\n },\n \"type\": \"sharedPropertyBasedPropertyType\",\n },\n },\n \"searchable\": true,\n \"status\": {\n \"active\": {},\n \"type\": \"active\",\n },\n },\n },\n },\n \"linkTypes\": {},\n \"objectTypes\": {},\n \"sharedPropertyTypes\": {\n \"com.palantir.foo\": {\n \"sharedPropertyType\": {\n \"aliases\": [],\n \"apiName\": \"com.palantir.foo\",\n \"baseFormatter\": undefined,\n \"dataConstraints\": undefined,\n \"displayMetadata\": {\n \"description\": undefined,\n \"displayName\": \"foo\",\n \"visibility\": \"NORMAL\",\n },\n \"gothamMapping\": undefined,\n \"indexedForSearch\": true,\n \"type\": {\n \"string\": {\n \"analyzerOverride\": undefined,\n \"enableAsciiFolding\": undefined,\n \"isLongText\": true,\n \"supportsEfficientLeadingWildcard\": true,\n \"supportsExactMatching\": false,\n \"supportsFullTextRegex\": undefined,\n },\n \"type\": \"string\",\n },\n \"typeClasses\": [\n {\n \"kind\": \"render_hint\",\n \"name\": \"SELECTABLE\",\n },\n {\n \"kind\": \"render_hint\",\n \"name\": \"SORTABLE\",\n },\n ],\n \"valueType\": undefined,\n },\n },\n },\n }\n `);\n });\n\n it(\"Custom decimal fields properly set\", () => {\n const spt1 = defineSharedPropertyType({\n apiName: \"precision\",\n type: {\n type: \"decimal\",\n precision: 10,\n },\n });\n const spt2 = defineSharedPropertyType({\n apiName: \"scale\",\n type: {\n type: \"decimal\",\n scale: 5,\n },\n });\n\n expect(dumpOntologyFullMetadata().ontology).toMatchInlineSnapshot(`\n {\n \"actionTypes\": {},\n \"blockPermissionInformation\": {\n \"actionTypes\": {},\n \"linkTypes\": {},\n \"objectTypes\": {},\n },\n \"interfaceTypes\": {},\n \"linkTypes\": {},\n \"objectTypes\": {},\n \"sharedPropertyTypes\": {\n \"com.palantir.precision\": {\n \"sharedPropertyType\": {\n \"aliases\": [],\n \"apiName\": \"com.palantir.precision\",\n \"baseFormatter\": undefined,\n \"dataConstraints\": undefined,\n \"displayMetadata\": {\n \"description\": undefined,\n \"displayName\": \"precision\",\n \"visibility\": \"NORMAL\",\n },\n \"gothamMapping\": undefined,\n \"indexedForSearch\": true,\n \"type\": {\n \"decimal\": {\n \"precision\": 10,\n \"scale\": undefined,\n },\n \"type\": \"decimal\",\n },\n \"typeClasses\": [\n {\n \"kind\": \"render_hint\",\n \"name\": \"SELECTABLE\",\n },\n {\n \"kind\": \"render_hint\",\n \"name\": \"SORTABLE\",\n },\n ],\n \"valueType\": undefined,\n },\n },\n \"com.palantir.scale\": {\n \"sharedPropertyType\": {\n \"aliases\": [],\n \"apiName\": \"com.palantir.scale\",\n \"baseFormatter\": undefined,\n \"dataConstraints\": undefined,\n \"displayMetadata\": {\n \"description\": undefined,\n \"displayName\": \"scale\",\n \"visibility\": \"NORMAL\",\n },\n \"gothamMapping\": undefined,\n \"indexedForSearch\": true,\n \"type\": {\n \"decimal\": {\n \"precision\": undefined,\n \"scale\": 5,\n },\n \"type\": \"decimal\",\n },\n \"typeClasses\": [\n {\n \"kind\": \"render_hint\",\n \"name\": \"SELECTABLE\",\n },\n {\n \"kind\": \"render_hint\",\n \"name\": \"SORTABLE\",\n },\n ],\n \"valueType\": undefined,\n },\n },\n },\n }\n `);\n });\n it(\"Number formatting works\", () => {\n const spt = defineSharedPropertyType({\n apiName: \"foo\",\n type: \"double\",\n baseFormatter: {\n type: \"number\",\n number: {\n type: \"base\",\n base: {\n maximumFractionDigits: 1,\n },\n },\n },\n });\n expect(dumpOntologyFullMetadata()).toMatchInlineSnapshot(`\n {\n \"importedOntology\": {\n \"actionTypes\": {},\n \"blockPermissionInformation\": {\n \"actionTypes\": {},\n \"linkTypes\": {},\n \"objectTypes\": {},\n },\n \"interfaceTypes\": {},\n \"linkTypes\": {},\n \"objectTypes\": {},\n \"sharedPropertyTypes\": {},\n },\n \"importedValueTypes\": {\n \"valueTypes\": [],\n },\n \"ontology\": {\n \"actionTypes\": {},\n \"blockPermissionInformation\": {\n \"actionTypes\": {},\n \"linkTypes\": {},\n \"objectTypes\": {},\n },\n \"interfaceTypes\": {},\n \"linkTypes\": {},\n \"objectTypes\": {},\n \"sharedPropertyTypes\": {\n \"com.palantir.foo\": {\n \"sharedPropertyType\": {\n \"aliases\": [],\n \"apiName\": \"com.palantir.foo\",\n \"baseFormatter\": {\n \"number\": {\n \"base\": {\n \"maximumFractionDigits\": 1,\n },\n \"type\": \"base\",\n },\n \"type\": \"number\",\n },\n \"dataConstraints\": undefined,\n \"displayMetadata\": {\n \"description\": undefined,\n \"displayName\": \"foo\",\n \"visibility\": \"NORMAL\",\n },\n \"gothamMapping\": undefined,\n \"indexedForSearch\": true,\n \"type\": {\n \"double\": {},\n \"type\": \"double\",\n },\n \"typeClasses\": [\n {\n \"kind\": \"render_hint\",\n \"name\": \"SELECTABLE\",\n },\n {\n \"kind\": \"render_hint\",\n \"name\": \"SORTABLE\",\n },\n ],\n \"valueType\": undefined,\n },\n },\n },\n },\n \"randomnessKey\": undefined,\n \"valueTypes\": {\n \"valueTypes\": [],\n },\n }\n `);\n });\n it(\"Aliases properly set\", () => {\n const spt = defineSharedPropertyType({\n apiName: \"foo\",\n type: { type: \"string\" },\n aliases: [\"alias1\", \"alias2\"],\n });\n expect(dumpOntologyFullMetadata().ontology).toMatchInlineSnapshot(`\n {\n \"actionTypes\": {},\n \"blockPermissionInformation\": {\n \"actionTypes\": {},\n \"linkTypes\": {},\n \"objectTypes\": {},\n },\n \"interfaceTypes\": {},\n \"linkTypes\": {},\n \"objectTypes\": {},\n \"sharedPropertyTypes\": {\n \"com.palantir.foo\": {\n \"sharedPropertyType\": {\n \"aliases\": [\n \"alias1\",\n \"alias2\",\n ],\n \"apiName\": \"com.palantir.foo\",\n \"baseFormatter\": undefined,\n \"dataConstraints\": undefined,\n \"displayMetadata\": {\n \"description\": undefined,\n \"displayName\": \"foo\",\n \"visibility\": \"NORMAL\",\n },\n \"gothamMapping\": undefined,\n \"indexedForSearch\": true,\n \"type\": {\n \"string\": {\n \"analyzerOverride\": undefined,\n \"enableAsciiFolding\": undefined,\n \"isLongText\": false,\n \"supportsEfficientLeadingWildcard\": false,\n \"supportsExactMatching\": true,\n \"supportsFullTextRegex\": undefined,\n },\n \"type\": \"string\",\n },\n \"typeClasses\": [\n {\n \"kind\": \"render_hint\",\n \"name\": \"SELECTABLE\",\n },\n {\n \"kind\": \"render_hint\",\n \"name\": \"SORTABLE\",\n },\n ],\n \"valueType\": undefined,\n },\n },\n },\n }\n `);\n });\n});\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,UAAU,EAAEC,QAAQ,EAAEC,MAAM,EAAEC,EAAE,QAAQ,QAAQ;AACzD,SAASC,eAAe,QAAQ,uBAAuB;AACvD,SAASC,cAAc,EAAEC,wBAAwB,QAAQ,sBAAsB;AAC/E,SAASC,wBAAwB,QAAQ,iBAAiB;AAC1DN,QAAQ,CAAC,MAAM,EAAE,MAAM;EACrBD,UAAU,CAAC,YAAY;IACrB,MAAMK,cAAc,CAAC,eAAe,EAAE,MAAM,CAAC,CAAC,EAAE,OAAO,CAAC;EAC1D,CAAC,CAAC;EAEFF,EAAE,CAAC,2CAA2C,EAAE,MAAM;IACpDI,wBAAwB,CAAC;MACvBC,OAAO,EAAE,KAAK;MACdC,IAAI,EAAE;IACR,CAAC,CAAC;IAEFP,MAAM,CAAC,MAAM;MACXK,wBAAwB,CAAC;QACvBC,OAAO,EAAE,KAAK;QACdC,IAAI,EAAE;MACR,CAAC,CAAC;IACJ,CAAC,CAAC,CAACC,kCAAkC,CACnC,iFACF,CAAC;EACH,CAAC,CAAC;EAEFP,EAAE,CAAC,uBAAuB,EAAE,MAAM;IAChC,MAAMQ,MAAM,GAAGJ,wBAAwB,CAAC;MACtCC,OAAO,EAAE,QAAQ;MACjBC,IAAI,EAAE;IACR,CAAC,CAAC;IAEmBL,eAAe,CAAC;MACnCI,OAAO,EAAE,cAAc;MACvBI,WAAW,EAAE,eAAe;MAC5BC,UAAU,EAAE;QACVF;MACF,CAAC;MACDG,IAAI,EAAE;QAAEC,KAAK,EAAE,QAAQ;QAAEC,OAAO,EAAE;MAAW;IAC/C,CAAC,CAAC;IAEFd,MAAM,CAACI,wBAAwB,CAAC,CAAC,CAACW,QAAQ,CAAC,CAACC,qBAAqB,CAAC;AACtE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK,CAAC;EACJ,CAAC,CAAC;EAEFf,EAAE,CAAC,+CAA+C,EAAE,MAAM;IACzCI,wBAAwB,CAAC;MACtCC,OAAO,EAAE,QAAQ;MACjBC,IAAI,EAAE;QACJA,IAAI,EAAE,QAAQ;QACdU,gBAAgB,EAAE;UAChB,gBAAgB,EAAE,SAAS;UAC3B,iBAAiB,EAAE;YACjBC,SAAS,EAAE,MAAM;YACjBC,eAAe,EAAE;cACfT,WAAW,EAAE,kBAAkB;cAC/BU,WAAW,EAAEC;YACf;UACF;QACF;MACF;IACF,CAAC,CAAC;IAEFrB,MAAM,CAACI,wBAAwB,CAAC,CAAC,CAACW,QAAQ,CAAC,CAACC,qBAAqB,CAAC;AACtE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,CAAC;EACV,CAAC,CAAC;EAEFf,EAAE,CAAC,mCAAmC,EAAE,MAAM;IAC5C,MAAMqB,GAAG,GAAGjB,wBAAwB,CAAC;MACnCC,OAAO,EAAE,KAAK;MACdC,IAAI,EAAE;QACJA,IAAI,EAAE,QAAQ;QACdgB,UAAU,EAAE,IAAI;QAChBC,gCAAgC,EAAE,IAAI;QACtCC,qBAAqB,EAAE;MACzB;IACF,CAAC,CAAC;IAEFvB,eAAe,CAAC;MACdI,OAAO,EAAE,WAAW;MACpBK,UAAU,EAAE;QAAEe,GAAG,EAAEJ;MAAI;IACzB,CAAC,CAAC;IAEFtB,MAAM,CAACI,wBAAwB,CAAC,CAAC,CAACW,QAAQ,CAAC,CAACC,qBAAqB,CAAC;AACtE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK,CAAC;EACJ,CAAC,CAAC;EAEFf,EAAE,CAAC,oCAAoC,EAAE,MAAM;IAChCI,wBAAwB,CAAC;MACpCC,OAAO,EAAE,WAAW;MACpBC,IAAI,EAAE;QACJA,IAAI,EAAE,SAAS;QACfoB,SAAS,EAAE;MACb;IACF,CAAC,CAAC;IACWtB,wBAAwB,CAAC;MACpCC,OAAO,EAAE,OAAO;MAChBC,IAAI,EAAE;QACJA,IAAI,EAAE,SAAS;QACfqB,KAAK,EAAE;MACT;IACF,CAAC,CAAC;IAEF5B,MAAM,CAACI,wBAAwB,CAAC,CAAC,CAACW,QAAQ,CAAC,CAACC,qBAAqB,CAAC;AACtE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK,CAAC;EACJ,CAAC,CAAC;EACFf,EAAE,CAAC,yBAAyB,EAAE,MAAM;IACtBI,wBAAwB,CAAC;MACnCC,OAAO,EAAE,KAAK;MACdC,IAAI,EAAE,QAAQ;MACdsB,aAAa,EAAE;QACbtB,IAAI,EAAE,QAAQ;QACduB,MAAM,EAAE;UACNvB,IAAI,EAAE,MAAM;UACZwB,IAAI,EAAE;YACJC,qBAAqB,EAAE;UACzB;QACF;MACF;IACF,CAAC,CAAC;IACFhC,MAAM,CAACI,wBAAwB,CAAC,CAAC,CAAC,CAACY,qBAAqB,CAAC;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK,CAAC;EACJ,CAAC,CAAC;EACFf,EAAE,CAAC,sBAAsB,EAAE,MAAM;IACnBI,wBAAwB,CAAC;MACnCC,OAAO,EAAE,KAAK;MACdC,IAAI,EAAE;QAAEA,IAAI,EAAE;MAAS,CAAC;MACxB0B,OAAO,EAAE,CAAC,QAAQ,EAAE,QAAQ;IAC9B,CAAC,CAAC;IACFjC,MAAM,CAACI,wBAAwB,CAAC,CAAC,CAACW,QAAQ,CAAC,CAACC,qBAAqB,CAAC;AACtE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK,CAAC;EACJ,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
|
|
@@ -152,5 +152,74 @@ describe("Value Types", () => {
|
|
|
152
152
|
}
|
|
153
153
|
`);
|
|
154
154
|
});
|
|
155
|
+
it("Correctly sets a status", () => {
|
|
156
|
+
defineValueType({
|
|
157
|
+
apiName: "apiName",
|
|
158
|
+
displayName: "displayName",
|
|
159
|
+
type: {
|
|
160
|
+
"type": "boolean",
|
|
161
|
+
constraints: [{
|
|
162
|
+
constraint: {
|
|
163
|
+
"allowedValues": ["TRUE_VALUE"]
|
|
164
|
+
}
|
|
165
|
+
}]
|
|
166
|
+
},
|
|
167
|
+
status: {
|
|
168
|
+
type: "deprecated",
|
|
169
|
+
deadline: "2026-01-01",
|
|
170
|
+
message: "This value type is deprecated"
|
|
171
|
+
},
|
|
172
|
+
version: "0.1.0"
|
|
173
|
+
});
|
|
174
|
+
expect(dumpValueTypeWireType()).toMatchInlineSnapshot(`
|
|
175
|
+
{
|
|
176
|
+
"valueTypes": [
|
|
177
|
+
{
|
|
178
|
+
"metadata": {
|
|
179
|
+
"apiName": "apiName",
|
|
180
|
+
"displayMetadata": {
|
|
181
|
+
"description": "",
|
|
182
|
+
"displayName": "displayName",
|
|
183
|
+
},
|
|
184
|
+
"packageNamespace": "com.palantir",
|
|
185
|
+
"status": {
|
|
186
|
+
"deprecated": {
|
|
187
|
+
"deadline": "2026-01-01",
|
|
188
|
+
"message": "This value type is deprecated",
|
|
189
|
+
"replacedBy": undefined,
|
|
190
|
+
},
|
|
191
|
+
"type": "deprecated",
|
|
192
|
+
},
|
|
193
|
+
},
|
|
194
|
+
"versions": [
|
|
195
|
+
{
|
|
196
|
+
"baseType": {
|
|
197
|
+
"boolean": {},
|
|
198
|
+
"type": "boolean",
|
|
199
|
+
},
|
|
200
|
+
"constraints": [
|
|
201
|
+
{
|
|
202
|
+
"constraint": {
|
|
203
|
+
"constraint": {
|
|
204
|
+
"boolean": {
|
|
205
|
+
"allowedValues": [
|
|
206
|
+
"TRUE_VALUE",
|
|
207
|
+
],
|
|
208
|
+
},
|
|
209
|
+
"type": "boolean",
|
|
210
|
+
},
|
|
211
|
+
"failureMessage": undefined,
|
|
212
|
+
},
|
|
213
|
+
},
|
|
214
|
+
],
|
|
215
|
+
"exampleValues": [],
|
|
216
|
+
"version": "0.1.0",
|
|
217
|
+
},
|
|
218
|
+
],
|
|
219
|
+
},
|
|
220
|
+
],
|
|
221
|
+
}
|
|
222
|
+
`);
|
|
223
|
+
});
|
|
155
224
|
});
|
|
156
225
|
//# sourceMappingURL=valueTypes.test.js.map
|