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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (109) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/build/browser/api/defineImportSpt.js +1 -0
  3. package/build/browser/api/defineImportSpt.js.map +1 -1
  4. package/build/browser/api/defineInterface.js +1 -0
  5. package/build/browser/api/defineInterface.js.map +1 -1
  6. package/build/browser/api/defineInterfaceLinkConstraint.js +1 -0
  7. package/build/browser/api/defineInterfaceLinkConstraint.js.map +1 -1
  8. package/build/browser/api/defineLink.js +1 -0
  9. package/build/browser/api/defineLink.js.map +1 -1
  10. package/build/browser/api/defineObject.js +2 -0
  11. package/build/browser/api/defineObject.js.map +1 -1
  12. package/build/browser/api/defineOntology.js +4 -0
  13. package/build/browser/api/defineOntology.js.map +1 -1
  14. package/build/browser/api/defineSpt.js +1 -0
  15. package/build/browser/api/defineSpt.js.map +1 -1
  16. package/build/browser/api/defineValueType.js +1 -0
  17. package/build/browser/api/defineValueType.js.map +1 -1
  18. package/build/browser/api/iconNames.js +0 -15
  19. package/build/browser/api/iconNames.js.map +1 -1
  20. package/build/browser/api/overall.test.js +16 -0
  21. package/build/browser/api/overall.test.js.map +1 -1
  22. package/build/browser/api/types.js +0 -15
  23. package/build/browser/api/types.js.map +1 -1
  24. package/build/browser/cli/main.js +3 -1
  25. package/build/browser/cli/main.js.map +1 -1
  26. package/build/browser/index.js +1 -0
  27. package/build/browser/index.js.map +1 -1
  28. package/build/cjs/index.cjs +561 -0
  29. package/build/cjs/index.cjs.map +1 -0
  30. package/build/cjs/index.d.cts +307 -0
  31. package/build/esm/api/defineImportSpt.js +1 -0
  32. package/build/esm/api/defineImportSpt.js.map +1 -1
  33. package/build/esm/api/defineInterface.js +1 -0
  34. package/build/esm/api/defineInterface.js.map +1 -1
  35. package/build/esm/api/defineInterfaceLinkConstraint.js +1 -0
  36. package/build/esm/api/defineInterfaceLinkConstraint.js.map +1 -1
  37. package/build/esm/api/defineLink.js +1 -0
  38. package/build/esm/api/defineLink.js.map +1 -1
  39. package/build/esm/api/defineObject.js +2 -0
  40. package/build/esm/api/defineObject.js.map +1 -1
  41. package/build/esm/api/defineOntology.js +4 -0
  42. package/build/esm/api/defineOntology.js.map +1 -1
  43. package/build/esm/api/defineSpt.js +1 -0
  44. package/build/esm/api/defineSpt.js.map +1 -1
  45. package/build/esm/api/defineValueType.js +1 -0
  46. package/build/esm/api/defineValueType.js.map +1 -1
  47. package/build/esm/api/iconNames.js +0 -15
  48. package/build/esm/api/iconNames.js.map +1 -1
  49. package/build/esm/api/overall.test.js +16 -0
  50. package/build/esm/api/overall.test.js.map +1 -1
  51. package/build/esm/api/types.js +0 -15
  52. package/build/esm/api/types.js.map +1 -1
  53. package/build/esm/cli/main.js +3 -1
  54. package/build/esm/cli/main.js.map +1 -1
  55. package/build/esm/index.js +1 -0
  56. package/build/esm/index.js.map +1 -1
  57. package/package.json +23 -10
  58. package/build/browser/api/defineImportSpt.d.ts +0 -10
  59. package/build/browser/api/defineImportSpt.d.ts.map +0 -1
  60. package/build/browser/api/defineInterface.d.ts +0 -25
  61. package/build/browser/api/defineInterface.d.ts.map +0 -1
  62. package/build/browser/api/defineInterfaceLinkConstraint.d.ts +0 -23
  63. package/build/browser/api/defineInterfaceLinkConstraint.d.ts.map +0 -1
  64. package/build/browser/api/defineLink.d.ts +0 -18
  65. package/build/browser/api/defineLink.d.ts.map +0 -1
  66. package/build/browser/api/defineObject.d.ts +0 -15
  67. package/build/browser/api/defineObject.d.ts.map +0 -1
  68. package/build/browser/api/defineOntology.d.ts +0 -10
  69. package/build/browser/api/defineOntology.d.ts.map +0 -1
  70. package/build/browser/api/defineSpt.d.ts +0 -13
  71. package/build/browser/api/defineSpt.d.ts.map +0 -1
  72. package/build/browser/api/defineValueType.d.ts +0 -17
  73. package/build/browser/api/defineValueType.d.ts.map +0 -1
  74. package/build/browser/api/iconNames.d.ts +0 -3
  75. package/build/browser/api/iconNames.d.ts.map +0 -1
  76. package/build/browser/api/overall.test.d.ts +0 -2
  77. package/build/browser/api/overall.test.d.ts.map +0 -1
  78. package/build/browser/api/types.d.ts +0 -231
  79. package/build/browser/api/types.d.ts.map +0 -1
  80. package/build/browser/cli/main.d.ts +0 -2
  81. package/build/browser/cli/main.d.ts.map +0 -1
  82. package/build/browser/index.d.ts +0 -7
  83. package/build/browser/index.d.ts.map +0 -1
  84. package/build/esm/api/defineImportSpt.d.ts +0 -10
  85. package/build/esm/api/defineImportSpt.d.ts.map +0 -1
  86. package/build/esm/api/defineInterface.d.ts +0 -25
  87. package/build/esm/api/defineInterface.d.ts.map +0 -1
  88. package/build/esm/api/defineInterfaceLinkConstraint.d.ts +0 -23
  89. package/build/esm/api/defineInterfaceLinkConstraint.d.ts.map +0 -1
  90. package/build/esm/api/defineLink.d.ts +0 -18
  91. package/build/esm/api/defineLink.d.ts.map +0 -1
  92. package/build/esm/api/defineObject.d.ts +0 -15
  93. package/build/esm/api/defineObject.d.ts.map +0 -1
  94. package/build/esm/api/defineOntology.d.ts +0 -10
  95. package/build/esm/api/defineOntology.d.ts.map +0 -1
  96. package/build/esm/api/defineSpt.d.ts +0 -13
  97. package/build/esm/api/defineSpt.d.ts.map +0 -1
  98. package/build/esm/api/defineValueType.d.ts +0 -17
  99. package/build/esm/api/defineValueType.d.ts.map +0 -1
  100. package/build/esm/api/iconNames.d.ts +0 -3
  101. package/build/esm/api/iconNames.d.ts.map +0 -1
  102. package/build/esm/api/overall.test.d.ts +0 -2
  103. package/build/esm/api/overall.test.d.ts.map +0 -1
  104. package/build/esm/api/types.d.ts +0 -231
  105. package/build/esm/api/types.d.ts.map +0 -1
  106. package/build/esm/cli/main.d.ts +0 -2
  107. package/build/esm/cli/main.d.ts.map +0 -1
  108. package/build/esm/index.d.ts +0 -7
  109. package/build/esm/index.d.ts.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,28 @@
1
1
  # @osdk/maker
2
2
 
3
+ ## 0.9.0-beta.24
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [03f95eb]
8
+ - Updated dependencies [c691c8b]
9
+ - Updated dependencies [3c9ac22]
10
+ - @osdk/api@2.1.0-beta.24
11
+
12
+ ## 0.9.0-beta.23
13
+
14
+ ### Minor Changes
15
+
16
+ - f0b519d: Upgrade to vitest 3 and vite 6
17
+ - 7a95618: Generate new OMS APIs
18
+ - d665147: Update platform sdk deps
19
+
20
+ ### Patch Changes
21
+
22
+ - Updated dependencies [d794c19]
23
+ - Updated dependencies [62c1d63]
24
+ - @osdk/api@2.1.0-beta.23
25
+
3
26
  ## 0.9.0-beta.22
4
27
 
5
28
  ### Minor Changes
@@ -13,6 +13,7 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
+
16
17
  import invariant from "tiny-invariant";
17
18
  import { ontologyDefinition } from "./defineOntology.js";
18
19
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"defineImportSpt.js","names":["invariant","ontologyDefinition","importSharedPropertyType","opts","apiName","packageName","typeHint","undefined","importedTypes","sharedPropertyTypes","push","endsWith","process","env","NODE_ENV","match","type"],"sources":["defineImportSpt.js"],"sourcesContent":["/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport invariant from \"tiny-invariant\";\nimport { ontologyDefinition } from \"./defineOntology.js\";\n/**\n * Defines a foreign shared property type you want to take as an input to your product. The typeHint field is used for OSDK generation\n */\nexport function importSharedPropertyType(opts) {\n const { apiName, packageName, typeHint } = opts;\n if (packageName !== undefined) {\n ontologyDefinition.importedTypes.sharedPropertyTypes.push({\n apiName,\n packageName,\n });\n invariant(!packageName.endsWith(\".\"), \"Package name format invalid ends with period\");\n invariant(packageName.match(\"[A-Z]\") == null, \"Package name includes upper case characters\");\n return { apiName: packageName + \".\" + apiName, type: typeHint };\n }\n return { apiName: apiName, type: typeHint };\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAOA,SAAS,MAAM,gBAAgB;AACtC,SAASC,kBAAkB,QAAQ,qBAAqB;AACxD;AACA;AACA;AACA,OAAO,SAASC,wBAAwBA,CAACC,IAAI,EAAE;EAC3C,MAAM;IAAEC,OAAO;IAAEC,WAAW;IAAEC;EAAS,CAAC,GAAGH,IAAI;EAC/C,IAAIE,WAAW,KAAKE,SAAS,EAAE;IAC3BN,kBAAkB,CAACO,aAAa,CAACC,mBAAmB,CAACC,IAAI,CAAC;MACtDN,OAAO;MACPC;IACJ,CAAC,CAAC;IACF,CAAU,CAACA,WAAW,CAACM,QAAQ,CAAC,GAAG,CAAC,GAAAC,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAApCd,SAAS,QAA6B,8CAA8C,IAApFA,SAAS;IACT,EAAUK,WAAW,CAACU,KAAK,CAAC,OAAO,CAAC,IAAI,IAAI,IAAAH,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAA5Cd,SAAS,QAAqC,6CAA6C,IAA3FA,SAAS;IACT,OAAO;MAAEI,OAAO,EAAEC,WAAW,GAAG,GAAG,GAAGD,OAAO;MAAEY,IAAI,EAAEV;IAAS,CAAC;EACnE;EACA,OAAO;IAAEF,OAAO,EAAEA,OAAO;IAAEY,IAAI,EAAEV;EAAS,CAAC;AAC/C","ignoreList":[]}
1
+ {"version":3,"file":"defineImportSpt.js","names":["invariant","ontologyDefinition","importSharedPropertyType","opts","apiName","packageName","typeHint","undefined","importedTypes","sharedPropertyTypes","push","endsWith","process","env","NODE_ENV","match","type"],"sources":["defineImportSpt.ts"],"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\nimport invariant from \"tiny-invariant\";\nimport { ontologyDefinition } from \"./defineOntology.js\";\nimport type { PropertyTypeType, SharedPropertyType } from \"./types.js\";\n\n/**\n * Defines a foreign shared property type you want to take as an input to your product. The typeHint field is used for OSDK generation\n */\nexport function importSharedPropertyType(\n opts: {\n apiName: string;\n packageName?: string;\n typeHint: PropertyTypeType;\n },\n): SharedPropertyType {\n const { apiName, packageName, typeHint } = opts;\n if (packageName !== undefined) {\n ontologyDefinition.importedTypes.sharedPropertyTypes.push({\n apiName,\n packageName,\n });\n invariant(\n !packageName.endsWith(\".\"),\n \"Package name format invalid ends with period\",\n );\n\n invariant(\n packageName.match(\"[A-Z]\") == null,\n \"Package name includes upper case characters\",\n );\n\n return { apiName: packageName + \".\" + apiName, type: typeHint };\n }\n return { apiName: apiName, type: typeHint };\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAOA,SAAS,MAAM,gBAAgB;AACtC,SAASC,kBAAkB,QAAQ,qBAAqB;AAGxD;AACA;AACA;AACA,OAAO,SAASC,wBAAwBA,CACtCC,IAIC,EACmB;EACpB,MAAM;IAAEC,OAAO;IAAEC,WAAW;IAAEC;EAAS,CAAC,GAAGH,IAAI;EAC/C,IAAIE,WAAW,KAAKE,SAAS,EAAE;IAC7BN,kBAAkB,CAACO,aAAa,CAACC,mBAAmB,CAACC,IAAI,CAAC;MACxDN,OAAO;MACPC;IACF,CAAC,CAAC;IACF,CACE,CAACA,WAAW,CAACM,QAAQ,CAAC,GAAG,CAAC,GAAAC,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAD5Bd,SAAS,QAEP,8CAA8C,IAFhDA,SAAS;IAKT,EACEK,WAAW,CAACU,KAAK,CAAC,OAAO,CAAC,IAAI,IAAI,IAAAH,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBADpCd,SAAS,QAEP,6CAA6C,IAF/CA,SAAS;IAKT,OAAO;MAAEI,OAAO,EAAEC,WAAW,GAAG,GAAG,GAAGD,OAAO;MAAEY,IAAI,EAAEV;IAAS,CAAC;EACjE;EACA,OAAO;IAAEF,OAAO,EAAEA,OAAO;IAAEY,IAAI,EAAEV;EAAS,CAAC;AAC7C","ignoreList":[]}
@@ -13,6 +13,7 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
+
16
17
  import invariant from "tiny-invariant";
17
18
  import { namespace, ontologyDefinition } from "./defineOntology.js";
18
19
  import { defineSharedPropertyType } from "./defineSpt.js";
@@ -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","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,CAACO,UAAU,IAAI,CAAC,CAAC,CAAC,CAACI,GAAG,CAAC,C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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.ts"],"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\nimport invariant from \"tiny-invariant\";\nimport { namespace, ontologyDefinition } from \"./defineOntology.js\";\nimport { defineSharedPropertyType } from \"./defineSpt.js\";\nimport type { BlueprintIcon } from \"./iconNames.js\";\nimport type {\n InterfaceType,\n InterfaceTypeStatus,\n PropertyTypeType,\n SharedPropertyType,\n} from \"./types.js\";\n\ntype SimplifiedInterfaceTypeStatus =\n | { type: \"deprecated\"; message: string; deadline: string }\n | { type: \"active\" }\n | { type: \"experimental\" };\n\nexport function defineInterface(\n opts: {\n apiName: string;\n displayName?: string;\n description?: string;\n icon?: { locator: BlueprintIcon; color: string };\n status?: SimplifiedInterfaceTypeStatus;\n properties?: Record<\n string,\n SharedPropertyType | PropertyTypeType\n >;\n\n extends?: InterfaceType | InterfaceType[] | string | string[];\n },\n): InterfaceType {\n const apiName = namespace + opts.apiName;\n invariant(\n ontologyDefinition.interfaceTypes[apiName] === undefined,\n `Interface ${apiName} already exists`,\n );\n\n const properties = Object.fromEntries(\n Object.entries(opts.properties ?? {}).map<\n [string, SharedPropertyType]\n >(\n ([apiName, type]) => {\n if (\n typeof type === \"string\"\n || (typeof type === \"object\" && !(\"apiName\" in type))\n ) {\n invariant(\n isPropertyTypeType(type),\n `Invalid data type ${\n JSON.stringify(type)\n } for property ${apiName} on InterfaceType ${apiName}`,\n );\n\n const spt = defineSharedPropertyType({\n apiName,\n displayName: apiName,\n type,\n array: false,\n });\n return [apiName, spt];\n } else {\n const unNamespacedTypeApiName = type.apiName.slice(\n type.apiName.lastIndexOf(\".\") + 1,\n );\n invariant(\n namespace + apiName === type.apiName\n || apiName === unNamespacedTypeApiName,\n `property key and it's apiName must be identical. ${\n JSON.stringify({ key: apiName, apiName: type.apiName })\n }`,\n );\n return [apiName, type];\n }\n },\n ),\n );\n\n let extendsInterfaces: string[] = [];\n if (opts.extends) {\n if (typeof opts.extends === \"string\") {\n extendsInterfaces = [opts.extends];\n } else if (\n Array.isArray(opts.extends)\n && opts.extends.every(item => typeof item === \"string\")\n ) {\n extendsInterfaces = opts.extends;\n } else if ((opts.extends as InterfaceType).apiName !== undefined) {\n extendsInterfaces = [(opts.extends as InterfaceType).apiName];\n } else {\n extendsInterfaces = (opts.extends as InterfaceType[]).map(item =>\n item.apiName\n );\n }\n }\n\n const status: InterfaceTypeStatus = mapSimplifiedStatusToInterfaceTypeStatus(\n opts.status ?? { type: \"active\" },\n );\n\n invariant(\n status.type !== \"deprecated\"\n || (status.deprecated.message && status.deprecated.deadline),\n `Deprecated status must include message and deadline properties.`,\n );\n\n const a: InterfaceType = {\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\n return ontologyDefinition.interfaceTypes[apiName] = a;\n}\n\nfunction isPropertyTypeType(\n v: PropertyTypeType,\n): v is PropertyTypeType {\n return v === \"boolean\" || v === \"byte\"\n || v === \"date\" || v === \"decimal\" || v === \"double\"\n || v === \"float\" || v === \"geopoint\" || v === \"geoshape\"\n || v === \"integer\" || v === \"long\"\n || (typeof v === \"object\" && v.type === \"marking\")\n || v === \"short\" || v === \"string\"\n || v === \"timestamp\";\n}\n\nfunction mapSimplifiedStatusToInterfaceTypeStatus(\n status: SimplifiedInterfaceTypeStatus,\n): InterfaceTypeStatus {\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 as any).type}`);\n }\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAOA,SAAS,MAAM,gBAAgB;AACtC,SAASC,SAAS,EAAEC,kBAAkB,QAAQ,qBAAqB;AACnE,SAASC,wBAAwB,QAAQ,gBAAgB;AAczD,OAAO,SAASC,eAAeA,CAC7BC,IAYC,EACc;EACf,MAAMC,OAAO,GAAGL,SAAS,GAAGI,IAAI,CAACC,OAAO;EACxC,EACEJ,kBAAkB,CAACK,cAAc,CAACD,OAAO,CAAC,KAAKE,SAAS,IAAAC,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAD1DX,SAAS,QAEP,aAAaM,OAAO,iBAAiB,IAFvCN,SAAS;EAKT,MAAMY,UAAU,GAAGC,MAAM,CAACC,WAAW,CACnCD,MAAM,CAACE,OAAO,CAACV,IAAI,CAACO,UAAU,IAAI,CAAC,CAAC,CAAC,CAACI,GAAG,CAGvC,CAAC,CAACV,OAAO,EAAEW,IAAI,CAAC,KAAK;IACnB,IACE,OAAOA,IAAI,KAAK,QAAQ,IACpB,OAAOA,IAA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U;IACVsB;EACF,CAAC;EAED,OAAOhC,kBAAkB,CAACK,cAAc,CAACD,OAAO,CAAC,GAAGiC,CAAC;AACvD;AAEA,SAASrB,kBAAkBA,CACzB6B,CAAmB,EACI;EACvB,OAAOA,CAAC,KAAK,SAAS,IAAIA,CAAC,KAAK,MAAM,IACjCA,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;AACxB;AAEA,SAASZ,wCAAwCA,CAC/CD,MAAqC,EAChB;EACrB,QAAQA,MAAM,CAACjB,IAAI;IACjB,KAAK,YAAY;MACf,OAAO;QACLA,IAAI,EAAE,YAAY;QAClBmB,UAAU,EAAE;UACVC,OAAO,EAAEH,MAAM,CAACG,OAAO;UACvBC,QAAQ,EAAEJ,MAAM,CAACI,QAAQ;UACzBU,UAAU,EAAExC;QACd;MACF,CAAC;IACH,KAAK,QAAQ;MACX,OAAO;QACLS,IAAI,EAAE,QAAQ;QACdgC,MAAM,EAAE,CAAC;MACX,CAAC;IACH,KAAK,cAAc;MACjB,OAAO;QACLhC,IAAI,EAAE,cAAc;QACpBiC,YAAY,EAAE,CAAC;MACjB,CAAC;IACH;MACE,MAAM,IAAIC,KAAK,CAAC,wBAAyBjB,MAAM,CAASjB,IAAI,EAAE,CAAC;EACnE;AACF","ignoreList":[]}
@@ -13,6 +13,7 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
+
16
17
  import invariant from "tiny-invariant";
17
18
  import { namespace } from "./defineOntology.js";
18
19
  export function defineInterfaceLinkConstraint(linkDef) {
@@ -1 +1 @@
1
- {"version":3,"file":"defineInterfaceLinkConstraint.js","names":["invariant","namespace","defineInterfaceLinkConstraint","linkDef","fromLinkMeta","getLinkMeta","from","links","find","a","metadata","apiName","process","env","NODE_ENV","push","cardinality","toMany","linkedEntityTypeId","getLinkedType","toOne","required","t","type","interfaceType","meta","withDefaults","description","displayName"],"sources":["defineInterfaceLinkConstraint.js"],"sourcesContent":["/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport invariant from \"tiny-invariant\";\nimport { namespace } from \"./defineOntology.js\";\nexport function defineInterfaceLinkConstraint(linkDef) {\n const fromLinkMeta = getLinkMeta(linkDef);\n invariant(linkDef.from.links.find(a => a.metadata.apiName === fromLinkMeta.apiName)\n == null, `Link with apiName ${fromLinkMeta.apiName} already exists on ${linkDef.apiName}`);\n linkDef.from.links.push({\n cardinality: linkDef.toMany ? \"MANY\" : \"SINGLE\",\n linkedEntityTypeId: getLinkedType(linkDef.toMany ?? linkDef.toOne),\n metadata: fromLinkMeta,\n required: linkDef.required ?? true,\n });\n}\nfunction getLinkedType(t) {\n return {\n type: \"interfaceType\",\n interfaceType: typeof t === \"string\" ? t : t.apiName,\n };\n}\nfunction getLinkMeta(meta) {\n return typeof meta === \"string\"\n ? withDefaults({ apiName: namespace + meta })\n : withDefaults(meta);\n}\nfunction withDefaults({ apiName, description, displayName }) {\n return {\n apiName: namespace + apiName,\n displayName: displayName ?? apiName,\n description: description ?? displayName ?? apiName,\n };\n}\n"],"mappings":"AAAA;AACA;A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AY,CAAC,EAAE;EACzD,OAAO;IACHjB,OAAO,EAAEV,SAAS,GAAGU,OAAO;IAC5BiB,WAAW,EAAEA,WAAW,IAAIjB,OAAO;IACnCgB,WAAW,EAAEA,WAAW,IAAIC,WAAW,IAAIjB;EAC/C,CAAC;AACL","ignoreList":[]}
1
+ {"version":3,"file":"defineInterfaceLinkConstraint.js","names":["invariant","namespace","defineInterfaceLinkConstraint","linkDef","fromLinkMeta","getLinkMeta","from","links","find","a","metadata","apiName","process","env","NODE_ENV","push","cardinality","toMany","linkedEntityTypeId","getLinkedType","toOne","required","t","type","interfaceType","meta","withDefaults","description","displayName"],"sources":["defineInterfaceLinkConstraint.ts"],"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\nimport invariant from \"tiny-invariant\";\nimport { namespace } from \"./defineOntology.js\";\nimport type { InterfaceType } from \"./types.js\";\n\ntype Meta = { apiName: string; displayName?: string; description?: string };\ntype ApiNameOrInterfaceType = string | InterfaceType;\n\ntype Many = {\n apiName: string;\n from: InterfaceType;\n toMany: ApiNameOrInterfaceType;\n toOne?: never;\n displayName?: string;\n description?: string;\n required?: boolean;\n};\ntype One = {\n apiName: string;\n from: InterfaceType;\n toOne: ApiNameOrInterfaceType;\n toMany?: never;\n displayName?: string;\n description?: string;\n required?: boolean;\n};\n\nexport function defineInterfaceLinkConstraint(\n linkDef: One | Many,\n): void {\n const fromLinkMeta = getLinkMeta(linkDef);\n\n invariant(\n linkDef.from.links.find(a => a.metadata.apiName === fromLinkMeta.apiName)\n == null,\n `Link with apiName ${fromLinkMeta.apiName} already exists on ${linkDef.apiName}`,\n );\n\n linkDef.from.links.push({\n cardinality: linkDef.toMany ? \"MANY\" : \"SINGLE\",\n linkedEntityTypeId: getLinkedType(linkDef.toMany ?? linkDef.toOne),\n metadata: fromLinkMeta,\n required: linkDef.required ?? true,\n });\n}\n\nfunction getLinkedType(t: string | InterfaceType) {\n return {\n type: \"interfaceType\" as const,\n interfaceType: typeof t === \"string\" ? t : t.apiName,\n };\n}\n\nfunction getLinkMeta(meta: One | Many) {\n return typeof meta === \"string\"\n ? withDefaults({ apiName: namespace + meta })\n : withDefaults(meta);\n}\n\nfunction withDefaults(\n { apiName, description, displayName }: Meta,\n): Required<Meta> {\n return {\n apiName: namespace + apiName,\n displayName: displayName ?? apiName,\n description: description ?? displayName ?? apiName,\n };\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAOA,SAAS,MAAM,gBAAgB;AACtC,SAASC,SAAS,QAAQ,qBAAqB;AAyB/C,OAAO,SAASC,6BAA6BA,CAC3CC,OAAmB,EACb;EACN,MAAMC,YAAY,GAAGC,WAAW,CAACF,OAAO,CAAC;EAEzC,EACEA,OAAO,CAACG,IAAI,CAACC,KAAK,CAACC,IAAI,CAACC,CAAC,IAAIA,CAAC,CAACC,QAAQ,CAACC,OAAO,KAAKP,YAAY,CAACO,OAAO,CAAC,IACpE,IAAI,IAAAC,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAFXd,SAAS,QAGP,qBAAqBI,YAAY,CAACO,OAAO,sBAAsBR,OAAO,CAACQ,OAAO,EAAE,IAHlFX,SAAS;EAMTG,OAAO,CAACG,IAAI,CAACC,KAAK,CAACQ,IAAI,CAAC;IACtBC,WAAW,EAAEb,OAAO,CAACc,MAAM,GAAG,MAAM,GAAG,QAAQ;IAC/CC,kBAAkB,EAAEC,aAAa,CAAChB,OAAO,CAACc,MAAM,IAAId,OAAO,CAACiB,KAAK,CAAC;IAClEV,QAAQ,EAAEN,YAAY;IACtBiB,QAAQ,EAAElB,OAAO,CAACkB,QAAQ,IAAI;EAChC,CAAC,CAAC;AACJ;AAEA,SAASF,aAAaA,CAACG,CAAyB,EAAE;EAChD,OAAO;IACLC,IAAI,EAAE,eAAwB;IAC9BC,aAAa,EAAE,OAAOF,CAAC,KAAK,QAAQ,GAAGA,CAAC,GAAGA,CAAC,CAACX;EAC/C,CAAC;AACH;AAEA,SAASN,WAAWA,CAACoB,IAAgB,EAAE;EACrC,OAAO,OAAOA,IAAI,KAAK,QAAQ,GAC3BC,YAAY,CAAC;IAAEf,OAAO,EAAEV,SAAS,GAAGwB;EAAK,CAAC,CAAC,GAC3CC,YAAY,CAACD,IAAI,CAAC;AACxB;AAEA,SAASC,YAAYA,CACnB;EAAEf,OAAO;EAAEgB,WAAW;EAAEC;AAAkB,CAAC,EAC3B;EAChB,OAAO;IACLjB,OAAO,EAAEV,SAAS,GAAGU,OAAO;IAC5BiB,WAAW,EAAEA,WAAW,IAAIjB,OAAO;IACnCgB,WAAW,EAAEA,WAAW,IAAIC,WAAW,IAAIjB;EAC7C,CAAC;AACH","ignoreList":[]}
@@ -13,6 +13,7 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
+
16
17
  import invariant from "tiny-invariant";
17
18
  export function defineLink(from, opts) {
18
19
  const apiName = opts.one ?? opts.many;
@@ -1 +1 @@
1
- {"version":3,"file":"defineLink.js","names":["invariant","defineLink","from","opts","apiName","one","many","toApiName","reverse","to","linkTypes","process","env","NODE_ENV","data","objectType","cardinality","displayName","objectTypeApiName","status"],"sources":["defineLink.js"],"sourcesContent":["/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport invariant from \"tiny-invariant\";\nexport function defineLink(from, opts) {\n const apiName = opts.one ?? opts.many;\n const toApiName = opts.reverse.one ?? opts.reverse.many;\n const to = opts.to;\n invariant(from.linkTypes[apiName] == null, `Link with apiName ${apiName} already exists on ${from.data.objectType.apiName}`);\n invariant(from.linkTypes[toApiName] == null, `Link with apiName ${toApiName} already exists on ${to.data.objectType.apiName}`);\n from.linkTypes[apiName] = {\n cardinality: \"ONE\",\n displayName: apiName,\n objectTypeApiName: to.data.objectType.apiName,\n status: \"ACTIVE\",\n };\n to.linkTypes[toApiName] = {\n apiName: toApiName,\n cardinality: \"ONE\",\n displayName: apiName,\n objectTypeApiName: from.data.objectType.apiName,\n status: \"ACTIVE\",\n };\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAOA,SAAS,MAAM,gBAAgB;AACtC,OAAO,SAASC,UAAUA,CAACC,IAAI,EAAEC,IAAI,EAAE;EACnC,MAAMC,OAAO,GAAGD,IAAI,CAACE,GAAG,IAAIF,IAAI,CAACG,IAAI;EACrC,MAAMC,SAAS,GAAGJ,IAAI,CAACK,OAAO,CAACH,GAAG,IAAIF,IAAI,CAACK,OAAO,CAACF,IAAI;EACvD,MAAMG,EAAE,GAAGN,IAAI,CAACM,EAAE;EAClB,EAAUP,IAAI,CAACQ,SAAS,CAACN,OAAO,CAAC,IAAI,IAAI,IAAAO,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAAzCb,SAAS,QAAkC,qBAAqBI,OAAO,sBAAsBF,IAAI,CAACY,IAAI,CAACC,UAAU,CAACX,OAAO,EAAE,IAA3HJ,SAAS;EACT,EAAUE,IAAI,CAACQ,SAAS,CAACH,SAAS,CAAC,IAAI,IAAI,IAAAI,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAA3Cb,SAAS,QAAoC,qBAAqBO,SAAS,sBAAsBE,EAAE,CAACK,IAAI,CAACC,UAAU,CAACX,OAAO,EAAE,IAA7HJ,SAAS;EACTE,IAAI,CAACQ,SAAS,CAACN,OAAO,CAAC,GAAG;IACtBY,WAAW,EAAE,KAAK;IAClBC,WAAW,EAAEb,OAAO;IACpBc,iBAAiB,EAAET,EAAE,CAACK,IAAI,CAACC,UAAU,CAACX,OAAO;IAC7Ce,MAAM,EAAE;EACZ,CAAC;EACDV,EAAE,CAACC,SAAS,CAACH,SAAS,CAAC,GAAG;IACtBH,OAAO,EAAEG,SAAS;IAClBS,WAAW,EAAE,KAAK;IAClBC,WAAW,EAAEb,OAAO;IACpBc,iBAAiB,EAAEhB,IAAI,CAACY,IAAI,CAACC,UAAU,CAACX,OAAO;IAC/Ce,MAAM,EAAE;EACZ,CAAC;AACL","ignoreList":[]}
1
+ {"version":3,"file":"defineLink.js","names":["invariant","defineLink","from","opts","apiName","one","many","toApiName","reverse","to","linkTypes","process","env","NODE_ENV","data","objectType","cardinality","displayName","objectTypeApiName","status"],"sources":["defineLink.ts"],"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\nimport invariant from \"tiny-invariant\";\nimport type { ObjectType } from \"./defineObject.js\";\n\nexport function defineLink(\n from: ObjectType,\n opts: {\n many: string;\n to: ObjectType;\n reverse: { one: string };\n },\n): unknown;\nexport function defineLink(\n from: ObjectType,\n opts: {\n one: string;\n to: ObjectType;\n reverse: { one: string } | { many: string };\n },\n): unknown;\nexport function defineLink(\n from: ObjectType,\n opts: {\n one?: never;\n many: string;\n to: ObjectType;\n reverse: { one: string };\n } | {\n one: string;\n many?: never;\n to: ObjectType;\n reverse: { one: string } | { many: string; one?: never };\n },\n) {\n const apiName = opts.one ?? opts.many;\n const toApiName = opts.reverse.one ?? opts.reverse.many;\n const to = opts.to;\n\n invariant(\n from.linkTypes[apiName] == null,\n `Link with apiName ${apiName} already exists on ${from.data.objectType.apiName}`,\n );\n invariant(\n from.linkTypes[toApiName] == null,\n `Link with apiName ${toApiName} already exists on ${to.data.objectType.apiName}`,\n );\n\n from.linkTypes[apiName] = {\n cardinality: \"ONE\",\n displayName: apiName,\n objectTypeApiName: to.data.objectType.apiName,\n status: \"ACTIVE\",\n };\n\n to.linkTypes[toApiName] = {\n apiName: toApiName,\n cardinality: \"ONE\",\n displayName: apiName,\n objectTypeApiName: from.data.objectType.apiName,\n status: \"ACTIVE\",\n };\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAOA,SAAS,MAAM,gBAAgB;AAmBtC,OAAO,SAASC,UAAUA,CACxBC,IAAgB,EAChBC,IAUC,EACD;EACA,MAAMC,OAAO,GAAGD,IAAI,CAACE,GAAG,IAAIF,IAAI,CAACG,IAAI;EACrC,MAAMC,SAAS,GAAGJ,IAAI,CAACK,OAAO,CAACH,GAAG,IAAIF,IAAI,CAACK,OAAO,CAACF,IAAI;EACvD,MAAMG,EAAE,GAAGN,IAAI,CAACM,EAAE;EAElB,EACEP,IAAI,CAACQ,SAAS,CAACN,OAAO,CAAC,IAAI,IAAI,IAAAO,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBADjCb,SAAS,QAEP,qBAAqBI,OAAO,sBAAsBF,IAAI,CAACY,IAAI,CAACC,UAAU,CAACX,OAAO,EAAE,IAFlFJ,SAAS;EAIT,EACEE,IAAI,CAACQ,SAAS,CAACH,SAAS,CAAC,IAAI,IAAI,IAAAI,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBADnCb,SAAS,QAEP,qBAAqBO,SAAS,sBAAsBE,EAAE,CAACK,IAAI,CAACC,UAAU,CAACX,OAAO,EAAE,IAFlFJ,SAAS;EAKTE,IAAI,CAACQ,SAAS,CAACN,OAAO,CAAC,GAAG;IACxBY,WAAW,EAAE,KAAK;IAClBC,WAAW,EAAEb,OAAO;IACpBc,iBAAiB,EAAET,EAAE,CAACK,IAAI,CAACC,UAAU,CAACX,OAAO;IAC7Ce,MAAM,EAAE;EACV,CAAC;EAEDV,EAAE,CAACC,SAAS,CAACH,SAAS,CAAC,GAAG;IACxBH,OAAO,EAAEG,SAAS;IAClBS,WAAW,EAAE,KAAK;IAClBC,WAAW,EAAEb,OAAO;IACpBc,iBAAiB,EAAEhB,IAAI,CAACY,IAAI,CAACC,UAAU,CAACX,OAAO;IAC/Ce,MAAM,EAAE;EACV,CAAC;AACH","ignoreList":[]}
@@ -13,6 +13,7 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
+
16
17
  import invariant from "tiny-invariant";
17
18
  import { ontologyDefinition } from "./defineOntology.js";
18
19
  export function defineObject(apiName, opts) {
@@ -42,6 +43,7 @@ export function defineObject(apiName, opts) {
42
43
  },
43
44
  sharedPropertyTypeMapping: {}
44
45
  };
46
+
45
47
  // FIXME: don't return the raw value
46
48
  return {
47
49
  data: ontologyDefinition.objectTypes[apiName],
@@ -1 +1 @@
1
- {"version":3,"file":"defineObject.js","names":["invariant","ontologyDefinition","defineObject","apiName","opts","objectTypes","implementsInterfaces","implementsInterfaces2","linkTypes","objectType","primaryKey","displayName","pluralDisplayName","icon","color","name","type","properties","dataType","convertType","rid","status","titleProperty","sharedPropertyTypeMapping","data","t","multiplicity","subType","itemType","structFieldTypes","Object","entries","map","process","env","NODE_ENV"],"sources":["defineObject.js"],"sourcesContent":["/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport invariant from \"tiny-invariant\";\nimport { ontologyDefinition } from \"./defineOntology.js\";\nexport function defineObject(apiName, opts) {\n ontologyDefinition.objectTypes[apiName] = {\n implementsInterfaces: [],\n implementsInterfaces2: {},\n linkTypes: [],\n objectType: {\n apiName,\n primaryKey: opts.primaryKey.apiName,\n displayName: opts.displayName ?? apiName,\n pluralDisplayName: opts.pluralDisplayName ?? apiName,\n icon: {\n color: \"blue\",\n name: \"cube\",\n type: \"blueprint\",\n },\n properties: {\n [opts.primaryKey.apiName]: {\n dataType: convertType(opts.primaryKey),\n rid: \"rid\",\n },\n },\n rid: \"PLACEHOLDER\",\n status: \"ACTIVE\",\n titleProperty: opts.primaryKey.apiName,\n },\n sharedPropertyTypeMapping: {},\n };\n // FIXME: don't return the raw value\n return {\n data: ontologyDefinition.objectTypes[apiName],\n linkTypes: {},\n };\n}\nfunction convertType(t) {\n switch (true) {\n case t.multiplicity === true:\n return {\n type: \"array\",\n subType: convertType({ ...t, multiplicity: false }),\n };\n case t.type === \"stringTimeseries\":\n return {\n itemType: {\n type: \"string\",\n },\n type: \"timeseries\",\n };\n break;\n case t.type === \"numericTimeseries\":\n return {\n itemType: {\n type: \"double\",\n },\n type: \"timeseries\",\n };\n case t.type === \"sensorTimeseries\":\n return {\n type: \"timeseries\",\n };\n case t.type === \"datetime\":\n return {\n type: \"timestamp\",\n };\n case typeof t.type === \"object\": {\n return {\n type: \"struct\",\n structFieldTypes: Object.entries(t.type).map(([apiName, dataType]) => ({\n apiName,\n dataType: { type: dataType },\n })),\n };\n }\n default:\n return {\n type: t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,WAAW,CAAC;UAAE,GAAGM,CAAC;UAAEC,YAAY,EAAE;QAAM,CAAC;MACtD,CAAC;IACL,KAAKD,CAAC,CAACT,IAAI,KAAK,kBAAkB;MAC9B,OAAO;QACHY,QAAQ,EAAE;UACNZ,IAAI,EAAE;QACV,CAAC;QACDA,IAAI,EAAE;MACV,CAAC;MACD;IACJ,KAAKS,CAAC,CAACT,IAAI,KAAK,mBAAmB;MAC/B,OAAO;QACHY,QAAQ,EAAE;UACNZ,IAAI,EAAE;QACV,CAAC;QACDA,IAAI,EAAE;MACV,CAAC;IACL,KAAKS,CAAC,CAACT,IAAI,KAAK,kBAAkB;MAC9B,OAAO;QACHA,IAAI,EAAE;MACV,CAAC;IACL,KAAKS,CAAC,CAACT,IAAI,KAAK,UAAU;MACtB,OAAO;QACHA,IAAI,EAAE;MACV,CAAC;IACL,KAAK,OAAOS,CAAC,CAACT,IAAI,KAAK,QAAQ;MAAE;QAC7B,OAAO;UACHA,IAAI,EAAE,QAAQ;UACda,gBAAgB,EAAEC,MAAM,CAACC,OAAO,CAACN,CAAC,CAACT,IAAI,CAAC,CAACgB,GAAG,CAAC,CAAC,CAAC7B,OAAO,EAAEe,QAAQ,CAAC,MAAM;YACnEf,OAAO;YACPe,QAAQ,EAAE;cAAEF,IAAI,EAAEE;YAAS;UAC/B,CAAC,CAAC;QACN,CAAC;MACL;IACA;MACI,OAAO;QACHF,IAAI,EAAES,CAAC,CAACT;MACZ,CAAC;EACT;EACAiB,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAAAnC,SAAS,UAATA,SAAS;AACb","ignoreList":[]}
1
+ {"version":3,"file":"defineObject.js","names":["invariant","ontologyDefinition","defineObject","apiName","opts","objectTypes","implementsInterfaces","implementsInterfaces2","linkTypes","objectType","primaryKey","displayName","pluralDisplayName","icon","color","name","type","properties","dataType","convertType","rid","status","titleProperty","sharedPropertyTypeMapping","data","t","multiplicity","subType","itemType","structFieldTypes","Object","entries","map","process","env","NODE_ENV"],"sources":["defineObject.ts"],"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\nimport type * as api from \"@osdk/api\";\nimport type {\n ObjectPropertyType,\n ObjectTypeFullMetadata,\n PropertyV2,\n} from \"@osdk/internal.foundry.core\";\nimport invariant from \"tiny-invariant\";\nimport { ontologyDefinition } from \"./defineOntology.js\";\n\ntype Writeable<T> = {\n -readonly [P in keyof T]: T[P] extends ReadonlyArray<infer Q> ? Array<Q>\n : Writeable<T[P]>;\n};\n\nexport interface ObjectType {\n data: ObjectTypeFullMetadata;\n linkTypes: Record<string, {\n // hasMany: (apiName: string, t: ObjectType, {\n // reverse: {}\n // })\n }>;\n}\n\nexport function defineObject(\n apiName: string,\n opts: {\n displayName?: string;\n pluralDisplayName?: string;\n primaryKey: api.ObjectMetadata.Property & { apiName: string };\n properties?: Record<\n string,\n | api.WirePropertyTypes\n | api.ObjectMetadata.Property\n >;\n },\n): ObjectType {\n ontologyDefinition.objectTypes[apiName] = {\n implementsInterfaces: [],\n implementsInterfaces2: {},\n linkTypes: [],\n objectType: {\n apiName,\n primaryKey: opts.primaryKey.apiName,\n displayName: opts.displayName ?? apiName,\n pluralDisplayName: opts.pluralDisplayName ?? apiName,\n icon: {\n color: \"blue\",\n name: \"cube\",\n type: \"blueprint\",\n },\n\n properties: {\n [opts.primaryKey.apiName]: {\n dataType: convertType(opts.primaryKey),\n rid: \"rid\",\n },\n },\n rid: \"PLACEHOLDER\",\n status: \"ACTIVE\",\n titleProperty: opts.primaryKey.apiName,\n },\n sharedPropertyTypeMapping: {},\n };\n\n // FIXME: don't return the raw value\n return {\n data: ontologyDefinition.objectTypes[apiName],\n linkTypes: {},\n };\n}\n\nfunction convertType(\n t: api.ObjectMetadata.Property & {\n apiName: string;\n },\n): PropertyV2[\"dataType\"] {\n switch (true) {\n case t.multiplicity === true:\n return {\n type: \"array\",\n subType: convertType({ ...t, multiplicity: false }),\n };\n\n case t.type === \"stringTimeseries\":\n return {\n itemType: {\n type: \"string\",\n },\n type: \"timeseries\",\n };\n break;\n\n case t.type === \"numericTimeseries\":\n return {\n itemType: {\n type: \"double\",\n },\n type: \"timeseries\",\n };\n\n case t.type === \"sensorTimeseries\":\n return {\n type: \"timeseries\",\n };\n\n case t.type === \"datetime\":\n return {\n type: \"timestamp\",\n };\n case typeof t.type === \"object\": {\n return {\n type: \"struct\",\n structFieldTypes: Object.entries(t.type).map(([apiName, dataType]) => ({\n apiName,\n dataType: { type: dataType } as ObjectPropertyType,\n })),\n };\n }\n default:\n return {\n type: t.type,\n };\n }\n\n invariant(false);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAQA,OAAOA,SAAS,MAAM,gBAAgB;AACtC,SAASC,kBAAkB,QAAQ,qBAAqB;AAgBxD,OAAO,SAASC,YAAYA,CAC1BC,OAAe,EACfC,IASC,EACW;EACZH,kBAAkB,CAACI,WAAW,CAACF,OAAO,CAAC,GAAG;IACxCG,oBAAoB,EAAE,EAAE;IACxBC,qBAAqB,EAAE,CAAC,CAAC;IACzBC,SAAS,EAAE,EAAE;IACbC,UAAU,EAAE;MACVN,OAAO;MACPO,UAAU,EAAEN,IAAI,CAACM,UAAU,CAACP,OAAO;MACnCQ,WAAW,EAAEP,IAAI,CAACO,WAAW,IAAIR,OAAO;MACxCS,iBAAiB,EAAER,IAAI,CAACQ,iBAAiB,IAAIT,OAAO;MACpDU,IAAI,EAAE;QACJC,KAAK,EAAE,MAAM;QACbC,IAAI,EAAE,MAAM;QACZC,I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AAEC,MAAM,CAACC,OAAO,CAACN,CAAC,CAACT,IAAI,CAAC,CAACgB,GAAG,CAAC,CAAC,CAAC7B,OAAO,EAAEe,QAAQ,CAAC,MAAM;YACrEf,OAAO;YACPe,QAAQ,EAAE;cAAEF,IAAI,EAAEE;YAAS;UAC7B,CAAC,CAAC;QACJ,CAAC;MACH;IACA;MACE,OAAO;QACLF,IAAI,EAAES,CAAC,CAACT;MACV,CAAC;EACL;EAEAiB,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAAAnC,SAAS,UAATA,SAAS;AACX","ignoreList":[]}
@@ -13,8 +13,10 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
+
16
17
  /** @internal */
17
18
  export let ontologyDefinition;
19
+
18
20
  /** @internal */
19
21
  export let namespace;
20
22
  export async function defineOntology(ns, body) {
@@ -212,6 +214,7 @@ function convertType(type) {
212
214
  analyzerOverride: undefined,
213
215
  enableAsciiFolding: undefined,
214
216
  isLongText: false,
217
+ supportsEfficientLeadingWildcard: false,
215
218
  supportsExactMatching: true
216
219
  }
217
220
  };
@@ -225,6 +228,7 @@ function convertType(type) {
225
228
  return distributeTypeHelper(type);
226
229
  }
227
230
  }
231
+
228
232
  /**
229
233
  * Helper function to avoid duplication. Makes the types match properly with the correct
230
234
  * behavior without needing to switch on type.
@@ -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","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,CA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AU;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,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.ts"],"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\nimport type {\n OntologyIr,\n OntologyIrInterfaceType,\n OntologyIrInterfaceTypeBlockDataV2,\n OntologyIrSharedPropertyType,\n OntologyIrSharedPropertyTypeBlockDataV2,\n OntologyIrStructFieldType,\n OntologyIrType,\n OntologyIrValueTypeBlockData,\n OntologyIrValueTypeBlockDataEntry,\n} from \"@osdk/client.unstable\";\nimport type {\n InterfaceType,\n Ontology,\n PropertyTypeType,\n SharedPropertyType,\n} from \"./types.js\";\n\n/** @internal */\nexport let ontologyDefinition: Ontology;\n\n/** @internal */\nexport let namespace: string;\n\ntype OntologyAndValueTypeIrs = {\n ontology: OntologyIr;\n valueType: OntologyIrValueTypeBlockData;\n};\n\nexport async function defineOntology(\n ns: string,\n body: () => void | Promise<void>,\n): Promise<OntologyAndValueTypeIrs> {\n namespace = ns;\n ontologyDefinition = {\n actionTypes: {},\n objectTypes: {},\n queryTypes: {},\n interfaceTypes: {},\n sharedPropertyTypes: {},\n valueTypes: {},\n importedTypes: {\n sharedPropertyTypes: [],\n },\n };\n\n try {\n await body();\n } catch (e) {\n // eslint-disable-next-line no-console\n console.error(\n \"Unexpected error while processing the body of the ontology\",\n e,\n );\n throw e;\n }\n\n return {\n ontology: convertToWireOntologyIr(ontologyDefinition),\n valueType: convertOntologyToValueTypeIr(ontologyDefinition),\n };\n}\n\nfunction convertOntologyToValueTypeIr(\n ontology: Ontology,\n): OntologyIrValueTypeBlockData {\n return {\n valueTypes: Object.values(ontology.valueTypes).map<\n OntologyIrValueTypeBlockDataEntry\n >(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}\n\nfunction convertToWireOntologyIr(\n ontology: Ontology,\n): OntologyIr {\n return {\n blockData: {\n sharedPropertyTypes: Object.fromEntries(\n Object.entries(\n ontology.sharedPropertyTypes,\n )\n .map<[string, OntologyIrSharedPropertyTypeBlockDataV2]>((\n [apiName, spt],\n ) => [apiName, { sharedPropertyType: convertSpt(spt) }]),\n ),\n interfaceTypes: Object.fromEntries(\n Object.entries(\n ontology.interfaceTypes,\n )\n .map<[string, OntologyIrInterfaceTypeBlockDataV2]>(\n ([apiName, interfaceType]) => {\n return [apiName, {\n interfaceType: convertInterface(interfaceType),\n }];\n },\n ),\n ),\n blockPermissionInformation: {\n actionTypes: {},\n linkTypes: {},\n objectTypes: {},\n },\n },\n importedTypes: ontology.importedTypes,\n };\n}\n\nfunction convertInterface(\n interfaceType: InterfaceType,\n): OntologyIrInterfaceType {\n return {\n ...interfaceType,\n properties: Object.values(interfaceType.properties)\n .map<OntologyIrSharedPropertyType>((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}\n\nexport function dumpOntologyFullMetadata(): OntologyIr {\n return convertToWireOntologyIr(ontologyDefinition);\n}\n\nexport function dumpValueTypeWireType(): OntologyIrValueTypeBlockData {\n return convertOntologyToValueTypeIr(ontologyDefinition);\n}\n\nfunction convertSpt(\n {\n type,\n array,\n description,\n apiName,\n displayName,\n gothamMapping,\n typeClasses,\n valueType,\n }: SharedPropertyType,\n): OntologyIrSharedPropertyType {\n const dataConstraint:\n | OntologyIrSharedPropertyType[\"dataConstraints\"]\n | undefined = (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\" as const,\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}\n\nfunction convertType(\n type: PropertyTypeType,\n): OntologyIrType {\n switch (true) {\n case (typeof type === \"object\" && \"markingType\" in type):\n return {\n \"type\": \"marking\",\n marking: { markingType: type.markingType },\n };\n\n case (typeof type === \"object\" && \"structDefinition\" in type):\n const structFields: Array<OntologyIrStructFieldType> = new Array();\n for (const key in type.structDefinition) {\n const fieldTypeDefinition = type.structDefinition[key];\n let field: OntologyIrStructFieldType;\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 } 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 } else {\n field = {\n apiName: key,\n displayMetadata: { displayName: key, description: undefined },\n typeClasses: [],\n aliases: [],\n fieldType: convertType(fieldTypeDefinition),\n };\n }\n }\n\n structFields.push(field);\n }\n\n return {\n type: \"struct\",\n struct: { structFields },\n };\n\n case (type === \"geopoint\"):\n return { type: \"geohash\", geohash: {} };\n\n case (type === \"decimal\"):\n return { type, [type]: { precision: undefined, scale: undefined } };\n\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\n case (type === \"mediaReference\"):\n return {\n type: type,\n mediaReference: {},\n };\n\n default:\n // use helper function to distribute `type` properly\n return distributeTypeHelper(type);\n }\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<T extends string>(\n type: T,\n): T extends any ? { type: T } & { [K in T]: {} } : never {\n return { type, [type]: {} } as any; // 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;;AAoBA;AACA,OAAO,IAAIA,kBAA4B;;AAEvC;AACA,OAAO,IAAIC,SAAiB;AAO5B,OAAO,eAAeC,cAAcA,CAClCC,EAAU,EACVC,IAAgC,EACE;EAClCH,SAAS,GAAGE,EAAE;EACdH,kBAAkB,GAAG;IACnBK,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;MACbF,mBAAmB,EAAE;IACvB;EACF,CAAC;EAED,IAAI;IACF,MAAML,IAAI,CAAC,CAAC;EACd,CAAC,CAAC,OAAOQ,CAAC,EAAE;IACV;IACAC,OAAO,CAACC,KAAK,CACX,4DAA4D,EAC5DF,CACF,CAAC;IACD,MAAMA,CAAC;EACT;EAEA,OAAO;IACLG,QAAQ,EAAEC,uBAAuB,CAAChB,kBAAkB,CAAC;IACrDiB,SAAS,EAAEC,4BAA4B,CAAClB,kBAAkB;EAC5D,CAAC;AACH;AAEA,SAASkB,4BAA4BA,CACnCH,QAAkB,EACY;EAC9B,OAAO;IACLL,UAAU,EAAES,MAAM,CAACC,MAAM,CAACL,QAAQ,CAACL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;IAAEA,IAAI;IAAE,CAACA,IAAI,GAAG,CAAC;EAAE,CAAC,CAAQ,CAAC;AACtC","ignoreList":[]}
@@ -13,6 +13,7 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
+
16
17
  import invariant from "tiny-invariant";
17
18
  import { namespace, ontologyDefinition } from "./defineOntology.js";
18
19
  const defaultTypeClasses = [{
@@ -1 +1 @@
1
- {"version":3,"file":"defineSpt.js","names":["invariant","namespace","ontologyDefinition","defaultTypeClasses","kind","name","defineSharedPropertyType","opts","apiName","sharedPropertyTypes","undefined","process","env","NODE_ENV","displayName","typeClasses"],"sources":["defineSpt.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\";\nconst defaultTypeClasses = [{\n kind: \"render_hint\",\n name: \"SELECTABLE\",\n }, { kind: \"render_hint\", name: \"SORTABLE\" }];\nexport function defineSharedPropertyType(opts) {\n const apiName = namespace + opts.apiName;\n invariant(ontologyDefinition.sharedPropertyTypes[apiName] === undefined, `Shared property type ${apiName} already exists`);\n return ontologyDefinition.sharedPropertyTypes[apiName] = {\n ...opts,\n apiName,\n displayName: opts.displayName ?? opts.apiName, // This way the non-namespaced api name is the display name (maybe not ideal)\n typeClasses: opts.typeClasses ?? defaultTypeClasses,\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,MAAMC,kBAAkB,GAAG,CAAC;EACpBC,IAAI,EAAE,aAAa;EACnBC,IAAI,EAAE;AACV,CAAC,EAAE;EAAED,IAAI,EAAE,aAAa;EAAEC,IAAI,EAAE;AAAW,CAAC,CAAC;AACjD,OAAO,SAASC,wBAAwBA,CAACC,IAAI,EAAE;EAC3C,MAAMC,OAAO,GAAGP,SAAS,GAAGM,IAAI,CAACC,OAAO;EACxC,EAAUN,kBAAkB,CAACO,mBAAmB,CAACD,OAAO,CAAC,KAAKE,SAAS,IAAAC,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAAvEb,SAAS,QAAgE,wBAAwBQ,OAAO,iBAAiB,IAAzHR,SAAS;EACT,OAAOE,kBAAkB,CAACO,mBAAmB,CAACD,OAAO,CAAC,GAAG;IACrD,GAAGD,IAAI;IACPC,OAAO;IACPM,WAAW,EAAEP,IAAI,CAACO,WAAW,IAAIP,IAAI,CAACC,OAAO;IAAE;IAC/CO,WAAW,EAAER,IAAI,CAACQ,WAAW,IAAIZ;EACrC,CAAC;AACL","ignoreList":[]}
1
+ {"version":3,"file":"defineSpt.js","names":["invariant","namespace","ontologyDefinition","defaultTypeClasses","kind","name","defineSharedPropertyType","opts","apiName","sharedPropertyTypes","undefined","process","env","NODE_ENV","displayName","typeClasses"],"sources":["defineSpt.ts"],"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\nimport type {\n ApiNameValueTypeReference,\n SharedPropertyTypeGothamMapping,\n} from \"@osdk/client.unstable\";\nimport invariant from \"tiny-invariant\";\nimport { namespace, ontologyDefinition } from \"./defineOntology.js\";\nimport type { PropertyTypeType, SharedPropertyType } from \"./types.js\";\n\nconst defaultTypeClasses: SharedPropertyType[\"typeClasses\"] = [{\n kind: \"render_hint\",\n name: \"SELECTABLE\",\n}, { kind: \"render_hint\", name: \"SORTABLE\" }];\n\nexport function defineSharedPropertyType(\n opts: {\n apiName: string;\n type: PropertyTypeType;\n array?: boolean;\n description?: string;\n displayName?: string;\n valueType?: ApiNameValueTypeReference;\n typeClasses?: SharedPropertyType[\"typeClasses\"];\n gothamMapping?: SharedPropertyTypeGothamMapping;\n },\n): SharedPropertyType {\n const apiName = namespace + opts.apiName;\n invariant(\n ontologyDefinition.sharedPropertyTypes[apiName] === undefined,\n `Shared property type ${apiName} already exists`,\n );\n\n return ontologyDefinition.sharedPropertyTypes[apiName] = {\n ...opts,\n apiName,\n displayName: opts.displayName ?? opts.apiName, // This way the non-namespaced api name is the display name (maybe not ideal)\n typeClasses: opts.typeClasses ?? defaultTypeClasses,\n };\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAMA,OAAOA,SAAS,MAAM,gBAAgB;AACtC,SAASC,SAAS,EAAEC,kBAAkB,QAAQ,qBAAqB;AAGnE,MAAMC,kBAAqD,GAAG,CAAC;EAC7DC,IAAI,EAAE,aAAa;EACnBC,IAAI,EAAE;AACR,CAAC,EAAE;EAAED,IAAI,EAAE,aAAa;EAAEC,IAAI,EAAE;AAAW,CAAC,CAAC;AAE7C,OAAO,SAASC,wBAAwBA,CACtCC,IASC,EACmB;EACpB,MAAMC,OAAO,GAAGP,SAAS,GAAGM,IAAI,CAACC,OAAO;EACxC,EACEN,kBAAkB,CAACO,mBAAmB,CAACD,OAAO,CAAC,KAAKE,SAAS,IAAAC,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAD/Db,SAAS,QAEP,wBAAwBQ,OAAO,iBAAiB,IAFlDR,SAAS;EAKT,OAAOE,kBAAkB,CAACO,mBAAmB,CAACD,OAAO,CAAC,GAAG;IACvD,GAAGD,IAAI;IACPC,OAAO;IACPM,WAAW,EAAEP,IAAI,CAACO,WAAW,IAAIP,IAAI,CAACC,OAAO;IAAE;IAC/CO,WAAW,EAAER,IAAI,CAACQ,WAAW,IAAIZ;EACnC,CAAC;AACH","ignoreList":[]}
@@ -13,6 +13,7 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
+
16
17
  import invariant from "tiny-invariant";
17
18
  import { ontologyDefinition } from "./defineOntology.js";
18
19
  function convertValueTypeTypeToBaseType(valueType) {
@@ -1 +1 @@
1
- {"version":3,"file":"defineValueType.js","names":["invariant","ontologyDefinition","convertValueTypeTypeToBaseType","valueType","type","array","elementType","structV2","fields","map","field","identifier","baseType","keyType","optional","wrappedType","Error","defineValueType","opts","apiName","displayName","description","version","test","process","env","NODE_ENV","typeName","constraints","constraint","output","failureMessage","vt","displayMetadata","status","active","exampleValues","valueTypes","undefined","push"],"sources":["defineValueType.js"],"sourcesContent":["/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport invariant from \"tiny-invariant\";\nimport { ontologyDefinition } from \"./defineOntology.js\";\nfunction convertValueTypeTypeToBaseType(valueType) {\n if (typeof valueType === \"string\") {\n }\n switch (true) {\n case (typeof valueType === \"object\" && valueType.type === \"array\"):\n return {\n type: \"array\",\n array: {\n elementType: convertValueTypeTypeToBaseType(valueType.elementType),\n },\n };\n case (typeof valueType === \"object\" && valueType.type === \"struct\"):\n return {\n type: \"structV2\",\n structV2: {\n fields: valueType.fields.map(field => ({\n identifier: field.identifier,\n baseType: convertValueTypeTypeToBaseType(field.baseType),\n })),\n },\n };\n case (typeof valueType === \"object\" && valueType.type === \"map\"):\n return {\n type: \"map\",\n map: {\n keyType: convertValueTypeTypeToBaseType(valueType.keyType),\n valueType: convertValueTypeTypeToBaseType(valueType.valueType),\n },\n };\n case (typeof valueType === \"object\" && valueType.type === \"optional\"):\n return {\n type: \"optional\",\n optional: {\n wrappedType: convertValueTypeTypeToBaseType(valueType.wrappedType),\n },\n };\n case (typeof valueType === \"string\"):\n return { type: valueType, [valueType]: {} };\n default:\n throw new Error(\"Invalid ValueTypeType\");\n }\n}\nexport function defineValueType(opts) {\n const { apiName, displayName, description, type, version } = opts;\n const semverValidation = /^((([0-9]+)\\.([0-9]+)\\.([0-9]+)(?:-([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?)(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?)$/;\n invariant(semverValidation.test(version), \"Version is not a valid semver\");\n const typeName = typeof type.type === \"string\"\n ? type.type\n : type.type.type === \"struct\"\n ? \"structV2\"\n : type.type.type;\n // These suck but TS doesn't understand the relationship from the key of the base type to the type string\n const constraints = type.constraints\n ? type.constraints.map(constraint => {\n const output = {\n constraint: { type: typeName, [typeName]: constraint.constraint },\n failureMessage: constraint.failureMessage,\n };\n return { constraint: output };\n })\n : [];\n const baseType = convertValueTypeTypeToBaseType(type.type);\n const vt = {\n apiName,\n displayMetadata: {\n displayName: displayName,\n description: description ?? \"\",\n },\n status: { type: \"active\", active: {} },\n version: version,\n baseType: baseType,\n constraints: constraints,\n exampleValues: [],\n };\n if (ontologyDefinition.valueTypes[apiName] === undefined) {\n ontologyDefinition.valueTypes[apiName] = [];\n }\n ontologyDefinition.valueTypes[apiName].push(vt);\n return vt;\n}\n"],"mappings":"A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E;MAAE9B,IAAI,EAAE,QAAQ;MAAE+B,MAAM,EAAE,CAAC;IAAE,CAAC;IACtCb,OAAO,EAAEA,OAAO;IAChBV,QAAQ,EAAEA,QAAQ;IAClBgB,WAAW,EAAEA,WAAW;IACxBQ,aAAa,EAAE;EACnB,CAAC;EACD,IAAInC,kBAAkB,CAACoC,UAAU,CAAClB,OAAO,CAAC,KAAKmB,SAAS,EAAE;IACtDrC,kBAAkB,CAACoC,UAAU,CAAClB,OAAO,CAAC,GAAG,EAAE;EAC/C;EACAlB,kBAAkB,CAACoC,UAAU,CAAClB,OAAO,CAAC,CAACoB,IAAI,CAACP,EAAE,CAAC;EAC/C,OAAOA,EAAE;AACb","ignoreList":[]}
1
+ {"version":3,"file":"defineValueType.js","names":["invariant","ontologyDefinition","convertValueTypeTypeToBaseType","valueType","type","array","elementType","structV2","fields","map","field","identifier","baseType","keyType","optional","wrappedType","Error","defineValueType","opts","apiName","displayName","description","version","test","process","env","NODE_ENV","typeName","constraints","constraint","output","failureMessage","vt","displayMetadata","status","active","exampleValues","valueTypes","undefined","push"],"sources":["defineValueType.ts"],"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\nimport type {\n BaseType,\n DataConstraint,\n DataConstraintWrapper,\n FailureMessage,\n ValueTypeDataConstraint,\n} from \"@osdk/client.unstable\";\nimport invariant from \"tiny-invariant\";\nimport { ontologyDefinition } from \"./defineOntology.js\";\nimport type { ValueTypeDefinitionVersion, ValueTypeType } from \"./types.js\";\n\ntype ZipBaseAndConstraint<Base, Constraint> = {\n [PropertyType in (BaseType[\"type\"] & DataConstraint[\"type\"])]: Base extends\n { type: PropertyType } ? {\n baseType: Omit<Base, \"type\">;\n constraints?: Constraint extends { type: PropertyType } ? {\n constraint: Omit<Constraint, \"type\">;\n failureMessage?: FailureMessage;\n }[]\n : undefined;\n }\n : never;\n};\n\ntype MappedZip = ZipBaseAndConstraint<BaseType, DataConstraint>;\n\ntype TypeNames = ValueTypeType[\"type\"];\n\ntype ValueTypeDefinitionBacking = {\n [Type in ValueTypeType[\"type\"] & DataConstraint[\"type\"]]: {\n baseType: { \"type\": Extract<ValueTypeType, { type: Type }>[\"value\"] } & {\n constraints: {\n constraint: Extract<\n DataConstraint,\n { type: Type }\n >[keyof Omit<Extract<DataConstraint, { type: Type }>, \"type\">];\n failureMessage?: FailureMessage;\n }[];\n };\n };\n};\n\ntype NewValueTypeDefinitionBacking = {\n [Type in ValueTypeType as Type[\"type\"]]: {\n type: Type[\"value\"];\n constraints?: Type[\"constraints\"];\n };\n};\ntype NewValueTypeDefinition =\n NewValueTypeDefinitionBacking[keyof NewValueTypeDefinitionBacking];\n\nfunction convertValueTypeTypeToBaseType(\n valueType: ValueTypeType[\"value\"],\n): BaseType {\n if (typeof valueType === \"string\") {\n }\n switch (true) {\n case (typeof valueType === \"object\" && valueType.type === \"array\"):\n return {\n type: \"array\",\n array: {\n elementType: convertValueTypeTypeToBaseType(valueType.elementType),\n },\n };\n case (typeof valueType === \"object\" && valueType.type === \"struct\"):\n return {\n type: \"structV2\",\n structV2: {\n fields: valueType.fields.map(field => ({\n identifier: field.identifier,\n baseType: convertValueTypeTypeToBaseType(field.baseType),\n })),\n },\n };\n case (typeof valueType === \"object\" && valueType.type === \"map\"):\n return {\n type: \"map\",\n map: {\n keyType: convertValueTypeTypeToBaseType(valueType.keyType),\n valueType: convertValueTypeTypeToBaseType(valueType.valueType),\n },\n };\n case (typeof valueType === \"object\" && valueType.type === \"optional\"):\n return {\n type: \"optional\",\n optional: {\n wrappedType: convertValueTypeTypeToBaseType(valueType.wrappedType),\n },\n };\n case (typeof valueType === \"string\"):\n return { type: valueType, [valueType]: {} } as any;\n default:\n throw new Error(\"Invalid ValueTypeType\");\n }\n}\n\nexport function defineValueType(\n opts: {\n apiName: string;\n displayName: string;\n description?: string;\n type: NewValueTypeDefinition;\n version: string;\n },\n): ValueTypeDefinitionVersion {\n const { apiName, displayName, description, type, version } = opts;\n const semverValidation =\n /^((([0-9]+)\\.([0-9]+)\\.([0-9]+)(?:-([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?)(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?)$/;\n invariant(semverValidation.test(version), \"Version is not a valid semver\");\n\n const typeName: TypeNames = typeof type.type === \"string\"\n ? type.type\n : type.type.type === \"struct\"\n ? \"structV2\"\n : type.type.type;\n // These suck but TS doesn't understand the relationship from the key of the base type to the type string\n const constraints = type.constraints\n ? type.constraints.map<ValueTypeDataConstraint>(constraint => {\n const output: any = {\n constraint: { type: typeName, [typeName]: constraint.constraint },\n failureMessage: constraint.failureMessage,\n };\n return { constraint: output as DataConstraintWrapper };\n })\n : [];\n\n const baseType: BaseType = convertValueTypeTypeToBaseType(type.type);\n\n const vt: ValueTypeDefinitionVersion = {\n apiName,\n displayMetadata: {\n displayName: displayName,\n description: description ?? \"\",\n },\n status: { type: \"active\", active: {} },\n version: version,\n baseType: baseType,\n constraints: constraints,\n exampleValues: [],\n };\n if (ontologyDefinition.valueTypes[apiName] === undefined) {\n ontologyDefinition.valueTypes[apiName] = [];\n }\n ontologyDefinition.valueTypes[apiName].push(vt);\n return vt;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AASA,OAAOA,SAAS,MAAM,gBAAgB;AACtC,SAASC,kBAAkB,QAAQ,qBAAqB;AA2CxD,SAASC,8BAA8BA,CACrCC,SAAiC,EACvB;EACV,IAAI,OAAOA,SAAS,KAAK,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B,CAACoC,UAAU,CAAClB,OAAO,CAAC,KAAKmB,SAAS,EAAE;IACxDrC,kBAAkB,CAACoC,UAAU,CAAClB,OAAO,CAAC,GAAG,EAAE;EAC7C;EACAlB,kBAAkB,CAACoC,UAAU,CAAClB,OAAO,CAAC,CAACoB,IAAI,CAACP,EAAE,CAAC;EAC/C,OAAOA,EAAE;AACX","ignoreList":[]}
@@ -1,17 +1,2 @@
1
- /*
2
- * Copyright 2024 Palantir Technologies, Inc. All rights reserved.
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
1
  export {};
17
2
  //# sourceMappingURL=iconNames.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"iconNames.js","names":[],"sources":["iconNames.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 */\nexport {};\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","ignoreList":[]}
1
+ {"version":3,"file":"iconNames.js","names":[],"sources":["iconNames.ts"],"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\n// This copy paste is bad but fine for now\nexport type BlueprintIcon =\n | \"add-clip\"\n | \"add-column-left\"\n | \"add-column-right\"\n | \"add-location\"\n | \"add-row-bottom\"\n | \"add-row-top\"\n | \"add-to-artifact\"\n | \"add-to-folder\"\n | \"add\"\n | \"aimpoints-target\"\n | \"airplane\"\n | \"align-center\"\n | \"align-justify\"\n | \"align-left\"\n | \"align-right\"\n | \"alignment-bottom\"\n | \"alignment-horizontal-center\"\n | \"alignment-left\"\n | \"alignment-right\"\n | \"alignment-top\"\n | \"alignment-vertical-center\"\n | \"ammunition\"\n | \"anchor\"\n | \"annotation\"\n | \"antenna\"\n | \"app-header\"\n | \"application\"\n | \"applications\"\n | \"archive\"\n | \"area-of-interest\"\n | \"array-boolean\"\n | \"array-date\"\n | \"array-floating-point\"\n | \"array-numeric\"\n | \"array-string\"\n | \"array-timestamp\"\n | \"array\"\n | \"arrow-bottom-left\"\n | \"arrow-bottom-right\"\n | \"arrow-down\"\n | \"arrow-left\"\n | \"arrow-right\"\n | \"arrow-top-left\"\n | \"arrow-top-right\"\n | \"arrow-up\"\n | \"arrows-horizontal\"\n | \"arrows-vertical\"\n | \"asterisk\"\n | \"at\"\n | \"automatic-updates\"\n | \"axle\"\n | \"backlink\"\n | \"backward-ten\"\n | \"badge\"\n | \"ban-circle\"\n | \"bank-account\"\n | \"barcode\"\n | \"binary-number\"\n | \"blank\"\n | \"blocked-person\"\n | \"bold\"\n | \"book\"\n | \"bookmark\"\n | \"box\"\n | \"briefcase\"\n | \"bring-data\"\n | \"bring-forward\"\n | \"bug\"\n | \"buggy\"\n | \"build\"\n | \"bullseye\"\n | \"calculator\"\n | \"calendar\"\n | \"camera\"\n | \"caret-down\"\n | \"caret-left\"\n | \"caret-right\"\n | \"caret-up\"\n | \"cargo-ship\"\n | \"cell-tower\"\n | \"changes\"\n | \"chart\"\n | \"chat\"\n | \"chevron-backward\"\n | \"chevron-down\"\n | \"chevron-forward\"\n | \"chevron-left\"\n | \"chevron-right\"\n | \"chevron-up\"\n | \"circle-arrow-down\"\n | \"circle-arrow-left\"\n | \"circle-arrow-right\"\n | \"circle-arrow-up\"\n | \"circle\"\n | \"citation\"\n | \"clean\"\n | \"clip\"\n | \"clipboard-file\"\n | \"clipboard\"\n | \"cloud-download\"\n | \"cloud-server\"\n | \"cloud-tick\"\n | \"cloud-upload\"\n | \"cloud\"\n | \"code-block\"\n | \"code\"\n | \"cog\"\n | \"collapse-all\"\n | \"color-fill\"\n | \"column-layout\"\n | \"comment\"\n | \"comparison\"\n | \"compass\"\n | \"compressed\"\n | \"confirm\"\n | \"console\"\n | \"contrast\"\n | \"control\"\n | \"credit-card\"\n | \"crop\"\n | \"cross-circle\"\n | \"cross\"\n | \"crown\"\n | \"css-style\"\n | \"cube-add\"\n | \"cube-remove\"\n | \"cube\"\n | \"curly-braces\"\n | \"curved-range-chart\"\n | \"cut\"\n | \"cycle\"\n | \"dashboard\"\n | \"data-connection\"\n | \"data-lineage\"\n | \"data-search\"\n | \"data-sync\"\n | \"database\"\n | \"delete\"\n | \"delta\"\n | \"derive-column\"\n | \"desktop\"\n | \"detection\"\n | \"diagnosis\"\n | \"diagram-tree\"\n | \"direction-left\"\n | \"direction-right\"\n | \"disable\"\n | \"divide\"\n | \"document-open\"\n | \"document-share\"\n | \"document\"\n | \"dollar\"\n | \"dot\"\n | \"double-caret-horizontal\"\n | \"double-caret-vertical\"\n | \"double-chevron-down\"\n | \"double-chevron-left\"\n | \"double-chevron-right\"\n | \"double-chevron-up\"\n | \"doughnut-chart\"\n | \"download\"\n | \"drag-handle-horizontal\"\n | \"drag-handle-vertical\"\n | \"draw\"\n | \"drawer-left-filled\"\n | \"drawer-left\"\n | \"drawer-right-filled\"\n | \"drawer-right\"\n | \"drive-time\"\n | \"duplicate\"\n | \"edit\"\n | \"eject\"\n | \"emoji\"\n | \"endnote\"\n | \"endorsed\"\n | \"envelope\"\n | \"equals\"\n | \"eraser\"\n | \"error\"\n | \"euro\"\n | \"excavator\"\n | \"exchange\"\n | \"exclude-row\"\n | \"expand-all\"\n | \"explain\"\n | \"export\"\n | \"eye-off\"\n | \"eye-on\"\n | \"eye-open\"\n | \"fast-backward\"\n | \"fast-forward\"\n | \"feed-subscribed\"\n | \"feed\"\n | \"film\"\n | \"filter-keep\"\n | \"filter-list\"\n | \"filter-open\"\n | \"filter-remove\"\n | \"filter\"\n | \"flag\"\n | \"flame\"\n | \"flash\"\n | \"floating-point\"\n | \"floppy-disk\"\n | \"flow-branch\"\n | \"flow-end\"\n | \"flow-linear\"\n | \"flow-review-branch\"\n | \"flow-review\"\n | \"flows\"\n | \"folder-close\"\n | \"folder-new\"\n | \"folder-open\"\n | \"folder-shared-open\"\n | \"folder-shared\"\n | \"follower\"\n | \"following\"\n | \"font\"\n | \"fork\"\n | \"form\"\n | \"forward-ten\"\n | \"fuel\"\n | \"full-circle\"\n | \"full-stacked-chart\"\n | \"fullscreen\"\n | \"function\"\n | \"gantt-chart\"\n | \"generate\"\n | \"geofence\"\n | \"geolocation\"\n | \"geosearch\"\n | \"geotime\"\n | \"git-branch\"\n | \"git-commit\"\n | \"git-merge\"\n | \"git-new-branch\"\n | \"git-pull\"\n | \"git-push\"\n | \"git-repo\"\n | \"glass\"\n | \"globe-network\"\n | \"globe\"\n | \"graph-remove\"\n | \"graph\"\n | \"greater-than-or-equal-to\"\n | \"greater-than\"\n | \"grid-view\"\n | \"grid\"\n | \"group-item\"\n | \"group-objects\"\n | \"grouped-bar-chart\"\n | \"hand-down\"\n | \"hand-left\"\n | \"hand-right\"\n | \"hand-up\"\n | \"hand\"\n | \"hat\"\n | \"header-one\"\n | \"header-three\"\n | \"header-two\"\n | \"header\"\n | \"headset\"\n | \"heart-broken\"\n | \"heart\"\n | \"heat-grid\"\n | \"heatmap\"\n | \"helicopter\"\n | \"help\"\n | \"helper-management\"\n | \"high-priority\"\n | \"high-voltage-pole\"\n | \"highlight\"\n | \"history\"\n | \"home\"\n | \"horizontal-bar-chart-asc\"\n | \"horizontal-bar-chart-desc\"\n | \"horizontal-bar-chart\"\n | \"horizontal-distribution\"\n | \"horizontal-inbetween\"\n | \"hurricane\"\n | \"id-number\"\n | \"image-rotate-left\"\n | \"image-rotate-right\"\n | \"import\"\n | \"inbox-filtered\"\n | \"inbox-geo\"\n | \"inbox-search\"\n | \"inbox-update\"\n | \"inbox\"\n | \"info-sign\"\n | \"inheritance\"\n | \"inherited-group\"\n | \"inner-join\"\n | \"input\"\n | \"insert\"\n | \"intelligence\"\n | \"intersection\"\n | \"ip-address\"\n | \"issue-closed\"\n | \"issue-new\"\n | \"issue\"\n | \"italic\"\n | \"join-table\"\n | \"key-backspace\"\n | \"key-command\"\n | \"key-control\"\n | \"key-delete\"\n | \"key-enter\"\n | \"key-escape\"\n | \"key-option\"\n | \"key-shift\"\n | \"key-tab\"\n | \"key\"\n | \"known-vehicle\"\n | \"lab-test\"\n | \"label\"\n | \"layer-outline\"\n | \"layer\"\n | \"layers\"\n | \"layout-auto\"\n | \"layout-balloon\"\n | \"layout-bottom-row-three-tiles\"\n | \"layout-bottom-row-two-tiles\"\n | \"layout-circle\"\n | \"layout-grid\"\n | \"layout-group-by\"\n | \"layout-hierarchy\"\n | \"layout-left-column-three-tiles\"\n | \"layout-left-column-two-tiles\"\n | \"layout-linear\"\n | \"layout-right-column-three-tiles\"\n | \"layout-right-column-two-tiles\"\n | \"layout-skew-grid\"\n | \"layout-sorted-clusters\"\n | \"layout-three-columns\"\n | \"layout-three-rows\"\n | \"layout-top-row-three-tiles\"\n | \"layout-top-row-two-tiles\"\n | \"layout-two-columns\"\n | \"layout-two-rows\"\n | \"layout\"\n | \"learning\"\n | \"left-join\"\n | \"lengthen-text\"\n | \"less-than-or-equal-to\"\n | \"less-than\"\n | \"lifesaver\"\n | \"lightbulb\"\n | \"lightning\"\n | \"link\"\n | \"list-columns\"\n | \"list-detail-view\"\n | \"list\"\n | \"locate\"\n | \"lock\"\n | \"locomotive\"\n | \"log-in\"\n | \"log-out\"\n | \"low-voltage-pole\"\n | \"manual\"\n | \"manually-entered-data\"\n | \"many-to-many\"\n | \"many-to-one\"\n | \"map-create\"\n | \"map-marker\"\n | \"map\"\n | \"maximize\"\n | \"media\"\n | \"menu-closed\"\n | \"menu-open\"\n | \"menu\"\n | \"merge-columns\"\n | \"merge-links\"\n | \"microphone\"\n | \"minimize\"\n | \"minus\"\n | \"mobile-phone\"\n | \"mobile-video\"\n | \"modal-filled\"\n | \"modal\"\n | \"model\"\n | \"moon\"\n | \"more\"\n | \"mountain\"\n | \"move\"\n | \"mugshot\"\n | \"multi-select\"\n | \"music\"\n | \"nest\"\n | \"new-drawing\"\n | \"new-grid-item\"\n | \"new-layer\"\n | \"new-layers\"\n | \"new-link\"\n | \"new-object\"\n | \"new-person\"\n | \"new-prescription\"\n | \"new-shield\"\n | \"new-text-box\"\n | \"ninja\"\n | \"not-equal-to\"\n | \"notifications-snooze\"\n | \"notifications-updated\"\n | \"notifications\"\n | \"numbered-list\"\n | \"numerical\"\n | \"office\"\n | \"offline\"\n | \"oil-field\"\n | \"one-column\"\n | \"one-to-many\"\n | \"one-to-one\"\n | \"open-application\"\n | \"outdated\"\n | \"output\"\n | \"page-layout\"\n | \"panel-stats\"\n | \"panel-table\"\n | \"paperclip\"\n | \"paragraph\"\n | \"paste-variable\"\n | \"path-search\"\n | \"path\"\n | \"pause\"\n | \"people\"\n | \"percentage\"\n | \"person\"\n | \"phone-call\"\n | \"phone-forward\"\n | \"phone\"\n | \"pie-chart\"\n | \"pin\"\n | \"pivot-table\"\n | \"pivot\"\n | \"play\"\n | \"playbook\"\n | \"plus\"\n | \"polygon-filter\"\n | \"power\"\n | \"predictive-analysis\"\n | \"prescription\"\n | \"presentation\"\n | \"print\"\n | \"projects\"\n | \"properties\"\n | \"property\"\n | \"publish-function\"\n | \"pulse\"\n | \"rain\"\n | \"random\"\n | \"range-ring\"\n | \"record\"\n | \"rect-height\"\n | \"rect-width\"\n | \"rectangle\"\n | \"redo\"\n | \"refresh\"\n | \"regex\"\n | \"regression-chart\"\n | \"remove-column-left\"\n | \"remove-column-right\"\n | \"remove-column\"\n | \"remove-row-bottom\"\n | \"remove-row-top\"\n | \"remove\"\n | \"repeat\"\n | \"reset\"\n | \"resolve\"\n | \"rig\"\n | \"right-join\"\n | \"ring\"\n | \"rocket-slant\"\n | \"rocket\"\n | \"rotate-document\"\n | \"rotate-page\"\n | \"route\"\n | \"satellite\"\n | \"saved\"\n | \"scatter-plot\"\n | \"search-around\"\n | \"search-template\"\n | \"search-text\"\n | \"search\"\n | \"segmented-control\"\n | \"select\"\n | \"selection\"\n | \"send-backward\"\n | \"send-message\"\n | \"send-to-graph\"\n | \"send-to-map\"\n | \"send-to\"\n | \"sensor\"\n | \"series-add\"\n | \"series-configuration\"\n | \"series-derived\"\n | \"series-filtered\"\n | \"series-search\"\n | \"settings\"\n | \"shapes\"\n | \"share\"\n | \"shared-filter\"\n | \"shield\"\n | \"ship\"\n | \"shop\"\n | \"shopping-cart\"\n | \"shorten-text\"\n | \"signal-search\"\n | \"sim-card\"\n | \"slash\"\n | \"small-cross\"\n | \"small-info-sign\"\n | \"small-minus\"\n | \"small-plus\"\n | \"small-square\"\n | \"small-tick\"\n | \"snowflake\"\n | \"soccer-ball\"\n | \"social-media\"\n | \"sort-alphabetical-desc\"\n | \"sort-alphabetical\"\n | \"sort-asc\"\n | \"sort-desc\"\n | \"sort-numerical-desc\"\n | \"sort-numerical\"\n | \"sort\"\n | \"spell-check\"\n | \"split-columns\"\n | \"sports-stadium\"\n | \"square\"\n | \"stacked-chart\"\n | \"stadium-geometry\"\n | \"star-empty\"\n | \"star\"\n | \"step-backward\"\n | \"step-chart\"\n | \"step-forward\"\n | \"stop\"\n | \"stopwatch\"\n | \"strikethrough\"\n | \"style\"\n | \"subscript\"\n | \"superscript\"\n | \"swap-horizontal\"\n | \"swap-vertical\"\n | \"switch\"\n | \"symbol-circle\"\n | \"symbol-cross\"\n | \"symbol-diamond\"\n | \"symbol-rectangle\"\n | \"symbol-square\"\n | \"symbol-triangle-down\"\n | \"symbol-triangle-up\"\n | \"syringe\"\n | \"table-sync\"\n | \"tag\"\n | \"take-action\"\n | \"tank\"\n | \"target\"\n | \"taxi\"\n | \"team\"\n | \"temperature\"\n | \"text-highlight\"\n | \"th-derived\"\n | \"th-disconnect\"\n | \"th-filtered\"\n | \"th-list\"\n | \"th\"\n | \"third-party\"\n | \"thumbs-down\"\n | \"thumbs-up\"\n | \"tick-circle\"\n | \"tick\"\n | \"time\"\n | \"timeline-area-chart\"\n | \"timeline-bar-chart\"\n | \"timeline-events\"\n | \"timeline-line-chart\"\n | \"tint\"\n | \"torch\"\n | \"tractor\"\n | \"train\"\n | \"translate\"\n | \"trash\"\n | \"tree\"\n | \"trending-down\"\n | \"trending-up\"\n | \"trophy\"\n | \"truck\"\n | \"two-columns\"\n | \"unarchive\"\n | \"underline\"\n | \"undo\"\n | \"ungroup-objects\"\n | \"unknown-vehicle\"\n | \"unlink\"\n | \"unlock\"\n | \"unpin\"\n | \"unresolve\"\n | \"updated\"\n | \"upload\"\n | \"user\"\n | \"variable\"\n | \"vector\"\n | \"vertical-bar-chart-asc\"\n | \"vertical-bar-chart-desc\"\n | \"vertical-distribution\"\n | \"vertical-inbetween\"\n | \"video\"\n | \"virus\"\n | \"volume-down\"\n | \"volume-off\"\n | \"volume-up\"\n | \"walk\"\n | \"warning-sign\"\n | \"waterfall-chart\"\n | \"waves\"\n | \"widget-button\"\n | \"widget-footer\"\n | \"widget-header\"\n | \"widget\"\n | \"wind\"\n | \"wrench\"\n | \"zoom-in\"\n | \"zoom-out\"\n | \"zoom-to-fit\";\n\nexport type BlueprintIcons_16Key =\n | \"AddClip\"\n | \"AddColumnLeft\"\n | \"AddColumnRight\"\n | \"AddLocation\"\n | \"AddRowBottom\"\n | \"AddRowTop\"\n | \"AddToArtifact\"\n | \"AddToFolder\"\n | \"Add\"\n | \"AimpointsTarget\"\n | \"Airplane\"\n | \"AlignCenter\"\n | \"AlignJustify\"\n | \"AlignLeft\"\n | \"AlignRight\"\n | \"AlignmentBottom\"\n | \"AlignmentHorizontalCenter\"\n | \"AlignmentLeft\"\n | \"AlignmentRight\"\n | \"AlignmentTop\"\n | \"AlignmentVerticalCenter\"\n | \"Ammunition\"\n | \"Anchor\"\n | \"Annotation\"\n | \"Antenna\"\n | \"AppHeader\"\n | \"Application\"\n | \"Applications\"\n | \"Archive\"\n | \"AreaOfInterest\"\n | \"ArrayBoolean\"\n | \"ArrayDate\"\n | \"ArrayFloatingPoint\"\n | \"ArrayNumeric\"\n | \"ArrayString\"\n | \"ArrayTimestamp\"\n | \"Array\"\n | \"ArrowBottomLeft\"\n | \"ArrowBottomRight\"\n | \"ArrowDown\"\n | \"ArrowLeft\"\n | \"ArrowRight\"\n | \"ArrowTopLeft\"\n | \"ArrowTopRight\"\n | \"ArrowUp\"\n | \"ArrowsHorizontal\"\n | \"ArrowsVertical\"\n | \"Asterisk\"\n | \"At\"\n | \"AutomaticUpdates\"\n | \"Axle\"\n | \"Backlink\"\n | \"BackwardTen\"\n | \"Badge\"\n | \"BanCircle\"\n | \"BankAccount\"\n | \"Barcode\"\n | \"BinaryNumber\"\n | \"Blank\"\n | \"BlockedPerson\"\n | \"Bold\"\n | \"Book\"\n | \"Bookmark\"\n | \"Box\"\n | \"Briefcase\"\n | \"BringData\"\n | \"BringForward\"\n | \"Bug\"\n | \"Buggy\"\n | \"Build\"\n | \"Bullseye\"\n | \"Calculator\"\n | \"Calendar\"\n | \"Camera\"\n | \"CaretDown\"\n | \"CaretLeft\"\n | \"CaretRight\"\n | \"CaretUp\"\n | \"CargoShip\"\n | \"CellTower\"\n | \"Changes\"\n | \"Chart\"\n | \"Chat\"\n | \"ChevronBackward\"\n | \"ChevronDown\"\n | \"ChevronForward\"\n | \"ChevronLeft\"\n | \"ChevronRight\"\n | \"ChevronUp\"\n | \"CircleArrowDown\"\n | \"CircleArrowLeft\"\n | \"CircleArrowRight\"\n | \"CircleArrowUp\"\n | \"Circle\"\n | \"Citation\"\n | \"Clean\"\n | \"Clip\"\n | \"ClipboardFile\"\n | \"Clipboard\"\n | \"CloudDownload\"\n | \"CloudServer\"\n | \"CloudTick\"\n | \"CloudUpload\"\n | \"Cloud\"\n | \"CodeBlock\"\n | \"Code\"\n | \"Cog\"\n | \"CollapseAll\"\n | \"ColorFill\"\n | \"ColumnLayout\"\n | \"Comment\"\n | \"Comparison\"\n | \"Compass\"\n | \"Compressed\"\n | \"Confirm\"\n | \"Console\"\n | \"Contrast\"\n | \"Control\"\n | \"CreditCard\"\n | \"Crop\"\n | \"CrossCircle\"\n | \"Cross\"\n | \"Crown\"\n | \"CssStyle\"\n | \"CubeAdd\"\n | \"CubeRemove\"\n | \"Cube\"\n | \"CurlyBraces\"\n | \"CurvedRangeChart\"\n | \"Cut\"\n | \"Cycle\"\n | \"Dashboard\"\n | \"DataConnection\"\n | \"DataLineage\"\n | \"DataSearch\"\n | \"DataSync\"\n | \"Database\"\n | \"Delete\"\n | \"Delta\"\n | \"DeriveColumn\"\n | \"Desktop\"\n | \"Detection\"\n | \"Diagnosis\"\n | \"DiagramTree\"\n | \"DirectionLeft\"\n | \"DirectionRight\"\n | \"Disable\"\n | \"Divide\"\n | \"DocumentOpen\"\n | \"DocumentShare\"\n | \"Document\"\n | \"Dollar\"\n | \"Dot\"\n | \"DoubleCaretHorizontal\"\n | \"DoubleCaretVertical\"\n | \"DoubleChevronDown\"\n | \"DoubleChevronLeft\"\n | \"DoubleChevronRight\"\n | \"DoubleChevronUp\"\n | \"DoughnutChart\"\n | \"Download\"\n | \"DragHandleHorizontal\"\n | \"DragHandleVertical\"\n | \"Draw\"\n | \"DrawerLeftFilled\"\n | \"DrawerLeft\"\n | \"DrawerRightFilled\"\n | \"DrawerRight\"\n | \"DriveTime\"\n | \"Duplicate\"\n | \"Edit\"\n | \"Eject\"\n | \"Emoji\"\n | \"Endnote\"\n | \"Endorsed\"\n | \"Envelope\"\n | \"Equals\"\n | \"Eraser\"\n | \"Error\"\n | \"Euro\"\n | \"Excavator\"\n | \"Exchange\"\n | \"ExcludeRow\"\n | \"ExpandAll\"\n | \"Explain\"\n | \"Export\"\n | \"EyeOff\"\n | \"EyeOn\"\n | \"EyeOpen\"\n | \"FastBackward\"\n | \"FastForward\"\n | \"FeedSubscribed\"\n | \"Feed\"\n | \"Film\"\n | \"FilterKeep\"\n | \"FilterList\"\n | \"FilterOpen\"\n | \"FilterRemove\"\n | \"Filter\"\n | \"Flag\"\n | \"Flame\"\n | \"Flash\"\n | \"FloatingPoint\"\n | \"FloppyDisk\"\n | \"FlowBranch\"\n | \"FlowEnd\"\n | \"FlowLinear\"\n | \"FlowReviewBranch\"\n | \"FlowReview\"\n | \"Flows\"\n | \"FolderClose\"\n | \"FolderNew\"\n | \"FolderOpen\"\n | \"FolderSharedOpen\"\n | \"FolderShared\"\n | \"Follower\"\n | \"Following\"\n | \"Font\"\n | \"Fork\"\n | \"Form\"\n | \"ForwardTen\"\n | \"Fuel\"\n | \"FullCircle\"\n | \"FullStackedChart\"\n | \"Fullscreen\"\n | \"Function\"\n | \"GanttChart\"\n | \"Generate\"\n | \"Geofence\"\n | \"Geolocation\"\n | \"Geosearch\"\n | \"Geotime\"\n | \"GitBranch\"\n | \"GitCommit\"\n | \"GitMerge\"\n | \"GitNewBranch\"\n | \"GitPull\"\n | \"GitPush\"\n | \"GitRepo\"\n | \"Glass\"\n | \"GlobeNetwork\"\n | \"Globe\"\n | \"GraphRemove\"\n | \"Graph\"\n | \"GreaterThanOrEqualTo\"\n | \"GreaterThan\"\n | \"GridView\"\n | \"Grid\"\n | \"GroupItem\"\n | \"GroupObjects\"\n | \"GroupedBarChart\"\n | \"HandDown\"\n | \"HandLeft\"\n | \"HandRight\"\n | \"HandUp\"\n | \"Hand\"\n | \"Hat\"\n | \"HeaderOne\"\n | \"HeaderThree\"\n | \"HeaderTwo\"\n | \"Header\"\n | \"Headset\"\n | \"HeartBroken\"\n | \"Heart\"\n | \"HeatGrid\"\n | \"Heatmap\"\n | \"Helicopter\"\n | \"Help\"\n | \"HelperManagement\"\n | \"HighPriority\"\n | \"HighVoltagePole\"\n | \"Highlight\"\n | \"History\"\n | \"Home\"\n | \"HorizontalBarChartAsc\"\n | \"HorizontalBarChartDesc\"\n | \"HorizontalBarChart\"\n | \"HorizontalDistribution\"\n | \"HorizontalInbetween\"\n | \"Hurricane\"\n | \"IdNumber\"\n | \"ImageRotateLeft\"\n | \"ImageRotateRight\"\n | \"Import\"\n | \"InboxFiltered\"\n | \"InboxGeo\"\n | \"InboxSearch\"\n | \"InboxUpdate\"\n | \"Inbox\"\n | \"InfoSign\"\n | \"Inheritance\"\n | \"InheritedGroup\"\n | \"InnerJoin\"\n | \"Input\"\n | \"Insert\"\n | \"Intelligence\"\n | \"Intersection\"\n | \"IpAddress\"\n | \"IssueClosed\"\n | \"IssueNew\"\n | \"Issue\"\n | \"Italic\"\n | \"JoinTable\"\n | \"KeyBackspace\"\n | \"KeyCommand\"\n | \"KeyControl\"\n | \"KeyDelete\"\n | \"KeyEnter\"\n | \"KeyEscape\"\n | \"KeyOption\"\n | \"KeyShift\"\n | \"KeyTab\"\n | \"Key\"\n | \"KnownVehicle\"\n | \"LabTest\"\n | \"Label\"\n | \"LayerOutline\"\n | \"Layer\"\n | \"Layers\"\n | \"LayoutAuto\"\n | \"LayoutBalloon\"\n | \"LayoutBottomRowThreeTiles\"\n | \"LayoutBottomRowTwoTiles\"\n | \"LayoutCircle\"\n | \"LayoutGrid\"\n | \"LayoutGroupBy\"\n | \"LayoutHierarchy\"\n | \"LayoutLeftColumnThreeTiles\"\n | \"LayoutLeftColumnTwoTiles\"\n | \"LayoutLinear\"\n | \"LayoutRightColumnThreeTiles\"\n | \"LayoutRightColumnTwoTiles\"\n | \"LayoutSkewGrid\"\n | \"LayoutSortedClusters\"\n | \"LayoutThreeColumns\"\n | \"LayoutThreeRows\"\n | \"LayoutTopRowThreeTiles\"\n | \"LayoutTopRowTwoTiles\"\n | \"LayoutTwoColumns\"\n | \"LayoutTwoRows\"\n | \"Layout\"\n | \"Learning\"\n | \"LeftJoin\"\n | \"LengthenText\"\n | \"LessThanOrEqualTo\"\n | \"LessThan\"\n | \"Lifesaver\"\n | \"Lightbulb\"\n | \"Lightning\"\n | \"Link\"\n | \"ListColumns\"\n | \"ListDetailView\"\n | \"List\"\n | \"Locate\"\n | \"Lock\"\n | \"Locomotive\"\n | \"LogIn\"\n | \"LogOut\"\n | \"LowVoltagePole\"\n | \"Manual\"\n | \"ManuallyEnteredData\"\n | \"ManyToMany\"\n | \"ManyToOne\"\n | \"MapCreate\"\n | \"MapMarker\"\n | \"Map\"\n | \"Maximize\"\n | \"Media\"\n | \"MenuClosed\"\n | \"MenuOpen\"\n | \"Menu\"\n | \"MergeColumns\"\n | \"MergeLinks\"\n | \"Microphone\"\n | \"Minimize\"\n | \"Minus\"\n | \"MobilePhone\"\n | \"MobileVideo\"\n | \"ModalFilled\"\n | \"Modal\"\n | \"Model\"\n | \"Moon\"\n | \"More\"\n | \"Mountain\"\n | \"Move\"\n | \"Mugshot\"\n | \"MultiSelect\"\n | \"Music\"\n | \"Nest\"\n | \"NewDrawing\"\n | \"NewGridItem\"\n | \"NewLayer\"\n | \"NewLayers\"\n | \"NewLink\"\n | \"NewObject\"\n | \"NewPerson\"\n | \"NewPrescription\"\n | \"NewShield\"\n | \"NewTextBox\"\n | \"Ninja\"\n | \"NotEqualTo\"\n | \"NotificationsSnooze\"\n | \"NotificationsUpdated\"\n | \"Notifications\"\n | \"NumberedList\"\n | \"Numerical\"\n | \"Office\"\n | \"Offline\"\n | \"OilField\"\n | \"OneColumn\"\n | \"OneToMany\"\n | \"OneToOne\"\n | \"OpenApplication\"\n | \"Outdated\"\n | \"Output\"\n | \"PageLayout\"\n | \"PanelStats\"\n | \"PanelTable\"\n | \"Paperclip\"\n | \"Paragraph\"\n | \"PasteVariable\"\n | \"PathSearch\"\n | \"Path\"\n | \"Pause\"\n | \"People\"\n | \"Percentage\"\n | \"Person\"\n | \"PhoneCall\"\n | \"PhoneForward\"\n | \"Phone\"\n | \"PieChart\"\n | \"Pin\"\n | \"PivotTable\"\n | \"Pivot\"\n | \"Play\"\n | \"Playbook\"\n | \"Plus\"\n | \"PolygonFilter\"\n | \"Power\"\n | \"PredictiveAnalysis\"\n | \"Prescription\"\n | \"Presentation\"\n | \"Print\"\n | \"Projects\"\n | \"Properties\"\n | \"Property\"\n | \"PublishFunction\"\n | \"Pulse\"\n | \"Rain\"\n | \"Random\"\n | \"RangeRing\"\n | \"Record\"\n | \"RectHeight\"\n | \"RectWidth\"\n | \"Rectangle\"\n | \"Redo\"\n | \"Refresh\"\n | \"Regex\"\n | \"RegressionChart\"\n | \"RemoveColumnLeft\"\n | \"RemoveColumnRight\"\n | \"RemoveColumn\"\n | \"RemoveRowBottom\"\n | \"RemoveRowTop\"\n | \"Remove\"\n | \"Repeat\"\n | \"Reset\"\n | \"Resolve\"\n | \"Rig\"\n | \"RightJoin\"\n | \"Ring\"\n | \"RocketSlant\"\n | \"Rocket\"\n | \"RotateDocument\"\n | \"RotatePage\"\n | \"Route\"\n | \"Satellite\"\n | \"Saved\"\n | \"ScatterPlot\"\n | \"SearchAround\"\n | \"SearchTemplate\"\n | \"SearchText\"\n | \"Search\"\n | \"SegmentedControl\"\n | \"Select\"\n | \"Selection\"\n | \"SendBackward\"\n | \"SendMessage\"\n | \"SendToGraph\"\n | \"SendToMap\"\n | \"SendTo\"\n | \"Sensor\"\n | \"SeriesAdd\"\n | \"SeriesConfiguration\"\n | \"SeriesDerived\"\n | \"SeriesFiltered\"\n | \"SeriesSearch\"\n | \"Settings\"\n | \"Shapes\"\n | \"Share\"\n | \"SharedFilter\"\n | \"Shield\"\n | \"Ship\"\n | \"Shop\"\n | \"ShoppingCart\"\n | \"ShortenText\"\n | \"SignalSearch\"\n | \"SimCard\"\n | \"Slash\"\n | \"SmallCross\"\n | \"SmallInfoSign\"\n | \"SmallMinus\"\n | \"SmallPlus\"\n | \"SmallSquare\"\n | \"SmallTick\"\n | \"Snowflake\"\n | \"SoccerBall\"\n | \"SocialMedia\"\n | \"SortAlphabeticalDesc\"\n | \"SortAlphabetical\"\n | \"SortAsc\"\n | \"SortDesc\"\n | \"SortNumericalDesc\"\n | \"SortNumerical\"\n | \"Sort\"\n | \"SpellCheck\"\n | \"SplitColumns\"\n | \"SportsStadium\"\n | \"Square\"\n | \"StackedChart\"\n | \"StadiumGeometry\"\n | \"StarEmpty\"\n | \"Star\"\n | \"StepBackward\"\n | \"StepChart\"\n | \"StepForward\"\n | \"Stop\"\n | \"Stopwatch\"\n | \"Strikethrough\"\n | \"Style\"\n | \"Subscript\"\n | \"Superscript\"\n | \"SwapHorizontal\"\n | \"SwapVertical\"\n | \"Switch\"\n | \"SymbolCircle\"\n | \"SymbolCross\"\n | \"SymbolDiamond\"\n | \"SymbolRectangle\"\n | \"SymbolSquare\"\n | \"SymbolTriangleDown\"\n | \"SymbolTriangleUp\"\n | \"Syringe\"\n | \"TableSync\"\n | \"Tag\"\n | \"TakeAction\"\n | \"Tank\"\n | \"Target\"\n | \"Taxi\"\n | \"Team\"\n | \"Temperature\"\n | \"TextHighlight\"\n | \"ThDerived\"\n | \"ThDisconnect\"\n | \"ThFiltered\"\n | \"ThList\"\n | \"Th\"\n | \"ThirdParty\"\n | \"ThumbsDown\"\n | \"ThumbsUp\"\n | \"TickCircle\"\n | \"Tick\"\n | \"Time\"\n | \"TimelineAreaChart\"\n | \"TimelineBarChart\"\n | \"TimelineEvents\"\n | \"TimelineLineChart\"\n | \"Tint\"\n | \"Torch\"\n | \"Tractor\"\n | \"Train\"\n | \"Translate\"\n | \"Trash\"\n | \"Tree\"\n | \"TrendingDown\"\n | \"TrendingUp\"\n | \"Trophy\"\n | \"Truck\"\n | \"TwoColumns\"\n | \"Unarchive\"\n | \"Underline\"\n | \"Undo\"\n | \"UngroupObjects\"\n | \"UnknownVehicle\"\n | \"Unlink\"\n | \"Unlock\"\n | \"Unpin\"\n | \"Unresolve\"\n | \"Updated\"\n | \"Upload\"\n | \"User\"\n | \"Variable\"\n | \"Vector\"\n | \"VerticalBarChartAsc\"\n | \"VerticalBarChartDesc\"\n | \"VerticalDistribution\"\n | \"VerticalInbetween\"\n | \"Video\"\n | \"Virus\"\n | \"VolumeDown\"\n | \"VolumeOff\"\n | \"VolumeUp\"\n | \"Walk\"\n | \"WarningSign\"\n | \"WaterfallChart\"\n | \"Waves\"\n | \"WidgetButton\"\n | \"WidgetFooter\"\n | \"WidgetHeader\"\n | \"Widget\"\n | \"Wind\"\n | \"Wrench\"\n | \"ZoomIn\"\n | \"ZoomOut\"\n | \"ZoomToFit\";\n"],"mappings":"","ignoreList":[]}