@kne/fastify-webhook 0.1.0 → 0.1.2

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/index.js CHANGED
@@ -6,7 +6,7 @@ module.exports = fp(async (fastify, options) => {
6
6
  {},
7
7
  {
8
8
  prefix: '/api/webhook',
9
- dbTableNamePrefix: 't_',
9
+ dbTableNamePrefix: 't_webhook_',
10
10
  name: 'webhook',
11
11
  hooks: {},
12
12
  getUserAuthenticate: () => {
@@ -15,7 +15,9 @@ module.exports = fp(async (fastify, options) => {
15
15
  properties: {
16
16
  name: { type: 'string' },
17
17
  type: { type: 'string' },
18
- expire: { type: 'string', format: 'date-time' }
18
+ expire: { type: 'string', format: 'date-time' },
19
+ signatureLocation: { type: 'string' },
20
+ inputLocation: { type: 'string' }
19
21
  },
20
22
  required: ['name', 'type']
21
23
  }
@@ -7,7 +7,7 @@ const get = require('lodash/get');
7
7
  module.exports = fp(async (fastify, options) => {
8
8
  const { models } = fastify[options.name];
9
9
 
10
- const create = async ({ name, type, expire, userId }) => {
10
+ const create = async ({ name, type, expire, userId, signatureLocation, inputLocation }) => {
11
11
  if (!options.hooks[type]) {
12
12
  throw new Error(`Hook ${type} not allowed`);
13
13
  }
@@ -15,7 +15,9 @@ module.exports = fp(async (fastify, options) => {
15
15
  name,
16
16
  type,
17
17
  expire,
18
- userId
18
+ userId,
19
+ signatureLocation,
20
+ inputLocation
19
21
  });
20
22
  };
21
23
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kne/fastify-webhook",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "实现一个webhook功能.",
5
5
  "main": "index.js",
6
6
  "scripts": {