liferay-headless-rest-client
Version:
A collection of Headless Clients used in Liferay Portal
596 lines (595 loc) • 14.4 kB
TypeScript
export type FormDocument = {
readonly contentUrl?: string;
description?: string;
readonly encodingFormat?: string;
readonly fileExtension?: string;
folderId?: number;
readonly id?: number;
siteId?: number;
readonly sizeInBytes?: number;
title?: string;
readonly 'x-class-name'?: string;
};
export type Creator = {
additionalName?: string;
/**
* The type of the content.
*/
readonly contentType?: string;
familyName?: string;
givenName?: string;
id?: number;
image?: string;
name?: string;
profileURL?: string;
readonly 'x-class-name'?: string;
};
/**
* https://www.schema.org/FormFieldValue
*/
export type FormFieldValue = {
formDocument?: FormDocument;
formDocumentId?: number;
readonly id?: number;
name?: string;
value?: string;
readonly 'x-class-name'?: string;
};
export type FormRecord = {
creator?: Creator;
readonly dateCreated?: string;
readonly dateModified?: string;
readonly datePublished?: string;
draft?: boolean;
formFieldValues?: Array<FormFieldValue>;
formId?: number;
readonly id?: number;
readonly 'x-class-name'?: string;
};
export type Facet = {
facetCriteria?: string;
facetValues?: Array<FacetValue>;
};
export type FacetValue = {
numberOfOccurrences?: number;
term?: string;
};
export type PageFormRecord = {
items?: Array<FormRecord>;
lastPage?: number;
totalCount?: number;
actions?: {
[key: string]: {
[key: string]: string;
};
};
page?: number;
facets?: Array<Facet>;
pageSize?: number;
};
export type Form = {
availableLanguages?: Array<string>;
creator?: Creator;
dateCreated?: string;
dateModified?: string;
datePublished?: string;
defaultLanguage?: string;
description?: string;
description_i18n?: {
[key: string]: string;
};
readonly formRecords?: Array<FormRecord>;
formRecordsIds?: Array<number>;
id?: number;
name?: string;
name_i18n?: {
[key: string]: string;
};
siteId?: number;
structure?: FormStructure;
structureId?: number;
readonly 'x-class-name'?: string;
};
export type FormField = {
autocomplete?: boolean;
dataSourceType?: string;
dataType?: string;
displayStyle?: string;
formFieldOptions?: Array<FormFieldOption>;
grid?: Grid;
hasFormRules?: boolean;
id?: number;
immutable?: boolean;
inline?: boolean;
inputControl?: string;
label?: string;
label_i18n?: {
[key: string]: string;
};
localizable?: boolean;
multiple?: boolean;
name?: string;
placeholder?: string;
predefinedValue?: string;
predefinedValue_i18n?: {
[key: string]: string;
};
readOnly?: boolean;
repeatable?: boolean;
required?: boolean;
showAsSwitcher?: boolean;
showLabel?: boolean;
style?: string;
text?: string;
text_i18n?: {
[key: string]: string;
};
tooltip?: string;
validation?: Validation;
readonly 'x-class-name'?: string;
};
export type FormFieldOption = {
id?: number;
label?: string;
label_i18n?: {
[key: string]: string;
};
value?: string;
readonly 'x-class-name'?: string;
};
/**
* https://www.schema.org/FormPage
*/
export type FormPage = {
formFields?: Array<FormField>;
headline?: string;
headline_i18n?: {
[key: string]: string;
};
id?: number;
text?: string;
text_i18n?: {
[key: string]: string;
};
readonly 'x-class-name'?: string;
};
export type FormStructure = {
availableLanguages?: Array<string>;
creator?: Creator;
dateCreated?: string;
dateModified?: string;
description?: string;
description_i18n?: {
[key: string]: string;
};
/**
* https://www.schema.org/FormPage
*/
formPages?: Array<FormPage>;
formSuccessPage?: FormSuccessPage;
id?: number;
name?: string;
name_i18n?: {
[key: string]: string;
};
siteId?: number;
readonly 'x-class-name'?: string;
};
/**
* https://www.schema.org/FormSuccessPage
*/
export type FormSuccessPage = {
description?: string;
description_i18n?: {
[key: string]: string;
};
headline?: string;
headline_i18n?: {
[key: string]: string;
};
id?: number;
readonly 'x-class-name'?: string;
};
export type Grid = {
columns?: Array<FormFieldOption>;
id?: number;
rows?: Array<FormFieldOption>;
readonly 'x-class-name'?: string;
};
/**
* https://www.schema.org/FormFieldValidation
*/
export type Validation = {
errorMessage?: string;
errorMessage_i18n?: {
[key: string]: string;
};
expression?: string;
id?: number;
readonly 'x-class-name'?: string;
};
export type PageForm = {
items?: Array<Form>;
lastPage?: number;
totalCount?: number;
actions?: {
[key: string]: {
[key: string]: string;
};
};
page?: number;
facets?: Array<Facet>;
pageSize?: number;
};
export type FormContext = {
/**
* https://www.schema.org/FormFieldValue
*/
formFieldValues?: Array<FormFieldValue>;
/**
* https://www.schema.org/FormPageContext
*/
formPageContexts?: Array<FormPageContext>;
readOnly?: boolean;
showRequiredFieldsWarning?: boolean;
showSubmitButton?: boolean;
readonly 'x-class-name'?: string;
};
/**
* https://www.schema.org/FormFieldContext
*/
export type FormFieldContext = {
evaluable?: boolean;
formFieldOptions?: Array<FormFieldOption>;
name?: string;
readOnly?: boolean;
required?: boolean;
valid?: boolean;
value?: string;
valueChanged?: boolean;
visible?: boolean;
readonly 'x-class-name'?: string;
};
/**
* https://www.schema.org/FormPageContext
*/
export type FormPageContext = {
enabled?: boolean;
/**
* https://www.schema.org/FormFieldContext
*/
formFieldContexts?: Array<FormFieldContext>;
showRequiredFieldsWarning?: boolean;
readonly 'x-class-name'?: string;
};
export type MultipartBody = {
values?: {
[key: string]: string;
};
};
export type PageFormStructure = {
items?: Array<FormStructure>;
lastPage?: number;
totalCount?: number;
actions?: {
[key: string]: {
[key: string]: string;
};
};
page?: number;
facets?: Array<Facet>;
pageSize?: number;
};
export type DeleteFormDocumentData = {
body?: never;
path: {
formDocumentId: string;
};
query?: never;
url: '/o/headless-form/v1.0/form-documents/{formDocumentId}';
};
export type DeleteFormDocumentResponses = {
/**
* default response
*/
default: unknown;
};
export type GetFormDocumentData = {
body?: never;
path: {
formDocumentId: string;
};
query?: never;
url: '/o/headless-form/v1.0/form-documents/{formDocumentId}';
};
export type GetFormDocumentResponses = {
/**
* default response
*/
default: FormDocument;
};
export type GetFormDocumentResponse = GetFormDocumentResponses[keyof GetFormDocumentResponses];
export type DeleteFormDocumentBatchData = {
body?: {
[key: string]: unknown;
};
path?: never;
query?: {
callbackURL?: string;
};
url: '/o/headless-form/v1.0/form-documents/batch';
};
export type DeleteFormDocumentBatchResponses = {
/**
* default response
*/
default: unknown;
};
export type GetFormFormRecordByLatestDraftData = {
body?: never;
path: {
formId: string;
};
query?: never;
url: '/o/headless-form/v1.0/forms/{formId}/form-records/by-latest-draft';
};
export type GetFormFormRecordByLatestDraftResponses = {
/**
* default response
*/
default: FormRecord;
};
export type GetFormFormRecordByLatestDraftResponse = GetFormFormRecordByLatestDraftResponses[keyof GetFormFormRecordByLatestDraftResponses];
export type GetFormFormRecordsPageData = {
body?: never;
path: {
formId: string;
};
query?: {
page?: string;
pageSize?: string;
nestedFields?: string;
};
url: '/o/headless-form/v1.0/forms/{formId}/form-records';
};
export type GetFormFormRecordsPageResponses = {
/**
* default response
*/
default: PageFormRecord;
};
export type GetFormFormRecordsPageResponse = GetFormFormRecordsPageResponses[keyof GetFormFormRecordsPageResponses];
export type PostFormFormRecordData = {
body?: FormRecord;
path: {
formId: string;
};
query?: never;
url: '/o/headless-form/v1.0/forms/{formId}/form-records';
};
export type PostFormFormRecordResponses = {
/**
* default response
*/
default: FormRecord;
};
export type PostFormFormRecordResponse = PostFormFormRecordResponses[keyof PostFormFormRecordResponses];
export type GetFormRecordData = {
body?: never;
path: {
formRecordId: string;
};
query?: never;
url: '/o/headless-form/v1.0/form-records/{formRecordId}';
};
export type GetFormRecordResponses = {
/**
* default response
*/
default: FormRecord;
};
export type GetFormRecordResponse = GetFormRecordResponses[keyof GetFormRecordResponses];
export type PutFormRecordData = {
body?: FormRecord;
path: {
formRecordId: string;
};
query?: never;
url: '/o/headless-form/v1.0/form-records/{formRecordId}';
};
export type PutFormRecordResponses = {
/**
* default response
*/
default: FormRecord;
};
export type PutFormRecordResponse = PutFormRecordResponses[keyof PutFormRecordResponses];
export type PostFormFormRecordBatchData = {
body?: {
[key: string]: unknown;
};
path: {
formId: string;
};
query?: {
callbackURL?: string;
};
url: '/o/headless-form/v1.0/forms/{formId}/form-records/batch';
};
export type PostFormFormRecordBatchResponses = {
/**
* default response
*/
default: unknown;
};
export type PostFormFormRecordsPageExportBatchData = {
body?: never;
path: {
formId: string;
};
query?: {
callbackURL?: string;
contentType?: string;
fieldNames?: string;
};
url: '/o/headless-form/v1.0/forms/{formId}/form-records/export-batch';
};
export type PostFormFormRecordsPageExportBatchResponses = {
/**
* default response
*/
default: unknown;
};
export type PutFormRecordBatchData = {
body?: {
[key: string]: unknown;
};
path?: never;
query?: {
callbackURL?: string;
};
url: '/o/headless-form/v1.0/form-records/batch';
};
export type PutFormRecordBatchResponses = {
/**
* default response
*/
default: unknown;
};
export type GetFormData = {
body?: never;
path: {
formId: string;
};
query?: never;
url: '/o/headless-form/v1.0/forms/{formId}';
};
export type GetFormResponses = {
/**
* default response
*/
default: Form;
};
export type GetFormResponse = GetFormResponses[keyof GetFormResponses];
export type GetSiteFormsPageData = {
body?: never;
path: {
siteId: string;
};
query?: {
page?: string;
pageSize?: string;
nestedFields?: string;
};
url: '/o/headless-form/v1.0/sites/{siteId}/forms';
};
export type GetSiteFormsPageResponses = {
/**
* default response
*/
default: PageForm;
};
export type GetSiteFormsPageResponse = GetSiteFormsPageResponses[keyof GetSiteFormsPageResponses];
export type PostFormEvaluateContextData = {
body?: FormContext;
path: {
formId: string;
};
query?: never;
url: '/o/headless-form/v1.0/forms/{formId}/evaluate-context';
};
export type PostFormEvaluateContextResponses = {
/**
* default response
*/
default: FormContext;
};
export type PostFormEvaluateContextResponse = PostFormEvaluateContextResponses[keyof PostFormEvaluateContextResponses];
export type PostFormFormDocumentData = {
body?: MultipartBody;
path: {
formId: string;
};
query?: never;
url: '/o/headless-form/v1.0/forms/{formId}/form-document';
};
export type PostFormFormDocumentResponses = {
/**
* default response
*/
default: FormDocument;
};
export type PostFormFormDocumentResponse = PostFormFormDocumentResponses[keyof PostFormFormDocumentResponses];
export type PostSiteFormsPageExportBatchData = {
body?: never;
path: {
siteId: string;
};
query?: {
callbackURL?: string;
contentType?: string;
fieldNames?: string;
};
url: '/o/headless-form/v1.0/sites/{siteId}/forms/export-batch';
};
export type PostSiteFormsPageExportBatchResponses = {
/**
* default response
*/
default: unknown;
};
export type GetFormStructureData = {
body?: never;
path: {
formStructureId: string;
};
query?: never;
url: '/o/headless-form/v1.0/form-structures/{formStructureId}';
};
export type GetFormStructureResponses = {
/**
* default response
*/
default: FormStructure;
};
export type GetFormStructureResponse = GetFormStructureResponses[keyof GetFormStructureResponses];
export type GetSiteFormStructuresPageData = {
body?: never;
path: {
siteId: string;
};
query?: {
page?: string;
pageSize?: string;
nestedFields?: string;
};
url: '/o/headless-form/v1.0/sites/{siteId}/form-structures';
};
export type GetSiteFormStructuresPageResponses = {
/**
* default response
*/
default: PageFormStructure;
};
export type GetSiteFormStructuresPageResponse = GetSiteFormStructuresPageResponses[keyof GetSiteFormStructuresPageResponses];
export type PostSiteFormStructuresPageExportBatchData = {
body?: never;
path: {
siteId: string;
};
query?: {
callbackURL?: string;
contentType?: string;
fieldNames?: string;
};
url: '/o/headless-form/v1.0/sites/{siteId}/form-structures/export-batch';
};
export type PostSiteFormStructuresPageExportBatchResponses = {
/**
* default response
*/
default: unknown;
};
export type ClientOptions = {
baseUrl: 'http://localhost:8080' | (string & {});
};