@pluv/platform-pluv 0.37.6 → 0.37.7

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.
@@ -1,5 +1,5 @@
1
1
 
2
- > @pluv/platform-pluv@0.37.6 build /home/runner/work/pluv/pluv/packages/platform-pluv
2
+ > @pluv/platform-pluv@0.37.7 build /home/runner/work/pluv/pluv/packages/platform-pluv
3
3
  > tsup src/index.ts --format esm,cjs --dts
4
4
 
5
5
  CLI Building entry: src/index.ts
@@ -8,11 +8,11 @@
8
8
  CLI Target: es6
9
9
  ESM Build start
10
10
  CJS Build start
11
- ESM dist/index.mjs 9.79 KB
12
- ESM ⚡️ Build success in 88ms
13
- CJS dist/index.js 10.68 KB
14
- CJS ⚡️ Build success in 88ms
11
+ CJS dist/index.js 11.40 KB
12
+ CJS ⚡️ Build success in 124ms
13
+ ESM dist/index.mjs 9.86 KB
14
+ ESM ⚡️ Build success in 132ms
15
15
  DTS Build start
16
- DTS ⚡️ Build success in 6253ms
16
+ DTS ⚡️ Build success in 6308ms
17
17
  DTS dist/index.d.mts 3.56 KB
18
18
  DTS dist/index.d.ts 3.56 KB
package/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # @pluv/platform-pluv
2
2
 
3
+ ## 0.37.7
4
+
5
+ ### Patch Changes
6
+
7
+ - c874f25: Fixed webhook signature verification.
8
+ - @pluv/crdt@0.37.7
9
+ - @pluv/io@0.37.7
10
+ - @pluv/types@0.37.7
11
+
3
12
  ## 0.37.6
4
13
 
5
14
  ### Patch Changes
package/dist/index.js CHANGED
@@ -1,8 +1,10 @@
1
1
  "use strict";
2
+ var __create = Object.create;
2
3
  var __defProp = Object.defineProperty;
3
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
6
  var __getOwnPropSymbols = Object.getOwnPropertySymbols;
7
+ var __getProtoOf = Object.getPrototypeOf;
6
8
  var __hasOwnProp = Object.prototype.hasOwnProperty;
7
9
  var __propIsEnum = Object.prototype.propertyIsEnumerable;
8
10
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
@@ -29,6 +31,14 @@ var __copyProps = (to, from, except, desc) => {
29
31
  }
30
32
  return to;
31
33
  };
34
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
35
+ // If the importer is in node compatibility mode or this is not an ESM
36
+ // file that has been converted to a CommonJS file using a Babel-
37
+ // compatible transform (i.e. "__esModule" has not been set), then set
38
+ // "default" to the CommonJS "module.exports" for node compatibility.
39
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
40
+ mod
41
+ ));
32
42
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
33
43
  var __async = (__this, __arguments, generator) => {
34
44
  return new Promise((resolve, reject) => {
@@ -61,6 +71,7 @@ module.exports = __toCommonJS(index_exports);
61
71
 
62
72
  // src/PluvPlatform.ts
63
73
  var import_io = require("@pluv/io");
74
+ var import_fast_json_stable_stringify = __toESM(require("fast-json-stable-stringify"));
64
75
  var import_hono = require("hono");
65
76
 
66
77
  // src/constants.ts
@@ -208,7 +219,7 @@ var PluvPlatform = class extends import_io.AbstractPlatform {
208
219
  if (!this._webhookSecret || !signature) return c.json({ error: "Unauthorized" }, 401);
209
220
  const payload = yield c.req.json();
210
221
  const verified = yield verifyWebhook({
211
- payload,
222
+ payload: (0, import_fast_json_stable_stringify.default)(payload),
212
223
  signature,
213
224
  secret: this._webhookSecret
214
225
  });
package/dist/index.mjs CHANGED
@@ -43,6 +43,7 @@ var __async = (__this, __arguments, generator) => {
43
43
 
44
44
  // src/PluvPlatform.ts
45
45
  import { AbstractPlatform } from "@pluv/io";
46
+ import stringify from "fast-json-stable-stringify";
46
47
  import { Hono } from "hono";
47
48
 
48
49
  // src/constants.ts
@@ -190,7 +191,7 @@ var PluvPlatform = class extends AbstractPlatform {
190
191
  if (!this._webhookSecret || !signature) return c.json({ error: "Unauthorized" }, 401);
191
192
  const payload = yield c.req.json();
192
193
  const verified = yield verifyWebhook({
193
- payload,
194
+ payload: stringify(payload),
194
195
  signature,
195
196
  secret: this._webhookSecret
196
197
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pluv/platform-pluv",
3
- "version": "0.37.6",
3
+ "version": "0.37.7",
4
4
  "description": "@pluv/io adapter for pluv.io",
5
5
  "author": "leedavidcs",
6
6
  "license": "MIT",
@@ -17,19 +17,20 @@
17
17
  "access": "public"
18
18
  },
19
19
  "dependencies": {
20
- "@types/node": "^22.13.9",
20
+ "@types/node": "^22.13.10",
21
+ "fast-json-stable-stringify": "^2.1.0",
21
22
  "hono": "^4.7.4",
22
23
  "zod": "^3.24.2",
23
- "@pluv/crdt": "^0.37.6",
24
- "@pluv/io": "^0.37.6",
25
- "@pluv/types": "^0.37.6"
24
+ "@pluv/crdt": "^0.37.7",
25
+ "@pluv/types": "^0.37.7",
26
+ "@pluv/io": "^0.37.7"
26
27
  },
27
28
  "devDependencies": {
28
29
  "eslint": "^8.57.1",
29
30
  "tsup": "^8.4.0",
30
31
  "typescript": "^5.8.2",
31
- "@pluv/tsconfig": "^0.37.6",
32
- "eslint-config-pluv": "^0.37.6"
32
+ "@pluv/tsconfig": "^0.37.7",
33
+ "eslint-config-pluv": "^0.37.7"
33
34
  },
34
35
  "scripts": {
35
36
  "build": "tsup src/index.ts --format esm,cjs --dts",
@@ -7,6 +7,7 @@ import type {
7
7
  WebSocketSerializedState,
8
8
  } from "@pluv/io";
9
9
  import { AbstractPlatform } from "@pluv/io";
10
+ import stringify from "fast-json-stable-stringify";
10
11
  import { Hono } from "hono";
11
12
  import { SIGNATURE_HEADER } from "./constants";
12
13
  import { ZodEvent } from "./schemas";
@@ -189,7 +190,7 @@ export class PluvPlatform extends AbstractPlatform<
189
190
  const payload = await c.req.json();
190
191
 
191
192
  const verified = await verifyWebhook({
192
- payload,
193
+ payload: stringify(payload),
193
194
  signature,
194
195
  secret: this._webhookSecret,
195
196
  });