@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 CHANGED
@@ -1,5 +1,20 @@
1
1
  # @osdk/shared.test
2
2
 
3
+ ## 0.1.4
4
+
5
+ ### Patch Changes
6
+
7
+ - 2a94a20: Fix applyQuery for marketplace installations
8
+ - @osdk/api@2.3.4
9
+ - @osdk/generator-converters@2.3.4
10
+
11
+ ## 0.1.3
12
+
13
+ ### Patch Changes
14
+
15
+ - @osdk/api@2.3.3
16
+ - @osdk/generator-converters@2.3.3
17
+
3
18
  ## 0.1.2
4
19
 
5
20
  ### Patch Changes
@@ -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,CAACX,KAAK,CAACkB,OAAO,CAAC,EAAE;IACnB,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":[]}
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":[]}
@@ -2576,7 +2576,7 @@ var createQueryHandlers = (baseUrl, fauxFoundry) => [
2576
2576
  }) => {
2577
2577
  const queryParams = Object.fromEntries(new URL(request.url).searchParams.entries());
2578
2578
  const version = queryParams["version"];
2579
- if (!semver.valid(version)) {
2579
+ if (version != null && !semver.valid(version)) {
2580
2580
  throw new Error(`Invalid version "${version}" for query "${queryApiName}" in ontology "${ontologyApiName}: not semver compatible".`);
2581
2581
  }
2582
2582
  const queryImpl = fauxFoundry.getOntology(ontologyApiName).getQueryImpl(queryApiName, version);