@osdk/maker 0.9.0-beta.21 → 0.9.0-beta.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @osdk/maker
2
2
 
3
+ ## 0.9.0-beta.22
4
+
5
+ ### Minor Changes
6
+
7
+ - 8d8bebb: Fix nullability
8
+ - c9da74c: Improves code quality by fixing linting errors
9
+
10
+ ### Patch Changes
11
+
12
+ - Updated dependencies [73fa373]
13
+ - @osdk/api@2.1.0-beta.22
14
+
3
15
  ## 0.9.0-beta.21
4
16
 
5
17
  ### Patch Changes
@@ -1 +1 @@
1
- {"version":3,"file":"defineInterface.d.ts","sourceRoot":"","sources":["../../../src/api/defineInterface.ts"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,KAAK,EACV,aAAa,EAEb,gBAAgB,EAChB,kBAAkB,EACnB,MAAM,YAAY,CAAC;AAEpB,KAAK,6BAA6B,GAC9B;IAAE,IAAI,EAAE,YAAY,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,GACzD;IAAE,IAAI,EAAE,QAAQ,CAAA;CAAE,GAClB;IAAE,IAAI,EAAE,cAAc,CAAA;CAAE,CAAC;AAE7B,wBAAgB,eAAe,CAC7B,IAAI,EAAE;IACJ,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE;QAAE,OAAO,EAAE,aAAa,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;IACjD,MAAM,CAAC,EAAE,6BAA6B,CAAC;IACvC,UAAU,CAAC,EAAE,MAAM,CACjB,MAAM,EACN,kBAAkB,GAAG,gBAAgB,CACtC,CAAC;IAEF,OAAO,CAAC,EAAE,aAAa,GAAG,aAAa,EAAE,GAAG,MAAM,GAAG,MAAM,EAAE,CAAC;CAC/D,GACA,aAAa,CA4Ff"}
1
+ {"version":3,"file":"defineInterface.d.ts","sourceRoot":"","sources":["../../../src/api/defineInterface.ts"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,KAAK,EACV,aAAa,EAEb,gBAAgB,EAChB,kBAAkB,EACnB,MAAM,YAAY,CAAC;AAEpB,KAAK,6BAA6B,GAC9B;IAAE,IAAI,EAAE,YAAY,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,GACzD;IAAE,IAAI,EAAE,QAAQ,CAAA;CAAE,GAClB;IAAE,IAAI,EAAE,cAAc,CAAA;CAAE,CAAC;AAE7B,wBAAgB,eAAe,CAC7B,IAAI,EAAE;IACJ,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE;QAAE,OAAO,EAAE,aAAa,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;IACjD,MAAM,CAAC,EAAE,6BAA6B,CAAC;IACvC,UAAU,CAAC,EAAE,MAAM,CACjB,MAAM,EACN,kBAAkB,GAAG,gBAAgB,CACtC,CAAC;IAEF,OAAO,CAAC,EAAE,aAAa,GAAG,aAAa,EAAE,GAAG,MAAM,GAAG,MAAM,EAAE,CAAC;CAC/D,GACA,aAAa,CA8Ff"}
@@ -21,7 +21,7 @@ export function defineInterface(opts) {
21
21
  !(ontologyDefinition.interfaceTypes[apiName] === undefined) ? process.env.NODE_ENV !== "production" ? invariant(false, `Interface ${apiName} already exists`) : invariant(false) : void 0;
22
22
  const properties = Object.fromEntries(Object.entries(opts.properties ?? {}).map(([apiName, type]) => {
23
23
  if (typeof type === "string" || typeof type === "object" && !("apiName" in type)) {
24
- !isPropertyTypeType(type) ? process.env.NODE_ENV !== "production" ? invariant(false, `Invalid data type ${type} for property ${apiName} on InterfaceType ${apiName}`) : invariant(false) : void 0;
24
+ !isPropertyTypeType(type) ? process.env.NODE_ENV !== "production" ? invariant(false, `Invalid data type ${JSON.stringify(type)} for property ${apiName} on InterfaceType ${apiName}`) : invariant(false) : void 0;
25
25
  const spt = defineSharedPropertyType({
26
26
  apiName,
27
27
  displayName: apiName,
@@ -1 +1 @@
1
- {"version":3,"file":"defineInterface.js","names":["invariant","namespace","ontologyDefinition","defineSharedPropertyType","defineInterface","opts","apiName","interfaceTypes","undefined","process","env","NODE_ENV","properties","Object","fromEntries","entries","map","type","isPropertyTypeType","spt","displayName","array","unNamespacedTypeApiName","slice","lastIndexOf","JSON","stringify","key","extendsInterfaces","extends","Array","isArray","every","item","status","mapSimplifiedStatusToInterfaceTypeStatus","deprecated","message","deadline","a","displayMetadata","description","icon","blueprint","color","locator","links","v","replacedBy","active","experimental","Error"],"sources":["defineInterface.js"],"sourcesContent":["/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport invariant from \"tiny-invariant\";\nimport { namespace, ontologyDefinition } from \"./defineOntology.js\";\nimport { defineSharedPropertyType } from \"./defineSpt.js\";\nexport function defineInterface(opts) {\n const apiName = namespace + opts.apiName;\n invariant(ontologyDefinition.interfaceTypes[apiName] === undefined, `Interface ${apiName} already exists`);\n const properties = Object.fromEntries(Object.entries(opts.properties ?? {}).map(([apiName, type]) => {\n if (typeof type === \"string\"\n || (typeof type === \"object\" && !(\"apiName\" in type))) {\n invariant(isPropertyTypeType(type), `Invalid data type ${type} for property ${apiName} on InterfaceType ${apiName}`);\n const spt = defineSharedPropertyType({\n apiName,\n displayName: apiName,\n type,\n array: false,\n });\n return [apiName, spt];\n }\n else {\n const unNamespacedTypeApiName = type.apiName.slice(type.apiName.lastIndexOf(\".\") + 1);\n invariant(namespace + apiName === type.apiName\n || apiName === unNamespacedTypeApiName, `property key and it's apiName must be identical. ${JSON.stringify({ key: apiName, apiName: type.apiName })}`);\n return [apiName, type];\n }\n }));\n let extendsInterfaces = [];\n if (opts.extends) {\n if (typeof opts.extends === \"string\") {\n extendsInterfaces = [opts.extends];\n }\n else if (Array.isArray(opts.extends)\n && opts.extends.every(item => typeof item === \"string\")) {\n extendsInterfaces = opts.extends;\n }\n else if (opts.extends.apiName !== undefined) {\n extendsInterfaces = [opts.extends.apiName];\n }\n else {\n extendsInterfaces = opts.extends.map(item => item.apiName);\n }\n }\n const status = mapSimplifiedStatusToInterfaceTypeStatus(opts.status ?? { type: \"active\" });\n invariant(status.type !== \"deprecated\"\n || (status.deprecated.message && status.deprecated.deadline), `Deprecated status must include message and deadline properties.`);\n const a = {\n apiName,\n displayMetadata: {\n displayName: opts.displayName ?? opts.apiName,\n description: opts.description ?? opts.displayName ?? opts.apiName,\n icon: opts.icon !== undefined\n ? {\n type: \"blueprint\",\n blueprint: { color: opts.icon.color, locator: opts.icon.locator },\n }\n : undefined,\n },\n extendsInterfaces: extendsInterfaces,\n links: [],\n properties,\n status,\n };\n return ontologyDefinition.interfaceTypes[apiName] = a;\n}\nfunction isPropertyTypeType(v) {\n return v === \"boolean\" || v === \"byte\"\n || v === \"date\" || v === \"decimal\" || v === \"double\"\n || v === \"float\" || v === \"geopoint\" || v === \"geoshape\"\n || v === \"integer\" || v === \"long\"\n || (typeof v === \"object\" && v.type === \"marking\")\n || v === \"short\" || v === \"string\"\n || v === \"timestamp\";\n}\nfunction mapSimplifiedStatusToInterfaceTypeStatus(status) {\n switch (status.type) {\n case \"deprecated\":\n return {\n type: \"deprecated\",\n deprecated: {\n message: status.message,\n deadline: status.deadline,\n replacedBy: undefined,\n },\n };\n case \"active\":\n return {\n type: \"active\",\n active: {},\n };\n case \"experimental\":\n return {\n type: \"experimental\",\n experimental: {},\n };\n default:\n throw new Error(`Invalid status type: ${status.type}`);\n }\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAOA,SAAS,MAAM,gBAAgB;AACtC,SAASC,SAAS,EAAEC,kBAAkB,QAAQ,qBAAqB;AACnE,SAASC,wBAAwB,QAAQ,gBAAgB;AACzD,OAAO,SAASC,eAAeA,CAACC,IAAI,EAAE;EAClC,MAAMC,OAAO,GAAGL,SAAS,GAAGI,IAAI,CAACC,OAAO;EACxC,EAAUJ,kBAAkB,CAACK,cAAc,CAACD,OAAO,CAAC,KAAKE,SAAS,IAAAC,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAAlEX,SAAS,QAA2D,aAAaM,OAAO,iBAAiB,IAAzGN,SAAS;EACT,MAAMY,UAAU,GAAGC,MAAM,CAACC,WAAW,CAACD,MAAM,CAACE,OAAO,CAACV,IAAI,CAACO,UAAU,IAAI,CAAC,CAAC,CAAC,CAACI,GAAG,CAAC,CAAC,CAACV,OAAO,EAAEW,IAAI,CAAC,KAAK;IACjG,IAAI,OAAOA,IAAI,KAAK,QAAQ,IACpB,OAAOA,IAAI,KAAK,QAAQ,IAAI,EAAE,SAAS,IAAIA,IAAI,CAAE,EAAE;MACvD,CAAUC,kBAAkB,CAACD,IAAI,CAAC,GAAAR,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAAlCX,SAAS,QAA2B,qBAAqBiB,IAAI,iBAAiBX,OAAO,qBAAqBA,OAAO,EAAE,IAAnHN,SAAS;MACT,MAAMmB,GAAG,GAAGhB,wBAAwB,CAAC;QACjCG,OAAO;QACPc,WAAW,EAAEd,O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UAAU,IACrDA,CAAC,KAAK,SAAS,IAAIA,CAAC,KAAK,MAAM,IAC9B,OAAOA,CAAC,KAAK,QAAQ,IAAIA,CAAC,CAAC9B,IAAI,KAAK,SAAU,IAC/C8B,CAAC,KAAK,OAAO,IAAIA,CAAC,KAAK,QAAQ,IAC/BA,CAAC,KAAK,WAAW;AAC5B;AACA,SAASZ,wCAAwCA,CAACD,MAAM,EAAE;EACtD,QAAQA,MAAM,CAACjB,IAAI;IACf,KAAK,YAAY;MACb,OAAO;QACHA,IAAI,EAAE,YAAY;QAClBmB,UAAU,EAAE;UACRC,OAAO,EAAEH,MAAM,CAACG,OAAO;UACvBC,QAAQ,EAAEJ,MAAM,CAACI,QAAQ;UACzBU,UAAU,EAAExC;QAChB;MACJ,CAAC;IACL,KAAK,QAAQ;MACT,OAAO;QACHS,IAAI,EAAE,QAAQ;QACdgC,MAAM,EAAE,CAAC;MACb,CAAC;IACL,KAAK,cAAc;MACf,OAAO;QACHhC,IAAI,EAAE,cAAc;QACpBiC,YAAY,EAAE,CAAC;MACnB,CAAC;IACL;MACI,MAAM,IAAIC,KAAK,CAAC,wBAAwBjB,MAAM,CAACjB,IAAI,EAAE,CAAC;EAC9D;AACJ","ignoreList":[]}
1
+ {"version":3,"file":"defineInterface.js","names":["invariant","namespace","ontologyDefinition","defineSharedPropertyType","defineInterface","opts","apiName","interfaceTypes","undefined","process","env","NODE_ENV","properties","Object","fromEntries","entries","map","type","isPropertyTypeType","JSON","stringify","spt","displayName","array","unNamespacedTypeApiName","slice","lastIndexOf","key","extendsInterfaces","extends","Array","isArray","every","item","status","mapSimplifiedStatusToInterfaceTypeStatus","deprecated","message","deadline","a","displayMetadata","description","icon","blueprint","color","locator","links","v","replacedBy","active","experimental","Error"],"sources":["defineInterface.js"],"sourcesContent":["/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport invariant from \"tiny-invariant\";\nimport { namespace, ontologyDefinition } from \"./defineOntology.js\";\nimport { defineSharedPropertyType } from \"./defineSpt.js\";\nexport function defineInterface(opts) {\n const apiName = namespace + opts.apiName;\n invariant(ontologyDefinition.interfaceTypes[apiName] === undefined, `Interface ${apiName} already exists`);\n const properties = Object.fromEntries(Object.entries(opts.properties ?? {}).map(([apiName, type]) => {\n if (typeof type === \"string\"\n || (typeof type === \"object\" && !(\"apiName\" in type))) {\n invariant(isPropertyTypeType(type), `Invalid data type ${JSON.stringify(type)} for property ${apiName} on InterfaceType ${apiName}`);\n const spt = defineSharedPropertyType({\n apiName,\n displayName: apiName,\n type,\n array: false,\n });\n return [apiName, spt];\n }\n else {\n const unNamespacedTypeApiName = type.apiName.slice(type.apiName.lastIndexOf(\".\") + 1);\n invariant(namespace + apiName === type.apiName\n || apiName === unNamespacedTypeApiName, `property key and it's apiName must be identical. ${JSON.stringify({ key: apiName, apiName: type.apiName })}`);\n return [apiName, type];\n }\n }));\n let extendsInterfaces = [];\n if (opts.extends) {\n if (typeof opts.extends === \"string\") {\n extendsInterfaces = [opts.extends];\n }\n else if (Array.isArray(opts.extends)\n && opts.extends.every(item => typeof item === \"string\")) {\n extendsInterfaces = opts.extends;\n }\n else if (opts.extends.apiName !== undefined) {\n extendsInterfaces = [opts.extends.apiName];\n }\n else {\n extendsInterfaces = opts.extends.map(item => item.apiName);\n }\n }\n const status = mapSimplifiedStatusToInterfaceTypeStatus(opts.status ?? { type: \"active\" });\n invariant(status.type !== \"deprecated\"\n || (status.deprecated.message && status.deprecated.deadline), `Deprecated status must include message and deadline properties.`);\n const a = {\n apiName,\n displayMetadata: {\n displayName: opts.displayName ?? opts.apiName,\n description: opts.description ?? opts.displayName ?? opts.apiName,\n icon: opts.icon !== undefined\n ? {\n type: \"blueprint\",\n blueprint: { color: opts.icon.color, locator: opts.icon.locator },\n }\n : undefined,\n },\n extendsInterfaces: extendsInterfaces,\n links: [],\n properties,\n status,\n };\n return ontologyDefinition.interfaceTypes[apiName] = a;\n}\nfunction isPropertyTypeType(v) {\n return v === \"boolean\" || v === \"byte\"\n || v === \"date\" || v === \"decimal\" || v === \"double\"\n || v === \"float\" || v === \"geopoint\" || v === \"geoshape\"\n || v === \"integer\" || v === \"long\"\n || (typeof v === \"object\" && v.type === \"marking\")\n || v === \"short\" || v === \"string\"\n || v === \"timestamp\";\n}\nfunction mapSimplifiedStatusToInterfaceTypeStatus(status) {\n switch (status.type) {\n case \"deprecated\":\n return {\n type: \"deprecated\",\n deprecated: {\n message: status.message,\n deadline: status.deadline,\n replacedBy: undefined,\n },\n };\n case \"active\":\n return {\n type: \"active\",\n active: {},\n };\n case \"experimental\":\n return {\n type: \"experimental\",\n experimental: {},\n };\n default:\n throw new Error(`Invalid status type: ${status.type}`);\n }\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAOA,SAAS,MAAM,gBAAgB;AACtC,SAASC,SAAS,EAAEC,kBAAkB,QAAQ,qBAAqB;AACnE,SAASC,wBAAwB,QAAQ,gBAAgB;AACzD,OAAO,SAASC,eAAeA,CAACC,IAAI,EAAE;EAClC,MAAMC,OAAO,GAAGL,SAAS,GAAGI,IAAI,CAACC,OAAO;EACxC,EAAUJ,kBAAkB,CAACK,cAAc,CAACD,OAAO,CAAC,KAAKE,SAAS,IAAAC,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAAlEX,SAAS,QAA2D,aAAaM,OAAO,iBAAiB,IAAzGN,SAAS;EACT,MAAMY,UAAU,GAAGC,MAAM,CAACC,WAAW,CAACD,MAAM,CAACE,OAAO,CAACV,IAAI,CA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;EAC9D;AACJ","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"defineInterfaceLinkConstraint.d.ts","sourceRoot":"","sources":["../../../src/api/defineInterfaceLinkConstraint.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAGhD,KAAK,sBAAsB,GAAG,MAAM,GAAG,aAAa,CAAC;AAErD,KAAK,IAAI,GAAG;IACV,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,aAAa,CAAC;IACpB,MAAM,EAAE,sBAAsB,CAAC;IAC/B,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AACF,KAAK,GAAG,GAAG;IACT,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,aAAa,CAAC;IACpB,KAAK,EAAE,sBAAsB,CAAC;IAC9B,MAAM,CAAC,EAAE,KAAK,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF,wBAAgB,6BAA6B,CAC3C,OAAO,EAAE,GAAG,GAAG,IAAI,QAgBpB"}
1
+ {"version":3,"file":"defineInterfaceLinkConstraint.d.ts","sourceRoot":"","sources":["../../../src/api/defineInterfaceLinkConstraint.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAGhD,KAAK,sBAAsB,GAAG,MAAM,GAAG,aAAa,CAAC;AAErD,KAAK,IAAI,GAAG;IACV,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,aAAa,CAAC;IACpB,MAAM,EAAE,sBAAsB,CAAC;IAC/B,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AACF,KAAK,GAAG,GAAG;IACT,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,aAAa,CAAC;IACpB,KAAK,EAAE,sBAAsB,CAAC;IAC9B,MAAM,CAAC,EAAE,KAAK,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF,wBAAgB,6BAA6B,CAC3C,OAAO,EAAE,GAAG,GAAG,IAAI,GAClB,IAAI,CAeN"}
@@ -107,7 +107,7 @@ function convertSpt({
107
107
  }) {
108
108
  const dataConstraint = typeof type === "object" && type.type === "marking" ? {
109
109
  propertyTypeConstraints: [],
110
- nullability: "NO_EXPLICIT_NULLS",
110
+ nullability: undefined,
111
111
  nullabilityV2: {
112
112
  noEmptyCollections: true,
113
113
  noNulls: true
@@ -149,7 +149,7 @@ function convertType(type) {
149
149
  const structFields = new Array();
150
150
  for (const key in type.structDefinition) {
151
151
  const fieldTypeDefinition = type.structDefinition[key];
152
- var field;
152
+ let field;
153
153
  if (typeof fieldTypeDefinition === "string") {
154
154
  field = {
155
155
  apiName: key,
@@ -1 +1 @@
1
- {"version":3,"file":"defineOntology.js","names":["ontologyDefinition","namespace","defineOntology","ns","body","actionTypes","objectTypes","queryTypes","interfaceTypes","sharedPropertyTypes","valueTypes","importedTypes","e","console","error","ontology","convertToWireOntologyIr","valueType","convertOntologyToValueTypeIr","Object","values","map","definitions","metadata","apiName","displayMetadata","status","versions","definition","version","baseType","constraints","exampleValues","blockData","fromEntries","entries","spt","sharedPropertyType","convertSpt","interfaceType","convertInterface","blockPermissionInformation","linkTypes","properties","allExtendsInterfaces","allLinks","allProperties","dumpOntologyFullMetadata","dumpValueTypeWireType","type","array","description","displayName","gothamMapping","typeClasses","dataConstraint","propertyTypeConstraints","nullability","nullabilityV2","noEmptyCollections","noNulls","undefined","visibility","subtype","convertType","aliases","baseFormatter","dataConstraints","indexedForSearch","provenance","marking","markingType","structFields","Array","key","structDefinition","fieldTypeDefinition","field","fieldType","push","struct","geohash","precision","scale","analyzerOverride","enableAsciiFolding","isLongText","supportsExactMatching","mediaReference","distributeTypeHelper"],"sources":["defineOntology.js"],"sourcesContent":["/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/** @internal */\nexport let ontologyDefinition;\n/** @internal */\nexport let namespace;\nexport async function defineOntology(ns, body) {\n namespace = ns;\n ontologyDefinition = {\n actionTypes: {},\n objectTypes: {},\n queryTypes: {},\n interfaceTypes: {},\n sharedPropertyTypes: {},\n valueTypes: {},\n importedTypes: {\n sharedPropertyTypes: [],\n },\n };\n try {\n await body();\n }\n catch (e) {\n // eslint-disable-next-line no-console\n console.error(\"Unexpected error while processing the body of the ontology\", e);\n throw e;\n }\n return {\n ontology: convertToWireOntologyIr(ontologyDefinition),\n valueType: convertOntologyToValueTypeIr(ontologyDefinition),\n };\n}\nfunction convertOntologyToValueTypeIr(ontology) {\n return {\n valueTypes: Object.values(ontology.valueTypes).map(definitions => ({\n metadata: {\n apiName: definitions[0].apiName,\n displayMetadata: definitions[0].displayMetadata,\n status: definitions[0].status,\n },\n versions: definitions.map(definition => ({\n version: definition.version,\n baseType: definition.baseType,\n constraints: definition.constraints,\n exampleValues: definition.exampleValues,\n })),\n })),\n };\n}\nfunction convertToWireOntologyIr(ontology) {\n return {\n blockData: {\n sharedPropertyTypes: Object.fromEntries(Object.entries(ontology.sharedPropertyTypes)\n .map(([apiName, spt]) => [apiName, { sharedPropertyType: convertSpt(spt) }])),\n interfaceTypes: Object.fromEntries(Object.entries(ontology.interfaceTypes)\n .map(([apiName, interfaceType]) => {\n return [apiName, {\n interfaceType: convertInterface(interfaceType),\n }];\n })),\n blockPermissionInformation: {\n actionTypes: {},\n linkTypes: {},\n objectTypes: {},\n },\n },\n importedTypes: ontology.importedTypes,\n };\n}\nfunction convertInterface(interfaceType) {\n return {\n ...interfaceType,\n properties: Object.values(interfaceType.properties)\n .map((spt) => convertSpt(spt)),\n // these are omitted from our internal types but we need to re-add them for the final json\n allExtendsInterfaces: [],\n allLinks: [],\n allProperties: [],\n };\n}\nexport function dumpOntologyFullMetadata() {\n return convertToWireOntologyIr(ontologyDefinition);\n}\nexport function dumpValueTypeWireType() {\n return convertOntologyToValueTypeIr(ontologyDefinition);\n}\nfunction convertSpt({ type, array, description, apiName, displayName, gothamMapping, typeClasses, valueType, }) {\n const dataConstraint = (typeof type === \"object\" && type.type === \"marking\")\n ? {\n propertyTypeConstraints: [],\n nullability: \"NO_EXPLICIT_NULLS\",\n nullabilityV2: { noEmptyCollections: true, noNulls: true },\n }\n : undefined;\n return {\n apiName,\n displayMetadata: {\n displayName: displayName ?? apiName,\n visibility: \"NORMAL\",\n description,\n },\n type: array\n ? {\n type: \"array\",\n array: {\n subtype: convertType(type),\n },\n }\n : convertType(type),\n aliases: [],\n baseFormatter: undefined,\n dataConstraints: dataConstraint,\n gothamMapping: gothamMapping,\n indexedForSearch: true,\n provenance: undefined,\n typeClasses: typeClasses ?? [],\n valueType: valueType,\n };\n}\nfunction convertType(type) {\n switch (true) {\n case (typeof type === \"object\" && \"markingType\" in type):\n return {\n \"type\": \"marking\",\n marking: { markingType: type.markingType },\n };\n case (typeof type === \"object\" && \"structDefinition\" in type):\n const structFields = new Array();\n for (const key in type.structDefinition) {\n const fieldTypeDefinition = type.structDefinition[key];\n var field;\n if (typeof fieldTypeDefinition === \"string\") {\n field = {\n apiName: key,\n displayMetadata: { displayName: key, description: undefined },\n typeClasses: [],\n aliases: [],\n fieldType: convertType(fieldTypeDefinition),\n };\n }\n else {\n // If it is a full form type definition then process it as such\n if (\"fieldType\" in fieldTypeDefinition) {\n field = {\n ...fieldTypeDefinition,\n apiName: key,\n fieldType: convertType(fieldTypeDefinition.fieldType),\n typeClasses: fieldTypeDefinition.typeClasses ?? [],\n aliases: fieldTypeDefinition.aliases ?? [],\n };\n }\n else {\n field = {\n apiName: key,\n displayMetadata: { displayName: key, description: undefined },\n typeClasses: [],\n aliases: [],\n fieldType: convertType(fieldTypeDefinition),\n };\n }\n }\n structFields.push(field);\n }\n return {\n type: \"struct\",\n struct: { structFields },\n };\n case (type === \"geopoint\"):\n return { type: \"geohash\", geohash: {} };\n case (type === \"decimal\"):\n return { type, [type]: { precision: undefined, scale: undefined } };\n case (type === \"string\"):\n return {\n type,\n [type]: {\n analyzerOverride: undefined,\n enableAsciiFolding: undefined,\n isLongText: false,\n supportsExactMatching: true,\n },\n };\n case (type === \"mediaReference\"):\n return {\n type: type,\n mediaReference: {},\n };\n default:\n // use helper function to distribute `type` properly\n return distributeTypeHelper(type);\n }\n}\n/**\n * Helper function to avoid duplication. Makes the types match properly with the correct\n * behavior without needing to switch on type.\n * @param type\n * @returns\n */\nfunction distributeTypeHelper(type) {\n return { type, [type]: {} }; // any cast to match conditional return type\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,IAAIA,kBAAkB;AAC7B;AACA,OAAO,IAAIC,SAAS;AACpB,OAAO,eAAeC,cAAcA,CAACC,EAAE,EAAEC,IAAI,EAAE;EAC3CH,SAAS,GAAGE,EAAE;EACdH,kBAAkB,GAAG;IACjBK,WAAW,EAAE,CAAC,CAAC;IACfC,WAAW,EAAE,CAAC,CAAC;IACfC,UAAU,EAAE,CA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B,SAAS;UAAEsB,KAAK,EAAEtB;QAAU;MAAE,CAAC;IACvE,KAAMZ,IAAI,KAAK,QAAQ;MACnB,OAAO;QACHA,IAAI;QACJ,CAACA,IAAI,GAAG;UACJmC,gBAAgB,EAAEvB,SAAS;UAC3BwB,kBAAkB,EAAExB,SAAS;UAC7ByB,UAAU,EAAE,KAAK;UACjBC,qBAAqB,EAAE;QAC3B;MACJ,CAAC;IACL,KAAMtC,IAAI,KAAK,gBAAgB;MAC3B,OAAO;QACHA,IAAI,EAAEA,IAAI;QACVuC,cAAc,EAAE,CAAC;MACrB,CAAC;IACL;MACI;MACA,OAAOC,oBAAoB,CAACxC,IAAI,CAAC;EACzC;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASwC,oBAAoBA,CAACxC,IAAI,EAAE;EAChC,OAAO;IAAEA,IAAI;IAAE,CAACA,IAAI,GAAG,CAAC;EAAE,CAAC,CAAC,CAAC;AACjC","ignoreList":[]}
1
+ {"version":3,"file":"defineOntology.js","names":["ontologyDefinition","namespace","defineOntology","ns","body","actionTypes","objectTypes","queryTypes","interfaceTypes","sharedPropertyTypes","valueTypes","importedTypes","e","console","error","ontology","convertToWireOntologyIr","valueType","convertOntologyToValueTypeIr","Object","values","map","definitions","metadata","apiName","displayMetadata","status","versions","definition","version","baseType","constraints","exampleValues","blockData","fromEntries","entries","spt","sharedPropertyType","convertSpt","interfaceType","convertInterface","blockPermissionInformation","linkTypes","properties","allExtendsInterfaces","allLinks","allProperties","dumpOntologyFullMetadata","dumpValueTypeWireType","type","array","description","displayName","gothamMapping","typeClasses","dataConstraint","propertyTypeConstraints","nullability","undefined","nullabilityV2","noEmptyCollections","noNulls","visibility","subtype","convertType","aliases","baseFormatter","dataConstraints","indexedForSearch","provenance","marking","markingType","structFields","Array","key","structDefinition","fieldTypeDefinition","field","fieldType","push","struct","geohash","precision","scale","analyzerOverride","enableAsciiFolding","isLongText","supportsExactMatching","mediaReference","distributeTypeHelper"],"sources":["defineOntology.js"],"sourcesContent":["/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/** @internal */\nexport let ontologyDefinition;\n/** @internal */\nexport let namespace;\nexport async function defineOntology(ns, body) {\n namespace = ns;\n ontologyDefinition = {\n actionTypes: {},\n objectTypes: {},\n queryTypes: {},\n interfaceTypes: {},\n sharedPropertyTypes: {},\n valueTypes: {},\n importedTypes: {\n sharedPropertyTypes: [],\n },\n };\n try {\n await body();\n }\n catch (e) {\n // eslint-disable-next-line no-console\n console.error(\"Unexpected error while processing the body of the ontology\", e);\n throw e;\n }\n return {\n ontology: convertToWireOntologyIr(ontologyDefinition),\n valueType: convertOntologyToValueTypeIr(ontologyDefinition),\n };\n}\nfunction convertOntologyToValueTypeIr(ontology) {\n return {\n valueTypes: Object.values(ontology.valueTypes).map(definitions => ({\n metadata: {\n apiName: definitions[0].apiName,\n displayMetadata: definitions[0].displayMetadata,\n status: definitions[0].status,\n },\n versions: definitions.map(definition => ({\n version: definition.version,\n baseType: definition.baseType,\n constraints: definition.constraints,\n exampleValues: definition.exampleValues,\n })),\n })),\n };\n}\nfunction convertToWireOntologyIr(ontology) {\n return {\n blockData: {\n sharedPropertyTypes: Object.fromEntries(Object.entries(ontology.sharedPropertyTypes)\n .map(([apiName, spt]) => [apiName, { sharedPropertyType: convertSpt(spt) }])),\n interfaceTypes: Object.fromEntries(Object.entries(ontology.interfaceTypes)\n .map(([apiName, interfaceType]) => {\n return [apiName, {\n interfaceType: convertInterface(interfaceType),\n }];\n })),\n blockPermissionInformation: {\n actionTypes: {},\n linkTypes: {},\n objectTypes: {},\n },\n },\n importedTypes: ontology.importedTypes,\n };\n}\nfunction convertInterface(interfaceType) {\n return {\n ...interfaceType,\n properties: Object.values(interfaceType.properties)\n .map((spt) => convertSpt(spt)),\n // these are omitted from our internal types but we need to re-add them for the final json\n allExtendsInterfaces: [],\n allLinks: [],\n allProperties: [],\n };\n}\nexport function dumpOntologyFullMetadata() {\n return convertToWireOntologyIr(ontologyDefinition);\n}\nexport function dumpValueTypeWireType() {\n return convertOntologyToValueTypeIr(ontologyDefinition);\n}\nfunction convertSpt({ type, array, description, apiName, displayName, gothamMapping, typeClasses, valueType, }) {\n const dataConstraint = (typeof type === \"object\" && type.type === \"marking\")\n ? {\n propertyTypeConstraints: [],\n nullability: undefined,\n nullabilityV2: { noEmptyCollections: true, noNulls: true },\n }\n : undefined;\n return {\n apiName,\n displayMetadata: {\n displayName: displayName ?? apiName,\n visibility: \"NORMAL\",\n description,\n },\n type: array\n ? {\n type: \"array\",\n array: {\n subtype: convertType(type),\n },\n }\n : convertType(type),\n aliases: [],\n baseFormatter: undefined,\n dataConstraints: dataConstraint,\n gothamMapping: gothamMapping,\n indexedForSearch: true,\n provenance: undefined,\n typeClasses: typeClasses ?? [],\n valueType: valueType,\n };\n}\nfunction convertType(type) {\n switch (true) {\n case (typeof type === \"object\" && \"markingType\" in type):\n return {\n \"type\": \"marking\",\n marking: { markingType: type.markingType },\n };\n case (typeof type === \"object\" && \"structDefinition\" in type):\n const structFields = new Array();\n for (const key in type.structDefinition) {\n const fieldTypeDefinition = type.structDefinition[key];\n let field;\n if (typeof fieldTypeDefinition === \"string\") {\n field = {\n apiName: key,\n displayMetadata: { displayName: key, description: undefined },\n typeClasses: [],\n aliases: [],\n fieldType: convertType(fieldTypeDefinition),\n };\n }\n else {\n // If it is a full form type definition then process it as such\n if (\"fieldType\" in fieldTypeDefinition) {\n field = {\n ...fieldTypeDefinition,\n apiName: key,\n fieldType: convertType(fieldTypeDefinition.fieldType),\n typeClasses: fieldTypeDefinition.typeClasses ?? [],\n aliases: fieldTypeDefinition.aliases ?? [],\n };\n }\n else {\n field = {\n apiName: key,\n displayMetadata: { displayName: key, description: undefined },\n typeClasses: [],\n aliases: [],\n fieldType: convertType(fieldTypeDefinition),\n };\n }\n }\n structFields.push(field);\n }\n return {\n type: \"struct\",\n struct: { structFields },\n };\n case (type === \"geopoint\"):\n return { type: \"geohash\", geohash: {} };\n case (type === \"decimal\"):\n return { type, [type]: { precision: undefined, scale: undefined } };\n case (type === \"string\"):\n return {\n type,\n [type]: {\n analyzerOverride: undefined,\n enableAsciiFolding: undefined,\n isLongText: false,\n supportsExactMatching: true,\n },\n };\n case (type === \"mediaReference\"):\n return {\n type: type,\n mediaReference: {},\n };\n default:\n // use helper function to distribute `type` properly\n return distributeTypeHelper(type);\n }\n}\n/**\n * Helper function to avoid duplication. Makes the types match properly with the correct\n * behavior without needing to switch on type.\n * @param type\n * @returns\n */\nfunction distributeTypeHelper(type) {\n return { type, [type]: {} }; // any cast to match conditional return type\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,IAAIA,kBAAkB;AAC7B;AACA,OAAO,IAAIC,SAAS;AACpB,OAAO,eAAeC,cAAcA,CAACC,EAAE,EAAEC,IAAI,EAAE;EAC3CH,SAAS,GAAGE,EAAE;EACdH,kBAAkB,GAAG;IACjBK,WAAW,EAAE,CAAC,CAAC;IACfC,WAAW,EAAE,CAAC,CAAC;IACfC,UAAU,EAAE,CAAC,CAAC;IACdC,cAAc,EAAE,CAAC,CAAC;IAClBC,mBAAmB,EAAE,CAAC,CAAC;IACvBC,UAAU,EAAE,CAAC,CAAC;IACdC,aAAa,EAAE;MACXF,mBAAmB,EAAE;IACzB;EACJ,CAAC;EACD,IAAI;IACA,MAAML,IAAI,CAAC,CAAC;EAChB,CAAC,CACD,OAAOQ,CAAC,EAAE;IACN;IACAC,OAAO,CAACC,KAAK,CAAC,4DAA4D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I,KAAK,gBAAgB;MAC3B,OAAO;QACHA,IAAI,EAAEA,IAAI;QACVuC,cAAc,EAAE,CAAC;MACrB,CAAC;IACL;MACI;MACA,OAAOC,oBAAoB,CAACxC,IAAI,CAAC;EACzC;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASwC,oBAAoBA,CAACxC,IAAI,EAAE;EAChC,OAAO;IAAEA,IAAI;IAAE,CAACA,IAAI,GAAG,CAAC;EAAE,CAAC,CAAC,CAAC;AACjC","ignoreList":[]}
@@ -21,8 +21,8 @@ import { defineOntology, dumpOntologyFullMetadata, dumpValueTypeWireType } from
21
21
  import { defineSharedPropertyType } from "./defineSpt.js";
22
22
  import { defineValueType } from "./defineValueType.js";
23
23
  describe("Ontology Defining", () => {
24
- beforeEach(() => {
25
- defineOntology("com.palantir.", () => {});
24
+ beforeEach(async () => {
25
+ await defineOntology("com.palantir.", () => {});
26
26
  });
27
27
  describe("ValueTypes", () => {
28
28
  it("Fails to define value type with incorrect semver", () => {
@@ -40,7 +40,7 @@ describe("Ontology Defining", () => {
40
40
  version: "not a version"
41
41
  })).toThrowErrorMatchingInlineSnapshot("[Error: Invariant failed: Version is not a valid semver]");
42
42
  });
43
- it("Correctly serializes a value type", () => {
43
+ it("Correctly serializes a value type", async () => {
44
44
  defineValueType({
45
45
  apiName: "apiName",
46
46
  displayName: "displayName",
@@ -99,6 +99,8 @@ describe("Ontology Defining", () => {
99
99
  }
100
100
  `);
101
101
  });
102
+ // N.B Not sure what this is for but I don't want to break anything so I added the eslint ignore
103
+ // eslint-disable-next-line @typescript-eslint/no-floating-promises
102
104
  defineOntology("com.palantir.", () => {});
103
105
  });
104
106
  describe("Interfaces", () => {
@@ -1169,7 +1171,7 @@ describe("Ontology Defining", () => {
1169
1171
  "apiName": "com.palantir.foo",
1170
1172
  "baseFormatter": undefined,
1171
1173
  "dataConstraints": {
1172
- "nullability": "NO_EXPLICIT_NULLS",
1174
+ "nullability": undefined,
1173
1175
  "nullabilityV2": {
1174
1176
  "noEmptyCollections": true,
1175
1177
  "noNulls": true,
@@ -1242,7 +1244,7 @@ describe("Ontology Defining", () => {
1242
1244
  "apiName": "com.palantir.foo",
1243
1245
  "baseFormatter": undefined,
1244
1246
  "dataConstraints": {
1245
- "nullability": "NO_EXPLICIT_NULLS",
1247
+ "nullability": undefined,
1246
1248
  "nullabilityV2": {
1247
1249
  "noEmptyCollections": true,
1248
1250
  "noNulls": true,
@@ -1 +1 @@
1
- {"version":3,"file":"overall.test.js","names":["beforeEach","describe","expect","it","importSharedPropertyType","defineInterface","defineInterfaceLinkConstraint","defineOntology","dumpOntologyFullMetadata","dumpValueTypeWireType","defineSharedPropertyType","defineValueType","apiName","displayName","type","constraints","constraint","version","toThrowErrorMatchingInlineSnapshot","toMatchInlineSnapshot","result","displayMetadata","toBe","description","properties","foo","blockData","parentInterface","property1","property2","extends","a","b","not","toBeUndefined","from","toOne","toMany","fooSpt","icon","color","locator","structDefinition","fieldType","undefined","regularSpt","markingType","importedSpt","typeHint","packageName","bar","importedTypes","status","toEqual","active","experimental","message","deadline","deprecated"],"sources":["overall.test.js"],"sourcesContent":["/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { beforeEach, describe, expect, it } from \"vitest\";\nimport { importSharedPropertyType } from \"./defineImportSpt.js\";\nimport { defineInterface } from \"./defineInterface.js\";\nimport { defineInterfaceLinkConstraint } from \"./defineInterfaceLinkConstraint.js\";\nimport { defineOntology, dumpOntologyFullMetadata, dumpValueTypeWireType, } from \"./defineOntology.js\";\nimport { defineSharedPropertyType } from \"./defineSpt.js\";\nimport { defineValueType } from \"./defineValueType.js\";\ndescribe(\"Ontology Defining\", () => {\n beforeEach(() => {\n defineOntology(\"com.palantir.\", () => { });\n });\n describe(\"ValueTypes\", () => {\n it(\"Fails to define value type with incorrect semver\", () => {\n expect(() => defineValueType({\n apiName: \"apiName\",\n displayName: \"displayName\",\n type: {\n \"type\": \"boolean\",\n constraints: [{ constraint: { \"allowedValues\": [\"TRUE_VALUE\"] } }],\n },\n version: \"not a version\",\n })).toThrowErrorMatchingInlineSnapshot(\"[Error: Invariant failed: Version is not a valid semver]\");\n });\n it(\"Correctly serializes a value type\", () => {\n defineValueType({\n apiName: \"apiName\",\n displayName: \"displayName\",\n 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 \"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 defineOntology(\"com.palantir.\", () => { });\n });\n describe(\"Interfaces\", () => {\n it(\"doesn't let you define the same interface twice\", () => {\n defineInterface({ apiName: \"Foo\" });\n expect(() => {\n defineInterface({ apiName: \"Foo\" });\n }).toThrowErrorMatchingInlineSnapshot(`[Error: Invariant failed: Interface com.palantir.Foo already exists]`);\n });\n it(\"defaults displayName to apiName\", () => {\n const result = defineInterface({ apiName: \"Foo\" });\n expect(result.displayMetadata.displayName).toBe(\"Foo\");\n });\n it(\"defaults description to displayName\", () => {\n const result = defineInterface({ apiName: \"Foo\", displayName: \"d\" });\n expect(result.displayMetadata.description).toBe(\"d\");\n });\n it(\"defaults description to displayName to apiName\", () => {\n const result = defineInterface({ apiName: \"Foo\" });\n expect(result.displayMetadata.description).toBe(\"Foo\");\n });\n describe(\"auto spts\", () => {\n it(\"auto creates spts\", () => {\n defineInterface({\n apiName: \"Foo\",\n properties: {\n foo: \"string\",\n },\n });\n expect(dumpOntologyFullMetadata().blockData).toMatchInlineSnapshot(`\n {\n \"blockPermissionInformation\": {\n \"actionTypes\": {},\n \"linkTypes\": {},\n \"objectTypes\": {},\n },\n \"interfaceTypes\": {\n \"com.palantir.Foo\": {\n \"interfaceType\": {\n \"allExtendsInterfaces\": [],\n \"allLinks\": [],\n \"allProperties\": [],\n \"apiName\": \"com.palantir.Foo\",\n \"displayMetadata\": {\n \"description\": \"Foo\",\n \"displayName\": \"Foo\",\n \"icon\": undefined,\n },\n \"extendsInterfaces\": [],\n \"links\": [],\n \"properties\": [\n {\n \"aliases\": [],\n \"apiName\": \"com.palantir.foo\",\n \"baseFormatter\": undefined,\n \"dataConstraints\": undefined,\n \"displayMetadata\": {\n \"description\": undefined,\n \"displayName\": \"foo\",\n \"visibility\": \"NORMAL\",\n },\n \"gothamMapping\": undefined,\n \"indexedForSearch\": true,\n \"provenance\": undefined,\n \"type\": {\n \"string\": {\n \"analyzerOverride\": undefined,\n \"enableAsciiFolding\": undefined,\n \"isLongText\": false,\n \"supportsExactMatching\": true,\n },\n \"type\": \"string\",\n },\n \"typeClasses\": [\n {\n \"kind\": \"render_hint\",\n \"name\": \"SELECTABLE\",\n },\n {\n \"kind\": \"render_hint\",\n \"name\": \"SORTABLE\",\n },\n ],\n \"valueType\": undefined,\n },\n ],\n \"status\": {\n \"active\": {},\n \"type\": \"active\",\n },\n },\n },\n },\n \"sharedPropertyTypes\": {\n \"com.palantir.foo\": {\n \"sharedPropertyType\": {\n \"aliases\": [],\n \"apiName\": \"com.palantir.foo\",\n \"baseFormatter\": undefined,\n \"dataConstraints\": undefined,\n \"displayMetadata\": {\n \"description\": undefined,\n \"displayName\": \"foo\",\n \"visibility\": \"NORMAL\",\n },\n \"gothamMapping\": undefined,\n \"indexedForSearch\": true,\n \"provenance\": undefined,\n \"type\": {\n \"string\": {\n \"analyzerOverride\": undefined,\n \"enableAsciiFolding\": undefined,\n \"isLongText\": false,\n \"supportsExactMatching\": true,\n },\n \"type\": \"string\",\n },\n \"typeClasses\": [\n {\n \"kind\": \"render_hint\",\n \"name\": \"SELECTABLE\",\n },\n {\n \"kind\": \"render_hint\",\n \"name\": \"SORTABLE\",\n },\n ],\n \"valueType\": undefined,\n },\n },\n },\n }\n `);\n });\n it(\"does not let you conflict spts\", () => {\n defineSharedPropertyType({\n apiName: \"foo\",\n type: \"string\",\n });\n expect(dumpOntologyFullMetadata().blockData).toMatchInlineSnapshot(`\n {\n \"blockPermissionInformation\": {\n \"actionTypes\": {},\n \"linkTypes\": {},\n \"objectTypes\": {},\n },\n \"interfaceTypes\": {},\n \"sharedPropertyTypes\": {\n \"com.palantir.foo\": {\n \"sharedPropertyType\": {\n \"aliases\": [],\n \"apiName\": \"com.palantir.foo\",\n \"baseFormatter\": undefined,\n \"dataConstraints\": undefined,\n \"displayMetadata\": {\n \"description\": undefined,\n \"displayName\": \"foo\",\n \"visibility\": \"NORMAL\",\n },\n \"gothamMapping\": undefined,\n \"indexedForSearch\": true,\n \"provenance\": undefined,\n \"type\": {\n \"string\": {\n \"analyzerOverride\": undefined,\n \"enableAsciiFolding\": undefined,\n \"isLongText\": false,\n \"supportsExactMatching\": true,\n },\n \"type\": \"string\",\n },\n \"typeClasses\": [\n {\n \"kind\": \"render_hint\",\n \"name\": \"SELECTABLE\",\n },\n {\n \"kind\": \"render_hint\",\n \"name\": \"SORTABLE\",\n },\n ],\n \"valueType\": undefined,\n },\n },\n },\n }\n `);\n expect(() => {\n defineInterface({\n apiName: \"Foo\",\n properties: {\n foo: \"string\",\n },\n });\n }).toThrowErrorMatchingInlineSnapshot(`[Error: Invariant failed: Shared property type com.palantir.foo already exists]`);\n });\n });\n it(\"allows extends interfaces with InterfaceType provided\", () => {\n const parentInterface = defineInterface({\n apiName: \"parentInterface\",\n properties: {\n property1: \"string\",\n },\n });\n const childInterface = defineInterface({\n apiName: \"childInterface\",\n properties: {\n property2: \"string\",\n },\n extends: [parentInterface],\n });\n expect(dumpOntologyFullMetadata().blockData).toMatchInlineSnapshot(`\n {\n \"blockPermissionInformation\": {\n \"actionTypes\": {},\n \"linkTypes\": {},\n \"objectTypes\": {},\n },\n \"interfaceTypes\": {\n \"com.palantir.childInterface\": {\n \"interfaceType\": {\n \"allExtendsInterfaces\": [],\n \"allLinks\": [],\n \"allProperties\": [],\n \"apiName\": \"com.palantir.childInterface\",\n \"displayMetadata\": {\n \"description\": \"childInterface\",\n \"displayName\": \"childInterface\",\n \"icon\": undefined,\n },\n \"extendsInterfaces\": [\n \"com.palantir.parentInterface\",\n ],\n \"links\": [],\n \"properties\": [\n {\n \"aliases\": [],\n \"apiName\": \"com.palantir.property2\",\n \"baseFormatter\": undefined,\n \"dataConstraints\": undefined,\n \"displayMetadata\": {\n \"description\": undefined,\n \"displayName\": \"property2\",\n \"visibility\": \"NORMAL\",\n },\n \"gothamMapping\": undefined,\n \"indexedForSearch\": true,\n \"provenance\": undefined,\n \"type\": {\n \"string\": {\n \"analyzerOverride\": undefined,\n \"enableAsciiFolding\": undefined,\n \"isLongText\": false,\n \"supportsExactMatching\": true,\n },\n \"type\": \"string\",\n },\n \"typeClasses\": [\n {\n \"kind\": \"render_hint\",\n \"name\": \"SELECTABLE\",\n },\n {\n \"kind\": \"render_hint\",\n \"name\": \"SORTABLE\",\n },\n ],\n \"valueType\": undefined,\n },\n ],\n \"status\": {\n \"active\": {},\n \"type\": \"active\",\n },\n },\n },\n \"com.palantir.parentInterface\": {\n \"interfaceType\": {\n \"allExtendsInterfaces\": [],\n \"allLinks\": [],\n \"allProperties\": [],\n \"apiName\": \"com.palantir.parentInterface\",\n \"displayMetadata\": {\n \"description\": \"parentInterface\",\n \"displayName\": \"parentInterface\",\n \"icon\": undefined,\n },\n \"extendsInterfaces\": [],\n \"links\": [],\n \"properties\": [\n {\n \"aliases\": [],\n \"apiName\": \"com.palantir.property1\",\n \"baseFormatter\": undefined,\n \"dataConstraints\": undefined,\n \"displayMetadata\": {\n \"description\": undefined,\n \"displayName\": \"property1\",\n \"visibility\": \"NORMAL\",\n },\n \"gothamMapping\": undefined,\n \"indexedForSearch\": true,\n \"provenance\": undefined,\n \"type\": {\n \"string\": {\n \"analyzerOverride\": undefined,\n \"enableAsciiFolding\": undefined,\n \"isLongText\": false,\n \"supportsExactMatching\": true,\n },\n \"type\": \"string\",\n },\n \"typeClasses\": [\n {\n \"kind\": \"render_hint\",\n \"name\": \"SELECTABLE\",\n },\n {\n \"kind\": \"render_hint\",\n \"name\": \"SORTABLE\",\n },\n ],\n \"valueType\": undefined,\n },\n ],\n \"status\": {\n \"active\": {},\n \"type\": \"active\",\n },\n },\n },\n },\n \"sharedPropertyTypes\": {\n \"com.palantir.property1\": {\n \"sharedPropertyType\": {\n \"aliases\": [],\n \"apiName\": \"com.palantir.property1\",\n \"baseFormatter\": undefined,\n \"dataConstraints\": undefined,\n \"displayMetadata\": {\n \"description\": undefined,\n \"displayName\": \"property1\",\n \"visibility\": \"NORMAL\",\n },\n \"gothamMapping\": undefined,\n \"indexedForSearch\": true,\n \"provenance\": undefined,\n \"type\": {\n \"string\": {\n \"analyzerOverride\": undefined,\n \"enableAsciiFolding\": undefined,\n \"isLongText\": false,\n \"supportsExactMatching\": true,\n },\n \"type\": \"string\",\n },\n \"typeClasses\": [\n {\n \"kind\": \"render_hint\",\n \"name\": \"SELECTABLE\",\n },\n {\n \"kind\": \"render_hint\",\n \"name\": \"SORTABLE\",\n },\n ],\n \"valueType\": undefined,\n },\n },\n \"com.palantir.property2\": {\n \"sharedPropertyType\": {\n \"aliases\": [],\n \"apiName\": \"com.palantir.property2\",\n \"baseFormatter\": undefined,\n \"dataConstraints\": undefined,\n \"displayMetadata\": {\n \"description\": undefined,\n \"displayName\": \"property2\",\n \"visibility\": \"NORMAL\",\n },\n \"gothamMapping\": undefined,\n \"indexedForSearch\": true,\n \"provenance\": undefined,\n \"type\": {\n \"string\": {\n \"analyzerOverride\": undefined,\n \"enableAsciiFolding\": undefined,\n \"isLongText\": false,\n \"supportsExactMatching\": true,\n },\n \"type\": \"string\",\n },\n \"typeClasses\": [\n {\n \"kind\": \"render_hint\",\n \"name\": \"SELECTABLE\",\n },\n {\n \"kind\": \"render_hint\",\n \"name\": \"SORTABLE\",\n },\n ],\n \"valueType\": undefined,\n },\n },\n },\n }\n `);\n });\n it(\"allows extends interfaces with apiName provided\", () => {\n const parentInterface = defineInterface({\n apiName: \"parentInterface\",\n properties: {\n property1: \"string\",\n },\n });\n const childInterface = defineInterface({\n apiName: \"childInterface\",\n properties: {\n property2: \"string\",\n },\n extends: [\"parentInterface\"],\n });\n expect(dumpOntologyFullMetadata().blockData).toMatchInlineSnapshot(`\n {\n \"blockPermissionInformation\": {\n \"actionTypes\": {},\n \"linkTypes\": {},\n \"objectTypes\": {},\n },\n \"interfaceTypes\": {\n \"com.palantir.childInterface\": {\n \"interfaceType\": {\n \"allExtendsInterfaces\": [],\n \"allLinks\": [],\n \"allProperties\": [],\n \"apiName\": \"com.palantir.childInterface\",\n \"displayMetadata\": {\n \"description\": \"childInterface\",\n \"displayName\": \"childInterface\",\n \"icon\": undefined,\n },\n \"extendsInterfaces\": [\n \"parentInterface\",\n ],\n \"links\": [],\n \"properties\": [\n {\n \"aliases\": [],\n \"apiName\": \"com.palantir.property2\",\n \"baseFormatter\": undefined,\n \"dataConstraints\": undefined,\n \"displayMetadata\": {\n \"description\": undefined,\n \"displayName\": \"property2\",\n \"visibility\": \"NORMAL\",\n },\n \"gothamMapping\": undefined,\n \"indexedForSearch\": true,\n \"provenance\": undefined,\n \"type\": {\n \"string\": {\n \"analyzerOverride\": undefined,\n \"enableAsciiFolding\": undefined,\n \"isLongText\": false,\n \"supportsExactMatching\": true,\n },\n \"type\": \"string\",\n },\n \"typeClasses\": [\n {\n \"kind\": \"render_hint\",\n \"name\": \"SELECTABLE\",\n },\n {\n \"kind\": \"render_hint\",\n \"name\": \"SORTABLE\",\n },\n ],\n \"valueType\": undefined,\n },\n ],\n \"status\": {\n \"active\": {},\n \"type\": \"active\",\n },\n },\n },\n \"com.palantir.parentInterface\": {\n \"interfaceType\": {\n \"allExtendsInterfaces\": [],\n \"allLinks\": [],\n \"allProperties\": [],\n \"apiName\": \"com.palantir.parentInterface\",\n \"displayMetadata\": {\n \"description\": \"parentInterface\",\n \"displayName\": \"parentInterface\",\n \"icon\": undefined,\n },\n \"extendsInterfaces\": [],\n \"links\": [],\n \"properties\": [\n {\n \"aliases\": [],\n \"apiName\": \"com.palantir.property1\",\n \"baseFormatter\": undefined,\n \"dataConstraints\": undefined,\n \"displayMetadata\": {\n \"description\": undefined,\n \"displayName\": \"property1\",\n \"visibility\": \"NORMAL\",\n },\n \"gothamMapping\": undefined,\n \"indexedForSearch\": true,\n \"provenance\": undefined,\n \"type\": {\n \"string\": {\n \"analyzerOverride\": undefined,\n \"enableAsciiFolding\": undefined,\n \"isLongText\": false,\n \"supportsExactMatching\": true,\n },\n \"type\": \"string\",\n },\n \"typeClasses\": [\n {\n \"kind\": \"render_hint\",\n \"name\": \"SELECTABLE\",\n },\n {\n \"kind\": \"render_hint\",\n \"name\": \"SORTABLE\",\n },\n ],\n \"valueType\": undefined,\n },\n ],\n \"status\": {\n \"active\": {},\n \"type\": \"active\",\n },\n },\n },\n },\n \"sharedPropertyTypes\": {\n \"com.palantir.property1\": {\n \"sharedPropertyType\": {\n \"aliases\": [],\n \"apiName\": \"com.palantir.property1\",\n \"baseFormatter\": undefined,\n \"dataConstraints\": undefined,\n \"displayMetadata\": {\n \"description\": undefined,\n \"displayName\": \"property1\",\n \"visibility\": \"NORMAL\",\n },\n \"gothamMapping\": undefined,\n \"indexedForSearch\": true,\n \"provenance\": undefined,\n \"type\": {\n \"string\": {\n \"analyzerOverride\": undefined,\n \"enableAsciiFolding\": undefined,\n \"isLongText\": false,\n \"supportsExactMatching\": true,\n },\n \"type\": \"string\",\n },\n \"typeClasses\": [\n {\n \"kind\": \"render_hint\",\n \"name\": \"SELECTABLE\",\n },\n {\n \"kind\": \"render_hint\",\n \"name\": \"SORTABLE\",\n },\n ],\n \"valueType\": undefined,\n },\n },\n \"com.palantir.property2\": {\n \"sharedPropertyType\": {\n \"aliases\": [],\n \"apiName\": \"com.palantir.property2\",\n \"baseFormatter\": undefined,\n \"dataConstraints\": undefined,\n \"displayMetadata\": {\n \"description\": undefined,\n \"displayName\": \"property2\",\n \"visibility\": \"NORMAL\",\n },\n \"gothamMapping\": undefined,\n \"indexedForSearch\": true,\n \"provenance\": undefined,\n \"type\": {\n \"string\": {\n \"analyzerOverride\": undefined,\n \"enableAsciiFolding\": undefined,\n \"isLongText\": false,\n \"supportsExactMatching\": true,\n },\n \"type\": \"string\",\n },\n \"typeClasses\": [\n {\n \"kind\": \"render_hint\",\n \"name\": \"SELECTABLE\",\n },\n {\n \"kind\": \"render_hint\",\n \"name\": \"SORTABLE\",\n },\n ],\n \"valueType\": undefined,\n },\n },\n },\n }\n `);\n });\n });\n describe(\"ILTs\", () => {\n let a;\n let b;\n beforeEach(() => {\n a = defineInterface({ apiName: \"A\" });\n b = defineInterface({ apiName: \"B\" });\n });\n it(\"single link works\", () => {\n expect(a).not.toBeUndefined();\n defineInterfaceLinkConstraint({\n from: a,\n toOne: b,\n apiName: \"singleLink\",\n });\n expect(dumpOntologyFullMetadata().blockData).toMatchInlineSnapshot(`\n {\n \"blockPermissionInformation\": {\n \"actionTypes\": {},\n \"linkTypes\": {},\n \"objectTypes\": {},\n },\n \"interfaceTypes\": {\n \"com.palantir.A\": {\n \"interfaceType\": {\n \"allExtendsInterfaces\": [],\n \"allLinks\": [],\n \"allProperties\": [],\n \"apiName\": \"com.palantir.A\",\n \"displayMetadata\": {\n \"description\": \"A\",\n \"displayName\": \"A\",\n \"icon\": undefined,\n },\n \"extendsInterfaces\": [],\n \"links\": [\n {\n \"cardinality\": \"SINGLE\",\n \"linkedEntityTypeId\": {\n \"interfaceType\": \"com.palantir.B\",\n \"type\": \"interfaceType\",\n },\n \"metadata\": {\n \"apiName\": \"com.palantir.singleLink\",\n \"description\": \"singleLink\",\n \"displayName\": \"singleLink\",\n },\n \"required\": true,\n },\n ],\n \"properties\": [],\n \"status\": {\n \"active\": {},\n \"type\": \"active\",\n },\n },\n },\n \"com.palantir.B\": {\n \"interfaceType\": {\n \"allExtendsInterfaces\": [],\n \"allLinks\": [],\n \"allProperties\": [],\n \"apiName\": \"com.palantir.B\",\n \"displayMetadata\": {\n \"description\": \"B\",\n \"displayName\": \"B\",\n \"icon\": undefined,\n },\n \"extendsInterfaces\": [],\n \"links\": [],\n \"properties\": [],\n \"status\": {\n \"active\": {},\n \"type\": \"active\",\n },\n },\n },\n },\n \"sharedPropertyTypes\": {},\n }\n `);\n });\n it(\"many link works\", () => {\n defineInterfaceLinkConstraint({\n from: a,\n toMany: b,\n apiName: \"manyLink\",\n });\n expect(dumpOntologyFullMetadata().blockData).toMatchInlineSnapshot(`\n {\n \"blockPermissionInformation\": {\n \"actionTypes\": {},\n \"linkTypes\": {},\n \"objectTypes\": {},\n },\n \"interfaceTypes\": {\n \"com.palantir.A\": {\n \"interfaceType\": {\n \"allExtendsInterfaces\": [],\n \"allLinks\": [],\n \"allProperties\": [],\n \"apiName\": \"com.palantir.A\",\n \"displayMetadata\": {\n \"description\": \"A\",\n \"displayName\": \"A\",\n \"icon\": undefined,\n },\n \"extendsInterfaces\": [],\n \"links\": [\n {\n \"cardinality\": \"MANY\",\n \"linkedEntityTypeId\": {\n \"interfaceType\": \"com.palantir.B\",\n \"type\": \"interfaceType\",\n },\n \"metadata\": {\n \"apiName\": \"com.palantir.manyLink\",\n \"description\": \"manyLink\",\n \"displayName\": \"manyLink\",\n },\n \"required\": true,\n },\n ],\n \"properties\": [],\n \"status\": {\n \"active\": {},\n \"type\": \"active\",\n },\n },\n },\n \"com.palantir.B\": {\n \"interfaceType\": {\n \"allExtendsInterfaces\": [],\n \"allLinks\": [],\n \"allProperties\": [],\n \"apiName\": \"com.palantir.B\",\n \"displayMetadata\": {\n \"description\": \"B\",\n \"displayName\": \"B\",\n \"icon\": undefined,\n },\n \"extendsInterfaces\": [],\n \"links\": [],\n \"properties\": [],\n \"status\": {\n \"active\": {},\n \"type\": \"active\",\n },\n },\n },\n },\n \"sharedPropertyTypes\": {},\n }\n `);\n });\n });\n describe(\"SPTs\", () => {\n it(\"doesn't let you create the same spt twice\", () => {\n defineSharedPropertyType({\n apiName: \"foo\",\n type: \"string\",\n });\n expect(() => {\n defineSharedPropertyType({\n apiName: \"foo\",\n type: \"string\",\n });\n }).toThrowErrorMatchingInlineSnapshot(`[Error: Invariant failed: Shared property type com.palantir.foo already exists]`);\n });\n });\n it(\"uses a predefined spt\", () => {\n const fooSpt = defineSharedPropertyType({\n apiName: \"fooSpt\",\n type: \"string\",\n });\n const FooInterface = defineInterface({\n apiName: \"FooInterface\",\n displayName: \"Foo Interface\",\n properties: {\n fooSpt,\n },\n icon: { color: \"#00000\", locator: \"airplane\" },\n });\n expect(dumpOntologyFullMetadata().blockData).toMatchInlineSnapshot(`\n {\n \"blockPermissionInformation\": {\n \"actionTypes\": {},\n \"linkTypes\": {},\n \"objectTypes\": {},\n },\n \"interfaceTypes\": {\n \"com.palantir.FooInterface\": {\n \"interfaceType\": {\n \"allExtendsInterfaces\": [],\n \"allLinks\": [],\n \"allProperties\": [],\n \"apiName\": \"com.palantir.FooInterface\",\n \"displayMetadata\": {\n \"description\": \"Foo Interface\",\n \"displayName\": \"Foo Interface\",\n \"icon\": {\n \"blueprint\": {\n \"color\": \"#00000\",\n \"locator\": \"airplane\",\n },\n \"type\": \"blueprint\",\n },\n },\n \"extendsInterfaces\": [],\n \"links\": [],\n \"properties\": [\n {\n \"aliases\": [],\n \"apiName\": \"com.palantir.fooSpt\",\n \"baseFormatter\": undefined,\n \"dataConstraints\": undefined,\n \"displayMetadata\": {\n \"description\": undefined,\n \"displayName\": \"fooSpt\",\n \"visibility\": \"NORMAL\",\n },\n \"gothamMapping\": undefined,\n \"indexedForSearch\": true,\n \"provenance\": undefined,\n \"type\": {\n \"string\": {\n \"analyzerOverride\": undefined,\n \"enableAsciiFolding\": undefined,\n \"isLongText\": false,\n \"supportsExactMatching\": true,\n },\n \"type\": \"string\",\n },\n \"typeClasses\": [\n {\n \"kind\": \"render_hint\",\n \"name\": \"SELECTABLE\",\n },\n {\n \"kind\": \"render_hint\",\n \"name\": \"SORTABLE\",\n },\n ],\n \"valueType\": undefined,\n },\n ],\n \"status\": {\n \"active\": {},\n \"type\": \"active\",\n },\n },\n },\n },\n \"sharedPropertyTypes\": {\n \"com.palantir.fooSpt\": {\n \"sharedPropertyType\": {\n \"aliases\": [],\n \"apiName\": \"com.palantir.fooSpt\",\n \"baseFormatter\": undefined,\n \"dataConstraints\": undefined,\n \"displayMetadata\": {\n \"description\": undefined,\n \"displayName\": \"fooSpt\",\n \"visibility\": \"NORMAL\",\n },\n \"gothamMapping\": undefined,\n \"indexedForSearch\": true,\n \"provenance\": undefined,\n \"type\": {\n \"string\": {\n \"analyzerOverride\": undefined,\n \"enableAsciiFolding\": undefined,\n \"isLongText\": false,\n \"supportsExactMatching\": true,\n },\n \"type\": \"string\",\n },\n \"typeClasses\": [\n {\n \"kind\": \"render_hint\",\n \"name\": \"SELECTABLE\",\n },\n {\n \"kind\": \"render_hint\",\n \"name\": \"SORTABLE\",\n },\n ],\n \"valueType\": undefined,\n },\n },\n },\n }\n `);\n });\n it(\"properly serializes both types of struct SPTs\", () => {\n const fooSpt = defineSharedPropertyType({\n apiName: \"fooSpt\",\n type: {\n type: \"struct\",\n structDefinition: {\n \"simpleProperty\": \"boolean\",\n \"complexProperty\": {\n fieldType: \"date\",\n displayMetadata: {\n displayName: \"complex property\",\n description: undefined,\n },\n },\n },\n },\n });\n expect(dumpOntologyFullMetadata().blockData).toMatchInlineSnapshot(`\n {\n \"blockPermissionInformation\": {\n \"actionTypes\": {},\n \"linkTypes\": {},\n \"objectTypes\": {},\n },\n \"interfaceTypes\": {},\n \"sharedPropertyTypes\": {\n \"com.palantir.fooSpt\": {\n \"sharedPropertyType\": {\n \"aliases\": [],\n \"apiName\": \"com.palantir.fooSpt\",\n \"baseFormatter\": undefined,\n \"dataConstraints\": undefined,\n \"displayMetadata\": {\n \"description\": undefined,\n \"displayName\": \"fooSpt\",\n \"visibility\": \"NORMAL\",\n },\n \"gothamMapping\": undefined,\n \"indexedForSearch\": true,\n \"provenance\": undefined,\n \"type\": {\n \"struct\": {\n \"structFields\": [\n {\n \"aliases\": [],\n \"apiName\": \"simpleProperty\",\n \"displayMetadata\": {\n \"description\": undefined,\n \"displayName\": \"simpleProperty\",\n },\n \"fieldType\": {\n \"boolean\": {},\n \"type\": \"boolean\",\n },\n \"typeClasses\": [],\n },\n {\n \"aliases\": [],\n \"apiName\": \"complexProperty\",\n \"displayMetadata\": {\n \"description\": undefined,\n \"displayName\": \"complex property\",\n },\n \"fieldType\": {\n \"date\": {},\n \"type\": \"date\",\n },\n \"typeClasses\": [],\n },\n ],\n },\n \"type\": \"struct\",\n },\n \"typeClasses\": [\n {\n \"kind\": \"render_hint\",\n \"name\": \"SELECTABLE\",\n },\n {\n \"kind\": \"render_hint\",\n \"name\": \"SORTABLE\",\n },\n ],\n \"valueType\": undefined,\n },\n },\n },\n }\n `);\n });\n it(\"Adds imported SPTs only to the interface definition\", () => {\n const regularSpt = defineSharedPropertyType({\n apiName: \"foo\",\n type: { type: \"marking\", markingType: \"CBAC\" },\n });\n const importedSpt = importSharedPropertyType({\n apiName: \"bar\",\n typeHint: \"string\",\n packageName: \"com.palantir.bar\",\n });\n defineInterface({\n apiName: \"interface\",\n properties: { foo: regularSpt, bar: importedSpt },\n });\n expect(dumpOntologyFullMetadata().blockData).toMatchInlineSnapshot(`\n {\n \"blockPermissionInformation\": {\n \"actionTypes\": {},\n \"linkTypes\": {},\n \"objectTypes\": {},\n },\n \"interfaceTypes\": {\n \"com.palantir.interface\": {\n \"interfaceType\": {\n \"allExtendsInterfaces\": [],\n \"allLinks\": [],\n \"allProperties\": [],\n \"apiName\": \"com.palantir.interface\",\n \"displayMetadata\": {\n \"description\": \"interface\",\n \"displayName\": \"interface\",\n \"icon\": undefined,\n },\n \"extendsInterfaces\": [],\n \"links\": [],\n \"properties\": [\n {\n \"aliases\": [],\n \"apiName\": \"com.palantir.foo\",\n \"baseFormatter\": undefined,\n \"dataConstraints\": {\n \"nullability\": \"NO_EXPLICIT_NULLS\",\n \"nullabilityV2\": {\n \"noEmptyCollections\": true,\n \"noNulls\": true,\n },\n \"propertyTypeConstraints\": [],\n },\n \"displayMetadata\": {\n \"description\": undefined,\n \"displayName\": \"foo\",\n \"visibility\": \"NORMAL\",\n },\n \"gothamMapping\": undefined,\n \"indexedForSearch\": true,\n \"provenance\": undefined,\n \"type\": {\n \"marking\": {\n \"markingType\": \"CBAC\",\n },\n \"type\": \"marking\",\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 \"aliases\": [],\n \"apiName\": \"com.palantir.bar.bar\",\n \"baseFormatter\": undefined,\n \"dataConstraints\": undefined,\n \"displayMetadata\": {\n \"description\": undefined,\n \"displayName\": \"com.palantir.bar.bar\",\n \"visibility\": \"NORMAL\",\n },\n \"gothamMapping\": undefined,\n \"indexedForSearch\": true,\n \"provenance\": undefined,\n \"type\": {\n \"string\": {\n \"analyzerOverride\": undefined,\n \"enableAsciiFolding\": undefined,\n \"isLongText\": false,\n \"supportsExactMatching\": true,\n },\n \"type\": \"string\",\n },\n \"typeClasses\": [],\n \"valueType\": undefined,\n },\n ],\n \"status\": {\n \"active\": {},\n \"type\": \"active\",\n },\n },\n },\n },\n \"sharedPropertyTypes\": {\n \"com.palantir.foo\": {\n \"sharedPropertyType\": {\n \"aliases\": [],\n \"apiName\": \"com.palantir.foo\",\n \"baseFormatter\": undefined,\n \"dataConstraints\": {\n \"nullability\": \"NO_EXPLICIT_NULLS\",\n \"nullabilityV2\": {\n \"noEmptyCollections\": true,\n \"noNulls\": true,\n },\n \"propertyTypeConstraints\": [],\n },\n \"displayMetadata\": {\n \"description\": undefined,\n \"displayName\": \"foo\",\n \"visibility\": \"NORMAL\",\n },\n \"gothamMapping\": undefined,\n \"indexedForSearch\": true,\n \"provenance\": undefined,\n \"type\": {\n \"marking\": {\n \"markingType\": \"CBAC\",\n },\n \"type\": \"marking\",\n },\n \"typeClasses\": [\n {\n \"kind\": \"render_hint\",\n \"name\": \"SELECTABLE\",\n },\n {\n \"kind\": \"render_hint\",\n \"name\": \"SORTABLE\",\n },\n ],\n \"valueType\": undefined,\n },\n },\n },\n }\n `);\n expect(dumpOntologyFullMetadata().importedTypes).toMatchInlineSnapshot(`\n {\n \"sharedPropertyTypes\": [\n {\n \"apiName\": \"bar\",\n \"packageName\": \"com.palantir.bar\",\n },\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 it(\"sets interface status as experimental from opts as typed\", () => {\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 it(\"sets interface status as deprecated from opts as typed\", () => {\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(deprecat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AEO,OAAO,EAAE;MAAM,CAAC,CAAC;MAClDV,MAAM,CAACkB,MAAM,CAACC,eAAe,CAACE,WAAW,CAAC,CAACD,IAAI,CAAC,KAAK,CAAC;IAC1D,CAAC,CAAC;IACFrB,QAAQ,CAAC,WAAW,EAAE,MAAM;MACxBE,EAAE,CAAC,mBAAmB,EAAE,MAAM;QAC1BE,eAAe,CAAC;UACZO,OAAO,EAAE,KAAK;UACdY,UAAU,EAAE;YACRC,GAAG,EAAE;UACT;QACJ,CAAC,CAAC;QACFvB,MAAM,CAACM,wBAAwB,CAAC,CAAC,CAACkB,SAAS,CAAC,CAACP,qBAAqB,CAAC;AACnF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,CAAC;MACE,CAAC,CAAC;MACFhB,EAAE,CAAC,gCAAgC,EAAE,MAAM;QACvCO,wBAAwB,CAAC;UACrBE,OAAO,EAAE,KAAK;UACdE,IAAI,EAAE;QACV,CAAC,CAAC;QACFZ,MAAM,CAACM,wBAAwB,CAAC,CAAC,CAACkB,SAAS,CAAC,CAACP,qBAAqB,CAAC;AACnF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,CAAC;QACMjB,MAAM,CAAC,MAAM;UACTG,eAAe,CAAC;YACZO,OAAO,EAAE,KAAK;YACdY,UAAU,EAAE;cACRC,GAAG,EAAE;YACT;UACJ,CAAC,CAAC;QACN,CAAC,CAAC,CAACP,kCAAkC,CAAC,iFAAiF,CAAC;MAC5H,CAAC,CAAC;IACN,CAAC,CAAC;IACFf,EAAE,CAAC,uDAAuD,EAAE,MAAM;MAC9D,MAAMwB,eAAe,GAAGtB,eAAe,CAAC;QACpCO,OAAO,EAAE,iBAAiB;QAC1BY,UAAU,EAAE;UACRI,SAAS,EAAE;QACf;MACJ,CAAC,CAAC;MACqBvB,eAAe,CAAC;QACnCO,OAAO,EAAE,gBAAgB;QACzBY,UAAU,EAAE;UACRK,SAAS,EAAE;QACf,CAAC;QACDC,OAAO,EAAE,CAACH,eAAe;MAC7B,CAAC,CAAC;MACFzB,MAAM,CAACM,wBAAwB,CAAC,CAAC,CAACkB,SAAS,CAAC,CAACP,qBAAqB,CAAC;AAC/E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,CAAC;IACA,CAAC,CAAC;IACFhB,EAAE,CAAC,iDAAiD,EAAE,MAAM;MAChCE,eAAe,CAAC;QACpCO,OAAO,EAAE,iBAAiB;QAC1BY,UAAU,EAAE;UACRI,SAAS,EAAE;QACf;MACJ,CAAC,CAAC;MACqBvB,eAAe,CAAC;QACnCO,OAAO,EAAE,gBAAgB;QACzBY,UAAU,EAAE;UACRK,SAAS,EAAE;QACf,CAAC;QACDC,OAAO,EAAE,CAAC,iBAAiB;MAC/B,CAAC,CAAC;MACF5B,MAAM,CAACM,wBAAwB,CAAC,CAAC,CAACkB,SAAS,CAAC,CAACP,qBAAqB,CAAC;AAC/E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,CAAC;IACA,CAAC,CAAC;EACN,CAAC,CAAC;EACFlB,QAAQ,CAAC,MAAM,EAAE,MAAM;IACnB,IAAI8B,CAAC;IACL,IAAIC,CAAC;IACLhC,UAAU,CAAC,MAAM;MACb+B,CAAC,GAAG1B,eAAe,CAAC;QAAEO,OAAO,EAAE;MAAI,CAAC,CAAC;MACrCoB,CAAC,GAAG3B,eAAe,CAAC;QAAEO,OAAO,EAAE;MAAI,CAAC,CAAC;IACzC,CAAC,CAAC;IACFT,EAAE,CAAC,mBAAmB,EAAE,MAAM;MAC1BD,MAAM,CAAC6B,CAAC,CAAC,CAACE,GAAG,CAACC,aAAa,CAAC,CAAC;MAC7B5B,6BAA6B,CAAC;QAC1B6B,IAAI,EAAEJ,CAAC;QACPK,KAAK,EAAEJ,CAAC;QACRpB,OAAO,EAAE;MACb,CAAC,CAAC;MACFV,MAAM,CAACM,wBAAwB,CAAC,CAAC,CAACkB,SAAS,CAAC,CAACP,qBAAqB,CAAC;AAC/E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,CAAC;IACA,CAAC,CAAC;IACFhB,EAAE,CAAC,iBAAiB,EAAE,MAAM;MACxBG,6BAA6B,CAAC;QAC1B6B,IAAI,EAAEJ,CAAC;QACPM,MAAM,EAAEL,CAAC;QACTpB,OAAO,EAAE;MACb,CAAC,CAAC;MACFV,MAAM,CAACM,wBAAwB,CAAC,CAAC,CAACkB,SAAS,CAAC,CAACP,qBAAqB,CAAC;AAC/E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,CAAC;IACA,CAAC,CAAC;EACN,CAAC,CAAC;EACFlB,QAAQ,CAAC,MAAM,EAAE,MAAM;IACnBE,EAAE,CAAC,2CAA2C,EAAE,MAAM;MAClDO,wBAAwB,CAAC;QACrBE,OAAO,EAAE,KAAK;QACdE,IAAI,EAAE;MACV,CAAC,CAAC;MACFZ,MAAM,CAAC,MAAM;QACTQ,wBAAwB,CAAC;UACrBE,OAAO,EAAE,KAAK;UACdE,IAAI,EAAE;QACV,CAAC,CAAC;MACN,CAAC,CAAC,CAACI,kCAAkC,CAAC,iFAAiF,CAAC;IAC5H,CAAC,CAAC;EACN,CAAC,CAAC;EACFf,EAAE,CAAC,uBAAuB,EAAE,MAAM;IAC9B,MAAMmC,MAAM,GAAG5B,wBAAwB,CAAC;MACpCE,OAAO,EAAE,QAAQ;MACjBE,IAAI,EAAE;IACV,CAAC,CAAC;IACmBT,eAAe,CAAC;MACjCO,OAAO,EAAE,cAAc;MACvBC,WAAW,EAAE,eAAe;MAC5BW,UAAU,EAAE;QACRc;MACJ,CAAC;MACDC,IAAI,EAAE;QAAEC,KAAK,EAAE,QAAQ;QAAEC,OAAO,EAAE;MAAW;IACjD,CAAC,CAAC;IACFvC,MAAM,CAACM,wBAAwB,CAAC,CAAC,CAACkB,SAAS,CAAC,CAACP,qBAAqB,CAAC;AAC3E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK,CAAC;EACF,CAAC,CAAC;EACFhB,EAAE,CAAC,+CAA+C,EAAE,MAAM;IACvCO,wBAAwB,CAAC;MACpCE,OAAO,EAAE,QAAQ;MACjBE,IAAI,EAAE;QACFA,IAAI,EAAE,QAAQ;QACd4B,gBAAgB,EAAE;UACd,gBAAgB,EAAE,SAAS;UAC3B,iBAAiB,EAAE;YACfC,SAAS,EAAE,MAAM;YACjBtB,eAAe,EAAE;cACbR,WAAW,EAAE,kBAAkB;cAC/BU,WAAW,EAAEqB;YACjB;UACJ;QACJ;MACJ;IACJ,CAAC,CAAC;IACF1C,MAAM,CAACM,wBAAwB,CAAC,CAAC,CAACkB,SAAS,CAAC,CAACP,qBAAqB,CAAC;AAC3E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,CAAC;EACJ,CAAC,CAAC;EACFhB,EAAE,CAAC,qDAAqD,EAAE,MAAM;IAC5D,MAAM0C,UAAU,GAAGnC,wBAAwB,CAAC;MACxCE,OAAO,EAAE,KAAK;MACdE,IAAI,EAAE;QAAEA,IAAI,EAAE,SAAS;QAAEgC,WAAW,EAAE;MAAO;IACjD,CAAC,CAAC;IACF,MAAMC,WAAW,GAAG3C,wBAAwB,CAAC;MACzCQ,OAAO,EAAE,KAAK;MACdoC,QAAQ,EAAE,QAAQ;MAClBC,WAAW,EAAE;IACjB,CAAC,CAAC;IACF5C,eAAe,CAAC;MACZO,OAAO,EAAE,WAAW;MACpBY,UAAU,EAAE;QAAEC,GAAG,EAAEoB,UAAU;QAAEK,GAAG,EAAEH;MAAY;IACpD,CAAC,CAAC;IACF7C,MAAM,CAACM,wBAAwB,CAAC,CAAC,CAACkB,SAAS,CAAC,CAACP,qBAAqB,CAAC;AAC3E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;IACAjB,MAAM,CAACM,wBAAwB,CAAC,CAAC,CAAC2C,aAAa,CAAC,CAAChC,qBAAqB,CAAC;AAC/E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK,CAAC;EACF,CAAC,CAAC;EACFhB,EAAE,CAAC,qCAAqC,EAAE,MAAM;IAC5C,MAAMiB,MAAM,GAAGf,eAAe,CAAC;MAAEO,OAAO,EAAE;IAAM,CAAC,CAAC;IAClDV,MAAM,CAACkB,MAAM,CAACgC,MAAM,CAAC,CAACC,OAAO,CAAC;MAAEvC,IAAI,EAAE,QAAQ;MAAEwC,MAAM,EAAE,CAAC;IAAE,CAAC,CAAC;EACjE,CAAC,CAAC;EACFnD,EAAE,CAAC,0DAA0D,EAAE,MAAM;IAKjE,MAAMiB,MAAM,GAAGf,eAAe,CAAC;MAC3BO,OAAO,EAAE,KAAK;MACdwC,MAAM,EAAE;QAAEtC,IAAI,EAAE;MAAe;IACnC,CAAC,CAAC;IACFZ,MAAM,CAACkB,MAAM,CAACgC,MAAM,CAAC,CAACC,OAAO,CARF;MACvBvC,IAAI,EAAE,cAAc;MACpByC,YAAY,EAAE,CAAC;IACnB,CAKgD,CAAC;EACrD,CAAC,CAAC;EACFpD,EAAE,CAAC,wDAAwD,EAAE,MAAM;IAQ/D,MAAMiB,MAAM,GAAGf,eAAe,CAAC;MAC3BO,OAAO,EAAE,KAAK;MACdwC,MAAM,EAAE;QAAEtC,IAAI,EAAE,YAAY;QAAE0C,OAAO,EAAE,KAAK;QAAEC,QAAQ,EAAE;MAAM;IAClE,CAAC,CAAC;IACFvD,MAAM,CAACkB,MAAM,CAACgC,MAAM,CAAC,CAACC,OAAO,CAXJ;MACrBvC,IAAI,EAAE,YAAY;MAClB4C,UAAU,EAAE;QACRF,OAAO,EAAE,KAAK;QACdC,QAAQ,EAAE;MACd;IACJ,CAK8C,CAAC;EACnD,CAAC,CAAC;AACN,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"overall.test.js","names":["beforeEach","describe","expect","it","importSharedPropertyType","defineInterface","defineInterfaceLinkConstraint","defineOntology","dumpOntologyFullMetadata","dumpValueTypeWireType","defineSharedPropertyType","defineValueType","apiName","displayName","type","constraints","constraint","version","toThrowErrorMatchingInlineSnapshot","toMatchInlineSnapshot","result","displayMetadata","toBe","description","properties","foo","blockData","parentInterface","property1","property2","extends","a","b","not","toBeUndefined","from","toOne","toMany","fooSpt","icon","color","locator","structDefinition","fieldType","undefined","regularSpt","markingType","importedSpt","typeHint","packageName","bar","importedTypes","status","toEqual","active","experimental","message","deadline","deprecated"],"sources":["overall.test.js"],"sourcesContent":["/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { beforeEach, describe, expect, it } from \"vitest\";\nimport { importSharedPropertyType } from \"./defineImportSpt.js\";\nimport { defineInterface } from \"./defineInterface.js\";\nimport { defineInterfaceLinkConstraint } from \"./defineInterfaceLinkConstraint.js\";\nimport { defineOntology, dumpOntologyFullMetadata, dumpValueTypeWireType, } from \"./defineOntology.js\";\nimport { defineSharedPropertyType } from \"./defineSpt.js\";\nimport { defineValueType } from \"./defineValueType.js\";\ndescribe(\"Ontology Defining\", () => {\n beforeEach(async () => {\n await defineOntology(\"com.palantir.\", () => { });\n });\n describe(\"ValueTypes\", () => {\n it(\"Fails to define value type with incorrect semver\", () => {\n expect(() => defineValueType({\n apiName: \"apiName\",\n displayName: \"displayName\",\n type: {\n \"type\": \"boolean\",\n constraints: [{ constraint: { \"allowedValues\": [\"TRUE_VALUE\"] } }],\n },\n version: \"not a version\",\n })).toThrowErrorMatchingInlineSnapshot(\"[Error: Invariant failed: Version is not a valid semver]\");\n });\n it(\"Correctly serializes a value type\", async () => {\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 \"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.B Not sure what this is for but I don't want to break anything so I added the eslint ignore\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n defineOntology(\"com.palantir.\", () => { });\n });\n describe(\"Interfaces\", () => {\n it(\"doesn't let you define the same interface twice\", () => {\n defineInterface({ apiName: \"Foo\" });\n expect(() => {\n defineInterface({ apiName: \"Foo\" });\n }).toThrowErrorMatchingInlineSnapshot(`[Error: Invariant failed: Interface com.palantir.Foo already exists]`);\n });\n it(\"defaults displayName to apiName\", () => {\n const result = defineInterface({ apiName: \"Foo\" });\n expect(result.displayMetadata.displayName).toBe(\"Foo\");\n });\n it(\"defaults description to displayName\", () => {\n const result = defineInterface({ apiName: \"Foo\", displayName: \"d\" });\n expect(result.displayMetadata.description).toBe(\"d\");\n });\n it(\"defaults description to displayName to apiName\", () => {\n const result = defineInterface({ apiName: \"Foo\" });\n expect(result.displayMetadata.description).toBe(\"Foo\");\n });\n describe(\"auto spts\", () => {\n it(\"auto creates spts\", () => {\n defineInterface({\n apiName: \"Foo\",\n properties: {\n foo: \"string\",\n },\n });\n expect(dumpOntologyFullMetadata().blockData).toMatchInlineSnapshot(`\n {\n \"blockPermissionInformation\": {\n \"actionTypes\": {},\n \"linkTypes\": {},\n \"objectTypes\": {},\n },\n \"interfaceTypes\": {\n \"com.palantir.Foo\": {\n \"interfaceType\": {\n \"allExtendsInterfaces\": [],\n \"allLinks\": [],\n \"allProperties\": [],\n \"apiName\": \"com.palantir.Foo\",\n \"displayMetadata\": {\n \"description\": \"Foo\",\n \"displayName\": \"Foo\",\n \"icon\": undefined,\n },\n \"extendsInterfaces\": [],\n \"links\": [],\n \"properties\": [\n {\n \"aliases\": [],\n \"apiName\": \"com.palantir.foo\",\n \"baseFormatter\": undefined,\n \"dataConstraints\": undefined,\n \"displayMetadata\": {\n \"description\": undefined,\n \"displayName\": \"foo\",\n \"visibility\": \"NORMAL\",\n },\n \"gothamMapping\": undefined,\n \"indexedForSearch\": true,\n \"provenance\": undefined,\n \"type\": {\n \"string\": {\n \"analyzerOverride\": undefined,\n \"enableAsciiFolding\": undefined,\n \"isLongText\": false,\n \"supportsExactMatching\": true,\n },\n \"type\": \"string\",\n },\n \"typeClasses\": [\n {\n \"kind\": \"render_hint\",\n \"name\": \"SELECTABLE\",\n },\n {\n \"kind\": \"render_hint\",\n \"name\": \"SORTABLE\",\n },\n ],\n \"valueType\": undefined,\n },\n ],\n \"status\": {\n \"active\": {},\n \"type\": \"active\",\n },\n },\n },\n },\n \"sharedPropertyTypes\": {\n \"com.palantir.foo\": {\n \"sharedPropertyType\": {\n \"aliases\": [],\n \"apiName\": \"com.palantir.foo\",\n \"baseFormatter\": undefined,\n \"dataConstraints\": undefined,\n \"displayMetadata\": {\n \"description\": undefined,\n \"displayName\": \"foo\",\n \"visibility\": \"NORMAL\",\n },\n \"gothamMapping\": undefined,\n \"indexedForSearch\": true,\n \"provenance\": undefined,\n \"type\": {\n \"string\": {\n \"analyzerOverride\": undefined,\n \"enableAsciiFolding\": undefined,\n \"isLongText\": false,\n \"supportsExactMatching\": true,\n },\n \"type\": \"string\",\n },\n \"typeClasses\": [\n {\n \"kind\": \"render_hint\",\n \"name\": \"SELECTABLE\",\n },\n {\n \"kind\": \"render_hint\",\n \"name\": \"SORTABLE\",\n },\n ],\n \"valueType\": undefined,\n },\n },\n },\n }\n `);\n });\n it(\"does not let you conflict spts\", () => {\n defineSharedPropertyType({\n apiName: \"foo\",\n type: \"string\",\n });\n expect(dumpOntologyFullMetadata().blockData).toMatchInlineSnapshot(`\n {\n \"blockPermissionInformation\": {\n \"actionTypes\": {},\n \"linkTypes\": {},\n \"objectTypes\": {},\n },\n \"interfaceTypes\": {},\n \"sharedPropertyTypes\": {\n \"com.palantir.foo\": {\n \"sharedPropertyType\": {\n \"aliases\": [],\n \"apiName\": \"com.palantir.foo\",\n \"baseFormatter\": undefined,\n \"dataConstraints\": undefined,\n \"displayMetadata\": {\n \"description\": undefined,\n \"displayName\": \"foo\",\n \"visibility\": \"NORMAL\",\n },\n \"gothamMapping\": undefined,\n \"indexedForSearch\": true,\n \"provenance\": undefined,\n \"type\": {\n \"string\": {\n \"analyzerOverride\": undefined,\n \"enableAsciiFolding\": undefined,\n \"isLongText\": false,\n \"supportsExactMatching\": true,\n },\n \"type\": \"string\",\n },\n \"typeClasses\": [\n {\n \"kind\": \"render_hint\",\n \"name\": \"SELECTABLE\",\n },\n {\n \"kind\": \"render_hint\",\n \"name\": \"SORTABLE\",\n },\n ],\n \"valueType\": undefined,\n },\n },\n },\n }\n `);\n expect(() => {\n defineInterface({\n apiName: \"Foo\",\n properties: {\n foo: \"string\",\n },\n });\n }).toThrowErrorMatchingInlineSnapshot(`[Error: Invariant failed: Shared property type com.palantir.foo already exists]`);\n });\n });\n it(\"allows extends interfaces with InterfaceType provided\", () => {\n const parentInterface = defineInterface({\n apiName: \"parentInterface\",\n properties: {\n property1: \"string\",\n },\n });\n const childInterface = defineInterface({\n apiName: \"childInterface\",\n properties: {\n property2: \"string\",\n },\n extends: [parentInterface],\n });\n expect(dumpOntologyFullMetadata().blockData).toMatchInlineSnapshot(`\n {\n \"blockPermissionInformation\": {\n \"actionTypes\": {},\n \"linkTypes\": {},\n \"objectTypes\": {},\n },\n \"interfaceTypes\": {\n \"com.palantir.childInterface\": {\n \"interfaceType\": {\n \"allExtendsInterfaces\": [],\n \"allLinks\": [],\n \"allProperties\": [],\n \"apiName\": \"com.palantir.childInterface\",\n \"displayMetadata\": {\n \"description\": \"childInterface\",\n \"displayName\": \"childInterface\",\n \"icon\": undefined,\n },\n \"extendsInterfaces\": [\n \"com.palantir.parentInterface\",\n ],\n \"links\": [],\n \"properties\": [\n {\n \"aliases\": [],\n \"apiName\": \"com.palantir.property2\",\n \"baseFormatter\": undefined,\n \"dataConstraints\": undefined,\n \"displayMetadata\": {\n \"description\": undefined,\n \"displayName\": \"property2\",\n \"visibility\": \"NORMAL\",\n },\n \"gothamMapping\": undefined,\n \"indexedForSearch\": true,\n \"provenance\": undefined,\n \"type\": {\n \"string\": {\n \"analyzerOverride\": undefined,\n \"enableAsciiFolding\": undefined,\n \"isLongText\": false,\n \"supportsExactMatching\": true,\n },\n \"type\": \"string\",\n },\n \"typeClasses\": [\n {\n \"kind\": \"render_hint\",\n \"name\": \"SELECTABLE\",\n },\n {\n \"kind\": \"render_hint\",\n \"name\": \"SORTABLE\",\n },\n ],\n \"valueType\": undefined,\n },\n ],\n \"status\": {\n \"active\": {},\n \"type\": \"active\",\n },\n },\n },\n \"com.palantir.parentInterface\": {\n \"interfaceType\": {\n \"allExtendsInterfaces\": [],\n \"allLinks\": [],\n \"allProperties\": [],\n \"apiName\": \"com.palantir.parentInterface\",\n \"displayMetadata\": {\n \"description\": \"parentInterface\",\n \"displayName\": \"parentInterface\",\n \"icon\": undefined,\n },\n \"extendsInterfaces\": [],\n \"links\": [],\n \"properties\": [\n {\n \"aliases\": [],\n \"apiName\": \"com.palantir.property1\",\n \"baseFormatter\": undefined,\n \"dataConstraints\": undefined,\n \"displayMetadata\": {\n \"description\": undefined,\n \"displayName\": \"property1\",\n \"visibility\": \"NORMAL\",\n },\n \"gothamMapping\": undefined,\n \"indexedForSearch\": true,\n \"provenance\": undefined,\n \"type\": {\n \"string\": {\n \"analyzerOverride\": undefined,\n \"enableAsciiFolding\": undefined,\n \"isLongText\": false,\n \"supportsExactMatching\": true,\n },\n \"type\": \"string\",\n },\n \"typeClasses\": [\n {\n \"kind\": \"render_hint\",\n \"name\": \"SELECTABLE\",\n },\n {\n \"kind\": \"render_hint\",\n \"name\": \"SORTABLE\",\n },\n ],\n \"valueType\": undefined,\n },\n ],\n \"status\": {\n \"active\": {},\n \"type\": \"active\",\n },\n },\n },\n },\n \"sharedPropertyTypes\": {\n \"com.palantir.property1\": {\n \"sharedPropertyType\": {\n \"aliases\": [],\n \"apiName\": \"com.palantir.property1\",\n \"baseFormatter\": undefined,\n \"dataConstraints\": undefined,\n \"displayMetadata\": {\n \"description\": undefined,\n \"displayName\": \"property1\",\n \"visibility\": \"NORMAL\",\n },\n \"gothamMapping\": undefined,\n \"indexedForSearch\": true,\n \"provenance\": undefined,\n \"type\": {\n \"string\": {\n \"analyzerOverride\": undefined,\n \"enableAsciiFolding\": undefined,\n \"isLongText\": false,\n \"supportsExactMatching\": true,\n },\n \"type\": \"string\",\n },\n \"typeClasses\": [\n {\n \"kind\": \"render_hint\",\n \"name\": \"SELECTABLE\",\n },\n {\n \"kind\": \"render_hint\",\n \"name\": \"SORTABLE\",\n },\n ],\n \"valueType\": undefined,\n },\n },\n \"com.palantir.property2\": {\n \"sharedPropertyType\": {\n \"aliases\": [],\n \"apiName\": \"com.palantir.property2\",\n \"baseFormatter\": undefined,\n \"dataConstraints\": undefined,\n \"displayMetadata\": {\n \"description\": undefined,\n \"displayName\": \"property2\",\n \"visibility\": \"NORMAL\",\n },\n \"gothamMapping\": undefined,\n \"indexedForSearch\": true,\n \"provenance\": undefined,\n \"type\": {\n \"string\": {\n \"analyzerOverride\": undefined,\n \"enableAsciiFolding\": undefined,\n \"isLongText\": false,\n \"supportsExactMatching\": true,\n },\n \"type\": \"string\",\n },\n \"typeClasses\": [\n {\n \"kind\": \"render_hint\",\n \"name\": \"SELECTABLE\",\n },\n {\n \"kind\": \"render_hint\",\n \"name\": \"SORTABLE\",\n },\n ],\n \"valueType\": undefined,\n },\n },\n },\n }\n `);\n });\n it(\"allows extends interfaces with apiName provided\", () => {\n const parentInterface = defineInterface({\n apiName: \"parentInterface\",\n properties: {\n property1: \"string\",\n },\n });\n const childInterface = defineInterface({\n apiName: \"childInterface\",\n properties: {\n property2: \"string\",\n },\n extends: [\"parentInterface\"],\n });\n expect(dumpOntologyFullMetadata().blockData).toMatchInlineSnapshot(`\n {\n \"blockPermissionInformation\": {\n \"actionTypes\": {},\n \"linkTypes\": {},\n \"objectTypes\": {},\n },\n \"interfaceTypes\": {\n \"com.palantir.childInterface\": {\n \"interfaceType\": {\n \"allExtendsInterfaces\": [],\n \"allLinks\": [],\n \"allProperties\": [],\n \"apiName\": \"com.palantir.childInterface\",\n \"displayMetadata\": {\n \"description\": \"childInterface\",\n \"displayName\": \"childInterface\",\n \"icon\": undefined,\n },\n \"extendsInterfaces\": [\n \"parentInterface\",\n ],\n \"links\": [],\n \"properties\": [\n {\n \"aliases\": [],\n \"apiName\": \"com.palantir.property2\",\n \"baseFormatter\": undefined,\n \"dataConstraints\": undefined,\n \"displayMetadata\": {\n \"description\": undefined,\n \"displayName\": \"property2\",\n \"visibility\": \"NORMAL\",\n },\n \"gothamMapping\": undefined,\n \"indexedForSearch\": true,\n \"provenance\": undefined,\n \"type\": {\n \"string\": {\n \"analyzerOverride\": undefined,\n \"enableAsciiFolding\": undefined,\n \"isLongText\": false,\n \"supportsExactMatching\": true,\n },\n \"type\": \"string\",\n },\n \"typeClasses\": [\n {\n \"kind\": \"render_hint\",\n \"name\": \"SELECTABLE\",\n },\n {\n \"kind\": \"render_hint\",\n \"name\": \"SORTABLE\",\n },\n ],\n \"valueType\": undefined,\n },\n ],\n \"status\": {\n \"active\": {},\n \"type\": \"active\",\n },\n },\n },\n \"com.palantir.parentInterface\": {\n \"interfaceType\": {\n \"allExtendsInterfaces\": [],\n \"allLinks\": [],\n \"allProperties\": [],\n \"apiName\": \"com.palantir.parentInterface\",\n \"displayMetadata\": {\n \"description\": \"parentInterface\",\n \"displayName\": \"parentInterface\",\n \"icon\": undefined,\n },\n \"extendsInterfaces\": [],\n \"links\": [],\n \"properties\": [\n {\n \"aliases\": [],\n \"apiName\": \"com.palantir.property1\",\n \"baseFormatter\": undefined,\n \"dataConstraints\": undefined,\n \"displayMetadata\": {\n \"description\": undefined,\n \"displayName\": \"property1\",\n \"visibility\": \"NORMAL\",\n },\n \"gothamMapping\": undefined,\n \"indexedForSearch\": true,\n \"provenance\": undefined,\n \"type\": {\n \"string\": {\n \"analyzerOverride\": undefined,\n \"enableAsciiFolding\": undefined,\n \"isLongText\": false,\n \"supportsExactMatching\": true,\n },\n \"type\": \"string\",\n },\n \"typeClasses\": [\n {\n \"kind\": \"render_hint\",\n \"name\": \"SELECTABLE\",\n },\n {\n \"kind\": \"render_hint\",\n \"name\": \"SORTABLE\",\n },\n ],\n \"valueType\": undefined,\n },\n ],\n \"status\": {\n \"active\": {},\n \"type\": \"active\",\n },\n },\n },\n },\n \"sharedPropertyTypes\": {\n \"com.palantir.property1\": {\n \"sharedPropertyType\": {\n \"aliases\": [],\n \"apiName\": \"com.palantir.property1\",\n \"baseFormatter\": undefined,\n \"dataConstraints\": undefined,\n \"displayMetadata\": {\n \"description\": undefined,\n \"displayName\": \"property1\",\n \"visibility\": \"NORMAL\",\n },\n \"gothamMapping\": undefined,\n \"indexedForSearch\": true,\n \"provenance\": undefined,\n \"type\": {\n \"string\": {\n \"analyzerOverride\": undefined,\n \"enableAsciiFolding\": undefined,\n \"isLongText\": false,\n \"supportsExactMatching\": true,\n },\n \"type\": \"string\",\n },\n \"typeClasses\": [\n {\n \"kind\": \"render_hint\",\n \"name\": \"SELECTABLE\",\n },\n {\n \"kind\": \"render_hint\",\n \"name\": \"SORTABLE\",\n },\n ],\n \"valueType\": undefined,\n },\n },\n \"com.palantir.property2\": {\n \"sharedPropertyType\": {\n \"aliases\": [],\n \"apiName\": \"com.palantir.property2\",\n \"baseFormatter\": undefined,\n \"dataConstraints\": undefined,\n \"displayMetadata\": {\n \"description\": undefined,\n \"displayName\": \"property2\",\n \"visibility\": \"NORMAL\",\n },\n \"gothamMapping\": undefined,\n \"indexedForSearch\": true,\n \"provenance\": undefined,\n \"type\": {\n \"string\": {\n \"analyzerOverride\": undefined,\n \"enableAsciiFolding\": undefined,\n \"isLongText\": false,\n \"supportsExactMatching\": true,\n },\n \"type\": \"string\",\n },\n \"typeClasses\": [\n {\n \"kind\": \"render_hint\",\n \"name\": \"SELECTABLE\",\n },\n {\n \"kind\": \"render_hint\",\n \"name\": \"SORTABLE\",\n },\n ],\n \"valueType\": undefined,\n },\n },\n },\n }\n `);\n });\n });\n describe(\"ILTs\", () => {\n let a;\n let b;\n beforeEach(() => {\n a = defineInterface({ apiName: \"A\" });\n b = defineInterface({ apiName: \"B\" });\n });\n it(\"single link works\", () => {\n expect(a).not.toBeUndefined();\n defineInterfaceLinkConstraint({\n from: a,\n toOne: b,\n apiName: \"singleLink\",\n });\n expect(dumpOntologyFullMetadata().blockData).toMatchInlineSnapshot(`\n {\n \"blockPermissionInformation\": {\n \"actionTypes\": {},\n \"linkTypes\": {},\n \"objectTypes\": {},\n },\n \"interfaceTypes\": {\n \"com.palantir.A\": {\n \"interfaceType\": {\n \"allExtendsInterfaces\": [],\n \"allLinks\": [],\n \"allProperties\": [],\n \"apiName\": \"com.palantir.A\",\n \"displayMetadata\": {\n \"description\": \"A\",\n \"displayName\": \"A\",\n \"icon\": undefined,\n },\n \"extendsInterfaces\": [],\n \"links\": [\n {\n \"cardinality\": \"SINGLE\",\n \"linkedEntityTypeId\": {\n \"interfaceType\": \"com.palantir.B\",\n \"type\": \"interfaceType\",\n },\n \"metadata\": {\n \"apiName\": \"com.palantir.singleLink\",\n \"description\": \"singleLink\",\n \"displayName\": \"singleLink\",\n },\n \"required\": true,\n },\n ],\n \"properties\": [],\n \"status\": {\n \"active\": {},\n \"type\": \"active\",\n },\n },\n },\n \"com.palantir.B\": {\n \"interfaceType\": {\n \"allExtendsInterfaces\": [],\n \"allLinks\": [],\n \"allProperties\": [],\n \"apiName\": \"com.palantir.B\",\n \"displayMetadata\": {\n \"description\": \"B\",\n \"displayName\": \"B\",\n \"icon\": undefined,\n },\n \"extendsInterfaces\": [],\n \"links\": [],\n \"properties\": [],\n \"status\": {\n \"active\": {},\n \"type\": \"active\",\n },\n },\n },\n },\n \"sharedPropertyTypes\": {},\n }\n `);\n });\n it(\"many link works\", () => {\n defineInterfaceLinkConstraint({\n from: a,\n toMany: b,\n apiName: \"manyLink\",\n });\n expect(dumpOntologyFullMetadata().blockData).toMatchInlineSnapshot(`\n {\n \"blockPermissionInformation\": {\n \"actionTypes\": {},\n \"linkTypes\": {},\n \"objectTypes\": {},\n },\n \"interfaceTypes\": {\n \"com.palantir.A\": {\n \"interfaceType\": {\n \"allExtendsInterfaces\": [],\n \"allLinks\": [],\n \"allProperties\": [],\n \"apiName\": \"com.palantir.A\",\n \"displayMetadata\": {\n \"description\": \"A\",\n \"displayName\": \"A\",\n \"icon\": undefined,\n },\n \"extendsInterfaces\": [],\n \"links\": [\n {\n \"cardinality\": \"MANY\",\n \"linkedEntityTypeId\": {\n \"interfaceType\": \"com.palantir.B\",\n \"type\": \"interfaceType\",\n },\n \"metadata\": {\n \"apiName\": \"com.palantir.manyLink\",\n \"description\": \"manyLink\",\n \"displayName\": \"manyLink\",\n },\n \"required\": true,\n },\n ],\n \"properties\": [],\n \"status\": {\n \"active\": {},\n \"type\": \"active\",\n },\n },\n },\n \"com.palantir.B\": {\n \"interfaceType\": {\n \"allExtendsInterfaces\": [],\n \"allLinks\": [],\n \"allProperties\": [],\n \"apiName\": \"com.palantir.B\",\n \"displayMetadata\": {\n \"description\": \"B\",\n \"displayName\": \"B\",\n \"icon\": undefined,\n },\n \"extendsInterfaces\": [],\n \"links\": [],\n \"properties\": [],\n \"status\": {\n \"active\": {},\n \"type\": \"active\",\n },\n },\n },\n },\n \"sharedPropertyTypes\": {},\n }\n `);\n });\n });\n describe(\"SPTs\", () => {\n it(\"doesn't let you create the same spt twice\", () => {\n defineSharedPropertyType({\n apiName: \"foo\",\n type: \"string\",\n });\n expect(() => {\n defineSharedPropertyType({\n apiName: \"foo\",\n type: \"string\",\n });\n }).toThrowErrorMatchingInlineSnapshot(`[Error: Invariant failed: Shared property type com.palantir.foo already exists]`);\n });\n });\n it(\"uses a predefined spt\", () => {\n const fooSpt = defineSharedPropertyType({\n apiName: \"fooSpt\",\n type: \"string\",\n });\n const FooInterface = defineInterface({\n apiName: \"FooInterface\",\n displayName: \"Foo Interface\",\n properties: {\n fooSpt,\n },\n icon: { color: \"#00000\", locator: \"airplane\" },\n });\n expect(dumpOntologyFullMetadata().blockData).toMatchInlineSnapshot(`\n {\n \"blockPermissionInformation\": {\n \"actionTypes\": {},\n \"linkTypes\": {},\n \"objectTypes\": {},\n },\n \"interfaceTypes\": {\n \"com.palantir.FooInterface\": {\n \"interfaceType\": {\n \"allExtendsInterfaces\": [],\n \"allLinks\": [],\n \"allProperties\": [],\n \"apiName\": \"com.palantir.FooInterface\",\n \"displayMetadata\": {\n \"description\": \"Foo Interface\",\n \"displayName\": \"Foo Interface\",\n \"icon\": {\n \"blueprint\": {\n \"color\": \"#00000\",\n \"locator\": \"airplane\",\n },\n \"type\": \"blueprint\",\n },\n },\n \"extendsInterfaces\": [],\n \"links\": [],\n \"properties\": [\n {\n \"aliases\": [],\n \"apiName\": \"com.palantir.fooSpt\",\n \"baseFormatter\": undefined,\n \"dataConstraints\": undefined,\n \"displayMetadata\": {\n \"description\": undefined,\n \"displayName\": \"fooSpt\",\n \"visibility\": \"NORMAL\",\n },\n \"gothamMapping\": undefined,\n \"indexedForSearch\": true,\n \"provenance\": undefined,\n \"type\": {\n \"string\": {\n \"analyzerOverride\": undefined,\n \"enableAsciiFolding\": undefined,\n \"isLongText\": false,\n \"supportsExactMatching\": true,\n },\n \"type\": \"string\",\n },\n \"typeClasses\": [\n {\n \"kind\": \"render_hint\",\n \"name\": \"SELECTABLE\",\n },\n {\n \"kind\": \"render_hint\",\n \"name\": \"SORTABLE\",\n },\n ],\n \"valueType\": undefined,\n },\n ],\n \"status\": {\n \"active\": {},\n \"type\": \"active\",\n },\n },\n },\n },\n \"sharedPropertyTypes\": {\n \"com.palantir.fooSpt\": {\n \"sharedPropertyType\": {\n \"aliases\": [],\n \"apiName\": \"com.palantir.fooSpt\",\n \"baseFormatter\": undefined,\n \"dataConstraints\": undefined,\n \"displayMetadata\": {\n \"description\": undefined,\n \"displayName\": \"fooSpt\",\n \"visibility\": \"NORMAL\",\n },\n \"gothamMapping\": undefined,\n \"indexedForSearch\": true,\n \"provenance\": undefined,\n \"type\": {\n \"string\": {\n \"analyzerOverride\": undefined,\n \"enableAsciiFolding\": undefined,\n \"isLongText\": false,\n \"supportsExactMatching\": true,\n },\n \"type\": \"string\",\n },\n \"typeClasses\": [\n {\n \"kind\": \"render_hint\",\n \"name\": \"SELECTABLE\",\n },\n {\n \"kind\": \"render_hint\",\n \"name\": \"SORTABLE\",\n },\n ],\n \"valueType\": undefined,\n },\n },\n },\n }\n `);\n });\n it(\"properly serializes both types of struct SPTs\", () => {\n const fooSpt = defineSharedPropertyType({\n apiName: \"fooSpt\",\n type: {\n type: \"struct\",\n structDefinition: {\n \"simpleProperty\": \"boolean\",\n \"complexProperty\": {\n fieldType: \"date\",\n displayMetadata: {\n displayName: \"complex property\",\n description: undefined,\n },\n },\n },\n },\n });\n expect(dumpOntologyFullMetadata().blockData).toMatchInlineSnapshot(`\n {\n \"blockPermissionInformation\": {\n \"actionTypes\": {},\n \"linkTypes\": {},\n \"objectTypes\": {},\n },\n \"interfaceTypes\": {},\n \"sharedPropertyTypes\": {\n \"com.palantir.fooSpt\": {\n \"sharedPropertyType\": {\n \"aliases\": [],\n \"apiName\": \"com.palantir.fooSpt\",\n \"baseFormatter\": undefined,\n \"dataConstraints\": undefined,\n \"displayMetadata\": {\n \"description\": undefined,\n \"displayName\": \"fooSpt\",\n \"visibility\": \"NORMAL\",\n },\n \"gothamMapping\": undefined,\n \"indexedForSearch\": true,\n \"provenance\": undefined,\n \"type\": {\n \"struct\": {\n \"structFields\": [\n {\n \"aliases\": [],\n \"apiName\": \"simpleProperty\",\n \"displayMetadata\": {\n \"description\": undefined,\n \"displayName\": \"simpleProperty\",\n },\n \"fieldType\": {\n \"boolean\": {},\n \"type\": \"boolean\",\n },\n \"typeClasses\": [],\n },\n {\n \"aliases\": [],\n \"apiName\": \"complexProperty\",\n \"displayMetadata\": {\n \"description\": undefined,\n \"displayName\": \"complex property\",\n },\n \"fieldType\": {\n \"date\": {},\n \"type\": \"date\",\n },\n \"typeClasses\": [],\n },\n ],\n },\n \"type\": \"struct\",\n },\n \"typeClasses\": [\n {\n \"kind\": \"render_hint\",\n \"name\": \"SELECTABLE\",\n },\n {\n \"kind\": \"render_hint\",\n \"name\": \"SORTABLE\",\n },\n ],\n \"valueType\": undefined,\n },\n },\n },\n }\n `);\n });\n it(\"Adds imported SPTs only to the interface definition\", () => {\n const regularSpt = defineSharedPropertyType({\n apiName: \"foo\",\n type: { type: \"marking\", markingType: \"CBAC\" },\n });\n const importedSpt = importSharedPropertyType({\n apiName: \"bar\",\n typeHint: \"string\",\n packageName: \"com.palantir.bar\",\n });\n defineInterface({\n apiName: \"interface\",\n properties: { foo: regularSpt, bar: importedSpt },\n });\n expect(dumpOntologyFullMetadata().blockData).toMatchInlineSnapshot(`\n {\n \"blockPermissionInformation\": {\n \"actionTypes\": {},\n \"linkTypes\": {},\n \"objectTypes\": {},\n },\n \"interfaceTypes\": {\n \"com.palantir.interface\": {\n \"interfaceType\": {\n \"allExtendsInterfaces\": [],\n \"allLinks\": [],\n \"allProperties\": [],\n \"apiName\": \"com.palantir.interface\",\n \"displayMetadata\": {\n \"description\": \"interface\",\n \"displayName\": \"interface\",\n \"icon\": undefined,\n },\n \"extendsInterfaces\": [],\n \"links\": [],\n \"properties\": [\n {\n \"aliases\": [],\n \"apiName\": \"com.palantir.foo\",\n \"baseFormatter\": undefined,\n \"dataConstraints\": {\n \"nullability\": undefined,\n \"nullabilityV2\": {\n \"noEmptyCollections\": true,\n \"noNulls\": true,\n },\n \"propertyTypeConstraints\": [],\n },\n \"displayMetadata\": {\n \"description\": undefined,\n \"displayName\": \"foo\",\n \"visibility\": \"NORMAL\",\n },\n \"gothamMapping\": undefined,\n \"indexedForSearch\": true,\n \"provenance\": undefined,\n \"type\": {\n \"marking\": {\n \"markingType\": \"CBAC\",\n },\n \"type\": \"marking\",\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 \"aliases\": [],\n \"apiName\": \"com.palantir.bar.bar\",\n \"baseFormatter\": undefined,\n \"dataConstraints\": undefined,\n \"displayMetadata\": {\n \"description\": undefined,\n \"displayName\": \"com.palantir.bar.bar\",\n \"visibility\": \"NORMAL\",\n },\n \"gothamMapping\": undefined,\n \"indexedForSearch\": true,\n \"provenance\": undefined,\n \"type\": {\n \"string\": {\n \"analyzerOverride\": undefined,\n \"enableAsciiFolding\": undefined,\n \"isLongText\": false,\n \"supportsExactMatching\": true,\n },\n \"type\": \"string\",\n },\n \"typeClasses\": [],\n \"valueType\": undefined,\n },\n ],\n \"status\": {\n \"active\": {},\n \"type\": \"active\",\n },\n },\n },\n },\n \"sharedPropertyTypes\": {\n \"com.palantir.foo\": {\n \"sharedPropertyType\": {\n \"aliases\": [],\n \"apiName\": \"com.palantir.foo\",\n \"baseFormatter\": undefined,\n \"dataConstraints\": {\n \"nullability\": undefined,\n \"nullabilityV2\": {\n \"noEmptyCollections\": true,\n \"noNulls\": true,\n },\n \"propertyTypeConstraints\": [],\n },\n \"displayMetadata\": {\n \"description\": undefined,\n \"displayName\": \"foo\",\n \"visibility\": \"NORMAL\",\n },\n \"gothamMapping\": undefined,\n \"indexedForSearch\": true,\n \"provenance\": undefined,\n \"type\": {\n \"marking\": {\n \"markingType\": \"CBAC\",\n },\n \"type\": \"marking\",\n },\n \"typeClasses\": [\n {\n \"kind\": \"render_hint\",\n \"name\": \"SELECTABLE\",\n },\n {\n \"kind\": \"render_hint\",\n \"name\": \"SORTABLE\",\n },\n ],\n \"valueType\": undefined,\n },\n },\n },\n }\n `);\n expect(dumpOntologyFullMetadata().importedTypes).toMatchInlineSnapshot(`\n {\n \"sharedPropertyTypes\": [\n {\n \"apiName\": \"bar\",\n \"packageName\": \"com.palantir.bar\",\n },\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 it(\"sets interface status as experimental from opts as typed\", () => {\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 it(\"sets interface status as deprecated from opts as typed\", () => {\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;AACA,SAASA,UAAU,EAAEC,QAAQ,EAAEC,MAAM,EAAEC,EAAE,QAAQ,QAAQ;AACzD,SAASC,wBAAwB,QAAQ,sBAAsB;AAC/D,SAASC,eAAe,QAAQ,sBAAsB;AACtD,SAASC,6BAA6B,QAAQ,oCAAoC;AAClF,SAASC,cAAc,EAAEC,wBAAwB,EAAEC,qBAAqB,QAAS,qBAAqB;AACtG,SAASC,wBAAwB,QAAQ,gBAAgB;AACzD,SAASC,eAAe,QAAQ,sBAAsB;AACtDV,QAAQ,CAAC,mBAAmB,EAAE,MAAM;EAChCD,UAAU,CAAC,YAAY;IACnB,MAAMO,cAAc,CAAC,eAAe,EAAE,MAAM,CAAE,CAAC,CAAC;EACpD,CAAC,CAAC;EACFN,QAAQ,CAAC,YAAY,EAAE,MAAM;IACzBE,EAAE,CAAC,kDAAkD,EAAE,MAAM;MACzDD,MAAM,CAAC,MAAMS,eAAe,CAAC;QACzBC,OAAO,EAAE,SAAS;QAClBC,WAAW,EAAE,aAAa;QAC1BC,IAAI,EAAE;UACF,MAAM,EAAE,SAAS;UACjBC,WAAW,EAAE,CAAC;YAAEC,UAAU,EAAE;cAAE,eAAe,EAAE,CAAC,YAAY;YAAE;UAAE,CAAC;QACrE,CAAC;QACDC,OAAO,EAAE;MACb,CAAC,CAAC,CAAC,CAACC,kCAAkC,CAAC,0DAA0D,CAAC;IACtG,CAAC,CAAC;IACFf,E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MAAM,GAAGf,eAAe,CAAC;QAAEO,OAAO,EAAE,KAAK;QAAEC,WAAW,EAAE;MAAI,CAAC,CAAC;MACpEX,MAAM,CAACkB,MAAM,CAACC,eAAe,CAACE,WAAW,CAAC,CAACD,IAAI,CAAC,GAAG,CAAC;IACxD,CAAC,CAAC;IACFnB,EAAE,CAAC,gDAAgD,EAAE,MAAM;MACvD,MAAMiB,MAAM,GAAGf,eAAe,CAAC;QAAEO,OAAO,EAAE;MAAM,CAAC,CAAC;MAClDV,MAAM,CAACkB,MAAM,CAACC,eAAe,CAACE,WAAW,CAAC,CAACD,IAAI,CAAC,KAAK,CAAC;IAC1D,CAAC,CAAC;IACFrB,QAAQ,CAAC,WAAW,EAAE,MAAM;MACxBE,EAAE,CAAC,mBAAmB,EAAE,MAAM;QAC1BE,eAAe,CAAC;UACZO,OAAO,EAAE,KAAK;UACdY,UAAU,EAAE;YACRC,GAAG,EAAE;UACT;QACJ,CAAC,CAAC;QACFvB,MAAM,CAACM,wBAAwB,CAAC,CAAC,CAACkB,SAAS,CAAC,CAACP,qBAAqB,CAAC;AACnF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,CAAC;MACE,CAAC,CAAC;MACFhB,EAAE,CAAC,gCAAgC,EAAE,MAAM;QACvCO,wBAAwB,CAAC;UACrBE,OAAO,EAAE,KAAK;UACdE,IAAI,EAAE;QACV,CAAC,CAAC;QACFZ,MAAM,CAACM,wBAAwB,CAAC,CAAC,CAACkB,SAAS,CAAC,CAACP,qBAAqB,CAAC;AACnF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,CAAC;QACMjB,MAAM,CAAC,MAAM;UACTG,eAAe,CAAC;YACZO,OAAO,EAAE,KAAK;YACdY,UAAU,EAAE;cACRC,GAAG,EAAE;YACT;UACJ,CAAC,CAAC;QACN,CAAC,CAAC,CAACP,kCAAkC,CAAC,iFAAiF,CAAC;MAC5H,CAAC,CAAC;IACN,CAAC,CAAC;IACFf,EAAE,CAAC,uDAAuD,EAAE,MAAM;MAC9D,MAAMwB,eAAe,GAAGtB,eAAe,CAAC;QACpCO,OAAO,EAAE,iBAAiB;QAC1BY,UAAU,EAAE;UACRI,SAAS,EAAE;QACf;MACJ,CAAC,CAAC;MACqBvB,eAAe,CAAC;QACnCO,OAAO,EAAE,gBAAgB;QACzBY,UAAU,EAAE;UACRK,SAAS,EAAE;QACf,CAAC;QACDC,OAAO,EAAE,CAACH,eAAe;MAC7B,CAAC,CAAC;MACFzB,MAAM,CAACM,wBAAwB,CAAC,CAAC,CAACkB,SAAS,CAAC,CAACP,qBAAqB,CAAC;AAC/E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,CAAC;IACA,CAAC,CAAC;IACFhB,EAAE,CAAC,iDAAiD,EAAE,MAAM;MAChCE,eAAe,CAAC;QACpCO,OAAO,EAAE,iBAAiB;QAC1BY,UAAU,EAAE;UACRI,SAAS,EAAE;QACf;MACJ,CAAC,CAAC;MACqBvB,eAAe,CAAC;QACnCO,OAAO,EAAE,gBAAgB;QACzBY,UAAU,EAAE;UACRK,SAAS,EAAE;QACf,CAAC;QACDC,OAAO,EAAE,CAAC,iBAAiB;MAC/B,CAAC,CAAC;MACF5B,MAAM,CAACM,wBAAwB,CAAC,CAAC,CAACkB,SAAS,CAAC,CAACP,qBAAqB,CAAC;AAC/E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,CAAC;IACA,CAAC,CAAC;EACN,CAAC,CAAC;EACFlB,QAAQ,CAAC,MAAM,EAAE,MAAM;IACnB,IAAI8B,CAAC;IACL,IAAIC,CAAC;IACLhC,UAAU,CAAC,MAAM;MACb+B,CAAC,GAAG1B,eAAe,CAAC;QAAEO,OAAO,EAAE;MAAI,CAAC,CAAC;MACrCoB,CAAC,GAAG3B,eAAe,CAAC;QAAEO,OAAO,EAAE;MAAI,CAAC,CAAC;IACzC,CAAC,CAAC;IACFT,EAAE,CAAC,mBAAmB,EAAE,MAAM;MAC1BD,MAAM,CAAC6B,CAAC,CAAC,CAACE,GAAG,CAACC,aAAa,CAAC,CAAC;MAC7B5B,6BAA6B,CAAC;QAC1B6B,IAAI,EAAEJ,CAAC;QACPK,KAAK,EAAEJ,CAAC;QACRpB,OAAO,EAAE;MACb,CAAC,CAAC;MACFV,MAAM,CAACM,wBAAwB,CAAC,CAAC,CAACkB,SAAS,CAAC,CAACP,qBAAqB,CAAC;AAC/E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,CAAC;IACA,CAAC,CAAC;IACFhB,EAAE,CAAC,iBAAiB,EAAE,MAAM;MACxBG,6BAA6B,CAAC;QAC1B6B,IAAI,EAAEJ,CAAC;QACPM,MAAM,EAAEL,CAAC;QACTpB,OAAO,EAAE;MACb,CAAC,CAAC;MACFV,MAAM,CAACM,wBAAwB,CAAC,CAAC,CAACkB,SAAS,CAAC,CAACP,qBAAqB,CAAC;AAC/E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,CAAC;IACA,CAAC,CAAC;EACN,CAAC,CAAC;EACFlB,QAAQ,CAAC,MAAM,EAAE,MAAM;IACnBE,EAAE,CAAC,2CAA2C,EAAE,MAAM;MAClDO,wBAAwB,CAAC;QACrBE,OAAO,EAAE,KAAK;QACdE,IAAI,EAAE;MACV,CAAC,CAAC;MACFZ,MAAM,CAAC,MAAM;QACTQ,wBAAwB,CAAC;UACrBE,OAAO,EAAE,KAAK;UACdE,IAAI,EAAE;QACV,CAAC,CAAC;MACN,CAAC,CAAC,CAACI,kCAAkC,CAAC,iFAAiF,CAAC;IAC5H,CAAC,CAAC;EACN,CAAC,CAAC;EACFf,EAAE,CAAC,uBAAuB,EAAE,MAAM;IAC9B,MAAMmC,MAAM,GAAG5B,wBAAwB,CAAC;MACpCE,OAAO,EAAE,QAAQ;MACjBE,IAAI,EAAE;IACV,CAAC,CAAC;IACmBT,eAAe,CAAC;MACjCO,OAAO,EAAE,cAAc;MACvBC,WAAW,EAAE,eAAe;MAC5BW,UAAU,EAAE;QACRc;MACJ,CAAC;MACDC,IAAI,EAAE;QAAEC,KAAK,EAAE,QAAQ;QAAEC,OAAO,EAAE;MAAW;IACjD,CAAC,CAAC;IACFvC,MAAM,CAACM,wBAAwB,CAAC,CAAC,CAACkB,SAAS,CAAC,CAACP,qBAAqB,CAAC;AAC3E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC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EAAEoB,UAAU;QAAEK,GAAG,EAAEH;MAAY;IACpD,CAAC,CAAC;IACF7C,MAAM,CAACM,wBAAwB,CAAC,CAAC,CAACkB,SAAS,CAAC,CAACP,qBAAqB,CAAC;AAC3E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;IACAjB,MAAM,CAACM,wBAAwB,CAAC,CAAC,CAAC2C,aAAa,CAAC,CAAChC,qBAAqB,CAAC;AAC/E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK,CAAC;EACF,CAAC,CAAC;EACFhB,EAAE,CAAC,qCAAqC,EAAE,MAAM;IAC5C,MAAMiB,MAAM,GAAGf,eAAe,CAAC;MAAEO,OAAO,EAAE;IAAM,CAAC,CAAC;IAClDV,MAAM,CAACkB,MAAM,CAACgC,MAAM,CAAC,CAACC,OAAO,CAAC;MAAEvC,IAAI,EAAE,QAAQ;MAAEwC,MAAM,EAAE,CAAC;IAAE,CAAC,CAAC;EACjE,CAAC,CAAC;EACFnD,EAAE,CAAC,0DAA0D,EAAE,MAAM;IAKjE,MAAMiB,MAAM,GAAGf,eAAe,CAAC;MAC3BO,OAAO,EAAE,KAAK;MACdwC,MAAM,EAAE;QAAEtC,IAAI,EAAE;MAAe;IACnC,CAAC,CAAC;IACFZ,MAAM,CAACkB,MAAM,CAACgC,MAAM,CAAC,CAACC,OAAO,CARF;MACvBvC,IAAI,EAAE,cAAc;MACpByC,YAAY,EAAE,CAAC;IACnB,CAKgD,CAAC;EACrD,CAAC,CAAC;EACFpD,EAAE,CAAC,wDAAwD,EAAE,MAAM;IAQ/D,MAAMiB,MAAM,GAAGf,eAAe,CAAC;MAC3BO,OAAO,EAAE,KAAK;MACdwC,MAAM,EAAE;QAAEtC,IAAI,EAAE,YAAY;QAAE0C,OAAO,EAAE,KAAK;QAAEC,QAAQ,EAAE;MAAM;IAClE,CAAC,CAAC;IACFvD,MAAM,CAACkB,MAAM,CAACgC,MAAM,CAAC,CAACC,OAAO,CAXJ;MACrBvC,IAAI,EAAE,YAAY;MAClB4C,UAAU,EAAE;QACRF,OAAO,EAAE,KAAK;QACdC,QAAQ,EAAE;MACd;IACJ,CAK8C,CAAC;EACnD,CAAC,CAAC;AACN,CAAC,CAAC","ignoreList":[]}
@@ -26,7 +26,7 @@ import { defineOntology } from "../api/defineOntology.js";
26
26
  import { defineSharedPropertyType } from "../api/defineSpt.js";
27
27
  const apiNamespaceRegex = /^[a-z0-9-]+(\.[a-z0-9-]+)*\.$/;
28
28
  export default async function main(args = process.argv) {
29
- const commandLineOpts = await yargs(hideBin(args)).version("0.9.0-beta.21" ?? "").wrap(Math.min(150, yargs().terminalWidth())).strict().help().options({
29
+ const commandLineOpts = await yargs(hideBin(args)).version("0.9.0-beta.22" ?? "").wrap(Math.min(150, yargs().terminalWidth())).strict().help().options({
30
30
  input: {
31
31
  alias: "i",
32
32
  describe: "Input file",
@@ -1 +1 @@
1
- {"version":3,"file":"defineInterface.d.ts","sourceRoot":"","sources":["../../../src/api/defineInterface.ts"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,KAAK,EACV,aAAa,EAEb,gBAAgB,EAChB,kBAAkB,EACnB,MAAM,YAAY,CAAC;AAEpB,KAAK,6BAA6B,GAC9B;IAAE,IAAI,EAAE,YAAY,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,GACzD;IAAE,IAAI,EAAE,QAAQ,CAAA;CAAE,GAClB;IAAE,IAAI,EAAE,cAAc,CAAA;CAAE,CAAC;AAE7B,wBAAgB,eAAe,CAC7B,IAAI,EAAE;IACJ,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE;QAAE,OAAO,EAAE,aAAa,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;IACjD,MAAM,CAAC,EAAE,6BAA6B,CAAC;IACvC,UAAU,CAAC,EAAE,MAAM,CACjB,MAAM,EACN,kBAAkB,GAAG,gBAAgB,CACtC,CAAC;IAEF,OAAO,CAAC,EAAE,aAAa,GAAG,aAAa,EAAE,GAAG,MAAM,GAAG,MAAM,EAAE,CAAC;CAC/D,GACA,aAAa,CA4Ff"}
1
+ {"version":3,"file":"defineInterface.d.ts","sourceRoot":"","sources":["../../../src/api/defineInterface.ts"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,KAAK,EACV,aAAa,EAEb,gBAAgB,EAChB,kBAAkB,EACnB,MAAM,YAAY,CAAC;AAEpB,KAAK,6BAA6B,GAC9B;IAAE,IAAI,EAAE,YAAY,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,GACzD;IAAE,IAAI,EAAE,QAAQ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