@osdk/maker 0.14.0-beta.3 → 0.14.0-beta.5

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 (120) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/build/browser/api/defineAction.js +130 -413
  3. package/build/browser/api/defineAction.js.map +1 -1
  4. package/build/browser/api/defineCreateInterfaceObjectAction.js +77 -0
  5. package/build/browser/api/defineCreateInterfaceObjectAction.js.map +1 -0
  6. package/build/browser/api/defineCreateObjectAction.js +76 -0
  7. package/build/browser/api/defineCreateObjectAction.js.map +1 -0
  8. package/build/browser/api/defineCreateOrModifyObjectAction.js +92 -0
  9. package/build/browser/api/defineCreateOrModifyObjectAction.js.map +1 -0
  10. package/build/browser/api/defineDeleteObjectAction.js +56 -0
  11. package/build/browser/api/defineDeleteObjectAction.js.map +1 -0
  12. package/build/browser/api/defineModifyInterfaceObjectAction.js +76 -0
  13. package/build/browser/api/defineModifyInterfaceObjectAction.js.map +1 -0
  14. package/build/browser/api/defineModifyObjectAction.js +91 -0
  15. package/build/browser/api/defineModifyObjectAction.js.map +1 -0
  16. package/build/browser/api/test/actions.test.js +11181 -0
  17. package/build/browser/api/test/actions.test.js.map +1 -0
  18. package/build/browser/api/test/interfaces.test.js +924 -0
  19. package/build/browser/api/test/interfaces.test.js.map +1 -0
  20. package/build/browser/api/test/links.test.js +1974 -0
  21. package/build/browser/api/test/links.test.js.map +1 -0
  22. package/build/browser/api/{markingconstraint.test.js → test/markingconstraint.test.js} +28 -2
  23. package/build/browser/api/test/markingconstraint.test.js.map +1 -0
  24. package/build/browser/api/test/misc.test.js +1058 -0
  25. package/build/browser/api/test/misc.test.js.map +1 -0
  26. package/build/browser/api/{objectStatus.test.js → test/objectStatus.test.js} +2 -2
  27. package/build/browser/api/test/objectStatus.test.js.map +1 -0
  28. package/build/browser/api/test/objects.test.js +1494 -0
  29. package/build/browser/api/test/objects.test.js.map +1 -0
  30. package/build/browser/api/test/spt.test.js +387 -0
  31. package/build/browser/api/test/spt.test.js.map +1 -0
  32. package/build/browser/api/test/valueTypes.test.js +156 -0
  33. package/build/browser/api/test/valueTypes.test.js.map +1 -0
  34. package/build/browser/cli/main.js +1 -1
  35. package/build/browser/index.js +7 -1
  36. package/build/browser/index.js.map +1 -1
  37. package/build/cjs/index.cjs +593 -510
  38. package/build/cjs/index.cjs.map +1 -1
  39. package/build/cjs/index.d.cts +31 -14
  40. package/build/esm/api/defineAction.js +130 -413
  41. package/build/esm/api/defineAction.js.map +1 -1
  42. package/build/esm/api/defineCreateInterfaceObjectAction.js +77 -0
  43. package/build/esm/api/defineCreateInterfaceObjectAction.js.map +1 -0
  44. package/build/esm/api/defineCreateObjectAction.js +76 -0
  45. package/build/esm/api/defineCreateObjectAction.js.map +1 -0
  46. package/build/esm/api/defineCreateOrModifyObjectAction.js +92 -0
  47. package/build/esm/api/defineCreateOrModifyObjectAction.js.map +1 -0
  48. package/build/esm/api/defineDeleteObjectAction.js +56 -0
  49. package/build/esm/api/defineDeleteObjectAction.js.map +1 -0
  50. package/build/esm/api/defineModifyInterfaceObjectAction.js +76 -0
  51. package/build/esm/api/defineModifyInterfaceObjectAction.js.map +1 -0
  52. package/build/esm/api/defineModifyObjectAction.js +91 -0
  53. package/build/esm/api/defineModifyObjectAction.js.map +1 -0
  54. package/build/esm/api/test/actions.test.js +11181 -0
  55. package/build/esm/api/test/actions.test.js.map +1 -0
  56. package/build/esm/api/test/interfaces.test.js +924 -0
  57. package/build/esm/api/test/interfaces.test.js.map +1 -0
  58. package/build/esm/api/test/links.test.js +1974 -0
  59. package/build/esm/api/test/links.test.js.map +1 -0
  60. package/build/esm/api/{markingconstraint.test.js → test/markingconstraint.test.js} +28 -2
  61. package/build/esm/api/test/markingconstraint.test.js.map +1 -0
  62. package/build/esm/api/test/misc.test.js +1058 -0
  63. package/build/esm/api/test/misc.test.js.map +1 -0
  64. package/build/esm/api/{objectStatus.test.js → test/objectStatus.test.js} +2 -2
  65. package/build/esm/api/test/objectStatus.test.js.map +1 -0
  66. package/build/esm/api/test/objects.test.js +1494 -0
  67. package/build/esm/api/test/objects.test.js.map +1 -0
  68. package/build/esm/api/test/spt.test.js +387 -0
  69. package/build/esm/api/test/spt.test.js.map +1 -0
  70. package/build/esm/api/test/valueTypes.test.js +156 -0
  71. package/build/esm/api/test/valueTypes.test.js.map +1 -0
  72. package/build/esm/cli/main.js +1 -1
  73. package/build/esm/index.js +7 -1
  74. package/build/esm/index.js.map +1 -1
  75. package/build/types/api/defineAction.d.ts +27 -7
  76. package/build/types/api/defineAction.d.ts.map +1 -1
  77. package/build/types/api/defineCreateInterfaceObjectAction.d.ts +3 -0
  78. package/build/types/api/defineCreateInterfaceObjectAction.d.ts.map +1 -0
  79. package/build/types/api/defineCreateObjectAction.d.ts +3 -0
  80. package/build/types/api/defineCreateObjectAction.d.ts.map +1 -0
  81. package/build/types/api/defineCreateOrModifyObjectAction.d.ts +3 -0
  82. package/build/types/api/defineCreateOrModifyObjectAction.d.ts.map +1 -0
  83. package/build/types/api/defineDeleteObjectAction.d.ts +3 -0
  84. package/build/types/api/defineDeleteObjectAction.d.ts.map +1 -0
  85. package/build/types/api/defineModifyInterfaceObjectAction.d.ts +3 -0
  86. package/build/types/api/defineModifyInterfaceObjectAction.d.ts.map +1 -0
  87. package/build/types/api/defineModifyObjectAction.d.ts +3 -0
  88. package/build/types/api/defineModifyObjectAction.d.ts.map +1 -0
  89. package/build/types/api/test/actions.test.d.ts.map +1 -0
  90. package/build/types/api/test/interfaces.test.d.ts.map +1 -0
  91. package/build/types/api/test/links.test.d.ts.map +1 -0
  92. package/build/types/api/test/markingconstraint.test.d.ts +1 -0
  93. package/build/types/api/test/markingconstraint.test.d.ts.map +1 -0
  94. package/build/types/api/test/misc.test.d.ts +1 -0
  95. package/build/types/api/test/misc.test.d.ts.map +1 -0
  96. package/build/types/api/test/objectStatus.test.d.ts +1 -0
  97. package/build/types/api/test/objectStatus.test.d.ts.map +1 -0
  98. package/build/types/api/test/objects.test.d.ts +1 -0
  99. package/build/types/api/test/objects.test.d.ts.map +1 -0
  100. package/build/types/api/test/spt.test.d.ts +1 -0
  101. package/build/types/api/test/spt.test.d.ts.map +1 -0
  102. package/build/types/api/test/valueTypes.test.d.ts +1 -0
  103. package/build/types/api/test/valueTypes.test.d.ts.map +1 -0
  104. package/build/types/index.d.ts +7 -1
  105. package/build/types/index.d.ts.map +1 -1
  106. package/package.json +5 -5
  107. package/build/browser/api/markingconstraint.test.js.map +0 -1
  108. package/build/browser/api/objectStatus.test.js.map +0 -1
  109. package/build/browser/api/overall.test.js +0 -14002
  110. package/build/browser/api/overall.test.js.map +0 -1
  111. package/build/esm/api/markingconstraint.test.js.map +0 -1
  112. package/build/esm/api/objectStatus.test.js.map +0 -1
  113. package/build/esm/api/overall.test.js +0 -14002
  114. package/build/esm/api/overall.test.js.map +0 -1
  115. package/build/types/api/markingconstraint.test.d.ts.map +0 -1
  116. package/build/types/api/objectStatus.test.d.ts.map +0 -1
  117. package/build/types/api/overall.test.d.ts.map +0 -1
  118. /package/build/types/api/{markingconstraint.test.d.ts → test/actions.test.d.ts} +0 -0
  119. /package/build/types/api/{objectStatus.test.d.ts → test/interfaces.test.d.ts} +0 -0
  120. /package/build/types/api/{overall.test.d.ts → test/links.test.d.ts} +0 -0
@@ -0,0 +1,924 @@
1
+ /*
2
+ * Copyright 2025 Palantir Technologies, Inc. All rights reserved.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ import { beforeEach, describe, expect, it } from "vitest";
18
+ import { defineInterface } from "../defineInterface.js";
19
+ import { defineOntology, dumpOntologyFullMetadata } from "../defineOntology.js";
20
+ import { defineSharedPropertyType } from "../defineSpt.js";
21
+ describe("Interfaces", () => {
22
+ beforeEach(async () => {
23
+ await defineOntology("com.palantir.", () => {}, "/tmp/");
24
+ });
25
+ it("doesn't let you define the same interface twice", () => {
26
+ defineInterface({
27
+ apiName: "Foo"
28
+ });
29
+ expect(() => {
30
+ defineInterface({
31
+ apiName: "Foo"
32
+ });
33
+ }).toThrowErrorMatchingInlineSnapshot(`[Error: Invariant failed: Interface com.palantir.Foo already exists]`);
34
+ });
35
+ it("defaults displayName to apiName", () => {
36
+ const result = defineInterface({
37
+ apiName: "Foo"
38
+ });
39
+ expect(result.displayMetadata.displayName).toBe("Foo");
40
+ });
41
+ it("defaults description to displayName", () => {
42
+ const result = defineInterface({
43
+ apiName: "Foo",
44
+ displayName: "d"
45
+ });
46
+ expect(result.displayMetadata.description).toBe("d");
47
+ });
48
+ it("defaults description to displayName to apiName", () => {
49
+ const result = defineInterface({
50
+ apiName: "Foo"
51
+ });
52
+ expect(result.displayMetadata.description).toBe("Foo");
53
+ });
54
+ describe("auto spts", () => {
55
+ it("auto creates spts", () => {
56
+ defineInterface({
57
+ apiName: "Foo",
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
+ },
176
+ }
177
+ `);
178
+ });
179
+ it("does not let you conflict spts", () => {
180
+ defineSharedPropertyType({
181
+ apiName: "foo",
182
+ type: "string"
183
+ });
184
+ 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
+ {
261
+ "actionTypes": {},
262
+ "blockPermissionInformation": {
263
+ "actionTypes": {},
264
+ "linkTypes": {},
265
+ "objectTypes": {},
266
+ },
267
+ "interfaceTypes": {
268
+ "com.palantir.childInterface": {
269
+ "interfaceType": {
270
+ "apiName": "com.palantir.childInterface",
271
+ "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",
340
+ "icon": {
341
+ "blueprint": {
342
+ "color": "#4C90F0",
343
+ "locator": "layout-hierarchy",
344
+ },
345
+ "type": "blueprint",
346
+ },
347
+ },
348
+ "extendsInterfaces": [],
349
+ "links": [],
350
+ "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,
359
+ "displayMetadata": {
360
+ "description": undefined,
361
+ "displayName": "property1",
362
+ "visibility": "NORMAL",
363
+ },
364
+ "gothamMapping": undefined,
365
+ "indexedForSearch": true,
366
+ "type": {
367
+ "string": {
368
+ "analyzerOverride": undefined,
369
+ "enableAsciiFolding": undefined,
370
+ "isLongText": false,
371
+ "supportsEfficientLeadingWildcard": false,
372
+ "supportsExactMatching": true,
373
+ },
374
+ "type": "string",
375
+ },
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
+ },
388
+ },
389
+ },
390
+ "propertiesV3": {},
391
+ "searchable": true,
392
+ "status": {
393
+ "active": {},
394
+ "type": "active",
395
+ },
396
+ },
397
+ },
398
+ },
399
+ "linkTypes": {},
400
+ "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
+ },
475
+ }
476
+ `);
477
+ });
478
+ it("supports optional properties", () => {
479
+ defineInterface({
480
+ apiName: "parentInterface",
481
+ properties: {
482
+ property1: {
483
+ required: false,
484
+ propertyDefinition: "string"
485
+ }
486
+ }
487
+ });
488
+ expect(dumpOntologyFullMetadata().ontology).toMatchInlineSnapshot(`
489
+ {
490
+ "actionTypes": {},
491
+ "blockPermissionInformation": {
492
+ "actionTypes": {},
493
+ "linkTypes": {},
494
+ "objectTypes": {},
495
+ },
496
+ "interfaceTypes": {
497
+ "com.palantir.parentInterface": {
498
+ "interfaceType": {
499
+ "apiName": "com.palantir.parentInterface",
500
+ "displayMetadata": {
501
+ "description": "parentInterface",
502
+ "displayName": "parentInterface",
503
+ "icon": {
504
+ "blueprint": {
505
+ "color": "#4C90F0",
506
+ "locator": "layout-hierarchy",
507
+ },
508
+ "type": "blueprint",
509
+ },
510
+ },
511
+ "extendsInterfaces": [],
512
+ "links": [],
513
+ "properties": [],
514
+ "propertiesV2": {
515
+ "com.palantir.property1": {
516
+ "required": false,
517
+ "sharedPropertyType": {
518
+ "aliases": [],
519
+ "apiName": "com.palantir.property1",
520
+ "baseFormatter": undefined,
521
+ "dataConstraints": undefined,
522
+ "displayMetadata": {
523
+ "description": undefined,
524
+ "displayName": "property1",
525
+ "visibility": "NORMAL",
526
+ },
527
+ "gothamMapping": undefined,
528
+ "indexedForSearch": true,
529
+ "type": {
530
+ "string": {
531
+ "analyzerOverride": undefined,
532
+ "enableAsciiFolding": undefined,
533
+ "isLongText": false,
534
+ "supportsEfficientLeadingWildcard": false,
535
+ "supportsExactMatching": true,
536
+ },
537
+ "type": "string",
538
+ },
539
+ "typeClasses": [
540
+ {
541
+ "kind": "render_hint",
542
+ "name": "SELECTABLE",
543
+ },
544
+ {
545
+ "kind": "render_hint",
546
+ "name": "SORTABLE",
547
+ },
548
+ ],
549
+ "valueType": undefined,
550
+ },
551
+ },
552
+ },
553
+ "propertiesV3": {},
554
+ "searchable": true,
555
+ "status": {
556
+ "active": {},
557
+ "type": "active",
558
+ },
559
+ },
560
+ },
561
+ },
562
+ "linkTypes": {},
563
+ "objectTypes": {},
564
+ "sharedPropertyTypes": {
565
+ "com.palantir.property1": {
566
+ "sharedPropertyType": {
567
+ "aliases": [],
568
+ "apiName": "com.palantir.property1",
569
+ "baseFormatter": undefined,
570
+ "dataConstraints": undefined,
571
+ "displayMetadata": {
572
+ "description": undefined,
573
+ "displayName": "property1",
574
+ "visibility": "NORMAL",
575
+ },
576
+ "gothamMapping": undefined,
577
+ "indexedForSearch": true,
578
+ "type": {
579
+ "string": {
580
+ "analyzerOverride": undefined,
581
+ "enableAsciiFolding": undefined,
582
+ "isLongText": false,
583
+ "supportsEfficientLeadingWildcard": false,
584
+ "supportsExactMatching": true,
585
+ },
586
+ "type": "string",
587
+ },
588
+ "typeClasses": [
589
+ {
590
+ "kind": "render_hint",
591
+ "name": "SELECTABLE",
592
+ },
593
+ {
594
+ "kind": "render_hint",
595
+ "name": "SORTABLE",
596
+ },
597
+ ],
598
+ "valueType": undefined,
599
+ },
600
+ },
601
+ },
602
+ }
603
+ `);
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
+ });
619
+ expect(dumpOntologyFullMetadata().ontology).toMatchInlineSnapshot(`
620
+ {
621
+ "actionTypes": {},
622
+ "blockPermissionInformation": {
623
+ "actionTypes": {},
624
+ "linkTypes": {},
625
+ "objectTypes": {},
626
+ },
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",
638
+ },
639
+ "type": "blueprint",
640
+ },
641
+ },
642
+ "extendsInterfaces": [
643
+ "com.palantir.parentInterface",
644
+ ],
645
+ "links": [],
646
+ "properties": [],
647
+ "propertiesV2": {
648
+ "com.palantir.property2": {
649
+ "required": true,
650
+ "sharedPropertyType": {
651
+ "aliases": [],
652
+ "apiName": "com.palantir.property2",
653
+ "baseFormatter": undefined,
654
+ "dataConstraints": undefined,
655
+ "displayMetadata": {
656
+ "description": undefined,
657
+ "displayName": "property2",
658
+ "visibility": "NORMAL",
659
+ },
660
+ "gothamMapping": undefined,
661
+ "indexedForSearch": true,
662
+ "type": {
663
+ "string": {
664
+ "analyzerOverride": undefined,
665
+ "enableAsciiFolding": undefined,
666
+ "isLongText": false,
667
+ "supportsEfficientLeadingWildcard": false,
668
+ "supportsExactMatching": true,
669
+ },
670
+ "type": "string",
671
+ },
672
+ "typeClasses": [
673
+ {
674
+ "kind": "render_hint",
675
+ "name": "SELECTABLE",
676
+ },
677
+ {
678
+ "kind": "render_hint",
679
+ "name": "SORTABLE",
680
+ },
681
+ ],
682
+ "valueType": undefined,
683
+ },
684
+ },
685
+ },
686
+ "propertiesV3": {},
687
+ "searchable": true,
688
+ "status": {
689
+ "active": {},
690
+ "type": "active",
691
+ },
692
+ },
693
+ },
694
+ "com.palantir.parentInterface": {
695
+ "interfaceType": {
696
+ "apiName": "com.palantir.parentInterface",
697
+ "displayMetadata": {
698
+ "description": "parentInterface",
699
+ "displayName": "parentInterface",
700
+ "icon": {
701
+ "blueprint": {
702
+ "color": "#4C90F0",
703
+ "locator": "layout-hierarchy",
704
+ },
705
+ "type": "blueprint",
706
+ },
707
+ },
708
+ "extendsInterfaces": [],
709
+ "links": [],
710
+ "properties": [],
711
+ "propertiesV2": {
712
+ "com.palantir.property1": {
713
+ "required": true,
714
+ "sharedPropertyType": {
715
+ "aliases": [],
716
+ "apiName": "com.palantir.property1",
717
+ "baseFormatter": undefined,
718
+ "dataConstraints": undefined,
719
+ "displayMetadata": {
720
+ "description": undefined,
721
+ "displayName": "property1",
722
+ "visibility": "NORMAL",
723
+ },
724
+ "gothamMapping": undefined,
725
+ "indexedForSearch": true,
726
+ "type": {
727
+ "string": {
728
+ "analyzerOverride": undefined,
729
+ "enableAsciiFolding": undefined,
730
+ "isLongText": false,
731
+ "supportsEfficientLeadingWildcard": false,
732
+ "supportsExactMatching": true,
733
+ },
734
+ "type": "string",
735
+ },
736
+ "typeClasses": [
737
+ {
738
+ "kind": "render_hint",
739
+ "name": "SELECTABLE",
740
+ },
741
+ {
742
+ "kind": "render_hint",
743
+ "name": "SORTABLE",
744
+ },
745
+ ],
746
+ "valueType": undefined,
747
+ },
748
+ },
749
+ },
750
+ "propertiesV3": {},
751
+ "searchable": true,
752
+ "status": {
753
+ "active": {},
754
+ "type": "active",
755
+ },
756
+ },
757
+ },
758
+ },
759
+ "linkTypes": {},
760
+ "objectTypes": {},
761
+ "sharedPropertyTypes": {
762
+ "com.palantir.property1": {
763
+ "sharedPropertyType": {
764
+ "aliases": [],
765
+ "apiName": "com.palantir.property1",
766
+ "baseFormatter": undefined,
767
+ "dataConstraints": undefined,
768
+ "displayMetadata": {
769
+ "description": undefined,
770
+ "displayName": "property1",
771
+ "visibility": "NORMAL",
772
+ },
773
+ "gothamMapping": undefined,
774
+ "indexedForSearch": true,
775
+ "type": {
776
+ "string": {
777
+ "analyzerOverride": undefined,
778
+ "enableAsciiFolding": undefined,
779
+ "isLongText": false,
780
+ "supportsEfficientLeadingWildcard": false,
781
+ "supportsExactMatching": true,
782
+ },
783
+ "type": "string",
784
+ },
785
+ "typeClasses": [
786
+ {
787
+ "kind": "render_hint",
788
+ "name": "SELECTABLE",
789
+ },
790
+ {
791
+ "kind": "render_hint",
792
+ "name": "SORTABLE",
793
+ },
794
+ ],
795
+ "valueType": undefined,
796
+ },
797
+ },
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",
808
+ },
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,
818
+ },
819
+ "type": "string",
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
+ },
835
+ }
836
+ `);
837
+ });
838
+ it("supports specifying searchable", () => {
839
+ defineInterface({
840
+ apiName: "parentInterface",
841
+ searchable: false
842
+ });
843
+ expect(dumpOntologyFullMetadata().ontology).toMatchInlineSnapshot(`
844
+ {
845
+ "actionTypes": {},
846
+ "blockPermissionInformation": {
847
+ "actionTypes": {},
848
+ "linkTypes": {},
849
+ "objectTypes": {},
850
+ },
851
+ "interfaceTypes": {
852
+ "com.palantir.parentInterface": {
853
+ "interfaceType": {
854
+ "apiName": "com.palantir.parentInterface",
855
+ "displayMetadata": {
856
+ "description": "parentInterface",
857
+ "displayName": "parentInterface",
858
+ "icon": {
859
+ "blueprint": {
860
+ "color": "#4C90F0",
861
+ "locator": "layout-hierarchy",
862
+ },
863
+ "type": "blueprint",
864
+ },
865
+ },
866
+ "extendsInterfaces": [],
867
+ "links": [],
868
+ "properties": [],
869
+ "propertiesV2": {},
870
+ "propertiesV3": {},
871
+ "searchable": false,
872
+ "status": {
873
+ "active": {},
874
+ "type": "active",
875
+ },
876
+ },
877
+ },
878
+ },
879
+ "linkTypes": {},
880
+ "objectTypes": {},
881
+ "sharedPropertyTypes": {},
882
+ }
883
+ `);
884
+ });
885
+ it("defaults interface status to active", () => {
886
+ const result = defineInterface({
887
+ apiName: "Foo"
888
+ });
889
+ expect(result.status).toEqual({
890
+ type: "active",
891
+ active: {}
892
+ });
893
+ });
894
+ it("sets interface status as experimental from opts", () => {
895
+ const result = defineInterface({
896
+ apiName: "Foo",
897
+ status: {
898
+ type: "experimental"
899
+ }
900
+ });
901
+ expect(result.status).toEqual({
902
+ type: "experimental",
903
+ experimental: {}
904
+ });
905
+ });
906
+ it("sets interface status as deprecated from opts", () => {
907
+ const result = defineInterface({
908
+ apiName: "Foo",
909
+ status: {
910
+ type: "deprecated",
911
+ message: "foo",
912
+ deadline: "foo"
913
+ }
914
+ });
915
+ expect(result.status).toEqual({
916
+ type: "deprecated",
917
+ deprecated: {
918
+ message: "foo",
919
+ deadline: "foo"
920
+ }
921
+ });
922
+ });
923
+ });
924
+ //# sourceMappingURL=interfaces.test.js.map