@osdk/maker 0.15.0-beta.5 → 0.15.0-beta.7

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.
Files changed (154) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/build/browser/api/action/ActionParameter.js.map +1 -1
  3. package/build/browser/api/action/ActionParameterConfiguration.js.map +1 -1
  4. package/build/browser/api/defineAction.js +65 -22
  5. package/build/browser/api/defineAction.js.map +1 -1
  6. package/build/browser/api/defineCreateInterfaceObjectAction.js +28 -8
  7. package/build/browser/api/defineCreateInterfaceObjectAction.js.map +1 -1
  8. package/build/browser/api/defineInterface.js +40 -34
  9. package/build/browser/api/defineInterface.js.map +1 -1
  10. package/build/browser/api/defineModifyInterfaceObjectAction.js +31 -8
  11. package/build/browser/api/defineModifyInterfaceObjectAction.js.map +1 -1
  12. package/build/browser/api/defineObject.js +53 -14
  13. package/build/browser/api/defineObject.js.map +1 -1
  14. package/build/browser/api/defineSpt.js.map +1 -1
  15. package/build/browser/api/interface/InterfacePropertyType.js +22 -1
  16. package/build/browser/api/interface/InterfacePropertyType.js.map +1 -1
  17. package/build/browser/api/interface/InterfaceType.js.map +1 -1
  18. package/build/browser/api/interface/getFlattenedInterfaceProperties.js +9 -3
  19. package/build/browser/api/interface/getFlattenedInterfaceProperties.js.map +1 -1
  20. package/build/browser/api/object/ObjectType.js.map +1 -1
  21. package/build/browser/api/object/ObjectTypeDefinition.js.map +1 -1
  22. package/build/browser/api/properties/PropertyTypeType.js +1 -1
  23. package/build/browser/api/properties/PropertyTypeType.js.map +1 -1
  24. package/build/browser/api/properties/SharedPropertyType.js.map +1 -1
  25. package/build/browser/api/test/actions.test.js +6105 -5850
  26. package/build/browser/api/test/actions.test.js.map +1 -1
  27. package/build/browser/api/test/interfaces.test.js +723 -470
  28. package/build/browser/api/test/interfaces.test.js.map +1 -1
  29. package/build/browser/api/test/links.test.js +1334 -1325
  30. package/build/browser/api/test/links.test.js.map +1 -1
  31. package/build/browser/api/test/misc.test.js +262 -11
  32. package/build/browser/api/test/misc.test.js.map +1 -1
  33. package/build/browser/api/test/objects.test.js +1872 -1412
  34. package/build/browser/api/test/objects.test.js.map +1 -1
  35. package/build/browser/api/test/spt.test.js +250 -103
  36. package/build/browser/api/test/spt.test.js.map +1 -1
  37. package/build/browser/cli/main.js +1 -1
  38. package/build/browser/conversion/toMarketplace/convertActionValidation.js +1 -1
  39. package/build/browser/conversion/toMarketplace/convertActionValidation.js.map +1 -1
  40. package/build/browser/conversion/toMarketplace/convertInterface.js +2 -2
  41. package/build/browser/conversion/toMarketplace/convertInterface.js.map +1 -1
  42. package/build/browser/conversion/toMarketplace/convertInterfacePropertyType.js +66 -0
  43. package/build/browser/conversion/toMarketplace/convertInterfacePropertyType.js.map +1 -0
  44. package/build/browser/conversion/toMarketplace/convertMappingValue.js +35 -0
  45. package/build/browser/conversion/toMarketplace/convertMappingValue.js.map +1 -1
  46. package/build/browser/conversion/toMarketplace/convertObject.js +4 -2
  47. package/build/browser/conversion/toMarketplace/convertObject.js.map +1 -1
  48. package/build/browser/conversion/toMarketplace/convertObjectPropertyType.js +2 -1
  49. package/build/browser/conversion/toMarketplace/convertObjectPropertyType.js.map +1 -1
  50. package/build/browser/conversion/toMarketplace/convertSpt.js +4 -2
  51. package/build/browser/conversion/toMarketplace/convertSpt.js.map +1 -1
  52. package/build/browser/conversion/toMarketplace/propertyTypeTypeToOntologyIrInterfaceType.js +143 -0
  53. package/build/browser/conversion/toMarketplace/propertyTypeTypeToOntologyIrInterfaceType.js.map +1 -0
  54. package/build/browser/conversion/toMarketplace/propertyTypeTypeToOntologyIrType.js +4 -0
  55. package/build/browser/conversion/toMarketplace/propertyTypeTypeToOntologyIrType.js.map +1 -1
  56. package/build/browser/index.js.map +1 -1
  57. package/build/cjs/index.cjs +417 -114
  58. package/build/cjs/index.cjs.map +1 -1
  59. package/build/cjs/index.d.cts +28 -13
  60. package/build/esm/api/action/ActionParameter.js.map +1 -1
  61. package/build/esm/api/action/ActionParameterConfiguration.js.map +1 -1
  62. package/build/esm/api/defineAction.js +65 -22
  63. package/build/esm/api/defineAction.js.map +1 -1
  64. package/build/esm/api/defineCreateInterfaceObjectAction.js +28 -8
  65. package/build/esm/api/defineCreateInterfaceObjectAction.js.map +1 -1
  66. package/build/esm/api/defineInterface.js +40 -34
  67. package/build/esm/api/defineInterface.js.map +1 -1
  68. package/build/esm/api/defineModifyInterfaceObjectAction.js +31 -8
  69. package/build/esm/api/defineModifyInterfaceObjectAction.js.map +1 -1
  70. package/build/esm/api/defineObject.js +53 -14
  71. package/build/esm/api/defineObject.js.map +1 -1
  72. package/build/esm/api/defineSpt.js.map +1 -1
  73. package/build/esm/api/interface/InterfacePropertyType.js +22 -1
  74. package/build/esm/api/interface/InterfacePropertyType.js.map +1 -1
  75. package/build/esm/api/interface/InterfaceType.js.map +1 -1
  76. package/build/esm/api/interface/getFlattenedInterfaceProperties.js +9 -3
  77. package/build/esm/api/interface/getFlattenedInterfaceProperties.js.map +1 -1
  78. package/build/esm/api/object/ObjectType.js.map +1 -1
  79. package/build/esm/api/object/ObjectTypeDefinition.js.map +1 -1
  80. package/build/esm/api/properties/PropertyTypeType.js +1 -1
  81. package/build/esm/api/properties/PropertyTypeType.js.map +1 -1
  82. package/build/esm/api/properties/SharedPropertyType.js.map +1 -1
  83. package/build/esm/api/test/actions.test.js +6105 -5850
  84. package/build/esm/api/test/actions.test.js.map +1 -1
  85. package/build/esm/api/test/interfaces.test.js +723 -470
  86. package/build/esm/api/test/interfaces.test.js.map +1 -1
  87. package/build/esm/api/test/links.test.js +1334 -1325
  88. package/build/esm/api/test/links.test.js.map +1 -1
  89. package/build/esm/api/test/misc.test.js +262 -11
  90. package/build/esm/api/test/misc.test.js.map +1 -1
  91. package/build/esm/api/test/objects.test.js +1872 -1412
  92. package/build/esm/api/test/objects.test.js.map +1 -1
  93. package/build/esm/api/test/spt.test.js +250 -103
  94. package/build/esm/api/test/spt.test.js.map +1 -1
  95. package/build/esm/cli/main.js +1 -1
  96. package/build/esm/conversion/toMarketplace/convertActionValidation.js +1 -1
  97. package/build/esm/conversion/toMarketplace/convertActionValidation.js.map +1 -1
  98. package/build/esm/conversion/toMarketplace/convertInterface.js +2 -2
  99. package/build/esm/conversion/toMarketplace/convertInterface.js.map +1 -1
  100. package/build/esm/conversion/toMarketplace/convertInterfacePropertyType.js +66 -0
  101. package/build/esm/conversion/toMarketplace/convertInterfacePropertyType.js.map +1 -0
  102. package/build/esm/conversion/toMarketplace/convertMappingValue.js +35 -0
  103. package/build/esm/conversion/toMarketplace/convertMappingValue.js.map +1 -1
  104. package/build/esm/conversion/toMarketplace/convertObject.js +4 -2
  105. package/build/esm/conversion/toMarketplace/convertObject.js.map +1 -1
  106. package/build/esm/conversion/toMarketplace/convertObjectPropertyType.js +2 -1
  107. package/build/esm/conversion/toMarketplace/convertObjectPropertyType.js.map +1 -1
  108. package/build/esm/conversion/toMarketplace/convertSpt.js +4 -2
  109. package/build/esm/conversion/toMarketplace/convertSpt.js.map +1 -1
  110. package/build/esm/conversion/toMarketplace/propertyTypeTypeToOntologyIrInterfaceType.js +143 -0
  111. package/build/esm/conversion/toMarketplace/propertyTypeTypeToOntologyIrInterfaceType.js.map +1 -0
  112. package/build/esm/conversion/toMarketplace/propertyTypeTypeToOntologyIrType.js +4 -0
  113. package/build/esm/conversion/toMarketplace/propertyTypeTypeToOntologyIrType.js.map +1 -1
  114. package/build/esm/index.js.map +1 -1
  115. package/build/types/api/action/ActionParameter.d.ts +2 -1
  116. package/build/types/api/action/ActionParameter.d.ts.map +1 -1
  117. package/build/types/api/action/ActionParameterConfiguration.d.ts +2 -1
  118. package/build/types/api/action/ActionParameterConfiguration.d.ts.map +1 -1
  119. package/build/types/api/defineAction.d.ts +4 -3
  120. package/build/types/api/defineAction.d.ts.map +1 -1
  121. package/build/types/api/defineCreateInterfaceObjectAction.d.ts.map +1 -1
  122. package/build/types/api/defineInterface.d.ts +5 -5
  123. package/build/types/api/defineInterface.d.ts.map +1 -1
  124. package/build/types/api/defineModifyInterfaceObjectAction.d.ts.map +1 -1
  125. package/build/types/api/defineObject.d.ts.map +1 -1
  126. package/build/types/api/defineSpt.d.ts +3 -0
  127. package/build/types/api/defineSpt.d.ts.map +1 -1
  128. package/build/types/api/interface/InterfacePropertyType.d.ts +12 -2
  129. package/build/types/api/interface/InterfacePropertyType.d.ts.map +1 -1
  130. package/build/types/api/interface/InterfaceType.d.ts +3 -2
  131. package/build/types/api/interface/InterfaceType.d.ts.map +1 -1
  132. package/build/types/api/interface/getFlattenedInterfaceProperties.d.ts +1 -1
  133. package/build/types/api/interface/getFlattenedInterfaceProperties.d.ts.map +1 -1
  134. package/build/types/api/object/ObjectType.d.ts +1 -0
  135. package/build/types/api/object/ObjectType.d.ts.map +1 -1
  136. package/build/types/api/object/ObjectTypeDefinition.d.ts +1 -0
  137. package/build/types/api/object/ObjectTypeDefinition.d.ts.map +1 -1
  138. package/build/types/api/properties/PropertyTypeType.d.ts +1 -0
  139. package/build/types/api/properties/PropertyTypeType.d.ts.map +1 -1
  140. package/build/types/api/properties/SharedPropertyType.d.ts +1 -0
  141. package/build/types/api/properties/SharedPropertyType.d.ts.map +1 -1
  142. package/build/types/conversion/toMarketplace/convertInterface.d.ts.map +1 -1
  143. package/build/types/conversion/toMarketplace/convertInterfacePropertyType.d.ts +3 -0
  144. package/build/types/conversion/toMarketplace/convertInterfacePropertyType.d.ts.map +1 -0
  145. package/build/types/conversion/toMarketplace/convertMappingValue.d.ts +2 -1
  146. package/build/types/conversion/toMarketplace/convertMappingValue.d.ts.map +1 -1
  147. package/build/types/conversion/toMarketplace/convertObject.d.ts.map +1 -1
  148. package/build/types/conversion/toMarketplace/convertSpt.d.ts +1 -1
  149. package/build/types/conversion/toMarketplace/convertSpt.d.ts.map +1 -1
  150. package/build/types/conversion/toMarketplace/propertyTypeTypeToOntologyIrInterfaceType.d.ts +3 -0
  151. package/build/types/conversion/toMarketplace/propertyTypeTypeToOntologyIrInterfaceType.d.ts.map +1 -0
  152. package/build/types/index.d.ts +1 -0
  153. package/build/types/index.d.ts.map +1 -1
  154. package/package.json +4 -4
@@ -51,121 +51,162 @@ describe("SPTs", () => {
51
51
  }
52
52
  });
53
53
  expect(dumpOntologyFullMetadata().ontology).toMatchInlineSnapshot(`
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",
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": "blueprint",
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
- "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,
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
- "typeClasses": [
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
- "propertiesV3": {},
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
- "linkTypes": {},
128
- "objectTypes": {},
129
- "sharedPropertyTypes": {
130
- "com.palantir.fooSpt": {
131
- "sharedPropertyType": {
132
- "aliases": [],
133
- "apiName": "com.palantir.fooSpt",
134
- "baseFormatter": undefined,
135
- "dataConstraints": undefined,
136
- "displayMetadata": {
137
- "description": undefined,
138
- "displayName": "fooSpt",
139
- "visibility": "NORMAL",
140
- },
141
- "gothamMapping": undefined,
142
- "indexedForSearch": true,
143
- "type": {
144
- "string": {
145
- "analyzerOverride": undefined,
146
- "enableAsciiFolding": undefined,
147
- "isLongText": false,
148
- "supportsEfficientLeadingWildcard": false,
149
- "supportsExactMatching": true,
150
- },
151
- "type": "string",
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":[]}
@@ -24,7 +24,7 @@ import { defineOntology } from "../api/defineOntology.js";
24
24
  const apiNamespaceRegex = /^[a-z0-9-]+(\.[a-z0-9-]+)*\.$/;
25
25
  const uuidRegex = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;
26
26
  export default async function main(args = process.argv) {
27
- const commandLineOpts = await yargs(hideBin(args)).version("0.15.0-beta.5" ?? "").wrap(Math.min(150, yargs().terminalWidth())).strict().help().options({
27
+ const commandLineOpts = await yargs(hideBin(args)).version("0.15.0-beta.7" ?? "").wrap(Math.min(150, yargs().terminalWidth())).strict().help().options({
28
28
  input: {
29
29
  alias: "i",
30
30
  describe: "Input file",
@@ -36,7 +36,7 @@ export function convertActionValidation(action) {
36
36
  return [p.id, {
37
37
  defaultValidation: {
38
38
  display: {
39
- renderHint: renderHintFromBaseType(p, p.validation),
39
+ renderHint: p.renderHint ?? renderHintFromBaseType(p, p.validation),
40
40
  visibility: convertActionVisibility(p.validation.defaultVisibility),
41
41
  ...(p.defaultValue && {
42
42
  prefill: p.defaultValue
@@ -1 +1 @@
1
- {"version":3,"file":"convertActionValidation.js","names":["extractAllowedValues","renderHintFromBaseType","convertActionParameterConditionalOverride","convertActionVisibility","convertSectionConditionalOverride","convertActionValidation","action","actionTypeLevelValidation","rules","Object","fromEntries","validation","condition","type","true","displayMetadata","failureMessage","typeClasses","map","rule","idx","parameterValidations","parameters","p","id","defaultValidation","display","renderHint","visibility","defaultVisibility","defaultValue","prefill","allowedValues","required","convertParameterRequirementConstraint","conditionalOverrides","override","sectionValidations","entries","sections","sectionId","section","defaultDisplayMetadata","hidden","visible","notRequired","min","max","listLength","listLengthValidation","minLength","maxLength"],"sources":["convertActionValidation.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 type {\n OntologyIrActionValidation,\n ParameterRequiredConfiguration,\n} from \"@osdk/client.unstable\";\nimport type { ActionParameterRequirementConstraint } from \"../../api/action/ActionParameterConfiguration.js\";\nimport type { ActionType } from \"../../api/action/ActionType.js\";\nimport {\n extractAllowedValues,\n renderHintFromBaseType,\n} from \"../../api/defineOntology.js\";\nimport { convertActionParameterConditionalOverride } from \"./convertActionParameterConditionalOverride.js\";\nimport { convertActionVisibility } from \"./convertActionVisibility.js\";\nimport { convertSectionConditionalOverride } from \"./convertSectionConditionalOverride.js\";\n\nexport function convertActionValidation(\n action: ActionType,\n): OntologyIrActionValidation {\n return {\n actionTypeLevelValidation: {\n rules: Object.fromEntries(\n (action.validation\n ?? [{\n condition: { type: \"true\", true: {} },\n displayMetadata: { failureMessage: \"\", typeClasses: [] },\n }]).map((rule, idx) => [idx, rule]),\n ),\n },\n parameterValidations: Object.fromEntries(\n (action.parameters ?? []).map(p => {\n return [\n p.id,\n {\n defaultValidation: {\n display: {\n renderHint: renderHintFromBaseType(p, p.validation),\n visibility: convertActionVisibility(\n p.validation.defaultVisibility,\n ),\n ...p.defaultValue\n && { prefill: p.defaultValue },\n },\n validation: {\n allowedValues: extractAllowedValues(\n p.validation.allowedValues!,\n ),\n required: convertParameterRequirementConstraint(\n p.validation.required!,\n ),\n },\n },\n conditionalOverrides: p.validation.conditionalOverrides?.map(\n (override) =>\n convertActionParameterConditionalOverride(\n override,\n p.validation,\n action.parameters,\n ),\n ) ?? [],\n },\n ];\n }),\n ),\n sectionValidations: {\n ...Object.fromEntries(\n Object.entries(action.sections ?? {}).map((\n [sectionId, section],\n ) => [\n section.id,\n {\n defaultDisplayMetadata: section.defaultVisibility === \"hidden\"\n ? {\n visibility: {\n type: \"hidden\",\n hidden: {},\n },\n }\n : {\n visibility: {\n type: \"visible\",\n visible: {},\n },\n },\n conditionalOverrides: section.conditionalOverrides?.map(\n (override) =>\n convertSectionConditionalOverride(\n override,\n section.defaultVisibility ?? \"visible\",\n action.parameters,\n ),\n ) ?? [],\n },\n ]),\n ),\n },\n };\n}\n\nfunction convertParameterRequirementConstraint(\n required: ActionParameterRequirementConstraint,\n): ParameterRequiredConfiguration {\n if (typeof required === \"boolean\") {\n return required\n ? { type: \"required\", required: {} }\n : { type: \"notRequired\", notRequired: {} };\n }\n const { min, max } = required.listLength;\n return {\n type: \"listLengthValidation\",\n listLengthValidation: { minLength: min, maxLength: max },\n };\n}\n"],"mappings":"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","ignoreList":[]}
1
+ {"version":3,"file":"convertActionValidation.js","names":["extractAllowedValues","renderHintFromBaseType","convertActionParameterConditionalOverride","convertActionVisibility","convertSectionConditionalOverride","convertActionValidation","action","actionTypeLevelValidation","rules","Object","fromEntries","validation","condition","type","true","displayMetadata","failureMessage","typeClasses","map","rule","idx","parameterValidations","parameters","p","id","defaultValidation","display","renderHint","visibility","defaultVisibility","defaultValue","prefill","allowedValues","required","convertParameterRequirementConstraint","conditionalOverrides","override","sectionValidations","entries","sections","sectionId","section","defaultDisplayMetadata","hidden","visible","notRequired","min","max","listLength","listLengthValidation","minLength","maxLength"],"sources":["convertActionValidation.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 type {\n OntologyIrActionValidation,\n ParameterRequiredConfiguration,\n} from \"@osdk/client.unstable\";\nimport type { ActionParameterRequirementConstraint } from \"../../api/action/ActionParameterConfiguration.js\";\nimport type { ActionType } from \"../../api/action/ActionType.js\";\nimport {\n extractAllowedValues,\n renderHintFromBaseType,\n} from \"../../api/defineOntology.js\";\nimport { convertActionParameterConditionalOverride } from \"./convertActionParameterConditionalOverride.js\";\nimport { convertActionVisibility } from \"./convertActionVisibility.js\";\nimport { convertSectionConditionalOverride } from \"./convertSectionConditionalOverride.js\";\n\nexport function convertActionValidation(\n action: ActionType,\n): OntologyIrActionValidation {\n return {\n actionTypeLevelValidation: {\n rules: Object.fromEntries(\n (action.validation\n ?? [{\n condition: { type: \"true\", true: {} },\n displayMetadata: { failureMessage: \"\", typeClasses: [] },\n }]).map((rule, idx) => [idx, rule]),\n ),\n },\n parameterValidations: Object.fromEntries(\n (action.parameters ?? []).map(p => {\n return [\n p.id,\n {\n defaultValidation: {\n display: {\n renderHint: p.renderHint\n ?? renderHintFromBaseType(p, p.validation),\n visibility: convertActionVisibility(\n p.validation.defaultVisibility,\n ),\n ...p.defaultValue\n && { prefill: p.defaultValue },\n },\n validation: {\n allowedValues: extractAllowedValues(\n p.validation.allowedValues!,\n ),\n required: convertParameterRequirementConstraint(\n p.validation.required!,\n ),\n },\n },\n conditionalOverrides: p.validation.conditionalOverrides?.map(\n (override) =>\n convertActionParameterConditionalOverride(\n override,\n p.validation,\n action.parameters,\n ),\n ) ?? [],\n },\n ];\n }),\n ),\n sectionValidations: {\n ...Object.fromEntries(\n Object.entries(action.sections ?? {}).map((\n [sectionId, section],\n ) => [\n section.id,\n {\n defaultDisplayMetadata: section.defaultVisibility === \"hidden\"\n ? {\n visibility: {\n type: \"hidden\",\n hidden: {},\n },\n }\n : {\n visibility: {\n type: \"visible\",\n visible: {},\n },\n },\n conditionalOverrides: section.conditionalOverrides?.map(\n (override) =>\n convertSectionConditionalOverride(\n override,\n section.defaultVisibility ?? \"visible\",\n action.parameters,\n ),\n ) ?? [],\n },\n ]),\n ),\n },\n };\n}\n\nfunction convertParameterRequirementConstraint(\n required: ActionParameterRequirementConstraint,\n): ParameterRequiredConfiguration {\n if (typeof required === \"boolean\") {\n return required\n ? { type: \"required\", required: {} }\n : { type: \"notRequired\", notRequired: {} };\n }\n const { min, max } = required.listLength;\n return {\n type: \"listLengthValidation\",\n listLengthValidation: { minLength: min, maxLength: max },\n };\n}\n"],"mappings":"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","ignoreList":[]}
@@ -14,6 +14,7 @@
14
14
  * limitations under the License.
15
15
  */
16
16
 
17
+ import { convertInterfaceProperty } from "./convertInterfacePropertyType.js";
17
18
  import { convertSpt } from "./convertSpt.js";
18
19
  export function convertInterface(interfaceType) {
19
20
  const {
@@ -40,8 +41,7 @@ export function convertInterface(interfaceType) {
40
41
  extendsInterfaces: interfaceType.extendsInterfaces.map(i => i.apiName),
41
42
  // these are omitted from our internal types but we need to re-add them for the final json
42
43
  properties: [],
43
- // TODO(mwalther): Support propertiesV3
44
- propertiesV3: {}
44
+ propertiesV3: Object.fromEntries(Object.entries(interfaceType.propertiesV3).map(([apiName, prop]) => convertInterfaceProperty(prop, apiName)))
45
45
  };
46
46
  }
47
47
  //# sourceMappingURL=convertInterface.js.map