@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.
Files changed (188) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/README.md +26 -22
  3. package/build/browser/api/action/ActionParameter.js.map +1 -1
  4. package/build/browser/api/action/ActionParameterConfiguration.js.map +1 -1
  5. package/build/browser/api/defineAction.js +65 -22
  6. package/build/browser/api/defineAction.js.map +1 -1
  7. package/build/browser/api/defineCreateInterfaceObjectAction.js +28 -8
  8. package/build/browser/api/defineCreateInterfaceObjectAction.js.map +1 -1
  9. package/build/browser/api/defineInterface.js +40 -34
  10. package/build/browser/api/defineInterface.js.map +1 -1
  11. package/build/browser/api/defineModifyInterfaceObjectAction.js +31 -8
  12. package/build/browser/api/defineModifyInterfaceObjectAction.js.map +1 -1
  13. package/build/browser/api/defineObject.js +13 -9
  14. package/build/browser/api/defineObject.js.map +1 -1
  15. package/build/browser/api/defineOntology.js +6 -0
  16. package/build/browser/api/defineOntology.js.map +1 -1
  17. package/build/browser/api/defineSpt.js.map +1 -1
  18. package/build/browser/api/defineValueType.js +17 -4
  19. package/build/browser/api/defineValueType.js.map +1 -1
  20. package/build/browser/api/interface/InterfacePropertyType.js +22 -1
  21. package/build/browser/api/interface/InterfacePropertyType.js.map +1 -1
  22. package/build/browser/api/interface/InterfaceType.js.map +1 -1
  23. package/build/browser/api/interface/getFlattenedInterfaceProperties.js +9 -3
  24. package/build/browser/api/interface/getFlattenedInterfaceProperties.js.map +1 -1
  25. package/build/browser/api/interface/mapSimplifiedStatusToInterfaceTypeStatus.js +5 -0
  26. package/build/browser/api/interface/mapSimplifiedStatusToInterfaceTypeStatus.js.map +1 -1
  27. package/build/browser/api/links/LinkType.js.map +1 -1
  28. package/build/browser/api/object/ObjectType.js.map +1 -1
  29. package/build/browser/api/object/ObjectTypeDefinition.js.map +1 -1
  30. package/build/browser/api/object/ObjectTypeStatus.js.map +1 -1
  31. package/build/browser/api/properties/PropertyTypeType.js +1 -1
  32. package/build/browser/api/properties/PropertyTypeType.js.map +1 -1
  33. package/build/browser/api/properties/SharedPropertyType.js.map +1 -1
  34. package/build/browser/api/test/actions.test.js +6105 -5850
  35. package/build/browser/api/test/actions.test.js.map +1 -1
  36. package/build/browser/api/test/interfaces.test.js +757 -492
  37. package/build/browser/api/test/interfaces.test.js.map +1 -1
  38. package/build/browser/api/test/links.test.js +1334 -1325
  39. package/build/browser/api/test/links.test.js.map +1 -1
  40. package/build/browser/api/test/misc.test.js +262 -11
  41. package/build/browser/api/test/misc.test.js.map +1 -1
  42. package/build/browser/api/test/objects.test.js +1019 -960
  43. package/build/browser/api/test/objects.test.js.map +1 -1
  44. package/build/browser/api/test/spt.test.js +250 -103
  45. package/build/browser/api/test/spt.test.js.map +1 -1
  46. package/build/browser/api/test/valueTypes.test.js +69 -0
  47. package/build/browser/api/test/valueTypes.test.js.map +1 -1
  48. package/build/browser/cli/main.js +1 -1
  49. package/build/browser/conversion/toMarketplace/convertActionValidation.js +1 -1
  50. package/build/browser/conversion/toMarketplace/convertActionValidation.js.map +1 -1
  51. package/build/browser/conversion/toMarketplace/convertInterface.js +2 -2
  52. package/build/browser/conversion/toMarketplace/convertInterface.js.map +1 -1
  53. package/build/browser/conversion/toMarketplace/convertInterfacePropertyType.js +66 -0
  54. package/build/browser/conversion/toMarketplace/convertInterfacePropertyType.js.map +1 -0
  55. package/build/browser/conversion/toMarketplace/convertLink.js +30 -4
  56. package/build/browser/conversion/toMarketplace/convertLink.js.map +1 -1
  57. package/build/browser/conversion/toMarketplace/convertMappingValue.js +35 -0
  58. package/build/browser/conversion/toMarketplace/convertMappingValue.js.map +1 -1
  59. package/build/browser/conversion/toMarketplace/convertObject.js +4 -2
  60. package/build/browser/conversion/toMarketplace/convertObject.js.map +1 -1
  61. package/build/browser/conversion/toMarketplace/convertObjectPropertyType.js +2 -1
  62. package/build/browser/conversion/toMarketplace/convertObjectPropertyType.js.map +1 -1
  63. package/build/browser/conversion/toMarketplace/convertSpt.js +4 -2
  64. package/build/browser/conversion/toMarketplace/convertSpt.js.map +1 -1
  65. package/build/browser/conversion/toMarketplace/propertyTypeTypeToOntologyIrInterfaceType.js +143 -0
  66. package/build/browser/conversion/toMarketplace/propertyTypeTypeToOntologyIrInterfaceType.js.map +1 -0
  67. package/build/browser/conversion/toMarketplace/propertyTypeTypeToOntologyIrType.js +4 -0
  68. package/build/browser/conversion/toMarketplace/propertyTypeTypeToOntologyIrType.js.map +1 -1
  69. package/build/browser/index.js.map +1 -1
  70. package/build/cjs/index.cjs +444 -117
  71. package/build/cjs/index.cjs.map +1 -1
  72. package/build/cjs/index.d.cts +53 -17
  73. package/build/esm/api/action/ActionParameter.js.map +1 -1
  74. package/build/esm/api/action/ActionParameterConfiguration.js.map +1 -1
  75. package/build/esm/api/defineAction.js +65 -22
  76. package/build/esm/api/defineAction.js.map +1 -1
  77. package/build/esm/api/defineCreateInterfaceObjectAction.js +28 -8
  78. package/build/esm/api/defineCreateInterfaceObjectAction.js.map +1 -1
  79. package/build/esm/api/defineInterface.js +40 -34
  80. package/build/esm/api/defineInterface.js.map +1 -1
  81. package/build/esm/api/defineModifyInterfaceObjectAction.js +31 -8
  82. package/build/esm/api/defineModifyInterfaceObjectAction.js.map +1 -1
  83. package/build/esm/api/defineObject.js +13 -9
  84. package/build/esm/api/defineObject.js.map +1 -1
  85. package/build/esm/api/defineOntology.js +6 -0
  86. package/build/esm/api/defineOntology.js.map +1 -1
  87. package/build/esm/api/defineSpt.js.map +1 -1
  88. package/build/esm/api/defineValueType.js +17 -4
  89. package/build/esm/api/defineValueType.js.map +1 -1
  90. package/build/esm/api/interface/InterfacePropertyType.js +22 -1
  91. package/build/esm/api/interface/InterfacePropertyType.js.map +1 -1
  92. package/build/esm/api/interface/InterfaceType.js.map +1 -1
  93. package/build/esm/api/interface/getFlattenedInterfaceProperties.js +9 -3
  94. package/build/esm/api/interface/getFlattenedInterfaceProperties.js.map +1 -1
  95. package/build/esm/api/interface/mapSimplifiedStatusToInterfaceTypeStatus.js +5 -0
  96. package/build/esm/api/interface/mapSimplifiedStatusToInterfaceTypeStatus.js.map +1 -1
  97. package/build/esm/api/links/LinkType.js.map +1 -1
  98. package/build/esm/api/object/ObjectType.js.map +1 -1
  99. package/build/esm/api/object/ObjectTypeDefinition.js.map +1 -1
  100. package/build/esm/api/object/ObjectTypeStatus.js.map +1 -1
  101. package/build/esm/api/properties/PropertyTypeType.js +1 -1
  102. package/build/esm/api/properties/PropertyTypeType.js.map +1 -1
  103. package/build/esm/api/properties/SharedPropertyType.js.map +1 -1
  104. package/build/esm/api/test/actions.test.js +6105 -5850
  105. package/build/esm/api/test/actions.test.js.map +1 -1
  106. package/build/esm/api/test/interfaces.test.js +757 -492
  107. package/build/esm/api/test/interfaces.test.js.map +1 -1
  108. package/build/esm/api/test/links.test.js +1334 -1325
  109. package/build/esm/api/test/links.test.js.map +1 -1
  110. package/build/esm/api/test/misc.test.js +262 -11
  111. package/build/esm/api/test/misc.test.js.map +1 -1
  112. package/build/esm/api/test/objects.test.js +1019 -960
  113. package/build/esm/api/test/objects.test.js.map +1 -1
  114. package/build/esm/api/test/spt.test.js +250 -103
  115. package/build/esm/api/test/spt.test.js.map +1 -1
  116. package/build/esm/api/test/valueTypes.test.js +69 -0
  117. package/build/esm/api/test/valueTypes.test.js.map +1 -1
  118. package/build/esm/cli/main.js +1 -1
  119. package/build/esm/conversion/toMarketplace/convertActionValidation.js +1 -1
  120. package/build/esm/conversion/toMarketplace/convertActionValidation.js.map +1 -1
  121. package/build/esm/conversion/toMarketplace/convertInterface.js +2 -2
  122. package/build/esm/conversion/toMarketplace/convertInterface.js.map +1 -1
  123. package/build/esm/conversion/toMarketplace/convertInterfacePropertyType.js +66 -0
  124. package/build/esm/conversion/toMarketplace/convertInterfacePropertyType.js.map +1 -0
  125. package/build/esm/conversion/toMarketplace/convertLink.js +30 -4
  126. package/build/esm/conversion/toMarketplace/convertLink.js.map +1 -1
  127. package/build/esm/conversion/toMarketplace/convertMappingValue.js +35 -0
  128. package/build/esm/conversion/toMarketplace/convertMappingValue.js.map +1 -1
  129. package/build/esm/conversion/toMarketplace/convertObject.js +4 -2
  130. package/build/esm/conversion/toMarketplace/convertObject.js.map +1 -1
  131. package/build/esm/conversion/toMarketplace/convertObjectPropertyType.js +2 -1
  132. package/build/esm/conversion/toMarketplace/convertObjectPropertyType.js.map +1 -1
  133. package/build/esm/conversion/toMarketplace/convertSpt.js +4 -2
  134. package/build/esm/conversion/toMarketplace/convertSpt.js.map +1 -1
  135. package/build/esm/conversion/toMarketplace/propertyTypeTypeToOntologyIrInterfaceType.js +143 -0
  136. package/build/esm/conversion/toMarketplace/propertyTypeTypeToOntologyIrInterfaceType.js.map +1 -0
  137. package/build/esm/conversion/toMarketplace/propertyTypeTypeToOntologyIrType.js +4 -0
  138. package/build/esm/conversion/toMarketplace/propertyTypeTypeToOntologyIrType.js.map +1 -1
  139. package/build/esm/index.js.map +1 -1
  140. package/build/types/api/action/ActionParameter.d.ts +2 -1
  141. package/build/types/api/action/ActionParameter.d.ts.map +1 -1
  142. package/build/types/api/action/ActionParameterConfiguration.d.ts +2 -1
  143. package/build/types/api/action/ActionParameterConfiguration.d.ts.map +1 -1
  144. package/build/types/api/defineAction.d.ts +4 -3
  145. package/build/types/api/defineAction.d.ts.map +1 -1
  146. package/build/types/api/defineCreateInterfaceObjectAction.d.ts.map +1 -1
  147. package/build/types/api/defineInterface.d.ts +7 -5
  148. package/build/types/api/defineInterface.d.ts.map +1 -1
  149. package/build/types/api/defineModifyInterfaceObjectAction.d.ts.map +1 -1
  150. package/build/types/api/defineObject.d.ts.map +1 -1
  151. package/build/types/api/defineOntology.d.ts.map +1 -1
  152. package/build/types/api/defineSpt.d.ts +3 -0
  153. package/build/types/api/defineSpt.d.ts.map +1 -1
  154. package/build/types/api/defineValueType.d.ts +9 -0
  155. package/build/types/api/defineValueType.d.ts.map +1 -1
  156. package/build/types/api/interface/InterfacePropertyType.d.ts +12 -2
  157. package/build/types/api/interface/InterfacePropertyType.d.ts.map +1 -1
  158. package/build/types/api/interface/InterfaceType.d.ts +3 -2
  159. package/build/types/api/interface/InterfaceType.d.ts.map +1 -1
  160. package/build/types/api/interface/getFlattenedInterfaceProperties.d.ts +1 -1
  161. package/build/types/api/interface/getFlattenedInterfaceProperties.d.ts.map +1 -1
  162. package/build/types/api/links/LinkType.d.ts +16 -4
  163. package/build/types/api/links/LinkType.d.ts.map +1 -1
  164. package/build/types/api/object/ObjectType.d.ts +1 -0
  165. package/build/types/api/object/ObjectType.d.ts.map +1 -1
  166. package/build/types/api/object/ObjectTypeDefinition.d.ts +1 -0
  167. package/build/types/api/object/ObjectTypeDefinition.d.ts.map +1 -1
  168. package/build/types/api/object/ObjectTypeStatus.d.ts +1 -1
  169. package/build/types/api/object/ObjectTypeStatus.d.ts.map +1 -1
  170. package/build/types/api/properties/PropertyTypeType.d.ts +1 -0
  171. package/build/types/api/properties/PropertyTypeType.d.ts.map +1 -1
  172. package/build/types/api/properties/SharedPropertyType.d.ts +1 -0
  173. package/build/types/api/properties/SharedPropertyType.d.ts.map +1 -1
  174. package/build/types/conversion/toMarketplace/convertInterface.d.ts.map +1 -1
  175. package/build/types/conversion/toMarketplace/convertInterfacePropertyType.d.ts +3 -0
  176. package/build/types/conversion/toMarketplace/convertInterfacePropertyType.d.ts.map +1 -0
  177. package/build/types/conversion/toMarketplace/convertLink.d.ts +3 -2
  178. package/build/types/conversion/toMarketplace/convertLink.d.ts.map +1 -1
  179. package/build/types/conversion/toMarketplace/convertMappingValue.d.ts +2 -1
  180. package/build/types/conversion/toMarketplace/convertMappingValue.d.ts.map +1 -1
  181. package/build/types/conversion/toMarketplace/convertObject.d.ts.map +1 -1
  182. package/build/types/conversion/toMarketplace/convertSpt.d.ts +1 -1
  183. package/build/types/conversion/toMarketplace/convertSpt.d.ts.map +1 -1
  184. package/build/types/conversion/toMarketplace/propertyTypeTypeToOntologyIrInterfaceType.d.ts +3 -0
  185. package/build/types/conversion/toMarketplace/propertyTypeTypeToOntologyIrInterfaceType.d.ts.map +1 -0
  186. package/build/types/index.d.ts +1 -0
  187. package/build/types/index.d.ts.map +1 -1
  188. package/package.json +3 -3
@@ -51,212 +51,17 @@ describe("Interfaces", () => {
51
51
  });
52
52
  expect(result.displayMetadata.description).toBe("Foo");
53
53
  });
54
- describe("auto spts", () => {
55
- it("auto creates spts", () => {
54
+ describe("Auto IDPs", () => {
55
+ it("Auto creates IDPs", () => {
56
56
  defineInterface({
57
57
  apiName: "Foo",
58
58
  properties: {
59
- foo: "string"
60
- }
61
- });
62
- expect(dumpOntologyFullMetadata().ontology).toMatchInlineSnapshot(`
63
- {
64
- "actionTypes": {},
65
- "blockPermissionInformation": {
66
- "actionTypes": {},
67
- "linkTypes": {},
68
- "objectTypes": {},
69
- },
70
- "interfaceTypes": {
71
- "com.palantir.Foo": {
72
- "interfaceType": {
73
- "apiName": "com.palantir.Foo",
74
- "displayMetadata": {
75
- "description": "Foo",
76
- "displayName": "Foo",
77
- "icon": {
78
- "blueprint": {
79
- "color": "#4C90F0",
80
- "locator": "layout-hierarchy",
81
- },
82
- "type": "blueprint",
83
- },
84
- },
85
- "extendsInterfaces": [],
86
- "links": [],
87
- "properties": [],
88
- "propertiesV2": {
89
- "com.palantir.foo": {
90
- "required": true,
91
- "sharedPropertyType": {
92
- "aliases": [],
93
- "apiName": "com.palantir.foo",
94
- "baseFormatter": undefined,
95
- "dataConstraints": undefined,
96
- "displayMetadata": {
97
- "description": undefined,
98
- "displayName": "foo",
99
- "visibility": "NORMAL",
100
- },
101
- "gothamMapping": undefined,
102
- "indexedForSearch": true,
103
- "type": {
104
- "string": {
105
- "analyzerOverride": undefined,
106
- "enableAsciiFolding": undefined,
107
- "isLongText": false,
108
- "supportsEfficientLeadingWildcard": false,
109
- "supportsExactMatching": true,
110
- },
111
- "type": "string",
112
- },
113
- "typeClasses": [
114
- {
115
- "kind": "render_hint",
116
- "name": "SELECTABLE",
117
- },
118
- {
119
- "kind": "render_hint",
120
- "name": "SORTABLE",
121
- },
122
- ],
123
- "valueType": undefined,
124
- },
125
- },
126
- },
127
- "propertiesV3": {},
128
- "searchable": true,
129
- "status": {
130
- "active": {},
131
- "type": "active",
132
- },
133
- },
134
- },
135
- },
136
- "linkTypes": {},
137
- "objectTypes": {},
138
- "sharedPropertyTypes": {
139
- "com.palantir.foo": {
140
- "sharedPropertyType": {
141
- "aliases": [],
142
- "apiName": "com.palantir.foo",
143
- "baseFormatter": undefined,
144
- "dataConstraints": undefined,
145
- "displayMetadata": {
146
- "description": undefined,
147
- "displayName": "foo",
148
- "visibility": "NORMAL",
149
- },
150
- "gothamMapping": undefined,
151
- "indexedForSearch": true,
152
- "type": {
153
- "string": {
154
- "analyzerOverride": undefined,
155
- "enableAsciiFolding": undefined,
156
- "isLongText": false,
157
- "supportsEfficientLeadingWildcard": false,
158
- "supportsExactMatching": true,
159
- },
160
- "type": "string",
161
- },
162
- "typeClasses": [
163
- {
164
- "kind": "render_hint",
165
- "name": "SELECTABLE",
166
- },
167
- {
168
- "kind": "render_hint",
169
- "name": "SORTABLE",
170
- },
171
- ],
172
- "valueType": undefined,
173
- },
174
- },
175
- },
59
+ foo: {
60
+ type: "string"
176
61
  }
177
- `);
178
- });
179
- it("does not let you conflict spts", () => {
180
- defineSharedPropertyType({
181
- apiName: "foo",
182
- type: "string"
62
+ }
183
63
  });
184
64
  expect(dumpOntologyFullMetadata().ontology).toMatchInlineSnapshot(`
185
- {
186
- "actionTypes": {},
187
- "blockPermissionInformation": {
188
- "actionTypes": {},
189
- "linkTypes": {},
190
- "objectTypes": {},
191
- },
192
- "interfaceTypes": {},
193
- "linkTypes": {},
194
- "objectTypes": {},
195
- "sharedPropertyTypes": {
196
- "com.palantir.foo": {
197
- "sharedPropertyType": {
198
- "aliases": [],
199
- "apiName": "com.palantir.foo",
200
- "baseFormatter": undefined,
201
- "dataConstraints": undefined,
202
- "displayMetadata": {
203
- "description": undefined,
204
- "displayName": "foo",
205
- "visibility": "NORMAL",
206
- },
207
- "gothamMapping": undefined,
208
- "indexedForSearch": true,
209
- "type": {
210
- "string": {
211
- "analyzerOverride": undefined,
212
- "enableAsciiFolding": undefined,
213
- "isLongText": false,
214
- "supportsEfficientLeadingWildcard": false,
215
- "supportsExactMatching": true,
216
- },
217
- "type": "string",
218
- },
219
- "typeClasses": [
220
- {
221
- "kind": "render_hint",
222
- "name": "SELECTABLE",
223
- },
224
- {
225
- "kind": "render_hint",
226
- "name": "SORTABLE",
227
- },
228
- ],
229
- "valueType": undefined,
230
- },
231
- },
232
- },
233
- }
234
- `);
235
- expect(() => {
236
- defineInterface({
237
- apiName: "Foo",
238
- properties: {
239
- foo: "string"
240
- }
241
- });
242
- }).toThrowErrorMatchingInlineSnapshot(`[Error: Invariant failed: Shared property type com.palantir.foo already exists]`);
243
- });
244
- });
245
- it("allows extends interfaces with InterfaceType provided", () => {
246
- const parentInterface = defineInterface({
247
- apiName: "parentInterface",
248
- properties: {
249
- property1: "string"
250
- }
251
- });
252
- defineInterface({
253
- apiName: "childInterface",
254
- properties: {
255
- property2: "string"
256
- },
257
- extends: [parentInterface]
258
- });
259
- expect(dumpOntologyFullMetadata().ontology).toMatchInlineSnapshot(`
260
65
  {
261
66
  "actionTypes": {},
262
67
  "blockPermissionInformation": {
@@ -265,78 +70,12 @@ describe("Interfaces", () => {
265
70
  "objectTypes": {},
266
71
  },
267
72
  "interfaceTypes": {
268
- "com.palantir.childInterface": {
73
+ "com.palantir.Foo": {
269
74
  "interfaceType": {
270
- "apiName": "com.palantir.childInterface",
75
+ "apiName": "com.palantir.Foo",
271
76
  "displayMetadata": {
272
- "description": "childInterface",
273
- "displayName": "childInterface",
274
- "icon": {
275
- "blueprint": {
276
- "color": "#4C90F0",
277
- "locator": "layout-hierarchy",
278
- },
279
- "type": "blueprint",
280
- },
281
- },
282
- "extendsInterfaces": [
283
- "com.palantir.parentInterface",
284
- ],
285
- "links": [],
286
- "properties": [],
287
- "propertiesV2": {
288
- "com.palantir.property2": {
289
- "required": true,
290
- "sharedPropertyType": {
291
- "aliases": [],
292
- "apiName": "com.palantir.property2",
293
- "baseFormatter": undefined,
294
- "dataConstraints": undefined,
295
- "displayMetadata": {
296
- "description": undefined,
297
- "displayName": "property2",
298
- "visibility": "NORMAL",
299
- },
300
- "gothamMapping": undefined,
301
- "indexedForSearch": true,
302
- "type": {
303
- "string": {
304
- "analyzerOverride": undefined,
305
- "enableAsciiFolding": undefined,
306
- "isLongText": false,
307
- "supportsEfficientLeadingWildcard": false,
308
- "supportsExactMatching": true,
309
- },
310
- "type": "string",
311
- },
312
- "typeClasses": [
313
- {
314
- "kind": "render_hint",
315
- "name": "SELECTABLE",
316
- },
317
- {
318
- "kind": "render_hint",
319
- "name": "SORTABLE",
320
- },
321
- ],
322
- "valueType": undefined,
323
- },
324
- },
325
- },
326
- "propertiesV3": {},
327
- "searchable": true,
328
- "status": {
329
- "active": {},
330
- "type": "active",
331
- },
332
- },
333
- },
334
- "com.palantir.parentInterface": {
335
- "interfaceType": {
336
- "apiName": "com.palantir.parentInterface",
337
- "displayMetadata": {
338
- "description": "parentInterface",
339
- "displayName": "parentInterface",
77
+ "description": "Foo",
78
+ "displayName": "Foo",
340
79
  "icon": {
341
80
  "blueprint": {
342
81
  "color": "#4C90F0",
@@ -348,21 +87,24 @@ describe("Interfaces", () => {
348
87
  "extendsInterfaces": [],
349
88
  "links": [],
350
89
  "properties": [],
351
- "propertiesV2": {
352
- "com.palantir.property1": {
353
- "required": true,
354
- "sharedPropertyType": {
355
- "aliases": [],
356
- "apiName": "com.palantir.property1",
357
- "baseFormatter": undefined,
358
- "dataConstraints": undefined,
90
+ "propertiesV2": {},
91
+ "propertiesV3": {
92
+ "foo": {
93
+ "interfaceDefinedPropertyType": {
94
+ "apiName": "foo",
95
+ "constraints": {
96
+ "dataConstraints": undefined,
97
+ "indexedForSearch": true,
98
+ "primaryKeyConstraint": "NO_RESTRICTION",
99
+ "requireImplementation": true,
100
+ "typeClasses": [],
101
+ "valueType": undefined,
102
+ },
359
103
  "displayMetadata": {
360
104
  "description": undefined,
361
- "displayName": "property1",
105
+ "displayName": "foo",
362
106
  "visibility": "NORMAL",
363
107
  },
364
- "gothamMapping": undefined,
365
- "indexedForSearch": true,
366
108
  "type": {
367
109
  "string": {
368
110
  "analyzerOverride": undefined,
@@ -373,21 +115,10 @@ describe("Interfaces", () => {
373
115
  },
374
116
  "type": "string",
375
117
  },
376
- "typeClasses": [
377
- {
378
- "kind": "render_hint",
379
- "name": "SELECTABLE",
380
- },
381
- {
382
- "kind": "render_hint",
383
- "name": "SORTABLE",
384
- },
385
- ],
386
- "valueType": undefined,
387
118
  },
119
+ "type": "interfaceDefinedPropertyType",
388
120
  },
389
121
  },
390
- "propertiesV3": {},
391
122
  "searchable": true,
392
123
  "status": {
393
124
  "active": {},
@@ -398,94 +129,28 @@ describe("Interfaces", () => {
398
129
  },
399
130
  "linkTypes": {},
400
131
  "objectTypes": {},
401
- "sharedPropertyTypes": {
402
- "com.palantir.property1": {
403
- "sharedPropertyType": {
404
- "aliases": [],
405
- "apiName": "com.palantir.property1",
406
- "baseFormatter": undefined,
407
- "dataConstraints": undefined,
408
- "displayMetadata": {
409
- "description": undefined,
410
- "displayName": "property1",
411
- "visibility": "NORMAL",
412
- },
413
- "gothamMapping": undefined,
414
- "indexedForSearch": true,
415
- "type": {
416
- "string": {
417
- "analyzerOverride": undefined,
418
- "enableAsciiFolding": undefined,
419
- "isLongText": false,
420
- "supportsEfficientLeadingWildcard": false,
421
- "supportsExactMatching": true,
422
- },
423
- "type": "string",
424
- },
425
- "typeClasses": [
426
- {
427
- "kind": "render_hint",
428
- "name": "SELECTABLE",
429
- },
430
- {
431
- "kind": "render_hint",
432
- "name": "SORTABLE",
433
- },
434
- ],
435
- "valueType": undefined,
436
- },
437
- },
438
- "com.palantir.property2": {
439
- "sharedPropertyType": {
440
- "aliases": [],
441
- "apiName": "com.palantir.property2",
442
- "baseFormatter": undefined,
443
- "dataConstraints": undefined,
444
- "displayMetadata": {
445
- "description": undefined,
446
- "displayName": "property2",
447
- "visibility": "NORMAL",
448
- },
449
- "gothamMapping": undefined,
450
- "indexedForSearch": true,
451
- "type": {
452
- "string": {
453
- "analyzerOverride": undefined,
454
- "enableAsciiFolding": undefined,
455
- "isLongText": false,
456
- "supportsEfficientLeadingWildcard": false,
457
- "supportsExactMatching": true,
458
- },
459
- "type": "string",
460
- },
461
- "typeClasses": [
462
- {
463
- "kind": "render_hint",
464
- "name": "SELECTABLE",
465
- },
466
- {
467
- "kind": "render_hint",
468
- "name": "SORTABLE",
469
- },
470
- ],
471
- "valueType": undefined,
472
- },
473
- },
474
- },
132
+ "sharedPropertyTypes": {},
475
133
  }
476
134
  `);
135
+ });
477
136
  });
478
- it("supports optional properties", () => {
479
- defineInterface({
480
- apiName: "parentInterface",
481
- properties: {
482
- property1: {
483
- required: false,
484
- propertyDefinition: "string"
137
+ describe("Interface properties", () => {
138
+ it("IDPs and SPTs on the same interface", () => {
139
+ const spt = defineSharedPropertyType({
140
+ apiName: "spt",
141
+ type: "string"
142
+ });
143
+ defineInterface({
144
+ apiName: "bar",
145
+ displayName: "Bar",
146
+ properties: {
147
+ "foo": {
148
+ type: "boolean"
149
+ },
150
+ "spt": spt
485
151
  }
486
- }
487
- });
488
- expect(dumpOntologyFullMetadata().ontology).toMatchInlineSnapshot(`
152
+ });
153
+ expect(dumpOntologyFullMetadata().ontology).toMatchInlineSnapshot(`
489
154
  {
490
155
  "actionTypes": {},
491
156
  "blockPermissionInformation": {
@@ -494,12 +159,12 @@ describe("Interfaces", () => {
494
159
  "objectTypes": {},
495
160
  },
496
161
  "interfaceTypes": {
497
- "com.palantir.parentInterface": {
162
+ "com.palantir.bar": {
498
163
  "interfaceType": {
499
- "apiName": "com.palantir.parentInterface",
164
+ "apiName": "com.palantir.bar",
500
165
  "displayMetadata": {
501
- "description": "parentInterface",
502
- "displayName": "parentInterface",
166
+ "description": "Bar",
167
+ "displayName": "Bar",
503
168
  "icon": {
504
169
  "blueprint": {
505
170
  "color": "#4C90F0",
@@ -512,16 +177,16 @@ describe("Interfaces", () => {
512
177
  "links": [],
513
178
  "properties": [],
514
179
  "propertiesV2": {
515
- "com.palantir.property1": {
516
- "required": false,
180
+ "com.palantir.spt": {
181
+ "required": true,
517
182
  "sharedPropertyType": {
518
183
  "aliases": [],
519
- "apiName": "com.palantir.property1",
184
+ "apiName": "com.palantir.spt",
520
185
  "baseFormatter": undefined,
521
186
  "dataConstraints": undefined,
522
187
  "displayMetadata": {
523
188
  "description": undefined,
524
- "displayName": "property1",
189
+ "displayName": "spt",
525
190
  "visibility": "NORMAL",
526
191
  },
527
192
  "gothamMapping": undefined,
@@ -550,7 +215,71 @@ describe("Interfaces", () => {
550
215
  },
551
216
  },
552
217
  },
553
- "propertiesV3": {},
218
+ "propertiesV3": {
219
+ "com.palantir.spt": {
220
+ "sharedPropertyBasedPropertyType": {
221
+ "requireImplementation": true,
222
+ "sharedPropertyType": {
223
+ "aliases": [],
224
+ "apiName": "com.palantir.spt",
225
+ "baseFormatter": undefined,
226
+ "dataConstraints": undefined,
227
+ "displayMetadata": {
228
+ "description": undefined,
229
+ "displayName": "spt",
230
+ "visibility": "NORMAL",
231
+ },
232
+ "gothamMapping": undefined,
233
+ "indexedForSearch": true,
234
+ "type": {
235
+ "string": {
236
+ "analyzerOverride": undefined,
237
+ "enableAsciiFolding": undefined,
238
+ "isLongText": false,
239
+ "supportsEfficientLeadingWildcard": false,
240
+ "supportsExactMatching": true,
241
+ },
242
+ "type": "string",
243
+ },
244
+ "typeClasses": [
245
+ {
246
+ "kind": "render_hint",
247
+ "name": "SELECTABLE",
248
+ },
249
+ {
250
+ "kind": "render_hint",
251
+ "name": "SORTABLE",
252
+ },
253
+ ],
254
+ "valueType": undefined,
255
+ },
256
+ },
257
+ "type": "sharedPropertyBasedPropertyType",
258
+ },
259
+ "foo": {
260
+ "interfaceDefinedPropertyType": {
261
+ "apiName": "foo",
262
+ "constraints": {
263
+ "dataConstraints": undefined,
264
+ "indexedForSearch": true,
265
+ "primaryKeyConstraint": "NO_RESTRICTION",
266
+ "requireImplementation": true,
267
+ "typeClasses": [],
268
+ "valueType": undefined,
269
+ },
270
+ "displayMetadata": {
271
+ "description": undefined,
272
+ "displayName": "foo",
273
+ "visibility": "NORMAL",
274
+ },
275
+ "type": {
276
+ "boolean": {},
277
+ "type": "boolean",
278
+ },
279
+ },
280
+ "type": "interfaceDefinedPropertyType",
281
+ },
282
+ },
554
283
  "searchable": true,
555
284
  "status": {
556
285
  "active": {},
@@ -562,15 +291,15 @@ describe("Interfaces", () => {
562
291
  "linkTypes": {},
563
292
  "objectTypes": {},
564
293
  "sharedPropertyTypes": {
565
- "com.palantir.property1": {
294
+ "com.palantir.spt": {
566
295
  "sharedPropertyType": {
567
296
  "aliases": [],
568
- "apiName": "com.palantir.property1",
297
+ "apiName": "com.palantir.spt",
569
298
  "baseFormatter": undefined,
570
299
  "dataConstraints": undefined,
571
300
  "displayMetadata": {
572
301
  "description": undefined,
573
- "displayName": "property1",
302
+ "displayName": "spt",
574
303
  "visibility": "NORMAL",
575
304
  },
576
305
  "gothamMapping": undefined,
@@ -601,60 +330,102 @@ describe("Interfaces", () => {
601
330
  },
602
331
  }
603
332
  `);
604
- });
605
- it("allows extends interfaces with apiName provided", () => {
606
- const parentInterface = defineInterface({
607
- apiName: "parentInterface",
608
- properties: {
609
- property1: "string"
610
- }
611
- });
612
- defineInterface({
613
- apiName: "childInterface",
614
- properties: {
615
- property2: "string"
616
- },
617
- extends: parentInterface
618
333
  });
619
- expect(dumpOntologyFullMetadata().ontology).toMatchInlineSnapshot(`
620
- {
621
- "actionTypes": {},
622
- "blockPermissionInformation": {
623
- "actionTypes": {},
624
- "linkTypes": {},
625
- "objectTypes": {},
334
+ it("supports optional properties", () => {
335
+ const spt = defineSharedPropertyType({
336
+ apiName: "spt",
337
+ type: "string"
338
+ });
339
+ defineInterface({
340
+ apiName: "parentInterface",
341
+ properties: {
342
+ spt: {
343
+ required: false,
344
+ sharedPropertyType: spt
626
345
  },
627
- "interfaceTypes": {
628
- "com.palantir.childInterface": {
629
- "interfaceType": {
630
- "apiName": "com.palantir.childInterface",
631
- "displayMetadata": {
632
- "description": "childInterface",
633
- "displayName": "childInterface",
634
- "icon": {
635
- "blueprint": {
636
- "color": "#4C90F0",
637
- "locator": "layout-hierarchy",
346
+ idp: {
347
+ required: false,
348
+ type: "string"
349
+ }
350
+ }
351
+ });
352
+ expect(dumpOntologyFullMetadata().ontology).toMatchInlineSnapshot(`
353
+ {
354
+ "actionTypes": {},
355
+ "blockPermissionInformation": {
356
+ "actionTypes": {},
357
+ "linkTypes": {},
358
+ "objectTypes": {},
359
+ },
360
+ "interfaceTypes": {
361
+ "com.palantir.parentInterface": {
362
+ "interfaceType": {
363
+ "apiName": "com.palantir.parentInterface",
364
+ "displayMetadata": {
365
+ "description": "parentInterface",
366
+ "displayName": "parentInterface",
367
+ "icon": {
368
+ "blueprint": {
369
+ "color": "#4C90F0",
370
+ "locator": "layout-hierarchy",
371
+ },
372
+ "type": "blueprint",
373
+ },
374
+ },
375
+ "extendsInterfaces": [],
376
+ "links": [],
377
+ "properties": [],
378
+ "propertiesV2": {
379
+ "com.palantir.spt": {
380
+ "required": false,
381
+ "sharedPropertyType": {
382
+ "aliases": [],
383
+ "apiName": "com.palantir.spt",
384
+ "baseFormatter": undefined,
385
+ "dataConstraints": undefined,
386
+ "displayMetadata": {
387
+ "description": undefined,
388
+ "displayName": "spt",
389
+ "visibility": "NORMAL",
638
390
  },
639
- "type": "blueprint",
391
+ "gothamMapping": undefined,
392
+ "indexedForSearch": true,
393
+ "type": {
394
+ "string": {
395
+ "analyzerOverride": undefined,
396
+ "enableAsciiFolding": undefined,
397
+ "isLongText": false,
398
+ "supportsEfficientLeadingWildcard": false,
399
+ "supportsExactMatching": true,
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,
640
414
  },
641
415
  },
642
- "extendsInterfaces": [
643
- "com.palantir.parentInterface",
644
- ],
645
- "links": [],
646
- "properties": [],
647
- "propertiesV2": {
648
- "com.palantir.property2": {
649
- "required": true,
416
+ },
417
+ "propertiesV3": {
418
+ "com.palantir.spt": {
419
+ "sharedPropertyBasedPropertyType": {
420
+ "requireImplementation": false,
650
421
  "sharedPropertyType": {
651
422
  "aliases": [],
652
- "apiName": "com.palantir.property2",
423
+ "apiName": "com.palantir.spt",
653
424
  "baseFormatter": undefined,
654
425
  "dataConstraints": undefined,
655
426
  "displayMetadata": {
656
427
  "description": undefined,
657
- "displayName": "property2",
428
+ "displayName": "spt",
658
429
  "visibility": "NORMAL",
659
430
  },
660
431
  "gothamMapping": undefined,
@@ -682,8 +453,205 @@ describe("Interfaces", () => {
682
453
  "valueType": undefined,
683
454
  },
684
455
  },
456
+ "type": "sharedPropertyBasedPropertyType",
457
+ },
458
+ "idp": {
459
+ "interfaceDefinedPropertyType": {
460
+ "apiName": "idp",
461
+ "constraints": {
462
+ "dataConstraints": undefined,
463
+ "indexedForSearch": true,
464
+ "primaryKeyConstraint": "NO_RESTRICTION",
465
+ "requireImplementation": false,
466
+ "typeClasses": [],
467
+ "valueType": undefined,
468
+ },
469
+ "displayMetadata": {
470
+ "description": undefined,
471
+ "displayName": "idp",
472
+ "visibility": "NORMAL",
473
+ },
474
+ "type": {
475
+ "string": {
476
+ "analyzerOverride": undefined,
477
+ "enableAsciiFolding": undefined,
478
+ "isLongText": false,
479
+ "supportsEfficientLeadingWildcard": false,
480
+ "supportsExactMatching": true,
481
+ },
482
+ "type": "string",
483
+ },
484
+ },
485
+ "type": "interfaceDefinedPropertyType",
486
+ },
487
+ },
488
+ "searchable": true,
489
+ "status": {
490
+ "active": {},
491
+ "type": "active",
492
+ },
493
+ },
494
+ },
495
+ },
496
+ "linkTypes": {},
497
+ "objectTypes": {},
498
+ "sharedPropertyTypes": {
499
+ "com.palantir.spt": {
500
+ "sharedPropertyType": {
501
+ "aliases": [],
502
+ "apiName": "com.palantir.spt",
503
+ "baseFormatter": undefined,
504
+ "dataConstraints": undefined,
505
+ "displayMetadata": {
506
+ "description": undefined,
507
+ "displayName": "spt",
508
+ "visibility": "NORMAL",
509
+ },
510
+ "gothamMapping": undefined,
511
+ "indexedForSearch": true,
512
+ "type": {
513
+ "string": {
514
+ "analyzerOverride": undefined,
515
+ "enableAsciiFolding": undefined,
516
+ "isLongText": false,
517
+ "supportsEfficientLeadingWildcard": false,
518
+ "supportsExactMatching": true,
519
+ },
520
+ "type": "string",
521
+ },
522
+ "typeClasses": [
523
+ {
524
+ "kind": "render_hint",
525
+ "name": "SELECTABLE",
526
+ },
527
+ {
528
+ "kind": "render_hint",
529
+ "name": "SORTABLE",
530
+ },
531
+ ],
532
+ "valueType": undefined,
533
+ },
534
+ },
535
+ },
536
+ }
537
+ `);
538
+ });
539
+ it("Struct IDPs", () => {
540
+ defineInterface({
541
+ apiName: "bar",
542
+ displayName: "Bar",
543
+ properties: {
544
+ "struct": {
545
+ type: {
546
+ type: "struct",
547
+ structDefinition: {
548
+ field: {
549
+ fieldType: "string",
550
+ requireImplementation: true,
551
+ displayMetadata: {
552
+ displayName: "Field"
553
+ }
554
+ },
555
+ optional: "string"
556
+ }
557
+ }
558
+ }
559
+ }
560
+ });
561
+ expect(dumpOntologyFullMetadata().ontology).toMatchInlineSnapshot(`
562
+ {
563
+ "actionTypes": {},
564
+ "blockPermissionInformation": {
565
+ "actionTypes": {},
566
+ "linkTypes": {},
567
+ "objectTypes": {},
568
+ },
569
+ "interfaceTypes": {
570
+ "com.palantir.bar": {
571
+ "interfaceType": {
572
+ "apiName": "com.palantir.bar",
573
+ "displayMetadata": {
574
+ "description": "Bar",
575
+ "displayName": "Bar",
576
+ "icon": {
577
+ "blueprint": {
578
+ "color": "#4C90F0",
579
+ "locator": "layout-hierarchy",
580
+ },
581
+ "type": "blueprint",
582
+ },
583
+ },
584
+ "extendsInterfaces": [],
585
+ "links": [],
586
+ "properties": [],
587
+ "propertiesV2": {},
588
+ "propertiesV3": {
589
+ "struct": {
590
+ "interfaceDefinedPropertyType": {
591
+ "apiName": "struct",
592
+ "constraints": {
593
+ "dataConstraints": undefined,
594
+ "indexedForSearch": true,
595
+ "primaryKeyConstraint": "NO_RESTRICTION",
596
+ "requireImplementation": true,
597
+ "typeClasses": [],
598
+ "valueType": undefined,
599
+ },
600
+ "displayMetadata": {
601
+ "description": undefined,
602
+ "displayName": "struct",
603
+ "visibility": "NORMAL",
604
+ },
605
+ "type": {
606
+ "struct": {
607
+ "structFields": [
608
+ {
609
+ "aliases": [],
610
+ "apiName": "field",
611
+ "displayMetadata": {
612
+ "displayName": "Field",
613
+ },
614
+ "fieldType": {
615
+ "string": {
616
+ "analyzerOverride": undefined,
617
+ "enableAsciiFolding": undefined,
618
+ "isLongText": false,
619
+ "supportsEfficientLeadingWildcard": false,
620
+ "supportsExactMatching": true,
621
+ },
622
+ "type": "string",
623
+ },
624
+ "requireImplementation": true,
625
+ "typeClasses": [],
626
+ },
627
+ {
628
+ "aliases": [],
629
+ "apiName": "optional",
630
+ "displayMetadata": {
631
+ "description": undefined,
632
+ "displayName": "optional",
633
+ },
634
+ "fieldType": {
635
+ "string": {
636
+ "analyzerOverride": undefined,
637
+ "enableAsciiFolding": undefined,
638
+ "isLongText": false,
639
+ "supportsEfficientLeadingWildcard": false,
640
+ "supportsExactMatching": true,
641
+ },
642
+ "type": "string",
643
+ },
644
+ "requireImplementation": true,
645
+ "typeClasses": [],
646
+ },
647
+ ],
648
+ },
649
+ "type": "struct",
650
+ },
651
+ },
652
+ "type": "interfaceDefinedPropertyType",
653
+ },
685
654
  },
686
- "propertiesV3": {},
687
655
  "searchable": true,
688
656
  "status": {
689
657
  "active": {},
@@ -691,6 +659,57 @@ describe("Interfaces", () => {
691
659
  },
692
660
  },
693
661
  },
662
+ },
663
+ "linkTypes": {},
664
+ "objectTypes": {},
665
+ "sharedPropertyTypes": {},
666
+ }
667
+ `);
668
+ });
669
+ it("Complex interface properties", () => {
670
+ const spt = defineSharedPropertyType({
671
+ apiName: "spt",
672
+ type: "string",
673
+ array: true,
674
+ description: "Description",
675
+ displayName: "Display Name",
676
+ visibility: "HIDDEN",
677
+ nullability: {
678
+ noEmptyCollections: true,
679
+ noNulls: true
680
+ }
681
+ });
682
+ defineInterface({
683
+ apiName: "parentInterface",
684
+ properties: {
685
+ spt: {
686
+ required: false,
687
+ sharedPropertyType: spt
688
+ },
689
+ idp: {
690
+ required: false,
691
+ type: "string",
692
+ primaryKeyConstraint: "MUST_BE_PK",
693
+ array: true,
694
+ description: "Description",
695
+ displayName: "Display Name",
696
+ visibility: "HIDDEN",
697
+ nullability: {
698
+ noEmptyCollections: true,
699
+ noNulls: true
700
+ }
701
+ }
702
+ }
703
+ });
704
+ expect(dumpOntologyFullMetadata().ontology).toMatchInlineSnapshot(`
705
+ {
706
+ "actionTypes": {},
707
+ "blockPermissionInformation": {
708
+ "actionTypes": {},
709
+ "linkTypes": {},
710
+ "objectTypes": {},
711
+ },
712
+ "interfaceTypes": {
694
713
  "com.palantir.parentInterface": {
695
714
  "interfaceType": {
696
715
  "apiName": "com.palantir.parentInterface",
@@ -709,29 +728,42 @@ describe("Interfaces", () => {
709
728
  "links": [],
710
729
  "properties": [],
711
730
  "propertiesV2": {
712
- "com.palantir.property1": {
713
- "required": true,
731
+ "com.palantir.spt": {
732
+ "required": false,
714
733
  "sharedPropertyType": {
715
734
  "aliases": [],
716
- "apiName": "com.palantir.property1",
735
+ "apiName": "com.palantir.spt",
717
736
  "baseFormatter": undefined,
718
- "dataConstraints": undefined,
737
+ "dataConstraints": {
738
+ "nullability": undefined,
739
+ "nullabilityV2": {
740
+ "noEmptyCollections": true,
741
+ "noNulls": true,
742
+ },
743
+ "propertyTypeConstraints": [],
744
+ },
719
745
  "displayMetadata": {
720
- "description": undefined,
721
- "displayName": "property1",
722
- "visibility": "NORMAL",
746
+ "description": "Description",
747
+ "displayName": "Display Name",
748
+ "visibility": "HIDDEN",
723
749
  },
724
750
  "gothamMapping": undefined,
725
751
  "indexedForSearch": true,
726
752
  "type": {
727
- "string": {
728
- "analyzerOverride": undefined,
729
- "enableAsciiFolding": undefined,
730
- "isLongText": false,
731
- "supportsEfficientLeadingWildcard": false,
732
- "supportsExactMatching": true,
753
+ "array": {
754
+ "reducers": [],
755
+ "subtype": {
756
+ "string": {
757
+ "analyzerOverride": undefined,
758
+ "enableAsciiFolding": undefined,
759
+ "isLongText": false,
760
+ "supportsEfficientLeadingWildcard": false,
761
+ "supportsExactMatching": true,
762
+ },
763
+ "type": "string",
764
+ },
733
765
  },
734
- "type": "string",
766
+ "type": "array",
735
767
  },
736
768
  "typeClasses": [
737
769
  {
@@ -747,7 +779,102 @@ describe("Interfaces", () => {
747
779
  },
748
780
  },
749
781
  },
750
- "propertiesV3": {},
782
+ "propertiesV3": {
783
+ "com.palantir.spt": {
784
+ "sharedPropertyBasedPropertyType": {
785
+ "requireImplementation": false,
786
+ "sharedPropertyType": {
787
+ "aliases": [],
788
+ "apiName": "com.palantir.spt",
789
+ "baseFormatter": undefined,
790
+ "dataConstraints": {
791
+ "nullability": undefined,
792
+ "nullabilityV2": {
793
+ "noEmptyCollections": true,
794
+ "noNulls": true,
795
+ },
796
+ "propertyTypeConstraints": [],
797
+ },
798
+ "displayMetadata": {
799
+ "description": "Description",
800
+ "displayName": "Display Name",
801
+ "visibility": "HIDDEN",
802
+ },
803
+ "gothamMapping": undefined,
804
+ "indexedForSearch": true,
805
+ "type": {
806
+ "array": {
807
+ "reducers": [],
808
+ "subtype": {
809
+ "string": {
810
+ "analyzerOverride": undefined,
811
+ "enableAsciiFolding": undefined,
812
+ "isLongText": false,
813
+ "supportsEfficientLeadingWildcard": false,
814
+ "supportsExactMatching": true,
815
+ },
816
+ "type": "string",
817
+ },
818
+ },
819
+ "type": "array",
820
+ },
821
+ "typeClasses": [
822
+ {
823
+ "kind": "render_hint",
824
+ "name": "SELECTABLE",
825
+ },
826
+ {
827
+ "kind": "render_hint",
828
+ "name": "SORTABLE",
829
+ },
830
+ ],
831
+ "valueType": undefined,
832
+ },
833
+ },
834
+ "type": "sharedPropertyBasedPropertyType",
835
+ },
836
+ "idp": {
837
+ "interfaceDefinedPropertyType": {
838
+ "apiName": "idp",
839
+ "constraints": {
840
+ "dataConstraints": {
841
+ "nullability": undefined,
842
+ "nullabilityV2": {
843
+ "noEmptyCollections": true,
844
+ "noNulls": true,
845
+ },
846
+ "propertyTypeConstraints": [],
847
+ },
848
+ "indexedForSearch": true,
849
+ "primaryKeyConstraint": "MUST_BE_PK",
850
+ "requireImplementation": false,
851
+ "typeClasses": [],
852
+ "valueType": undefined,
853
+ },
854
+ "displayMetadata": {
855
+ "description": "Description",
856
+ "displayName": "Display Name",
857
+ "visibility": "HIDDEN",
858
+ },
859
+ "type": {
860
+ "array": {
861
+ "subtype": {
862
+ "string": {
863
+ "analyzerOverride": undefined,
864
+ "enableAsciiFolding": undefined,
865
+ "isLongText": false,
866
+ "supportsEfficientLeadingWildcard": false,
867
+ "supportsExactMatching": true,
868
+ },
869
+ "type": "string",
870
+ },
871
+ },
872
+ "type": "array",
873
+ },
874
+ },
875
+ "type": "interfaceDefinedPropertyType",
876
+ },
877
+ },
751
878
  "searchable": true,
752
879
  "status": {
753
880
  "active": {},
@@ -759,28 +886,41 @@ describe("Interfaces", () => {
759
886
  "linkTypes": {},
760
887
  "objectTypes": {},
761
888
  "sharedPropertyTypes": {
762
- "com.palantir.property1": {
889
+ "com.palantir.spt": {
763
890
  "sharedPropertyType": {
764
891
  "aliases": [],
765
- "apiName": "com.palantir.property1",
892
+ "apiName": "com.palantir.spt",
766
893
  "baseFormatter": undefined,
767
- "dataConstraints": undefined,
894
+ "dataConstraints": {
895
+ "nullability": undefined,
896
+ "nullabilityV2": {
897
+ "noEmptyCollections": true,
898
+ "noNulls": true,
899
+ },
900
+ "propertyTypeConstraints": [],
901
+ },
768
902
  "displayMetadata": {
769
- "description": undefined,
770
- "displayName": "property1",
771
- "visibility": "NORMAL",
903
+ "description": "Description",
904
+ "displayName": "Display Name",
905
+ "visibility": "HIDDEN",
772
906
  },
773
907
  "gothamMapping": undefined,
774
908
  "indexedForSearch": true,
775
909
  "type": {
776
- "string": {
777
- "analyzerOverride": undefined,
778
- "enableAsciiFolding": undefined,
779
- "isLongText": false,
780
- "supportsEfficientLeadingWildcard": false,
781
- "supportsExactMatching": true,
910
+ "array": {
911
+ "reducers": [],
912
+ "subtype": {
913
+ "string": {
914
+ "analyzerOverride": undefined,
915
+ "enableAsciiFolding": undefined,
916
+ "isLongText": false,
917
+ "supportsEfficientLeadingWildcard": false,
918
+ "supportsExactMatching": true,
919
+ },
920
+ "type": "string",
921
+ },
782
922
  },
783
- "type": "string",
923
+ "type": "array",
784
924
  },
785
925
  "typeClasses": [
786
926
  {
@@ -795,45 +935,158 @@ describe("Interfaces", () => {
795
935
  "valueType": undefined,
796
936
  },
797
937
  },
798
- "com.palantir.property2": {
799
- "sharedPropertyType": {
800
- "aliases": [],
801
- "apiName": "com.palantir.property2",
802
- "baseFormatter": undefined,
803
- "dataConstraints": undefined,
804
- "displayMetadata": {
805
- "description": undefined,
806
- "displayName": "property2",
807
- "visibility": "NORMAL",
938
+ },
939
+ }
940
+ `);
941
+ });
942
+ });
943
+ it("allows extends interfaces with apiName provided", () => {
944
+ const parentInterface = defineInterface({
945
+ apiName: "parentInterface",
946
+ properties: {
947
+ property1: {
948
+ type: "string"
949
+ }
950
+ }
951
+ });
952
+ defineInterface({
953
+ apiName: "childInterface",
954
+ properties: {
955
+ property2: {
956
+ type: "string"
957
+ }
958
+ },
959
+ extends: parentInterface
960
+ });
961
+ expect(dumpOntologyFullMetadata().ontology).toMatchInlineSnapshot(`
962
+ {
963
+ "actionTypes": {},
964
+ "blockPermissionInformation": {
965
+ "actionTypes": {},
966
+ "linkTypes": {},
967
+ "objectTypes": {},
968
+ },
969
+ "interfaceTypes": {
970
+ "com.palantir.childInterface": {
971
+ "interfaceType": {
972
+ "apiName": "com.palantir.childInterface",
973
+ "displayMetadata": {
974
+ "description": "childInterface",
975
+ "displayName": "childInterface",
976
+ "icon": {
977
+ "blueprint": {
978
+ "color": "#4C90F0",
979
+ "locator": "layout-hierarchy",
980
+ },
981
+ "type": "blueprint",
808
982
  },
809
- "gothamMapping": undefined,
810
- "indexedForSearch": true,
811
- "type": {
812
- "string": {
813
- "analyzerOverride": undefined,
814
- "enableAsciiFolding": undefined,
815
- "isLongText": false,
816
- "supportsEfficientLeadingWildcard": false,
817
- "supportsExactMatching": true,
983
+ },
984
+ "extendsInterfaces": [
985
+ "com.palantir.parentInterface",
986
+ ],
987
+ "links": [],
988
+ "properties": [],
989
+ "propertiesV2": {},
990
+ "propertiesV3": {
991
+ "property2": {
992
+ "interfaceDefinedPropertyType": {
993
+ "apiName": "property2",
994
+ "constraints": {
995
+ "dataConstraints": undefined,
996
+ "indexedForSearch": true,
997
+ "primaryKeyConstraint": "NO_RESTRICTION",
998
+ "requireImplementation": true,
999
+ "typeClasses": [],
1000
+ "valueType": undefined,
1001
+ },
1002
+ "displayMetadata": {
1003
+ "description": undefined,
1004
+ "displayName": "property2",
1005
+ "visibility": "NORMAL",
1006
+ },
1007
+ "type": {
1008
+ "string": {
1009
+ "analyzerOverride": undefined,
1010
+ "enableAsciiFolding": undefined,
1011
+ "isLongText": false,
1012
+ "supportsEfficientLeadingWildcard": false,
1013
+ "supportsExactMatching": true,
1014
+ },
1015
+ "type": "string",
1016
+ },
818
1017
  },
819
- "type": "string",
1018
+ "type": "interfaceDefinedPropertyType",
820
1019
  },
821
- "typeClasses": [
822
- {
823
- "kind": "render_hint",
824
- "name": "SELECTABLE",
1020
+ },
1021
+ "searchable": true,
1022
+ "status": {
1023
+ "active": {},
1024
+ "type": "active",
1025
+ },
1026
+ },
1027
+ },
1028
+ "com.palantir.parentInterface": {
1029
+ "interfaceType": {
1030
+ "apiName": "com.palantir.parentInterface",
1031
+ "displayMetadata": {
1032
+ "description": "parentInterface",
1033
+ "displayName": "parentInterface",
1034
+ "icon": {
1035
+ "blueprint": {
1036
+ "color": "#4C90F0",
1037
+ "locator": "layout-hierarchy",
825
1038
  },
826
- {
827
- "kind": "render_hint",
828
- "name": "SORTABLE",
1039
+ "type": "blueprint",
1040
+ },
1041
+ },
1042
+ "extendsInterfaces": [],
1043
+ "links": [],
1044
+ "properties": [],
1045
+ "propertiesV2": {},
1046
+ "propertiesV3": {
1047
+ "property1": {
1048
+ "interfaceDefinedPropertyType": {
1049
+ "apiName": "property1",
1050
+ "constraints": {
1051
+ "dataConstraints": undefined,
1052
+ "indexedForSearch": true,
1053
+ "primaryKeyConstraint": "NO_RESTRICTION",
1054
+ "requireImplementation": true,
1055
+ "typeClasses": [],
1056
+ "valueType": undefined,
1057
+ },
1058
+ "displayMetadata": {
1059
+ "description": undefined,
1060
+ "displayName": "property1",
1061
+ "visibility": "NORMAL",
1062
+ },
1063
+ "type": {
1064
+ "string": {
1065
+ "analyzerOverride": undefined,
1066
+ "enableAsciiFolding": undefined,
1067
+ "isLongText": false,
1068
+ "supportsEfficientLeadingWildcard": false,
1069
+ "supportsExactMatching": true,
1070
+ },
1071
+ "type": "string",
1072
+ },
829
1073
  },
830
- ],
831
- "valueType": undefined,
1074
+ "type": "interfaceDefinedPropertyType",
1075
+ },
1076
+ },
1077
+ "searchable": true,
1078
+ "status": {
1079
+ "active": {},
1080
+ "type": "active",
832
1081
  },
833
1082
  },
834
1083
  },
835
- }
836
- `);
1084
+ },
1085
+ "linkTypes": {},
1086
+ "objectTypes": {},
1087
+ "sharedPropertyTypes": {},
1088
+ }
1089
+ `);
837
1090
  });
838
1091
  it("supports specifying searchable", () => {
839
1092
  defineInterface({
@@ -920,5 +1173,17 @@ describe("Interfaces", () => {
920
1173
  }
921
1174
  });
922
1175
  });
1176
+ it("sets interface status as example from opts", () => {
1177
+ const result = defineInterface({
1178
+ apiName: "Foo",
1179
+ status: {
1180
+ type: "example"
1181
+ }
1182
+ });
1183
+ expect(result.status).toEqual({
1184
+ type: "example",
1185
+ example: {}
1186
+ });
1187
+ });
923
1188
  });
924
1189
  //# sourceMappingURL=interfaces.test.js.map