@osdk/faux 0.1.2 → 0.1.4
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 +15 -0
- package/build/browser/handlers/createQueryHandlers.js +1 -1
- package/build/browser/handlers/createQueryHandlers.js.map +1 -1
- package/build/cjs/index.cjs +1 -1
- package/build/cjs/index.cjs.map +1 -1
- package/build/esm/handlers/createQueryHandlers.js +1 -1
- package/build/esm/handlers/createQueryHandlers.js.map +1 -1
- package/package.json +3 -3
|
@@ -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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@osdk/faux",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4",
|
|
4
4
|
"description": "",
|
|
5
5
|
"access": "private",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -42,8 +42,8 @@
|
|
|
42
42
|
"semver": "^7.5.1",
|
|
43
43
|
"tiny-invariant": "^1.3.3",
|
|
44
44
|
"type-fest": "^4.37.0",
|
|
45
|
-
"@osdk/api": "~2.3.
|
|
46
|
-
"@osdk/generator-converters": "~2.3.
|
|
45
|
+
"@osdk/api": "~2.3.4",
|
|
46
|
+
"@osdk/generator-converters": "~2.3.4"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
49
|
"@types/json-stable-stringify": "^1.0.36",
|