@openaddresses/batch-schema 9.0.0 → 9.2.0

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
@@ -10,6 +10,14 @@
10
10
 
11
11
  ## Version History
12
12
 
13
+ ### v9.2.0
14
+
15
+ - :rocket: Use Defaults in response middleware
16
+
17
+ ### v9.1.0
18
+
19
+ - :rocket: Only attempt to load js and ts files
20
+
13
21
  ### v9.0.0
14
22
 
15
23
  - :rocket: Only JSON parse body if `body` of JSON Schema is set. If body is not set it is up to the caller to parse the body
package/lib/middleware.js CHANGED
@@ -8,6 +8,7 @@ import Generic from '@openaddresses/batch-generic';
8
8
  const ajv = addFormats(new Ajv({
9
9
  strict: false,
10
10
  allErrors: true,
11
+ useDefaults: true,
11
12
  removeAdditional: true
12
13
  }));
13
14
 
package/lib/schema.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { Validator } from 'express-json-validator-middleware';
2
2
  import $RefParser from '@apidevtools/json-schema-ref-parser';
3
- import fs from 'fs';
4
- import path from 'path';
3
+ import fs from 'node:fs';
4
+ import path from 'node:path';
5
5
  import morgan from 'morgan';
6
6
  import bodyparser from 'body-parser';
7
7
 
@@ -74,6 +74,7 @@ export default class Schemas {
74
74
  // Load dynamic routes directory
75
75
  for (const r of fs.readdirSync(dirpath)) {
76
76
  if (!opts.silent) console.log(`ok - loaded routes/${r}`);
77
+ if (!['.ts', '.js'].includes(path.parse(r).ext)) continue;
77
78
  routes.push((await import(path.resolve(dirpath, r))).default(this, config));
78
79
  }
79
80
 
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "type": "module",
4
4
  "root": true,
5
5
  "main": "index.js",
6
- "version": "9.0.0",
6
+ "version": "9.2.0",
7
7
  "description": "Strongly Validated JSON Schema support for address",
8
8
  "repository": "git@github.com:openaddresses/batch-schema",
9
9
  "author": "ingalls <nick@ingalls.ca>",