@frigear-nu/forms 0.1.1 → 0.1.3
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.
- package/dist/module.d.mts +18 -1
- package/dist/module.json +1 -1
- package/dist/module.mjs +29 -26
- package/dist/runtime/app/components/FormBuilderAccess.vue +255 -262
- package/dist/runtime/app/components/FormBuilderCaptchaSettings.vue +8 -1
- package/dist/runtime/app/components/FormBuilderSettings.vue +143 -141
- package/dist/runtime/app/components/FormCreateSlideover.vue +2 -2
- package/dist/runtime/app/components/FormEmbed.vue +2 -2
- package/dist/runtime/app/components/FormImportSlideover.d.vue.ts +8 -0
- package/dist/runtime/app/components/FormImportSlideover.vue +57 -0
- package/dist/runtime/app/components/FormImportSlideover.vue.d.ts +8 -0
- package/dist/runtime/app/components/FormRenderer.vue +3 -3
- package/dist/runtime/app/components/FormSubmissionView.vue +2 -2
- package/dist/runtime/app/composables/useCaptchaSecrets.js +17 -7
- package/dist/runtime/app/composables/useFormActions.d.ts +14 -2
- package/dist/runtime/app/composables/useFormActions.js +33 -21
- package/dist/runtime/app/composables/useForms.d.ts +12 -5
- package/dist/runtime/app/composables/useForms.js +11 -5
- package/dist/runtime/app/pages/admin-form.vue +36 -20
- package/dist/runtime/app/pages/admin-submission.vue +27 -16
- package/dist/runtime/app/pages/admin-submissions.vue +30 -22
- package/dist/runtime/app/pages/admin.vue +29 -78
- package/dist/runtime/app/pages/form.vue +2 -1
- package/dist/runtime/i18n/lang/da.json +10 -2
- package/dist/runtime/i18n/lang/en.json +10 -2
- package/dist/runtime/server/mcp/tools/admin/get-submission.js +4 -4
- package/dist/runtime/server/mcp/tools/submit-form.js +2 -1
- package/dist/runtime/server/routes/admin/form-clone.post.js +6 -6
- package/dist/runtime/server/routes/admin/form-password.delete.js +5 -3
- package/dist/runtime/server/routes/admin/form-password.get.js +4 -2
- package/dist/runtime/server/routes/admin/form-password.put.js +4 -2
- package/dist/runtime/server/routes/admin/form-secret.delete.js +6 -5
- package/dist/runtime/server/routes/admin/form-secret.put.js +11 -0
- package/dist/runtime/server/routes/admin/form-secrets.get.js +4 -2
- package/dist/runtime/server/routes/admin/form-token.delete.js +9 -6
- package/dist/runtime/server/routes/admin/form-tokens.get.js +5 -3
- package/dist/runtime/server/routes/admin/form-tokens.post.js +5 -4
- package/dist/runtime/server/routes/admin/form.delete.js +6 -4
- package/dist/runtime/server/routes/admin/form.get.js +4 -2
- package/dist/runtime/server/routes/admin/form.patch.js +3 -3
- package/dist/runtime/server/routes/admin/forms.get.js +37 -16
- package/dist/runtime/server/routes/admin/forms.post.js +3 -4
- package/dist/runtime/server/routes/admin/import.post.js +3 -2
- package/dist/runtime/server/routes/admin/submission-file.get.js +8 -5
- package/dist/runtime/server/routes/admin/submission-redeliver.post.js +4 -3
- package/dist/runtime/server/routes/admin/submission.get.js +5 -17
- package/dist/runtime/server/routes/admin/submissions.get.js +29 -13
- package/dist/runtime/server/routes/public/access.get.js +3 -1
- package/dist/runtime/server/routes/public/form.get.js +3 -1
- package/dist/runtime/server/routes/public/submit.post.js +2 -1
- package/dist/runtime/server/utils/access.js +3 -2
- package/dist/runtime/server/utils/admin-schemas.d.ts +9 -0
- package/dist/runtime/server/utils/admin-schemas.js +4 -0
- package/dist/runtime/server/utils/auth.d.ts +8 -4
- package/dist/runtime/server/utils/auth.js +6 -7
- package/dist/runtime/server/utils/captcha.js +3 -2
- package/dist/runtime/server/utils/forms.d.ts +12 -2
- package/dist/runtime/server/utils/forms.js +57 -10
- package/dist/runtime/server/utils/mcp-access.js +2 -1
- package/dist/runtime/server/utils/rate-limit.js +3 -2
- package/dist/runtime/server/utils/submit.d.ts +3 -0
- package/dist/runtime/server/utils/submit.js +21 -17
- package/dist/runtime/utils/api.d.ts +36 -0
- package/dist/runtime/utils/api.js +39 -0
- package/dist/runtime/utils/index.d.ts +1 -0
- package/dist/runtime/utils/index.js +1 -0
- package/dist/types.d.mts +1 -1
- package/package.json +17 -12
- package/dist/runtime/server/routes/admin/form-secrets.put.js +0 -12
- /package/dist/runtime/server/routes/admin/{form-secrets.put.d.ts → form-secret.put.d.ts} +0 -0
package/dist/module.d.mts
CHANGED
|
@@ -375,6 +375,23 @@ type SubmissionDto = {
|
|
|
375
375
|
deliveryError: string | null;
|
|
376
376
|
createdAt: string;
|
|
377
377
|
};
|
|
378
|
+
/** The outcome of `POST /api/admin/forms/submissions/:id/redeliver`. */
|
|
379
|
+
type SubmissionDeliveryDto = {
|
|
380
|
+
deliveryStatus: DeliveryStatus;
|
|
381
|
+
deliveryError: string | null;
|
|
382
|
+
};
|
|
383
|
+
/** The outcome of `POST /api/admin/forms/import`: slugs that were inserted, and slugs skipped because they exist. */
|
|
384
|
+
type FormImportResultDto = {
|
|
385
|
+
inserted: string[];
|
|
386
|
+
skipped: string[];
|
|
387
|
+
};
|
|
388
|
+
/** One page of a paginated admin list (`GET /api/admin/forms`, `GET /api/admin/forms/:id/submissions`). */
|
|
389
|
+
type FormsPage<T> = {
|
|
390
|
+
items: T[];
|
|
391
|
+
total: number;
|
|
392
|
+
page: number;
|
|
393
|
+
pageSize: number;
|
|
394
|
+
};
|
|
378
395
|
type SubmitResponse = {
|
|
379
396
|
ok: true;
|
|
380
397
|
id: string | null;
|
|
@@ -418,4 +435,4 @@ declare module 'nitropack' {
|
|
|
418
435
|
declare const _default: _nuxt_schema.NuxtModule<ModuleOptions, ModuleOptions, false>;
|
|
419
436
|
|
|
420
437
|
export { _default as default };
|
|
421
|
-
export type { AuthorizeContext, CaptchaConfig, CaptchaProvider, CaptchaVerifyContext, Condition, ConditionOp, CreatedFormAccessTokenDto, DeliveredContext, DeliveryStatus, FieldOption, FieldType, FieldValidation, FileDescriptor, FormAccess, FormAccessInfoDto, FormAccessTokenDto, FormAdminDto, FormAuthMode, FormAvailability, FormDefinition, FormDelivery, FormField, FormMode, FormPasswordStatusDto, FormSecretsDto, FormStatus, FormStep, FormStorage, FormSubmitSettings, FormSummaryDto, FormsRuntimeConfig, ModuleOptions, PhoneConfig, PublicFormDto, PublicModuleOptions, SecretSource, SeedForm, SubmissionDto, SubmissionFileDto, SubmissionSummaryDto, SubmitResponse, SubmittedContext, SubmittedFile };
|
|
438
|
+
export type { AuthorizeContext, CaptchaConfig, CaptchaProvider, CaptchaVerifyContext, Condition, ConditionOp, CreatedFormAccessTokenDto, DeliveredContext, DeliveryStatus, FieldOption, FieldType, FieldValidation, FileDescriptor, FormAccess, FormAccessInfoDto, FormAccessTokenDto, FormAdminDto, FormAuthMode, FormAvailability, FormDefinition, FormDelivery, FormField, FormImportResultDto, FormMode, FormPasswordStatusDto, FormSecretsDto, FormStatus, FormStep, FormStorage, FormSubmitSettings, FormSummaryDto, FormsPage, FormsRuntimeConfig, ModuleOptions, PhoneConfig, PublicFormDto, PublicModuleOptions, SecretSource, SeedForm, SubmissionDeliveryDto, SubmissionDto, SubmissionFileDto, SubmissionSummaryDto, SubmitResponse, SubmittedContext, SubmittedFile };
|
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineNuxtModule, createResolver, hasNuxtModule, addServerImportsDir, addServerPlugin, addImports, addComponentsDir, addComponent
|
|
2
|
-
import { registerModule, registerTailwindSource, registerLocales, resolvePagePath, registerDatabaseTable, inlineModuleRuntime, addModulePages, addOptionalMenuSource } from '@frigear-nu/module-kit/utils';
|
|
1
|
+
import { defineNuxtModule, createResolver, hasNuxtModule, addServerImportsDir, addServerPlugin, addImports, addComponentsDir, addComponent } from '@nuxt/kit';
|
|
2
|
+
import { registerModule, registerTailwindSource, registerLocales, resolvePagePath, registerDatabaseTable, addModuleRoutes, inlineModuleRuntime, addModulePages, addOptionalMenuSource } from '@frigear-nu/module-kit/utils';
|
|
3
3
|
import { adminRoute } from '@frigear-nu/admin/utils';
|
|
4
4
|
import { addAuthScope } from '@frigear-nu/auth/utils';
|
|
5
5
|
import { addMcpDefinitions } from '@frigear-nu/mcp/utils';
|
|
@@ -75,30 +75,33 @@ const module$1 = defineNuxtModule({
|
|
|
75
75
|
resolver,
|
|
76
76
|
schema: (dialect) => `./runtime/server/db/schema.${dialect}`
|
|
77
77
|
});
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
78
|
+
addModuleRoutes(resolver, [
|
|
79
|
+
{ method: "get", path: "", file: "admin/forms.get" },
|
|
80
|
+
{ method: "post", path: "", file: "admin/forms.post" },
|
|
81
|
+
{ method: "post", path: "import", file: "admin/import.post" },
|
|
82
|
+
{ method: "get", path: "submissions/:id", file: "admin/submission.get" },
|
|
83
|
+
{ method: "get", path: "submissions/:id/files/:fileId", file: "admin/submission-file.get" },
|
|
84
|
+
{ method: "post", path: "submissions/:id/redeliver", file: "admin/submission-redeliver.post" },
|
|
85
|
+
{ method: "get", path: ":id", file: "admin/form.get" },
|
|
86
|
+
{ method: "patch", path: ":id", file: "admin/form.patch" },
|
|
87
|
+
{ method: "delete", path: ":id", file: "admin/form.delete" },
|
|
88
|
+
{ method: "post", path: ":id/clone", file: "admin/form-clone.post" },
|
|
89
|
+
{ method: "get", path: ":id/submissions", file: "admin/submissions.get" },
|
|
90
|
+
{ method: "get", path: ":id/tokens", file: "admin/form-tokens.get" },
|
|
91
|
+
{ method: "post", path: ":id/tokens", file: "admin/form-tokens.post" },
|
|
92
|
+
{ method: "delete", path: ":id/tokens/:tokenId", file: "admin/form-token.delete" },
|
|
93
|
+
{ method: "get", path: ":id/password", file: "admin/form-password.get" },
|
|
94
|
+
{ method: "put", path: ":id/password", file: "admin/form-password.put" },
|
|
95
|
+
{ method: "delete", path: ":id/password", file: "admin/form-password.delete" },
|
|
96
|
+
{ method: "get", path: ":id/secrets", file: "admin/form-secrets.get" },
|
|
97
|
+
{ method: "put", path: ":id/secrets/:key", file: "admin/form-secret.put" },
|
|
98
|
+
{ method: "delete", path: ":id/secrets/:key", file: "admin/form-secret.delete" }
|
|
99
|
+
], { base: "/api/admin/forms" });
|
|
100
|
+
addModuleRoutes(resolver, [
|
|
101
|
+
{ method: "get", path: ":slug", file: "public/form.get" },
|
|
102
|
+
{ method: "get", path: ":slug/access", file: "public/access.get" },
|
|
103
|
+
{ method: "post", path: ":slug/submit", file: "public/submit.post" }
|
|
104
|
+
], { base: "/api/forms" });
|
|
102
105
|
addServerImportsDir(resolver.resolve("./runtime/server/utils"));
|
|
103
106
|
inlineModuleRuntime(nuxt, resolver);
|
|
104
107
|
if (settings.mcp === true) addMcpDefinitions(nuxt, resolver.resolve("./runtime/server/mcp"));
|