Přeskočit na hlavní obsah

Module: client/formManagementClient

Functions

createAction

createAction<TSettings>(formId, action, token): Promise<Action<TSettings>>

Create action attached to a form in formio.

Type parameters

Name
TSettings

Parameters

NameTypeDescription
formIdstringId of the form to create action for.
actionAction<TSettings>Definition of the action to create.
tokenstringJWT token for formio.

Returns

Promise<Action<TSettings>>

Throws

If the http request fails.

Throws

If the response is not valid json or when a network error is encountered or CORS is misconfigured on the server-side.

Defined in

src/web-app/src/client/formManagementClient.ts:329


createForm

createForm(formSchema, token): Promise<Form>

Submit form to formio.

Parameters

NameTypeDescription
formSchemaFormSchemaSchema of the form to submit.
tokenstringJWT token for formio.

Returns

Promise<Form>

Created form.

Throws

If the http request fails.

Throws

If the response is not valid json or when a network error is encountered or CORS is misconfigured on the server-side.

Defined in

src/web-app/src/client/formManagementClient.ts:85


deleteForm

deleteForm(formPath, token): Promise<void>

Delete form from the form management system.

Parameters

NameTypeDescription
formPathstringPath of the form to delete.
tokenstringJWT token for formio.

Returns

Promise<void>

Throws

If the http request fails.

Throws

When a network error is encountered or CORS is misconfigured on the server-side.

Defined in

src/web-app/src/client/formManagementClient.ts:183


deleteFormById

deleteFormById(formId, token): Promise<void>

Delete form from the form management system.

Parameters

NameTypeDescription
formIdstringId of the form to delete.
tokenstringJWT token for formio.

Returns

Promise<void>

Throws

If the http request fails.

Throws

When a network error is encountered or CORS is misconfigured on the server-side.

Defined in

src/web-app/src/client/formManagementClient.ts:202


exportFormSubmissions

exportFormSubmissions(formId, root0): Promise<Blob>

Export form submissions from formio.

Parameters

NameTypeDescription
formIdstringId of the form to export.
root0ObjectOptions for exporting form submissions.
root0.filters?{ comparedValue: string ; fieldPath: string ; operation: "contains" }[]List of filters to apply.
root0.format"json" | "csv"Format to export the submissions in.
root0.tokenstringJWT token for formio.

Returns

Promise<Blob>

Blob with exported data in given format.

Throws

If the http request fails.

Throws

When a network error is encountered or CORS is misconfigured on the server-side.

Defined in

src/web-app/src/client/formManagementClient.ts:140


loadFormById

loadFormById(formId, token): Promise<Form | null>

Load form with given id from formio.

Parameters

NameTypeDescription
formIdstringId of the form to load.
tokenstringJWT token for formio.

Returns

Promise<Form | null>

Form with given id or null if not found.

Throws

If the http request fails.

Throws

If the response is not valid json or when a network error is encountered or CORS is misconfigured on the server-side.

Defined in

src/web-app/src/client/formManagementClient.ts:52


loadFormByPath

loadFormByPath(relativeFormPath, token): Promise<Form | null>

Load form with given path from formio.

Parameters

NameTypeDescription
relativeFormPathstringRelative path to the form (including leading slash).
tokenstringJWT token for formio.

Returns

Promise<Form | null>

Form with given path or null if not found.

Throws

If the returned http status is not OK.

Throws

If the response is not valid json or when a network error is encountered or CORS is misconfigured on the server-side.

Defined in

src/web-app/src/client/formManagementClient.ts:16


loadForms

loadForms(root0): Promise<{ data: Form[] ; totalCount: number }>

Load forms from the form management system.

Parameters

NameTypeDescription
root0ObjectOptions for loading forms.
root0.filters?{ comparedValue: string ; fieldPath: string ; operation: "contains" }[]List of filters to apply.
root0.paginationObjectPagination settings.
root0.pagination.limitnumber-
root0.pagination.offsetnumber-
root0.sort?ObjectSorting settings.
root0.sort.fieldkeyof FormSchema | "_id"-
root0.sort.order"asc" | "desc"-
root0.tags?string[]List of tags which must be present on the form.
root0.tokenstringJWT token for formio.

Returns

Promise<{ data: Form[] ; totalCount: number }>

List of forms.

Throws

If the response is not valid json or when a network error is encountered or CORS is misconfigured on the server-side.

Throws

If the Content-Range header in the response is invalid or the total count is unknown.

Defined in

src/web-app/src/client/formManagementClient.ts:230


loadSubmission

loadSubmission(formPath, submissionId, token): Promise<Submission | null>

Load submissions from formio.

Parameters

NameTypeDescription
formPathstringPath of the form to load submissions from.
submissionIdstringId of the submission to load.
tokenstringJWT token for formio.

Returns

Promise<Submission | null>

Submission or null if the returned status is 404.

Throws

If the http request fails.

Throws

If the response is not valid json or when a network error is encountered or CORS is misconfigured on the server-side.

Defined in

src/web-app/src/client/formManagementClient.ts:357


loadSubmissions

loadSubmissions(formId, root0): Promise<{ data: Submission[] ; totalCount: number }>

Get submissions of a form.

Parameters

NameTypeDescription
formIdstringId of the form to load submissions from.
root0ObjectOptions for loading submissions.
root0.filters?{ comparedValue: string ; fieldPath: string ; operation: "contains" }[]List of filters to apply.
root0.paginationObjectPagination settings.
root0.pagination.limitnumber-
root0.pagination.offsetnumber-
root0.sort?ObjectSorting settings.
root0.sort.fieldstring-
root0.sort.order"asc" | "desc"-
root0.tokenstringJWT token for formio.

Returns

Promise<{ data: Submission[] ; totalCount: number }>

List of submissions.

Throws

If the http request fails.

Throws

If the response is not valid json or when a network error is encountered or CORS is misconfigured on the server-side.

Throws

If the Content-Range header is invalid or unknown.

Defined in

src/web-app/src/client/formManagementClient.ts:402


submitForm

submitForm(formPath, submissionData, token): Promise<Submission>

Make a submission to a formio form.

Parameters

NameTypeDescription
formPathstringPath of the form to submit to (including leading slash).
submissionDataunknownForm data to submit.
tokenstringJWT token for formio.

Returns

Promise<Submission>

Created submission.

Throws

If the http request fails.

Throws

If the response is not valid json or when a network error is encountered or CORS is misconfigured on the server-side.

Defined in

src/web-app/src/client/formManagementClient.ts:111


updateForm

updateForm(formSchema, token): Promise<Form>

Update form in the form management system.

Parameters

NameTypeDescription
formSchemaFormForm schema to save to server.
tokenstringJWT token for formio.

Returns

Promise<Form>

Updated form.

Throws

If the http request fails.

Throws

If the response is not valid json or when a network error is encountered or CORS is misconfigured on the server-side.

Defined in

src/web-app/src/client/formManagementClient.ts:303


updateSubmission

updateSubmission(formPath, updatedSubmission, token): Promise<Submission>

Update submission in the form management system.

Parameters

NameTypeDescription
formPathstringPath of the form of which to update the submission.
updatedSubmissionPartial<Submission> & Pick<Submission, "data" | "_id">Updated submission (used to replace submission with the same _id).
tokenstringJWT token for formio.

Returns

Promise<Submission>

Updated submission.

Throws

If the http request fails.

Throws

If the response is not valid json or when a network error is encountered or CORS is misconfigured on the server-side.

Defined in

src/web-app/src/client/formManagementClient.ts:473