@osdk/maker-experimental 0.3.0-beta.4 → 0.3.0
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 +29 -0
- package/build/browser/api/importObjectType.js +2 -13
- package/build/browser/api/importObjectType.js.map +1 -1
- package/build/browser/api/overall.test.js +131 -25
- package/build/browser/api/overall.test.js.map +1 -1
- package/build/cjs/{chunk-NJB6ZY7G.cjs → chunk-FZ56D34B.cjs} +3 -3
- package/build/cjs/{chunk-NJB6ZY7G.cjs.map → chunk-FZ56D34B.cjs.map} +1 -1
- package/build/cjs/index.cjs +13 -135
- package/build/cjs/index.cjs.map +1 -1
- package/build/cjs/index.d.cts +2 -3
- package/build/cjs/{prompt-VGNWMASA.cjs → prompt-6FZ62QK3.cjs} +3 -3
- package/build/cjs/{prompt-VGNWMASA.cjs.map → prompt-6FZ62QK3.cjs.map} +1 -1
- package/build/esm/api/importObjectType.js +2 -13
- package/build/esm/api/importObjectType.js.map +1 -1
- package/build/esm/api/overall.test.js +131 -25
- package/build/esm/api/overall.test.js.map +1 -1
- package/build/types/api/importObjectType.d.ts +2 -2
- package/build/types/api/importObjectType.d.ts.map +1 -1
- package/package.json +7 -7
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
import { convertToDisplayName, convertToPluralDisplayName,
|
|
17
|
+
import { convertToDisplayName, convertToPluralDisplayName, importOntologyEntity, OntologyEntityTypeEnum } from "@osdk/maker";
|
|
18
18
|
/*
|
|
19
19
|
* Takes in the minimal object definition to create an input shape.
|
|
20
20
|
* First converts it to fake block data to call importOntologyEntity,
|
|
@@ -37,17 +37,6 @@ export function defineImportObject(objectDef) {
|
|
|
37
37
|
titlePropertyApiName: properties[0]?.apiName
|
|
38
38
|
};
|
|
39
39
|
importOntologyEntity(finalObject);
|
|
40
|
-
|
|
41
|
-
...importedPt,
|
|
42
|
-
apiName: apiName,
|
|
43
|
-
displayName: importedPt.displayName ?? convertToDisplayName(apiName),
|
|
44
|
-
type: convertType(importedPt.type)
|
|
45
|
-
}));
|
|
46
|
-
const ontologyImportObject = {
|
|
47
|
-
...objectDef,
|
|
48
|
-
displayName: objectDef.displayName ?? convertToDisplayName(objectDef.apiName),
|
|
49
|
-
propertyTypes: importPropertyTypes
|
|
50
|
-
};
|
|
51
|
-
return ontologyImportObject;
|
|
40
|
+
return finalObject;
|
|
52
41
|
}
|
|
53
42
|
//# sourceMappingURL=importObjectType.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"importObjectType.js","names":["convertToDisplayName","convertToPluralDisplayName","
|
|
1
|
+
{"version":3,"file":"importObjectType.js","names":["convertToDisplayName","convertToPluralDisplayName","importOntologyEntity","OntologyEntityTypeEnum","defineImportObject","objectDef","properties","Object","entries","map","apiName","type","displayName","finalObject","__type","OBJECT_TYPE","pluralDisplayName","primaryKeyPropertyApiName","titlePropertyApiName"],"sources":["importObjectType.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n convertToDisplayName,\n convertToPluralDisplayName,\n importOntologyEntity,\n type ObjectPropertyType,\n type ObjectType,\n OntologyEntityTypeEnum,\n} from \"@osdk/maker\";\nimport type { ImportObjectDefinition } from \"./types.js\";\n\n/*\n * Takes in the minimal object definition to create an input shape.\n * First converts it to fake block data to call importOntologyEntity,\n * then converts it to an OntologyIrImportedObjectType that is safe to use elsewhere.\n */\nexport function defineImportObject(\n objectDef: ImportObjectDefinition,\n): ObjectType {\n const properties: Array<ObjectPropertyType> = Object.entries(\n objectDef.properties ?? {},\n ).map(([apiName, type]) => ({\n apiName: apiName,\n displayName: convertToDisplayName(apiName),\n type: type.type,\n }));\n const finalObject: ObjectType = {\n apiName: objectDef.apiName,\n properties: properties,\n __type: OntologyEntityTypeEnum.OBJECT_TYPE,\n\n // the rest don't matter for now\n displayName: objectDef.displayName\n ?? convertToDisplayName(objectDef.apiName),\n pluralDisplayName: convertToPluralDisplayName(objectDef.apiName),\n primaryKeyPropertyApiName: properties[0]?.apiName,\n titlePropertyApiName: properties[0]?.apiName,\n };\n importOntologyEntity(finalObject);\n\n return finalObject;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SACEA,oBAAoB,EACpBC,0BAA0B,EAC1BC,oBAAoB,EAGpBC,sBAAsB,QACjB,aAAa;AAGpB;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,kBAAkBA,CAChCC,SAAiC,EACrB;EACZ,MAAMC,UAAqC,GAAGC,MAAM,CAACC,OAAO,CAC1DH,SAAS,CAACC,UAAU,IAAI,CAAC,CAC3B,CAAC,CAACG,GAAG,CAAC,CAAC,CAACC,OAAO,EAAEC,IAAI,CAAC,MAAM;IAC1BD,OAAO,EAAEA,OAAO;IAChBE,WAAW,EAAEZ,oBAAoB,CAACU,OAAO,CAAC;IAC1CC,IAAI,EAAEA,IAAI,CAACA;EACb,CAAC,CAAC,CAAC;EACH,MAAME,WAAuB,GAAG;IAC9BH,OAAO,EAAEL,SAAS,CAACK,OAAO;IAC1BJ,UAAU,EAAEA,UAAU;IACtBQ,MAAM,EAAEX,sBAAsB,CAACY,WAAW;IAE1C;IACAH,WAAW,EAAEP,SAAS,CAACO,WAAW,IAC7BZ,oBAAoB,CAACK,SAAS,CAACK,OAAO,CAAC;IAC5CM,iBAAiB,EAAEf,0BAA0B,CAACI,SAAS,CAACK,OAAO,CAAC;IAChEO,yBAAyB,EAAEX,UAAU,CAAC,CAAC,CAAC,EAAEI,OAAO;IACjDQ,oBAAoB,EAAEZ,UAAU,CAAC,CAAC,CAAC,EAAEI;EACvC,CAAC;EACDR,oBAAoB,CAACW,WAAW,CAAC;EAEjC,OAAOA,WAAW;AACpB","ignoreList":[]}
|
|
@@ -75,7 +75,7 @@ describe("Experimental Test Suite", () => {
|
|
|
75
75
|
}
|
|
76
76
|
}
|
|
77
77
|
});
|
|
78
|
-
expect(dumpOntologyFullMetadata().
|
|
78
|
+
expect(dumpOntologyFullMetadata().ontology).toMatchInlineSnapshot(`
|
|
79
79
|
{
|
|
80
80
|
"actionTypes": {
|
|
81
81
|
"com.palantir.create-object-foo": {
|
|
@@ -383,11 +383,11 @@ describe("Experimental Test Suite", () => {
|
|
|
383
383
|
},
|
|
384
384
|
"type": "datasetV2",
|
|
385
385
|
},
|
|
386
|
+
"datasourceName": "com.palantir.foo",
|
|
386
387
|
"editsConfiguration": {
|
|
387
388
|
"onlyAllowPrivilegedEdits": false,
|
|
388
389
|
},
|
|
389
390
|
"redacted": false,
|
|
390
|
-
"rid": "ri.ontology.main.datasource.com.palantir.foo",
|
|
391
391
|
},
|
|
392
392
|
],
|
|
393
393
|
"entityMetadata": {
|
|
@@ -542,22 +542,86 @@ describe("Experimental Test Suite", () => {
|
|
|
542
542
|
"sharedPropertyTypes": {},
|
|
543
543
|
}
|
|
544
544
|
`);
|
|
545
|
-
expect(dumpOntologyFullMetadata().
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
"
|
|
550
|
-
"
|
|
551
|
-
|
|
545
|
+
expect(dumpOntologyFullMetadata().importedOntology).toMatchInlineSnapshot(`
|
|
546
|
+
{
|
|
547
|
+
"actionTypes": {},
|
|
548
|
+
"blockPermissionInformation": {
|
|
549
|
+
"actionTypes": {},
|
|
550
|
+
"linkTypes": {},
|
|
551
|
+
"objectTypes": {},
|
|
552
|
+
},
|
|
553
|
+
"interfaceTypes": {},
|
|
554
|
+
"linkTypes": {},
|
|
555
|
+
"objectTypes": {
|
|
556
|
+
"myImport": {
|
|
557
|
+
"datasources": [
|
|
558
|
+
{
|
|
559
|
+
"datasource": {
|
|
560
|
+
"datasetV2": {
|
|
561
|
+
"datasetRid": "myImport",
|
|
562
|
+
"propertyMapping": {
|
|
563
|
+
"id": {
|
|
564
|
+
"column": "id",
|
|
565
|
+
"type": "column",
|
|
566
|
+
},
|
|
567
|
+
"name": {
|
|
568
|
+
"column": "name",
|
|
569
|
+
"type": "column",
|
|
570
|
+
},
|
|
571
|
+
},
|
|
572
|
+
},
|
|
573
|
+
"type": "datasetV2",
|
|
574
|
+
},
|
|
575
|
+
"datasourceName": "myImport",
|
|
576
|
+
"editsConfiguration": {
|
|
577
|
+
"onlyAllowPrivilegedEdits": false,
|
|
578
|
+
},
|
|
579
|
+
"redacted": false,
|
|
580
|
+
},
|
|
581
|
+
],
|
|
582
|
+
"entityMetadata": {
|
|
583
|
+
"arePatchesEnabled": false,
|
|
584
|
+
},
|
|
585
|
+
"objectType": {
|
|
586
|
+
"allImplementsInterfaces": {},
|
|
552
587
|
"apiName": "myImport",
|
|
553
|
-
"
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
588
|
+
"displayMetadata": {
|
|
589
|
+
"description": undefined,
|
|
590
|
+
"displayName": "MyImport",
|
|
591
|
+
"groupDisplayName": undefined,
|
|
592
|
+
"icon": {
|
|
593
|
+
"blueprint": {
|
|
594
|
+
"color": "#2D72D2",
|
|
595
|
+
"locator": "cube",
|
|
596
|
+
},
|
|
597
|
+
"type": "blueprint",
|
|
598
|
+
},
|
|
599
|
+
"pluralDisplayName": "MyImports",
|
|
600
|
+
"visibility": "NORMAL",
|
|
601
|
+
},
|
|
602
|
+
"implementsInterfaces2": [],
|
|
603
|
+
"primaryKeys": [
|
|
604
|
+
"id",
|
|
605
|
+
],
|
|
606
|
+
"propertyTypes": {
|
|
607
|
+
"id": {
|
|
557
608
|
"apiName": "id",
|
|
558
|
-
"
|
|
559
|
-
"
|
|
560
|
-
"
|
|
609
|
+
"baseFormatter": undefined,
|
|
610
|
+
"dataConstraints": undefined,
|
|
611
|
+
"displayMetadata": {
|
|
612
|
+
"description": undefined,
|
|
613
|
+
"displayName": "Id",
|
|
614
|
+
"visibility": "NORMAL",
|
|
615
|
+
},
|
|
616
|
+
"indexedForSearch": true,
|
|
617
|
+
"inlineAction": undefined,
|
|
618
|
+
"ruleSetBinding": undefined,
|
|
619
|
+
"sharedPropertyTypeApiName": undefined,
|
|
620
|
+
"sharedPropertyTypeRid": undefined,
|
|
621
|
+
"status": {
|
|
622
|
+
"active": {},
|
|
623
|
+
"type": "active",
|
|
624
|
+
},
|
|
561
625
|
"type": {
|
|
562
626
|
"string": {
|
|
563
627
|
"analyzerOverride": undefined,
|
|
@@ -568,12 +632,36 @@ describe("Experimental Test Suite", () => {
|
|
|
568
632
|
},
|
|
569
633
|
"type": "string",
|
|
570
634
|
},
|
|
635
|
+
"typeClasses": [
|
|
636
|
+
{
|
|
637
|
+
"kind": "render_hint",
|
|
638
|
+
"name": "SELECTABLE",
|
|
639
|
+
},
|
|
640
|
+
{
|
|
641
|
+
"kind": "render_hint",
|
|
642
|
+
"name": "SORTABLE",
|
|
643
|
+
},
|
|
644
|
+
],
|
|
645
|
+
"valueType": undefined,
|
|
571
646
|
},
|
|
572
|
-
{
|
|
647
|
+
"name": {
|
|
573
648
|
"apiName": "name",
|
|
574
|
-
"
|
|
575
|
-
"
|
|
576
|
-
"
|
|
649
|
+
"baseFormatter": undefined,
|
|
650
|
+
"dataConstraints": undefined,
|
|
651
|
+
"displayMetadata": {
|
|
652
|
+
"description": undefined,
|
|
653
|
+
"displayName": "Name",
|
|
654
|
+
"visibility": "NORMAL",
|
|
655
|
+
},
|
|
656
|
+
"indexedForSearch": true,
|
|
657
|
+
"inlineAction": undefined,
|
|
658
|
+
"ruleSetBinding": undefined,
|
|
659
|
+
"sharedPropertyTypeApiName": undefined,
|
|
660
|
+
"sharedPropertyTypeRid": undefined,
|
|
661
|
+
"status": {
|
|
662
|
+
"active": {},
|
|
663
|
+
"type": "active",
|
|
664
|
+
},
|
|
577
665
|
"type": {
|
|
578
666
|
"string": {
|
|
579
667
|
"analyzerOverride": undefined,
|
|
@@ -584,13 +672,31 @@ describe("Experimental Test Suite", () => {
|
|
|
584
672
|
},
|
|
585
673
|
"type": "string",
|
|
586
674
|
},
|
|
675
|
+
"typeClasses": [
|
|
676
|
+
{
|
|
677
|
+
"kind": "render_hint",
|
|
678
|
+
"name": "SELECTABLE",
|
|
679
|
+
},
|
|
680
|
+
{
|
|
681
|
+
"kind": "render_hint",
|
|
682
|
+
"name": "SORTABLE",
|
|
683
|
+
},
|
|
684
|
+
],
|
|
685
|
+
"valueType": undefined,
|
|
587
686
|
},
|
|
588
|
-
|
|
687
|
+
},
|
|
688
|
+
"redacted": false,
|
|
689
|
+
"status": {
|
|
690
|
+
"active": {},
|
|
691
|
+
"type": "active",
|
|
692
|
+
},
|
|
693
|
+
"titlePropertyTypeRid": "id",
|
|
589
694
|
},
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
}
|
|
593
|
-
|
|
695
|
+
},
|
|
696
|
+
},
|
|
697
|
+
"sharedPropertyTypes": {},
|
|
698
|
+
}
|
|
699
|
+
`);
|
|
594
700
|
});
|
|
595
701
|
});
|
|
596
702
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"overall.test.js","names":["defineCreateObjectAction","defineObject","defineOntology","dumpOntologyFullMetadata","beforeEach","describe","expect","it","defineImportObject","importedObject","apiName","properties","id","type","name","foo","displayName","pluralDisplayName","titlePropertyApiName","primaryKeyPropertyApiName","objectType","parameterOrdering","parameterConfiguration","customParameterType","objectReference","objectTypeId","defaultValue","objectParameterPropertyValue","parameterId","propertyTypeId","blockData","toMatchInlineSnapshot","importedTypes"],"sources":["overall.test.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n defineCreateObjectAction,\n defineObject,\n defineOntology,\n dumpOntologyFullMetadata,\n} from \"@osdk/maker\";\nimport { beforeEach, describe, expect, it } from \"vitest\";\nimport { defineImportObject } from \"./importObjectType.js\";\n\ndescribe(\"Experimental Test Suite\", () => {\n beforeEach(async () => {\n await defineOntology(\"com.palantir.\", () => {}, \"/tmp/\");\n });\n\n describe(\"Imports\", () => {\n it(\"Imported object types as action parameters are properly defined\", () => {\n const importedObject = defineImportObject({\n apiName: \"myImport\",\n properties: {\n id: { type: \"string\" },\n name: { type: \"string\" },\n },\n });\n const foo = defineObject({\n apiName: \"foo\",\n displayName: \"Foo\",\n pluralDisplayName: \"Foos\",\n titlePropertyApiName: \"id\",\n primaryKeyPropertyApiName: \"id\",\n properties: {\n \"id\": { type: \"string\" },\n \"date\": { type: \"date\" },\n \"team\": { type: \"string\" },\n },\n });\n defineCreateObjectAction({\n objectType: foo,\n parameterOrdering: [\"ref\", \"team\", \"id\", \"date\"],\n parameterConfiguration: {\n \"ref\": {\n customParameterType: {\n type: \"objectReference\",\n objectReference: {\n objectTypeId: importedObject.apiName,\n },\n },\n },\n \"team\": {\n defaultValue: {\n type: \"objectParameterPropertyValue\",\n objectParameterPropertyValue: {\n parameterId: \"ref\",\n propertyTypeId: \"foo\",\n },\n },\n },\n },\n });\n expect(dumpOntologyFullMetadata().blockData).toMatchInlineSnapshot(`\n {\n \"actionTypes\": {\n \"com.palantir.create-object-foo\": {\n \"actionType\": {\n \"actionTypeLogic\": {\n \"logic\": {\n \"rules\": [\n {\n \"addObjectRule\": {\n \"objectTypeId\": \"com.palantir.foo\",\n \"propertyValues\": {\n \"date\": {\n \"parameterId\": \"date\",\n \"type\": \"parameterId\",\n },\n \"id\": {\n \"parameterId\": \"id\",\n \"type\": \"parameterId\",\n },\n \"team\": {\n \"parameterId\": \"team\",\n \"type\": \"parameterId\",\n },\n },\n \"structFieldValues\": {},\n },\n \"type\": \"addObjectRule\",\n },\n ],\n },\n \"validation\": {\n \"actionTypeLevelValidation\": {\n \"rules\": {\n \"0\": {\n \"condition\": {\n \"true\": {},\n \"type\": \"true\",\n },\n \"displayMetadata\": {\n \"failureMessage\": \"\",\n \"typeClasses\": [],\n },\n },\n },\n },\n \"parameterValidations\": {\n \"date\": {\n \"conditionalOverrides\": [],\n \"defaultValidation\": {\n \"display\": {\n \"renderHint\": {\n \"dateTimePicker\": {},\n \"type\": \"dateTimePicker\",\n },\n \"visibility\": {\n \"editable\": {},\n \"type\": \"editable\",\n },\n },\n \"validation\": {\n \"allowedValues\": {\n \"datetime\": {\n \"datetime\": {\n \"maximum\": undefined,\n \"minimum\": undefined,\n },\n \"type\": \"datetime\",\n },\n \"type\": \"datetime\",\n },\n \"required\": {\n \"notRequired\": {},\n \"type\": \"notRequired\",\n },\n },\n },\n },\n \"id\": {\n \"conditionalOverrides\": [],\n \"defaultValidation\": {\n \"display\": {\n \"renderHint\": {\n \"textInput\": {},\n \"type\": \"textInput\",\n },\n \"visibility\": {\n \"editable\": {},\n \"type\": \"editable\",\n },\n },\n \"validation\": {\n \"allowedValues\": {\n \"text\": {\n \"text\": {},\n \"type\": \"text\",\n },\n \"type\": \"text\",\n },\n \"required\": {\n \"notRequired\": {},\n \"type\": \"notRequired\",\n },\n },\n },\n },\n \"ref\": {\n \"conditionalOverrides\": [],\n \"defaultValidation\": {\n \"display\": {\n \"renderHint\": {\n \"dropdown\": {},\n \"type\": \"dropdown\",\n },\n \"visibility\": {\n \"editable\": {},\n \"type\": \"editable\",\n },\n },\n \"validation\": {\n \"allowedValues\": {\n \"objectQuery\": {\n \"objectQuery\": {},\n \"type\": \"objectQuery\",\n },\n \"type\": \"objectQuery\",\n },\n \"required\": {\n \"notRequired\": {},\n \"type\": \"notRequired\",\n },\n },\n },\n },\n \"team\": {\n \"conditionalOverrides\": [],\n \"defaultValidation\": {\n \"display\": {\n \"prefill\": {\n \"objectParameterPropertyValue\": {\n \"parameterId\": \"ref\",\n \"propertyTypeId\": \"foo\",\n },\n \"type\": \"objectParameterPropertyValue\",\n },\n \"renderHint\": {\n \"textInput\": {},\n \"type\": \"textInput\",\n },\n \"visibility\": {\n \"editable\": {},\n \"type\": \"editable\",\n },\n },\n \"validation\": {\n \"allowedValues\": {\n \"text\": {\n \"text\": {},\n \"type\": \"text\",\n },\n \"type\": \"text\",\n },\n \"required\": {\n \"notRequired\": {},\n \"type\": \"notRequired\",\n },\n },\n },\n },\n },\n \"sectionValidations\": {},\n },\n },\n \"metadata\": {\n \"apiName\": \"com.palantir.create-object-foo\",\n \"displayMetadata\": {\n \"configuration\": {\n \"defaultLayout\": \"FORM\",\n \"displayAndFormat\": {\n \"table\": {\n \"columnWidthByParameterRid\": {},\n \"enableFileImport\": true,\n \"fitHorizontally\": false,\n \"frozenColumnCount\": 0,\n \"rowHeightInLines\": 1,\n },\n },\n \"enableLayoutUserSwitch\": false,\n },\n \"description\": \"\",\n \"displayName\": \"Create Foo\",\n \"icon\": {\n \"blueprint\": {\n \"color\": \"#000000\",\n \"locator\": \"edit\",\n },\n \"type\": \"blueprint\",\n },\n \"successMessage\": [],\n \"typeClasses\": [],\n },\n \"entities\": {\n \"affectedInterfaceTypes\": [],\n \"affectedLinkTypes\": [],\n \"affectedObjectTypes\": [\n \"com.palantir.foo\",\n ],\n \"typeGroups\": [],\n },\n \"formContentOrdering\": [],\n \"parameterOrdering\": [\n \"ref\",\n \"team\",\n \"id\",\n \"date\",\n ],\n \"parameters\": {\n \"date\": {\n \"displayMetadata\": {\n \"description\": \"\",\n \"displayName\": \"Date\",\n \"typeClasses\": [],\n },\n \"id\": \"date\",\n \"type\": {\n \"date\": {},\n \"type\": \"date\",\n },\n },\n \"id\": {\n \"displayMetadata\": {\n \"description\": \"\",\n \"displayName\": \"Id\",\n \"typeClasses\": [],\n },\n \"id\": \"id\",\n \"type\": {\n \"string\": {},\n \"type\": \"string\",\n },\n },\n \"ref\": {\n \"displayMetadata\": {\n \"description\": \"\",\n \"displayName\": \"Ref\",\n \"typeClasses\": [],\n },\n \"id\": \"ref\",\n \"type\": {\n \"objectReference\": {\n \"objectTypeId\": \"myImport\",\n },\n \"type\": \"objectReference\",\n },\n },\n \"team\": {\n \"displayMetadata\": {\n \"description\": \"\",\n \"displayName\": \"Team\",\n \"typeClasses\": [],\n },\n \"id\": \"team\",\n \"type\": {\n \"string\": {},\n \"type\": \"string\",\n },\n },\n },\n \"sections\": {},\n \"status\": {\n \"active\": {},\n \"type\": \"active\",\n },\n },\n },\n },\n },\n \"blockPermissionInformation\": {\n \"actionTypes\": {},\n \"linkTypes\": {},\n \"objectTypes\": {},\n },\n \"interfaceTypes\": {},\n \"linkTypes\": {},\n \"objectTypes\": {\n \"com.palantir.foo\": {\n \"datasources\": [\n {\n \"datasource\": {\n \"datasetV2\": {\n \"datasetRid\": \"com.palantir.foo\",\n \"propertyMapping\": {\n \"date\": {\n \"column\": \"date\",\n \"type\": \"column\",\n },\n \"id\": {\n \"column\": \"id\",\n \"type\": \"column\",\n },\n \"team\": {\n \"column\": \"team\",\n \"type\": \"column\",\n },\n },\n },\n \"type\": \"datasetV2\",\n },\n \"editsConfiguration\": {\n \"onlyAllowPrivilegedEdits\": false,\n },\n \"redacted\": false,\n \"rid\": \"ri.ontology.main.datasource.com.palantir.foo\",\n },\n ],\n \"entityMetadata\": {\n \"arePatchesEnabled\": false,\n },\n \"objectType\": {\n \"allImplementsInterfaces\": {},\n \"apiName\": \"com.palantir.foo\",\n \"displayMetadata\": {\n \"description\": undefined,\n \"displayName\": \"Foo\",\n \"groupDisplayName\": undefined,\n \"icon\": {\n \"blueprint\": {\n \"color\": \"#2D72D2\",\n \"locator\": \"cube\",\n },\n \"type\": \"blueprint\",\n },\n \"pluralDisplayName\": \"Foos\",\n \"visibility\": \"NORMAL\",\n },\n \"implementsInterfaces2\": [],\n \"primaryKeys\": [\n \"id\",\n ],\n \"propertyTypes\": {\n \"date\": {\n \"apiName\": \"date\",\n \"baseFormatter\": undefined,\n \"dataConstraints\": undefined,\n \"displayMetadata\": {\n \"description\": undefined,\n \"displayName\": \"Date\",\n \"visibility\": \"NORMAL\",\n },\n \"indexedForSearch\": true,\n \"inlineAction\": undefined,\n \"ruleSetBinding\": undefined,\n \"sharedPropertyTypeApiName\": undefined,\n \"sharedPropertyTypeRid\": undefined,\n \"status\": {\n \"active\": {},\n \"type\": \"active\",\n },\n \"type\": {\n \"date\": {},\n \"type\": \"date\",\n },\n \"typeClasses\": [\n {\n \"kind\": \"render_hint\",\n \"name\": \"SELECTABLE\",\n },\n {\n \"kind\": \"render_hint\",\n \"name\": \"SORTABLE\",\n },\n ],\n \"valueType\": undefined,\n },\n \"id\": {\n \"apiName\": \"id\",\n \"baseFormatter\": undefined,\n \"dataConstraints\": undefined,\n \"displayMetadata\": {\n \"description\": undefined,\n \"displayName\": \"Id\",\n \"visibility\": \"NORMAL\",\n },\n \"indexedForSearch\": true,\n \"inlineAction\": undefined,\n \"ruleSetBinding\": undefined,\n \"sharedPropertyTypeApiName\": undefined,\n \"sharedPropertyTypeRid\": undefined,\n \"status\": {\n \"active\": {},\n \"type\": \"active\",\n },\n \"type\": {\n \"string\": {\n \"analyzerOverride\": undefined,\n \"enableAsciiFolding\": undefined,\n \"isLongText\": false,\n \"supportsEfficientLeadingWildcard\": false,\n \"supportsExactMatching\": true,\n },\n \"type\": \"string\",\n },\n \"typeClasses\": [\n {\n \"kind\": \"render_hint\",\n \"name\": \"SELECTABLE\",\n },\n {\n \"kind\": \"render_hint\",\n \"name\": \"SORTABLE\",\n },\n ],\n \"valueType\": undefined,\n },\n \"team\": {\n \"apiName\": \"team\",\n \"baseFormatter\": undefined,\n \"dataConstraints\": undefined,\n \"displayMetadata\": {\n \"description\": undefined,\n \"displayName\": \"Team\",\n \"visibility\": \"NORMAL\",\n },\n \"indexedForSearch\": true,\n \"inlineAction\": undefined,\n \"ruleSetBinding\": undefined,\n \"sharedPropertyTypeApiName\": undefined,\n \"sharedPropertyTypeRid\": undefined,\n \"status\": {\n \"active\": {},\n \"type\": \"active\",\n },\n \"type\": {\n \"string\": {\n \"analyzerOverride\": undefined,\n \"enableAsciiFolding\": undefined,\n \"isLongText\": false,\n \"supportsEfficientLeadingWildcard\": false,\n \"supportsExactMatching\": true,\n },\n \"type\": \"string\",\n },\n \"typeClasses\": [\n {\n \"kind\": \"render_hint\",\n \"name\": \"SELECTABLE\",\n },\n {\n \"kind\": \"render_hint\",\n \"name\": \"SORTABLE\",\n },\n ],\n \"valueType\": undefined,\n },\n },\n \"redacted\": false,\n \"status\": {\n \"active\": {},\n \"type\": \"active\",\n },\n \"titlePropertyTypeRid\": \"id\",\n },\n },\n },\n \"sharedPropertyTypes\": {},\n }\n `);\n expect(dumpOntologyFullMetadata().importedTypes).toMatchInlineSnapshot(`\n {\n \"actionTypes\": [],\n \"interfaceTypes\": [],\n \"linkTypes\": [],\n \"objectTypes\": [\n {\n \"apiName\": \"myImport\",\n \"description\": undefined,\n \"displayName\": \"MyImport\",\n \"propertyTypes\": [\n {\n \"apiName\": \"id\",\n \"description\": undefined,\n \"displayName\": \"Id\",\n \"sharedPropertyType\": undefined,\n \"type\": {\n \"string\": {\n \"analyzerOverride\": undefined,\n \"enableAsciiFolding\": undefined,\n \"isLongText\": false,\n \"supportsEfficientLeadingWildcard\": false,\n \"supportsExactMatching\": true,\n },\n \"type\": \"string\",\n },\n },\n {\n \"apiName\": \"name\",\n \"description\": undefined,\n \"displayName\": \"Name\",\n \"sharedPropertyType\": undefined,\n \"type\": {\n \"string\": {\n \"analyzerOverride\": undefined,\n \"enableAsciiFolding\": undefined,\n \"isLongText\": false,\n \"supportsEfficientLeadingWildcard\": false,\n \"supportsExactMatching\": true,\n },\n \"type\": \"string\",\n },\n },\n ],\n },\n ],\n \"sharedPropertyTypes\": [],\n }\n `);\n });\n });\n});\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SACEA,wBAAwB,EACxBC,YAAY,EACZC,cAAc,EACdC,wBAAwB,QACnB,aAAa;AACpB,SAASC,UAAU,EAAEC,QAAQ,EAAEC,MAAM,EAAEC,EAAE,QAAQ,QAAQ;AACzD,SAASC,kBAAkB,QAAQ,uBAAuB;AAE1DH,QAAQ,CAAC,yBAAyB,EAAE,MAAM;EACxCD,UAAU,CAAC,YAAY;IACrB,MAAMF,cAAc,CAAC,eAAe,EAAE,MAAM,CAAC,CAAC,EAAE,OAAO,CAAC;EAC1D,CAAC,CAAC;EAEFG,QAAQ,CAAC,SAAS,EAAE,MAAM;IACxBE,EAAE,CAAC,iEAAiE,EAAE,MAAM;MAC1E,MAAME,cAAc,GAAGD,kBAAkB,CAAC;QACxCE,OAAO,EAAE,UAAU;QACnBC,UAAU,EAAE;UACVC,EAAE,EAAE;YAAEC,IAAI,EAAE;UAAS,CAAC;UACtBC,IAAI,EAAE;YAAED,IAAI,EAAE;UAAS;QACzB;MACF,CAAC,CAAC;MACF,MAAME,GAAG,GAAGd,YAAY,CAAC;QACvBS,OAAO,EAAE,KAAK;QACdM,WAAW,EAAE,KAAK;QAClBC,iBAAiB,EAAE,MAAM;QACzBC,oBAAoB,EAAE,IAAI;QAC1BC,yBAAyB,EAAE,IAAI;QAC/BR,UAAU,EAAE;UACV,IAAI,EAAE;YAAEE,IAAI,EAAE;UAAS,CAAC;UACxB,MAAM,EAAE;YAAEA,IAAI,EAAE;UAAO,CAAC;UACxB,MAAM,EAAE;YAAEA,IAAI,EAAE;UAAS;QAC3B;MACF,CAAC,CAAC;MACFb,wBAAwB,CAAC;QACvBoB,UAAU,EAAEL,GAAG;QACfM,iBAAiB,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC;QAChDC,sBAAsB,EAAE;UACtB,KAAK,EAAE;YACLC,mBAAmB,EAAE;cACnBV,IAAI,EAAE,iBAAiB;cACvBW,eAAe,EAAE;gBACfC,YAAY,EAAEhB,cAAc,CAACC;cAC/B;YACF;UACF,CAAC;UACD,MAAM,EAAE;YACNgB,YAAY,EAAE;cACZb,IAAI,EAAE,8BAA8B;cACpCc,4BAA4B,EAAE;gBAC5BC,WAAW,EAAE,KAAK;gBAClBC,cAAc,EAAE;cAClB;YACF;UACF;QACF;MACF,CAAC,CAAC;MACFvB,MAAM,CAACH,wBAAwB,CAAC,CAAC,CAAC2B,SAAS,CAAC,CAACC,qBAAqB,CAAC;AACzE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,CAAC;MACFzB,MAAM,CAACH,wBAAwB,CAAC,CAAC,CAAC6B,aAAa,CAAC,CAACD,qBAAqB,CAAC;AAC7E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,CAAC;IACN,CAAC,CAAC;EACJ,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"overall.test.js","names":["defineCreateObjectAction","defineObject","defineOntology","dumpOntologyFullMetadata","beforeEach","describe","expect","it","defineImportObject","importedObject","apiName","properties","id","type","name","foo","displayName","pluralDisplayName","titlePropertyApiName","primaryKeyPropertyApiName","objectType","parameterOrdering","parameterConfiguration","customParameterType","objectReference","objectTypeId","defaultValue","objectParameterPropertyValue","parameterId","propertyTypeId","ontology","toMatchInlineSnapshot","importedOntology"],"sources":["overall.test.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n defineCreateObjectAction,\n defineObject,\n defineOntology,\n dumpOntologyFullMetadata,\n} from \"@osdk/maker\";\nimport { beforeEach, describe, expect, it } from \"vitest\";\nimport { defineImportObject } from \"./importObjectType.js\";\n\ndescribe(\"Experimental Test Suite\", () => {\n beforeEach(async () => {\n await defineOntology(\"com.palantir.\", () => {}, \"/tmp/\");\n });\n\n describe(\"Imports\", () => {\n it(\"Imported object types as action parameters are properly defined\", () => {\n const importedObject = defineImportObject({\n apiName: \"myImport\",\n properties: {\n id: { type: \"string\" },\n name: { type: \"string\" },\n },\n });\n const foo = defineObject({\n apiName: \"foo\",\n displayName: \"Foo\",\n pluralDisplayName: \"Foos\",\n titlePropertyApiName: \"id\",\n primaryKeyPropertyApiName: \"id\",\n properties: {\n \"id\": { type: \"string\" },\n \"date\": { type: \"date\" },\n \"team\": { type: \"string\" },\n },\n });\n defineCreateObjectAction({\n objectType: foo,\n parameterOrdering: [\"ref\", \"team\", \"id\", \"date\"],\n parameterConfiguration: {\n \"ref\": {\n customParameterType: {\n type: \"objectReference\",\n objectReference: {\n objectTypeId: importedObject.apiName,\n },\n },\n },\n \"team\": {\n defaultValue: {\n type: \"objectParameterPropertyValue\",\n objectParameterPropertyValue: {\n parameterId: \"ref\",\n propertyTypeId: \"foo\",\n },\n },\n },\n },\n });\n expect(dumpOntologyFullMetadata().ontology).toMatchInlineSnapshot(`\n {\n \"actionTypes\": {\n \"com.palantir.create-object-foo\": {\n \"actionType\": {\n \"actionTypeLogic\": {\n \"logic\": {\n \"rules\": [\n {\n \"addObjectRule\": {\n \"objectTypeId\": \"com.palantir.foo\",\n \"propertyValues\": {\n \"date\": {\n \"parameterId\": \"date\",\n \"type\": \"parameterId\",\n },\n \"id\": {\n \"parameterId\": \"id\",\n \"type\": \"parameterId\",\n },\n \"team\": {\n \"parameterId\": \"team\",\n \"type\": \"parameterId\",\n },\n },\n \"structFieldValues\": {},\n },\n \"type\": \"addObjectRule\",\n },\n ],\n },\n \"validation\": {\n \"actionTypeLevelValidation\": {\n \"rules\": {\n \"0\": {\n \"condition\": {\n \"true\": {},\n \"type\": \"true\",\n },\n \"displayMetadata\": {\n \"failureMessage\": \"\",\n \"typeClasses\": [],\n },\n },\n },\n },\n \"parameterValidations\": {\n \"date\": {\n \"conditionalOverrides\": [],\n \"defaultValidation\": {\n \"display\": {\n \"renderHint\": {\n \"dateTimePicker\": {},\n \"type\": \"dateTimePicker\",\n },\n \"visibility\": {\n \"editable\": {},\n \"type\": \"editable\",\n },\n },\n \"validation\": {\n \"allowedValues\": {\n \"datetime\": {\n \"datetime\": {\n \"maximum\": undefined,\n \"minimum\": undefined,\n },\n \"type\": \"datetime\",\n },\n \"type\": \"datetime\",\n },\n \"required\": {\n \"notRequired\": {},\n \"type\": \"notRequired\",\n },\n },\n },\n },\n \"id\": {\n \"conditionalOverrides\": [],\n \"defaultValidation\": {\n \"display\": {\n \"renderHint\": {\n \"textInput\": {},\n \"type\": \"textInput\",\n },\n \"visibility\": {\n \"editable\": {},\n \"type\": \"editable\",\n },\n },\n \"validation\": {\n \"allowedValues\": {\n \"text\": {\n \"text\": {},\n \"type\": \"text\",\n },\n \"type\": \"text\",\n },\n \"required\": {\n \"notRequired\": {},\n \"type\": \"notRequired\",\n },\n },\n },\n },\n \"ref\": {\n \"conditionalOverrides\": [],\n \"defaultValidation\": {\n \"display\": {\n \"renderHint\": {\n \"dropdown\": {},\n \"type\": \"dropdown\",\n },\n \"visibility\": {\n \"editable\": {},\n \"type\": \"editable\",\n },\n },\n \"validation\": {\n \"allowedValues\": {\n \"objectQuery\": {\n \"objectQuery\": {},\n \"type\": \"objectQuery\",\n },\n \"type\": \"objectQuery\",\n },\n \"required\": {\n \"notRequired\": {},\n \"type\": \"notRequired\",\n },\n },\n },\n },\n \"team\": {\n \"conditionalOverrides\": [],\n \"defaultValidation\": {\n \"display\": {\n \"prefill\": {\n \"objectParameterPropertyValue\": {\n \"parameterId\": \"ref\",\n \"propertyTypeId\": \"foo\",\n },\n \"type\": \"objectParameterPropertyValue\",\n },\n \"renderHint\": {\n \"textInput\": {},\n \"type\": \"textInput\",\n },\n \"visibility\": {\n \"editable\": {},\n \"type\": \"editable\",\n },\n },\n \"validation\": {\n \"allowedValues\": {\n \"text\": {\n \"text\": {},\n \"type\": \"text\",\n },\n \"type\": \"text\",\n },\n \"required\": {\n \"notRequired\": {},\n \"type\": \"notRequired\",\n },\n },\n },\n },\n },\n \"sectionValidations\": {},\n },\n },\n \"metadata\": {\n \"apiName\": \"com.palantir.create-object-foo\",\n \"displayMetadata\": {\n \"configuration\": {\n \"defaultLayout\": \"FORM\",\n \"displayAndFormat\": {\n \"table\": {\n \"columnWidthByParameterRid\": {},\n \"enableFileImport\": true,\n \"fitHorizontally\": false,\n \"frozenColumnCount\": 0,\n \"rowHeightInLines\": 1,\n },\n },\n \"enableLayoutUserSwitch\": false,\n },\n \"description\": \"\",\n \"displayName\": \"Create Foo\",\n \"icon\": {\n \"blueprint\": {\n \"color\": \"#000000\",\n \"locator\": \"edit\",\n },\n \"type\": \"blueprint\",\n },\n \"successMessage\": [],\n \"typeClasses\": [],\n },\n \"entities\": {\n \"affectedInterfaceTypes\": [],\n \"affectedLinkTypes\": [],\n \"affectedObjectTypes\": [\n \"com.palantir.foo\",\n ],\n \"typeGroups\": [],\n },\n \"formContentOrdering\": [],\n \"parameterOrdering\": [\n \"ref\",\n \"team\",\n \"id\",\n \"date\",\n ],\n \"parameters\": {\n \"date\": {\n \"displayMetadata\": {\n \"description\": \"\",\n \"displayName\": \"Date\",\n \"typeClasses\": [],\n },\n \"id\": \"date\",\n \"type\": {\n \"date\": {},\n \"type\": \"date\",\n },\n },\n \"id\": {\n \"displayMetadata\": {\n \"description\": \"\",\n \"displayName\": \"Id\",\n \"typeClasses\": [],\n },\n \"id\": \"id\",\n \"type\": {\n \"string\": {},\n \"type\": \"string\",\n },\n },\n \"ref\": {\n \"displayMetadata\": {\n \"description\": \"\",\n \"displayName\": \"Ref\",\n \"typeClasses\": [],\n },\n \"id\": \"ref\",\n \"type\": {\n \"objectReference\": {\n \"objectTypeId\": \"myImport\",\n },\n \"type\": \"objectReference\",\n },\n },\n \"team\": {\n \"displayMetadata\": {\n \"description\": \"\",\n \"displayName\": \"Team\",\n \"typeClasses\": [],\n },\n \"id\": \"team\",\n \"type\": {\n \"string\": {},\n \"type\": \"string\",\n },\n },\n },\n \"sections\": {},\n \"status\": {\n \"active\": {},\n \"type\": \"active\",\n },\n },\n },\n },\n },\n \"blockPermissionInformation\": {\n \"actionTypes\": {},\n \"linkTypes\": {},\n \"objectTypes\": {},\n },\n \"interfaceTypes\": {},\n \"linkTypes\": {},\n \"objectTypes\": {\n \"com.palantir.foo\": {\n \"datasources\": [\n {\n \"datasource\": {\n \"datasetV2\": {\n \"datasetRid\": \"com.palantir.foo\",\n \"propertyMapping\": {\n \"date\": {\n \"column\": \"date\",\n \"type\": \"column\",\n },\n \"id\": {\n \"column\": \"id\",\n \"type\": \"column\",\n },\n \"team\": {\n \"column\": \"team\",\n \"type\": \"column\",\n },\n },\n },\n \"type\": \"datasetV2\",\n },\n \"datasourceName\": \"com.palantir.foo\",\n \"editsConfiguration\": {\n \"onlyAllowPrivilegedEdits\": false,\n },\n \"redacted\": false,\n },\n ],\n \"entityMetadata\": {\n \"arePatchesEnabled\": false,\n },\n \"objectType\": {\n \"allImplementsInterfaces\": {},\n \"apiName\": \"com.palantir.foo\",\n \"displayMetadata\": {\n \"description\": undefined,\n \"displayName\": \"Foo\",\n \"groupDisplayName\": undefined,\n \"icon\": {\n \"blueprint\": {\n \"color\": \"#2D72D2\",\n \"locator\": \"cube\",\n },\n \"type\": \"blueprint\",\n },\n \"pluralDisplayName\": \"Foos\",\n \"visibility\": \"NORMAL\",\n },\n \"implementsInterfaces2\": [],\n \"primaryKeys\": [\n \"id\",\n ],\n \"propertyTypes\": {\n \"date\": {\n \"apiName\": \"date\",\n \"baseFormatter\": undefined,\n \"dataConstraints\": undefined,\n \"displayMetadata\": {\n \"description\": undefined,\n \"displayName\": \"Date\",\n \"visibility\": \"NORMAL\",\n },\n \"indexedForSearch\": true,\n \"inlineAction\": undefined,\n \"ruleSetBinding\": undefined,\n \"sharedPropertyTypeApiName\": undefined,\n \"sharedPropertyTypeRid\": undefined,\n \"status\": {\n \"active\": {},\n \"type\": \"active\",\n },\n \"type\": {\n \"date\": {},\n \"type\": \"date\",\n },\n \"typeClasses\": [\n {\n \"kind\": \"render_hint\",\n \"name\": \"SELECTABLE\",\n },\n {\n \"kind\": \"render_hint\",\n \"name\": \"SORTABLE\",\n },\n ],\n \"valueType\": undefined,\n },\n \"id\": {\n \"apiName\": \"id\",\n \"baseFormatter\": undefined,\n \"dataConstraints\": undefined,\n \"displayMetadata\": {\n \"description\": undefined,\n \"displayName\": \"Id\",\n \"visibility\": \"NORMAL\",\n },\n \"indexedForSearch\": true,\n \"inlineAction\": undefined,\n \"ruleSetBinding\": undefined,\n \"sharedPropertyTypeApiName\": undefined,\n \"sharedPropertyTypeRid\": undefined,\n \"status\": {\n \"active\": {},\n \"type\": \"active\",\n },\n \"type\": {\n \"string\": {\n \"analyzerOverride\": undefined,\n \"enableAsciiFolding\": undefined,\n \"isLongText\": false,\n \"supportsEfficientLeadingWildcard\": false,\n \"supportsExactMatching\": true,\n },\n \"type\": \"string\",\n },\n \"typeClasses\": [\n {\n \"kind\": \"render_hint\",\n \"name\": \"SELECTABLE\",\n },\n {\n \"kind\": \"render_hint\",\n \"name\": \"SORTABLE\",\n },\n ],\n \"valueType\": undefined,\n },\n \"team\": {\n \"apiName\": \"team\",\n \"baseFormatter\": undefined,\n \"dataConstraints\": undefined,\n \"displayMetadata\": {\n \"description\": undefined,\n \"displayName\": \"Team\",\n \"visibility\": \"NORMAL\",\n },\n \"indexedForSearch\": true,\n \"inlineAction\": undefined,\n \"ruleSetBinding\": undefined,\n \"sharedPropertyTypeApiName\": undefined,\n \"sharedPropertyTypeRid\": undefined,\n \"status\": {\n \"active\": {},\n \"type\": \"active\",\n },\n \"type\": {\n \"string\": {\n \"analyzerOverride\": undefined,\n \"enableAsciiFolding\": undefined,\n \"isLongText\": false,\n \"supportsEfficientLeadingWildcard\": false,\n \"supportsExactMatching\": true,\n },\n \"type\": \"string\",\n },\n \"typeClasses\": [\n {\n \"kind\": \"render_hint\",\n \"name\": \"SELECTABLE\",\n },\n {\n \"kind\": \"render_hint\",\n \"name\": \"SORTABLE\",\n },\n ],\n \"valueType\": undefined,\n },\n },\n \"redacted\": false,\n \"status\": {\n \"active\": {},\n \"type\": \"active\",\n },\n \"titlePropertyTypeRid\": \"id\",\n },\n },\n },\n \"sharedPropertyTypes\": {},\n }\n `);\n expect(dumpOntologyFullMetadata().importedOntology).toMatchInlineSnapshot(\n `\n {\n \"actionTypes\": {},\n \"blockPermissionInformation\": {\n \"actionTypes\": {},\n \"linkTypes\": {},\n \"objectTypes\": {},\n },\n \"interfaceTypes\": {},\n \"linkTypes\": {},\n \"objectTypes\": {\n \"myImport\": {\n \"datasources\": [\n {\n \"datasource\": {\n \"datasetV2\": {\n \"datasetRid\": \"myImport\",\n \"propertyMapping\": {\n \"id\": {\n \"column\": \"id\",\n \"type\": \"column\",\n },\n \"name\": {\n \"column\": \"name\",\n \"type\": \"column\",\n },\n },\n },\n \"type\": \"datasetV2\",\n },\n \"datasourceName\": \"myImport\",\n \"editsConfiguration\": {\n \"onlyAllowPrivilegedEdits\": false,\n },\n \"redacted\": false,\n },\n ],\n \"entityMetadata\": {\n \"arePatchesEnabled\": false,\n },\n \"objectType\": {\n \"allImplementsInterfaces\": {},\n \"apiName\": \"myImport\",\n \"displayMetadata\": {\n \"description\": undefined,\n \"displayName\": \"MyImport\",\n \"groupDisplayName\": undefined,\n \"icon\": {\n \"blueprint\": {\n \"color\": \"#2D72D2\",\n \"locator\": \"cube\",\n },\n \"type\": \"blueprint\",\n },\n \"pluralDisplayName\": \"MyImports\",\n \"visibility\": \"NORMAL\",\n },\n \"implementsInterfaces2\": [],\n \"primaryKeys\": [\n \"id\",\n ],\n \"propertyTypes\": {\n \"id\": {\n \"apiName\": \"id\",\n \"baseFormatter\": undefined,\n \"dataConstraints\": undefined,\n \"displayMetadata\": {\n \"description\": undefined,\n \"displayName\": \"Id\",\n \"visibility\": \"NORMAL\",\n },\n \"indexedForSearch\": true,\n \"inlineAction\": undefined,\n \"ruleSetBinding\": undefined,\n \"sharedPropertyTypeApiName\": undefined,\n \"sharedPropertyTypeRid\": undefined,\n \"status\": {\n \"active\": {},\n \"type\": \"active\",\n },\n \"type\": {\n \"string\": {\n \"analyzerOverride\": undefined,\n \"enableAsciiFolding\": undefined,\n \"isLongText\": false,\n \"supportsEfficientLeadingWildcard\": false,\n \"supportsExactMatching\": true,\n },\n \"type\": \"string\",\n },\n \"typeClasses\": [\n {\n \"kind\": \"render_hint\",\n \"name\": \"SELECTABLE\",\n },\n {\n \"kind\": \"render_hint\",\n \"name\": \"SORTABLE\",\n },\n ],\n \"valueType\": undefined,\n },\n \"name\": {\n \"apiName\": \"name\",\n \"baseFormatter\": undefined,\n \"dataConstraints\": undefined,\n \"displayMetadata\": {\n \"description\": undefined,\n \"displayName\": \"Name\",\n \"visibility\": \"NORMAL\",\n },\n \"indexedForSearch\": true,\n \"inlineAction\": undefined,\n \"ruleSetBinding\": undefined,\n \"sharedPropertyTypeApiName\": undefined,\n \"sharedPropertyTypeRid\": undefined,\n \"status\": {\n \"active\": {},\n \"type\": \"active\",\n },\n \"type\": {\n \"string\": {\n \"analyzerOverride\": undefined,\n \"enableAsciiFolding\": undefined,\n \"isLongText\": false,\n \"supportsEfficientLeadingWildcard\": false,\n \"supportsExactMatching\": true,\n },\n \"type\": \"string\",\n },\n \"typeClasses\": [\n {\n \"kind\": \"render_hint\",\n \"name\": \"SELECTABLE\",\n },\n {\n \"kind\": \"render_hint\",\n \"name\": \"SORTABLE\",\n },\n ],\n \"valueType\": undefined,\n },\n },\n \"redacted\": false,\n \"status\": {\n \"active\": {},\n \"type\": \"active\",\n },\n \"titlePropertyTypeRid\": \"id\",\n },\n },\n },\n \"sharedPropertyTypes\": {},\n }\n `,\n );\n });\n });\n});\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SACEA,wBAAwB,EACxBC,YAAY,EACZC,cAAc,EACdC,wBAAwB,QACnB,aAAa;AACpB,SAASC,UAAU,EAAEC,QAAQ,EAAEC,MAAM,EAAEC,EAAE,QAAQ,QAAQ;AACzD,SAASC,kBAAkB,QAAQ,uBAAuB;AAE1DH,QAAQ,CAAC,yBAAyB,EAAE,MAAM;EACxCD,UAAU,CAAC,YAAY;IACrB,MAAMF,cAAc,CAAC,eAAe,EAAE,MAAM,CAAC,CAAC,EAAE,OAAO,CAAC;EAC1D,CAAC,CAAC;EAEFG,QAAQ,CAAC,SAAS,EAAE,MAAM;IACxBE,EAAE,CAAC,iEAAiE,EAAE,MAAM;MAC1E,MAAME,cAAc,GAAGD,kBAAkB,CAAC;QACxCE,OAAO,EAAE,UAAU;QACnBC,UAAU,EAAE;UACVC,EAAE,EAAE;YAAEC,IAAI,EAAE;UAAS,CAAC;UACtBC,IAAI,EAAE;YAAED,IAAI,EAAE;UAAS;QACzB;MACF,CAAC,CAAC;MACF,MAAME,GAAG,GAAGd,YAAY,CAAC;QACvBS,OAAO,EAAE,KAAK;QACdM,WAAW,EAAE,KAAK;QAClBC,iBAAiB,EAAE,MAAM;QACzBC,oBAAoB,EAAE,IAAI;QAC1BC,yBAAyB,EAAE,IAAI;QAC/BR,UAAU,EAAE;UACV,IAAI,EAAE;YAAEE,IAAI,EAAE;UAAS,CAAC;UACxB,MAAM,EAAE;YAAEA,IAAI,EAAE;UAAO,CAAC;UACxB,MAAM,EAAE;YAAEA,IAAI,EAAE;UAAS;QAC3B;MACF,CAAC,CAAC;MACFb,wBAAwB,CAAC;QACvBoB,UAAU,EAAEL,GAAG;QACfM,iBAAiB,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC;QAChDC,sBAAsB,EAAE;UACtB,KAAK,EAAE;YACLC,mBAAmB,EAAE;cACnBV,IAAI,EAAE,iBAAiB;cACvBW,eAAe,EAAE;gBACfC,YAAY,EAAEhB,cAAc,CAACC;cAC/B;YACF;UACF,CAAC;UACD,MAAM,EAAE;YACNgB,YAAY,EAAE;cACZb,IAAI,EAAE,8BAA8B;cACpCc,4BAA4B,EAAE;gBAC5BC,WAAW,EAAE,KAAK;gBAClBC,cAAc,EAAE;cAClB;YACF;UACF;QACF;MACF,CAAC,CAAC;MACFvB,MAAM,CAACH,wBAAwB,CAAC,CAAC,CAAC2B,QAAQ,CAAC,CAACC,qBAAqB,CAAC;AACxE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,CAAC;MACFzB,MAAM,CAACH,wBAAwB,CAAC,CAAC,CAAC6B,gBAAgB,CAAC,CAACD,qBAAqB,CACvE;AACR;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OACM,CAAC;IACH,CAAC,CAAC;EACJ,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type ObjectType } from "@osdk/maker";
|
|
2
2
|
import type { ImportObjectDefinition } from "./types.js";
|
|
3
|
-
export declare function defineImportObject(objectDef: ImportObjectDefinition):
|
|
3
|
+
export declare function defineImportObject(objectDef: ImportObjectDefinition): ObjectType;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"AAgBA,
|
|
1
|
+
{"mappings":"AAgBA,cAKO,kBAEA,aAAc;AACrB,cAAc,8BAA8B,YAAa;AAOzD,OAAO,iBAAS,mBACdA,WAAW,yBACV","names":["objectDef: ImportObjectDefinition"],"sources":["../../../src/api/importObjectType.ts"],"version":3,"file":"importObjectType.d.ts"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@osdk/maker-experimental",
|
|
3
|
-
"version": "0.3.0
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -28,15 +28,15 @@
|
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"tiny-invariant": "^1.3.3",
|
|
31
|
-
"@osdk/api": "~2.5.0
|
|
31
|
+
"@osdk/api": "~2.5.0"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"typescript": "~5.5.4",
|
|
35
|
-
"vitest": "^3.
|
|
36
|
-
"@osdk/
|
|
37
|
-
"@osdk/monorepo.
|
|
38
|
-
"@osdk/monorepo.
|
|
39
|
-
"@osdk/
|
|
35
|
+
"vitest": "^3.2.4",
|
|
36
|
+
"@osdk/client.unstable": "~2.5.0",
|
|
37
|
+
"@osdk/monorepo.tsconfig": "~0.4.0",
|
|
38
|
+
"@osdk/monorepo.api-extractor": "~0.4.0",
|
|
39
|
+
"@osdk/maker": "~0.13.0"
|
|
40
40
|
},
|
|
41
41
|
"publishConfig": {
|
|
42
42
|
"access": "public"
|