@easy-cms/plugin-form-builder 0.43.0 → 0.44.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 +11 -7
  2. package/package.json +5 -5
package/dist/index.js CHANGED
@@ -195,7 +195,7 @@ function fieldBlocks(localized, kinds) {
195
195
  // src/info.ts
196
196
  var INFO = {
197
197
  name: "@easy-cms/plugin-form-builder",
198
- ...true ? { version: "0.43.0" } : {}
198
+ ...true ? { version: "0.44.0" } : {}
199
199
  };
200
200
 
201
201
  // src/spam.ts
@@ -643,7 +643,7 @@ function formBuilderPlugin(options = {}) {
643
643
  const csvEndpoint = {
644
644
  path: "/form/:slug/submissions.csv",
645
645
  method: "get",
646
- handler: async ({ params, user, cms }) => {
646
+ handler: async ({ params, user, context, cms }) => {
647
647
  const slug = params.slug;
648
648
  if (!user) return fail(401, [{ message: "Log in to export submissions" }]);
649
649
  const { docs } = await cms.find(forms, {
@@ -652,7 +652,8 @@ function formBuilderPlugin(options = {}) {
652
652
  depth: 0,
653
653
  draft: true,
654
654
  overrideAccess: false,
655
- user
655
+ user,
656
+ context
656
657
  });
657
658
  const form = docs[0];
658
659
  if (!form) return fail(404, [{ message: `No form "${slug}"` }]);
@@ -665,7 +666,8 @@ function formBuilderPlugin(options = {}) {
665
666
  page,
666
667
  depth: 0,
667
668
  overrideAccess: false,
668
- user
669
+ user,
670
+ context
669
671
  });
670
672
  rows.push(...result.docs);
671
673
  if (!result.hasNextPage) break;
@@ -698,7 +700,7 @@ function formBuilderPlugin(options = {}) {
698
700
  const statsEndpoint = {
699
701
  path: "/form/stats.json",
700
702
  method: "get",
701
- handler: async ({ url, user, cms }) => {
703
+ handler: async ({ url, user, context, cms }) => {
702
704
  if (!user) return fail(401, [{ message: "Log in to see form statistics" }]);
703
705
  const days = url.searchParams.get("days") === "30" ? 30 : 7;
704
706
  const timeZone = validTimeZone(url.searchParams.get("tz"));
@@ -723,7 +725,8 @@ function formBuilderPlugin(options = {}) {
723
725
  depth: 0,
724
726
  draft: true,
725
727
  overrideAccess: false,
726
- user
728
+ user,
729
+ context
727
730
  });
728
731
  formRows.push(...result.docs);
729
732
  if (!result.hasNextPage) break;
@@ -737,7 +740,8 @@ function formBuilderPlugin(options = {}) {
737
740
  page,
738
741
  depth: 0,
739
742
  overrideAccess: false,
740
- user
743
+ user,
744
+ context
741
745
  });
742
746
  for (const row of result.docs) {
743
747
  const perDay = counts.get(String(row.form));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@easy-cms/plugin-form-builder",
3
- "version": "0.43.0",
3
+ "version": "0.44.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",
@@ -23,15 +23,15 @@
23
23
  "dist"
24
24
  ],
25
25
  "dependencies": {
26
- "@easy-cms/richtext": "^0.43.0"
26
+ "@easy-cms/richtext": "^0.44.0"
27
27
  },
28
28
  "peerDependencies": {
29
- "@easy-cms/core": "^0.43.0"
29
+ "@easy-cms/core": "^0.44.0"
30
30
  },
31
31
  "devDependencies": {
32
32
  "happy-dom": "^20.14.5",
33
- "@easy-cms/core": "^0.43.0",
34
- "@easy-cms/db-sqlite": "^0.43.0"
33
+ "@easy-cms/core": "^0.44.0",
34
+ "@easy-cms/db-sqlite": "^0.44.0"
35
35
  },
36
36
  "engines": {
37
37
  "node": ">=22.12"