@osdk/maker 0.9.0-beta.3 → 0.9.0-beta.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/build/browser/api/defineInterface.d.ts.map +1 -1
  3. package/build/browser/api/defineInterface.js +7 -7
  4. package/build/browser/api/defineInterface.js.map +1 -1
  5. package/build/browser/api/defineInterfaceLinkConstraint.js +1 -1
  6. package/build/browser/api/defineInterfaceLinkConstraint.js.map +1 -1
  7. package/build/browser/api/defineLink.js +2 -2
  8. package/build/browser/api/defineLink.js.map +1 -1
  9. package/build/browser/api/defineObject.js +1 -1
  10. package/build/browser/api/defineObject.js.map +1 -1
  11. package/build/browser/api/defineOntology.d.ts.map +1 -1
  12. package/build/browser/api/defineOntology.js +56 -9
  13. package/build/browser/api/defineOntology.js.map +1 -1
  14. package/build/browser/api/defineSpt.js +1 -1
  15. package/build/browser/api/defineSpt.js.map +1 -1
  16. package/build/browser/api/defineValueType.js +1 -1
  17. package/build/browser/api/defineValueType.js.map +1 -1
  18. package/build/browser/api/overall.test.js +90 -0
  19. package/build/browser/api/overall.test.js.map +1 -1
  20. package/build/browser/api/types.d.ts +16 -2
  21. package/build/browser/api/types.d.ts.map +1 -1
  22. package/build/browser/cli/main.js +3 -3
  23. package/build/browser/cli/main.js.map +1 -1
  24. package/build/esm/api/defineInterface.d.ts.map +1 -1
  25. package/build/esm/api/defineInterface.js +7 -7
  26. package/build/esm/api/defineInterface.js.map +1 -1
  27. package/build/esm/api/defineInterfaceLinkConstraint.js +1 -1
  28. package/build/esm/api/defineInterfaceLinkConstraint.js.map +1 -1
  29. package/build/esm/api/defineLink.js +2 -2
  30. package/build/esm/api/defineLink.js.map +1 -1
  31. package/build/esm/api/defineObject.js +1 -1
  32. package/build/esm/api/defineObject.js.map +1 -1
  33. package/build/esm/api/defineOntology.d.ts.map +1 -1
  34. package/build/esm/api/defineOntology.js +56 -9
  35. package/build/esm/api/defineOntology.js.map +1 -1
  36. package/build/esm/api/defineSpt.js +1 -1
  37. package/build/esm/api/defineSpt.js.map +1 -1
  38. package/build/esm/api/defineValueType.js +1 -1
  39. package/build/esm/api/defineValueType.js.map +1 -1
  40. package/build/esm/api/overall.test.js +90 -0
  41. package/build/esm/api/overall.test.js.map +1 -1
  42. package/build/esm/api/types.d.ts +16 -2
  43. package/build/esm/api/types.d.ts.map +1 -1
  44. package/build/esm/cli/main.js +3 -3
  45. package/build/esm/cli/main.js.map +1 -1
  46. package/package.json +5 -5
@@ -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,QAAQ,QAAQ;AACzD,SAASC,eAAe,QAAQ,sBAAsB;AAC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;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,MAAM;MAC1CO,eAAe,CAAC;QACZC,OAAO,EAAE,SAAS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AAEO,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,CACF,oBAAoB,EACpB,UAAU,GAAG,qBAAqB,GAAG,gBA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AAC;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.3" ?? "").wrap(Math.min(150, yargs().terminalWidth())).strict().help().options({
29
+ const commandLineOpts = await yargs(hideBin(args)).version("0.9.0-beta.5" ?? "").wrap(Math.min(150, yargs().terminalWidth())).strict().help().options({
30
30
  input: {
31
31
  alias: "i",
32
32
  describe: "Input file",
@@ -63,8 +63,8 @@ export default async function main(args = process.argv) {
63
63
  let apiNamespace = "";
64
64
  if (commandLineOpts.apiNamespace.length !== 0) {
65
65
  apiNamespace = commandLineOpts.apiNamespace.slice(-1) !== "." ? commandLineOpts.apiNamespace + "." : commandLineOpts.apiNamespace;
66
- !(apiNamespace.length < 1024) ? invariant(false, "API namespace is too long.") : void 0;
67
- !apiNamespaceRegex.test(apiNamespace) ? invariant(false, "API namespace is invalid! It is expected to conform to ^[a-z0-9-]+(\.[a-z0-9-]+)*\.$") : void 0;
66
+ !(apiNamespace.length < 1024) ? process.env.NODE_ENV !== "production" ? invariant(false, "API namespace is too long.") : invariant(false) : void 0;
67
+ !apiNamespaceRegex.test(apiNamespace) ? process.env.NODE_ENV !== "production" ? invariant(false, "API namespace is invalid! It is expected to conform to ^[a-z0-9-]+(\.[a-z0-9-]+)*\.$") : invariant(false) : void 0;
68
68
  }
69
69
  consola.info(`Loading ontology from ${commandLineOpts.input}`);
70
70
  const ontology = await loadOntology(commandLineOpts.input, apiNamespace);
@@ -1 +1 @@
1
- {"version":3,"file":"main.js","names":["consola","fs","path","invariant","yargs","hideBin","defineInterface","defineLink","defineObject","defineOntology","defineSharedPropertyType","apiNamespaceRegex","main","args","process","argv","commandLineOpts","version","wrap","Math","min","terminalWidth","strict","help","options","input","alias","describe","type","default","coerce","resolve","output","apiNamespace","snapshotDir","valueTypesOutput","parseAsync","length","slice","test","info","ontology","loadOntology","writeFile","JSON","stringify","valueType","valueTypes","loadOntologyViaJiti","Object","assign","globalThis","jiti_","jiti","cwd","debug","loadOntologyViaTsNode","tsNode","tsNodeService","register","transpileOnly","compilerOptions","module","target","esm","enabled","q"],"sources":["main.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 { consola } from \"consola\";\nimport * as fs from \"node:fs/promises\";\nimport * as path from \"node:path\";\nimport invariant from \"tiny-invariant\";\nimport yargs from \"yargs\";\nimport { hideBin } from \"yargs/helpers\";\nimport { defineInterface } from \"../api/defineInterface.js\";\nimport { defineLink } from \"../api/defineLink.js\";\nimport { defineObject } from \"../api/defineObject.js\";\nimport { defineOntology } from \"../api/defineOntology.js\";\nimport { defineSharedPropertyType } from \"../api/defineSpt.js\";\nconst apiNamespaceRegex = /^[a-z0-9-]+(\\.[a-z0-9-]+)*\\.$/;\nexport default async function main(args = process.argv) {\n const commandLineOpts = await yargs(hideBin(args))\n .version(process.env.PACKAGE_VERSION ?? \"\")\n .wrap(Math.min(150, yargs().terminalWidth()))\n .strict()\n .help()\n .options({\n input: {\n alias: \"i\",\n describe: \"Input file\",\n type: \"string\",\n default: \".ontology/ontology.ts\",\n coerce: path.resolve,\n },\n output: {\n alias: \"o\",\n describe: \"Output file\",\n type: \"string\",\n default: \"ontology.json\",\n coerce: path.resolve,\n },\n apiNamespace: {\n describe: \"Api name prefix for namespaced ontology types\",\n type: \"string\",\n default: \"\",\n },\n snapshotDir: {\n alias: \"s\",\n describe: \"Snapshot directory\",\n type: \"string\",\n default: \"snapshots\",\n coerce: path.resolve,\n },\n valueTypesOutput: {\n describe: \"Value Type Output File\",\n type: \"string\",\n default: \"value-types.json\",\n coerce: path.resolve,\n },\n })\n .parseAsync();\n let apiNamespace = \"\";\n if (commandLineOpts.apiNamespace.length !== 0) {\n apiNamespace = (commandLineOpts.apiNamespace.slice(-1) !== \".\")\n ? commandLineOpts.apiNamespace + \".\"\n : commandLineOpts.apiNamespace;\n invariant(apiNamespace.length < 1024, \"API namespace is too long.\");\n invariant(apiNamespaceRegex.test(apiNamespace), \"API namespace is invalid! It is expected to conform to ^[a-z0-9-]+(\\.[a-z0-9-]+)*\\.$\");\n }\n consola.info(`Loading ontology from ${commandLineOpts.input}`);\n const ontology = await loadOntology(commandLineOpts.input, apiNamespace);\n consola.info(`Saving ontology to ${commandLineOpts.output}`);\n await fs.writeFile(commandLineOpts.output, JSON.stringify(ontology.ontology, null, 2));\n // No point in generating block if there aren't any value types\n if (ontology.valueType.valueTypes.length > 0) {\n await fs.writeFile(commandLineOpts.valueTypesOutput, JSON.stringify(ontology.valueType, null, 2));\n }\n}\nasync function loadOntologyViaJiti(input) {\n Object.assign(globalThis, {\n defineInterface,\n defineLink,\n defineObject,\n defineSharedPropertyType,\n });\n const jiti_ = await import(\"jiti\");\n const jiti = jiti_.default(process.cwd(), { debug: true });\n return defineOntology(\"\", async () => await jiti(input));\n}\nasync function loadOntologyViaTsNode(input) {\n Object.assign(globalThis, {\n defineInterface,\n defineLink,\n defineObject,\n defineSharedPropertyType,\n });\n const tsNode = await import(\"ts-node\");\n const tsNodeService = tsNode.register({\n transpileOnly: true,\n compilerOptions: {\n module: \"commonjs\",\n target: \"esnext\",\n },\n esm: true,\n });\n tsNodeService.enabled(true);\n const q = await import(input);\n return q;\n}\nasync function loadOntology(input, apiNamespace) {\n // Object.assign(globalThis, {\n // defineInterface,\n // defineLink,\n // defineObject,\n // defineSharedPropertyType,\n // });\n const q = await defineOntology(apiNamespace, async () => await import(input));\n return q;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,OAAO,QAAQ,SAAS;AACjC,OAAO,KAAKC,EAAE,MAAM,kBAAkB;AACtC,OAAO,KAAKC,IAAI,MAAM,WAAW;AACjC,OAAOC,SAAS,MAAM,gBAAgB;AACtC,OAAOC,KAAK,MAAM,OAAO;AACzB,SAASC,OAAO,QAAQ,eAAe;AACvC,SAASC,eAAe,QAAQ,2BAA2B;AAC3D,SAASC,UAAU,QAAQ,sBAAsB;AACjD,SAASC,YAAY,QAAQ,wBAAwB;AACrD,SAASC,cAAc,QAAQ,0BAA0B;AACzD,SAASC,wBAAwB,QAAQ,qBAAqB;AAC9D,MAAMC,iBAAiB,GAAG,+BAA+B;AACzD,eAAe,eAAeC,IAAIA,CAACC,IAAI,GAAGC,OAAO,CAACC,IAAI,EAAE;EACpD,MAAMC,eAAe,GAAG,MAAMZ,KAAK,CAACC,OAAO,CAACQ,IAAI,CAAC,CAAC,CAC7CI,OAAO,CAAC,kBAA+B,EAAE,CAAC,CAC1CC,IAAI,CAACC,IAAI,CAACC,GAAG,CAAC,GAAG,EAAEhB,KAAK,CAAC,CAAC,CAACiB,aAAa,CAAC,CAAC,CAAC,CAAC,CAC5CC,MAAM,CAAC,CAAC,CACRC,IAAI,CAAC,CAAC,CACNC,OAAO,CAAC;IACTC,KAAK,EAAE;MACHC,KAAK,EAAE,GAAG;MACVC,QAAQ,EAAE,YAAY;MACtBC,IAAI,EAAE,QAAQ;MACdC,OAAO,EAAE,uBAAuB;MAChCC,MAAM,EAAE5B,IAAI,CAAC6B;IACjB,CAAC;IACDC,MAAM,EAAE;MACJN,KAAK,EAAE,GAAG;MACVC,QAAQ,EAAE,aAAa;MACvBC,IAAI,EAAE,QAAQ;MACdC,OAAO,E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M,CAACzC,KAAK,CAAC;EAC7B,OAAOyC,CAAC;AACZ;AACA,eAAexB,YAAYA,CAACjB,KAAK,EAAEQ,YAAY,EAAE;EAC7C;EACA;EACA;EACA;EACA;EACA;EACA,MAAMiC,CAAC,GAAG,MAAMzD,cAAc,CAACwB,YAAY,EAAE,YAAY,MAAM,MAAM,CAACR,KAAK,CAAC,CAAC;EAC7E,OAAOyC,CAAC;AACZ","ignoreList":[]}
1
+ {"version":3,"file":"main.js","names":["consola","fs","path","invariant","yargs","hideBin","defineInterface","defineLink","defineObject","defineOntology","defineSharedPropertyType","apiNamespaceRegex","main","args","process","argv","commandLineOpts","version","wrap","Math","min","terminalWidth","strict","help","options","input","alias","describe","type","default","coerce","resolve","output","apiNamespace","snapshotDir","valueTypesOutput","parseAsync","length","slice","env","NODE_ENV","test","info","ontology","loadOntology","writeFile","JSON","stringify","valueType","valueTypes","loadOntologyViaJiti","Object","assign","globalThis","jiti_","jiti","cwd","debug","loadOntologyViaTsNode","tsNode","tsNodeService","register","transpileOnly","compilerOptions","module","target","esm","enabled","q"],"sources":["main.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 { consola } from \"consola\";\nimport * as fs from \"node:fs/promises\";\nimport * as path from \"node:path\";\nimport invariant from \"tiny-invariant\";\nimport yargs from \"yargs\";\nimport { hideBin } from \"yargs/helpers\";\nimport { defineInterface } from \"../api/defineInterface.js\";\nimport { defineLink } from \"../api/defineLink.js\";\nimport { defineObject } from \"../api/defineObject.js\";\nimport { defineOntology } from \"../api/defineOntology.js\";\nimport { defineSharedPropertyType } from \"../api/defineSpt.js\";\nconst apiNamespaceRegex = /^[a-z0-9-]+(\\.[a-z0-9-]+)*\\.$/;\nexport default async function main(args = process.argv) {\n const commandLineOpts = await yargs(hideBin(args))\n .version(process.env.PACKAGE_VERSION ?? \"\")\n .wrap(Math.min(150, yargs().terminalWidth()))\n .strict()\n .help()\n .options({\n input: {\n alias: \"i\",\n describe: \"Input file\",\n type: \"string\",\n default: \".ontology/ontology.ts\",\n coerce: path.resolve,\n },\n output: {\n alias: \"o\",\n describe: \"Output file\",\n type: \"string\",\n default: \"ontology.json\",\n coerce: path.resolve,\n },\n apiNamespace: {\n describe: \"Api name prefix for namespaced ontology types\",\n type: \"string\",\n default: \"\",\n },\n snapshotDir: {\n alias: \"s\",\n describe: \"Snapshot directory\",\n type: \"string\",\n default: \"snapshots\",\n coerce: path.resolve,\n },\n valueTypesOutput: {\n describe: \"Value Type Output File\",\n type: \"string\",\n default: \"value-types.json\",\n coerce: path.resolve,\n },\n })\n .parseAsync();\n let apiNamespace = \"\";\n if (commandLineOpts.apiNamespace.length !== 0) {\n apiNamespace = (commandLineOpts.apiNamespace.slice(-1) !== \".\")\n ? commandLineOpts.apiNamespace + \".\"\n : commandLineOpts.apiNamespace;\n invariant(apiNamespace.length < 1024, \"API namespace is too long.\");\n invariant(apiNamespaceRegex.test(apiNamespace), \"API namespace is invalid! It is expected to conform to ^[a-z0-9-]+(\\.[a-z0-9-]+)*\\.$\");\n }\n consola.info(`Loading ontology from ${commandLineOpts.input}`);\n const ontology = await loadOntology(commandLineOpts.input, apiNamespace);\n consola.info(`Saving ontology to ${commandLineOpts.output}`);\n await fs.writeFile(commandLineOpts.output, JSON.stringify(ontology.ontology, null, 2));\n // No point in generating block if there aren't any value types\n if (ontology.valueType.valueTypes.length > 0) {\n await fs.writeFile(commandLineOpts.valueTypesOutput, JSON.stringify(ontology.valueType, null, 2));\n }\n}\nasync function loadOntologyViaJiti(input) {\n Object.assign(globalThis, {\n defineInterface,\n defineLink,\n defineObject,\n defineSharedPropertyType,\n });\n const jiti_ = await import(\"jiti\");\n const jiti = jiti_.default(process.cwd(), { debug: true });\n return defineOntology(\"\", async () => await jiti(input));\n}\nasync function loadOntologyViaTsNode(input) {\n Object.assign(globalThis, {\n defineInterface,\n defineLink,\n defineObject,\n defineSharedPropertyType,\n });\n const tsNode = await import(\"ts-node\");\n const tsNodeService = tsNode.register({\n transpileOnly: true,\n compilerOptions: {\n module: \"commonjs\",\n target: \"esnext\",\n },\n esm: true,\n });\n tsNodeService.enabled(true);\n const q = await import(input);\n return q;\n}\nasync function loadOntology(input, apiNamespace) {\n // Object.assign(globalThis, {\n // defineInterface,\n // defineLink,\n // defineObject,\n // defineSharedPropertyType,\n // });\n const q = await defineOntology(apiNamespace, async () => await import(input));\n return q;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,OAAO,QAAQ,SAAS;AACjC,OAAO,KAAKC,EAAE,MAAM,kBAAkB;AACtC,OAAO,KAAKC,IAAI,MAAM,WAAW;AACjC,OAAOC,SAAS,MAAM,gBAAgB;AACtC,OAAOC,KAAK,MAAM,OAAO;AACzB,SAASC,OAAO,QAAQ,eAAe;AACvC,SAASC,eAAe,QAAQ,2BAA2B;AAC3D,SAASC,UAAU,QAAQ,sBAAsB;AACjD,SAASC,YAAY,QAAQ,wBAAwB;AACrD,SAASC,cAAc,QAAQ,0BAA0B;AACzD,SAASC,wBAAwB,QAAQ,qBAAqB;AAC9D,MAAMC,iBAAiB,GAAG,+BAA+B;AACzD,eAAe,eAAeC,IAAIA,CAACC,IAAI,GAAGC,OAAO,CAACC,IAAI,EAAE;EACpD,MAAMC,eAAe,GAAG,MAAMZ,KAAK,CAACC,OAAO,CAACQ,IAAI,CAAC,CAAC,CAC7CI,OAAO,CAAC,kBAA+B,EAAE,CAAC,CAC1CC,IAAI,CAACC,IAAI,CAACC,GAAG,CAAC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AE,EAAE,YAAY,MAAM8C,IAAI,CAAC9B,KAAK,CAAC,CAAC;AAC5D;AACA,eAAeiC,qBAAqBA,CAACjC,KAAK,EAAE;EACxC0B,MAAM,CAACC,MAAM,CAACC,UAAU,EAAE;IACtB/C,eAAe;IACfC,UAAU;IACVC,YAAY;IACZE;EACJ,CAAC,CAAC;EACF,MAAMiD,MAAM,GAAG,MAAM,MAAM,CAAC,SAAS,CAAC;EACtC,MAAMC,aAAa,GAAGD,MAAM,CAACE,QAAQ,CAAC;IAClCC,aAAa,EAAE,IAAI;IACnBC,eAAe,EAAE;MACbC,MAAM,EAAE,UAAU;MAClBC,MAAM,EAAE;IACZ,CAAC;IACDC,GAAG,EAAE;EACT,CAAC,CAAC;EACFN,aAAa,CAACO,OAAO,CAAC,IAAI,CAAC;EAC3B,MAAMC,CAAC,GAAG,MAAM,MAAM,CAAC3C,KAAK,CAAC;EAC7B,OAAO2C,CAAC;AACZ;AACA,eAAexB,YAAYA,CAACnB,KAAK,EAAEQ,YAAY,EAAE;EAC7C;EACA;EACA;EACA;EACA;EACA;EACA,MAAMmC,CAAC,GAAG,MAAM3D,cAAc,CAACwB,YAAY,EAAE,YAAY,MAAM,MAAM,CAACR,KAAK,CAAC,CAAC;EAC7E,OAAO2C,CAAC;AACZ","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"defineInterface.d.ts","sourceRoot":"","sources":["../../../src/api/defineInterface.ts"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,KAAK,EACV,aAAa,EACb,gBAAgB,EAChB,kBAAkB,EACnB,MAAM,YAAY,CAAC;AAEpB,wBAAgB,eAAe,CAC7B,IAAI,EAAE;IACJ,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE;QAAE,OAAO,EAAE,aAAa,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;IACjD,UAAU,CAAC,EAAE,MAAM,CACjB,MAAM,EACN,kBAAkB,GAAG,gBAAgB,CACtC,CAAC;IACF,OAAO,CAAC,EAAE,aAAa,GAAG,aAAa,EAAE,GAAG,MAAM,GAAG,MAAM,EAAE,CAAC;CAC/D,GACA,aAAa,CA2Ef"}
1
+ {"version":3,"file":"defineInterface.d.ts","sourceRoot":"","sources":["../../../src/api/defineInterface.ts"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,KAAK,EACV,aAAa,EACb,gBAAgB,EAChB,kBAAkB,EACnB,MAAM,YAAY,CAAC;AAEpB,wBAAgB,eAAe,CAC7B,IAAI,EAAE;IACJ,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE;QAAE,OAAO,EAAE,aAAa,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;IACjD,UAAU,CAAC,EAAE,MAAM,CACjB,MAAM,EACN,kBAAkB,GAAG,gBAAgB,CACtC,CAAC;IACF,OAAO,CAAC,EAAE,aAAa,GAAG,aAAa,EAAE,GAAG,MAAM,GAAG,MAAM,EAAE,CAAC;CAC/D,GACA,aAAa,CA8Ef"}
@@ -18,10 +18,10 @@ import { namespace, ontologyDefinition } from "./defineOntology.js";
18
18
  import { defineSharedPropertyType } from "./defineSpt.js";
19
19
  export function defineInterface(opts) {
20
20
  const apiName = namespace + opts.apiName;
21
- !(ontologyDefinition.interfaceTypes[apiName] === undefined) ? invariant(false, `Interface ${apiName} already exists`) : void 0;
21
+ !(ontologyDefinition.interfaceTypes[apiName] === undefined) ? process.env.NODE_ENV !== "production" ? invariant(false, `Interface ${apiName} already exists`) : invariant(false) : void 0;
22
22
  const properties = Object.fromEntries(Object.entries(opts.properties ?? {}).map(([apiName, type]) => {
23
- if (typeof type === "string") {
24
- !isSimpleType(type) ? invariant(false, `Invalid data type ${type} for property ${apiName} on InterfaceType ${apiName}`) : void 0;
23
+ if (typeof type === "string" || typeof type === "object" && !("apiName" in type)) {
24
+ !isPropertyTypeType(type) ? process.env.NODE_ENV !== "production" ? invariant(false, `Invalid data type ${type} for property ${apiName} on InterfaceType ${apiName}`) : invariant(false) : void 0;
25
25
  const spt = defineSharedPropertyType({
26
26
  apiName,
27
27
  displayName: apiName,
@@ -30,10 +30,10 @@ export function defineInterface(opts) {
30
30
  });
31
31
  return [apiName, spt];
32
32
  } else {
33
- !(namespace + apiName === type.apiName) ? invariant(false, `property key and it's apiName must be identical. ${JSON.stringify({
33
+ !(namespace + apiName === type.apiName) ? process.env.NODE_ENV !== "production" ? invariant(false, `property key and it's apiName must be identical. ${JSON.stringify({
34
34
  key: apiName,
35
35
  apiName: type.apiName
36
- })}`) : void 0;
36
+ })}`) : invariant(false) : void 0;
37
37
  return [apiName, type];
38
38
  }
39
39
  }));
@@ -72,7 +72,7 @@ export function defineInterface(opts) {
72
72
  };
73
73
  return ontologyDefinition.interfaceTypes[apiName] = a;
74
74
  }
75
- function isSimpleType(v) {
76
- return v === "boolean" || v === "byte" || v === "date" || v === "decimal" || v === "double" || v === "float" || v === "geopoint" || v === "geoshape" || v === "integer" || v === "long" || v === "marking" || v === "short" || v === "string" || v === "timestamp";
75
+ function isPropertyTypeType(v) {
76
+ return v === "boolean" || v === "byte" || v === "date" || v === "decimal" || v === "double" || v === "float" || v === "geopoint" || v === "geoshape" || v === "integer" || v === "long" || typeof v === "object" && v.type === "marking" || v === "short" || v === "string" || v === "timestamp";
77
77
  }
78
78
  //# sourceMappingURL=defineInterface.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"defineInterface.js","names":["invariant","namespace","ontologyDefinition","defineSharedPropertyType","defineInterface","opts","apiName","interfaceTypes","undefined","properties","Object","fromEntries","entries","map","type","isSimpleType","spt","displayName","array","JSON","stringify","key","extendsInterfaces","extends","Array","isArray","every","item","a","displayMetadata","description","icon","blueprint","color","locator","links","status","active","v"],"sources":["defineInterface.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 invariant from \"tiny-invariant\";\nimport { namespace, ontologyDefinition } from \"./defineOntology.js\";\nimport { defineSharedPropertyType } from \"./defineSpt.js\";\nexport function defineInterface(opts) {\n const apiName = namespace + opts.apiName;\n invariant(ontologyDefinition.interfaceTypes[apiName] === undefined, `Interface ${apiName} already exists`);\n const properties = Object.fromEntries(Object.entries(opts.properties ?? {}).map(([apiName, type]) => {\n if (typeof type === \"string\") {\n invariant(isSimpleType(type), `Invalid data type ${type} for property ${apiName} on InterfaceType ${apiName}`);\n const spt = defineSharedPropertyType({\n apiName,\n displayName: apiName,\n type,\n array: false,\n });\n return [apiName, spt];\n }\n else {\n invariant(namespace + apiName === type.apiName, `property key and it's apiName must be identical. ${JSON.stringify({ key: apiName, apiName: type.apiName })}`);\n return [apiName, type];\n }\n }));\n let extendsInterfaces = [];\n if (opts.extends) {\n if (typeof opts.extends === \"string\") {\n extendsInterfaces = [opts.extends];\n }\n else if (Array.isArray(opts.extends)\n && opts.extends.every(item => typeof item === \"string\")) {\n extendsInterfaces = opts.extends;\n }\n else if (opts.extends.apiName !== undefined) {\n extendsInterfaces = [opts.extends.apiName];\n }\n else {\n extendsInterfaces = opts.extends.map(item => item.apiName);\n }\n }\n const a = {\n apiName,\n displayMetadata: {\n displayName: opts.displayName ?? opts.apiName,\n description: opts.description ?? opts.displayName ?? opts.apiName,\n icon: opts.icon !== undefined\n ? {\n type: \"blueprint\",\n blueprint: { color: opts.icon.color, locator: opts.icon.locator },\n }\n : undefined,\n },\n extendsInterfaces: extendsInterfaces,\n links: [],\n properties,\n status: { type: \"active\", active: {} },\n };\n return ontologyDefinition.interfaceTypes[apiName] = a;\n}\nfunction isSimpleType(v) {\n return v === \"boolean\" || v === \"byte\"\n || v === \"date\" || v === \"decimal\" || v === \"double\"\n || v === \"float\" || v === \"geopoint\" || v === \"geoshape\"\n || v === \"integer\" || v === \"long\" || v === \"marking\"\n || v === \"short\" || v === \"string\"\n || v === \"timestamp\";\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAOA,SAAS,MAAM,gBAAgB;AACtC,SAASC,SAAS,EAAEC,kBAAkB,QAAQ,qBAAqB;AACnE,SAASC,wBAAwB,QAAQ,gBAAgB;AACzD,OAAO,SAASC,eAAeA,CAACC,IAAI,EAAE;EAClC,MAAMC,OAAO,GAAGL,SAAS,GAAGI,IAAI,CAACC,OAAO;EACxC,EAAUJ,kBAAkB,CAACK,cAAc,CAACD,OAAO,CAAC,KAAKE,SAAS,IAAlER,SAAS,QAA2D,aAAaM,OAAO,iBAAiB;EACzG,MAAMG,UAAU,GAAGC,MAAM,CAACC,WAAW,CAACD,MAAM,CAACE,OAAO,CAACP,IAAI,CAACI,UAAU,IAAI,CAAC,CAAC,CAAC,CAACI,GAAG,CAAC,CAAC,CAACP,OAAO,EAAEQ,IAAI,CAAC,KAAK;IACjG,IAAI,OAAOA,IAAI,KAAK,QAAQ,EAAE;MAC1B,CAAUC,YAAY,CAACD,IAAI,CAAC,GAA5Bd,SAAS,QAAqB,qBAAqBc,IAAI,iBAAiBR,OAAO,qBAAqBA,OAAO,EAAE;MAC7G,MAAMU,GAAG,GAAGb,wBAAwB,CAAC;QACjCG,OAAO;QACPW,WAAW,EAAEX,OAAO;QACpBQ,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AAI,CAACY,WAAW,IAAIZ,IAAI,CAACC,OAAO;MACjEyB,IAAI,EAAE1B,IAAI,CAAC0B,IAAI,KAAKvB,SAAS,GACvB;QACEM,IAAI,EAAE,WAAW;QACjBkB,SAAS,EAAE;UAAEC,KAAK,EAAE5B,IAAI,CAAC0B,IAAI,CAACE,KAAK;UAAEC,OAAO,EAAE7B,IAAI,CAAC0B,IAAI,CAACG;QAAQ;MACpE,CAAC,GACC1B;IACV,CAAC;IACDc,iBAAiB,EAAEA,iBAAiB;IACpCa,KAAK,EAAE,EAAE;IACT1B,UAAU;IACV2B,MAAM,EAAE;MAAEtB,IAAI,EAAE,QAAQ;MAAEuB,MAAM,EAAE,CAAC;IAAE;EACzC,CAAC;EACD,OAAOnC,kBAAkB,CAACK,cAAc,CAACD,OAAO,CAAC,GAAGsB,CAAC;AACzD;AACA,SAASb,YAAYA,CAACuB,CAAC,EAAE;EACrB,OAAOA,CAAC,KAAK,SAAS,IAAIA,CAAC,KAAK,MAAM,IAC/BA,CAAC,KAAK,MAAM,IAAIA,CAAC,KAAK,SAAS,IAAIA,CAAC,KAAK,QAAQ,IACjDA,CAAC,KAAK,OAAO,IAAIA,CAAC,KAAK,UAAU,IAAIA,CAAC,KAAK,UAAU,IACrDA,CAAC,KAAK,SAAS,IAAIA,CAAC,KAAK,MAAM,IAAIA,CAAC,KAAK,SAAS,IAClDA,CAAC,KAAK,OAAO,IAAIA,CAAC,KAAK,QAAQ,IAC/BA,CAAC,KAAK,WAAW;AAC5B","ignoreList":[]}
1
+ {"version":3,"file":"defineInterface.js","names":["invariant","namespace","ontologyDefinition","defineSharedPropertyType","defineInterface","opts","apiName","interfaceTypes","undefined","process","env","NODE_ENV","properties","Object","fromEntries","entries","map","type","isPropertyTypeType","spt","displayName","array","JSON","stringify","key","extendsInterfaces","extends","Array","isArray","every","item","a","displayMetadata","description","icon","blueprint","color","locator","links","status","active","v"],"sources":["defineInterface.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 invariant from \"tiny-invariant\";\nimport { namespace, ontologyDefinition } from \"./defineOntology.js\";\nimport { defineSharedPropertyType } from \"./defineSpt.js\";\nexport function defineInterface(opts) {\n const apiName = namespace + opts.apiName;\n invariant(ontologyDefinition.interfaceTypes[apiName] === undefined, `Interface ${apiName} already exists`);\n const properties = Object.fromEntries(Object.entries(opts.properties ?? {}).map(([apiName, type]) => {\n if (typeof type === \"string\"\n || (typeof type === \"object\" && !(\"apiName\" in type))) {\n invariant(isPropertyTypeType(type), `Invalid data type ${type} for property ${apiName} on InterfaceType ${apiName}`);\n const spt = defineSharedPropertyType({\n apiName,\n displayName: apiName,\n type,\n array: false,\n });\n return [apiName, spt];\n }\n else {\n invariant(namespace + apiName === type.apiName, `property key and it's apiName must be identical. ${JSON.stringify({ key: apiName, apiName: type.apiName })}`);\n return [apiName, type];\n }\n }));\n let extendsInterfaces = [];\n if (opts.extends) {\n if (typeof opts.extends === \"string\") {\n extendsInterfaces = [opts.extends];\n }\n else if (Array.isArray(opts.extends)\n && opts.extends.every(item => typeof item === \"string\")) {\n extendsInterfaces = opts.extends;\n }\n else if (opts.extends.apiName !== undefined) {\n extendsInterfaces = [opts.extends.apiName];\n }\n else {\n extendsInterfaces = opts.extends.map(item => item.apiName);\n }\n }\n const a = {\n apiName,\n displayMetadata: {\n displayName: opts.displayName ?? opts.apiName,\n description: opts.description ?? opts.displayName ?? opts.apiName,\n icon: opts.icon !== undefined\n ? {\n type: \"blueprint\",\n blueprint: { color: opts.icon.color, locator: opts.icon.locator },\n }\n : undefined,\n },\n extendsInterfaces: extendsInterfaces,\n links: [],\n properties,\n status: { type: \"active\", active: {} },\n };\n return ontologyDefinition.interfaceTypes[apiName] = a;\n}\nfunction isPropertyTypeType(v) {\n return v === \"boolean\" || v === \"byte\"\n || v === \"date\" || v === \"decimal\" || v === \"double\"\n || v === \"float\" || v === \"geopoint\" || v === \"geoshape\"\n || v === \"integer\" || v === \"long\"\n || (typeof v === \"object\" && v.type === \"marking\")\n || v === \"short\" || v === \"string\"\n || v === \"timestamp\";\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAOA,SAAS,MAAM,gBAAgB;AACtC,SAASC,SAAS,EAAEC,kBAAkB,QAAQ,qBAAqB;AACnE,SAASC,wBAAwB,QAAQ,gBAAgB;AACzD,OAAO,SAASC,eAAeA,CAACC,IAAI,EAAE;EAClC,MAAMC,OAAO,GAAGL,SAAS,GAAGI,IAAI,CAACC,OAAO;EACxC,EAAUJ,kBAAkB,CAACK,cAAc,CAACD,OAAO,CAAC,KAAKE,SAAS,IAAAC,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAAlEX,SAAS,QAA2D,aAAaM,OAAO,iBAAiB,IAAzGN,SAAS;EACT,MAAMY,UAAU,GAAGC,MAAM,CAACC,WAAW,CAACD,MAAM,CAACE,OAAO,CAACV,IAAI,CAACO,UAAU,IAAI,CAAC,CAAC,CAAC,CAACI,GAAG,CAAC,CAAC,CAACV,OAAO,EAAEW,IAAI,CAAC,KAAK;IACjG,IAAI,OAAOA,IAAI,KAAK,QAAQ,IACpB,OAAOA,IAAI,KAAK,QAAQ,IAAI,EAAE,SAAS,IAAIA,IAAI,CAAE,EAAE;MACvD,CAAUC,kBAAkB,CAACD,IAAI,CAAC,GAAAR,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAAlCX,SAAS,QAA2B,qBAAqBiB,IAAI,iBAAiBX,OAAO,qBAAqBA,OAAO,EAAE,IA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ACNzB,OAAO;IACP0B,eAAe,EAAE;MACbZ,WAAW,EAAEf,IAAI,CAACe,WAAW,IAAIf,IAAI,CAACC,OAAO;MAC7C2B,WAAW,EAAE5B,IAAI,CAAC4B,WAAW,IAAI5B,IAAI,CAACe,WAAW,IAAIf,IAAI,CAACC,OAAO;MACjE4B,IAAI,EAAE7B,IAAI,CAAC6B,IAAI,KAAK1B,SAAS,GACvB;QACES,IAAI,EAAE,WAAW;QACjBkB,SAAS,EAAE;UAAEC,KAAK,EAAE/B,IAAI,CAAC6B,IAAI,CAACE,KAAK;UAAEC,OAAO,EAAEhC,IAAI,CAAC6B,IAAI,CAACG;QAAQ;MACpE,CAAC,GACC7B;IACV,CAAC;IACDiB,iBAAiB,EAAEA,iBAAiB;IACpCa,KAAK,EAAE,EAAE;IACT1B,UAAU;IACV2B,MAAM,EAAE;MAAEtB,IAAI,EAAE,QAAQ;MAAEuB,MAAM,EAAE,CAAC;IAAE;EACzC,CAAC;EACD,OAAOtC,kBAAkB,CAACK,cAAc,CAACD,OAAO,CAAC,GAAGyB,CAAC;AACzD;AACA,SAASb,kBAAkBA,CAACuB,CAAC,EAAE;EAC3B,OAAOA,CAAC,KAAK,SAAS,IAAIA,CAAC,KAAK,MAAM,IAC/BA,CAAC,KAAK,MAAM,IAAIA,CAAC,KAAK,SAAS,IAAIA,CAAC,KAAK,QAAQ,IACjDA,CAAC,KAAK,OAAO,IAAIA,CAAC,KAAK,UAAU,IAAIA,CAAC,KAAK,UAAU,IACrDA,CAAC,KAAK,SAAS,IAAIA,CAAC,KAAK,MAAM,IAC9B,OAAOA,CAAC,KAAK,QAAQ,IAAIA,CAAC,CAACxB,IAAI,KAAK,SAAU,IAC/CwB,CAAC,KAAK,OAAO,IAAIA,CAAC,KAAK,QAAQ,IAC/BA,CAAC,KAAK,WAAW;AAC5B","ignoreList":[]}
@@ -17,7 +17,7 @@ import invariant from "tiny-invariant";
17
17
  import { namespace } from "./defineOntology.js";
18
18
  export function defineInterfaceLinkConstraint(linkDef) {
19
19
  const fromLinkMeta = getLinkMeta(linkDef);
20
- !(linkDef.from.links.find(a => a.metadata.apiName === fromLinkMeta.apiName) == null) ? invariant(false, `Link with apiName ${fromLinkMeta.apiName} already exists on ${linkDef.apiName}`) : void 0;
20
+ !(linkDef.from.links.find(a => a.metadata.apiName === fromLinkMeta.apiName) == null) ? process.env.NODE_ENV !== "production" ? invariant(false, `Link with apiName ${fromLinkMeta.apiName} already exists on ${linkDef.apiName}`) : invariant(false) : void 0;
21
21
  linkDef.from.links.push({
22
22
  cardinality: linkDef.toMany ? "MANY" : "SINGLE",
23
23
  linkedEntityTypeId: getLinkedType(linkDef.toMany ?? linkDef.toOne),
@@ -1 +1 @@
1
- {"version":3,"file":"defineInterfaceLinkConstraint.js","names":["invariant","namespace","defineInterfaceLinkConstraint","linkDef","fromLinkMeta","getLinkMeta","from","links","find","a","metadata","apiName","push","cardinality","toMany","linkedEntityTypeId","getLinkedType","toOne","required","t","type","interfaceType","meta","withDefaults","description","displayName"],"sources":["defineInterfaceLinkConstraint.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 invariant from \"tiny-invariant\";\nimport { namespace } from \"./defineOntology.js\";\nexport function defineInterfaceLinkConstraint(linkDef) {\n const fromLinkMeta = getLinkMeta(linkDef);\n invariant(linkDef.from.links.find(a => a.metadata.apiName === fromLinkMeta.apiName)\n == null, `Link with apiName ${fromLinkMeta.apiName} already exists on ${linkDef.apiName}`);\n linkDef.from.links.push({\n cardinality: linkDef.toMany ? \"MANY\" : \"SINGLE\",\n linkedEntityTypeId: getLinkedType(linkDef.toMany ?? linkDef.toOne),\n metadata: fromLinkMeta,\n required: true, // TODO: expose this?\n });\n}\nfunction getLinkedType(t) {\n return {\n type: \"interfaceType\",\n interfaceType: typeof t === \"string\" ? t : t.apiName,\n };\n}\nfunction getLinkMeta(meta) {\n return typeof meta === \"string\"\n ? withDefaults({ apiName: namespace + meta })\n : withDefaults(meta);\n}\nfunction withDefaults({ apiName, description, displayName }) {\n return {\n apiName: namespace + apiName,\n displayName: displayName ?? apiName,\n description: description ?? displayName ?? apiName,\n };\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAOA,SAAS,MAAM,gBAAgB;AACtC,SAASC,SAAS,QAAQ,qBAAqB;AAC/C,OAAO,SAASC,6BAA6BA,CAACC,OAAO,EAAE;EACnD,MAAMC,YAAY,GAAGC,WAAW,CAACF,OAAO,CAAC;EACzC,EAAUA,OAAO,CAACG,IAAI,CAACC,KAAK,CAACC,IAAI,CAACC,CAAC,IAAIA,CAAC,CAACC,QAAQ,CAACC,OAAO,KAAKP,YAAY,CAACO,OAAO,CAAC,IAC5E,IAAI,IADXX,SAAS,QACI,qBAAqBI,YAAY,CAACO,OAAO,sBAAsBR,OAAO,CAACQ,OAAO,EAAE;EAC7FR,OAAO,CAACG,IAAI,CAACC,KAAK,CAACK,IAAI,CAAC;IACpBC,WAAW,EAAEV,OAAO,CAACW,MAAM,GAAG,MAAM,GAAG,QAAQ;IAC/CC,kBAAkB,EAAEC,aAAa,CAACb,OAAO,CAACW,MAAM,IAAIX,OAAO,CAACc,KAAK,CAAC;IAClEP,QAAQ,EAAEN,YAAY;IACtBc,QAAQ,EAAE,IAAI,CAAE;EACpB,CAAC,CAAC;AACN;AACA,SAASF,aAAaA,CAACG,CAAC,EAAE;EACtB,OAAO;IACHC,IAAI,EAAE,eAAe;IACrBC,aAAa,EAAE,OAAOF,CAAC,KAAK,QAAQ,GAAGA,CAAC,GAAGA,CAAC,CAACR;EACjD,CAAC;AACL;AACA,SAASN,WAAWA,CAACiB,IAAI,EAAE;EACvB,OAAO,OAAOA,IAAI,KAAK,QAAQ,GACzBC,YAAY,CAAC;IAAEZ,OAAO,EAAEV,SAAS,GAAGqB;EAAK,CAAC,CAAC,GAC3CC,YAAY,CAACD,IAAI,CAAC;AAC5B;AACA,SAASC,YAAYA,CAAC;EAAEZ,OAAO;EAAEa,WAAW;EAAEC;AAAY,CAAC,EAAE;EACzD,OAAO;IACHd,OAAO,EAAEV,SAAS,GAAGU,OAAO;IAC5Bc,WAAW,EAAEA,WAAW,IAAId,OAAO;IACnCa,WAAW,EAAEA,WAAW,IAAIC,WAAW,IAAId;EAC/C,CAAC;AACL","ignoreList":[]}
1
+ {"version":3,"file":"defineInterfaceLinkConstraint.js","names":["invariant","namespace","defineInterfaceLinkConstraint","linkDef","fromLinkMeta","getLinkMeta","from","links","find","a","metadata","apiName","process","env","NODE_ENV","push","cardinality","toMany","linkedEntityTypeId","getLinkedType","toOne","required","t","type","interfaceType","meta","withDefaults","description","displayName"],"sources":["defineInterfaceLinkConstraint.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 invariant from \"tiny-invariant\";\nimport { namespace } from \"./defineOntology.js\";\nexport function defineInterfaceLinkConstraint(linkDef) {\n const fromLinkMeta = getLinkMeta(linkDef);\n invariant(linkDef.from.links.find(a => a.metadata.apiName === fromLinkMeta.apiName)\n == null, `Link with apiName ${fromLinkMeta.apiName} already exists on ${linkDef.apiName}`);\n linkDef.from.links.push({\n cardinality: linkDef.toMany ? \"MANY\" : \"SINGLE\",\n linkedEntityTypeId: getLinkedType(linkDef.toMany ?? linkDef.toOne),\n metadata: fromLinkMeta,\n required: true, // TODO: expose this?\n });\n}\nfunction getLinkedType(t) {\n return {\n type: \"interfaceType\",\n interfaceType: typeof t === \"string\" ? t : t.apiName,\n };\n}\nfunction getLinkMeta(meta) {\n return typeof meta === \"string\"\n ? withDefaults({ apiName: namespace + meta })\n : withDefaults(meta);\n}\nfunction withDefaults({ apiName, description, displayName }) {\n return {\n apiName: namespace + apiName,\n displayName: displayName ?? apiName,\n description: description ?? displayName ?? apiName,\n };\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAOA,SAAS,MAAM,gBAAgB;AACtC,SAASC,SAAS,QAAQ,qBAAqB;AAC/C,OAAO,SAASC,6BAA6BA,CAACC,OAAO,EAAE;EACnD,MAAMC,YAAY,GAAGC,WAAW,CAACF,OAAO,CAAC;EACzC,EAAUA,OAAO,CAACG,IAAI,CAACC,KAAK,CAACC,IAAI,CAACC,CAAC,IAAIA,CAAC,CAACC,QAAQ,CAACC,OAAO,KAAKP,YAAY,CAACO,OAAO,CAAC,IAC5E,IAAI,IAAAC,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBADXd,SAAS,QACI,qBAAqBI,YAAY,CAACO,OAAO,sBAAsBR,OAAO,CAACQ,OAAO,EAAE,IAD7FX,SAAS;EAETG,OAAO,CAACG,IAAI,CAACC,KAAK,CAACQ,IAAI,CAAC;IACpBC,WAAW,EAAEb,OAAO,CAACc,MAAM,GAAG,MAAM,GAAG,QAAQ;IAC/CC,kBAAkB,EAAEC,aAAa,CAAChB,OAAO,CAACc,MAAM,IAAId,OAAO,CAACiB,KAAK,CAAC;IAClEV,QAAQ,EAAEN,YAAY;IACtBiB,QAAQ,EAAE,IAAI,CAAE;EACpB,CAAC,CAAC;AACN;AACA,SAASF,aAAaA,CAACG,CAAC,EAAE;EACtB,OAAO;IACHC,IAAI,EAAE,eAAe;IACrBC,aAAa,EAAE,OAAOF,CAAC,KAAK,QAAQ,GAAGA,CAAC,GAAGA,CAAC,CAACX;EACjD,CAAC;AACL;AACA,SAASN,WAAWA,CAACoB,IAAI,EAAE;EACvB,OAAO,OAAOA,IAAI,KAAK,QAAQ,GACzBC,YAAY,CAAC;IAAEf,OAAO,EAAEV,SAAS,GAAGwB;EAAK,CAAC,CAAC,GAC3CC,YAAY,CAACD,IAAI,CAAC;AAC5B;AACA,SAASC,YAAYA,CAAC;EAAEf,OAAO;EAAEgB,WAAW;EAAEC;AAAY,CAAC,EAAE;EACzD,OAAO;IACHjB,OAAO,EAAEV,SAAS,GAAGU,OAAO;IAC5BiB,WAAW,EAAEA,WAAW,IAAIjB,OAAO;IACnCgB,WAAW,EAAEA,WAAW,IAAIC,WAAW,IAAIjB;EAC/C,CAAC;AACL","ignoreList":[]}
@@ -18,8 +18,8 @@ export function defineLink(from, opts) {
18
18
  const apiName = opts.one ?? opts.many;
19
19
  const toApiName = opts.reverse.one ?? opts.reverse.many;
20
20
  const to = opts.to;
21
- !(from.linkTypes[apiName] == null) ? invariant(false, `Link with apiName ${apiName} already exists on ${from.data.objectType.apiName}`) : void 0;
22
- !(from.linkTypes[toApiName] == null) ? invariant(false, `Link with apiName ${toApiName} already exists on ${to.data.objectType.apiName}`) : void 0;
21
+ !(from.linkTypes[apiName] == null) ? process.env.NODE_ENV !== "production" ? invariant(false, `Link with apiName ${apiName} already exists on ${from.data.objectType.apiName}`) : invariant(false) : void 0;
22
+ !(from.linkTypes[toApiName] == null) ? process.env.NODE_ENV !== "production" ? invariant(false, `Link with apiName ${toApiName} already exists on ${to.data.objectType.apiName}`) : invariant(false) : void 0;
23
23
  from.linkTypes[apiName] = {
24
24
  cardinality: "ONE",
25
25
  displayName: apiName,
@@ -1 +1 @@
1
- {"version":3,"file":"defineLink.js","names":["invariant","defineLink","from","opts","apiName","one","many","toApiName","reverse","to","linkTypes","data","objectType","cardinality","displayName","objectTypeApiName","status"],"sources":["defineLink.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 invariant from \"tiny-invariant\";\nexport function defineLink(from, opts) {\n const apiName = opts.one ?? opts.many;\n const toApiName = opts.reverse.one ?? opts.reverse.many;\n const to = opts.to;\n invariant(from.linkTypes[apiName] == null, `Link with apiName ${apiName} already exists on ${from.data.objectType.apiName}`);\n invariant(from.linkTypes[toApiName] == null, `Link with apiName ${toApiName} already exists on ${to.data.objectType.apiName}`);\n from.linkTypes[apiName] = {\n cardinality: \"ONE\",\n displayName: apiName,\n objectTypeApiName: to.data.objectType.apiName,\n status: \"ACTIVE\",\n };\n to.linkTypes[toApiName] = {\n apiName: toApiName,\n cardinality: \"ONE\",\n displayName: apiName,\n objectTypeApiName: from.data.objectType.apiName,\n status: \"ACTIVE\",\n };\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAOA,SAAS,MAAM,gBAAgB;AACtC,OAAO,SAASC,UAAUA,CAACC,IAAI,EAAEC,IAAI,EAAE;EACnC,MAAMC,OAAO,GAAGD,IAAI,CAACE,GAAG,IAAIF,IAAI,CAACG,IAAI;EACrC,MAAMC,SAAS,GAAGJ,IAAI,CAACK,OAAO,CAACH,GAAG,IAAIF,IAAI,CAACK,OAAO,CAACF,IAAI;EACvD,MAAMG,EAAE,GAAGN,IAAI,CAACM,EAAE;EAClB,EAAUP,IAAI,CAACQ,SAAS,CAACN,OAAO,CAAC,IAAI,IAAI,IAAzCJ,SAAS,QAAkC,qBAAqBI,OAAO,sBAAsBF,IAAI,CAACS,IAAI,CAACC,UAAU,CAACR,OAAO,EAAE;EAC3H,EAAUF,IAAI,CAACQ,SAAS,CAACH,SAAS,CAAC,IAAI,IAAI,IAA3CP,SAAS,QAAoC,qBAAqBO,SAAS,sBAAsBE,EAAE,CAACE,IAAI,CAACC,UAAU,CAACR,OAAO,EAAE;EAC7HF,IAAI,CAACQ,SAAS,CAACN,OAAO,CAAC,GAAG;IACtBS,WAAW,EAAE,KAAK;IAClBC,WAAW,EAAEV,OAAO;IACpBW,iBAAiB,EAAEN,EAAE,CAACE,IAAI,CAACC,UAAU,CAACR,OAAO;IAC7CY,MAAM,EAAE;EACZ,CAAC;EACDP,EAAE,CAACC,SAAS,CAACH,SAAS,CAAC,GAAG;IACtBH,OAAO,EAAEG,SAAS;IAClBM,WAAW,EAAE,KAAK;IAClBC,WAAW,EAAEV,OAAO;IACpBW,iBAAiB,EAAEb,IAAI,CAACS,IAAI,CAACC,UAAU,CAACR,OAAO;IAC/CY,MAAM,EAAE;EACZ,CAAC;AACL","ignoreList":[]}
1
+ {"version":3,"file":"defineLink.js","names":["invariant","defineLink","from","opts","apiName","one","many","toApiName","reverse","to","linkTypes","process","env","NODE_ENV","data","objectType","cardinality","displayName","objectTypeApiName","status"],"sources":["defineLink.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 invariant from \"tiny-invariant\";\nexport function defineLink(from, opts) {\n const apiName = opts.one ?? opts.many;\n const toApiName = opts.reverse.one ?? opts.reverse.many;\n const to = opts.to;\n invariant(from.linkTypes[apiName] == null, `Link with apiName ${apiName} already exists on ${from.data.objectType.apiName}`);\n invariant(from.linkTypes[toApiName] == null, `Link with apiName ${toApiName} already exists on ${to.data.objectType.apiName}`);\n from.linkTypes[apiName] = {\n cardinality: \"ONE\",\n displayName: apiName,\n objectTypeApiName: to.data.objectType.apiName,\n status: \"ACTIVE\",\n };\n to.linkTypes[toApiName] = {\n apiName: toApiName,\n cardinality: \"ONE\",\n displayName: apiName,\n objectTypeApiName: from.data.objectType.apiName,\n status: \"ACTIVE\",\n };\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAOA,SAAS,MAAM,gBAAgB;AACtC,OAAO,SAASC,UAAUA,CAACC,IAAI,EAAEC,IAAI,EAAE;EACnC,MAAMC,OAAO,GAAGD,IAAI,CAACE,GAAG,IAAIF,IAAI,CAACG,IAAI;EACrC,MAAMC,SAAS,GAAGJ,IAAI,CAACK,OAAO,CAACH,GAAG,IAAIF,IAAI,CAACK,OAAO,CAACF,IAAI;EACvD,MAAMG,EAAE,GAAGN,IAAI,CAACM,EAAE;EAClB,EAAUP,IAAI,CAACQ,SAAS,CAACN,OAAO,CAAC,IAAI,IAAI,IAAAO,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAAzCb,SAAS,QAAkC,qBAAqBI,OAAO,sBAAsBF,IAAI,CAACY,IAAI,CAACC,UAAU,CAACX,OAAO,EAAE,IAA3HJ,SAAS;EACT,EAAUE,IAAI,CAACQ,SAAS,CAACH,SAAS,CAAC,IAAI,IAAI,IAAAI,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAA3Cb,SAAS,QAAoC,qBAAqBO,SAAS,sBAAsBE,EAAE,CAACK,IAAI,CAACC,UAAU,CAACX,OAAO,EAAE,IAA7HJ,SAAS;EACTE,IAAI,CAACQ,SAAS,CAACN,OAAO,CAAC,GAAG;IACtBY,WAAW,EAAE,KAAK;IAClBC,WAAW,EAAEb,OAAO;IACpBc,iBAAiB,EAAET,EAAE,CAACK,IAAI,CAACC,UAAU,CAACX,OAAO;IAC7Ce,MAAM,EAAE;EACZ,CAAC;EACDV,EAAE,CAACC,SAAS,CAACH,SAAS,CAAC,GAAG;IACtBH,OAAO,EAAEG,SAAS;IAClBS,WAAW,EAAE,KAAK;IAClBC,WAAW,EAAEb,OAAO;IACpBc,iBAAiB,EAAEhB,IAAI,CAACY,IAAI,CAACC,UAAU,CAACX,OAAO;IAC/Ce,MAAM,EAAE;EACZ,CAAC;AACL","ignoreList":[]}
@@ -81,6 +81,6 @@ function convertType(t) {
81
81
  type: t.type
82
82
  };
83
83
  }
84
- invariant(false);
84
+ process.env.NODE_ENV !== "production" ? invariant(false) : invariant(false);
85
85
  }
86
86
  //# sourceMappingURL=defineObject.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"defineObject.js","names":["invariant","ontologyDefinition","defineObject","apiName","opts","objectTypes","implementsInterfaces","implementsInterfaces2","linkTypes","objectType","primaryKey","displayName","pluralDisplayName","icon","color","name","type","properties","dataType","convertType","rid","status","titleProperty","sharedPropertyTypeMapping","data","t","multiplicity","subType","itemType"],"sources":["defineObject.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 invariant from \"tiny-invariant\";\nimport { ontologyDefinition } from \"./defineOntology.js\";\nexport function defineObject(apiName, opts) {\n ontologyDefinition.objectTypes[apiName] = {\n implementsInterfaces: [],\n implementsInterfaces2: {},\n linkTypes: [],\n objectType: {\n apiName,\n primaryKey: opts.primaryKey.apiName,\n displayName: opts.displayName ?? apiName,\n pluralDisplayName: opts.pluralDisplayName ?? apiName,\n icon: {\n color: \"blue\",\n name: \"cube\",\n type: \"blueprint\",\n },\n properties: {\n [opts.primaryKey.apiName]: {\n dataType: convertType(opts.primaryKey),\n },\n },\n rid: \"PLACEHOLDER\",\n status: \"ACTIVE\",\n titleProperty: opts.primaryKey.apiName,\n },\n sharedPropertyTypeMapping: {},\n };\n // FIXME: don't return the raw value\n return {\n data: ontologyDefinition.objectTypes[apiName],\n linkTypes: {},\n };\n}\nfunction convertType(t) {\n switch (true) {\n case t.multiplicity === true:\n return {\n type: \"array\",\n subType: convertType({ ...t, multiplicity: false }),\n };\n case t.type === \"stringTimeseries\":\n return {\n itemType: {\n type: \"string\",\n },\n type: \"timeseries\",\n };\n break;\n case t.type === \"numericTimeseries\":\n return {\n itemType: {\n type: \"double\",\n },\n type: \"timeseries\",\n };\n case t.type === \"datetime\":\n return {\n type: \"timestamp\",\n };\n default:\n return {\n type: t.type,\n };\n }\n invariant(false);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAOA,SAAS,MAAM,gBAAgB;AACtC,SAASC,kBAAkB,QAAQ,qBAAqB;AACxD,OAAO,SAASC,YAAYA,CAACC,OAAO,EAAEC,IAAI,EAAE;EACxCH,kBAAkB,CAACI,WAAW,CAACF,OAAO,CAAC,GAAG;IACtCG,oBAAoB,EAAE,EAAE;IACxBC,qBAAqB,EAAE,CAAC,CAAC;IACzBC,SAAS,EAAE,EAAE;IACbC,UAAU,EAAE;MACRN,OAAO;MACPO,UAAU,EAAEN,IAAI,CAACM,UAAU,CAACP,OAAO;MACnCQ,WAAW,EAAEP,IAAI,CAACO,WAAW,IAAIR,OAAO;MACxCS,iB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3,"file":"defineObject.js","names":["invariant","ontologyDefinition","defineObject","apiName","opts","objectTypes","implementsInterfaces","implementsInterfaces2","linkTypes","objectType","primaryKey","displayName","pluralDisplayName","icon","color","name","type","properties","dataType","convertType","rid","status","titleProperty","sharedPropertyTypeMapping","data","t","multiplicity","subType","itemType","process","env","NODE_ENV"],"sources":["defineObject.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 invariant from \"tiny-invariant\";\nimport { ontologyDefinition } from \"./defineOntology.js\";\nexport function defineObject(apiName, opts) {\n ontologyDefinition.objectTypes[apiName] = {\n implementsInterfaces: [],\n implementsInterfaces2: {},\n linkTypes: [],\n objectType: {\n apiName,\n primaryKey: opts.primaryKey.apiName,\n displayName: opts.displayName ?? apiName,\n pluralDisplayName: opts.pluralDisplayName ?? apiName,\n icon: {\n color: \"blue\",\n name: \"cube\",\n type: \"blueprint\",\n },\n properties: {\n [opts.primaryKey.apiName]: {\n dataType: convertType(opts.primaryKey),\n },\n },\n rid: \"PLACEHOLDER\",\n status: \"ACTIVE\",\n titleProperty: opts.primaryKey.apiName,\n },\n sharedPropertyTypeMapping: {},\n };\n // FIXME: don't return the raw value\n return {\n data: ontologyDefinition.objectTypes[apiName],\n linkTypes: {},\n };\n}\nfunction convertType(t) {\n switch (true) {\n case t.multiplicity === true:\n return {\n type: \"array\",\n subType: convertType({ ...t, multiplicity: false }),\n };\n case t.type === \"stringTimeseries\":\n return {\n itemType: {\n type: \"string\",\n },\n type: \"timeseries\",\n };\n break;\n case t.type === \"numericTimeseries\":\n return {\n itemType: {\n type: \"double\",\n },\n type: \"timeseries\",\n };\n case t.type === \"datetime\":\n return {\n type: \"timestamp\",\n };\n default:\n return {\n type: t.type,\n };\n }\n invariant(false);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAOA,SAAS,MAAM,gBAAgB;AACtC,SAASC,kBAAkB,QAAQ,qBAAqB;AACxD,OAAO,SAASC,YAAYA,CAACC,OAAO,EAAEC,IAAI,EAAE;EACxCH,kBAAkB,CAACI,WAAW,CAACF,OAAO,CAAC,GAAG;IACtCG,oBAAoB,EAAE,EAAE;IACxBC,qBAAqB,EAAE,CAAC,CAAC;IACzBC,SAAS,EAAE,EAAE;IACbC,UAAU,EAAE;MACRN,OAAO;MACPO,UAAU,EAAEN,IAAI,CAACM,UAAU,CAACP,OAAO;MACnCQ,WAAW,EAAEP,IAAI,CAACO,WAAW,IAAIR,OAAO;MACxCS,iBAAiB,EAAER,IAAI,CAACQ,iBAAiB,IAAIT,OAAO;MACpDU,IAAI,EAAE;QACFC,KAAK,EAAE,MAAM;QACbC,IAAI,EAAE,MAAM;QACZC,IAAI,EAAE;MACV,CAAC;MACDC,UAAU,EAAE;QACR,CAACb,IAAI,CAACM,UAAU,CAACP,OAAO,GAAG;UACvBe,QAAQ,EAAEC,WAAW,CAACf,IAAI,CAACM,UAAU;QACzC;MACJ,CAAC;MACDU,GAAG,EAAE,aAAa;MAClBC,MAAM,EAAE,QAAQ;MAChBC,aAAa,EAAElB,IAAI,CAACM,UAAU,CAACP;IACnC,CAAC;IACDoB,yBAAyB,EAAE,CAAC;EAChC,CAAC;EACD;EACA,OAAO;IACHC,IAAI,EAAEvB,kBAAkB,CAACI,WAAW,CAACF,OAAO,CAAC;IAC7CK,SAAS,EAAE,CAAC;EAChB,CAAC;AACL;AACA,SAASW,WAAWA,CAACM,CAAC,EAAE;EACpB,QAAQ,IAAI;IACR,KAAKA,CAAC,CAACC,YAAY,KAAK,IAAI;MACxB,OAAO;QACHV,IAAI,EAAE,OAAO;QACbW,OAAO,EAAER,WAAW,CAAC;UAAE,GAAGM,CAAC;UAAEC,YAAY,EAAE;QAAM,CAAC;MACtD,CAAC;IACL,KAAKD,CAAC,CAACT,IAAI,KAAK,kBAAkB;MAC9B,OAAO;QACHY,QAAQ,EAAE;UACNZ,IAAI,EAAE;QACV,CAAC;QACDA,IAAI,EAAE;MACV,CAAC;MACD;IACJ,KAAKS,CAAC,CAACT,IAAI,KAAK,mBAAmB;MAC/B,OAAO;QACHY,QAAQ,EAAE;UACNZ,IAAI,EAAE;QACV,CAAC;QACDA,IAAI,EAAE;MACV,CAAC;IACL,KAAKS,CAAC,CAACT,IAAI,KAAK,UAAU;MACtB,OAAO;QACHA,IAAI,EAAE;MACV,CAAC;IACL;MACI,OAAO;QACHA,IAAI,EAAES,CAAC,CAACT;MACZ,CAAC;EACT;EACAa,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAAA/B,SAAS,UAATA,SAAS;AACb","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"defineOntology.d.ts","sourceRoot":"","sources":["../../../src/api/defineOntology.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAGV,6BAA6B,EAG7B,4BAA4B,EAG7B,MAAM,uBAAuB,CAAC;AAc/B,KAAK,uBAAuB,GAAG;IAC7B,QAAQ,EAAE,6BAA6B,CAAC;IACxC,SAAS,EAAE,4BAA4B,CAAC;CACzC,CAAC;AAEF,wBAAsB,cAAc,CAClC,EAAE,EAAE,MAAM,EACV,IAAI,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,GAC/B,OAAO,CAAC,uBAAuB,CAAC,CA0BlC;AAsED,wBAAgB,wBAAwB,IAAI,6BAA6B,CAExE;AAED,wBAAgB,qBAAqB,IAAI,4BAA4B,CAEpE"}
1
+ {"version":3,"file":"defineOntology.d.ts","sourceRoot":"","sources":["../../../src/api/defineOntology.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAGV,6BAA6B,EAK7B,4BAA4B,EAI7B,MAAM,uBAAuB,CAAC;AAc/B,KAAK,uBAAuB,GAAG;IAC7B,QAAQ,EAAE,6BAA6B,CAAC;IACxC,SAAS,EAAE,4BAA4B,CAAC;CACzC,CAAC;AAEF,wBAAsB,cAAc,CAClC,EAAE,EAAE,MAAM,EACV,IAAI,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,GAC/B,OAAO,CAAC,uBAAuB,CAAC,CA0BlC;AAsED,wBAAgB,wBAAwB,IAAI,6BAA6B,CAExE;AAED,wBAAgB,qBAAqB,IAAI,4BAA4B,CAEpE"}