@osdk/maker 0.13.0-beta.12 → 0.13.0-beta.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +10 -0
- package/README.md +6 -2
- package/build/browser/api/defineAction.js +30 -30
- package/build/browser/api/defineAction.js.map +1 -1
- package/build/browser/api/overall.test.js +563 -3
- package/build/browser/api/overall.test.js.map +1 -1
- package/build/browser/cli/main.js +1 -1
- package/build/cjs/index.cjs +31 -31
- package/build/cjs/index.cjs.map +1 -1
- package/build/cjs/index.d.cts +8 -2
- package/build/esm/api/defineAction.js +30 -30
- package/build/esm/api/defineAction.js.map +1 -1
- package/build/esm/api/overall.test.js +563 -3
- package/build/esm/api/overall.test.js.map +1 -1
- package/build/esm/cli/main.js +1 -1
- package/build/types/api/defineAction.d.ts +8 -2
- package/build/types/api/defineAction.d.ts.map +1 -1
- package/package.json +4 -4
|
@@ -3580,7 +3580,7 @@ defineOntology("com.palantir.",()=>{},"/tmp/");});describe("Interfaces",()=>{it(
|
|
|
3580
3580
|
"valueTypes": [],
|
|
3581
3581
|
},
|
|
3582
3582
|
}
|
|
3583
|
-
`);});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(exampleInterface,exampleObjectType);defineModifyInterfaceObjectAction(exampleInterface,exampleObjectType);expect(dumpOntologyFullMetadata()).toMatchInlineSnapshot(`
|
|
3583
|
+
`);});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(`
|
|
3584
3584
|
{
|
|
3585
3585
|
"importedOntology": {
|
|
3586
3586
|
"actionTypes": {},
|
|
@@ -9025,7 +9025,7 @@ const employeeObject=defineObject({apiName:"employee",displayName:"Employee",plu
|
|
|
9025
9025
|
"valueTypes": [],
|
|
9026
9026
|
},
|
|
9027
9027
|
}
|
|
9028
|
-
`);});it("Simple interface actions (without object types) are properly defined",()=>{const exampleInterface=defineInterface({apiName:"exampleInterface",properties:{property1:"string"}});defineCreateInterfaceObjectAction(exampleInterface);defineModifyInterfaceObjectAction(exampleInterface);expect(dumpOntologyFullMetadata()).toMatchInlineSnapshot(`
|
|
9028
|
+
`);});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(`
|
|
9029
9029
|
{
|
|
9030
9030
|
"importedOntology": {
|
|
9031
9031
|
"actionTypes": {},
|
|
@@ -9512,6 +9512,566 @@ const employeeObject=defineObject({apiName:"employee",displayName:"Employee",plu
|
|
|
9512
9512
|
"valueTypes": [],
|
|
9513
9513
|
},
|
|
9514
9514
|
}
|
|
9515
|
+
`);});it("Interface actions with customizations are properly defined",()=>{const exampleInterface=defineInterface({apiName:"exampleInterface",properties:{property1:"string",property2:"string"}});defineCreateInterfaceObjectAction({interfaceType:exampleInterface,excludedProperties:["property2"]});defineModifyInterfaceObjectAction({interfaceType:exampleInterface,excludedProperties:["property2"]});expect(dumpOntologyFullMetadata()).toMatchInlineSnapshot(`
|
|
9516
|
+
{
|
|
9517
|
+
"importedOntology": {
|
|
9518
|
+
"actionTypes": {},
|
|
9519
|
+
"blockPermissionInformation": {
|
|
9520
|
+
"actionTypes": {},
|
|
9521
|
+
"linkTypes": {},
|
|
9522
|
+
"objectTypes": {},
|
|
9523
|
+
},
|
|
9524
|
+
"interfaceTypes": {},
|
|
9525
|
+
"linkTypes": {},
|
|
9526
|
+
"objectTypes": {},
|
|
9527
|
+
"sharedPropertyTypes": {},
|
|
9528
|
+
},
|
|
9529
|
+
"importedValueTypes": {
|
|
9530
|
+
"valueTypes": [],
|
|
9531
|
+
},
|
|
9532
|
+
"ontology": {
|
|
9533
|
+
"actionTypes": {
|
|
9534
|
+
"com.palantir.create-example-interface": {
|
|
9535
|
+
"actionType": {
|
|
9536
|
+
"actionTypeLogic": {
|
|
9537
|
+
"logic": {
|
|
9538
|
+
"rules": [
|
|
9539
|
+
{
|
|
9540
|
+
"addInterfaceRule": {
|
|
9541
|
+
"interfaceApiName": "com.palantir.exampleInterface",
|
|
9542
|
+
"objectTypeParameter": "objectTypeParameter",
|
|
9543
|
+
"sharedPropertyValues": {
|
|
9544
|
+
"com.palantir.property1": {
|
|
9545
|
+
"parameterId": "com.palantir.property1",
|
|
9546
|
+
"type": "parameterId",
|
|
9547
|
+
},
|
|
9548
|
+
},
|
|
9549
|
+
},
|
|
9550
|
+
"type": "addInterfaceRule",
|
|
9551
|
+
},
|
|
9552
|
+
],
|
|
9553
|
+
},
|
|
9554
|
+
"validation": {
|
|
9555
|
+
"actionTypeLevelValidation": {
|
|
9556
|
+
"rules": {
|
|
9557
|
+
"0": {
|
|
9558
|
+
"condition": {
|
|
9559
|
+
"true": {},
|
|
9560
|
+
"type": "true",
|
|
9561
|
+
},
|
|
9562
|
+
"displayMetadata": {
|
|
9563
|
+
"failureMessage": "",
|
|
9564
|
+
"typeClasses": [],
|
|
9565
|
+
},
|
|
9566
|
+
},
|
|
9567
|
+
},
|
|
9568
|
+
},
|
|
9569
|
+
"parameterValidations": {
|
|
9570
|
+
"com.palantir.property1": {
|
|
9571
|
+
"conditionalOverrides": [],
|
|
9572
|
+
"defaultValidation": {
|
|
9573
|
+
"display": {
|
|
9574
|
+
"renderHint": {
|
|
9575
|
+
"textInput": {},
|
|
9576
|
+
"type": "textInput",
|
|
9577
|
+
},
|
|
9578
|
+
"visibility": {
|
|
9579
|
+
"editable": {},
|
|
9580
|
+
"type": "editable",
|
|
9581
|
+
},
|
|
9582
|
+
},
|
|
9583
|
+
"validation": {
|
|
9584
|
+
"allowedValues": {
|
|
9585
|
+
"text": {
|
|
9586
|
+
"text": {},
|
|
9587
|
+
"type": "text",
|
|
9588
|
+
},
|
|
9589
|
+
"type": "text",
|
|
9590
|
+
},
|
|
9591
|
+
"required": {
|
|
9592
|
+
"required": {},
|
|
9593
|
+
"type": "required",
|
|
9594
|
+
},
|
|
9595
|
+
},
|
|
9596
|
+
},
|
|
9597
|
+
},
|
|
9598
|
+
"objectTypeParameter": {
|
|
9599
|
+
"conditionalOverrides": [],
|
|
9600
|
+
"defaultValidation": {
|
|
9601
|
+
"display": {
|
|
9602
|
+
"renderHint": {
|
|
9603
|
+
"dropdown": {},
|
|
9604
|
+
"type": "dropdown",
|
|
9605
|
+
},
|
|
9606
|
+
"visibility": {
|
|
9607
|
+
"editable": {},
|
|
9608
|
+
"type": "editable",
|
|
9609
|
+
},
|
|
9610
|
+
},
|
|
9611
|
+
"validation": {
|
|
9612
|
+
"allowedValues": {
|
|
9613
|
+
"objectTypeReference": {
|
|
9614
|
+
"objectTypeReference": {
|
|
9615
|
+
"interfaceTypeRids": [
|
|
9616
|
+
"com.palantir.exampleInterface",
|
|
9617
|
+
],
|
|
9618
|
+
},
|
|
9619
|
+
"type": "objectTypeReference",
|
|
9620
|
+
},
|
|
9621
|
+
"type": "objectTypeReference",
|
|
9622
|
+
},
|
|
9623
|
+
"required": {
|
|
9624
|
+
"required": {},
|
|
9625
|
+
"type": "required",
|
|
9626
|
+
},
|
|
9627
|
+
},
|
|
9628
|
+
},
|
|
9629
|
+
},
|
|
9630
|
+
},
|
|
9631
|
+
"sectionValidations": {},
|
|
9632
|
+
},
|
|
9633
|
+
},
|
|
9634
|
+
"metadata": {
|
|
9635
|
+
"apiName": "com.palantir.create-example-interface",
|
|
9636
|
+
"displayMetadata": {
|
|
9637
|
+
"configuration": {
|
|
9638
|
+
"defaultLayout": "FORM",
|
|
9639
|
+
"displayAndFormat": {
|
|
9640
|
+
"table": {
|
|
9641
|
+
"columnWidthByParameterRid": {},
|
|
9642
|
+
"enableFileImport": true,
|
|
9643
|
+
"fitHorizontally": false,
|
|
9644
|
+
"frozenColumnCount": 0,
|
|
9645
|
+
"rowHeightInLines": 1,
|
|
9646
|
+
},
|
|
9647
|
+
},
|
|
9648
|
+
"enableLayoutUserSwitch": false,
|
|
9649
|
+
},
|
|
9650
|
+
"description": "",
|
|
9651
|
+
"displayName": "Create exampleInterface",
|
|
9652
|
+
"icon": {
|
|
9653
|
+
"blueprint": {
|
|
9654
|
+
"color": "#000000",
|
|
9655
|
+
"locator": "edit",
|
|
9656
|
+
},
|
|
9657
|
+
"type": "blueprint",
|
|
9658
|
+
},
|
|
9659
|
+
"successMessage": [],
|
|
9660
|
+
"typeClasses": [],
|
|
9661
|
+
},
|
|
9662
|
+
"entities": {
|
|
9663
|
+
"affectedInterfaceTypes": [
|
|
9664
|
+
"com.palantir.exampleInterface",
|
|
9665
|
+
],
|
|
9666
|
+
"affectedLinkTypes": [],
|
|
9667
|
+
"affectedObjectTypes": [],
|
|
9668
|
+
"typeGroups": [],
|
|
9669
|
+
},
|
|
9670
|
+
"formContentOrdering": [],
|
|
9671
|
+
"parameterOrdering": [
|
|
9672
|
+
"objectTypeParameter",
|
|
9673
|
+
"com.palantir.property1",
|
|
9674
|
+
],
|
|
9675
|
+
"parameters": {
|
|
9676
|
+
"com.palantir.property1": {
|
|
9677
|
+
"displayMetadata": {
|
|
9678
|
+
"description": "",
|
|
9679
|
+
"displayName": "property1",
|
|
9680
|
+
"typeClasses": [],
|
|
9681
|
+
},
|
|
9682
|
+
"id": "com.palantir.property1",
|
|
9683
|
+
"type": {
|
|
9684
|
+
"string": {},
|
|
9685
|
+
"type": "string",
|
|
9686
|
+
},
|
|
9687
|
+
},
|
|
9688
|
+
"objectTypeParameter": {
|
|
9689
|
+
"displayMetadata": {
|
|
9690
|
+
"description": "",
|
|
9691
|
+
"displayName": "Object type to create",
|
|
9692
|
+
"typeClasses": [],
|
|
9693
|
+
},
|
|
9694
|
+
"id": "objectTypeParameter",
|
|
9695
|
+
"type": {
|
|
9696
|
+
"objectTypeReference": {
|
|
9697
|
+
"interfaceTypeRids": [
|
|
9698
|
+
"com.palantir.exampleInterface",
|
|
9699
|
+
],
|
|
9700
|
+
},
|
|
9701
|
+
"type": "objectTypeReference",
|
|
9702
|
+
},
|
|
9703
|
+
},
|
|
9704
|
+
},
|
|
9705
|
+
"sections": {},
|
|
9706
|
+
"status": {
|
|
9707
|
+
"active": {},
|
|
9708
|
+
"type": "active",
|
|
9709
|
+
},
|
|
9710
|
+
},
|
|
9711
|
+
},
|
|
9712
|
+
},
|
|
9713
|
+
"com.palantir.modify-example-interface": {
|
|
9714
|
+
"actionType": {
|
|
9715
|
+
"actionTypeLogic": {
|
|
9716
|
+
"logic": {
|
|
9717
|
+
"rules": [
|
|
9718
|
+
{
|
|
9719
|
+
"modifyInterfaceRule": {
|
|
9720
|
+
"interfaceObjectToModifyParameter": "interfaceObjectToModifyParameter",
|
|
9721
|
+
"sharedPropertyValues": {
|
|
9722
|
+
"com.palantir.property1": {
|
|
9723
|
+
"parameterId": "com.palantir.property1",
|
|
9724
|
+
"type": "parameterId",
|
|
9725
|
+
},
|
|
9726
|
+
},
|
|
9727
|
+
},
|
|
9728
|
+
"type": "modifyInterfaceRule",
|
|
9729
|
+
},
|
|
9730
|
+
],
|
|
9731
|
+
},
|
|
9732
|
+
"validation": {
|
|
9733
|
+
"actionTypeLevelValidation": {
|
|
9734
|
+
"rules": {
|
|
9735
|
+
"0": {
|
|
9736
|
+
"condition": {
|
|
9737
|
+
"true": {},
|
|
9738
|
+
"type": "true",
|
|
9739
|
+
},
|
|
9740
|
+
"displayMetadata": {
|
|
9741
|
+
"failureMessage": "",
|
|
9742
|
+
"typeClasses": [],
|
|
9743
|
+
},
|
|
9744
|
+
},
|
|
9745
|
+
},
|
|
9746
|
+
},
|
|
9747
|
+
"parameterValidations": {
|
|
9748
|
+
"com.palantir.property1": {
|
|
9749
|
+
"conditionalOverrides": [],
|
|
9750
|
+
"defaultValidation": {
|
|
9751
|
+
"display": {
|
|
9752
|
+
"renderHint": {
|
|
9753
|
+
"textInput": {},
|
|
9754
|
+
"type": "textInput",
|
|
9755
|
+
},
|
|
9756
|
+
"visibility": {
|
|
9757
|
+
"editable": {},
|
|
9758
|
+
"type": "editable",
|
|
9759
|
+
},
|
|
9760
|
+
},
|
|
9761
|
+
"validation": {
|
|
9762
|
+
"allowedValues": {
|
|
9763
|
+
"text": {
|
|
9764
|
+
"text": {},
|
|
9765
|
+
"type": "text",
|
|
9766
|
+
},
|
|
9767
|
+
"type": "text",
|
|
9768
|
+
},
|
|
9769
|
+
"required": {
|
|
9770
|
+
"required": {},
|
|
9771
|
+
"type": "required",
|
|
9772
|
+
},
|
|
9773
|
+
},
|
|
9774
|
+
},
|
|
9775
|
+
},
|
|
9776
|
+
"interfaceObjectToModifyParameter": {
|
|
9777
|
+
"conditionalOverrides": [],
|
|
9778
|
+
"defaultValidation": {
|
|
9779
|
+
"display": {
|
|
9780
|
+
"renderHint": {
|
|
9781
|
+
"dropdown": {},
|
|
9782
|
+
"type": "dropdown",
|
|
9783
|
+
},
|
|
9784
|
+
"visibility": {
|
|
9785
|
+
"editable": {},
|
|
9786
|
+
"type": "editable",
|
|
9787
|
+
},
|
|
9788
|
+
},
|
|
9789
|
+
"validation": {
|
|
9790
|
+
"allowedValues": {
|
|
9791
|
+
"interfaceObjectQuery": {
|
|
9792
|
+
"interfaceObjectQuery": {},
|
|
9793
|
+
"type": "interfaceObjectQuery",
|
|
9794
|
+
},
|
|
9795
|
+
"type": "interfaceObjectQuery",
|
|
9796
|
+
},
|
|
9797
|
+
"required": {
|
|
9798
|
+
"required": {},
|
|
9799
|
+
"type": "required",
|
|
9800
|
+
},
|
|
9801
|
+
},
|
|
9802
|
+
},
|
|
9803
|
+
},
|
|
9804
|
+
},
|
|
9805
|
+
"sectionValidations": {},
|
|
9806
|
+
},
|
|
9807
|
+
},
|
|
9808
|
+
"metadata": {
|
|
9809
|
+
"apiName": "com.palantir.modify-example-interface",
|
|
9810
|
+
"displayMetadata": {
|
|
9811
|
+
"configuration": {
|
|
9812
|
+
"defaultLayout": "FORM",
|
|
9813
|
+
"displayAndFormat": {
|
|
9814
|
+
"table": {
|
|
9815
|
+
"columnWidthByParameterRid": {},
|
|
9816
|
+
"enableFileImport": true,
|
|
9817
|
+
"fitHorizontally": false,
|
|
9818
|
+
"frozenColumnCount": 0,
|
|
9819
|
+
"rowHeightInLines": 1,
|
|
9820
|
+
},
|
|
9821
|
+
},
|
|
9822
|
+
"enableLayoutUserSwitch": false,
|
|
9823
|
+
},
|
|
9824
|
+
"description": "",
|
|
9825
|
+
"displayName": "Modify exampleInterface",
|
|
9826
|
+
"icon": {
|
|
9827
|
+
"blueprint": {
|
|
9828
|
+
"color": "#000000",
|
|
9829
|
+
"locator": "edit",
|
|
9830
|
+
},
|
|
9831
|
+
"type": "blueprint",
|
|
9832
|
+
},
|
|
9833
|
+
"successMessage": [],
|
|
9834
|
+
"typeClasses": [],
|
|
9835
|
+
},
|
|
9836
|
+
"entities": {
|
|
9837
|
+
"affectedInterfaceTypes": [
|
|
9838
|
+
"com.palantir.exampleInterface",
|
|
9839
|
+
],
|
|
9840
|
+
"affectedLinkTypes": [],
|
|
9841
|
+
"affectedObjectTypes": [],
|
|
9842
|
+
"typeGroups": [],
|
|
9843
|
+
},
|
|
9844
|
+
"formContentOrdering": [],
|
|
9845
|
+
"parameterOrdering": [
|
|
9846
|
+
"interfaceObjectToModifyParameter",
|
|
9847
|
+
"com.palantir.property1",
|
|
9848
|
+
],
|
|
9849
|
+
"parameters": {
|
|
9850
|
+
"com.palantir.property1": {
|
|
9851
|
+
"displayMetadata": {
|
|
9852
|
+
"description": "",
|
|
9853
|
+
"displayName": "property1",
|
|
9854
|
+
"typeClasses": [],
|
|
9855
|
+
},
|
|
9856
|
+
"id": "com.palantir.property1",
|
|
9857
|
+
"type": {
|
|
9858
|
+
"string": {},
|
|
9859
|
+
"type": "string",
|
|
9860
|
+
},
|
|
9861
|
+
},
|
|
9862
|
+
"interfaceObjectToModifyParameter": {
|
|
9863
|
+
"displayMetadata": {
|
|
9864
|
+
"description": "",
|
|
9865
|
+
"displayName": "Object type to modify",
|
|
9866
|
+
"typeClasses": [],
|
|
9867
|
+
},
|
|
9868
|
+
"id": "interfaceObjectToModifyParameter",
|
|
9869
|
+
"type": {
|
|
9870
|
+
"interfaceReference": {
|
|
9871
|
+
"interfaceTypeRid": "com.palantir.exampleInterface",
|
|
9872
|
+
},
|
|
9873
|
+
"type": "interfaceReference",
|
|
9874
|
+
},
|
|
9875
|
+
},
|
|
9876
|
+
},
|
|
9877
|
+
"sections": {},
|
|
9878
|
+
"status": {
|
|
9879
|
+
"active": {},
|
|
9880
|
+
"type": "active",
|
|
9881
|
+
},
|
|
9882
|
+
},
|
|
9883
|
+
},
|
|
9884
|
+
},
|
|
9885
|
+
},
|
|
9886
|
+
"blockPermissionInformation": {
|
|
9887
|
+
"actionTypes": {},
|
|
9888
|
+
"linkTypes": {},
|
|
9889
|
+
"objectTypes": {},
|
|
9890
|
+
},
|
|
9891
|
+
"interfaceTypes": {
|
|
9892
|
+
"com.palantir.exampleInterface": {
|
|
9893
|
+
"interfaceType": {
|
|
9894
|
+
"apiName": "com.palantir.exampleInterface",
|
|
9895
|
+
"displayMetadata": {
|
|
9896
|
+
"description": "exampleInterface",
|
|
9897
|
+
"displayName": "exampleInterface",
|
|
9898
|
+
"icon": {
|
|
9899
|
+
"blueprint": {
|
|
9900
|
+
"color": "#4C90F0",
|
|
9901
|
+
"locator": "layout-hierarchy",
|
|
9902
|
+
},
|
|
9903
|
+
"type": "blueprint",
|
|
9904
|
+
},
|
|
9905
|
+
},
|
|
9906
|
+
"extendsInterfaces": [],
|
|
9907
|
+
"links": [],
|
|
9908
|
+
"properties": [],
|
|
9909
|
+
"propertiesV2": {
|
|
9910
|
+
"com.palantir.property1": {
|
|
9911
|
+
"required": true,
|
|
9912
|
+
"sharedPropertyType": {
|
|
9913
|
+
"aliases": [],
|
|
9914
|
+
"apiName": "com.palantir.property1",
|
|
9915
|
+
"baseFormatter": undefined,
|
|
9916
|
+
"dataConstraints": undefined,
|
|
9917
|
+
"displayMetadata": {
|
|
9918
|
+
"description": undefined,
|
|
9919
|
+
"displayName": "property1",
|
|
9920
|
+
"visibility": "NORMAL",
|
|
9921
|
+
},
|
|
9922
|
+
"gothamMapping": undefined,
|
|
9923
|
+
"indexedForSearch": true,
|
|
9924
|
+
"type": {
|
|
9925
|
+
"string": {
|
|
9926
|
+
"analyzerOverride": undefined,
|
|
9927
|
+
"enableAsciiFolding": undefined,
|
|
9928
|
+
"isLongText": false,
|
|
9929
|
+
"supportsEfficientLeadingWildcard": false,
|
|
9930
|
+
"supportsExactMatching": true,
|
|
9931
|
+
},
|
|
9932
|
+
"type": "string",
|
|
9933
|
+
},
|
|
9934
|
+
"typeClasses": [
|
|
9935
|
+
{
|
|
9936
|
+
"kind": "render_hint",
|
|
9937
|
+
"name": "SELECTABLE",
|
|
9938
|
+
},
|
|
9939
|
+
{
|
|
9940
|
+
"kind": "render_hint",
|
|
9941
|
+
"name": "SORTABLE",
|
|
9942
|
+
},
|
|
9943
|
+
],
|
|
9944
|
+
"valueType": undefined,
|
|
9945
|
+
},
|
|
9946
|
+
},
|
|
9947
|
+
"com.palantir.property2": {
|
|
9948
|
+
"required": true,
|
|
9949
|
+
"sharedPropertyType": {
|
|
9950
|
+
"aliases": [],
|
|
9951
|
+
"apiName": "com.palantir.property2",
|
|
9952
|
+
"baseFormatter": undefined,
|
|
9953
|
+
"dataConstraints": undefined,
|
|
9954
|
+
"displayMetadata": {
|
|
9955
|
+
"description": undefined,
|
|
9956
|
+
"displayName": "property2",
|
|
9957
|
+
"visibility": "NORMAL",
|
|
9958
|
+
},
|
|
9959
|
+
"gothamMapping": undefined,
|
|
9960
|
+
"indexedForSearch": true,
|
|
9961
|
+
"type": {
|
|
9962
|
+
"string": {
|
|
9963
|
+
"analyzerOverride": undefined,
|
|
9964
|
+
"enableAsciiFolding": undefined,
|
|
9965
|
+
"isLongText": false,
|
|
9966
|
+
"supportsEfficientLeadingWildcard": false,
|
|
9967
|
+
"supportsExactMatching": true,
|
|
9968
|
+
},
|
|
9969
|
+
"type": "string",
|
|
9970
|
+
},
|
|
9971
|
+
"typeClasses": [
|
|
9972
|
+
{
|
|
9973
|
+
"kind": "render_hint",
|
|
9974
|
+
"name": "SELECTABLE",
|
|
9975
|
+
},
|
|
9976
|
+
{
|
|
9977
|
+
"kind": "render_hint",
|
|
9978
|
+
"name": "SORTABLE",
|
|
9979
|
+
},
|
|
9980
|
+
],
|
|
9981
|
+
"valueType": undefined,
|
|
9982
|
+
},
|
|
9983
|
+
},
|
|
9984
|
+
},
|
|
9985
|
+
"propertiesV3": {},
|
|
9986
|
+
"searchable": true,
|
|
9987
|
+
"status": {
|
|
9988
|
+
"active": {},
|
|
9989
|
+
"type": "active",
|
|
9990
|
+
},
|
|
9991
|
+
},
|
|
9992
|
+
},
|
|
9993
|
+
},
|
|
9994
|
+
"linkTypes": {},
|
|
9995
|
+
"objectTypes": {},
|
|
9996
|
+
"sharedPropertyTypes": {
|
|
9997
|
+
"com.palantir.property1": {
|
|
9998
|
+
"sharedPropertyType": {
|
|
9999
|
+
"aliases": [],
|
|
10000
|
+
"apiName": "com.palantir.property1",
|
|
10001
|
+
"baseFormatter": undefined,
|
|
10002
|
+
"dataConstraints": undefined,
|
|
10003
|
+
"displayMetadata": {
|
|
10004
|
+
"description": undefined,
|
|
10005
|
+
"displayName": "property1",
|
|
10006
|
+
"visibility": "NORMAL",
|
|
10007
|
+
},
|
|
10008
|
+
"gothamMapping": undefined,
|
|
10009
|
+
"indexedForSearch": true,
|
|
10010
|
+
"type": {
|
|
10011
|
+
"string": {
|
|
10012
|
+
"analyzerOverride": undefined,
|
|
10013
|
+
"enableAsciiFolding": undefined,
|
|
10014
|
+
"isLongText": false,
|
|
10015
|
+
"supportsEfficientLeadingWildcard": false,
|
|
10016
|
+
"supportsExactMatching": true,
|
|
10017
|
+
},
|
|
10018
|
+
"type": "string",
|
|
10019
|
+
},
|
|
10020
|
+
"typeClasses": [
|
|
10021
|
+
{
|
|
10022
|
+
"kind": "render_hint",
|
|
10023
|
+
"name": "SELECTABLE",
|
|
10024
|
+
},
|
|
10025
|
+
{
|
|
10026
|
+
"kind": "render_hint",
|
|
10027
|
+
"name": "SORTABLE",
|
|
10028
|
+
},
|
|
10029
|
+
],
|
|
10030
|
+
"valueType": undefined,
|
|
10031
|
+
},
|
|
10032
|
+
},
|
|
10033
|
+
"com.palantir.property2": {
|
|
10034
|
+
"sharedPropertyType": {
|
|
10035
|
+
"aliases": [],
|
|
10036
|
+
"apiName": "com.palantir.property2",
|
|
10037
|
+
"baseFormatter": undefined,
|
|
10038
|
+
"dataConstraints": undefined,
|
|
10039
|
+
"displayMetadata": {
|
|
10040
|
+
"description": undefined,
|
|
10041
|
+
"displayName": "property2",
|
|
10042
|
+
"visibility": "NORMAL",
|
|
10043
|
+
},
|
|
10044
|
+
"gothamMapping": undefined,
|
|
10045
|
+
"indexedForSearch": true,
|
|
10046
|
+
"type": {
|
|
10047
|
+
"string": {
|
|
10048
|
+
"analyzerOverride": undefined,
|
|
10049
|
+
"enableAsciiFolding": undefined,
|
|
10050
|
+
"isLongText": false,
|
|
10051
|
+
"supportsEfficientLeadingWildcard": false,
|
|
10052
|
+
"supportsExactMatching": true,
|
|
10053
|
+
},
|
|
10054
|
+
"type": "string",
|
|
10055
|
+
},
|
|
10056
|
+
"typeClasses": [
|
|
10057
|
+
{
|
|
10058
|
+
"kind": "render_hint",
|
|
10059
|
+
"name": "SELECTABLE",
|
|
10060
|
+
},
|
|
10061
|
+
{
|
|
10062
|
+
"kind": "render_hint",
|
|
10063
|
+
"name": "SORTABLE",
|
|
10064
|
+
},
|
|
10065
|
+
],
|
|
10066
|
+
"valueType": undefined,
|
|
10067
|
+
},
|
|
10068
|
+
},
|
|
10069
|
+
},
|
|
10070
|
+
},
|
|
10071
|
+
"valueTypes": {
|
|
10072
|
+
"valueTypes": [],
|
|
10073
|
+
},
|
|
10074
|
+
}
|
|
9515
10075
|
`);});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(`
|
|
9516
10076
|
{
|
|
9517
10077
|
"importedOntology": {
|
|
@@ -12013,7 +12573,7 @@ parameterOrdering:["foo","id"]});}).toThrowErrorMatchingInlineSnapshot(`[Error:
|
|
|
12013
12573
|
"valueTypes": [],
|
|
12014
12574
|
},
|
|
12015
12575
|
}
|
|
12016
|
-
`);});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)).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]`);});});describe("Imports",()=>{it("Legacy importing works",()=>{const id=importSharedPropertyType({apiName:"id",packageName:"com.palantir.core.ontology.types",typeHint:"string"});defineInterface({apiName:"myInterface",properties:{id}});expect(dumpOntologyFullMetadata()).toMatchInlineSnapshot(`
|
|
12576
|
+
`);});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]`);});});describe("Imports",()=>{it("Legacy importing works",()=>{const id=importSharedPropertyType({apiName:"id",packageName:"com.palantir.core.ontology.types",typeHint:"string"});defineInterface({apiName:"myInterface",properties:{id}});expect(dumpOntologyFullMetadata()).toMatchInlineSnapshot(`
|
|
12017
12577
|
{
|
|
12018
12578
|
"importedOntology": {
|
|
12019
12579
|
"actionTypes": {},
|