@defra/forms-model 3.0.403 → 3.0.404
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/form/form-manager/index.js +7 -0
- package/dist/module/form/form-manager/index.js.map +1 -0
- package/dist/module/form/form-manager/types.js +2 -0
- package/dist/module/form/form-manager/types.js.map +1 -0
- package/dist/module/form/form-metadata/types.js.map +1 -1
- package/dist/module/index.js +2 -0
- package/dist/module/index.js.map +1 -1
- package/dist/types/form/form-manager/index.d.ts +3 -0
- package/dist/types/form/form-manager/index.d.ts.map +1 -0
- package/dist/types/form/form-manager/types.d.ts +6 -0
- package/dist/types/form/form-manager/types.d.ts.map +1 -0
- package/dist/types/form/form-metadata/types.d.ts +7 -0
- package/dist/types/form/form-metadata/types.d.ts.map +1 -1
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/form/form-manager/index.ts +12 -0
- package/src/form/form-manager/types.ts +7 -0
- package/src/form/form-metadata/types.ts +10 -0
- package/src/index.ts +2 -0
@@ -0,0 +1,7 @@
|
|
1
|
+
import Joi from 'joi';
|
2
|
+
import { pageSchema } from "../../index.js";
|
3
|
+
export const patchPageSchema = Joi.object().keys({
|
4
|
+
title: pageSchema.extract('title').optional(),
|
5
|
+
path: pageSchema.extract('path').optional()
|
6
|
+
}).required().min(1);
|
7
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","names":["Joi","pageSchema","patchPageSchema","object","keys","title","extract","optional","path","required","min"],"sources":["../../../../src/form/form-manager/index.ts"],"sourcesContent":["import Joi from 'joi'\n\nimport { type PatchPageFields } from '~/src/form/form-manager/types.js'\nimport { pageSchema } from '~/src/index.js'\n\nexport const patchPageSchema = Joi.object<PatchPageFields>()\n .keys({\n title: pageSchema.extract('title').optional(),\n path: pageSchema.extract('path').optional()\n })\n .required()\n .min(1)\n"],"mappings":"AAAA,OAAOA,GAAG,MAAM,KAAK;AAGrB,SAASC,UAAU;AAEnB,OAAO,MAAMC,eAAe,GAAGF,GAAG,CAACG,MAAM,CAAkB,CAAC,CACzDC,IAAI,CAAC;EACJC,KAAK,EAAEJ,UAAU,CAACK,OAAO,CAAC,OAAO,CAAC,CAACC,QAAQ,CAAC,CAAC;EAC7CC,IAAI,EAAEP,UAAU,CAACK,OAAO,CAAC,MAAM,CAAC,CAACC,QAAQ,CAAC;AAC5C,CAAC,CAAC,CACDE,QAAQ,CAAC,CAAC,CACVC,GAAG,CAAC,CAAC,CAAC","ignoreList":[]}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"types.js","names":[],"sources":["../../../../src/form/form-manager/types.ts"],"sourcesContent":["import { type Page } from '~/src/index.js'\n\nexport type PatchPageFields = Partial<Pick<Page, 'title' | 'path'>>\n\nexport interface AddComponentQueryOptions {\n prepend?: boolean\n}\n"],"mappings":"","ignoreList":[]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"types.js","names":[],"sources":["../../../../src/form/form-metadata/types.ts"],"sourcesContent":["import { formMetadataSchema } from '~/src/form/form-metadata/index.js'\n\n/**\n * Interface for author (createdBy and updatedBy)\n */\nexport interface FormMetadataAuthor {\n /**\n * The ID of the user\n */\n id: string\n\n /**\n * The display name of the user\n */\n displayName: string\n}\n\n/**\n * Interface for metadata state (draft & live)\n */\nexport interface FormMetadataState {\n /**\n * The date the form state was created\n */\n createdAt: Date\n\n /**\n * The author who created the state\n */\n createdBy: FormMetadataAuthor\n\n /**\n * The date the form state was last updated\n */\n updatedAt: Date\n\n /**\n * The author who last updated the state\n */\n updatedBy: FormMetadataAuthor\n}\n\n/**\n * Interface for email contact details\n */\nexport interface FormMetadataContactEmail {\n /**\n * The email address details for support\n */\n address: string\n\n /**\n * How long it takes to receive a support response\n */\n responseTime: string\n}\n\n/**\n * Interface for online contact details\n */\nexport interface FormMetadataContactOnline {\n /**\n * The url of the online contact link\n */\n url: string\n\n /**\n * The text of the online contact link\n */\n text: string\n}\n\n/**\n * Interface for contact details (phone, email and online)\n */\nexport interface FormMetadataContact {\n /**\n * The phone details for support\n */\n phone?: string\n\n /**\n * The email details for support\n */\n email?: FormMetadataContactEmail\n\n /**\n * The online details for support\n */\n online?: FormMetadataContactOnline\n}\n\n/**\n * Interface for `formMetadataSchema` Joi schema\n * @see {@link formMetadataSchema}\n */\nexport interface FormMetadata {\n /**\n * The id of the form\n */\n id: string\n\n /**\n * The human-readable slug id of the form\n */\n slug: string\n\n /**\n * The human-readable title of the form\n */\n title: string\n\n /**\n * The organisation this form belongs to\n */\n organisation: string\n\n /**\n * The name of the team who own this form\n */\n teamName: string\n\n /**\n * The email of the team who own this form\n */\n teamEmail: string\n /**\n * The contact details of the form\n */\n contact?: FormMetadataContact\n\n /**\n * The guidance text displayed on the form submitted page\n */\n submissionGuidance?: string\n\n /**\n * The url of the privacy notice\n */\n privacyNoticeUrl?: string\n\n /**\n * Email address where form responses are sent\n */\n notificationEmail?: string\n\n /**\n * The draft state of the form\n */\n draft?: FormMetadataState\n\n /**\n * The live state of the form\n */\n live?: FormMetadataState\n\n /**\n * The author who created the form\n */\n createdBy: FormMetadataState['createdBy']\n\n /**\n * The date the form was created\n */\n createdAt: FormMetadataState['createdAt']\n\n /**\n * The author who last updated the form\n */\n updatedBy: FormMetadataState['updatedBy']\n\n /**\n * The date the form was last updated\n */\n updatedAt: FormMetadataState['updatedAt']\n}\n\nexport type FormByIdInput = Pick<FormMetadata, 'id'>\nexport type FormBySlugInput = Pick<FormMetadata, 'slug'>\nexport type FormMetadataDocument = Omit<FormMetadata, 'id'>\nexport type FormMetadataInput = Pick<\n FormMetadata,\n | 'title'\n | 'organisation'\n | 'teamName'\n | 'teamEmail'\n | 'contact'\n | 'submissionGuidance'\n | 'privacyNoticeUrl'\n | 'notificationEmail'\n>\n\nexport interface FormResponse {\n id: FormMetadata['id']\n slug: FormMetadata['slug']\n status: string\n}\n"],"mappings":"","ignoreList":[]}
|
1
|
+
{"version":3,"file":"types.js","names":[],"sources":["../../../../src/form/form-metadata/types.ts"],"sourcesContent":["import { formMetadataSchema } from '~/src/form/form-metadata/index.js'\n\n/**\n * Interface for author (createdBy and updatedBy)\n */\nexport interface FormMetadataAuthor {\n /**\n * The ID of the user\n */\n id: string\n\n /**\n * The display name of the user\n */\n displayName: string\n}\n\n/**\n * Interface for metadata state (draft & live)\n */\nexport interface FormMetadataState {\n /**\n * The date the form state was created\n */\n createdAt: Date\n\n /**\n * The author who created the state\n */\n createdBy: FormMetadataAuthor\n\n /**\n * The date the form state was last updated\n */\n updatedAt: Date\n\n /**\n * The author who last updated the state\n */\n updatedBy: FormMetadataAuthor\n}\n\n/**\n * Interface for email contact details\n */\nexport interface FormMetadataContactEmail {\n /**\n * The email address details for support\n */\n address: string\n\n /**\n * How long it takes to receive a support response\n */\n responseTime: string\n}\n\n/**\n * Interface for online contact details\n */\nexport interface FormMetadataContactOnline {\n /**\n * The url of the online contact link\n */\n url: string\n\n /**\n * The text of the online contact link\n */\n text: string\n}\n\n/**\n * Interface for contact details (phone, email and online)\n */\nexport interface FormMetadataContact {\n /**\n * The phone details for support\n */\n phone?: string\n\n /**\n * The email details for support\n */\n email?: FormMetadataContactEmail\n\n /**\n * The online details for support\n */\n online?: FormMetadataContactOnline\n}\n\n/**\n * Interface for `formMetadataSchema` Joi schema\n * @see {@link formMetadataSchema}\n */\nexport interface FormMetadata {\n /**\n * The id of the form\n */\n id: string\n\n /**\n * The human-readable slug id of the form\n */\n slug: string\n\n /**\n * The human-readable title of the form\n */\n title: string\n\n /**\n * The organisation this form belongs to\n */\n organisation: string\n\n /**\n * The name of the team who own this form\n */\n teamName: string\n\n /**\n * The email of the team who own this form\n */\n teamEmail: string\n /**\n * The contact details of the form\n */\n contact?: FormMetadataContact\n\n /**\n * The guidance text displayed on the form submitted page\n */\n submissionGuidance?: string\n\n /**\n * The url of the privacy notice\n */\n privacyNoticeUrl?: string\n\n /**\n * Email address where form responses are sent\n */\n notificationEmail?: string\n\n /**\n * The draft state of the form\n */\n draft?: FormMetadataState\n\n /**\n * The live state of the form\n */\n live?: FormMetadataState\n\n /**\n * The author who created the form\n */\n createdBy: FormMetadataState['createdBy']\n\n /**\n * The date the form was created\n */\n createdAt: FormMetadataState['createdAt']\n\n /**\n * The author who last updated the form\n */\n updatedBy: FormMetadataState['updatedBy']\n\n /**\n * The date the form was last updated\n */\n updatedAt: FormMetadataState['updatedAt']\n}\n\nexport type FormByIdInput = Pick<FormMetadata, 'id'>\nexport type FormByIDAndPageByIdInput = Pick<FormMetadata, 'id'> & {\n pageId: string\n}\nexport type FormByIDAndPageByIdAndComponentByIdInput = Pick<\n FormMetadata,\n 'id'\n> & {\n pageId: string\n componentId: string\n}\nexport type FormBySlugInput = Pick<FormMetadata, 'slug'>\nexport type FormMetadataDocument = Omit<FormMetadata, 'id'>\nexport type FormMetadataInput = Pick<\n FormMetadata,\n | 'title'\n | 'organisation'\n | 'teamName'\n | 'teamEmail'\n | 'contact'\n | 'submissionGuidance'\n | 'privacyNoticeUrl'\n | 'notificationEmail'\n>\n\nexport interface FormResponse {\n id: FormMetadata['id']\n slug: FormMetadata['slug']\n status: string\n}\n"],"mappings":"","ignoreList":[]}
|
package/dist/module/index.js
CHANGED
@@ -10,6 +10,8 @@ export * from "./form/form-metadata/index.js";
|
|
10
10
|
export * from "./form/form-submission/index.js";
|
11
11
|
export * from "./form/utils/index.js";
|
12
12
|
export * from "./form/form-editor/index.js";
|
13
|
+
export * from "./form/form-manager/index.js";
|
14
|
+
export * from "./form/form-manager/types.js";
|
13
15
|
export * from "./pages/index.js";
|
14
16
|
export * from "./utils/helpers.js";
|
15
17
|
export * from "./utils/markdown.js";
|
package/dist/module/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../src/index.ts"],"sourcesContent":["export * from '~/src/common/schema.js'\nexport * from '~/src/common/pagination/index.js'\nexport * from '~/src/common/search/index.js'\nexport * from '~/src/common/sorting/index.js'\nexport * from '~/src/components/index.js'\nexport * from '~/src/conditions/index.js'\nexport * from '~/src/form/form-definition/index.js'\nexport * from '~/src/form/form-definition/types.js'\nexport * from '~/src/form/form-metadata/index.js'\nexport * from '~/src/form/form-submission/index.js'\nexport * from '~/src/form/utils/index.js'\nexport * from '~/src/form/form-editor/index.js'\nexport * from '~/src/pages/index.js'\nexport * from '~/src/utils/helpers.js'\nexport * from '~/src/utils/markdown.js'\n\nexport type * from '~/src/common/types.js'\nexport type * from '~/src/common/pagination/types.js'\nexport type * from '~/src/common/search/types.js'\nexport type * from '~/src/common/sorting/types.js'\nexport type * from '~/src/components/types.js'\nexport type * from '~/src/conditions/types.js'\nexport type * from '~/src/form/form-definition/types.js'\nexport type * from '~/src/form/form-metadata/types.js'\nexport type * from '~/src/form/form-submission/types.js'\nexport type * from '~/src/form/form-editor/types.js'\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","ignoreList":[]}
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../src/index.ts"],"sourcesContent":["export * from '~/src/common/schema.js'\nexport * from '~/src/common/pagination/index.js'\nexport * from '~/src/common/search/index.js'\nexport * from '~/src/common/sorting/index.js'\nexport * from '~/src/components/index.js'\nexport * from '~/src/conditions/index.js'\nexport * from '~/src/form/form-definition/index.js'\nexport * from '~/src/form/form-definition/types.js'\nexport * from '~/src/form/form-metadata/index.js'\nexport * from '~/src/form/form-submission/index.js'\nexport * from '~/src/form/utils/index.js'\nexport * from '~/src/form/form-editor/index.js'\nexport * from '~/src/form/form-manager/index.js'\nexport * from '~/src/form/form-manager/types.js'\nexport * from '~/src/pages/index.js'\nexport * from '~/src/utils/helpers.js'\nexport * from '~/src/utils/markdown.js'\n\nexport type * from '~/src/common/types.js'\nexport type * from '~/src/common/pagination/types.js'\nexport type * from '~/src/common/search/types.js'\nexport type * from '~/src/common/sorting/types.js'\nexport type * from '~/src/components/types.js'\nexport type * from '~/src/conditions/types.js'\nexport type * from '~/src/form/form-definition/types.js'\nexport type * from '~/src/form/form-metadata/types.js'\nexport type * from '~/src/form/form-submission/types.js'\nexport type * from '~/src/form/form-editor/types.js'\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","ignoreList":[]}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/form/form-manager/index.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,KAAK,CAAA;AAKrB,eAAO,MAAM,eAAe,kFAMnB,CAAA"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/form/form-manager/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,gBAAgB,CAAA;AAE1C,MAAM,MAAM,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,EAAE,OAAO,GAAG,MAAM,CAAC,CAAC,CAAA;AAEnE,MAAM,WAAW,wBAAwB;IACvC,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB"}
|
@@ -146,6 +146,13 @@ export interface FormMetadata {
|
|
146
146
|
updatedAt: FormMetadataState['updatedAt'];
|
147
147
|
}
|
148
148
|
export type FormByIdInput = Pick<FormMetadata, 'id'>;
|
149
|
+
export type FormByIDAndPageByIdInput = Pick<FormMetadata, 'id'> & {
|
150
|
+
pageId: string;
|
151
|
+
};
|
152
|
+
export type FormByIDAndPageByIdAndComponentByIdInput = Pick<FormMetadata, 'id'> & {
|
153
|
+
pageId: string;
|
154
|
+
componentId: string;
|
155
|
+
};
|
149
156
|
export type FormBySlugInput = Pick<FormMetadata, 'slug'>;
|
150
157
|
export type FormMetadataDocument = Omit<FormMetadata, 'id'>;
|
151
158
|
export type FormMetadataInput = Pick<FormMetadata, 'title' | 'organisation' | 'teamName' | 'teamEmail' | 'contact' | 'submissionGuidance' | 'privacyNoticeUrl' | 'notificationEmail'>;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/form/form-metadata/types.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,EAAE,EAAE,MAAM,CAAA;IAEV;;OAEG;IACH,WAAW,EAAE,MAAM,CAAA;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC;;OAEG;IACH,SAAS,EAAE,IAAI,CAAA;IAEf;;OAEG;IACH,SAAS,EAAE,kBAAkB,CAAA;IAE7B;;OAEG;IACH,SAAS,EAAE,IAAI,CAAA;IAEf;;OAEG;IACH,SAAS,EAAE,kBAAkB,CAAA;CAC9B;AAED;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACvC;;OAEG;IACH,OAAO,EAAE,MAAM,CAAA;IAEf;;OAEG;IACH,YAAY,EAAE,MAAM,CAAA;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACxC;;OAEG;IACH,GAAG,EAAE,MAAM,CAAA;IAEX;;OAEG;IACH,IAAI,EAAE,MAAM,CAAA;CACb;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;IAEd;;OAEG;IACH,KAAK,CAAC,EAAE,wBAAwB,CAAA;IAEhC;;OAEG;IACH,MAAM,CAAC,EAAE,yBAAyB,CAAA;CACnC;AAED;;;GAGG;AACH,MAAM,WAAW,YAAY;IAC3B;;OAEG;IACH,EAAE,EAAE,MAAM,CAAA;IAEV;;OAEG;IACH,IAAI,EAAE,MAAM,CAAA;IAEZ;;OAEG;IACH,KAAK,EAAE,MAAM,CAAA;IAEb;;OAEG;IACH,YAAY,EAAE,MAAM,CAAA;IAEpB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAA;IAEhB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ts
CHANGED
@@ -10,6 +10,8 @@ export * from './form/form-metadata/index.js';
|
|
10
10
|
export * from './form/form-submission/index.js';
|
11
11
|
export * from './form/utils/index.js';
|
12
12
|
export * from './form/form-editor/index.js';
|
13
|
+
export * from './form/form-manager/index.js';
|
14
|
+
export * from './form/form-manager/types.js';
|
13
15
|
export * from './pages/index.js';
|
14
16
|
export * from './utils/helpers.js';
|
15
17
|
export * from './utils/markdown.js';
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAA;AACtC,cAAc,kCAAkC,CAAA;AAChD,cAAc,8BAA8B,CAAA;AAC5C,cAAc,+BAA+B,CAAA;AAC7C,cAAc,2BAA2B,CAAA;AACzC,cAAc,2BAA2B,CAAA;AACzC,cAAc,qCAAqC,CAAA;AACnD,cAAc,qCAAqC,CAAA;AACnD,cAAc,mCAAmC,CAAA;AACjD,cAAc,qCAAqC,CAAA;AACnD,cAAc,2BAA2B,CAAA;AACzC,cAAc,iCAAiC,CAAA;AAC/C,cAAc,sBAAsB,CAAA;AACpC,cAAc,wBAAwB,CAAA;AACtC,cAAc,yBAAyB,CAAA;AAEvC,mBAAmB,uBAAuB,CAAA;AAC1C,mBAAmB,kCAAkC,CAAA;AACrD,mBAAmB,8BAA8B,CAAA;AACjD,mBAAmB,+BAA+B,CAAA;AAClD,mBAAmB,2BAA2B,CAAA;AAC9C,mBAAmB,2BAA2B,CAAA;AAC9C,mBAAmB,qCAAqC,CAAA;AACxD,mBAAmB,mCAAmC,CAAA;AACtD,mBAAmB,qCAAqC,CAAA;AACxD,mBAAmB,iCAAiC,CAAA"}
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAA;AACtC,cAAc,kCAAkC,CAAA;AAChD,cAAc,8BAA8B,CAAA;AAC5C,cAAc,+BAA+B,CAAA;AAC7C,cAAc,2BAA2B,CAAA;AACzC,cAAc,2BAA2B,CAAA;AACzC,cAAc,qCAAqC,CAAA;AACnD,cAAc,qCAAqC,CAAA;AACnD,cAAc,mCAAmC,CAAA;AACjD,cAAc,qCAAqC,CAAA;AACnD,cAAc,2BAA2B,CAAA;AACzC,cAAc,iCAAiC,CAAA;AAC/C,cAAc,kCAAkC,CAAA;AAChD,cAAc,kCAAkC,CAAA;AAChD,cAAc,sBAAsB,CAAA;AACpC,cAAc,wBAAwB,CAAA;AACtC,cAAc,yBAAyB,CAAA;AAEvC,mBAAmB,uBAAuB,CAAA;AAC1C,mBAAmB,kCAAkC,CAAA;AACrD,mBAAmB,8BAA8B,CAAA;AACjD,mBAAmB,+BAA+B,CAAA;AAClD,mBAAmB,2BAA2B,CAAA;AAC9C,mBAAmB,2BAA2B,CAAA;AAC9C,mBAAmB,qCAAqC,CAAA;AACxD,mBAAmB,mCAAmC,CAAA;AACtD,mBAAmB,qCAAqC,CAAA;AACxD,mBAAmB,iCAAiC,CAAA"}
|
package/package.json
CHANGED
@@ -0,0 +1,12 @@
|
|
1
|
+
import Joi from 'joi'
|
2
|
+
|
3
|
+
import { type PatchPageFields } from '~/src/form/form-manager/types.js'
|
4
|
+
import { pageSchema } from '~/src/index.js'
|
5
|
+
|
6
|
+
export const patchPageSchema = Joi.object<PatchPageFields>()
|
7
|
+
.keys({
|
8
|
+
title: pageSchema.extract('title').optional(),
|
9
|
+
path: pageSchema.extract('path').optional()
|
10
|
+
})
|
11
|
+
.required()
|
12
|
+
.min(1)
|
@@ -176,6 +176,16 @@ export interface FormMetadata {
|
|
176
176
|
}
|
177
177
|
|
178
178
|
export type FormByIdInput = Pick<FormMetadata, 'id'>
|
179
|
+
export type FormByIDAndPageByIdInput = Pick<FormMetadata, 'id'> & {
|
180
|
+
pageId: string
|
181
|
+
}
|
182
|
+
export type FormByIDAndPageByIdAndComponentByIdInput = Pick<
|
183
|
+
FormMetadata,
|
184
|
+
'id'
|
185
|
+
> & {
|
186
|
+
pageId: string
|
187
|
+
componentId: string
|
188
|
+
}
|
179
189
|
export type FormBySlugInput = Pick<FormMetadata, 'slug'>
|
180
190
|
export type FormMetadataDocument = Omit<FormMetadata, 'id'>
|
181
191
|
export type FormMetadataInput = Pick<
|
package/src/index.ts
CHANGED
@@ -10,6 +10,8 @@ export * from '~/src/form/form-metadata/index.js'
|
|
10
10
|
export * from '~/src/form/form-submission/index.js'
|
11
11
|
export * from '~/src/form/utils/index.js'
|
12
12
|
export * from '~/src/form/form-editor/index.js'
|
13
|
+
export * from '~/src/form/form-manager/index.js'
|
14
|
+
export * from '~/src/form/form-manager/types.js'
|
13
15
|
export * from '~/src/pages/index.js'
|
14
16
|
export * from '~/src/utils/helpers.js'
|
15
17
|
export * from '~/src/utils/markdown.js'
|