@osdk/maker 0.9.0-beta.3 → 0.9.0-beta.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +258 -0
- package/build/browser/api/defineImportSpt.js +47 -0
- package/build/browser/api/defineImportSpt.js.map +1 -0
- package/build/browser/api/defineInterface.js +39 -11
- package/build/browser/api/defineInterface.js.map +1 -1
- package/build/browser/api/defineInterfaceLinkConstraint.js +3 -2
- package/build/browser/api/defineInterfaceLinkConstraint.js.map +1 -1
- package/build/browser/api/defineObject.js +57 -62
- package/build/browser/api/defineObject.js.map +1 -1
- package/build/browser/api/defineOntology.js +194 -23
- package/build/browser/api/defineOntology.js.map +1 -1
- package/build/browser/api/defineSpt.js +3 -1
- package/build/browser/api/defineSpt.js.map +1 -1
- package/build/browser/api/defineValueType.js +58 -11
- package/build/browser/api/defineValueType.js.map +1 -1
- package/build/browser/api/iconNames.js +0 -15
- package/build/browser/api/iconNames.js.map +1 -1
- package/build/browser/api/overall.test.js +704 -63
- package/build/browser/api/overall.test.js.map +1 -1
- package/build/browser/api/types.js +0 -15
- package/build/browser/api/types.js.map +1 -1
- package/build/browser/cli/main.js +5 -6
- package/build/browser/cli/main.js.map +1 -1
- package/build/browser/index.js +3 -0
- package/build/browser/index.js.map +1 -1
- package/build/cjs/index.cjs +716 -0
- package/build/cjs/index.cjs.map +1 -0
- package/build/cjs/index.d.cts +343 -0
- package/build/esm/api/defineImportSpt.js +47 -0
- package/build/esm/api/defineImportSpt.js.map +1 -0
- package/build/esm/api/defineInterface.js +39 -11
- package/build/esm/api/defineInterface.js.map +1 -1
- package/build/esm/api/defineInterfaceLinkConstraint.js +3 -2
- package/build/esm/api/defineInterfaceLinkConstraint.js.map +1 -1
- package/build/esm/api/defineObject.js +57 -62
- package/build/esm/api/defineObject.js.map +1 -1
- package/build/esm/api/defineOntology.js +194 -23
- package/build/esm/api/defineOntology.js.map +1 -1
- package/build/esm/api/defineSpt.js +3 -1
- package/build/esm/api/defineSpt.js.map +1 -1
- package/build/esm/api/defineValueType.js +58 -11
- package/build/esm/api/defineValueType.js.map +1 -1
- package/build/esm/api/iconNames.js +0 -15
- package/build/esm/api/iconNames.js.map +1 -1
- package/build/esm/api/overall.test.js +704 -63
- package/build/esm/api/overall.test.js.map +1 -1
- package/build/esm/api/types.js +0 -15
- package/build/esm/api/types.js.map +1 -1
- package/build/esm/cli/main.js +5 -6
- package/build/esm/cli/main.js.map +1 -1
- package/build/esm/index.js +3 -0
- package/build/esm/index.js.map +1 -1
- package/package.json +28 -13
- package/build/browser/api/defineInterface.d.ts +0 -14
- package/build/browser/api/defineInterface.d.ts.map +0 -1
- package/build/browser/api/defineInterfaceLinkConstraint.d.ts +0 -21
- package/build/browser/api/defineInterfaceLinkConstraint.d.ts.map +0 -1
- package/build/browser/api/defineLink.d.ts +0 -18
- package/build/browser/api/defineLink.d.ts.map +0 -1
- package/build/browser/api/defineLink.js +0 -37
- package/build/browser/api/defineLink.js.map +0 -1
- package/build/browser/api/defineObject.d.ts +0 -15
- package/build/browser/api/defineObject.d.ts.map +0 -1
- package/build/browser/api/defineOntology.d.ts +0 -10
- package/build/browser/api/defineOntology.d.ts.map +0 -1
- package/build/browser/api/defineSpt.d.ts +0 -13
- package/build/browser/api/defineSpt.d.ts.map +0 -1
- package/build/browser/api/defineValueType.d.ts +0 -26
- package/build/browser/api/defineValueType.d.ts.map +0 -1
- package/build/browser/api/iconNames.d.ts +0 -3
- package/build/browser/api/iconNames.d.ts.map +0 -1
- package/build/browser/api/overall.test.d.ts +0 -2
- package/build/browser/api/overall.test.d.ts.map +0 -1
- package/build/browser/api/types.d.ts +0 -38
- package/build/browser/api/types.d.ts.map +0 -1
- package/build/browser/cli/main.d.ts +0 -2
- package/build/browser/cli/main.d.ts.map +0 -1
- package/build/browser/index.d.ts +0 -6
- package/build/browser/index.d.ts.map +0 -1
- package/build/esm/api/defineInterface.d.ts +0 -14
- package/build/esm/api/defineInterface.d.ts.map +0 -1
- package/build/esm/api/defineInterfaceLinkConstraint.d.ts +0 -21
- package/build/esm/api/defineInterfaceLinkConstraint.d.ts.map +0 -1
- package/build/esm/api/defineLink.d.ts +0 -18
- package/build/esm/api/defineLink.d.ts.map +0 -1
- package/build/esm/api/defineLink.js +0 -37
- package/build/esm/api/defineLink.js.map +0 -1
- package/build/esm/api/defineObject.d.ts +0 -15
- package/build/esm/api/defineObject.d.ts.map +0 -1
- package/build/esm/api/defineOntology.d.ts +0 -10
- package/build/esm/api/defineOntology.d.ts.map +0 -1
- package/build/esm/api/defineSpt.d.ts +0 -13
- package/build/esm/api/defineSpt.d.ts.map +0 -1
- package/build/esm/api/defineValueType.d.ts +0 -26
- package/build/esm/api/defineValueType.d.ts.map +0 -1
- package/build/esm/api/iconNames.d.ts +0 -3
- package/build/esm/api/iconNames.d.ts.map +0 -1
- package/build/esm/api/overall.test.d.ts +0 -2
- package/build/esm/api/overall.test.d.ts.map +0 -1
- package/build/esm/api/types.d.ts +0 -38
- package/build/esm/api/types.d.ts.map +0 -1
- package/build/esm/cli/main.d.ts +0 -2
- package/build/esm/cli/main.d.ts.map +0 -1
- package/build/esm/index.d.ts +0 -6
- package/build/esm/index.d.ts.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/api/defineOntology.ts","../../src/api/defineSpt.ts","../../src/api/defineInterface.ts","../../src/api/defineObject.ts","../../src/cli/main.ts","../../src/api/defineImportSpt.ts","../../src/api/defineInterfaceLinkConstraint.ts","../../src/api/defineValueType.ts"],"names":["invariant","apiName","yargs","hideBin","path","consola","fs"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiCO,IAAI,kBAAA;AAGJ,IAAI,SAAA;AACX,eAAsB,cAAA,CAAe,IAAI,IAAM,EAAA;AAC7C,EAAY,SAAA,GAAA,EAAA;AACZ,EAAqB,kBAAA,GAAA;AAAA,IACnB,aAAa,EAAC;AAAA,IACd,aAAa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AA;AAAA,KAC7B;AACA,IAAO,OAAA;AAAA,MACL,UAAY,EAAA;AAAA,KACd;AAAA,GACD,IAAI,EAAC;AACN,EAAM,MAAA,QAAA,GAAW,8BAA+B,CAAA,IAAA,CAAK,IAAI,CAAA;AACzD,EAAA,MAAM,EAAK,GAAA;AAAA,IACT,OAAA;AAAA,IACA,eAAiB,EAAA;AAAA,MACf,WAAA;AAAA,MACA,aAAa,WAAe,IAAA;AAAA,KAC9B;AAAA,IACA,MAAQ,EAAA;AAAA,MACN,IAAM,EAAA,QAAA;AAAA,MACN,QAAQ;AAAC,KACX;AAAA,IACA,OAAA;AAAA,IACA,QAAA;AAAA,IACA,WAAA;AAAA,IACA,eAAe;AAAC,GAClB;AACA,EAAA,IAAI,kBAAmB,CAAA,UAAA,CAAW,OAAO,CAAA,KAAM,SAAW,EAAA;AACxD,IAAmB,kBAAA,CAAA,UAAA,CAAW,OAAO,CAAA,GAAI,EAAC;AAAA;AAE5C,EAAA,kBAAA,CAAmB,UAAW,CAAA,OAAO,CAAE,CAAA,IAAA,CAAK,EAAE,CAAA;AAC9C,EAAO,OAAA,EAAA;AACT","file":"index.cjs","sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/*\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/** @internal */\nexport let ontologyDefinition;\n\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 } 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 objectTypes: Object.fromEntries(Object.entries(ontology.objectTypes).map(([apiName, objectType]) => {\n return [apiName, convertObject(objectType)];\n })),\n sharedPropertyTypes: Object.fromEntries(Object.entries(ontology.sharedPropertyTypes).map(([apiName, spt]) => [apiName, {\n sharedPropertyType: convertSpt(spt)\n }])),\n interfaceTypes: Object.fromEntries(Object.entries(ontology.interfaceTypes).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 convertObject(objectType) {\n const propertyDatasource = {};\n (objectType.properties ?? []).forEach(property => {\n propertyDatasource[property.apiName] = {\n type: \"column\",\n column: property.apiName\n };\n });\n const datasource = {\n rid: \"ri.ontology.main.datasource.\".concat(objectType.apiName),\n datasource: {\n type: \"datasetV2\",\n datasetV2: {\n datasetRid: objectType.apiName,\n propertyMapping: propertyDatasource\n }\n },\n editsConfiguration: {\n onlyAllowPrivilegedEdits: false\n },\n redacted: false\n };\n const implementations = objectType.implementsInterfaces ?? [];\n return {\n objectType: {\n displayMetadata: {\n description: objectType.description,\n displayName: objectType.displayName,\n groupDisplayName: undefined,\n icon: {\n type: \"blueprint\",\n blueprint: objectType.icon ?? {\n locator: \"cube\",\n color: \"#2D72D2\"\n }\n },\n pluralDisplayName: objectType.pluralDisplayName,\n visibility: objectType.visibility ?? \"NORMAL\"\n },\n primaryKeys: objectType.primaryKeys,\n propertyTypes: Object.fromEntries(objectType.properties?.map(val => [val.apiName, convertProperty(val)]) ?? []),\n titlePropertyTypeRid: objectType.titlePropertyApiName,\n apiName: objectType.apiName,\n status: objectType.status ?? {\n type: \"active\",\n active: {}\n },\n redacted: false,\n implementsInterfaces2: implementations.map(impl => ({\n interfaceTypeApiName: impl.implements.apiName,\n properties: Object.fromEntries(impl.propertyMapping.map(mapping => [namespace + mapping.interfaceProperty, {\n propertyTypeRid: mapping.mapsTo\n }]))\n })),\n allImplementsInterfaces: {}\n },\n datasources: [datasource],\n entityMetadata: {\n arePatchesEnabled: objectType.editsEnabled ?? false\n }\n };\n}\nfunction convertProperty(property) {\n const output = {\n apiName: property.apiName,\n sharedPropertyTypeApiName: property.sharedPropertyType?.apiName,\n displayMetadata: {\n displayName: property.displayName,\n description: property.description,\n visibility: property.visibility ?? \"NORMAL\"\n },\n indexedForSearch: property.indexedForSearch ?? true,\n ruleSetBinding: undefined,\n baseFormatter: property.baseFormatter,\n type: convertType(property.type),\n typeClasses: property.typeClasses ?? [],\n status: property.status ?? {\n type: \"active\",\n active: {}\n },\n inlineAction: undefined,\n dataConstraints: property.dataConstraints,\n sharedPropertyTypeRid: property.sharedPropertyType?.apiName,\n valueType: undefined\n };\n return output;\n}\nfunction convertInterface(interfaceType) {\n return {\n ...interfaceType,\n properties: Object.values(interfaceType.properties).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({\n type,\n array,\n description,\n apiName,\n displayName,\n gothamMapping,\n typeClasses,\n valueType\n}) {\n const dataConstraint = typeof type === \"object\" && type.type === \"marking\" ? {\n propertyTypeConstraints: [],\n nullability: undefined,\n nullabilityV2: {\n noEmptyCollections: true,\n 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 type: \"array\",\n array: {\n subtype: convertType(type)\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: {\n markingType: type.markingType\n }\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: {\n displayName: key,\n description: undefined\n },\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: {\n displayName: key,\n description: undefined\n },\n typeClasses: [],\n aliases: [],\n fieldType: convertType(fieldTypeDefinition)\n };\n }\n }\n structFields.push(field);\n }\n return {\n type: \"struct\",\n struct: {\n structFields\n }\n };\n case type === \"geopoint\":\n return {\n type: \"geohash\",\n geohash: {}\n };\n case type === \"decimal\":\n return {\n type,\n [type]: {\n precision: undefined,\n scale: undefined\n }\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 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/**\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 {\n type,\n [type]: {}\n }; // any cast to match conditional return type\n}","/*\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\";\nconst defaultTypeClasses = [{\n kind: \"render_hint\",\n name: \"SELECTABLE\"\n}, {\n kind: \"render_hint\",\n name: \"SORTABLE\"\n}];\nexport function defineSharedPropertyType(opts) {\n const apiName = namespace + opts.apiName;\n !(ontologyDefinition.sharedPropertyTypes[apiName] === undefined) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Shared property type ${apiName} already exists`) : invariant(false) : void 0;\n return ontologyDefinition.sharedPropertyTypes[apiName] = {\n ...opts,\n apiName,\n nonNameSpacedApiName: opts.apiName,\n displayName: opts.displayName ?? opts.apiName,\n // This way the non-namespaced api name is the display name (maybe not ideal)\n typeClasses: opts.typeClasses ?? defaultTypeClasses\n };\n}","/*\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\";\nexport function defineInterface(opts) {\n const apiName = namespace + opts.apiName;\n !(ontologyDefinition.interfaceTypes[apiName] === undefined) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Interface ${apiName} already exists`) : invariant(false) : void 0;\n const properties = Object.fromEntries(Object.entries(opts.properties ?? {}).map(([apiName, type]) => {\n if (typeof type === \"string\" || typeof type === \"object\" && !(\"apiName\" in type)) {\n !isPropertyTypeType(type) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Invalid data type ${JSON.stringify(type)} for property ${apiName} on InterfaceType ${apiName}`) : invariant(false) : void 0;\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(type.apiName.lastIndexOf(\".\") + 1);\n !(namespace + apiName === type.apiName || apiName === unNamespacedTypeApiName) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `property key and it's apiName must be identical. ${JSON.stringify({\n key: apiName,\n apiName: type.apiName\n })}`) : invariant(false) : void 0;\n return [apiName, type];\n }\n }));\n let extendsInterfaces = [];\n if (opts.extends) {\n if (typeof opts.extends === \"string\") {\n extendsInterfaces = [opts.extends];\n } else if (Array.isArray(opts.extends) && opts.extends.every(item => typeof item === \"string\")) {\n extendsInterfaces = opts.extends;\n } else if (opts.extends.apiName !== undefined) {\n extendsInterfaces = [opts.extends.apiName];\n } else {\n extendsInterfaces = opts.extends.map(item => item.apiName);\n }\n }\n const status = mapSimplifiedStatusToInterfaceTypeStatus(opts.status ?? {\n type: \"active\"\n });\n !(status.type !== \"deprecated\" || status.deprecated.message && status.deprecated.deadline) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Deprecated status must include message and deadline properties.`) : invariant(false) : void 0;\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 type: \"blueprint\",\n blueprint: {\n color: opts.icon.color,\n 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\" || v === \"date\" || v === \"decimal\" || v === \"double\" || v === \"float\" || v === \"geopoint\" || v === \"geoshape\" || v === \"integer\" || v === \"long\" || typeof v === \"object\" && v.type === \"marking\" || v === \"short\" || v === \"string\" || v === \"timestamp\";\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 * 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\";\nexport function defineObject(objectDef) {\n const apiName = namespace + objectDef.apiName;\n const propertyApiNames = (objectDef.properties ?? []).map(val => val.apiName);\n if (ontologyDefinition.objectTypes[apiName] !== undefined) {\n throw new Error(`Object type with apiName ${objectDef.apiName} is already defined`);\n }\n !propertyApiNames.includes(objectDef.titlePropertyApiName) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Title property ${objectDef.titlePropertyApiName} is not defined on object ${objectDef.apiName}`) : invariant(false) : void 0;\n !(objectDef.primaryKeys.length !== 0) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `${objectDef.apiName} does not have any primary keys, objects must have at least one primary key`) : invariant(false) : void 0;\n const nonExistentPrimaryKeys = objectDef.primaryKeys.filter(primaryKey => !objectDef.properties?.map(val => val.apiName).includes(primaryKey));\n !(nonExistentPrimaryKeys.length === 0) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Primary key properties ${nonExistentPrimaryKeys} do not exist on object ${objectDef.apiName}`) : invariant(false) : void 0;\n objectDef.implementsInterfaces?.forEach(interfaceImpl => {\n const nonExistentInterfaceProperties = interfaceImpl.propertyMapping.map(val => val.interfaceProperty).filter(interfaceProperty => interfaceImpl.implements.properties[interfaceProperty] === undefined).map(interfaceProp => ({\n type: \"invalid\",\n reason: `Interface property ${interfaceImpl.implements.apiName}.${interfaceProp} referenced in ${objectDef.apiName} object does not exist`\n }));\n const interfaceToObjectProperties = Object.fromEntries(interfaceImpl.propertyMapping.map(mapping => [mapping.interfaceProperty, mapping.mapsTo]));\n const validateProperty = interfaceProp => {\n if (interfaceProp[1].nonNameSpacedApiName in interfaceToObjectProperties) {\n return validateInterfaceImplProperty(interfaceProp[1], interfaceToObjectProperties[interfaceProp[0]], objectDef);\n }\n return {\n type: \"invalid\",\n reason: `Interface property ${interfaceImpl.implements.apiName}.${interfaceProp[1].nonNameSpacedApiName} not implemented by ${objectDef.apiName} object definition`\n };\n };\n const baseValidations = Object.entries(interfaceImpl.implements.properties).map(validateProperty);\n const extendsValidations = interfaceImpl.implements.extendsInterfaces.flatMap(interfaceApiName => Object.entries(ontologyDefinition.interfaceTypes[interfaceApiName].properties).map(validateProperty));\n const allFailedValidations = baseValidations.concat(extendsValidations, nonExistentInterfaceProperties).filter(val => val.type === \"invalid\");\n !(allFailedValidations.length === 0) ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"\\n\" + allFailedValidations.map(formatValidationErrors).join(\"\\n\")) : invariant(false) : void 0;\n });\n ontologyDefinition.objectTypes[apiName] = {\n ...objectDef,\n apiName: apiName\n };\n return {\n ...objectDef,\n apiName: apiName\n };\n}\nfunction formatValidationErrors(error) {\n return `Ontology Definition Error: ${error.reason}\\n`;\n}\n\n// Validate that the object and the interface property match up\nfunction validateInterfaceImplProperty(spt, mappedObjectProp, object) {\n const objProp = object.properties?.find(prop => prop.apiName === mappedObjectProp);\n if (objProp === undefined) {\n return {\n type: \"invalid\",\n reason: `Object property mapped to interface does not exist. Object Property Mapped: ${mappedObjectProp}`\n };\n }\n if (spt.type !== objProp?.type) {\n return {\n type: \"invalid\",\n reason: `Object property type does not match the interface property it is mapped to. Interface Property: ${spt.apiName}, objectProperty: ${mappedObjectProp}`\n };\n }\n return {\n type: \"valid\"\n };\n}","/*\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 { consola } from \"consola\";\nimport * as fs from \"node:fs/promises\";\nimport * as path from \"node:path\";\nimport invariant from \"tiny-invariant\";\nimport yargs from \"yargs\";\nimport { hideBin } from \"yargs/helpers\";\nimport { defineInterface } from \"../api/defineInterface.js\";\nimport { defineObject } from \"../api/defineObject.js\";\nimport { defineOntology } from \"../api/defineOntology.js\";\nimport { defineSharedPropertyType } from \"../api/defineSpt.js\";\nconst apiNamespaceRegex = /^[a-z0-9-]+(\\.[a-z0-9-]+)*\\.$/;\nexport default async function main(args = process.argv) {\n const commandLineOpts = await yargs(hideBin(args)).version(process.env.PACKAGE_VERSION ?? \"\").wrap(Math.min(150, yargs().terminalWidth())).strict().help().options({\n input: {\n alias: \"i\",\n describe: \"Input file\",\n type: \"string\",\n default: \".ontology/ontology.ts\",\n coerce: path.resolve\n },\n output: {\n alias: \"o\",\n describe: \"Output file\",\n type: \"string\",\n default: \"ontology.json\",\n coerce: path.resolve\n },\n apiNamespace: {\n describe: \"Api name prefix for namespaced ontology types\",\n type: \"string\",\n default: \"\"\n },\n snapshotDir: {\n alias: \"s\",\n describe: \"Snapshot directory\",\n type: \"string\",\n default: \"snapshots\",\n coerce: path.resolve\n },\n valueTypesOutput: {\n describe: \"Value Type Output File\",\n type: \"string\",\n default: \"value-types.json\",\n coerce: path.resolve\n }\n }).parseAsync();\n let apiNamespace = \"\";\n if (commandLineOpts.apiNamespace.length !== 0) {\n apiNamespace = commandLineOpts.apiNamespace.slice(-1) !== \".\" ? commandLineOpts.apiNamespace + \".\" : commandLineOpts.apiNamespace;\n !(apiNamespace.length < 1024) ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"API namespace is too long.\") : invariant(false) : void 0;\n !apiNamespaceRegex.test(apiNamespace) ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"API namespace is invalid! It is expected to conform to ^[a-z0-9-]+(\\.[a-z0-9-]+)*\\.$\") : invariant(false) : void 0;\n }\n consola.info(`Loading ontology from ${commandLineOpts.input}`);\n const ontology = await loadOntology(commandLineOpts.input, apiNamespace);\n consola.info(`Saving ontology to ${commandLineOpts.output}`);\n await fs.writeFile(commandLineOpts.output, JSON.stringify(ontology.ontology, null, 2));\n // No point in generating block if there aren't any value types\n if (ontology.valueType.valueTypes.length > 0) {\n await fs.writeFile(commandLineOpts.valueTypesOutput, JSON.stringify(ontology.valueType, null, 2));\n }\n}\nasync function loadOntologyViaJiti(input) {\n Object.assign(globalThis, {\n defineInterface,\n defineObject,\n defineSharedPropertyType\n });\n const jiti_ = await import(\"jiti\");\n const jiti = jiti_.default(process.cwd(), {\n debug: true\n });\n return defineOntology(\"\", async () => await jiti(input));\n}\nasync function loadOntologyViaTsNode(input) {\n Object.assign(globalThis, {\n defineInterface,\n defineObject,\n defineSharedPropertyType\n });\n const tsNode = await import(\"ts-node\");\n const tsNodeService = tsNode.register({\n transpileOnly: true,\n compilerOptions: {\n module: \"commonjs\",\n target: \"esnext\"\n },\n esm: true\n });\n tsNodeService.enabled(true);\n const q = await import(input);\n return q;\n}\nasync function loadOntology(input, apiNamespace) {\n // Object.assign(globalThis, {\n // defineInterface,\n // defineLink,\n // defineObject,\n // defineSharedPropertyType,\n // });\n\n const q = await defineOntology(apiNamespace, async () => await import(input));\n return q;\n}","/*\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\";\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 {\n apiName,\n packageName,\n typeHint\n } = opts;\n if (packageName !== undefined) {\n ontologyDefinition.importedTypes.sharedPropertyTypes.push({\n apiName,\n packageName\n });\n !!packageName.endsWith(\".\") ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"Package name format invalid ends with period\") : invariant(false) : void 0;\n !(packageName.match(\"[A-Z]\") == null) ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"Package name includes upper case characters\") : invariant(false) : void 0;\n return {\n apiName: packageName + \".\" + apiName,\n type: typeHint,\n nonNameSpacedApiName: apiName\n };\n }\n return {\n apiName: apiName,\n type: typeHint,\n nonNameSpacedApiName: apiName\n };\n}","/*\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\";\nexport function defineInterfaceLinkConstraint(linkDef) {\n const fromLinkMeta = getLinkMeta(linkDef);\n !(linkDef.from.links.find(a => a.metadata.apiName === fromLinkMeta.apiName) == null) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Link with apiName ${fromLinkMeta.apiName} already exists on ${linkDef.apiName}`) : invariant(false) : void 0;\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\" ? withDefaults({\n apiName: namespace + meta\n }) : withDefaults(meta);\n}\nfunction withDefaults({\n apiName,\n description,\n displayName\n}) {\n return {\n apiName: namespace + apiName,\n displayName: displayName ?? apiName,\n description: description ?? displayName ?? apiName\n };\n}","/*\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\";\nfunction convertValueTypeTypeToBaseType(valueType) {\n if (typeof valueType === \"string\") {}\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 {\n type: valueType,\n [valueType]: {}\n };\n default:\n throw new Error(\"Invalid ValueTypeType\");\n }\n}\nexport function defineValueType(opts) {\n const {\n apiName,\n displayName,\n description,\n type,\n version\n } = 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 !semverValidation.test(version) ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"Version is not a valid semver\") : invariant(false) : void 0;\n const typeName = typeof type.type === \"string\" ? type.type : type.type.type === \"struct\" ? \"structV2\" : 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 ? type.constraints.map(constraint => {\n const output = {\n constraint: {\n type: typeName,\n [typeName]: constraint.constraint\n },\n failureMessage: constraint.failureMessage\n };\n return {\n 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: {\n type: \"active\",\n active: {}\n },\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}"]}
|
|
@@ -0,0 +1,343 @@
|
|
|
1
|
+
import { OntologyIrInterfaceType, InterfaceTypeStatus, SharedPropertyTypeGothamMapping, StructFieldType, ValueTypeApiName, ValueTypeDisplayMetadata, ValueTypeStatus, ValueTypeVersion, BaseType, ValueTypeDataConstraint, ExampleValue, OntologyIrObjectType, Visibility, ApiNameValueTypeReference, OntologyIrPropertyType, DataConstraint, FailureMessage } from '@osdk/client.unstable';
|
|
2
|
+
|
|
3
|
+
declare function main(args?: string[]): Promise<void>;
|
|
4
|
+
|
|
5
|
+
type BlueprintIcon = "add-clip" | "add-column-left" | "add-column-right" | "add-location" | "add-row-bottom" | "add-row-top" | "add-to-artifact" | "add-to-folder" | "add" | "aimpoints-target" | "airplane" | "align-center" | "align-justify" | "align-left" | "align-right" | "alignment-bottom" | "alignment-horizontal-center" | "alignment-left" | "alignment-right" | "alignment-top" | "alignment-vertical-center" | "ammunition" | "anchor" | "annotation" | "antenna" | "app-header" | "application" | "applications" | "archive" | "area-of-interest" | "array-boolean" | "array-date" | "array-floating-point" | "array-numeric" | "array-string" | "array-timestamp" | "array" | "arrow-bottom-left" | "arrow-bottom-right" | "arrow-down" | "arrow-left" | "arrow-right" | "arrow-top-left" | "arrow-top-right" | "arrow-up" | "arrows-horizontal" | "arrows-vertical" | "asterisk" | "at" | "automatic-updates" | "axle" | "backlink" | "backward-ten" | "badge" | "ban-circle" | "bank-account" | "barcode" | "binary-number" | "blank" | "blocked-person" | "bold" | "book" | "bookmark" | "box" | "briefcase" | "bring-data" | "bring-forward" | "bug" | "buggy" | "build" | "bullseye" | "calculator" | "calendar" | "camera" | "caret-down" | "caret-left" | "caret-right" | "caret-up" | "cargo-ship" | "cell-tower" | "changes" | "chart" | "chat" | "chevron-backward" | "chevron-down" | "chevron-forward" | "chevron-left" | "chevron-right" | "chevron-up" | "circle-arrow-down" | "circle-arrow-left" | "circle-arrow-right" | "circle-arrow-up" | "circle" | "citation" | "clean" | "clip" | "clipboard-file" | "clipboard" | "cloud-download" | "cloud-server" | "cloud-tick" | "cloud-upload" | "cloud" | "code-block" | "code" | "cog" | "collapse-all" | "color-fill" | "column-layout" | "comment" | "comparison" | "compass" | "compressed" | "confirm" | "console" | "contrast" | "control" | "credit-card" | "crop" | "cross-circle" | "cross" | "crown" | "css-style" | "cube-add" | "cube-remove" | "cube" | "curly-braces" | "curved-range-chart" | "cut" | "cycle" | "dashboard" | "data-connection" | "data-lineage" | "data-search" | "data-sync" | "database" | "delete" | "delta" | "derive-column" | "desktop" | "detection" | "diagnosis" | "diagram-tree" | "direction-left" | "direction-right" | "disable" | "divide" | "document-open" | "document-share" | "document" | "dollar" | "dot" | "double-caret-horizontal" | "double-caret-vertical" | "double-chevron-down" | "double-chevron-left" | "double-chevron-right" | "double-chevron-up" | "doughnut-chart" | "download" | "drag-handle-horizontal" | "drag-handle-vertical" | "draw" | "drawer-left-filled" | "drawer-left" | "drawer-right-filled" | "drawer-right" | "drive-time" | "duplicate" | "edit" | "eject" | "emoji" | "endnote" | "endorsed" | "envelope" | "equals" | "eraser" | "error" | "euro" | "excavator" | "exchange" | "exclude-row" | "expand-all" | "explain" | "export" | "eye-off" | "eye-on" | "eye-open" | "fast-backward" | "fast-forward" | "feed-subscribed" | "feed" | "film" | "filter-keep" | "filter-list" | "filter-open" | "filter-remove" | "filter" | "flag" | "flame" | "flash" | "floating-point" | "floppy-disk" | "flow-branch" | "flow-end" | "flow-linear" | "flow-review-branch" | "flow-review" | "flows" | "folder-close" | "folder-new" | "folder-open" | "folder-shared-open" | "folder-shared" | "follower" | "following" | "font" | "fork" | "form" | "forward-ten" | "fuel" | "full-circle" | "full-stacked-chart" | "fullscreen" | "function" | "gantt-chart" | "generate" | "geofence" | "geolocation" | "geosearch" | "geotime" | "git-branch" | "git-commit" | "git-merge" | "git-new-branch" | "git-pull" | "git-push" | "git-repo" | "glass" | "globe-network" | "globe" | "graph-remove" | "graph" | "greater-than-or-equal-to" | "greater-than" | "grid-view" | "grid" | "group-item" | "group-objects" | "grouped-bar-chart" | "hand-down" | "hand-left" | "hand-right" | "hand-up" | "hand" | "hat" | "header-one" | "header-three" | "header-two" | "header" | "headset" | "heart-broken" | "heart" | "heat-grid" | "heatmap" | "helicopter" | "help" | "helper-management" | "high-priority" | "high-voltage-pole" | "highlight" | "history" | "home" | "horizontal-bar-chart-asc" | "horizontal-bar-chart-desc" | "horizontal-bar-chart" | "horizontal-distribution" | "horizontal-inbetween" | "hurricane" | "id-number" | "image-rotate-left" | "image-rotate-right" | "import" | "inbox-filtered" | "inbox-geo" | "inbox-search" | "inbox-update" | "inbox" | "info-sign" | "inheritance" | "inherited-group" | "inner-join" | "input" | "insert" | "intelligence" | "intersection" | "ip-address" | "issue-closed" | "issue-new" | "issue" | "italic" | "join-table" | "key-backspace" | "key-command" | "key-control" | "key-delete" | "key-enter" | "key-escape" | "key-option" | "key-shift" | "key-tab" | "key" | "known-vehicle" | "lab-test" | "label" | "layer-outline" | "layer" | "layers" | "layout-auto" | "layout-balloon" | "layout-bottom-row-three-tiles" | "layout-bottom-row-two-tiles" | "layout-circle" | "layout-grid" | "layout-group-by" | "layout-hierarchy" | "layout-left-column-three-tiles" | "layout-left-column-two-tiles" | "layout-linear" | "layout-right-column-three-tiles" | "layout-right-column-two-tiles" | "layout-skew-grid" | "layout-sorted-clusters" | "layout-three-columns" | "layout-three-rows" | "layout-top-row-three-tiles" | "layout-top-row-two-tiles" | "layout-two-columns" | "layout-two-rows" | "layout" | "learning" | "left-join" | "lengthen-text" | "less-than-or-equal-to" | "less-than" | "lifesaver" | "lightbulb" | "lightning" | "link" | "list-columns" | "list-detail-view" | "list" | "locate" | "lock" | "locomotive" | "log-in" | "log-out" | "low-voltage-pole" | "manual" | "manually-entered-data" | "many-to-many" | "many-to-one" | "map-create" | "map-marker" | "map" | "maximize" | "media" | "menu-closed" | "menu-open" | "menu" | "merge-columns" | "merge-links" | "microphone" | "minimize" | "minus" | "mobile-phone" | "mobile-video" | "modal-filled" | "modal" | "model" | "moon" | "more" | "mountain" | "move" | "mugshot" | "multi-select" | "music" | "nest" | "new-drawing" | "new-grid-item" | "new-layer" | "new-layers" | "new-link" | "new-object" | "new-person" | "new-prescription" | "new-shield" | "new-text-box" | "ninja" | "not-equal-to" | "notifications-snooze" | "notifications-updated" | "notifications" | "numbered-list" | "numerical" | "office" | "offline" | "oil-field" | "one-column" | "one-to-many" | "one-to-one" | "open-application" | "outdated" | "output" | "page-layout" | "panel-stats" | "panel-table" | "paperclip" | "paragraph" | "paste-variable" | "path-search" | "path" | "pause" | "people" | "percentage" | "person" | "phone-call" | "phone-forward" | "phone" | "pie-chart" | "pin" | "pivot-table" | "pivot" | "play" | "playbook" | "plus" | "polygon-filter" | "power" | "predictive-analysis" | "prescription" | "presentation" | "print" | "projects" | "properties" | "property" | "publish-function" | "pulse" | "rain" | "random" | "range-ring" | "record" | "rect-height" | "rect-width" | "rectangle" | "redo" | "refresh" | "regex" | "regression-chart" | "remove-column-left" | "remove-column-right" | "remove-column" | "remove-row-bottom" | "remove-row-top" | "remove" | "repeat" | "reset" | "resolve" | "rig" | "right-join" | "ring" | "rocket-slant" | "rocket" | "rotate-document" | "rotate-page" | "route" | "satellite" | "saved" | "scatter-plot" | "search-around" | "search-template" | "search-text" | "search" | "segmented-control" | "select" | "selection" | "send-backward" | "send-message" | "send-to-graph" | "send-to-map" | "send-to" | "sensor" | "series-add" | "series-configuration" | "series-derived" | "series-filtered" | "series-search" | "settings" | "shapes" | "share" | "shared-filter" | "shield" | "ship" | "shop" | "shopping-cart" | "shorten-text" | "signal-search" | "sim-card" | "slash" | "small-cross" | "small-info-sign" | "small-minus" | "small-plus" | "small-square" | "small-tick" | "snowflake" | "soccer-ball" | "social-media" | "sort-alphabetical-desc" | "sort-alphabetical" | "sort-asc" | "sort-desc" | "sort-numerical-desc" | "sort-numerical" | "sort" | "spell-check" | "split-columns" | "sports-stadium" | "square" | "stacked-chart" | "stadium-geometry" | "star-empty" | "star" | "step-backward" | "step-chart" | "step-forward" | "stop" | "stopwatch" | "strikethrough" | "style" | "subscript" | "superscript" | "swap-horizontal" | "swap-vertical" | "switch" | "symbol-circle" | "symbol-cross" | "symbol-diamond" | "symbol-rectangle" | "symbol-square" | "symbol-triangle-down" | "symbol-triangle-up" | "syringe" | "table-sync" | "tag" | "take-action" | "tank" | "target" | "taxi" | "team" | "temperature" | "text-highlight" | "th-derived" | "th-disconnect" | "th-filtered" | "th-list" | "th" | "third-party" | "thumbs-down" | "thumbs-up" | "tick-circle" | "tick" | "time" | "timeline-area-chart" | "timeline-bar-chart" | "timeline-events" | "timeline-line-chart" | "tint" | "torch" | "tractor" | "train" | "translate" | "trash" | "tree" | "trending-down" | "trending-up" | "trophy" | "truck" | "two-columns" | "unarchive" | "underline" | "undo" | "ungroup-objects" | "unknown-vehicle" | "unlink" | "unlock" | "unpin" | "unresolve" | "updated" | "upload" | "user" | "variable" | "vector" | "vertical-bar-chart-asc" | "vertical-bar-chart-desc" | "vertical-distribution" | "vertical-inbetween" | "video" | "virus" | "volume-down" | "volume-off" | "volume-up" | "walk" | "warning-sign" | "waterfall-chart" | "waves" | "widget-button" | "widget-footer" | "widget-header" | "widget" | "wind" | "wrench" | "zoom-in" | "zoom-out" | "zoom-to-fit";
|
|
6
|
+
|
|
7
|
+
type RequiredFields<T, K extends keyof T> = T & Required<Pick<T, K>>;
|
|
8
|
+
interface ObjectTypeInner extends Omit<OntologyIrObjectType, "titlePropertyTypeRid" | "propertyTypes" | "allImplementsInterfaces" | "implementsInterfaces2" | "displayMetadata"> {
|
|
9
|
+
properties: Array<ObjectPropertyType>;
|
|
10
|
+
titlePropertyApiName: string;
|
|
11
|
+
implementsInterfaces: Array<InterfaceImplementation>;
|
|
12
|
+
description: string | undefined;
|
|
13
|
+
icon: {
|
|
14
|
+
locator: BlueprintIcon;
|
|
15
|
+
color: string;
|
|
16
|
+
} | undefined;
|
|
17
|
+
displayName: string;
|
|
18
|
+
pluralDisplayName: string;
|
|
19
|
+
visibility: Visibility;
|
|
20
|
+
editsEnabled: boolean;
|
|
21
|
+
}
|
|
22
|
+
type InterfaceImplementation = {
|
|
23
|
+
implements: InterfaceType;
|
|
24
|
+
propertyMapping: {
|
|
25
|
+
interfaceProperty: string;
|
|
26
|
+
mapsTo: string;
|
|
27
|
+
}[];
|
|
28
|
+
};
|
|
29
|
+
type ObjectType = RequiredFields<Partial<ObjectTypeInner>, "apiName" | "primaryKeys" | "displayName" | "pluralDisplayName" | "titlePropertyApiName">;
|
|
30
|
+
interface ObjectPropertyTypeInner extends Omit<OntologyIrPropertyType, "sharedPropertyTypeApiName" | "type" | "inlineAction" | "sharedPropertyTypeRid" | "valueType" | "ruleSetBinding" | "displayMetadata"> {
|
|
31
|
+
type: PropertyTypeType;
|
|
32
|
+
array?: boolean;
|
|
33
|
+
valueType: string | ValueTypeDefinitionVersion;
|
|
34
|
+
sharedPropertyType: SharedPropertyType;
|
|
35
|
+
description: string | undefined;
|
|
36
|
+
displayName: string;
|
|
37
|
+
visibility: Visibility;
|
|
38
|
+
}
|
|
39
|
+
type ObjectPropertyType = RequiredFields<Partial<ObjectPropertyTypeInner>, "apiName" | "type" | "displayName">;
|
|
40
|
+
interface InterfaceType extends Omit<OntologyIrInterfaceType, "properties" | "allProperties" | "allLinks" | "allExtendsInterfaces"> {
|
|
41
|
+
properties: Record<string, SharedPropertyType>;
|
|
42
|
+
status: InterfaceTypeStatus;
|
|
43
|
+
}
|
|
44
|
+
interface PropertyType {
|
|
45
|
+
type: PropertyTypeType;
|
|
46
|
+
array?: boolean;
|
|
47
|
+
description?: string;
|
|
48
|
+
displayName?: string;
|
|
49
|
+
valueType?: ApiNameValueTypeReference;
|
|
50
|
+
typeClasses?: TypeClass[];
|
|
51
|
+
}
|
|
52
|
+
type TypeClass = {
|
|
53
|
+
kind: string;
|
|
54
|
+
name: string;
|
|
55
|
+
};
|
|
56
|
+
interface SharedPropertyType extends PropertyType {
|
|
57
|
+
apiName: string;
|
|
58
|
+
nonNameSpacedApiName: string;
|
|
59
|
+
gothamMapping?: SharedPropertyTypeGothamMapping;
|
|
60
|
+
}
|
|
61
|
+
type PropertyTypeType = PropertyTypeTypesWithoutStruct | {
|
|
62
|
+
type: "struct";
|
|
63
|
+
structDefinition: {
|
|
64
|
+
[api_name: string]: StructPropertyType | Exclude<PropertyTypeTypesWithoutStruct, MarkingPropertyType>;
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
type PropertyTypeTypesWithoutStruct = "boolean" | "byte" | "date" | "decimal" | "double" | "float" | "geopoint" | "geoshape" | "integer" | "long" | MarkingPropertyType | "short" | "string" | "timestamp" | "mediaReference";
|
|
68
|
+
type MarkingPropertyType = {
|
|
69
|
+
type: "marking";
|
|
70
|
+
markingType: "MANDATORY" | "CBAC";
|
|
71
|
+
};
|
|
72
|
+
type Optional<T, K extends keyof T> = Pick<Partial<T>, K> & Omit<T, K>;
|
|
73
|
+
interface StructPropertyType extends Optional<Omit<StructFieldType, "fieldType" | "structFieldRid" | "apiName">, "typeClasses" | "aliases"> {
|
|
74
|
+
fieldType: PropertyTypeTypesWithoutStruct;
|
|
75
|
+
}
|
|
76
|
+
interface ValueTypeType_array {
|
|
77
|
+
constraints: {
|
|
78
|
+
constraint: Extract<DataConstraint, {
|
|
79
|
+
type: "array";
|
|
80
|
+
}>["array"];
|
|
81
|
+
failureMessage?: FailureMessage;
|
|
82
|
+
}[];
|
|
83
|
+
type: "array";
|
|
84
|
+
value: {
|
|
85
|
+
type: "array";
|
|
86
|
+
elementType: ValueTypeType["value"];
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
interface ValueTypeType_boolean {
|
|
90
|
+
constraints: {
|
|
91
|
+
constraint: Extract<DataConstraint, {
|
|
92
|
+
type: "boolean";
|
|
93
|
+
}>["boolean"];
|
|
94
|
+
failureMessage?: FailureMessage;
|
|
95
|
+
}[];
|
|
96
|
+
type: "boolean";
|
|
97
|
+
value: "boolean";
|
|
98
|
+
}
|
|
99
|
+
interface ValueTypeType_binary {
|
|
100
|
+
constraints: {
|
|
101
|
+
constraint: Extract<DataConstraint, {
|
|
102
|
+
type: "binary";
|
|
103
|
+
}>["binary"];
|
|
104
|
+
failureMessage?: FailureMessage;
|
|
105
|
+
}[];
|
|
106
|
+
type: "binary";
|
|
107
|
+
value: "binary";
|
|
108
|
+
}
|
|
109
|
+
interface ValueTypeType_byte {
|
|
110
|
+
constraints: {
|
|
111
|
+
constraint: Extract<DataConstraint, {
|
|
112
|
+
type: "byte";
|
|
113
|
+
}>["byte"];
|
|
114
|
+
failureMessage?: FailureMessage;
|
|
115
|
+
}[];
|
|
116
|
+
type: "byte";
|
|
117
|
+
value: "byte";
|
|
118
|
+
}
|
|
119
|
+
interface ValueTypeType_date {
|
|
120
|
+
constraints: {
|
|
121
|
+
constraint: Extract<DataConstraint, {
|
|
122
|
+
type: "date";
|
|
123
|
+
}>["date"];
|
|
124
|
+
failureMessage?: FailureMessage;
|
|
125
|
+
}[];
|
|
126
|
+
type: "date";
|
|
127
|
+
value: "date";
|
|
128
|
+
}
|
|
129
|
+
interface ValueTypeType_decimal {
|
|
130
|
+
constraints: {
|
|
131
|
+
constraint: Extract<DataConstraint, {
|
|
132
|
+
type: "decimal";
|
|
133
|
+
}>["decimal"];
|
|
134
|
+
failureMessage?: FailureMessage;
|
|
135
|
+
}[];
|
|
136
|
+
type: "decimal";
|
|
137
|
+
value: "decimal";
|
|
138
|
+
}
|
|
139
|
+
interface ValueTypeType_double {
|
|
140
|
+
constraints: {
|
|
141
|
+
constraint: Extract<DataConstraint, {
|
|
142
|
+
type: "double";
|
|
143
|
+
}>["double"];
|
|
144
|
+
failureMessage?: FailureMessage;
|
|
145
|
+
}[];
|
|
146
|
+
type: "double";
|
|
147
|
+
value: "double";
|
|
148
|
+
}
|
|
149
|
+
interface ValueTypeType_float {
|
|
150
|
+
constraints: {
|
|
151
|
+
constraint: Extract<DataConstraint, {
|
|
152
|
+
type: "float";
|
|
153
|
+
}>["float"];
|
|
154
|
+
failureMessage?: FailureMessage;
|
|
155
|
+
}[];
|
|
156
|
+
type: "float";
|
|
157
|
+
value: "float";
|
|
158
|
+
}
|
|
159
|
+
interface ValueTypeType_integer {
|
|
160
|
+
constraints: {
|
|
161
|
+
constraint: Extract<DataConstraint, {
|
|
162
|
+
type: "integer";
|
|
163
|
+
}>["integer"];
|
|
164
|
+
failureMessage?: FailureMessage;
|
|
165
|
+
}[];
|
|
166
|
+
type: "integer";
|
|
167
|
+
value: "integer";
|
|
168
|
+
}
|
|
169
|
+
interface ValueTypeType_long {
|
|
170
|
+
constraints: {
|
|
171
|
+
constraint: Extract<DataConstraint, {
|
|
172
|
+
type: "long";
|
|
173
|
+
}>["long"];
|
|
174
|
+
failureMessage?: FailureMessage;
|
|
175
|
+
}[];
|
|
176
|
+
type: "long";
|
|
177
|
+
value: "long";
|
|
178
|
+
}
|
|
179
|
+
interface ValueTypeType_map {
|
|
180
|
+
constraints: {
|
|
181
|
+
constraint: Extract<DataConstraint, {
|
|
182
|
+
type: "map";
|
|
183
|
+
}>["map"];
|
|
184
|
+
failureMessage?: FailureMessage;
|
|
185
|
+
}[];
|
|
186
|
+
type: "map";
|
|
187
|
+
value: {
|
|
188
|
+
type: "map";
|
|
189
|
+
keyType: ValueTypeType["value"];
|
|
190
|
+
valueType: ValueTypeType["value"];
|
|
191
|
+
};
|
|
192
|
+
}
|
|
193
|
+
interface ValueTypeType_optional {
|
|
194
|
+
constraints: {
|
|
195
|
+
constraint: Extract<DataConstraint, {
|
|
196
|
+
type: "optional";
|
|
197
|
+
}>["optional"];
|
|
198
|
+
failureMessage?: FailureMessage;
|
|
199
|
+
}[];
|
|
200
|
+
type: "optional";
|
|
201
|
+
value: {
|
|
202
|
+
type: "optional";
|
|
203
|
+
wrappedType: ValueTypeType["value"];
|
|
204
|
+
};
|
|
205
|
+
}
|
|
206
|
+
interface ValueTypeType_short {
|
|
207
|
+
constraints: {
|
|
208
|
+
constraint: Extract<DataConstraint, {
|
|
209
|
+
type: "short";
|
|
210
|
+
}>["short"];
|
|
211
|
+
failureMessage?: FailureMessage;
|
|
212
|
+
}[];
|
|
213
|
+
type: "short";
|
|
214
|
+
value: "short";
|
|
215
|
+
}
|
|
216
|
+
interface ValueTypeType_string {
|
|
217
|
+
constraints: {
|
|
218
|
+
constraint: Extract<DataConstraint, {
|
|
219
|
+
type: "string";
|
|
220
|
+
}>["string"];
|
|
221
|
+
failureMessage?: FailureMessage;
|
|
222
|
+
}[];
|
|
223
|
+
type: "string";
|
|
224
|
+
value: "string";
|
|
225
|
+
}
|
|
226
|
+
interface ValueTypeType_structV2 {
|
|
227
|
+
constraints: {
|
|
228
|
+
constraint: Extract<DataConstraint, {
|
|
229
|
+
type: "structV2";
|
|
230
|
+
}>["structV2"];
|
|
231
|
+
failureMessage?: FailureMessage;
|
|
232
|
+
}[];
|
|
233
|
+
type: "structV2";
|
|
234
|
+
value: {
|
|
235
|
+
type: "struct";
|
|
236
|
+
fields: Array<{
|
|
237
|
+
identifier: string;
|
|
238
|
+
baseType: ValueTypeType["value"];
|
|
239
|
+
}>;
|
|
240
|
+
};
|
|
241
|
+
}
|
|
242
|
+
interface ValueTypeType_timestamp {
|
|
243
|
+
constraints: {
|
|
244
|
+
constraint: Extract<DataConstraint, {
|
|
245
|
+
type: "timestamp";
|
|
246
|
+
}>["timestamp"];
|
|
247
|
+
failureMessage?: FailureMessage;
|
|
248
|
+
}[];
|
|
249
|
+
type: "timestamp";
|
|
250
|
+
value: "timestamp";
|
|
251
|
+
}
|
|
252
|
+
type ValueTypeType = ValueTypeType_array | ValueTypeType_boolean | ValueTypeType_binary | ValueTypeType_byte | ValueTypeType_date | ValueTypeType_decimal | ValueTypeType_double | ValueTypeType_float | ValueTypeType_integer | ValueTypeType_long | ValueTypeType_map | ValueTypeType_optional | ValueTypeType_short | ValueTypeType_string | ValueTypeType_structV2 | ValueTypeType_timestamp;
|
|
253
|
+
type ValueTypeDefinitionVersion = {
|
|
254
|
+
apiName: ValueTypeApiName;
|
|
255
|
+
displayMetadata: ValueTypeDisplayMetadata;
|
|
256
|
+
status: ValueTypeStatus;
|
|
257
|
+
version: ValueTypeVersion;
|
|
258
|
+
baseType: BaseType;
|
|
259
|
+
constraints: ValueTypeDataConstraint[];
|
|
260
|
+
exampleValues: ExampleValue[];
|
|
261
|
+
};
|
|
262
|
+
|
|
263
|
+
/**
|
|
264
|
+
* Defines a foreign shared property type you want to take as an input to your product. The typeHint field is used for OSDK generation
|
|
265
|
+
*/
|
|
266
|
+
declare function importSharedPropertyType(opts: {
|
|
267
|
+
apiName: string;
|
|
268
|
+
packageName?: string;
|
|
269
|
+
typeHint: PropertyTypeType;
|
|
270
|
+
}): SharedPropertyType;
|
|
271
|
+
|
|
272
|
+
type SimplifiedInterfaceTypeStatus = {
|
|
273
|
+
type: "deprecated";
|
|
274
|
+
message: string;
|
|
275
|
+
deadline: string;
|
|
276
|
+
} | {
|
|
277
|
+
type: "active";
|
|
278
|
+
} | {
|
|
279
|
+
type: "experimental";
|
|
280
|
+
};
|
|
281
|
+
declare function defineInterface(opts: {
|
|
282
|
+
apiName: string;
|
|
283
|
+
displayName?: string;
|
|
284
|
+
description?: string;
|
|
285
|
+
icon?: {
|
|
286
|
+
locator: BlueprintIcon;
|
|
287
|
+
color: string;
|
|
288
|
+
};
|
|
289
|
+
status?: SimplifiedInterfaceTypeStatus;
|
|
290
|
+
properties?: Record<string, SharedPropertyType | PropertyTypeType>;
|
|
291
|
+
extends?: InterfaceType | InterfaceType[] | string | string[];
|
|
292
|
+
}): InterfaceType;
|
|
293
|
+
|
|
294
|
+
type ApiNameOrInterfaceType = string | InterfaceType;
|
|
295
|
+
type Many = {
|
|
296
|
+
apiName: string;
|
|
297
|
+
from: InterfaceType;
|
|
298
|
+
toMany: ApiNameOrInterfaceType;
|
|
299
|
+
toOne?: never;
|
|
300
|
+
displayName?: string;
|
|
301
|
+
description?: string;
|
|
302
|
+
required?: boolean;
|
|
303
|
+
};
|
|
304
|
+
type One = {
|
|
305
|
+
apiName: string;
|
|
306
|
+
from: InterfaceType;
|
|
307
|
+
toOne: ApiNameOrInterfaceType;
|
|
308
|
+
toMany?: never;
|
|
309
|
+
displayName?: string;
|
|
310
|
+
description?: string;
|
|
311
|
+
required?: boolean;
|
|
312
|
+
};
|
|
313
|
+
declare function defineInterfaceLinkConstraint(linkDef: One | Many): void;
|
|
314
|
+
|
|
315
|
+
declare function defineObject(objectDef: ObjectType): ObjectType;
|
|
316
|
+
|
|
317
|
+
declare function defineSharedPropertyType(opts: {
|
|
318
|
+
apiName: string;
|
|
319
|
+
type: PropertyTypeType;
|
|
320
|
+
array?: boolean;
|
|
321
|
+
description?: string;
|
|
322
|
+
displayName?: string;
|
|
323
|
+
valueType?: ApiNameValueTypeReference;
|
|
324
|
+
typeClasses?: SharedPropertyType["typeClasses"];
|
|
325
|
+
gothamMapping?: SharedPropertyTypeGothamMapping;
|
|
326
|
+
}): SharedPropertyType;
|
|
327
|
+
|
|
328
|
+
type NewValueTypeDefinitionBacking = {
|
|
329
|
+
[Type in ValueTypeType as Type["type"]]: {
|
|
330
|
+
type: Type["value"];
|
|
331
|
+
constraints?: Type["constraints"];
|
|
332
|
+
};
|
|
333
|
+
};
|
|
334
|
+
type NewValueTypeDefinition = NewValueTypeDefinitionBacking[keyof NewValueTypeDefinitionBacking];
|
|
335
|
+
declare function defineValueType(opts: {
|
|
336
|
+
apiName: string;
|
|
337
|
+
displayName: string;
|
|
338
|
+
description?: string;
|
|
339
|
+
type: NewValueTypeDefinition;
|
|
340
|
+
version: string;
|
|
341
|
+
}): ValueTypeDefinitionVersion;
|
|
342
|
+
|
|
343
|
+
export { main as default, defineInterface, defineInterfaceLinkConstraint, defineObject, defineSharedPropertyType, defineValueType, importSharedPropertyType };
|
|
@@ -0,0 +1,47 @@
|
|
|
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
|
+
|
|
17
|
+
import invariant from "tiny-invariant";
|
|
18
|
+
import { ontologyDefinition } from "./defineOntology.js";
|
|
19
|
+
/**
|
|
20
|
+
* Defines a foreign shared property type you want to take as an input to your product. The typeHint field is used for OSDK generation
|
|
21
|
+
*/
|
|
22
|
+
export function importSharedPropertyType(opts) {
|
|
23
|
+
const {
|
|
24
|
+
apiName,
|
|
25
|
+
packageName,
|
|
26
|
+
typeHint
|
|
27
|
+
} = opts;
|
|
28
|
+
if (packageName !== undefined) {
|
|
29
|
+
ontologyDefinition.importedTypes.sharedPropertyTypes.push({
|
|
30
|
+
apiName,
|
|
31
|
+
packageName
|
|
32
|
+
});
|
|
33
|
+
!!packageName.endsWith(".") ? process.env.NODE_ENV !== "production" ? invariant(false, "Package name format invalid ends with period") : invariant(false) : void 0;
|
|
34
|
+
!(packageName.match("[A-Z]") == null) ? process.env.NODE_ENV !== "production" ? invariant(false, "Package name includes upper case characters") : invariant(false) : void 0;
|
|
35
|
+
return {
|
|
36
|
+
apiName: packageName + "." + apiName,
|
|
37
|
+
type: typeHint,
|
|
38
|
+
nonNameSpacedApiName: apiName
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
return {
|
|
42
|
+
apiName: apiName,
|
|
43
|
+
type: typeHint,
|
|
44
|
+
nonNameSpacedApiName: apiName
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=defineImportSpt.js.map
|
|
@@ -0,0 +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","nonNameSpacedApiName"],"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 {\n apiName: packageName + \".\" + apiName,\n type: typeHint,\n nonNameSpacedApiName: apiName,\n };\n }\n return { apiName: apiName, type: typeHint, nonNameSpacedApiName: apiName };\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;MACLI,OAAO,EAAEC,WAAW,GAAG,GAAG,GAAGD,OAAO;MACpCY,IAAI,EAAEV,QAAQ;MACdW,oBAAoB,EAAEb;IACxB,CAAC;EACH;EACA,OAAO;IAAEA,OAAO,EAAEA,OAAO;IAAEY,IAAI,EAAEV,QAAQ;IAAEW,oBAAoB,EAAEb;EAAQ,CAAC;AAC5E","ignoreList":[]}
|
|
@@ -13,15 +13,16 @@
|
|
|
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";
|
|
19
20
|
export function defineInterface(opts) {
|
|
20
21
|
const apiName = namespace + opts.apiName;
|
|
21
|
-
!(ontologyDefinition.interfaceTypes[apiName] === undefined) ? invariant(false, `Interface ${apiName} already exists`) : void 0;
|
|
22
|
+
!(ontologyDefinition.interfaceTypes[apiName] === undefined) ? process.env.NODE_ENV !== "production" ? invariant(false, `Interface ${apiName} already exists`) : invariant(false) : void 0;
|
|
22
23
|
const properties = Object.fromEntries(Object.entries(opts.properties ?? {}).map(([apiName, type]) => {
|
|
23
|
-
if (typeof type === "string") {
|
|
24
|
-
!
|
|
24
|
+
if (typeof type === "string" || typeof type === "object" && !("apiName" in type)) {
|
|
25
|
+
!isPropertyTypeType(type) ? process.env.NODE_ENV !== "production" ? invariant(false, `Invalid data type ${JSON.stringify(type)} for property ${apiName} on InterfaceType ${apiName}`) : invariant(false) : void 0;
|
|
25
26
|
const spt = defineSharedPropertyType({
|
|
26
27
|
apiName,
|
|
27
28
|
displayName: apiName,
|
|
@@ -30,10 +31,11 @@ export function defineInterface(opts) {
|
|
|
30
31
|
});
|
|
31
32
|
return [apiName, spt];
|
|
32
33
|
} else {
|
|
33
|
-
|
|
34
|
+
const unNamespacedTypeApiName = type.apiName.slice(type.apiName.lastIndexOf(".") + 1);
|
|
35
|
+
!(namespace + apiName === type.apiName || apiName === unNamespacedTypeApiName) ? process.env.NODE_ENV !== "production" ? invariant(false, `property key and it's apiName must be identical. ${JSON.stringify({
|
|
34
36
|
key: apiName,
|
|
35
37
|
apiName: type.apiName
|
|
36
|
-
})}`) : void 0;
|
|
38
|
+
})}`) : invariant(false) : void 0;
|
|
37
39
|
return [apiName, type];
|
|
38
40
|
}
|
|
39
41
|
}));
|
|
@@ -49,6 +51,10 @@ export function defineInterface(opts) {
|
|
|
49
51
|
extendsInterfaces = opts.extends.map(item => item.apiName);
|
|
50
52
|
}
|
|
51
53
|
}
|
|
54
|
+
const status = mapSimplifiedStatusToInterfaceTypeStatus(opts.status ?? {
|
|
55
|
+
type: "active"
|
|
56
|
+
});
|
|
57
|
+
!(status.type !== "deprecated" || status.deprecated.message && status.deprecated.deadline) ? process.env.NODE_ENV !== "production" ? invariant(false, `Deprecated status must include message and deadline properties.`) : invariant(false) : void 0;
|
|
52
58
|
const a = {
|
|
53
59
|
apiName,
|
|
54
60
|
displayMetadata: {
|
|
@@ -65,14 +71,36 @@ export function defineInterface(opts) {
|
|
|
65
71
|
extendsInterfaces: extendsInterfaces,
|
|
66
72
|
links: [],
|
|
67
73
|
properties,
|
|
68
|
-
status
|
|
69
|
-
type: "active",
|
|
70
|
-
active: {}
|
|
71
|
-
}
|
|
74
|
+
status
|
|
72
75
|
};
|
|
73
76
|
return ontologyDefinition.interfaceTypes[apiName] = a;
|
|
74
77
|
}
|
|
75
|
-
function
|
|
76
|
-
return v === "boolean" || v === "byte" || v === "date" || v === "decimal" || v === "double" || v === "float" || v === "geopoint" || v === "geoshape" || v === "integer" || v === "long" || v === "marking" || v === "short" || v === "string" || v === "timestamp";
|
|
78
|
+
function isPropertyTypeType(v) {
|
|
79
|
+
return v === "boolean" || v === "byte" || v === "date" || v === "decimal" || v === "double" || v === "float" || v === "geopoint" || v === "geoshape" || v === "integer" || v === "long" || typeof v === "object" && v.type === "marking" || v === "short" || v === "string" || v === "timestamp";
|
|
80
|
+
}
|
|
81
|
+
function mapSimplifiedStatusToInterfaceTypeStatus(status) {
|
|
82
|
+
switch (status.type) {
|
|
83
|
+
case "deprecated":
|
|
84
|
+
return {
|
|
85
|
+
type: "deprecated",
|
|
86
|
+
deprecated: {
|
|
87
|
+
message: status.message,
|
|
88
|
+
deadline: status.deadline,
|
|
89
|
+
replacedBy: undefined
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
case "active":
|
|
93
|
+
return {
|
|
94
|
+
type: "active",
|
|
95
|
+
active: {}
|
|
96
|
+
};
|
|
97
|
+
case "experimental":
|
|
98
|
+
return {
|
|
99
|
+
type: "experimental",
|
|
100
|
+
experimental: {}
|
|
101
|
+
};
|
|
102
|
+
default:
|
|
103
|
+
throw new Error(`Invalid status type: ${status.type}`);
|
|
104
|
+
}
|
|
77
105
|
}
|
|
78
106
|
//# sourceMappingURL=defineInterface.js.map
|