@osdk/maker 0.15.0-beta.7 → 0.15.0-beta.8

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 (49) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/README.md +26 -22
  3. package/build/browser/api/defineInterface.js.map +1 -1
  4. package/build/browser/api/defineOntology.js +6 -0
  5. package/build/browser/api/defineOntology.js.map +1 -1
  6. package/build/browser/api/defineValueType.js +17 -4
  7. package/build/browser/api/defineValueType.js.map +1 -1
  8. package/build/browser/api/interface/mapSimplifiedStatusToInterfaceTypeStatus.js +5 -0
  9. package/build/browser/api/interface/mapSimplifiedStatusToInterfaceTypeStatus.js.map +1 -1
  10. package/build/browser/api/links/LinkType.js.map +1 -1
  11. package/build/browser/api/object/ObjectTypeStatus.js.map +1 -1
  12. package/build/browser/api/test/interfaces.test.js +12 -0
  13. package/build/browser/api/test/interfaces.test.js.map +1 -1
  14. package/build/browser/api/test/valueTypes.test.js +69 -0
  15. package/build/browser/api/test/valueTypes.test.js.map +1 -1
  16. package/build/browser/cli/main.js +1 -1
  17. package/build/browser/conversion/toMarketplace/convertLink.js +30 -4
  18. package/build/browser/conversion/toMarketplace/convertLink.js.map +1 -1
  19. package/build/cjs/index.cjs +59 -9
  20. package/build/cjs/index.cjs.map +1 -1
  21. package/build/cjs/index.d.cts +26 -5
  22. package/build/esm/api/defineInterface.js.map +1 -1
  23. package/build/esm/api/defineOntology.js +6 -0
  24. package/build/esm/api/defineOntology.js.map +1 -1
  25. package/build/esm/api/defineValueType.js +17 -4
  26. package/build/esm/api/defineValueType.js.map +1 -1
  27. package/build/esm/api/interface/mapSimplifiedStatusToInterfaceTypeStatus.js +5 -0
  28. package/build/esm/api/interface/mapSimplifiedStatusToInterfaceTypeStatus.js.map +1 -1
  29. package/build/esm/api/links/LinkType.js.map +1 -1
  30. package/build/esm/api/object/ObjectTypeStatus.js.map +1 -1
  31. package/build/esm/api/test/interfaces.test.js +12 -0
  32. package/build/esm/api/test/interfaces.test.js.map +1 -1
  33. package/build/esm/api/test/valueTypes.test.js +69 -0
  34. package/build/esm/api/test/valueTypes.test.js.map +1 -1
  35. package/build/esm/cli/main.js +1 -1
  36. package/build/esm/conversion/toMarketplace/convertLink.js +30 -4
  37. package/build/esm/conversion/toMarketplace/convertLink.js.map +1 -1
  38. package/build/types/api/defineInterface.d.ts +2 -0
  39. package/build/types/api/defineInterface.d.ts.map +1 -1
  40. package/build/types/api/defineOntology.d.ts.map +1 -1
  41. package/build/types/api/defineValueType.d.ts +9 -0
  42. package/build/types/api/defineValueType.d.ts.map +1 -1
  43. package/build/types/api/links/LinkType.d.ts +16 -4
  44. package/build/types/api/links/LinkType.d.ts.map +1 -1
  45. package/build/types/api/object/ObjectTypeStatus.d.ts +1 -1
  46. package/build/types/api/object/ObjectTypeStatus.d.ts.map +1 -1
  47. package/build/types/conversion/toMarketplace/convertLink.d.ts +3 -2
  48. package/build/types/conversion/toMarketplace/convertLink.d.ts.map +1 -1
  49. package/package.json +4 -4
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.test.js","names":["beforeEach","describe","expect","it","defineInterface","defineOntology","dumpOntologyFullMetadata","defineSharedPropertyType","apiName","toThrowErrorMatchingInlineSnapshot","result","displayMetadata","displayName","toBe","description","properties","foo","type","ontology","toMatchInlineSnapshot","spt","required","sharedPropertyType","idp","structDefinition","field","fieldType","requireImplementation","optional","array","visibility","nullability","noEmptyCollections","noNulls","primaryKeyConstraint","parentInterface","property1","property2","extends","searchable","status","toEqual","active","experimental","message","deadline","deprecated"],"sources":["interfaces.test.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { beforeEach, describe, expect, it } from \"vitest\";\nimport { defineInterface } from \"../defineInterface.js\";\nimport { defineOntology, dumpOntologyFullMetadata } from \"../defineOntology.js\";\nimport { defineSharedPropertyType } from \"../defineSpt.js\";\n\ndescribe(\"Interfaces\", () => {\n beforeEach(async () => {\n await defineOntology(\"com.palantir.\", () => {}, \"/tmp/\");\n });\n\n it(\"doesn't let you define the same interface twice\", () => {\n defineInterface({ apiName: \"Foo\" });\n expect(() => {\n defineInterface({ apiName: \"Foo\" });\n }).toThrowErrorMatchingInlineSnapshot(\n `[Error: Invariant failed: Interface com.palantir.Foo already exists]`,\n );\n });\n\n it(\"defaults displayName to apiName\", () => {\n const result = defineInterface({ apiName: \"Foo\" });\n expect(result.displayMetadata.displayName).toBe(\"Foo\");\n });\n\n it(\"defaults description to displayName\", () => {\n const result = defineInterface({ apiName: \"Foo\", displayName: \"d\" });\n expect(result.displayMetadata.description).toBe(\"d\");\n });\n\n it(\"defaults description to displayName to apiName\", () => {\n const result = defineInterface({ apiName: \"Foo\" });\n expect(result.displayMetadata.description).toBe(\"Foo\");\n });\n\n describe(\"Auto IDPs\", () => {\n it(\"Auto creates IDPs\", () => {\n defineInterface({\n apiName: \"Foo\",\n properties: {\n foo: { type: \"string\" },\n },\n });\n expect(dumpOntologyFullMetadata().ontology).toMatchInlineSnapshot(`\n {\n \"actionTypes\": {},\n \"blockPermissionInformation\": {\n \"actionTypes\": {},\n \"linkTypes\": {},\n \"objectTypes\": {},\n },\n \"interfaceTypes\": {\n \"com.palantir.Foo\": {\n \"interfaceType\": {\n \"apiName\": \"com.palantir.Foo\",\n \"displayMetadata\": {\n \"description\": \"Foo\",\n \"displayName\": \"Foo\",\n \"icon\": {\n \"blueprint\": {\n \"color\": \"#4C90F0\",\n \"locator\": \"layout-hierarchy\",\n },\n \"type\": \"blueprint\",\n },\n },\n \"extendsInterfaces\": [],\n \"links\": [],\n \"properties\": [],\n \"propertiesV2\": {},\n \"propertiesV3\": {\n \"foo\": {\n \"interfaceDefinedPropertyType\": {\n \"apiName\": \"foo\",\n \"constraints\": {\n \"dataConstraints\": undefined,\n \"indexedForSearch\": true,\n \"primaryKeyConstraint\": \"NO_RESTRICTION\",\n \"requireImplementation\": true,\n \"typeClasses\": [],\n \"valueType\": undefined,\n },\n \"displayMetadata\": {\n \"description\": undefined,\n \"displayName\": \"foo\",\n \"visibility\": \"NORMAL\",\n },\n \"type\": {\n \"string\": {\n \"analyzerOverride\": undefined,\n \"enableAsciiFolding\": undefined,\n \"isLongText\": false,\n \"supportsEfficientLeadingWildcard\": false,\n \"supportsExactMatching\": true,\n },\n \"type\": \"string\",\n },\n },\n \"type\": \"interfaceDefinedPropertyType\",\n },\n },\n \"searchable\": true,\n \"status\": {\n \"active\": {},\n \"type\": \"active\",\n },\n },\n },\n },\n \"linkTypes\": {},\n \"objectTypes\": {},\n \"sharedPropertyTypes\": {},\n }\n `);\n });\n });\n\n describe(\"Interface properties\", () => {\n it(\"IDPs and SPTs on the same interface\", () => {\n const spt = defineSharedPropertyType({\n apiName: \"spt\",\n type: \"string\",\n });\n\n const iface = defineInterface({\n apiName: \"bar\",\n displayName: \"Bar\",\n properties: {\n \"foo\": { type: \"boolean\" },\n \"spt\": spt,\n },\n });\n expect(dumpOntologyFullMetadata().ontology).toMatchInlineSnapshot(`\n {\n \"actionTypes\": {},\n \"blockPermissionInformation\": {\n \"actionTypes\": {},\n \"linkTypes\": {},\n \"objectTypes\": {},\n },\n \"interfaceTypes\": {\n \"com.palantir.bar\": {\n \"interfaceType\": {\n \"apiName\": \"com.palantir.bar\",\n \"displayMetadata\": {\n \"description\": \"Bar\",\n \"displayName\": \"Bar\",\n \"icon\": {\n \"blueprint\": {\n \"color\": \"#4C90F0\",\n \"locator\": \"layout-hierarchy\",\n },\n \"type\": \"blueprint\",\n },\n },\n \"extendsInterfaces\": [],\n \"links\": [],\n \"properties\": [],\n \"propertiesV2\": {\n \"com.palantir.spt\": {\n \"required\": true,\n \"sharedPropertyType\": {\n \"aliases\": [],\n \"apiName\": \"com.palantir.spt\",\n \"baseFormatter\": undefined,\n \"dataConstraints\": undefined,\n \"displayMetadata\": {\n \"description\": undefined,\n \"displayName\": \"spt\",\n \"visibility\": \"NORMAL\",\n },\n \"gothamMapping\": undefined,\n \"indexedForSearch\": true,\n \"type\": {\n \"string\": {\n \"analyzerOverride\": undefined,\n \"enableAsciiFolding\": undefined,\n \"isLongText\": false,\n \"supportsEfficientLeadingWildcard\": false,\n \"supportsExactMatching\": true,\n },\n \"type\": \"string\",\n },\n \"typeClasses\": [\n {\n \"kind\": \"render_hint\",\n \"name\": \"SELECTABLE\",\n },\n {\n \"kind\": \"render_hint\",\n \"name\": \"SORTABLE\",\n },\n ],\n \"valueType\": undefined,\n },\n },\n },\n \"propertiesV3\": {\n \"com.palantir.spt\": {\n \"sharedPropertyBasedPropertyType\": {\n \"requireImplementation\": true,\n \"sharedPropertyType\": {\n \"aliases\": [],\n \"apiName\": \"com.palantir.spt\",\n \"baseFormatter\": undefined,\n \"dataConstraints\": undefined,\n \"displayMetadata\": {\n \"description\": undefined,\n \"displayName\": \"spt\",\n \"visibility\": \"NORMAL\",\n },\n \"gothamMapping\": undefined,\n \"indexedForSearch\": true,\n \"type\": {\n \"string\": {\n \"analyzerOverride\": undefined,\n \"enableAsciiFolding\": undefined,\n \"isLongText\": false,\n \"supportsEfficientLeadingWildcard\": false,\n \"supportsExactMatching\": true,\n },\n \"type\": \"string\",\n },\n \"typeClasses\": [\n {\n \"kind\": \"render_hint\",\n \"name\": \"SELECTABLE\",\n },\n {\n \"kind\": \"render_hint\",\n \"name\": \"SORTABLE\",\n },\n ],\n \"valueType\": undefined,\n },\n },\n \"type\": \"sharedPropertyBasedPropertyType\",\n },\n \"foo\": {\n \"interfaceDefinedPropertyType\": {\n \"apiName\": \"foo\",\n \"constraints\": {\n \"dataConstraints\": undefined,\n \"indexedForSearch\": true,\n \"primaryKeyConstraint\": \"NO_RESTRICTION\",\n \"requireImplementation\": true,\n \"typeClasses\": [],\n \"valueType\": undefined,\n },\n \"displayMetadata\": {\n \"description\": undefined,\n \"displayName\": \"foo\",\n \"visibility\": \"NORMAL\",\n },\n \"type\": {\n \"boolean\": {},\n \"type\": \"boolean\",\n },\n },\n \"type\": \"interfaceDefinedPropertyType\",\n },\n },\n \"searchable\": true,\n \"status\": {\n \"active\": {},\n \"type\": \"active\",\n },\n },\n },\n },\n \"linkTypes\": {},\n \"objectTypes\": {},\n \"sharedPropertyTypes\": {\n \"com.palantir.spt\": {\n \"sharedPropertyType\": {\n \"aliases\": [],\n \"apiName\": \"com.palantir.spt\",\n \"baseFormatter\": undefined,\n \"dataConstraints\": undefined,\n \"displayMetadata\": {\n \"description\": undefined,\n \"displayName\": \"spt\",\n \"visibility\": \"NORMAL\",\n },\n \"gothamMapping\": undefined,\n \"indexedForSearch\": true,\n \"type\": {\n \"string\": {\n \"analyzerOverride\": undefined,\n \"enableAsciiFolding\": undefined,\n \"isLongText\": false,\n \"supportsEfficientLeadingWildcard\": false,\n \"supportsExactMatching\": true,\n },\n \"type\": \"string\",\n },\n \"typeClasses\": [\n {\n \"kind\": \"render_hint\",\n \"name\": \"SELECTABLE\",\n },\n {\n \"kind\": \"render_hint\",\n \"name\": \"SORTABLE\",\n },\n ],\n \"valueType\": undefined,\n },\n },\n },\n }\n `);\n });\n\n it(\"supports optional properties\", () => {\n const spt = defineSharedPropertyType({\n apiName: \"spt\",\n type: \"string\",\n });\n const parentInterface = defineInterface({\n apiName: \"parentInterface\",\n properties: {\n spt: { required: false, sharedPropertyType: spt },\n idp: { required: false, type: \"string\" },\n },\n });\n\n expect(dumpOntologyFullMetadata().ontology).toMatchInlineSnapshot(`\n {\n \"actionTypes\": {},\n \"blockPermissionInformation\": {\n \"actionTypes\": {},\n \"linkTypes\": {},\n \"objectTypes\": {},\n },\n \"interfaceTypes\": {\n \"com.palantir.parentInterface\": {\n \"interfaceType\": {\n \"apiName\": \"com.palantir.parentInterface\",\n \"displayMetadata\": {\n \"description\": \"parentInterface\",\n \"displayName\": \"parentInterface\",\n \"icon\": {\n \"blueprint\": {\n \"color\": \"#4C90F0\",\n \"locator\": \"layout-hierarchy\",\n },\n \"type\": \"blueprint\",\n },\n },\n \"extendsInterfaces\": [],\n \"links\": [],\n \"properties\": [],\n \"propertiesV2\": {\n \"com.palantir.spt\": {\n \"required\": false,\n \"sharedPropertyType\": {\n \"aliases\": [],\n \"apiName\": \"com.palantir.spt\",\n \"baseFormatter\": undefined,\n \"dataConstraints\": undefined,\n \"displayMetadata\": {\n \"description\": undefined,\n \"displayName\": \"spt\",\n \"visibility\": \"NORMAL\",\n },\n \"gothamMapping\": undefined,\n \"indexedForSearch\": true,\n \"type\": {\n \"string\": {\n \"analyzerOverride\": undefined,\n \"enableAsciiFolding\": undefined,\n \"isLongText\": false,\n \"supportsEfficientLeadingWildcard\": false,\n \"supportsExactMatching\": true,\n },\n \"type\": \"string\",\n },\n \"typeClasses\": [\n {\n \"kind\": \"render_hint\",\n \"name\": \"SELECTABLE\",\n },\n {\n \"kind\": \"render_hint\",\n \"name\": \"SORTABLE\",\n },\n ],\n \"valueType\": undefined,\n },\n },\n },\n \"propertiesV3\": {\n \"com.palantir.spt\": {\n \"sharedPropertyBasedPropertyType\": {\n \"requireImplementation\": false,\n \"sharedPropertyType\": {\n \"aliases\": [],\n \"apiName\": \"com.palantir.spt\",\n \"baseFormatter\": undefined,\n \"dataConstraints\": undefined,\n \"displayMetadata\": {\n \"description\": undefined,\n \"displayName\": \"spt\",\n \"visibility\": \"NORMAL\",\n },\n \"gothamMapping\": undefined,\n \"indexedForSearch\": true,\n \"type\": {\n \"string\": {\n \"analyzerOverride\": undefined,\n \"enableAsciiFolding\": undefined,\n \"isLongText\": false,\n \"supportsEfficientLeadingWildcard\": false,\n \"supportsExactMatching\": true,\n },\n \"type\": \"string\",\n },\n \"typeClasses\": [\n {\n \"kind\": \"render_hint\",\n \"name\": \"SELECTABLE\",\n },\n {\n \"kind\": \"render_hint\",\n \"name\": \"SORTABLE\",\n },\n ],\n \"valueType\": undefined,\n },\n },\n \"type\": \"sharedPropertyBasedPropertyType\",\n },\n \"idp\": {\n \"interfaceDefinedPropertyType\": {\n \"apiName\": \"idp\",\n \"constraints\": {\n \"dataConstraints\": undefined,\n \"indexedForSearch\": true,\n \"primaryKeyConstraint\": \"NO_RESTRICTION\",\n \"requireImplementation\": false,\n \"typeClasses\": [],\n \"valueType\": undefined,\n },\n \"displayMetadata\": {\n \"description\": undefined,\n \"displayName\": \"idp\",\n \"visibility\": \"NORMAL\",\n },\n \"type\": {\n \"string\": {\n \"analyzerOverride\": undefined,\n \"enableAsciiFolding\": undefined,\n \"isLongText\": false,\n \"supportsEfficientLeadingWildcard\": false,\n \"supportsExactMatching\": true,\n },\n \"type\": \"string\",\n },\n },\n \"type\": \"interfaceDefinedPropertyType\",\n },\n },\n \"searchable\": true,\n \"status\": {\n \"active\": {},\n \"type\": \"active\",\n },\n },\n },\n },\n \"linkTypes\": {},\n \"objectTypes\": {},\n \"sharedPropertyTypes\": {\n \"com.palantir.spt\": {\n \"sharedPropertyType\": {\n \"aliases\": [],\n \"apiName\": \"com.palantir.spt\",\n \"baseFormatter\": undefined,\n \"dataConstraints\": undefined,\n \"displayMetadata\": {\n \"description\": undefined,\n \"displayName\": \"spt\",\n \"visibility\": \"NORMAL\",\n },\n \"gothamMapping\": undefined,\n \"indexedForSearch\": true,\n \"type\": {\n \"string\": {\n \"analyzerOverride\": undefined,\n \"enableAsciiFolding\": undefined,\n \"isLongText\": false,\n \"supportsEfficientLeadingWildcard\": false,\n \"supportsExactMatching\": true,\n },\n \"type\": \"string\",\n },\n \"typeClasses\": [\n {\n \"kind\": \"render_hint\",\n \"name\": \"SELECTABLE\",\n },\n {\n \"kind\": \"render_hint\",\n \"name\": \"SORTABLE\",\n },\n ],\n \"valueType\": undefined,\n },\n },\n },\n }\n `);\n });\n\n it(\"Struct IDPs\", () => {\n const iface = defineInterface({\n apiName: \"bar\",\n displayName: \"Bar\",\n properties: {\n \"struct\": {\n type: {\n type: \"struct\",\n structDefinition: {\n field: {\n fieldType: \"string\",\n requireImplementation: true,\n displayMetadata: {\n displayName: \"Field\",\n },\n },\n optional: \"string\",\n },\n },\n },\n },\n });\n expect(dumpOntologyFullMetadata().ontology).toMatchInlineSnapshot(`\n {\n \"actionTypes\": {},\n \"blockPermissionInformation\": {\n \"actionTypes\": {},\n \"linkTypes\": {},\n \"objectTypes\": {},\n },\n \"interfaceTypes\": {\n \"com.palantir.bar\": {\n \"interfaceType\": {\n \"apiName\": \"com.palantir.bar\",\n \"displayMetadata\": {\n \"description\": \"Bar\",\n \"displayName\": \"Bar\",\n \"icon\": {\n \"blueprint\": {\n \"color\": \"#4C90F0\",\n \"locator\": \"layout-hierarchy\",\n },\n \"type\": \"blueprint\",\n },\n },\n \"extendsInterfaces\": [],\n \"links\": [],\n \"properties\": [],\n \"propertiesV2\": {},\n \"propertiesV3\": {\n \"struct\": {\n \"interfaceDefinedPropertyType\": {\n \"apiName\": \"struct\",\n \"constraints\": {\n \"dataConstraints\": undefined,\n \"indexedForSearch\": true,\n \"primaryKeyConstraint\": \"NO_RESTRICTION\",\n \"requireImplementation\": true,\n \"typeClasses\": [],\n \"valueType\": undefined,\n },\n \"displayMetadata\": {\n \"description\": undefined,\n \"displayName\": \"struct\",\n \"visibility\": \"NORMAL\",\n },\n \"type\": {\n \"struct\": {\n \"structFields\": [\n {\n \"aliases\": [],\n \"apiName\": \"field\",\n \"displayMetadata\": {\n \"displayName\": \"Field\",\n },\n \"fieldType\": {\n \"string\": {\n \"analyzerOverride\": undefined,\n \"enableAsciiFolding\": undefined,\n \"isLongText\": false,\n \"supportsEfficientLeadingWildcard\": false,\n \"supportsExactMatching\": true,\n },\n \"type\": \"string\",\n },\n \"requireImplementation\": true,\n \"typeClasses\": [],\n },\n {\n \"aliases\": [],\n \"apiName\": \"optional\",\n \"displayMetadata\": {\n \"description\": undefined,\n \"displayName\": \"optional\",\n },\n \"fieldType\": {\n \"string\": {\n \"analyzerOverride\": undefined,\n \"enableAsciiFolding\": undefined,\n \"isLongText\": false,\n \"supportsEfficientLeadingWildcard\": false,\n \"supportsExactMatching\": true,\n },\n \"type\": \"string\",\n },\n \"requireImplementation\": true,\n \"typeClasses\": [],\n },\n ],\n },\n \"type\": \"struct\",\n },\n },\n \"type\": \"interfaceDefinedPropertyType\",\n },\n },\n \"searchable\": true,\n \"status\": {\n \"active\": {},\n \"type\": \"active\",\n },\n },\n },\n },\n \"linkTypes\": {},\n \"objectTypes\": {},\n \"sharedPropertyTypes\": {},\n }\n `);\n });\n\n it(\"Complex interface properties\", () => {\n const spt = defineSharedPropertyType({\n apiName: \"spt\",\n type: \"string\",\n array: true,\n description: \"Description\",\n displayName: \"Display Name\",\n visibility: \"HIDDEN\",\n nullability: {\n noEmptyCollections: true,\n noNulls: true,\n },\n });\n const parentInterface = defineInterface({\n apiName: \"parentInterface\",\n properties: {\n spt: { required: false, sharedPropertyType: spt },\n idp: {\n required: false,\n type: \"string\",\n primaryKeyConstraint: \"MUST_BE_PK\",\n array: true,\n description: \"Description\",\n displayName: \"Display Name\",\n visibility: \"HIDDEN\",\n nullability: {\n noEmptyCollections: true,\n noNulls: true,\n },\n },\n },\n });\n\n expect(dumpOntologyFullMetadata().ontology).toMatchInlineSnapshot(`\n {\n \"actionTypes\": {},\n \"blockPermissionInformation\": {\n \"actionTypes\": {},\n \"linkTypes\": {},\n \"objectTypes\": {},\n },\n \"interfaceTypes\": {\n \"com.palantir.parentInterface\": {\n \"interfaceType\": {\n \"apiName\": \"com.palantir.parentInterface\",\n \"displayMetadata\": {\n \"description\": \"parentInterface\",\n \"displayName\": \"parentInterface\",\n \"icon\": {\n \"blueprint\": {\n \"color\": \"#4C90F0\",\n \"locator\": \"layout-hierarchy\",\n },\n \"type\": \"blueprint\",\n },\n },\n \"extendsInterfaces\": [],\n \"links\": [],\n \"properties\": [],\n \"propertiesV2\": {\n \"com.palantir.spt\": {\n \"required\": false,\n \"sharedPropertyType\": {\n \"aliases\": [],\n \"apiName\": \"com.palantir.spt\",\n \"baseFormatter\": undefined,\n \"dataConstraints\": {\n \"nullability\": undefined,\n \"nullabilityV2\": {\n \"noEmptyCollections\": true,\n \"noNulls\": true,\n },\n \"propertyTypeConstraints\": [],\n },\n \"displayMetadata\": {\n \"description\": \"Description\",\n \"displayName\": \"Display Name\",\n \"visibility\": \"HIDDEN\",\n },\n \"gothamMapping\": undefined,\n \"indexedForSearch\": true,\n \"type\": {\n \"array\": {\n \"reducers\": [],\n \"subtype\": {\n \"string\": {\n \"analyzerOverride\": undefined,\n \"enableAsciiFolding\": undefined,\n \"isLongText\": false,\n \"supportsEfficientLeadingWildcard\": false,\n \"supportsExactMatching\": true,\n },\n \"type\": \"string\",\n },\n },\n \"type\": \"array\",\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 \"propertiesV3\": {\n \"com.palantir.spt\": {\n \"sharedPropertyBasedPropertyType\": {\n \"requireImplementation\": false,\n \"sharedPropertyType\": {\n \"aliases\": [],\n \"apiName\": \"com.palantir.spt\",\n \"baseFormatter\": undefined,\n \"dataConstraints\": {\n \"nullability\": undefined,\n \"nullabilityV2\": {\n \"noEmptyCollections\": true,\n \"noNulls\": true,\n },\n \"propertyTypeConstraints\": [],\n },\n \"displayMetadata\": {\n \"description\": \"Description\",\n \"displayName\": \"Display Name\",\n \"visibility\": \"HIDDEN\",\n },\n \"gothamMapping\": undefined,\n \"indexedForSearch\": true,\n \"type\": {\n \"array\": {\n \"reducers\": [],\n \"subtype\": {\n \"string\": {\n \"analyzerOverride\": undefined,\n \"enableAsciiFolding\": undefined,\n \"isLongText\": false,\n \"supportsEfficientLeadingWildcard\": false,\n \"supportsExactMatching\": true,\n },\n \"type\": \"string\",\n },\n },\n \"type\": \"array\",\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 \"type\": \"sharedPropertyBasedPropertyType\",\n },\n \"idp\": {\n \"interfaceDefinedPropertyType\": {\n \"apiName\": \"idp\",\n \"constraints\": {\n \"dataConstraints\": {\n \"nullability\": undefined,\n \"nullabilityV2\": {\n \"noEmptyCollections\": true,\n \"noNulls\": true,\n },\n \"propertyTypeConstraints\": [],\n },\n \"indexedForSearch\": true,\n \"primaryKeyConstraint\": \"MUST_BE_PK\",\n \"requireImplementation\": false,\n \"typeClasses\": [],\n \"valueType\": undefined,\n },\n \"displayMetadata\": {\n \"description\": \"Description\",\n \"displayName\": \"Display Name\",\n \"visibility\": \"HIDDEN\",\n },\n \"type\": {\n \"array\": {\n \"subtype\": {\n \"string\": {\n \"analyzerOverride\": undefined,\n \"enableAsciiFolding\": undefined,\n \"isLongText\": false,\n \"supportsEfficientLeadingWildcard\": false,\n \"supportsExactMatching\": true,\n },\n \"type\": \"string\",\n },\n },\n \"type\": \"array\",\n },\n },\n \"type\": \"interfaceDefinedPropertyType\",\n },\n },\n \"searchable\": true,\n \"status\": {\n \"active\": {},\n \"type\": \"active\",\n },\n },\n },\n },\n \"linkTypes\": {},\n \"objectTypes\": {},\n \"sharedPropertyTypes\": {\n \"com.palantir.spt\": {\n \"sharedPropertyType\": {\n \"aliases\": [],\n \"apiName\": \"com.palantir.spt\",\n \"baseFormatter\": undefined,\n \"dataConstraints\": {\n \"nullability\": undefined,\n \"nullabilityV2\": {\n \"noEmptyCollections\": true,\n \"noNulls\": true,\n },\n \"propertyTypeConstraints\": [],\n },\n \"displayMetadata\": {\n \"description\": \"Description\",\n \"displayName\": \"Display Name\",\n \"visibility\": \"HIDDEN\",\n },\n \"gothamMapping\": undefined,\n \"indexedForSearch\": true,\n \"type\": {\n \"array\": {\n \"reducers\": [],\n \"subtype\": {\n \"string\": {\n \"analyzerOverride\": undefined,\n \"enableAsciiFolding\": undefined,\n \"isLongText\": false,\n \"supportsEfficientLeadingWildcard\": false,\n \"supportsExactMatching\": true,\n },\n \"type\": \"string\",\n },\n },\n \"type\": \"array\",\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\n it(\"allows extends interfaces with apiName provided\", () => {\n const parentInterface = defineInterface({\n apiName: \"parentInterface\",\n properties: {\n property1: { type: \"string\" },\n },\n });\n const childInterface = defineInterface({\n apiName: \"childInterface\",\n properties: {\n property2: { type: \"string\" },\n },\n extends: parentInterface,\n });\n\n expect(dumpOntologyFullMetadata().ontology).toMatchInlineSnapshot(`\n {\n \"actionTypes\": {},\n \"blockPermissionInformation\": {\n \"actionTypes\": {},\n \"linkTypes\": {},\n \"objectTypes\": {},\n },\n \"interfaceTypes\": {\n \"com.palantir.childInterface\": {\n \"interfaceType\": {\n \"apiName\": \"com.palantir.childInterface\",\n \"displayMetadata\": {\n \"description\": \"childInterface\",\n \"displayName\": \"childInterface\",\n \"icon\": {\n \"blueprint\": {\n \"color\": \"#4C90F0\",\n \"locator\": \"layout-hierarchy\",\n },\n \"type\": \"blueprint\",\n },\n },\n \"extendsInterfaces\": [\n \"com.palantir.parentInterface\",\n ],\n \"links\": [],\n \"properties\": [],\n \"propertiesV2\": {},\n \"propertiesV3\": {\n \"property2\": {\n \"interfaceDefinedPropertyType\": {\n \"apiName\": \"property2\",\n \"constraints\": {\n \"dataConstraints\": undefined,\n \"indexedForSearch\": true,\n \"primaryKeyConstraint\": \"NO_RESTRICTION\",\n \"requireImplementation\": true,\n \"typeClasses\": [],\n \"valueType\": undefined,\n },\n \"displayMetadata\": {\n \"description\": undefined,\n \"displayName\": \"property2\",\n \"visibility\": \"NORMAL\",\n },\n \"type\": {\n \"string\": {\n \"analyzerOverride\": undefined,\n \"enableAsciiFolding\": undefined,\n \"isLongText\": false,\n \"supportsEfficientLeadingWildcard\": false,\n \"supportsExactMatching\": true,\n },\n \"type\": \"string\",\n },\n },\n \"type\": \"interfaceDefinedPropertyType\",\n },\n },\n \"searchable\": true,\n \"status\": {\n \"active\": {},\n \"type\": \"active\",\n },\n },\n },\n \"com.palantir.parentInterface\": {\n \"interfaceType\": {\n \"apiName\": \"com.palantir.parentInterface\",\n \"displayMetadata\": {\n \"description\": \"parentInterface\",\n \"displayName\": \"parentInterface\",\n \"icon\": {\n \"blueprint\": {\n \"color\": \"#4C90F0\",\n \"locator\": \"layout-hierarchy\",\n },\n \"type\": \"blueprint\",\n },\n },\n \"extendsInterfaces\": [],\n \"links\": [],\n \"properties\": [],\n \"propertiesV2\": {},\n \"propertiesV3\": {\n \"property1\": {\n \"interfaceDefinedPropertyType\": {\n \"apiName\": \"property1\",\n \"constraints\": {\n \"dataConstraints\": undefined,\n \"indexedForSearch\": true,\n \"primaryKeyConstraint\": \"NO_RESTRICTION\",\n \"requireImplementation\": true,\n \"typeClasses\": [],\n \"valueType\": undefined,\n },\n \"displayMetadata\": {\n \"description\": undefined,\n \"displayName\": \"property1\",\n \"visibility\": \"NORMAL\",\n },\n \"type\": {\n \"string\": {\n \"analyzerOverride\": undefined,\n \"enableAsciiFolding\": undefined,\n \"isLongText\": false,\n \"supportsEfficientLeadingWildcard\": false,\n \"supportsExactMatching\": true,\n },\n \"type\": \"string\",\n },\n },\n \"type\": \"interfaceDefinedPropertyType\",\n },\n },\n \"searchable\": true,\n \"status\": {\n \"active\": {},\n \"type\": \"active\",\n },\n },\n },\n },\n \"linkTypes\": {},\n \"objectTypes\": {},\n \"sharedPropertyTypes\": {},\n }\n `);\n });\n\n it(\"supports specifying searchable\", () => {\n const parentInterface = defineInterface({\n apiName: \"parentInterface\",\n searchable: false,\n });\n\n expect(dumpOntologyFullMetadata().ontology).toMatchInlineSnapshot(`\n {\n \"actionTypes\": {},\n \"blockPermissionInformation\": {\n \"actionTypes\": {},\n \"linkTypes\": {},\n \"objectTypes\": {},\n },\n \"interfaceTypes\": {\n \"com.palantir.parentInterface\": {\n \"interfaceType\": {\n \"apiName\": \"com.palantir.parentInterface\",\n \"displayMetadata\": {\n \"description\": \"parentInterface\",\n \"displayName\": \"parentInterface\",\n \"icon\": {\n \"blueprint\": {\n \"color\": \"#4C90F0\",\n \"locator\": \"layout-hierarchy\",\n },\n \"type\": \"blueprint\",\n },\n },\n \"extendsInterfaces\": [],\n \"links\": [],\n \"properties\": [],\n \"propertiesV2\": {},\n \"propertiesV3\": {},\n \"searchable\": false,\n \"status\": {\n \"active\": {},\n \"type\": \"active\",\n },\n },\n },\n },\n \"linkTypes\": {},\n \"objectTypes\": {},\n \"sharedPropertyTypes\": {},\n }\n `);\n });\n\n it(\"defaults interface status to active\", () => {\n const result = defineInterface({ apiName: \"Foo\" });\n expect(result.status).toEqual({ type: \"active\", active: {} });\n });\n\n it(\"sets interface status as experimental from opts\", () => {\n const experimentalStatus = {\n type: \"experimental\",\n experimental: {},\n };\n const result = defineInterface({\n apiName: \"Foo\",\n status: { type: \"experimental\" },\n });\n expect(result.status).toEqual(experimentalStatus);\n });\n\n it(\"sets interface status as deprecated from opts\", () => {\n const deprecatedStatus = {\n type: \"deprecated\",\n deprecated: {\n message: \"foo\",\n deadline: \"foo\",\n },\n };\n const result = defineInterface({\n apiName: \"Foo\",\n status: { type: \"deprecated\", message: \"foo\", deadline: \"foo\" },\n });\n expect(result.status).toEqual(deprecatedStatus);\n });\n});\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,UAAU,EAAEC,QAAQ,EAAEC,MAAM,EAAEC,EAAE,QAAQ,QAAQ;AACzD,SAASC,eAAe,QAAQ,uBAAuB;AACvD,SAASC,c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B,EAAE,MAAM;MAC5BC,eAAe,CAAC;QACdI,OAAO,EAAE,KAAK;QACdO,UAAU,EAAE;UACVC,GAAG,EAAE;YAAEC,IAAI,EAAE;UAAS;QACxB;MACF,CAAC,CAAC;MACFf,MAAM,CAACI,wBAAwB,CAAC,CAAC,CAACY,QAAQ,CAAC,CAACC,qBAAqB,CAAC;AACxE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,CAAC;IACJ,CAAC,CAAC;EACJ,CAAC,CAAC;EAEFlB,QAAQ,CAAC,sBAAsB,EAAE,MAAM;IACrCE,EAAE,CAAC,qCAAqC,EAAE,MAAM;MAC9C,MAAMiB,GAAG,GAAGb,wBAAwB,CAAC;QACnCC,OAAO,EAAE,KAAK;QACdS,IAAI,EAAE;MACR,CAAC,CAAC;MAEYb,eAAe,CAAC;QAC5BI,OAAO,EAAE,KAAK;QACdI,WAAW,EAAE,KAAK;QAClBG,UAAU,EAAE;UACV,KAAK,EAAE;YAAEE,IAAI,EAAE;UAAU,CAAC;UAC1B,KAAK,EAAEG;QACT;MACF,CAAC,CAAC;MACFlB,MAAM,CAACI,wBAAwB,CAAC,CAAC,CAACY,QAAQ,CAAC,CAACC,qBAAqB,CAAC;AACxE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,CAAC;IACJ,CAAC,CAAC;IAEFhB,EAAE,CAAC,8BAA8B,EAAE,MAAM;MACvC,MAAMiB,GAAG,GAAGb,wBAAwB,CAAC;QACnCC,OAAO,EAAE,KAAK;QACdS,IAAI,EAAE;MACR,CAAC,CAAC;MACsBb,eAAe,CAAC;QACtCI,OAAO,EAAE,iBAAiB;QAC1BO,UAAU,EAAE;UACVK,GAAG,EAAE;YAAEC,QAAQ,EAAE,KAAK;YAAEC,kBAAkB,EAAEF;UAAI,CAAC;UACjDG,GAAG,EAAE;YAAEF,QAAQ,EAAE,KAAK;YAAEJ,IAAI,EAAE;UAAS;QACzC;MACF,CAAC,CAAC;MAEFf,MAAM,CAACI,wBAAwB,CAAC,CAAC,CAACY,QAAQ,CAAC,CAACC,qBAAqB,CAAC;AACxE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK,CAAC;IACF,CAAC,CAAC;IAEFhB,EAAE,CAAC,aAAa,EAAE,MAAM;MACRC,eAAe,CAAC;QAC5BI,OAAO,EAAE,KAAK;QACdI,WAAW,EAAE,KAAK;QAClBG,UAAU,EAAE;UACV,QAAQ,EAAE;YACRE,IAAI,EAAE;cACJA,IAAI,EAAE,QAAQ;cACdO,gBAAgB,EAAE;gBAChBC,KAAK,EAAE;kBACLC,SAAS,EAAE,QAAQ;kBACnBC,qBAAqB,EAAE,IAAI;kBAC3BhB,eAAe,EAAE;oBACfC,WAAW,EAAE;kBACf;gBACF,CAAC;gBACDgB,QAAQ,EAAE;cACZ;YACF;UACF;QACF;MACF,CAAC,CAAC;MACF1B,MAAM,CAACI,wBAAwB,CAAC,CAAC,CAACY,QAAQ,CAAC,CAACC,qBAAqB,CAAC;AACxE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,CAAC;IACJ,CAAC,CAAC;IAEFhB,EAAE,CAAC,8BAA8B,EAAE,MAAM;MACvC,MAAMiB,GAAG,GAAGb,wBAAwB,CAAC;QACnCC,OAAO,EAAE,KAAK;QACdS,IAAI,EAAE,QAAQ;QACdY,KAAK,EAAE,IAAI;QACXf,WAAW,EAAE,aAAa;QAC1BF,WAAW,EAAE,cAAc;QAC3BkB,UAAU,EAAE,QAAQ;QACpBC,WAAW,EAAE;UACXC,kBAAkB,EAAE,IAAI;UACxBC,OAAO,EAAE;QACX;MACF,CAAC,CAAC;MACsB7B,eAAe,CAAC;QACtCI,OAAO,EAAE,iBAAiB;QAC1BO,UAAU,EAAE;UACVK,GAAG,EAAE;YAAEC,QAAQ,EAAE,KAAK;YAAEC,kBAAkB,EAAEF;UAAI,CAAC;UACjDG,GAAG,EAAE;YACHF,QAAQ,EAAE,KAAK;YACfJ,IAAI,EAAE,QAAQ;YACdiB,oBAAoB,EAAE,YAAY;YAClCL,KAAK,EAAE,IAAI;YACXf,WAAW,EAAE,aAAa;YAC1BF,WAAW,EAAE,cAAc;YAC3BkB,UAAU,EAAE,QAAQ;YACpBC,WAAW,EAAE;cACXC,kBAAkB,EAAE,IAAI;cACxBC,OAAO,EAAE;YACX;UACF;QACF;MACF,CAAC,CAAC;MAEF/B,MAAM,CAACI,wBAAwB,CAAC,CAAC,CAACY,QAAQ,CAAC,CAACC,qBAAqB,CAAC;AACxE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,CAAC;IACJ,CAAC,CAAC;EACJ,CAAC,CAAC;EAEFhB,EAAE,CAAC,iDAAiD,EAAE,MAAM;IAC1D,MAAMgC,eAAe,GAAG/B,eAAe,CAAC;MACtCI,OAAO,EAAE,iBAAiB;MAC1BO,UAAU,EAAE;QACVqB,SAAS,EAAE;UAAEnB,IAAI,EAAE;QAAS;MAC9B;IACF,CAAC,CAAC;IACqBb,eAAe,CAAC;MACrCI,OAAO,EAAE,gBAAgB;MACzBO,UAAU,EAAE;QACVsB,SAAS,EAAE;UAAEpB,IAAI,EAAE;QAAS;MAC9B,CAAC;MACDqB,OAAO,EAAEH;IACX,CAAC,CAAC;IAEFjC,MAAM,CAACI,wBAAwB,CAAC,CAAC,CAACY,QAAQ,CAAC,CAACC,qBAAqB,CAAC;AACtE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA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AM,EAAE;QAAEvB,IAAI,EAAE,YAAY;QAAE2B,OAAO,EAAE,KAAK;QAAEC,QAAQ,EAAE;MAAM;IAChE,CAAC,CAAC;IACF3C,MAAM,CAACQ,MAAM,CAAC8B,MAAM,CAAC,CAACC,OAAO,CAXJ;MACvBxB,IAAI,EAAE,YAAY;MAClB6B,UAAU,EAAE;QACVF,OAAO,EAAE,KAAK;QACdC,QAAQ,EAAE;MACZ;IACF,CAK8C,CAAC;EACjD,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"interfaces.test.js","names":["beforeEach","describe","expect","it","defineInterface","defineOntology","dumpOntologyFullMetadata","defineSharedPropertyType","apiName","toThrowErrorMatchingInlineSnapshot","result","displayMetadata","displayName","toBe","description","properties","foo","type","ontology","toMatchInlineSnapshot","spt","required","sharedPropertyType","idp","structDefinition","field","fieldType","requireImplementation","optional","array","visibility","nullability","noEmptyCollections","noNulls","primaryKeyConstraint","parentInterface","property1","property2","extends","searchable","status","toEqual","active","experimental","message","deadline","deprecated","example"],"sources":["interfaces.test.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { beforeEach, describe, expect, it } from \"vitest\";\nimport { defineInterface } from \"../defineInterface.js\";\nimport { defineOntology, dumpOntologyFullMetadata } from \"../defineOntology.js\";\nimport { defineSharedPropertyType } from \"../defineSpt.js\";\n\ndescribe(\"Interfaces\", () => {\n beforeEach(async () => {\n await defineOntology(\"com.palantir.\", () => {}, \"/tmp/\");\n });\n\n it(\"doesn't let you define the same interface twice\", () => {\n defineInterface({ apiName: \"Foo\" });\n expect(() => {\n defineInterface({ apiName: \"Foo\" });\n }).toThrowErrorMatchingInlineSnapshot(\n `[Error: Invariant failed: Interface com.palantir.Foo already exists]`,\n );\n });\n\n it(\"defaults displayName to apiName\", () => {\n const result = defineInterface({ apiName: \"Foo\" });\n expect(result.displayMetadata.displayName).toBe(\"Foo\");\n });\n\n it(\"defaults description to displayName\", () => {\n const result = defineInterface({ apiName: \"Foo\", displayName: \"d\" });\n expect(result.displayMetadata.description).toBe(\"d\");\n });\n\n it(\"defaults description to displayName to apiName\", () => {\n const result = defineInterface({ apiName: \"Foo\" });\n expect(result.displayMetadata.description).toBe(\"Foo\");\n });\n\n describe(\"Auto IDPs\", () => {\n it(\"Auto creates IDPs\", () => {\n defineInterface({\n apiName: \"Foo\",\n properties: {\n foo: { type: \"string\" },\n },\n });\n expect(dumpOntologyFullMetadata().ontology).toMatchInlineSnapshot(`\n {\n \"actionTypes\": {},\n \"blockPermissionInformation\": {\n \"actionTypes\": {},\n \"linkTypes\": {},\n \"objectTypes\": {},\n },\n \"interfaceTypes\": {\n \"com.palantir.Foo\": {\n \"interfaceType\": {\n \"apiName\": \"com.palantir.Foo\",\n \"displayMetadata\": {\n \"description\": \"Foo\",\n \"displayName\": \"Foo\",\n \"icon\": {\n \"blueprint\": {\n \"color\": \"#4C90F0\",\n \"locator\": \"layout-hierarchy\",\n },\n \"type\": \"blueprint\",\n },\n },\n \"extendsInterfaces\": [],\n \"links\": [],\n \"properties\": [],\n \"propertiesV2\": {},\n \"propertiesV3\": {\n \"foo\": {\n \"interfaceDefinedPropertyType\": {\n \"apiName\": \"foo\",\n \"constraints\": {\n \"dataConstraints\": undefined,\n \"indexedForSearch\": true,\n \"primaryKeyConstraint\": \"NO_RESTRICTION\",\n \"requireImplementation\": true,\n \"typeClasses\": [],\n \"valueType\": undefined,\n },\n \"displayMetadata\": {\n \"description\": undefined,\n \"displayName\": \"foo\",\n \"visibility\": \"NORMAL\",\n },\n \"type\": {\n \"string\": {\n \"analyzerOverride\": undefined,\n \"enableAsciiFolding\": undefined,\n \"isLongText\": false,\n \"supportsEfficientLeadingWildcard\": false,\n \"supportsExactMatching\": true,\n },\n \"type\": \"string\",\n },\n },\n \"type\": \"interfaceDefinedPropertyType\",\n },\n },\n \"searchable\": true,\n \"status\": {\n \"active\": {},\n \"type\": \"active\",\n },\n },\n },\n },\n \"linkTypes\": {},\n \"objectTypes\": {},\n \"sharedPropertyTypes\": {},\n }\n `);\n });\n });\n\n describe(\"Interface properties\", () => {\n it(\"IDPs and SPTs on the same interface\", () => {\n const spt = defineSharedPropertyType({\n apiName: \"spt\",\n type: \"string\",\n });\n\n const iface = defineInterface({\n apiName: \"bar\",\n displayName: \"Bar\",\n properties: {\n \"foo\": { type: \"boolean\" },\n \"spt\": spt,\n },\n });\n expect(dumpOntologyFullMetadata().ontology).toMatchInlineSnapshot(`\n {\n \"actionTypes\": {},\n \"blockPermissionInformation\": {\n \"actionTypes\": {},\n \"linkTypes\": {},\n \"objectTypes\": {},\n },\n \"interfaceTypes\": {\n \"com.palantir.bar\": {\n \"interfaceType\": {\n \"apiName\": \"com.palantir.bar\",\n \"displayMetadata\": {\n \"description\": \"Bar\",\n \"displayName\": \"Bar\",\n \"icon\": {\n \"blueprint\": {\n \"color\": \"#4C90F0\",\n \"locator\": \"layout-hierarchy\",\n },\n \"type\": \"blueprint\",\n },\n },\n \"extendsInterfaces\": [],\n \"links\": [],\n \"properties\": [],\n \"propertiesV2\": {\n \"com.palantir.spt\": {\n \"required\": true,\n \"sharedPropertyType\": {\n \"aliases\": [],\n \"apiName\": \"com.palantir.spt\",\n \"baseFormatter\": undefined,\n \"dataConstraints\": undefined,\n \"displayMetadata\": {\n \"description\": undefined,\n \"displayName\": \"spt\",\n \"visibility\": \"NORMAL\",\n },\n \"gothamMapping\": undefined,\n \"indexedForSearch\": true,\n \"type\": {\n \"string\": {\n \"analyzerOverride\": undefined,\n \"enableAsciiFolding\": undefined,\n \"isLongText\": false,\n \"supportsEfficientLeadingWildcard\": false,\n \"supportsExactMatching\": true,\n },\n \"type\": \"string\",\n },\n \"typeClasses\": [\n {\n \"kind\": \"render_hint\",\n \"name\": \"SELECTABLE\",\n },\n {\n \"kind\": \"render_hint\",\n \"name\": \"SORTABLE\",\n },\n ],\n \"valueType\": undefined,\n },\n },\n },\n \"propertiesV3\": {\n \"com.palantir.spt\": {\n \"sharedPropertyBasedPropertyType\": {\n \"requireImplementation\": true,\n \"sharedPropertyType\": {\n \"aliases\": [],\n \"apiName\": \"com.palantir.spt\",\n \"baseFormatter\": undefined,\n \"dataConstraints\": undefined,\n \"displayMetadata\": {\n \"description\": undefined,\n \"displayName\": \"spt\",\n \"visibility\": \"NORMAL\",\n },\n \"gothamMapping\": undefined,\n \"indexedForSearch\": true,\n \"type\": {\n \"string\": {\n \"analyzerOverride\": undefined,\n \"enableAsciiFolding\": undefined,\n \"isLongText\": false,\n \"supportsEfficientLeadingWildcard\": false,\n \"supportsExactMatching\": true,\n },\n \"type\": \"string\",\n },\n \"typeClasses\": [\n {\n \"kind\": \"render_hint\",\n \"name\": \"SELECTABLE\",\n },\n {\n \"kind\": \"render_hint\",\n \"name\": \"SORTABLE\",\n },\n ],\n \"valueType\": undefined,\n },\n },\n \"type\": \"sharedPropertyBasedPropertyType\",\n },\n \"foo\": {\n \"interfaceDefinedPropertyType\": {\n \"apiName\": \"foo\",\n \"constraints\": {\n \"dataConstraints\": undefined,\n \"indexedForSearch\": true,\n \"primaryKeyConstraint\": \"NO_RESTRICTION\",\n \"requireImplementation\": true,\n \"typeClasses\": [],\n \"valueType\": undefined,\n },\n \"displayMetadata\": {\n \"description\": undefined,\n \"displayName\": \"foo\",\n \"visibility\": \"NORMAL\",\n },\n \"type\": {\n \"boolean\": {},\n \"type\": \"boolean\",\n },\n },\n \"type\": \"interfaceDefinedPropertyType\",\n },\n },\n \"searchable\": true,\n \"status\": {\n \"active\": {},\n \"type\": \"active\",\n },\n },\n },\n },\n \"linkTypes\": {},\n \"objectTypes\": {},\n \"sharedPropertyTypes\": {\n \"com.palantir.spt\": {\n \"sharedPropertyType\": {\n \"aliases\": [],\n \"apiName\": \"com.palantir.spt\",\n \"baseFormatter\": undefined,\n \"dataConstraints\": undefined,\n \"displayMetadata\": {\n \"description\": undefined,\n \"displayName\": \"spt\",\n \"visibility\": \"NORMAL\",\n },\n \"gothamMapping\": undefined,\n \"indexedForSearch\": true,\n \"type\": {\n \"string\": {\n \"analyzerOverride\": undefined,\n \"enableAsciiFolding\": undefined,\n \"isLongText\": false,\n \"supportsEfficientLeadingWildcard\": false,\n \"supportsExactMatching\": true,\n },\n \"type\": \"string\",\n },\n \"typeClasses\": [\n {\n \"kind\": \"render_hint\",\n \"name\": \"SELECTABLE\",\n },\n {\n \"kind\": \"render_hint\",\n \"name\": \"SORTABLE\",\n },\n ],\n \"valueType\": undefined,\n },\n },\n },\n }\n `);\n });\n\n it(\"supports optional properties\", () => {\n const spt = defineSharedPropertyType({\n apiName: \"spt\",\n type: \"string\",\n });\n const parentInterface = defineInterface({\n apiName: \"parentInterface\",\n properties: {\n spt: { required: false, sharedPropertyType: spt },\n idp: { required: false, type: \"string\" },\n },\n });\n\n expect(dumpOntologyFullMetadata().ontology).toMatchInlineSnapshot(`\n {\n \"actionTypes\": {},\n \"blockPermissionInformation\": {\n \"actionTypes\": {},\n \"linkTypes\": {},\n \"objectTypes\": {},\n },\n \"interfaceTypes\": {\n \"com.palantir.parentInterface\": {\n \"interfaceType\": {\n \"apiName\": \"com.palantir.parentInterface\",\n \"displayMetadata\": {\n \"description\": \"parentInterface\",\n \"displayName\": \"parentInterface\",\n \"icon\": {\n \"blueprint\": {\n \"color\": \"#4C90F0\",\n \"locator\": \"layout-hierarchy\",\n },\n \"type\": \"blueprint\",\n },\n },\n \"extendsInterfaces\": [],\n \"links\": [],\n \"properties\": [],\n \"propertiesV2\": {\n \"com.palantir.spt\": {\n \"required\": false,\n \"sharedPropertyType\": {\n \"aliases\": [],\n \"apiName\": \"com.palantir.spt\",\n \"baseFormatter\": undefined,\n \"dataConstraints\": undefined,\n \"displayMetadata\": {\n \"description\": undefined,\n \"displayName\": \"spt\",\n \"visibility\": \"NORMAL\",\n },\n \"gothamMapping\": undefined,\n \"indexedForSearch\": true,\n \"type\": {\n \"string\": {\n \"analyzerOverride\": undefined,\n \"enableAsciiFolding\": undefined,\n \"isLongText\": false,\n \"supportsEfficientLeadingWildcard\": false,\n \"supportsExactMatching\": true,\n },\n \"type\": \"string\",\n },\n \"typeClasses\": [\n {\n \"kind\": \"render_hint\",\n \"name\": \"SELECTABLE\",\n },\n {\n \"kind\": \"render_hint\",\n \"name\": \"SORTABLE\",\n },\n ],\n \"valueType\": undefined,\n },\n },\n },\n \"propertiesV3\": {\n \"com.palantir.spt\": {\n \"sharedPropertyBasedPropertyType\": {\n \"requireImplementation\": false,\n \"sharedPropertyType\": {\n \"aliases\": [],\n \"apiName\": \"com.palantir.spt\",\n \"baseFormatter\": undefined,\n \"dataConstraints\": undefined,\n \"displayMetadata\": {\n \"description\": undefined,\n \"displayName\": \"spt\",\n \"visibility\": \"NORMAL\",\n },\n \"gothamMapping\": undefined,\n \"indexedForSearch\": true,\n \"type\": {\n \"string\": {\n \"analyzerOverride\": undefined,\n \"enableAsciiFolding\": undefined,\n \"isLongText\": false,\n \"supportsEfficientLeadingWildcard\": false,\n \"supportsExactMatching\": true,\n },\n \"type\": \"string\",\n },\n \"typeClasses\": [\n {\n \"kind\": \"render_hint\",\n \"name\": \"SELECTABLE\",\n },\n {\n \"kind\": \"render_hint\",\n \"name\": \"SORTABLE\",\n },\n ],\n \"valueType\": undefined,\n },\n },\n \"type\": \"sharedPropertyBasedPropertyType\",\n },\n \"idp\": {\n \"interfaceDefinedPropertyType\": {\n \"apiName\": \"idp\",\n \"constraints\": {\n \"dataConstraints\": undefined,\n \"indexedForSearch\": true,\n \"primaryKeyConstraint\": \"NO_RESTRICTION\",\n \"requireImplementation\": false,\n \"typeClasses\": [],\n \"valueType\": undefined,\n },\n \"displayMetadata\": {\n \"description\": undefined,\n \"displayName\": \"idp\",\n \"visibility\": \"NORMAL\",\n },\n \"type\": {\n \"string\": {\n \"analyzerOverride\": undefined,\n \"enableAsciiFolding\": undefined,\n \"isLongText\": false,\n \"supportsEfficientLeadingWildcard\": false,\n \"supportsExactMatching\": true,\n },\n \"type\": \"string\",\n },\n },\n \"type\": \"interfaceDefinedPropertyType\",\n },\n },\n \"searchable\": true,\n \"status\": {\n \"active\": {},\n \"type\": \"active\",\n },\n },\n },\n },\n \"linkTypes\": {},\n \"objectTypes\": {},\n \"sharedPropertyTypes\": {\n \"com.palantir.spt\": {\n \"sharedPropertyType\": {\n \"aliases\": [],\n \"apiName\": \"com.palantir.spt\",\n \"baseFormatter\": undefined,\n \"dataConstraints\": undefined,\n \"displayMetadata\": {\n \"description\": undefined,\n \"displayName\": \"spt\",\n \"visibility\": \"NORMAL\",\n },\n \"gothamMapping\": undefined,\n \"indexedForSearch\": true,\n \"type\": {\n \"string\": {\n \"analyzerOverride\": undefined,\n \"enableAsciiFolding\": undefined,\n \"isLongText\": false,\n \"supportsEfficientLeadingWildcard\": false,\n \"supportsExactMatching\": true,\n },\n \"type\": \"string\",\n },\n \"typeClasses\": [\n {\n \"kind\": \"render_hint\",\n \"name\": \"SELECTABLE\",\n },\n {\n \"kind\": \"render_hint\",\n \"name\": \"SORTABLE\",\n },\n ],\n \"valueType\": undefined,\n },\n },\n },\n }\n `);\n });\n\n it(\"Struct IDPs\", () => {\n const iface = defineInterface({\n apiName: \"bar\",\n displayName: \"Bar\",\n properties: {\n \"struct\": {\n type: {\n type: \"struct\",\n structDefinition: {\n field: {\n fieldType: \"string\",\n requireImplementation: true,\n displayMetadata: {\n displayName: \"Field\",\n },\n },\n optional: \"string\",\n },\n },\n },\n },\n });\n expect(dumpOntologyFullMetadata().ontology).toMatchInlineSnapshot(`\n {\n \"actionTypes\": {},\n \"blockPermissionInformation\": {\n \"actionTypes\": {},\n \"linkTypes\": {},\n \"objectTypes\": {},\n },\n \"interfaceTypes\": {\n \"com.palantir.bar\": {\n \"interfaceType\": {\n \"apiName\": \"com.palantir.bar\",\n \"displayMetadata\": {\n \"description\": \"Bar\",\n \"displayName\": \"Bar\",\n \"icon\": {\n \"blueprint\": {\n \"color\": \"#4C90F0\",\n \"locator\": \"layout-hierarchy\",\n },\n \"type\": \"blueprint\",\n },\n },\n \"extendsInterfaces\": [],\n \"links\": [],\n \"properties\": [],\n \"propertiesV2\": {},\n \"propertiesV3\": {\n \"struct\": {\n \"interfaceDefinedPropertyType\": {\n \"apiName\": \"struct\",\n \"constraints\": {\n \"dataConstraints\": undefined,\n \"indexedForSearch\": true,\n \"primaryKeyConstraint\": \"NO_RESTRICTION\",\n \"requireImplementation\": true,\n \"typeClasses\": [],\n \"valueType\": undefined,\n },\n \"displayMetadata\": {\n \"description\": undefined,\n \"displayName\": \"struct\",\n \"visibility\": \"NORMAL\",\n },\n \"type\": {\n \"struct\": {\n \"structFields\": [\n {\n \"aliases\": [],\n \"apiName\": \"field\",\n \"displayMetadata\": {\n \"displayName\": \"Field\",\n },\n \"fieldType\": {\n \"string\": {\n \"analyzerOverride\": undefined,\n \"enableAsciiFolding\": undefined,\n \"isLongText\": false,\n \"supportsEfficientLeadingWildcard\": false,\n \"supportsExactMatching\": true,\n },\n \"type\": \"string\",\n },\n \"requireImplementation\": true,\n \"typeClasses\": [],\n },\n {\n \"aliases\": [],\n \"apiName\": \"optional\",\n \"displayMetadata\": {\n \"description\": undefined,\n \"displayName\": \"optional\",\n },\n \"fieldType\": {\n \"string\": {\n \"analyzerOverride\": undefined,\n \"enableAsciiFolding\": undefined,\n \"isLongText\": false,\n \"supportsEfficientLeadingWildcard\": false,\n \"supportsExactMatching\": true,\n },\n \"type\": \"string\",\n },\n \"requireImplementation\": true,\n \"typeClasses\": [],\n },\n ],\n },\n \"type\": \"struct\",\n },\n },\n \"type\": \"interfaceDefinedPropertyType\",\n },\n },\n \"searchable\": true,\n \"status\": {\n \"active\": {},\n \"type\": \"active\",\n },\n },\n },\n },\n \"linkTypes\": {},\n \"objectTypes\": {},\n \"sharedPropertyTypes\": {},\n }\n `);\n });\n\n it(\"Complex interface properties\", () => {\n const spt = defineSharedPropertyType({\n apiName: \"spt\",\n type: \"string\",\n array: true,\n description: \"Description\",\n displayName: \"Display Name\",\n visibility: \"HIDDEN\",\n nullability: {\n noEmptyCollections: true,\n noNulls: true,\n },\n });\n const parentInterface = defineInterface({\n apiName: \"parentInterface\",\n properties: {\n spt: { required: false, sharedPropertyType: spt },\n idp: {\n required: false,\n type: \"string\",\n primaryKeyConstraint: \"MUST_BE_PK\",\n array: true,\n description: \"Description\",\n displayName: \"Display Name\",\n visibility: \"HIDDEN\",\n nullability: {\n noEmptyCollections: true,\n noNulls: true,\n },\n },\n },\n });\n\n expect(dumpOntologyFullMetadata().ontology).toMatchInlineSnapshot(`\n {\n \"actionTypes\": {},\n \"blockPermissionInformation\": {\n \"actionTypes\": {},\n \"linkTypes\": {},\n \"objectTypes\": {},\n },\n \"interfaceTypes\": {\n \"com.palantir.parentInterface\": {\n \"interfaceType\": {\n \"apiName\": \"com.palantir.parentInterface\",\n \"displayMetadata\": {\n \"description\": \"parentInterface\",\n \"displayName\": \"parentInterface\",\n \"icon\": {\n \"blueprint\": {\n \"color\": \"#4C90F0\",\n \"locator\": \"layout-hierarchy\",\n },\n \"type\": \"blueprint\",\n },\n },\n \"extendsInterfaces\": [],\n \"links\": [],\n \"properties\": [],\n \"propertiesV2\": {\n \"com.palantir.spt\": {\n \"required\": false,\n \"sharedPropertyType\": {\n \"aliases\": [],\n \"apiName\": \"com.palantir.spt\",\n \"baseFormatter\": undefined,\n \"dataConstraints\": {\n \"nullability\": undefined,\n \"nullabilityV2\": {\n \"noEmptyCollections\": true,\n \"noNulls\": true,\n },\n \"propertyTypeConstraints\": [],\n },\n \"displayMetadata\": {\n \"description\": \"Description\",\n \"displayName\": \"Display Name\",\n \"visibility\": \"HIDDEN\",\n },\n \"gothamMapping\": undefined,\n \"indexedForSearch\": true,\n \"type\": {\n \"array\": {\n \"reducers\": [],\n \"subtype\": {\n \"string\": {\n \"analyzerOverride\": undefined,\n \"enableAsciiFolding\": undefined,\n \"isLongText\": false,\n \"supportsEfficientLeadingWildcard\": false,\n \"supportsExactMatching\": true,\n },\n \"type\": \"string\",\n },\n },\n \"type\": \"array\",\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 \"propertiesV3\": {\n \"com.palantir.spt\": {\n \"sharedPropertyBasedPropertyType\": {\n \"requireImplementation\": false,\n \"sharedPropertyType\": {\n \"aliases\": [],\n \"apiName\": \"com.palantir.spt\",\n \"baseFormatter\": undefined,\n \"dataConstraints\": {\n \"nullability\": undefined,\n \"nullabilityV2\": {\n \"noEmptyCollections\": true,\n \"noNulls\": true,\n },\n \"propertyTypeConstraints\": [],\n },\n \"displayMetadata\": {\n \"description\": \"Description\",\n \"displayName\": \"Display Name\",\n \"visibility\": \"HIDDEN\",\n },\n \"gothamMapping\": undefined,\n \"indexedForSearch\": true,\n \"type\": {\n \"array\": {\n \"reducers\": [],\n \"subtype\": {\n \"string\": {\n \"analyzerOverride\": undefined,\n \"enableAsciiFolding\": undefined,\n \"isLongText\": false,\n \"supportsEfficientLeadingWildcard\": false,\n \"supportsExactMatching\": true,\n },\n \"type\": \"string\",\n },\n },\n \"type\": \"array\",\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 \"type\": \"sharedPropertyBasedPropertyType\",\n },\n \"idp\": {\n \"interfaceDefinedPropertyType\": {\n \"apiName\": \"idp\",\n \"constraints\": {\n \"dataConstraints\": {\n \"nullability\": undefined,\n \"nullabilityV2\": {\n \"noEmptyCollections\": true,\n \"noNulls\": true,\n },\n \"propertyTypeConstraints\": [],\n },\n \"indexedForSearch\": true,\n \"primaryKeyConstraint\": \"MUST_BE_PK\",\n \"requireImplementation\": false,\n \"typeClasses\": [],\n \"valueType\": undefined,\n },\n \"displayMetadata\": {\n \"description\": \"Description\",\n \"displayName\": \"Display Name\",\n \"visibility\": \"HIDDEN\",\n },\n \"type\": {\n \"array\": {\n \"subtype\": {\n \"string\": {\n \"analyzerOverride\": undefined,\n \"enableAsciiFolding\": undefined,\n \"isLongText\": false,\n \"supportsEfficientLeadingWildcard\": false,\n \"supportsExactMatching\": true,\n },\n \"type\": \"string\",\n },\n },\n \"type\": \"array\",\n },\n },\n \"type\": \"interfaceDefinedPropertyType\",\n },\n },\n \"searchable\": true,\n \"status\": {\n \"active\": {},\n \"type\": \"active\",\n },\n },\n },\n },\n \"linkTypes\": {},\n \"objectTypes\": {},\n \"sharedPropertyTypes\": {\n \"com.palantir.spt\": {\n \"sharedPropertyType\": {\n \"aliases\": [],\n \"apiName\": \"com.palantir.spt\",\n \"baseFormatter\": undefined,\n \"dataConstraints\": {\n \"nullability\": undefined,\n \"nullabilityV2\": {\n \"noEmptyCollections\": true,\n \"noNulls\": true,\n },\n \"propertyTypeConstraints\": [],\n },\n \"displayMetadata\": {\n \"description\": \"Description\",\n \"displayName\": \"Display Name\",\n \"visibility\": \"HIDDEN\",\n },\n \"gothamMapping\": undefined,\n \"indexedForSearch\": true,\n \"type\": {\n \"array\": {\n \"reducers\": [],\n \"subtype\": {\n \"string\": {\n \"analyzerOverride\": undefined,\n \"enableAsciiFolding\": undefined,\n \"isLongText\": false,\n \"supportsEfficientLeadingWildcard\": false,\n \"supportsExactMatching\": true,\n },\n \"type\": \"string\",\n },\n },\n \"type\": \"array\",\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\n it(\"allows extends interfaces with apiName provided\", () => {\n const parentInterface = defineInterface({\n apiName: \"parentInterface\",\n properties: {\n property1: { type: \"string\" },\n },\n });\n const childInterface = defineInterface({\n apiName: \"childInterface\",\n properties: {\n property2: { type: \"string\" },\n },\n extends: parentInterface,\n });\n\n expect(dumpOntologyFullMetadata().ontology).toMatchInlineSnapshot(`\n {\n \"actionTypes\": {},\n \"blockPermissionInformation\": {\n \"actionTypes\": {},\n \"linkTypes\": {},\n \"objectTypes\": {},\n },\n \"interfaceTypes\": {\n \"com.palantir.childInterface\": {\n \"interfaceType\": {\n \"apiName\": \"com.palantir.childInterface\",\n \"displayMetadata\": {\n \"description\": \"childInterface\",\n \"displayName\": \"childInterface\",\n \"icon\": {\n \"blueprint\": {\n \"color\": \"#4C90F0\",\n \"locator\": \"layout-hierarchy\",\n },\n \"type\": \"blueprint\",\n },\n },\n \"extendsInterfaces\": [\n \"com.palantir.parentInterface\",\n ],\n \"links\": [],\n \"properties\": [],\n \"propertiesV2\": {},\n \"propertiesV3\": {\n \"property2\": {\n \"interfaceDefinedPropertyType\": {\n \"apiName\": \"property2\",\n \"constraints\": {\n \"dataConstraints\": undefined,\n \"indexedForSearch\": true,\n \"primaryKeyConstraint\": \"NO_RESTRICTION\",\n \"requireImplementation\": true,\n \"typeClasses\": [],\n \"valueType\": undefined,\n },\n \"displayMetadata\": {\n \"description\": undefined,\n \"displayName\": \"property2\",\n \"visibility\": \"NORMAL\",\n },\n \"type\": {\n \"string\": {\n \"analyzerOverride\": undefined,\n \"enableAsciiFolding\": undefined,\n \"isLongText\": false,\n \"supportsEfficientLeadingWildcard\": false,\n \"supportsExactMatching\": true,\n },\n \"type\": \"string\",\n },\n },\n \"type\": \"interfaceDefinedPropertyType\",\n },\n },\n \"searchable\": true,\n \"status\": {\n \"active\": {},\n \"type\": \"active\",\n },\n },\n },\n \"com.palantir.parentInterface\": {\n \"interfaceType\": {\n \"apiName\": \"com.palantir.parentInterface\",\n \"displayMetadata\": {\n \"description\": \"parentInterface\",\n \"displayName\": \"parentInterface\",\n \"icon\": {\n \"blueprint\": {\n \"color\": \"#4C90F0\",\n \"locator\": \"layout-hierarchy\",\n },\n \"type\": \"blueprint\",\n },\n },\n \"extendsInterfaces\": [],\n \"links\": [],\n \"properties\": [],\n \"propertiesV2\": {},\n \"propertiesV3\": {\n \"property1\": {\n \"interfaceDefinedPropertyType\": {\n \"apiName\": \"property1\",\n \"constraints\": {\n \"dataConstraints\": undefined,\n \"indexedForSearch\": true,\n \"primaryKeyConstraint\": \"NO_RESTRICTION\",\n \"requireImplementation\": true,\n \"typeClasses\": [],\n \"valueType\": undefined,\n },\n \"displayMetadata\": {\n \"description\": undefined,\n \"displayName\": \"property1\",\n \"visibility\": \"NORMAL\",\n },\n \"type\": {\n \"string\": {\n \"analyzerOverride\": undefined,\n \"enableAsciiFolding\": undefined,\n \"isLongText\": false,\n \"supportsEfficientLeadingWildcard\": false,\n \"supportsExactMatching\": true,\n },\n \"type\": \"string\",\n },\n },\n \"type\": \"interfaceDefinedPropertyType\",\n },\n },\n \"searchable\": true,\n \"status\": {\n \"active\": {},\n \"type\": \"active\",\n },\n },\n },\n },\n \"linkTypes\": {},\n \"objectTypes\": {},\n \"sharedPropertyTypes\": {},\n }\n `);\n });\n\n it(\"supports specifying searchable\", () => {\n const parentInterface = defineInterface({\n apiName: \"parentInterface\",\n searchable: false,\n });\n\n expect(dumpOntologyFullMetadata().ontology).toMatchInlineSnapshot(`\n {\n \"actionTypes\": {},\n \"blockPermissionInformation\": {\n \"actionTypes\": {},\n \"linkTypes\": {},\n \"objectTypes\": {},\n },\n \"interfaceTypes\": {\n \"com.palantir.parentInterface\": {\n \"interfaceType\": {\n \"apiName\": \"com.palantir.parentInterface\",\n \"displayMetadata\": {\n \"description\": \"parentInterface\",\n \"displayName\": \"parentInterface\",\n \"icon\": {\n \"blueprint\": {\n \"color\": \"#4C90F0\",\n \"locator\": \"layout-hierarchy\",\n },\n \"type\": \"blueprint\",\n },\n },\n \"extendsInterfaces\": [],\n \"links\": [],\n \"properties\": [],\n \"propertiesV2\": {},\n \"propertiesV3\": {},\n \"searchable\": false,\n \"status\": {\n \"active\": {},\n \"type\": \"active\",\n },\n },\n },\n },\n \"linkTypes\": {},\n \"objectTypes\": {},\n \"sharedPropertyTypes\": {},\n }\n `);\n });\n\n it(\"defaults interface status to active\", () => {\n const result = defineInterface({ apiName: \"Foo\" });\n expect(result.status).toEqual({ type: \"active\", active: {} });\n });\n\n it(\"sets interface status as experimental from opts\", () => {\n const experimentalStatus = {\n type: \"experimental\",\n experimental: {},\n };\n const result = defineInterface({\n apiName: \"Foo\",\n status: { type: \"experimental\" },\n });\n expect(result.status).toEqual(experimentalStatus);\n });\n\n it(\"sets interface status as deprecated from opts\", () => {\n const deprecatedStatus = {\n type: \"deprecated\",\n deprecated: {\n message: \"foo\",\n deadline: \"foo\",\n },\n };\n const result = defineInterface({\n apiName: \"Foo\",\n status: { type: \"deprecated\", message: \"foo\", deadline: \"foo\" },\n });\n expect(result.status).toEqual(deprecatedStatus);\n });\n\n it(\"sets interface status as example from opts\", () => {\n const exampleStatus = {\n type: \"example\",\n example: {},\n };\n const result = defineInterface({\n apiName: \"Foo\",\n status: { type: \"example\" },\n });\n expect(result.status).toEqual(exampleStatus);\n });\n});\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,UAAU,EAAEC,QAAQ,EAAEC,MAAM,EAAEC,EAAE,QAAQ,QAAQ;AACzD,SAASC,eAAe,QAAQ,uBAAuB;AACvD,SAASC,cAAc,EAAEC,wBAAwB,QAAQ,sBAAsB;AAC/E,SAASC,wBAAwB,QAAQ,iBAAiB;AAE1DN,QAAQ,CAAC,YAAY,EAAE,MAAM;EAC3BD,UAAU,CAAC,YAAY;IACrB,MAAMK,cAAc,CAAC,eAAe,EAAE,MAA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,CAACY,QAAQ,CAAC,CAACC,qBAAqB,CAAC;AACxE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,CAAC;IACJ,CAAC,CAAC;EACJ,CAAC,CAAC;EAEFlB,QAAQ,CAAC,sBAAsB,EAAE,MAAM;IACrCE,EAAE,CAAC,qCAAqC,EAAE,MAAM;MAC9C,MAAMiB,GAAG,GAAGb,wBAAwB,CAAC;QACnCC,OAAO,EAAE,KAAK;QACdS,IAAI,EAAE;MACR,CAAC,CAAC;MAEYb,eAAe,CAAC;QAC5BI,OAAO,EAAE,KAAK;QACdI,WAAW,EAAE,KAAK;QAClBG,UAAU,EAAE;UACV,KAAK,EAAE;YAAEE,IAAI,EAAE;UAAU,CAAC;UAC1B,KAAK,EAAEG;QACT;MACF,CAAC,CAAC;MACFlB,MAAM,CAACI,wBAAwB,CAAC,CAAC,CAACY,QAAQ,CAAC,CAACC,qBAAqB,CAAC;AACxE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,CAAC;IACJ,CAAC,CAAC;IAEFhB,EAAE,CAAC,8BAA8B,EAAE,MAAM;MACvC,MAAMiB,GAAG,GAAGb,wBAAwB,CAAC;QACnCC,OAAO,EAAE,KAAK;QACdS,IAAI,EAAE;MACR,CAAC,CAAC;MACsBb,eAAe,CAAC;QACtCI,OAAO,EAAE,iBAAiB;QAC1BO,UAAU,EAAE;UACVK,GAAG,EAAE;YAAEC,QAAQ,EAAE,KAAK;YAAEC,kBAAkB,EAAEF;UAAI,CAAC;UACjDG,GAAG,EAAE;YAAEF,QAAQ,EAAE,KAAK;YAAEJ,IAAI,EAAE;UAAS;QACzC;MACF,CAAC,CAAC;MAEFf,MAAM,CAACI,wBAAwB,CAAC,CAAC,CAACY,QAAQ,CAAC,CAACC,qBAAqB,CAAC;AACxE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK,CAAC;IACF,CAAC,CAAC;IAEFhB,EAAE,CAAC,aAAa,EAAE,MAAM;MACRC,eAAe,CAAC;QAC5BI,OAAO,EAAE,KAAK;QACdI,WAAW,EAAE,KAAK;QAClBG,UAAU,EAAE;UACV,QAAQ,EAAE;YACRE,IAAI,EAAE;cACJA,IAAI,EAAE,QAAQ;cACdO,gBAAgB,EAAE;gBAChBC,KAAK,EAAE;kBACLC,SAAS,EAAE,QAAQ;kBACnBC,qBAAqB,EAAE,IAAI;kBAC3BhB,eAAe,EAAE;oBACfC,WAAW,EAAE;kBACf;gBACF,CAAC;gBACDgB,QAAQ,EAAE;cACZ;YACF;UACF;QACF;MACF,CAAC,CAAC;MACF1B,MAAM,CAACI,wBAAwB,CAAC,CAAC,CAACY,QAAQ,CAAC,CAACC,qBAAqB,CAAC;AACxE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,CAAC;IACJ,CAAC,CAAC;IAEFhB,EAAE,CAAC,8BAA8B,EAAE,MAAM;MACvC,MAAMiB,GAAG,GAAGb,wBAAwB,CAAC;QACnCC,OAAO,EAAE,KAAK;QACdS,IAAI,EAAE,QAAQ;QACdY,KAAK,EAAE,IAAI;QACXf,WAAW,EAAE,aAAa;QAC1BF,WAAW,EAAE,cAAc;QAC3BkB,UAAU,EAAE,QAAQ;QACpBC,WAAW,EAAE;UACXC,kBAAkB,EAAE,IAAI;UACxBC,OAAO,EAAE;QACX;MACF,CAAC,CAAC;MACsB7B,eAAe,CAAC;QACtCI,OAAO,EAAE,iBAAiB;QAC1BO,UAAU,EAAE;UACVK,GAAG,EAAE;YAAEC,QAAQ,EAAE,KAAK;YAAEC,kBAAkB,EAAEF;UAAI,CAAC;UACjDG,GAAG,EAAE;YACHF,QAAQ,EAAE,KAAK;YACfJ,IAAI,EAAE,QAAQ;YACdiB,oBAAoB,EAAE,YAAY;YAClCL,KAAK,EAAE,IAAI;YACXf,WAAW,EAAE,aAAa;YAC1BF,WAAW,EAAE,cAAc;YAC3BkB,UAAU,EAAE,QAAQ;YACpBC,WAAW,EAAE;cACXC,kBAAkB,EAAE,IAAI;cACxBC,OAAO,EAAE;YACX;UACF;QACF;MACF,CAAC,CAAC;MAEF/B,MAAM,CAACI,wBAAwB,CAAC,CAAC,CAACY,QAAQ,CAAC,CAACC,qBAAqB,CAAC;AACxE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,CAAC;IACJ,CAAC,CAAC;EACJ,CAAC,CAAC;EAEFhB,EAAE,CAAC,iDAAiD,EAAE,MAAM;IAC1D,MAAMgC,eAAe,GAAG/B,eAAe,CAAC;MACtCI,OAAO,EAAE,iBAAiB;MAC1BO,UAAU,EAAE;QACVqB,SAAS,EAAE;UAAEnB,IAAI,EAAE;QAAS;MAC9B;IACF,CAAC,CAAC;IACqBb,eAAe,CAAC;MACrCI,OAAO,EAAE,gBAAgB;MACzBO,UAAU,EAAE;QACVsB,SAAS,EAAE;UAAEpB,IAAI,EAAE;QAAS;MAC9B,CAAC;MACDqB,OAAO,EAAEH;IACX,CAAC,CAAC;IAEFjC,MAAM,CAACI,wBAAwB,CAAC,CAAC,CAACY,QAAQ,CAAC,CAACC,qBAAqB,CAAC;AACtE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;EACJ,CAAC,CAAC;EAEFhB,EAAE,CAAC,gCAAgC,EAAE,MAAM;IACjBC,eAAe,CAAC;MACtCI,OAAO,EAAE,iBAAiB;MAC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,IAAI,EAAE,YAAY;MAClB6B,UAAU,EAAE;QACVF,OAAO,EAAE,KAAK;QACdC,QAAQ,EAAE;MACZ;IACF,CAK8C,CAAC;EACjD,CAAC,CAAC;EAEF1C,EAAE,CAAC,4CAA4C,EAAE,MAAM;IAKrD,MAAMO,MAAM,GAAGN,eAAe,CAAC;MAC7BI,OAAO,EAAE,KAAK;MACdgC,MAAM,EAAE;QAAEvB,IAAI,EAAE;MAAU;IAC5B,CAAC,CAAC;IACFf,MAAM,CAACQ,MAAM,CAAC8B,MAAM,CAAC,CAACC,OAAO,CARP;MACpBxB,IAAI,EAAE,SAAS;MACf8B,OAAO,EAAE,CAAC;IACZ,CAK2C,CAAC;EAC9C,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
@@ -152,5 +152,74 @@ describe("Value Types", () => {
152
152
  }
153
153
  `);
154
154
  });
155
+ it("Correctly sets a status", () => {
156
+ defineValueType({
157
+ apiName: "apiName",
158
+ displayName: "displayName",
159
+ type: {
160
+ "type": "boolean",
161
+ constraints: [{
162
+ constraint: {
163
+ "allowedValues": ["TRUE_VALUE"]
164
+ }
165
+ }]
166
+ },
167
+ status: {
168
+ type: "deprecated",
169
+ deadline: "2026-01-01",
170
+ message: "This value type is deprecated"
171
+ },
172
+ version: "0.1.0"
173
+ });
174
+ expect(dumpValueTypeWireType()).toMatchInlineSnapshot(`
175
+ {
176
+ "valueTypes": [
177
+ {
178
+ "metadata": {
179
+ "apiName": "apiName",
180
+ "displayMetadata": {
181
+ "description": "",
182
+ "displayName": "displayName",
183
+ },
184
+ "packageNamespace": "com.palantir",
185
+ "status": {
186
+ "deprecated": {
187
+ "deadline": "2026-01-01",
188
+ "message": "This value type is deprecated",
189
+ "replacedBy": undefined,
190
+ },
191
+ "type": "deprecated",
192
+ },
193
+ },
194
+ "versions": [
195
+ {
196
+ "baseType": {
197
+ "boolean": {},
198
+ "type": "boolean",
199
+ },
200
+ "constraints": [
201
+ {
202
+ "constraint": {
203
+ "constraint": {
204
+ "boolean": {
205
+ "allowedValues": [
206
+ "TRUE_VALUE",
207
+ ],
208
+ },
209
+ "type": "boolean",
210
+ },
211
+ "failureMessage": undefined,
212
+ },
213
+ },
214
+ ],
215
+ "exampleValues": [],
216
+ "version": "0.1.0",
217
+ },
218
+ ],
219
+ },
220
+ ],
221
+ }
222
+ `);
223
+ });
155
224
  });
156
225
  //# sourceMappingURL=valueTypes.test.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"valueTypes.test.js","names":["beforeEach","describe","expect","it","defineObject","defineOntology","dumpOntologyFullMetadata","dumpValueTypeWireType","defineValueType","apiName","displayName","type","constraints","constraint","version","toThrowErrorMatchingInlineSnapshot","testStringValueType","description","length","minSize","maxSize","failureMessage","message","titlePropertyApiName","pluralDisplayName","primaryKeyPropertyApiName","properties","valueType","ontology","objectPropertyType","objectTypes","objectType","propertyTypes","toEqual","packageNamespace","displayMetadata","dataConstraints","toBeDefined","propertyTypeConstraints","toHaveLength","constraintWrapper","toBe","string","toMatchInlineSnapshot"],"sources":["valueTypes.test.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { beforeEach, describe, expect, it } from \"vitest\";\nimport { defineObject } from \"../defineObject.js\";\nimport {\n defineOntology,\n dumpOntologyFullMetadata,\n dumpValueTypeWireType,\n} from \"../defineOntology.js\";\nimport { defineValueType } from \"../defineValueType.js\";\n\ndescribe(\"Value Types\", () => {\n beforeEach(async () => {\n await defineOntology(\"com.palantir.\", () => {}, \"/tmp/\");\n });\n\n it(\"Fails to define value type with incorrect semver\", () => {\n expect(() =>\n defineValueType({\n apiName: \"apiName\",\n displayName: \"displayName\",\n type: {\n \"type\": \"boolean\",\n constraints: [{ constraint: { \"allowedValues\": [\"TRUE_VALUE\"] } }],\n },\n version: \"not a version\",\n })\n ).toThrowErrorMatchingInlineSnapshot(\n \"[Error: Invariant failed: Version is not a valid semver]\",\n );\n });\n\n it(\"Tests convertProperty function with valueType constraints for string\", () => {\n const testStringValueType = defineValueType({\n apiName: \"stringWithConstraints\",\n displayName: \"String With Constraints\",\n description: \"A string type with additional constraints\",\n type: {\n \"type\": \"string\",\n constraints: [\n {\n constraint: {\n type: \"length\",\n length: {\n minSize: 5,\n maxSize: 20,\n },\n },\n failureMessage: {\n message: \"String must be between 5 and 20 characters\",\n },\n },\n ],\n },\n version: \"1.0.0\",\n });\n\n const object = defineObject({\n titlePropertyApiName: \"constrainedString\",\n displayName: \"Test Object\",\n pluralDisplayName: \"Test Objects\",\n apiName: \"testObject\",\n primaryKeyPropertyApiName: \"constrainedString\",\n properties: {\n \"constrainedString\": {\n type: \"string\",\n displayName: \"Constrained String\",\n valueType: testStringValueType,\n },\n },\n });\n\n const ontology = dumpOntologyFullMetadata();\n const objectPropertyType =\n ontology.ontology.objectTypes[\"com.palantir.testObject\"]\n .objectType.propertyTypes[\"constrainedString\"];\n\n expect(objectPropertyType.valueType).toEqual({\n apiName: \"stringWithConstraints\",\n version: \"1.0.0\",\n packageNamespace: \"com.palantir\",\n displayMetadata: {\n displayName: \"String With Constraints\",\n description: \"A string type with additional constraints\",\n },\n });\n\n expect(objectPropertyType.dataConstraints).toBeDefined();\n expect(objectPropertyType.dataConstraints?.propertyTypeConstraints)\n .toHaveLength(1);\n\n const constraintWrapper = objectPropertyType.dataConstraints\n ?.propertyTypeConstraints[0];\n expect(constraintWrapper?.constraints?.type).toBe(\"string\");\n expect(\n (constraintWrapper?.constraints as {\n type: \"string\";\n string: { length: { minSize: number; maxSize: number } };\n }).string.length.minSize,\n ).toBe(5);\n expect(\n (constraintWrapper?.constraints as {\n type: \"string\";\n string: { length: { minSize: number; maxSize: number } };\n }).string.length.maxSize,\n ).toBe(20);\n expect(constraintWrapper?.failureMessage?.message).toBe(\n \"String must be between 5 and 20 characters\",\n );\n });\n\n it(\"Correctly serializes a value type\", () => {\n defineValueType({\n apiName: \"apiName\",\n displayName: \"displayName\",\n type: {\n \"type\": \"boolean\",\n constraints: [{ constraint: { \"allowedValues\": [\"TRUE_VALUE\"] } }],\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 \"packageNamespace\": \"com.palantir\",\n \"status\": {\n \"active\": {},\n \"type\": \"active\",\n },\n },\n \"versions\": [\n {\n \"baseType\": {\n \"boolean\": {},\n \"type\": \"boolean\",\n },\n \"constraints\": [\n {\n \"constraint\": {\n \"constraint\": {\n \"boolean\": {\n \"allowedValues\": [\n \"TRUE_VALUE\",\n ],\n },\n \"type\": \"boolean\",\n },\n \"failureMessage\": undefined,\n },\n },\n ],\n \"exampleValues\": [],\n \"version\": \"0.1.0\",\n },\n ],\n },\n ],\n }\n `);\n });\n});\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,UAAU,EAAEC,QAAQ,EAAEC,MAAM,EAAEC,EAAE,QAAQ,QAAQ;AACzD,SAASC,YAAY,QAAQ,oBAAoB;AACjD,SACEC,cAAc,EACdC,wBAAwB,EACxBC,qBAAqB,QAChB,sBAAsB;AAC7B,SAASC,eAAe,QAAQ,uBAAuB;AAEvDP,QAAQ,CAAC,aAAa,EAAE,MAAM;EAC5BD,UAAU,CAAC,YAAY;IACrB,MAAMK,cAAc,CAAC,eAAe,EAAE,MAAM,CAAC,CAAC,EAAE,OAAO,CAAC;EAC1D,CAA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AE;YAAE,eAAe,EAAE,CAAC,YAAY;UAAE;QAAE,CAAC;MACnE,CAAC;MACDC,OAAO,EAAE;IACX,CAAC,CAAC;IACFZ,MAAM,CAACK,qBAAqB,CAAC,CAAC,CAAC,CAACoC,qBAAqB,CAAC;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;EACN,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"valueTypes.test.js","names":["beforeEach","describe","expect","it","defineObject","defineOntology","dumpOntologyFullMetadata","dumpValueTypeWireType","defineValueType","apiName","displayName","type","constraints","constraint","version","toThrowErrorMatchingInlineSnapshot","testStringValueType","description","length","minSize","maxSize","failureMessage","message","titlePropertyApiName","pluralDisplayName","primaryKeyPropertyApiName","properties","valueType","ontology","objectPropertyType","objectTypes","objectType","propertyTypes","toEqual","packageNamespace","displayMetadata","dataConstraints","toBeDefined","propertyTypeConstraints","toHaveLength","constraintWrapper","toBe","string","toMatchInlineSnapshot","status","deadline"],"sources":["valueTypes.test.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { beforeEach, describe, expect, it } from \"vitest\";\nimport { defineObject } from \"../defineObject.js\";\nimport {\n defineOntology,\n dumpOntologyFullMetadata,\n dumpValueTypeWireType,\n} from \"../defineOntology.js\";\nimport { defineValueType } from \"../defineValueType.js\";\n\ndescribe(\"Value Types\", () => {\n beforeEach(async () => {\n await defineOntology(\"com.palantir.\", () => {}, \"/tmp/\");\n });\n\n it(\"Fails to define value type with incorrect semver\", () => {\n expect(() =>\n defineValueType({\n apiName: \"apiName\",\n displayName: \"displayName\",\n type: {\n \"type\": \"boolean\",\n constraints: [{ constraint: { \"allowedValues\": [\"TRUE_VALUE\"] } }],\n },\n version: \"not a version\",\n })\n ).toThrowErrorMatchingInlineSnapshot(\n \"[Error: Invariant failed: Version is not a valid semver]\",\n );\n });\n\n it(\"Tests convertProperty function with valueType constraints for string\", () => {\n const testStringValueType = defineValueType({\n apiName: \"stringWithConstraints\",\n displayName: \"String With Constraints\",\n description: \"A string type with additional constraints\",\n type: {\n \"type\": \"string\",\n constraints: [\n {\n constraint: {\n type: \"length\",\n length: {\n minSize: 5,\n maxSize: 20,\n },\n },\n failureMessage: {\n message: \"String must be between 5 and 20 characters\",\n },\n },\n ],\n },\n version: \"1.0.0\",\n });\n\n const object = defineObject({\n titlePropertyApiName: \"constrainedString\",\n displayName: \"Test Object\",\n pluralDisplayName: \"Test Objects\",\n apiName: \"testObject\",\n primaryKeyPropertyApiName: \"constrainedString\",\n properties: {\n \"constrainedString\": {\n type: \"string\",\n displayName: \"Constrained String\",\n valueType: testStringValueType,\n },\n },\n });\n\n const ontology = dumpOntologyFullMetadata();\n const objectPropertyType =\n ontology.ontology.objectTypes[\"com.palantir.testObject\"]\n .objectType.propertyTypes[\"constrainedString\"];\n\n expect(objectPropertyType.valueType).toEqual({\n apiName: \"stringWithConstraints\",\n version: \"1.0.0\",\n packageNamespace: \"com.palantir\",\n displayMetadata: {\n displayName: \"String With Constraints\",\n description: \"A string type with additional constraints\",\n },\n });\n\n expect(objectPropertyType.dataConstraints).toBeDefined();\n expect(objectPropertyType.dataConstraints?.propertyTypeConstraints)\n .toHaveLength(1);\n\n const constraintWrapper = objectPropertyType.dataConstraints\n ?.propertyTypeConstraints[0];\n expect(constraintWrapper?.constraints?.type).toBe(\"string\");\n expect(\n (constraintWrapper?.constraints as {\n type: \"string\";\n string: { length: { minSize: number; maxSize: number } };\n }).string.length.minSize,\n ).toBe(5);\n expect(\n (constraintWrapper?.constraints as {\n type: \"string\";\n string: { length: { minSize: number; maxSize: number } };\n }).string.length.maxSize,\n ).toBe(20);\n expect(constraintWrapper?.failureMessage?.message).toBe(\n \"String must be between 5 and 20 characters\",\n );\n });\n\n it(\"Correctly serializes a value type\", () => {\n defineValueType({\n apiName: \"apiName\",\n displayName: \"displayName\",\n type: {\n \"type\": \"boolean\",\n constraints: [{ constraint: { \"allowedValues\": [\"TRUE_VALUE\"] } }],\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 \"packageNamespace\": \"com.palantir\",\n \"status\": {\n \"active\": {},\n \"type\": \"active\",\n },\n },\n \"versions\": [\n {\n \"baseType\": {\n \"boolean\": {},\n \"type\": \"boolean\",\n },\n \"constraints\": [\n {\n \"constraint\": {\n \"constraint\": {\n \"boolean\": {\n \"allowedValues\": [\n \"TRUE_VALUE\",\n ],\n },\n \"type\": \"boolean\",\n },\n \"failureMessage\": undefined,\n },\n },\n ],\n \"exampleValues\": [],\n \"version\": \"0.1.0\",\n },\n ],\n },\n ],\n }\n `);\n });\n it(\"Correctly sets a status\", () => {\n defineValueType({\n apiName: \"apiName\",\n displayName: \"displayName\",\n type: {\n \"type\": \"boolean\",\n constraints: [{ constraint: { \"allowedValues\": [\"TRUE_VALUE\"] } }],\n },\n status: {\n type: \"deprecated\",\n deadline: \"2026-01-01\",\n message: \"This value type is deprecated\",\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 \"packageNamespace\": \"com.palantir\",\n \"status\": {\n \"deprecated\": {\n \"deadline\": \"2026-01-01\",\n \"message\": \"This value type is deprecated\",\n \"replacedBy\": undefined,\n },\n \"type\": \"deprecated\",\n },\n },\n \"versions\": [\n {\n \"baseType\": {\n \"boolean\": {},\n \"type\": \"boolean\",\n },\n \"constraints\": [\n {\n \"constraint\": {\n \"constraint\": {\n \"boolean\": {\n \"allowedValues\": [\n \"TRUE_VALUE\",\n ],\n },\n \"type\": \"boolean\",\n },\n \"failureMessage\": undefined,\n },\n },\n ],\n \"exampleValues\": [],\n \"version\": \"0.1.0\",\n },\n ],\n },\n ],\n }\n `);\n });\n});\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,UAAU,EAAEC,QAAQ,EAAEC,MAAM,EAAEC,EAAE,QAAQ,QAAQ;AACzD,SAASC,YAAY,QAAQ,oBAAoB;AACjD,SACEC,cAAc,EACdC,wBAAwB,EACxBC,qBAAqB,QAChB,sBAAsB;AAC7B,SAASC,eAAe,QAAQ,uBAAuB;AAEvDP,QAAQ,CAAC,aAAa,EAAE,MAAM;EAC5BD,UAAU,CAAC,YAAY;IACrB,MAAMK,cAAc,CAAC,eAAe,EAAE,MAAM,CAAC,CAAC,EAAE,OAAO,CAAC;EAC1D,CAAC,CAAC;EAEFF,EAAE,CAAC,kDAAkD,EAAE,MAAM;IAC3DD,MAAM,CAAC,MACLM,eAAe,CAAC;MACdC,OAAO,EAAE,SAAS;MAClBC,WAAW,EAAE,aAAa;MAC1BC,IAAI,EAAE;QACJ,MAAM,EAAE,SAAS;QACjBC,WAAW,EAAE,CAAC;UAAEC,UAAU,EAAE;YAAE,eAAe,EAAE,CAAC,YAAY;UAAE;QAAE,CAAC;MACnE,CAAC;MACDC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ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,CAAC;EACN,CAAC,CAAC;EACFxC,EAAE,CAAC,yBAAyB,EAAE,MAAM;IAClCK,eAAe,CAAC;MACdC,OAAO,EAAE,SAAS;MAClBC,WAAW,EAAE,aAAa;MAC1BC,IAAI,EAAE;QACJ,MAAM,EAAE,SAAS;QACjBC,WAAW,EAAE,CAAC;UAAEC,UAAU,EAAE;YAAE,eAAe,EAAE,CAAC,YAAY;UAAE;QAAE,CAAC;MACnE,CAAC;MACD+B,MAAM,EAAE;QACNjC,IAAI,EAAE,YAAY;QAClBkC,QAAQ,EAAE,YAAY;QACtBvB,OAAO,EAAE;MACX,CAAC;MACDR,OAAO,EAAE;IACX,CAAC,CAAC;IACFZ,MAAM,CAACK,qBAAqB,CAAC,CAAC,CAAC,CAACoC,qBAAqB,CAAC;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;EACJ,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
@@ -24,7 +24,7 @@ import { defineOntology } from "../api/defineOntology.js";
24
24
  const apiNamespaceRegex = /^[a-z0-9-]+(\.[a-z0-9-]+)*\.$/;
25
25
  const uuidRegex = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;
26
26
  export default async function main(args = process.argv) {
27
- const commandLineOpts = await yargs(hideBin(args)).version("0.15.0-beta.7" ?? "").wrap(Math.min(150, yargs().terminalWidth())).strict().help().options({
27
+ const commandLineOpts = await yargs(hideBin(args)).version("0.15.0-beta.8" ?? "").wrap(Math.min(150, yargs().terminalWidth())).strict().help().options({
28
28
  input: {
29
29
  alias: "i",
30
30
  describe: "Input file",
@@ -144,10 +144,7 @@ export function convertLink(linkType) {
144
144
  linkType: {
145
145
  definition: definition,
146
146
  id: cleanAndValidateLinkTypeId(linkType.apiName),
147
- status: linkType.status ?? {
148
- type: "active",
149
- active: {}
150
- },
147
+ status: convertLinkStatus(linkType.status),
151
148
  redacted: linkType.redacted ?? false
152
149
  },
153
150
  datasources: datasource !== undefined ? [datasource] : [],
@@ -214,4 +211,33 @@ export function getObject(object) {
214
211
  object: fullObject
215
212
  };
216
213
  }
214
+ export function convertLinkStatus(status) {
215
+ if (typeof status === "object" && "type" in status && status.type === "deprecated") {
216
+ return {
217
+ type: "deprecated",
218
+ deprecated: {
219
+ message: status.message,
220
+ deadline: status.deadline
221
+ }
222
+ };
223
+ }
224
+ switch (status) {
225
+ case "experimental":
226
+ return {
227
+ type: "experimental",
228
+ experimental: {}
229
+ };
230
+ case "example":
231
+ return {
232
+ type: "example",
233
+ example: {}
234
+ };
235
+ case "active":
236
+ default:
237
+ return {
238
+ type: "active",
239
+ active: {}
240
+ };
241
+ }
242
+ }
217
243
  //# sourceMappingURL=convertLink.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"convertLink.js","names":["invariant","OntologyEntityTypeEnum","cleanAndValidateLinkTypeId","ontologyDefinition","convertCardinality","convertLink","linkType","validateLink","definition","datasource","undefined","apiName","oneObjectApiName","object","oneObject","getObject","one","toManyObjectApiName","toManyObject","toMany","type","oneToMany","cardinalityHint","cardinality","manyToOneLinkMetadata","metadata","objectTypeRidManySide","objectTypeRidOneSide","oneToManyLinkMetadata","oneSidePrimaryKeyToManySidePropertyMapping","from","primaryKeyPropertyApiName","to","manyForeignKeyProperty","manyObjectApiName","manyObject","many","intermediary","objectTypeAToBLinkMetadata","objectTypeBToALinkMetadata","objectTypeRidA","objectTypeRidB","intermediaryObjectTypeRid","intermediaryObjectType","aToIntermediaryLinkTypeRid","linkToIntermediary","intermediaryToBLinkTypeRid","manyToMany","peeringMetadata","objectTypeAPrimaryKeyPropertyMapping","objectTypeBPrimaryKeyPropertyMapping","datasourceName","dataset","datasetRid","concat","writebackDatasetRid","objectTypeAPrimaryKeyMapping","property","column","objectTypeBPrimaryKeyMapping","editsConfiguration","onlyAllowPrivilegedEdits","redacted","id","status","active","datasources","entityMetadata","arePatchesEnabled","editsEnabled","linkDefinition","foreignKey","properties","find","p","process","env","NODE_ENV","test","typesMatch","intermediaryObjectTypeApiName","manyIntermediaryOneObjectApiName","manyIntermediaryOneObject","manyIntermediaryToManyObjectApiName","manyIntermediaryToManyObject","toManyIntermediaryOneObjectApiName","toManyIntermediaryOneObject","toManyIntermediaryToManyObjectApiName","toManyIntermediaryToManyObject","objectApiName","fullObject","OBJECT_TYPE"],"sources":["convertLink.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type {\n OntologyIrLinkDefinition,\n OntologyIrLinkTypeBlockDataV2,\n OntologyIrManyToManyLinkTypeDatasource,\n} from \"@osdk/client.unstable\";\nimport invariant from \"tiny-invariant\";\nimport { OntologyEntityTypeEnum } from \"../../api/common/OntologyEntityTypeEnum.js\";\nimport {\n cleanAndValidateLinkTypeId,\n ontologyDefinition,\n} from \"../../api/defineOntology.js\";\nimport type { LinkType } from \"../../api/links/LinkType.js\";\nimport type { ObjectType } from \"../../api/object/ObjectType.js\";\nimport type { ObjectTypeDefinition } from \"../../api/object/ObjectTypeDefinition.js\";\nimport { convertCardinality } from \"./convertCardinality.js\";\n\nexport function convertLink(\n linkType: LinkType,\n): OntologyIrLinkTypeBlockDataV2 {\n validateLink(linkType);\n let definition: OntologyIrLinkDefinition;\n let datasource: OntologyIrManyToManyLinkTypeDatasource | undefined =\n undefined;\n if (\"one\" in linkType) {\n const { apiName: oneObjectApiName, object: oneObject } = getObject(\n linkType.one.object,\n );\n const { apiName: toManyObjectApiName, object: toManyObject } = getObject(\n linkType.toMany.object,\n );\n definition = {\n type: \"oneToMany\",\n oneToMany: {\n cardinalityHint: convertCardinality(linkType.cardinality),\n manyToOneLinkMetadata: linkType.toMany.metadata,\n objectTypeRidManySide: toManyObjectApiName,\n objectTypeRidOneSide: oneObjectApiName,\n oneToManyLinkMetadata: linkType.one.metadata,\n oneSidePrimaryKeyToManySidePropertyMapping: [{\n from: {\n apiName: oneObject.primaryKeyPropertyApiName,\n object: oneObjectApiName,\n },\n to: {\n apiName: linkType.manyForeignKeyProperty,\n object: toManyObjectApiName,\n },\n }],\n },\n };\n } else if (\"intermediaryObjectType\" in linkType) {\n const { apiName: manyObjectApiName, object: manyObject } = getObject(\n linkType.many.object,\n );\n const { apiName: toManyObjectApiName, object: toManyObject } = getObject(\n linkType.toMany.object,\n );\n definition = {\n type: \"intermediary\",\n intermediary: {\n objectTypeAToBLinkMetadata: linkType.many.metadata,\n objectTypeBToALinkMetadata: linkType.toMany.metadata,\n objectTypeRidA: manyObjectApiName,\n objectTypeRidB: toManyObjectApiName,\n intermediaryObjectTypeRid: linkType.intermediaryObjectType.apiName,\n aToIntermediaryLinkTypeRid: cleanAndValidateLinkTypeId(\n linkType.many.linkToIntermediary.apiName,\n ),\n intermediaryToBLinkTypeRid: cleanAndValidateLinkTypeId(\n linkType.toMany.linkToIntermediary.apiName,\n ),\n },\n };\n } else {\n const { apiName: manyObjectApiName, object: manyObject } = getObject(\n linkType.many.object,\n );\n const { apiName: toManyObjectApiName, object: toManyObject } = getObject(\n linkType.toMany.object,\n );\n definition = {\n type: \"manyToMany\",\n manyToMany: {\n objectTypeAToBLinkMetadata: linkType.many.metadata,\n objectTypeBToALinkMetadata: linkType.toMany.metadata,\n objectTypeRidA: manyObjectApiName,\n objectTypeRidB: toManyObjectApiName,\n peeringMetadata: undefined,\n objectTypeAPrimaryKeyPropertyMapping: [{\n from: {\n apiName: manyObject.primaryKeyPropertyApiName,\n object: manyObjectApiName,\n },\n to: {\n apiName: manyObject.primaryKeyPropertyApiName,\n object: manyObjectApiName,\n },\n }],\n objectTypeBPrimaryKeyPropertyMapping: [{\n from: {\n apiName: toManyObject.primaryKeyPropertyApiName,\n object: toManyObjectApiName,\n },\n to: {\n apiName: toManyObject.primaryKeyPropertyApiName,\n object: toManyObjectApiName,\n },\n }],\n },\n };\n\n datasource = {\n datasourceName: linkType.apiName,\n datasource: {\n type: \"dataset\",\n dataset: {\n datasetRid: \"link-\".concat(linkType.apiName),\n writebackDatasetRid: undefined,\n objectTypeAPrimaryKeyMapping: [{\n property: {\n apiName: manyObject.primaryKeyPropertyApiName,\n object: manyObjectApiName,\n },\n column: manyObject.primaryKeyPropertyApiName,\n }],\n objectTypeBPrimaryKeyMapping: [{\n property: {\n apiName: toManyObject.primaryKeyPropertyApiName,\n object: toManyObjectApiName,\n },\n column: toManyObject.primaryKeyPropertyApiName,\n }],\n },\n },\n editsConfiguration: {\n onlyAllowPrivilegedEdits: false,\n },\n redacted: linkType.redacted,\n };\n }\n\n return {\n linkType: {\n definition: definition,\n id: cleanAndValidateLinkTypeId(linkType.apiName),\n status: linkType.status ?? { type: \"active\", active: {} },\n redacted: linkType.redacted ?? false,\n },\n datasources: datasource !== undefined ? [datasource] : [],\n entityMetadata: {\n arePatchesEnabled: linkType.editsEnabled ?? false,\n },\n };\n}\nfunction validateLink(linkDefinition: LinkType) {\n if (\"one\" in linkDefinition) {\n const { apiName: oneObjectApiName, object: oneObject } = getObject(\n linkDefinition.one.object,\n );\n const { apiName: toManyObjectApiName, object: toManyObject } = getObject(\n linkDefinition.toMany.object,\n );\n const foreignKey = toManyObject.properties?.find(p =>\n p.apiName === linkDefinition.manyForeignKeyProperty\n );\n invariant(\n foreignKey !== undefined,\n `Foreign key ${linkDefinition.manyForeignKeyProperty} on link ${linkDefinition.apiName} does not exist on object ${toManyObjectApiName}`,\n );\n\n invariant(\n /([a-z][a-z0-9\\\\-]*)/.test(linkDefinition.apiName),\n `Top level link api names are expected to match the regex pattern ([a-z][a-z0-9\\\\-]*) ${linkDefinition.apiName} does not match`,\n );\n\n const typesMatch = foreignKey.type\n === oneObject.properties?.find(p =>\n p.apiName === oneObject.primaryKeyPropertyApiName\n )?.type;\n invariant(\n typesMatch,\n `Link ${linkDefinition.apiName} has type mismatch between the one side's primary key and the foreign key on the many side`,\n );\n }\n if (\"intermediaryObjectType\" in linkDefinition) {\n const {\n apiName: intermediaryObjectTypeApiName,\n object: intermediaryObjectType,\n } = getObject(linkDefinition.intermediaryObjectType);\n const { apiName: manyObjectApiName, object: manyObject } = getObject(\n linkDefinition.many.object,\n );\n const { apiName: toManyObjectApiName, object: toManyObject } = getObject(\n linkDefinition.toMany.object,\n );\n\n const {\n apiName: manyIntermediaryOneObjectApiName,\n object: manyIntermediaryOneObject,\n } = getObject((linkDefinition.many.linkToIntermediary as any).one.object);\n const {\n apiName: manyIntermediaryToManyObjectApiName,\n object: manyIntermediaryToManyObject,\n } = getObject(linkDefinition.many.linkToIntermediary.toMany.object);\n invariant(\n \"one\" in linkDefinition.many.linkToIntermediary\n && manyIntermediaryOneObjectApiName\n === manyObject.apiName\n && manyIntermediaryToManyObjectApiName\n === intermediaryObjectTypeApiName,\n `LinkTypeA ${linkDefinition.many.linkToIntermediary.apiName} must be a many to one link from intermediary object ${intermediaryObjectTypeApiName} to objectA ${manyObjectApiName}`,\n );\n\n const {\n apiName: toManyIntermediaryOneObjectApiName,\n object: toManyIntermediaryOneObject,\n } = getObject((linkDefinition.toMany.linkToIntermediary as any).one.object);\n const {\n apiName: toManyIntermediaryToManyObjectApiName,\n object: toManyIntermediaryToManyObject,\n } = getObject(linkDefinition.toMany.linkToIntermediary.toMany.object);\n invariant(\n \"one\" in linkDefinition.toMany.linkToIntermediary\n && toManyIntermediaryOneObjectApiName\n === toManyObjectApiName\n && toManyIntermediaryToManyObjectApiName\n === intermediaryObjectTypeApiName,\n `LinkTypeB ${linkDefinition.toMany.linkToIntermediary.apiName} must be a many to one link from intermediary object ${intermediaryObjectTypeApiName} to objectB ${toManyObjectApiName}`,\n );\n }\n}\n\nexport function getObject(\n object: string | ObjectTypeDefinition,\n): { apiName: string; object: ObjectType } {\n const objectApiName = typeof object === \"string\" ? object : object.apiName;\n const fullObject =\n ontologyDefinition[OntologyEntityTypeEnum.OBJECT_TYPE][objectApiName];\n invariant(\n fullObject !== undefined,\n `Object ${objectApiName} is not defined`,\n );\n return { apiName: objectApiName, object: fullObject };\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAOA,OAAOA,SAAS,MAAM,gBAAgB;AACtC,SAASC,sBAAsB,QAAQ,4CAA4C;AACnF,SACEC,0BAA0B,EAC1BC,kBAAkB,QACb,6BAA6B;AAIpC,SAASC,kBAAkB,QAAQ,yBAAyB;AAE5D,OAAO,SAASC,WAAWA,CACzBC,QAAkB,EACa;EAC/BC,YAAY,CAACD,QAAQ,CAAC;EACtB,IAAIE,UAAoC;EACxC,IAAIC,UAA8D,GAChEC,SAAS;EACX,IAAI,KAAK,IAAIJ,QAAQ,EAAE;IACrB,MAAM;MAAEK,OAAO,EAAEC,gBAAgB;MAAEC,MAAM,EAAEC;IAAU,CAAC,GAAGC,SAAS,CAChET,QAAQ,CAACU,GAAG,CAACH,MACf,CAAC;IACD,MAAM;MAAEF,OAAO,EAAEM,mBAAmB;MAAEJ,MAAM,EAAEK;IAAa,CAAC,GAAGH,SAAS,CACtET,QAAQ,CAACa,MAAM,CAACN,MAClB,CAAC;IACDL,UAAU,GAAG;MACXY,IAAI,EAAE,WAAW;MACjBC,SAAS,EAAE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mB,IACtBsE,qCAAqC,KAClCP,6BAA6B,IAAAL,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBALvC7E,SAAS,QAMP,aAAasE,cAAc,CAACnD,MAAM,CAAC0B,kBAAkB,CAAClC,OAAO,wDAAwDqE,6BAA6B,eAAe/D,mBAAmB,EAAE,IANxLjB,SAAS;EAQX;AACF;AAEA,OAAO,SAASe,SAASA,CACvBF,MAAqC,EACI;EACzC,MAAM4E,aAAa,GAAG,OAAO5E,MAAM,KAAK,QAAQ,GAAGA,MAAM,GAAGA,MAAM,CAACF,OAAO;EAC1E,MAAM+E,UAAU,GACdvF,kBAAkB,CAACF,sBAAsB,CAAC0F,WAAW,CAAC,CAACF,aAAa,CAAC;EACvE,EACEC,UAAU,KAAKhF,SAAS,IAAAiE,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAD1B7E,SAAS,QAEP,UAAUyF,aAAa,iBAAiB,IAF1CzF,SAAS;EAIT,OAAO;IAAEW,OAAO,EAAE8E,aAAa;IAAE5E,MAAM,EAAE6E;EAAW,CAAC;AACvD","ignoreList":[]}
1
+ {"version":3,"file":"convertLink.js","names":["invariant","OntologyEntityTypeEnum","cleanAndValidateLinkTypeId","ontologyDefinition","convertCardinality","convertLink","linkType","validateLink","definition","datasource","undefined","apiName","oneObjectApiName","object","oneObject","getObject","one","toManyObjectApiName","toManyObject","toMany","type","oneToMany","cardinalityHint","cardinality","manyToOneLinkMetadata","metadata","objectTypeRidManySide","objectTypeRidOneSide","oneToManyLinkMetadata","oneSidePrimaryKeyToManySidePropertyMapping","from","primaryKeyPropertyApiName","to","manyForeignKeyProperty","manyObjectApiName","manyObject","many","intermediary","objectTypeAToBLinkMetadata","objectTypeBToALinkMetadata","objectTypeRidA","objectTypeRidB","intermediaryObjectTypeRid","intermediaryObjectType","aToIntermediaryLinkTypeRid","linkToIntermediary","intermediaryToBLinkTypeRid","manyToMany","peeringMetadata","objectTypeAPrimaryKeyPropertyMapping","objectTypeBPrimaryKeyPropertyMapping","datasourceName","dataset","datasetRid","concat","writebackDatasetRid","objectTypeAPrimaryKeyMapping","property","column","objectTypeBPrimaryKeyMapping","editsConfiguration","onlyAllowPrivilegedEdits","redacted","id","status","convertLinkStatus","datasources","entityMetadata","arePatchesEnabled","editsEnabled","linkDefinition","foreignKey","properties","find","p","process","env","NODE_ENV","test","typesMatch","intermediaryObjectTypeApiName","manyIntermediaryOneObjectApiName","manyIntermediaryOneObject","manyIntermediaryToManyObjectApiName","manyIntermediaryToManyObject","toManyIntermediaryOneObjectApiName","toManyIntermediaryOneObject","toManyIntermediaryToManyObjectApiName","toManyIntermediaryToManyObject","objectApiName","fullObject","OBJECT_TYPE","deprecated","message","deadline","experimental","example","active"],"sources":["convertLink.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type {\n OntologyIrLinkDefinition,\n OntologyIrLinkTypeBlockDataV2,\n OntologyIrLinkTypeStatus,\n OntologyIrManyToManyLinkTypeDatasource,\n} from \"@osdk/client.unstable\";\nimport invariant from \"tiny-invariant\";\nimport { OntologyEntityTypeEnum } from \"../../api/common/OntologyEntityTypeEnum.js\";\nimport {\n cleanAndValidateLinkTypeId,\n ontologyDefinition,\n} from \"../../api/defineOntology.js\";\nimport type { LinkType, UserLinkTypeStatus } from \"../../api/links/LinkType.js\";\nimport type { ObjectType } from \"../../api/object/ObjectType.js\";\nimport type { ObjectTypeDefinition } from \"../../api/object/ObjectTypeDefinition.js\";\nimport { convertCardinality } from \"./convertCardinality.js\";\n\nexport function convertLink(\n linkType: LinkType,\n): OntologyIrLinkTypeBlockDataV2 {\n validateLink(linkType);\n let definition: OntologyIrLinkDefinition;\n let datasource: OntologyIrManyToManyLinkTypeDatasource | undefined =\n undefined;\n if (\"one\" in linkType) {\n const { apiName: oneObjectApiName, object: oneObject } = getObject(\n linkType.one.object,\n );\n const { apiName: toManyObjectApiName, object: toManyObject } = getObject(\n linkType.toMany.object,\n );\n definition = {\n type: \"oneToMany\",\n oneToMany: {\n cardinalityHint: convertCardinality(linkType.cardinality),\n manyToOneLinkMetadata: linkType.toMany.metadata,\n objectTypeRidManySide: toManyObjectApiName,\n objectTypeRidOneSide: oneObjectApiName,\n oneToManyLinkMetadata: linkType.one.metadata,\n oneSidePrimaryKeyToManySidePropertyMapping: [{\n from: {\n apiName: oneObject.primaryKeyPropertyApiName,\n object: oneObjectApiName,\n },\n to: {\n apiName: linkType.manyForeignKeyProperty,\n object: toManyObjectApiName,\n },\n }],\n },\n };\n } else if (\"intermediaryObjectType\" in linkType) {\n const { apiName: manyObjectApiName, object: manyObject } = getObject(\n linkType.many.object,\n );\n const { apiName: toManyObjectApiName, object: toManyObject } = getObject(\n linkType.toMany.object,\n );\n definition = {\n type: \"intermediary\",\n intermediary: {\n objectTypeAToBLinkMetadata: linkType.many.metadata,\n objectTypeBToALinkMetadata: linkType.toMany.metadata,\n objectTypeRidA: manyObjectApiName,\n objectTypeRidB: toManyObjectApiName,\n intermediaryObjectTypeRid: linkType.intermediaryObjectType.apiName,\n aToIntermediaryLinkTypeRid: cleanAndValidateLinkTypeId(\n linkType.many.linkToIntermediary.apiName,\n ),\n intermediaryToBLinkTypeRid: cleanAndValidateLinkTypeId(\n linkType.toMany.linkToIntermediary.apiName,\n ),\n },\n };\n } else {\n const { apiName: manyObjectApiName, object: manyObject } = getObject(\n linkType.many.object,\n );\n const { apiName: toManyObjectApiName, object: toManyObject } = getObject(\n linkType.toMany.object,\n );\n definition = {\n type: \"manyToMany\",\n manyToMany: {\n objectTypeAToBLinkMetadata: linkType.many.metadata,\n objectTypeBToALinkMetadata: linkType.toMany.metadata,\n objectTypeRidA: manyObjectApiName,\n objectTypeRidB: toManyObjectApiName,\n peeringMetadata: undefined,\n objectTypeAPrimaryKeyPropertyMapping: [{\n from: {\n apiName: manyObject.primaryKeyPropertyApiName,\n object: manyObjectApiName,\n },\n to: {\n apiName: manyObject.primaryKeyPropertyApiName,\n object: manyObjectApiName,\n },\n }],\n objectTypeBPrimaryKeyPropertyMapping: [{\n from: {\n apiName: toManyObject.primaryKeyPropertyApiName,\n object: toManyObjectApiName,\n },\n to: {\n apiName: toManyObject.primaryKeyPropertyApiName,\n object: toManyObjectApiName,\n },\n }],\n },\n };\n\n datasource = {\n datasourceName: linkType.apiName,\n datasource: {\n type: \"dataset\",\n dataset: {\n datasetRid: \"link-\".concat(linkType.apiName),\n writebackDatasetRid: undefined,\n objectTypeAPrimaryKeyMapping: [{\n property: {\n apiName: manyObject.primaryKeyPropertyApiName,\n object: manyObjectApiName,\n },\n column: manyObject.primaryKeyPropertyApiName,\n }],\n objectTypeBPrimaryKeyMapping: [{\n property: {\n apiName: toManyObject.primaryKeyPropertyApiName,\n object: toManyObjectApiName,\n },\n column: toManyObject.primaryKeyPropertyApiName,\n }],\n },\n },\n editsConfiguration: {\n onlyAllowPrivilegedEdits: false,\n },\n redacted: linkType.redacted,\n };\n }\n\n return {\n linkType: {\n definition: definition,\n id: cleanAndValidateLinkTypeId(linkType.apiName),\n status: convertLinkStatus(linkType.status),\n redacted: linkType.redacted ?? false,\n },\n datasources: datasource !== undefined ? [datasource] : [],\n entityMetadata: {\n arePatchesEnabled: linkType.editsEnabled ?? false,\n },\n };\n}\nfunction validateLink(linkDefinition: LinkType) {\n if (\"one\" in linkDefinition) {\n const { apiName: oneObjectApiName, object: oneObject } = getObject(\n linkDefinition.one.object,\n );\n const { apiName: toManyObjectApiName, object: toManyObject } = getObject(\n linkDefinition.toMany.object,\n );\n const foreignKey = toManyObject.properties?.find(p =>\n p.apiName === linkDefinition.manyForeignKeyProperty\n );\n invariant(\n foreignKey !== undefined,\n `Foreign key ${linkDefinition.manyForeignKeyProperty} on link ${linkDefinition.apiName} does not exist on object ${toManyObjectApiName}`,\n );\n\n invariant(\n /([a-z][a-z0-9\\\\-]*)/.test(linkDefinition.apiName),\n `Top level link api names are expected to match the regex pattern ([a-z][a-z0-9\\\\-]*) ${linkDefinition.apiName} does not match`,\n );\n\n const typesMatch = foreignKey.type\n === oneObject.properties?.find(p =>\n p.apiName === oneObject.primaryKeyPropertyApiName\n )?.type;\n invariant(\n typesMatch,\n `Link ${linkDefinition.apiName} has type mismatch between the one side's primary key and the foreign key on the many side`,\n );\n }\n if (\"intermediaryObjectType\" in linkDefinition) {\n const {\n apiName: intermediaryObjectTypeApiName,\n object: intermediaryObjectType,\n } = getObject(linkDefinition.intermediaryObjectType);\n const { apiName: manyObjectApiName, object: manyObject } = getObject(\n linkDefinition.many.object,\n );\n const { apiName: toManyObjectApiName, object: toManyObject } = getObject(\n linkDefinition.toMany.object,\n );\n\n const {\n apiName: manyIntermediaryOneObjectApiName,\n object: manyIntermediaryOneObject,\n } = getObject((linkDefinition.many.linkToIntermediary as any).one.object);\n const {\n apiName: manyIntermediaryToManyObjectApiName,\n object: manyIntermediaryToManyObject,\n } = getObject(linkDefinition.many.linkToIntermediary.toMany.object);\n invariant(\n \"one\" in linkDefinition.many.linkToIntermediary\n && manyIntermediaryOneObjectApiName\n === manyObject.apiName\n && manyIntermediaryToManyObjectApiName\n === intermediaryObjectTypeApiName,\n `LinkTypeA ${linkDefinition.many.linkToIntermediary.apiName} must be a many to one link from intermediary object ${intermediaryObjectTypeApiName} to objectA ${manyObjectApiName}`,\n );\n\n const {\n apiName: toManyIntermediaryOneObjectApiName,\n object: toManyIntermediaryOneObject,\n } = getObject((linkDefinition.toMany.linkToIntermediary as any).one.object);\n const {\n apiName: toManyIntermediaryToManyObjectApiName,\n object: toManyIntermediaryToManyObject,\n } = getObject(linkDefinition.toMany.linkToIntermediary.toMany.object);\n invariant(\n \"one\" in linkDefinition.toMany.linkToIntermediary\n && toManyIntermediaryOneObjectApiName\n === toManyObjectApiName\n && toManyIntermediaryToManyObjectApiName\n === intermediaryObjectTypeApiName,\n `LinkTypeB ${linkDefinition.toMany.linkToIntermediary.apiName} must be a many to one link from intermediary object ${intermediaryObjectTypeApiName} to objectB ${toManyObjectApiName}`,\n );\n }\n}\n\nexport function getObject(\n object: string | ObjectTypeDefinition,\n): { apiName: string; object: ObjectType } {\n const objectApiName = typeof object === \"string\" ? object : object.apiName;\n const fullObject =\n ontologyDefinition[OntologyEntityTypeEnum.OBJECT_TYPE][objectApiName];\n invariant(\n fullObject !== undefined,\n `Object ${objectApiName} is not defined`,\n );\n return { apiName: objectApiName, object: fullObject };\n}\n\nexport function convertLinkStatus(\n status: UserLinkTypeStatus | undefined,\n): OntologyIrLinkTypeStatus {\n if (\n typeof status === \"object\" && \"type\" in status\n && status.type === \"deprecated\"\n ) {\n return {\n type: \"deprecated\",\n deprecated: {\n message: status.message,\n deadline: status.deadline,\n },\n };\n }\n switch (status) {\n case \"experimental\":\n return { type: \"experimental\", experimental: {} };\n case \"example\":\n return { type: \"example\", example: {} };\n case \"active\":\n default:\n return { type: \"active\", active: {} };\n }\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAQA,OAAOA,SAAS,MAAM,gBAAgB;AACtC,SAASC,sBAAsB,QAAQ,4CAA4C;AACnF,SACEC,0BAA0B,EAC1BC,kBAAkB,QACb,6BAA6B;AAIpC,SAASC,kBAAkB,QAAQ,yBAAyB;AAE5D,OAAO,SAASC,WAAWA,CACzBC,QAAkB,EACa;EAC/BC,YAAY,CAACD,QAAQ,CAAC;EACtB,IAAIE,UAAoC;EACxC,IAAIC,UAA8D,GAChEC,SAAS;EACX,IAAI,KAAK,IAAIJ,QAAQ,EAAE;IACrB,MAAM;MAAEK,OAAO,EAAEC,gBAAgB;MAAEC,MAAM,EAAEC;I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OAAO;QAAE5C,IAAI,EAAE,cAAc;QAAE2E,YAAY,EAAE,CAAC;MAAE,CAAC;IACnD,KAAK,SAAS;MACZ,OAAO;QAAE3E,IAAI,EAAE,SAAS;QAAE4E,OAAO,EAAE,CAAC;MAAE,CAAC;IACzC,KAAK,QAAQ;IACb;MACE,OAAO;QAAE5E,IAAI,EAAE,QAAQ;QAAE6E,MAAM,EAAE,CAAC;MAAE,CAAC;EACzC;AACF","ignoreList":[]}
@@ -10,6 +10,8 @@ export type SimplifiedInterfaceTypeStatus = {
10
10
  type: "active"
11
11
  } | {
12
12
  type: "experimental"
13
+ } | {
14
+ type: "example"
13
15
  };
14
16
  type PropertyBase = SharedPropertyType | InterfaceDefinedProperty;
15
17
  type SptWithOptional = {
@@ -1 +1 @@
1
- {"mappings":"AAkBA,cAAc,qBAAqB,4BAA6B;AAQhE,cACO,gCAGA,sCAAuC;AAC9C,cAAc,qBAAqB,8BAA+B;AAIlE,cAAc,0BAA0B,oCAAqC;AAE7E,YAAY,gCACR;CAAE,MAAM;CAAc;CAAiB;AAAkB,IACzD;CAAE,MAAM;AAAU,IAClB;CAAE,MAAM;AAAgB;KAEvB,eACD,qBACA;KACC,kBAAkB;CACrB;CACA,oBAAoB;AACrB;AAED,YAAY,0BAA0B;CACpC;CACA;CACA;CACA,OAAO;EAAE,SAAS;EAAe;CAAe;CAChD,SAAS;CACT,aAAa,eAEX,eAAe;CAEjB,UAAU,gBAAgB;CAC1B;AACD;AAED,OAAO,iBAAS,gBACdA,cAAc,0BACb","names":["interfaceDef: InterfaceTypeDefinition"],"sources":["../../../src/api/defineInterface.ts"],"version":3,"file":"defineInterface.d.ts"}
1
+ {"mappings":"AAkBA,cAAc,qBAAqB,4BAA6B;AAQhE,cACO,gCAGA,sCAAuC;AAC9C,cAAc,qBAAqB,8BAA+B;AAIlE,cAAc,0BAA0B,oCAAqC;AAE7E,YAAY,gCACR;CAAE,MAAM;CAAc;CAAiB;AAAkB,IACzD;CAAE,MAAM;AAAU,IAClB;CAAE,MAAM;AAAgB,IACxB;CAAE,MAAM;AAAW;KAElB,eACD,qBACA;KACC,kBAAkB;CACrB;CACA,oBAAoB;AACrB;AAED,YAAY,0BAA0B;CACpC;CACA;CACA;CACA,OAAO;EAAE,SAAS;EAAe;CAAe;CAChD,SAAS;CACT,aAAa,eAEX,eAAe;CAEjB,UAAU,gBAAgB;CAC1B;AACD;AAED,OAAO,iBAAS,gBACdA,cAAc,0BACb","names":["interfaceDef: InterfaceTypeDefinition"],"sources":["../../../src/api/defineInterface.ts"],"version":3,"file":"defineInterface.d.ts"}