@osdk/maker 0.9.0-beta.4 → 0.9.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.
@@ -1037,5 +1037,95 @@ describe("Ontology Defining", () => {
1037
1037
  }
1038
1038
  `);
1039
1039
  });
1040
+ it("properly serializes both types of struct SPTs", () => {
1041
+ defineSharedPropertyType({
1042
+ apiName: "fooSpt",
1043
+ type: {
1044
+ type: "struct",
1045
+ structDefinition: {
1046
+ "simpleProperty": "boolean",
1047
+ "complexProperty": {
1048
+ fieldType: "date",
1049
+ displayMetadata: {
1050
+ displayName: "complex property",
1051
+ description: undefined
1052
+ }
1053
+ }
1054
+ }
1055
+ }
1056
+ });
1057
+ expect(dumpOntologyFullMetadata()).toMatchInlineSnapshot(`
1058
+ {
1059
+ "blockPermissionInformation": {
1060
+ "actionTypes": {},
1061
+ "linkTypes": {},
1062
+ "objectTypes": {},
1063
+ },
1064
+ "interfaceTypes": {},
1065
+ "sharedPropertyTypes": {
1066
+ "com.palantir.fooSpt": {
1067
+ "sharedPropertyType": {
1068
+ "aliases": [],
1069
+ "apiName": "com.palantir.fooSpt",
1070
+ "baseFormatter": undefined,
1071
+ "dataConstraints": undefined,
1072
+ "displayMetadata": {
1073
+ "description": undefined,
1074
+ "displayName": "fooSpt",
1075
+ "visibility": "NORMAL",
1076
+ },
1077
+ "gothamMapping": undefined,
1078
+ "indexedForSearch": true,
1079
+ "provenance": undefined,
1080
+ "type": {
1081
+ "struct": {
1082
+ "structFields": [
1083
+ {
1084
+ "aliases": [],
1085
+ "apiName": "simpleProperty",
1086
+ "displayMetadata": {
1087
+ "description": undefined,
1088
+ "displayName": "simpleProperty",
1089
+ },
1090
+ "fieldType": {
1091
+ "boolean": {},
1092
+ "type": "boolean",
1093
+ },
1094
+ "typeClasses": [],
1095
+ },
1096
+ {
1097
+ "aliases": [],
1098
+ "apiName": "complexProperty",
1099
+ "displayMetadata": {
1100
+ "description": undefined,
1101
+ "displayName": "complex property",
1102
+ },
1103
+ "fieldType": {
1104
+ "date": {},
1105
+ "type": "date",
1106
+ },
1107
+ "typeClasses": [],
1108
+ },
1109
+ ],
1110
+ },
1111
+ "type": "struct",
1112
+ },
1113
+ "typeClasses": [
1114
+ {
1115
+ "kind": "render_hint",
1116
+ "name": "SELECTABLE",
1117
+ },
1118
+ {
1119
+ "kind": "render_hint",
1120
+ "name": "SORTABLE",
1121
+ },
1122
+ ],
1123
+ "valueType": undefined,
1124
+ },
1125
+ },
1126
+ },
1127
+ }
1128
+ `);
1129
+ });
1040
1130
  });
1041
1131
  //# sourceMappingURL=overall.test.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"overall.test.js","names":["beforeEach","describe","expect","it","defineInterface","defineInterfaceLinkConstraint","defineOntology","dumpOntologyFullMetadata","dumpValueTypeWireType","defineSharedPropertyType","defineValueType","apiName","displayName","typeAndConstraints","baseType","boolean","constraints","constraint","allowedValues","version","toThrowErrorMatchingInlineSnapshot","toMatchInlineSnapshot","result","displayMetadata","toBe","description","properties","foo","type","parentInterface","property1","property2","extends","a","b","not","toBeUndefined","from","toOne","toMany","fooSpt","icon","color","locator"],"sources":["overall.test.js"],"sourcesContent":["/*\n * Copyright 2024 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 */\nimport { beforeEach, describe, expect, it } from \"vitest\";\nimport { defineInterface } from \"./defineInterface.js\";\nimport { defineInterfaceLinkConstraint } from \"./defineInterfaceLinkConstraint.js\";\nimport { defineOntology, dumpOntologyFullMetadata, dumpValueTypeWireType, } from \"./defineOntology.js\";\nimport { defineSharedPropertyType } from \"./defineSpt.js\";\nimport { defineValueType } from \"./defineValueType.js\";\ndescribe(\"Ontology Defining\", () => {\n beforeEach(() => {\n defineOntology(\"com.palantir.\", () => { });\n });\n describe(\"ValueTypes\", () => {\n it(\"Fails to define value type with incorrect semver\", () => {\n expect(() => defineValueType({\n apiName: \"apiName\",\n displayName: \"displayName\",\n typeAndConstraints: {\n baseType: { boolean: {} },\n constraints: [{\n constraint: { boolean: { allowedValues: [\"TRUE_VALUE\"] } },\n }],\n },\n version: \"not a version\",\n })).toThrowErrorMatchingInlineSnapshot(\"[Error: Invariant failed: Version is not a valid semver]\");\n });\n it(\"Correctly serializes a value type\", () => {\n defineValueType({\n apiName: \"apiName\",\n displayName: \"displayName\",\n typeAndConstraints: {\n baseType: { boolean: {} },\n constraints: [{\n constraint: { boolean: { allowedValues: [\"TRUE_VALUE\"] } },\n }],\n },\n version: \"0.1.0\",\n });\n expect(dumpValueTypeWireType()).toMatchInlineSnapshot(`\n {\n \"valueTypes\": [\n {\n \"metadata\": {\n \"apiName\": \"apiName\",\n \"displayMetadata\": {\n \"description\": \"\",\n \"displayName\": \"displayName\",\n },\n \"status\": {\n \"active\": {},\n \"type\": \"active\",\n },\n },\n \"versions\": [\n {\n \"baseType\": {\n \"boolean\": {},\n },\n \"constraints\": [\n {\n \"constraint\": {\n \"boolean\": \"boolean\",\n \"constraint\": {\n \"boolean\": {\n \"allowedValues\": [\n \"TRUE_VALUE\",\n ],\n },\n },\n },\n },\n ],\n \"exampleValues\": [],\n \"version\": \"0.1.0\",\n },\n ],\n },\n ],\n }\n `);\n });\n defineOntology(\"com.palantir.\", () => { });\n });\n describe(\"Interfaces\", () => {\n it(\"doesn't let you define the same interface twice\", () => {\n defineInterface({ apiName: \"Foo\" });\n expect(() => {\n defineInterface({ apiName: \"Foo\" });\n }).toThrowErrorMatchingInlineSnapshot(`[Error: Invariant failed: Interface com.palantir.Foo already exists]`);\n });\n it(\"defaults displayName to apiName\", () => {\n const result = defineInterface({ apiName: \"Foo\" });\n expect(result.displayMetadata.displayName).toBe(\"Foo\");\n });\n it(\"defaults description to displayName\", () => {\n const result = defineInterface({ apiName: \"Foo\", displayName: \"d\" });\n expect(result.displayMetadata.description).toBe(\"d\");\n });\n it(\"defaults description to displayName to apiName\", () => {\n const result = defineInterface({ apiName: \"Foo\" });\n expect(result.displayMetadata.description).toBe(\"Foo\");\n });\n describe(\"auto spts\", () => {\n it(\"auto creates spts\", () => {\n defineInterface({\n apiName: \"Foo\",\n properties: {\n foo: \"string\",\n },\n });\n expect(dumpOntologyFullMetadata()).toMatchInlineSnapshot(`\n {\n \"blockPermissionInformation\": {\n \"actionTypes\": {},\n \"linkTypes\": {},\n \"objectTypes\": {},\n },\n \"interfaceTypes\": {\n \"com.palantir.Foo\": {\n \"interfaceType\": {\n \"allExtendsInterfaces\": [],\n \"allLinks\": [],\n \"allProperties\": [],\n \"apiName\": \"com.palantir.Foo\",\n \"displayMetadata\": {\n \"description\": \"Foo\",\n \"displayName\": \"Foo\",\n \"icon\": undefined,\n },\n \"extendsInterfaces\": [],\n \"links\": [],\n \"properties\": [\n {\n \"aliases\": [],\n \"apiName\": \"com.palantir.foo\",\n \"baseFormatter\": undefined,\n \"dataConstraints\": undefined,\n \"displayMetadata\": {\n \"description\": undefined,\n \"displayName\": \"foo\",\n \"visibility\": \"NORMAL\",\n },\n \"gothamMapping\": undefined,\n \"indexedForSearch\": true,\n \"provenance\": undefined,\n \"type\": {\n \"string\": {\n \"analyzerOverride\": undefined,\n \"enableAsciiFolding\": undefined,\n \"isLongText\": 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 \"status\": {\n \"active\": {},\n \"type\": \"active\",\n },\n },\n },\n },\n \"sharedPropertyTypes\": {\n \"com.palantir.foo\": {\n \"sharedPropertyType\": {\n \"aliases\": [],\n \"apiName\": \"com.palantir.foo\",\n \"baseFormatter\": undefined,\n \"dataConstraints\": undefined,\n \"displayMetadata\": {\n \"description\": undefined,\n \"displayName\": \"foo\",\n \"visibility\": \"NORMAL\",\n },\n \"gothamMapping\": undefined,\n \"indexedForSearch\": true,\n \"provenance\": undefined,\n \"type\": {\n \"string\": {\n \"analyzerOverride\": undefined,\n \"enableAsciiFolding\": undefined,\n \"isLongText\": 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 },\n }\n `);\n });\n it(\"does not let you conflict spts\", () => {\n defineSharedPropertyType({\n apiName: \"foo\",\n type: \"string\",\n });\n expect(dumpOntologyFullMetadata()).toMatchInlineSnapshot(`\n {\n \"blockPermissionInformation\": {\n \"actionTypes\": {},\n \"linkTypes\": {},\n \"objectTypes\": {},\n },\n \"interfaceTypes\": {},\n \"sharedPropertyTypes\": {\n \"com.palantir.foo\": {\n \"sharedPropertyType\": {\n \"aliases\": [],\n \"apiName\": \"com.palantir.foo\",\n \"baseFormatter\": undefined,\n \"dataConstraints\": undefined,\n \"displayMetadata\": {\n \"description\": undefined,\n \"displayName\": \"foo\",\n \"visibility\": \"NORMAL\",\n },\n \"gothamMapping\": undefined,\n \"indexedForSearch\": true,\n \"provenance\": undefined,\n \"type\": {\n \"string\": {\n \"analyzerOverride\": undefined,\n \"enableAsciiFolding\": undefined,\n \"isLongText\": 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 },\n }\n `);\n expect(() => {\n defineInterface({\n apiName: \"Foo\",\n properties: {\n foo: \"string\",\n },\n });\n }).toThrowErrorMatchingInlineSnapshot(`[Error: Invariant failed: Shared property type com.palantir.foo already exists]`);\n });\n });\n it(\"allows extends interfaces with InterfaceType provided\", () => {\n const parentInterface = defineInterface({\n apiName: \"parentInterface\",\n properties: {\n property1: \"string\",\n },\n });\n const childInterface = defineInterface({\n apiName: \"childInterface\",\n properties: {\n property2: \"string\",\n },\n extends: [parentInterface],\n });\n expect(dumpOntologyFullMetadata()).toMatchInlineSnapshot(`\n {\n \"blockPermissionInformation\": {\n \"actionTypes\": {},\n \"linkTypes\": {},\n \"objectTypes\": {},\n },\n \"interfaceTypes\": {\n \"com.palantir.childInterface\": {\n \"interfaceType\": {\n \"allExtendsInterfaces\": [],\n \"allLinks\": [],\n \"allProperties\": [],\n \"apiName\": \"com.palantir.childInterface\",\n \"displayMetadata\": {\n \"description\": \"childInterface\",\n \"displayName\": \"childInterface\",\n \"icon\": undefined,\n },\n \"extendsInterfaces\": [\n \"com.palantir.parentInterface\",\n ],\n \"links\": [],\n \"properties\": [\n {\n \"aliases\": [],\n \"apiName\": \"com.palantir.property2\",\n \"baseFormatter\": undefined,\n \"dataConstraints\": undefined,\n \"displayMetadata\": {\n \"description\": undefined,\n \"displayName\": \"property2\",\n \"visibility\": \"NORMAL\",\n },\n \"gothamMapping\": undefined,\n \"indexedForSearch\": true,\n \"provenance\": undefined,\n \"type\": {\n \"string\": {\n \"analyzerOverride\": undefined,\n \"enableAsciiFolding\": undefined,\n \"isLongText\": 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 \"status\": {\n \"active\": {},\n \"type\": \"active\",\n },\n },\n },\n \"com.palantir.parentInterface\": {\n \"interfaceType\": {\n \"allExtendsInterfaces\": [],\n \"allLinks\": [],\n \"allProperties\": [],\n \"apiName\": \"com.palantir.parentInterface\",\n \"displayMetadata\": {\n \"description\": \"parentInterface\",\n \"displayName\": \"parentInterface\",\n \"icon\": undefined,\n },\n \"extendsInterfaces\": [],\n \"links\": [],\n \"properties\": [\n {\n \"aliases\": [],\n \"apiName\": \"com.palantir.property1\",\n \"baseFormatter\": undefined,\n \"dataConstraints\": undefined,\n \"displayMetadata\": {\n \"description\": undefined,\n \"displayName\": \"property1\",\n \"visibility\": \"NORMAL\",\n },\n \"gothamMapping\": undefined,\n \"indexedForSearch\": true,\n \"provenance\": undefined,\n \"type\": {\n \"string\": {\n \"analyzerOverride\": undefined,\n \"enableAsciiFolding\": undefined,\n \"isLongText\": 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 \"status\": {\n \"active\": {},\n \"type\": \"active\",\n },\n },\n },\n },\n \"sharedPropertyTypes\": {\n \"com.palantir.property1\": {\n \"sharedPropertyType\": {\n \"aliases\": [],\n \"apiName\": \"com.palantir.property1\",\n \"baseFormatter\": undefined,\n \"dataConstraints\": undefined,\n \"displayMetadata\": {\n \"description\": undefined,\n \"displayName\": \"property1\",\n \"visibility\": \"NORMAL\",\n },\n \"gothamMapping\": undefined,\n \"indexedForSearch\": true,\n \"provenance\": undefined,\n \"type\": {\n \"string\": {\n \"analyzerOverride\": undefined,\n \"enableAsciiFolding\": undefined,\n \"isLongText\": 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 \"com.palantir.property2\": {\n \"sharedPropertyType\": {\n \"aliases\": [],\n \"apiName\": \"com.palantir.property2\",\n \"baseFormatter\": undefined,\n \"dataConstraints\": undefined,\n \"displayMetadata\": {\n \"description\": undefined,\n \"displayName\": \"property2\",\n \"visibility\": \"NORMAL\",\n },\n \"gothamMapping\": undefined,\n \"indexedForSearch\": true,\n \"provenance\": undefined,\n \"type\": {\n \"string\": {\n \"analyzerOverride\": undefined,\n \"enableAsciiFolding\": undefined,\n \"isLongText\": 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 },\n }\n `);\n });\n it(\"allows extends interfaces with apiName provided\", () => {\n const parentInterface = defineInterface({\n apiName: \"parentInterface\",\n properties: {\n property1: \"string\",\n },\n });\n const childInterface = defineInterface({\n apiName: \"childInterface\",\n properties: {\n property2: \"string\",\n },\n extends: [\"parentInterface\"],\n });\n expect(dumpOntologyFullMetadata()).toMatchInlineSnapshot(`\n {\n \"blockPermissionInformation\": {\n \"actionTypes\": {},\n \"linkTypes\": {},\n \"objectTypes\": {},\n },\n \"interfaceTypes\": {\n \"com.palantir.childInterface\": {\n \"interfaceType\": {\n \"allExtendsInterfaces\": [],\n \"allLinks\": [],\n \"allProperties\": [],\n \"apiName\": \"com.palantir.childInterface\",\n \"displayMetadata\": {\n \"description\": \"childInterface\",\n \"displayName\": \"childInterface\",\n \"icon\": undefined,\n },\n \"extendsInterfaces\": [\n \"parentInterface\",\n ],\n \"links\": [],\n \"properties\": [\n {\n \"aliases\": [],\n \"apiName\": \"com.palantir.property2\",\n \"baseFormatter\": undefined,\n \"dataConstraints\": undefined,\n \"displayMetadata\": {\n \"description\": undefined,\n \"displayName\": \"property2\",\n \"visibility\": \"NORMAL\",\n },\n \"gothamMapping\": undefined,\n \"indexedForSearch\": true,\n \"provenance\": undefined,\n \"type\": {\n \"string\": {\n \"analyzerOverride\": undefined,\n \"enableAsciiFolding\": undefined,\n \"isLongText\": 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 \"status\": {\n \"active\": {},\n \"type\": \"active\",\n },\n },\n },\n \"com.palantir.parentInterface\": {\n \"interfaceType\": {\n \"allExtendsInterfaces\": [],\n \"allLinks\": [],\n \"allProperties\": [],\n \"apiName\": \"com.palantir.parentInterface\",\n \"displayMetadata\": {\n \"description\": \"parentInterface\",\n \"displayName\": \"parentInterface\",\n \"icon\": undefined,\n },\n \"extendsInterfaces\": [],\n \"links\": [],\n \"properties\": [\n {\n \"aliases\": [],\n \"apiName\": \"com.palantir.property1\",\n \"baseFormatter\": undefined,\n \"dataConstraints\": undefined,\n \"displayMetadata\": {\n \"description\": undefined,\n \"displayName\": \"property1\",\n \"visibility\": \"NORMAL\",\n },\n \"gothamMapping\": undefined,\n \"indexedForSearch\": true,\n \"provenance\": undefined,\n \"type\": {\n \"string\": {\n \"analyzerOverride\": undefined,\n \"enableAsciiFolding\": undefined,\n \"isLongText\": 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 \"status\": {\n \"active\": {},\n \"type\": \"active\",\n },\n },\n },\n },\n \"sharedPropertyTypes\": {\n \"com.palantir.property1\": {\n \"sharedPropertyType\": {\n \"aliases\": [],\n \"apiName\": \"com.palantir.property1\",\n \"baseFormatter\": undefined,\n \"dataConstraints\": undefined,\n \"displayMetadata\": {\n \"description\": undefined,\n \"displayName\": \"property1\",\n \"visibility\": \"NORMAL\",\n },\n \"gothamMapping\": undefined,\n \"indexedForSearch\": true,\n \"provenance\": undefined,\n \"type\": {\n \"string\": {\n \"analyzerOverride\": undefined,\n \"enableAsciiFolding\": undefined,\n \"isLongText\": 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 \"com.palantir.property2\": {\n \"sharedPropertyType\": {\n \"aliases\": [],\n \"apiName\": \"com.palantir.property2\",\n \"baseFormatter\": undefined,\n \"dataConstraints\": undefined,\n \"displayMetadata\": {\n \"description\": undefined,\n \"displayName\": \"property2\",\n \"visibility\": \"NORMAL\",\n },\n \"gothamMapping\": undefined,\n \"indexedForSearch\": true,\n \"provenance\": undefined,\n \"type\": {\n \"string\": {\n \"analyzerOverride\": undefined,\n \"enableAsciiFolding\": undefined,\n \"isLongText\": 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 },\n }\n `);\n });\n });\n describe(\"ILTs\", () => {\n let a;\n let b;\n beforeEach(() => {\n a = defineInterface({ apiName: \"A\" });\n b = defineInterface({ apiName: \"B\" });\n });\n it(\"single link works\", () => {\n expect(a).not.toBeUndefined();\n defineInterfaceLinkConstraint({\n from: a,\n toOne: b,\n apiName: \"singleLink\",\n });\n expect(dumpOntologyFullMetadata()).toMatchInlineSnapshot(`\n {\n \"blockPermissionInformation\": {\n \"actionTypes\": {},\n \"linkTypes\": {},\n \"objectTypes\": {},\n },\n \"interfaceTypes\": {\n \"com.palantir.A\": {\n \"interfaceType\": {\n \"allExtendsInterfaces\": [],\n \"allLinks\": [],\n \"allProperties\": [],\n \"apiName\": \"com.palantir.A\",\n \"displayMetadata\": {\n \"description\": \"A\",\n \"displayName\": \"A\",\n \"icon\": undefined,\n },\n \"extendsInterfaces\": [],\n \"links\": [\n {\n \"cardinality\": \"SINGLE\",\n \"linkedEntityTypeId\": {\n \"interfaceType\": \"com.palantir.B\",\n \"type\": \"interfaceType\",\n },\n \"metadata\": {\n \"apiName\": \"com.palantir.singleLink\",\n \"description\": \"singleLink\",\n \"displayName\": \"singleLink\",\n },\n \"required\": true,\n },\n ],\n \"properties\": [],\n \"status\": {\n \"active\": {},\n \"type\": \"active\",\n },\n },\n },\n \"com.palantir.B\": {\n \"interfaceType\": {\n \"allExtendsInterfaces\": [],\n \"allLinks\": [],\n \"allProperties\": [],\n \"apiName\": \"com.palantir.B\",\n \"displayMetadata\": {\n \"description\": \"B\",\n \"displayName\": \"B\",\n \"icon\": undefined,\n },\n \"extendsInterfaces\": [],\n \"links\": [],\n \"properties\": [],\n \"status\": {\n \"active\": {},\n \"type\": \"active\",\n },\n },\n },\n },\n \"sharedPropertyTypes\": {},\n }\n `);\n });\n it(\"many link works\", () => {\n defineInterfaceLinkConstraint({\n from: a,\n toMany: b,\n apiName: \"manyLink\",\n });\n expect(dumpOntologyFullMetadata()).toMatchInlineSnapshot(`\n {\n \"blockPermissionInformation\": {\n \"actionTypes\": {},\n \"linkTypes\": {},\n \"objectTypes\": {},\n },\n \"interfaceTypes\": {\n \"com.palantir.A\": {\n \"interfaceType\": {\n \"allExtendsInterfaces\": [],\n \"allLinks\": [],\n \"allProperties\": [],\n \"apiName\": \"com.palantir.A\",\n \"displayMetadata\": {\n \"description\": \"A\",\n \"displayName\": \"A\",\n \"icon\": undefined,\n },\n \"extendsInterfaces\": [],\n \"links\": [\n {\n \"cardinality\": \"MANY\",\n \"linkedEntityTypeId\": {\n \"interfaceType\": \"com.palantir.B\",\n \"type\": \"interfaceType\",\n },\n \"metadata\": {\n \"apiName\": \"com.palantir.manyLink\",\n \"description\": \"manyLink\",\n \"displayName\": \"manyLink\",\n },\n \"required\": true,\n },\n ],\n \"properties\": [],\n \"status\": {\n \"active\": {},\n \"type\": \"active\",\n },\n },\n },\n \"com.palantir.B\": {\n \"interfaceType\": {\n \"allExtendsInterfaces\": [],\n \"allLinks\": [],\n \"allProperties\": [],\n \"apiName\": \"com.palantir.B\",\n \"displayMetadata\": {\n \"description\": \"B\",\n \"displayName\": \"B\",\n \"icon\": undefined,\n },\n \"extendsInterfaces\": [],\n \"links\": [],\n \"properties\": [],\n \"status\": {\n \"active\": {},\n \"type\": \"active\",\n },\n },\n },\n },\n \"sharedPropertyTypes\": {},\n }\n `);\n });\n });\n describe(\"SPTs\", () => {\n it(\"doesn't let you create the same spt twice\", () => {\n defineSharedPropertyType({\n apiName: \"foo\",\n type: \"string\",\n });\n expect(() => {\n defineSharedPropertyType({\n apiName: \"foo\",\n type: \"string\",\n });\n }).toThrowErrorMatchingInlineSnapshot(`[Error: Invariant failed: Shared property type com.palantir.foo already exists]`);\n });\n });\n it(\"uses a predefined spt\", () => {\n const fooSpt = defineSharedPropertyType({\n apiName: \"fooSpt\",\n type: \"string\",\n });\n const FooInterface = defineInterface({\n apiName: \"FooInterface\",\n displayName: \"Foo Interface\",\n properties: {\n fooSpt,\n },\n icon: { color: \"#00000\", locator: \"airplane\" },\n });\n expect(dumpOntologyFullMetadata()).toMatchInlineSnapshot(`\n {\n \"blockPermissionInformation\": {\n \"actionTypes\": {},\n \"linkTypes\": {},\n \"objectTypes\": {},\n },\n \"interfaceTypes\": {\n \"com.palantir.FooInterface\": {\n \"interfaceType\": {\n \"allExtendsInterfaces\": [],\n \"allLinks\": [],\n \"allProperties\": [],\n \"apiName\": \"com.palantir.FooInterface\",\n \"displayMetadata\": {\n \"description\": \"Foo Interface\",\n \"displayName\": \"Foo Interface\",\n \"icon\": {\n \"blueprint\": {\n \"color\": \"#00000\",\n \"locator\": \"airplane\",\n },\n \"type\": \"blueprint\",\n },\n },\n \"extendsInterfaces\": [],\n \"links\": [],\n \"properties\": [\n {\n \"aliases\": [],\n \"apiName\": \"com.palantir.fooSpt\",\n \"baseFormatter\": undefined,\n \"dataConstraints\": undefined,\n \"displayMetadata\": {\n \"description\": undefined,\n \"displayName\": \"fooSpt\",\n \"visibility\": \"NORMAL\",\n },\n \"gothamMapping\": undefined,\n \"indexedForSearch\": true,\n \"provenance\": undefined,\n \"type\": {\n \"string\": {\n \"analyzerOverride\": undefined,\n \"enableAsciiFolding\": undefined,\n \"isLongText\": 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 \"status\": {\n \"active\": {},\n \"type\": \"active\",\n },\n },\n },\n },\n \"sharedPropertyTypes\": {\n \"com.palantir.fooSpt\": {\n \"sharedPropertyType\": {\n \"aliases\": [],\n \"apiName\": \"com.palantir.fooSpt\",\n \"baseFormatter\": undefined,\n \"dataConstraints\": undefined,\n \"displayMetadata\": {\n \"description\": undefined,\n \"displayName\": \"fooSpt\",\n \"visibility\": \"NORMAL\",\n },\n \"gothamMapping\": undefined,\n \"indexedForSearch\": true,\n \"provenance\": undefined,\n \"type\": {\n \"string\": {\n \"analyzerOverride\": undefined,\n \"enableAsciiFolding\": undefined,\n \"isLongText\": 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 },\n }\n `);\n });\n});\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,UAAU,EAAEC,QAAQ,EAAEC,MAAM,EAAEC,EAAE,Q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e,CAACE,WAAW,CAAC,CAACD,IAAI,CAAC,KAAK,CAAC;IAC1D,CAAC,CAAC;IACFvB,QAAQ,CAAC,WAAW,EAAE,MAAM;MACxBE,EAAE,CAAC,mBAAmB,EAAE,MAAM;QAC1BC,eAAe,CAAC;UACZO,OAAO,EAAE,KAAK;UACde,UAAU,EAAE;YACRC,GAAG,EAAE;UACT;QACJ,CAAC,CAAC;QACFzB,MAAM,CAACK,wBAAwB,CAAC,CAAC,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,SAAS,CAAC;MACE,CAAC,CAAC;MACFlB,EAAE,CAAC,gCAAgC,EAAE,MAAM;QACvCM,wBAAwB,CAAC;UACrBE,OAAO,EAAE,KAAK;UACdiB,IAAI,EAAE;QACV,CAAC,CAAC;QACF1B,MAAM,CAACK,wBAAwB,CAAC,CAAC,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,SAAS,CAAC;QACMnB,MAAM,CAAC,MAAM;UACTE,eAAe,CAAC;YACZO,OAAO,EAAE,KAAK;YACde,UAAU,EAAE;cACRC,GAAG,EAAE;YACT;UACJ,CAAC,CAAC;QACN,CAAC,CAAC,CAACP,kCAAkC,CAAC,iFAAiF,CAAC;MAC5H,CAAC,CAAC;IACN,CAAC,CAAC;IACFjB,EAAE,CAAC,uDAAuD,EAAE,MAAM;MAC9D,MAAM0B,eAAe,GAAGzB,eAAe,CAAC;QACpCO,OAAO,EAAE,iBAAiB;QAC1Be,UAAU,EAAE;UACRI,SAAS,EAAE;QACf;MACJ,CAAC,CAAC;MACqB1B,eAAe,CAAC;QACnCO,OAAO,EAAE,gBAAgB;QACzBe,UAAU,EAAE;UACRK,SAAS,EAAE;QACf,CAAC;QACDC,OAAO,EAAE,CAACH,eAAe;MAC7B,CAAC,CAAC;MACF3B,MAAM,CAACK,wBAAwB,CAAC,CAAC,CAAC,CAACc,qBAAqB,CAAC;AACrE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;IACA,CAAC,CAAC;IACFlB,EAAE,CAAC,iDAAiD,EAAE,MAAM;MAChCC,eAAe,CAAC;QACpCO,OAAO,EAAE,iBAAiB;QAC1Be,UAAU,EAAE;UACRI,SAAS,EAAE;QACf;MACJ,CAAC,CAAC;MACqB1B,eAAe,CAAC;QACnCO,OAAO,EAAE,gBAAgB;QACzBe,UAAU,EAAE;UACRK,SAAS,EAAE;QACf,CAAC;QACDC,OAAO,EAAE,CAAC,iBAAiB;MAC/B,CAAC,CAAC;MACF9B,MAAM,CAACK,wBAAwB,CAAC,CAAC,CAAC,CAACc,qBAAqB,CAAC;AACrE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;IACA,CAAC,CAAC;EACN,CAAC,CAAC;EACFpB,QAAQ,CAAC,MAAM,EAAE,MAAM;IACnB,IAAIgC,CAAC;IACL,IAAIC,CAAC;IACLlC,UAAU,CAAC,MAAM;MACbiC,CAAC,GAAG7B,eAAe,CAAC;QAAEO,OAAO,EAAE;MAAI,CAAC,CAAC;MACrCuB,CAAC,GAAG9B,eAAe,CAAC;QAAEO,OAAO,EAAE;MAAI,CAAC,CAAC;IACzC,CAAC,CAAC;IACFR,EAAE,CAAC,mBAAmB,EAAE,MAAM;MAC1BD,MAAM,CAAC+B,CAAC,CAAC,CAACE,GAAG,CAACC,aAAa,CAAC,CAAC;MAC7B/B,6BAA6B,CAAC;QAC1BgC,IAAI,EAAEJ,CAAC;QACPK,KAAK,EAAEJ,CAAC;QACRvB,OAAO,EAAE;MACb,CAAC,CAAC;MACFT,MAAM,CAACK,wBAAwB,CAAC,CAAC,CAAC,CAACc,qBAAqB,CAAC;AACrE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;IACA,CAAC,CAAC;IACFlB,EAAE,CAAC,iBAAiB,EAAE,MAAM;MACxBE,6BAA6B,CAAC;QAC1BgC,IAAI,EAAEJ,CAAC;QACPM,MAAM,EAAEL,CAAC;QACTvB,OAAO,EAAE;MACb,CAAC,CAAC;MACFT,MAAM,CAACK,wBAAwB,CAAC,CAAC,CAAC,CAACc,qBAAqB,CAAC;AACrE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;IACA,CAAC,CAAC;EACN,CAAC,CAAC;EACFpB,QAAQ,CAAC,MAAM,EAAE,MAAM;IACnBE,EAAE,CAAC,2CAA2C,EAAE,MAAM;MAClDM,wBAAwB,CAAC;QACrBE,OAAO,EAAE,KAAK;QACdiB,IAAI,EAAE;MACV,CAAC,CAAC;MACF1B,MAAM,CAAC,MAAM;QACTO,wBAAwB,CAAC;UACrBE,OAAO,EAAE,KAAK;UACdiB,IAAI,EAAE;QACV,CAAC,CAAC;MACN,CAAC,CAAC,CAACR,kCAAkC,CAAC,iFAAiF,CAAC;IAC5H,CAAC,CAAC;EACN,CAAC,CAAC;EACFjB,EAAE,CAAC,uBAAuB,EAAE,MAAM;IAC9B,MAAMqC,MAAM,GAAG/B,wBAAwB,CAAC;MACpCE,OAAO,EAAE,QAAQ;MACjBiB,IAAI,EAAE;IACV,CAAC,CAAC;IACmBxB,eAAe,CAAC;MACjCO,OAAO,EAAE,cAAc;MACvBC,WAAW,EAAE,eAAe;MAC5Bc,UAAU,EAAE;QACRc;MACJ,CAAC;MACDC,IAAI,EAAE;QAAEC,KAAK,EAAE,QAAQ;QAAEC,OAAO,EAAE;MAAW;IACjD,CAAC,CAAC;IACFzC,MAAM,CAACK,wBAAwB,CAAC,CAAC,CAAC,CAACc,qBAAqB,CAAC;AACjE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK,CAAC;EACF,CAAC,CAAC;AACN,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"overall.test.js","names":["beforeEach","describe","expect","it","defineInterface","defineInterfaceLinkConstraint","defineOntology","dumpOntologyFullMetadata","dumpValueTypeWireType","defineSharedPropertyType","defineValueType","apiName","displayName","typeAndConstraints","baseType","boolean","constraints","constraint","allowedValues","version","toThrowErrorMatchingInlineSnapshot","toMatchInlineSnapshot","result","displayMetadata","toBe","description","properties","foo","type","parentInterface","property1","property2","extends","a","b","not","toBeUndefined","from","toOne","toMany","fooSpt","icon","color","locator","structDefinition","fieldType","undefined"],"sources":["overall.test.js"],"sourcesContent":["/*\n * Copyright 2024 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 */\nimport { beforeEach, describe, expect, it } from \"vitest\";\nimport { defineInterface } from \"./defineInterface.js\";\nimport { defineInterfaceLinkConstraint } from \"./defineInterfaceLinkConstraint.js\";\nimport { defineOntology, dumpOntologyFullMetadata, dumpValueTypeWireType, } from \"./defineOntology.js\";\nimport { defineSharedPropertyType } from \"./defineSpt.js\";\nimport { defineValueType } from \"./defineValueType.js\";\ndescribe(\"Ontology Defining\", () => {\n beforeEach(() => {\n defineOntology(\"com.palantir.\", () => { });\n });\n describe(\"ValueTypes\", () => {\n it(\"Fails to define value type with incorrect semver\", () => {\n expect(() => defineValueType({\n apiName: \"apiName\",\n displayName: \"displayName\",\n typeAndConstraints: {\n baseType: { boolean: {} },\n constraints: [{\n constraint: { boolean: { allowedValues: [\"TRUE_VALUE\"] } },\n }],\n },\n version: \"not a version\",\n })).toThrowErrorMatchingInlineSnapshot(\"[Error: Invariant failed: Version is not a valid semver]\");\n });\n it(\"Correctly serializes a value type\", () => {\n defineValueType({\n apiName: \"apiName\",\n displayName: \"displayName\",\n typeAndConstraints: {\n baseType: { boolean: {} },\n constraints: [{\n constraint: { boolean: { allowedValues: [\"TRUE_VALUE\"] } },\n }],\n },\n version: \"0.1.0\",\n });\n expect(dumpValueTypeWireType()).toMatchInlineSnapshot(`\n {\n \"valueTypes\": [\n {\n \"metadata\": {\n \"apiName\": \"apiName\",\n \"displayMetadata\": {\n \"description\": \"\",\n \"displayName\": \"displayName\",\n },\n \"status\": {\n \"active\": {},\n \"type\": \"active\",\n },\n },\n \"versions\": [\n {\n \"baseType\": {\n \"boolean\": {},\n },\n \"constraints\": [\n {\n \"constraint\": {\n \"boolean\": \"boolean\",\n \"constraint\": {\n \"boolean\": {\n \"allowedValues\": [\n \"TRUE_VALUE\",\n ],\n },\n },\n },\n },\n ],\n \"exampleValues\": [],\n \"version\": \"0.1.0\",\n },\n ],\n },\n ],\n }\n `);\n });\n defineOntology(\"com.palantir.\", () => { });\n });\n describe(\"Interfaces\", () => {\n it(\"doesn't let you define the same interface twice\", () => {\n defineInterface({ apiName: \"Foo\" });\n expect(() => {\n defineInterface({ apiName: \"Foo\" });\n }).toThrowErrorMatchingInlineSnapshot(`[Error: Invariant failed: Interface com.palantir.Foo already exists]`);\n });\n it(\"defaults displayName to apiName\", () => {\n const result = defineInterface({ apiName: \"Foo\" });\n expect(result.displayMetadata.displayName).toBe(\"Foo\");\n });\n it(\"defaults description to displayName\", () => {\n const result = defineInterface({ apiName: \"Foo\", displayName: \"d\" });\n expect(result.displayMetadata.description).toBe(\"d\");\n });\n it(\"defaults description to displayName to apiName\", () => {\n const result = defineInterface({ apiName: \"Foo\" });\n expect(result.displayMetadata.description).toBe(\"Foo\");\n });\n describe(\"auto spts\", () => {\n it(\"auto creates spts\", () => {\n defineInterface({\n apiName: \"Foo\",\n properties: {\n foo: \"string\",\n },\n });\n expect(dumpOntologyFullMetadata()).toMatchInlineSnapshot(`\n {\n \"blockPermissionInformation\": {\n \"actionTypes\": {},\n \"linkTypes\": {},\n \"objectTypes\": {},\n },\n \"interfaceTypes\": {\n \"com.palantir.Foo\": {\n \"interfaceType\": {\n \"allExtendsInterfaces\": [],\n \"allLinks\": [],\n \"allProperties\": [],\n \"apiName\": \"com.palantir.Foo\",\n \"displayMetadata\": {\n \"description\": \"Foo\",\n \"displayName\": \"Foo\",\n \"icon\": undefined,\n },\n \"extendsInterfaces\": [],\n \"links\": [],\n \"properties\": [\n {\n \"aliases\": [],\n \"apiName\": \"com.palantir.foo\",\n \"baseFormatter\": undefined,\n \"dataConstraints\": undefined,\n \"displayMetadata\": {\n \"description\": undefined,\n \"displayName\": \"foo\",\n \"visibility\": \"NORMAL\",\n },\n \"gothamMapping\": undefined,\n \"indexedForSearch\": true,\n \"provenance\": undefined,\n \"type\": {\n \"string\": {\n \"analyzerOverride\": undefined,\n \"enableAsciiFolding\": undefined,\n \"isLongText\": 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 \"status\": {\n \"active\": {},\n \"type\": \"active\",\n },\n },\n },\n },\n \"sharedPropertyTypes\": {\n \"com.palantir.foo\": {\n \"sharedPropertyType\": {\n \"aliases\": [],\n \"apiName\": \"com.palantir.foo\",\n \"baseFormatter\": undefined,\n \"dataConstraints\": undefined,\n \"displayMetadata\": {\n \"description\": undefined,\n \"displayName\": \"foo\",\n \"visibility\": \"NORMAL\",\n },\n \"gothamMapping\": undefined,\n \"indexedForSearch\": true,\n \"provenance\": undefined,\n \"type\": {\n \"string\": {\n \"analyzerOverride\": undefined,\n \"enableAsciiFolding\": undefined,\n \"isLongText\": 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 },\n }\n `);\n });\n it(\"does not let you conflict spts\", () => {\n defineSharedPropertyType({\n apiName: \"foo\",\n type: \"string\",\n });\n expect(dumpOntologyFullMetadata()).toMatchInlineSnapshot(`\n {\n \"blockPermissionInformation\": {\n \"actionTypes\": {},\n \"linkTypes\": {},\n \"objectTypes\": {},\n },\n \"interfaceTypes\": {},\n \"sharedPropertyTypes\": {\n \"com.palantir.foo\": {\n \"sharedPropertyType\": {\n \"aliases\": [],\n \"apiName\": \"com.palantir.foo\",\n \"baseFormatter\": undefined,\n \"dataConstraints\": undefined,\n \"displayMetadata\": {\n \"description\": undefined,\n \"displayName\": \"foo\",\n \"visibility\": \"NORMAL\",\n },\n \"gothamMapping\": undefined,\n \"indexedForSearch\": true,\n \"provenance\": undefined,\n \"type\": {\n \"string\": {\n \"analyzerOverride\": undefined,\n \"enableAsciiFolding\": undefined,\n \"isLongText\": 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 },\n }\n `);\n expect(() => {\n defineInterface({\n apiName: \"Foo\",\n properties: {\n foo: \"string\",\n },\n });\n }).toThrowErrorMatchingInlineSnapshot(`[Error: Invariant failed: Shared property type com.palantir.foo already exists]`);\n });\n });\n it(\"allows extends interfaces with InterfaceType provided\", () => {\n const parentInterface = defineInterface({\n apiName: \"parentInterface\",\n properties: {\n property1: \"string\",\n },\n });\n const childInterface = defineInterface({\n apiName: \"childInterface\",\n properties: {\n property2: \"string\",\n },\n extends: [parentInterface],\n });\n expect(dumpOntologyFullMetadata()).toMatchInlineSnapshot(`\n {\n \"blockPermissionInformation\": {\n \"actionTypes\": {},\n \"linkTypes\": {},\n \"objectTypes\": {},\n },\n \"interfaceTypes\": {\n \"com.palantir.childInterface\": {\n \"interfaceType\": {\n \"allExtendsInterfaces\": [],\n \"allLinks\": [],\n \"allProperties\": [],\n \"apiName\": \"com.palantir.childInterface\",\n \"displayMetadata\": {\n \"description\": \"childInterface\",\n \"displayName\": \"childInterface\",\n \"icon\": undefined,\n },\n \"extendsInterfaces\": [\n \"com.palantir.parentInterface\",\n ],\n \"links\": [],\n \"properties\": [\n {\n \"aliases\": [],\n \"apiName\": \"com.palantir.property2\",\n \"baseFormatter\": undefined,\n \"dataConstraints\": undefined,\n \"displayMetadata\": {\n \"description\": undefined,\n \"displayName\": \"property2\",\n \"visibility\": \"NORMAL\",\n },\n \"gothamMapping\": undefined,\n \"indexedForSearch\": true,\n \"provenance\": undefined,\n \"type\": {\n \"string\": {\n \"analyzerOverride\": undefined,\n \"enableAsciiFolding\": undefined,\n \"isLongText\": 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 \"status\": {\n \"active\": {},\n \"type\": \"active\",\n },\n },\n },\n \"com.palantir.parentInterface\": {\n \"interfaceType\": {\n \"allExtendsInterfaces\": [],\n \"allLinks\": [],\n \"allProperties\": [],\n \"apiName\": \"com.palantir.parentInterface\",\n \"displayMetadata\": {\n \"description\": \"parentInterface\",\n \"displayName\": \"parentInterface\",\n \"icon\": undefined,\n },\n \"extendsInterfaces\": [],\n \"links\": [],\n \"properties\": [\n {\n \"aliases\": [],\n \"apiName\": \"com.palantir.property1\",\n \"baseFormatter\": undefined,\n \"dataConstraints\": undefined,\n \"displayMetadata\": {\n \"description\": undefined,\n \"displayName\": \"property1\",\n \"visibility\": \"NORMAL\",\n },\n \"gothamMapping\": undefined,\n \"indexedForSearch\": true,\n \"provenance\": undefined,\n \"type\": {\n \"string\": {\n \"analyzerOverride\": undefined,\n \"enableAsciiFolding\": undefined,\n \"isLongText\": 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 \"status\": {\n \"active\": {},\n \"type\": \"active\",\n },\n },\n },\n },\n \"sharedPropertyTypes\": {\n \"com.palantir.property1\": {\n \"sharedPropertyType\": {\n \"aliases\": [],\n \"apiName\": \"com.palantir.property1\",\n \"baseFormatter\": undefined,\n \"dataConstraints\": undefined,\n \"displayMetadata\": {\n \"description\": undefined,\n \"displayName\": \"property1\",\n \"visibility\": \"NORMAL\",\n },\n \"gothamMapping\": undefined,\n \"indexedForSearch\": true,\n \"provenance\": undefined,\n \"type\": {\n \"string\": {\n \"analyzerOverride\": undefined,\n \"enableAsciiFolding\": undefined,\n \"isLongText\": 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 \"com.palantir.property2\": {\n \"sharedPropertyType\": {\n \"aliases\": [],\n \"apiName\": \"com.palantir.property2\",\n \"baseFormatter\": undefined,\n \"dataConstraints\": undefined,\n \"displayMetadata\": {\n \"description\": undefined,\n \"displayName\": \"property2\",\n \"visibility\": \"NORMAL\",\n },\n \"gothamMapping\": undefined,\n \"indexedForSearch\": true,\n \"provenance\": undefined,\n \"type\": {\n \"string\": {\n \"analyzerOverride\": undefined,\n \"enableAsciiFolding\": undefined,\n \"isLongText\": 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 },\n }\n `);\n });\n it(\"allows extends interfaces with apiName provided\", () => {\n const parentInterface = defineInterface({\n apiName: \"parentInterface\",\n properties: {\n property1: \"string\",\n },\n });\n const childInterface = defineInterface({\n apiName: \"childInterface\",\n properties: {\n property2: \"string\",\n },\n extends: [\"parentInterface\"],\n });\n expect(dumpOntologyFullMetadata()).toMatchInlineSnapshot(`\n {\n \"blockPermissionInformation\": {\n \"actionTypes\": {},\n \"linkTypes\": {},\n \"objectTypes\": {},\n },\n \"interfaceTypes\": {\n \"com.palantir.childInterface\": {\n \"interfaceType\": {\n \"allExtendsInterfaces\": [],\n \"allLinks\": [],\n \"allProperties\": [],\n \"apiName\": \"com.palantir.childInterface\",\n \"displayMetadata\": {\n \"description\": \"childInterface\",\n \"displayName\": \"childInterface\",\n \"icon\": undefined,\n },\n \"extendsInterfaces\": [\n \"parentInterface\",\n ],\n \"links\": [],\n \"properties\": [\n {\n \"aliases\": [],\n \"apiName\": \"com.palantir.property2\",\n \"baseFormatter\": undefined,\n \"dataConstraints\": undefined,\n \"displayMetadata\": {\n \"description\": undefined,\n \"displayName\": \"property2\",\n \"visibility\": \"NORMAL\",\n },\n \"gothamMapping\": undefined,\n \"indexedForSearch\": true,\n \"provenance\": undefined,\n \"type\": {\n \"string\": {\n \"analyzerOverride\": undefined,\n \"enableAsciiFolding\": undefined,\n \"isLongText\": 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 \"status\": {\n \"active\": {},\n \"type\": \"active\",\n },\n },\n },\n \"com.palantir.parentInterface\": {\n \"interfaceType\": {\n \"allExtendsInterfaces\": [],\n \"allLinks\": [],\n \"allProperties\": [],\n \"apiName\": \"com.palantir.parentInterface\",\n \"displayMetadata\": {\n \"description\": \"parentInterface\",\n \"displayName\": \"parentInterface\",\n \"icon\": undefined,\n },\n \"extendsInterfaces\": [],\n \"links\": [],\n \"properties\": [\n {\n \"aliases\": [],\n \"apiName\": \"com.palantir.property1\",\n \"baseFormatter\": undefined,\n \"dataConstraints\": undefined,\n \"displayMetadata\": {\n \"description\": undefined,\n \"displayName\": \"property1\",\n \"visibility\": \"NORMAL\",\n },\n \"gothamMapping\": undefined,\n \"indexedForSearch\": true,\n \"provenance\": undefined,\n \"type\": {\n \"string\": {\n \"analyzerOverride\": undefined,\n \"enableAsciiFolding\": undefined,\n \"isLongText\": 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 \"status\": {\n \"active\": {},\n \"type\": \"active\",\n },\n },\n },\n },\n \"sharedPropertyTypes\": {\n \"com.palantir.property1\": {\n \"sharedPropertyType\": {\n \"aliases\": [],\n \"apiName\": \"com.palantir.property1\",\n \"baseFormatter\": undefined,\n \"dataConstraints\": undefined,\n \"displayMetadata\": {\n \"description\": undefined,\n \"displayName\": \"property1\",\n \"visibility\": \"NORMAL\",\n },\n \"gothamMapping\": undefined,\n \"indexedForSearch\": true,\n \"provenance\": undefined,\n \"type\": {\n \"string\": {\n \"analyzerOverride\": undefined,\n \"enableAsciiFolding\": undefined,\n \"isLongText\": 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 \"com.palantir.property2\": {\n \"sharedPropertyType\": {\n \"aliases\": [],\n \"apiName\": \"com.palantir.property2\",\n \"baseFormatter\": undefined,\n \"dataConstraints\": undefined,\n \"displayMetadata\": {\n \"description\": undefined,\n \"displayName\": \"property2\",\n \"visibility\": \"NORMAL\",\n },\n \"gothamMapping\": undefined,\n \"indexedForSearch\": true,\n \"provenance\": undefined,\n \"type\": {\n \"string\": {\n \"analyzerOverride\": undefined,\n \"enableAsciiFolding\": undefined,\n \"isLongText\": 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 },\n }\n `);\n });\n });\n describe(\"ILTs\", () => {\n let a;\n let b;\n beforeEach(() => {\n a = defineInterface({ apiName: \"A\" });\n b = defineInterface({ apiName: \"B\" });\n });\n it(\"single link works\", () => {\n expect(a).not.toBeUndefined();\n defineInterfaceLinkConstraint({\n from: a,\n toOne: b,\n apiName: \"singleLink\",\n });\n expect(dumpOntologyFullMetadata()).toMatchInlineSnapshot(`\n {\n \"blockPermissionInformation\": {\n \"actionTypes\": {},\n \"linkTypes\": {},\n \"objectTypes\": {},\n },\n \"interfaceTypes\": {\n \"com.palantir.A\": {\n \"interfaceType\": {\n \"allExtendsInterfaces\": [],\n \"allLinks\": [],\n \"allProperties\": [],\n \"apiName\": \"com.palantir.A\",\n \"displayMetadata\": {\n \"description\": \"A\",\n \"displayName\": \"A\",\n \"icon\": undefined,\n },\n \"extendsInterfaces\": [],\n \"links\": [\n {\n \"cardinality\": \"SINGLE\",\n \"linkedEntityTypeId\": {\n \"interfaceType\": \"com.palantir.B\",\n \"type\": \"interfaceType\",\n },\n \"metadata\": {\n \"apiName\": \"com.palantir.singleLink\",\n \"description\": \"singleLink\",\n \"displayName\": \"singleLink\",\n },\n \"required\": true,\n },\n ],\n \"properties\": [],\n \"status\": {\n \"active\": {},\n \"type\": \"active\",\n },\n },\n },\n \"com.palantir.B\": {\n \"interfaceType\": {\n \"allExtendsInterfaces\": [],\n \"allLinks\": [],\n \"allProperties\": [],\n \"apiName\": \"com.palantir.B\",\n \"displayMetadata\": {\n \"description\": \"B\",\n \"displayName\": \"B\",\n \"icon\": undefined,\n },\n \"extendsInterfaces\": [],\n \"links\": [],\n \"properties\": [],\n \"status\": {\n \"active\": {},\n \"type\": \"active\",\n },\n },\n },\n },\n \"sharedPropertyTypes\": {},\n }\n `);\n });\n it(\"many link works\", () => {\n defineInterfaceLinkConstraint({\n from: a,\n toMany: b,\n apiName: \"manyLink\",\n });\n expect(dumpOntologyFullMetadata()).toMatchInlineSnapshot(`\n {\n \"blockPermissionInformation\": {\n \"actionTypes\": {},\n \"linkTypes\": {},\n \"objectTypes\": {},\n },\n \"interfaceTypes\": {\n \"com.palantir.A\": {\n \"interfaceType\": {\n \"allExtendsInterfaces\": [],\n \"allLinks\": [],\n \"allProperties\": [],\n \"apiName\": \"com.palantir.A\",\n \"displayMetadata\": {\n \"description\": \"A\",\n \"displayName\": \"A\",\n \"icon\": undefined,\n },\n \"extendsInterfaces\": [],\n \"links\": [\n {\n \"cardinality\": \"MANY\",\n \"linkedEntityTypeId\": {\n \"interfaceType\": \"com.palantir.B\",\n \"type\": \"interfaceType\",\n },\n \"metadata\": {\n \"apiName\": \"com.palantir.manyLink\",\n \"description\": \"manyLink\",\n \"displayName\": \"manyLink\",\n },\n \"required\": true,\n },\n ],\n \"properties\": [],\n \"status\": {\n \"active\": {},\n \"type\": \"active\",\n },\n },\n },\n \"com.palantir.B\": {\n \"interfaceType\": {\n \"allExtendsInterfaces\": [],\n \"allLinks\": [],\n \"allProperties\": [],\n \"apiName\": \"com.palantir.B\",\n \"displayMetadata\": {\n \"description\": \"B\",\n \"displayName\": \"B\",\n \"icon\": undefined,\n },\n \"extendsInterfaces\": [],\n \"links\": [],\n \"properties\": [],\n \"status\": {\n \"active\": {},\n \"type\": \"active\",\n },\n },\n },\n },\n \"sharedPropertyTypes\": {},\n }\n `);\n });\n });\n describe(\"SPTs\", () => {\n it(\"doesn't let you create the same spt twice\", () => {\n defineSharedPropertyType({\n apiName: \"foo\",\n type: \"string\",\n });\n expect(() => {\n defineSharedPropertyType({\n apiName: \"foo\",\n type: \"string\",\n });\n }).toThrowErrorMatchingInlineSnapshot(`[Error: Invariant failed: Shared property type com.palantir.foo already exists]`);\n });\n });\n it(\"uses a predefined spt\", () => {\n const fooSpt = defineSharedPropertyType({\n apiName: \"fooSpt\",\n type: \"string\",\n });\n const FooInterface = defineInterface({\n apiName: \"FooInterface\",\n displayName: \"Foo Interface\",\n properties: {\n fooSpt,\n },\n icon: { color: \"#00000\", locator: \"airplane\" },\n });\n expect(dumpOntologyFullMetadata()).toMatchInlineSnapshot(`\n {\n \"blockPermissionInformation\": {\n \"actionTypes\": {},\n \"linkTypes\": {},\n \"objectTypes\": {},\n },\n \"interfaceTypes\": {\n \"com.palantir.FooInterface\": {\n \"interfaceType\": {\n \"allExtendsInterfaces\": [],\n \"allLinks\": [],\n \"allProperties\": [],\n \"apiName\": \"com.palantir.FooInterface\",\n \"displayMetadata\": {\n \"description\": \"Foo Interface\",\n \"displayName\": \"Foo Interface\",\n \"icon\": {\n \"blueprint\": {\n \"color\": \"#00000\",\n \"locator\": \"airplane\",\n },\n \"type\": \"blueprint\",\n },\n },\n \"extendsInterfaces\": [],\n \"links\": [],\n \"properties\": [\n {\n \"aliases\": [],\n \"apiName\": \"com.palantir.fooSpt\",\n \"baseFormatter\": undefined,\n \"dataConstraints\": undefined,\n \"displayMetadata\": {\n \"description\": undefined,\n \"displayName\": \"fooSpt\",\n \"visibility\": \"NORMAL\",\n },\n \"gothamMapping\": undefined,\n \"indexedForSearch\": true,\n \"provenance\": undefined,\n \"type\": {\n \"string\": {\n \"analyzerOverride\": undefined,\n \"enableAsciiFolding\": undefined,\n \"isLongText\": 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 \"status\": {\n \"active\": {},\n \"type\": \"active\",\n },\n },\n },\n },\n \"sharedPropertyTypes\": {\n \"com.palantir.fooSpt\": {\n \"sharedPropertyType\": {\n \"aliases\": [],\n \"apiName\": \"com.palantir.fooSpt\",\n \"baseFormatter\": undefined,\n \"dataConstraints\": undefined,\n \"displayMetadata\": {\n \"description\": undefined,\n \"displayName\": \"fooSpt\",\n \"visibility\": \"NORMAL\",\n },\n \"gothamMapping\": undefined,\n \"indexedForSearch\": true,\n \"provenance\": undefined,\n \"type\": {\n \"string\": {\n \"analyzerOverride\": undefined,\n \"enableAsciiFolding\": undefined,\n \"isLongText\": 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 },\n }\n `);\n });\n it(\"properly serializes both types of struct SPTs\", () => {\n const fooSpt = defineSharedPropertyType({\n apiName: \"fooSpt\",\n type: {\n type: \"struct\",\n structDefinition: {\n \"simpleProperty\": \"boolean\",\n \"complexProperty\": {\n fieldType: \"date\",\n displayMetadata: {\n displayName: \"complex property\",\n description: undefined,\n },\n },\n },\n },\n });\n expect(dumpOntologyFullMetadata()).toMatchInlineSnapshot(`\n {\n \"blockPermissionInformation\": {\n \"actionTypes\": {},\n \"linkTypes\": {},\n \"objectTypes\": {},\n },\n \"interfaceTypes\": {},\n \"sharedPropertyTypes\": {\n \"com.palantir.fooSpt\": {\n \"sharedPropertyType\": {\n \"aliases\": [],\n \"apiName\": \"com.palantir.fooSpt\",\n \"baseFormatter\": undefined,\n \"dataConstraints\": undefined,\n \"displayMetadata\": {\n \"description\": undefined,\n \"displayName\": \"fooSpt\",\n \"visibility\": \"NORMAL\",\n },\n \"gothamMapping\": undefined,\n \"indexedForSearch\": true,\n \"provenance\": undefined,\n \"type\": {\n \"struct\": {\n \"structFields\": [\n {\n \"aliases\": [],\n \"apiName\": \"simpleProperty\",\n \"displayMetadata\": {\n \"description\": undefined,\n \"displayName\": \"simpleProperty\",\n },\n \"fieldType\": {\n \"boolean\": {},\n \"type\": \"boolean\",\n },\n \"typeClasses\": [],\n },\n {\n \"aliases\": [],\n \"apiName\": \"complexProperty\",\n \"displayMetadata\": {\n \"description\": undefined,\n \"displayName\": \"complex property\",\n },\n \"fieldType\": {\n \"date\": {},\n \"type\": \"date\",\n },\n \"typeClasses\": [],\n },\n ],\n },\n \"type\": \"struct\",\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 },\n }\n `);\n });\n});\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,UAAU,EAAEC,QAAQ,EAAEC,MAAM,EAAEC,EAAE,QAAQ,QAAQ;AACzD,SAASC,eAAe,QAAQ,sBAAsB;AACtD,SAASC,6BAA6B,QAAQ,oCAAoC;AAClF,SAASC,cAAc,EAAEC,wBAAwB,EAAEC,qBAAqB,QAAS,qBAAqB;AACtG,SAASC,wBAAwB,QAAQ,gBAAgB;AACzD,SAASC,eAAe,QAAQ,sBAAsB;AACtDT,QAAQ,CAAC,mBAAmB,EAAE,MAAM;EAChCD,UAAU,CAAC,MAAM;IACbM,cAAc,CAAC,eAAe,EAAE,MAAM,CAAE,CAAC,CAAC;EAC9C,CAAC,CAAC;EACFL,QAAQ,CAAC,YAAY,EAAE,MAAM;IACzBE,EAAE,CAAC,kDAAkD,EAAE,MAAM;MACzDD,MAAM,CAAC,MAAMQ,eAAe,CAAC;QACzBC,OAAO,EAAE,SAAS;QAClBC,WAAW,EAAE,aAAa;QAC1BC,kBAAkB,EAAE;UAChBC,QAAQ,EAAE;YAAEC,OAAO,EAAE,CAAC;UAAE,CAAC;UACzBC,WAAW,EAAE,CAAC;YACNC,UAAU,EAAE;cAAEF,OAAO,EAAE;gBAAEG,aAAa,EAAE,CAAC,YAAY;cAAE;YAAE;UAC7D,CAAC;QACT,CAAC;QACDC,OAAO,EAAE;MACb,CAAC,CAAC,CAAC,CAACC,kCAAkC,CAAC,0DAA0D,CAAC;IACtG,CAAC,CAAC;IACFjB,EAAE,CAAC,mCAAmC,EAAE,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MAAM;MAC5C,MAAMmB,MAAM,GAAGlB,eAAe,CAAC;QAAEO,OAAO,EAAE,KAAK;QAAEC,WAAW,EAAE;MAAI,CAAC,CAAC;MACpEV,MAAM,CAACoB,MAAM,CAACC,eAAe,CAACE,WAAW,CAAC,CAACD,IAAI,CAAC,GAAG,CAAC;IACxD,CAAC,CAAC;IACFrB,EAAE,CAAC,gDAAgD,EAAE,MAAM;MACvD,MAAMmB,MAAM,GAAGlB,eAAe,CAAC;QAAEO,OAAO,EAAE;MAAM,CAAC,CAAC;MAClDT,MAAM,CAACoB,MAAM,CAACC,eAAe,CAACE,WAAW,CAAC,CAACD,IAAI,CAAC,KAAK,CAAC;IAC1D,CAAC,CAAC;IACFvB,QAAQ,CAAC,WAAW,EAAE,MAAM;MACxBE,EAAE,CAAC,mBAAmB,EAAE,MAAM;QAC1BC,eAAe,CAAC;UACZO,OAAO,EAAE,KAAK;UACde,UAAU,EAAE;YACRC,GAAG,EAAE;UACT;QACJ,CAAC,CAAC;QACFzB,MAAM,CAACK,wBAAwB,CAAC,CAAC,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,SAAS,CAAC;MACE,CAAC,CAAC;MACFlB,EAAE,CAAC,gCAAgC,EAAE,MAAM;QACvCM,wBAAwB,CAAC;UACrBE,OAAO,EAAE,KAAK;UACdiB,IAAI,EAAE;QACV,CAAC,CAAC;QACF1B,MAAM,CAACK,wBAAwB,CAAC,CAAC,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,SAAS,CAAC;QACMnB,MAAM,CAAC,MAAM;UACTE,eAAe,CAAC;YACZO,OAAO,EAAE,KAAK;YACde,UAAU,EAAE;cACRC,GAAG,EAAE;YACT;UACJ,CAAC,CAAC;QACN,CAAC,CAAC,CAACP,kCAAkC,CAAC,iFAAiF,CAAC;MAC5H,CAAC,CAAC;IACN,CAAC,CAAC;IACFjB,EAAE,CAAC,uDAAuD,EAAE,MAAM;MAC9D,MAAM0B,eAAe,GAAGzB,eAAe,CAAC;QACpCO,OAAO,EAAE,iBAAiB;QAC1Be,UAAU,EAAE;UACRI,SAAS,EAAE;QACf;MACJ,CAAC,CAAC;MACqB1B,eAAe,CAAC;QACnCO,OAAO,EAAE,gBAAgB;QACzBe,UAAU,EAAE;UACRK,SAAS,EAAE;QACf,CAAC;QACDC,OAAO,EAAE,CAACH,eAAe;MAC7B,CAAC,CAAC;MACF3B,MAAM,CAACK,wBAAwB,CAAC,CAAC,CAAC,CAACc,qBAAqB,CAAC;AACrE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;IACA,CAAC,CAAC;IACFlB,EAAE,CAAC,iDAAiD,EAAE,MAAM;MAChCC,eAAe,CAAC;QACpCO,OAAO,EAAE,iBAAiB;QAC1Be,UAAU,EAAE;UACRI,SAAS,EAAE;QACf;MACJ,CAAC,CAAC;MACqB1B,eAAe,CAAC;QACnCO,OAAO,EAAE,gBAAgB;QACzBe,UAAU,EAAE;UACRK,SAAS,EAAE;QACf,CAAC;QACDC,OAAO,EAAE,CAAC,iBAAiB;MAC/B,CAAC,CAAC;MACF9B,MAAM,CAACK,wBAAwB,CAAC,CAAC,CAAC,CAACc,qBAAqB,CAAC;AACrE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;IACA,CAAC,CAAC;EACN,CAAC,CAAC;EACFpB,QAAQ,CAAC,MAAM,EAAE,MAAM;IACnB,IAAIgC,CAAC;IACL,IAAIC,CAAC;IACLlC,UAAU,CAAC,MAAM;MACbiC,CAAC,GAAG7B,eAAe,CAAC;QAAEO,OAAO,EAAE;MAAI,CAAC,CAAC;MACrCuB,CAAC,GAAG9B,eAAe,CAAC;QAAEO,OAAO,EAAE;MAAI,CAAC,CAAC;IACzC,CAAC,CAAC;IACFR,EAAE,CAAC,mBAAmB,EAAE,MAAM;MAC1BD,MAAM,CAAC+B,CAAC,CAAC,CAACE,GAAG,CAACC,aAAa,CAAC,CAAC;MAC7B/B,6BAA6B,CAAC;QAC1BgC,IAAI,EAAEJ,CAAC;QACPK,KAAK,EAAEJ,CAAC;QACRvB,OAAO,EAAE;MACb,CAAC,CAAC;MACFT,MAAM,CAACK,wBAAwB,CAAC,CAAC,CAAC,CAACc,qBAAqB,CAAC;AACrE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;IACA,CAAC,CAAC;IACFlB,EAAE,CAAC,iBAAiB,EAAE,MAAM;MACxBE,6BAA6B,CAAC;QAC1BgC,IAAI,EAAEJ,CAAC;QACPM,MAAM,EAAEL,CAAC;QACTvB,OAAO,EAAE;MACb,CAAC,CAAC;MACFT,MAAM,CAACK,wBAAwB,CAAC,CAAC,CAAC,CAACc,qBAAqB,CAAC;AACrE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;IACA,CAAC,CAAC;EACN,CAAC,CAAC;EACFpB,QAAQ,CAAC,MAAM,EAAE,MAAM;IACnBE,EAAE,CAAC,2CAA2C,EAAE,MAAM;MAClDM,wBAAwB,CAAC;QACrBE,OAAO,EAAE,KAAK;QACdiB,IAAI,EAAE;MACV,CAAC,CAAC;MACF1B,MAAM,CAAC,MAAM;QACTO,wBAAwB,CAAC;UACrBE,OAAO,EAAE,KAAK;UACdiB,IAAI,EAAE;QACV,CAAC,CAAC;MACN,CAAC,CAAC,CAACR,kCAAkC,CAAC,iFAAiF,CAAC;IAC5H,CAAC,CAAC;EACN,CAAC,CAAC;EACFjB,EAAE,CAAC,uBAAuB,EAAE,MAAM;IAC9B,MAAMqC,MAAM,GAAG/B,wBAAwB,CAAC;MACpCE,OAAO,EAAE,QAAQ;MACjBiB,IAAI,EAAE;IACV,CAAC,CAAC;IACmBxB,eAAe,CAAC;MACjCO,OAAO,EAAE,cAAc;MACvBC,WAAW,EAAE,eAAe;MAC5Bc,UAAU,EAAE;QACRc;MACJ,CAAC;MACDC,IAAI,EAAE;QAAEC,KAAK,EAAE,QAAQ;QAAEC,OAAO,EAAE;MAAW;IACjD,CAAC,CAAC;IACFzC,MAAM,CAACK,wBAAwB,CAAC,CAAC,CAAC,CAACc,qBAAqB,CAAC;AACjE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK,CAAC;EACF,CAAC,CAAC;EACFlB,EAAE,CAAC,+CAA+C,EAAE,MAAM;IACvCM,wBAAwB,CAAC;MACpCE,OAAO,EAAE,QAAQ;MACjBiB,IAAI,EAAE;QACFA,IAAI,EAAE,QAAQ;QACdgB,gBAAgB,EAAE;UACd,gBAAgB,EAAE,SAAS;UAC3B,iBAAiB,EAAE;YACfC,SAAS,EAAE,MAAM;YACjBtB,eAAe,EAAE;cACbX,WAAW,EAAE,kBAAkB;cAC/Ba,WAAW,EAAEqB;YACjB;UACJ;QACJ;MACJ;IACJ,CAAC,CAAC;IACF5C,MAAM,CAACK,wBAAwB,CAAC,CAAC,CAAC,CAACc,qBAAqB,CAAC;AACjE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;EACJ,CAAC,CAAC;AACN,CAAC,CAAC","ignoreList":[]}
@@ -1,4 +1,4 @@
1
- import type { ApiNameValueTypeReference, BaseType, ExampleValue, OntologyIrInterfaceType, SharedPropertyTypeGothamMapping, ValueTypeApiName, ValueTypeDataConstraint, ValueTypeDisplayMetadata, ValueTypeStatus, ValueTypeVersion } from "@osdk/client.unstable";
1
+ import type { ApiNameValueTypeReference, BaseType, ExampleValue, OntologyIrInterfaceType, SharedPropertyTypeGothamMapping, StructFieldType, ValueTypeApiName, ValueTypeDataConstraint, ValueTypeDisplayMetadata, ValueTypeStatus, ValueTypeVersion } from "@osdk/client.unstable";
2
2
  import type { OntologyFullMetadata } from "@osdk/internal.foundry.core";
3
3
  export interface Ontology extends Omit<OntologyFullMetadata, "ontology" | "sharedPropertyTypes" | "interfaceTypes"> {
4
4
  interfaceTypes: Record<string, InterfaceType>;
@@ -24,7 +24,21 @@ export interface SharedPropertyType extends PropertyType {
24
24
  apiName: string;
25
25
  gothamMapping?: SharedPropertyTypeGothamMapping;
26
26
  }
27
- export type PropertyTypeType = "boolean" | "byte" | "date" | "decimal" | "double" | "float" | "geopoint" | "geoshape" | "integer" | "long" | "marking" | "short" | "string" | "timestamp" | "mediaReference";
27
+ export type PropertyTypeType = PropertyTypeTypesWithoutStruct | {
28
+ type: "struct";
29
+ structDefinition: {
30
+ [api_name: string]: StructPropertyType | Exclude<PropertyTypeTypesWithoutStruct, MarkingPropertyType>;
31
+ };
32
+ };
33
+ export type PropertyTypeTypesWithoutStruct = "boolean" | "byte" | "date" | "decimal" | "double" | "float" | "geopoint" | "geoshape" | "integer" | "long" | MarkingPropertyType | "short" | "string" | "timestamp" | "mediaReference";
34
+ type MarkingPropertyType = {
35
+ type: "marking";
36
+ markingType: "MANDATORY" | "CBAC";
37
+ };
38
+ type Optional<T, K extends keyof T> = Pick<Partial<T>, K> & Omit<T, K>;
39
+ export interface StructPropertyType extends Optional<Omit<StructFieldType, "fieldType" | "structFieldRid" | "apiName">, "typeClasses" | "aliases"> {
40
+ fieldType: PropertyTypeTypesWithoutStruct;
41
+ }
28
42
  export type ValueTypeDefinitionVersion = {
29
43
  apiName: ValueTypeApiName;
30
44
  displayMetadata: ValueTypeDisplayMetadata;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/api/types.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EACV,yBAAyB,EACzB,QAAQ,EACR,YAAY,EACZ,uBAAuB,EACvB,+BAA+B,EAC/B,gBAAgB,EAChB,uBAAuB,EACvB,wBAAwB,EACxB,eAAe,EACf,gBAAgB,EACjB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAExE,MAAM,WAAW,QAAS,SACxB,IAAI,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E,QAAQ,CAAC;IACnB,WAAW,EAAE,uBAAuB,EAAE,CAAC;IACvC,aAAa,EAAE,YAAY,EAAE,CAAC;CAC/B,CAAC"}
@@ -26,7 +26,7 @@ import { defineOntology } from "../api/defineOntology.js";
26
26
  import { defineSharedPropertyType } from "../api/defineSpt.js";
27
27
  const apiNamespaceRegex = /^[a-z0-9-]+(\.[a-z0-9-]+)*\.$/;
28
28
  export default async function main(args = process.argv) {
29
- const commandLineOpts = await yargs(hideBin(args)).version("0.9.0-beta.4" ?? "").wrap(Math.min(150, yargs().terminalWidth())).strict().help().options({
29
+ const commandLineOpts = await yargs(hideBin(args)).version("0.9.0-beta.6" ?? "").wrap(Math.min(150, yargs().terminalWidth())).strict().help().options({
30
30
  input: {
31
31
  alias: "i",
32
32
  describe: "Input file",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@osdk/maker",
3
- "version": "0.9.0-beta.4",
3
+ "version": "0.9.0-beta.6",
4
4
  "license": "Apache-2.0",
5
5
  "repository": {
6
6
  "type": "git",
@@ -9,11 +9,13 @@
9
9
  "exports": {
10
10
  ".": {
11
11
  "browser": "./build/browser/index.js",
12
- "import": "./build/esm/index.js"
12
+ "import": "./build/esm/index.js",
13
+ "default": "./build/browser/index.js"
13
14
  },
14
15
  "./*": {
15
16
  "browser": "./build/browser/public/*.js",
16
- "import": "./build/esm/public/*.js"
17
+ "import": "./build/esm/public/*.js",
18
+ "default": "./build/browser/public/*.js"
17
19
  }
18
20
  },
19
21
  "dependencies": {
@@ -22,17 +24,17 @@
22
24
  "tiny-invariant": "^1.3.3",
23
25
  "ts-node": "^10.9.2",
24
26
  "yargs": "^17.7.2",
25
- "@osdk/api": "~2.1.0-beta.4"
27
+ "@osdk/api": "~2.1.0-beta.6"
26
28
  },
27
29
  "devDependencies": {
28
30
  "@osdk/internal.foundry.core": "2.2.0",
29
31
  "@types/yargs": "^17.0.32",
30
- "typescript": "^5.5.4",
32
+ "typescript": "~5.5.4",
31
33
  "vitest": "^2.1.2",
32
- "@osdk/monorepo.tsup": "~0.0.0",
34
+ "@osdk/client.unstable": "~2.1.0-beta.6",
35
+ "@osdk/monorepo.api-extractor": "~0.0.0",
33
36
  "@osdk/monorepo.tsconfig": "~0.0.0",
34
- "@osdk/client.unstable": "~2.1.0-beta.4",
35
- "@osdk/monorepo.api-extractor": "~0.0.0"
37
+ "@osdk/monorepo.tsup": "~0.0.0"
36
38
  },
37
39
  "publishConfig": {
38
40
  "access": "public"