From e2b5b6329441b9c0847cabadf96fccaf85af8779 Mon Sep 17 00:00:00 2001 From: Max Bischof <106820326+bischofmax@users.noreply.github.com> Date: Mon, 22 Apr 2024 15:53:05 +0200 Subject: [PATCH] BC-6781 - Add collaborative text editor element to api (#4906) --- .../etherpad-api-client/api.ts | 22 + .../etherpad-api-client/api/author-api.ts | 908 ++++ .../etherpad-api-client/api/default-api.ts | 2114 ++++++++++ .../etherpad-api-client/api/group-api.ts | 1214 ++++++ .../etherpad-api-client/api/pad-api.ts | 3752 +++++++++++++++++ .../etherpad-api-client/api/session-api.ts | 600 +++ .../etherpad-api-client/base.ts | 71 + .../etherpad-api-client/common.ts | 138 + .../etherpad-api-client/configuration.ts | 101 + .../etherpad-api-client/index.ts | 18 + .../etherpad-api-client/models/index.ts | 49 + .../models/inline-response200-data.ts | 31 + .../models/inline-response200.ts | 44 + .../models/inline-response2001.ts | 43 + .../models/inline-response20010-data.ts | 31 + .../models/inline-response20010.ts | 44 + .../models/inline-response20011-data.ts | 31 + .../models/inline-response20011.ts | 44 + .../models/inline-response20012-data.ts | 31 + .../models/inline-response20012.ts | 44 + .../models/inline-response20013-data.ts | 31 + .../models/inline-response20013.ts | 44 + .../models/inline-response20014-data.ts | 31 + .../models/inline-response20014.ts | 44 + .../models/inline-response20015-data-info.ts | 49 + .../models/inline-response20015-data.ts | 32 + .../models/inline-response20015.ts | 44 + .../models/inline-response20016-data.ts | 32 + .../models/inline-response20016.ts | 44 + .../models/inline-response20017-data.ts | 31 + .../models/inline-response20017.ts | 44 + .../models/inline-response20018.ts | 43 + .../inline-response20019-data-messages.ts | 49 + .../models/inline-response20019-data.ts | 32 + .../models/inline-response20019.ts | 44 + .../models/inline-response2002-data.ts | 31 + .../models/inline-response2002.ts | 44 + .../models/inline-response20020-data.ts | 32 + .../models/inline-response20020.ts | 44 + .../models/inline-response2003-data.ts | 31 + .../models/inline-response2003.ts | 44 + .../models/inline-response2004-data.ts | 31 + .../models/inline-response2004.ts | 44 + .../models/inline-response2005-data-info.ts | 49 + .../models/inline-response2005-data.ts | 32 + .../models/inline-response2005.ts | 44 + .../models/inline-response2006-data.ts | 32 + .../models/inline-response2006.ts | 44 + .../models/inline-response2007-data.ts | 31 + .../models/inline-response2007.ts | 44 + .../models/inline-response2008-data.ts | 31 + .../models/inline-response2008.ts | 44 + .../models/inline-response2009-data.ts | 31 + .../models/inline-response2009.ts | 44 + .../models/inline-response400.ts | 43 + .../models/inline-response401.ts | 43 + .../models/inline-response500.ts | 43 + .../etherpad-api-client/models/message.ts | 49 + .../models/session-info.ts | 49 + .../etherpad-api-client/models/user-info.ts | 49 + .../etherpad-client.adapter.spec.ts | 626 +++ .../etherpad-client.adapter.ts | 210 + .../etherpad-client/etherpad-client.module.ts | 45 + .../server/src/infra/etherpad-client/index.ts | 2 + .../interface/etherpad-error-type.enum.ts | 7 + .../infra/etherpad-client/interface/index.ts | 2 + .../interface/payloads.interface.ts | 21 + .../etherpad-error-loggable-exception.ts | 28 + .../etherpad-server-error-exception.spec.ts | 29 + .../infra/etherpad-client/loggable/index.ts | 1 + .../mappers/etherpad-response.mapper.ts | 52 + .../infra/etherpad-client/mappers/index.ts | 1 + .../content-element-create.api.spec.ts | 10 + .../controller/dto/card/card.response.ts | 5 +- .../element/any-content-element.response.ts | 6 +- ...laborative-text-editor-element.response.ts | 25 + .../board/controller/dto/element/index.ts | 1 + ...ive-text-editor-element-response.mapper.ts | 32 + .../content-element-response.factory.ts | 4 +- .../modules/board/controller/mapper/index.ts | 1 + .../board/repo/board-do.builder-impl.ts | 16 + .../repo/recursive-delete.visitor.spec.ts | 25 + .../board/repo/recursive-delete.vistor.ts | 8 + .../board/repo/recursive-save.visitor.spec.ts | 17 + .../board/repo/recursive-save.visitor.ts | 14 + .../recursive-copy.visitor.spec.ts | 26 + .../recursive-copy.visitor.ts | 9 + .../swap-internal-links.visitor.spec.ts | 2 + .../swap-internal-links.visitor.ts | 4 + .../content-element-update.visitor.spec.ts | 13 +- .../service/content-element-update.visitor.ts | 7 + .../collaborative-text-editor.controller.ts | 42 + .../api/collaborative-text-editor.uc.ts | 55 + .../dto/collaborative-text-editor.response.ts | 10 + ...aborative-text-editor-for-parent.params.ts | 25 + .../collaborative-text-editor.mapper.ts | 14 + .../api/tests/get.api.spec.ts | 178 + .../collaborative-text-editor-api.module.ts | 13 + .../collaborative-text-editor.config.ts | 4 + .../collaborative-text-editor.module.ts | 12 + .../collaborative-text-editor/config.ts | 7 + .../domain/do/collaborative-text-editor.ts | 5 + .../collaborative-text-editor/index.ts | 2 + .../collaborative-text-editor.service.spec.ts | 264 ++ .../collaborative-text-editor.service.ts | 67 + .../src/modules/lesson/lesson.config.ts | 1 - .../modules/server/api/dto/config.response.ts | 5 + .../server/api/test/server.api.spec.ts | 1 + .../src/modules/server/server.config.ts | 25 +- .../src/modules/server/server.module.ts | 4 +- .../domain/domainobject/board/card.do.ts | 4 +- ...llaborative-text-editor-element.do.spec.ts | 66 + .../collaborative-text-editor-element.do.ts | 20 + .../board/content-element.factory.ts | 19 +- .../shared/domain/domainobject/board/index.ts | 3 +- .../board/types/any-content-element-do.ts | 5 +- .../board/types/board-composite-visitor.ts | 5 + .../board/types/content-elements.enum.ts | 1 + .../src/shared/domain/entity/all-entities.ts | 4 +- ...orative-text-editor-element-node.entity.ts | 18 + .../shared/domain/entity/boardnode/index.ts | 7 +- .../boardnode/types/board-do.builder.ts | 3 + .../entity/boardnode/types/board-node-type.ts | 1 + .../collaborative-text-editor-node.factory.ts | 10 + .../shared/testing/factory/boardnode/index.ts | 7 +- ...borative-text-editor-element.do.factory.ts | 15 + .../factory/domainobject/board/index.ts | 6 +- config/default.schema.json | 9 +- config/development.json | 5 + config/test.json | 5 + sonar-project.properties | 4 +- 131 files changed, 13093 insertions(+), 34 deletions(-) create mode 100644 apps/server/src/infra/etherpad-client/etherpad-api-client/api.ts create mode 100644 apps/server/src/infra/etherpad-client/etherpad-api-client/api/author-api.ts create mode 100644 apps/server/src/infra/etherpad-client/etherpad-api-client/api/default-api.ts create mode 100644 apps/server/src/infra/etherpad-client/etherpad-api-client/api/group-api.ts create mode 100644 apps/server/src/infra/etherpad-client/etherpad-api-client/api/pad-api.ts create mode 100644 apps/server/src/infra/etherpad-client/etherpad-api-client/api/session-api.ts create mode 100644 apps/server/src/infra/etherpad-client/etherpad-api-client/base.ts create mode 100644 apps/server/src/infra/etherpad-client/etherpad-api-client/common.ts create mode 100644 apps/server/src/infra/etherpad-client/etherpad-api-client/configuration.ts create mode 100644 apps/server/src/infra/etherpad-client/etherpad-api-client/index.ts create mode 100644 apps/server/src/infra/etherpad-client/etherpad-api-client/models/index.ts create mode 100644 apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response200-data.ts create mode 100644 apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response200.ts create mode 100644 apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response2001.ts create mode 100644 apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response20010-data.ts create mode 100644 apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response20010.ts create mode 100644 apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response20011-data.ts create mode 100644 apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response20011.ts create mode 100644 apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response20012-data.ts create mode 100644 apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response20012.ts create mode 100644 apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response20013-data.ts create mode 100644 apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response20013.ts create mode 100644 apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response20014-data.ts create mode 100644 apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response20014.ts create mode 100644 apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response20015-data-info.ts create mode 100644 apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response20015-data.ts create mode 100644 apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response20015.ts create mode 100644 apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response20016-data.ts create mode 100644 apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response20016.ts create mode 100644 apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response20017-data.ts create mode 100644 apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response20017.ts create mode 100644 apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response20018.ts create mode 100644 apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response20019-data-messages.ts create mode 100644 apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response20019-data.ts create mode 100644 apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response20019.ts create mode 100644 apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response2002-data.ts create mode 100644 apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response2002.ts create mode 100644 apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response20020-data.ts create mode 100644 apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response20020.ts create mode 100644 apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response2003-data.ts create mode 100644 apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response2003.ts create mode 100644 apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response2004-data.ts create mode 100644 apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response2004.ts create mode 100644 apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response2005-data-info.ts create mode 100644 apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response2005-data.ts create mode 100644 apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response2005.ts create mode 100644 apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response2006-data.ts create mode 100644 apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response2006.ts create mode 100644 apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response2007-data.ts create mode 100644 apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response2007.ts create mode 100644 apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response2008-data.ts create mode 100644 apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response2008.ts create mode 100644 apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response2009-data.ts create mode 100644 apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response2009.ts create mode 100644 apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response400.ts create mode 100644 apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response401.ts create mode 100644 apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response500.ts create mode 100644 apps/server/src/infra/etherpad-client/etherpad-api-client/models/message.ts create mode 100644 apps/server/src/infra/etherpad-client/etherpad-api-client/models/session-info.ts create mode 100644 apps/server/src/infra/etherpad-client/etherpad-api-client/models/user-info.ts create mode 100644 apps/server/src/infra/etherpad-client/etherpad-client.adapter.spec.ts create mode 100644 apps/server/src/infra/etherpad-client/etherpad-client.adapter.ts create mode 100644 apps/server/src/infra/etherpad-client/etherpad-client.module.ts create mode 100644 apps/server/src/infra/etherpad-client/index.ts create mode 100644 apps/server/src/infra/etherpad-client/interface/etherpad-error-type.enum.ts create mode 100644 apps/server/src/infra/etherpad-client/interface/index.ts create mode 100644 apps/server/src/infra/etherpad-client/interface/payloads.interface.ts create mode 100644 apps/server/src/infra/etherpad-client/loggable/etherpad-error-loggable-exception.ts create mode 100644 apps/server/src/infra/etherpad-client/loggable/etherpad-server-error-exception.spec.ts create mode 100644 apps/server/src/infra/etherpad-client/loggable/index.ts create mode 100644 apps/server/src/infra/etherpad-client/mappers/etherpad-response.mapper.ts create mode 100644 apps/server/src/infra/etherpad-client/mappers/index.ts create mode 100644 apps/server/src/modules/board/controller/dto/element/collaborative-text-editor-element.response.ts create mode 100644 apps/server/src/modules/board/controller/mapper/collaborative-text-editor-element-response.mapper.ts create mode 100644 apps/server/src/modules/collaborative-text-editor/api/collaborative-text-editor.controller.ts create mode 100644 apps/server/src/modules/collaborative-text-editor/api/collaborative-text-editor.uc.ts create mode 100644 apps/server/src/modules/collaborative-text-editor/api/dto/collaborative-text-editor.response.ts create mode 100644 apps/server/src/modules/collaborative-text-editor/api/dto/get-collaborative-text-editor-for-parent.params.ts create mode 100644 apps/server/src/modules/collaborative-text-editor/api/mapper/collaborative-text-editor.mapper.ts create mode 100644 apps/server/src/modules/collaborative-text-editor/api/tests/get.api.spec.ts create mode 100644 apps/server/src/modules/collaborative-text-editor/collaborative-text-editor-api.module.ts create mode 100644 apps/server/src/modules/collaborative-text-editor/collaborative-text-editor.config.ts create mode 100644 apps/server/src/modules/collaborative-text-editor/collaborative-text-editor.module.ts create mode 100644 apps/server/src/modules/collaborative-text-editor/config.ts create mode 100644 apps/server/src/modules/collaborative-text-editor/domain/do/collaborative-text-editor.ts create mode 100644 apps/server/src/modules/collaborative-text-editor/index.ts create mode 100644 apps/server/src/modules/collaborative-text-editor/service/collaborative-text-editor.service.spec.ts create mode 100644 apps/server/src/modules/collaborative-text-editor/service/collaborative-text-editor.service.ts create mode 100644 apps/server/src/shared/domain/domainobject/board/collaborative-text-editor-element.do.spec.ts create mode 100644 apps/server/src/shared/domain/domainobject/board/collaborative-text-editor-element.do.ts create mode 100644 apps/server/src/shared/domain/entity/boardnode/collaborative-text-editor-element-node.entity.ts create mode 100644 apps/server/src/shared/testing/factory/boardnode/collaborative-text-editor-node.factory.ts create mode 100644 apps/server/src/shared/testing/factory/domainobject/board/collaborative-text-editor-element.do.factory.ts diff --git a/apps/server/src/infra/etherpad-client/etherpad-api-client/api.ts b/apps/server/src/infra/etherpad-client/etherpad-api-client/api.ts new file mode 100644 index 00000000000..2782a0d11e8 --- /dev/null +++ b/apps/server/src/infra/etherpad-client/etherpad-api-client/api.ts @@ -0,0 +1,22 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Etherpad API + * Etherpad is a real-time collaborative editor scalable to thousands of simultaneous real time users. It provides full data export capabilities, and runs on your server, under your control. + * + * The version of the OpenAPI document: 1.3.0 + * Contact: support@example.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +export * from './api/author-api'; +export * from './api/default-api'; +export * from './api/group-api'; +export * from './api/pad-api'; +export * from './api/session-api'; + diff --git a/apps/server/src/infra/etherpad-client/etherpad-api-client/api/author-api.ts b/apps/server/src/infra/etherpad-client/etherpad-api-client/api/author-api.ts new file mode 100644 index 00000000000..58cb162042f --- /dev/null +++ b/apps/server/src/infra/etherpad-client/etherpad-api-client/api/author-api.ts @@ -0,0 +1,908 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Etherpad API + * Etherpad is a real-time collaborative editor scalable to thousands of simultaneous real time users. It provides full data export capabilities, and runs on your server, under your control. + * + * The version of the OpenAPI document: 1.3.0 + * Contact: support@example.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import globalAxios, { AxiosPromise, AxiosInstance } from 'axios'; +import { Configuration } from '../configuration'; +// Some imports not used depending on template conditions +// @ts-ignore +import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base'; +// @ts-ignore +import { InlineResponse20015 } from '../models'; +// @ts-ignore +import { InlineResponse2002 } from '../models'; +// @ts-ignore +import { InlineResponse2003 } from '../models'; +// @ts-ignore +import { InlineResponse2006 } from '../models'; +// @ts-ignore +import { InlineResponse400 } from '../models'; +// @ts-ignore +import { InlineResponse401 } from '../models'; +// @ts-ignore +import { InlineResponse500 } from '../models'; +/** + * AuthorApi - axios parameter creator + * @export + */ +export const AuthorApiAxiosParamCreator = function (configuration?: Configuration) { + return { + /** + * + * @summary this functions helps you to map your application author ids to Etherpad author ids + * @param {string} [authorMapper] + * @param {string} [name] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createAuthorIfNotExistsForUsingGET: async (authorMapper?: string, name?: string, options: any = {}): Promise => { + const localVarPath = `/createAuthorIfNotExistsFor`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ApiKey required + await setApiKeyToObject(localVarQueryParameter, "apikey", configuration) + + if (authorMapper !== undefined) { + localVarQueryParameter['authorMapper'] = authorMapper; + } + + if (name !== undefined) { + localVarQueryParameter['name'] = name; + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary this functions helps you to map your application author ids to Etherpad author ids + * @param {string} [authorMapper] + * @param {string} [name] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createAuthorIfNotExistsForUsingPOST: async (authorMapper?: string, name?: string, options: any = {}): Promise => { + const localVarPath = `/createAuthorIfNotExistsFor`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ApiKey required + await setApiKeyToObject(localVarQueryParameter, "apikey", configuration) + + if (authorMapper !== undefined) { + localVarQueryParameter['authorMapper'] = authorMapper; + } + + if (name !== undefined) { + localVarQueryParameter['name'] = name; + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary creates a new author + * @param {string} [name] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createAuthorUsingGET: async (name?: string, options: any = {}): Promise => { + const localVarPath = `/createAuthor`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ApiKey required + await setApiKeyToObject(localVarQueryParameter, "apikey", configuration) + + if (name !== undefined) { + localVarQueryParameter['name'] = name; + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary creates a new author + * @param {string} [name] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createAuthorUsingPOST: async (name?: string, options: any = {}): Promise => { + const localVarPath = `/createAuthor`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ApiKey required + await setApiKeyToObject(localVarQueryParameter, "apikey", configuration) + + if (name !== undefined) { + localVarQueryParameter['name'] = name; + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Returns the Author Name of the author + * @param {string} [authorID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getAuthorNameUsingGET: async (authorID?: string, options: any = {}): Promise => { + const localVarPath = `/getAuthorName`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ApiKey required + await setApiKeyToObject(localVarQueryParameter, "apikey", configuration) + + if (authorID !== undefined) { + localVarQueryParameter['authorID'] = authorID; + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Returns the Author Name of the author + * @param {string} [authorID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getAuthorNameUsingPOST: async (authorID?: string, options: any = {}): Promise => { + const localVarPath = `/getAuthorName`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ApiKey required + await setApiKeyToObject(localVarQueryParameter, "apikey", configuration) + + if (authorID !== undefined) { + localVarQueryParameter['authorID'] = authorID; + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary returns an array of all pads this author contributed to + * @param {string} [authorID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listPadsOfAuthorUsingGET: async (authorID?: string, options: any = {}): Promise => { + const localVarPath = `/listPadsOfAuthor`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ApiKey required + await setApiKeyToObject(localVarQueryParameter, "apikey", configuration) + + if (authorID !== undefined) { + localVarQueryParameter['authorID'] = authorID; + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary returns an array of all pads this author contributed to + * @param {string} [authorID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listPadsOfAuthorUsingPOST: async (authorID?: string, options: any = {}): Promise => { + const localVarPath = `/listPadsOfAuthor`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ApiKey required + await setApiKeyToObject(localVarQueryParameter, "apikey", configuration) + + if (authorID !== undefined) { + localVarQueryParameter['authorID'] = authorID; + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary returns all sessions of an author + * @param {string} [authorID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listSessionsOfAuthorUsingGET: async (authorID?: string, options: any = {}): Promise => { + const localVarPath = `/listSessionsOfAuthor`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ApiKey required + await setApiKeyToObject(localVarQueryParameter, "apikey", configuration) + + if (authorID !== undefined) { + localVarQueryParameter['authorID'] = authorID; + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary returns all sessions of an author + * @param {string} [authorID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listSessionsOfAuthorUsingPOST: async (authorID?: string, options: any = {}): Promise => { + const localVarPath = `/listSessionsOfAuthor`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ApiKey required + await setApiKeyToObject(localVarQueryParameter, "apikey", configuration) + + if (authorID !== undefined) { + localVarQueryParameter['authorID'] = authorID; + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + } +}; + +/** + * AuthorApi - functional programming interface + * @export + */ +export const AuthorApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = AuthorApiAxiosParamCreator(configuration) + return { + /** + * + * @summary this functions helps you to map your application author ids to Etherpad author ids + * @param {string} [authorMapper] + * @param {string} [name] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async createAuthorIfNotExistsForUsingGET(authorMapper?: string, name?: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.createAuthorIfNotExistsForUsingGET(authorMapper, name, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * + * @summary this functions helps you to map your application author ids to Etherpad author ids + * @param {string} [authorMapper] + * @param {string} [name] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async createAuthorIfNotExistsForUsingPOST(authorMapper?: string, name?: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.createAuthorIfNotExistsForUsingPOST(authorMapper, name, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * + * @summary creates a new author + * @param {string} [name] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async createAuthorUsingGET(name?: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.createAuthorUsingGET(name, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * + * @summary creates a new author + * @param {string} [name] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async createAuthorUsingPOST(name?: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.createAuthorUsingPOST(name, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * + * @summary Returns the Author Name of the author + * @param {string} [authorID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getAuthorNameUsingGET(authorID?: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getAuthorNameUsingGET(authorID, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * + * @summary Returns the Author Name of the author + * @param {string} [authorID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getAuthorNameUsingPOST(authorID?: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getAuthorNameUsingPOST(authorID, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * + * @summary returns an array of all pads this author contributed to + * @param {string} [authorID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async listPadsOfAuthorUsingGET(authorID?: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.listPadsOfAuthorUsingGET(authorID, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * + * @summary returns an array of all pads this author contributed to + * @param {string} [authorID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async listPadsOfAuthorUsingPOST(authorID?: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.listPadsOfAuthorUsingPOST(authorID, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * + * @summary returns all sessions of an author + * @param {string} [authorID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async listSessionsOfAuthorUsingGET(authorID?: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.listSessionsOfAuthorUsingGET(authorID, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * + * @summary returns all sessions of an author + * @param {string} [authorID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async listSessionsOfAuthorUsingPOST(authorID?: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.listSessionsOfAuthorUsingPOST(authorID, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + } +}; + +/** + * AuthorApi - factory interface + * @export + */ +export const AuthorApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = AuthorApiFp(configuration) + return { + /** + * + * @summary this functions helps you to map your application author ids to Etherpad author ids + * @param {string} [authorMapper] + * @param {string} [name] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createAuthorIfNotExistsForUsingGET(authorMapper?: string, name?: string, options?: any): AxiosPromise { + return localVarFp.createAuthorIfNotExistsForUsingGET(authorMapper, name, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary this functions helps you to map your application author ids to Etherpad author ids + * @param {string} [authorMapper] + * @param {string} [name] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createAuthorIfNotExistsForUsingPOST(authorMapper?: string, name?: string, options?: any): AxiosPromise { + return localVarFp.createAuthorIfNotExistsForUsingPOST(authorMapper, name, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary creates a new author + * @param {string} [name] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createAuthorUsingGET(name?: string, options?: any): AxiosPromise { + return localVarFp.createAuthorUsingGET(name, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary creates a new author + * @param {string} [name] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createAuthorUsingPOST(name?: string, options?: any): AxiosPromise { + return localVarFp.createAuthorUsingPOST(name, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary Returns the Author Name of the author + * @param {string} [authorID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getAuthorNameUsingGET(authorID?: string, options?: any): AxiosPromise { + return localVarFp.getAuthorNameUsingGET(authorID, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary Returns the Author Name of the author + * @param {string} [authorID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getAuthorNameUsingPOST(authorID?: string, options?: any): AxiosPromise { + return localVarFp.getAuthorNameUsingPOST(authorID, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary returns an array of all pads this author contributed to + * @param {string} [authorID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listPadsOfAuthorUsingGET(authorID?: string, options?: any): AxiosPromise { + return localVarFp.listPadsOfAuthorUsingGET(authorID, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary returns an array of all pads this author contributed to + * @param {string} [authorID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listPadsOfAuthorUsingPOST(authorID?: string, options?: any): AxiosPromise { + return localVarFp.listPadsOfAuthorUsingPOST(authorID, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary returns all sessions of an author + * @param {string} [authorID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listSessionsOfAuthorUsingGET(authorID?: string, options?: any): AxiosPromise { + return localVarFp.listSessionsOfAuthorUsingGET(authorID, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary returns all sessions of an author + * @param {string} [authorID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listSessionsOfAuthorUsingPOST(authorID?: string, options?: any): AxiosPromise { + return localVarFp.listSessionsOfAuthorUsingPOST(authorID, options).then((request) => request(axios, basePath)); + }, + }; +}; + +/** + * AuthorApi - interface + * @export + * @interface AuthorApi + */ +export interface AuthorApiInterface { + /** + * + * @summary this functions helps you to map your application author ids to Etherpad author ids + * @param {string} [authorMapper] + * @param {string} [name] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof AuthorApiInterface + */ + createAuthorIfNotExistsForUsingGET(authorMapper?: string, name?: string, options?: any): AxiosPromise; + + /** + * + * @summary this functions helps you to map your application author ids to Etherpad author ids + * @param {string} [authorMapper] + * @param {string} [name] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof AuthorApiInterface + */ + createAuthorIfNotExistsForUsingPOST(authorMapper?: string, name?: string, options?: any): AxiosPromise; + + /** + * + * @summary creates a new author + * @param {string} [name] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof AuthorApiInterface + */ + createAuthorUsingGET(name?: string, options?: any): AxiosPromise; + + /** + * + * @summary creates a new author + * @param {string} [name] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof AuthorApiInterface + */ + createAuthorUsingPOST(name?: string, options?: any): AxiosPromise; + + /** + * + * @summary Returns the Author Name of the author + * @param {string} [authorID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof AuthorApiInterface + */ + getAuthorNameUsingGET(authorID?: string, options?: any): AxiosPromise; + + /** + * + * @summary Returns the Author Name of the author + * @param {string} [authorID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof AuthorApiInterface + */ + getAuthorNameUsingPOST(authorID?: string, options?: any): AxiosPromise; + + /** + * + * @summary returns an array of all pads this author contributed to + * @param {string} [authorID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof AuthorApiInterface + */ + listPadsOfAuthorUsingGET(authorID?: string, options?: any): AxiosPromise; + + /** + * + * @summary returns an array of all pads this author contributed to + * @param {string} [authorID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof AuthorApiInterface + */ + listPadsOfAuthorUsingPOST(authorID?: string, options?: any): AxiosPromise; + + /** + * + * @summary returns all sessions of an author + * @param {string} [authorID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof AuthorApiInterface + */ + listSessionsOfAuthorUsingGET(authorID?: string, options?: any): AxiosPromise; + + /** + * + * @summary returns all sessions of an author + * @param {string} [authorID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof AuthorApiInterface + */ + listSessionsOfAuthorUsingPOST(authorID?: string, options?: any): AxiosPromise; + +} + +/** + * AuthorApi - object-oriented interface + * @export + * @class AuthorApi + * @extends {BaseAPI} + */ +export class AuthorApi extends BaseAPI implements AuthorApiInterface { + /** + * + * @summary this functions helps you to map your application author ids to Etherpad author ids + * @param {string} [authorMapper] + * @param {string} [name] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof AuthorApi + */ + public createAuthorIfNotExistsForUsingGET(authorMapper?: string, name?: string, options?: any) { + return AuthorApiFp(this.configuration).createAuthorIfNotExistsForUsingGET(authorMapper, name, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary this functions helps you to map your application author ids to Etherpad author ids + * @param {string} [authorMapper] + * @param {string} [name] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof AuthorApi + */ + public createAuthorIfNotExistsForUsingPOST(authorMapper?: string, name?: string, options?: any) { + return AuthorApiFp(this.configuration).createAuthorIfNotExistsForUsingPOST(authorMapper, name, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary creates a new author + * @param {string} [name] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof AuthorApi + */ + public createAuthorUsingGET(name?: string, options?: any) { + return AuthorApiFp(this.configuration).createAuthorUsingGET(name, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary creates a new author + * @param {string} [name] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof AuthorApi + */ + public createAuthorUsingPOST(name?: string, options?: any) { + return AuthorApiFp(this.configuration).createAuthorUsingPOST(name, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary Returns the Author Name of the author + * @param {string} [authorID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof AuthorApi + */ + public getAuthorNameUsingGET(authorID?: string, options?: any) { + return AuthorApiFp(this.configuration).getAuthorNameUsingGET(authorID, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary Returns the Author Name of the author + * @param {string} [authorID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof AuthorApi + */ + public getAuthorNameUsingPOST(authorID?: string, options?: any) { + return AuthorApiFp(this.configuration).getAuthorNameUsingPOST(authorID, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary returns an array of all pads this author contributed to + * @param {string} [authorID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof AuthorApi + */ + public listPadsOfAuthorUsingGET(authorID?: string, options?: any) { + return AuthorApiFp(this.configuration).listPadsOfAuthorUsingGET(authorID, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary returns an array of all pads this author contributed to + * @param {string} [authorID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof AuthorApi + */ + public listPadsOfAuthorUsingPOST(authorID?: string, options?: any) { + return AuthorApiFp(this.configuration).listPadsOfAuthorUsingPOST(authorID, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary returns all sessions of an author + * @param {string} [authorID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof AuthorApi + */ + public listSessionsOfAuthorUsingGET(authorID?: string, options?: any) { + return AuthorApiFp(this.configuration).listSessionsOfAuthorUsingGET(authorID, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary returns all sessions of an author + * @param {string} [authorID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof AuthorApi + */ + public listSessionsOfAuthorUsingPOST(authorID?: string, options?: any) { + return AuthorApiFp(this.configuration).listSessionsOfAuthorUsingPOST(authorID, options).then((request) => request(this.axios, this.basePath)); + } +} diff --git a/apps/server/src/infra/etherpad-client/etherpad-api-client/api/default-api.ts b/apps/server/src/infra/etherpad-client/etherpad-api-client/api/default-api.ts new file mode 100644 index 00000000000..9c9e7559233 --- /dev/null +++ b/apps/server/src/infra/etherpad-client/etherpad-api-client/api/default-api.ts @@ -0,0 +1,2114 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Etherpad API + * Etherpad is a real-time collaborative editor scalable to thousands of simultaneous real time users. It provides full data export capabilities, and runs on your server, under your control. + * + * The version of the OpenAPI document: 1.3.0 + * Contact: support@example.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import globalAxios, { AxiosPromise, AxiosInstance } from 'axios'; +import { Configuration } from '../configuration'; +// Some imports not used depending on template conditions +// @ts-ignore +import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base'; +// @ts-ignore +import { InlineResponse2001 } from '../models'; +// @ts-ignore +import { InlineResponse400 } from '../models'; +// @ts-ignore +import { InlineResponse401 } from '../models'; +// @ts-ignore +import { InlineResponse500 } from '../models'; +/** + * DefaultApi - axios parameter creator + * @export + */ +export const DefaultApiAxiosParamCreator = function (configuration?: Configuration) { + return { + /** + * + * @param {string} [padID] + * @param {string} [text] + * @param {string} [authorId] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + appendTextUsingGET: async (padID?: string, text?: string, authorId?: string, options: any = {}): Promise => { + const localVarPath = `/appendText`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ApiKey required + await setApiKeyToObject(localVarQueryParameter, "apikey", configuration) + + if (padID !== undefined) { + localVarQueryParameter['padID'] = padID; + } + + if (text !== undefined) { + localVarQueryParameter['text'] = text; + } + + if (authorId !== undefined) { + localVarQueryParameter['authorId'] = authorId; + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @param {string} [padID] + * @param {string} [text] + * @param {string} [authorId] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + appendTextUsingPOST: async (padID?: string, text?: string, authorId?: string, options: any = {}): Promise => { + const localVarPath = `/appendText`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ApiKey required + await setApiKeyToObject(localVarQueryParameter, "apikey", configuration) + + if (padID !== undefined) { + localVarQueryParameter['padID'] = padID; + } + + if (text !== undefined) { + localVarQueryParameter['text'] = text; + } + + if (authorId !== undefined) { + localVarQueryParameter['authorId'] = authorId; + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @param {string} [sourceID] + * @param {string} [destinationID] + * @param {string} [force] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + copyPadUsingGET: async (sourceID?: string, destinationID?: string, force?: string, options: any = {}): Promise => { + const localVarPath = `/copyPad`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ApiKey required + await setApiKeyToObject(localVarQueryParameter, "apikey", configuration) + + if (sourceID !== undefined) { + localVarQueryParameter['sourceID'] = sourceID; + } + + if (destinationID !== undefined) { + localVarQueryParameter['destinationID'] = destinationID; + } + + if (force !== undefined) { + localVarQueryParameter['force'] = force; + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @param {string} [sourceID] + * @param {string} [destinationID] + * @param {string} [force] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + copyPadUsingPOST: async (sourceID?: string, destinationID?: string, force?: string, options: any = {}): Promise => { + const localVarPath = `/copyPad`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ApiKey required + await setApiKeyToObject(localVarQueryParameter, "apikey", configuration) + + if (sourceID !== undefined) { + localVarQueryParameter['sourceID'] = sourceID; + } + + if (destinationID !== undefined) { + localVarQueryParameter['destinationID'] = destinationID; + } + + if (force !== undefined) { + localVarQueryParameter['force'] = force; + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @param {string} [sourceID] + * @param {string} [destinationID] + * @param {string} [force] + * @param {string} [authorId] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + copyPadWithoutHistoryUsingGET: async (sourceID?: string, destinationID?: string, force?: string, authorId?: string, options: any = {}): Promise => { + const localVarPath = `/copyPadWithoutHistory`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ApiKey required + await setApiKeyToObject(localVarQueryParameter, "apikey", configuration) + + if (sourceID !== undefined) { + localVarQueryParameter['sourceID'] = sourceID; + } + + if (destinationID !== undefined) { + localVarQueryParameter['destinationID'] = destinationID; + } + + if (force !== undefined) { + localVarQueryParameter['force'] = force; + } + + if (authorId !== undefined) { + localVarQueryParameter['authorId'] = authorId; + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @param {string} [sourceID] + * @param {string} [destinationID] + * @param {string} [force] + * @param {string} [authorId] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + copyPadWithoutHistoryUsingPOST: async (sourceID?: string, destinationID?: string, force?: string, authorId?: string, options: any = {}): Promise => { + const localVarPath = `/copyPadWithoutHistory`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ApiKey required + await setApiKeyToObject(localVarQueryParameter, "apikey", configuration) + + if (sourceID !== undefined) { + localVarQueryParameter['sourceID'] = sourceID; + } + + if (destinationID !== undefined) { + localVarQueryParameter['destinationID'] = destinationID; + } + + if (force !== undefined) { + localVarQueryParameter['force'] = force; + } + + if (authorId !== undefined) { + localVarQueryParameter['authorId'] = authorId; + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @param {string} [padID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getAttributePoolUsingGET: async (padID?: string, options: any = {}): Promise => { + const localVarPath = `/getAttributePool`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ApiKey required + await setApiKeyToObject(localVarQueryParameter, "apikey", configuration) + + if (padID !== undefined) { + localVarQueryParameter['padID'] = padID; + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @param {string} [padID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getAttributePoolUsingPOST: async (padID?: string, options: any = {}): Promise => { + const localVarPath = `/getAttributePool`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ApiKey required + await setApiKeyToObject(localVarQueryParameter, "apikey", configuration) + + if (padID !== undefined) { + localVarQueryParameter['padID'] = padID; + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @param {string} [roID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getPadIDUsingGET: async (roID?: string, options: any = {}): Promise => { + const localVarPath = `/getPadID`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ApiKey required + await setApiKeyToObject(localVarQueryParameter, "apikey", configuration) + + if (roID !== undefined) { + localVarQueryParameter['roID'] = roID; + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @param {string} [roID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getPadIDUsingPOST: async (roID?: string, options: any = {}): Promise => { + const localVarPath = `/getPadID`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ApiKey required + await setApiKeyToObject(localVarQueryParameter, "apikey", configuration) + + if (roID !== undefined) { + localVarQueryParameter['roID'] = roID; + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @param {string} [padID] + * @param {string} [rev] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getRevisionChangesetUsingGET: async (padID?: string, rev?: string, options: any = {}): Promise => { + const localVarPath = `/getRevisionChangeset`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ApiKey required + await setApiKeyToObject(localVarQueryParameter, "apikey", configuration) + + if (padID !== undefined) { + localVarQueryParameter['padID'] = padID; + } + + if (rev !== undefined) { + localVarQueryParameter['rev'] = rev; + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @param {string} [padID] + * @param {string} [rev] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getRevisionChangesetUsingPOST: async (padID?: string, rev?: string, options: any = {}): Promise => { + const localVarPath = `/getRevisionChangeset`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ApiKey required + await setApiKeyToObject(localVarQueryParameter, "apikey", configuration) + + if (padID !== undefined) { + localVarQueryParameter['padID'] = padID; + } + + if (rev !== undefined) { + localVarQueryParameter['rev'] = rev; + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @param {string} [padID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getSavedRevisionsCountUsingGET: async (padID?: string, options: any = {}): Promise => { + const localVarPath = `/getSavedRevisionsCount`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ApiKey required + await setApiKeyToObject(localVarQueryParameter, "apikey", configuration) + + if (padID !== undefined) { + localVarQueryParameter['padID'] = padID; + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @param {string} [padID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getSavedRevisionsCountUsingPOST: async (padID?: string, options: any = {}): Promise => { + const localVarPath = `/getSavedRevisionsCount`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ApiKey required + await setApiKeyToObject(localVarQueryParameter, "apikey", configuration) + + if (padID !== undefined) { + localVarQueryParameter['padID'] = padID; + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getStatsUsingGET: async (options: any = {}): Promise => { + const localVarPath = `/getStats`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ApiKey required + await setApiKeyToObject(localVarQueryParameter, "apikey", configuration) + + + + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getStatsUsingPOST: async (options: any = {}): Promise => { + const localVarPath = `/getStats`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ApiKey required + await setApiKeyToObject(localVarQueryParameter, "apikey", configuration) + + + + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @param {string} [padID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listSavedRevisionsUsingGET: async (padID?: string, options: any = {}): Promise => { + const localVarPath = `/listSavedRevisions`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ApiKey required + await setApiKeyToObject(localVarQueryParameter, "apikey", configuration) + + if (padID !== undefined) { + localVarQueryParameter['padID'] = padID; + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @param {string} [padID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listSavedRevisionsUsingPOST: async (padID?: string, options: any = {}): Promise => { + const localVarPath = `/listSavedRevisions`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ApiKey required + await setApiKeyToObject(localVarQueryParameter, "apikey", configuration) + + if (padID !== undefined) { + localVarQueryParameter['padID'] = padID; + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @param {string} [sourceID] + * @param {string} [destinationID] + * @param {string} [force] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + movePadUsingGET: async (sourceID?: string, destinationID?: string, force?: string, options: any = {}): Promise => { + const localVarPath = `/movePad`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ApiKey required + await setApiKeyToObject(localVarQueryParameter, "apikey", configuration) + + if (sourceID !== undefined) { + localVarQueryParameter['sourceID'] = sourceID; + } + + if (destinationID !== undefined) { + localVarQueryParameter['destinationID'] = destinationID; + } + + if (force !== undefined) { + localVarQueryParameter['force'] = force; + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @param {string} [sourceID] + * @param {string} [destinationID] + * @param {string} [force] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + movePadUsingPOST: async (sourceID?: string, destinationID?: string, force?: string, options: any = {}): Promise => { + const localVarPath = `/movePad`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ApiKey required + await setApiKeyToObject(localVarQueryParameter, "apikey", configuration) + + if (sourceID !== undefined) { + localVarQueryParameter['sourceID'] = sourceID; + } + + if (destinationID !== undefined) { + localVarQueryParameter['destinationID'] = destinationID; + } + + if (force !== undefined) { + localVarQueryParameter['force'] = force; + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @param {string} [padID] + * @param {string} [rev] + * @param {string} [authorId] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + restoreRevisionUsingGET: async (padID?: string, rev?: string, authorId?: string, options: any = {}): Promise => { + const localVarPath = `/restoreRevision`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ApiKey required + await setApiKeyToObject(localVarQueryParameter, "apikey", configuration) + + if (padID !== undefined) { + localVarQueryParameter['padID'] = padID; + } + + if (rev !== undefined) { + localVarQueryParameter['rev'] = rev; + } + + if (authorId !== undefined) { + localVarQueryParameter['authorId'] = authorId; + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @param {string} [padID] + * @param {string} [rev] + * @param {string} [authorId] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + restoreRevisionUsingPOST: async (padID?: string, rev?: string, authorId?: string, options: any = {}): Promise => { + const localVarPath = `/restoreRevision`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ApiKey required + await setApiKeyToObject(localVarQueryParameter, "apikey", configuration) + + if (padID !== undefined) { + localVarQueryParameter['padID'] = padID; + } + + if (rev !== undefined) { + localVarQueryParameter['rev'] = rev; + } + + if (authorId !== undefined) { + localVarQueryParameter['authorId'] = authorId; + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @param {string} [padID] + * @param {string} [rev] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + saveRevisionUsingGET: async (padID?: string, rev?: string, options: any = {}): Promise => { + const localVarPath = `/saveRevision`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ApiKey required + await setApiKeyToObject(localVarQueryParameter, "apikey", configuration) + + if (padID !== undefined) { + localVarQueryParameter['padID'] = padID; + } + + if (rev !== undefined) { + localVarQueryParameter['rev'] = rev; + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @param {string} [padID] + * @param {string} [rev] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + saveRevisionUsingPOST: async (padID?: string, rev?: string, options: any = {}): Promise => { + const localVarPath = `/saveRevision`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ApiKey required + await setApiKeyToObject(localVarQueryParameter, "apikey", configuration) + + if (padID !== undefined) { + localVarQueryParameter['padID'] = padID; + } + + if (rev !== undefined) { + localVarQueryParameter['rev'] = rev; + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + } +}; + +/** + * DefaultApi - functional programming interface + * @export + */ +export const DefaultApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = DefaultApiAxiosParamCreator(configuration) + return { + /** + * + * @param {string} [padID] + * @param {string} [text] + * @param {string} [authorId] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async appendTextUsingGET(padID?: string, text?: string, authorId?: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.appendTextUsingGET(padID, text, authorId, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * + * @param {string} [padID] + * @param {string} [text] + * @param {string} [authorId] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async appendTextUsingPOST(padID?: string, text?: string, authorId?: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.appendTextUsingPOST(padID, text, authorId, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * + * @param {string} [sourceID] + * @param {string} [destinationID] + * @param {string} [force] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async copyPadUsingGET(sourceID?: string, destinationID?: string, force?: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.copyPadUsingGET(sourceID, destinationID, force, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * + * @param {string} [sourceID] + * @param {string} [destinationID] + * @param {string} [force] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async copyPadUsingPOST(sourceID?: string, destinationID?: string, force?: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.copyPadUsingPOST(sourceID, destinationID, force, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * + * @param {string} [sourceID] + * @param {string} [destinationID] + * @param {string} [force] + * @param {string} [authorId] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async copyPadWithoutHistoryUsingGET(sourceID?: string, destinationID?: string, force?: string, authorId?: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.copyPadWithoutHistoryUsingGET(sourceID, destinationID, force, authorId, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * + * @param {string} [sourceID] + * @param {string} [destinationID] + * @param {string} [force] + * @param {string} [authorId] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async copyPadWithoutHistoryUsingPOST(sourceID?: string, destinationID?: string, force?: string, authorId?: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.copyPadWithoutHistoryUsingPOST(sourceID, destinationID, force, authorId, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * + * @param {string} [padID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getAttributePoolUsingGET(padID?: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getAttributePoolUsingGET(padID, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * + * @param {string} [padID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getAttributePoolUsingPOST(padID?: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getAttributePoolUsingPOST(padID, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * + * @param {string} [roID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getPadIDUsingGET(roID?: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getPadIDUsingGET(roID, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * + * @param {string} [roID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getPadIDUsingPOST(roID?: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getPadIDUsingPOST(roID, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * + * @param {string} [padID] + * @param {string} [rev] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getRevisionChangesetUsingGET(padID?: string, rev?: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getRevisionChangesetUsingGET(padID, rev, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * + * @param {string} [padID] + * @param {string} [rev] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getRevisionChangesetUsingPOST(padID?: string, rev?: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getRevisionChangesetUsingPOST(padID, rev, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * + * @param {string} [padID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getSavedRevisionsCountUsingGET(padID?: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getSavedRevisionsCountUsingGET(padID, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * + * @param {string} [padID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getSavedRevisionsCountUsingPOST(padID?: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getSavedRevisionsCountUsingPOST(padID, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getStatsUsingGET(options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getStatsUsingGET(options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getStatsUsingPOST(options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getStatsUsingPOST(options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * + * @param {string} [padID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async listSavedRevisionsUsingGET(padID?: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.listSavedRevisionsUsingGET(padID, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * + * @param {string} [padID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async listSavedRevisionsUsingPOST(padID?: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.listSavedRevisionsUsingPOST(padID, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * + * @param {string} [sourceID] + * @param {string} [destinationID] + * @param {string} [force] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async movePadUsingGET(sourceID?: string, destinationID?: string, force?: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.movePadUsingGET(sourceID, destinationID, force, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * + * @param {string} [sourceID] + * @param {string} [destinationID] + * @param {string} [force] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async movePadUsingPOST(sourceID?: string, destinationID?: string, force?: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.movePadUsingPOST(sourceID, destinationID, force, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * + * @param {string} [padID] + * @param {string} [rev] + * @param {string} [authorId] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async restoreRevisionUsingGET(padID?: string, rev?: string, authorId?: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.restoreRevisionUsingGET(padID, rev, authorId, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * + * @param {string} [padID] + * @param {string} [rev] + * @param {string} [authorId] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async restoreRevisionUsingPOST(padID?: string, rev?: string, authorId?: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.restoreRevisionUsingPOST(padID, rev, authorId, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * + * @param {string} [padID] + * @param {string} [rev] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async saveRevisionUsingGET(padID?: string, rev?: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.saveRevisionUsingGET(padID, rev, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * + * @param {string} [padID] + * @param {string} [rev] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async saveRevisionUsingPOST(padID?: string, rev?: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.saveRevisionUsingPOST(padID, rev, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + } +}; + +/** + * DefaultApi - factory interface + * @export + */ +export const DefaultApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = DefaultApiFp(configuration) + return { + /** + * + * @param {string} [padID] + * @param {string} [text] + * @param {string} [authorId] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + appendTextUsingGET(padID?: string, text?: string, authorId?: string, options?: any): AxiosPromise { + return localVarFp.appendTextUsingGET(padID, text, authorId, options).then((request) => request(axios, basePath)); + }, + /** + * + * @param {string} [padID] + * @param {string} [text] + * @param {string} [authorId] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + appendTextUsingPOST(padID?: string, text?: string, authorId?: string, options?: any): AxiosPromise { + return localVarFp.appendTextUsingPOST(padID, text, authorId, options).then((request) => request(axios, basePath)); + }, + /** + * + * @param {string} [sourceID] + * @param {string} [destinationID] + * @param {string} [force] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + copyPadUsingGET(sourceID?: string, destinationID?: string, force?: string, options?: any): AxiosPromise { + return localVarFp.copyPadUsingGET(sourceID, destinationID, force, options).then((request) => request(axios, basePath)); + }, + /** + * + * @param {string} [sourceID] + * @param {string} [destinationID] + * @param {string} [force] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + copyPadUsingPOST(sourceID?: string, destinationID?: string, force?: string, options?: any): AxiosPromise { + return localVarFp.copyPadUsingPOST(sourceID, destinationID, force, options).then((request) => request(axios, basePath)); + }, + /** + * + * @param {string} [sourceID] + * @param {string} [destinationID] + * @param {string} [force] + * @param {string} [authorId] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + copyPadWithoutHistoryUsingGET(sourceID?: string, destinationID?: string, force?: string, authorId?: string, options?: any): AxiosPromise { + return localVarFp.copyPadWithoutHistoryUsingGET(sourceID, destinationID, force, authorId, options).then((request) => request(axios, basePath)); + }, + /** + * + * @param {string} [sourceID] + * @param {string} [destinationID] + * @param {string} [force] + * @param {string} [authorId] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + copyPadWithoutHistoryUsingPOST(sourceID?: string, destinationID?: string, force?: string, authorId?: string, options?: any): AxiosPromise { + return localVarFp.copyPadWithoutHistoryUsingPOST(sourceID, destinationID, force, authorId, options).then((request) => request(axios, basePath)); + }, + /** + * + * @param {string} [padID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getAttributePoolUsingGET(padID?: string, options?: any): AxiosPromise { + return localVarFp.getAttributePoolUsingGET(padID, options).then((request) => request(axios, basePath)); + }, + /** + * + * @param {string} [padID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getAttributePoolUsingPOST(padID?: string, options?: any): AxiosPromise { + return localVarFp.getAttributePoolUsingPOST(padID, options).then((request) => request(axios, basePath)); + }, + /** + * + * @param {string} [roID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getPadIDUsingGET(roID?: string, options?: any): AxiosPromise { + return localVarFp.getPadIDUsingGET(roID, options).then((request) => request(axios, basePath)); + }, + /** + * + * @param {string} [roID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getPadIDUsingPOST(roID?: string, options?: any): AxiosPromise { + return localVarFp.getPadIDUsingPOST(roID, options).then((request) => request(axios, basePath)); + }, + /** + * + * @param {string} [padID] + * @param {string} [rev] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getRevisionChangesetUsingGET(padID?: string, rev?: string, options?: any): AxiosPromise { + return localVarFp.getRevisionChangesetUsingGET(padID, rev, options).then((request) => request(axios, basePath)); + }, + /** + * + * @param {string} [padID] + * @param {string} [rev] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getRevisionChangesetUsingPOST(padID?: string, rev?: string, options?: any): AxiosPromise { + return localVarFp.getRevisionChangesetUsingPOST(padID, rev, options).then((request) => request(axios, basePath)); + }, + /** + * + * @param {string} [padID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getSavedRevisionsCountUsingGET(padID?: string, options?: any): AxiosPromise { + return localVarFp.getSavedRevisionsCountUsingGET(padID, options).then((request) => request(axios, basePath)); + }, + /** + * + * @param {string} [padID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getSavedRevisionsCountUsingPOST(padID?: string, options?: any): AxiosPromise { + return localVarFp.getSavedRevisionsCountUsingPOST(padID, options).then((request) => request(axios, basePath)); + }, + /** + * + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getStatsUsingGET(options?: any): AxiosPromise { + return localVarFp.getStatsUsingGET(options).then((request) => request(axios, basePath)); + }, + /** + * + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getStatsUsingPOST(options?: any): AxiosPromise { + return localVarFp.getStatsUsingPOST(options).then((request) => request(axios, basePath)); + }, + /** + * + * @param {string} [padID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listSavedRevisionsUsingGET(padID?: string, options?: any): AxiosPromise { + return localVarFp.listSavedRevisionsUsingGET(padID, options).then((request) => request(axios, basePath)); + }, + /** + * + * @param {string} [padID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listSavedRevisionsUsingPOST(padID?: string, options?: any): AxiosPromise { + return localVarFp.listSavedRevisionsUsingPOST(padID, options).then((request) => request(axios, basePath)); + }, + /** + * + * @param {string} [sourceID] + * @param {string} [destinationID] + * @param {string} [force] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + movePadUsingGET(sourceID?: string, destinationID?: string, force?: string, options?: any): AxiosPromise { + return localVarFp.movePadUsingGET(sourceID, destinationID, force, options).then((request) => request(axios, basePath)); + }, + /** + * + * @param {string} [sourceID] + * @param {string} [destinationID] + * @param {string} [force] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + movePadUsingPOST(sourceID?: string, destinationID?: string, force?: string, options?: any): AxiosPromise { + return localVarFp.movePadUsingPOST(sourceID, destinationID, force, options).then((request) => request(axios, basePath)); + }, + /** + * + * @param {string} [padID] + * @param {string} [rev] + * @param {string} [authorId] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + restoreRevisionUsingGET(padID?: string, rev?: string, authorId?: string, options?: any): AxiosPromise { + return localVarFp.restoreRevisionUsingGET(padID, rev, authorId, options).then((request) => request(axios, basePath)); + }, + /** + * + * @param {string} [padID] + * @param {string} [rev] + * @param {string} [authorId] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + restoreRevisionUsingPOST(padID?: string, rev?: string, authorId?: string, options?: any): AxiosPromise { + return localVarFp.restoreRevisionUsingPOST(padID, rev, authorId, options).then((request) => request(axios, basePath)); + }, + /** + * + * @param {string} [padID] + * @param {string} [rev] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + saveRevisionUsingGET(padID?: string, rev?: string, options?: any): AxiosPromise { + return localVarFp.saveRevisionUsingGET(padID, rev, options).then((request) => request(axios, basePath)); + }, + /** + * + * @param {string} [padID] + * @param {string} [rev] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + saveRevisionUsingPOST(padID?: string, rev?: string, options?: any): AxiosPromise { + return localVarFp.saveRevisionUsingPOST(padID, rev, options).then((request) => request(axios, basePath)); + }, + }; +}; + +/** + * DefaultApi - interface + * @export + * @interface DefaultApi + */ +export interface DefaultApiInterface { + /** + * + * @param {string} [padID] + * @param {string} [text] + * @param {string} [authorId] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof DefaultApiInterface + */ + appendTextUsingGET(padID?: string, text?: string, authorId?: string, options?: any): AxiosPromise; + + /** + * + * @param {string} [padID] + * @param {string} [text] + * @param {string} [authorId] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof DefaultApiInterface + */ + appendTextUsingPOST(padID?: string, text?: string, authorId?: string, options?: any): AxiosPromise; + + /** + * + * @param {string} [sourceID] + * @param {string} [destinationID] + * @param {string} [force] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof DefaultApiInterface + */ + copyPadUsingGET(sourceID?: string, destinationID?: string, force?: string, options?: any): AxiosPromise; + + /** + * + * @param {string} [sourceID] + * @param {string} [destinationID] + * @param {string} [force] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof DefaultApiInterface + */ + copyPadUsingPOST(sourceID?: string, destinationID?: string, force?: string, options?: any): AxiosPromise; + + /** + * + * @param {string} [sourceID] + * @param {string} [destinationID] + * @param {string} [force] + * @param {string} [authorId] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof DefaultApiInterface + */ + copyPadWithoutHistoryUsingGET(sourceID?: string, destinationID?: string, force?: string, authorId?: string, options?: any): AxiosPromise; + + /** + * + * @param {string} [sourceID] + * @param {string} [destinationID] + * @param {string} [force] + * @param {string} [authorId] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof DefaultApiInterface + */ + copyPadWithoutHistoryUsingPOST(sourceID?: string, destinationID?: string, force?: string, authorId?: string, options?: any): AxiosPromise; + + /** + * + * @param {string} [padID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof DefaultApiInterface + */ + getAttributePoolUsingGET(padID?: string, options?: any): AxiosPromise; + + /** + * + * @param {string} [padID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof DefaultApiInterface + */ + getAttributePoolUsingPOST(padID?: string, options?: any): AxiosPromise; + + /** + * + * @param {string} [roID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof DefaultApiInterface + */ + getPadIDUsingGET(roID?: string, options?: any): AxiosPromise; + + /** + * + * @param {string} [roID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof DefaultApiInterface + */ + getPadIDUsingPOST(roID?: string, options?: any): AxiosPromise; + + /** + * + * @param {string} [padID] + * @param {string} [rev] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof DefaultApiInterface + */ + getRevisionChangesetUsingGET(padID?: string, rev?: string, options?: any): AxiosPromise; + + /** + * + * @param {string} [padID] + * @param {string} [rev] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof DefaultApiInterface + */ + getRevisionChangesetUsingPOST(padID?: string, rev?: string, options?: any): AxiosPromise; + + /** + * + * @param {string} [padID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof DefaultApiInterface + */ + getSavedRevisionsCountUsingGET(padID?: string, options?: any): AxiosPromise; + + /** + * + * @param {string} [padID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof DefaultApiInterface + */ + getSavedRevisionsCountUsingPOST(padID?: string, options?: any): AxiosPromise; + + /** + * + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof DefaultApiInterface + */ + getStatsUsingGET(options?: any): AxiosPromise; + + /** + * + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof DefaultApiInterface + */ + getStatsUsingPOST(options?: any): AxiosPromise; + + /** + * + * @param {string} [padID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof DefaultApiInterface + */ + listSavedRevisionsUsingGET(padID?: string, options?: any): AxiosPromise; + + /** + * + * @param {string} [padID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof DefaultApiInterface + */ + listSavedRevisionsUsingPOST(padID?: string, options?: any): AxiosPromise; + + /** + * + * @param {string} [sourceID] + * @param {string} [destinationID] + * @param {string} [force] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof DefaultApiInterface + */ + movePadUsingGET(sourceID?: string, destinationID?: string, force?: string, options?: any): AxiosPromise; + + /** + * + * @param {string} [sourceID] + * @param {string} [destinationID] + * @param {string} [force] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof DefaultApiInterface + */ + movePadUsingPOST(sourceID?: string, destinationID?: string, force?: string, options?: any): AxiosPromise; + + /** + * + * @param {string} [padID] + * @param {string} [rev] + * @param {string} [authorId] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof DefaultApiInterface + */ + restoreRevisionUsingGET(padID?: string, rev?: string, authorId?: string, options?: any): AxiosPromise; + + /** + * + * @param {string} [padID] + * @param {string} [rev] + * @param {string} [authorId] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof DefaultApiInterface + */ + restoreRevisionUsingPOST(padID?: string, rev?: string, authorId?: string, options?: any): AxiosPromise; + + /** + * + * @param {string} [padID] + * @param {string} [rev] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof DefaultApiInterface + */ + saveRevisionUsingGET(padID?: string, rev?: string, options?: any): AxiosPromise; + + /** + * + * @param {string} [padID] + * @param {string} [rev] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof DefaultApiInterface + */ + saveRevisionUsingPOST(padID?: string, rev?: string, options?: any): AxiosPromise; + +} + +/** + * DefaultApi - object-oriented interface + * @export + * @class DefaultApi + * @extends {BaseAPI} + */ +export class DefaultApi extends BaseAPI implements DefaultApiInterface { + /** + * + * @param {string} [padID] + * @param {string} [text] + * @param {string} [authorId] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof DefaultApi + */ + public appendTextUsingGET(padID?: string, text?: string, authorId?: string, options?: any) { + return DefaultApiFp(this.configuration).appendTextUsingGET(padID, text, authorId, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @param {string} [padID] + * @param {string} [text] + * @param {string} [authorId] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof DefaultApi + */ + public appendTextUsingPOST(padID?: string, text?: string, authorId?: string, options?: any) { + return DefaultApiFp(this.configuration).appendTextUsingPOST(padID, text, authorId, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @param {string} [sourceID] + * @param {string} [destinationID] + * @param {string} [force] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof DefaultApi + */ + public copyPadUsingGET(sourceID?: string, destinationID?: string, force?: string, options?: any) { + return DefaultApiFp(this.configuration).copyPadUsingGET(sourceID, destinationID, force, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @param {string} [sourceID] + * @param {string} [destinationID] + * @param {string} [force] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof DefaultApi + */ + public copyPadUsingPOST(sourceID?: string, destinationID?: string, force?: string, options?: any) { + return DefaultApiFp(this.configuration).copyPadUsingPOST(sourceID, destinationID, force, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @param {string} [sourceID] + * @param {string} [destinationID] + * @param {string} [force] + * @param {string} [authorId] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof DefaultApi + */ + public copyPadWithoutHistoryUsingGET(sourceID?: string, destinationID?: string, force?: string, authorId?: string, options?: any) { + return DefaultApiFp(this.configuration).copyPadWithoutHistoryUsingGET(sourceID, destinationID, force, authorId, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @param {string} [sourceID] + * @param {string} [destinationID] + * @param {string} [force] + * @param {string} [authorId] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof DefaultApi + */ + public copyPadWithoutHistoryUsingPOST(sourceID?: string, destinationID?: string, force?: string, authorId?: string, options?: any) { + return DefaultApiFp(this.configuration).copyPadWithoutHistoryUsingPOST(sourceID, destinationID, force, authorId, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @param {string} [padID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof DefaultApi + */ + public getAttributePoolUsingGET(padID?: string, options?: any) { + return DefaultApiFp(this.configuration).getAttributePoolUsingGET(padID, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @param {string} [padID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof DefaultApi + */ + public getAttributePoolUsingPOST(padID?: string, options?: any) { + return DefaultApiFp(this.configuration).getAttributePoolUsingPOST(padID, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @param {string} [roID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof DefaultApi + */ + public getPadIDUsingGET(roID?: string, options?: any) { + return DefaultApiFp(this.configuration).getPadIDUsingGET(roID, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @param {string} [roID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof DefaultApi + */ + public getPadIDUsingPOST(roID?: string, options?: any) { + return DefaultApiFp(this.configuration).getPadIDUsingPOST(roID, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @param {string} [padID] + * @param {string} [rev] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof DefaultApi + */ + public getRevisionChangesetUsingGET(padID?: string, rev?: string, options?: any) { + return DefaultApiFp(this.configuration).getRevisionChangesetUsingGET(padID, rev, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @param {string} [padID] + * @param {string} [rev] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof DefaultApi + */ + public getRevisionChangesetUsingPOST(padID?: string, rev?: string, options?: any) { + return DefaultApiFp(this.configuration).getRevisionChangesetUsingPOST(padID, rev, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @param {string} [padID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof DefaultApi + */ + public getSavedRevisionsCountUsingGET(padID?: string, options?: any) { + return DefaultApiFp(this.configuration).getSavedRevisionsCountUsingGET(padID, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @param {string} [padID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof DefaultApi + */ + public getSavedRevisionsCountUsingPOST(padID?: string, options?: any) { + return DefaultApiFp(this.configuration).getSavedRevisionsCountUsingPOST(padID, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof DefaultApi + */ + public getStatsUsingGET(options?: any) { + return DefaultApiFp(this.configuration).getStatsUsingGET(options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof DefaultApi + */ + public getStatsUsingPOST(options?: any) { + return DefaultApiFp(this.configuration).getStatsUsingPOST(options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @param {string} [padID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof DefaultApi + */ + public listSavedRevisionsUsingGET(padID?: string, options?: any) { + return DefaultApiFp(this.configuration).listSavedRevisionsUsingGET(padID, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @param {string} [padID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof DefaultApi + */ + public listSavedRevisionsUsingPOST(padID?: string, options?: any) { + return DefaultApiFp(this.configuration).listSavedRevisionsUsingPOST(padID, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @param {string} [sourceID] + * @param {string} [destinationID] + * @param {string} [force] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof DefaultApi + */ + public movePadUsingGET(sourceID?: string, destinationID?: string, force?: string, options?: any) { + return DefaultApiFp(this.configuration).movePadUsingGET(sourceID, destinationID, force, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @param {string} [sourceID] + * @param {string} [destinationID] + * @param {string} [force] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof DefaultApi + */ + public movePadUsingPOST(sourceID?: string, destinationID?: string, force?: string, options?: any) { + return DefaultApiFp(this.configuration).movePadUsingPOST(sourceID, destinationID, force, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @param {string} [padID] + * @param {string} [rev] + * @param {string} [authorId] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof DefaultApi + */ + public restoreRevisionUsingGET(padID?: string, rev?: string, authorId?: string, options?: any) { + return DefaultApiFp(this.configuration).restoreRevisionUsingGET(padID, rev, authorId, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @param {string} [padID] + * @param {string} [rev] + * @param {string} [authorId] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof DefaultApi + */ + public restoreRevisionUsingPOST(padID?: string, rev?: string, authorId?: string, options?: any) { + return DefaultApiFp(this.configuration).restoreRevisionUsingPOST(padID, rev, authorId, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @param {string} [padID] + * @param {string} [rev] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof DefaultApi + */ + public saveRevisionUsingGET(padID?: string, rev?: string, options?: any) { + return DefaultApiFp(this.configuration).saveRevisionUsingGET(padID, rev, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @param {string} [padID] + * @param {string} [rev] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof DefaultApi + */ + public saveRevisionUsingPOST(padID?: string, rev?: string, options?: any) { + return DefaultApiFp(this.configuration).saveRevisionUsingPOST(padID, rev, options).then((request) => request(this.axios, this.basePath)); + } +} diff --git a/apps/server/src/infra/etherpad-client/etherpad-api-client/api/group-api.ts b/apps/server/src/infra/etherpad-client/etherpad-api-client/api/group-api.ts new file mode 100644 index 00000000000..cbb4db16de1 --- /dev/null +++ b/apps/server/src/infra/etherpad-client/etherpad-api-client/api/group-api.ts @@ -0,0 +1,1214 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Etherpad API + * Etherpad is a real-time collaborative editor scalable to thousands of simultaneous real time users. It provides full data export capabilities, and runs on your server, under your control. + * + * The version of the OpenAPI document: 1.3.0 + * Contact: support@example.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import globalAxios, { AxiosPromise, AxiosInstance } from 'axios'; +import { Configuration } from '../configuration'; +// Some imports not used depending on template conditions +// @ts-ignore +import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base'; +// @ts-ignore +import { InlineResponse200 } from '../models'; +// @ts-ignore +import { InlineResponse2001 } from '../models'; +// @ts-ignore +import { InlineResponse20017 } from '../models'; +// @ts-ignore +import { InlineResponse2002 } from '../models'; +// @ts-ignore +import { InlineResponse2006 } from '../models'; +// @ts-ignore +import { InlineResponse400 } from '../models'; +// @ts-ignore +import { InlineResponse401 } from '../models'; +// @ts-ignore +import { InlineResponse500 } from '../models'; +/** + * GroupApi - axios parameter creator + * @export + */ +export const GroupApiAxiosParamCreator = function (configuration?: Configuration) { + return { + /** + * + * @summary this functions helps you to map your application group ids to Etherpad group ids + * @param {string} [groupMapper] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createGroupIfNotExistsForUsingGET: async (groupMapper?: string, options: any = {}): Promise => { + const localVarPath = `/createGroupIfNotExistsFor`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ApiKey required + await setApiKeyToObject(localVarQueryParameter, "apikey", configuration) + + if (groupMapper !== undefined) { + localVarQueryParameter['groupMapper'] = groupMapper; + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary this functions helps you to map your application group ids to Etherpad group ids + * @param {string} [groupMapper] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createGroupIfNotExistsForUsingPOST: async (groupMapper?: string, options: any = {}): Promise => { + const localVarPath = `/createGroupIfNotExistsFor`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ApiKey required + await setApiKeyToObject(localVarQueryParameter, "apikey", configuration) + + if (groupMapper !== undefined) { + localVarQueryParameter['groupMapper'] = groupMapper; + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary creates a new pad in this group + * @param {string} [groupID] + * @param {string} [padName] + * @param {string} [text] + * @param {string} [authorId] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createGroupPadUsingGET: async (groupID?: string, padName?: string, text?: string, authorId?: string, options: any = {}): Promise => { + const localVarPath = `/createGroupPad`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ApiKey required + await setApiKeyToObject(localVarQueryParameter, "apikey", configuration) + + if (groupID !== undefined) { + localVarQueryParameter['groupID'] = groupID; + } + + if (padName !== undefined) { + localVarQueryParameter['padName'] = padName; + } + + if (text !== undefined) { + localVarQueryParameter['text'] = text; + } + + if (authorId !== undefined) { + localVarQueryParameter['authorId'] = authorId; + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary creates a new pad in this group + * @param {string} [groupID] + * @param {string} [padName] + * @param {string} [text] + * @param {string} [authorId] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createGroupPadUsingPOST: async (groupID?: string, padName?: string, text?: string, authorId?: string, options: any = {}): Promise => { + const localVarPath = `/createGroupPad`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ApiKey required + await setApiKeyToObject(localVarQueryParameter, "apikey", configuration) + + if (groupID !== undefined) { + localVarQueryParameter['groupID'] = groupID; + } + + if (padName !== undefined) { + localVarQueryParameter['padName'] = padName; + } + + if (text !== undefined) { + localVarQueryParameter['text'] = text; + } + + if (authorId !== undefined) { + localVarQueryParameter['authorId'] = authorId; + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary creates a new group + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createGroupUsingGET: async (options: any = {}): Promise => { + const localVarPath = `/createGroup`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ApiKey required + await setApiKeyToObject(localVarQueryParameter, "apikey", configuration) + + + + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary creates a new group + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createGroupUsingPOST: async (options: any = {}): Promise => { + const localVarPath = `/createGroup`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ApiKey required + await setApiKeyToObject(localVarQueryParameter, "apikey", configuration) + + + + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary deletes a group + * @param {string} [groupID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteGroupUsingGET: async (groupID?: string, options: any = {}): Promise => { + const localVarPath = `/deleteGroup`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ApiKey required + await setApiKeyToObject(localVarQueryParameter, "apikey", configuration) + + if (groupID !== undefined) { + localVarQueryParameter['groupID'] = groupID; + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary deletes a group + * @param {string} [groupID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteGroupUsingPOST: async (groupID?: string, options: any = {}): Promise => { + const localVarPath = `/deleteGroup`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ApiKey required + await setApiKeyToObject(localVarQueryParameter, "apikey", configuration) + + if (groupID !== undefined) { + localVarQueryParameter['groupID'] = groupID; + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listAllGroupsUsingGET: async (options: any = {}): Promise => { + const localVarPath = `/listAllGroups`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ApiKey required + await setApiKeyToObject(localVarQueryParameter, "apikey", configuration) + + + + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listAllGroupsUsingPOST: async (options: any = {}): Promise => { + const localVarPath = `/listAllGroups`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ApiKey required + await setApiKeyToObject(localVarQueryParameter, "apikey", configuration) + + + + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary returns all pads of this group + * @param {string} [groupID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listPadsUsingGET: async (groupID?: string, options: any = {}): Promise => { + const localVarPath = `/listPads`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ApiKey required + await setApiKeyToObject(localVarQueryParameter, "apikey", configuration) + + if (groupID !== undefined) { + localVarQueryParameter['groupID'] = groupID; + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary returns all pads of this group + * @param {string} [groupID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listPadsUsingPOST: async (groupID?: string, options: any = {}): Promise => { + const localVarPath = `/listPads`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ApiKey required + await setApiKeyToObject(localVarQueryParameter, "apikey", configuration) + + if (groupID !== undefined) { + localVarQueryParameter['groupID'] = groupID; + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @param {string} [groupID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listSessionsOfGroupUsingGET: async (groupID?: string, options: any = {}): Promise => { + const localVarPath = `/listSessionsOfGroup`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ApiKey required + await setApiKeyToObject(localVarQueryParameter, "apikey", configuration) + + if (groupID !== undefined) { + localVarQueryParameter['groupID'] = groupID; + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @param {string} [groupID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listSessionsOfGroupUsingPOST: async (groupID?: string, options: any = {}): Promise => { + const localVarPath = `/listSessionsOfGroup`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ApiKey required + await setApiKeyToObject(localVarQueryParameter, "apikey", configuration) + + if (groupID !== undefined) { + localVarQueryParameter['groupID'] = groupID; + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + } +}; + +/** + * GroupApi - functional programming interface + * @export + */ +export const GroupApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = GroupApiAxiosParamCreator(configuration) + return { + /** + * + * @summary this functions helps you to map your application group ids to Etherpad group ids + * @param {string} [groupMapper] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async createGroupIfNotExistsForUsingGET(groupMapper?: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.createGroupIfNotExistsForUsingGET(groupMapper, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * + * @summary this functions helps you to map your application group ids to Etherpad group ids + * @param {string} [groupMapper] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async createGroupIfNotExistsForUsingPOST(groupMapper?: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.createGroupIfNotExistsForUsingPOST(groupMapper, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * + * @summary creates a new pad in this group + * @param {string} [groupID] + * @param {string} [padName] + * @param {string} [text] + * @param {string} [authorId] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async createGroupPadUsingGET(groupID?: string, padName?: string, text?: string, authorId?: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.createGroupPadUsingGET(groupID, padName, text, authorId, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * + * @summary creates a new pad in this group + * @param {string} [groupID] + * @param {string} [padName] + * @param {string} [text] + * @param {string} [authorId] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async createGroupPadUsingPOST(groupID?: string, padName?: string, text?: string, authorId?: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.createGroupPadUsingPOST(groupID, padName, text, authorId, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * + * @summary creates a new group + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async createGroupUsingGET(options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.createGroupUsingGET(options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * + * @summary creates a new group + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async createGroupUsingPOST(options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.createGroupUsingPOST(options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * + * @summary deletes a group + * @param {string} [groupID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async deleteGroupUsingGET(groupID?: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.deleteGroupUsingGET(groupID, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * + * @summary deletes a group + * @param {string} [groupID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async deleteGroupUsingPOST(groupID?: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.deleteGroupUsingPOST(groupID, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async listAllGroupsUsingGET(options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.listAllGroupsUsingGET(options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async listAllGroupsUsingPOST(options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.listAllGroupsUsingPOST(options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * + * @summary returns all pads of this group + * @param {string} [groupID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async listPadsUsingGET(groupID?: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.listPadsUsingGET(groupID, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * + * @summary returns all pads of this group + * @param {string} [groupID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async listPadsUsingPOST(groupID?: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.listPadsUsingPOST(groupID, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * + * @param {string} [groupID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async listSessionsOfGroupUsingGET(groupID?: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.listSessionsOfGroupUsingGET(groupID, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * + * @param {string} [groupID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async listSessionsOfGroupUsingPOST(groupID?: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.listSessionsOfGroupUsingPOST(groupID, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + } +}; + +/** + * GroupApi - factory interface + * @export + */ +export const GroupApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = GroupApiFp(configuration) + return { + /** + * + * @summary this functions helps you to map your application group ids to Etherpad group ids + * @param {string} [groupMapper] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createGroupIfNotExistsForUsingGET(groupMapper?: string, options?: any): AxiosPromise { + return localVarFp.createGroupIfNotExistsForUsingGET(groupMapper, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary this functions helps you to map your application group ids to Etherpad group ids + * @param {string} [groupMapper] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createGroupIfNotExistsForUsingPOST(groupMapper?: string, options?: any): AxiosPromise { + return localVarFp.createGroupIfNotExistsForUsingPOST(groupMapper, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary creates a new pad in this group + * @param {string} [groupID] + * @param {string} [padName] + * @param {string} [text] + * @param {string} [authorId] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createGroupPadUsingGET(groupID?: string, padName?: string, text?: string, authorId?: string, options?: any): AxiosPromise { + return localVarFp.createGroupPadUsingGET(groupID, padName, text, authorId, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary creates a new pad in this group + * @param {string} [groupID] + * @param {string} [padName] + * @param {string} [text] + * @param {string} [authorId] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createGroupPadUsingPOST(groupID?: string, padName?: string, text?: string, authorId?: string, options?: any): AxiosPromise { + return localVarFp.createGroupPadUsingPOST(groupID, padName, text, authorId, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary creates a new group + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createGroupUsingGET(options?: any): AxiosPromise { + return localVarFp.createGroupUsingGET(options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary creates a new group + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createGroupUsingPOST(options?: any): AxiosPromise { + return localVarFp.createGroupUsingPOST(options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary deletes a group + * @param {string} [groupID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteGroupUsingGET(groupID?: string, options?: any): AxiosPromise { + return localVarFp.deleteGroupUsingGET(groupID, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary deletes a group + * @param {string} [groupID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteGroupUsingPOST(groupID?: string, options?: any): AxiosPromise { + return localVarFp.deleteGroupUsingPOST(groupID, options).then((request) => request(axios, basePath)); + }, + /** + * + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listAllGroupsUsingGET(options?: any): AxiosPromise { + return localVarFp.listAllGroupsUsingGET(options).then((request) => request(axios, basePath)); + }, + /** + * + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listAllGroupsUsingPOST(options?: any): AxiosPromise { + return localVarFp.listAllGroupsUsingPOST(options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary returns all pads of this group + * @param {string} [groupID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listPadsUsingGET(groupID?: string, options?: any): AxiosPromise { + return localVarFp.listPadsUsingGET(groupID, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary returns all pads of this group + * @param {string} [groupID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listPadsUsingPOST(groupID?: string, options?: any): AxiosPromise { + return localVarFp.listPadsUsingPOST(groupID, options).then((request) => request(axios, basePath)); + }, + /** + * + * @param {string} [groupID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listSessionsOfGroupUsingGET(groupID?: string, options?: any): AxiosPromise { + return localVarFp.listSessionsOfGroupUsingGET(groupID, options).then((request) => request(axios, basePath)); + }, + /** + * + * @param {string} [groupID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listSessionsOfGroupUsingPOST(groupID?: string, options?: any): AxiosPromise { + return localVarFp.listSessionsOfGroupUsingPOST(groupID, options).then((request) => request(axios, basePath)); + }, + }; +}; + +/** + * GroupApi - interface + * @export + * @interface GroupApi + */ +export interface GroupApiInterface { + /** + * + * @summary this functions helps you to map your application group ids to Etherpad group ids + * @param {string} [groupMapper] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof GroupApiInterface + */ + createGroupIfNotExistsForUsingGET(groupMapper?: string, options?: any): AxiosPromise; + + /** + * + * @summary this functions helps you to map your application group ids to Etherpad group ids + * @param {string} [groupMapper] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof GroupApiInterface + */ + createGroupIfNotExistsForUsingPOST(groupMapper?: string, options?: any): AxiosPromise; + + /** + * + * @summary creates a new pad in this group + * @param {string} [groupID] + * @param {string} [padName] + * @param {string} [text] + * @param {string} [authorId] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof GroupApiInterface + */ + createGroupPadUsingGET(groupID?: string, padName?: string, text?: string, authorId?: string, options?: any): AxiosPromise; + + /** + * + * @summary creates a new pad in this group + * @param {string} [groupID] + * @param {string} [padName] + * @param {string} [text] + * @param {string} [authorId] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof GroupApiInterface + */ + createGroupPadUsingPOST(groupID?: string, padName?: string, text?: string, authorId?: string, options?: any): AxiosPromise; + + /** + * + * @summary creates a new group + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof GroupApiInterface + */ + createGroupUsingGET(options?: any): AxiosPromise; + + /** + * + * @summary creates a new group + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof GroupApiInterface + */ + createGroupUsingPOST(options?: any): AxiosPromise; + + /** + * + * @summary deletes a group + * @param {string} [groupID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof GroupApiInterface + */ + deleteGroupUsingGET(groupID?: string, options?: any): AxiosPromise; + + /** + * + * @summary deletes a group + * @param {string} [groupID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof GroupApiInterface + */ + deleteGroupUsingPOST(groupID?: string, options?: any): AxiosPromise; + + /** + * + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof GroupApiInterface + */ + listAllGroupsUsingGET(options?: any): AxiosPromise; + + /** + * + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof GroupApiInterface + */ + listAllGroupsUsingPOST(options?: any): AxiosPromise; + + /** + * + * @summary returns all pads of this group + * @param {string} [groupID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof GroupApiInterface + */ + listPadsUsingGET(groupID?: string, options?: any): AxiosPromise; + + /** + * + * @summary returns all pads of this group + * @param {string} [groupID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof GroupApiInterface + */ + listPadsUsingPOST(groupID?: string, options?: any): AxiosPromise; + + /** + * + * @param {string} [groupID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof GroupApiInterface + */ + listSessionsOfGroupUsingGET(groupID?: string, options?: any): AxiosPromise; + + /** + * + * @param {string} [groupID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof GroupApiInterface + */ + listSessionsOfGroupUsingPOST(groupID?: string, options?: any): AxiosPromise; + +} + +/** + * GroupApi - object-oriented interface + * @export + * @class GroupApi + * @extends {BaseAPI} + */ +export class GroupApi extends BaseAPI implements GroupApiInterface { + /** + * + * @summary this functions helps you to map your application group ids to Etherpad group ids + * @param {string} [groupMapper] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof GroupApi + */ + public createGroupIfNotExistsForUsingGET(groupMapper?: string, options?: any) { + return GroupApiFp(this.configuration).createGroupIfNotExistsForUsingGET(groupMapper, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary this functions helps you to map your application group ids to Etherpad group ids + * @param {string} [groupMapper] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof GroupApi + */ + public createGroupIfNotExistsForUsingPOST(groupMapper?: string, options?: any) { + return GroupApiFp(this.configuration).createGroupIfNotExistsForUsingPOST(groupMapper, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary creates a new pad in this group + * @param {string} [groupID] + * @param {string} [padName] + * @param {string} [text] + * @param {string} [authorId] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof GroupApi + */ + public createGroupPadUsingGET(groupID?: string, padName?: string, text?: string, authorId?: string, options?: any) { + return GroupApiFp(this.configuration).createGroupPadUsingGET(groupID, padName, text, authorId, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary creates a new pad in this group + * @param {string} [groupID] + * @param {string} [padName] + * @param {string} [text] + * @param {string} [authorId] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof GroupApi + */ + public createGroupPadUsingPOST(groupID?: string, padName?: string, text?: string, authorId?: string, options?: any) { + return GroupApiFp(this.configuration).createGroupPadUsingPOST(groupID, padName, text, authorId, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary creates a new group + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof GroupApi + */ + public createGroupUsingGET(options?: any) { + return GroupApiFp(this.configuration).createGroupUsingGET(options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary creates a new group + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof GroupApi + */ + public createGroupUsingPOST(options?: any) { + return GroupApiFp(this.configuration).createGroupUsingPOST(options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary deletes a group + * @param {string} [groupID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof GroupApi + */ + public deleteGroupUsingGET(groupID?: string, options?: any) { + return GroupApiFp(this.configuration).deleteGroupUsingGET(groupID, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary deletes a group + * @param {string} [groupID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof GroupApi + */ + public deleteGroupUsingPOST(groupID?: string, options?: any) { + return GroupApiFp(this.configuration).deleteGroupUsingPOST(groupID, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof GroupApi + */ + public listAllGroupsUsingGET(options?: any) { + return GroupApiFp(this.configuration).listAllGroupsUsingGET(options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof GroupApi + */ + public listAllGroupsUsingPOST(options?: any) { + return GroupApiFp(this.configuration).listAllGroupsUsingPOST(options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary returns all pads of this group + * @param {string} [groupID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof GroupApi + */ + public listPadsUsingGET(groupID?: string, options?: any) { + return GroupApiFp(this.configuration).listPadsUsingGET(groupID, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary returns all pads of this group + * @param {string} [groupID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof GroupApi + */ + public listPadsUsingPOST(groupID?: string, options?: any) { + return GroupApiFp(this.configuration).listPadsUsingPOST(groupID, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @param {string} [groupID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof GroupApi + */ + public listSessionsOfGroupUsingGET(groupID?: string, options?: any) { + return GroupApiFp(this.configuration).listSessionsOfGroupUsingGET(groupID, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @param {string} [groupID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof GroupApi + */ + public listSessionsOfGroupUsingPOST(groupID?: string, options?: any) { + return GroupApiFp(this.configuration).listSessionsOfGroupUsingPOST(groupID, options).then((request) => request(this.axios, this.basePath)); + } +} diff --git a/apps/server/src/infra/etherpad-client/etherpad-api-client/api/pad-api.ts b/apps/server/src/infra/etherpad-client/etherpad-api-client/api/pad-api.ts new file mode 100644 index 00000000000..da7fd948c7f --- /dev/null +++ b/apps/server/src/infra/etherpad-client/etherpad-api-client/api/pad-api.ts @@ -0,0 +1,3752 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Etherpad API + * Etherpad is a real-time collaborative editor scalable to thousands of simultaneous real time users. It provides full data export capabilities, and runs on your server, under your control. + * + * The version of the OpenAPI document: 1.3.0 + * Contact: support@example.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import globalAxios, { AxiosPromise, AxiosInstance } from 'axios'; +import { Configuration } from '../configuration'; +// Some imports not used depending on template conditions +// @ts-ignore +import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base'; +// @ts-ignore +import { InlineResponse2001 } from '../models'; +// @ts-ignore +import { InlineResponse20010 } from '../models'; +// @ts-ignore +import { InlineResponse20011 } from '../models'; +// @ts-ignore +import { InlineResponse20012 } from '../models'; +// @ts-ignore +import { InlineResponse20013 } from '../models'; +// @ts-ignore +import { InlineResponse20014 } from '../models'; +// @ts-ignore +import { InlineResponse20016 } from '../models'; +// @ts-ignore +import { InlineResponse20018 } from '../models'; +// @ts-ignore +import { InlineResponse20019 } from '../models'; +// @ts-ignore +import { InlineResponse2002 } from '../models'; +// @ts-ignore +import { InlineResponse20020 } from '../models'; +// @ts-ignore +import { InlineResponse2007 } from '../models'; +// @ts-ignore +import { InlineResponse2008 } from '../models'; +// @ts-ignore +import { InlineResponse2009 } from '../models'; +// @ts-ignore +import { InlineResponse400 } from '../models'; +// @ts-ignore +import { InlineResponse401 } from '../models'; +// @ts-ignore +import { InlineResponse500 } from '../models'; +/** + * PadApi - axios parameter creator + * @export + */ +export const PadApiAxiosParamCreator = function (configuration?: Configuration) { + return { + /** + * + * @summary appends a chat message + * @param {string} [padID] + * @param {string} [text] + * @param {string} [authorID] + * @param {string} [time] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + appendChatMessageUsingGET: async (padID?: string, text?: string, authorID?: string, time?: string, options: any = {}): Promise => { + const localVarPath = `/appendChatMessage`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ApiKey required + await setApiKeyToObject(localVarQueryParameter, "apikey", configuration) + + if (padID !== undefined) { + localVarQueryParameter['padID'] = padID; + } + + if (text !== undefined) { + localVarQueryParameter['text'] = text; + } + + if (authorID !== undefined) { + localVarQueryParameter['authorID'] = authorID; + } + + if (time !== undefined) { + localVarQueryParameter['time'] = time; + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary appends a chat message + * @param {string} [padID] + * @param {string} [text] + * @param {string} [authorID] + * @param {string} [time] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + appendChatMessageUsingPOST: async (padID?: string, text?: string, authorID?: string, time?: string, options: any = {}): Promise => { + const localVarPath = `/appendChatMessage`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ApiKey required + await setApiKeyToObject(localVarQueryParameter, "apikey", configuration) + + if (padID !== undefined) { + localVarQueryParameter['padID'] = padID; + } + + if (text !== undefined) { + localVarQueryParameter['text'] = text; + } + + if (authorID !== undefined) { + localVarQueryParameter['authorID'] = authorID; + } + + if (time !== undefined) { + localVarQueryParameter['time'] = time; + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary returns ok when the current api token is valid + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + checkTokenUsingGET: async (options: any = {}): Promise => { + const localVarPath = `/checkToken`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ApiKey required + await setApiKeyToObject(localVarQueryParameter, "apikey", configuration) + + + + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary returns ok when the current api token is valid + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + checkTokenUsingPOST: async (options: any = {}): Promise => { + const localVarPath = `/checkToken`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ApiKey required + await setApiKeyToObject(localVarQueryParameter, "apikey", configuration) + + + + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @param {string} [padID] + * @param {string} [startRev] + * @param {string} [endRev] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createDiffHTMLUsingGET: async (padID?: string, startRev?: string, endRev?: string, options: any = {}): Promise => { + const localVarPath = `/createDiffHTML`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ApiKey required + await setApiKeyToObject(localVarQueryParameter, "apikey", configuration) + + if (padID !== undefined) { + localVarQueryParameter['padID'] = padID; + } + + if (startRev !== undefined) { + localVarQueryParameter['startRev'] = startRev; + } + + if (endRev !== undefined) { + localVarQueryParameter['endRev'] = endRev; + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @param {string} [padID] + * @param {string} [startRev] + * @param {string} [endRev] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createDiffHTMLUsingPOST: async (padID?: string, startRev?: string, endRev?: string, options: any = {}): Promise => { + const localVarPath = `/createDiffHTML`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ApiKey required + await setApiKeyToObject(localVarQueryParameter, "apikey", configuration) + + if (padID !== undefined) { + localVarQueryParameter['padID'] = padID; + } + + if (startRev !== undefined) { + localVarQueryParameter['startRev'] = startRev; + } + + if (endRev !== undefined) { + localVarQueryParameter['endRev'] = endRev; + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * creates a new (non-group) pad. Note that if you need to create a group Pad, you should call createGroupPad + * @param {string} [padID] + * @param {string} [text] + * @param {string} [authorId] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createPadUsingGET: async (padID?: string, text?: string, authorId?: string, options: any = {}): Promise => { + const localVarPath = `/createPad`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ApiKey required + await setApiKeyToObject(localVarQueryParameter, "apikey", configuration) + + if (padID !== undefined) { + localVarQueryParameter['padID'] = padID; + } + + if (text !== undefined) { + localVarQueryParameter['text'] = text; + } + + if (authorId !== undefined) { + localVarQueryParameter['authorId'] = authorId; + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * creates a new (non-group) pad. Note that if you need to create a group Pad, you should call createGroupPad + * @param {string} [padID] + * @param {string} [text] + * @param {string} [authorId] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createPadUsingPOST: async (padID?: string, text?: string, authorId?: string, options: any = {}): Promise => { + const localVarPath = `/createPad`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ApiKey required + await setApiKeyToObject(localVarQueryParameter, "apikey", configuration) + + if (padID !== undefined) { + localVarQueryParameter['padID'] = padID; + } + + if (text !== undefined) { + localVarQueryParameter['text'] = text; + } + + if (authorId !== undefined) { + localVarQueryParameter['authorId'] = authorId; + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary deletes a pad + * @param {string} [padID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deletePadUsingGET: async (padID?: string, options: any = {}): Promise => { + const localVarPath = `/deletePad`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ApiKey required + await setApiKeyToObject(localVarQueryParameter, "apikey", configuration) + + if (padID !== undefined) { + localVarQueryParameter['padID'] = padID; + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary deletes a pad + * @param {string} [padID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deletePadUsingPOST: async (padID?: string, options: any = {}): Promise => { + const localVarPath = `/deletePad`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ApiKey required + await setApiKeyToObject(localVarQueryParameter, "apikey", configuration) + + if (padID !== undefined) { + localVarQueryParameter['padID'] = padID; + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary returns the chatHead (chat-message) of the pad + * @param {string} [padID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getChatHeadUsingGET: async (padID?: string, options: any = {}): Promise => { + const localVarPath = `/getChatHead`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ApiKey required + await setApiKeyToObject(localVarQueryParameter, "apikey", configuration) + + if (padID !== undefined) { + localVarQueryParameter['padID'] = padID; + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary returns the chatHead (chat-message) of the pad + * @param {string} [padID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getChatHeadUsingPOST: async (padID?: string, options: any = {}): Promise => { + const localVarPath = `/getChatHead`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ApiKey required + await setApiKeyToObject(localVarQueryParameter, "apikey", configuration) + + if (padID !== undefined) { + localVarQueryParameter['padID'] = padID; + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary returns the chat history + * @param {string} [padID] + * @param {string} [start] + * @param {string} [end] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getChatHistoryUsingGET: async (padID?: string, start?: string, end?: string, options: any = {}): Promise => { + const localVarPath = `/getChatHistory`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ApiKey required + await setApiKeyToObject(localVarQueryParameter, "apikey", configuration) + + if (padID !== undefined) { + localVarQueryParameter['padID'] = padID; + } + + if (start !== undefined) { + localVarQueryParameter['start'] = start; + } + + if (end !== undefined) { + localVarQueryParameter['end'] = end; + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary returns the chat history + * @param {string} [padID] + * @param {string} [start] + * @param {string} [end] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getChatHistoryUsingPOST: async (padID?: string, start?: string, end?: string, options: any = {}): Promise => { + const localVarPath = `/getChatHistory`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ApiKey required + await setApiKeyToObject(localVarQueryParameter, "apikey", configuration) + + if (padID !== undefined) { + localVarQueryParameter['padID'] = padID; + } + + if (start !== undefined) { + localVarQueryParameter['start'] = start; + } + + if (end !== undefined) { + localVarQueryParameter['end'] = end; + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary returns the text of a pad formatted as HTML + * @param {string} [padID] + * @param {string} [rev] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getHTMLUsingGET: async (padID?: string, rev?: string, options: any = {}): Promise => { + const localVarPath = `/getHTML`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ApiKey required + await setApiKeyToObject(localVarQueryParameter, "apikey", configuration) + + if (padID !== undefined) { + localVarQueryParameter['padID'] = padID; + } + + if (rev !== undefined) { + localVarQueryParameter['rev'] = rev; + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary returns the text of a pad formatted as HTML + * @param {string} [padID] + * @param {string} [rev] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getHTMLUsingPOST: async (padID?: string, rev?: string, options: any = {}): Promise => { + const localVarPath = `/getHTML`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ApiKey required + await setApiKeyToObject(localVarQueryParameter, "apikey", configuration) + + if (padID !== undefined) { + localVarQueryParameter['padID'] = padID; + } + + if (rev !== undefined) { + localVarQueryParameter['rev'] = rev; + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary returns the timestamp of the last revision of the pad + * @param {string} [padID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getLastEditedUsingGET: async (padID?: string, options: any = {}): Promise => { + const localVarPath = `/getLastEdited`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ApiKey required + await setApiKeyToObject(localVarQueryParameter, "apikey", configuration) + + if (padID !== undefined) { + localVarQueryParameter['padID'] = padID; + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary returns the timestamp of the last revision of the pad + * @param {string} [padID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getLastEditedUsingPOST: async (padID?: string, options: any = {}): Promise => { + const localVarPath = `/getLastEdited`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ApiKey required + await setApiKeyToObject(localVarQueryParameter, "apikey", configuration) + + if (padID !== undefined) { + localVarQueryParameter['padID'] = padID; + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary return true of false + * @param {string} [padID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getPublicStatusUsingGET: async (padID?: string, options: any = {}): Promise => { + const localVarPath = `/getPublicStatus`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ApiKey required + await setApiKeyToObject(localVarQueryParameter, "apikey", configuration) + + if (padID !== undefined) { + localVarQueryParameter['padID'] = padID; + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary return true of false + * @param {string} [padID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getPublicStatusUsingPOST: async (padID?: string, options: any = {}): Promise => { + const localVarPath = `/getPublicStatus`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ApiKey required + await setApiKeyToObject(localVarQueryParameter, "apikey", configuration) + + if (padID !== undefined) { + localVarQueryParameter['padID'] = padID; + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary returns the read only link of a pad + * @param {string} [padID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getReadOnlyIDUsingGET: async (padID?: string, options: any = {}): Promise => { + const localVarPath = `/getReadOnlyID`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ApiKey required + await setApiKeyToObject(localVarQueryParameter, "apikey", configuration) + + if (padID !== undefined) { + localVarQueryParameter['padID'] = padID; + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary returns the read only link of a pad + * @param {string} [padID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getReadOnlyIDUsingPOST: async (padID?: string, options: any = {}): Promise => { + const localVarPath = `/getReadOnlyID`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ApiKey required + await setApiKeyToObject(localVarQueryParameter, "apikey", configuration) + + if (padID !== undefined) { + localVarQueryParameter['padID'] = padID; + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary returns the number of revisions of this pad + * @param {string} [padID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getRevisionsCountUsingGET: async (padID?: string, options: any = {}): Promise => { + const localVarPath = `/getRevisionsCount`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ApiKey required + await setApiKeyToObject(localVarQueryParameter, "apikey", configuration) + + if (padID !== undefined) { + localVarQueryParameter['padID'] = padID; + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary returns the number of revisions of this pad + * @param {string} [padID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getRevisionsCountUsingPOST: async (padID?: string, options: any = {}): Promise => { + const localVarPath = `/getRevisionsCount`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ApiKey required + await setApiKeyToObject(localVarQueryParameter, "apikey", configuration) + + if (padID !== undefined) { + localVarQueryParameter['padID'] = padID; + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary returns the text of a pad + * @param {string} [padID] + * @param {string} [rev] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getTextUsingGET: async (padID?: string, rev?: string, options: any = {}): Promise => { + const localVarPath = `/getText`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ApiKey required + await setApiKeyToObject(localVarQueryParameter, "apikey", configuration) + + if (padID !== undefined) { + localVarQueryParameter['padID'] = padID; + } + + if (rev !== undefined) { + localVarQueryParameter['rev'] = rev; + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary returns the text of a pad + * @param {string} [padID] + * @param {string} [rev] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getTextUsingPOST: async (padID?: string, rev?: string, options: any = {}): Promise => { + const localVarPath = `/getText`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ApiKey required + await setApiKeyToObject(localVarQueryParameter, "apikey", configuration) + + if (padID !== undefined) { + localVarQueryParameter['padID'] = padID; + } + + if (rev !== undefined) { + localVarQueryParameter['rev'] = rev; + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary list all the pads + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listAllPadsUsingGET: async (options: any = {}): Promise => { + const localVarPath = `/listAllPads`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ApiKey required + await setApiKeyToObject(localVarQueryParameter, "apikey", configuration) + + + + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary list all the pads + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listAllPadsUsingPOST: async (options: any = {}): Promise => { + const localVarPath = `/listAllPads`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ApiKey required + await setApiKeyToObject(localVarQueryParameter, "apikey", configuration) + + + + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary returns an array of authors who contributed to this pad + * @param {string} [padID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listAuthorsOfPadUsingGET: async (padID?: string, options: any = {}): Promise => { + const localVarPath = `/listAuthorsOfPad`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ApiKey required + await setApiKeyToObject(localVarQueryParameter, "apikey", configuration) + + if (padID !== undefined) { + localVarQueryParameter['padID'] = padID; + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary returns an array of authors who contributed to this pad + * @param {string} [padID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listAuthorsOfPadUsingPOST: async (padID?: string, options: any = {}): Promise => { + const localVarPath = `/listAuthorsOfPad`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ApiKey required + await setApiKeyToObject(localVarQueryParameter, "apikey", configuration) + + if (padID !== undefined) { + localVarQueryParameter['padID'] = padID; + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary returns the number of user that are currently editing this pad + * @param {string} [padID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + padUsersCountUsingGET: async (padID?: string, options: any = {}): Promise => { + const localVarPath = `/padUsersCount`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ApiKey required + await setApiKeyToObject(localVarQueryParameter, "apikey", configuration) + + if (padID !== undefined) { + localVarQueryParameter['padID'] = padID; + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary returns the number of user that are currently editing this pad + * @param {string} [padID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + padUsersCountUsingPOST: async (padID?: string, options: any = {}): Promise => { + const localVarPath = `/padUsersCount`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ApiKey required + await setApiKeyToObject(localVarQueryParameter, "apikey", configuration) + + if (padID !== undefined) { + localVarQueryParameter['padID'] = padID; + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary returns the list of users that are currently editing this pad + * @param {string} [padID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + padUsersUsingGET: async (padID?: string, options: any = {}): Promise => { + const localVarPath = `/padUsers`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ApiKey required + await setApiKeyToObject(localVarQueryParameter, "apikey", configuration) + + if (padID !== undefined) { + localVarQueryParameter['padID'] = padID; + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary returns the list of users that are currently editing this pad + * @param {string} [padID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + padUsersUsingPOST: async (padID?: string, options: any = {}): Promise => { + const localVarPath = `/padUsers`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ApiKey required + await setApiKeyToObject(localVarQueryParameter, "apikey", configuration) + + if (padID !== undefined) { + localVarQueryParameter['padID'] = padID; + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary sends a custom message of type msg to the pad + * @param {string} [padID] + * @param {string} [msg] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + sendClientsMessageUsingGET: async (padID?: string, msg?: string, options: any = {}): Promise => { + const localVarPath = `/sendClientsMessage`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ApiKey required + await setApiKeyToObject(localVarQueryParameter, "apikey", configuration) + + if (padID !== undefined) { + localVarQueryParameter['padID'] = padID; + } + + if (msg !== undefined) { + localVarQueryParameter['msg'] = msg; + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary sends a custom message of type msg to the pad + * @param {string} [padID] + * @param {string} [msg] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + sendClientsMessageUsingPOST: async (padID?: string, msg?: string, options: any = {}): Promise => { + const localVarPath = `/sendClientsMessage`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ApiKey required + await setApiKeyToObject(localVarQueryParameter, "apikey", configuration) + + if (padID !== undefined) { + localVarQueryParameter['padID'] = padID; + } + + if (msg !== undefined) { + localVarQueryParameter['msg'] = msg; + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary sets the text of a pad with HTML + * @param {string} [padID] + * @param {string} [html] + * @param {string} [authorId] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + setHTMLUsingGET: async (padID?: string, html?: string, authorId?: string, options: any = {}): Promise => { + const localVarPath = `/setHTML`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ApiKey required + await setApiKeyToObject(localVarQueryParameter, "apikey", configuration) + + if (padID !== undefined) { + localVarQueryParameter['padID'] = padID; + } + + if (html !== undefined) { + localVarQueryParameter['html'] = html; + } + + if (authorId !== undefined) { + localVarQueryParameter['authorId'] = authorId; + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary sets the text of a pad with HTML + * @param {string} [padID] + * @param {string} [html] + * @param {string} [authorId] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + setHTMLUsingPOST: async (padID?: string, html?: string, authorId?: string, options: any = {}): Promise => { + const localVarPath = `/setHTML`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ApiKey required + await setApiKeyToObject(localVarQueryParameter, "apikey", configuration) + + if (padID !== undefined) { + localVarQueryParameter['padID'] = padID; + } + + if (html !== undefined) { + localVarQueryParameter['html'] = html; + } + + if (authorId !== undefined) { + localVarQueryParameter['authorId'] = authorId; + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary sets a boolean for the public status of a pad + * @param {string} [padID] + * @param {string} [publicStatus] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + setPublicStatusUsingGET: async (padID?: string, publicStatus?: string, options: any = {}): Promise => { + const localVarPath = `/setPublicStatus`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ApiKey required + await setApiKeyToObject(localVarQueryParameter, "apikey", configuration) + + if (padID !== undefined) { + localVarQueryParameter['padID'] = padID; + } + + if (publicStatus !== undefined) { + localVarQueryParameter['publicStatus'] = publicStatus; + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary sets a boolean for the public status of a pad + * @param {string} [padID] + * @param {string} [publicStatus] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + setPublicStatusUsingPOST: async (padID?: string, publicStatus?: string, options: any = {}): Promise => { + const localVarPath = `/setPublicStatus`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ApiKey required + await setApiKeyToObject(localVarQueryParameter, "apikey", configuration) + + if (padID !== undefined) { + localVarQueryParameter['padID'] = padID; + } + + if (publicStatus !== undefined) { + localVarQueryParameter['publicStatus'] = publicStatus; + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary sets the text of a pad + * @param {string} [padID] + * @param {string} [text] + * @param {string} [authorId] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + setTextUsingGET: async (padID?: string, text?: string, authorId?: string, options: any = {}): Promise => { + const localVarPath = `/setText`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ApiKey required + await setApiKeyToObject(localVarQueryParameter, "apikey", configuration) + + if (padID !== undefined) { + localVarQueryParameter['padID'] = padID; + } + + if (text !== undefined) { + localVarQueryParameter['text'] = text; + } + + if (authorId !== undefined) { + localVarQueryParameter['authorId'] = authorId; + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary sets the text of a pad + * @param {string} [padID] + * @param {string} [text] + * @param {string} [authorId] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + setTextUsingPOST: async (padID?: string, text?: string, authorId?: string, options: any = {}): Promise => { + const localVarPath = `/setText`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ApiKey required + await setApiKeyToObject(localVarQueryParameter, "apikey", configuration) + + if (padID !== undefined) { + localVarQueryParameter['padID'] = padID; + } + + if (text !== undefined) { + localVarQueryParameter['text'] = text; + } + + if (authorId !== undefined) { + localVarQueryParameter['authorId'] = authorId; + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + } +}; + +/** + * PadApi - functional programming interface + * @export + */ +export const PadApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = PadApiAxiosParamCreator(configuration) + return { + /** + * + * @summary appends a chat message + * @param {string} [padID] + * @param {string} [text] + * @param {string} [authorID] + * @param {string} [time] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async appendChatMessageUsingGET(padID?: string, text?: string, authorID?: string, time?: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.appendChatMessageUsingGET(padID, text, authorID, time, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * + * @summary appends a chat message + * @param {string} [padID] + * @param {string} [text] + * @param {string} [authorID] + * @param {string} [time] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async appendChatMessageUsingPOST(padID?: string, text?: string, authorID?: string, time?: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.appendChatMessageUsingPOST(padID, text, authorID, time, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * + * @summary returns ok when the current api token is valid + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async checkTokenUsingGET(options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.checkTokenUsingGET(options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * + * @summary returns ok when the current api token is valid + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async checkTokenUsingPOST(options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.checkTokenUsingPOST(options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * + * @param {string} [padID] + * @param {string} [startRev] + * @param {string} [endRev] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async createDiffHTMLUsingGET(padID?: string, startRev?: string, endRev?: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.createDiffHTMLUsingGET(padID, startRev, endRev, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * + * @param {string} [padID] + * @param {string} [startRev] + * @param {string} [endRev] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async createDiffHTMLUsingPOST(padID?: string, startRev?: string, endRev?: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.createDiffHTMLUsingPOST(padID, startRev, endRev, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * creates a new (non-group) pad. Note that if you need to create a group Pad, you should call createGroupPad + * @param {string} [padID] + * @param {string} [text] + * @param {string} [authorId] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async createPadUsingGET(padID?: string, text?: string, authorId?: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.createPadUsingGET(padID, text, authorId, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * creates a new (non-group) pad. Note that if you need to create a group Pad, you should call createGroupPad + * @param {string} [padID] + * @param {string} [text] + * @param {string} [authorId] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async createPadUsingPOST(padID?: string, text?: string, authorId?: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.createPadUsingPOST(padID, text, authorId, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * + * @summary deletes a pad + * @param {string} [padID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async deletePadUsingGET(padID?: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.deletePadUsingGET(padID, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * + * @summary deletes a pad + * @param {string} [padID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async deletePadUsingPOST(padID?: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.deletePadUsingPOST(padID, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * + * @summary returns the chatHead (chat-message) of the pad + * @param {string} [padID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getChatHeadUsingGET(padID?: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getChatHeadUsingGET(padID, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * + * @summary returns the chatHead (chat-message) of the pad + * @param {string} [padID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getChatHeadUsingPOST(padID?: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getChatHeadUsingPOST(padID, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * + * @summary returns the chat history + * @param {string} [padID] + * @param {string} [start] + * @param {string} [end] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getChatHistoryUsingGET(padID?: string, start?: string, end?: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getChatHistoryUsingGET(padID, start, end, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * + * @summary returns the chat history + * @param {string} [padID] + * @param {string} [start] + * @param {string} [end] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getChatHistoryUsingPOST(padID?: string, start?: string, end?: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getChatHistoryUsingPOST(padID, start, end, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * + * @summary returns the text of a pad formatted as HTML + * @param {string} [padID] + * @param {string} [rev] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getHTMLUsingGET(padID?: string, rev?: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getHTMLUsingGET(padID, rev, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * + * @summary returns the text of a pad formatted as HTML + * @param {string} [padID] + * @param {string} [rev] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getHTMLUsingPOST(padID?: string, rev?: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getHTMLUsingPOST(padID, rev, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * + * @summary returns the timestamp of the last revision of the pad + * @param {string} [padID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getLastEditedUsingGET(padID?: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getLastEditedUsingGET(padID, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * + * @summary returns the timestamp of the last revision of the pad + * @param {string} [padID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getLastEditedUsingPOST(padID?: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getLastEditedUsingPOST(padID, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * + * @summary return true of false + * @param {string} [padID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getPublicStatusUsingGET(padID?: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getPublicStatusUsingGET(padID, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * + * @summary return true of false + * @param {string} [padID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getPublicStatusUsingPOST(padID?: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getPublicStatusUsingPOST(padID, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * + * @summary returns the read only link of a pad + * @param {string} [padID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getReadOnlyIDUsingGET(padID?: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getReadOnlyIDUsingGET(padID, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * + * @summary returns the read only link of a pad + * @param {string} [padID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getReadOnlyIDUsingPOST(padID?: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getReadOnlyIDUsingPOST(padID, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * + * @summary returns the number of revisions of this pad + * @param {string} [padID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getRevisionsCountUsingGET(padID?: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getRevisionsCountUsingGET(padID, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * + * @summary returns the number of revisions of this pad + * @param {string} [padID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getRevisionsCountUsingPOST(padID?: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getRevisionsCountUsingPOST(padID, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * + * @summary returns the text of a pad + * @param {string} [padID] + * @param {string} [rev] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getTextUsingGET(padID?: string, rev?: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getTextUsingGET(padID, rev, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * + * @summary returns the text of a pad + * @param {string} [padID] + * @param {string} [rev] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getTextUsingPOST(padID?: string, rev?: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getTextUsingPOST(padID, rev, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * + * @summary list all the pads + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async listAllPadsUsingGET(options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.listAllPadsUsingGET(options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * + * @summary list all the pads + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async listAllPadsUsingPOST(options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.listAllPadsUsingPOST(options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * + * @summary returns an array of authors who contributed to this pad + * @param {string} [padID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async listAuthorsOfPadUsingGET(padID?: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.listAuthorsOfPadUsingGET(padID, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * + * @summary returns an array of authors who contributed to this pad + * @param {string} [padID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async listAuthorsOfPadUsingPOST(padID?: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.listAuthorsOfPadUsingPOST(padID, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * + * @summary returns the number of user that are currently editing this pad + * @param {string} [padID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async padUsersCountUsingGET(padID?: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.padUsersCountUsingGET(padID, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * + * @summary returns the number of user that are currently editing this pad + * @param {string} [padID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async padUsersCountUsingPOST(padID?: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.padUsersCountUsingPOST(padID, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * + * @summary returns the list of users that are currently editing this pad + * @param {string} [padID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async padUsersUsingGET(padID?: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.padUsersUsingGET(padID, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * + * @summary returns the list of users that are currently editing this pad + * @param {string} [padID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async padUsersUsingPOST(padID?: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.padUsersUsingPOST(padID, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * + * @summary sends a custom message of type msg to the pad + * @param {string} [padID] + * @param {string} [msg] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async sendClientsMessageUsingGET(padID?: string, msg?: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.sendClientsMessageUsingGET(padID, msg, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * + * @summary sends a custom message of type msg to the pad + * @param {string} [padID] + * @param {string} [msg] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async sendClientsMessageUsingPOST(padID?: string, msg?: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.sendClientsMessageUsingPOST(padID, msg, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * + * @summary sets the text of a pad with HTML + * @param {string} [padID] + * @param {string} [html] + * @param {string} [authorId] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async setHTMLUsingGET(padID?: string, html?: string, authorId?: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.setHTMLUsingGET(padID, html, authorId, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * + * @summary sets the text of a pad with HTML + * @param {string} [padID] + * @param {string} [html] + * @param {string} [authorId] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async setHTMLUsingPOST(padID?: string, html?: string, authorId?: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.setHTMLUsingPOST(padID, html, authorId, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * + * @summary sets a boolean for the public status of a pad + * @param {string} [padID] + * @param {string} [publicStatus] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async setPublicStatusUsingGET(padID?: string, publicStatus?: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.setPublicStatusUsingGET(padID, publicStatus, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * + * @summary sets a boolean for the public status of a pad + * @param {string} [padID] + * @param {string} [publicStatus] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async setPublicStatusUsingPOST(padID?: string, publicStatus?: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.setPublicStatusUsingPOST(padID, publicStatus, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * + * @summary sets the text of a pad + * @param {string} [padID] + * @param {string} [text] + * @param {string} [authorId] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async setTextUsingGET(padID?: string, text?: string, authorId?: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.setTextUsingGET(padID, text, authorId, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * + * @summary sets the text of a pad + * @param {string} [padID] + * @param {string} [text] + * @param {string} [authorId] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async setTextUsingPOST(padID?: string, text?: string, authorId?: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.setTextUsingPOST(padID, text, authorId, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + } +}; + +/** + * PadApi - factory interface + * @export + */ +export const PadApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = PadApiFp(configuration) + return { + /** + * + * @summary appends a chat message + * @param {string} [padID] + * @param {string} [text] + * @param {string} [authorID] + * @param {string} [time] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + appendChatMessageUsingGET(padID?: string, text?: string, authorID?: string, time?: string, options?: any): AxiosPromise { + return localVarFp.appendChatMessageUsingGET(padID, text, authorID, time, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary appends a chat message + * @param {string} [padID] + * @param {string} [text] + * @param {string} [authorID] + * @param {string} [time] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + appendChatMessageUsingPOST(padID?: string, text?: string, authorID?: string, time?: string, options?: any): AxiosPromise { + return localVarFp.appendChatMessageUsingPOST(padID, text, authorID, time, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary returns ok when the current api token is valid + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + checkTokenUsingGET(options?: any): AxiosPromise { + return localVarFp.checkTokenUsingGET(options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary returns ok when the current api token is valid + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + checkTokenUsingPOST(options?: any): AxiosPromise { + return localVarFp.checkTokenUsingPOST(options).then((request) => request(axios, basePath)); + }, + /** + * + * @param {string} [padID] + * @param {string} [startRev] + * @param {string} [endRev] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createDiffHTMLUsingGET(padID?: string, startRev?: string, endRev?: string, options?: any): AxiosPromise { + return localVarFp.createDiffHTMLUsingGET(padID, startRev, endRev, options).then((request) => request(axios, basePath)); + }, + /** + * + * @param {string} [padID] + * @param {string} [startRev] + * @param {string} [endRev] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createDiffHTMLUsingPOST(padID?: string, startRev?: string, endRev?: string, options?: any): AxiosPromise { + return localVarFp.createDiffHTMLUsingPOST(padID, startRev, endRev, options).then((request) => request(axios, basePath)); + }, + /** + * creates a new (non-group) pad. Note that if you need to create a group Pad, you should call createGroupPad + * @param {string} [padID] + * @param {string} [text] + * @param {string} [authorId] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createPadUsingGET(padID?: string, text?: string, authorId?: string, options?: any): AxiosPromise { + return localVarFp.createPadUsingGET(padID, text, authorId, options).then((request) => request(axios, basePath)); + }, + /** + * creates a new (non-group) pad. Note that if you need to create a group Pad, you should call createGroupPad + * @param {string} [padID] + * @param {string} [text] + * @param {string} [authorId] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createPadUsingPOST(padID?: string, text?: string, authorId?: string, options?: any): AxiosPromise { + return localVarFp.createPadUsingPOST(padID, text, authorId, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary deletes a pad + * @param {string} [padID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deletePadUsingGET(padID?: string, options?: any): AxiosPromise { + return localVarFp.deletePadUsingGET(padID, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary deletes a pad + * @param {string} [padID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deletePadUsingPOST(padID?: string, options?: any): AxiosPromise { + return localVarFp.deletePadUsingPOST(padID, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary returns the chatHead (chat-message) of the pad + * @param {string} [padID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getChatHeadUsingGET(padID?: string, options?: any): AxiosPromise { + return localVarFp.getChatHeadUsingGET(padID, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary returns the chatHead (chat-message) of the pad + * @param {string} [padID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getChatHeadUsingPOST(padID?: string, options?: any): AxiosPromise { + return localVarFp.getChatHeadUsingPOST(padID, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary returns the chat history + * @param {string} [padID] + * @param {string} [start] + * @param {string} [end] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getChatHistoryUsingGET(padID?: string, start?: string, end?: string, options?: any): AxiosPromise { + return localVarFp.getChatHistoryUsingGET(padID, start, end, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary returns the chat history + * @param {string} [padID] + * @param {string} [start] + * @param {string} [end] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getChatHistoryUsingPOST(padID?: string, start?: string, end?: string, options?: any): AxiosPromise { + return localVarFp.getChatHistoryUsingPOST(padID, start, end, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary returns the text of a pad formatted as HTML + * @param {string} [padID] + * @param {string} [rev] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getHTMLUsingGET(padID?: string, rev?: string, options?: any): AxiosPromise { + return localVarFp.getHTMLUsingGET(padID, rev, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary returns the text of a pad formatted as HTML + * @param {string} [padID] + * @param {string} [rev] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getHTMLUsingPOST(padID?: string, rev?: string, options?: any): AxiosPromise { + return localVarFp.getHTMLUsingPOST(padID, rev, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary returns the timestamp of the last revision of the pad + * @param {string} [padID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getLastEditedUsingGET(padID?: string, options?: any): AxiosPromise { + return localVarFp.getLastEditedUsingGET(padID, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary returns the timestamp of the last revision of the pad + * @param {string} [padID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getLastEditedUsingPOST(padID?: string, options?: any): AxiosPromise { + return localVarFp.getLastEditedUsingPOST(padID, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary return true of false + * @param {string} [padID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getPublicStatusUsingGET(padID?: string, options?: any): AxiosPromise { + return localVarFp.getPublicStatusUsingGET(padID, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary return true of false + * @param {string} [padID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getPublicStatusUsingPOST(padID?: string, options?: any): AxiosPromise { + return localVarFp.getPublicStatusUsingPOST(padID, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary returns the read only link of a pad + * @param {string} [padID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getReadOnlyIDUsingGET(padID?: string, options?: any): AxiosPromise { + return localVarFp.getReadOnlyIDUsingGET(padID, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary returns the read only link of a pad + * @param {string} [padID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getReadOnlyIDUsingPOST(padID?: string, options?: any): AxiosPromise { + return localVarFp.getReadOnlyIDUsingPOST(padID, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary returns the number of revisions of this pad + * @param {string} [padID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getRevisionsCountUsingGET(padID?: string, options?: any): AxiosPromise { + return localVarFp.getRevisionsCountUsingGET(padID, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary returns the number of revisions of this pad + * @param {string} [padID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getRevisionsCountUsingPOST(padID?: string, options?: any): AxiosPromise { + return localVarFp.getRevisionsCountUsingPOST(padID, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary returns the text of a pad + * @param {string} [padID] + * @param {string} [rev] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getTextUsingGET(padID?: string, rev?: string, options?: any): AxiosPromise { + return localVarFp.getTextUsingGET(padID, rev, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary returns the text of a pad + * @param {string} [padID] + * @param {string} [rev] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getTextUsingPOST(padID?: string, rev?: string, options?: any): AxiosPromise { + return localVarFp.getTextUsingPOST(padID, rev, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary list all the pads + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listAllPadsUsingGET(options?: any): AxiosPromise { + return localVarFp.listAllPadsUsingGET(options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary list all the pads + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listAllPadsUsingPOST(options?: any): AxiosPromise { + return localVarFp.listAllPadsUsingPOST(options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary returns an array of authors who contributed to this pad + * @param {string} [padID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listAuthorsOfPadUsingGET(padID?: string, options?: any): AxiosPromise { + return localVarFp.listAuthorsOfPadUsingGET(padID, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary returns an array of authors who contributed to this pad + * @param {string} [padID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listAuthorsOfPadUsingPOST(padID?: string, options?: any): AxiosPromise { + return localVarFp.listAuthorsOfPadUsingPOST(padID, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary returns the number of user that are currently editing this pad + * @param {string} [padID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + padUsersCountUsingGET(padID?: string, options?: any): AxiosPromise { + return localVarFp.padUsersCountUsingGET(padID, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary returns the number of user that are currently editing this pad + * @param {string} [padID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + padUsersCountUsingPOST(padID?: string, options?: any): AxiosPromise { + return localVarFp.padUsersCountUsingPOST(padID, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary returns the list of users that are currently editing this pad + * @param {string} [padID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + padUsersUsingGET(padID?: string, options?: any): AxiosPromise { + return localVarFp.padUsersUsingGET(padID, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary returns the list of users that are currently editing this pad + * @param {string} [padID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + padUsersUsingPOST(padID?: string, options?: any): AxiosPromise { + return localVarFp.padUsersUsingPOST(padID, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary sends a custom message of type msg to the pad + * @param {string} [padID] + * @param {string} [msg] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + sendClientsMessageUsingGET(padID?: string, msg?: string, options?: any): AxiosPromise { + return localVarFp.sendClientsMessageUsingGET(padID, msg, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary sends a custom message of type msg to the pad + * @param {string} [padID] + * @param {string} [msg] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + sendClientsMessageUsingPOST(padID?: string, msg?: string, options?: any): AxiosPromise { + return localVarFp.sendClientsMessageUsingPOST(padID, msg, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary sets the text of a pad with HTML + * @param {string} [padID] + * @param {string} [html] + * @param {string} [authorId] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + setHTMLUsingGET(padID?: string, html?: string, authorId?: string, options?: any): AxiosPromise { + return localVarFp.setHTMLUsingGET(padID, html, authorId, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary sets the text of a pad with HTML + * @param {string} [padID] + * @param {string} [html] + * @param {string} [authorId] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + setHTMLUsingPOST(padID?: string, html?: string, authorId?: string, options?: any): AxiosPromise { + return localVarFp.setHTMLUsingPOST(padID, html, authorId, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary sets a boolean for the public status of a pad + * @param {string} [padID] + * @param {string} [publicStatus] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + setPublicStatusUsingGET(padID?: string, publicStatus?: string, options?: any): AxiosPromise { + return localVarFp.setPublicStatusUsingGET(padID, publicStatus, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary sets a boolean for the public status of a pad + * @param {string} [padID] + * @param {string} [publicStatus] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + setPublicStatusUsingPOST(padID?: string, publicStatus?: string, options?: any): AxiosPromise { + return localVarFp.setPublicStatusUsingPOST(padID, publicStatus, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary sets the text of a pad + * @param {string} [padID] + * @param {string} [text] + * @param {string} [authorId] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + setTextUsingGET(padID?: string, text?: string, authorId?: string, options?: any): AxiosPromise { + return localVarFp.setTextUsingGET(padID, text, authorId, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary sets the text of a pad + * @param {string} [padID] + * @param {string} [text] + * @param {string} [authorId] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + setTextUsingPOST(padID?: string, text?: string, authorId?: string, options?: any): AxiosPromise { + return localVarFp.setTextUsingPOST(padID, text, authorId, options).then((request) => request(axios, basePath)); + }, + }; +}; + +/** + * PadApi - interface + * @export + * @interface PadApi + */ +export interface PadApiInterface { + /** + * + * @summary appends a chat message + * @param {string} [padID] + * @param {string} [text] + * @param {string} [authorID] + * @param {string} [time] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PadApiInterface + */ + appendChatMessageUsingGET(padID?: string, text?: string, authorID?: string, time?: string, options?: any): AxiosPromise; + + /** + * + * @summary appends a chat message + * @param {string} [padID] + * @param {string} [text] + * @param {string} [authorID] + * @param {string} [time] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PadApiInterface + */ + appendChatMessageUsingPOST(padID?: string, text?: string, authorID?: string, time?: string, options?: any): AxiosPromise; + + /** + * + * @summary returns ok when the current api token is valid + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PadApiInterface + */ + checkTokenUsingGET(options?: any): AxiosPromise; + + /** + * + * @summary returns ok when the current api token is valid + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PadApiInterface + */ + checkTokenUsingPOST(options?: any): AxiosPromise; + + /** + * + * @param {string} [padID] + * @param {string} [startRev] + * @param {string} [endRev] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PadApiInterface + */ + createDiffHTMLUsingGET(padID?: string, startRev?: string, endRev?: string, options?: any): AxiosPromise; + + /** + * + * @param {string} [padID] + * @param {string} [startRev] + * @param {string} [endRev] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PadApiInterface + */ + createDiffHTMLUsingPOST(padID?: string, startRev?: string, endRev?: string, options?: any): AxiosPromise; + + /** + * creates a new (non-group) pad. Note that if you need to create a group Pad, you should call createGroupPad + * @param {string} [padID] + * @param {string} [text] + * @param {string} [authorId] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PadApiInterface + */ + createPadUsingGET(padID?: string, text?: string, authorId?: string, options?: any): AxiosPromise; + + /** + * creates a new (non-group) pad. Note that if you need to create a group Pad, you should call createGroupPad + * @param {string} [padID] + * @param {string} [text] + * @param {string} [authorId] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PadApiInterface + */ + createPadUsingPOST(padID?: string, text?: string, authorId?: string, options?: any): AxiosPromise; + + /** + * + * @summary deletes a pad + * @param {string} [padID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PadApiInterface + */ + deletePadUsingGET(padID?: string, options?: any): AxiosPromise; + + /** + * + * @summary deletes a pad + * @param {string} [padID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PadApiInterface + */ + deletePadUsingPOST(padID?: string, options?: any): AxiosPromise; + + /** + * + * @summary returns the chatHead (chat-message) of the pad + * @param {string} [padID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PadApiInterface + */ + getChatHeadUsingGET(padID?: string, options?: any): AxiosPromise; + + /** + * + * @summary returns the chatHead (chat-message) of the pad + * @param {string} [padID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PadApiInterface + */ + getChatHeadUsingPOST(padID?: string, options?: any): AxiosPromise; + + /** + * + * @summary returns the chat history + * @param {string} [padID] + * @param {string} [start] + * @param {string} [end] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PadApiInterface + */ + getChatHistoryUsingGET(padID?: string, start?: string, end?: string, options?: any): AxiosPromise; + + /** + * + * @summary returns the chat history + * @param {string} [padID] + * @param {string} [start] + * @param {string} [end] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PadApiInterface + */ + getChatHistoryUsingPOST(padID?: string, start?: string, end?: string, options?: any): AxiosPromise; + + /** + * + * @summary returns the text of a pad formatted as HTML + * @param {string} [padID] + * @param {string} [rev] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PadApiInterface + */ + getHTMLUsingGET(padID?: string, rev?: string, options?: any): AxiosPromise; + + /** + * + * @summary returns the text of a pad formatted as HTML + * @param {string} [padID] + * @param {string} [rev] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PadApiInterface + */ + getHTMLUsingPOST(padID?: string, rev?: string, options?: any): AxiosPromise; + + /** + * + * @summary returns the timestamp of the last revision of the pad + * @param {string} [padID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PadApiInterface + */ + getLastEditedUsingGET(padID?: string, options?: any): AxiosPromise; + + /** + * + * @summary returns the timestamp of the last revision of the pad + * @param {string} [padID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PadApiInterface + */ + getLastEditedUsingPOST(padID?: string, options?: any): AxiosPromise; + + /** + * + * @summary return true of false + * @param {string} [padID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PadApiInterface + */ + getPublicStatusUsingGET(padID?: string, options?: any): AxiosPromise; + + /** + * + * @summary return true of false + * @param {string} [padID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PadApiInterface + */ + getPublicStatusUsingPOST(padID?: string, options?: any): AxiosPromise; + + /** + * + * @summary returns the read only link of a pad + * @param {string} [padID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PadApiInterface + */ + getReadOnlyIDUsingGET(padID?: string, options?: any): AxiosPromise; + + /** + * + * @summary returns the read only link of a pad + * @param {string} [padID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PadApiInterface + */ + getReadOnlyIDUsingPOST(padID?: string, options?: any): AxiosPromise; + + /** + * + * @summary returns the number of revisions of this pad + * @param {string} [padID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PadApiInterface + */ + getRevisionsCountUsingGET(padID?: string, options?: any): AxiosPromise; + + /** + * + * @summary returns the number of revisions of this pad + * @param {string} [padID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PadApiInterface + */ + getRevisionsCountUsingPOST(padID?: string, options?: any): AxiosPromise; + + /** + * + * @summary returns the text of a pad + * @param {string} [padID] + * @param {string} [rev] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PadApiInterface + */ + getTextUsingGET(padID?: string, rev?: string, options?: any): AxiosPromise; + + /** + * + * @summary returns the text of a pad + * @param {string} [padID] + * @param {string} [rev] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PadApiInterface + */ + getTextUsingPOST(padID?: string, rev?: string, options?: any): AxiosPromise; + + /** + * + * @summary list all the pads + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PadApiInterface + */ + listAllPadsUsingGET(options?: any): AxiosPromise; + + /** + * + * @summary list all the pads + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PadApiInterface + */ + listAllPadsUsingPOST(options?: any): AxiosPromise; + + /** + * + * @summary returns an array of authors who contributed to this pad + * @param {string} [padID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PadApiInterface + */ + listAuthorsOfPadUsingGET(padID?: string, options?: any): AxiosPromise; + + /** + * + * @summary returns an array of authors who contributed to this pad + * @param {string} [padID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PadApiInterface + */ + listAuthorsOfPadUsingPOST(padID?: string, options?: any): AxiosPromise; + + /** + * + * @summary returns the number of user that are currently editing this pad + * @param {string} [padID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PadApiInterface + */ + padUsersCountUsingGET(padID?: string, options?: any): AxiosPromise; + + /** + * + * @summary returns the number of user that are currently editing this pad + * @param {string} [padID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PadApiInterface + */ + padUsersCountUsingPOST(padID?: string, options?: any): AxiosPromise; + + /** + * + * @summary returns the list of users that are currently editing this pad + * @param {string} [padID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PadApiInterface + */ + padUsersUsingGET(padID?: string, options?: any): AxiosPromise; + + /** + * + * @summary returns the list of users that are currently editing this pad + * @param {string} [padID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PadApiInterface + */ + padUsersUsingPOST(padID?: string, options?: any): AxiosPromise; + + /** + * + * @summary sends a custom message of type msg to the pad + * @param {string} [padID] + * @param {string} [msg] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PadApiInterface + */ + sendClientsMessageUsingGET(padID?: string, msg?: string, options?: any): AxiosPromise; + + /** + * + * @summary sends a custom message of type msg to the pad + * @param {string} [padID] + * @param {string} [msg] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PadApiInterface + */ + sendClientsMessageUsingPOST(padID?: string, msg?: string, options?: any): AxiosPromise; + + /** + * + * @summary sets the text of a pad with HTML + * @param {string} [padID] + * @param {string} [html] + * @param {string} [authorId] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PadApiInterface + */ + setHTMLUsingGET(padID?: string, html?: string, authorId?: string, options?: any): AxiosPromise; + + /** + * + * @summary sets the text of a pad with HTML + * @param {string} [padID] + * @param {string} [html] + * @param {string} [authorId] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PadApiInterface + */ + setHTMLUsingPOST(padID?: string, html?: string, authorId?: string, options?: any): AxiosPromise; + + /** + * + * @summary sets a boolean for the public status of a pad + * @param {string} [padID] + * @param {string} [publicStatus] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PadApiInterface + */ + setPublicStatusUsingGET(padID?: string, publicStatus?: string, options?: any): AxiosPromise; + + /** + * + * @summary sets a boolean for the public status of a pad + * @param {string} [padID] + * @param {string} [publicStatus] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PadApiInterface + */ + setPublicStatusUsingPOST(padID?: string, publicStatus?: string, options?: any): AxiosPromise; + + /** + * + * @summary sets the text of a pad + * @param {string} [padID] + * @param {string} [text] + * @param {string} [authorId] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PadApiInterface + */ + setTextUsingGET(padID?: string, text?: string, authorId?: string, options?: any): AxiosPromise; + + /** + * + * @summary sets the text of a pad + * @param {string} [padID] + * @param {string} [text] + * @param {string} [authorId] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PadApiInterface + */ + setTextUsingPOST(padID?: string, text?: string, authorId?: string, options?: any): AxiosPromise; + +} + +/** + * PadApi - object-oriented interface + * @export + * @class PadApi + * @extends {BaseAPI} + */ +export class PadApi extends BaseAPI implements PadApiInterface { + /** + * + * @summary appends a chat message + * @param {string} [padID] + * @param {string} [text] + * @param {string} [authorID] + * @param {string} [time] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PadApi + */ + public appendChatMessageUsingGET(padID?: string, text?: string, authorID?: string, time?: string, options?: any) { + return PadApiFp(this.configuration).appendChatMessageUsingGET(padID, text, authorID, time, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary appends a chat message + * @param {string} [padID] + * @param {string} [text] + * @param {string} [authorID] + * @param {string} [time] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PadApi + */ + public appendChatMessageUsingPOST(padID?: string, text?: string, authorID?: string, time?: string, options?: any) { + return PadApiFp(this.configuration).appendChatMessageUsingPOST(padID, text, authorID, time, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary returns ok when the current api token is valid + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PadApi + */ + public checkTokenUsingGET(options?: any) { + return PadApiFp(this.configuration).checkTokenUsingGET(options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary returns ok when the current api token is valid + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PadApi + */ + public checkTokenUsingPOST(options?: any) { + return PadApiFp(this.configuration).checkTokenUsingPOST(options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @param {string} [padID] + * @param {string} [startRev] + * @param {string} [endRev] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PadApi + */ + public createDiffHTMLUsingGET(padID?: string, startRev?: string, endRev?: string, options?: any) { + return PadApiFp(this.configuration).createDiffHTMLUsingGET(padID, startRev, endRev, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @param {string} [padID] + * @param {string} [startRev] + * @param {string} [endRev] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PadApi + */ + public createDiffHTMLUsingPOST(padID?: string, startRev?: string, endRev?: string, options?: any) { + return PadApiFp(this.configuration).createDiffHTMLUsingPOST(padID, startRev, endRev, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * creates a new (non-group) pad. Note that if you need to create a group Pad, you should call createGroupPad + * @param {string} [padID] + * @param {string} [text] + * @param {string} [authorId] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PadApi + */ + public createPadUsingGET(padID?: string, text?: string, authorId?: string, options?: any) { + return PadApiFp(this.configuration).createPadUsingGET(padID, text, authorId, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * creates a new (non-group) pad. Note that if you need to create a group Pad, you should call createGroupPad + * @param {string} [padID] + * @param {string} [text] + * @param {string} [authorId] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PadApi + */ + public createPadUsingPOST(padID?: string, text?: string, authorId?: string, options?: any) { + return PadApiFp(this.configuration).createPadUsingPOST(padID, text, authorId, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary deletes a pad + * @param {string} [padID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PadApi + */ + public deletePadUsingGET(padID?: string, options?: any) { + return PadApiFp(this.configuration).deletePadUsingGET(padID, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary deletes a pad + * @param {string} [padID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PadApi + */ + public deletePadUsingPOST(padID?: string, options?: any) { + return PadApiFp(this.configuration).deletePadUsingPOST(padID, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary returns the chatHead (chat-message) of the pad + * @param {string} [padID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PadApi + */ + public getChatHeadUsingGET(padID?: string, options?: any) { + return PadApiFp(this.configuration).getChatHeadUsingGET(padID, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary returns the chatHead (chat-message) of the pad + * @param {string} [padID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PadApi + */ + public getChatHeadUsingPOST(padID?: string, options?: any) { + return PadApiFp(this.configuration).getChatHeadUsingPOST(padID, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary returns the chat history + * @param {string} [padID] + * @param {string} [start] + * @param {string} [end] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PadApi + */ + public getChatHistoryUsingGET(padID?: string, start?: string, end?: string, options?: any) { + return PadApiFp(this.configuration).getChatHistoryUsingGET(padID, start, end, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary returns the chat history + * @param {string} [padID] + * @param {string} [start] + * @param {string} [end] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PadApi + */ + public getChatHistoryUsingPOST(padID?: string, start?: string, end?: string, options?: any) { + return PadApiFp(this.configuration).getChatHistoryUsingPOST(padID, start, end, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary returns the text of a pad formatted as HTML + * @param {string} [padID] + * @param {string} [rev] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PadApi + */ + public getHTMLUsingGET(padID?: string, rev?: string, options?: any) { + return PadApiFp(this.configuration).getHTMLUsingGET(padID, rev, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary returns the text of a pad formatted as HTML + * @param {string} [padID] + * @param {string} [rev] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PadApi + */ + public getHTMLUsingPOST(padID?: string, rev?: string, options?: any) { + return PadApiFp(this.configuration).getHTMLUsingPOST(padID, rev, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary returns the timestamp of the last revision of the pad + * @param {string} [padID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PadApi + */ + public getLastEditedUsingGET(padID?: string, options?: any) { + return PadApiFp(this.configuration).getLastEditedUsingGET(padID, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary returns the timestamp of the last revision of the pad + * @param {string} [padID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PadApi + */ + public getLastEditedUsingPOST(padID?: string, options?: any) { + return PadApiFp(this.configuration).getLastEditedUsingPOST(padID, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary return true of false + * @param {string} [padID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PadApi + */ + public getPublicStatusUsingGET(padID?: string, options?: any) { + return PadApiFp(this.configuration).getPublicStatusUsingGET(padID, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary return true of false + * @param {string} [padID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PadApi + */ + public getPublicStatusUsingPOST(padID?: string, options?: any) { + return PadApiFp(this.configuration).getPublicStatusUsingPOST(padID, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary returns the read only link of a pad + * @param {string} [padID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PadApi + */ + public getReadOnlyIDUsingGET(padID?: string, options?: any) { + return PadApiFp(this.configuration).getReadOnlyIDUsingGET(padID, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary returns the read only link of a pad + * @param {string} [padID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PadApi + */ + public getReadOnlyIDUsingPOST(padID?: string, options?: any) { + return PadApiFp(this.configuration).getReadOnlyIDUsingPOST(padID, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary returns the number of revisions of this pad + * @param {string} [padID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PadApi + */ + public getRevisionsCountUsingGET(padID?: string, options?: any) { + return PadApiFp(this.configuration).getRevisionsCountUsingGET(padID, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary returns the number of revisions of this pad + * @param {string} [padID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PadApi + */ + public getRevisionsCountUsingPOST(padID?: string, options?: any) { + return PadApiFp(this.configuration).getRevisionsCountUsingPOST(padID, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary returns the text of a pad + * @param {string} [padID] + * @param {string} [rev] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PadApi + */ + public getTextUsingGET(padID?: string, rev?: string, options?: any) { + return PadApiFp(this.configuration).getTextUsingGET(padID, rev, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary returns the text of a pad + * @param {string} [padID] + * @param {string} [rev] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PadApi + */ + public getTextUsingPOST(padID?: string, rev?: string, options?: any) { + return PadApiFp(this.configuration).getTextUsingPOST(padID, rev, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary list all the pads + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PadApi + */ + public listAllPadsUsingGET(options?: any) { + return PadApiFp(this.configuration).listAllPadsUsingGET(options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary list all the pads + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PadApi + */ + public listAllPadsUsingPOST(options?: any) { + return PadApiFp(this.configuration).listAllPadsUsingPOST(options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary returns an array of authors who contributed to this pad + * @param {string} [padID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PadApi + */ + public listAuthorsOfPadUsingGET(padID?: string, options?: any) { + return PadApiFp(this.configuration).listAuthorsOfPadUsingGET(padID, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary returns an array of authors who contributed to this pad + * @param {string} [padID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PadApi + */ + public listAuthorsOfPadUsingPOST(padID?: string, options?: any) { + return PadApiFp(this.configuration).listAuthorsOfPadUsingPOST(padID, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary returns the number of user that are currently editing this pad + * @param {string} [padID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PadApi + */ + public padUsersCountUsingGET(padID?: string, options?: any) { + return PadApiFp(this.configuration).padUsersCountUsingGET(padID, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary returns the number of user that are currently editing this pad + * @param {string} [padID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PadApi + */ + public padUsersCountUsingPOST(padID?: string, options?: any) { + return PadApiFp(this.configuration).padUsersCountUsingPOST(padID, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary returns the list of users that are currently editing this pad + * @param {string} [padID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PadApi + */ + public padUsersUsingGET(padID?: string, options?: any) { + return PadApiFp(this.configuration).padUsersUsingGET(padID, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary returns the list of users that are currently editing this pad + * @param {string} [padID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PadApi + */ + public padUsersUsingPOST(padID?: string, options?: any) { + return PadApiFp(this.configuration).padUsersUsingPOST(padID, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary sends a custom message of type msg to the pad + * @param {string} [padID] + * @param {string} [msg] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PadApi + */ + public sendClientsMessageUsingGET(padID?: string, msg?: string, options?: any) { + return PadApiFp(this.configuration).sendClientsMessageUsingGET(padID, msg, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary sends a custom message of type msg to the pad + * @param {string} [padID] + * @param {string} [msg] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PadApi + */ + public sendClientsMessageUsingPOST(padID?: string, msg?: string, options?: any) { + return PadApiFp(this.configuration).sendClientsMessageUsingPOST(padID, msg, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary sets the text of a pad with HTML + * @param {string} [padID] + * @param {string} [html] + * @param {string} [authorId] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PadApi + */ + public setHTMLUsingGET(padID?: string, html?: string, authorId?: string, options?: any) { + return PadApiFp(this.configuration).setHTMLUsingGET(padID, html, authorId, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary sets the text of a pad with HTML + * @param {string} [padID] + * @param {string} [html] + * @param {string} [authorId] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PadApi + */ + public setHTMLUsingPOST(padID?: string, html?: string, authorId?: string, options?: any) { + return PadApiFp(this.configuration).setHTMLUsingPOST(padID, html, authorId, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary sets a boolean for the public status of a pad + * @param {string} [padID] + * @param {string} [publicStatus] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PadApi + */ + public setPublicStatusUsingGET(padID?: string, publicStatus?: string, options?: any) { + return PadApiFp(this.configuration).setPublicStatusUsingGET(padID, publicStatus, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary sets a boolean for the public status of a pad + * @param {string} [padID] + * @param {string} [publicStatus] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PadApi + */ + public setPublicStatusUsingPOST(padID?: string, publicStatus?: string, options?: any) { + return PadApiFp(this.configuration).setPublicStatusUsingPOST(padID, publicStatus, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary sets the text of a pad + * @param {string} [padID] + * @param {string} [text] + * @param {string} [authorId] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PadApi + */ + public setTextUsingGET(padID?: string, text?: string, authorId?: string, options?: any) { + return PadApiFp(this.configuration).setTextUsingGET(padID, text, authorId, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary sets the text of a pad + * @param {string} [padID] + * @param {string} [text] + * @param {string} [authorId] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PadApi + */ + public setTextUsingPOST(padID?: string, text?: string, authorId?: string, options?: any) { + return PadApiFp(this.configuration).setTextUsingPOST(padID, text, authorId, options).then((request) => request(this.axios, this.basePath)); + } +} diff --git a/apps/server/src/infra/etherpad-client/etherpad-api-client/api/session-api.ts b/apps/server/src/infra/etherpad-client/etherpad-api-client/api/session-api.ts new file mode 100644 index 00000000000..e43546095ce --- /dev/null +++ b/apps/server/src/infra/etherpad-client/etherpad-api-client/api/session-api.ts @@ -0,0 +1,600 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Etherpad API + * Etherpad is a real-time collaborative editor scalable to thousands of simultaneous real time users. It provides full data export capabilities, and runs on your server, under your control. + * + * The version of the OpenAPI document: 1.3.0 + * Contact: support@example.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import globalAxios, { AxiosPromise, AxiosInstance } from 'axios'; +import { Configuration } from '../configuration'; +// Some imports not used depending on template conditions +// @ts-ignore +import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base'; +// @ts-ignore +import { InlineResponse2001 } from '../models'; +// @ts-ignore +import { InlineResponse2004 } from '../models'; +// @ts-ignore +import { InlineResponse2005 } from '../models'; +// @ts-ignore +import { InlineResponse400 } from '../models'; +// @ts-ignore +import { InlineResponse401 } from '../models'; +// @ts-ignore +import { InlineResponse500 } from '../models'; +/** + * SessionApi - axios parameter creator + * @export + */ +export const SessionApiAxiosParamCreator = function (configuration?: Configuration) { + return { + /** + * + * @summary creates a new session. validUntil is an unix timestamp in seconds + * @param {string} [groupID] + * @param {string} [authorID] + * @param {string} [validUntil] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createSessionUsingGET: async (groupID?: string, authorID?: string, validUntil?: string, options: any = {}): Promise => { + const localVarPath = `/createSession`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ApiKey required + await setApiKeyToObject(localVarQueryParameter, "apikey", configuration) + + if (groupID !== undefined) { + localVarQueryParameter['groupID'] = groupID; + } + + if (authorID !== undefined) { + localVarQueryParameter['authorID'] = authorID; + } + + if (validUntil !== undefined) { + localVarQueryParameter['validUntil'] = validUntil; + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary creates a new session. validUntil is an unix timestamp in seconds + * @param {string} [groupID] + * @param {string} [authorID] + * @param {string} [validUntil] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createSessionUsingPOST: async (groupID?: string, authorID?: string, validUntil?: string, options: any = {}): Promise => { + const localVarPath = `/createSession`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ApiKey required + await setApiKeyToObject(localVarQueryParameter, "apikey", configuration) + + if (groupID !== undefined) { + localVarQueryParameter['groupID'] = groupID; + } + + if (authorID !== undefined) { + localVarQueryParameter['authorID'] = authorID; + } + + if (validUntil !== undefined) { + localVarQueryParameter['validUntil'] = validUntil; + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary deletes a session + * @param {string} [sessionID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteSessionUsingGET: async (sessionID?: string, options: any = {}): Promise => { + const localVarPath = `/deleteSession`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ApiKey required + await setApiKeyToObject(localVarQueryParameter, "apikey", configuration) + + if (sessionID !== undefined) { + localVarQueryParameter['sessionID'] = sessionID; + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary deletes a session + * @param {string} [sessionID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteSessionUsingPOST: async (sessionID?: string, options: any = {}): Promise => { + const localVarPath = `/deleteSession`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ApiKey required + await setApiKeyToObject(localVarQueryParameter, "apikey", configuration) + + if (sessionID !== undefined) { + localVarQueryParameter['sessionID'] = sessionID; + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary returns information about a session + * @param {string} [sessionID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getSessionInfoUsingGET: async (sessionID?: string, options: any = {}): Promise => { + const localVarPath = `/getSessionInfo`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ApiKey required + await setApiKeyToObject(localVarQueryParameter, "apikey", configuration) + + if (sessionID !== undefined) { + localVarQueryParameter['sessionID'] = sessionID; + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary returns information about a session + * @param {string} [sessionID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getSessionInfoUsingPOST: async (sessionID?: string, options: any = {}): Promise => { + const localVarPath = `/getSessionInfo`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ApiKey required + await setApiKeyToObject(localVarQueryParameter, "apikey", configuration) + + if (sessionID !== undefined) { + localVarQueryParameter['sessionID'] = sessionID; + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + } +}; + +/** + * SessionApi - functional programming interface + * @export + */ +export const SessionApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = SessionApiAxiosParamCreator(configuration) + return { + /** + * + * @summary creates a new session. validUntil is an unix timestamp in seconds + * @param {string} [groupID] + * @param {string} [authorID] + * @param {string} [validUntil] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async createSessionUsingGET(groupID?: string, authorID?: string, validUntil?: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.createSessionUsingGET(groupID, authorID, validUntil, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * + * @summary creates a new session. validUntil is an unix timestamp in seconds + * @param {string} [groupID] + * @param {string} [authorID] + * @param {string} [validUntil] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async createSessionUsingPOST(groupID?: string, authorID?: string, validUntil?: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.createSessionUsingPOST(groupID, authorID, validUntil, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * + * @summary deletes a session + * @param {string} [sessionID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async deleteSessionUsingGET(sessionID?: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.deleteSessionUsingGET(sessionID, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * + * @summary deletes a session + * @param {string} [sessionID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async deleteSessionUsingPOST(sessionID?: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.deleteSessionUsingPOST(sessionID, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * + * @summary returns information about a session + * @param {string} [sessionID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getSessionInfoUsingGET(sessionID?: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getSessionInfoUsingGET(sessionID, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * + * @summary returns information about a session + * @param {string} [sessionID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getSessionInfoUsingPOST(sessionID?: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getSessionInfoUsingPOST(sessionID, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + } +}; + +/** + * SessionApi - factory interface + * @export + */ +export const SessionApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = SessionApiFp(configuration) + return { + /** + * + * @summary creates a new session. validUntil is an unix timestamp in seconds + * @param {string} [groupID] + * @param {string} [authorID] + * @param {string} [validUntil] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createSessionUsingGET(groupID?: string, authorID?: string, validUntil?: string, options?: any): AxiosPromise { + return localVarFp.createSessionUsingGET(groupID, authorID, validUntil, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary creates a new session. validUntil is an unix timestamp in seconds + * @param {string} [groupID] + * @param {string} [authorID] + * @param {string} [validUntil] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createSessionUsingPOST(groupID?: string, authorID?: string, validUntil?: string, options?: any): AxiosPromise { + return localVarFp.createSessionUsingPOST(groupID, authorID, validUntil, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary deletes a session + * @param {string} [sessionID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteSessionUsingGET(sessionID?: string, options?: any): AxiosPromise { + return localVarFp.deleteSessionUsingGET(sessionID, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary deletes a session + * @param {string} [sessionID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteSessionUsingPOST(sessionID?: string, options?: any): AxiosPromise { + return localVarFp.deleteSessionUsingPOST(sessionID, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary returns information about a session + * @param {string} [sessionID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getSessionInfoUsingGET(sessionID?: string, options?: any): AxiosPromise { + return localVarFp.getSessionInfoUsingGET(sessionID, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary returns information about a session + * @param {string} [sessionID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getSessionInfoUsingPOST(sessionID?: string, options?: any): AxiosPromise { + return localVarFp.getSessionInfoUsingPOST(sessionID, options).then((request) => request(axios, basePath)); + }, + }; +}; + +/** + * SessionApi - interface + * @export + * @interface SessionApi + */ +export interface SessionApiInterface { + /** + * + * @summary creates a new session. validUntil is an unix timestamp in seconds + * @param {string} [groupID] + * @param {string} [authorID] + * @param {string} [validUntil] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof SessionApiInterface + */ + createSessionUsingGET(groupID?: string, authorID?: string, validUntil?: string, options?: any): AxiosPromise; + + /** + * + * @summary creates a new session. validUntil is an unix timestamp in seconds + * @param {string} [groupID] + * @param {string} [authorID] + * @param {string} [validUntil] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof SessionApiInterface + */ + createSessionUsingPOST(groupID?: string, authorID?: string, validUntil?: string, options?: any): AxiosPromise; + + /** + * + * @summary deletes a session + * @param {string} [sessionID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof SessionApiInterface + */ + deleteSessionUsingGET(sessionID?: string, options?: any): AxiosPromise; + + /** + * + * @summary deletes a session + * @param {string} [sessionID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof SessionApiInterface + */ + deleteSessionUsingPOST(sessionID?: string, options?: any): AxiosPromise; + + /** + * + * @summary returns information about a session + * @param {string} [sessionID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof SessionApiInterface + */ + getSessionInfoUsingGET(sessionID?: string, options?: any): AxiosPromise; + + /** + * + * @summary returns information about a session + * @param {string} [sessionID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof SessionApiInterface + */ + getSessionInfoUsingPOST(sessionID?: string, options?: any): AxiosPromise; + +} + +/** + * SessionApi - object-oriented interface + * @export + * @class SessionApi + * @extends {BaseAPI} + */ +export class SessionApi extends BaseAPI implements SessionApiInterface { + /** + * + * @summary creates a new session. validUntil is an unix timestamp in seconds + * @param {string} [groupID] + * @param {string} [authorID] + * @param {string} [validUntil] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof SessionApi + */ + public createSessionUsingGET(groupID?: string, authorID?: string, validUntil?: string, options?: any) { + return SessionApiFp(this.configuration).createSessionUsingGET(groupID, authorID, validUntil, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary creates a new session. validUntil is an unix timestamp in seconds + * @param {string} [groupID] + * @param {string} [authorID] + * @param {string} [validUntil] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof SessionApi + */ + public createSessionUsingPOST(groupID?: string, authorID?: string, validUntil?: string, options?: any) { + return SessionApiFp(this.configuration).createSessionUsingPOST(groupID, authorID, validUntil, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary deletes a session + * @param {string} [sessionID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof SessionApi + */ + public deleteSessionUsingGET(sessionID?: string, options?: any) { + return SessionApiFp(this.configuration).deleteSessionUsingGET(sessionID, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary deletes a session + * @param {string} [sessionID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof SessionApi + */ + public deleteSessionUsingPOST(sessionID?: string, options?: any) { + return SessionApiFp(this.configuration).deleteSessionUsingPOST(sessionID, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary returns information about a session + * @param {string} [sessionID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof SessionApi + */ + public getSessionInfoUsingGET(sessionID?: string, options?: any) { + return SessionApiFp(this.configuration).getSessionInfoUsingGET(sessionID, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary returns information about a session + * @param {string} [sessionID] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof SessionApi + */ + public getSessionInfoUsingPOST(sessionID?: string, options?: any) { + return SessionApiFp(this.configuration).getSessionInfoUsingPOST(sessionID, options).then((request) => request(this.axios, this.basePath)); + } +} diff --git a/apps/server/src/infra/etherpad-client/etherpad-api-client/base.ts b/apps/server/src/infra/etherpad-client/etherpad-api-client/base.ts new file mode 100644 index 00000000000..4ec85a45e09 --- /dev/null +++ b/apps/server/src/infra/etherpad-client/etherpad-api-client/base.ts @@ -0,0 +1,71 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Etherpad API + * Etherpad is a real-time collaborative editor scalable to thousands of simultaneous real time users. It provides full data export capabilities, and runs on your server, under your control. + * + * The version of the OpenAPI document: 1.3.0 + * Contact: support@example.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import { Configuration } from "./configuration"; +// Some imports not used depending on template conditions +// @ts-ignore +import globalAxios, { AxiosPromise, AxiosInstance } from 'axios'; + +export const BASE_PATH = "http://localhost:9001/api/1.3.0".replace(/\/+$/, ""); + +/** + * + * @export + */ +export const COLLECTION_FORMATS = { + csv: ",", + ssv: " ", + tsv: "\t", + pipes: "|", +}; + +/** + * + * @export + * @interface RequestArgs + */ +export interface RequestArgs { + url: string; + options: any; +} + +/** + * + * @export + * @class BaseAPI + */ +export class BaseAPI { + protected configuration: Configuration | undefined; + + constructor(configuration?: Configuration, protected basePath: string = BASE_PATH, protected axios: AxiosInstance = globalAxios) { + if (configuration) { + this.configuration = configuration; + this.basePath = configuration.basePath || this.basePath; + } + } +}; + +/** + * + * @export + * @class RequiredError + * @extends {Error} + */ +export class RequiredError extends Error { + name: "RequiredError" = "RequiredError"; + constructor(public field: string, msg?: string) { + super(msg); + } +} diff --git a/apps/server/src/infra/etherpad-client/etherpad-api-client/common.ts b/apps/server/src/infra/etherpad-client/etherpad-api-client/common.ts new file mode 100644 index 00000000000..6da22d106a8 --- /dev/null +++ b/apps/server/src/infra/etherpad-client/etherpad-api-client/common.ts @@ -0,0 +1,138 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Etherpad API + * Etherpad is a real-time collaborative editor scalable to thousands of simultaneous real time users. It provides full data export capabilities, and runs on your server, under your control. + * + * The version of the OpenAPI document: 1.3.0 + * Contact: support@example.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import { Configuration } from "./configuration"; +import { RequiredError, RequestArgs } from "./base"; +import { AxiosInstance } from 'axios'; + +/** + * + * @export + */ +export const DUMMY_BASE_URL = 'https://example.com' + +/** + * + * @throws {RequiredError} + * @export + */ +export const assertParamExists = function (functionName: string, paramName: string, paramValue: unknown) { + if (paramValue === null || paramValue === undefined) { + throw new RequiredError(paramName, `Required parameter ${paramName} was null or undefined when calling ${functionName}.`); + } +} + +/** + * + * @export + */ +export const setApiKeyToObject = async function (object: any, keyParamName: string, configuration?: Configuration) { + if (configuration && configuration.apiKey) { + const localVarApiKeyValue = typeof configuration.apiKey === 'function' + ? await configuration.apiKey(keyParamName) + : await configuration.apiKey; + object[keyParamName] = localVarApiKeyValue; + } +} + +/** + * + * @export + */ +export const setBasicAuthToObject = function (object: any, configuration?: Configuration) { + if (configuration && (configuration.username || configuration.password)) { + object["auth"] = { username: configuration.username, password: configuration.password }; + } +} + +/** + * + * @export + */ +export const setBearerAuthToObject = async function (object: any, configuration?: Configuration) { + if (configuration && configuration.accessToken) { + const accessToken = typeof configuration.accessToken === 'function' + ? await configuration.accessToken() + : await configuration.accessToken; + object["Authorization"] = "Bearer " + accessToken; + } +} + +/** + * + * @export + */ +export const setOAuthToObject = async function (object: any, name: string, scopes: string[], configuration?: Configuration) { + if (configuration && configuration.accessToken) { + const localVarAccessTokenValue = typeof configuration.accessToken === 'function' + ? await configuration.accessToken(name, scopes) + : await configuration.accessToken; + object["Authorization"] = "Bearer " + localVarAccessTokenValue; + } +} + +/** + * + * @export + */ +export const setSearchParams = function (url: URL, ...objects: any[]) { + const searchParams = new URLSearchParams(url.search); + for (const object of objects) { + for (const key in object) { + if (Array.isArray(object[key])) { + searchParams.delete(key); + for (const item of object[key]) { + searchParams.append(key, item); + } + } else { + searchParams.set(key, object[key]); + } + } + } + url.search = searchParams.toString(); +} + +/** + * + * @export + */ +export const serializeDataIfNeeded = function (value: any, requestOptions: any, configuration?: Configuration) { + const nonString = typeof value !== 'string'; + const needsSerialization = nonString && configuration && configuration.isJsonMime + ? configuration.isJsonMime(requestOptions.headers['Content-Type']) + : nonString; + return needsSerialization + ? JSON.stringify(value !== undefined ? value : {}) + : (value || ""); +} + +/** + * + * @export + */ +export const toPathString = function (url: URL) { + return url.pathname + url.search + url.hash +} + +/** + * + * @export + */ +export const createRequestFunction = function (axiosArgs: RequestArgs, globalAxios: AxiosInstance, BASE_PATH: string, configuration?: Configuration) { + return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { + const axiosRequestArgs = {...axiosArgs.options, url: (configuration?.basePath || basePath) + axiosArgs.url}; + return axios.request(axiosRequestArgs); + }; +} diff --git a/apps/server/src/infra/etherpad-client/etherpad-api-client/configuration.ts b/apps/server/src/infra/etherpad-client/etherpad-api-client/configuration.ts new file mode 100644 index 00000000000..b43bb03fda6 --- /dev/null +++ b/apps/server/src/infra/etherpad-client/etherpad-api-client/configuration.ts @@ -0,0 +1,101 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Etherpad API + * Etherpad is a real-time collaborative editor scalable to thousands of simultaneous real time users. It provides full data export capabilities, and runs on your server, under your control. + * + * The version of the OpenAPI document: 1.3.0 + * Contact: support@example.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export interface ConfigurationParameters { + apiKey?: string | Promise | ((name: string) => string) | ((name: string) => Promise); + username?: string; + password?: string; + accessToken?: string | Promise | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise); + basePath?: string; + baseOptions?: any; + formDataCtor?: new () => any; +} + +export class Configuration { + /** + * parameter for apiKey security + * @param name security name + * @memberof Configuration + */ + apiKey?: string | Promise | ((name: string) => string) | ((name: string) => Promise); + /** + * parameter for basic security + * + * @type {string} + * @memberof Configuration + */ + username?: string; + /** + * parameter for basic security + * + * @type {string} + * @memberof Configuration + */ + password?: string; + /** + * parameter for oauth2 security + * @param name security name + * @param scopes oauth2 scope + * @memberof Configuration + */ + accessToken?: string | Promise | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise); + /** + * override base path + * + * @type {string} + * @memberof Configuration + */ + basePath?: string; + /** + * base options for axios calls + * + * @type {any} + * @memberof Configuration + */ + baseOptions?: any; + /** + * The FormData constructor that will be used to create multipart form data + * requests. You can inject this here so that execution environments that + * do not support the FormData class can still run the generated client. + * + * @type {new () => FormData} + */ + formDataCtor?: new () => any; + + constructor(param: ConfigurationParameters = {}) { + this.apiKey = param.apiKey; + this.username = param.username; + this.password = param.password; + this.accessToken = param.accessToken; + this.basePath = param.basePath; + this.baseOptions = param.baseOptions; + this.formDataCtor = param.formDataCtor; + } + + /** + * Check if the given MIME is a JSON MIME. + * JSON MIME examples: + * application/json + * application/json; charset=UTF8 + * APPLICATION/JSON + * application/vnd.company+json + * @param mime - MIME (Multipurpose Internet Mail Extensions) + * @return True if the given MIME is JSON, false otherwise. + */ + public isJsonMime(mime: string): boolean { + const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i'); + return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); + } +} diff --git a/apps/server/src/infra/etherpad-client/etherpad-api-client/index.ts b/apps/server/src/infra/etherpad-client/etherpad-api-client/index.ts new file mode 100644 index 00000000000..5b5522069b3 --- /dev/null +++ b/apps/server/src/infra/etherpad-client/etherpad-api-client/index.ts @@ -0,0 +1,18 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Etherpad API + * Etherpad is a real-time collaborative editor scalable to thousands of simultaneous real time users. It provides full data export capabilities, and runs on your server, under your control. + * + * The version of the OpenAPI document: 1.3.0 + * Contact: support@example.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export * from "./api"; +export * from "./configuration"; +export * from "./models"; diff --git a/apps/server/src/infra/etherpad-client/etherpad-api-client/models/index.ts b/apps/server/src/infra/etherpad-client/etherpad-api-client/models/index.ts new file mode 100644 index 00000000000..36a926c85d9 --- /dev/null +++ b/apps/server/src/infra/etherpad-client/etherpad-api-client/models/index.ts @@ -0,0 +1,49 @@ +export * from './inline-response200'; +export * from './inline-response2001'; +export * from './inline-response20010'; +export * from './inline-response20010-data'; +export * from './inline-response20011'; +export * from './inline-response20011-data'; +export * from './inline-response20012'; +export * from './inline-response20012-data'; +export * from './inline-response20013'; +export * from './inline-response20013-data'; +export * from './inline-response20014'; +export * from './inline-response20014-data'; +export * from './inline-response20015'; +export * from './inline-response20015-data'; +export * from './inline-response20015-data-info'; +export * from './inline-response20016'; +export * from './inline-response20016-data'; +export * from './inline-response20017'; +export * from './inline-response20017-data'; +export * from './inline-response20018'; +export * from './inline-response20019'; +export * from './inline-response20019-data'; +export * from './inline-response20019-data-messages'; +export * from './inline-response2002'; +export * from './inline-response20020'; +export * from './inline-response20020-data'; +export * from './inline-response2002-data'; +export * from './inline-response2003'; +export * from './inline-response2003-data'; +export * from './inline-response2004'; +export * from './inline-response2004-data'; +export * from './inline-response2005'; +export * from './inline-response2005-data'; +export * from './inline-response2005-data-info'; +export * from './inline-response2006'; +export * from './inline-response2006-data'; +export * from './inline-response2007'; +export * from './inline-response2007-data'; +export * from './inline-response2008'; +export * from './inline-response2008-data'; +export * from './inline-response2009'; +export * from './inline-response2009-data'; +export * from './inline-response200-data'; +export * from './inline-response400'; +export * from './inline-response401'; +export * from './inline-response500'; +export * from './message'; +export * from './session-info'; +export * from './user-info'; diff --git a/apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response200-data.ts b/apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response200-data.ts new file mode 100644 index 00000000000..735b422f0a0 --- /dev/null +++ b/apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response200-data.ts @@ -0,0 +1,31 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Etherpad API + * Etherpad is a real-time collaborative editor scalable to thousands of simultaneous real time users. It provides full data export capabilities, and runs on your server, under your control. + * + * The version of the OpenAPI document: 1.3.0 + * Contact: support@example.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +/** + * + * @export + * @interface InlineResponse200Data + */ +export interface InlineResponse200Data { + /** + * + * @type {string} + * @memberof InlineResponse200Data + */ + groupID?: string; +} + + diff --git a/apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response200.ts b/apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response200.ts new file mode 100644 index 00000000000..d4420b0eb50 --- /dev/null +++ b/apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response200.ts @@ -0,0 +1,44 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Etherpad API + * Etherpad is a real-time collaborative editor scalable to thousands of simultaneous real time users. It provides full data export capabilities, and runs on your server, under your control. + * + * The version of the OpenAPI document: 1.3.0 + * Contact: support@example.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import { InlineResponse200Data } from './inline-response200-data'; + +/** + * + * @export + * @interface InlineResponse200 + */ +export interface InlineResponse200 { + /** + * + * @type {number} + * @memberof InlineResponse200 + */ + code?: number; + /** + * + * @type {string} + * @memberof InlineResponse200 + */ + message?: string; + /** + * + * @type {InlineResponse200Data} + * @memberof InlineResponse200 + */ + data?: InlineResponse200Data; +} + + diff --git a/apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response2001.ts b/apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response2001.ts new file mode 100644 index 00000000000..7f0f7922127 --- /dev/null +++ b/apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response2001.ts @@ -0,0 +1,43 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Etherpad API + * Etherpad is a real-time collaborative editor scalable to thousands of simultaneous real time users. It provides full data export capabilities, and runs on your server, under your control. + * + * The version of the OpenAPI document: 1.3.0 + * Contact: support@example.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +/** + * + * @export + * @interface InlineResponse2001 + */ +export interface InlineResponse2001 { + /** + * + * @type {number} + * @memberof InlineResponse2001 + */ + code?: number; + /** + * + * @type {string} + * @memberof InlineResponse2001 + */ + message?: string; + /** + * + * @type {object} + * @memberof InlineResponse2001 + */ + data?: object; +} + + diff --git a/apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response20010-data.ts b/apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response20010-data.ts new file mode 100644 index 00000000000..217dce4b49c --- /dev/null +++ b/apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response20010-data.ts @@ -0,0 +1,31 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Etherpad API + * Etherpad is a real-time collaborative editor scalable to thousands of simultaneous real time users. It provides full data export capabilities, and runs on your server, under your control. + * + * The version of the OpenAPI document: 1.3.0 + * Contact: support@example.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +/** + * + * @export + * @interface InlineResponse20010Data + */ +export interface InlineResponse20010Data { + /** + * + * @type {number} + * @memberof InlineResponse20010Data + */ + lastEdited?: number; +} + + diff --git a/apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response20010.ts b/apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response20010.ts new file mode 100644 index 00000000000..1e337932d5a --- /dev/null +++ b/apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response20010.ts @@ -0,0 +1,44 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Etherpad API + * Etherpad is a real-time collaborative editor scalable to thousands of simultaneous real time users. It provides full data export capabilities, and runs on your server, under your control. + * + * The version of the OpenAPI document: 1.3.0 + * Contact: support@example.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import { InlineResponse20010Data } from './inline-response20010-data'; + +/** + * + * @export + * @interface InlineResponse20010 + */ +export interface InlineResponse20010 { + /** + * + * @type {number} + * @memberof InlineResponse20010 + */ + code?: number; + /** + * + * @type {string} + * @memberof InlineResponse20010 + */ + message?: string; + /** + * + * @type {InlineResponse20010Data} + * @memberof InlineResponse20010 + */ + data?: InlineResponse20010Data; +} + + diff --git a/apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response20011-data.ts b/apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response20011-data.ts new file mode 100644 index 00000000000..5434d57d16c --- /dev/null +++ b/apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response20011-data.ts @@ -0,0 +1,31 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Etherpad API + * Etherpad is a real-time collaborative editor scalable to thousands of simultaneous real time users. It provides full data export capabilities, and runs on your server, under your control. + * + * The version of the OpenAPI document: 1.3.0 + * Contact: support@example.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +/** + * + * @export + * @interface InlineResponse20011Data + */ +export interface InlineResponse20011Data { + /** + * + * @type {string} + * @memberof InlineResponse20011Data + */ + readOnlyID?: string; +} + + diff --git a/apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response20011.ts b/apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response20011.ts new file mode 100644 index 00000000000..7cdc7fd7d69 --- /dev/null +++ b/apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response20011.ts @@ -0,0 +1,44 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Etherpad API + * Etherpad is a real-time collaborative editor scalable to thousands of simultaneous real time users. It provides full data export capabilities, and runs on your server, under your control. + * + * The version of the OpenAPI document: 1.3.0 + * Contact: support@example.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import { InlineResponse20011Data } from './inline-response20011-data'; + +/** + * + * @export + * @interface InlineResponse20011 + */ +export interface InlineResponse20011 { + /** + * + * @type {number} + * @memberof InlineResponse20011 + */ + code?: number; + /** + * + * @type {string} + * @memberof InlineResponse20011 + */ + message?: string; + /** + * + * @type {InlineResponse20011Data} + * @memberof InlineResponse20011 + */ + data?: InlineResponse20011Data; +} + + diff --git a/apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response20012-data.ts b/apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response20012-data.ts new file mode 100644 index 00000000000..5d7ca35e17d --- /dev/null +++ b/apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response20012-data.ts @@ -0,0 +1,31 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Etherpad API + * Etherpad is a real-time collaborative editor scalable to thousands of simultaneous real time users. It provides full data export capabilities, and runs on your server, under your control. + * + * The version of the OpenAPI document: 1.3.0 + * Contact: support@example.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +/** + * + * @export + * @interface InlineResponse20012Data + */ +export interface InlineResponse20012Data { + /** + * + * @type {boolean} + * @memberof InlineResponse20012Data + */ + publicStatus?: boolean; +} + + diff --git a/apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response20012.ts b/apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response20012.ts new file mode 100644 index 00000000000..d53101a7622 --- /dev/null +++ b/apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response20012.ts @@ -0,0 +1,44 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Etherpad API + * Etherpad is a real-time collaborative editor scalable to thousands of simultaneous real time users. It provides full data export capabilities, and runs on your server, under your control. + * + * The version of the OpenAPI document: 1.3.0 + * Contact: support@example.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import { InlineResponse20012Data } from './inline-response20012-data'; + +/** + * + * @export + * @interface InlineResponse20012 + */ +export interface InlineResponse20012 { + /** + * + * @type {number} + * @memberof InlineResponse20012 + */ + code?: number; + /** + * + * @type {string} + * @memberof InlineResponse20012 + */ + message?: string; + /** + * + * @type {InlineResponse20012Data} + * @memberof InlineResponse20012 + */ + data?: InlineResponse20012Data; +} + + diff --git a/apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response20013-data.ts b/apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response20013-data.ts new file mode 100644 index 00000000000..6f14430430f --- /dev/null +++ b/apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response20013-data.ts @@ -0,0 +1,31 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Etherpad API + * Etherpad is a real-time collaborative editor scalable to thousands of simultaneous real time users. It provides full data export capabilities, and runs on your server, under your control. + * + * The version of the OpenAPI document: 1.3.0 + * Contact: support@example.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +/** + * + * @export + * @interface InlineResponse20013Data + */ +export interface InlineResponse20013Data { + /** + * + * @type {Array} + * @memberof InlineResponse20013Data + */ + authorIDs?: Array; +} + + diff --git a/apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response20013.ts b/apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response20013.ts new file mode 100644 index 00000000000..6c115592623 --- /dev/null +++ b/apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response20013.ts @@ -0,0 +1,44 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Etherpad API + * Etherpad is a real-time collaborative editor scalable to thousands of simultaneous real time users. It provides full data export capabilities, and runs on your server, under your control. + * + * The version of the OpenAPI document: 1.3.0 + * Contact: support@example.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import { InlineResponse20013Data } from './inline-response20013-data'; + +/** + * + * @export + * @interface InlineResponse20013 + */ +export interface InlineResponse20013 { + /** + * + * @type {number} + * @memberof InlineResponse20013 + */ + code?: number; + /** + * + * @type {string} + * @memberof InlineResponse20013 + */ + message?: string; + /** + * + * @type {InlineResponse20013Data} + * @memberof InlineResponse20013 + */ + data?: InlineResponse20013Data; +} + + diff --git a/apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response20014-data.ts b/apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response20014-data.ts new file mode 100644 index 00000000000..8cfede0f0c0 --- /dev/null +++ b/apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response20014-data.ts @@ -0,0 +1,31 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Etherpad API + * Etherpad is a real-time collaborative editor scalable to thousands of simultaneous real time users. It provides full data export capabilities, and runs on your server, under your control. + * + * The version of the OpenAPI document: 1.3.0 + * Contact: support@example.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +/** + * + * @export + * @interface InlineResponse20014Data + */ +export interface InlineResponse20014Data { + /** + * + * @type {number} + * @memberof InlineResponse20014Data + */ + padUsersCount?: number; +} + + diff --git a/apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response20014.ts b/apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response20014.ts new file mode 100644 index 00000000000..c72f9dfb6ef --- /dev/null +++ b/apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response20014.ts @@ -0,0 +1,44 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Etherpad API + * Etherpad is a real-time collaborative editor scalable to thousands of simultaneous real time users. It provides full data export capabilities, and runs on your server, under your control. + * + * The version of the OpenAPI document: 1.3.0 + * Contact: support@example.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import { InlineResponse20014Data } from './inline-response20014-data'; + +/** + * + * @export + * @interface InlineResponse20014 + */ +export interface InlineResponse20014 { + /** + * + * @type {number} + * @memberof InlineResponse20014 + */ + code?: number; + /** + * + * @type {string} + * @memberof InlineResponse20014 + */ + message?: string; + /** + * + * @type {InlineResponse20014Data} + * @memberof InlineResponse20014 + */ + data?: InlineResponse20014Data; +} + + diff --git a/apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response20015-data-info.ts b/apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response20015-data-info.ts new file mode 100644 index 00000000000..2108f3be2af --- /dev/null +++ b/apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response20015-data-info.ts @@ -0,0 +1,49 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Etherpad API + * Etherpad is a real-time collaborative editor scalable to thousands of simultaneous real time users. It provides full data export capabilities, and runs on your server, under your control. + * + * The version of the OpenAPI document: 1.3.0 + * Contact: support@example.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +/** + * + * @export + * @interface InlineResponse20015DataInfo + */ +export interface InlineResponse20015DataInfo { + /** + * + * @type {string} + * @memberof InlineResponse20015DataInfo + */ + id?: string; + /** + * + * @type {string} + * @memberof InlineResponse20015DataInfo + */ + colorId?: string; + /** + * + * @type {string} + * @memberof InlineResponse20015DataInfo + */ + name?: string; + /** + * + * @type {number} + * @memberof InlineResponse20015DataInfo + */ + timestamp?: number; +} + + diff --git a/apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response20015-data.ts b/apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response20015-data.ts new file mode 100644 index 00000000000..a35c1e49871 --- /dev/null +++ b/apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response20015-data.ts @@ -0,0 +1,32 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Etherpad API + * Etherpad is a real-time collaborative editor scalable to thousands of simultaneous real time users. It provides full data export capabilities, and runs on your server, under your control. + * + * The version of the OpenAPI document: 1.3.0 + * Contact: support@example.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import { InlineResponse20015DataInfo } from './inline-response20015-data-info'; + +/** + * + * @export + * @interface InlineResponse20015Data + */ +export interface InlineResponse20015Data { + /** + * + * @type {InlineResponse20015DataInfo} + * @memberof InlineResponse20015Data + */ + info?: InlineResponse20015DataInfo; +} + + diff --git a/apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response20015.ts b/apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response20015.ts new file mode 100644 index 00000000000..f898636471b --- /dev/null +++ b/apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response20015.ts @@ -0,0 +1,44 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Etherpad API + * Etherpad is a real-time collaborative editor scalable to thousands of simultaneous real time users. It provides full data export capabilities, and runs on your server, under your control. + * + * The version of the OpenAPI document: 1.3.0 + * Contact: support@example.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import { InlineResponse20015Data } from './inline-response20015-data'; + +/** + * + * @export + * @interface InlineResponse20015 + */ +export interface InlineResponse20015 { + /** + * + * @type {number} + * @memberof InlineResponse20015 + */ + code?: number; + /** + * + * @type {string} + * @memberof InlineResponse20015 + */ + message?: string; + /** + * + * @type {InlineResponse20015Data} + * @memberof InlineResponse20015 + */ + data?: InlineResponse20015Data; +} + + diff --git a/apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response20016-data.ts b/apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response20016-data.ts new file mode 100644 index 00000000000..b2020e36332 --- /dev/null +++ b/apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response20016-data.ts @@ -0,0 +1,32 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Etherpad API + * Etherpad is a real-time collaborative editor scalable to thousands of simultaneous real time users. It provides full data export capabilities, and runs on your server, under your control. + * + * The version of the OpenAPI document: 1.3.0 + * Contact: support@example.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import { InlineResponse20015DataInfo } from './inline-response20015-data-info'; + +/** + * + * @export + * @interface InlineResponse20016Data + */ +export interface InlineResponse20016Data { + /** + * + * @type {Array} + * @memberof InlineResponse20016Data + */ + padUsers?: Array; +} + + diff --git a/apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response20016.ts b/apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response20016.ts new file mode 100644 index 00000000000..20ab5a260a9 --- /dev/null +++ b/apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response20016.ts @@ -0,0 +1,44 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Etherpad API + * Etherpad is a real-time collaborative editor scalable to thousands of simultaneous real time users. It provides full data export capabilities, and runs on your server, under your control. + * + * The version of the OpenAPI document: 1.3.0 + * Contact: support@example.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import { InlineResponse20016Data } from './inline-response20016-data'; + +/** + * + * @export + * @interface InlineResponse20016 + */ +export interface InlineResponse20016 { + /** + * + * @type {number} + * @memberof InlineResponse20016 + */ + code?: number; + /** + * + * @type {string} + * @memberof InlineResponse20016 + */ + message?: string; + /** + * + * @type {InlineResponse20016Data} + * @memberof InlineResponse20016 + */ + data?: InlineResponse20016Data; +} + + diff --git a/apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response20017-data.ts b/apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response20017-data.ts new file mode 100644 index 00000000000..215b1588eda --- /dev/null +++ b/apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response20017-data.ts @@ -0,0 +1,31 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Etherpad API + * Etherpad is a real-time collaborative editor scalable to thousands of simultaneous real time users. It provides full data export capabilities, and runs on your server, under your control. + * + * The version of the OpenAPI document: 1.3.0 + * Contact: support@example.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +/** + * + * @export + * @interface InlineResponse20017Data + */ +export interface InlineResponse20017Data { + /** + * + * @type {Array} + * @memberof InlineResponse20017Data + */ + groupIDs?: Array; +} + + diff --git a/apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response20017.ts b/apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response20017.ts new file mode 100644 index 00000000000..1aad51e9d7d --- /dev/null +++ b/apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response20017.ts @@ -0,0 +1,44 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Etherpad API + * Etherpad is a real-time collaborative editor scalable to thousands of simultaneous real time users. It provides full data export capabilities, and runs on your server, under your control. + * + * The version of the OpenAPI document: 1.3.0 + * Contact: support@example.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import { InlineResponse20017Data } from './inline-response20017-data'; + +/** + * + * @export + * @interface InlineResponse20017 + */ +export interface InlineResponse20017 { + /** + * + * @type {number} + * @memberof InlineResponse20017 + */ + code?: number; + /** + * + * @type {string} + * @memberof InlineResponse20017 + */ + message?: string; + /** + * + * @type {InlineResponse20017Data} + * @memberof InlineResponse20017 + */ + data?: InlineResponse20017Data; +} + + diff --git a/apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response20018.ts b/apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response20018.ts new file mode 100644 index 00000000000..ae6fe679f95 --- /dev/null +++ b/apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response20018.ts @@ -0,0 +1,43 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Etherpad API + * Etherpad is a real-time collaborative editor scalable to thousands of simultaneous real time users. It provides full data export capabilities, and runs on your server, under your control. + * + * The version of the OpenAPI document: 1.3.0 + * Contact: support@example.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +/** + * + * @export + * @interface InlineResponse20018 + */ +export interface InlineResponse20018 { + /** + * + * @type {number} + * @memberof InlineResponse20018 + */ + code?: number; + /** + * + * @type {string} + * @memberof InlineResponse20018 + */ + message?: string; + /** + * + * @type {object} + * @memberof InlineResponse20018 + */ + data?: object; +} + + diff --git a/apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response20019-data-messages.ts b/apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response20019-data-messages.ts new file mode 100644 index 00000000000..54faf8189a9 --- /dev/null +++ b/apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response20019-data-messages.ts @@ -0,0 +1,49 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Etherpad API + * Etherpad is a real-time collaborative editor scalable to thousands of simultaneous real time users. It provides full data export capabilities, and runs on your server, under your control. + * + * The version of the OpenAPI document: 1.3.0 + * Contact: support@example.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +/** + * + * @export + * @interface InlineResponse20019DataMessages + */ +export interface InlineResponse20019DataMessages { + /** + * + * @type {string} + * @memberof InlineResponse20019DataMessages + */ + text?: string; + /** + * + * @type {string} + * @memberof InlineResponse20019DataMessages + */ + userId?: string; + /** + * + * @type {string} + * @memberof InlineResponse20019DataMessages + */ + userName?: string; + /** + * + * @type {number} + * @memberof InlineResponse20019DataMessages + */ + time?: number; +} + + diff --git a/apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response20019-data.ts b/apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response20019-data.ts new file mode 100644 index 00000000000..a994048ded6 --- /dev/null +++ b/apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response20019-data.ts @@ -0,0 +1,32 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Etherpad API + * Etherpad is a real-time collaborative editor scalable to thousands of simultaneous real time users. It provides full data export capabilities, and runs on your server, under your control. + * + * The version of the OpenAPI document: 1.3.0 + * Contact: support@example.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import { InlineResponse20019DataMessages } from './inline-response20019-data-messages'; + +/** + * + * @export + * @interface InlineResponse20019Data + */ +export interface InlineResponse20019Data { + /** + * + * @type {Array} + * @memberof InlineResponse20019Data + */ + messages?: Array; +} + + diff --git a/apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response20019.ts b/apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response20019.ts new file mode 100644 index 00000000000..f61c085a5db --- /dev/null +++ b/apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response20019.ts @@ -0,0 +1,44 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Etherpad API + * Etherpad is a real-time collaborative editor scalable to thousands of simultaneous real time users. It provides full data export capabilities, and runs on your server, under your control. + * + * The version of the OpenAPI document: 1.3.0 + * Contact: support@example.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import { InlineResponse20019Data } from './inline-response20019-data'; + +/** + * + * @export + * @interface InlineResponse20019 + */ +export interface InlineResponse20019 { + /** + * + * @type {number} + * @memberof InlineResponse20019 + */ + code?: number; + /** + * + * @type {string} + * @memberof InlineResponse20019 + */ + message?: string; + /** + * + * @type {InlineResponse20019Data} + * @memberof InlineResponse20019 + */ + data?: InlineResponse20019Data; +} + + diff --git a/apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response2002-data.ts b/apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response2002-data.ts new file mode 100644 index 00000000000..b6a0cd73889 --- /dev/null +++ b/apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response2002-data.ts @@ -0,0 +1,31 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Etherpad API + * Etherpad is a real-time collaborative editor scalable to thousands of simultaneous real time users. It provides full data export capabilities, and runs on your server, under your control. + * + * The version of the OpenAPI document: 1.3.0 + * Contact: support@example.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +/** + * + * @export + * @interface InlineResponse2002Data + */ +export interface InlineResponse2002Data { + /** + * + * @type {Array} + * @memberof InlineResponse2002Data + */ + padIDs?: Array; +} + + diff --git a/apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response2002.ts b/apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response2002.ts new file mode 100644 index 00000000000..71457ee02a9 --- /dev/null +++ b/apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response2002.ts @@ -0,0 +1,44 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Etherpad API + * Etherpad is a real-time collaborative editor scalable to thousands of simultaneous real time users. It provides full data export capabilities, and runs on your server, under your control. + * + * The version of the OpenAPI document: 1.3.0 + * Contact: support@example.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import { InlineResponse2002Data } from './inline-response2002-data'; + +/** + * + * @export + * @interface InlineResponse2002 + */ +export interface InlineResponse2002 { + /** + * + * @type {number} + * @memberof InlineResponse2002 + */ + code?: number; + /** + * + * @type {string} + * @memberof InlineResponse2002 + */ + message?: string; + /** + * + * @type {InlineResponse2002Data} + * @memberof InlineResponse2002 + */ + data?: InlineResponse2002Data; +} + + diff --git a/apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response20020-data.ts b/apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response20020-data.ts new file mode 100644 index 00000000000..8d04eb06af2 --- /dev/null +++ b/apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response20020-data.ts @@ -0,0 +1,32 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Etherpad API + * Etherpad is a real-time collaborative editor scalable to thousands of simultaneous real time users. It provides full data export capabilities, and runs on your server, under your control. + * + * The version of the OpenAPI document: 1.3.0 + * Contact: support@example.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import { InlineResponse20019DataMessages } from './inline-response20019-data-messages'; + +/** + * + * @export + * @interface InlineResponse20020Data + */ +export interface InlineResponse20020Data { + /** + * + * @type {InlineResponse20019DataMessages} + * @memberof InlineResponse20020Data + */ + chatHead?: InlineResponse20019DataMessages; +} + + diff --git a/apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response20020.ts b/apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response20020.ts new file mode 100644 index 00000000000..075caa51d44 --- /dev/null +++ b/apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response20020.ts @@ -0,0 +1,44 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Etherpad API + * Etherpad is a real-time collaborative editor scalable to thousands of simultaneous real time users. It provides full data export capabilities, and runs on your server, under your control. + * + * The version of the OpenAPI document: 1.3.0 + * Contact: support@example.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import { InlineResponse20020Data } from './inline-response20020-data'; + +/** + * + * @export + * @interface InlineResponse20020 + */ +export interface InlineResponse20020 { + /** + * + * @type {number} + * @memberof InlineResponse20020 + */ + code?: number; + /** + * + * @type {string} + * @memberof InlineResponse20020 + */ + message?: string; + /** + * + * @type {InlineResponse20020Data} + * @memberof InlineResponse20020 + */ + data?: InlineResponse20020Data; +} + + diff --git a/apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response2003-data.ts b/apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response2003-data.ts new file mode 100644 index 00000000000..a9b18e69b58 --- /dev/null +++ b/apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response2003-data.ts @@ -0,0 +1,31 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Etherpad API + * Etherpad is a real-time collaborative editor scalable to thousands of simultaneous real time users. It provides full data export capabilities, and runs on your server, under your control. + * + * The version of the OpenAPI document: 1.3.0 + * Contact: support@example.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +/** + * + * @export + * @interface InlineResponse2003Data + */ +export interface InlineResponse2003Data { + /** + * + * @type {string} + * @memberof InlineResponse2003Data + */ + authorID?: string; +} + + diff --git a/apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response2003.ts b/apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response2003.ts new file mode 100644 index 00000000000..36564956f1c --- /dev/null +++ b/apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response2003.ts @@ -0,0 +1,44 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Etherpad API + * Etherpad is a real-time collaborative editor scalable to thousands of simultaneous real time users. It provides full data export capabilities, and runs on your server, under your control. + * + * The version of the OpenAPI document: 1.3.0 + * Contact: support@example.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import { InlineResponse2003Data } from './inline-response2003-data'; + +/** + * + * @export + * @interface InlineResponse2003 + */ +export interface InlineResponse2003 { + /** + * + * @type {number} + * @memberof InlineResponse2003 + */ + code?: number; + /** + * + * @type {string} + * @memberof InlineResponse2003 + */ + message?: string; + /** + * + * @type {InlineResponse2003Data} + * @memberof InlineResponse2003 + */ + data?: InlineResponse2003Data; +} + + diff --git a/apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response2004-data.ts b/apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response2004-data.ts new file mode 100644 index 00000000000..c04b243eaa0 --- /dev/null +++ b/apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response2004-data.ts @@ -0,0 +1,31 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Etherpad API + * Etherpad is a real-time collaborative editor scalable to thousands of simultaneous real time users. It provides full data export capabilities, and runs on your server, under your control. + * + * The version of the OpenAPI document: 1.3.0 + * Contact: support@example.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +/** + * + * @export + * @interface InlineResponse2004Data + */ +export interface InlineResponse2004Data { + /** + * + * @type {string} + * @memberof InlineResponse2004Data + */ + sessionID?: string; +} + + diff --git a/apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response2004.ts b/apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response2004.ts new file mode 100644 index 00000000000..dac37c9ef04 --- /dev/null +++ b/apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response2004.ts @@ -0,0 +1,44 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Etherpad API + * Etherpad is a real-time collaborative editor scalable to thousands of simultaneous real time users. It provides full data export capabilities, and runs on your server, under your control. + * + * The version of the OpenAPI document: 1.3.0 + * Contact: support@example.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import { InlineResponse2004Data } from './inline-response2004-data'; + +/** + * + * @export + * @interface InlineResponse2004 + */ +export interface InlineResponse2004 { + /** + * + * @type {number} + * @memberof InlineResponse2004 + */ + code?: number; + /** + * + * @type {string} + * @memberof InlineResponse2004 + */ + message?: string; + /** + * + * @type {InlineResponse2004Data} + * @memberof InlineResponse2004 + */ + data?: InlineResponse2004Data; +} + + diff --git a/apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response2005-data-info.ts b/apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response2005-data-info.ts new file mode 100644 index 00000000000..9fb27c355dd --- /dev/null +++ b/apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response2005-data-info.ts @@ -0,0 +1,49 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Etherpad API + * Etherpad is a real-time collaborative editor scalable to thousands of simultaneous real time users. It provides full data export capabilities, and runs on your server, under your control. + * + * The version of the OpenAPI document: 1.3.0 + * Contact: support@example.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +/** + * + * @export + * @interface InlineResponse2005DataInfo + */ +export interface InlineResponse2005DataInfo { + /** + * + * @type {string} + * @memberof InlineResponse2005DataInfo + */ + id?: string; + /** + * + * @type {string} + * @memberof InlineResponse2005DataInfo + */ + authorID?: string; + /** + * + * @type {string} + * @memberof InlineResponse2005DataInfo + */ + groupID?: string; + /** + * + * @type {number} + * @memberof InlineResponse2005DataInfo + */ + validUntil?: number; +} + + diff --git a/apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response2005-data.ts b/apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response2005-data.ts new file mode 100644 index 00000000000..04d51fc9b1e --- /dev/null +++ b/apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response2005-data.ts @@ -0,0 +1,32 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Etherpad API + * Etherpad is a real-time collaborative editor scalable to thousands of simultaneous real time users. It provides full data export capabilities, and runs on your server, under your control. + * + * The version of the OpenAPI document: 1.3.0 + * Contact: support@example.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import { InlineResponse2005DataInfo } from './inline-response2005-data-info'; + +/** + * + * @export + * @interface InlineResponse2005Data + */ +export interface InlineResponse2005Data { + /** + * + * @type {InlineResponse2005DataInfo} + * @memberof InlineResponse2005Data + */ + info?: InlineResponse2005DataInfo; +} + + diff --git a/apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response2005.ts b/apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response2005.ts new file mode 100644 index 00000000000..d832070a651 --- /dev/null +++ b/apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response2005.ts @@ -0,0 +1,44 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Etherpad API + * Etherpad is a real-time collaborative editor scalable to thousands of simultaneous real time users. It provides full data export capabilities, and runs on your server, under your control. + * + * The version of the OpenAPI document: 1.3.0 + * Contact: support@example.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import { InlineResponse2005Data } from './inline-response2005-data'; + +/** + * + * @export + * @interface InlineResponse2005 + */ +export interface InlineResponse2005 { + /** + * + * @type {number} + * @memberof InlineResponse2005 + */ + code?: number; + /** + * + * @type {string} + * @memberof InlineResponse2005 + */ + message?: string; + /** + * + * @type {InlineResponse2005Data} + * @memberof InlineResponse2005 + */ + data?: InlineResponse2005Data; +} + + diff --git a/apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response2006-data.ts b/apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response2006-data.ts new file mode 100644 index 00000000000..4803681884e --- /dev/null +++ b/apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response2006-data.ts @@ -0,0 +1,32 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Etherpad API + * Etherpad is a real-time collaborative editor scalable to thousands of simultaneous real time users. It provides full data export capabilities, and runs on your server, under your control. + * + * The version of the OpenAPI document: 1.3.0 + * Contact: support@example.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import { InlineResponse2005DataInfo } from './inline-response2005-data-info'; + +/** + * + * @export + * @interface InlineResponse2006Data + */ +export interface InlineResponse2006Data { + /** + * + * @type {Array} + * @memberof InlineResponse2006Data + */ + sessions?: Array; +} + + diff --git a/apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response2006.ts b/apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response2006.ts new file mode 100644 index 00000000000..65daa063bb3 --- /dev/null +++ b/apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response2006.ts @@ -0,0 +1,44 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Etherpad API + * Etherpad is a real-time collaborative editor scalable to thousands of simultaneous real time users. It provides full data export capabilities, and runs on your server, under your control. + * + * The version of the OpenAPI document: 1.3.0 + * Contact: support@example.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import { InlineResponse2006Data } from './inline-response2006-data'; + +/** + * + * @export + * @interface InlineResponse2006 + */ +export interface InlineResponse2006 { + /** + * + * @type {number} + * @memberof InlineResponse2006 + */ + code?: number; + /** + * + * @type {string} + * @memberof InlineResponse2006 + */ + message?: string; + /** + * + * @type {InlineResponse2006Data} + * @memberof InlineResponse2006 + */ + data?: InlineResponse2006Data; +} + + diff --git a/apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response2007-data.ts b/apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response2007-data.ts new file mode 100644 index 00000000000..deb4fde87a6 --- /dev/null +++ b/apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response2007-data.ts @@ -0,0 +1,31 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Etherpad API + * Etherpad is a real-time collaborative editor scalable to thousands of simultaneous real time users. It provides full data export capabilities, and runs on your server, under your control. + * + * The version of the OpenAPI document: 1.3.0 + * Contact: support@example.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +/** + * + * @export + * @interface InlineResponse2007Data + */ +export interface InlineResponse2007Data { + /** + * + * @type {string} + * @memberof InlineResponse2007Data + */ + text?: string; +} + + diff --git a/apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response2007.ts b/apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response2007.ts new file mode 100644 index 00000000000..b6a65b833b4 --- /dev/null +++ b/apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response2007.ts @@ -0,0 +1,44 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Etherpad API + * Etherpad is a real-time collaborative editor scalable to thousands of simultaneous real time users. It provides full data export capabilities, and runs on your server, under your control. + * + * The version of the OpenAPI document: 1.3.0 + * Contact: support@example.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import { InlineResponse2007Data } from './inline-response2007-data'; + +/** + * + * @export + * @interface InlineResponse2007 + */ +export interface InlineResponse2007 { + /** + * + * @type {number} + * @memberof InlineResponse2007 + */ + code?: number; + /** + * + * @type {string} + * @memberof InlineResponse2007 + */ + message?: string; + /** + * + * @type {InlineResponse2007Data} + * @memberof InlineResponse2007 + */ + data?: InlineResponse2007Data; +} + + diff --git a/apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response2008-data.ts b/apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response2008-data.ts new file mode 100644 index 00000000000..e07512e1148 --- /dev/null +++ b/apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response2008-data.ts @@ -0,0 +1,31 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Etherpad API + * Etherpad is a real-time collaborative editor scalable to thousands of simultaneous real time users. It provides full data export capabilities, and runs on your server, under your control. + * + * The version of the OpenAPI document: 1.3.0 + * Contact: support@example.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +/** + * + * @export + * @interface InlineResponse2008Data + */ +export interface InlineResponse2008Data { + /** + * + * @type {string} + * @memberof InlineResponse2008Data + */ + html?: string; +} + + diff --git a/apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response2008.ts b/apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response2008.ts new file mode 100644 index 00000000000..ad763fff549 --- /dev/null +++ b/apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response2008.ts @@ -0,0 +1,44 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Etherpad API + * Etherpad is a real-time collaborative editor scalable to thousands of simultaneous real time users. It provides full data export capabilities, and runs on your server, under your control. + * + * The version of the OpenAPI document: 1.3.0 + * Contact: support@example.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import { InlineResponse2008Data } from './inline-response2008-data'; + +/** + * + * @export + * @interface InlineResponse2008 + */ +export interface InlineResponse2008 { + /** + * + * @type {number} + * @memberof InlineResponse2008 + */ + code?: number; + /** + * + * @type {string} + * @memberof InlineResponse2008 + */ + message?: string; + /** + * + * @type {InlineResponse2008Data} + * @memberof InlineResponse2008 + */ + data?: InlineResponse2008Data; +} + + diff --git a/apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response2009-data.ts b/apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response2009-data.ts new file mode 100644 index 00000000000..6e8f853ca4e --- /dev/null +++ b/apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response2009-data.ts @@ -0,0 +1,31 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Etherpad API + * Etherpad is a real-time collaborative editor scalable to thousands of simultaneous real time users. It provides full data export capabilities, and runs on your server, under your control. + * + * The version of the OpenAPI document: 1.3.0 + * Contact: support@example.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +/** + * + * @export + * @interface InlineResponse2009Data + */ +export interface InlineResponse2009Data { + /** + * + * @type {number} + * @memberof InlineResponse2009Data + */ + revisions?: number; +} + + diff --git a/apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response2009.ts b/apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response2009.ts new file mode 100644 index 00000000000..12c4d4ba1d9 --- /dev/null +++ b/apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response2009.ts @@ -0,0 +1,44 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Etherpad API + * Etherpad is a real-time collaborative editor scalable to thousands of simultaneous real time users. It provides full data export capabilities, and runs on your server, under your control. + * + * The version of the OpenAPI document: 1.3.0 + * Contact: support@example.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import { InlineResponse2009Data } from './inline-response2009-data'; + +/** + * + * @export + * @interface InlineResponse2009 + */ +export interface InlineResponse2009 { + /** + * + * @type {number} + * @memberof InlineResponse2009 + */ + code?: number; + /** + * + * @type {string} + * @memberof InlineResponse2009 + */ + message?: string; + /** + * + * @type {InlineResponse2009Data} + * @memberof InlineResponse2009 + */ + data?: InlineResponse2009Data; +} + + diff --git a/apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response400.ts b/apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response400.ts new file mode 100644 index 00000000000..e789c1914af --- /dev/null +++ b/apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response400.ts @@ -0,0 +1,43 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Etherpad API + * Etherpad is a real-time collaborative editor scalable to thousands of simultaneous real time users. It provides full data export capabilities, and runs on your server, under your control. + * + * The version of the OpenAPI document: 1.3.0 + * Contact: support@example.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +/** + * + * @export + * @interface InlineResponse400 + */ +export interface InlineResponse400 { + /** + * + * @type {number} + * @memberof InlineResponse400 + */ + code?: number; + /** + * + * @type {string} + * @memberof InlineResponse400 + */ + message?: string; + /** + * + * @type {object} + * @memberof InlineResponse400 + */ + data?: object; +} + + diff --git a/apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response401.ts b/apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response401.ts new file mode 100644 index 00000000000..aae7fca505c --- /dev/null +++ b/apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response401.ts @@ -0,0 +1,43 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Etherpad API + * Etherpad is a real-time collaborative editor scalable to thousands of simultaneous real time users. It provides full data export capabilities, and runs on your server, under your control. + * + * The version of the OpenAPI document: 1.3.0 + * Contact: support@example.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +/** + * + * @export + * @interface InlineResponse401 + */ +export interface InlineResponse401 { + /** + * + * @type {number} + * @memberof InlineResponse401 + */ + code?: number; + /** + * + * @type {string} + * @memberof InlineResponse401 + */ + message?: string; + /** + * + * @type {object} + * @memberof InlineResponse401 + */ + data?: object; +} + + diff --git a/apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response500.ts b/apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response500.ts new file mode 100644 index 00000000000..7d49e7559c6 --- /dev/null +++ b/apps/server/src/infra/etherpad-client/etherpad-api-client/models/inline-response500.ts @@ -0,0 +1,43 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Etherpad API + * Etherpad is a real-time collaborative editor scalable to thousands of simultaneous real time users. It provides full data export capabilities, and runs on your server, under your control. + * + * The version of the OpenAPI document: 1.3.0 + * Contact: support@example.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +/** + * + * @export + * @interface InlineResponse500 + */ +export interface InlineResponse500 { + /** + * + * @type {number} + * @memberof InlineResponse500 + */ + code?: number; + /** + * + * @type {string} + * @memberof InlineResponse500 + */ + message?: string; + /** + * + * @type {object} + * @memberof InlineResponse500 + */ + data?: object; +} + + diff --git a/apps/server/src/infra/etherpad-client/etherpad-api-client/models/message.ts b/apps/server/src/infra/etherpad-client/etherpad-api-client/models/message.ts new file mode 100644 index 00000000000..ffb1c4a66c1 --- /dev/null +++ b/apps/server/src/infra/etherpad-client/etherpad-api-client/models/message.ts @@ -0,0 +1,49 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Etherpad API + * Etherpad is a real-time collaborative editor scalable to thousands of simultaneous real time users. It provides full data export capabilities, and runs on your server, under your control. + * + * The version of the OpenAPI document: 1.3.0 + * Contact: support@example.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +/** + * + * @export + * @interface Message + */ +export interface Message { + /** + * + * @type {string} + * @memberof Message + */ + text?: string; + /** + * + * @type {string} + * @memberof Message + */ + userId?: string; + /** + * + * @type {string} + * @memberof Message + */ + userName?: string; + /** + * + * @type {number} + * @memberof Message + */ + time?: number; +} + + diff --git a/apps/server/src/infra/etherpad-client/etherpad-api-client/models/session-info.ts b/apps/server/src/infra/etherpad-client/etherpad-api-client/models/session-info.ts new file mode 100644 index 00000000000..17c8fa938c0 --- /dev/null +++ b/apps/server/src/infra/etherpad-client/etherpad-api-client/models/session-info.ts @@ -0,0 +1,49 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Etherpad API + * Etherpad is a real-time collaborative editor scalable to thousands of simultaneous real time users. It provides full data export capabilities, and runs on your server, under your control. + * + * The version of the OpenAPI document: 1.3.0 + * Contact: support@example.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +/** + * + * @export + * @interface SessionInfo + */ +export interface SessionInfo { + /** + * + * @type {string} + * @memberof SessionInfo + */ + id?: string; + /** + * + * @type {string} + * @memberof SessionInfo + */ + authorID?: string; + /** + * + * @type {string} + * @memberof SessionInfo + */ + groupID?: string; + /** + * + * @type {number} + * @memberof SessionInfo + */ + validUntil?: number; +} + + diff --git a/apps/server/src/infra/etherpad-client/etherpad-api-client/models/user-info.ts b/apps/server/src/infra/etherpad-client/etherpad-api-client/models/user-info.ts new file mode 100644 index 00000000000..a659aa73e6d --- /dev/null +++ b/apps/server/src/infra/etherpad-client/etherpad-api-client/models/user-info.ts @@ -0,0 +1,49 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Etherpad API + * Etherpad is a real-time collaborative editor scalable to thousands of simultaneous real time users. It provides full data export capabilities, and runs on your server, under your control. + * + * The version of the OpenAPI document: 1.3.0 + * Contact: support@example.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +/** + * + * @export + * @interface UserInfo + */ +export interface UserInfo { + /** + * + * @type {string} + * @memberof UserInfo + */ + id?: string; + /** + * + * @type {string} + * @memberof UserInfo + */ + colorId?: string; + /** + * + * @type {string} + * @memberof UserInfo + */ + name?: string; + /** + * + * @type {number} + * @memberof UserInfo + */ + timestamp?: number; +} + + diff --git a/apps/server/src/infra/etherpad-client/etherpad-client.adapter.spec.ts b/apps/server/src/infra/etherpad-client/etherpad-client.adapter.spec.ts new file mode 100644 index 00000000000..53e69c3926d --- /dev/null +++ b/apps/server/src/infra/etherpad-client/etherpad-client.adapter.spec.ts @@ -0,0 +1,626 @@ +import { createMock, DeepMocked } from '@golevelup/ts-jest'; +import { Test, TestingModule } from '@nestjs/testing'; +import { AxiosResponse } from 'axios'; +import { + AuthorApi, + GroupApi, + InlineResponse200, + InlineResponse2001, + InlineResponse2002, + InlineResponse2003, + InlineResponse2004, + InlineResponse2006, + SessionApi, +} from './etherpad-api-client'; +import { EtherpadClientAdapter } from './etherpad-client.adapter'; +import { EtherpadErrorType } from './interface'; +import { EtherpadErrorLoggableException } from './loggable'; + +describe(EtherpadClientAdapter.name, () => { + let module: TestingModule; + let service: EtherpadClientAdapter; + let groupApi: DeepMocked; + let sessionApi: DeepMocked; + let authorApi: DeepMocked; + + beforeAll(async () => { + module = await Test.createTestingModule({ + providers: [ + EtherpadClientAdapter, + { + provide: GroupApi, + useValue: createMock(), + }, + { + provide: SessionApi, + useValue: createMock(), + }, + { + provide: AuthorApi, + useValue: createMock(), + }, + ], + }).compile(); + + service = module.get(EtherpadClientAdapter); + sessionApi = module.get(SessionApi); + authorApi = module.get(AuthorApi); + groupApi = module.get(GroupApi); + }); + + afterAll(async () => { + await module.close(); + }); + + afterEach(() => { + jest.resetAllMocks(); + }); + + it('should be defined', () => { + expect(service).toBeDefined(); + }); + + describe('getOrCreateAuthorId', () => { + describe('when createAuthorIfNotExistsForUsingGET resolves succesful', () => { + const setup = () => { + const userId = 'userId'; + const username = 'username'; + const response = createMock>({ + data: { + data: { authorID: 'authorId' }, + }, + }); + + authorApi.createAuthorIfNotExistsForUsingGET.mockResolvedValue(response); + return { userId, username }; + }; + + it('should return author id', async () => { + const { userId, username } = setup(); + + const result = await service.getOrCreateAuthorId(userId, username); + + expect(result).toBe('authorId'); + }); + + it('should call createAuthorIfNotExistsForUsingGET with correct params', async () => { + const { userId, username } = setup(); + + await service.getOrCreateAuthorId(userId, username); + + expect(authorApi.createAuthorIfNotExistsForUsingGET).toBeCalledWith(userId, username); + }); + }); + + describe('when createAuthorIfNotExistsForUsingGET response is empty', () => { + const setup = () => { + const userId = 'userId'; + const username = 'username'; + const response = createMock>({ + data: { + data: {}, + }, + }); + + authorApi.createAuthorIfNotExistsForUsingGET.mockResolvedValue(response); + return { userId, username }; + }; + + it('should throw an error', async () => { + const { userId, username } = setup(); + + await expect(service.getOrCreateAuthorId(userId, username)).rejects.toThrowError('Author could not be created'); + }); + }); + + describe('when createAuthorIfNotExistsForUsingGET returns error', () => { + const setup = () => { + const userId = 'userId'; + const username = 'username'; + + authorApi.createAuthorIfNotExistsForUsingGET.mockRejectedValueOnce(new Error('error')); + + return { userId, username }; + }; + + it('should throw EtherpadErrorLoggableException', async () => { + const { userId, username } = setup(); + + await expect(service.getOrCreateAuthorId(userId, username)).rejects.toThrowError( + EtherpadErrorLoggableException + ); + }); + }); + }); + + describe('getOrCreateSessionId', () => { + describe('when session already exists', () => { + const setup = () => { + const groupId = 'groupId'; + const authorId = 'authorId'; + const parentId = 'parentId'; + const sessionCookieExpire = new Date(); + const response = createMock>({ + data: { + data: { sessionID: 'sessionId' }, + }, + }); + + const listSessionsResponse = createMock>({ + data: { + data: { + // @ts-expect-error wrong type mapping + 'session-id-1': { groupID: groupId, authorID: authorId }, + 'session-id-2': { groupID: 'other-group-id', authorID: 'other-author-id' }, + }, + }, + }); + + authorApi.listSessionsOfAuthorUsingGET.mockResolvedValue(listSessionsResponse); + + sessionApi.createSessionUsingGET.mockResolvedValue(response); + return { groupId, authorId, parentId, sessionCookieExpire }; + }; + + it('should return session id', async () => { + const { groupId, authorId, parentId, sessionCookieExpire } = setup(); + + const result = await service.getOrCreateSessionId(groupId, authorId, parentId, sessionCookieExpire); + + expect(result).toBe('session-id-1'); + }); + + it('should not call createSessionUsingGET', async () => { + const { groupId, authorId, parentId, sessionCookieExpire } = setup(); + + await service.getOrCreateSessionId(groupId, authorId, parentId, sessionCookieExpire); + + expect(sessionApi.createSessionUsingGET).not.toBeCalled(); + }); + }); + + describe('when session does not exist', () => { + const setup = () => { + const groupId = 'groupId'; + const authorId = 'authorId'; + const parentId = 'parentId'; + const sessionCookieExpire = new Date(); + const response = createMock>({ + data: { + data: { sessionID: 'sessionId' }, + }, + }); + + const listSessionsResponse = createMock>({ + data: { + data: {}, + }, + }); + + authorApi.listSessionsOfAuthorUsingGET.mockResolvedValue(listSessionsResponse); + sessionApi.createSessionUsingGET.mockResolvedValue(response); + return { groupId, authorId, parentId, sessionCookieExpire }; + }; + + it('should return session id', async () => { + const { groupId, authorId, parentId, sessionCookieExpire } = setup(); + + const result = await service.getOrCreateSessionId(groupId, authorId, parentId, sessionCookieExpire); + + expect(result).toBe('sessionId'); + }); + + it('should call createSessionUsingGET with correct params', async () => { + const { groupId, authorId, parentId, sessionCookieExpire } = setup(); + + await service.getOrCreateSessionId(groupId, authorId, parentId, sessionCookieExpire); + + expect(sessionApi.createSessionUsingGET).toBeCalledWith( + groupId, + authorId, + sessionCookieExpire.getTime().toString() + ); + }); + }); + + describe('when createSessionUsingGET response is empty', () => { + const setup = () => { + const groupId = 'groupId'; + const authorId = 'authorId'; + const parentId = 'parentId'; + const sessionCookieExpire = new Date(); + const listSessionsResponse = createMock>({ + data: { + data: {}, + }, + }); + + authorApi.listSessionsOfAuthorUsingGET.mockResolvedValue(listSessionsResponse); + + const response = createMock>({ + data: { + data: {}, + }, + }); + + sessionApi.createSessionUsingGET.mockResolvedValue(response); + return { groupId, authorId, parentId, sessionCookieExpire }; + }; + + it('should throw an error', async () => { + const { groupId, authorId, parentId, sessionCookieExpire } = setup(); + + await expect( + service.getOrCreateSessionId(groupId, authorId, parentId, sessionCookieExpire) + ).rejects.toThrowError('Session could not be created'); + }); + }); + + describe('when createSessionUsingGET returns error', () => { + const setup = () => { + const groupId = 'groupId'; + const authorId = 'authorId'; + const parentId = 'parentId'; + const sessionCookieExpire = new Date(); + const listSessionsResponse = createMock>({ + data: { + data: {}, + }, + }); + + authorApi.listSessionsOfAuthorUsingGET.mockResolvedValue(listSessionsResponse); + + sessionApi.createSessionUsingGET.mockRejectedValueOnce(new Error('error')); + return { groupId, authorId, parentId, sessionCookieExpire }; + }; + + it('should throw EtherpadErrorLoggableException', async () => { + const { groupId, authorId, parentId, sessionCookieExpire } = setup(); + + await expect( + service.getOrCreateSessionId(groupId, authorId, parentId, sessionCookieExpire) + ).rejects.toThrowError(EtherpadErrorLoggableException); + }); + }); + }); + + describe('listSessionIdsOfAuthor', () => { + describe('when author has sessions', () => { + const setup = () => { + const authorId = 'authorId'; + const response = createMock>({ + data: { + // @ts-expect-error wrong type mapping + data: { 'session-id-1': { groupID: 'groupId', authorID: authorId } }, + }, + }); + + authorApi.listSessionsOfAuthorUsingGET.mockResolvedValue(response); + return authorId; + }; + + it('should return session ids', async () => { + const authorId = setup(); + + const result = await service.listSessionIdsOfAuthor(authorId); + + expect(result).toEqual(['session-id-1']); + }); + }); + + describe('when author has no sessions', () => { + const setup = () => { + const authorId = 'authorId'; + const response = createMock>({ + data: { + data: {}, + }, + }); + + authorApi.listSessionsOfAuthorUsingGET.mockResolvedValue(response); + return authorId; + }; + + it('should return empty array', async () => { + const authorId = setup(); + + const result = await service.listSessionIdsOfAuthor(authorId); + + expect(result).toEqual([]); + }); + }); + + describe('when listSessionsOfAuthorUsingGET returns error', () => { + const setup = () => { + const authorId = 'authorId'; + + authorApi.listSessionsOfAuthorUsingGET.mockRejectedValueOnce(new Error('error')); + + return authorId; + }; + + it('should throw EtherpadErrorLoggableException', async () => { + const authorId = setup(); + + await expect(service.listSessionIdsOfAuthor(authorId)).rejects.toThrowError(EtherpadErrorLoggableException); + }); + }); + }); + + describe('getOrCreateGroupId', () => { + describe('when group does not exist', () => { + const setup = () => { + const parentId = 'parentId'; + const response = createMock>({ + data: { + data: { groupID: 'groupId' }, + }, + }); + + groupApi.createGroupIfNotExistsForUsingGET.mockResolvedValue(response); + return parentId; + }; + + it('should return group id', async () => { + const parentId = setup(); + + const result = await service.getOrCreateGroupId(parentId); + + expect(result).toBe('groupId'); + }); + + it('should call createGroupIfNotExistsForUsingGET with correct params', async () => { + const parentId = setup(); + + await service.getOrCreateGroupId(parentId); + + expect(groupApi.createGroupIfNotExistsForUsingGET).toBeCalledWith(parentId); + }); + }); + + describe('when createGroupIfNotExistsForUsingGET response is empty', () => { + const setup = () => { + const parentId = 'parentId'; + const response = createMock>({ + data: {}, + }); + + groupApi.createGroupIfNotExistsForUsingGET.mockResolvedValue(response); + return parentId; + }; + + it('should throw an error', async () => { + const parentId = setup(); + + await expect(service.getOrCreateGroupId(parentId)).rejects.toThrowError('Group could not be created'); + }); + }); + + describe('when createGroupIfNotExistsForUsingGET returns an error', () => { + const setup = () => { + const parentId = 'parentId'; + + groupApi.createGroupIfNotExistsForUsingGET.mockRejectedValueOnce(new Error('error')); + + return parentId; + }; + + it('should throw EtherpadErrorLoggableException', async () => { + const parentId = setup(); + + await expect(service.getOrCreateGroupId(parentId)).rejects.toThrowError(EtherpadErrorLoggableException); + }); + }); + }); + + describe('getOrCreateEtherpadId', () => { + describe('when pad does not exist', () => { + const setup = () => { + const groupId = 'groupId'; + const parentId = 'parentId'; + const response = createMock>({ + data: { + data: { padID: 'padId' }, + }, + }); + + const listPadsResponse = createMock>({ + data: { + data: { padIDs: [] }, + }, + }); + + groupApi.listPadsUsingGET.mockResolvedValue(listPadsResponse); + groupApi.createGroupPadUsingGET.mockResolvedValue(response); + return { groupId, parentId }; + }; + + it('should return pad id', async () => { + const { groupId, parentId } = setup(); + + const result = await service.getOrCreateEtherpadId(groupId, parentId); + + expect(result).toBe('padId'); + }); + + it('should call createGroupPadUsingGET with correct params', async () => { + const { groupId, parentId } = setup(); + + await service.getOrCreateEtherpadId(groupId, parentId); + + expect(groupApi.createGroupPadUsingGET).toBeCalledWith(groupId, parentId); + }); + }); + + describe('when pad exists', () => { + const setup = () => { + const groupId = 'groupId'; + const parentId = 'parentId'; + const response = createMock>({ + data: { + data: { padIDs: ['groupId$parentId'] }, + }, + }); + + groupApi.listPadsUsingGET.mockResolvedValue(response); + return { groupId, parentId }; + }; + + it('should return pad id', async () => { + const { groupId, parentId } = setup(); + + const result = await service.getOrCreateEtherpadId(groupId, parentId); + + expect(result).toBe('groupId$parentId'); + }); + + it('should not call createGroupPadUsingGET', async () => { + const { groupId, parentId } = setup(); + + await service.getOrCreateEtherpadId(groupId, parentId); + + expect(groupApi.createGroupPadUsingGET).not.toBeCalled(); + }); + }); + + describe('when createGroupPadUsingGET response is empty', () => { + const setup = () => { + const groupId = 'groupId'; + const parentId = 'parentId'; + const listPadsResponse = createMock>({ + data: { + data: { padIDs: [] }, + }, + }); + const response = createMock>({ + data: { + data: {}, + }, + }); + + groupApi.listPadsUsingGET.mockResolvedValue(listPadsResponse); + groupApi.createGroupPadUsingGET.mockResolvedValue(response); + return { groupId, parentId }; + }; + + it('should throw an error', async () => { + const { groupId, parentId } = setup(); + + await expect(service.getOrCreateEtherpadId(groupId, parentId)).rejects.toThrowError('Pad could not be created'); + }); + }); + + describe('when createGroupPadUsingGET returns error', () => { + const setup = () => { + const groupId = 'groupId'; + const parentId = 'parentId'; + const listPadsResponse = createMock>({ + data: { + data: { padIDs: [] }, + }, + }); + + groupApi.listPadsUsingGET.mockResolvedValue(listPadsResponse); + groupApi.createGroupPadUsingGET.mockRejectedValueOnce(new Error('error')); + + return { groupId, parentId }; + }; + + it('should throw EtherpadErrorLoggableException', async () => { + const { groupId, parentId } = setup(); + + await expect(service.getOrCreateEtherpadId(groupId, parentId)).rejects.toThrowError( + EtherpadErrorLoggableException + ); + }); + }); + + describe('when listPadsUsingGET returns error', () => { + const setup = () => { + const groupId = 'groupId'; + const parentId = 'parentId'; + + groupApi.listPadsUsingGET.mockRejectedValueOnce(new Error('error')); + + return { groupId, parentId }; + }; + + it('should throw EtherpadErrorLoggableException', async () => { + const { groupId, parentId } = setup(); + + await expect(service.getOrCreateEtherpadId(groupId, parentId)).rejects.toThrowError( + EtherpadErrorLoggableException + ); + }); + }); + }); + + describe('handleResponse', () => { + const setup = (code = 0) => { + const parentId = 'parentId'; + const response = createMock>({ + data: { + code, + data: { groupID: 'groupId' }, + }, + }); + + groupApi.createGroupIfNotExistsForUsingGET.mockResolvedValue(response); + return parentId; + }; + + describe('wehn status code is 0', () => { + it('should return data', async () => { + const parentId = setup(); + + const result = await service.getOrCreateGroupId(parentId); + + expect(result).toEqual('groupId'); + }); + }); + + describe('when status code is 1', () => { + it('should throw an error', async () => { + const parentId = setup(1); + + const result = service.getOrCreateGroupId(parentId); + + await expect(result).rejects.toThrowError(EtherpadErrorType.BAD_REQUEST); + await expect(result).rejects.toThrowError(EtherpadErrorLoggableException); + }); + }); + + describe('when status code is 2', () => { + it('should throw an error', async () => { + const parentId = setup(2); + + const result = service.getOrCreateGroupId(parentId); + + await expect(result).rejects.toThrowError(EtherpadErrorType.INTERNAL_ERROR); + await expect(result).rejects.toThrowError(EtherpadErrorLoggableException); + }); + }); + + describe('when status code is 3', () => { + it('should throw an error', async () => { + const parentId = setup(3); + + const result = service.getOrCreateGroupId(parentId); + + await expect(result).rejects.toThrowError(EtherpadErrorType.FUNCTION_NOT_FOUND); + await expect(result).rejects.toThrowError(EtherpadErrorLoggableException); + }); + }); + + describe('when status code is 4', () => { + it('should throw an error', async () => { + const parentId = setup(4); + + const result = service.getOrCreateGroupId(parentId); + + await expect(result).rejects.toThrowError(EtherpadErrorType.WRONG_API_KEY); + await expect(result).rejects.toThrowError(EtherpadErrorLoggableException); + }); + }); + }); +}); diff --git a/apps/server/src/infra/etherpad-client/etherpad-client.adapter.ts b/apps/server/src/infra/etherpad-client/etherpad-client.adapter.ts new file mode 100644 index 00000000000..f73c841c671 --- /dev/null +++ b/apps/server/src/infra/etherpad-client/etherpad-client.adapter.ts @@ -0,0 +1,210 @@ +import { Injectable } from '@nestjs/common'; +import { EntityId } from '@shared/domain/types'; +import { AxiosResponse } from 'axios'; +import { + InlineResponse200, + InlineResponse2001, + InlineResponse2002, + InlineResponse2003, + InlineResponse2004, + InlineResponse2006, + InlineResponse2006Data, +} from './etherpad-api-client'; +import { AuthorApi, GroupApi, SessionApi } from './etherpad-api-client/api'; +import { AuthorId, EtherpadErrorType, EtherpadParams, EtherpadResponse, GroupId, PadId, SessionId } from './interface'; +import { EtherpadResponseMapper } from './mappers'; + +@Injectable() +export class EtherpadClientAdapter { + constructor( + private readonly groupApi: GroupApi, + private readonly sessionApi: SessionApi, + private readonly authorApi: AuthorApi + ) {} + + public async getOrCreateAuthorId(userId: EntityId, username: string): Promise { + const response = await this.tryCreateAuthor(userId, username); + const user = this.handleResponse(response, { userId }); + + const authorId = EtherpadResponseMapper.mapToAuthorResponse(user); + + return authorId; + } + + private async tryCreateAuthor(userId: string, username: string): Promise> { + try { + const response = await this.authorApi.createAuthorIfNotExistsForUsingGET(userId, username); + + return response; + } catch (error) { + throw EtherpadResponseMapper.mapResponseToException(EtherpadErrorType.CONNECTION_ERROR, { userId }, error); + } + } + + public async getOrCreateSessionId( + groupId: GroupId, + authorId: AuthorId, + parentId: EntityId, + sessionCookieExpire: Date + ): Promise { + let sessionId: SessionId | undefined; + sessionId = await this.getSessionIdByGroupAndAuthor(groupId, authorId); + + if (sessionId) { + return sessionId; + } + + const response = await this.tryCreateSession(groupId, authorId, sessionCookieExpire); + const session = this.handleResponse(response, { parentId }); + + sessionId = EtherpadResponseMapper.mapToSessionResponse(session); + + return sessionId; + } + + private async tryCreateSession( + groupId: string, + authorId: string, + sessionCookieExpire: Date + ): Promise> { + try { + const response = await this.sessionApi.createSessionUsingGET( + groupId, + authorId, + sessionCookieExpire.getTime().toString() + ); + + return response; + } catch (error) { + throw EtherpadResponseMapper.mapResponseToException(EtherpadErrorType.CONNECTION_ERROR, { authorId }, error); + } + } + + private async getSessionIdByGroupAndAuthor(groupId: GroupId, authorId: AuthorId): Promise { + let sessionId: SessionId | undefined; + + const response = await this.tryListSessionsOfAuthor(authorId); + const sessions = this.handleResponse(response, { groupId, authorId }); + + if (sessions) { + sessionId = this.findSessionId(sessions, groupId, authorId); + } + + return sessionId; + } + + private findSessionId(sessions: InlineResponse2006Data, groupId: string, authorId: string): string | undefined { + const sessionEntries = Object.entries(sessions); + const sessionId = sessionEntries.map(([key, value]: [string, { groupID: string; authorID: string }]) => { + if (value.groupID === groupId && value.authorID === authorId) { + return key; + } + + return undefined; + }); + + return sessionId[0]; + } + + public async listSessionIdsOfAuthor(authorId: AuthorId): Promise { + const response = await this.tryListSessionsOfAuthor(authorId); + const sessions = this.handleResponse(response, { authorId }); + + const sessionIds = Object.keys(sessions as object); + + return sessionIds; + } + + private async tryListSessionsOfAuthor(authorId: string): Promise> { + try { + const response = await this.authorApi.listSessionsOfAuthorUsingGET(authorId); + + return response; + } catch (error) { + throw EtherpadResponseMapper.mapResponseToException(EtherpadErrorType.CONNECTION_ERROR, { authorId }, error); + } + } + + public async getOrCreateGroupId(parentId: EntityId): Promise { + const groupResponse = await this.tryGetOrCreateGroup(parentId); + const group = this.handleResponse(groupResponse, { parentId }); + + const groupId = EtherpadResponseMapper.mapToGroupResponse(group); + + return groupId; + } + + private async tryGetOrCreateGroup(parentId: string): Promise> { + try { + const response = await this.groupApi.createGroupIfNotExistsForUsingGET(parentId); + + return response; + } catch (error) { + throw EtherpadResponseMapper.mapResponseToException(EtherpadErrorType.CONNECTION_ERROR, { parentId }, error); + } + } + + public async getOrCreateEtherpadId(groupId: GroupId, parentId: EntityId): Promise { + let padId: PadId | undefined; + + padId = await this.getPadId(groupId, parentId); + + if (!padId) { + const padResponse = await this.tryCreateEtherpad(groupId, parentId); + const pad = this.handleResponse(padResponse, { parentId }); + + padId = EtherpadResponseMapper.mapToPadResponse(pad); + } + + return padId; + } + + private async tryCreateEtherpad(groupId: string, parentId: string): Promise> { + try { + const response = await this.groupApi.createGroupPadUsingGET(groupId, parentId); + + return response; + } catch (error) { + throw EtherpadResponseMapper.mapResponseToException(EtherpadErrorType.CONNECTION_ERROR, { groupId }, error); + } + } + + private async getPadId(groupId: GroupId, parentId: EntityId): Promise { + const padsResponse = await this.tryListPads(groupId); + const pads = this.handleResponse(padsResponse, { parentId }); + + const padId = pads?.padIDs?.find((id: string) => id.includes(`${groupId}$${parentId}`)); + + return padId; + } + + private async tryListPads(groupId: string): Promise> { + try { + const response = await this.groupApi.listPadsUsingGET(groupId); + + return response; + } catch (error) { + throw EtherpadResponseMapper.mapResponseToException(EtherpadErrorType.CONNECTION_ERROR, { groupId }, error); + } + } + + private handleResponse( + axiosResponse: AxiosResponse, + payload: EtherpadParams + ): T['data'] { + const response = axiosResponse.data; + + switch (response.code) { + case 1: + throw EtherpadResponseMapper.mapResponseToException(EtherpadErrorType.BAD_REQUEST, payload, response); + case 2: + throw EtherpadResponseMapper.mapResponseToException(EtherpadErrorType.INTERNAL_ERROR, payload, response); + case 3: + throw EtherpadResponseMapper.mapResponseToException(EtherpadErrorType.FUNCTION_NOT_FOUND, payload, response); + case 4: + throw EtherpadResponseMapper.mapResponseToException(EtherpadErrorType.WRONG_API_KEY, payload, response); + default: + return response.data as T['data']; + } + } +} diff --git a/apps/server/src/infra/etherpad-client/etherpad-client.module.ts b/apps/server/src/infra/etherpad-client/etherpad-client.module.ts new file mode 100644 index 00000000000..3230fcf1c48 --- /dev/null +++ b/apps/server/src/infra/etherpad-client/etherpad-client.module.ts @@ -0,0 +1,45 @@ +import { DynamicModule, Module } from '@nestjs/common'; +import { AuthorApi, GroupApi, SessionApi } from './etherpad-api-client/api'; +import { Configuration, ConfigurationParameters } from './etherpad-api-client/configuration'; +import { EtherpadClientAdapter } from './etherpad-client.adapter'; + +export interface EtherpadClientConfig extends ConfigurationParameters { + apiKey?: string; + basePath?: string; +} + +@Module({}) +export class EtherpadClientModule { + static register(config: EtherpadClientConfig): DynamicModule { + const providers = [ + EtherpadClientAdapter, + { + provide: GroupApi, + useFactory: () => { + const configuration = new Configuration(config); + return new GroupApi(configuration); + }, + }, + { + provide: SessionApi, + useFactory: () => { + const configuration = new Configuration(config); + return new SessionApi(configuration); + }, + }, + { + provide: AuthorApi, + useFactory: () => { + const configuration = new Configuration(config); + return new AuthorApi(configuration); + }, + }, + ]; + + return { + module: EtherpadClientModule, + providers, + exports: [EtherpadClientAdapter], + }; + } +} diff --git a/apps/server/src/infra/etherpad-client/index.ts b/apps/server/src/infra/etherpad-client/index.ts new file mode 100644 index 00000000000..256dd9f0354 --- /dev/null +++ b/apps/server/src/infra/etherpad-client/index.ts @@ -0,0 +1,2 @@ +export { EtherpadClientAdapter } from './etherpad-client.adapter'; +export { EtherpadClientConfig, EtherpadClientModule } from './etherpad-client.module'; diff --git a/apps/server/src/infra/etherpad-client/interface/etherpad-error-type.enum.ts b/apps/server/src/infra/etherpad-client/interface/etherpad-error-type.enum.ts new file mode 100644 index 00000000000..f997879f197 --- /dev/null +++ b/apps/server/src/infra/etherpad-client/interface/etherpad-error-type.enum.ts @@ -0,0 +1,7 @@ +export enum EtherpadErrorType { + BAD_REQUEST = 'BAD_REQUEST', + INTERNAL_ERROR = 'INTERNAL_ERROR', + FUNCTION_NOT_FOUND = 'FUNCTION_NOT_FOUND', + WRONG_API_KEY = 'WRONG_API_KEY', + CONNECTION_ERROR = 'CONNECTION_ERROR', +} diff --git a/apps/server/src/infra/etherpad-client/interface/index.ts b/apps/server/src/infra/etherpad-client/interface/index.ts new file mode 100644 index 00000000000..e087de15d39 --- /dev/null +++ b/apps/server/src/infra/etherpad-client/interface/index.ts @@ -0,0 +1,2 @@ +export * from './etherpad-error-type.enum'; +export * from './payloads.interface'; diff --git a/apps/server/src/infra/etherpad-client/interface/payloads.interface.ts b/apps/server/src/infra/etherpad-client/interface/payloads.interface.ts new file mode 100644 index 00000000000..83a96b59834 --- /dev/null +++ b/apps/server/src/infra/etherpad-client/interface/payloads.interface.ts @@ -0,0 +1,21 @@ +import { EntityId } from '@shared/domain/types'; + +export type AuthorId = string; +export type GroupId = string; +export type SessionId = string; +export type PadId = string; + +export interface EtherpadParams { + userId?: EntityId; + parentId?: EntityId; + groupId?: GroupId; + authorId?: AuthorId; + sessionId?: SessionId; + padId?: PadId; +} + +export interface EtherpadResponse { + code?: number; + message?: string; + data?: unknown; +} diff --git a/apps/server/src/infra/etherpad-client/loggable/etherpad-error-loggable-exception.ts b/apps/server/src/infra/etherpad-client/loggable/etherpad-error-loggable-exception.ts new file mode 100644 index 00000000000..93fa4140076 --- /dev/null +++ b/apps/server/src/infra/etherpad-client/loggable/etherpad-error-loggable-exception.ts @@ -0,0 +1,28 @@ +import { HttpExceptionOptions, InternalServerErrorException } from '@nestjs/common'; +import { ErrorLogMessage, Loggable } from '@src/core/logger'; +import { EtherpadErrorType, EtherpadParams } from '../interface'; + +export class EtherpadErrorLoggableException extends InternalServerErrorException implements Loggable { + constructor( + private readonly type: EtherpadErrorType, + private readonly payload: EtherpadParams, + private readonly exceptionOptions: HttpExceptionOptions + ) { + super(type, exceptionOptions); + } + + getLogMessage(): ErrorLogMessage { + const { userId, parentId } = this.payload; + + const message: ErrorLogMessage = { + type: this.type, + stack: this.stack, + data: { + userId, + parentId, + }, + }; + + return message; + } +} diff --git a/apps/server/src/infra/etherpad-client/loggable/etherpad-server-error-exception.spec.ts b/apps/server/src/infra/etherpad-client/loggable/etherpad-server-error-exception.spec.ts new file mode 100644 index 00000000000..63cbfadfabb --- /dev/null +++ b/apps/server/src/infra/etherpad-client/loggable/etherpad-server-error-exception.spec.ts @@ -0,0 +1,29 @@ +import { ErrorUtils } from '@src/core/error/utils'; +import { EtherpadErrorType } from '../interface'; +import { EtherpadErrorLoggableException } from './etherpad-error-loggable-exception'; + +describe('EtherpadErrorLoggableException', () => { + describe('getLogMessage', () => { + it('should return log message', () => { + const type = EtherpadErrorType.BAD_REQUEST; + const payload = { + userId: 'userId', + parentId: 'parentId', + }; + const error = new Error('error'); + const httpExceptionOptions = ErrorUtils.createHttpExceptionOptions(error); + + const exception = new EtherpadErrorLoggableException(type, payload, httpExceptionOptions); + const result = exception.getLogMessage(); + + expect(result).toStrictEqual({ + type: 'BAD_REQUEST', + stack: exception.stack, + data: { + userId: 'userId', + parentId: 'parentId', + }, + }); + }); + }); +}); diff --git a/apps/server/src/infra/etherpad-client/loggable/index.ts b/apps/server/src/infra/etherpad-client/loggable/index.ts new file mode 100644 index 00000000000..51498c1094f --- /dev/null +++ b/apps/server/src/infra/etherpad-client/loggable/index.ts @@ -0,0 +1 @@ +export * from './etherpad-error-loggable-exception'; diff --git a/apps/server/src/infra/etherpad-client/mappers/etherpad-response.mapper.ts b/apps/server/src/infra/etherpad-client/mappers/etherpad-response.mapper.ts new file mode 100644 index 00000000000..a0dcf5d508f --- /dev/null +++ b/apps/server/src/infra/etherpad-client/mappers/etherpad-response.mapper.ts @@ -0,0 +1,52 @@ +import { ErrorUtils } from '@src/core/error/utils'; +import { InlineResponse2003Data, InlineResponse2004Data, InlineResponse200Data } from '../etherpad-api-client'; +import { AuthorId, EtherpadErrorType, EtherpadParams, EtherpadResponse, GroupId, PadId, SessionId } from '../interface'; +import { EtherpadErrorLoggableException } from '../loggable'; + +export class EtherpadResponseMapper { + static mapToSessionResponse(session?: InlineResponse2004Data): SessionId { + if (!session?.sessionID) { + throw new Error('Session could not be created'); + } + const sessionId = session.sessionID; + + return sessionId; + } + + static mapToAuthorResponse(author?: InlineResponse2003Data): AuthorId { + if (!author?.authorID) { + throw new Error('Author could not be created'); + } + const authorId = author.authorID; + + return authorId; + } + + static mapToGroupResponse(group?: InlineResponse200Data): GroupId { + if (!group?.groupID) { + throw new Error('Group could not be created'); + } + const groupId = group.groupID; + + return groupId; + } + + static mapToPadResponse(pad?: object): PadId { + // InlineResponse2001 has wrong type definition + if (pad && 'padID' in pad && pad.padID) { + const padId = pad.padID as string; + + return padId; + } + + throw new Error('Pad could not be created'); + } + + static mapResponseToException( + type: EtherpadErrorType, + payload: EtherpadParams, + response: T | Error + ): EtherpadErrorLoggableException { + return new EtherpadErrorLoggableException(type, payload, ErrorUtils.createHttpExceptionOptions(response.message)); + } +} diff --git a/apps/server/src/infra/etherpad-client/mappers/index.ts b/apps/server/src/infra/etherpad-client/mappers/index.ts new file mode 100644 index 00000000000..a387823b9c4 --- /dev/null +++ b/apps/server/src/infra/etherpad-client/mappers/index.ts @@ -0,0 +1 @@ +export * from './etherpad-response.mapper'; diff --git a/apps/server/src/modules/board/controller/api-test/content-element-create.api.spec.ts b/apps/server/src/modules/board/controller/api-test/content-element-create.api.spec.ts index 065e3bcabda..7fdbaf734e0 100644 --- a/apps/server/src/modules/board/controller/api-test/content-element-create.api.spec.ts +++ b/apps/server/src/modules/board/controller/api-test/content-element-create.api.spec.ts @@ -111,6 +111,16 @@ describe(`content element create (api)`, () => { expect((response.body as SubmissionContainerElementResponse).content.dueDate).toBeNull(); }); + it('should return the created content element of type COLABORATIVE_TEXT_EDITOR', async () => { + const { loggedInClient, cardNode } = await setup(); + + const response = await loggedInClient.post(`${cardNode.id}/elements`, { + type: ContentElementType.COLLABORATIVE_TEXT_EDITOR, + }); + + expect((response.body as AnyContentElementResponse).type).toEqual(ContentElementType.COLLABORATIVE_TEXT_EDITOR); + }); + it('should actually create the content element', async () => { const { loggedInClient, cardNode } = await setup(); const response = await loggedInClient.post(`${cardNode.id}/elements`, { type: ContentElementType.RICH_TEXT }); diff --git a/apps/server/src/modules/board/controller/dto/card/card.response.ts b/apps/server/src/modules/board/controller/dto/card/card.response.ts index 596e34b1549..31f8049e835 100644 --- a/apps/server/src/modules/board/controller/dto/card/card.response.ts +++ b/apps/server/src/modules/board/controller/dto/card/card.response.ts @@ -2,6 +2,7 @@ import { ApiExtraModels, ApiProperty, ApiPropertyOptional, getSchemaPath } from import { DecodeHtmlEntities } from '@shared/controller'; import { AnyContentElementResponse, + CollaborativeTextEditorElementResponse, DrawingElementResponse, ExternalToolElementResponse, FileElementResponse, @@ -18,7 +19,8 @@ import { VisibilitySettingsResponse } from './visibility-settings.response'; LinkElementResponse, RichTextElementResponse, DrawingElementResponse, - SubmissionContainerElementResponse + SubmissionContainerElementResponse, + CollaborativeTextEditorElementResponse ) export class CardResponse { constructor({ id, title, height, elements, visibilitySettings, timestamps }: CardResponse) { @@ -52,6 +54,7 @@ export class CardResponse { { $ref: getSchemaPath(RichTextElementResponse) }, { $ref: getSchemaPath(SubmissionContainerElementResponse) }, { $ref: getSchemaPath(DrawingElementResponse) }, + { $ref: getSchemaPath(CollaborativeTextEditorElementResponse) }, ], }, }) diff --git a/apps/server/src/modules/board/controller/dto/element/any-content-element.response.ts b/apps/server/src/modules/board/controller/dto/element/any-content-element.response.ts index ec3f1beb96c..fa77ed11755 100644 --- a/apps/server/src/modules/board/controller/dto/element/any-content-element.response.ts +++ b/apps/server/src/modules/board/controller/dto/element/any-content-element.response.ts @@ -1,5 +1,6 @@ -import { ExternalToolElementResponse } from './external-tool-element.response'; +import { CollaborativeTextEditorElementResponse } from './collaborative-text-editor-element.response'; import { DrawingElementResponse } from './drawing-element.response'; +import { ExternalToolElementResponse } from './external-tool-element.response'; import { FileElementResponse } from './file-element.response'; import { LinkElementResponse } from './link-element.response'; import { RichTextElementResponse } from './rich-text-element.response'; @@ -11,7 +12,8 @@ export type AnyContentElementResponse = | RichTextElementResponse | SubmissionContainerElementResponse | ExternalToolElementResponse - | DrawingElementResponse; + | DrawingElementResponse + | CollaborativeTextEditorElementResponse; export const isFileElementResponse = (element: AnyContentElementResponse): element is FileElementResponse => element instanceof FileElementResponse; diff --git a/apps/server/src/modules/board/controller/dto/element/collaborative-text-editor-element.response.ts b/apps/server/src/modules/board/controller/dto/element/collaborative-text-editor-element.response.ts new file mode 100644 index 00000000000..085ab02c082 --- /dev/null +++ b/apps/server/src/modules/board/controller/dto/element/collaborative-text-editor-element.response.ts @@ -0,0 +1,25 @@ +import { ApiProperty } from '@nestjs/swagger'; +import { ContentElementType } from '@shared/domain/domainobject'; +import { TimestampsResponse } from '../timestamps.response'; + +export class CollaborativeTextEditorElementResponse { + constructor(props: CollaborativeTextEditorElementResponse) { + this.id = props.id; + this.type = props.type; + this.timestamps = props.timestamps; + this.content = props.content; + } + + @ApiProperty({ pattern: '[a-f0-9]{24}' }) + id: string; + + @ApiProperty({ enum: ContentElementType, enumName: 'ContentElementType' }) + type: ContentElementType.COLLABORATIVE_TEXT_EDITOR; + + @ApiProperty() + timestamps: TimestampsResponse; + + // This is required due to the nuxt-client content element handling, but otherwise not used. + @ApiProperty() + content: object; +} diff --git a/apps/server/src/modules/board/controller/dto/element/index.ts b/apps/server/src/modules/board/controller/dto/element/index.ts index 3b85cb57f3f..73c8d08f93c 100644 --- a/apps/server/src/modules/board/controller/dto/element/index.ts +++ b/apps/server/src/modules/board/controller/dto/element/index.ts @@ -1,4 +1,5 @@ export * from './any-content-element.response'; +export * from './collaborative-text-editor-element.response'; export * from './create-content-element.body.params'; export * from './drawing-element.response'; export * from './external-tool-element.response'; diff --git a/apps/server/src/modules/board/controller/mapper/collaborative-text-editor-element-response.mapper.ts b/apps/server/src/modules/board/controller/mapper/collaborative-text-editor-element-response.mapper.ts new file mode 100644 index 00000000000..fcd768be342 --- /dev/null +++ b/apps/server/src/modules/board/controller/mapper/collaborative-text-editor-element-response.mapper.ts @@ -0,0 +1,32 @@ +import { ContentElementType } from '@shared/domain/domainobject'; +import { CollaborativeTextEditorElement } from '@shared/domain/domainobject/board/collaborative-text-editor-element.do'; +import { TimestampsResponse } from '../dto'; +import { CollaborativeTextEditorElementResponse } from '../dto/element/collaborative-text-editor-element.response'; +import { BaseResponseMapper } from './base-mapper.interface'; + +export class CollaborativeTextEditorElementResponseMapper implements BaseResponseMapper { + private static instance: CollaborativeTextEditorElementResponseMapper; + + public static getInstance(): CollaborativeTextEditorElementResponseMapper { + if (!CollaborativeTextEditorElementResponseMapper.instance) { + CollaborativeTextEditorElementResponseMapper.instance = new CollaborativeTextEditorElementResponseMapper(); + } + + return CollaborativeTextEditorElementResponseMapper.instance; + } + + mapToResponse(element: CollaborativeTextEditorElement): CollaborativeTextEditorElementResponse { + const result = new CollaborativeTextEditorElementResponse({ + id: element.id, + timestamps: new TimestampsResponse({ lastUpdatedAt: element.updatedAt, createdAt: element.createdAt }), + type: ContentElementType.COLLABORATIVE_TEXT_EDITOR, + content: {}, + }); + + return result; + } + + canMap(element: CollaborativeTextEditorElement): boolean { + return element instanceof CollaborativeTextEditorElement; + } +} diff --git a/apps/server/src/modules/board/controller/mapper/content-element-response.factory.ts b/apps/server/src/modules/board/controller/mapper/content-element-response.factory.ts index 9300890d684..b7cbd4726ed 100644 --- a/apps/server/src/modules/board/controller/mapper/content-element-response.factory.ts +++ b/apps/server/src/modules/board/controller/mapper/content-element-response.factory.ts @@ -3,11 +3,12 @@ import { AnyBoardDo, FileElement, RichTextElement } from '@shared/domain/domaino import { AnyContentElementResponse, FileElementResponse, + RichTextElementResponse, isFileElementResponse, isRichTextElementResponse, - RichTextElementResponse, } from '../dto'; import { BaseResponseMapper } from './base-mapper.interface'; +import { CollaborativeTextEditorElementResponseMapper } from './collaborative-text-editor-element-response.mapper'; import { DrawingElementResponseMapper } from './drawing-element-response.mapper'; import { ExternalToolElementResponseMapper } from './external-tool-element-response.mapper'; import { FileElementResponseMapper } from './file-element-response.mapper'; @@ -23,6 +24,7 @@ export class ContentElementResponseFactory { DrawingElementResponseMapper.getInstance(), SubmissionContainerElementResponseMapper.getInstance(), ExternalToolElementResponseMapper.getInstance(), + CollaborativeTextEditorElementResponseMapper.getInstance(), ]; static mapToResponse(element: AnyBoardDo): AnyContentElementResponse { diff --git a/apps/server/src/modules/board/controller/mapper/index.ts b/apps/server/src/modules/board/controller/mapper/index.ts index 34980b96de3..2d5e1b49937 100644 --- a/apps/server/src/modules/board/controller/mapper/index.ts +++ b/apps/server/src/modules/board/controller/mapper/index.ts @@ -1,5 +1,6 @@ export * from './board-response.mapper'; export * from './card-response.mapper'; +export * from './collaborative-text-editor-element-response.mapper'; export * from './column-response.mapper'; export * from './content-element-response.factory'; export * from './create-board-response.mapper'; diff --git a/apps/server/src/modules/board/repo/board-do.builder-impl.ts b/apps/server/src/modules/board/repo/board-do.builder-impl.ts index 82394678d82..c07dd333682 100644 --- a/apps/server/src/modules/board/repo/board-do.builder-impl.ts +++ b/apps/server/src/modules/board/repo/board-do.builder-impl.ts @@ -2,6 +2,7 @@ import { NotImplementedException } from '@nestjs/common'; import { AnyBoardDo, Card, + CollaborativeTextEditorElement, Column, ColumnBoard, DrawingElement, @@ -20,6 +21,7 @@ import { type BoardDoBuilder, type BoardNode, type CardNode, + type CollaborativeTextEditorElementNode, type ColumnBoardNode, type ColumnNode, type DrawingElementNode, @@ -90,6 +92,7 @@ export class BoardDoBuilderImpl implements BoardDoBuilder { BoardNodeType.DRAWING_ELEMENT, BoardNodeType.SUBMISSION_CONTAINER_ELEMENT, BoardNodeType.EXTERNAL_TOOL, + BoardNodeType.COLLABORATIVE_TEXT_EDITOR, ]); const elements = this.buildChildren< @@ -210,6 +213,19 @@ export class BoardDoBuilderImpl implements BoardDoBuilder { return element; } + buildCollaborativeTextEditorElement(boardNode: CollaborativeTextEditorElementNode): CollaborativeTextEditorElement { + this.ensureLeafNode(boardNode); + + const element: CollaborativeTextEditorElement = new CollaborativeTextEditorElement({ + id: boardNode.id, + children: [], + createdAt: boardNode.createdAt, + updatedAt: boardNode.updatedAt, + }); + + return element; + } + buildChildren(boardNode: BoardNode): T[] { const children = this.getChildren(boardNode).map((node) => node.useDoBuilder(this)); return children as T[]; diff --git a/apps/server/src/modules/board/repo/recursive-delete.visitor.spec.ts b/apps/server/src/modules/board/repo/recursive-delete.visitor.spec.ts index 46ebf91634e..e4215553641 100644 --- a/apps/server/src/modules/board/repo/recursive-delete.visitor.spec.ts +++ b/apps/server/src/modules/board/repo/recursive-delete.visitor.spec.ts @@ -6,6 +6,7 @@ import { DrawingElementAdapterService } from '@modules/tldraw-client'; import { ContextExternalToolService } from '@modules/tool/context-external-tool/service'; import { Test, TestingModule } from '@nestjs/testing'; import { + collaborativeTextEditorElementFactory, columnBoardFactory, columnFactory, contextExternalToolFactory, @@ -441,4 +442,28 @@ describe(RecursiveDeleteVisitor.name, () => { }); }); }); + + describe('visitCollaborativeTextEditorAsync', () => { + const setup = () => { + const childCollaborativeTextEditorElement = collaborativeTextEditorElementFactory.build(); + const collaborativeTextEditorElement = collaborativeTextEditorElementFactory.build({ + children: [childCollaborativeTextEditorElement], + }); + + return { collaborativeTextEditorElement, childCollaborativeTextEditorElement }; + }; + + it('should call entity remove', async () => { + const { collaborativeTextEditorElement, childCollaborativeTextEditorElement } = setup(); + + await service.visitCollaborativeTextEditorElementAsync(collaborativeTextEditorElement); + + expect(em.remove).toHaveBeenCalledWith( + em.getReference(collaborativeTextEditorElement.constructor, collaborativeTextEditorElement.id) + ); + expect(em.remove).toHaveBeenCalledWith( + em.getReference(childCollaborativeTextEditorElement.constructor, childCollaborativeTextEditorElement.id) + ); + }); + }); }); diff --git a/apps/server/src/modules/board/repo/recursive-delete.vistor.ts b/apps/server/src/modules/board/repo/recursive-delete.vistor.ts index 7e73321eaa2..a4b082097bc 100644 --- a/apps/server/src/modules/board/repo/recursive-delete.vistor.ts +++ b/apps/server/src/modules/board/repo/recursive-delete.vistor.ts @@ -8,6 +8,7 @@ import type { AnyBoardDo, BoardCompositeVisitorAsync, Card, + CollaborativeTextEditorElement, Column, ColumnBoard, DrawingElement, @@ -100,6 +101,13 @@ export class RecursiveDeleteVisitor implements BoardCompositeVisitorAsync { await this.visitChildrenAsync(externalToolElement); } + async visitCollaborativeTextEditorElementAsync( + collaborativeTextEditorElement: CollaborativeTextEditorElement + ): Promise { + this.deleteNode(collaborativeTextEditorElement); + await this.visitChildrenAsync(collaborativeTextEditorElement); + } + async visitMediaBoardAsync(mediaBoard: MediaBoard): Promise { this.deleteNode(mediaBoard); await this.visitChildrenAsync(mediaBoard); diff --git a/apps/server/src/modules/board/repo/recursive-save.visitor.spec.ts b/apps/server/src/modules/board/repo/recursive-save.visitor.spec.ts index b3a68c25e62..0b524e794dc 100644 --- a/apps/server/src/modules/board/repo/recursive-save.visitor.spec.ts +++ b/apps/server/src/modules/board/repo/recursive-save.visitor.spec.ts @@ -4,6 +4,7 @@ import { contextExternalToolEntityFactory } from '@modules/tool/context-external import { BoardNodeType, CardNode, + CollaborativeTextEditorElementNode, ColumnBoardNode, ColumnNode, DrawingElementNode, @@ -19,6 +20,7 @@ import { } from '@shared/domain/entity'; import { cardFactory, + collaborativeTextEditorElementFactory, columnBoardFactory, columnBoardNodeFactory, columnFactory, @@ -173,6 +175,21 @@ describe(RecursiveSaveVisitor.name, () => { }); }); + describe('when visiting a collaborative text editor element composite', () => { + it('should create or update the node', () => { + const collaborativeTextEditorElement = collaborativeTextEditorElementFactory.build(); + jest.spyOn(visitor, 'createOrUpdateBoardNode'); + + visitor.visitCollaborativeTextEditorElement(collaborativeTextEditorElement); + + const expectedNode: Partial = { + id: collaborativeTextEditorElement.id, + type: BoardNodeType.COLLABORATIVE_TEXT_EDITOR, + }; + expect(visitor.createOrUpdateBoardNode).toHaveBeenCalledWith(expect.objectContaining(expectedNode)); + }); + }); + describe('when visiting a rich text element composite', () => { it('should create or update the node', () => { const richTextElement = richTextElementFactory.build(); diff --git a/apps/server/src/modules/board/repo/recursive-save.visitor.ts b/apps/server/src/modules/board/repo/recursive-save.visitor.ts index 51506bcadcd..13ab4e4a33c 100644 --- a/apps/server/src/modules/board/repo/recursive-save.visitor.ts +++ b/apps/server/src/modules/board/repo/recursive-save.visitor.ts @@ -5,6 +5,7 @@ import type { AnyBoardDo, BoardCompositeVisitor, Card, + CollaborativeTextEditorElement, Column, ColumnBoard, DrawingElement, @@ -21,6 +22,7 @@ import type { import { BoardNode, CardNode, + CollaborativeTextEditorElementNode, ColumnBoardNode, ColumnNode, DrawingElementNode, @@ -204,6 +206,18 @@ export class RecursiveSaveVisitor implements BoardCompositeVisitor { this.visitChildren(externalToolElement, boardNode); } + visitCollaborativeTextEditorElement(collaborativeTextEditorElement: CollaborativeTextEditorElement): void { + const parentData = this.parentsMap.get(collaborativeTextEditorElement.id); + + const boardNode = new CollaborativeTextEditorElementNode({ + id: collaborativeTextEditorElement.id, + parent: parentData?.boardNode, + position: parentData?.position, + }); + + this.saveRecursive(boardNode, collaborativeTextEditorElement); + } + private visitChildren(parent: AnyBoardDo, parentNode: BoardNode) { parent.children.forEach((child) => { this.registerParentData(parent, child, parentNode); diff --git a/apps/server/src/modules/board/service/board-do-copy-service/recursive-copy.visitor.spec.ts b/apps/server/src/modules/board/service/board-do-copy-service/recursive-copy.visitor.spec.ts index d5f701a4c3c..acbac09848e 100644 --- a/apps/server/src/modules/board/service/board-do-copy-service/recursive-copy.visitor.spec.ts +++ b/apps/server/src/modules/board/service/board-do-copy-service/recursive-copy.visitor.spec.ts @@ -4,6 +4,7 @@ import { IToolFeatures, ToolFeatures } from '@modules/tool/tool-config'; import { Test, TestingModule } from '@nestjs/testing'; import { LinkElement } from '@shared/domain/domainobject'; import { + collaborativeTextEditorElementFactory, linkElementFactory, mediaBoardFactory, mediaExternalToolElementFactory, @@ -172,4 +173,29 @@ describe(RecursiveCopyVisitor.name, () => { }); }); }); + + describe('visitCollaborativeTextEditorElementAsync', () => { + const setup = () => { + const collaborativeTextEditorElement = collaborativeTextEditorElementFactory.build(); + const visitor = new RecursiveCopyVisitor( + createMock(), + contextExternalToolService, + toolFeatures + ); + + return { + collaborativeTextEditorElement, + visitor, + }; + }; + + it('should throw an error', async () => { + const { visitor, collaborativeTextEditorElement } = setup(); + const error = new Error(`Cannot copy element of type: '${collaborativeTextEditorElement.constructor.name}'`); + + await expect(() => + visitor.visitCollaborativeTextEditorElementAsync(collaborativeTextEditorElement) + ).rejects.toThrow(error); + }); + }); }); diff --git a/apps/server/src/modules/board/service/board-do-copy-service/recursive-copy.visitor.ts b/apps/server/src/modules/board/service/board-do-copy-service/recursive-copy.visitor.ts index 13c9b5be1aa..95cd09ce1e2 100644 --- a/apps/server/src/modules/board/service/board-do-copy-service/recursive-copy.visitor.ts +++ b/apps/server/src/modules/board/service/board-do-copy-service/recursive-copy.visitor.ts @@ -8,6 +8,7 @@ import { AnyBoardDo, BoardCompositeVisitorAsync, Card, + CollaborativeTextEditorElement, Column, ColumnBoard, DrawingElement, @@ -286,6 +287,14 @@ export class RecursiveCopyVisitor implements BoardCompositeVisitorAsync { return Promise.resolve(); } + async visitCollaborativeTextEditorElementAsync( + collaborativeTextEditorElement: CollaborativeTextEditorElement + ): Promise { + return Promise.reject( + new Error(`Cannot copy element of type: '${collaborativeTextEditorElement.constructor.name}'`) + ); + } + async visitMediaBoardAsync(original: MediaBoard): Promise { await this.visitChildrenOf(original); diff --git a/apps/server/src/modules/board/service/board-do-copy-service/swap-internal-links.visitor.spec.ts b/apps/server/src/modules/board/service/board-do-copy-service/swap-internal-links.visitor.spec.ts index 34972e397c5..c831f97595f 100644 --- a/apps/server/src/modules/board/service/board-do-copy-service/swap-internal-links.visitor.spec.ts +++ b/apps/server/src/modules/board/service/board-do-copy-service/swap-internal-links.visitor.spec.ts @@ -3,6 +3,7 @@ import { LinkElement, MediaBoard, MediaExternalToolElement, MediaLine } from '@s import { EntityId } from '@shared/domain/types'; import { cardFactory, + collaborativeTextEditorElementFactory, columnBoardFactory, columnFactory, drawingElementFactory, @@ -65,6 +66,7 @@ describe('swap internal links visitor', () => { submissionContainer, drawingElementFactory.build(), externalToolElementFactory.build(), + collaborativeTextEditorElementFactory.build(), ], }); const column = columnFactory.build({ diff --git a/apps/server/src/modules/board/service/board-do-copy-service/swap-internal-links.visitor.ts b/apps/server/src/modules/board/service/board-do-copy-service/swap-internal-links.visitor.ts index d9edaf75291..3b65325211a 100644 --- a/apps/server/src/modules/board/service/board-do-copy-service/swap-internal-links.visitor.ts +++ b/apps/server/src/modules/board/service/board-do-copy-service/swap-internal-links.visitor.ts @@ -58,6 +58,10 @@ export class SwapInternalLinksVisitor implements BoardCompositeVisitor { this.visitChildrenOf(submissionItem); } + visitCollaborativeTextEditorElement(): void { + this.doNothing(); + } + private visitChildrenOf(boardDo: AnyBoardDo) { boardDo.children.forEach((child) => child.accept(this)); } diff --git a/apps/server/src/modules/board/service/content-element-update.visitor.spec.ts b/apps/server/src/modules/board/service/content-element-update.visitor.spec.ts index 7ef2a1e8da2..bac4a981971 100644 --- a/apps/server/src/modules/board/service/content-element-update.visitor.spec.ts +++ b/apps/server/src/modules/board/service/content-element-update.visitor.spec.ts @@ -2,6 +2,7 @@ import { ObjectId } from '@mikro-orm/mongodb'; import { InputFormat } from '@shared/domain/types'; import { cardFactory, + collaborativeTextEditorElementFactory, columnBoardFactory, columnFactory, drawingElementFactory, @@ -28,9 +29,10 @@ describe(ContentElementUpdateVisitor.name, () => { content.text = 'a text'; content.inputFormat = InputFormat.RICH_TEXT_CK5; const submissionItem = submissionItemFactory.build(); + const collaborativeTextEditorElement = collaborativeTextEditorElementFactory.build(); const updater = new ContentElementUpdateVisitor(content); - return { board, column, card, submissionItem, updater }; + return { board, column, card, submissionItem, collaborativeTextEditorElement, updater }; }; describe('when component is a column board', () => { @@ -61,6 +63,15 @@ describe(ContentElementUpdateVisitor.name, () => { }); }); + describe('when component is a collaborative text editor element', () => { + it('should throw an error', async () => { + const { updater, collaborativeTextEditorElement } = setup(); + await expect(() => + updater.visitCollaborativeTextEditorElementAsync(collaborativeTextEditorElement) + ).rejects.toThrow(); + }); + }); + describe('when component is a media board', () => { it('should throw an error', async () => { const { updater } = setup(); diff --git a/apps/server/src/modules/board/service/content-element-update.visitor.ts b/apps/server/src/modules/board/service/content-element-update.visitor.ts index 2fd11842b9a..fe1b979e2cd 100644 --- a/apps/server/src/modules/board/service/content-element-update.visitor.ts +++ b/apps/server/src/modules/board/service/content-element-update.visitor.ts @@ -15,6 +15,7 @@ import type { SubmissionContainerElement, SubmissionItem, } from '@shared/domain/domainobject'; +import { CollaborativeTextEditorElement } from '@shared/domain/domainobject/board/collaborative-text-editor-element.do'; import { DrawingElement } from '@shared/domain/domainobject/board/drawing-element.do'; import { LinkElement } from '@shared/domain/domainobject/board/link-element.do'; import { InputFormat } from '@shared/domain/types'; @@ -118,6 +119,12 @@ export class ContentElementUpdateVisitor implements BoardCompositeVisitorAsync { return this.rejectNotHandled(externalToolElement); } + async visitCollaborativeTextEditorElementAsync( + collaborativeTextEditorElement: CollaborativeTextEditorElement + ): Promise { + return this.rejectNotHandled(collaborativeTextEditorElement); + } + private rejectNotHandled(component: AnyBoardDo): Promise { return Promise.reject(new Error(`Cannot update element of type: '${component.constructor.name}'`)); } diff --git a/apps/server/src/modules/collaborative-text-editor/api/collaborative-text-editor.controller.ts b/apps/server/src/modules/collaborative-text-editor/api/collaborative-text-editor.controller.ts new file mode 100644 index 00000000000..febd0c555d4 --- /dev/null +++ b/apps/server/src/modules/collaborative-text-editor/api/collaborative-text-editor.controller.ts @@ -0,0 +1,42 @@ +import { Authenticate, CurrentUser, ICurrentUser } from '@modules/authentication'; +import { Controller, ForbiddenException, Get, NotFoundException, Param, Res } from '@nestjs/common'; +import { ApiOperation, ApiResponse, ApiTags } from '@nestjs/swagger'; +import { ApiValidationError } from '@shared/common'; +import { Response } from 'express'; +import { CollaborativeTextEditorUc } from './collaborative-text-editor.uc'; +import { CollaborativeTextEditorResponse } from './dto/collaborative-text-editor.response'; +import { GetCollaborativeTextEditorForParentParams } from './dto/get-collaborative-text-editor-for-parent.params'; +import { CollaborativeTextEditorMapper } from './mapper/collaborative-text-editor.mapper'; + +@ApiTags('CollaborativeTextEditor') +@Authenticate('jwt') +@Controller('collaborative-text-editor') +export class CollaborativeTextEditorController { + constructor(private readonly collaborativeTextEditorUc: CollaborativeTextEditorUc) {} + + @ApiOperation({ summary: 'Get or create CollaborativeTextEditor for parent' }) + @ApiResponse({ status: 200, type: CollaborativeTextEditorResponse }) + @ApiResponse({ status: 400, type: ApiValidationError }) + @ApiResponse({ status: 403, type: ForbiddenException }) + @ApiResponse({ status: 404, type: NotFoundException }) + @Get('/:parentType/:parentId') + async getOrCreateCollaborativeTextEditorForParent( + @Param() getCollaborativeTextEditorForParentParams: GetCollaborativeTextEditorForParentParams, + @CurrentUser() currentUser: ICurrentUser, + @Res({ passthrough: true }) res: Response + ): Promise { + const textEditor = await this.collaborativeTextEditorUc.getOrCreateCollaborativeTextEditorForParent( + currentUser.userId, + getCollaborativeTextEditorForParentParams + ); + + res.cookie('sessionID', textEditor.sessions.toString(), { + expires: textEditor.sessionExpiryDate, + secure: true, + }); + + const dto = CollaborativeTextEditorMapper.mapCollaborativeTextEditorToResponse(textEditor); + + return dto; + } +} diff --git a/apps/server/src/modules/collaborative-text-editor/api/collaborative-text-editor.uc.ts b/apps/server/src/modules/collaborative-text-editor/api/collaborative-text-editor.uc.ts new file mode 100644 index 00000000000..2f45c89c2f6 --- /dev/null +++ b/apps/server/src/modules/collaborative-text-editor/api/collaborative-text-editor.uc.ts @@ -0,0 +1,55 @@ +import { Injectable } from '@nestjs/common'; +import { User } from '@shared/domain/entity'; +import { Permission } from '@shared/domain/interface'; +import { AuthorizationContextBuilder, AuthorizationService } from '@src/modules/authorization'; +import { BoardDoAuthorizableService, ContentElementService } from '@src/modules/board'; +import { CollaborativeTextEditor } from '../domain/do/collaborative-text-editor'; +import { CollaborativeTextEditorService } from '../service/collaborative-text-editor.service'; +import { + CollaborativeTextEditorParentType, + GetCollaborativeTextEditorForParentParams, +} from './dto/get-collaborative-text-editor-for-parent.params'; + +@Injectable() +export class CollaborativeTextEditorUc { + constructor( + private readonly authorizationService: AuthorizationService, + private readonly collaborativeTextEditorService: CollaborativeTextEditorService, + private readonly contentElementService: ContentElementService, + private readonly boardDoAuthorizableService: BoardDoAuthorizableService + ) {} + + async getOrCreateCollaborativeTextEditorForParent( + userId: string, + params: GetCollaborativeTextEditorForParentParams + ): Promise { + const user = await this.authorizationService.getUserWithPermissions(userId); + await this.authorizeByParentType(params, user); + + const userName = `${user.firstName} ${user.lastName}`; + const textEditor = await this.collaborativeTextEditorService.getOrCreateCollaborativeTextEditor( + userId, + userName, + params + ); + + return textEditor; + } + + private async authorizeByParentType(params: GetCollaborativeTextEditorForParentParams, user: User) { + if (params.parentType === CollaborativeTextEditorParentType.BOARD_CONTENT_ELEMENT) { + await this.authorizeForContentElement(params, user); + } + } + + private async authorizeForContentElement(params: GetCollaborativeTextEditorForParentParams, user: User) { + const contentElement = await this.contentElementService.findById(params.parentId); + const contentElementDoAuthorizable = await this.boardDoAuthorizableService.getBoardAuthorizable(contentElement); + + this.authorizationService.checkPermission( + user, + contentElementDoAuthorizable, + AuthorizationContextBuilder.read([Permission.COURSE_VIEW]) + ); + } +} diff --git a/apps/server/src/modules/collaborative-text-editor/api/dto/collaborative-text-editor.response.ts b/apps/server/src/modules/collaborative-text-editor/api/dto/collaborative-text-editor.response.ts new file mode 100644 index 00000000000..6049d1bc55a --- /dev/null +++ b/apps/server/src/modules/collaborative-text-editor/api/dto/collaborative-text-editor.response.ts @@ -0,0 +1,10 @@ +import { ApiProperty } from '@nestjs/swagger'; + +export class CollaborativeTextEditorResponse { + @ApiProperty() + url: string; + + constructor(props: CollaborativeTextEditorResponse) { + this.url = props.url; + } +} diff --git a/apps/server/src/modules/collaborative-text-editor/api/dto/get-collaborative-text-editor-for-parent.params.ts b/apps/server/src/modules/collaborative-text-editor/api/dto/get-collaborative-text-editor-for-parent.params.ts new file mode 100644 index 00000000000..fd7b00edda2 --- /dev/null +++ b/apps/server/src/modules/collaborative-text-editor/api/dto/get-collaborative-text-editor-for-parent.params.ts @@ -0,0 +1,25 @@ +import { ApiProperty } from '@nestjs/swagger'; +import { IsEnum, IsMongoId } from 'class-validator'; + +export enum CollaborativeTextEditorParentType { + BOARD_CONTENT_ELEMENT = 'content-element', +} + +export class GetCollaborativeTextEditorForParentParams { + @ApiProperty({ + required: true, + nullable: false, + }) + @IsMongoId() + parentId!: string; + + @IsEnum(CollaborativeTextEditorParentType) + @ApiProperty({ + description: 'Parent type of the collaborative text editor.', + enum: CollaborativeTextEditorParentType, + enumName: 'CollaborativeTextEditorParentType', + required: true, + nullable: false, + }) + parentType!: CollaborativeTextEditorParentType; +} diff --git a/apps/server/src/modules/collaborative-text-editor/api/mapper/collaborative-text-editor.mapper.ts b/apps/server/src/modules/collaborative-text-editor/api/mapper/collaborative-text-editor.mapper.ts new file mode 100644 index 00000000000..032e07645dd --- /dev/null +++ b/apps/server/src/modules/collaborative-text-editor/api/mapper/collaborative-text-editor.mapper.ts @@ -0,0 +1,14 @@ +import { CollaborativeTextEditor } from '../../domain/do/collaborative-text-editor'; +import { CollaborativeTextEditorResponse } from '../dto/collaborative-text-editor.response'; + +export class CollaborativeTextEditorMapper { + public static mapCollaborativeTextEditorToResponse( + collaborativeTextEditor: CollaborativeTextEditor + ): CollaborativeTextEditorResponse { + const dto = new CollaborativeTextEditorResponse({ + url: collaborativeTextEditor.url, + }); + + return dto; + } +} diff --git a/apps/server/src/modules/collaborative-text-editor/api/tests/get.api.spec.ts b/apps/server/src/modules/collaborative-text-editor/api/tests/get.api.spec.ts new file mode 100644 index 00000000000..bcab3061685 --- /dev/null +++ b/apps/server/src/modules/collaborative-text-editor/api/tests/get.api.spec.ts @@ -0,0 +1,178 @@ +import { createMock, DeepMocked } from '@golevelup/ts-jest'; +import { Configuration } from '@hpi-schul-cloud/commons/lib'; +import { EntityManager, ObjectId } from '@mikro-orm/mongodb'; +import { HttpStatus, INestApplication } from '@nestjs/common'; +import { Test } from '@nestjs/testing'; +import { BoardExternalReferenceType } from '@shared/domain/domainobject'; +import { + cardNodeFactory, + cleanupCollections, + collaborativeTextEditorNodeFactory, + columnBoardNodeFactory, + columnNodeFactory, + courseFactory, + TestApiClient, + UserAndAccountTestFactory, +} from '@shared/testing'; +import { EtherpadClientAdapter } from '@src/infra/etherpad-client'; +import { ServerTestModule } from '@src/modules/server'; + +describe('Collaborative Text Editor Controller (API)', () => { + let app: INestApplication; + let em: EntityManager; + let testApiClient: TestApiClient; + let etherpadClientAdapter: DeepMocked; + + beforeAll(async () => { + const module = await Test.createTestingModule({ + imports: [ServerTestModule], + }) + .overrideProvider(EtherpadClientAdapter) + .useValue(createMock()) + .compile(); + + app = module.createNestApplication(); + await app.init(); + em = app.get(EntityManager); + testApiClient = new TestApiClient(app, 'collaborative-text-editor'); + etherpadClientAdapter = module.get(EtherpadClientAdapter); + }); + + beforeEach(async () => { + await cleanupCollections(em); + }); + + afterAll(async () => { + await app.close(); + }); + + describe('getCollaborativeTextEditorForParent', () => { + describe('when request is invalid', () => { + const setup = async () => { + const { studentAccount, studentUser } = UserAndAccountTestFactory.buildStudent(); + + await em.persistAndFlush([studentAccount, studentUser]); + em.clear(); + + const loggedInClient = await testApiClient.login(studentAccount); + + return { loggedInClient }; + }; + + describe('when no user is logged in', () => { + it('should return 401', async () => { + const someId = new ObjectId().toHexString(); + + const response = await testApiClient.get(`content-element/${someId}}`); + + expect(response.status).toEqual(HttpStatus.UNAUTHORIZED); + }); + }); + + describe('when id in params is not a mongo id', () => { + it('should return 400', async () => { + const { loggedInClient } = await setup(); + + const response = await loggedInClient.get(`content-element/123`); + + expect(response.status).toEqual(HttpStatus.BAD_REQUEST); + expect(response.body).toEqual( + expect.objectContaining({ + validationErrors: [{ errors: ['parentId must be a mongodb id'], field: ['parentId'] }], + }) + ); + }); + }); + + describe('when parentType in params is not correct', () => { + it('should return 400', async () => { + const { loggedInClient } = await setup(); + + const someId = new ObjectId().toHexString(); + + const response = await loggedInClient.get(`other-element/${someId}`); + + expect(response.status).toEqual(HttpStatus.BAD_REQUEST); + expect(response.body).toEqual( + expect.objectContaining({ + validationErrors: [ + { errors: ['parentType must be one of the following values: content-element'], field: ['parentType'] }, + ], + }) + ); + }); + }); + }); + + describe('when request is valid', () => { + const setup = async () => { + const { studentAccount, studentUser } = UserAndAccountTestFactory.buildStudent(); + const course = courseFactory.build({ students: [studentUser] }); + + await em.persistAndFlush([studentUser, course]); + + const columnBoardNode = columnBoardNodeFactory.buildWithId({ + context: { id: course.id, type: BoardExternalReferenceType.Course }, + }); + const columnNode = columnNodeFactory.buildWithId({ parent: columnBoardNode }); + const cardNode = cardNodeFactory.buildWithId({ parent: columnNode }); + const collaborativeTextEditorElement = collaborativeTextEditorNodeFactory.build({ parent: cardNode }); + + await em.persistAndFlush([ + studentAccount, + collaborativeTextEditorElement, + columnBoardNode, + columnNode, + cardNode, + ]); + em.clear(); + + const loggedInClient = await testApiClient.login(studentAccount); + + const editorId = 'editorId'; + etherpadClientAdapter.getOrCreateEtherpadId.mockResolvedValueOnce(editorId); + const otherSessionIds = ['otherSessionId1', 'otherSessionId2']; + etherpadClientAdapter.listSessionIdsOfAuthor.mockResolvedValueOnce(otherSessionIds); + const sessionId = 'sessionId'; + etherpadClientAdapter.getOrCreateSessionId.mockResolvedValueOnce(sessionId); + + const basePath = Configuration.get('ETHERPAD__PAD_URI') as string; + const expectedPath = `${basePath}/${editorId}`; + + const expectedSessions = encodeURIComponent([...otherSessionIds, sessionId].join(',')); + + const cookieExpiresMilliseconds = Number(Configuration.get('ETHERPAD_COOKIE__EXPIRES_SECONDS')) * 1000; + // Remove the last 8 characters from the string to prevent conflict between time of test and code execution + const sessionCookieExpiryDate = new Date(Date.now() + cookieExpiresMilliseconds).toUTCString().slice(0, -8); + + return { + loggedInClient, + collaborativeTextEditorElement, + expectedPath, + expectedSessions, + sessionCookieExpiryDate, + }; + }; + + it('should return response and set cookie', async () => { + const { + loggedInClient, + collaborativeTextEditorElement, + expectedPath, + expectedSessions, + sessionCookieExpiryDate, + } = await setup(); + + const response = await loggedInClient.get(`content-element/${collaborativeTextEditorElement.id}`); + + expect(response.status).toEqual(HttpStatus.OK); + // eslint-disable-next-line @typescript-eslint/dot-notation, @typescript-eslint/no-unsafe-member-access + expect(response.body['url']).toEqual(expectedPath); + // eslint-disable-next-line @typescript-eslint/dot-notation, @typescript-eslint/no-unsafe-member-access + expect(response.headers['set-cookie'][0]).toContain( + `sessionID=${expectedSessions}; Path=/; Expires=${sessionCookieExpiryDate}` + ); + }); + }); + }); +}); diff --git a/apps/server/src/modules/collaborative-text-editor/collaborative-text-editor-api.module.ts b/apps/server/src/modules/collaborative-text-editor/collaborative-text-editor-api.module.ts new file mode 100644 index 00000000000..1470b7cabe1 --- /dev/null +++ b/apps/server/src/modules/collaborative-text-editor/collaborative-text-editor-api.module.ts @@ -0,0 +1,13 @@ +import { AuthorizationModule } from '@modules/authorization'; +import { Module } from '@nestjs/common'; +import { BoardModule } from '../board'; +import { CollaborativeTextEditorController } from './api/collaborative-text-editor.controller'; +import { CollaborativeTextEditorUc } from './api/collaborative-text-editor.uc'; +import { CollaborativeTextEditorModule } from './collaborative-text-editor.module'; + +@Module({ + imports: [CollaborativeTextEditorModule, AuthorizationModule, BoardModule], + controllers: [CollaborativeTextEditorController], + providers: [CollaborativeTextEditorUc], +}) +export class CollaborativeTextEditorApiModule {} diff --git a/apps/server/src/modules/collaborative-text-editor/collaborative-text-editor.config.ts b/apps/server/src/modules/collaborative-text-editor/collaborative-text-editor.config.ts new file mode 100644 index 00000000000..2317a0fedce --- /dev/null +++ b/apps/server/src/modules/collaborative-text-editor/collaborative-text-editor.config.ts @@ -0,0 +1,4 @@ +export interface CollaborativeTextEditorConfig { + ETHERPAD_COOKIE__EXPIRES_SECONDS: number; + ETHERPAD__PAD_URI: string; +} diff --git a/apps/server/src/modules/collaborative-text-editor/collaborative-text-editor.module.ts b/apps/server/src/modules/collaborative-text-editor/collaborative-text-editor.module.ts new file mode 100644 index 00000000000..d077d2b1fc0 --- /dev/null +++ b/apps/server/src/modules/collaborative-text-editor/collaborative-text-editor.module.ts @@ -0,0 +1,12 @@ +import { Module } from '@nestjs/common'; +import { LoggerModule } from '@src/core/logger'; +import { EtherpadClientModule } from '@src/infra/etherpad-client'; +import { etherpadClientConfig } from './config'; +import { CollaborativeTextEditorService } from './service/collaborative-text-editor.service'; + +@Module({ + imports: [LoggerModule, EtherpadClientModule.register(etherpadClientConfig)], + providers: [CollaborativeTextEditorService], + exports: [CollaborativeTextEditorService], +}) +export class CollaborativeTextEditorModule {} diff --git a/apps/server/src/modules/collaborative-text-editor/config.ts b/apps/server/src/modules/collaborative-text-editor/config.ts new file mode 100644 index 00000000000..1afc27483e9 --- /dev/null +++ b/apps/server/src/modules/collaborative-text-editor/config.ts @@ -0,0 +1,7 @@ +import { Configuration } from '@hpi-schul-cloud/commons/lib'; +import { EtherpadClientConfig } from '@src/infra/etherpad-client'; + +export const etherpadClientConfig: EtherpadClientConfig = { + apiKey: Configuration.has('ETHERPAD_API_KEY') ? (Configuration.get('ETHERPAD_API_KEY') as string) : undefined, + basePath: Configuration.has('ETHERPAD_URI') ? (Configuration.get('ETHERPAD_URI') as string) : undefined, +}; diff --git a/apps/server/src/modules/collaborative-text-editor/domain/do/collaborative-text-editor.ts b/apps/server/src/modules/collaborative-text-editor/domain/do/collaborative-text-editor.ts new file mode 100644 index 00000000000..c1b58baa071 --- /dev/null +++ b/apps/server/src/modules/collaborative-text-editor/domain/do/collaborative-text-editor.ts @@ -0,0 +1,5 @@ +export interface CollaborativeTextEditor { + url: string; + sessions: string[]; + sessionExpiryDate: Date; +} diff --git a/apps/server/src/modules/collaborative-text-editor/index.ts b/apps/server/src/modules/collaborative-text-editor/index.ts new file mode 100644 index 00000000000..274f33d5408 --- /dev/null +++ b/apps/server/src/modules/collaborative-text-editor/index.ts @@ -0,0 +1,2 @@ +export { CollaborativeTextEditorApiModule } from './collaborative-text-editor-api.module'; +export { CollaborativeTextEditorConfig } from './collaborative-text-editor.config'; diff --git a/apps/server/src/modules/collaborative-text-editor/service/collaborative-text-editor.service.spec.ts b/apps/server/src/modules/collaborative-text-editor/service/collaborative-text-editor.service.spec.ts new file mode 100644 index 00000000000..59945ebcd93 --- /dev/null +++ b/apps/server/src/modules/collaborative-text-editor/service/collaborative-text-editor.service.spec.ts @@ -0,0 +1,264 @@ +import { createMock, DeepMocked } from '@golevelup/ts-jest'; +import { ConfigService } from '@nestjs/config'; +import { Test, TestingModule } from '@nestjs/testing'; +import { Logger } from '@src/core/logger'; +import { EtherpadClientAdapter } from '@src/infra/etherpad-client'; +import { CollaborativeTextEditorParentType } from '../api/dto/get-collaborative-text-editor-for-parent.params'; +import { CollaborativeTextEditorService } from './collaborative-text-editor.service'; + +describe('CollaborativeTextEditorService', () => { + let service: CollaborativeTextEditorService; + let configService: DeepMocked; + let etherpadClientAdapter: DeepMocked; + + beforeAll(async () => { + const module: TestingModule = await Test.createTestingModule({ + providers: [ + CollaborativeTextEditorService, + { + provide: ConfigService, + useValue: createMock(), + }, + { + provide: EtherpadClientAdapter, + useValue: createMock(), + }, + { + provide: Logger, + useValue: createMock(), + }, + ], + }).compile(); + + service = module.get(CollaborativeTextEditorService); + configService = module.get(ConfigService); + etherpadClientAdapter = module.get(EtherpadClientAdapter); + }); + + afterEach(() => { + jest.resetAllMocks(); + }); + + describe('createCollaborativeTextEditor', () => { + const buildParameter = () => { + const userId = 'userId'; + const userName = 'userName'; + const parentId = 'parentId'; + const params = { parentId, parentType: CollaborativeTextEditorParentType.BOARD_CONTENT_ELEMENT }; + const groupId = 'groupId'; + const padId = 'padId'; + const authorId = 'authorId'; + const sessionId = 'sessionId1'; + const authorsSessionIds = ['sessionId1', 'sessionId2']; + const url = 'url'; + const cookieExpiresSeconds = 2; + const dateMock = new Date(2022, 1, 22); + const sessionExpiryDate = new Date(dateMock.getTime() + cookieExpiresSeconds * 1000); + + return { + userId, + userName, + params, + groupId, + padId, + authorId, + sessionId, + authorsSessionIds, + url, + cookieExpiresSeconds, + sessionExpiryDate, + dateMock, + }; + }; + + describe('WHEN all adapter requests return successfully', () => { + const setup = () => { + const { + userId, + userName, + params, + groupId, + padId, + authorId, + sessionId, + authorsSessionIds, + url, + cookieExpiresSeconds, + sessionExpiryDate, + dateMock, + } = buildParameter(); + + configService.get.mockReturnValueOnce(cookieExpiresSeconds); + configService.get.mockReturnValueOnce(url); + etherpadClientAdapter.getOrCreateGroupId.mockResolvedValueOnce(groupId); + etherpadClientAdapter.getOrCreateEtherpadId.mockResolvedValueOnce(padId); + etherpadClientAdapter.getOrCreateAuthorId.mockResolvedValueOnce(authorId); + etherpadClientAdapter.getOrCreateSessionId.mockResolvedValueOnce(sessionId); + etherpadClientAdapter.listSessionIdsOfAuthor.mockResolvedValueOnce(authorsSessionIds); + + jest.useFakeTimers(); + jest.setSystemTime(dateMock); + + return { + userId, + userName, + params, + groupId, + padId, + authorId, + sessionId, + authorsSessionIds, + url, + cookieExpiresSeconds, + sessionExpiryDate, + dateMock, + }; + }; + + it('should return collaborative text editor', async () => { + const { userId, padId, userName, params, url, sessionExpiryDate } = setup(); + + const result = await service.getOrCreateCollaborativeTextEditor(userId, userName, params); + + expect(result).toEqual({ + sessions: ['sessionId1', 'sessionId2'], + url: `${url}/${padId}`, + sessionExpiryDate, + }); + }); + + it('should call etherpadClientAdapter methods with correct parameter', async () => { + const { userId, userName, params, groupId, authorId, sessionExpiryDate } = setup(); + + await service.getOrCreateCollaborativeTextEditor(userId, userName, params); + + expect(etherpadClientAdapter.getOrCreateGroupId).toHaveBeenCalledWith(params.parentId); + expect(etherpadClientAdapter.getOrCreateEtherpadId).toHaveBeenCalledWith(groupId, params.parentId); + expect(etherpadClientAdapter.getOrCreateAuthorId).toHaveBeenCalledWith(userId, userName); + expect(etherpadClientAdapter.getOrCreateSessionId).toHaveBeenCalledWith( + groupId, + authorId, + params.parentId, + sessionExpiryDate + ); + expect(etherpadClientAdapter.listSessionIdsOfAuthor).toHaveBeenCalledWith(authorId); + }); + }); + + describe('WHEN etherpadClientAdapter.getOrCreateGroup throws an error', () => { + const setup = () => { + const { userId, userName, params, dateMock, cookieExpiresSeconds } = buildParameter(); + const error = new Error('error'); + + configService.get.mockReturnValueOnce(cookieExpiresSeconds); + etherpadClientAdapter.getOrCreateGroupId.mockRejectedValueOnce(error); + + jest.useFakeTimers(); + jest.setSystemTime(dateMock); + + return { userId, userName, params, error }; + }; + + it('should throw an error', async () => { + const { userId, userName, params, error } = setup(); + + await expect(service.getOrCreateCollaborativeTextEditor(userId, userName, params)).rejects.toThrowError(error); + }); + }); + + describe('WHEN etherpadClientAdapter.getOrCreateEtherpad throws an error', () => { + const setup = () => { + const { userId, userName, params, dateMock, cookieExpiresSeconds, groupId } = buildParameter(); + const error = new Error('error'); + + configService.get.mockReturnValueOnce(cookieExpiresSeconds); + etherpadClientAdapter.getOrCreateGroupId.mockResolvedValueOnce(groupId); + etherpadClientAdapter.getOrCreateEtherpadId.mockRejectedValueOnce(error); + + jest.useFakeTimers(); + jest.setSystemTime(dateMock); + + return { userId, userName, params, error }; + }; + + it('should throw an error', async () => { + const { userId, userName, params, error } = setup(); + + await expect(service.getOrCreateCollaborativeTextEditor(userId, userName, params)).rejects.toThrowError(error); + }); + }); + + describe('WHEN etherpadClientAdapter.getOrCreateAuthor throws an error', () => { + const setup = () => { + const { userId, userName, params, dateMock, cookieExpiresSeconds, groupId, padId } = buildParameter(); + const error = new Error('error'); + + configService.get.mockReturnValueOnce(cookieExpiresSeconds); + etherpadClientAdapter.getOrCreateGroupId.mockResolvedValueOnce(groupId); + etherpadClientAdapter.getOrCreateEtherpadId.mockResolvedValueOnce(padId); + etherpadClientAdapter.getOrCreateAuthorId.mockRejectedValueOnce(error); + + jest.useFakeTimers(); + jest.setSystemTime(dateMock); + + return { userId, userName, params, error }; + }; + + it('should throw an error', async () => { + const { userId, userName, params, error } = setup(); + + await expect(service.getOrCreateCollaborativeTextEditor(userId, userName, params)).rejects.toThrowError(error); + }); + }); + + describe('WHEN etherpadClientAdapter.getOrCreateSession throws an error', () => { + const setup = () => { + const { userId, userName, params, dateMock, cookieExpiresSeconds, groupId, padId, authorId } = buildParameter(); + const error = new Error('error'); + + configService.get.mockReturnValueOnce(cookieExpiresSeconds); + etherpadClientAdapter.getOrCreateGroupId.mockResolvedValueOnce(groupId); + etherpadClientAdapter.getOrCreateEtherpadId.mockResolvedValueOnce(padId); + etherpadClientAdapter.getOrCreateAuthorId.mockResolvedValueOnce(authorId); + etherpadClientAdapter.getOrCreateSessionId.mockRejectedValueOnce(error); + + jest.useFakeTimers(); + jest.setSystemTime(dateMock); + + return { userId, userName, params, error }; + }; + + it('should throw an error', async () => { + const { userId, userName, params, error } = setup(); + + await expect(service.getOrCreateCollaborativeTextEditor(userId, userName, params)).rejects.toThrowError(error); + }); + }); + + describe('WHEN etherpadClientAdapter.listSessionsOfAuthor throws an error', () => { + const setup = () => { + const { userId, userName, params, dateMock, cookieExpiresSeconds, groupId, padId, authorId, sessionId } = + buildParameter(); + const error = new Error('error'); + + configService.get.mockReturnValueOnce(cookieExpiresSeconds); + etherpadClientAdapter.getOrCreateGroupId.mockResolvedValueOnce(groupId); + etherpadClientAdapter.getOrCreateEtherpadId.mockResolvedValueOnce(padId); + etherpadClientAdapter.getOrCreateAuthorId.mockResolvedValueOnce(authorId); + etherpadClientAdapter.getOrCreateSessionId.mockResolvedValueOnce(sessionId); + etherpadClientAdapter.listSessionIdsOfAuthor.mockRejectedValueOnce(error); + + jest.useFakeTimers(); + jest.setSystemTime(dateMock); + + return { userId, userName, params, error }; + }; + + it('should throw an error', async () => { + const { userId, userName, params, error } = setup(); + + await expect(service.getOrCreateCollaborativeTextEditor(userId, userName, params)).rejects.toThrowError(error); + }); + }); + }); +}); diff --git a/apps/server/src/modules/collaborative-text-editor/service/collaborative-text-editor.service.ts b/apps/server/src/modules/collaborative-text-editor/service/collaborative-text-editor.service.ts new file mode 100644 index 00000000000..fa0ea1d3316 --- /dev/null +++ b/apps/server/src/modules/collaborative-text-editor/service/collaborative-text-editor.service.ts @@ -0,0 +1,67 @@ +import { Injectable } from '@nestjs/common'; +import { ConfigService } from '@nestjs/config'; +import { Logger } from '@src/core/logger'; +import { EtherpadClientAdapter } from '@src/infra/etherpad-client'; +import { ServerConfig } from '@src/modules/server'; +import { GetCollaborativeTextEditorForParentParams } from '../api/dto/get-collaborative-text-editor-for-parent.params'; +import { CollaborativeTextEditor } from '../domain/do/collaborative-text-editor'; + +@Injectable() +export class CollaborativeTextEditorService { + constructor( + private readonly collaborativeTextEditorAdapter: EtherpadClientAdapter, + private readonly configService: ConfigService, + private logger: Logger + ) { + this.logger.setContext(CollaborativeTextEditorService.name); + } + + async getOrCreateCollaborativeTextEditor( + userId: string, + userName: string, + params: GetCollaborativeTextEditorForParentParams + ): Promise { + const sessionExpiryDate = this.buildSessionExpiryDate(); + const { parentId } = params; + + const groupId = await this.collaborativeTextEditorAdapter.getOrCreateGroupId(parentId); + const padId = await this.collaborativeTextEditorAdapter.getOrCreateEtherpadId(groupId, parentId); + const authorId = await this.collaborativeTextEditorAdapter.getOrCreateAuthorId(userId, userName); + const sessionId = await this.collaborativeTextEditorAdapter.getOrCreateSessionId( + groupId, + authorId, + parentId, + sessionExpiryDate + ); + const authorsSessionIds = await this.collaborativeTextEditorAdapter.listSessionIdsOfAuthor(authorId); + + const url = this.buildPath(padId); + const uniqueSessionIds = this.removeDuplicateSessions([...authorsSessionIds, sessionId]); + + return { + sessions: uniqueSessionIds, + url, + sessionExpiryDate, + }; + } + + private removeDuplicateSessions(sessions: string[]): string[] { + const uniqueSessions = [...new Set(sessions)]; + + return uniqueSessions; + } + + private buildSessionExpiryDate(): Date { + const cookieExpiresMilliseconds = Number(this.configService.get('ETHERPAD_COOKIE__EXPIRES_SECONDS')) * 1000; + const sessionCookieExpiryDate = new Date(Date.now() + cookieExpiresMilliseconds); + + return sessionCookieExpiryDate; + } + + private buildPath(editorId: string): string { + const basePath = this.configService.get('ETHERPAD__PAD_URI'); + const url = `${basePath}/${editorId}`; + + return url; + } +} diff --git a/apps/server/src/modules/lesson/lesson.config.ts b/apps/server/src/modules/lesson/lesson.config.ts index 033a8682e19..249ebdf9f41 100644 --- a/apps/server/src/modules/lesson/lesson.config.ts +++ b/apps/server/src/modules/lesson/lesson.config.ts @@ -1,5 +1,4 @@ export interface LessonConfig { FEATURE_NEXBOARD_COPY_ENABLED: boolean; FEATURE_ETHERPAD_ENABLED: boolean; - ETHERPAD__PAD_URI?: string; } diff --git a/apps/server/src/modules/server/api/dto/config.response.ts b/apps/server/src/modules/server/api/dto/config.response.ts index 3e996219b52..a7133c730c9 100644 --- a/apps/server/src/modules/server/api/dto/config.response.ts +++ b/apps/server/src/modules/server/api/dto/config.response.ts @@ -101,6 +101,9 @@ export class ConfigResponse { @ApiProperty() FEATURE_COLUMN_BOARD_SUBMISSIONS_ENABLED: boolean; + @ApiProperty() + FEATURE_COLUMN_BOARD_COLLABORATIVE_TEXT_EDITOR_ENABLED: boolean; + @ApiProperty() FEATURE_COLUMN_BOARD_LINK_ELEMENT_ENABLED: boolean; @@ -218,6 +221,8 @@ export class ConfigResponse { this.FEATURE_NEXBOARD_COPY_ENABLED = config.FEATURE_NEXBOARD_COPY_ENABLED; this.FEATURE_COLUMN_BOARD_ENABLED = config.FEATURE_COLUMN_BOARD_ENABLED; this.FEATURE_COLUMN_BOARD_SUBMISSIONS_ENABLED = config.FEATURE_COLUMN_BOARD_SUBMISSIONS_ENABLED; + this.FEATURE_COLUMN_BOARD_COLLABORATIVE_TEXT_EDITOR_ENABLED = + config.FEATURE_COLUMN_BOARD_COLLABORATIVE_TEXT_EDITOR_ENABLED; this.FEATURE_COLUMN_BOARD_LINK_ELEMENT_ENABLED = config.FEATURE_COLUMN_BOARD_LINK_ELEMENT_ENABLED; this.FEATURE_COLUMN_BOARD_EXTERNAL_TOOLS_ENABLED = config.FEATURE_COLUMN_BOARD_EXTERNAL_TOOLS_ENABLED; this.FEATURE_COLUMN_BOARD_SHARE = config.FEATURE_COLUMN_BOARD_SHARE; diff --git a/apps/server/src/modules/server/api/test/server.api.spec.ts b/apps/server/src/modules/server/api/test/server.api.spec.ts index d2b501dffea..ac8a07d7292 100644 --- a/apps/server/src/modules/server/api/test/server.api.spec.ts +++ b/apps/server/src/modules/server/api/test/server.api.spec.ts @@ -45,6 +45,7 @@ describe('Server Controller (API)', () => { 'FEATURE_COLUMN_BOARD_EXTERNAL_TOOLS_ENABLED', 'FEATURE_COLUMN_BOARD_LINK_ELEMENT_ENABLED', 'FEATURE_COLUMN_BOARD_SUBMISSIONS_ENABLED', + 'FEATURE_COLUMN_BOARD_COLLABORATIVE_TEXT_EDITOR_ENABLED', 'FEATURE_COLUMN_BOARD_SHARE', 'FEATURE_BOARD_LAYOUT_ENABLED', 'FEATURE_CONSENT_NECESSARY', diff --git a/apps/server/src/modules/server/server.config.ts b/apps/server/src/modules/server/server.config.ts index 54e586be01d..a8b11b6a512 100644 --- a/apps/server/src/modules/server/server.config.ts +++ b/apps/server/src/modules/server/server.config.ts @@ -4,24 +4,25 @@ import type { SchulconnexClientConfig } from '@infra/schulconnex-client'; import type { AccountConfig } from '@modules/account'; import type { AuthenticationConfig, XApiKeyConfig } from '@modules/authentication'; import type { BoardConfig } from '@modules/board'; +import type { MediaBoardConfig } from '@modules/board/media-board.config'; +import type { CollaborativeTextEditorConfig } from '@modules/collaborative-text-editor'; +import { DeletionConfig } from '@modules/deletion'; import type { FilesStorageClientConfig } from '@modules/files-storage-client'; +import { SynchronizationConfig } from '@modules/idp-console'; import type { LearnroomConfig } from '@modules/learnroom'; import type { LessonConfig } from '@modules/lesson'; +import { ProvisioningConfig } from '@modules/provisioning'; import type { SchoolConfig } from '@modules/school'; import type { SharingConfig } from '@modules/sharing'; import { getTldrawClientConfig, type TldrawClientConfig } from '@modules/tldraw-client'; -import { type IToolFeatures, ToolConfiguration } from '@modules/tool'; +import { ToolConfiguration, type IToolFeatures } from '@modules/tool'; import type { UserConfig } from '@modules/user'; -import { type IUserImportFeatures, UserImportConfiguration } from '@modules/user-import'; +import { UserImportConfiguration, type IUserImportFeatures } from '@modules/user-import'; import type { UserLoginMigrationConfig } from '@modules/user-login-migration'; -import { type IVideoConferenceSettings, VideoConferenceConfiguration } from '@modules/video-conference'; +import { VideoConferenceConfiguration, type IVideoConferenceSettings } from '@modules/video-conference'; import { LanguageType } from '@shared/domain/interface'; import type { CoreModuleConfig } from '@src/core'; import type { MailConfig } from '@src/infra/mail/interfaces/mail-config'; -import { DeletionConfig } from '@modules/deletion'; -import type { MediaBoardConfig } from '@modules/board/media-board.config'; -import { ProvisioningConfig } from '@modules/provisioning'; -import { SynchronizationConfig } from '@modules/idp-console'; import { SchulcloudTheme } from './types/schulcloud-theme.enum'; import { Timezone } from './types/timezone.enum'; @@ -57,6 +58,7 @@ export interface ServerConfig SchulconnexClientConfig, SynchronizationConfig, DeletionConfig, + CollaborativeTextEditorConfig, ProvisioningConfig { NODE_ENV: NodeEnvType; SC_DOMAIN: string; @@ -75,6 +77,7 @@ export interface ServerConfig FEATURE_COLUMN_BOARD_SUBMISSIONS_ENABLED: boolean; FEATURE_COLUMN_BOARD_LINK_ELEMENT_ENABLED: boolean; FEATURE_COLUMN_BOARD_EXTERNAL_TOOLS_ENABLED: boolean; + FEATURE_COLUMN_BOARD_COLLABORATIVE_TEXT_EDITOR_ENABLED: boolean; FEATURE_COLUMN_BOARD_SHARE: boolean; FEATURE_BOARD_LAYOUT_ENABLED: boolean; FEATURE_LOGIN_LINK_ENABLED: boolean; @@ -123,6 +126,9 @@ const config: ServerConfig = { FEATURE_COLUMN_BOARD_ENABLED: Configuration.get('FEATURE_COLUMN_BOARD_ENABLED') as boolean, FEATURE_COLUMN_BOARD_SUBMISSIONS_ENABLED: Configuration.get('FEATURE_COLUMN_BOARD_SUBMISSIONS_ENABLED') as boolean, FEATURE_COLUMN_BOARD_LINK_ELEMENT_ENABLED: Configuration.get('FEATURE_COLUMN_BOARD_LINK_ELEMENT_ENABLED') as boolean, + FEATURE_COLUMN_BOARD_COLLABORATIVE_TEXT_EDITOR_ENABLED: Configuration.get( + 'FEATURE_COLUMN_BOARD_COLLABORATIVE_TEXT_EDITOR_ENABLED' + ) as boolean, FEATURE_COLUMN_BOARD_EXTERNAL_TOOLS_ENABLED: Configuration.get( 'FEATURE_COLUMN_BOARD_EXTERNAL_TOOLS_ENABLED' ) as boolean, @@ -205,9 +211,8 @@ const config: ServerConfig = { : undefined, FEATURE_NEXBOARD_COPY_ENABLED: Configuration.get('FEATURE_NEXBOARD_COPY_ENABLED') as boolean, FEATURE_ETHERPAD_ENABLED: Configuration.get('FEATURE_ETHERPAD_ENABLED') as boolean, - ETHERPAD__PAD_URI: Configuration.has('ETHERPAD__PAD_URI') - ? (Configuration.get('ETHERPAD__PAD_URI') as string) - : undefined, + ETHERPAD__PAD_URI: Configuration.get('ETHERPAD__PAD_URI') as string, + ETHERPAD_COOKIE__EXPIRES_SECONDS: Configuration.get('ETHERPAD_COOKIE__EXPIRES_SECONDS') as number, I18N__AVAILABLE_LANGUAGES: (Configuration.get('I18N__AVAILABLE_LANGUAGES') as string).split(',') as LanguageType[], I18N__DEFAULT_LANGUAGE: Configuration.get('I18N__DEFAULT_LANGUAGE') as unknown as LanguageType, I18N__FALLBACK_LANGUAGE: Configuration.get('I18N__FALLBACK_LANGUAGE') as unknown as LanguageType, diff --git a/apps/server/src/modules/server/server.module.ts b/apps/server/src/modules/server/server.module.ts index 3f2a3eeced7..ff8b86cd649 100644 --- a/apps/server/src/modules/server/server.module.ts +++ b/apps/server/src/modules/server/server.module.ts @@ -10,6 +10,7 @@ import { AuthenticationApiModule } from '@modules/authentication/authentication- import { BoardApiModule } from '@modules/board/board-api.module'; import { MediaBoardApiModule } from '@modules/board/media-board-api.module'; import { CollaborativeStorageModule } from '@modules/collaborative-storage'; +import { CollaborativeTextEditorApiModule } from '@modules/collaborative-text-editor'; import { FilesStorageClientModule } from '@modules/files-storage-client'; import { GroupApiModule } from '@modules/group/group-api.module'; import { LearnroomApiModule } from '@modules/learnroom/learnroom-api.module'; @@ -36,7 +37,7 @@ import { VideoConferenceApiModule } from '@modules/video-conference/video-confer import { DynamicModule, Module, NotFoundException } from '@nestjs/common'; import { ConfigModule } from '@nestjs/config'; import { ALL_ENTITIES } from '@shared/domain/entity'; -import { createConfigModuleOptions, DB_PASSWORD, DB_URL, DB_USERNAME } from '@src/config'; +import { DB_PASSWORD, DB_URL, DB_USERNAME, createConfigModuleOptions } from '@src/config'; import { CoreModule } from '@src/core'; import { LoggerModule } from '@src/core/logger'; import { ServerConfigController, ServerController, ServerUc } from './api'; @@ -93,6 +94,7 @@ const serverModules = [ LegacySchoolApiModule, MeApiModule, MediaBoardApiModule, + CollaborativeTextEditorApiModule, ]; export const defaultMikroOrmOptions: MikroOrmModuleSyncOptions = { diff --git a/apps/server/src/shared/domain/domainobject/board/card.do.ts b/apps/server/src/shared/domain/domainobject/board/card.do.ts index 2e18326c416..8635e2db8d1 100644 --- a/apps/server/src/shared/domain/domainobject/board/card.do.ts +++ b/apps/server/src/shared/domain/domainobject/board/card.do.ts @@ -1,5 +1,6 @@ import { DrawingElement } from '@shared/domain/domainobject/board/drawing-element.do'; import { BoardComposite, BoardCompositeProps } from './board-composite.do'; +import { CollaborativeTextEditorElement } from './collaborative-text-editor-element.do'; import { ExternalToolElement } from './external-tool-element.do'; import { FileElement } from './file-element.do'; import { LinkElement } from './link-element.do'; @@ -31,7 +32,8 @@ export class Card extends BoardComposite { domainObject instanceof LinkElement || domainObject instanceof RichTextElement || domainObject instanceof SubmissionContainerElement || - domainObject instanceof ExternalToolElement; + domainObject instanceof ExternalToolElement || + domainObject instanceof CollaborativeTextEditorElement; return allowed; } diff --git a/apps/server/src/shared/domain/domainobject/board/collaborative-text-editor-element.do.spec.ts b/apps/server/src/shared/domain/domainobject/board/collaborative-text-editor-element.do.spec.ts new file mode 100644 index 00000000000..379159ca791 --- /dev/null +++ b/apps/server/src/shared/domain/domainobject/board/collaborative-text-editor-element.do.spec.ts @@ -0,0 +1,66 @@ +import { createMock } from '@golevelup/ts-jest'; +import { collaborativeTextEditorElementFactory } from '@shared/testing'; +import { + CollaborativeTextEditorElement, + isCollaborativeTextEditorElement, +} from './collaborative-text-editor-element.do'; +import { BoardCompositeVisitor, BoardCompositeVisitorAsync } from './types'; + +describe(CollaborativeTextEditorElement.name, () => { + describe('isAllowedAsChild', () => { + it('should return false', () => { + const collaborativeTextEditorElement = collaborativeTextEditorElementFactory.build(); + + expect(collaborativeTextEditorElement.isAllowedAsChild()).toBe(false); + }); + }); + + describe('when trying to add a child to a CollaborativeTextEditorElement', () => { + it('should throw an error ', () => { + const collaborativeTextEditorElement = collaborativeTextEditorElementFactory.build(); + const collaborativeTextEditorElementChild = collaborativeTextEditorElementFactory.build(); + + expect(() => collaborativeTextEditorElement.addChild(collaborativeTextEditorElementChild)).toThrow(); + }); + }); + + describe('accept', () => { + it('should call the right visitor method', () => { + const visitor = createMock(); + const collaborativeTextEditorElement = collaborativeTextEditorElementFactory.build(); + + collaborativeTextEditorElement.accept(visitor); + + expect(visitor.visitCollaborativeTextEditorElement).toHaveBeenCalledWith(collaborativeTextEditorElement); + }); + }); + + describe('acceptAsync', () => { + it('should call the right async visitor method', async () => { + const visitor = createMock(); + const collaborativeTextEditorElement = collaborativeTextEditorElementFactory.build(); + + await collaborativeTextEditorElement.acceptAsync(visitor); + + expect(visitor.visitCollaborativeTextEditorElementAsync).toHaveBeenCalledWith(collaborativeTextEditorElement); + }); + }); + + describe('isCollaborativeTextEditorElement', () => { + describe('when element is collaborative text editor element', () => { + it('should return true', () => { + const collaborativeTextEditorElement = collaborativeTextEditorElementFactory.build(); + + expect(isCollaborativeTextEditorElement(collaborativeTextEditorElement)).toBe(true); + }); + }); + + describe('when element is not collaborative text editor element', () => { + it('should return false', () => { + const notCollaborativeTextEditorElement = {}; + + expect(isCollaborativeTextEditorElement(notCollaborativeTextEditorElement)).toBe(false); + }); + }); + }); +}); diff --git a/apps/server/src/shared/domain/domainobject/board/collaborative-text-editor-element.do.ts b/apps/server/src/shared/domain/domainobject/board/collaborative-text-editor-element.do.ts new file mode 100644 index 00000000000..9d939f1746c --- /dev/null +++ b/apps/server/src/shared/domain/domainobject/board/collaborative-text-editor-element.do.ts @@ -0,0 +1,20 @@ +import { BoardComposite, BoardCompositeProps } from './board-composite.do'; +import type { BoardCompositeVisitor, BoardCompositeVisitorAsync } from './types'; + +export class CollaborativeTextEditorElement extends BoardComposite { + isAllowedAsChild(): boolean { + return false; + } + + accept(visitor: BoardCompositeVisitor): void { + visitor.visitCollaborativeTextEditorElement(this); + } + + async acceptAsync(visitor: BoardCompositeVisitorAsync): Promise { + await visitor.visitCollaborativeTextEditorElementAsync(this); + } +} + +export function isCollaborativeTextEditorElement(reference: unknown): reference is CollaborativeTextEditorElement { + return reference instanceof CollaborativeTextEditorElement; +} diff --git a/apps/server/src/shared/domain/domainobject/board/content-element.factory.ts b/apps/server/src/shared/domain/domainobject/board/content-element.factory.ts index 91efd8c6e96..1e382576bbf 100644 --- a/apps/server/src/shared/domain/domainobject/board/content-element.factory.ts +++ b/apps/server/src/shared/domain/domainobject/board/content-element.factory.ts @@ -1,8 +1,9 @@ +import { ObjectId } from '@mikro-orm/mongodb'; import { Injectable, NotImplementedException } from '@nestjs/common'; import { InputFormat } from '@shared/domain/types'; -import { ObjectId } from '@mikro-orm/mongodb'; -import { ExternalToolElement } from './external-tool-element.do'; +import { CollaborativeTextEditorElement } from './collaborative-text-editor-element.do'; import { DrawingElement } from './drawing-element.do'; +import { ExternalToolElement } from './external-tool-element.do'; import { FileElement } from './file-element.do'; import { LinkElement } from './link-element.do'; import { RichTextElement } from './rich-text-element.do'; @@ -33,6 +34,9 @@ export class ContentElementFactory { case ContentElementType.EXTERNAL_TOOL: element = this.buildExternalTool(); break; + case ContentElementType.COLLABORATIVE_TEXT_EDITOR: + element = this.buildCollaborativeTextEditor(); + break; default: break; } @@ -116,4 +120,15 @@ export class ContentElementFactory { return element; } + + private buildCollaborativeTextEditor() { + const element = new CollaborativeTextEditorElement({ + id: new ObjectId().toHexString(), + children: [], + createdAt: new Date(), + updatedAt: new Date(), + }); + + return element; + } } diff --git a/apps/server/src/shared/domain/domainobject/board/index.ts b/apps/server/src/shared/domain/domainobject/board/index.ts index 7985c051dbd..dfee37bab05 100644 --- a/apps/server/src/shared/domain/domainobject/board/index.ts +++ b/apps/server/src/shared/domain/domainobject/board/index.ts @@ -1,5 +1,6 @@ export * from './board-composite.do'; export * from './card.do'; +export * from './collaborative-text-editor-element.do'; export * from './column-board.do'; export * from './column.do'; export * from './content-element.factory'; @@ -7,9 +8,9 @@ export * from './drawing-element.do'; export * from './external-tool-element.do'; export * from './file-element.do'; export * from './link-element.do'; +export * from './media-board'; export * from './rich-text-element.do'; export * from './submission-container-element.do'; export * from './submission-item.do'; export * from './submission-item.factory'; export * from './types'; -export * from './media-board'; diff --git a/apps/server/src/shared/domain/domainobject/board/types/any-content-element-do.ts b/apps/server/src/shared/domain/domainobject/board/types/any-content-element-do.ts index 14239363aaf..e40eb2035dc 100644 --- a/apps/server/src/shared/domain/domainobject/board/types/any-content-element-do.ts +++ b/apps/server/src/shared/domain/domainobject/board/types/any-content-element-do.ts @@ -1,5 +1,6 @@ -import { ExternalToolElement } from '../external-tool-element.do'; +import { CollaborativeTextEditorElement } from '../collaborative-text-editor-element.do'; import { DrawingElement } from '../drawing-element.do'; +import { ExternalToolElement } from '../external-tool-element.do'; import { FileElement } from '../file-element.do'; import { LinkElement } from '../link-element.do'; import { RichTextElement } from '../rich-text-element.do'; @@ -7,6 +8,7 @@ import { SubmissionContainerElement } from '../submission-container-element.do'; import type { AnyBoardDo } from './any-board-do'; export type AnyContentElementDo = + | CollaborativeTextEditorElement | DrawingElement | ExternalToolElement | FileElement @@ -16,6 +18,7 @@ export type AnyContentElementDo = export const isAnyContentElement = (element: AnyBoardDo): element is AnyContentElementDo => { const result = + element instanceof CollaborativeTextEditorElement || element instanceof DrawingElement || element instanceof ExternalToolElement || element instanceof FileElement || diff --git a/apps/server/src/shared/domain/domainobject/board/types/board-composite-visitor.ts b/apps/server/src/shared/domain/domainobject/board/types/board-composite-visitor.ts index 0d0eef8377e..ab52ec61e3c 100644 --- a/apps/server/src/shared/domain/domainobject/board/types/board-composite-visitor.ts +++ b/apps/server/src/shared/domain/domainobject/board/types/board-composite-visitor.ts @@ -1,4 +1,5 @@ import type { Card } from '../card.do'; +import { CollaborativeTextEditorElement } from '../collaborative-text-editor-element.do'; import type { ColumnBoard } from '../column-board.do'; import type { Column } from '../column.do'; import type { DrawingElement } from '../drawing-element.do'; @@ -24,6 +25,7 @@ export interface ColumnBoardCompositeVisitor { visitSubmissionContainerElement(submissionContainerElement: SubmissionContainerElement): void; visitSubmissionItem(submissionItem: SubmissionItem): void; visitExternalToolElement(externalToolElement: ExternalToolElement): void; + visitCollaborativeTextEditorElement(collaborativeTextEditorElement: CollaborativeTextEditorElement): void; } export interface ColumnBoardCompositeVisitorAsync { @@ -37,6 +39,9 @@ export interface ColumnBoardCompositeVisitorAsync { visitSubmissionContainerElementAsync(submissionContainerElement: SubmissionContainerElement): Promise; visitSubmissionItemAsync(submissionItem: SubmissionItem): Promise; visitExternalToolElementAsync(externalToolElement: ExternalToolElement): Promise; + visitCollaborativeTextEditorElementAsync( + collaborativeTextEditorElement: CollaborativeTextEditorElement + ): Promise; } export interface MediaBoardCompositeVisitor { diff --git a/apps/server/src/shared/domain/domainobject/board/types/content-elements.enum.ts b/apps/server/src/shared/domain/domainobject/board/types/content-elements.enum.ts index 151e7666c7f..5127c9b4376 100644 --- a/apps/server/src/shared/domain/domainobject/board/types/content-elements.enum.ts +++ b/apps/server/src/shared/domain/domainobject/board/types/content-elements.enum.ts @@ -5,4 +5,5 @@ export enum ContentElementType { RICH_TEXT = 'richText', SUBMISSION_CONTAINER = 'submissionContainer', EXTERNAL_TOOL = 'externalTool', + COLLABORATIVE_TEXT_EDITOR = 'collaborativeTextEditor', } diff --git a/apps/server/src/shared/domain/entity/all-entities.ts b/apps/server/src/shared/domain/entity/all-entities.ts index 19923d1c07b..8066afc0b16 100644 --- a/apps/server/src/shared/domain/entity/all-entities.ts +++ b/apps/server/src/shared/domain/entity/all-entities.ts @@ -1,3 +1,4 @@ +import { AccountEntity } from '@modules/account/entity/account.entity'; import { ClassEntity } from '@modules/class/entity'; import { GroupEntity } from '@modules/group/entity'; import { SchoolSystemOptionsEntity } from '@modules/legacy-school/entity'; @@ -8,13 +9,13 @@ import { TldrawDrawing } from '@modules/tldraw/entities'; import { ContextExternalToolEntity } from '@modules/tool/context-external-tool/entity'; import { ExternalToolEntity } from '@modules/tool/external-tool/entity'; import { SchoolExternalToolEntity } from '@modules/tool/school-external-tool/entity'; -import { AccountEntity } from '@modules/account/entity/account.entity'; import { DeletionLogEntity } from '@src/modules/deletion/repo/entity/deletion-log.entity'; import { DeletionRequestEntity } from '@src/modules/deletion/repo/entity/deletion-request.entity'; import { RocketChatUserEntity } from '@src/modules/rocketchat-user/entity'; import { BoardNode, CardNode, + CollaborativeTextEditorElementNode, ColumnBoardNode, ColumnNode, DrawingElementNode, @@ -75,6 +76,7 @@ export const ALL_ENTITIES = [ SubmissionContainerElementNode, SubmissionItemNode, ExternalToolElementNodeEntity, + CollaborativeTextEditorElementNode, MediaBoardNode, MediaLineNode, MediaExternalToolElementNode, diff --git a/apps/server/src/shared/domain/entity/boardnode/collaborative-text-editor-element-node.entity.ts b/apps/server/src/shared/domain/entity/boardnode/collaborative-text-editor-element-node.entity.ts new file mode 100644 index 00000000000..700f9a15482 --- /dev/null +++ b/apps/server/src/shared/domain/entity/boardnode/collaborative-text-editor-element-node.entity.ts @@ -0,0 +1,18 @@ +import { Entity } from '@mikro-orm/core'; +import { AnyBoardDo } from '../../domainobject'; +import { BoardNode, BoardNodeProps } from './boardnode.entity'; +import { BoardDoBuilder, BoardNodeType } from './types'; + +@Entity({ discriminatorValue: BoardNodeType.COLLABORATIVE_TEXT_EDITOR }) +export class CollaborativeTextEditorElementNode extends BoardNode { + constructor(props: BoardNodeProps) { + super(props); + this.type = BoardNodeType.COLLABORATIVE_TEXT_EDITOR; + } + + useDoBuilder(builder: BoardDoBuilder): AnyBoardDo { + const domainObject = builder.buildCollaborativeTextEditorElement(this); + + return domainObject; + } +} diff --git a/apps/server/src/shared/domain/entity/boardnode/index.ts b/apps/server/src/shared/domain/entity/boardnode/index.ts index 01356508e90..258859f83cc 100644 --- a/apps/server/src/shared/domain/entity/boardnode/index.ts +++ b/apps/server/src/shared/domain/entity/boardnode/index.ts @@ -1,14 +1,15 @@ export * from './boardnode.entity'; export * from './card-node.entity'; +export * from './collaborative-text-editor-element-node.entity'; export * from './column-board-node.entity'; export * from './column-node.entity'; +export * from './drawing-element-node.entity'; export * from './external-tool-element-node.entity'; export * from './file-element-node.entity'; export * from './link-element-node.entity'; -export * from './drawing-element-node.entity'; +export * from './media-board'; export * from './rich-text-element-node.entity'; +export * from './root-board-node.entity'; export * from './submission-container-element-node.entity'; export * from './submission-item-node.entity'; export * from './types'; -export * from './media-board'; -export * from './root-board-node.entity'; diff --git a/apps/server/src/shared/domain/entity/boardnode/types/board-do.builder.ts b/apps/server/src/shared/domain/entity/boardnode/types/board-do.builder.ts index 2f8cf002a50..d475836b8e5 100644 --- a/apps/server/src/shared/domain/entity/boardnode/types/board-do.builder.ts +++ b/apps/server/src/shared/domain/entity/boardnode/types/board-do.builder.ts @@ -1,5 +1,6 @@ import type { Card, + CollaborativeTextEditorElement, Column, ColumnBoard, DrawingElement, @@ -14,6 +15,7 @@ import type { SubmissionItem, } from '../../../domainobject'; import type { CardNode } from '../card-node.entity'; +import type { CollaborativeTextEditorElementNode } from '../collaborative-text-editor-element-node.entity'; import type { ColumnBoardNode } from '../column-board-node.entity'; import type { ColumnNode } from '../column-node.entity'; import type { DrawingElementNode } from '../drawing-element-node.entity'; @@ -36,6 +38,7 @@ export interface BoardDoBuilder { buildSubmissionContainerElement(boardNode: SubmissionContainerElementNode): SubmissionContainerElement; buildSubmissionItem(boardNode: SubmissionItemNode): SubmissionItem; buildExternalToolElement(boardNode: ExternalToolElementNodeEntity): ExternalToolElement; + buildCollaborativeTextEditorElement(boardNode: CollaborativeTextEditorElementNode): CollaborativeTextEditorElement; buildMediaBoard(boardNode: MediaBoardNode): MediaBoard; buildMediaLine(boardNode: MediaLineNode): MediaLine; diff --git a/apps/server/src/shared/domain/entity/boardnode/types/board-node-type.ts b/apps/server/src/shared/domain/entity/boardnode/types/board-node-type.ts index a80128c9da7..7fde3710af1 100644 --- a/apps/server/src/shared/domain/entity/boardnode/types/board-node-type.ts +++ b/apps/server/src/shared/domain/entity/boardnode/types/board-node-type.ts @@ -9,6 +9,7 @@ export enum BoardNodeType { SUBMISSION_CONTAINER_ELEMENT = 'submission-container-element', SUBMISSION_ITEM = 'submission-item', EXTERNAL_TOOL = 'external-tool', + COLLABORATIVE_TEXT_EDITOR = 'collaborative-text-editor', MEDIA_BOARD = 'media-board', MEDIA_LINE = 'media-line', diff --git a/apps/server/src/shared/testing/factory/boardnode/collaborative-text-editor-node.factory.ts b/apps/server/src/shared/testing/factory/boardnode/collaborative-text-editor-node.factory.ts new file mode 100644 index 00000000000..f0de6983521 --- /dev/null +++ b/apps/server/src/shared/testing/factory/boardnode/collaborative-text-editor-node.factory.ts @@ -0,0 +1,10 @@ +import { BoardNodeProps } from '@shared/domain/entity'; +import { CollaborativeTextEditorElementNode } from '@shared/domain/entity/boardnode/collaborative-text-editor-element-node.entity'; +import { BaseFactory } from '../base.factory'; + +export const collaborativeTextEditorNodeFactory = BaseFactory.define< + CollaborativeTextEditorElementNode, + BoardNodeProps +>(CollaborativeTextEditorElementNode, () => { + return {}; +}); diff --git a/apps/server/src/shared/testing/factory/boardnode/index.ts b/apps/server/src/shared/testing/factory/boardnode/index.ts index 5b6f79fb5b6..a45b70e8298 100644 --- a/apps/server/src/shared/testing/factory/boardnode/index.ts +++ b/apps/server/src/shared/testing/factory/boardnode/index.ts @@ -1,12 +1,13 @@ export * from './card-node.factory'; +export * from './collaborative-text-editor-node.factory'; export * from './column-board-node.factory'; export * from './column-node.factory'; export * from './external-tool-element-node.factory'; export * from './file-element-node.factory'; export * from './link-element-node.factory'; +export { mediaBoardNodeFactory } from './media-board-node.factory'; +export { mediaExternalToolElementNodeFactory } from './media-external-tool-element-node.factory'; +export { mediaLineNodeFactory } from './media-line-node.factory'; export * from './rich-text-element-node.factory'; export * from './submission-container-element-node.factory'; export * from './submission-item-node.factory'; -export { mediaBoardNodeFactory } from './media-board-node.factory'; -export { mediaLineNodeFactory } from './media-line-node.factory'; -export { mediaExternalToolElementNodeFactory } from './media-external-tool-element-node.factory'; diff --git a/apps/server/src/shared/testing/factory/domainobject/board/collaborative-text-editor-element.do.factory.ts b/apps/server/src/shared/testing/factory/domainobject/board/collaborative-text-editor-element.do.factory.ts new file mode 100644 index 00000000000..94fa3cf5767 --- /dev/null +++ b/apps/server/src/shared/testing/factory/domainobject/board/collaborative-text-editor-element.do.factory.ts @@ -0,0 +1,15 @@ +/* istanbul ignore file */ +import { ObjectId } from '@mikro-orm/mongodb'; +import { BoardCompositeProps, CollaborativeTextEditorElement } from '@shared/domain/domainobject'; +import { BaseFactory } from '../../base.factory'; + +export const collaborativeTextEditorElementFactory = BaseFactory.define< + CollaborativeTextEditorElement, + BoardCompositeProps +>(CollaborativeTextEditorElement, () => { + return { + id: new ObjectId().toHexString(), + createdAt: new Date(), + updatedAt: new Date(), + }; +}); diff --git a/apps/server/src/shared/testing/factory/domainobject/board/index.ts b/apps/server/src/shared/testing/factory/domainobject/board/index.ts index 5394032781f..9927751e2d7 100644 --- a/apps/server/src/shared/testing/factory/domainobject/board/index.ts +++ b/apps/server/src/shared/testing/factory/domainobject/board/index.ts @@ -1,4 +1,5 @@ export * from './card.do.factory'; +export * from './collaborative-text-editor-element.do.factory'; export * from './column-board.do.factory'; export * from './column.do.factory'; export * from './drawing-element.do.factory'; @@ -8,9 +9,10 @@ export * from './link-element.do.factory'; export * from './rich-text-element.do.factory'; export * from './submission-container-element.do.factory'; export * from './submission-item.do.factory'; + +export { boardDoAuthorizableFactory } from './board-do-authorizable.factory'; export { mediaBoardFactory } from './media-board.do.factory'; -export { mediaLineFactory } from './media-line.do.factory'; export { mediaExternalToolElementFactory } from './media-external-tool-element.do.factory'; -export { boardDoAuthorizableFactory } from './board-do-authorizable.factory'; +export { mediaLineFactory } from './media-line.do.factory'; export { mediaAvailableLineElementFactory } from './media-available-line-element.do.factory'; export { mediaAvailableLineFactory } from './media-available-line.do.factory'; diff --git a/config/default.schema.json b/config/default.schema.json index ce2d4d0e0dc..461e2d44d5d 100644 --- a/config/default.schema.json +++ b/config/default.schema.json @@ -805,10 +805,12 @@ "PAD_URI": { "type": "string", "format": "uri", - "default": "https://dbildungscloud.de/etherpad/p", "pattern": ".*(?