@osdk/faux 0.2.0-rc.19 → 0.2.1
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 +32 -0
- package/build/browser/FauxFoundry/FauxOntology.js +4 -2
- package/build/browser/FauxFoundry/FauxOntology.js.map +1 -1
- package/build/browser/handlers/createQueryHandlers.js +1 -1
- package/build/browser/handlers/createQueryHandlers.js.map +1 -1
- package/build/cjs/index.cjs +28 -21
- package/build/cjs/index.cjs.map +1 -1
- package/build/esm/FauxFoundry/FauxOntology.js +4 -2
- package/build/esm/FauxFoundry/FauxOntology.js.map +1 -1
- package/build/esm/handlers/createQueryHandlers.js +1 -1
- package/build/esm/handlers/createQueryHandlers.js.map +1 -1
- package/build/types/FauxFoundry/FauxOntology.d.ts.map +1 -1
- package/package.json +9 -9
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,37 @@
|
|
|
1
1
|
# @osdk/shared.test
|
|
2
2
|
|
|
3
|
+
## 0.2.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 9cceb0f: Update Platform SDK dependencies
|
|
8
|
+
- ebf35cf: Fix applyQuery for marketplace installations
|
|
9
|
+
- Updated dependencies [9cceb0f]
|
|
10
|
+
- @osdk/generator-converters@2.4.1
|
|
11
|
+
- @osdk/api@2.4.1
|
|
12
|
+
|
|
13
|
+
## 0.2.0
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- 150da1a: Simulated release
|
|
18
|
+
- 4bc848b: Add interface link support.
|
|
19
|
+
- 1c1c2c4: Properly handles one to many links
|
|
20
|
+
- Updated dependencies [322c5bc]
|
|
21
|
+
- Updated dependencies [322c5bc]
|
|
22
|
+
- Updated dependencies [4bc848b]
|
|
23
|
+
- Updated dependencies [9f4fe9e]
|
|
24
|
+
- Updated dependencies [29d2ada]
|
|
25
|
+
- Updated dependencies [8dd6229]
|
|
26
|
+
- Updated dependencies [8c95154]
|
|
27
|
+
- Updated dependencies [c32dcf2]
|
|
28
|
+
- Updated dependencies [722c89a]
|
|
29
|
+
- Updated dependencies [9101bad]
|
|
30
|
+
- Updated dependencies [44bbbe0]
|
|
31
|
+
- Updated dependencies [f277b30]
|
|
32
|
+
- @osdk/api@2.4.0
|
|
33
|
+
- @osdk/generator-converters@2.4.0
|
|
34
|
+
|
|
3
35
|
## 0.2.0-rc.19
|
|
4
36
|
|
|
5
37
|
### Patch Changes
|
|
@@ -33,7 +33,8 @@ export class FauxOntology {
|
|
|
33
33
|
objectTypes: {},
|
|
34
34
|
ontology,
|
|
35
35
|
queryTypes: {},
|
|
36
|
-
sharedPropertyTypes: {}
|
|
36
|
+
sharedPropertyTypes: {},
|
|
37
|
+
valueTypes: {}
|
|
37
38
|
};
|
|
38
39
|
}
|
|
39
40
|
get apiName() {
|
|
@@ -52,7 +53,8 @@ export class FauxOntology {
|
|
|
52
53
|
actionTypes: filterRecord(this.#ontology.actionTypes, request.actionTypes),
|
|
53
54
|
queryTypes: this.#getFilteredQueryTypes(request),
|
|
54
55
|
interfaceTypes: filterRecord(this.#ontology.interfaceTypes, request.interfaceTypes),
|
|
55
|
-
sharedPropertyTypes: {}
|
|
56
|
+
sharedPropertyTypes: {},
|
|
57
|
+
valueTypes: {}
|
|
56
58
|
};
|
|
57
59
|
}
|
|
58
60
|
getAllInterfaceTypes() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FauxOntology.js","names":["semver","valid","invariant","ActionNotFoundError","LinkTypeNotFound","ObjectNotFoundError","ObjectTypeDoesNotExistError","QueryNotFoundError","OpenApiCallError","FauxOntology","ontology","actionImpl","Map","queryImpl","constructor","actionTypes","interfaceTypes","objectTypes","queryTypes","sharedPropertyTypes","apiName","getOntologyFullMetadata","getFilteredOntologyMetadata","request","Object","fromEntries","entries","filter","objectType","includes","map","objectTypeApiName","objectTypeDefinition","linkTypes","linkType","filterRecord","getFilteredQueryTypes","getAllInterfaceTypes","values","getAllObjectTypes","getAllActionTypes","getAllQueryTypes","getInterfaceType","interfaceType","ret","undefined","getObjectTypeFullMetadata","getObjectTypeFullMetadataOrThrow","getActionDef","actionTypeApiName","actionType","getActionImpl","impl","get","process","env","NODE_ENV","getQueryDef","queryTypeApiNameAndVersion","queryType","convertToVersionedApiName","getQueryImpl","queryTypeApiName","version","versionMap","rsort","Array","from","keys","getInterfaceToObjectTypeMappings","objectApiNames","objectDefs","ifaceToObjMap","objDef","ifaceApiName","properties","implementsInterfaces2","getLinkTypeSideV2","linkTypeName","find","a","getOtherLinkTypeSideV2OrThrow","thisSideLink","otherObj","candidates","l","linkTypeRid","length","candidate","getBothLinkTypeSides","leftObjectType","leftLinkName","rightObjectType","leftTypeSideV2","rightTypeSideV2","registerObjectType","def","Error","registerActionType","implementation","set","registerQueryType","has","registerInterfaceType","registerSharedPropertyType","#getFilteredQueryTypes","remappedQueryTypes","x","queryTypeDefinition","indexOf","#convertToVersionedApiName","extractVersion","split","record","key"],"sources":["FauxOntology.ts"],"sourcesContent":["/*\n * Copyright 2023 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 ObjectTypeDefinition } from \"@osdk/api\";\nimport type * as OntologiesV2 from \"@osdk/foundry.ontologies\";\nimport type {\n LoadOntologyMetadataRequest,\n VersionedQueryTypeApiName,\n} from \"@osdk/internal.foundry.ontologies\";\nimport semver, { valid } from \"semver\";\nimport invariant from \"tiny-invariant\";\nimport type { ReadonlyDeep } from \"type-fest\";\nimport {\n ActionNotFoundError,\n LinkTypeNotFound,\n ObjectNotFoundError,\n ObjectTypeDoesNotExistError,\n QueryNotFoundError,\n} from \"../errors.js\";\nimport { OpenApiCallError } from \"../handlers/util/handleOpenApiCall.js\";\nimport type { FauxActionImpl } from \"./FauxActionImpl.js\";\nimport type { FauxQueryImpl } from \"./FauxQueryImpl.js\";\nimport type { TH_ObjectTypeFullMetadata } from \"./typeHelpers/TH_ObjectTypeFullMetadata.js\";\n\n/**\n * Currently Unsupported Concepts:\n * - many:many links.\n */\nexport class FauxOntology {\n #ontology: OntologiesV2.OntologyFullMetadata;\n #actionImpl: Map<OntologiesV2.ActionTypeApiName, FauxActionImpl> = new Map();\n #queryImpl: Map<\n OntologiesV2.QueryApiName,\n Map<OntologiesV2.FunctionVersion, FauxQueryImpl>\n > = new Map();\n\n constructor(ontology: OntologiesV2.OntologyV2) {\n this.#ontology = {\n actionTypes: {},\n interfaceTypes: {},\n objectTypes: {},\n ontology,\n queryTypes: {},\n sharedPropertyTypes: {},\n };\n }\n\n get apiName(): OntologiesV2.OntologyApiName {\n return this.#ontology.ontology.apiName;\n }\n\n getOntologyFullMetadata(): OntologiesV2.OntologyFullMetadata {\n return this.#ontology;\n }\n\n getFilteredOntologyMetadata(\n request: OntologiesV2.LoadOntologyMetadataRequest,\n ): OntologiesV2.OntologyFullMetadata {\n return {\n ontology: this.#ontology.ontology,\n objectTypes: Object.fromEntries(\n Object.entries(this.#ontology.objectTypes).filter(([objectType]) =>\n request.objectTypes.includes(objectType)\n ).map(([objectTypeApiName, objectTypeDefinition]) => [\n objectTypeApiName,\n {\n ...objectTypeDefinition,\n linkTypes: objectTypeDefinition.linkTypes.filter(linkType =>\n request.linkTypes.includes(linkType.apiName)\n ),\n },\n ]),\n ),\n actionTypes: filterRecord(\n this.#ontology.actionTypes,\n request.actionTypes,\n ),\n queryTypes: this.#getFilteredQueryTypes(request),\n\n interfaceTypes: filterRecord(\n this.#ontology.interfaceTypes,\n request.interfaceTypes,\n ),\n sharedPropertyTypes: {},\n };\n }\n\n getAllInterfaceTypes(): OntologiesV2.InterfaceType[] {\n return Object.values(this.#ontology.interfaceTypes);\n }\n\n getAllObjectTypes(): OntologiesV2.ObjectTypeFullMetadata[] {\n return Object.values(this.#ontology.objectTypes);\n }\n\n getAllActionTypes(): OntologiesV2.ActionTypeV2[] {\n return Object.values(this.#ontology.actionTypes);\n }\n\n getAllQueryTypes(): OntologiesV2.QueryTypeV2[] {\n return Object.values(this.#ontology.queryTypes);\n }\n\n getInterfaceType(interfaceType: string): OntologiesV2.InterfaceType {\n const ret = this.#ontology.interfaceTypes[interfaceType];\n\n if (ret === undefined) {\n throw new OpenApiCallError(\n 404,\n ObjectNotFoundError(interfaceType, \"\"),\n );\n }\n\n return (\n this.#ontology.interfaceTypes[interfaceType]\n );\n }\n\n public getObjectTypeFullMetadata(\n objectTypeApiName: string,\n ): OntologiesV2.ObjectTypeFullMetadata | undefined {\n return this.#ontology.objectTypes[objectTypeApiName];\n }\n\n public getObjectTypeFullMetadataOrThrow(\n objectTypeApiName: string,\n ): OntologiesV2.ObjectTypeFullMetadata {\n const objectType = this.#ontology.objectTypes[objectTypeApiName];\n if (objectType === undefined) {\n throw new OpenApiCallError(\n 404,\n ObjectTypeDoesNotExistError(objectTypeApiName),\n );\n }\n return objectType;\n }\n\n public getActionDef(actionTypeApiName: string): OntologiesV2.ActionTypeV2 {\n const actionType = this.#ontology.actionTypes[actionTypeApiName];\n if (actionType === undefined) {\n throw new OpenApiCallError(\n 404,\n ActionNotFoundError(),\n );\n }\n return actionType;\n }\n\n public getActionImpl(actionTypeApiName: string): FauxActionImpl {\n const impl = this.#actionImpl.get(actionTypeApiName);\n invariant(impl, \"Action implementation not found for \" + actionTypeApiName);\n return impl;\n }\n\n public getQueryDef(\n queryTypeApiNameAndVersion: string,\n ): OntologiesV2.QueryTypeV2 {\n const queryType = this.#ontology\n .queryTypes[this.#convertToVersionedApiName(queryTypeApiNameAndVersion)];\n if (queryType === undefined) {\n throw new OpenApiCallError(\n 404,\n QueryNotFoundError(queryTypeApiNameAndVersion),\n );\n }\n return queryType;\n }\n\n public getQueryImpl(\n queryTypeApiName: string,\n version?: string,\n ): FauxQueryImpl {\n const versionMap = this.#queryImpl.get(queryTypeApiName);\n\n const impl = version !== undefined\n ? versionMap?.get(version)\n : versionMap?.get(semver.rsort(Array.from(versionMap.keys() ?? []))[0]);\n\n if (!impl) {\n throw new OpenApiCallError(\n 404,\n QueryNotFoundError(queryTypeApiName),\n );\n }\n invariant(impl, \"Query implementation not found for \" + queryTypeApiName);\n return impl;\n }\n\n public getInterfaceToObjectTypeMappings(\n objectApiNames: Iterable<OntologiesV2.ObjectTypeApiName>,\n ): Record<\n OntologiesV2.InterfaceTypeApiName,\n OntologiesV2.InterfaceToObjectTypeMappings\n > {\n const objectDefs = Array.from(objectApiNames).map(apiName =>\n this.getObjectTypeFullMetadataOrThrow(apiName)\n );\n\n const ifaceToObjMap: Record<\n OntologiesV2.InterfaceTypeApiName,\n OntologiesV2.InterfaceToObjectTypeMappings\n > = {};\n\n for (const objDef of objectDefs) {\n for (\n const [ifaceApiName, { properties }] of Object.entries(\n objDef.implementsInterfaces2,\n )\n ) {\n if (ifaceToObjMap[ifaceApiName] === undefined) {\n ifaceToObjMap[ifaceApiName] = {};\n }\n\n ifaceToObjMap[ifaceApiName][objDef.objectType.apiName] = properties;\n }\n }\n\n return ifaceToObjMap;\n }\n\n public getLinkTypeSideV2(\n objectTypeApiName: string,\n linkTypeName: string,\n ): OntologiesV2.LinkTypeSideV2 {\n const objectType = this.getObjectTypeFullMetadataOrThrow(objectTypeApiName);\n const linkType = objectType.linkTypes.find((a) =>\n a.apiName === linkTypeName\n );\n if (linkType === undefined) {\n throw new OpenApiCallError(\n 404,\n LinkTypeNotFound(objectTypeApiName, linkTypeName),\n );\n }\n return linkType;\n }\n\n public getOtherLinkTypeSideV2OrThrow(\n objectTypeApiName: string,\n linkTypeName: string,\n ): OntologiesV2.LinkTypeSideV2 {\n const thisSideLink = this.getLinkTypeSideV2(\n objectTypeApiName,\n linkTypeName,\n );\n const otherObj = this.getObjectTypeFullMetadataOrThrow(\n thisSideLink.objectTypeApiName,\n );\n const candidates = otherObj.linkTypes.filter(l =>\n l.linkTypeRid === thisSideLink.linkTypeRid\n );\n if (otherObj.objectType.apiName !== objectTypeApiName) {\n // if its not the same object type then there should only be one\n invariant(\n candidates.length === 1,\n \"Expected only one candidate link type\",\n );\n return candidates[0];\n }\n // if its the same object type, then this could be a link that points to itself that\n // is 1:1, many:1 or many:many. In the 1:1 case, the link could have the same name\n // and there would only be 1 entry in that case. Otherwise there should be 2 entries\n // and we want the one that doesn't match the one passed in.\n if (candidates.length === 1) {\n return candidates[0];\n }\n invariant(\n candidates.length === 2,\n \"Expected only two candidate link types\",\n );\n const candidate = candidates.find(l => l.apiName !== thisSideLink.apiName);\n invariant(\n candidate,\n \"Expected to find a candidate link type that is not the same as the one passed in\",\n );\n return candidate;\n }\n\n getBothLinkTypeSides(\n leftObjectType: string,\n leftLinkName: string,\n rightObjectType: string,\n ): [OntologiesV2.LinkTypeSideV2, OntologiesV2.LinkTypeSideV2] {\n const leftTypeSideV2 = this.getLinkTypeSideV2(\n leftObjectType,\n leftLinkName,\n );\n\n // the rhs passed in should match the target of the lhs\n invariant(rightObjectType === leftTypeSideV2.objectTypeApiName);\n\n const rightTypeSideV2 = this.getOtherLinkTypeSideV2OrThrow(\n leftObjectType,\n leftLinkName,\n );\n\n return [leftTypeSideV2, rightTypeSideV2];\n }\n\n registerObjectType<Q extends ObjectTypeDefinition>(\n def: TH_ObjectTypeFullMetadata<Q>,\n ): void;\n registerObjectType(\n def: ReadonlyDeep<OntologiesV2.ObjectTypeFullMetadata>,\n ): void;\n registerObjectType<Q extends ObjectTypeDefinition>(\n def:\n | TH_ObjectTypeFullMetadata<Q>\n | OntologiesV2.ObjectTypeFullMetadata,\n ): void {\n if (def.objectType.apiName in this.#ontology.objectTypes) {\n throw new Error(\n `ObjectType ${def.objectType.apiName} already registered`,\n );\n }\n this.#ontology.objectTypes[def.objectType.apiName] = def;\n }\n\n registerActionType<Q extends OntologiesV2.ActionTypeV2>(\n def: Q,\n implementation?: FauxActionImpl<Q>,\n ): void;\n registerActionType(\n def: OntologiesV2.ActionTypeV2,\n implementation?: FauxActionImpl,\n ): void;\n registerActionType(\n def: OntologiesV2.ActionTypeV2,\n implementation?: FauxActionImpl,\n ): void {\n if (def.apiName in this.#ontology.actionTypes) {\n throw new Error(\n `ActionType ${def.apiName} already registered`,\n );\n }\n this.#ontology.actionTypes[def.apiName] = def;\n if (implementation) {\n this.#actionImpl.set(def.apiName, implementation);\n }\n }\n\n registerQueryType(\n def: OntologiesV2.QueryTypeV2,\n implementation?: FauxQueryImpl,\n ): void {\n if (`${def.apiName}:${def.version}` in this.#ontology.queryTypes) {\n throw new Error(\n `QueryType ${def.apiName} already registered`,\n );\n }\n this.#ontology\n .queryTypes[\n `${def.apiName}:${def.version}` as VersionedQueryTypeApiName\n ] = def;\n if (implementation) {\n if (!this.#queryImpl.has(def.apiName)) {\n this.#queryImpl.set(def.apiName, new Map());\n }\n if (!valid(def.version)) {\n throw new Error(\n `QueryType ${def.apiName} version ${def.version} is not semver valid`,\n );\n }\n this.#queryImpl.get(def.apiName)?.set(\n def.version,\n implementation,\n );\n }\n }\n\n registerInterfaceType(def: OntologiesV2.InterfaceType): void {\n if (def.apiName in this.#ontology.interfaceTypes) {\n throw new Error(\n `InterfaceType ${def.apiName} already registered`,\n );\n }\n this.#ontology.interfaceTypes[def.apiName] = def;\n }\n\n registerSharedPropertyType(def: OntologiesV2.SharedPropertyType): void {\n if (def.apiName in this.#ontology.sharedPropertyTypes) {\n throw new Error(\n `SharedPropertyType ${def.apiName} already registered`,\n );\n }\n this.#ontology.sharedPropertyTypes[def.apiName] = def;\n }\n\n #getFilteredQueryTypes(request: LoadOntologyMetadataRequest): Record<\n OntologiesV2.QueryApiName,\n OntologiesV2.QueryTypeV2\n > {\n const remappedQueryTypes = request.queryTypes.map(x =>\n this.#convertToVersionedApiName(x)\n );\n return Object.fromEntries(\n Object.entries(this.#ontology.queryTypes).filter((\n [queryTypeApiName],\n ) => remappedQueryTypes.includes(queryTypeApiName)).map((\n [queryTypeApiName, queryTypeDefinition],\n ) => [\n request.queryTypes[remappedQueryTypes.indexOf(queryTypeApiName)],\n queryTypeDefinition,\n ]),\n );\n }\n\n #convertToVersionedApiName(\n apiName: string,\n ): VersionedQueryTypeApiName {\n // If a query is requested without a version, we remap it to include a versioned api name with the latest version\n if (extractVersion(apiName) !== undefined) {\n return apiName as VersionedQueryTypeApiName;\n }\n const version = semver.rsort(\n Object.keys(this.#ontology.queryTypes).filter(\n queryTypeApiName => queryTypeApiName.split(\":\")[0] === apiName,\n ).map(x => extractVersion(x)),\n )[0];\n return `${apiName}:${version}`;\n }\n}\n\nfunction filterRecord<T>(\n record: Record<string, T>,\n keys: string[],\n): Record<string, T> {\n return Object.fromEntries(\n Object.entries(record).filter(([key]) => keys.includes(key)),\n );\n}\n\nfunction extractVersion(\n apiName: string,\n): string {\n return apiName.split(\":\")[1];\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAQA,OAAOA,MAAM,IAAIC,KAAK,QAAQ,QAAQ;AACtC,OAAOC,SAAS,MAAM,gBAAgB;AAEtC,SACEC,mBAAmB,EACnBC,gBAAgB,EAChBC,mBAAmB,EACnBC,2BAA2B,EAC3BC,kBAAkB,QACb,cAAc;AACrB,SAASC,gBAAgB,QAAQ,uCAAuC;AAKxE;AACA;AACA;AACA;AACA,OAAO,MAAMC,YAAY,CAAC;EACxB,CAACC,QAAQ;EACT,CAACC,UAAU,GAAwD,IAAIC,GAAG,CAAC,CAAC;EAC5E,CAACC,SAAS,GAGN,IAAID,GAAG,CAAC,CAAC;EAEbE,WAAWA,CAACJ,QAAiC,EAAE;IAC7C,IAAI,CAAC,CAACA,QAAQ,GAAG;MACfK,WAAW,EAAE,CAAC,CAAC;MACfC,cAAc,EAAE,CAAC,CAA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I2C,OAAO,EAAE;EAChC;AACF;AAEA,SAAS5B,YAAYA,CACnB8E,MAAyB,EACzB7C,IAAc,EACK;EACnB,OAAO5C,MAAM,CAACC,WAAW,CACvBD,MAAM,CAACE,OAAO,CAACuF,MAAM,CAAC,CAACtF,MAAM,CAAC,CAAC,CAACuF,GAAG,CAAC,KAAK9C,IAAI,CAACvC,QAAQ,CAACqF,GAAG,CAAC,CAC7D,CAAC;AACH;AAEA,SAASH,cAAcA,CACrB3F,OAAe,EACP;EACR,OAAOA,OAAO,CAAC4F,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AAC9B","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"FauxOntology.js","names":["semver","valid","invariant","ActionNotFoundError","LinkTypeNotFound","ObjectNotFoundError","ObjectTypeDoesNotExistError","QueryNotFoundError","OpenApiCallError","FauxOntology","ontology","actionImpl","Map","queryImpl","constructor","actionTypes","interfaceTypes","objectTypes","queryTypes","sharedPropertyTypes","valueTypes","apiName","getOntologyFullMetadata","getFilteredOntologyMetadata","request","Object","fromEntries","entries","filter","objectType","includes","map","objectTypeApiName","objectTypeDefinition","linkTypes","linkType","filterRecord","getFilteredQueryTypes","getAllInterfaceTypes","values","getAllObjectTypes","getAllActionTypes","getAllQueryTypes","getInterfaceType","interfaceType","ret","undefined","getObjectTypeFullMetadata","getObjectTypeFullMetadataOrThrow","getActionDef","actionTypeApiName","actionType","getActionImpl","impl","get","process","env","NODE_ENV","getQueryDef","queryTypeApiNameAndVersion","queryType","convertToVersionedApiName","getQueryImpl","queryTypeApiName","version","versionMap","rsort","Array","from","keys","getInterfaceToObjectTypeMappings","objectApiNames","objectDefs","ifaceToObjMap","objDef","ifaceApiName","properties","implementsInterfaces2","getLinkTypeSideV2","linkTypeName","find","a","getOtherLinkTypeSideV2OrThrow","thisSideLink","otherObj","candidates","l","linkTypeRid","length","candidate","getBothLinkTypeSides","leftObjectType","leftLinkName","rightObjectType","leftTypeSideV2","rightTypeSideV2","registerObjectType","def","Error","registerActionType","implementation","set","registerQueryType","has","registerInterfaceType","registerSharedPropertyType","#getFilteredQueryTypes","remappedQueryTypes","x","queryTypeDefinition","indexOf","#convertToVersionedApiName","extractVersion","split","record","key"],"sources":["FauxOntology.ts"],"sourcesContent":["/*\n * Copyright 2023 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 ObjectTypeDefinition } from \"@osdk/api\";\nimport type * as OntologiesV2 from \"@osdk/foundry.ontologies\";\nimport type {\n LoadOntologyMetadataRequest,\n VersionedQueryTypeApiName,\n} from \"@osdk/internal.foundry.ontologies\";\nimport semver, { valid } from \"semver\";\nimport invariant from \"tiny-invariant\";\nimport type { ReadonlyDeep } from \"type-fest\";\nimport {\n ActionNotFoundError,\n LinkTypeNotFound,\n ObjectNotFoundError,\n ObjectTypeDoesNotExistError,\n QueryNotFoundError,\n} from \"../errors.js\";\nimport { OpenApiCallError } from \"../handlers/util/handleOpenApiCall.js\";\nimport type { FauxActionImpl } from \"./FauxActionImpl.js\";\nimport type { FauxQueryImpl } from \"./FauxQueryImpl.js\";\nimport type { TH_ObjectTypeFullMetadata } from \"./typeHelpers/TH_ObjectTypeFullMetadata.js\";\n\n/**\n * Currently Unsupported Concepts:\n * - many:many links.\n */\nexport class FauxOntology {\n #ontology: OntologiesV2.OntologyFullMetadata;\n #actionImpl: Map<OntologiesV2.ActionTypeApiName, FauxActionImpl> = new Map();\n #queryImpl: Map<\n OntologiesV2.QueryApiName,\n Map<OntologiesV2.FunctionVersion, FauxQueryImpl>\n > = new Map();\n\n constructor(ontology: OntologiesV2.OntologyV2) {\n this.#ontology = {\n actionTypes: {},\n interfaceTypes: {},\n objectTypes: {},\n ontology,\n queryTypes: {},\n sharedPropertyTypes: {},\n valueTypes: {},\n };\n }\n\n get apiName(): OntologiesV2.OntologyApiName {\n return this.#ontology.ontology.apiName;\n }\n\n getOntologyFullMetadata(): OntologiesV2.OntologyFullMetadata {\n return this.#ontology;\n }\n\n getFilteredOntologyMetadata(\n request: OntologiesV2.LoadOntologyMetadataRequest,\n ): OntologiesV2.OntologyFullMetadata {\n return {\n ontology: this.#ontology.ontology,\n objectTypes: Object.fromEntries(\n Object.entries(this.#ontology.objectTypes).filter(([objectType]) =>\n request.objectTypes.includes(objectType)\n ).map(([objectTypeApiName, objectTypeDefinition]) => [\n objectTypeApiName,\n {\n ...objectTypeDefinition,\n linkTypes: objectTypeDefinition.linkTypes.filter(linkType =>\n request.linkTypes.includes(linkType.apiName)\n ),\n },\n ]),\n ),\n actionTypes: filterRecord(\n this.#ontology.actionTypes,\n request.actionTypes,\n ),\n queryTypes: this.#getFilteredQueryTypes(request),\n\n interfaceTypes: filterRecord(\n this.#ontology.interfaceTypes,\n request.interfaceTypes,\n ),\n sharedPropertyTypes: {},\n valueTypes: {},\n };\n }\n\n getAllInterfaceTypes(): OntologiesV2.InterfaceType[] {\n return Object.values(this.#ontology.interfaceTypes);\n }\n\n getAllObjectTypes(): OntologiesV2.ObjectTypeFullMetadata[] {\n return Object.values(this.#ontology.objectTypes);\n }\n\n getAllActionTypes(): OntologiesV2.ActionTypeV2[] {\n return Object.values(this.#ontology.actionTypes);\n }\n\n getAllQueryTypes(): OntologiesV2.QueryTypeV2[] {\n return Object.values(this.#ontology.queryTypes);\n }\n\n getInterfaceType(interfaceType: string): OntologiesV2.InterfaceType {\n const ret = this.#ontology.interfaceTypes[interfaceType];\n\n if (ret === undefined) {\n throw new OpenApiCallError(\n 404,\n ObjectNotFoundError(interfaceType, \"\"),\n );\n }\n\n return (\n this.#ontology.interfaceTypes[interfaceType]\n );\n }\n\n public getObjectTypeFullMetadata(\n objectTypeApiName: string,\n ): OntologiesV2.ObjectTypeFullMetadata | undefined {\n return this.#ontology.objectTypes[objectTypeApiName];\n }\n\n public getObjectTypeFullMetadataOrThrow(\n objectTypeApiName: string,\n ): OntologiesV2.ObjectTypeFullMetadata {\n const objectType = this.#ontology.objectTypes[objectTypeApiName];\n if (objectType === undefined) {\n throw new OpenApiCallError(\n 404,\n ObjectTypeDoesNotExistError(objectTypeApiName),\n );\n }\n return objectType;\n }\n\n public getActionDef(actionTypeApiName: string): OntologiesV2.ActionTypeV2 {\n const actionType = this.#ontology.actionTypes[actionTypeApiName];\n if (actionType === undefined) {\n throw new OpenApiCallError(\n 404,\n ActionNotFoundError(),\n );\n }\n return actionType;\n }\n\n public getActionImpl(actionTypeApiName: string): FauxActionImpl {\n const impl = this.#actionImpl.get(actionTypeApiName);\n invariant(impl, \"Action implementation not found for \" + actionTypeApiName);\n return impl;\n }\n\n public getQueryDef(\n queryTypeApiNameAndVersion: string,\n ): OntologiesV2.QueryTypeV2 {\n const queryType = this.#ontology\n .queryTypes[this.#convertToVersionedApiName(queryTypeApiNameAndVersion)];\n if (queryType === undefined) {\n throw new OpenApiCallError(\n 404,\n QueryNotFoundError(queryTypeApiNameAndVersion),\n );\n }\n return queryType;\n }\n\n public getQueryImpl(\n queryTypeApiName: string,\n version?: string,\n ): FauxQueryImpl {\n const versionMap = this.#queryImpl.get(queryTypeApiName);\n\n const impl = version !== undefined\n ? versionMap?.get(version)\n : versionMap?.get(semver.rsort(Array.from(versionMap.keys() ?? []))[0]);\n\n if (!impl) {\n throw new OpenApiCallError(\n 404,\n QueryNotFoundError(queryTypeApiName),\n );\n }\n invariant(impl, \"Query implementation not found for \" + queryTypeApiName);\n return impl;\n }\n\n public getInterfaceToObjectTypeMappings(\n objectApiNames: Iterable<OntologiesV2.ObjectTypeApiName>,\n ): Record<\n OntologiesV2.InterfaceTypeApiName,\n OntologiesV2.InterfaceToObjectTypeMappings\n > {\n const objectDefs = Array.from(objectApiNames).map(apiName =>\n this.getObjectTypeFullMetadataOrThrow(apiName)\n );\n\n const ifaceToObjMap: Record<\n OntologiesV2.InterfaceTypeApiName,\n OntologiesV2.InterfaceToObjectTypeMappings\n > = {};\n\n for (const objDef of objectDefs) {\n for (\n const [ifaceApiName, { properties }] of Object.entries(\n objDef.implementsInterfaces2,\n )\n ) {\n if (ifaceToObjMap[ifaceApiName] === undefined) {\n ifaceToObjMap[ifaceApiName] = {};\n }\n\n ifaceToObjMap[ifaceApiName][objDef.objectType.apiName] = properties;\n }\n }\n\n return ifaceToObjMap;\n }\n\n public getLinkTypeSideV2(\n objectTypeApiName: string,\n linkTypeName: string,\n ): OntologiesV2.LinkTypeSideV2 {\n const objectType = this.getObjectTypeFullMetadataOrThrow(objectTypeApiName);\n const linkType = objectType.linkTypes.find((a) =>\n a.apiName === linkTypeName\n );\n if (linkType === undefined) {\n throw new OpenApiCallError(\n 404,\n LinkTypeNotFound(objectTypeApiName, linkTypeName),\n );\n }\n return linkType;\n }\n\n public getOtherLinkTypeSideV2OrThrow(\n objectTypeApiName: string,\n linkTypeName: string,\n ): OntologiesV2.LinkTypeSideV2 {\n const thisSideLink = this.getLinkTypeSideV2(\n objectTypeApiName,\n linkTypeName,\n );\n const otherObj = this.getObjectTypeFullMetadataOrThrow(\n thisSideLink.objectTypeApiName,\n );\n const candidates = otherObj.linkTypes.filter(l =>\n l.linkTypeRid === thisSideLink.linkTypeRid\n );\n if (otherObj.objectType.apiName !== objectTypeApiName) {\n // if its not the same object type then there should only be one\n invariant(\n candidates.length === 1,\n \"Expected only one candidate link type\",\n );\n return candidates[0];\n }\n // if its the same object type, then this could be a link that points to itself that\n // is 1:1, many:1 or many:many. In the 1:1 case, the link could have the same name\n // and there would only be 1 entry in that case. Otherwise there should be 2 entries\n // and we want the one that doesn't match the one passed in.\n if (candidates.length === 1) {\n return candidates[0];\n }\n invariant(\n candidates.length === 2,\n \"Expected only two candidate link types\",\n );\n const candidate = candidates.find(l => l.apiName !== thisSideLink.apiName);\n invariant(\n candidate,\n \"Expected to find a candidate link type that is not the same as the one passed in\",\n );\n return candidate;\n }\n\n getBothLinkTypeSides(\n leftObjectType: string,\n leftLinkName: string,\n rightObjectType: string,\n ): [OntologiesV2.LinkTypeSideV2, OntologiesV2.LinkTypeSideV2] {\n const leftTypeSideV2 = this.getLinkTypeSideV2(\n leftObjectType,\n leftLinkName,\n );\n\n // the rhs passed in should match the target of the lhs\n invariant(rightObjectType === leftTypeSideV2.objectTypeApiName);\n\n const rightTypeSideV2 = this.getOtherLinkTypeSideV2OrThrow(\n leftObjectType,\n leftLinkName,\n );\n\n return [leftTypeSideV2, rightTypeSideV2];\n }\n\n registerObjectType<Q extends ObjectTypeDefinition>(\n def: TH_ObjectTypeFullMetadata<Q>,\n ): void;\n registerObjectType(\n def: ReadonlyDeep<OntologiesV2.ObjectTypeFullMetadata>,\n ): void;\n registerObjectType<Q extends ObjectTypeDefinition>(\n def:\n | TH_ObjectTypeFullMetadata<Q>\n | OntologiesV2.ObjectTypeFullMetadata,\n ): void {\n if (def.objectType.apiName in this.#ontology.objectTypes) {\n throw new Error(\n `ObjectType ${def.objectType.apiName} already registered`,\n );\n }\n this.#ontology.objectTypes[def.objectType.apiName] = def;\n }\n\n registerActionType<Q extends OntologiesV2.ActionTypeV2>(\n def: Q,\n implementation?: FauxActionImpl<Q>,\n ): void;\n registerActionType(\n def: OntologiesV2.ActionTypeV2,\n implementation?: FauxActionImpl,\n ): void;\n registerActionType(\n def: OntologiesV2.ActionTypeV2,\n implementation?: FauxActionImpl,\n ): void {\n if (def.apiName in this.#ontology.actionTypes) {\n throw new Error(\n `ActionType ${def.apiName} already registered`,\n );\n }\n this.#ontology.actionTypes[def.apiName] = def;\n if (implementation) {\n this.#actionImpl.set(def.apiName, implementation);\n }\n }\n\n registerQueryType(\n def: OntologiesV2.QueryTypeV2,\n implementation?: FauxQueryImpl,\n ): void {\n if (`${def.apiName}:${def.version}` in this.#ontology.queryTypes) {\n throw new Error(\n `QueryType ${def.apiName} already registered`,\n );\n }\n this.#ontology\n .queryTypes[\n `${def.apiName}:${def.version}` as VersionedQueryTypeApiName\n ] = def;\n if (implementation) {\n if (!this.#queryImpl.has(def.apiName)) {\n this.#queryImpl.set(def.apiName, new Map());\n }\n if (!valid(def.version)) {\n throw new Error(\n `QueryType ${def.apiName} version ${def.version} is not semver valid`,\n );\n }\n this.#queryImpl.get(def.apiName)?.set(\n def.version,\n implementation,\n );\n }\n }\n\n registerInterfaceType(def: OntologiesV2.InterfaceType): void {\n if (def.apiName in this.#ontology.interfaceTypes) {\n throw new Error(\n `InterfaceType ${def.apiName} already registered`,\n );\n }\n this.#ontology.interfaceTypes[def.apiName] = def;\n }\n\n registerSharedPropertyType(def: OntologiesV2.SharedPropertyType): void {\n if (def.apiName in this.#ontology.sharedPropertyTypes) {\n throw new Error(\n `SharedPropertyType ${def.apiName} already registered`,\n );\n }\n this.#ontology.sharedPropertyTypes[def.apiName] = def;\n }\n\n #getFilteredQueryTypes(request: LoadOntologyMetadataRequest): Record<\n OntologiesV2.QueryApiName,\n OntologiesV2.QueryTypeV2\n > {\n const remappedQueryTypes = request.queryTypes.map(x =>\n this.#convertToVersionedApiName(x)\n );\n return Object.fromEntries(\n Object.entries(this.#ontology.queryTypes).filter((\n [queryTypeApiName],\n ) => remappedQueryTypes.includes(queryTypeApiName)).map((\n [queryTypeApiName, queryTypeDefinition],\n ) => [\n request.queryTypes[remappedQueryTypes.indexOf(queryTypeApiName)],\n queryTypeDefinition,\n ]),\n );\n }\n\n #convertToVersionedApiName(\n apiName: string,\n ): VersionedQueryTypeApiName {\n // If a query is requested without a version, we remap it to include a versioned api name with the latest version\n if (extractVersion(apiName) !== undefined) {\n return apiName as VersionedQueryTypeApiName;\n }\n const version = semver.rsort(\n Object.keys(this.#ontology.queryTypes).filter(\n queryTypeApiName => queryTypeApiName.split(\":\")[0] === apiName,\n ).map(x => extractVersion(x)),\n )[0];\n return `${apiName}:${version}`;\n }\n}\n\nfunction filterRecord<T>(\n record: Record<string, T>,\n keys: string[],\n): Record<string, T> {\n return Object.fromEntries(\n Object.entries(record).filter(([key]) => keys.includes(key)),\n );\n}\n\nfunction extractVersion(\n apiName: string,\n): string {\n return apiName.split(\":\")[1];\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAQA,OAAOA,MAAM,IAAIC,KAAK,QAAQ,QAAQ;AACtC,OAAOC,SAAS,MAAM,gBAAgB;AAEtC,SACEC,mBAAmB,EACnBC,gBAAgB,EAChBC,mBAAmB,EACnBC,2BAA2B,EAC3BC,kBAAkB,QACb,cAAc;AACrB,SAASC,gBAAgB,QAAQ,uCAAuC;AAKxE;AACA;AACA;AACA;AACA,OAAO,MAAMC,YAAY,CAAC;EACxB,CAACC,QAAQ;EACT,CAACC,UAAU,GAAwD,IAAIC,GAAG,CAAC,CAAC;EAC5E,CAACC,SAAS,GAGN,IAAID,GAAG,CAAC,CAAC;EAEbE,WAAWA,CAACJ,QAAiC,EAAE;IAC7C,IAAI,CAAC,CAACA,QAAQ,GAAG;MACfK,WAAW,EAAE,CAAC,CAAC;MACfC,cAAc,EAAE,CAAC,CAAC;MAClBC,WAAW,EAAE,CAAC,CAAC;MACfP,QAAQ;MACRQ,UAAU,EAAE,CAAC,CAAC;MACdC,mBAAmB,EAAE,CAAC,CAAC;MACvBC,UAAU,EAAE,CAAC;IACf,CAAC;EACH;EAEA,IAAIC,OAAOA,CAAA,EAAiC;IAC1C,OAAO,IAAI,CAAC,CAACX,QAAQ,CAACA,QAAQ,CAACW,OAAO;EACxC;EAEAC,uBAAuBA,CAAA,EAAsC;IAC3D,OAAO,IAAI,CAAC,CAACZ,QAAQ;EACvB;EAEAa,2BAA2BA,CACzBC,OAAiD,EACd;IACnC,OAAO;MACLd,QAAQ,EAAE,IAAI,CAAC,CAACA,QAAQ,CAACA,QAAQ;MACjCO,WAAW,EAAEQ,MAAM,C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 -29,7 +29,7 @@ OntologiesV2.Queries.execute(baseUrl, async ({
|
|
|
29
29
|
}) => {
|
|
30
30
|
const queryParams = Object.fromEntries(new URL(request.url).searchParams.entries());
|
|
31
31
|
const version = queryParams["version"];
|
|
32
|
-
if (!valid(version)) {
|
|
32
|
+
if (version != null && !valid(version)) {
|
|
33
33
|
throw new Error(`Invalid version "${version}" for query "${queryApiName}" in ontology "${ontologyApiName}: not semver compatible".`);
|
|
34
34
|
}
|
|
35
35
|
const queryImpl = fauxFoundry.getOntology(ontologyApiName).getQueryImpl(queryApiName, version);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createQueryHandlers.js","names":["valid","OntologiesV2","createQueryHandlers","baseUrl","fauxFoundry","Queries","execute","request","params","ontologyApiName","queryApiName","queryParams","Object","fromEntries","URL","url","searchParams","entries","version","Error","queryImpl","getOntology","getQueryImpl","json","getDataStore"],"sources":["createQueryHandlers.ts"],"sourcesContent":["/*\n * Copyright 2023 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 { valid } from \"semver\";\nimport { OntologiesV2 } from \"../mock/index.js\";\nimport type { FauxFoundryHandlersFactory } from \"./createFauxFoundryHandlers.js\";\n\nexport const createQueryHandlers: FauxFoundryHandlersFactory = (\n baseUrl,\n fauxFoundry,\n) => [\n /**\n * Execute Queries\n */\n OntologiesV2.Queries.execute(\n baseUrl,\n async ({ request, params: { ontologyApiName, queryApiName } }) => {\n const queryParams = Object.fromEntries(\n new URL(request.url).searchParams.entries(),\n );\n\n const version = queryParams[\"version\"];\n if (!valid(version)) {\n throw new Error(\n `Invalid version \"${version}\" for query \"${queryApiName}\" in ontology \"${ontologyApiName}: not semver compatible\".`,\n );\n }\n\n const queryImpl = fauxFoundry\n .getOntology(ontologyApiName)\n .getQueryImpl(queryApiName, version);\n\n return queryImpl(\n await request.json(),\n fauxFoundry.getDataStore(ontologyApiName),\n );\n },\n ),\n];\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,KAAK,QAAQ,QAAQ;AAC9B,SAASC,YAAY,QAAQ,kBAAkB;AAG/C,OAAO,MAAMC,mBAA+C,GAAGA,CAC7DC,OAAO,EACPC,WAAW,KACR;AACH;AACF;AACA;AACEH,YAAY,CAACI,OAAO,CAACC,OAAO,CAC1BH,OAAO,EACP,OAAO;EAAEI,OAAO;EAAEC,MAAM,EAAE;IAAEC,eAAe;IAAEC;EAAa;AAAE,CAAC,KAAK;EAChE,MAAMC,WAAW,GAAGC,MAAM,CAACC,WAAW,CACpC,IAAIC,GAAG,CAACP,OAAO,CAACQ,GAAG,CAAC,CAACC,YAAY,CAACC,OAAO,CAAC,CAC5C,CAAC;EAED,MAAMC,OAAO,GAAGP,WAAW,CAAC,SAAS,CAAC;EACtC,IAAI,
|
|
1
|
+
{"version":3,"file":"createQueryHandlers.js","names":["valid","OntologiesV2","createQueryHandlers","baseUrl","fauxFoundry","Queries","execute","request","params","ontologyApiName","queryApiName","queryParams","Object","fromEntries","URL","url","searchParams","entries","version","Error","queryImpl","getOntology","getQueryImpl","json","getDataStore"],"sources":["createQueryHandlers.ts"],"sourcesContent":["/*\n * Copyright 2023 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 { valid } from \"semver\";\nimport { OntologiesV2 } from \"../mock/index.js\";\nimport type { FauxFoundryHandlersFactory } from \"./createFauxFoundryHandlers.js\";\n\nexport const createQueryHandlers: FauxFoundryHandlersFactory = (\n baseUrl,\n fauxFoundry,\n) => [\n /**\n * Execute Queries\n */\n OntologiesV2.Queries.execute(\n baseUrl,\n async ({ request, params: { ontologyApiName, queryApiName } }) => {\n const queryParams = Object.fromEntries(\n new URL(request.url).searchParams.entries(),\n );\n\n const version = queryParams[\"version\"];\n if (version != null && !valid(version)) {\n throw new Error(\n `Invalid version \"${version}\" for query \"${queryApiName}\" in ontology \"${ontologyApiName}: not semver compatible\".`,\n );\n }\n\n const queryImpl = fauxFoundry\n .getOntology(ontologyApiName)\n .getQueryImpl(queryApiName, version);\n\n return queryImpl(\n await request.json(),\n fauxFoundry.getDataStore(ontologyApiName),\n );\n },\n ),\n];\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,KAAK,QAAQ,QAAQ;AAC9B,SAASC,YAAY,QAAQ,kBAAkB;AAG/C,OAAO,MAAMC,mBAA+C,GAAGA,CAC7DC,OAAO,EACPC,WAAW,KACR;AACH;AACF;AACA;AACEH,YAAY,CAACI,OAAO,CAACC,OAAO,CAC1BH,OAAO,EACP,OAAO;EAAEI,OAAO;EAAEC,MAAM,EAAE;IAAEC,eAAe;IAAEC;EAAa;AAAE,CAAC,KAAK;EAChE,MAAMC,WAAW,GAAGC,MAAM,CAACC,WAAW,CACpC,IAAIC,GAAG,CAACP,OAAO,CAACQ,GAAG,CAAC,CAACC,YAAY,CAACC,OAAO,CAAC,CAC5C,CAAC;EAED,MAAMC,OAAO,GAAGP,WAAW,CAAC,SAAS,CAAC;EACtC,IAAIO,OAAO,IAAI,IAAI,IAAI,CAAClB,KAAK,CAACkB,OAAO,CAAC,EAAE;IACtC,MAAM,IAAIC,KAAK,CACb,oBAAoBD,OAAO,gBAAgBR,YAAY,kBAAkBD,eAAe,2BAC1F,CAAC;EACH;EAEA,MAAMW,SAAS,GAAGhB,WAAW,CAC1BiB,WAAW,CAACZ,eAAe,CAAC,CAC5Ba,YAAY,CAACZ,YAAY,EAAEQ,OAAO,CAAC;EAEtC,OAAOE,SAAS,CACd,MAAMb,OAAO,CAACgB,IAAI,CAAC,CAAC,EACpBnB,WAAW,CAACoB,YAAY,CAACf,eAAe,CAC1C,CAAC;AACH,CACF,CAAC,CACF","ignoreList":[]}
|
package/build/cjs/index.cjs
CHANGED
|
@@ -1677,7 +1677,7 @@ __export(Actions_exports, {
|
|
|
1677
1677
|
applyBatch: () => applyBatch2
|
|
1678
1678
|
});
|
|
1679
1679
|
|
|
1680
|
-
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.
|
|
1680
|
+
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.28.0/node_modules/@osdk/foundry.ontologies/build/esm/public/Action.js
|
|
1681
1681
|
var Action_exports = {};
|
|
1682
1682
|
__export(Action_exports, {
|
|
1683
1683
|
apply: () => apply,
|
|
@@ -1784,7 +1784,7 @@ function parseUrl(baseUrl, endpointPath) {
|
|
|
1784
1784
|
return new URL(`api${endpointPath}`, baseUrl);
|
|
1785
1785
|
}
|
|
1786
1786
|
|
|
1787
|
-
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.
|
|
1787
|
+
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.28.0/node_modules/@osdk/foundry.ontologies/build/esm/public/Action.js
|
|
1788
1788
|
var _apply = [1, "/v2/ontologies/{0}/actions/{1}/apply", 3];
|
|
1789
1789
|
function apply($ctx, ...args) {
|
|
1790
1790
|
return foundryPlatformFetch($ctx, _apply, ...args);
|
|
@@ -1798,7 +1798,7 @@ function applyBatch($ctx, ...args) {
|
|
|
1798
1798
|
return foundryPlatformFetch($ctx, _applyBatch, ...args);
|
|
1799
1799
|
}
|
|
1800
1800
|
|
|
1801
|
-
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.
|
|
1801
|
+
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.28.0/node_modules/@osdk/foundry.ontologies/build/esm/public/ActionTypeV2.js
|
|
1802
1802
|
var ActionTypeV2_exports = {};
|
|
1803
1803
|
__export(ActionTypeV2_exports, {
|
|
1804
1804
|
get: () => get,
|
|
@@ -1818,7 +1818,7 @@ function getByRid($ctx, ...args) {
|
|
|
1818
1818
|
return foundryPlatformFetch($ctx, _getByRid, ...args);
|
|
1819
1819
|
}
|
|
1820
1820
|
|
|
1821
|
-
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.
|
|
1821
|
+
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.28.0/node_modules/@osdk/foundry.ontologies/build/esm/public/Attachment.js
|
|
1822
1822
|
var Attachment_exports = {};
|
|
1823
1823
|
__export(Attachment_exports, {
|
|
1824
1824
|
get: () => get2,
|
|
@@ -1843,7 +1843,7 @@ function get2($ctx, ...args) {
|
|
|
1843
1843
|
return foundryPlatformFetch($ctx, _get2, ...args);
|
|
1844
1844
|
}
|
|
1845
1845
|
|
|
1846
|
-
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.
|
|
1846
|
+
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.28.0/node_modules/@osdk/foundry.ontologies/build/esm/public/AttachmentPropertyV2.js
|
|
1847
1847
|
var AttachmentPropertyV2_exports = {};
|
|
1848
1848
|
__export(AttachmentPropertyV2_exports, {
|
|
1849
1849
|
getAttachment: () => getAttachment,
|
|
@@ -1868,7 +1868,7 @@ function readAttachmentByRid($ctx, ...args) {
|
|
|
1868
1868
|
return foundryPlatformFetch($ctx, _readAttachmentByRid, ...args);
|
|
1869
1869
|
}
|
|
1870
1870
|
|
|
1871
|
-
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.
|
|
1871
|
+
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.28.0/node_modules/@osdk/foundry.ontologies/build/esm/public/LinkedObjectV2.js
|
|
1872
1872
|
var LinkedObjectV2_exports = {};
|
|
1873
1873
|
__export(LinkedObjectV2_exports, {
|
|
1874
1874
|
getLinkedObject: () => getLinkedObject,
|
|
@@ -1883,7 +1883,7 @@ function getLinkedObject($ctx, ...args) {
|
|
|
1883
1883
|
return foundryPlatformFetch($ctx, _getLinkedObject, ...args);
|
|
1884
1884
|
}
|
|
1885
1885
|
|
|
1886
|
-
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.
|
|
1886
|
+
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.28.0/node_modules/@osdk/foundry.ontologies/build/esm/public/MediaReferenceProperty.js
|
|
1887
1887
|
var MediaReferenceProperty_exports = {};
|
|
1888
1888
|
__export(MediaReferenceProperty_exports, {
|
|
1889
1889
|
getMediaContent: () => getMediaContent,
|
|
@@ -1908,7 +1908,7 @@ function uploadMedia($ctx, ...args) {
|
|
|
1908
1908
|
return foundryPlatformFetch($ctx, _uploadMedia, ...args);
|
|
1909
1909
|
}
|
|
1910
1910
|
|
|
1911
|
-
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.
|
|
1911
|
+
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.28.0/node_modules/@osdk/foundry.ontologies/build/esm/public/ObjectTypeV2.js
|
|
1912
1912
|
var ObjectTypeV2_exports = {};
|
|
1913
1913
|
__export(ObjectTypeV2_exports, {
|
|
1914
1914
|
get: () => get3,
|
|
@@ -1938,13 +1938,14 @@ function getOutgoingLinkType($ctx, ...args) {
|
|
|
1938
1938
|
return foundryPlatformFetch($ctx, _getOutgoingLinkType, ...args);
|
|
1939
1939
|
}
|
|
1940
1940
|
|
|
1941
|
-
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.
|
|
1941
|
+
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.28.0/node_modules/@osdk/foundry.ontologies/build/esm/public/OntologyInterface.js
|
|
1942
1942
|
var OntologyInterface_exports = {};
|
|
1943
1943
|
__export(OntologyInterface_exports, {
|
|
1944
1944
|
aggregate: () => aggregate,
|
|
1945
1945
|
get: () => get4,
|
|
1946
1946
|
getOutgoingInterfaceLinkType: () => getOutgoingInterfaceLinkType,
|
|
1947
1947
|
list: () => list3,
|
|
1948
|
+
listObjectsForInterface: () => listObjectsForInterface,
|
|
1948
1949
|
listOutgoingInterfaceLinkTypes: () => listOutgoingInterfaceLinkTypes,
|
|
1949
1950
|
search: () => search
|
|
1950
1951
|
});
|
|
@@ -1956,6 +1957,10 @@ var _get4 = [0, "/v2/ontologies/{0}/interfaceTypes/{1}", 2];
|
|
|
1956
1957
|
function get4($ctx, ...args) {
|
|
1957
1958
|
return foundryPlatformFetch($ctx, _get4, ...args);
|
|
1958
1959
|
}
|
|
1960
|
+
var _listObjectsForInterface = [0, "/v2/ontologies/{0}/interfaces/{1}", 2];
|
|
1961
|
+
function listObjectsForInterface($ctx, ...args) {
|
|
1962
|
+
return foundryPlatformFetch($ctx, _listObjectsForInterface, ...args);
|
|
1963
|
+
}
|
|
1959
1964
|
var _search = [1, "/v2/ontologies/{0}/interfaces/{1}/search", 3];
|
|
1960
1965
|
function search($ctx, ...args) {
|
|
1961
1966
|
return foundryPlatformFetch($ctx, _search, ...args);
|
|
@@ -1973,7 +1978,7 @@ function getOutgoingInterfaceLinkType($ctx, ...args) {
|
|
|
1973
1978
|
return foundryPlatformFetch($ctx, _getOutgoingInterfaceLinkType, ...args);
|
|
1974
1979
|
}
|
|
1975
1980
|
|
|
1976
|
-
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.
|
|
1981
|
+
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.28.0/node_modules/@osdk/foundry.ontologies/build/esm/public/OntologyObjectSet.js
|
|
1977
1982
|
var OntologyObjectSet_exports = {};
|
|
1978
1983
|
__export(OntologyObjectSet_exports, {
|
|
1979
1984
|
aggregate: () => aggregate2,
|
|
@@ -1983,7 +1988,7 @@ __export(OntologyObjectSet_exports, {
|
|
|
1983
1988
|
loadMultipleObjectTypes: () => loadMultipleObjectTypes,
|
|
1984
1989
|
loadObjectsOrInterfaces: () => loadObjectsOrInterfaces
|
|
1985
1990
|
});
|
|
1986
|
-
var _createTemporary = [1, "/v2/ontologies/{0}/objectSets/createTemporary",
|
|
1991
|
+
var _createTemporary = [1, "/v2/ontologies/{0}/objectSets/createTemporary", 3];
|
|
1987
1992
|
function createTemporary($ctx, ...args) {
|
|
1988
1993
|
return foundryPlatformFetch($ctx, _createTemporary, ...args);
|
|
1989
1994
|
}
|
|
@@ -2008,7 +2013,7 @@ function aggregate2($ctx, ...args) {
|
|
|
2008
2013
|
return foundryPlatformFetch($ctx, _aggregate2, ...args);
|
|
2009
2014
|
}
|
|
2010
2015
|
|
|
2011
|
-
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.
|
|
2016
|
+
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.28.0/node_modules/@osdk/foundry.ontologies/build/esm/public/OntologyObjectV2.js
|
|
2012
2017
|
var OntologyObjectV2_exports = {};
|
|
2013
2018
|
__export(OntologyObjectV2_exports, {
|
|
2014
2019
|
aggregate: () => aggregate3,
|
|
@@ -2038,7 +2043,7 @@ function aggregate3($ctx, ...args) {
|
|
|
2038
2043
|
return foundryPlatformFetch($ctx, _aggregate3, ...args);
|
|
2039
2044
|
}
|
|
2040
2045
|
|
|
2041
|
-
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.
|
|
2046
|
+
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.28.0/node_modules/@osdk/foundry.ontologies/build/esm/public/OntologyV2.js
|
|
2042
2047
|
var OntologyV2_exports = {};
|
|
2043
2048
|
__export(OntologyV2_exports, {
|
|
2044
2049
|
get: () => get7,
|
|
@@ -2063,17 +2068,17 @@ function loadMetadata($ctx, ...args) {
|
|
|
2063
2068
|
return foundryPlatformFetch($ctx, _loadMetadata, ...args);
|
|
2064
2069
|
}
|
|
2065
2070
|
|
|
2066
|
-
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.
|
|
2071
|
+
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.28.0/node_modules/@osdk/foundry.ontologies/build/esm/public/Query.js
|
|
2067
2072
|
var Query_exports = {};
|
|
2068
2073
|
__export(Query_exports, {
|
|
2069
2074
|
execute: () => execute
|
|
2070
2075
|
});
|
|
2071
|
-
var _execute = [1, "/v2/ontologies/{0}/queries/{1}/execute",
|
|
2076
|
+
var _execute = [1, "/v2/ontologies/{0}/queries/{1}/execute", 7];
|
|
2072
2077
|
function execute($ctx, ...args) {
|
|
2073
2078
|
return foundryPlatformFetch($ctx, _execute, ...args);
|
|
2074
2079
|
}
|
|
2075
2080
|
|
|
2076
|
-
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.
|
|
2081
|
+
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.28.0/node_modules/@osdk/foundry.ontologies/build/esm/public/QueryType.js
|
|
2077
2082
|
var QueryType_exports = {};
|
|
2078
2083
|
__export(QueryType_exports, {
|
|
2079
2084
|
get: () => get8,
|
|
@@ -2088,7 +2093,7 @@ function get8($ctx, ...args) {
|
|
|
2088
2093
|
return foundryPlatformFetch($ctx, _get8, ...args);
|
|
2089
2094
|
}
|
|
2090
2095
|
|
|
2091
|
-
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.
|
|
2096
|
+
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.28.0/node_modules/@osdk/foundry.ontologies/build/esm/public/TimeSeriesPropertyV2.js
|
|
2092
2097
|
var TimeSeriesPropertyV2_exports = {};
|
|
2093
2098
|
__export(TimeSeriesPropertyV2_exports, {
|
|
2094
2099
|
getFirstPoint: () => getFirstPoint,
|
|
@@ -2108,7 +2113,7 @@ function streamPoints($ctx, ...args) {
|
|
|
2108
2113
|
return foundryPlatformFetch($ctx, _streamPoints, ...args);
|
|
2109
2114
|
}
|
|
2110
2115
|
|
|
2111
|
-
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.
|
|
2116
|
+
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.28.0/node_modules/@osdk/foundry.ontologies/build/esm/public/TimeSeriesValueBankProperty.js
|
|
2112
2117
|
var TimeSeriesValueBankProperty_exports = {};
|
|
2113
2118
|
__export(TimeSeriesValueBankProperty_exports, {
|
|
2114
2119
|
getLatestValue: () => getLatestValue,
|
|
@@ -2720,7 +2725,7 @@ var createQueryHandlers = (baseUrl, fauxFoundry) => [
|
|
|
2720
2725
|
}) => {
|
|
2721
2726
|
const queryParams = Object.fromEntries(new URL(request.url).searchParams.entries());
|
|
2722
2727
|
const version = queryParams["version"];
|
|
2723
|
-
if (!semver.valid(version)) {
|
|
2728
|
+
if (version != null && !semver.valid(version)) {
|
|
2724
2729
|
throw new Error(`Invalid version "${version}" for query "${queryApiName}" in ontology "${ontologyApiName}: not semver compatible".`);
|
|
2725
2730
|
}
|
|
2726
2731
|
const queryImpl = fauxFoundry.getOntology(ontologyApiName).getQueryImpl(queryApiName, version);
|
|
@@ -2862,7 +2867,8 @@ var FauxOntology = class {
|
|
|
2862
2867
|
objectTypes: {},
|
|
2863
2868
|
ontology,
|
|
2864
2869
|
queryTypes: {},
|
|
2865
|
-
sharedPropertyTypes: {}
|
|
2870
|
+
sharedPropertyTypes: {},
|
|
2871
|
+
valueTypes: {}
|
|
2866
2872
|
};
|
|
2867
2873
|
}
|
|
2868
2874
|
get apiName() {
|
|
@@ -2881,7 +2887,8 @@ var FauxOntology = class {
|
|
|
2881
2887
|
actionTypes: filterRecord(this.#ontology.actionTypes, request.actionTypes),
|
|
2882
2888
|
queryTypes: this.#getFilteredQueryTypes(request),
|
|
2883
2889
|
interfaceTypes: filterRecord(this.#ontology.interfaceTypes, request.interfaceTypes),
|
|
2884
|
-
sharedPropertyTypes: {}
|
|
2890
|
+
sharedPropertyTypes: {},
|
|
2891
|
+
valueTypes: {}
|
|
2885
2892
|
};
|
|
2886
2893
|
}
|
|
2887
2894
|
getAllInterfaceTypes() {
|