@osdk/maker 0.14.0-beta.4 → 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.
@@ -12,58 +12,170 @@
12
12
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
- */
16
-
17
- import { beforeEach, describe, expect, it } from "vitest";
18
- import { OntologyEntityTypeEnum } from "../common/OntologyEntityTypeEnum.js";
19
- import { CREATE_INTERFACE_OBJECT_PARAMETER, CREATE_OR_MODIFY_OBJECT_PARAMETER, defineAction, MODIFY_INTERFACE_OBJECT_PARAMETER, MODIFY_OBJECT_PARAMETER } from "../defineAction.js";
20
- import { defineCreateInterfaceObjectAction } from "../defineCreateInterfaceObjectAction.js";
21
- import { defineCreateObjectAction } from "../defineCreateObjectAction.js";
22
- import { defineCreateOrModifyObjectAction } from "../defineCreateOrModifyObjectAction.js";
23
- import { defineDeleteObjectAction } from "../defineDeleteObjectAction.js";
24
- import { defineInterface } from "../defineInterface.js";
25
- import { defineModifyInterfaceObjectAction } from "../defineModifyInterfaceObjectAction.js";
26
- import { defineModifyObjectAction } from "../defineModifyObjectAction.js";
27
- import { defineObject } from "../defineObject.js";
28
- import { defineOntology, dumpOntologyFullMetadata } from "../defineOntology.js";
29
- import { defineSharedPropertyType } from "../defineSpt.js";
30
- import { importOntologyEntity } from "../importOntologyEntity.js";
31
- describe("Action Types", () => {
32
- beforeEach(async () => {
33
- await defineOntology("com.palantir.", () => {}, "/tmp/");
34
- });
35
- describe("Interface Actions", () => {
36
- it("Interface actions are properly defined", () => {
37
- defineInterface({
38
- apiName: "foo",
39
- displayName: "foo",
40
- properties: {}
41
- });
42
- defineAction({
43
- apiName: "foo",
44
- displayName: "exampleAction",
45
- status: "active",
46
- rules: [{
47
- type: "addInterfaceRule",
48
- addInterfaceRule: {
49
- interfaceApiName: "foo",
50
- objectTypeParameter: "param1",
51
- sharedPropertyValues: {}
52
- }
53
- }],
54
- parameters: [{
55
- id: "param1",
56
- displayName: "param1",
57
- type: "boolean",
58
- validation: {
59
- required: true,
60
- allowedValues: {
61
- type: "boolean"
62
- }
15
+ */import{beforeEach,describe,expect,it}from"vitest";import{OntologyEntityTypeEnum}from"../common/OntologyEntityTypeEnum.js";import{CREATE_INTERFACE_OBJECT_PARAMETER,CREATE_OR_MODIFY_OBJECT_PARAMETER,defineAction,MODIFY_INTERFACE_OBJECT_PARAMETER,MODIFY_OBJECT_PARAMETER}from"../defineAction.js";import{defineCreateInterfaceObjectAction}from"../defineCreateInterfaceObjectAction.js";import{defineCreateObjectAction}from"../defineCreateObjectAction.js";import{defineCreateOrModifyObjectAction}from"../defineCreateOrModifyObjectAction.js";import{defineDeleteObjectAction}from"../defineDeleteObjectAction.js";import{defineInterface}from"../defineInterface.js";import{defineModifyInterfaceObjectAction}from"../defineModifyInterfaceObjectAction.js";import{defineModifyObjectAction}from"../defineModifyObjectAction.js";import{defineObject}from"../defineObject.js";import{defineOntology,dumpOntologyFullMetadata}from"../defineOntology.js";import{defineSharedPropertyType}from"../defineSpt.js";import{importOntologyEntity}from"../importOntologyEntity.js";describe("Action Types",()=>{beforeEach(async()=>{await defineOntology("com.palantir.",()=>{},"/tmp/");});it("Concrete actions are properly defined",()=>{defineAction({apiName:"foo",displayName:"exampleAction",status:"active",rules:[{type:"addOrModifyObjectRuleV2",addOrModifyObjectRuleV2:{objectToModify:"objectToModifyParameter",propertyValues:{"bar":{type:"parameterId",parameterId:"param1"}},structFieldValues:{}}}],parameters:[{id:"param1",displayName:"param1",type:"boolean",validation:{required:true,allowedValues:{type:"boolean"}}}]});expect(dumpOntologyFullMetadata()).toMatchInlineSnapshot(`
16
+ {
17
+ "importedOntology": {
18
+ "actionTypes": {},
19
+ "blockPermissionInformation": {
20
+ "actionTypes": {},
21
+ "linkTypes": {},
22
+ "objectTypes": {},
23
+ },
24
+ "interfaceTypes": {},
25
+ "linkTypes": {},
26
+ "objectTypes": {},
27
+ "sharedPropertyTypes": {},
28
+ },
29
+ "importedValueTypes": {
30
+ "valueTypes": [],
31
+ },
32
+ "ontology": {
33
+ "actionTypes": {
34
+ "com.palantir.foo": {
35
+ "actionType": {
36
+ "actionTypeLogic": {
37
+ "logic": {
38
+ "rules": [
39
+ {
40
+ "addOrModifyObjectRuleV2": {
41
+ "objectToModify": "objectToModifyParameter",
42
+ "propertyValues": {
43
+ "bar": {
44
+ "parameterId": "param1",
45
+ "type": "parameterId",
46
+ },
47
+ },
48
+ "structFieldValues": {},
49
+ },
50
+ "type": "addOrModifyObjectRuleV2",
51
+ },
52
+ ],
53
+ },
54
+ "validation": {
55
+ "actionTypeLevelValidation": {
56
+ "rules": {
57
+ "0": {
58
+ "condition": {
59
+ "true": {},
60
+ "type": "true",
61
+ },
62
+ "displayMetadata": {
63
+ "failureMessage": "",
64
+ "typeClasses": [],
65
+ },
66
+ },
67
+ },
68
+ },
69
+ "parameterValidations": {
70
+ "param1": {
71
+ "conditionalOverrides": [],
72
+ "defaultValidation": {
73
+ "display": {
74
+ "renderHint": {
75
+ "checkbox": {},
76
+ "type": "checkbox",
77
+ },
78
+ "visibility": {
79
+ "editable": {},
80
+ "type": "editable",
81
+ },
82
+ },
83
+ "validation": {
84
+ "allowedValues": {
85
+ "boolean": {
86
+ "boolean": {},
87
+ "type": "boolean",
88
+ },
89
+ "type": "boolean",
90
+ },
91
+ "required": {
92
+ "required": {},
93
+ "type": "required",
94
+ },
95
+ },
96
+ },
97
+ },
98
+ },
99
+ "sectionValidations": {},
100
+ },
101
+ },
102
+ "metadata": {
103
+ "apiName": "com.palantir.foo",
104
+ "displayMetadata": {
105
+ "configuration": {
106
+ "defaultLayout": "FORM",
107
+ "displayAndFormat": {
108
+ "table": {
109
+ "columnWidthByParameterRid": {},
110
+ "enableFileImport": true,
111
+ "fitHorizontally": false,
112
+ "frozenColumnCount": 0,
113
+ "rowHeightInLines": 1,
114
+ },
115
+ },
116
+ "enableLayoutUserSwitch": false,
117
+ },
118
+ "description": "",
119
+ "displayName": "exampleAction",
120
+ "icon": {
121
+ "blueprint": {
122
+ "color": "#000000",
123
+ "locator": "edit",
124
+ },
125
+ "type": "blueprint",
126
+ },
127
+ "successMessage": [],
128
+ "typeClasses": [],
129
+ },
130
+ "entities": {
131
+ "affectedInterfaceTypes": [],
132
+ "affectedLinkTypes": [],
133
+ "affectedObjectTypes": [],
134
+ "typeGroups": [],
135
+ },
136
+ "formContentOrdering": [],
137
+ "parameterOrdering": [
138
+ "param1",
139
+ ],
140
+ "parameters": {
141
+ "param1": {
142
+ "displayMetadata": {
143
+ "description": "",
144
+ "displayName": "param1",
145
+ "typeClasses": [],
146
+ },
147
+ "id": "param1",
148
+ "type": {
149
+ "boolean": {},
150
+ "type": "boolean",
151
+ },
152
+ },
153
+ },
154
+ "sections": {},
155
+ "status": {
156
+ "active": {},
157
+ "type": "active",
158
+ },
159
+ },
160
+ },
161
+ },
162
+ },
163
+ "blockPermissionInformation": {
164
+ "actionTypes": {},
165
+ "linkTypes": {},
166
+ "objectTypes": {},
167
+ },
168
+ "interfaceTypes": {},
169
+ "linkTypes": {},
170
+ "objectTypes": {},
171
+ "sharedPropertyTypes": {},
172
+ },
173
+ "randomnessKey": undefined,
174
+ "valueTypes": {
175
+ "valueTypes": [],
176
+ },
63
177
  }
64
- }]
65
- });
66
- expect(dumpOntologyFullMetadata()).toMatchInlineSnapshot(`
178
+ `);});describe("Interface Actions",()=>{it("Interface actions are properly defined",()=>{defineInterface({apiName:"foo",displayName:"foo",properties:{}});defineAction({apiName:"foo",displayName:"exampleAction",status:"active",rules:[{type:"addInterfaceRule",addInterfaceRule:{interfaceApiName:"foo",objectTypeParameter:"param1",sharedPropertyValues:{}}}],parameters:[{id:"param1",displayName:"param1",type:"boolean",validation:{required:true,allowedValues:{type:"boolean"}}}]});expect(dumpOntologyFullMetadata()).toMatchInlineSnapshot(`
67
179
  {
68
180
  "importedOntology": {
69
181
  "actionTypes": {},
@@ -248,79 +360,7 @@ describe("Action Types", () => {
248
360
  "valueTypes": [],
249
361
  },
250
362
  }
251
- `);
252
- });
253
- it("Simple interface actions (with object types) are properly defined", () => {
254
- const exampleStructPropertyType = defineSharedPropertyType({
255
- apiName: "property2",
256
- type: {
257
- type: "struct",
258
- structDefinition: {
259
- simpleProperty: "string"
260
- }
261
- }
262
- });
263
- const mySpt = defineSharedPropertyType({
264
- apiName: "mySpt",
265
- type: "string"
266
- });
267
- const exampleInterface = defineInterface({
268
- apiName: "exampleInterface",
269
- icon: {
270
- color: "#c7cdd6ff",
271
- locator: "globe"
272
- },
273
- properties: {
274
- mySpt,
275
- property1: "string",
276
- property2: exampleStructPropertyType
277
- }
278
- });
279
- const exampleObjectType = defineObject({
280
- titlePropertyApiName: "bar",
281
- displayName: "exampleObjectType",
282
- pluralDisplayName: "exampleObjectTypes",
283
- apiName: "foo",
284
- primaryKeyPropertyApiName: "bar",
285
- properties: {
286
- "bar": {
287
- type: "string"
288
- },
289
- "property1": {
290
- type: "string"
291
- },
292
- "property2": {
293
- type: {
294
- type: "struct",
295
- structDefinition: {
296
- simpleProperty: "string"
297
- }
298
- }
299
- }
300
- },
301
- implementsInterfaces: [{
302
- implements: exampleInterface,
303
- propertyMapping: [{
304
- interfaceProperty: "com.palantir.mySpt",
305
- mapsTo: "bar"
306
- }, {
307
- interfaceProperty: "com.palantir.property1",
308
- mapsTo: "property1"
309
- }, {
310
- interfaceProperty: "com.palantir.property2",
311
- mapsTo: "property2"
312
- }]
313
- }]
314
- });
315
- defineCreateInterfaceObjectAction({
316
- interfaceType: exampleInterface,
317
- objectType: exampleObjectType
318
- });
319
- defineModifyInterfaceObjectAction({
320
- interfaceType: exampleInterface,
321
- objectType: exampleObjectType
322
- });
323
- expect(dumpOntologyFullMetadata()).toMatchInlineSnapshot(`
363
+ `);});it("Simple interface actions (with object types) are properly defined",()=>{const exampleStructPropertyType=defineSharedPropertyType({apiName:"property2",type:{type:"struct",structDefinition:{simpleProperty:"string"}}});const mySpt=defineSharedPropertyType({apiName:"mySpt",type:"string"});const exampleInterface=defineInterface({apiName:"exampleInterface",icon:{color:"#c7cdd6ff",locator:"globe"},properties:{mySpt,property1:"string",property2:exampleStructPropertyType}});const exampleObjectType=defineObject({titlePropertyApiName:"bar",displayName:"exampleObjectType",pluralDisplayName:"exampleObjectTypes",apiName:"foo",primaryKeyPropertyApiName:"bar",properties:{"bar":{type:"string"},"property1":{type:"string"},"property2":{type:{type:"struct",structDefinition:{simpleProperty:"string"}}}},implementsInterfaces:[{implements:exampleInterface,propertyMapping:[{interfaceProperty:"com.palantir.mySpt",mapsTo:"bar"},{interfaceProperty:"com.palantir.property1",mapsTo:"property1"},{interfaceProperty:"com.palantir.property2",mapsTo:"property2"}]}]});defineCreateInterfaceObjectAction({interfaceType:exampleInterface,objectType:exampleObjectType});defineModifyInterfaceObjectAction({interfaceType:exampleInterface,objectType:exampleObjectType});expect(dumpOntologyFullMetadata()).toMatchInlineSnapshot(`
324
364
  {
325
365
  "importedOntology": {
326
366
  "actionTypes": {},
@@ -1301,22 +1341,7 @@ describe("Action Types", () => {
1301
1341
  "valueTypes": [],
1302
1342
  },
1303
1343
  }
1304
- `);
1305
- });
1306
- it("Simple interface actions (without object types) are properly defined", () => {
1307
- const exampleInterface = defineInterface({
1308
- apiName: "exampleInterface",
1309
- properties: {
1310
- property1: "string"
1311
- }
1312
- });
1313
- defineCreateInterfaceObjectAction({
1314
- interfaceType: exampleInterface
1315
- });
1316
- defineModifyInterfaceObjectAction({
1317
- interfaceType: exampleInterface
1318
- });
1319
- expect(dumpOntologyFullMetadata()).toMatchInlineSnapshot(`
1344
+ `);});it("Simple interface actions (without object types) are properly defined",()=>{const exampleInterface=defineInterface({apiName:"exampleInterface",properties:{property1:"string"}});defineCreateInterfaceObjectAction({interfaceType:exampleInterface});defineModifyInterfaceObjectAction({interfaceType:exampleInterface});expect(dumpOntologyFullMetadata()).toMatchInlineSnapshot(`
1320
1345
  {
1321
1346
  "importedOntology": {
1322
1347
  "actionTypes": {},
@@ -1804,1419 +1829,1549 @@ describe("Action Types", () => {
1804
1829
  "valueTypes": [],
1805
1830
  },
1806
1831
  }
1807
- `);
1808
- });
1809
- it("Interface actions with customizations are properly defined", () => {
1810
- const property1 = defineSharedPropertyType({
1811
- apiName: "property1",
1812
- type: "string"
1813
- });
1814
- const property2 = defineSharedPropertyType({
1815
- apiName: "property2",
1816
- type: "string"
1817
- });
1818
- const property3 = defineSharedPropertyType({
1819
- apiName: "property3",
1820
- type: "string"
1821
- });
1822
- const exampleInterface = defineInterface({
1823
- apiName: "exampleInterface",
1824
- properties: {
1825
- property1,
1826
- property2,
1827
- property3
1828
- }
1829
- });
1830
- defineCreateInterfaceObjectAction({
1831
- interfaceType: exampleInterface,
1832
- apiName: "custom-api-name-1",
1833
- displayName: "Custom Create Action",
1834
- status: "experimental",
1835
- parameterConfiguration: {
1836
- [property3.apiName]: {
1837
- required: false,
1838
- conditionalOverrides: [{
1839
- type: "required",
1840
- condition: {
1841
- type: "and",
1842
- conditions: [{
1843
- type: "group",
1844
- name: "parameterLevelGroup"
1845
- }, {
1846
- type: "parameter",
1847
- parameterId: property1.apiName,
1848
- matches: {
1849
- type: "staticValue",
1850
- staticValue: {
1851
- type: "string",
1852
- string: "bar"
1853
- }
1854
- }
1855
- }]
1856
- }
1857
- }],
1858
- defaultValue: {
1859
- type: "staticValue",
1860
- staticValue: {
1861
- type: "string",
1862
- string: "default_fizz"
1863
- }
1864
- },
1865
- displayName: "fizz_display",
1866
- description: "fizz_description"
1867
- }
1868
- },
1869
- excludedProperties: [property2.apiName],
1870
- parameterOrdering: [property1.apiName, property3.apiName]
1871
- });
1872
- defineModifyInterfaceObjectAction({
1873
- interfaceType: exampleInterface,
1874
- apiName: "custom-api-name-2",
1875
- displayName: "Custom Modify Action",
1876
- status: "experimental",
1877
- parameterConfiguration: {
1878
- [property3.apiName]: {
1879
- required: false,
1880
- conditionalOverrides: [{
1881
- type: "required",
1882
- condition: {
1883
- type: "and",
1884
- conditions: [{
1885
- type: "group",
1886
- name: "parameterLevelGroup"
1887
- }, {
1888
- type: "parameter",
1889
- parameterId: property1.apiName,
1890
- matches: {
1891
- type: "staticValue",
1892
- staticValue: {
1893
- type: "string",
1894
- string: "bar"
1895
- }
1896
- }
1897
- }]
1898
- }
1899
- }],
1900
- defaultValue: {
1901
- type: "staticValue",
1902
- staticValue: {
1903
- type: "string",
1904
- string: "default_fizz"
1905
- }
1906
- },
1907
- displayName: "fizz_display",
1908
- description: "fizz_description"
1909
- }
1910
- },
1911
- excludedProperties: [property2.apiName],
1912
- parameterOrdering: [property1.apiName, property3.apiName]
1913
- });
1914
- expect(dumpOntologyFullMetadata()).toMatchInlineSnapshot(`
1915
- {
1916
- "importedOntology": {
1832
+ `);});it("Interface actions with customizations are properly defined",()=>{const property1=defineSharedPropertyType({apiName:"property1",type:"string"});const property2=defineSharedPropertyType({apiName:"property2",type:"string"});const property3=defineSharedPropertyType({apiName:"property3",type:"string"});const exampleInterface=defineInterface({apiName:"exampleInterface",properties:{property1,property2,property3}});defineCreateInterfaceObjectAction({interfaceType:exampleInterface,apiName:"custom-api-name-1",displayName:"Custom Create Action",status:"experimental",parameterConfiguration:{[property3.apiName]:{required:false,conditionalOverrides:[{type:"required",condition:{type:"and",conditions:[{type:"group",name:"parameterLevelGroup"},{type:"parameter",parameterId:property1.apiName,matches:{type:"staticValue",staticValue:{type:"string",string:"bar"}}}]}}],defaultValue:{type:"staticValue",staticValue:{type:"string",string:"default_fizz"}},displayName:"fizz_display",description:"fizz_description"}},excludedProperties:[property2.apiName],parameterOrdering:[property1.apiName,property3.apiName],enableLayoutSwitch:true,submissionMetadata:{successMessage:"Custom success message",undoButtonConfiguration:true,submitButtonDisplayMetadata:{intent:"DANGER",text:"Custom button"}}});defineModifyInterfaceObjectAction({interfaceType:exampleInterface,apiName:"custom-api-name-2",displayName:"Custom Modify Action",status:"experimental",parameterConfiguration:{[property3.apiName]:{required:false,conditionalOverrides:[{type:"required",condition:{type:"and",conditions:[{type:"group",name:"parameterLevelGroup"},{type:"parameter",parameterId:property1.apiName,matches:{type:"staticValue",staticValue:{type:"string",string:"bar"}}}]}}],defaultValue:{type:"staticValue",staticValue:{type:"string",string:"default_fizz"}},displayName:"fizz_display",description:"fizz_description"}},excludedProperties:[property2.apiName],parameterOrdering:[property1.apiName,property3.apiName],enableLayoutSwitch:true,submissionMetadata:{successMessage:"Custom success message",undoButtonConfiguration:true,submitButtonDisplayMetadata:{intent:"DANGER",text:"Custom button"}}});expect(dumpOntologyFullMetadata()).toMatchInlineSnapshot(`
1833
+ {
1834
+ "importedOntology": {
1835
+ "actionTypes": {},
1836
+ "blockPermissionInformation": {
1917
1837
  "actionTypes": {},
1918
- "blockPermissionInformation": {
1919
- "actionTypes": {},
1920
- "linkTypes": {},
1921
- "objectTypes": {},
1922
- },
1923
- "interfaceTypes": {},
1924
1838
  "linkTypes": {},
1925
1839
  "objectTypes": {},
1926
- "sharedPropertyTypes": {},
1927
- },
1928
- "importedValueTypes": {
1929
- "valueTypes": [],
1930
1840
  },
1931
- "ontology": {
1932
- "actionTypes": {
1933
- "com.palantir.custom-api-name-1": {
1934
- "actionType": {
1935
- "actionTypeLogic": {
1936
- "logic": {
1937
- "rules": [
1938
- {
1939
- "addInterfaceRule": {
1940
- "interfaceApiName": "com.palantir.exampleInterface",
1941
- "objectTypeParameter": "objectTypeParameter",
1942
- "sharedPropertyValues": {
1943
- "com.palantir.property1": {
1944
- "parameterId": "com.palantir.property1",
1945
- "type": "parameterId",
1946
- },
1947
- "com.palantir.property3": {
1948
- "parameterId": "com.palantir.property3",
1949
- "type": "parameterId",
1950
- },
1841
+ "interfaceTypes": {},
1842
+ "linkTypes": {},
1843
+ "objectTypes": {},
1844
+ "sharedPropertyTypes": {},
1845
+ },
1846
+ "importedValueTypes": {
1847
+ "valueTypes": [],
1848
+ },
1849
+ "ontology": {
1850
+ "actionTypes": {
1851
+ "com.palantir.custom-api-name-1": {
1852
+ "actionType": {
1853
+ "actionTypeLogic": {
1854
+ "logic": {
1855
+ "rules": [
1856
+ {
1857
+ "addInterfaceRule": {
1858
+ "interfaceApiName": "com.palantir.exampleInterface",
1859
+ "objectTypeParameter": "objectTypeParameter",
1860
+ "sharedPropertyValues": {
1861
+ "com.palantir.property1": {
1862
+ "parameterId": "com.palantir.property1",
1863
+ "type": "parameterId",
1864
+ },
1865
+ "com.palantir.property3": {
1866
+ "parameterId": "com.palantir.property3",
1867
+ "type": "parameterId",
1951
1868
  },
1952
1869
  },
1953
- "type": "addInterfaceRule",
1954
1870
  },
1955
- ],
1956
- },
1957
- "validation": {
1958
- "actionTypeLevelValidation": {
1959
- "rules": {
1960
- "0": {
1961
- "condition": {
1962
- "true": {},
1963
- "type": "true",
1964
- },
1965
- "displayMetadata": {
1966
- "failureMessage": "",
1967
- "typeClasses": [],
1968
- },
1871
+ "type": "addInterfaceRule",
1872
+ },
1873
+ ],
1874
+ },
1875
+ "validation": {
1876
+ "actionTypeLevelValidation": {
1877
+ "rules": {
1878
+ "0": {
1879
+ "condition": {
1880
+ "true": {},
1881
+ "type": "true",
1882
+ },
1883
+ "displayMetadata": {
1884
+ "failureMessage": "",
1885
+ "typeClasses": [],
1969
1886
  },
1970
1887
  },
1971
1888
  },
1972
- "parameterValidations": {
1973
- "com.palantir.property1": {
1974
- "conditionalOverrides": [],
1975
- "defaultValidation": {
1976
- "display": {
1977
- "renderHint": {
1978
- "textInput": {},
1979
- "type": "textInput",
1980
- },
1981
- "visibility": {
1982
- "editable": {},
1983
- "type": "editable",
1984
- },
1889
+ },
1890
+ "parameterValidations": {
1891
+ "com.palantir.property1": {
1892
+ "conditionalOverrides": [],
1893
+ "defaultValidation": {
1894
+ "display": {
1895
+ "renderHint": {
1896
+ "textInput": {},
1897
+ "type": "textInput",
1985
1898
  },
1986
- "validation": {
1987
- "allowedValues": {
1988
- "text": {
1989
- "text": {},
1990
- "type": "text",
1991
- },
1899
+ "visibility": {
1900
+ "editable": {},
1901
+ "type": "editable",
1902
+ },
1903
+ },
1904
+ "validation": {
1905
+ "allowedValues": {
1906
+ "text": {
1907
+ "text": {},
1992
1908
  "type": "text",
1993
1909
  },
1994
- "required": {
1995
- "required": {},
1996
- "type": "required",
1997
- },
1910
+ "type": "text",
1911
+ },
1912
+ "required": {
1913
+ "required": {},
1914
+ "type": "required",
1998
1915
  },
1999
1916
  },
2000
1917
  },
2001
- "com.palantir.property3": {
2002
- "conditionalOverrides": [
2003
- {
2004
- "condition": {
2005
- "and": {
2006
- "conditions": [
2007
- {
2008
- "comparison": {
2009
- "left": {
2010
- "type": "userProperty",
2011
- "userProperty": {
2012
- "propertyValue": {
2013
- "groupIds": {},
2014
- "type": "groupIds",
2015
- },
2016
- "userId": {
2017
- "currentUser": {},
2018
- "type": "currentUser",
2019
- },
1918
+ },
1919
+ "com.palantir.property3": {
1920
+ "conditionalOverrides": [
1921
+ {
1922
+ "condition": {
1923
+ "and": {
1924
+ "conditions": [
1925
+ {
1926
+ "comparison": {
1927
+ "left": {
1928
+ "type": "userProperty",
1929
+ "userProperty": {
1930
+ "propertyValue": {
1931
+ "groupIds": {},
1932
+ "type": "groupIds",
2020
1933
  },
2021
- },
2022
- "operator": "INTERSECTS",
2023
- "right": {
2024
- "staticValue": {
2025
- "stringList": {
2026
- "strings": [
2027
- "parameterLevelGroup",
2028
- ],
2029
- },
2030
- "type": "stringList",
1934
+ "userId": {
1935
+ "currentUser": {},
1936
+ "type": "currentUser",
2031
1937
  },
2032
- "type": "staticValue",
2033
1938
  },
2034
1939
  },
2035
- "type": "comparison",
2036
- },
2037
- {
2038
- "comparison": {
2039
- "left": {
2040
- "parameterId": "com.palantir.property1",
2041
- "type": "parameterId",
2042
- },
2043
- "operator": "EQUALS",
2044
- "right": {
2045
- "staticValue": {
2046
- "string": "bar",
2047
- "type": "string",
1940
+ "operator": "INTERSECTS",
1941
+ "right": {
1942
+ "staticValue": {
1943
+ "stringList": {
1944
+ "strings": [
1945
+ "parameterLevelGroup",
1946
+ ],
2048
1947
  },
2049
- "type": "staticValue",
1948
+ "type": "stringList",
2050
1949
  },
1950
+ "type": "staticValue",
2051
1951
  },
2052
- "type": "comparison",
2053
1952
  },
2054
- ],
2055
- },
2056
- "type": "and",
2057
- },
2058
- "parameterBlockOverrides": [
2059
- {
2060
- "parameterRequired": {
2061
- "required": {
2062
- "required": {},
2063
- "type": "required",
1953
+ "type": "comparison",
1954
+ },
1955
+ {
1956
+ "comparison": {
1957
+ "left": {
1958
+ "parameterId": "com.palantir.property1",
1959
+ "type": "parameterId",
1960
+ },
1961
+ "operator": "EQUALS",
1962
+ "right": {
1963
+ "staticValue": {
1964
+ "string": "bar",
1965
+ "type": "string",
1966
+ },
1967
+ "type": "staticValue",
1968
+ },
2064
1969
  },
1970
+ "type": "comparison",
2065
1971
  },
2066
- "type": "parameterRequired",
2067
- },
2068
- ],
1972
+ ],
1973
+ },
1974
+ "type": "and",
2069
1975
  },
2070
- ],
2071
- "defaultValidation": {
2072
- "display": {
2073
- "prefill": {
2074
- "staticValue": {
2075
- "string": "default_fizz",
2076
- "type": "string",
1976
+ "parameterBlockOverrides": [
1977
+ {
1978
+ "parameterRequired": {
1979
+ "required": {
1980
+ "required": {},
1981
+ "type": "required",
1982
+ },
2077
1983
  },
2078
- "type": "staticValue",
2079
- },
2080
- "renderHint": {
2081
- "textInput": {},
2082
- "type": "textInput",
1984
+ "type": "parameterRequired",
2083
1985
  },
2084
- "visibility": {
2085
- "editable": {},
2086
- "type": "editable",
1986
+ ],
1987
+ },
1988
+ ],
1989
+ "defaultValidation": {
1990
+ "display": {
1991
+ "prefill": {
1992
+ "staticValue": {
1993
+ "string": "default_fizz",
1994
+ "type": "string",
2087
1995
  },
1996
+ "type": "staticValue",
2088
1997
  },
2089
- "validation": {
2090
- "allowedValues": {
2091
- "text": {
2092
- "text": {},
2093
- "type": "text",
2094
- },
1998
+ "renderHint": {
1999
+ "textInput": {},
2000
+ "type": "textInput",
2001
+ },
2002
+ "visibility": {
2003
+ "editable": {},
2004
+ "type": "editable",
2005
+ },
2006
+ },
2007
+ "validation": {
2008
+ "allowedValues": {
2009
+ "text": {
2010
+ "text": {},
2095
2011
  "type": "text",
2096
2012
  },
2097
- "required": {
2098
- "notRequired": {},
2099
- "type": "notRequired",
2100
- },
2013
+ "type": "text",
2014
+ },
2015
+ "required": {
2016
+ "notRequired": {},
2017
+ "type": "notRequired",
2101
2018
  },
2102
2019
  },
2103
2020
  },
2104
- "objectTypeParameter": {
2105
- "conditionalOverrides": [],
2106
- "defaultValidation": {
2107
- "display": {
2108
- "renderHint": {
2109
- "dropdown": {},
2110
- "type": "dropdown",
2111
- },
2112
- "visibility": {
2113
- "editable": {},
2114
- "type": "editable",
2115
- },
2021
+ },
2022
+ "objectTypeParameter": {
2023
+ "conditionalOverrides": [],
2024
+ "defaultValidation": {
2025
+ "display": {
2026
+ "renderHint": {
2027
+ "dropdown": {},
2028
+ "type": "dropdown",
2116
2029
  },
2117
- "validation": {
2118
- "allowedValues": {
2030
+ "visibility": {
2031
+ "editable": {},
2032
+ "type": "editable",
2033
+ },
2034
+ },
2035
+ "validation": {
2036
+ "allowedValues": {
2037
+ "objectTypeReference": {
2119
2038
  "objectTypeReference": {
2120
- "objectTypeReference": {
2121
- "interfaceTypeRids": [
2122
- "com.palantir.exampleInterface",
2123
- ],
2124
- },
2125
- "type": "objectTypeReference",
2039
+ "interfaceTypeRids": [
2040
+ "com.palantir.exampleInterface",
2041
+ ],
2126
2042
  },
2127
2043
  "type": "objectTypeReference",
2128
2044
  },
2129
- "required": {
2130
- "required": {},
2131
- "type": "required",
2132
- },
2045
+ "type": "objectTypeReference",
2046
+ },
2047
+ "required": {
2048
+ "required": {},
2049
+ "type": "required",
2133
2050
  },
2134
2051
  },
2135
2052
  },
2136
2053
  },
2137
- "sectionValidations": {},
2138
2054
  },
2055
+ "sectionValidations": {},
2139
2056
  },
2140
- "metadata": {
2141
- "apiName": "com.palantir.custom-api-name-1",
2142
- "displayMetadata": {
2143
- "configuration": {
2144
- "defaultLayout": "FORM",
2145
- "displayAndFormat": {
2146
- "table": {
2147
- "columnWidthByParameterRid": {},
2148
- "enableFileImport": true,
2149
- "fitHorizontally": false,
2150
- "frozenColumnCount": 0,
2151
- "rowHeightInLines": 1,
2152
- },
2057
+ },
2058
+ "metadata": {
2059
+ "apiName": "com.palantir.custom-api-name-1",
2060
+ "displayMetadata": {
2061
+ "configuration": {
2062
+ "defaultLayout": "FORM",
2063
+ "displayAndFormat": {
2064
+ "table": {
2065
+ "columnWidthByParameterRid": {},
2066
+ "enableFileImport": true,
2067
+ "fitHorizontally": false,
2068
+ "frozenColumnCount": 0,
2069
+ "rowHeightInLines": 1,
2153
2070
  },
2154
- "enableLayoutUserSwitch": false,
2155
2071
  },
2156
- "description": "",
2157
- "displayName": "Custom Create Action",
2158
- "icon": {
2159
- "blueprint": {
2160
- "color": "#000000",
2161
- "locator": "edit",
2162
- },
2163
- "type": "blueprint",
2072
+ "enableLayoutUserSwitch": true,
2073
+ },
2074
+ "description": "",
2075
+ "displayName": "Custom Create Action",
2076
+ "icon": {
2077
+ "blueprint": {
2078
+ "color": "#000000",
2079
+ "locator": "edit",
2164
2080
  },
2165
- "successMessage": [],
2166
- "typeClasses": [],
2081
+ "type": "blueprint",
2167
2082
  },
2168
- "entities": {
2169
- "affectedInterfaceTypes": [
2170
- "com.palantir.exampleInterface",
2171
- ],
2172
- "affectedLinkTypes": [],
2173
- "affectedObjectTypes": [],
2174
- "typeGroups": [],
2083
+ "submitButtonDisplayMetadata": {
2084
+ "intent": "DANGER",
2085
+ "text": "Custom button",
2175
2086
  },
2176
- "formContentOrdering": [],
2177
- "parameterOrdering": [
2178
- "objectTypeParameter",
2179
- "com.palantir.property1",
2180
- "com.palantir.property3",
2087
+ "successMessage": [
2088
+ {
2089
+ "message": "Custom success message",
2090
+ "type": "message",
2091
+ },
2181
2092
  ],
2182
- "parameters": {
2183
- "com.palantir.property1": {
2184
- "displayMetadata": {
2185
- "description": "",
2186
- "displayName": "property1",
2187
- "typeClasses": [],
2188
- },
2189
- "id": "com.palantir.property1",
2190
- "type": {
2191
- "string": {},
2192
- "type": "string",
2193
- },
2093
+ "typeClasses": [],
2094
+ "undoButtonConfiguration": true,
2095
+ },
2096
+ "entities": {
2097
+ "affectedInterfaceTypes": [
2098
+ "com.palantir.exampleInterface",
2099
+ ],
2100
+ "affectedLinkTypes": [],
2101
+ "affectedObjectTypes": [],
2102
+ "typeGroups": [],
2103
+ },
2104
+ "formContentOrdering": [],
2105
+ "parameterOrdering": [
2106
+ "objectTypeParameter",
2107
+ "com.palantir.property1",
2108
+ "com.palantir.property3",
2109
+ ],
2110
+ "parameters": {
2111
+ "com.palantir.property1": {
2112
+ "displayMetadata": {
2113
+ "description": "",
2114
+ "displayName": "property1",
2115
+ "typeClasses": [],
2194
2116
  },
2195
- "com.palantir.property3": {
2196
- "displayMetadata": {
2197
- "description": "fizz_description",
2198
- "displayName": "fizz_display",
2199
- "typeClasses": [],
2200
- },
2201
- "id": "com.palantir.property3",
2202
- "type": {
2203
- "string": {},
2204
- "type": "string",
2205
- },
2117
+ "id": "com.palantir.property1",
2118
+ "type": {
2119
+ "string": {},
2120
+ "type": "string",
2206
2121
  },
2207
- "objectTypeParameter": {
2208
- "displayMetadata": {
2209
- "description": "",
2210
- "displayName": "Object type to create",
2211
- "typeClasses": [],
2212
- },
2213
- "id": "objectTypeParameter",
2214
- "type": {
2215
- "objectTypeReference": {
2216
- "interfaceTypeRids": [
2217
- "com.palantir.exampleInterface",
2218
- ],
2219
- },
2220
- "type": "objectTypeReference",
2221
- },
2122
+ },
2123
+ "com.palantir.property3": {
2124
+ "displayMetadata": {
2125
+ "description": "fizz_description",
2126
+ "displayName": "fizz_display",
2127
+ "typeClasses": [],
2128
+ },
2129
+ "id": "com.palantir.property3",
2130
+ "type": {
2131
+ "string": {},
2132
+ "type": "string",
2222
2133
  },
2223
2134
  },
2224
- "sections": {},
2225
- "status": {
2226
- "experimental": {},
2227
- "type": "experimental",
2135
+ "objectTypeParameter": {
2136
+ "displayMetadata": {
2137
+ "description": "",
2138
+ "displayName": "Object type to create",
2139
+ "typeClasses": [],
2140
+ },
2141
+ "id": "objectTypeParameter",
2142
+ "type": {
2143
+ "objectTypeReference": {
2144
+ "interfaceTypeRids": [
2145
+ "com.palantir.exampleInterface",
2146
+ ],
2147
+ },
2148
+ "type": "objectTypeReference",
2149
+ },
2228
2150
  },
2229
2151
  },
2152
+ "sections": {},
2153
+ "status": {
2154
+ "experimental": {},
2155
+ "type": "experimental",
2156
+ },
2230
2157
  },
2231
2158
  },
2232
- "com.palantir.custom-api-name-2": {
2233
- "actionType": {
2234
- "actionTypeLogic": {
2235
- "logic": {
2236
- "rules": [
2237
- {
2238
- "modifyInterfaceRule": {
2239
- "interfaceObjectToModifyParameter": "interfaceObjectToModifyParameter",
2240
- "sharedPropertyValues": {
2241
- "com.palantir.property1": {
2242
- "parameterId": "com.palantir.property1",
2243
- "type": "parameterId",
2244
- },
2245
- "com.palantir.property3": {
2246
- "parameterId": "com.palantir.property3",
2247
- "type": "parameterId",
2248
- },
2159
+ },
2160
+ "com.palantir.custom-api-name-2": {
2161
+ "actionType": {
2162
+ "actionTypeLogic": {
2163
+ "logic": {
2164
+ "rules": [
2165
+ {
2166
+ "modifyInterfaceRule": {
2167
+ "interfaceObjectToModifyParameter": "interfaceObjectToModifyParameter",
2168
+ "sharedPropertyValues": {
2169
+ "com.palantir.property1": {
2170
+ "parameterId": "com.palantir.property1",
2171
+ "type": "parameterId",
2172
+ },
2173
+ "com.palantir.property3": {
2174
+ "parameterId": "com.palantir.property3",
2175
+ "type": "parameterId",
2249
2176
  },
2250
2177
  },
2251
- "type": "modifyInterfaceRule",
2252
2178
  },
2253
- ],
2254
- },
2255
- "validation": {
2256
- "actionTypeLevelValidation": {
2257
- "rules": {
2258
- "0": {
2259
- "condition": {
2260
- "true": {},
2261
- "type": "true",
2262
- },
2263
- "displayMetadata": {
2264
- "failureMessage": "",
2265
- "typeClasses": [],
2266
- },
2179
+ "type": "modifyInterfaceRule",
2180
+ },
2181
+ ],
2182
+ },
2183
+ "validation": {
2184
+ "actionTypeLevelValidation": {
2185
+ "rules": {
2186
+ "0": {
2187
+ "condition": {
2188
+ "true": {},
2189
+ "type": "true",
2190
+ },
2191
+ "displayMetadata": {
2192
+ "failureMessage": "",
2193
+ "typeClasses": [],
2267
2194
  },
2268
2195
  },
2269
2196
  },
2270
- "parameterValidations": {
2271
- "com.palantir.property1": {
2272
- "conditionalOverrides": [],
2273
- "defaultValidation": {
2274
- "display": {
2275
- "renderHint": {
2276
- "textInput": {},
2277
- "type": "textInput",
2278
- },
2279
- "visibility": {
2280
- "editable": {},
2281
- "type": "editable",
2282
- },
2197
+ },
2198
+ "parameterValidations": {
2199
+ "com.palantir.property1": {
2200
+ "conditionalOverrides": [],
2201
+ "defaultValidation": {
2202
+ "display": {
2203
+ "renderHint": {
2204
+ "textInput": {},
2205
+ "type": "textInput",
2283
2206
  },
2284
- "validation": {
2285
- "allowedValues": {
2286
- "text": {
2287
- "text": {},
2288
- "type": "text",
2289
- },
2207
+ "visibility": {
2208
+ "editable": {},
2209
+ "type": "editable",
2210
+ },
2211
+ },
2212
+ "validation": {
2213
+ "allowedValues": {
2214
+ "text": {
2215
+ "text": {},
2290
2216
  "type": "text",
2291
2217
  },
2292
- "required": {
2293
- "required": {},
2294
- "type": "required",
2295
- },
2218
+ "type": "text",
2219
+ },
2220
+ "required": {
2221
+ "required": {},
2222
+ "type": "required",
2296
2223
  },
2297
2224
  },
2298
2225
  },
2299
- "com.palantir.property3": {
2300
- "conditionalOverrides": [
2301
- {
2302
- "condition": {
2303
- "and": {
2304
- "conditions": [
2305
- {
2306
- "comparison": {
2307
- "left": {
2308
- "type": "userProperty",
2309
- "userProperty": {
2310
- "propertyValue": {
2311
- "groupIds": {},
2312
- "type": "groupIds",
2313
- },
2314
- "userId": {
2315
- "currentUser": {},
2316
- "type": "currentUser",
2317
- },
2226
+ },
2227
+ "com.palantir.property3": {
2228
+ "conditionalOverrides": [
2229
+ {
2230
+ "condition": {
2231
+ "and": {
2232
+ "conditions": [
2233
+ {
2234
+ "comparison": {
2235
+ "left": {
2236
+ "type": "userProperty",
2237
+ "userProperty": {
2238
+ "propertyValue": {
2239
+ "groupIds": {},
2240
+ "type": "groupIds",
2318
2241
  },
2319
- },
2320
- "operator": "INTERSECTS",
2321
- "right": {
2322
- "staticValue": {
2323
- "stringList": {
2324
- "strings": [
2325
- "parameterLevelGroup",
2326
- ],
2327
- },
2328
- "type": "stringList",
2242
+ "userId": {
2243
+ "currentUser": {},
2244
+ "type": "currentUser",
2329
2245
  },
2330
- "type": "staticValue",
2331
2246
  },
2332
2247
  },
2333
- "type": "comparison",
2334
- },
2335
- {
2336
- "comparison": {
2337
- "left": {
2338
- "parameterId": "com.palantir.property1",
2339
- "type": "parameterId",
2340
- },
2341
- "operator": "EQUALS",
2342
- "right": {
2343
- "staticValue": {
2344
- "string": "bar",
2345
- "type": "string",
2248
+ "operator": "INTERSECTS",
2249
+ "right": {
2250
+ "staticValue": {
2251
+ "stringList": {
2252
+ "strings": [
2253
+ "parameterLevelGroup",
2254
+ ],
2346
2255
  },
2347
- "type": "staticValue",
2256
+ "type": "stringList",
2348
2257
  },
2258
+ "type": "staticValue",
2349
2259
  },
2350
- "type": "comparison",
2351
2260
  },
2352
- ],
2353
- },
2354
- "type": "and",
2355
- },
2356
- "parameterBlockOverrides": [
2357
- {
2358
- "parameterRequired": {
2359
- "required": {
2360
- "required": {},
2361
- "type": "required",
2261
+ "type": "comparison",
2262
+ },
2263
+ {
2264
+ "comparison": {
2265
+ "left": {
2266
+ "parameterId": "com.palantir.property1",
2267
+ "type": "parameterId",
2268
+ },
2269
+ "operator": "EQUALS",
2270
+ "right": {
2271
+ "staticValue": {
2272
+ "string": "bar",
2273
+ "type": "string",
2274
+ },
2275
+ "type": "staticValue",
2276
+ },
2362
2277
  },
2278
+ "type": "comparison",
2363
2279
  },
2364
- "type": "parameterRequired",
2365
- },
2366
- ],
2280
+ ],
2281
+ },
2282
+ "type": "and",
2367
2283
  },
2368
- ],
2369
- "defaultValidation": {
2370
- "display": {
2371
- "prefill": {
2372
- "staticValue": {
2373
- "string": "default_fizz",
2374
- "type": "string",
2284
+ "parameterBlockOverrides": [
2285
+ {
2286
+ "parameterRequired": {
2287
+ "required": {
2288
+ "required": {},
2289
+ "type": "required",
2290
+ },
2375
2291
  },
2376
- "type": "staticValue",
2377
- },
2378
- "renderHint": {
2379
- "textInput": {},
2380
- "type": "textInput",
2292
+ "type": "parameterRequired",
2381
2293
  },
2382
- "visibility": {
2383
- "editable": {},
2384
- "type": "editable",
2294
+ ],
2295
+ },
2296
+ ],
2297
+ "defaultValidation": {
2298
+ "display": {
2299
+ "prefill": {
2300
+ "staticValue": {
2301
+ "string": "default_fizz",
2302
+ "type": "string",
2385
2303
  },
2304
+ "type": "staticValue",
2386
2305
  },
2387
- "validation": {
2388
- "allowedValues": {
2389
- "text": {
2390
- "text": {},
2391
- "type": "text",
2392
- },
2306
+ "renderHint": {
2307
+ "textInput": {},
2308
+ "type": "textInput",
2309
+ },
2310
+ "visibility": {
2311
+ "editable": {},
2312
+ "type": "editable",
2313
+ },
2314
+ },
2315
+ "validation": {
2316
+ "allowedValues": {
2317
+ "text": {
2318
+ "text": {},
2393
2319
  "type": "text",
2394
2320
  },
2395
- "required": {
2396
- "notRequired": {},
2397
- "type": "notRequired",
2398
- },
2321
+ "type": "text",
2322
+ },
2323
+ "required": {
2324
+ "notRequired": {},
2325
+ "type": "notRequired",
2399
2326
  },
2400
2327
  },
2401
2328
  },
2402
- "interfaceObjectToModifyParameter": {
2403
- "conditionalOverrides": [],
2404
- "defaultValidation": {
2405
- "display": {
2406
- "renderHint": {
2407
- "dropdown": {},
2408
- "type": "dropdown",
2409
- },
2410
- "visibility": {
2411
- "editable": {},
2412
- "type": "editable",
2413
- },
2329
+ },
2330
+ "interfaceObjectToModifyParameter": {
2331
+ "conditionalOverrides": [],
2332
+ "defaultValidation": {
2333
+ "display": {
2334
+ "renderHint": {
2335
+ "dropdown": {},
2336
+ "type": "dropdown",
2414
2337
  },
2415
- "validation": {
2416
- "allowedValues": {
2417
- "interfaceObjectQuery": {
2418
- "interfaceObjectQuery": {},
2419
- "type": "interfaceObjectQuery",
2420
- },
2338
+ "visibility": {
2339
+ "editable": {},
2340
+ "type": "editable",
2341
+ },
2342
+ },
2343
+ "validation": {
2344
+ "allowedValues": {
2345
+ "interfaceObjectQuery": {
2346
+ "interfaceObjectQuery": {},
2421
2347
  "type": "interfaceObjectQuery",
2422
2348
  },
2423
- "required": {
2424
- "required": {},
2425
- "type": "required",
2426
- },
2349
+ "type": "interfaceObjectQuery",
2350
+ },
2351
+ "required": {
2352
+ "required": {},
2353
+ "type": "required",
2427
2354
  },
2428
2355
  },
2429
2356
  },
2430
2357
  },
2431
- "sectionValidations": {},
2432
2358
  },
2359
+ "sectionValidations": {},
2433
2360
  },
2434
- "metadata": {
2435
- "apiName": "com.palantir.custom-api-name-2",
2436
- "displayMetadata": {
2437
- "configuration": {
2438
- "defaultLayout": "FORM",
2439
- "displayAndFormat": {
2440
- "table": {
2441
- "columnWidthByParameterRid": {},
2442
- "enableFileImport": true,
2443
- "fitHorizontally": false,
2444
- "frozenColumnCount": 0,
2445
- "rowHeightInLines": 1,
2446
- },
2361
+ },
2362
+ "metadata": {
2363
+ "apiName": "com.palantir.custom-api-name-2",
2364
+ "displayMetadata": {
2365
+ "configuration": {
2366
+ "defaultLayout": "FORM",
2367
+ "displayAndFormat": {
2368
+ "table": {
2369
+ "columnWidthByParameterRid": {},
2370
+ "enableFileImport": true,
2371
+ "fitHorizontally": false,
2372
+ "frozenColumnCount": 0,
2373
+ "rowHeightInLines": 1,
2447
2374
  },
2448
- "enableLayoutUserSwitch": false,
2449
2375
  },
2450
- "description": "",
2451
- "displayName": "Custom Modify Action",
2452
- "icon": {
2453
- "blueprint": {
2454
- "color": "#000000",
2455
- "locator": "edit",
2456
- },
2457
- "type": "blueprint",
2376
+ "enableLayoutUserSwitch": true,
2377
+ },
2378
+ "description": "",
2379
+ "displayName": "Custom Modify Action",
2380
+ "icon": {
2381
+ "blueprint": {
2382
+ "color": "#000000",
2383
+ "locator": "edit",
2458
2384
  },
2459
- "successMessage": [],
2460
- "typeClasses": [],
2385
+ "type": "blueprint",
2461
2386
  },
2462
- "entities": {
2463
- "affectedInterfaceTypes": [
2464
- "com.palantir.exampleInterface",
2465
- ],
2466
- "affectedLinkTypes": [],
2467
- "affectedObjectTypes": [],
2468
- "typeGroups": [],
2387
+ "submitButtonDisplayMetadata": {
2388
+ "intent": "DANGER",
2389
+ "text": "Custom button",
2469
2390
  },
2470
- "formContentOrdering": [],
2471
- "parameterOrdering": [
2472
- "interfaceObjectToModifyParameter",
2473
- "com.palantir.property1",
2474
- "com.palantir.property3",
2391
+ "successMessage": [
2392
+ {
2393
+ "message": "Custom success message",
2394
+ "type": "message",
2395
+ },
2475
2396
  ],
2476
- "parameters": {
2477
- "com.palantir.property1": {
2478
- "displayMetadata": {
2479
- "description": "",
2480
- "displayName": "property1",
2481
- "typeClasses": [],
2482
- },
2483
- "id": "com.palantir.property1",
2484
- "type": {
2485
- "string": {},
2486
- "type": "string",
2487
- },
2397
+ "typeClasses": [],
2398
+ "undoButtonConfiguration": true,
2399
+ },
2400
+ "entities": {
2401
+ "affectedInterfaceTypes": [
2402
+ "com.palantir.exampleInterface",
2403
+ ],
2404
+ "affectedLinkTypes": [],
2405
+ "affectedObjectTypes": [],
2406
+ "typeGroups": [],
2407
+ },
2408
+ "formContentOrdering": [],
2409
+ "parameterOrdering": [
2410
+ "interfaceObjectToModifyParameter",
2411
+ "com.palantir.property1",
2412
+ "com.palantir.property3",
2413
+ ],
2414
+ "parameters": {
2415
+ "com.palantir.property1": {
2416
+ "displayMetadata": {
2417
+ "description": "",
2418
+ "displayName": "property1",
2419
+ "typeClasses": [],
2488
2420
  },
2489
- "com.palantir.property3": {
2490
- "displayMetadata": {
2491
- "description": "fizz_description",
2492
- "displayName": "fizz_display",
2493
- "typeClasses": [],
2494
- },
2495
- "id": "com.palantir.property3",
2496
- "type": {
2497
- "string": {},
2498
- "type": "string",
2499
- },
2421
+ "id": "com.palantir.property1",
2422
+ "type": {
2423
+ "string": {},
2424
+ "type": "string",
2500
2425
  },
2501
- "interfaceObjectToModifyParameter": {
2502
- "displayMetadata": {
2503
- "description": "",
2504
- "displayName": "Object type to modify",
2505
- "typeClasses": [],
2506
- },
2507
- "id": "interfaceObjectToModifyParameter",
2508
- "type": {
2509
- "interfaceReference": {
2510
- "interfaceTypeRid": "com.palantir.exampleInterface",
2511
- },
2512
- "type": "interfaceReference",
2513
- },
2426
+ },
2427
+ "com.palantir.property3": {
2428
+ "displayMetadata": {
2429
+ "description": "fizz_description",
2430
+ "displayName": "fizz_display",
2431
+ "typeClasses": [],
2432
+ },
2433
+ "id": "com.palantir.property3",
2434
+ "type": {
2435
+ "string": {},
2436
+ "type": "string",
2514
2437
  },
2515
2438
  },
2516
- "sections": {},
2517
- "status": {
2518
- "experimental": {},
2519
- "type": "experimental",
2439
+ "interfaceObjectToModifyParameter": {
2440
+ "displayMetadata": {
2441
+ "description": "",
2442
+ "displayName": "Object type to modify",
2443
+ "typeClasses": [],
2444
+ },
2445
+ "id": "interfaceObjectToModifyParameter",
2446
+ "type": {
2447
+ "interfaceReference": {
2448
+ "interfaceTypeRid": "com.palantir.exampleInterface",
2449
+ },
2450
+ "type": "interfaceReference",
2451
+ },
2520
2452
  },
2521
2453
  },
2454
+ "sections": {},
2455
+ "status": {
2456
+ "experimental": {},
2457
+ "type": "experimental",
2458
+ },
2522
2459
  },
2523
2460
  },
2524
2461
  },
2525
- "blockPermissionInformation": {
2526
- "actionTypes": {},
2527
- "linkTypes": {},
2528
- "objectTypes": {},
2529
- },
2530
- "interfaceTypes": {
2531
- "com.palantir.exampleInterface": {
2532
- "interfaceType": {
2533
- "apiName": "com.palantir.exampleInterface",
2534
- "displayMetadata": {
2535
- "description": "exampleInterface",
2536
- "displayName": "exampleInterface",
2537
- "icon": {
2538
- "blueprint": {
2539
- "color": "#4C90F0",
2540
- "locator": "layout-hierarchy",
2462
+ },
2463
+ "blockPermissionInformation": {
2464
+ "actionTypes": {},
2465
+ "linkTypes": {},
2466
+ "objectTypes": {},
2467
+ },
2468
+ "interfaceTypes": {
2469
+ "com.palantir.exampleInterface": {
2470
+ "interfaceType": {
2471
+ "apiName": "com.palantir.exampleInterface",
2472
+ "displayMetadata": {
2473
+ "description": "exampleInterface",
2474
+ "displayName": "exampleInterface",
2475
+ "icon": {
2476
+ "blueprint": {
2477
+ "color": "#4C90F0",
2478
+ "locator": "layout-hierarchy",
2479
+ },
2480
+ "type": "blueprint",
2481
+ },
2482
+ },
2483
+ "extendsInterfaces": [],
2484
+ "links": [],
2485
+ "properties": [],
2486
+ "propertiesV2": {
2487
+ "com.palantir.property1": {
2488
+ "required": true,
2489
+ "sharedPropertyType": {
2490
+ "aliases": [],
2491
+ "apiName": "com.palantir.property1",
2492
+ "baseFormatter": undefined,
2493
+ "dataConstraints": undefined,
2494
+ "displayMetadata": {
2495
+ "description": undefined,
2496
+ "displayName": "property1",
2497
+ "visibility": "NORMAL",
2541
2498
  },
2542
- "type": "blueprint",
2499
+ "gothamMapping": undefined,
2500
+ "indexedForSearch": true,
2501
+ "type": {
2502
+ "string": {
2503
+ "analyzerOverride": undefined,
2504
+ "enableAsciiFolding": undefined,
2505
+ "isLongText": false,
2506
+ "supportsEfficientLeadingWildcard": false,
2507
+ "supportsExactMatching": true,
2508
+ },
2509
+ "type": "string",
2510
+ },
2511
+ "typeClasses": [
2512
+ {
2513
+ "kind": "render_hint",
2514
+ "name": "SELECTABLE",
2515
+ },
2516
+ {
2517
+ "kind": "render_hint",
2518
+ "name": "SORTABLE",
2519
+ },
2520
+ ],
2521
+ "valueType": undefined,
2543
2522
  },
2544
2523
  },
2545
- "extendsInterfaces": [],
2546
- "links": [],
2547
- "properties": [],
2548
- "propertiesV2": {
2549
- "com.palantir.property1": {
2550
- "required": true,
2551
- "sharedPropertyType": {
2552
- "aliases": [],
2553
- "apiName": "com.palantir.property1",
2554
- "baseFormatter": undefined,
2555
- "dataConstraints": undefined,
2556
- "displayMetadata": {
2557
- "description": undefined,
2558
- "displayName": "property1",
2559
- "visibility": "NORMAL",
2560
- },
2561
- "gothamMapping": undefined,
2562
- "indexedForSearch": true,
2563
- "type": {
2564
- "string": {
2565
- "analyzerOverride": undefined,
2566
- "enableAsciiFolding": undefined,
2567
- "isLongText": false,
2568
- "supportsEfficientLeadingWildcard": false,
2569
- "supportsExactMatching": true,
2570
- },
2571
- "type": "string",
2524
+ "com.palantir.property2": {
2525
+ "required": true,
2526
+ "sharedPropertyType": {
2527
+ "aliases": [],
2528
+ "apiName": "com.palantir.property2",
2529
+ "baseFormatter": undefined,
2530
+ "dataConstraints": undefined,
2531
+ "displayMetadata": {
2532
+ "description": undefined,
2533
+ "displayName": "property2",
2534
+ "visibility": "NORMAL",
2535
+ },
2536
+ "gothamMapping": undefined,
2537
+ "indexedForSearch": true,
2538
+ "type": {
2539
+ "string": {
2540
+ "analyzerOverride": undefined,
2541
+ "enableAsciiFolding": undefined,
2542
+ "isLongText": false,
2543
+ "supportsEfficientLeadingWildcard": false,
2544
+ "supportsExactMatching": true,
2572
2545
  },
2573
- "typeClasses": [
2574
- {
2575
- "kind": "render_hint",
2576
- "name": "SELECTABLE",
2577
- },
2578
- {
2579
- "kind": "render_hint",
2580
- "name": "SORTABLE",
2581
- },
2582
- ],
2583
- "valueType": undefined,
2546
+ "type": "string",
2584
2547
  },
2585
- },
2586
- "com.palantir.property2": {
2587
- "required": true,
2588
- "sharedPropertyType": {
2589
- "aliases": [],
2590
- "apiName": "com.palantir.property2",
2591
- "baseFormatter": undefined,
2592
- "dataConstraints": undefined,
2593
- "displayMetadata": {
2594
- "description": undefined,
2595
- "displayName": "property2",
2596
- "visibility": "NORMAL",
2548
+ "typeClasses": [
2549
+ {
2550
+ "kind": "render_hint",
2551
+ "name": "SELECTABLE",
2597
2552
  },
2598
- "gothamMapping": undefined,
2599
- "indexedForSearch": true,
2600
- "type": {
2601
- "string": {
2602
- "analyzerOverride": undefined,
2603
- "enableAsciiFolding": undefined,
2604
- "isLongText": false,
2605
- "supportsEfficientLeadingWildcard": false,
2606
- "supportsExactMatching": true,
2607
- },
2608
- "type": "string",
2553
+ {
2554
+ "kind": "render_hint",
2555
+ "name": "SORTABLE",
2609
2556
  },
2610
- "typeClasses": [
2611
- {
2612
- "kind": "render_hint",
2613
- "name": "SELECTABLE",
2614
- },
2615
- {
2616
- "kind": "render_hint",
2617
- "name": "SORTABLE",
2618
- },
2619
- ],
2620
- "valueType": undefined,
2621
- },
2557
+ ],
2558
+ "valueType": undefined,
2622
2559
  },
2623
- "com.palantir.property3": {
2624
- "required": true,
2625
- "sharedPropertyType": {
2626
- "aliases": [],
2627
- "apiName": "com.palantir.property3",
2628
- "baseFormatter": undefined,
2629
- "dataConstraints": undefined,
2630
- "displayMetadata": {
2631
- "description": undefined,
2632
- "displayName": "property3",
2633
- "visibility": "NORMAL",
2634
- },
2635
- "gothamMapping": undefined,
2636
- "indexedForSearch": true,
2637
- "type": {
2638
- "string": {
2639
- "analyzerOverride": undefined,
2640
- "enableAsciiFolding": undefined,
2641
- "isLongText": false,
2642
- "supportsEfficientLeadingWildcard": false,
2643
- "supportsExactMatching": true,
2644
- },
2645
- "type": "string",
2560
+ },
2561
+ "com.palantir.property3": {
2562
+ "required": true,
2563
+ "sharedPropertyType": {
2564
+ "aliases": [],
2565
+ "apiName": "com.palantir.property3",
2566
+ "baseFormatter": undefined,
2567
+ "dataConstraints": undefined,
2568
+ "displayMetadata": {
2569
+ "description": undefined,
2570
+ "displayName": "property3",
2571
+ "visibility": "NORMAL",
2572
+ },
2573
+ "gothamMapping": undefined,
2574
+ "indexedForSearch": true,
2575
+ "type": {
2576
+ "string": {
2577
+ "analyzerOverride": undefined,
2578
+ "enableAsciiFolding": undefined,
2579
+ "isLongText": false,
2580
+ "supportsEfficientLeadingWildcard": false,
2581
+ "supportsExactMatching": true,
2646
2582
  },
2647
- "typeClasses": [
2648
- {
2649
- "kind": "render_hint",
2650
- "name": "SELECTABLE",
2651
- },
2652
- {
2653
- "kind": "render_hint",
2654
- "name": "SORTABLE",
2655
- },
2656
- ],
2657
- "valueType": undefined,
2583
+ "type": "string",
2658
2584
  },
2585
+ "typeClasses": [
2586
+ {
2587
+ "kind": "render_hint",
2588
+ "name": "SELECTABLE",
2589
+ },
2590
+ {
2591
+ "kind": "render_hint",
2592
+ "name": "SORTABLE",
2593
+ },
2594
+ ],
2595
+ "valueType": undefined,
2659
2596
  },
2660
2597
  },
2661
- "propertiesV3": {},
2662
- "searchable": true,
2663
- "status": {
2664
- "active": {},
2665
- "type": "active",
2598
+ },
2599
+ "propertiesV3": {},
2600
+ "searchable": true,
2601
+ "status": {
2602
+ "active": {},
2603
+ "type": "active",
2604
+ },
2605
+ },
2606
+ },
2607
+ },
2608
+ "linkTypes": {},
2609
+ "objectTypes": {},
2610
+ "sharedPropertyTypes": {
2611
+ "com.palantir.property1": {
2612
+ "sharedPropertyType": {
2613
+ "aliases": [],
2614
+ "apiName": "com.palantir.property1",
2615
+ "baseFormatter": undefined,
2616
+ "dataConstraints": undefined,
2617
+ "displayMetadata": {
2618
+ "description": undefined,
2619
+ "displayName": "property1",
2620
+ "visibility": "NORMAL",
2621
+ },
2622
+ "gothamMapping": undefined,
2623
+ "indexedForSearch": true,
2624
+ "type": {
2625
+ "string": {
2626
+ "analyzerOverride": undefined,
2627
+ "enableAsciiFolding": undefined,
2628
+ "isLongText": false,
2629
+ "supportsEfficientLeadingWildcard": false,
2630
+ "supportsExactMatching": true,
2631
+ },
2632
+ "type": "string",
2633
+ },
2634
+ "typeClasses": [
2635
+ {
2636
+ "kind": "render_hint",
2637
+ "name": "SELECTABLE",
2638
+ },
2639
+ {
2640
+ "kind": "render_hint",
2641
+ "name": "SORTABLE",
2642
+ },
2643
+ ],
2644
+ "valueType": undefined,
2645
+ },
2646
+ },
2647
+ "com.palantir.property2": {
2648
+ "sharedPropertyType": {
2649
+ "aliases": [],
2650
+ "apiName": "com.palantir.property2",
2651
+ "baseFormatter": undefined,
2652
+ "dataConstraints": undefined,
2653
+ "displayMetadata": {
2654
+ "description": undefined,
2655
+ "displayName": "property2",
2656
+ "visibility": "NORMAL",
2657
+ },
2658
+ "gothamMapping": undefined,
2659
+ "indexedForSearch": true,
2660
+ "type": {
2661
+ "string": {
2662
+ "analyzerOverride": undefined,
2663
+ "enableAsciiFolding": undefined,
2664
+ "isLongText": false,
2665
+ "supportsEfficientLeadingWildcard": false,
2666
+ "supportsExactMatching": true,
2667
+ },
2668
+ "type": "string",
2669
+ },
2670
+ "typeClasses": [
2671
+ {
2672
+ "kind": "render_hint",
2673
+ "name": "SELECTABLE",
2666
2674
  },
2675
+ {
2676
+ "kind": "render_hint",
2677
+ "name": "SORTABLE",
2678
+ },
2679
+ ],
2680
+ "valueType": undefined,
2681
+ },
2682
+ },
2683
+ "com.palantir.property3": {
2684
+ "sharedPropertyType": {
2685
+ "aliases": [],
2686
+ "apiName": "com.palantir.property3",
2687
+ "baseFormatter": undefined,
2688
+ "dataConstraints": undefined,
2689
+ "displayMetadata": {
2690
+ "description": undefined,
2691
+ "displayName": "property3",
2692
+ "visibility": "NORMAL",
2693
+ },
2694
+ "gothamMapping": undefined,
2695
+ "indexedForSearch": true,
2696
+ "type": {
2697
+ "string": {
2698
+ "analyzerOverride": undefined,
2699
+ "enableAsciiFolding": undefined,
2700
+ "isLongText": false,
2701
+ "supportsEfficientLeadingWildcard": false,
2702
+ "supportsExactMatching": true,
2703
+ },
2704
+ "type": "string",
2667
2705
  },
2706
+ "typeClasses": [
2707
+ {
2708
+ "kind": "render_hint",
2709
+ "name": "SELECTABLE",
2710
+ },
2711
+ {
2712
+ "kind": "render_hint",
2713
+ "name": "SORTABLE",
2714
+ },
2715
+ ],
2716
+ "valueType": undefined,
2668
2717
  },
2669
2718
  },
2719
+ },
2720
+ },
2721
+ "randomnessKey": undefined,
2722
+ "valueTypes": {
2723
+ "valueTypes": [],
2724
+ },
2725
+ }
2726
+ `);});it("Interface actions validate SPT existence",()=>{const spt=defineSharedPropertyType({apiName:"spt",type:"string"});const importedInterface={"apiName":"com.palantir.other.ontology.event.Event","displayMetadata":{"displayName":"Event","description":"Event","icon":{"type":"blueprint","blueprint":{"color":"#4C90F0","locator":"timeline-events"}}},"extendsInterfaces":[],"links":[],"status":{"type":"active","active":{}},"propertiesV2":{"com.palantir.other.ontology.types.id":{"required":true,"sharedPropertyType":{"displayName":"Id","apiName":"com.palantir.other.ontology.types.id","type":"string","nonNameSpacedApiName":"id","typeClasses":[{"kind":"render_hint","name":"SELECTABLE"},{"kind":"render_hint","name":"SORTABLE"}],"__type":"SHARED_PROPERTY_TYPE"}}},"searchable":false,"__type":"INTERFACE_TYPE"};importOntologyEntity(importedInterface);const interfaceType=defineInterface({apiName:"interfaceType",properties:{spt},extends:importedInterface});expect(()=>defineAction({apiName:"action",displayName:"action",status:"active",parameters:[{id:"interfaceObjectToModifyParameter",displayName:"Interface object to modify",type:{type:"interfaceReference",interfaceReference:{interfaceTypeRid:interfaceType.apiName}},validation:{required:true,allowedValues:{type:"interfaceObjectQuery"}}},{id:"sptParameter",displayName:"SPT",type:"string",validation:{required:true,allowedValues:{type:"text"}}},{id:"otherParameter",displayName:"Other parameter",type:"string",validation:{required:true,allowedValues:{type:"text"}}}],rules:[{type:"modifyInterfaceRule",modifyInterfaceRule:{interfaceObjectToModifyParameter:"interfaceObjectToModifyParameter",sharedPropertyValues:{spt:{type:"parameterId",parameterId:"sptParameter"},"com.palantir.other.invalid.spt":{type:"staticValue",staticValue:{type:"double",double:4}},other:{type:"parameterId",parameterId:"otherParameter"}}}}]})).toThrowErrorMatchingInlineSnapshot(`[Error: Invariant failed: Shared property type com.palantir.other.invalid.spt does not exist in interface type com.palantir.interfaceType]`);expect(()=>defineCreateInterfaceObjectAction({interfaceType:interfaceType})).not.toThrow();});it("Interface actions validate SPT existence on the interface",()=>{expect(()=>{const spt=defineSharedPropertyType({apiName:"spt",type:"string"});const pulseRepetitionIntervalSecs={"apiName":"com.palantir.other.ontology.pulseRepetitionIntervalSecs","displayName":"Pulse Repetition Interval (s)","description":"Pulse Repetition Interval in seconds.","type":"double","nonNameSpacedApiName":"pulseRepetitionIntervalSecs","typeClasses":[],"__type":OntologyEntityTypeEnum.SHARED_PROPERTY_TYPE};importOntologyEntity(pulseRepetitionIntervalSecs);const interfaceType=defineInterface({apiName:"interfaceType",properties:{spt}});defineAction({apiName:"action",displayName:"action",status:"active",parameters:[{id:"interfaceObjectToModifyParameter",displayName:"Interface object to modify",type:{type:"interfaceReference",interfaceReference:{interfaceTypeRid:interfaceType.apiName}},validation:{required:true,allowedValues:{type:"interfaceObjectQuery"}}},{id:"sptParameter",displayName:"SPT",type:"string",validation:{required:true,allowedValues:{type:"text"}}}],rules:[{type:"modifyInterfaceRule",modifyInterfaceRule:{interfaceObjectToModifyParameter:"interfaceObjectToModifyParameter",sharedPropertyValues:{spt:{type:"parameterId",parameterId:"sptParameter"},[pulseRepetitionIntervalSecs.apiName]:{type:"staticValue",staticValue:{type:"double",double:4}}}}}]});}).toThrowErrorMatchingInlineSnapshot(`[Error: Invariant failed: Shared property type com.palantir.other.ontology.pulseRepetitionIntervalSecs does not exist in interface type com.palantir.interfaceType]`);});it("Parameter configuration, property mapping, and excluded property validations work",()=>{const property1=defineSharedPropertyType({apiName:"property1",type:"string"});const sampleInterface=defineInterface({apiName:"sampleInterface",properties:{property1}});expect(()=>{defineCreateInterfaceObjectAction({interfaceType:sampleInterface,parameterConfiguration:{"custom_parameter":{displayName:"My Custom Param"}}});}).toThrowErrorMatchingInlineSnapshot(`[Error: Invariant failed: Parameter custom_parameter does not exist as a property on com.palantir.sampleInterface and its type is not explicitly defined]`);expect(()=>{defineModifyInterfaceObjectAction({interfaceType:sampleInterface,parameterConfiguration:{"custom_parameter":{displayName:"My Custom Param"}}});}).toThrowErrorMatchingInlineSnapshot(`[Error: Invariant failed: Parameter custom_parameter does not exist as a property on com.palantir.sampleInterface and its type is not explicitly defined]`);expect(()=>{defineCreateInterfaceObjectAction({interfaceType:sampleInterface,apiName:"test-create-interface0",parameterConfiguration:{"custom_parameter":{displayName:"My Custom Param",customParameterType:"string"}}});}).not.toThrow();expect(()=>{defineModifyInterfaceObjectAction({interfaceType:sampleInterface,apiName:"test-modify-interface0",parameterConfiguration:{"custom_parameter":{displayName:"My Custom Param",customParameterType:"string"}}});}).not.toThrow();expect(()=>{defineCreateInterfaceObjectAction({interfaceType:sampleInterface,parameterConfiguration:{"property1":{displayName:"My Custom Param"}}});}).not.toThrow();expect(()=>{defineModifyInterfaceObjectAction({interfaceType:sampleInterface,parameterConfiguration:{"property1":{displayName:"My Custom Param"}}});}).not.toThrow();expect(()=>{defineCreateInterfaceObjectAction({interfaceType:sampleInterface,nonParameterMappings:{"custom_parameter":{type:"staticValue",staticValue:{type:"string",string:"custom_value"}}}});}).toThrowErrorMatchingInlineSnapshot(`[Error: Invariant failed: Property com.palantir.custom_parameter does not exist as a property on com.palantir.sampleInterface]`);expect(()=>{defineModifyInterfaceObjectAction({interfaceType:sampleInterface,nonParameterMappings:{"custom_parameter":{type:"staticValue",staticValue:{type:"string",string:"custom_value"}}}});}).toThrowErrorMatchingInlineSnapshot(`[Error: Invariant failed: Property com.palantir.custom_parameter does not exist as a property on com.palantir.sampleInterface]`);expect(()=>{defineCreateInterfaceObjectAction({interfaceType:sampleInterface,apiName:"test-create-interface1",nonParameterMappings:{"property1":{type:"staticValue",staticValue:{type:"string",string:"custom_value"}}}});}).not.toThrow();expect(()=>{defineModifyInterfaceObjectAction({interfaceType:sampleInterface,apiName:"test-modify-interface1",nonParameterMappings:{"property1":{type:"staticValue",staticValue:{type:"string",string:"custom_value"}}}});}).not.toThrow();expect(()=>{defineCreateInterfaceObjectAction({interfaceType:sampleInterface,excludedProperties:["custom_parameter"]});}).toThrowErrorMatchingInlineSnapshot(`[Error: Invariant failed: Property com.palantir.custom_parameter does not exist as a property on com.palantir.sampleInterface]`);expect(()=>{defineModifyInterfaceObjectAction({interfaceType:sampleInterface,excludedProperties:["custom_parameter"]});}).toThrowErrorMatchingInlineSnapshot(`[Error: Invariant failed: Property com.palantir.custom_parameter does not exist as a property on com.palantir.sampleInterface]`);expect(()=>{defineCreateInterfaceObjectAction({interfaceType:sampleInterface,apiName:"test-create-interface2",excludedProperties:["property1"]});}).not.toThrow();expect(()=>{defineModifyInterfaceObjectAction({interfaceType:sampleInterface,apiName:"test-modify-interface2",excludedProperties:["property1"]});}).not.toThrow();});it("Action sections are properly defined",()=>{const property1=defineSharedPropertyType({apiName:"property1",type:"string"});const sampleInterface=defineInterface({apiName:"sampleInterface",properties:{property1}});defineCreateInterfaceObjectAction({interfaceType:sampleInterface,sections:[{id:"section1",displayName:"Section 1",parameters:[property1.apiName],description:"Description for Section 1",conditionalOverrides:[{type:"visibility",condition:{type:"group",name:"testGroup"}}]}]});defineModifyInterfaceObjectAction({interfaceType:sampleInterface,sections:[{id:"section1",displayName:"Section 1",parameters:["property1"],description:"Description for Section 1",conditionalOverrides:[{type:"visibility",condition:{type:"group",name:"testGroup"}}]}]});expect(dumpOntologyFullMetadata()).toMatchInlineSnapshot(`
2727
+ {
2728
+ "importedOntology": {
2729
+ "actionTypes": {},
2730
+ "blockPermissionInformation": {
2731
+ "actionTypes": {},
2670
2732
  "linkTypes": {},
2671
2733
  "objectTypes": {},
2672
- "sharedPropertyTypes": {
2673
- "com.palantir.property1": {
2674
- "sharedPropertyType": {
2675
- "aliases": [],
2676
- "apiName": "com.palantir.property1",
2677
- "baseFormatter": undefined,
2678
- "dataConstraints": undefined,
2679
- "displayMetadata": {
2680
- "description": undefined,
2681
- "displayName": "property1",
2682
- "visibility": "NORMAL",
2734
+ },
2735
+ "interfaceTypes": {},
2736
+ "linkTypes": {},
2737
+ "objectTypes": {},
2738
+ "sharedPropertyTypes": {},
2739
+ },
2740
+ "importedValueTypes": {
2741
+ "valueTypes": [],
2742
+ },
2743
+ "ontology": {
2744
+ "actionTypes": {
2745
+ "com.palantir.create-sample-interface": {
2746
+ "actionType": {
2747
+ "actionTypeLogic": {
2748
+ "logic": {
2749
+ "rules": [
2750
+ {
2751
+ "addInterfaceRule": {
2752
+ "interfaceApiName": "com.palantir.sampleInterface",
2753
+ "objectTypeParameter": "objectTypeParameter",
2754
+ "sharedPropertyValues": {
2755
+ "com.palantir.property1": {
2756
+ "parameterId": "com.palantir.property1",
2757
+ "type": "parameterId",
2758
+ },
2759
+ },
2760
+ },
2761
+ "type": "addInterfaceRule",
2762
+ },
2763
+ ],
2683
2764
  },
2684
- "gothamMapping": undefined,
2685
- "indexedForSearch": true,
2686
- "type": {
2687
- "string": {
2688
- "analyzerOverride": undefined,
2689
- "enableAsciiFolding": undefined,
2690
- "isLongText": false,
2691
- "supportsEfficientLeadingWildcard": false,
2692
- "supportsExactMatching": true,
2765
+ "validation": {
2766
+ "actionTypeLevelValidation": {
2767
+ "rules": {
2768
+ "0": {
2769
+ "condition": {
2770
+ "true": {},
2771
+ "type": "true",
2772
+ },
2773
+ "displayMetadata": {
2774
+ "failureMessage": "",
2775
+ "typeClasses": [],
2776
+ },
2777
+ },
2778
+ },
2693
2779
  },
2694
- "type": "string",
2695
- },
2696
- "typeClasses": [
2697
- {
2698
- "kind": "render_hint",
2699
- "name": "SELECTABLE",
2780
+ "parameterValidations": {
2781
+ "com.palantir.property1": {
2782
+ "conditionalOverrides": [],
2783
+ "defaultValidation": {
2784
+ "display": {
2785
+ "renderHint": {
2786
+ "textInput": {},
2787
+ "type": "textInput",
2788
+ },
2789
+ "visibility": {
2790
+ "editable": {},
2791
+ "type": "editable",
2792
+ },
2793
+ },
2794
+ "validation": {
2795
+ "allowedValues": {
2796
+ "text": {
2797
+ "text": {},
2798
+ "type": "text",
2799
+ },
2800
+ "type": "text",
2801
+ },
2802
+ "required": {
2803
+ "required": {},
2804
+ "type": "required",
2805
+ },
2806
+ },
2807
+ },
2808
+ },
2809
+ "objectTypeParameter": {
2810
+ "conditionalOverrides": [],
2811
+ "defaultValidation": {
2812
+ "display": {
2813
+ "renderHint": {
2814
+ "dropdown": {},
2815
+ "type": "dropdown",
2816
+ },
2817
+ "visibility": {
2818
+ "editable": {},
2819
+ "type": "editable",
2820
+ },
2821
+ },
2822
+ "validation": {
2823
+ "allowedValues": {
2824
+ "objectTypeReference": {
2825
+ "objectTypeReference": {
2826
+ "interfaceTypeRids": [
2827
+ "com.palantir.sampleInterface",
2828
+ ],
2829
+ },
2830
+ "type": "objectTypeReference",
2831
+ },
2832
+ "type": "objectTypeReference",
2833
+ },
2834
+ "required": {
2835
+ "required": {},
2836
+ "type": "required",
2837
+ },
2838
+ },
2839
+ },
2840
+ },
2700
2841
  },
2701
- {
2702
- "kind": "render_hint",
2703
- "name": "SORTABLE",
2842
+ "sectionValidations": {
2843
+ "section1": {
2844
+ "conditionalOverrides": [
2845
+ {
2846
+ "condition": {
2847
+ "comparison": {
2848
+ "left": {
2849
+ "type": "userProperty",
2850
+ "userProperty": {
2851
+ "propertyValue": {
2852
+ "groupIds": {},
2853
+ "type": "groupIds",
2854
+ },
2855
+ "userId": {
2856
+ "currentUser": {},
2857
+ "type": "currentUser",
2858
+ },
2859
+ },
2860
+ },
2861
+ "operator": "INTERSECTS",
2862
+ "right": {
2863
+ "staticValue": {
2864
+ "stringList": {
2865
+ "strings": [
2866
+ "testGroup",
2867
+ ],
2868
+ },
2869
+ "type": "stringList",
2870
+ },
2871
+ "type": "staticValue",
2872
+ },
2873
+ },
2874
+ "type": "comparison",
2875
+ },
2876
+ "sectionBlockOverrides": [
2877
+ {
2878
+ "type": "visibility",
2879
+ "visibility": {
2880
+ "visibility": {
2881
+ "hidden": {},
2882
+ "type": "hidden",
2883
+ },
2884
+ },
2885
+ },
2886
+ ],
2887
+ },
2888
+ ],
2889
+ "defaultDisplayMetadata": {
2890
+ "visibility": {
2891
+ "type": "visible",
2892
+ "visible": {},
2893
+ },
2894
+ },
2895
+ },
2704
2896
  },
2705
- ],
2706
- "valueType": undefined,
2897
+ },
2707
2898
  },
2708
- },
2709
- "com.palantir.property2": {
2710
- "sharedPropertyType": {
2711
- "aliases": [],
2712
- "apiName": "com.palantir.property2",
2713
- "baseFormatter": undefined,
2714
- "dataConstraints": undefined,
2899
+ "metadata": {
2900
+ "apiName": "com.palantir.create-sample-interface",
2715
2901
  "displayMetadata": {
2716
- "description": undefined,
2717
- "displayName": "property2",
2718
- "visibility": "NORMAL",
2719
- },
2720
- "gothamMapping": undefined,
2721
- "indexedForSearch": true,
2722
- "type": {
2723
- "string": {
2724
- "analyzerOverride": undefined,
2725
- "enableAsciiFolding": undefined,
2726
- "isLongText": false,
2727
- "supportsEfficientLeadingWildcard": false,
2728
- "supportsExactMatching": true,
2902
+ "configuration": {
2903
+ "defaultLayout": "FORM",
2904
+ "displayAndFormat": {
2905
+ "table": {
2906
+ "columnWidthByParameterRid": {},
2907
+ "enableFileImport": true,
2908
+ "fitHorizontally": false,
2909
+ "frozenColumnCount": 0,
2910
+ "rowHeightInLines": 1,
2911
+ },
2912
+ },
2913
+ "enableLayoutUserSwitch": false,
2729
2914
  },
2730
- "type": "string",
2915
+ "description": "",
2916
+ "displayName": "Create sampleInterface",
2917
+ "icon": {
2918
+ "blueprint": {
2919
+ "color": "#000000",
2920
+ "locator": "edit",
2921
+ },
2922
+ "type": "blueprint",
2923
+ },
2924
+ "successMessage": [],
2925
+ "typeClasses": [],
2731
2926
  },
2732
- "typeClasses": [
2927
+ "entities": {
2928
+ "affectedInterfaceTypes": [
2929
+ "com.palantir.sampleInterface",
2930
+ ],
2931
+ "affectedLinkTypes": [],
2932
+ "affectedObjectTypes": [],
2933
+ "typeGroups": [],
2934
+ },
2935
+ "formContentOrdering": [
2733
2936
  {
2734
- "kind": "render_hint",
2735
- "name": "SELECTABLE",
2937
+ "parameterId": "objectTypeParameter",
2938
+ "type": "parameterId",
2736
2939
  },
2737
2940
  {
2738
- "kind": "render_hint",
2739
- "name": "SORTABLE",
2941
+ "sectionId": "section1",
2942
+ "type": "sectionId",
2740
2943
  },
2741
2944
  ],
2742
- "valueType": undefined,
2743
- },
2744
- },
2745
- "com.palantir.property3": {
2746
- "sharedPropertyType": {
2747
- "aliases": [],
2748
- "apiName": "com.palantir.property3",
2749
- "baseFormatter": undefined,
2750
- "dataConstraints": undefined,
2751
- "displayMetadata": {
2752
- "description": undefined,
2753
- "displayName": "property3",
2754
- "visibility": "NORMAL",
2755
- },
2756
- "gothamMapping": undefined,
2757
- "indexedForSearch": true,
2758
- "type": {
2759
- "string": {
2760
- "analyzerOverride": undefined,
2761
- "enableAsciiFolding": undefined,
2762
- "isLongText": false,
2763
- "supportsEfficientLeadingWildcard": false,
2764
- "supportsExactMatching": true,
2945
+ "parameterOrdering": [
2946
+ "objectTypeParameter",
2947
+ "com.palantir.property1",
2948
+ ],
2949
+ "parameters": {
2950
+ "com.palantir.property1": {
2951
+ "displayMetadata": {
2952
+ "description": "",
2953
+ "displayName": "property1",
2954
+ "typeClasses": [],
2955
+ },
2956
+ "id": "com.palantir.property1",
2957
+ "type": {
2958
+ "string": {},
2959
+ "type": "string",
2960
+ },
2765
2961
  },
2766
- "type": "string",
2767
- },
2768
- "typeClasses": [
2769
- {
2770
- "kind": "render_hint",
2771
- "name": "SELECTABLE",
2962
+ "objectTypeParameter": {
2963
+ "displayMetadata": {
2964
+ "description": "",
2965
+ "displayName": "Object type to create",
2966
+ "typeClasses": [],
2967
+ },
2968
+ "id": "objectTypeParameter",
2969
+ "type": {
2970
+ "objectTypeReference": {
2971
+ "interfaceTypeRids": [
2972
+ "com.palantir.sampleInterface",
2973
+ ],
2974
+ },
2975
+ "type": "objectTypeReference",
2976
+ },
2772
2977
  },
2773
- {
2774
- "kind": "render_hint",
2775
- "name": "SORTABLE",
2978
+ },
2979
+ "sections": {
2980
+ "section1": {
2981
+ "content": [
2982
+ {
2983
+ "parameterId": "com.palantir.property1",
2984
+ "type": "parameterId",
2985
+ },
2986
+ ],
2987
+ "displayMetadata": {
2988
+ "collapsedByDefault": false,
2989
+ "columnCount": 1,
2990
+ "description": "Description for Section 1",
2991
+ "displayName": "Section 1",
2992
+ "showTitleBar": true,
2993
+ },
2994
+ "id": "section1",
2776
2995
  },
2777
- ],
2778
- "valueType": undefined,
2996
+ },
2997
+ "status": {
2998
+ "active": {},
2999
+ "type": "active",
3000
+ },
2779
3001
  },
2780
3002
  },
2781
3003
  },
2782
- },
2783
- "randomnessKey": undefined,
2784
- "valueTypes": {
2785
- "valueTypes": [],
2786
- },
2787
- }
2788
- `);
2789
- });
2790
- it("Interface actions validate SPT existence", () => {
2791
- const spt = defineSharedPropertyType({
2792
- apiName: "spt",
2793
- type: "string"
2794
- });
2795
- const importedInterface = {
2796
- "apiName": "com.palantir.other.ontology.event.Event",
2797
- "displayMetadata": {
2798
- "displayName": "Event",
2799
- "description": "Event",
2800
- "icon": {
2801
- "type": "blueprint",
2802
- "blueprint": {
2803
- "color": "#4C90F0",
2804
- "locator": "timeline-events"
2805
- }
2806
- }
2807
- },
2808
- "extendsInterfaces": [],
2809
- "links": [],
2810
- "status": {
2811
- "type": "active",
2812
- "active": {}
2813
- },
2814
- "propertiesV2": {
2815
- "com.palantir.other.ontology.types.id": {
2816
- "required": true,
2817
- "sharedPropertyType": {
2818
- "displayName": "Id",
2819
- "apiName": "com.palantir.other.ontology.types.id",
2820
- "type": "string",
2821
- "nonNameSpacedApiName": "id",
2822
- "typeClasses": [{
2823
- "kind": "render_hint",
2824
- "name": "SELECTABLE"
2825
- }, {
2826
- "kind": "render_hint",
2827
- "name": "SORTABLE"
2828
- }],
2829
- "__type": "SHARED_PROPERTY_TYPE"
2830
- }
2831
- }
2832
- },
2833
- "searchable": false,
2834
- "__type": "INTERFACE_TYPE"
2835
- };
2836
- importOntologyEntity(importedInterface);
2837
- const interfaceType = defineInterface({
2838
- apiName: "interfaceType",
2839
- properties: {
2840
- spt
2841
- },
2842
- extends: importedInterface
2843
- });
2844
- expect(() => defineAction({
2845
- apiName: "action",
2846
- displayName: "action",
2847
- status: "active",
2848
- parameters: [{
2849
- id: "interfaceObjectToModifyParameter",
2850
- displayName: "Interface object to modify",
2851
- type: {
2852
- type: "interfaceReference",
2853
- interfaceReference: {
2854
- interfaceTypeRid: interfaceType.apiName
2855
- }
2856
- },
2857
- validation: {
2858
- required: true,
2859
- allowedValues: {
2860
- type: "interfaceObjectQuery"
2861
- }
2862
- }
2863
- }, {
2864
- id: "sptParameter",
2865
- displayName: "SPT",
2866
- type: "string",
2867
- validation: {
2868
- required: true,
2869
- allowedValues: {
2870
- type: "text"
2871
- }
2872
- }
2873
- }, {
2874
- id: "otherParameter",
2875
- displayName: "Other parameter",
2876
- type: "string",
2877
- validation: {
2878
- required: true,
2879
- allowedValues: {
2880
- type: "text"
2881
- }
2882
- }
2883
- }],
2884
- rules: [{
2885
- type: "modifyInterfaceRule",
2886
- modifyInterfaceRule: {
2887
- interfaceObjectToModifyParameter: "interfaceObjectToModifyParameter",
2888
- sharedPropertyValues: {
2889
- spt: {
2890
- type: "parameterId",
2891
- parameterId: "sptParameter"
2892
- },
2893
- "com.palantir.other.invalid.spt": {
2894
- type: "staticValue",
2895
- staticValue: {
2896
- type: "double",
2897
- double: 4
2898
- }
2899
- },
2900
- other: {
2901
- type: "parameterId",
2902
- parameterId: "otherParameter"
2903
- }
2904
- }
2905
- }
2906
- }]
2907
- })).toThrowErrorMatchingInlineSnapshot(`[Error: Invariant failed: Shared property type com.palantir.other.invalid.spt does not exist in interface type com.palantir.interfaceType]`);
2908
- expect(() => defineCreateInterfaceObjectAction({
2909
- interfaceType: interfaceType
2910
- })).not.toThrow();
2911
- });
2912
- it("Interface actions validate SPT existence on the interface", () => {
2913
- expect(() => {
2914
- const spt = defineSharedPropertyType({
2915
- apiName: "spt",
2916
- type: "string"
2917
- });
2918
- const pulseRepetitionIntervalSecs = {
2919
- "apiName": "com.palantir.other.ontology.pulseRepetitionIntervalSecs",
2920
- "displayName": "Pulse Repetition Interval (s)",
2921
- "description": "Pulse Repetition Interval in seconds.",
2922
- "type": "double",
2923
- "nonNameSpacedApiName": "pulseRepetitionIntervalSecs",
2924
- "typeClasses": [],
2925
- "__type": OntologyEntityTypeEnum.SHARED_PROPERTY_TYPE
2926
- };
2927
- importOntologyEntity(pulseRepetitionIntervalSecs);
2928
- const interfaceType = defineInterface({
2929
- apiName: "interfaceType",
2930
- properties: {
2931
- spt
2932
- }
2933
- });
2934
- defineAction({
2935
- apiName: "action",
2936
- displayName: "action",
2937
- status: "active",
2938
- parameters: [{
2939
- id: "interfaceObjectToModifyParameter",
2940
- displayName: "Interface object to modify",
2941
- type: {
2942
- type: "interfaceReference",
2943
- interfaceReference: {
2944
- interfaceTypeRid: interfaceType.apiName
2945
- }
2946
- },
2947
- validation: {
2948
- required: true,
2949
- allowedValues: {
2950
- type: "interfaceObjectQuery"
2951
- }
2952
- }
2953
- }, {
2954
- id: "sptParameter",
2955
- displayName: "SPT",
2956
- type: "string",
2957
- validation: {
2958
- required: true,
2959
- allowedValues: {
2960
- type: "text"
2961
- }
2962
- }
2963
- }],
2964
- rules: [{
2965
- type: "modifyInterfaceRule",
2966
- modifyInterfaceRule: {
2967
- interfaceObjectToModifyParameter: "interfaceObjectToModifyParameter",
2968
- sharedPropertyValues: {
2969
- spt: {
2970
- type: "parameterId",
2971
- parameterId: "sptParameter"
2972
- },
2973
- [pulseRepetitionIntervalSecs.apiName]: {
2974
- type: "staticValue",
2975
- staticValue: {
2976
- type: "double",
2977
- double: 4
2978
- }
2979
- }
2980
- }
2981
- }
2982
- }]
2983
- });
2984
- }).toThrowErrorMatchingInlineSnapshot(`[Error: Invariant failed: Shared property type com.palantir.other.ontology.pulseRepetitionIntervalSecs does not exist in interface type com.palantir.interfaceType]`);
2985
- });
2986
- it("Concrete actions are properly defined", () => {
2987
- defineAction({
2988
- apiName: "foo",
2989
- displayName: "exampleAction",
2990
- status: "active",
2991
- rules: [{
2992
- type: "addOrModifyObjectRuleV2",
2993
- addOrModifyObjectRuleV2: {
2994
- objectToModify: "objectToModifyParameter",
2995
- propertyValues: {
2996
- "bar": {
2997
- type: "parameterId",
2998
- parameterId: "param1"
2999
- }
3000
- },
3001
- structFieldValues: {}
3002
- }
3003
- }],
3004
- parameters: [{
3005
- id: "param1",
3006
- displayName: "param1",
3007
- type: "boolean",
3008
- validation: {
3009
- required: true,
3010
- allowedValues: {
3011
- type: "boolean"
3012
- }
3013
- }
3014
- }]
3015
- });
3016
- expect(dumpOntologyFullMetadata()).toMatchInlineSnapshot(`
3017
- {
3018
- "importedOntology": {
3019
- "actionTypes": {},
3020
- "blockPermissionInformation": {
3021
- "actionTypes": {},
3022
- "linkTypes": {},
3023
- "objectTypes": {},
3024
- },
3025
- "interfaceTypes": {},
3026
- "linkTypes": {},
3027
- "objectTypes": {},
3028
- "sharedPropertyTypes": {},
3029
- },
3030
- "importedValueTypes": {
3031
- "valueTypes": [],
3032
- },
3033
- "ontology": {
3034
- "actionTypes": {
3035
- "com.palantir.foo": {
3036
- "actionType": {
3037
- "actionTypeLogic": {
3038
- "logic": {
3039
- "rules": [
3040
- {
3041
- "addOrModifyObjectRuleV2": {
3042
- "objectToModify": "objectToModifyParameter",
3043
- "propertyValues": {
3044
- "bar": {
3045
- "parameterId": "param1",
3046
- "type": "parameterId",
3047
- },
3004
+ "com.palantir.modify-sample-interface": {
3005
+ "actionType": {
3006
+ "actionTypeLogic": {
3007
+ "logic": {
3008
+ "rules": [
3009
+ {
3010
+ "modifyInterfaceRule": {
3011
+ "interfaceObjectToModifyParameter": "interfaceObjectToModifyParameter",
3012
+ "sharedPropertyValues": {
3013
+ "com.palantir.property1": {
3014
+ "parameterId": "com.palantir.property1",
3015
+ "type": "parameterId",
3048
3016
  },
3049
- "structFieldValues": {},
3050
3017
  },
3051
- "type": "addOrModifyObjectRuleV2",
3052
3018
  },
3053
- ],
3019
+ "type": "modifyInterfaceRule",
3020
+ },
3021
+ ],
3022
+ },
3023
+ "validation": {
3024
+ "actionTypeLevelValidation": {
3025
+ "rules": {
3026
+ "0": {
3027
+ "condition": {
3028
+ "true": {},
3029
+ "type": "true",
3030
+ },
3031
+ "displayMetadata": {
3032
+ "failureMessage": "",
3033
+ "typeClasses": [],
3034
+ },
3035
+ },
3036
+ },
3054
3037
  },
3055
- "validation": {
3056
- "actionTypeLevelValidation": {
3057
- "rules": {
3058
- "0": {
3059
- "condition": {
3060
- "true": {},
3061
- "type": "true",
3038
+ "parameterValidations": {
3039
+ "com.palantir.property1": {
3040
+ "conditionalOverrides": [],
3041
+ "defaultValidation": {
3042
+ "display": {
3043
+ "renderHint": {
3044
+ "textInput": {},
3045
+ "type": "textInput",
3062
3046
  },
3063
- "displayMetadata": {
3064
- "failureMessage": "",
3065
- "typeClasses": [],
3047
+ "visibility": {
3048
+ "editable": {},
3049
+ "type": "editable",
3050
+ },
3051
+ },
3052
+ "validation": {
3053
+ "allowedValues": {
3054
+ "text": {
3055
+ "text": {},
3056
+ "type": "text",
3057
+ },
3058
+ "type": "text",
3059
+ },
3060
+ "required": {
3061
+ "required": {},
3062
+ "type": "required",
3066
3063
  },
3067
3064
  },
3068
3065
  },
3069
3066
  },
3070
- "parameterValidations": {
3071
- "param1": {
3072
- "conditionalOverrides": [],
3073
- "defaultValidation": {
3074
- "display": {
3075
- "renderHint": {
3076
- "checkbox": {},
3077
- "type": "checkbox",
3078
- },
3079
- "visibility": {
3080
- "editable": {},
3081
- "type": "editable",
3082
- },
3067
+ "interfaceObjectToModifyParameter": {
3068
+ "conditionalOverrides": [],
3069
+ "defaultValidation": {
3070
+ "display": {
3071
+ "renderHint": {
3072
+ "dropdown": {},
3073
+ "type": "dropdown",
3083
3074
  },
3084
- "validation": {
3085
- "allowedValues": {
3086
- "boolean": {
3087
- "boolean": {},
3088
- "type": "boolean",
3089
- },
3090
- "type": "boolean",
3091
- },
3092
- "required": {
3093
- "required": {},
3094
- "type": "required",
3075
+ "visibility": {
3076
+ "editable": {},
3077
+ "type": "editable",
3078
+ },
3079
+ },
3080
+ "validation": {
3081
+ "allowedValues": {
3082
+ "interfaceObjectQuery": {
3083
+ "interfaceObjectQuery": {},
3084
+ "type": "interfaceObjectQuery",
3095
3085
  },
3086
+ "type": "interfaceObjectQuery",
3087
+ },
3088
+ "required": {
3089
+ "required": {},
3090
+ "type": "required",
3096
3091
  },
3097
3092
  },
3098
3093
  },
3099
3094
  },
3100
- "sectionValidations": {},
3101
3095
  },
3102
- },
3103
- "metadata": {
3104
- "apiName": "com.palantir.foo",
3105
- "displayMetadata": {
3106
- "configuration": {
3107
- "defaultLayout": "FORM",
3108
- "displayAndFormat": {
3109
- "table": {
3110
- "columnWidthByParameterRid": {},
3111
- "enableFileImport": true,
3112
- "fitHorizontally": false,
3113
- "frozenColumnCount": 0,
3114
- "rowHeightInLines": 1,
3096
+ "sectionValidations": {
3097
+ "section1": {
3098
+ "conditionalOverrides": [
3099
+ {
3100
+ "condition": {
3101
+ "comparison": {
3102
+ "left": {
3103
+ "type": "userProperty",
3104
+ "userProperty": {
3105
+ "propertyValue": {
3106
+ "groupIds": {},
3107
+ "type": "groupIds",
3108
+ },
3109
+ "userId": {
3110
+ "currentUser": {},
3111
+ "type": "currentUser",
3112
+ },
3113
+ },
3114
+ },
3115
+ "operator": "INTERSECTS",
3116
+ "right": {
3117
+ "staticValue": {
3118
+ "stringList": {
3119
+ "strings": [
3120
+ "testGroup",
3121
+ ],
3122
+ },
3123
+ "type": "stringList",
3124
+ },
3125
+ "type": "staticValue",
3126
+ },
3127
+ },
3128
+ "type": "comparison",
3129
+ },
3130
+ "sectionBlockOverrides": [
3131
+ {
3132
+ "type": "visibility",
3133
+ "visibility": {
3134
+ "visibility": {
3135
+ "hidden": {},
3136
+ "type": "hidden",
3137
+ },
3138
+ },
3139
+ },
3140
+ ],
3141
+ },
3142
+ ],
3143
+ "defaultDisplayMetadata": {
3144
+ "visibility": {
3145
+ "type": "visible",
3146
+ "visible": {},
3115
3147
  },
3116
3148
  },
3117
- "enableLayoutUserSwitch": false,
3118
3149
  },
3119
- "description": "",
3120
- "displayName": "exampleAction",
3121
- "icon": {
3122
- "blueprint": {
3123
- "color": "#000000",
3124
- "locator": "edit",
3150
+ },
3151
+ },
3152
+ },
3153
+ "metadata": {
3154
+ "apiName": "com.palantir.modify-sample-interface",
3155
+ "displayMetadata": {
3156
+ "configuration": {
3157
+ "defaultLayout": "FORM",
3158
+ "displayAndFormat": {
3159
+ "table": {
3160
+ "columnWidthByParameterRid": {},
3161
+ "enableFileImport": true,
3162
+ "fitHorizontally": false,
3163
+ "frozenColumnCount": 0,
3164
+ "rowHeightInLines": 1,
3125
3165
  },
3126
- "type": "blueprint",
3127
3166
  },
3128
- "successMessage": [],
3129
- "typeClasses": [],
3167
+ "enableLayoutUserSwitch": false,
3130
3168
  },
3131
- "entities": {
3132
- "affectedInterfaceTypes": [],
3133
- "affectedLinkTypes": [],
3134
- "affectedObjectTypes": [],
3135
- "typeGroups": [],
3169
+ "description": "",
3170
+ "displayName": "Modify sampleInterface",
3171
+ "icon": {
3172
+ "blueprint": {
3173
+ "color": "#000000",
3174
+ "locator": "edit",
3175
+ },
3176
+ "type": "blueprint",
3136
3177
  },
3137
- "formContentOrdering": [],
3138
- "parameterOrdering": [
3139
- "param1",
3178
+ "successMessage": [],
3179
+ "typeClasses": [],
3180
+ },
3181
+ "entities": {
3182
+ "affectedInterfaceTypes": [
3183
+ "com.palantir.sampleInterface",
3140
3184
  ],
3141
- "parameters": {
3142
- "param1": {
3143
- "displayMetadata": {
3144
- "description": "",
3145
- "displayName": "param1",
3146
- "typeClasses": [],
3147
- },
3148
- "id": "param1",
3149
- "type": {
3150
- "boolean": {},
3151
- "type": "boolean",
3185
+ "affectedLinkTypes": [],
3186
+ "affectedObjectTypes": [],
3187
+ "typeGroups": [],
3188
+ },
3189
+ "formContentOrdering": [
3190
+ {
3191
+ "parameterId": "interfaceObjectToModifyParameter",
3192
+ "type": "parameterId",
3193
+ },
3194
+ {
3195
+ "sectionId": "section1",
3196
+ "type": "sectionId",
3197
+ },
3198
+ ],
3199
+ "parameterOrdering": [
3200
+ "interfaceObjectToModifyParameter",
3201
+ "com.palantir.property1",
3202
+ ],
3203
+ "parameters": {
3204
+ "com.palantir.property1": {
3205
+ "displayMetadata": {
3206
+ "description": "",
3207
+ "displayName": "property1",
3208
+ "typeClasses": [],
3209
+ },
3210
+ "id": "com.palantir.property1",
3211
+ "type": {
3212
+ "string": {},
3213
+ "type": "string",
3214
+ },
3215
+ },
3216
+ "interfaceObjectToModifyParameter": {
3217
+ "displayMetadata": {
3218
+ "description": "",
3219
+ "displayName": "Object type to modify",
3220
+ "typeClasses": [],
3221
+ },
3222
+ "id": "interfaceObjectToModifyParameter",
3223
+ "type": {
3224
+ "interfaceReference": {
3225
+ "interfaceTypeRid": "com.palantir.sampleInterface",
3152
3226
  },
3227
+ "type": "interfaceReference",
3153
3228
  },
3154
3229
  },
3155
- "sections": {},
3156
- "status": {
3157
- "active": {},
3158
- "type": "active",
3230
+ },
3231
+ "sections": {
3232
+ "section1": {
3233
+ "content": [
3234
+ {
3235
+ "parameterId": "com.palantir.property1",
3236
+ "type": "parameterId",
3237
+ },
3238
+ ],
3239
+ "displayMetadata": {
3240
+ "collapsedByDefault": false,
3241
+ "columnCount": 1,
3242
+ "description": "Description for Section 1",
3243
+ "displayName": "Section 1",
3244
+ "showTitleBar": true,
3245
+ },
3246
+ "id": "section1",
3159
3247
  },
3160
3248
  },
3249
+ "status": {
3250
+ "active": {},
3251
+ "type": "active",
3252
+ },
3161
3253
  },
3162
3254
  },
3163
3255
  },
3164
- "blockPermissionInformation": {
3165
- "actionTypes": {},
3166
- "linkTypes": {},
3167
- "objectTypes": {},
3168
- },
3169
- "interfaceTypes": {},
3256
+ },
3257
+ "blockPermissionInformation": {
3258
+ "actionTypes": {},
3170
3259
  "linkTypes": {},
3171
3260
  "objectTypes": {},
3172
- "sharedPropertyTypes": {},
3173
3261
  },
3174
- "randomnessKey": undefined,
3175
- "valueTypes": {
3176
- "valueTypes": [],
3262
+ "interfaceTypes": {
3263
+ "com.palantir.sampleInterface": {
3264
+ "interfaceType": {
3265
+ "apiName": "com.palantir.sampleInterface",
3266
+ "displayMetadata": {
3267
+ "description": "sampleInterface",
3268
+ "displayName": "sampleInterface",
3269
+ "icon": {
3270
+ "blueprint": {
3271
+ "color": "#4C90F0",
3272
+ "locator": "layout-hierarchy",
3273
+ },
3274
+ "type": "blueprint",
3275
+ },
3276
+ },
3277
+ "extendsInterfaces": [],
3278
+ "links": [],
3279
+ "properties": [],
3280
+ "propertiesV2": {
3281
+ "com.palantir.property1": {
3282
+ "required": true,
3283
+ "sharedPropertyType": {
3284
+ "aliases": [],
3285
+ "apiName": "com.palantir.property1",
3286
+ "baseFormatter": undefined,
3287
+ "dataConstraints": undefined,
3288
+ "displayMetadata": {
3289
+ "description": undefined,
3290
+ "displayName": "property1",
3291
+ "visibility": "NORMAL",
3292
+ },
3293
+ "gothamMapping": undefined,
3294
+ "indexedForSearch": true,
3295
+ "type": {
3296
+ "string": {
3297
+ "analyzerOverride": undefined,
3298
+ "enableAsciiFolding": undefined,
3299
+ "isLongText": false,
3300
+ "supportsEfficientLeadingWildcard": false,
3301
+ "supportsExactMatching": true,
3302
+ },
3303
+ "type": "string",
3304
+ },
3305
+ "typeClasses": [
3306
+ {
3307
+ "kind": "render_hint",
3308
+ "name": "SELECTABLE",
3309
+ },
3310
+ {
3311
+ "kind": "render_hint",
3312
+ "name": "SORTABLE",
3313
+ },
3314
+ ],
3315
+ "valueType": undefined,
3316
+ },
3317
+ },
3318
+ },
3319
+ "propertiesV3": {},
3320
+ "searchable": true,
3321
+ "status": {
3322
+ "active": {},
3323
+ "type": "active",
3324
+ },
3325
+ },
3326
+ },
3327
+ },
3328
+ "linkTypes": {},
3329
+ "objectTypes": {},
3330
+ "sharedPropertyTypes": {
3331
+ "com.palantir.property1": {
3332
+ "sharedPropertyType": {
3333
+ "aliases": [],
3334
+ "apiName": "com.palantir.property1",
3335
+ "baseFormatter": undefined,
3336
+ "dataConstraints": undefined,
3337
+ "displayMetadata": {
3338
+ "description": undefined,
3339
+ "displayName": "property1",
3340
+ "visibility": "NORMAL",
3341
+ },
3342
+ "gothamMapping": undefined,
3343
+ "indexedForSearch": true,
3344
+ "type": {
3345
+ "string": {
3346
+ "analyzerOverride": undefined,
3347
+ "enableAsciiFolding": undefined,
3348
+ "isLongText": false,
3349
+ "supportsEfficientLeadingWildcard": false,
3350
+ "supportsExactMatching": true,
3351
+ },
3352
+ "type": "string",
3353
+ },
3354
+ "typeClasses": [
3355
+ {
3356
+ "kind": "render_hint",
3357
+ "name": "SELECTABLE",
3358
+ },
3359
+ {
3360
+ "kind": "render_hint",
3361
+ "name": "SORTABLE",
3362
+ },
3363
+ ],
3364
+ "valueType": undefined,
3365
+ },
3366
+ },
3177
3367
  },
3178
- }
3179
- `);
3180
- });
3181
- });
3182
- describe("Object Actions", () => {
3183
- it("Simple concrete actions are properly defined", () => {
3184
- const exampleObjectType = defineObject({
3185
- titlePropertyApiName: "bar",
3186
- displayName: "exampleObjectType",
3187
- pluralDisplayName: "exampleObjectTypes",
3188
- apiName: "foo",
3189
- primaryKeyPropertyApiName: "bar",
3190
- properties: {
3191
- "bar": {
3192
- type: "string"
3193
3368
  },
3194
- "structProp": {
3195
- type: {
3196
- type: "struct",
3197
- structDefinition: {
3198
- simpleProperty: "string"
3199
- }
3200
- }
3369
+ "randomnessKey": undefined,
3370
+ "valueTypes": {
3371
+ "valueTypes": [],
3201
3372
  },
3202
- "optionalProp": {
3203
- type: "string"
3204
- }
3205
3373
  }
3206
- });
3207
- defineCreateObjectAction({
3208
- objectType: exampleObjectType
3209
- });
3210
- defineModifyObjectAction({
3211
- objectType: exampleObjectType
3212
- });
3213
- defineDeleteObjectAction({
3214
- objectType: exampleObjectType
3215
- });
3216
- defineCreateOrModifyObjectAction({
3217
- objectType: exampleObjectType
3218
- });
3219
- expect(dumpOntologyFullMetadata()).toMatchInlineSnapshot(`
3374
+ `);});});describe("Object Actions",()=>{it("Simple concrete actions are properly defined",()=>{const exampleObjectType=defineObject({titlePropertyApiName:"bar",displayName:"exampleObjectType",pluralDisplayName:"exampleObjectTypes",apiName:"foo",primaryKeyPropertyApiName:"bar",properties:{"bar":{type:"string"},"structProp":{type:{type:"struct",structDefinition:{simpleProperty:"string"}}},"optionalProp":{type:"string"}}});defineCreateObjectAction({objectType:exampleObjectType});defineModifyObjectAction({objectType:exampleObjectType});defineDeleteObjectAction({objectType:exampleObjectType});defineCreateOrModifyObjectAction({objectType:exampleObjectType});expect(dumpOntologyFullMetadata()).toMatchInlineSnapshot(`
3220
3375
  {
3221
3376
  "importedOntology": {
3222
3377
  "actionTypes": {},
@@ -4115,224 +4270,7 @@ describe("Action Types", () => {
4115
4270
  "valueTypes": [],
4116
4271
  },
4117
4272
  }
4118
- `);
4119
- });
4120
- it("Customizations on CRUD object type actions are properly defined", () => {
4121
- const exampleObjectType = defineObject({
4122
- titlePropertyApiName: "bar",
4123
- displayName: "exampleObjectType",
4124
- pluralDisplayName: "exampleObjectTypes",
4125
- apiName: "foo",
4126
- primaryKeyPropertyApiName: "primary",
4127
- properties: {
4128
- "bar": {
4129
- type: "string"
4130
- },
4131
- "fizz": {
4132
- type: "string"
4133
- },
4134
- "buzz": {
4135
- type: "string"
4136
- },
4137
- "primary": {
4138
- type: "string"
4139
- }
4140
- }
4141
- });
4142
- defineCreateObjectAction({
4143
- objectType: exampleObjectType,
4144
- actionLevelValidation: [{
4145
- condition: {
4146
- type: "group",
4147
- name: "actionLevelGroup"
4148
- }
4149
- }, {
4150
- condition: {
4151
- type: "group",
4152
- name: "actionLevelGroup2"
4153
- },
4154
- displayMetadata: {
4155
- failureMessage: "Different custom failure message",
4156
- typeClasses: []
4157
- }
4158
- }],
4159
- parameterOrdering: ["bar", "fizz", "primary"],
4160
- parameterConfiguration: {
4161
- "fizz": {
4162
- required: false,
4163
- conditionalOverrides: [{
4164
- type: "required",
4165
- condition: {
4166
- type: "and",
4167
- conditions: [{
4168
- type: "group",
4169
- name: "parameterLevelGroup"
4170
- }, {
4171
- type: "parameter",
4172
- parameterId: "bar",
4173
- matches: {
4174
- type: "staticValue",
4175
- staticValue: {
4176
- type: "string",
4177
- string: "bar"
4178
- }
4179
- }
4180
- }]
4181
- }
4182
- }],
4183
- defaultValue: {
4184
- type: "staticValue",
4185
- staticValue: {
4186
- type: "string",
4187
- string: "default_fizz"
4188
- }
4189
- },
4190
- displayName: "fizz_display",
4191
- description: "fizz_description"
4192
- }
4193
- },
4194
- excludedProperties: ["buzz"],
4195
- defaultFormat: "TABLE",
4196
- enableLayoutSwitch: true,
4197
- submissionMetadata: {
4198
- successMessage: "Custom success message",
4199
- undoButtonConfiguration: true,
4200
- submitButtonDisplayMetadata: {
4201
- intent: "DANGER",
4202
- text: "Custom button"
4203
- }
4204
- }
4205
- });
4206
- defineModifyObjectAction({
4207
- objectType: exampleObjectType,
4208
- actionLevelValidation: [{
4209
- condition: {
4210
- type: "group",
4211
- name: "actionLevelGroup"
4212
- }
4213
- }, {
4214
- condition: {
4215
- type: "group",
4216
- name: "actionLevelGroup2"
4217
- },
4218
- displayMetadata: {
4219
- failureMessage: "Different custom failure message",
4220
- typeClasses: []
4221
- }
4222
- }],
4223
- parameterOrdering: ["bar", "fizz"],
4224
- parameterConfiguration: {
4225
- "fizz": {
4226
- required: false,
4227
- conditionalOverrides: [{
4228
- type: "required",
4229
- condition: {
4230
- type: "and",
4231
- conditions: [{
4232
- type: "group",
4233
- name: "parameterLevelGroup"
4234
- }, {
4235
- type: "parameter",
4236
- parameterId: "bar",
4237
- matches: {
4238
- type: "staticValue",
4239
- staticValue: {
4240
- type: "string",
4241
- string: "bar"
4242
- }
4243
- }
4244
- }]
4245
- }
4246
- }],
4247
- defaultValue: {
4248
- type: "staticValue",
4249
- staticValue: {
4250
- type: "string",
4251
- string: "default_fizz"
4252
- }
4253
- },
4254
- displayName: "fizz_display",
4255
- description: "fizz_description"
4256
- }
4257
- },
4258
- excludedProperties: ["buzz"],
4259
- defaultFormat: "TABLE",
4260
- enableLayoutSwitch: true,
4261
- submissionMetadata: {
4262
- successMessage: "Custom success message",
4263
- undoButtonConfiguration: true,
4264
- submitButtonDisplayMetadata: {
4265
- intent: "DANGER",
4266
- text: "Custom button"
4267
- }
4268
- }
4269
- });
4270
- defineCreateOrModifyObjectAction({
4271
- objectType: exampleObjectType,
4272
- actionLevelValidation: [{
4273
- condition: {
4274
- type: "group",
4275
- name: "actionLevelGroup"
4276
- }
4277
- }, {
4278
- condition: {
4279
- type: "group",
4280
- name: "actionLevelGroup2"
4281
- },
4282
- displayMetadata: {
4283
- failureMessage: "Different custom failure message",
4284
- typeClasses: []
4285
- }
4286
- }],
4287
- parameterOrdering: ["bar", "fizz"],
4288
- parameterConfiguration: {
4289
- "fizz": {
4290
- required: false,
4291
- conditionalOverrides: [{
4292
- type: "required",
4293
- condition: {
4294
- type: "and",
4295
- conditions: [{
4296
- type: "group",
4297
- name: "parameterLevelGroup"
4298
- }, {
4299
- type: "parameter",
4300
- parameterId: "bar",
4301
- matches: {
4302
- type: "staticValue",
4303
- staticValue: {
4304
- type: "string",
4305
- string: "bar"
4306
- }
4307
- }
4308
- }]
4309
- }
4310
- }],
4311
- defaultValue: {
4312
- type: "staticValue",
4313
- staticValue: {
4314
- type: "string",
4315
- string: "default_fizz"
4316
- }
4317
- },
4318
- displayName: "fizz_display",
4319
- description: "fizz_description"
4320
- }
4321
- },
4322
- excludedProperties: ["buzz"],
4323
- defaultFormat: "TABLE",
4324
- enableLayoutSwitch: true,
4325
- submissionMetadata: {
4326
- successMessage: "Custom success message",
4327
- undoButtonConfiguration: true,
4328
- submitButtonDisplayMetadata: {
4329
- intent: "DANGER",
4330
- text: "Custom button"
4331
- }
4332
- },
4333
- primaryKeyOption: "userInput"
4334
- });
4335
- expect(dumpOntologyFullMetadata()).toMatchInlineSnapshot(`
4273
+ `);});it("Customizations on CRUD object type actions are properly defined",()=>{const exampleObjectType=defineObject({titlePropertyApiName:"bar",displayName:"exampleObjectType",pluralDisplayName:"exampleObjectTypes",apiName:"foo",primaryKeyPropertyApiName:"primary",properties:{"bar":{type:"string"},"fizz":{type:"string"},"buzz":{type:"string"},"primary":{type:"string"}}});defineCreateObjectAction({objectType:exampleObjectType,actionLevelValidation:[{condition:{type:"group",name:"actionLevelGroup"}},{condition:{type:"group",name:"actionLevelGroup2"},displayMetadata:{failureMessage:"Different custom failure message",typeClasses:[]}}],parameterOrdering:["bar","fizz","primary"],parameterConfiguration:{"fizz":{required:false,conditionalOverrides:[{type:"required",condition:{type:"and",conditions:[{type:"group",name:"parameterLevelGroup"},{type:"parameter",parameterId:"bar",matches:{type:"staticValue",staticValue:{type:"string",string:"bar"}}}]}}],defaultValue:{type:"staticValue",staticValue:{type:"string",string:"default_fizz"}},displayName:"fizz_display",description:"fizz_description"}},excludedProperties:["buzz"],defaultFormat:"TABLE",enableLayoutSwitch:true,submissionMetadata:{successMessage:"Custom success message",undoButtonConfiguration:true,submitButtonDisplayMetadata:{intent:"DANGER",text:"Custom button"}}});defineModifyObjectAction({objectType:exampleObjectType,actionLevelValidation:[{condition:{type:"group",name:"actionLevelGroup"}},{condition:{type:"group",name:"actionLevelGroup2"},displayMetadata:{failureMessage:"Different custom failure message",typeClasses:[]}}],parameterOrdering:["bar","fizz"],parameterConfiguration:{"fizz":{required:false,conditionalOverrides:[{type:"required",condition:{type:"and",conditions:[{type:"group",name:"parameterLevelGroup"},{type:"parameter",parameterId:"bar",matches:{type:"staticValue",staticValue:{type:"string",string:"bar"}}}]}}],defaultValue:{type:"staticValue",staticValue:{type:"string",string:"default_fizz"}},displayName:"fizz_display",description:"fizz_description"}},excludedProperties:["buzz"],defaultFormat:"TABLE",enableLayoutSwitch:true,submissionMetadata:{successMessage:"Custom success message",undoButtonConfiguration:true,submitButtonDisplayMetadata:{intent:"DANGER",text:"Custom button"}}});defineCreateOrModifyObjectAction({objectType:exampleObjectType,actionLevelValidation:[{condition:{type:"group",name:"actionLevelGroup"}},{condition:{type:"group",name:"actionLevelGroup2"},displayMetadata:{failureMessage:"Different custom failure message",typeClasses:[]}}],parameterOrdering:["bar","fizz"],parameterConfiguration:{"fizz":{required:false,conditionalOverrides:[{type:"required",condition:{type:"and",conditions:[{type:"group",name:"parameterLevelGroup"},{type:"parameter",parameterId:"bar",matches:{type:"staticValue",staticValue:{type:"string",string:"bar"}}}]}}],defaultValue:{type:"staticValue",staticValue:{type:"string",string:"default_fizz"}},displayName:"fizz_display",description:"fizz_description"}},excludedProperties:["buzz"],defaultFormat:"TABLE",enableLayoutSwitch:true,submissionMetadata:{successMessage:"Custom success message",undoButtonConfiguration:true,submitButtonDisplayMetadata:{intent:"DANGER",text:"Custom button"}},primaryKeyOption:"userInput"});expect(dumpOntologyFullMetadata()).toMatchInlineSnapshot(`
4336
4274
  {
4337
4275
  "importedOntology": {
4338
4276
  "actionTypes": {},
@@ -5733,98 +5671,7 @@ describe("Action Types", () => {
5733
5671
  "valueTypes": [],
5734
5672
  },
5735
5673
  }
5736
- `);
5737
- });
5738
- it("Non-parameter mapped properties are properly defined", () => {
5739
- const exampleObjectType = defineObject({
5740
- titlePropertyApiName: "bar",
5741
- displayName: "exampleObjectType",
5742
- pluralDisplayName: "exampleObjectTypes",
5743
- apiName: "foo",
5744
- primaryKeyPropertyApiName: "bar",
5745
- properties: {
5746
- "bar": {
5747
- type: "string"
5748
- },
5749
- "fizz": {
5750
- type: "string"
5751
- },
5752
- "buzz": {
5753
- type: "timestamp"
5754
- }
5755
- }
5756
- });
5757
- defineCreateObjectAction({
5758
- objectType: exampleObjectType,
5759
- nonParameterMappings: {
5760
- "fizz": {
5761
- type: "currentUser"
5762
- },
5763
- "buzz": {
5764
- type: "currentTime"
5765
- }
5766
- }
5767
- });
5768
- defineModifyObjectAction({
5769
- objectType: exampleObjectType,
5770
- nonParameterMappings: {
5771
- "fizz": {
5772
- type: "currentUser"
5773
- },
5774
- "buzz": {
5775
- type: "currentTime"
5776
- }
5777
- }
5778
- });
5779
- defineCreateOrModifyObjectAction({
5780
- objectType: exampleObjectType,
5781
- nonParameterMappings: {
5782
- "fizz": {
5783
- type: "currentUser"
5784
- },
5785
- "buzz": {
5786
- type: "currentTime"
5787
- }
5788
- }
5789
- });
5790
- const property1 = defineSharedPropertyType({
5791
- apiName: "property1",
5792
- type: "string"
5793
- });
5794
- const property2 = defineSharedPropertyType({
5795
- apiName: "property2",
5796
- type: "string"
5797
- });
5798
- const exampleInterface = defineInterface({
5799
- apiName: "exampleInterface",
5800
- properties: {
5801
- property1,
5802
- property2
5803
- }
5804
- });
5805
- defineCreateInterfaceObjectAction({
5806
- interfaceType: exampleInterface,
5807
- nonParameterMappings: {
5808
- [property1.apiName]: {
5809
- type: "currentUser"
5810
- },
5811
- [property2.apiName]: {
5812
- type: "currentTime"
5813
- }
5814
- }
5815
- });
5816
- defineModifyInterfaceObjectAction({
5817
- interfaceType: exampleInterface,
5818
- nonParameterMappings: {
5819
- [property1.apiName]: {
5820
- type: "currentUser"
5821
- },
5822
- [property2.apiName]: {
5823
- type: "currentTime"
5824
- }
5825
- }
5826
- });
5827
- expect(dumpOntologyFullMetadata()).toMatchInlineSnapshot(`
5674
+ `);});it("Non-parameter mapped properties are properly defined",()=>{const exampleObjectType=defineObject({titlePropertyApiName:"bar",displayName:"exampleObjectType",pluralDisplayName:"exampleObjectTypes",apiName:"foo",primaryKeyPropertyApiName:"bar",properties:{"bar":{type:"string"},"fizz":{type:"string"},"buzz":{type:"timestamp"}}});defineCreateObjectAction({objectType:exampleObjectType,nonParameterMappings:{"fizz":{type:"currentUser"},"buzz":{type:"currentTime"}}});defineModifyObjectAction({objectType:exampleObjectType,nonParameterMappings:{"fizz":{type:"currentUser"},"buzz":{type:"currentTime"}}});defineCreateOrModifyObjectAction({objectType:exampleObjectType,nonParameterMappings:{"fizz":{type:"currentUser"},"buzz":{type:"currentTime"}}});const property1=defineSharedPropertyType({apiName:"property1",type:"string"});const property2=defineSharedPropertyType({apiName:"property2",type:"string"});const exampleInterface=defineInterface({apiName:"exampleInterface",properties:{property1,property2}});defineCreateInterfaceObjectAction({interfaceType:exampleInterface,nonParameterMappings:{[property1.apiName]:{type:"currentUser"},[property2.apiName]:{type:"currentTime"}}});defineModifyInterfaceObjectAction({interfaceType:exampleInterface,nonParameterMappings:{[property1.apiName]:{type:"currentUser"},[property2.apiName]:{type:"currentTime"}}});expect(dumpOntologyFullMetadata()).toMatchInlineSnapshot(`
5828
5675
  {
5829
5676
  "importedOntology": {
5830
5677
  "actionTypes": {},
@@ -6904,289 +6751,7 @@ describe("Action Types", () => {
6904
6751
  "valueTypes": [],
6905
6752
  },
6906
6753
  }
6907
- `);
6908
- });
6909
- it("Parameter configuration, property mapping, and excluded property validations work", () => {
6910
- const sampleObject = defineObject({
6911
- apiName: "sampleObject",
6912
- displayName: "Test Object",
6913
- description: "Sample object description",
6914
- primaryKeyPropertyApiName: "id",
6915
- pluralDisplayName: "tests",
6916
- titlePropertyApiName: "name",
6917
- properties: {
6918
- "name": {
6919
- type: "string"
6920
- },
6921
- "id": {
6922
- type: "string"
6923
- }
6924
- }
6925
- });
6926
- expect(() => {
6927
- defineCreateObjectAction({
6928
- objectType: sampleObject,
6929
- parameterConfiguration: {
6930
- "name": {
6931
- displayName: "Name"
6932
- },
6933
- "custom_parameter": {
6934
- displayName: "My Custom Param"
6935
- }
6936
- }
6937
- });
6938
- }).toThrowErrorMatchingInlineSnapshot(`[Error: Invariant failed: Parameter custom_parameter does not exist as a property on com.palantir.sampleObject and its type is not explicitly defined]`);
6939
- expect(() => {
6940
- defineCreateObjectAction({
6941
- objectType: sampleObject,
6942
- nonParameterMappings: {
6943
- "custom_parameter": {
6944
- type: "staticValue",
6945
- staticValue: {
6946
- type: "string",
6947
- string: "custom_value"
6948
- }
6949
- }
6950
- }
6951
- });
6952
- }).toThrowErrorMatchingInlineSnapshot(`[Error: Invariant failed: Property custom_parameter does not exist as a property on com.palantir.sampleObject]`);
6953
- expect(() => {
6954
- defineCreateObjectAction({
6955
- objectType: sampleObject,
6956
- excludedProperties: ["custom_parameter"]
6957
- });
6958
- }).toThrowErrorMatchingInlineSnapshot(`[Error: Invariant failed: Property custom_parameter does not exist as a property on com.palantir.sampleObject]`);
6959
- expect(() => {
6960
- defineCreateObjectAction({
6961
- objectType: sampleObject,
6962
- actionLevelValidation: [{
6963
- condition: {
6964
- type: "or",
6965
- conditions: [{
6966
- type: "parameter",
6967
- parameterId: "non_existent_parameter",
6968
- matches: {
6969
- type: "staticValue",
6970
- staticValue: {
6971
- type: "string",
6972
- string: "value"
6973
- }
6974
- }
6975
- }]
6976
- }
6977
- }]
6978
- });
6979
- }).toThrowErrorMatchingInlineSnapshot(`[Error: Invariant failed: Action parameter condition references unknown parameter non_existent_parameter]`);
6980
- const property1 = defineSharedPropertyType({
6981
- apiName: "property1",
6982
- type: "string"
6983
- });
6984
- const sampleInterface = defineInterface({
6985
- apiName: "sampleInterface",
6986
- properties: {
6987
- property1
6988
- }
6989
- });
6990
- expect(() => {
6991
- defineCreateInterfaceObjectAction({
6992
- interfaceType: sampleInterface,
6993
- parameterConfiguration: {
6994
- "property": {
6995
- displayName: "My Custom Param"
6996
- }
6997
- }
6998
- });
6999
- }).toThrowErrorMatchingInlineSnapshot(`[Error: Invariant failed: Parameter com.palantir.property does not exist as a property on com.palantir.sampleInterface and its type is not explicitly defined]`);
7000
- expect(() => {
7001
- defineModifyInterfaceObjectAction({
7002
- interfaceType: sampleInterface,
7003
- parameterConfiguration: {
7004
- "property": {
7005
- displayName: "My Custom Param"
7006
- }
7007
- }
7008
- });
7009
- }).toThrowErrorMatchingInlineSnapshot(`[Error: Invariant failed: Parameter com.palantir.property does not exist as a property on com.palantir.sampleInterface and its type is not explicitly defined]`);
7010
- });
7011
- it("Static default action parameters must match type", () => {
7012
- const exampleObjectType = defineObject({
7013
- titlePropertyApiName: "bar",
7014
- displayName: "exampleObjectType",
7015
- pluralDisplayName: "exampleObjectTypes",
7016
- apiName: "foo",
7017
- primaryKeyPropertyApiName: "primary",
7018
- properties: {
7019
- "bar": {
7020
- type: "string"
7021
- },
7022
- "fizz": {
7023
- type: "string"
7024
- },
7025
- "buzz": {
7026
- type: "string"
7027
- },
7028
- "primary": {
7029
- type: "string"
7030
- }
7031
- }
7032
- });
7033
- expect(() => defineCreateObjectAction({
7034
- objectType: exampleObjectType,
7035
- parameterConfiguration: {
7036
- "buzz": {
7037
- defaultValue: {
7038
- type: "staticValue",
7039
- staticValue: {
7040
- type: "boolean",
7041
- boolean: true
7042
- }
7043
- }
7044
- }
7045
- }
7046
- })).toThrowError("Invariant failed: Default static value for parameter buzz does not match type");
7047
- });
7048
- it("ModifyObjectRule requires objectToModify parameter", () => {
7049
- defineObject({
7050
- apiName: "sampleObject",
7051
- displayName: "Test Object",
7052
- description: "Sample object description",
7053
- primaryKeyPropertyApiName: "id",
7054
- pluralDisplayName: "tests",
7055
- titlePropertyApiName: "name",
7056
- properties: {
7057
- "name": {
7058
- type: "string",
7059
- description: "The name of the test object"
7060
- },
7061
- "id": {
7062
- type: "string",
7063
- description: "The ID of the test object"
7064
- }
7065
- }
7066
- });
7067
- expect(() => defineAction({
7068
- apiName: "foo",
7069
- displayName: "exampleAction",
7070
- status: "active",
7071
- rules: [{
7072
- type: "modifyObjectRule",
7073
- modifyObjectRule: {
7074
- objectToModify: "sampleObject",
7075
- propertyValues: {
7076
- "name": {
7077
- type: "parameterId",
7078
- parameterId: "name"
7079
- }
7080
- },
7081
- structFieldValues: {}
7082
- }
7083
- }],
7084
- parameters: [{
7085
- id: "name",
7086
- displayName: "Name",
7087
- type: "string",
7088
- validation: {
7089
- required: true,
7090
- allowedValues: {
7091
- type: "text"
7092
- }
7093
- }
7094
- }]
7095
- })).toThrowError("Invariant failed: Object to modify parameter must be defined in parameters");
7096
- });
7097
- it("Target object parameters are configurable", () => {
7098
- const employeeObject = defineObject({
7099
- apiName: "employee",
7100
- displayName: "Employee",
7101
- pluralDisplayName: "Employees",
7102
- titlePropertyApiName: "id",
7103
- primaryKeyPropertyApiName: "id",
7104
- properties: {
7105
- "id": {
7106
- type: "string",
7107
- displayName: "ID",
7108
- description: "dummy"
7109
- },
7110
- "managedBy": {
7111
- type: "string"
7112
- }
7113
- }
7114
- });
7115
- defineModifyObjectAction({
7116
- objectType: employeeObject,
7117
- parameterConfiguration: {
7118
- [MODIFY_OBJECT_PARAMETER]: {
7119
- displayName: "Chose a manager to modify",
7120
- description: "Description",
7121
- conditionalOverrides: [{
7122
- type: "visibility",
7123
- condition: {
7124
- type: "group",
7125
- name: "supervisors"
7126
- }
7127
- }]
7128
- }
7129
- }
7130
- });
7131
- defineCreateOrModifyObjectAction({
7132
- objectType: employeeObject,
7133
- parameterConfiguration: {
7134
- [CREATE_OR_MODIFY_OBJECT_PARAMETER]: {
7135
- displayName: "Chose a manager to modify or create a new one",
7136
- description: "Description",
7137
- conditionalOverrides: [{
7138
- type: "visibility",
7139
- condition: {
7140
- type: "group",
7141
- name: "supervisors"
7142
- }
7143
- }]
7144
- }
7145
- }
7146
- });
7147
- const property1 = defineSharedPropertyType({
7148
- apiName: "property1",
7149
- type: "string"
7150
- });
7151
- const exampleInterface = defineInterface({
7152
- apiName: "exampleInterface",
7153
- properties: {
7154
- property1
7155
- }
7156
- });
7157
- defineCreateInterfaceObjectAction({
7158
- interfaceType: exampleInterface,
7159
- parameterConfiguration: {
7160
- [CREATE_INTERFACE_OBJECT_PARAMETER]: {
7161
- displayName: "Choose an object to create",
7162
- description: "Description",
7163
- conditionalOverrides: [{
7164
- type: "visibility",
7165
- condition: {
7166
- type: "group",
7167
- name: "supervisors"
7168
- }
7169
- }]
7170
- }
7171
- }
7172
- });
7173
- defineModifyInterfaceObjectAction({
7174
- interfaceType: exampleInterface,
7175
- parameterConfiguration: {
7176
- [MODIFY_INTERFACE_OBJECT_PARAMETER]: {
7177
- displayName: "Choose an object to modify",
7178
- description: "Description",
7179
- conditionalOverrides: [{
7180
- type: "visibility",
7181
- condition: {
7182
- type: "group",
7183
- name: "supervisors"
7184
- }
7185
- }]
7186
- }
7187
- }
7188
- });
7189
- expect(dumpOntologyFullMetadata()).toMatchInlineSnapshot(`
6754
+ `);});it("Parameter configuration, property mapping, and excluded property validations work",()=>{const sampleObject=defineObject({apiName:"sampleObject",displayName:"Test Object",description:"Sample object description",primaryKeyPropertyApiName:"id",pluralDisplayName:"tests",titlePropertyApiName:"name",properties:{"name":{type:"string"},"id":{type:"string"}}});expect(()=>{defineCreateObjectAction({objectType:sampleObject,parameterConfiguration:{"name":{displayName:"Name"},"custom_parameter":{displayName:"My Custom Param"}}});}).toThrowErrorMatchingInlineSnapshot(`[Error: Invariant failed: Parameter custom_parameter does not exist as a property on com.palantir.sampleObject and its type is not explicitly defined]`);expect(()=>{defineCreateObjectAction({objectType:sampleObject,nonParameterMappings:{"custom_parameter":{type:"staticValue",staticValue:{type:"string",string:"custom_value"}}}});}).toThrowErrorMatchingInlineSnapshot(`[Error: Invariant failed: Property custom_parameter does not exist as a property on com.palantir.sampleObject]`);expect(()=>{defineCreateObjectAction({objectType:sampleObject,excludedProperties:["custom_parameter"]});}).toThrowErrorMatchingInlineSnapshot(`[Error: Invariant failed: Property custom_parameter does not exist as a property on com.palantir.sampleObject]`);expect(()=>{defineCreateObjectAction({objectType:sampleObject,actionLevelValidation:[{condition:{type:"or",conditions:[{type:"parameter",parameterId:"non_existent_parameter",matches:{type:"staticValue",staticValue:{type:"string",string:"value"}}}]}}]});}).toThrowErrorMatchingInlineSnapshot(`[Error: Invariant failed: Action parameter condition references unknown parameter non_existent_parameter]`);});it("Static default action parameters must match type",()=>{const exampleObjectType=defineObject({titlePropertyApiName:"bar",displayName:"exampleObjectType",pluralDisplayName:"exampleObjectTypes",apiName:"foo",primaryKeyPropertyApiName:"primary",properties:{"bar":{type:"string"},"fizz":{type:"string"},"buzz":{type:"string"},"primary":{type:"string"}}});expect(()=>defineCreateObjectAction({objectType:exampleObjectType,parameterConfiguration:{"buzz":{defaultValue:{type:"staticValue",staticValue:{type:"boolean",boolean:true}}}}})).toThrowError("Invariant failed: Default static value for parameter buzz does not match type");});it("ModifyObjectRule requires objectToModify parameter",()=>{defineObject({apiName:"sampleObject",displayName:"Test Object",description:"Sample object description",primaryKeyPropertyApiName:"id",pluralDisplayName:"tests",titlePropertyApiName:"name",properties:{"name":{type:"string",description:"The name of the test object"},"id":{type:"string",description:"The ID of the test object"}}});expect(()=>defineAction({apiName:"foo",displayName:"exampleAction",status:"active",rules:[{type:"modifyObjectRule",modifyObjectRule:{objectToModify:"sampleObject",propertyValues:{"name":{type:"parameterId",parameterId:"name"}},structFieldValues:{}}}],parameters:[{id:"name",displayName:"Name",type:"string",validation:{required:true,allowedValues:{type:"text"}}}]})).toThrowError("Invariant failed: Object to modify parameter must be defined in parameters");});it("Target object parameters are configurable",()=>{const employeeObject=defineObject({apiName:"employee",displayName:"Employee",pluralDisplayName:"Employees",titlePropertyApiName:"id",primaryKeyPropertyApiName:"id",properties:{"id":{type:"string",displayName:"ID",description:"dummy"},"managedBy":{type:"string"}}});defineModifyObjectAction({objectType:employeeObject,parameterConfiguration:{[MODIFY_OBJECT_PARAMETER]:{displayName:"Chose a manager to modify",description:"Description",conditionalOverrides:[{type:"visibility",condition:{type:"group",name:"supervisors"}}]}}});defineCreateOrModifyObjectAction({objectType:employeeObject,parameterConfiguration:{[CREATE_OR_MODIFY_OBJECT_PARAMETER]:{displayName:"Chose a manager to modify or create a new one",description:"Description",conditionalOverrides:[{type:"visibility",condition:{type:"group",name:"supervisors"}}]}}});const property1=defineSharedPropertyType({apiName:"property1",type:"string"});const exampleInterface=defineInterface({apiName:"exampleInterface",properties:{property1}});defineCreateInterfaceObjectAction({interfaceType:exampleInterface,parameterConfiguration:{[CREATE_INTERFACE_OBJECT_PARAMETER]:{displayName:"Choose an object to create",description:"Description",conditionalOverrides:[{type:"visibility",condition:{type:"group",name:"supervisors"}}]}}});defineModifyInterfaceObjectAction({interfaceType:exampleInterface,parameterConfiguration:{[MODIFY_INTERFACE_OBJECT_PARAMETER]:{displayName:"Choose an object to modify",description:"Description",conditionalOverrides:[{type:"visibility",condition:{type:"group",name:"supervisors"}}]}}});expect(dumpOntologyFullMetadata()).toMatchInlineSnapshot(`
7190
6755
  {
7191
6756
  "importedOntology": {
7192
6757
  "actionTypes": {},
@@ -8355,59 +7920,7 @@ describe("Action Types", () => {
8355
7920
  "valueTypes": [],
8356
7921
  },
8357
7922
  }
8358
- `);
8359
- });
8360
- it("Conditional overrides on actions are properly defined", () => {
8361
- defineAction({
8362
- apiName: "foo",
8363
- displayName: "exampleAction",
8364
- status: "active",
8365
- rules: [{
8366
- type: "modifyObjectRule",
8367
- modifyObjectRule: {
8368
- objectToModify: "objectToModifyParameter",
8369
- propertyValues: {
8370
- "bar": {
8371
- type: "parameterId",
8372
- parameterId: "param1"
8373
- }
8374
- },
8375
- structFieldValues: {}
8376
- }
8377
- }],
8378
- parameters: [{
8379
- id: "param1",
8380
- displayName: "param1",
8381
- type: "boolean",
8382
- validation: {
8383
- required: true,
8384
- allowedValues: {
8385
- type: "boolean"
8386
- },
8387
- defaultVisibility: "editable",
8388
- conditionalOverrides: [{
8389
- type: "visibility",
8390
- condition: {
8391
- type: "group",
8392
- name: "myGroup"
8393
- }
8394
- }]
8395
- }
8396
- }, {
8397
- id: "objectToModifyParameter",
8398
- displayName: "objectToModifyParameter",
8399
- type: "objectTypeReference",
8400
- validation: {
8401
- required: true,
8402
- allowedValues: {
8403
- type: "objectTypeReference",
8404
- interfaceTypes: []
8405
- },
8406
- defaultVisibility: "editable"
8407
- }
8408
- }]
8409
- });
8410
- expect(dumpOntologyFullMetadata()).toMatchInlineSnapshot(`
7923
+ `);});it("Conditional overrides on actions are properly defined",()=>{defineAction({apiName:"foo",displayName:"exampleAction",status:"active",rules:[{type:"modifyObjectRule",modifyObjectRule:{objectToModify:"objectToModifyParameter",propertyValues:{"bar":{type:"parameterId",parameterId:"param1"}},structFieldValues:{}}}],parameters:[{id:"param1",displayName:"param1",type:"boolean",validation:{required:true,allowedValues:{type:"boolean"},defaultVisibility:"editable",conditionalOverrides:[{type:"visibility",condition:{type:"group",name:"myGroup"}}]}},{id:"objectToModifyParameter",displayName:"objectToModifyParameter",type:"objectTypeReference",validation:{required:true,allowedValues:{type:"objectTypeReference",interfaceTypes:[]},defaultVisibility:"editable"}}]});expect(dumpOntologyFullMetadata()).toMatchInlineSnapshot(`
8411
7924
  {
8412
7925
  "importedOntology": {
8413
7926
  "actionTypes": {},
@@ -8657,69 +8170,11 @@ describe("Action Types", () => {
8657
8170
  "valueTypes": [],
8658
8171
  },
8659
8172
  }
8660
- `);
8661
- });
8662
- it("OAC defined object references as parameters are properly defined", () => {
8663
- // This test defines an action that creates an OAC-defined employee object type and also adds an additional parameter
8664
- // for an objectReference to a manager object type that is also defined in OAC. The action shows how you can use this
8665
- // objectReference parameter elsewhere in the action - in this case we are prefilling the managedBy property to be the
8666
- // id of the selected manager object type.
8667
- const employeeObject = defineObject({
8668
- apiName: "employee",
8669
- displayName: "Employee",
8670
- pluralDisplayName: "Employees",
8671
- titlePropertyApiName: "id",
8672
- primaryKeyPropertyApiName: "id",
8673
- properties: {
8674
- "id": {
8675
- type: "string",
8676
- displayName: "ID",
8677
- description: "dummy"
8678
- },
8679
- "managedBy": {
8680
- type: "string"
8681
- }
8682
- }
8683
- });
8684
- const managerObject = defineObject({
8685
- apiName: "manager",
8686
- displayName: "Manager",
8687
- pluralDisplayName: "Managers",
8688
- titlePropertyApiName: "id",
8689
- primaryKeyPropertyApiName: "id",
8690
- properties: {
8691
- "id": {
8692
- type: "string",
8693
- displayName: "ID",
8694
- description: "dummy"
8695
- }
8696
- },
8697
- editsEnabled: true
8698
- });
8699
- defineCreateObjectAction({
8700
- objectType: employeeObject,
8701
- parameterOrdering: ["myManager", "id", "managedBy"],
8702
- parameterConfiguration: {
8703
- "myManager": {
8704
- customParameterType: {
8705
- type: "objectReference",
8706
- objectReference: {
8707
- objectTypeId: managerObject.apiName
8708
- }
8709
- }
8710
- },
8711
- "managedBy": {
8712
- defaultValue: {
8713
- type: "objectParameterPropertyValue",
8714
- objectParameterPropertyValue: {
8715
- parameterId: "myManager",
8716
- propertyTypeId: "id"
8717
- }
8718
- }
8719
- }
8720
- }
8721
- });
8722
- expect(dumpOntologyFullMetadata()).toMatchInlineSnapshot(`
8173
+ `);});it("OAC defined object references as parameters are properly defined",()=>{// This test defines an action that creates an OAC-defined employee object type and also adds an additional parameter
8174
+ // for an objectReference to a manager object type that is also defined in OAC. The action shows how you can use this
8175
+ // objectReference parameter elsewhere in the action - in this case we are prefilling the managedBy property to be the
8176
+ // id of the selected manager object type.
8177
+ const employeeObject=defineObject({apiName:"employee",displayName:"Employee",pluralDisplayName:"Employees",titlePropertyApiName:"id",primaryKeyPropertyApiName:"id",properties:{"id":{type:"string",displayName:"ID",description:"dummy"},"managedBy":{type:"string"}}});const managerObject=defineObject({apiName:"manager",displayName:"Manager",pluralDisplayName:"Managers",titlePropertyApiName:"id",primaryKeyPropertyApiName:"id",properties:{"id":{type:"string",displayName:"ID",description:"dummy"}},editsEnabled:true});defineCreateObjectAction({objectType:employeeObject,parameterOrdering:["myManager","id","managedBy"],parameterConfiguration:{"myManager":{customParameterType:{type:"objectReference",objectReference:{objectTypeId:managerObject.apiName}}},"managedBy":{defaultValue:{type:"objectParameterPropertyValue",objectParameterPropertyValue:{parameterId:"myManager",propertyTypeId:"id"}}}}});expect(dumpOntologyFullMetadata()).toMatchInlineSnapshot(`
8723
8178
  {
8724
8179
  "importedOntology": {
8725
8180
  "actionTypes": {},
@@ -9216,38 +8671,7 @@ describe("Action Types", () => {
9216
8671
  "valueTypes": [],
9217
8672
  },
9218
8673
  }
9219
- `);
9220
- });
9221
- it("Actions with group permissions are properly defined", () => {
9222
- const sampleObject = defineObject({
9223
- apiName: "sampleObject",
9224
- displayName: "Test Object",
9225
- description: "Sample object description",
9226
- primaryKeyPropertyApiName: "id",
9227
- pluralDisplayName: "tests",
9228
- titlePropertyApiName: "name",
9229
- properties: {
9230
- "name": {
9231
- type: "string",
9232
- description: "The name of the test object"
9233
- },
9234
- "id": {
9235
- type: "string",
9236
- displayName: "ID",
9237
- description: "The ID of the test object"
9238
- }
9239
- }
9240
- });
9241
- defineCreateObjectAction({
9242
- objectType: sampleObject,
9243
- actionLevelValidation: [{
9244
- condition: {
9245
- type: "group",
9246
- name: "testGroup"
9247
- }
9248
- }]
9249
- });
9250
- expect(dumpOntologyFullMetadata()).toMatchInlineSnapshot(`
8674
+ `);});it("Actions with group permissions are properly defined",()=>{const sampleObject=defineObject({apiName:"sampleObject",displayName:"Test Object",description:"Sample object description",primaryKeyPropertyApiName:"id",pluralDisplayName:"tests",titlePropertyApiName:"name",properties:{"name":{type:"string",description:"The name of the test object"},"id":{type:"string",displayName:"ID",description:"The ID of the test object"}}});defineCreateObjectAction({objectType:sampleObject,actionLevelValidation:[{condition:{type:"group",name:"testGroup"}}]});expect(dumpOntologyFullMetadata()).toMatchInlineSnapshot(`
9251
8675
  {
9252
8676
  "importedOntology": {
9253
8677
  "actionTypes": {},
@@ -9632,66 +9056,7 @@ describe("Action Types", () => {
9632
9056
  "valueTypes": [],
9633
9057
  },
9634
9058
  }
9635
- `);
9636
- });
9637
- it("Actions with custom permissions are properly defined", () => {
9638
- const sampleObject = defineObject({
9639
- apiName: "sampleObject",
9640
- displayName: "Test Object",
9641
- description: "Sample object description",
9642
- primaryKeyPropertyApiName: "id",
9643
- pluralDisplayName: "tests",
9644
- titlePropertyApiName: "name",
9645
- properties: {
9646
- "name": {
9647
- type: "string",
9648
- description: "The name of the test object"
9649
- },
9650
- "id": {
9651
- type: "string",
9652
- displayName: "ID",
9653
- description: "The ID of the test object"
9654
- }
9655
- }
9656
- });
9657
- defineCreateObjectAction({
9658
- objectType: sampleObject,
9659
- actionLevelValidation: [{
9660
- displayMetadata: {
9661
- failureMessage: "Insufficient permissions. Missing organization membership required to submit action",
9662
- typeClasses: []
9663
- },
9664
- condition: {
9665
- type: "comparison",
9666
- comparison: {
9667
- operator: "INTERSECTS",
9668
- left: {
9669
- type: "userProperty",
9670
- userProperty: {
9671
- userId: {
9672
- type: "currentUser",
9673
- currentUser: {}
9674
- },
9675
- propertyValue: {
9676
- type: "organizationMarkingIds",
9677
- organizationMarkingIds: {}
9678
- }
9679
- }
9680
- },
9681
- right: {
9682
- type: "staticValue",
9683
- staticValue: {
9684
- type: "stringList",
9685
- stringList: {
9686
- strings: ["87ef507e-f954-457e-ad68-e0df71ef7567"]
9687
- }
9688
- }
9689
- }
9690
- }
9691
- }
9692
- }]
9693
- });
9694
- expect(dumpOntologyFullMetadata()).toMatchInlineSnapshot(`
9059
+ `);});it("Actions with custom permissions are properly defined",()=>{const sampleObject=defineObject({apiName:"sampleObject",displayName:"Test Object",description:"Sample object description",primaryKeyPropertyApiName:"id",pluralDisplayName:"tests",titlePropertyApiName:"name",properties:{"name":{type:"string",description:"The name of the test object"},"id":{type:"string",displayName:"ID",description:"The ID of the test object"}}});defineCreateObjectAction({objectType:sampleObject,actionLevelValidation:[{displayMetadata:{failureMessage:"Insufficient permissions. Missing organization membership required to submit action",typeClasses:[]},condition:{type:"comparison",comparison:{operator:"INTERSECTS",left:{type:"userProperty",userProperty:{userId:{type:"currentUser",currentUser:{}},propertyValue:{type:"organizationMarkingIds",organizationMarkingIds:{}}}},right:{type:"staticValue",staticValue:{type:"stringList",stringList:{strings:["87ef507e-f954-457e-ad68-e0df71ef7567"]}}}}}}]});expect(dumpOntologyFullMetadata()).toMatchInlineSnapshot(`
9695
9060
  {
9696
9061
  "importedOntology": {
9697
9062
  "actionTypes": {},
@@ -10076,43 +9441,7 @@ describe("Action Types", () => {
10076
9441
  "valueTypes": [],
10077
9442
  },
10078
9443
  }
10079
- `);
10080
- });
10081
- it("Array property validation is correctly structured for actions", () => {
10082
- const objectWithArrays = defineObject({
10083
- apiName: "objectWithArrays",
10084
- displayName: "Object With Arrays",
10085
- primaryKeyPropertyApiName: "id",
10086
- titlePropertyApiName: "id",
10087
- pluralDisplayName: "Objects With Arrays",
10088
- properties: {
10089
- "id": {
10090
- type: "string",
10091
- displayName: "ID"
10092
- },
10093
- "tags": {
10094
- type: "string",
10095
- array: true,
10096
- displayName: "Tags"
10097
- },
10098
- "numbers": {
10099
- type: "integer",
10100
- array: true,
10101
- displayName: "Numbers"
10102
- },
10103
- "singleValue": {
10104
- type: "string",
10105
- displayName: "Single Value"
10106
- }
10107
- }
10108
- });
10109
- defineCreateObjectAction({
10110
- objectType: objectWithArrays
10111
- });
10112
- defineModifyObjectAction({
10113
- objectType: objectWithArrays
10114
- });
10115
- expect(dumpOntologyFullMetadata()).toMatchInlineSnapshot(`
9444
+ `);});it("Array property validation is correctly structured for actions",()=>{const objectWithArrays=defineObject({apiName:"objectWithArrays",displayName:"Object With Arrays",primaryKeyPropertyApiName:"id",titlePropertyApiName:"id",pluralDisplayName:"Objects With Arrays",properties:{"id":{type:"string",displayName:"ID"},"tags":{type:"string",array:true,displayName:"Tags"},"numbers":{type:"integer",array:true,displayName:"Numbers"},"singleValue":{type:"string",displayName:"Single Value"}}});defineCreateObjectAction({objectType:objectWithArrays});defineModifyObjectAction({objectType:objectWithArrays});expect(dumpOntologyFullMetadata()).toMatchInlineSnapshot(`
10116
9445
  {
10117
9446
  "importedOntology": {
10118
9447
  "actionTypes": {},
@@ -10941,42 +10270,7 @@ describe("Action Types", () => {
10941
10270
  "valueTypes": [],
10942
10271
  },
10943
10272
  }
10944
- `);
10945
- });
10946
- it("Action sections are properly defined", () => {
10947
- const sampleObject = defineObject({
10948
- apiName: "sampleObject",
10949
- displayName: "Test Object",
10950
- description: "Sample object description",
10951
- primaryKeyPropertyApiName: "id",
10952
- pluralDisplayName: "tests",
10953
- titlePropertyApiName: "name",
10954
- properties: {
10955
- "name": {
10956
- type: "string"
10957
- },
10958
- "id": {
10959
- type: "string"
10960
- }
10961
- }
10962
- });
10963
- defineCreateObjectAction({
10964
- objectType: sampleObject,
10965
- sections: [{
10966
- id: "section1",
10967
- displayName: "Section 1",
10968
- parameters: ["id"],
10969
- description: "Description for Section 1",
10970
- conditionalOverrides: [{
10971
- type: "visibility",
10972
- condition: {
10973
- type: "group",
10974
- name: "testGroup"
10975
- }
10976
- }]
10977
- }]
10978
- });
10979
- expect(dumpOntologyFullMetadata()).toMatchInlineSnapshot(`
10273
+ `);});it("Action sections are properly defined",()=>{const sampleObject=defineObject({apiName:"sampleObject",displayName:"Test Object",description:"Sample object description",primaryKeyPropertyApiName:"id",pluralDisplayName:"tests",titlePropertyApiName:"name",properties:{"name":{type:"string"},"id":{type:"string"}}});defineCreateObjectAction({objectType:sampleObject,sections:[{id:"section1",displayName:"Section 1",parameters:["id"],description:"Description for Section 1",conditionalOverrides:[{type:"visibility",condition:{type:"group",name:"testGroup"}}]}]});expect(dumpOntologyFullMetadata()).toMatchInlineSnapshot(`
10980
10274
  {
10981
10275
  "importedOntology": {
10982
10276
  "actionTypes": {},
@@ -11407,136 +10701,12 @@ describe("Action Types", () => {
11407
10701
  "valueTypes": [],
11408
10702
  },
11409
10703
  }
11410
- `);
11411
- });
11412
- it("Action section parameters must exist", () => {
11413
- const sampleObject = defineObject({
11414
- apiName: "sampleObject",
11415
- displayName: "Test Object",
11416
- description: "Sample object description",
11417
- primaryKeyPropertyApiName: "id",
11418
- pluralDisplayName: "tests",
11419
- titlePropertyApiName: "name",
11420
- properties: {
11421
- "name": {
11422
- type: "string"
11423
- },
11424
- "id": {
11425
- type: "string"
11426
- }
11427
- }
11428
- });
11429
- expect(() => {
11430
- defineCreateObjectAction({
11431
- objectType: sampleObject,
11432
- sections: [{
11433
- id: "section1",
11434
- displayName: "Section 1",
11435
- parameters: ["foo"]
11436
- }]
11437
- });
11438
- }).toThrowErrorMatchingInlineSnapshot(`[Error: Invariant failed: Parameters ["foo"] were referenced but not defined]`);
11439
- });
11440
- it("Custom parameter ordering is properly defined", () => {
11441
- const sampleObject = defineObject({
11442
- apiName: "sampleObject",
11443
- displayName: "Test Object",
11444
- description: "Sample object description",
11445
- primaryKeyPropertyApiName: "id",
11446
- pluralDisplayName: "tests",
11447
- titlePropertyApiName: "name",
11448
- properties: {
11449
- "name": {
11450
- type: "string"
11451
- },
11452
- "id": {
11453
- type: "string"
11454
- },
11455
- "foo": {
11456
- type: "string"
11457
- }
11458
- }
11459
- });
11460
- expect(() => {
11461
- defineCreateObjectAction({
11462
- objectType: sampleObject,
11463
- parameterOrdering: ["foo", "id"],
11464
- excludedProperties: ["id"]
11465
- });
11466
- }).toThrowErrorMatchingInlineSnapshot(`[Error: Invariant failed: Action parameter ordering for create-object-sample-object does not match expected parameters. Extraneous parameters in ordering: {id}, Missing parameters in ordering: {name}]`);
11467
- expect(() => {
11468
- defineModifyObjectAction({
11469
- objectType: sampleObject,
11470
- // primary keys should not be in modify action orderings
11471
- parameterOrdering: ["foo", "id"]
11472
- });
11473
- }).toThrowErrorMatchingInlineSnapshot(`[Error: Invariant failed: Action parameter ordering for modify-object-sample-object does not match expected parameters. Extraneous parameters in ordering: {id}, Missing parameters in ordering: {name}]`);
11474
- expect(() => {
11475
- defineCreateOrModifyObjectAction({
11476
- objectType: sampleObject,
11477
- // primary keys should not be in create-or-modify action orderings
11478
- parameterOrdering: ["foo", "id"]
11479
- });
11480
- }).toThrowErrorMatchingInlineSnapshot(`[Error: Invariant failed: Action parameter ordering for create-or-modify-sample-object does not match expected parameters. Extraneous parameters in ordering: {id}, Missing parameters in ordering: {name}]`);
11481
- expect(() => {
11482
- defineCreateObjectAction({
11483
- objectType: sampleObject,
11484
- nonParameterMappings: {
11485
- "foo": {
11486
- type: "currentUser"
11487
- }
11488
- },
11489
- // non-parameter mapped properties should not be in action orderings
11490
- parameterOrdering: ["foo", "id"]
11491
- });
11492
- }).toThrowErrorMatchingInlineSnapshot(`[Error: Invariant failed: Action parameter ordering for create-object-sample-object does not match expected parameters. Extraneous parameters in ordering: {foo}, Missing parameters in ordering: {name}]`);
11493
- expect(() => {
11494
- defineModifyObjectAction({
11495
- objectType: sampleObject,
11496
- nonParameterMappings: {
11497
- "foo": {
11498
- type: "currentUser"
11499
- }
11500
- },
11501
- // non-parameter mapped properties should not be in action orderings
11502
- parameterOrdering: ["foo", "id"]
11503
- });
11504
- }).toThrowErrorMatchingInlineSnapshot(`[Error: Invariant failed: Action parameter ordering for modify-object-sample-object does not match expected parameters. Extraneous parameters in ordering: {foo,id}, Missing parameters in ordering: {name}]`);
11505
- expect(() => {
11506
- defineCreateOrModifyObjectAction({
11507
- objectType: sampleObject,
11508
- nonParameterMappings: {
11509
- "foo": {
11510
- type: "currentUser"
11511
- }
11512
- },
11513
- // non-parameter mapped properties should not be in action orderings
11514
- parameterOrdering: ["foo", "id"]
11515
- });
11516
- }).toThrowErrorMatchingInlineSnapshot(`[Error: Invariant failed: Action parameter ordering for create-or-modify-sample-object does not match expected parameters. Extraneous parameters in ordering: {foo,id}, Missing parameters in ordering: {name}]`);
11517
- defineCreateObjectAction({
11518
- objectType: sampleObject,
11519
- parameterOrdering: ["foo", "name", "id"],
11520
- parameterConfiguration: {
11521
- "name": {
11522
- conditionalOverrides: [{
11523
- type: "visibility",
11524
- condition: {
11525
- type: "parameter",
11526
- parameterId: "foo",
11527
- matches: {
11528
- type: "staticValue",
11529
- staticValue: {
11530
- type: "string",
11531
- string: "foo"
11532
- }
11533
- }
11534
- }
11535
- }]
11536
- }
11537
- }
11538
- });
11539
- expect(dumpOntologyFullMetadata()).toMatchInlineSnapshot(`
10704
+ `);});it("Action section parameters must exist",()=>{const sampleObject=defineObject({apiName:"sampleObject",displayName:"Test Object",description:"Sample object description",primaryKeyPropertyApiName:"id",pluralDisplayName:"tests",titlePropertyApiName:"name",properties:{"name":{type:"string"},"id":{type:"string"}}});expect(()=>{defineCreateObjectAction({objectType:sampleObject,sections:[{id:"section1",displayName:"Section 1",parameters:["foo"]}]});}).toThrowErrorMatchingInlineSnapshot(`[Error: Invariant failed: Parameters ["foo"] were referenced but not defined]`);});it("Custom parameter ordering is properly defined",()=>{const sampleObject=defineObject({apiName:"sampleObject",displayName:"Test Object",description:"Sample object description",primaryKeyPropertyApiName:"id",pluralDisplayName:"tests",titlePropertyApiName:"name",properties:{"name":{type:"string"},"id":{type:"string"},"foo":{type:"string"}}});expect(()=>{defineCreateObjectAction({objectType:sampleObject,parameterOrdering:["foo","id"],excludedProperties:["id"]});}).toThrowErrorMatchingInlineSnapshot(`[Error: Invariant failed: Action parameter ordering for create-object-sample-object does not match expected parameters. Extraneous parameters in ordering: {id}, Missing parameters in ordering: {name}]`);expect(()=>{defineModifyObjectAction({objectType:sampleObject,// primary keys should not be in modify action orderings
10705
+ parameterOrdering:["foo","id"]});}).toThrowErrorMatchingInlineSnapshot(`[Error: Invariant failed: Action parameter ordering for modify-object-sample-object does not match expected parameters. Extraneous parameters in ordering: {id}, Missing parameters in ordering: {name}]`);expect(()=>{defineCreateOrModifyObjectAction({objectType:sampleObject,// primary keys should not be in create-or-modify action orderings
10706
+ parameterOrdering:["foo","id"]});}).toThrowErrorMatchingInlineSnapshot(`[Error: Invariant failed: Action parameter ordering for create-or-modify-sample-object does not match expected parameters. Extraneous parameters in ordering: {id}, Missing parameters in ordering: {name}]`);expect(()=>{defineCreateObjectAction({objectType:sampleObject,nonParameterMappings:{"foo":{type:"currentUser"}},// non-parameter mapped properties should not be in action orderings
10707
+ parameterOrdering:["foo","id"]});}).toThrowErrorMatchingInlineSnapshot(`[Error: Invariant failed: Action parameter ordering for create-object-sample-object does not match expected parameters. Extraneous parameters in ordering: {foo}, Missing parameters in ordering: {name}]`);expect(()=>{defineModifyObjectAction({objectType:sampleObject,nonParameterMappings:{"foo":{type:"currentUser"}},// non-parameter mapped properties should not be in action orderings
10708
+ parameterOrdering:["foo","id"]});}).toThrowErrorMatchingInlineSnapshot(`[Error: Invariant failed: Action parameter ordering for modify-object-sample-object does not match expected parameters. Extraneous parameters in ordering: {foo,id}, Missing parameters in ordering: {name}]`);expect(()=>{defineCreateOrModifyObjectAction({objectType:sampleObject,nonParameterMappings:{"foo":{type:"currentUser"}},// non-parameter mapped properties should not be in action orderings
10709
+ parameterOrdering:["foo","id"]});}).toThrowErrorMatchingInlineSnapshot(`[Error: Invariant failed: Action parameter ordering for create-or-modify-sample-object does not match expected parameters. Extraneous parameters in ordering: {foo,id}, Missing parameters in ordering: {name}]`);defineCreateObjectAction({objectType:sampleObject,parameterOrdering:["foo","name","id"],parameterConfiguration:{"name":{conditionalOverrides:[{type:"visibility",condition:{type:"parameter",parameterId:"foo",matches:{type:"staticValue",staticValue:{type:"string",string:"foo"}}}}]}}});expect(dumpOntologyFullMetadata()).toMatchInlineSnapshot(`
11540
10710
  {
11541
10711
  "importedOntology": {
11542
10712
  "actionTypes": {},
@@ -12007,8 +11177,5 @@ describe("Action Types", () => {
12007
11177
  "valueTypes": [],
12008
11178
  },
12009
11179
  }
12010
- `);
12011
- });
12012
- });
12013
- });
11180
+ `);});});});
12014
11181
  //# sourceMappingURL=actions.test.js.map