@hatchet-dev/typescript-sdk 0.15.2 → 0.15.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.
@@ -79,22 +79,26 @@ class WebhookHandler {
79
79
  expressHandler({ secret }) {
80
80
  return (req, res) => {
81
81
  if (req.method === 'GET') {
82
- res.sendStatus(200).send(okMessage);
82
+ res.status(200).send(okMessage);
83
83
  return;
84
84
  }
85
85
  if (req.method === 'PUT') {
86
- this.getHealthcheckResponse(req.body, req.headers['x-hatchet-signature'], secret)
86
+ let { body } = req;
87
+ if (typeof body !== 'string') {
88
+ body = JSON.stringify(body);
89
+ }
90
+ this.getHealthcheckResponse(body, req.headers['x-hatchet-signature'], secret)
87
91
  .then((resp) => {
88
- res.sendStatus(200).json(resp);
92
+ res.status(200).json(resp);
89
93
  })
90
94
  .catch((err) => {
91
- res.sendStatus(500);
95
+ res.status(500);
92
96
  this.worker.logger.error(`Error handling request: ${err.message}`);
93
97
  });
94
98
  return;
95
99
  }
96
100
  if (req.method !== 'POST') {
97
- res.sendStatus(405).json({ error: 'Method not allowed' });
101
+ res.status(405).json({ error: 'Method not allowed' });
98
102
  return;
99
103
  }
100
104
  let action = req.body;
@@ -103,10 +107,10 @@ class WebhookHandler {
103
107
  }
104
108
  this.handle(action, req.headers['x-hatchet-signature'], secret)
105
109
  .then(() => {
106
- res.sendStatus(200);
110
+ res.status(200);
107
111
  })
108
112
  .catch((err) => {
109
- res.sendStatus(500);
113
+ res.status(500);
110
114
  this.worker.logger.error(`Error handling request: ${err.message}`);
111
115
  });
112
116
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hatchet-dev/typescript-sdk",
3
- "version": "0.15.2",
3
+ "version": "0.15.4",
4
4
  "description": "Background task orchestration & visibility for developers",
5
5
  "types": "dist/index.d.ts",
6
6
  "files": [
package/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const HATCHET_VERSION = "0.15.2";
1
+ export declare const HATCHET_VERSION = "0.15.4";
package/version.js CHANGED
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.HATCHET_VERSION = void 0;
4
- exports.HATCHET_VERSION = '0.15.2';
4
+ exports.HATCHET_VERSION = '0.15.4';