@feathersjs/schema
Advanced tools
Comparing version 5.0.0-pre.37 to 5.0.0-pre.38
@@ -6,2 +6,12 @@ # Change Log | ||
# [5.0.0-pre.38](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.37...v5.0.0-pre.38) (2023-02-17) | ||
### Bug Fixes | ||
- **schema:** validateQuery - move next function outside of try-catch ([#3053](https://github.com/feathersjs/feathers/issues/3053)) ([37fe5c4](https://github.com/feathersjs/feathers/commit/37fe5c4a4d813867f6d02098b7c77d08786248c7)) | ||
### Features | ||
- **schema:** Add schema helper for handling Object ids ([#3058](https://github.com/feathersjs/feathers/issues/3058)) ([1393bed](https://github.com/feathersjs/feathers/commit/1393bed81a9ee814de6aab0e537af83e667591a2)) | ||
# [5.0.0-pre.37](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.36...v5.0.0-pre.37) (2023-02-09) | ||
@@ -8,0 +18,0 @@ |
@@ -18,5 +18,2 @@ "use strict"; | ||
}; | ||
if (typeof next === 'function') { | ||
return next(); | ||
} | ||
} | ||
@@ -26,2 +23,5 @@ catch (error) { | ||
} | ||
if (typeof next === 'function') { | ||
return next(); | ||
} | ||
}; | ||
@@ -28,0 +28,0 @@ }; |
@@ -160,1 +160,11 @@ import { JSONSchema } from 'json-schema-to-ts'; | ||
} & { [K_2 in keyof T]: PropertyQuery<T[K_2], X[K_2]>; }; | ||
export declare const ObjectIdSchema: () => { | ||
readonly anyOf: readonly [{ | ||
readonly type: "string"; | ||
readonly objectid: true; | ||
}, { | ||
readonly type: "object"; | ||
readonly properties: {}; | ||
readonly additionalProperties: false; | ||
}]; | ||
}; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.querySyntax = exports.queryProperties = exports.queryProperty = exports.getDataValidator = exports.getValidator = void 0; | ||
exports.ObjectIdSchema = exports.querySyntax = exports.queryProperties = exports.queryProperty = exports.getDataValidator = exports.getValidator = void 0; | ||
const commons_1 = require("@feathersjs/commons"); | ||
@@ -89,6 +89,2 @@ /** | ||
const definition = definitions[key]; | ||
const { $ref } = definition; | ||
if ($ref) { | ||
throw new Error(`Can not create query syntax schema for reference property '${key}'`); | ||
} | ||
result[key] = (0, exports.queryProperty)(definition, extensions[key]); | ||
@@ -162,2 +158,9 @@ return result; | ||
exports.querySyntax = querySyntax; | ||
const ObjectIdSchema = () => ({ | ||
anyOf: [ | ||
{ type: 'string', objectid: true }, | ||
{ type: 'object', properties: {}, additionalProperties: false } | ||
] | ||
}); | ||
exports.ObjectIdSchema = ObjectIdSchema; | ||
//# sourceMappingURL=json-schema.js.map |
{ | ||
"name": "@feathersjs/schema", | ||
"description": "A common data schema definition format", | ||
"version": "5.0.0-pre.37", | ||
"version": "5.0.0-pre.38", | ||
"homepage": "https://feathersjs.com", | ||
@@ -57,7 +57,7 @@ "main": "lib/", | ||
"dependencies": { | ||
"@feathersjs/adapter-commons": "^5.0.0-pre.37", | ||
"@feathersjs/commons": "^5.0.0-pre.37", | ||
"@feathersjs/errors": "^5.0.0-pre.37", | ||
"@feathersjs/feathers": "^5.0.0-pre.37", | ||
"@feathersjs/hooks": "^0.7.6", | ||
"@feathersjs/adapter-commons": "^5.0.0-pre.38", | ||
"@feathersjs/commons": "^5.0.0-pre.38", | ||
"@feathersjs/errors": "^5.0.0-pre.38", | ||
"@feathersjs/feathers": "^5.0.0-pre.38", | ||
"@feathersjs/hooks": "^0.8.1", | ||
"@types/json-schema": "^7.0.11", | ||
@@ -69,5 +69,5 @@ "ajv": "^8.12.0", | ||
"devDependencies": { | ||
"@feathersjs/memory": "^5.0.0-pre.37", | ||
"@feathersjs/memory": "^5.0.0-pre.38", | ||
"@types/mocha": "^10.0.1", | ||
"@types/node": "^18.11.18", | ||
"@types/node": "^18.13.0", | ||
"ajv-formats": "^2.1.1", | ||
@@ -78,3 +78,3 @@ "mocha": "^10.2.0", | ||
}, | ||
"gitHead": "17a8b3b2614876772472d3cab3d96d45c01db6ed" | ||
"gitHead": "7fc86307438ae8cf3f71ce3b677be8bcc55768c1" | ||
} |
@@ -22,9 +22,9 @@ import { HookContext, NextFunction } from '@feathersjs/feathers' | ||
} | ||
if (typeof next === 'function') { | ||
return next() | ||
} | ||
} catch (error: any) { | ||
throw error.ajv ? new BadRequest(error.message, error.errors) : error | ||
} | ||
if (typeof next === 'function') { | ||
return next() | ||
} | ||
} | ||
@@ -31,0 +31,0 @@ } |
@@ -147,8 +147,3 @@ import { _ } from '@feathersjs/commons' | ||
const definition = definitions[key] | ||
const { $ref } = definition as any | ||
if ($ref) { | ||
throw new Error(`Can not create query syntax schema for reference property '${key}'`) | ||
} | ||
result[key] = queryProperty(definition as JSONSchemaDefinition, extensions[key as keyof T]) | ||
@@ -231,1 +226,9 @@ | ||
} | ||
export const ObjectIdSchema = () => | ||
({ | ||
anyOf: [ | ||
{ type: 'string', objectid: true }, | ||
{ type: 'object', properties: {}, additionalProperties: false } | ||
] | ||
} as const) |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
141550
2759
+ Added@feathersjs/hooks@0.8.1(transitive)
- Removed@feathersjs/hooks@0.7.6(transitive)
Updated@feathersjs/hooks@^0.8.1