@osdk/maker 0.13.0-beta.5 → 0.13.0-beta.6

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.
@@ -5737,7 +5737,7 @@ defineOntology("com.palantir.",()=>{},"/tmp/");});describe("Interfaces",()=>{it(
5737
5737
  "valueTypes": [],
5738
5738
  },
5739
5739
  }
5740
- `);});it("Customizations on CRUD 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"}},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"}},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"}},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(`
5740
+ `);});it("Customizations on CRUD 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(`
5741
5741
  {
5742
5742
  "importedOntology": {
5743
5743
  "actionTypes": {},
@@ -5823,6 +5823,42 @@ defineOntology("com.palantir.",()=>{},"/tmp/");});describe("Interfaces",()=>{it(
5823
5823
  "typeClasses": [],
5824
5824
  },
5825
5825
  },
5826
+ "1": {
5827
+ "condition": {
5828
+ "comparison": {
5829
+ "left": {
5830
+ "type": "userProperty",
5831
+ "userProperty": {
5832
+ "propertyValue": {
5833
+ "groupIds": {},
5834
+ "type": "groupIds",
5835
+ },
5836
+ "userId": {
5837
+ "currentUser": {},
5838
+ "type": "currentUser",
5839
+ },
5840
+ },
5841
+ },
5842
+ "operator": "INTERSECTS",
5843
+ "right": {
5844
+ "staticValue": {
5845
+ "stringList": {
5846
+ "strings": [
5847
+ "actionLevelGroup2",
5848
+ ],
5849
+ },
5850
+ "type": "stringList",
5851
+ },
5852
+ "type": "staticValue",
5853
+ },
5854
+ },
5855
+ "type": "comparison",
5856
+ },
5857
+ "displayMetadata": {
5858
+ "failureMessage": "Different custom failure message",
5859
+ "typeClasses": [],
5860
+ },
5861
+ },
5826
5862
  },
5827
5863
  },
5828
5864
  "parameterValidations": {
@@ -6150,6 +6186,42 @@ defineOntology("com.palantir.",()=>{},"/tmp/");});describe("Interfaces",()=>{it(
6150
6186
  "typeClasses": [],
6151
6187
  },
6152
6188
  },
6189
+ "1": {
6190
+ "condition": {
6191
+ "comparison": {
6192
+ "left": {
6193
+ "type": "userProperty",
6194
+ "userProperty": {
6195
+ "propertyValue": {
6196
+ "groupIds": {},
6197
+ "type": "groupIds",
6198
+ },
6199
+ "userId": {
6200
+ "currentUser": {},
6201
+ "type": "currentUser",
6202
+ },
6203
+ },
6204
+ },
6205
+ "operator": "INTERSECTS",
6206
+ "right": {
6207
+ "staticValue": {
6208
+ "stringList": {
6209
+ "strings": [
6210
+ "actionLevelGroup2",
6211
+ ],
6212
+ },
6213
+ "type": "stringList",
6214
+ },
6215
+ "type": "staticValue",
6216
+ },
6217
+ },
6218
+ "type": "comparison",
6219
+ },
6220
+ "displayMetadata": {
6221
+ "failureMessage": "Different custom failure message",
6222
+ "typeClasses": [],
6223
+ },
6224
+ },
6153
6225
  },
6154
6226
  },
6155
6227
  "parameterValidations": {
@@ -6490,6 +6562,42 @@ defineOntology("com.palantir.",()=>{},"/tmp/");});describe("Interfaces",()=>{it(
6490
6562
  "typeClasses": [],
6491
6563
  },
6492
6564
  },
6565
+ "1": {
6566
+ "condition": {
6567
+ "comparison": {
6568
+ "left": {
6569
+ "type": "userProperty",
6570
+ "userProperty": {
6571
+ "propertyValue": {
6572
+ "groupIds": {},
6573
+ "type": "groupIds",
6574
+ },
6575
+ "userId": {
6576
+ "currentUser": {},
6577
+ "type": "currentUser",
6578
+ },
6579
+ },
6580
+ },
6581
+ "operator": "INTERSECTS",
6582
+ "right": {
6583
+ "staticValue": {
6584
+ "stringList": {
6585
+ "strings": [
6586
+ "actionLevelGroup2",
6587
+ ],
6588
+ },
6589
+ "type": "stringList",
6590
+ },
6591
+ "type": "staticValue",
6592
+ },
6593
+ },
6594
+ "type": "comparison",
6595
+ },
6596
+ "displayMetadata": {
6597
+ "failureMessage": "Different custom failure message",
6598
+ "typeClasses": [],
6599
+ },
6600
+ },
6493
6601
  },
6494
6602
  },
6495
6603
  "parameterValidations": {
@@ -9265,7 +9373,7 @@ const employeeObject=defineObject({apiName:"employee",displayName:"Employee",plu
9265
9373
  "valueTypes": [],
9266
9374
  },
9267
9375
  }
9268
- `);});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(`
9376
+ `);});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(`
9269
9377
  {
9270
9378
  "importedOntology": {
9271
9379
  "actionTypes": {},
@@ -9649,7 +9757,7 @@ const employeeObject=defineObject({apiName:"employee",displayName:"Employee",plu
9649
9757
  "valueTypes": [],
9650
9758
  },
9651
9759
  }
9652
- `);});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(`
9760
+ `);});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(`
9653
9761
  {
9654
9762
  "importedOntology": {
9655
9763
  "actionTypes": {},