Skip to content

Commit

Permalink
Merge pull request #72 from bcgsc/release/v3.15.0
Browse files Browse the repository at this point in the history
Release/v3.15.0
  • Loading branch information
sshugsc authored Jul 3, 2024
2 parents d161ebb + 842d96d commit 6196e05
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 22 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/npm-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node: [12, 14, 16]
node: [16, 18, 20]
orientdb: ['3.0', '3.1', '3.2.13']
name: orientdb-${{ matrix.orientdb }} node-${{ matrix.node }}
services:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ these please see the [contributing guide](./docs/CONTRIBUTING.md).
Requirements

- orientdb 3.0, 3.1, or 3.2
- node v12, v14 or v16
- node v16, v18 or v20

Clone the repository

Expand Down
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@bcgsc-pori/graphkb-api",
"main": "server.js",
"version": "3.14.6",
"version": "3.15.0",
"private": true,
"repository": {
"type": "git",
Expand All @@ -26,7 +26,7 @@
"jsonwebtoken": "^8.2.0",
"lodash": "^4.17.21",
"morgan": "^1.10.0",
"orientjs": "^3.0.11",
"orientjs": "^3.2.0",
"portfinder": "^1.0.20",
"request-promise": "^4.2.1",
"semver": "^5.6.0",
Expand Down
23 changes: 12 additions & 11 deletions src/routes/openapi/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ const { generatePropertiesMd } = require('./returnProperties');
const SCHEMA_PREFIX = '#/components/schemas';

const STUB = {
openapi: '3.0.0',
info: {
title: 'GraphKB',
version: process.env.npm_package_version,
},
components: {
parameters: {
in: {
Expand All @@ -56,15 +61,11 @@ const STUB = {
pattern: '^#\\d+:\\d+$',
type: 'string',
},
RecordId: { $ref: '#/components/schemas/@rid' },
RecordId: { $ref: `${SCHEMA_PREFIX}/@rid` },
undefined: {},
...schemas,
},
},
info: {
title: 'GraphKB',
version: process.env.npm_package_version,
},
openapi: '3.0.0',
paths: {
'/license': { get: GET_LICENSE, post: POST_LICENSE },
'/license/sign': { post: POST_SIGN_LICENSE },
Expand Down Expand Up @@ -350,7 +351,7 @@ const generateSwaggerSpec = (schema, metadata) => {
}
if (model.isAbstract) {
// should inherit from its concrete subclasses instead
const anyOf = schema.children(model.name).map((m) => ({ $ref: `#/components/schemas/${m}` }));
const anyOf = schema.children(model.name).map((m) => ({ $ref: `${SCHEMA_PREFIX}/${m}` }));
docs.components.schemas[model.name].anyOf = anyOf;
continue;
}
Expand All @@ -370,7 +371,7 @@ const generateSwaggerSpec = (schema, metadata) => {
docs.components.schemas[model.name].required.push(prop.name);
}
if (docs.components.schemas[prop.name] && model.name !== 'Permissions') {
docs.components.schemas[model.name].properties[prop.name] = { $ref: `#/components/schemas/${prop.name}` };
docs.components.schemas[model.name].properties[prop.name] = { $ref: `${SCHEMA_PREFIX}/${prop.name}` };
continue;
}
let propDefn = {};
Expand All @@ -385,9 +386,9 @@ const generateSwaggerSpec = (schema, metadata) => {
propDefn.type = 'string';
} else if (prop.linkedClass) {
if (prop.type.includes('embedded')) {
propDefn.$ref = `#/components/schemas/${prop.linkedClass.name}`;
propDefn.$ref = `${SCHEMA_PREFIX}/${prop.linkedClass.name}`;
} else if (docs.components.schemas[`${prop.linkedClass.name}Link`]) {
propDefn.$ref = `#/components/schemas/${prop.linkedClass.name}Link`;
propDefn.$ref = `${SCHEMA_PREFIX}/${prop.linkedClass.name}Link`;
} else {
Object.assign(propDefn, linkOrModel(prop.linkedClass.name));
}
Expand Down Expand Up @@ -506,7 +507,7 @@ const registerSpecEndpoints = (router, spec) => {
</head>
<body>
<redoc id="redoc-container" require-props-first="true" sort-props-alphabetically="true" spec-url="${req.baseUrl}/spec.json"></redoc>
<script src="https://cdn.jsdelivr.net/npm/redoc@next/bundles/redoc.standalone.js"> </script>
<script src="https://cdn.redoc.ly/redoc/latest/bundles/redoc.standalone.js"> </script>
</body>
</html>`;
res.set('Content-Type', 'text/html');
Expand Down
7 changes: 4 additions & 3 deletions src/routes/resource.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,11 @@ const { checkStandardOptions } = require('../repo/query_builder/util');
const { OPERATORS } = require('../repo/query_builder/constants');

const activeRidQuery = (modelName, rid, opt = {}) => {
const { history, ...rest } = opt;
const query = parse({
...opt,
...rest,
filters: { '@this': modelName, operator: OPERATORS.INSTANCEOF },
history: false,
history: history || false,
target: [rid],
});
return query;
Expand All @@ -46,7 +47,7 @@ const getRoute = (app, model) => {
let query;

try {
query = activeRidQuery(model.name, req.params.rid, { neighbors });
query = activeRidQuery(model.name, req.params.rid, { history: true, neighbors });
} catch (err) {
if (err instanceof ValidationError) {
return next(err);
Expand Down
2 changes: 1 addition & 1 deletion test/db_integration/service_routes.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const { createEmptyDb, tearDownDb } = require('./util');
const request = async (opt) => requestPromise({ json: true, resolveWithFullResponse: true, ...opt });

const REALLY_LONG_TIME = 10000000000;
const TEST_TIMEOUT_MS = 1000000;
const TEST_TIMEOUT_MS = 2000000;
jest.setTimeout(TEST_TIMEOUT_MS);

const describeWithAuth = process.env.GKB_DBS_PASS
Expand Down

0 comments on commit 6196e05

Please sign in to comment.