@hatchet-dev/typescript-sdk 0.15.1 → 0.15.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.
@@ -79,15 +79,13 @@ class WebhookHandler {
79
79
  expressHandler({ secret }) {
80
80
  return (req, res) => {
81
81
  if (req.method === 'GET') {
82
- res.sendStatus(200);
83
- res.send(okMessage);
82
+ res.sendStatus(200).send(okMessage);
84
83
  return;
85
84
  }
86
85
  if (req.method === 'PUT') {
87
86
  this.getHealthcheckResponse(req.body, req.headers['x-hatchet-signature'], secret)
88
87
  .then((resp) => {
89
- res.sendStatus(200);
90
- res.json(resp);
88
+ res.sendStatus(200).json(resp);
91
89
  })
92
90
  .catch((err) => {
93
91
  res.sendStatus(500);
@@ -96,11 +94,14 @@ class WebhookHandler {
96
94
  return;
97
95
  }
98
96
  if (req.method !== 'POST') {
99
- res.sendStatus(405);
100
- res.json({ error: 'Method not allowed' });
97
+ res.sendStatus(405).json({ error: 'Method not allowed' });
101
98
  return;
102
99
  }
103
- this.handle(req.body, req.headers['x-hatchet-signature'], secret)
100
+ let action = req.body;
101
+ if (typeof action !== 'string') {
102
+ action = JSON.stringify(action);
103
+ }
104
+ this.handle(action, req.headers['x-hatchet-signature'], secret)
104
105
  .then(() => {
105
106
  res.sendStatus(200);
106
107
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hatchet-dev/typescript-sdk",
3
- "version": "0.15.1",
3
+ "version": "0.15.2",
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.1";
1
+ export declare const HATCHET_VERSION = "0.15.2";
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.1';
4
+ exports.HATCHET_VERSION = '0.15.2';