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

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,31 @@
1
1
  # @osdk/maker
2
2
 
3
+ ## 0.9.0-beta.23
4
+
5
+ ### Minor Changes
6
+
7
+ - f0b519d: Upgrade to vitest 3 and vite 6
8
+ - 7a95618: Generate new OMS APIs
9
+ - d665147: Update platform sdk deps
10
+
11
+ ### Patch Changes
12
+
13
+ - Updated dependencies [d794c19]
14
+ - Updated dependencies [62c1d63]
15
+ - @osdk/api@2.1.0-beta.23
16
+
17
+ ## 0.9.0-beta.22
18
+
19
+ ### Minor Changes
20
+
21
+ - 8d8bebb: Fix nullability
22
+ - c9da74c: Improves code quality by fixing linting errors
23
+
24
+ ### Patch Changes
25
+
26
+ - Updated dependencies [73fa373]
27
+ - @osdk/api@2.1.0-beta.22
28
+
3
29
  ## 0.9.0-beta.21
4
30
 
5
31
  ### 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,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A,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,CAAU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kBAAkBA,CAAC6B,CAAC,EAAE;EAC3B,OAAOA,CAAC,KAAK,SAAS,IAAIA,CAAC,KAAK,MAAM,IAC/BA,CAAC,KAAK,MAAM,IAAIA,CAAC,KAAK,SAAS,IAAIA,CAAC,KAAK,QAAQ,IACjDA,CAAC,KAAK,OAAO,IAAIA,CAAC,KAAK,UAAU,IAAIA,CAAC,KAAK,UAAU,IACrDA,CAAC,KAAK,SAAS,IAAIA,CAAC,KAAK,MAAM,IAC9B,OAAOA,CAAC,KAAK,QAAQ,IAAIA,CAAC,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,EAAU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,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 +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,
@@ -212,6 +212,7 @@ function convertType(type) {
212
212
  analyzerOverride: undefined,
213
213
  enableAsciiFolding: undefined,
214
214
  isLongText: false,
215
+ supportsEfficientLeadingWildcard: false,
215
216
  supportsExactMatching: true
216
217
  }
217
218
  };
@@ -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,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,EAAEF,CAAC,CAAC;IAC9E,MAAMA,CAAC;EACX;EACA,OAAO;IACHG,QAAQ,EAAEC,uBAAuB,CAAChB,kBAAkB,CAAC;IACrDiB,SAAS,EAAEC,4BAA4B,CAAClB,kBAAkB;EAC9D,CAAC;AACL;AACA,SAASkB,4BAA4BA,CAACH,QAAQ,EAAE;EAC5C,OAAO;IACHL,UAAU,EAAES,MAAM,CAACC,MAAM,CAACL,QAAQ,CAACL,UAAU,CAAC,CAACW,GAAG,CAACC,WAAW,KAAK;MAC/DC,QAAQ,EAAE;QACNC,OAAO,EAAEF,WAAW,CAAC,CAAC,CAAC,CAACE,OAAO;QAC/BC,eAAe,EAAEH,WAAW,CAAC,CAAC,CAAC,CAACG,eAAe;QAC/CC,MAAM,EAAEJ,WAAW,CAAC,CAAC,CAAC,CAACI;MAC3B,CAAC;MACDC,QAAQ,EAAEL,WAAW,CAACD,GAAG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AEd,WAAW,CAACY,mBAAmB;YAC9C,CAAC;UACL;QACJ;QACAJ,YAAY,CAACO,IAAI,CAACF,KAAK,CAAC;MAC5B;MACA,OAAO;QACH5B,IAAI,EAAE,QAAQ;QACd+B,MAAM,EAAE;UAAER;QAAa;MAC3B,CAAC;IACL,KAAMvB,IAAI,KAAK,UAAU;MACrB,OAAO;QAAEA,IAAI,EAAE,SAAS;QAAEgC,OAAO,EAAE,CAAC;MAAE,CAAC;IAC3C,KAAMhC,IAAI,KAAK,SAAS;MACpB,OAAO;QAAEA,IAAI;QAAE,CAACA,IAAI,GAAG;UAAEiC,SAAS,EAAErB,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","supportsEfficientLeadingWildcard","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 supportsEfficientLeadingWildcard: 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,E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AI,EAAE,SAAS;QAAEgC,OAAO,EAAE,CAAC;MAAE,CAAC;IAC3C,KAAMhC,IAAI,KAAK,SAAS;MACpB,OAAO;QAAEA,IAAI;QAAE,CAACA,IAAI,GAAG;UAAEiC,SAAS,EAAExB,SAAS;UAAEyB,KAAK,EAAEzB;QAAU;MAAE,CAAC;IACvE,KAAMT,IAAI,KAAK,QAAQ;MACnB,OAAO;QACHA,IAAI;QACJ,CAACA,IAAI,GAAG;UACJmC,gBAAgB,EAAE1B,SAAS;UAC3B2B,kBAAkB,EAAE3B,SAAS;UAC7B4B,UAAU,EAAE,KAAK;UACjBC,gCAAgC,EAAE,KAAK;UACvCC,qBAAqB,EAAE;QAC3B;MACJ,CAAC;IACL,KAAMvC,IAAI,KAAK,gBAAgB;MAC3B,OAAO;QACHA,IAAI,EAAEA,IAAI;QACVwC,cAAc,EAAE,CAAC;MACrB,CAAC;IACL;MACI;MACA,OAAOC,oBAAoB,CAACzC,IAAI,CAAC;EACzC;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASyC,oBAAoBA,CAACzC,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", () => {
@@ -179,6 +181,7 @@ describe("Ontology Defining", () => {
179
181
  "analyzerOverride": undefined,
180
182
  "enableAsciiFolding": undefined,
181
183
  "isLongText": false,
184
+ "supportsEfficientLeadingWildcard": false,
182
185
  "supportsExactMatching": true,
183
186
  },
184
187
  "type": "string",
@@ -223,6 +226,7 @@ describe("Ontology Defining", () => {
223
226
  "analyzerOverride": undefined,
224
227
  "enableAsciiFolding": undefined,
225
228
  "isLongText": false,
229
+ "supportsEfficientLeadingWildcard": false,
226
230
  "supportsExactMatching": true,
227
231
  },
228
232
  "type": "string",
@@ -277,6 +281,7 @@ describe("Ontology Defining", () => {
277
281
  "analyzerOverride": undefined,
278
282
  "enableAsciiFolding": undefined,
279
283
  "isLongText": false,
284
+ "supportsEfficientLeadingWildcard": false,
280
285
  "supportsExactMatching": true,
281
286
  },
282
287
  "type": "string",
@@ -363,6 +368,7 @@ describe("Ontology Defining", () => {
363
368
  "analyzerOverride": undefined,
364
369
  "enableAsciiFolding": undefined,
365
370
  "isLongText": false,
371
+ "supportsEfficientLeadingWildcard": false,
366
372
  "supportsExactMatching": true,
367
373
  },
368
374
  "type": "string",
@@ -418,6 +424,7 @@ describe("Ontology Defining", () => {
418
424
  "analyzerOverride": undefined,
419
425
  "enableAsciiFolding": undefined,
420
426
  "isLongText": false,
427
+ "supportsEfficientLeadingWildcard": false,
421
428
  "supportsExactMatching": true,
422
429
  },
423
430
  "type": "string",
@@ -462,6 +469,7 @@ describe("Ontology Defining", () => {
462
469
  "analyzerOverride": undefined,
463
470
  "enableAsciiFolding": undefined,
464
471
  "isLongText": false,
472
+ "supportsEfficientLeadingWildcard": false,
465
473
  "supportsExactMatching": true,
466
474
  },
467
475
  "type": "string",
@@ -498,6 +506,7 @@ describe("Ontology Defining", () => {
498
506
  "analyzerOverride": undefined,
499
507
  "enableAsciiFolding": undefined,
500
508
  "isLongText": false,
509
+ "supportsEfficientLeadingWildcard": false,
501
510
  "supportsExactMatching": true,
502
511
  },
503
512
  "type": "string",
@@ -575,6 +584,7 @@ describe("Ontology Defining", () => {
575
584
  "analyzerOverride": undefined,
576
585
  "enableAsciiFolding": undefined,
577
586
  "isLongText": false,
587
+ "supportsEfficientLeadingWildcard": false,
578
588
  "supportsExactMatching": true,
579
589
  },
580
590
  "type": "string",
@@ -630,6 +640,7 @@ describe("Ontology Defining", () => {
630
640
  "analyzerOverride": undefined,
631
641
  "enableAsciiFolding": undefined,
632
642
  "isLongText": false,
643
+ "supportsEfficientLeadingWildcard": false,
633
644
  "supportsExactMatching": true,
634
645
  },
635
646
  "type": "string",
@@ -674,6 +685,7 @@ describe("Ontology Defining", () => {
674
685
  "analyzerOverride": undefined,
675
686
  "enableAsciiFolding": undefined,
676
687
  "isLongText": false,
688
+ "supportsEfficientLeadingWildcard": false,
677
689
  "supportsExactMatching": true,
678
690
  },
679
691
  "type": "string",
@@ -710,6 +722,7 @@ describe("Ontology Defining", () => {
710
722
  "analyzerOverride": undefined,
711
723
  "enableAsciiFolding": undefined,
712
724
  "isLongText": false,
725
+ "supportsEfficientLeadingWildcard": false,
713
726
  "supportsExactMatching": true,
714
727
  },
715
728
  "type": "string",
@@ -967,6 +980,7 @@ describe("Ontology Defining", () => {
967
980
  "analyzerOverride": undefined,
968
981
  "enableAsciiFolding": undefined,
969
982
  "isLongText": false,
983
+ "supportsEfficientLeadingWildcard": false,
970
984
  "supportsExactMatching": true,
971
985
  },
972
986
  "type": "string",
@@ -1011,6 +1025,7 @@ describe("Ontology Defining", () => {
1011
1025
  "analyzerOverride": undefined,
1012
1026
  "enableAsciiFolding": undefined,
1013
1027
  "isLongText": false,
1028
+ "supportsEfficientLeadingWildcard": false,
1014
1029
  "supportsExactMatching": true,
1015
1030
  },
1016
1031
  "type": "string",
@@ -1169,7 +1184,7 @@ describe("Ontology Defining", () => {
1169
1184
  "apiName": "com.palantir.foo",
1170
1185
  "baseFormatter": undefined,
1171
1186
  "dataConstraints": {
1172
- "nullability": "NO_EXPLICIT_NULLS",
1187
+ "nullability": undefined,
1173
1188
  "nullabilityV2": {
1174
1189
  "noEmptyCollections": true,
1175
1190
  "noNulls": true,
@@ -1220,6 +1235,7 @@ describe("Ontology Defining", () => {
1220
1235
  "analyzerOverride": undefined,
1221
1236
  "enableAsciiFolding": undefined,
1222
1237
  "isLongText": false,
1238
+ "supportsEfficientLeadingWildcard": false,
1223
1239
  "supportsExactMatching": true,
1224
1240
  },
1225
1241
  "type": "string",
@@ -1242,7 +1258,7 @@ describe("Ontology Defining", () => {
1242
1258
  "apiName": "com.palantir.foo",
1243
1259
  "baseFormatter": undefined,
1244
1260
  "dataConstraints": {
1245
- "nullability": "NO_EXPLICIT_NULLS",
1261
+ "nullability": undefined,
1246
1262
  "nullabilityV2": {
1247
1263
  "noEmptyCollections": true,
1248
1264
  "noNulls": true,