@easy-cms/plugin-form-builder 1.17.0 → 1.18.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.
Files changed (2) hide show
  1. package/dist/index.js +4 -4
  2. package/package.json +5 -5
package/dist/index.js CHANGED
@@ -7,7 +7,7 @@ import { readFile } from "fs/promises";
7
7
  import {
8
8
  definePlugin
9
9
  } from "@easy-cms/core";
10
- import { checkRenamedOptions, resolveAdminModule } from "@easy-cms/core/internal";
10
+ import { checkRenamedOptions, resolveAdminModule, secretsOf } from "@easy-cms/core/internal";
11
11
  import { renderRichText as renderRichText2 } from "@easy-cms/richtext";
12
12
 
13
13
  // src/emails.ts
@@ -197,7 +197,7 @@ var INFO = {
197
197
  name: "@easy-cms/plugin-form-builder",
198
198
  // The plugin API it is written for (`PLUGIN_API_VERSION` of @easy-cms/core).
199
199
  apiVersion: 1,
200
- ...true ? { version: "1.17.0" } : {}
200
+ ...true ? { version: "1.18.0" } : {}
201
201
  };
202
202
 
203
203
  // src/spam.ts
@@ -208,7 +208,7 @@ import {
208
208
  } from "@easy-cms/core/internal";
209
209
  import { honeypotName, verifyTurnstile } from "@easy-cms/core/internal";
210
210
  var formToken = (secret, slug, now = Date.now()) => coreFormToken(secret, `easy-form:${slug}`, now);
211
- var checkToken = (secret, slug, token, minTime, now = Date.now()) => checkFormToken(secret, `easy-form:${slug}`, token, minTime, now);
211
+ var checkToken = (secrets, slug, token, minTime, now = Date.now()) => checkFormToken(secrets, `easy-form:${slug}`, token, minTime, now);
212
212
  var rateKeys = (secret, ip, form, window, now = Date.now()) => coreRateKeys(secret, `easy-form-rate:${ip}:${String(form)}`, window, now);
213
213
 
214
214
  // src/validate.ts
@@ -581,7 +581,7 @@ function formBuilderPlugin(options = {}) {
581
581
  const data = typeof body.data === "object" && body.data !== null ? body.data : {};
582
582
  const { values, errors } = validateSubmission(rowsOf(form), data, locale);
583
583
  if (errors.length > 0) return fail(400, errors);
584
- const token = checkToken(secret, slug, body.token, minTime);
584
+ const token = checkToken(secretsOf(config), slug, body.token, minTime);
585
585
  if (token === "too-fast") return { confirmation };
586
586
  if (token !== "ok") return fail(400, [{ message: reload }]);
587
587
  if (options.turnstile && !await verifyTurnstile(options.turnstile.secretKey, body.turnstile, ip))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@easy-cms/plugin-form-builder",
3
- "version": "1.17.0",
3
+ "version": "1.18.0",
4
4
  "description": "Forms for Easy CMS: build forms in the admin, collect submissions, email notifications, spam protection and an <easy-form> element",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -26,15 +26,15 @@
26
26
  "dist"
27
27
  ],
28
28
  "dependencies": {
29
- "@easy-cms/richtext": "^1.17.0"
29
+ "@easy-cms/richtext": "^1.18.0"
30
30
  },
31
31
  "peerDependencies": {
32
- "@easy-cms/core": "^1.17.0"
32
+ "@easy-cms/core": "^1.18.0"
33
33
  },
34
34
  "devDependencies": {
35
35
  "happy-dom": "^21.0.4",
36
- "@easy-cms/core": "^1.17.0",
37
- "@easy-cms/db-sqlite": "^1.17.0"
36
+ "@easy-cms/core": "^1.18.0",
37
+ "@easy-cms/db-sqlite": "^1.18.0"
38
38
  },
39
39
  "engines": {
40
40
  "node": ">=22.12"