diff --git a/.eslintrc.js b/.eslintrc.js index 331307559..7fb63032e 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -78,8 +78,6 @@ module.exports = { '@typescript-eslint/no-warning-comments': 'off', '@typescript-eslint/no-empty-function': 'off', '@typescript-eslint/no-var-requires': 'error', - '@typescript-eslint/explicit-function-return-type': 'warn', - '@typescript-eslint/explicit-module-boundary-types': 'warn', '@typescript-eslint/ban-types': 'off', '@typescript-eslint/camelcase': 'off', '@typescript-eslint/no-unsafe-member-access': 'off', diff --git a/CHANGELOG.md b/CHANGELOG.md index 563b6f426..c69843c48 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added +- **Frontend**: Custom reporst can now be confihured using an interactive form. #1131 - **Frontend**: New feature: Run custom reports from the reports page. #1050 ### Fixed diff --git a/packages/api-types/out/schema.ts b/packages/api-types/out/schema.ts index 999c2278d..c9f856a66 100644 --- a/packages/api-types/out/schema.ts +++ b/packages/api-types/out/schema.ts @@ -1050,7 +1050,15 @@ export interface components { */ praiseIds: string[]; }; - SettingDto: { + ConfigurationValueItemsDto: { + /** + * @description Allowed array types + * @example string + * @enum {string} + */ + type: 'string' | 'number'; + }; + ConfigurationValueDto: { /** * @description Type of the setting * @example string @@ -1059,9 +1067,9 @@ export interface components { type: 'string' | 'number' | 'boolean' | 'array'; /** * @description Default value for the setting - * @example Some string + * @example 666 */ - default: Record; + default: number | string | boolean | number[] | string[]; /** * @description Description of the setting * @example Description of the string setting @@ -1071,7 +1079,7 @@ export interface components { * @description Markdown description of the setting * @example Description of the string setting */ - markdownDescription: string; + markdownDescription?: string; /** * @description Edit presentation style * @example multiline @@ -1082,7 +1090,7 @@ export interface components { * @description Order of the setting * @example 1 */ - order: number; + order?: number; /** * @description Enum values for string type settings * @example [ @@ -1091,9 +1099,8 @@ export interface components { * ] */ enum?: string[]; - items: { - type?: Record; - }; + /** @description Defines the type of items for array settings */ + items?: components['schemas']['ConfigurationValueItemsDto']; }; ReportManifestDto: { /** @example https://raw.githubusercontent.com/givepraise/reports/main/reports/disperse-dist-straight-curve-with-ceiling/manifest.json */ @@ -1131,7 +1138,9 @@ export interface components { keywords: string[]; /** @description Configuration settings for the report */ configuration: { - [key: string]: components['schemas']['SettingDto'] | undefined; + [key: string]: + | components['schemas']['ConfigurationValueDto'] + | undefined; }; }; }; diff --git a/packages/api/openapi.json b/packages/api/openapi.json index 77684788b..4378688a7 100644 --- a/packages/api/openapi.json +++ b/packages/api/openapi.json @@ -1 +1 @@ -{"openapi":"3.0.0","paths":{"/api/activate":{"post":{"operationId":"ActivateController_activate","summary":"Activate a user account in order to be able to give praise and receive rewards. Activation a user account creates a new User object or adds user account to User if it already exists.","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ActivateInputDto"}}}},"responses":{"200":{"description":"The created (or updated) user.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/User"}}}},"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/User"}}}}},"tags":["Activate"]}},"/api/users/export/json":{"get":{"operationId":"UsersController_exportJson","summary":"Export users document to json","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"string","format":"binary"}}}}},"tags":["Users"]}},"/api/users/export/csv":{"get":{"operationId":"UsersController_exportCsv","summary":"Export users document to csv","parameters":[],"responses":{"200":{"description":"","content":{"text/csv":{"schema":{"type":"string","format":"binary"}}}}},"tags":["Users"]}},"/api/users/export/parquet":{"get":{"operationId":"UsersController_exportParquet","summary":"Export users document to parquet","parameters":[],"responses":{"200":{"description":"","content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}}},"tags":["Users"]}},"/api/users":{"get":{"operationId":"UsersController_findAll","parameters":[],"responses":{"200":{"description":"All users","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/User"}}}}}},"tags":["Users"]}},"/api/users/{id}":{"get":{"operationId":"UsersController_findOne","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"A single user","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserWithStatsDto"}}}}},"tags":["Users"]},"patch":{"operationId":"UsersController_update","summary":"Updates a user","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateUserRequestDto"}}}},"responses":{"200":{"description":"Updated user","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserWithStatsDto"}}}}},"tags":["Users"]}},"/api/users/{id}/addRole":{"patch":{"operationId":"UsersController_addRole","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateUserRoleInputDto"}}}},"responses":{"200":{"description":"The updated user","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserWithStatsDto"}}}}},"tags":["Users"]}},"/api/users/{id}/removeRole":{"patch":{"operationId":"UsersController_removeRole","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateUserRoleInputDto"}}}},"responses":{"200":{"description":"The updated user","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserWithStatsDto"}}}}},"tags":["Users"]}},"/api/periods/export/json":{"get":{"operationId":"PeriodsController_exportJson","summary":"Export periods document to json","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"string","format":"binary"}}}}},"tags":["Periods"]}},"/api/periods/export/csv":{"get":{"operationId":"PeriodsController_exportCsv","summary":"Export periods document to csv","parameters":[],"responses":{"200":{"description":"","content":{"text/csv":{"schema":{"type":"string","format":"binary"}}}}},"tags":["Periods"]}},"/api/periods/export/parquet":{"get":{"operationId":"PeriodsController_exportParquet","summary":"Export periods document to parquet","parameters":[],"responses":{"200":{"description":"","content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}}},"tags":["Periods"]}},"/api/periods":{"get":{"operationId":"PeriodsController_findAllPaginated","summary":"List all periods","parameters":[{"name":"limit","required":true,"in":"query","example":10,"schema":{"type":"number"}},{"name":"page","required":true,"in":"query","example":1,"schema":{"type":"number"}},{"name":"sortColumn","required":false,"in":"query","schema":{"type":"string"}},{"name":"sortType","required":false,"in":"query","schema":{"default":"desc","enum":["asc","desc"],"type":"string"}}],"responses":{"200":{"description":"Periods","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PeriodPaginatedResponseDto"}}}}},"tags":["Periods"]},"post":{"operationId":"PeriodsController_create","summary":"Create a new period","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePeriodInputDto"}}}},"responses":{"200":{"description":"Period","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PeriodDetailsDto"}}}},"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PeriodDetailsDto"}}}}},"tags":["Periods"]}},"/api/periods/{id}":{"get":{"operationId":"PeriodsController_findOne","summary":"Find period by id","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"Period","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PeriodDetailsDto"}}}}},"tags":["Periods"]},"patch":{"operationId":"PeriodsController_update","summary":"Update a period","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdatePeriodInputDto"}}}},"responses":{"200":{"description":"Period","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PeriodDetailsDto"}}}}},"tags":["Periods"]}},"/api/periods/{id}/close":{"patch":{"operationId":"PeriodsController_close","summary":"Close a period","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"Period","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PeriodDetailsDto"}}}}},"tags":["Periods"]}},"/api/periods/{id}/praise":{"get":{"operationId":"PeriodsController_praise","summary":"Fetch all Praise in a period","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"Period Praise items","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/PraiseWithUserAccountsWithUserRefDto"}}}}}},"tags":["Periods"]}},"/api/periods/{periodId}/praise/receiver/{receiverId}":{"get":{"operationId":"PeriodsController_praiseByReceiver","summary":"Fetch all Praise in a period for a given receiver","parameters":[{"name":"periodId","required":true,"in":"path","schema":{"type":"string"}},{"name":"receiverId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"Period Praise items","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/PraiseWithUserAccountsWithUserRefDto"}}}}}},"tags":["Periods"]}},"/api/periods/{periodId}/praise/giver/{giverId}":{"get":{"operationId":"PeriodsController_praiseByGiver","summary":"Fetch all Praise in a period for a given giver","parameters":[{"name":"periodId","required":true,"in":"path","schema":{"type":"string"}},{"name":"giverId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"Period Praise items","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/PraiseWithUserAccountsWithUserRefDto"}}}}}},"tags":["Periods"]}},"/api/periods/{periodId}/praise/quantifier/{quantifierId}":{"get":{"operationId":"PeriodsController_praiseByQuantifier","summary":"Fetch all Praise in a period for a given quantifier","parameters":[{"name":"periodId","required":true,"in":"path","schema":{"type":"string"}},{"name":"quantifierId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"Period Praise items","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/PraiseWithUserAccountsWithUserRefDto"}}}}}},"tags":["Periods"]}},"/api/periods/{id}/verifyQuantifierPoolSize":{"get":{"operationId":"PeriodsController_verifyQuantifierPoolSize","summary":"Verify quantifier pool size","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"Period","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VerifyQuantifierPoolSizeDto"}}}}},"tags":["Periods"]}},"/api/periods/{id}/assignQuantifiers":{"patch":{"operationId":"PeriodsController_assignQuantifiers","summary":"Assign quantifiers to period","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"Period","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PeriodDetailsDto"}}}}},"tags":["Periods"]}},"/api/periods/{id}/replaceQuantifier":{"patch":{"operationId":"PeriodsController_replaceQuantifier","summary":"Replace quantifier in period","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReplaceQuantifierInputDto"}}}},"responses":{"200":{"description":"Period","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReplaceQuantifierResponseDto"}}}}},"tags":["Periods"]}},"/api/event-log":{"get":{"operationId":"EventLogController_findAllPaginated","summary":"List event logs, paginated results","parameters":[{"name":"limit","required":true,"in":"query","example":10,"schema":{"type":"number"}},{"name":"page","required":true,"in":"query","example":1,"schema":{"type":"number"}},{"name":"sortColumn","required":false,"in":"query","schema":{"type":"string"}},{"name":"sortType","required":false,"in":"query","schema":{"default":"desc","enum":["asc","desc"],"type":"string"}},{"name":"search","required":false,"in":"query","schema":{"type":"string"}},{"name":"types","required":false,"in":"query","schema":{"type":"array","items":{"type":"string"}}}],"responses":{"200":{"description":"Paginated event logs","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EventLogPaginatedResponseDto"}}}}},"tags":["Event Log"]}},"/api/event-log/types":{"get":{"operationId":"EventLogController_types","summary":"List event log types","parameters":[],"responses":{"200":{"description":"Event log types","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/EventLogType"}}}}}},"tags":["Event Log"]}},"/api/settings":{"get":{"operationId":"SettingsController_findAll","summary":"List all settings.","parameters":[{"name":"key","required":false,"in":"query","readOnly":true,"example":"SETTING_KEY","schema":{"type":"string"}},{"name":"type","required":false,"in":"query","readOnly":true,"schema":{"enum":["Integer","Float","String","Textarea","Boolean","IntegerList","StringList","Image","Radio","JSON"],"type":"string"}},{"name":"group","required":false,"in":"query","readOnly":true,"example":0,"schema":{"type":"number"}},{"name":"subgroup","required":false,"in":"query","readOnly":true,"example":0,"schema":{"type":"number"}}],"responses":{"200":{"description":"All settings.","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Setting"}}}}}},"tags":["Settings"]}},"/api/settings/{id}":{"get":{"operationId":"SettingsController_findOne","summary":"Get a setting.","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"Setting.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Setting"}}}}},"tags":["Settings"]},"patch":{"operationId":"SettingsController_set","summary":"Set a value for a setting.","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetSettingDto"}}}},"responses":{"200":{"description":"Updated setting.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Setting"}}}}},"tags":["Settings"]}},"/api/settings/{id}/upload":{"patch":{"operationId":"SettingsController_setWithUpload","summary":"Upload a file for a setting","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"Updated setting.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Setting"}}}}},"tags":["Settings"]}},"/api/settings/uploads/{file}":{"get":{"operationId":"SettingsController_serveUpload","summary":"Serve an uploaded settings file.","parameters":[{"name":"file","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"tags":["Settings"]}},"/api/periods/{periodId}/settings":{"get":{"operationId":"PeriodSettingsController_findAll","summary":"List all period settings.","parameters":[{"name":"periodId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"All period settings","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/PeriodSetting"}}}}}},"tags":["Periods"]}},"/api/periods/{periodId}/settings/{settingId}":{"get":{"operationId":"PeriodSettingsController_findOne","summary":"Get a period setting.","parameters":[{"name":"periodId","required":true,"in":"path","schema":{"type":"string"}},{"name":"settingId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"Period setting","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PeriodSetting"}}}}},"tags":["Periods"]},"patch":{"operationId":"PeriodSettingsController_set","summary":"Set value for a period setting.","parameters":[{"name":"periodId","required":true,"in":"path","schema":{"type":"string"}},{"name":"settingId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetPeriodSettingDto"}}}},"responses":{"200":{"description":"Updated period setting","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PeriodSetting"}}}}},"tags":["Periods"]}},"/api/praise":{"get":{"operationId":"PraiseController_findAllPaginated","summary":"List praise items, paginated results","parameters":[{"name":"limit","required":true,"in":"query","example":10,"schema":{"type":"number"}},{"name":"page","required":true,"in":"query","example":1,"schema":{"type":"number"}},{"name":"sortColumn","required":false,"in":"query","schema":{"type":"string"}},{"name":"sortType","required":false,"in":"query","schema":{"default":"desc","enum":["asc","desc"],"type":"string"}},{"name":"giver","required":false,"in":"query","schema":{"type":"string"}},{"name":"receiver","required":false,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"Paginated praise items","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PraisePaginatedResponseDto"}}}}},"tags":["Praise"]},"post":{"operationId":"PraiseController_praise","summary":"Create praise item","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PraiseCreateInputDto"}}}},"responses":{"200":{"description":"Praise item","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Praise"}}}},"201":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Praise"}}}}}},"tags":["Praise"]}},"/api/praise/export/json":{"get":{"operationId":"PraiseController_exportJson","summary":"Export praise document to json","parameters":[{"name":"startDate","required":false,"in":"query","schema":{"format":"date-time","type":"string"}},{"name":"endDate","required":false,"in":"query","schema":{"format":"date-time","type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"string","format":"binary"}}}}},"tags":["Praise"]}},"/api/praise/export/csv":{"get":{"operationId":"PraiseController_exportCsv","summary":"Export praise document to csv","parameters":[{"name":"startDate","required":false,"in":"query","schema":{"format":"date-time","type":"string"}},{"name":"endDate","required":false,"in":"query","schema":{"format":"date-time","type":"string"}}],"responses":{"200":{"description":"","content":{"text/csv":{"schema":{"type":"string","format":"binary"}}}}},"tags":["Praise"]}},"/api/praise/export/parquet":{"get":{"operationId":"PraiseController_exportParquet","summary":"Export praise document to parquet","parameters":[{"name":"startDate","required":false,"in":"query","schema":{"format":"date-time","type":"string"}},{"name":"endDate","required":false,"in":"query","schema":{"format":"date-time","type":"string"}}],"responses":{"200":{"description":"","content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}}},"tags":["Praise"]}},"/api/praise/{id}":{"get":{"operationId":"PraiseController_findOne","summary":"Find praise item by id","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"Praise item","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Praise"}}}}},"tags":["Praise"]}},"/api/praise/forward":{"post":{"operationId":"PraiseController_forward","summary":"Forward praise item","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PraiseForwardInputDto"}}}},"responses":{"200":{"description":"Praise item","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Praise"}}}},"201":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Praise"}}}}}},"tags":["Praise"]}},"/api/useraccounts":{"post":{"operationId":"UserAccountsController_create","summary":"Create a UserAccount","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateUserAccountInputDto"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateUserAccountResponseDto"}}}}},"tags":["UserAccounts"]},"get":{"operationId":"UserAccountsController_findAll","summary":"UserAccount list","parameters":[{"name":"accountId","required":false,"in":"query","example":"098098098098098","schema":{"minLength":10,"maxLength":255,"type":"string"}},{"name":"name","required":false,"in":"query","example":"darth#6755","schema":{"minLength":4,"maxLength":32,"type":"string"}},{"name":"user","required":false,"in":"query","example":"63b428f7d9ca4f6ff5370d05","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserAccount"}}}}},"tags":["UserAccounts"]}},"/api/useraccounts/export/json":{"get":{"operationId":"UserAccountsController_exportJson","summary":"Export userAccounts document to json","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"string","format":"binary"}}}}},"tags":["UserAccounts"]}},"/api/useraccounts/export/csv":{"get":{"operationId":"UserAccountsController_exportCsv","summary":"Export userAccounts document to csv","parameters":[],"responses":{"200":{"description":"","content":{"text/csv":{"schema":{"type":"string","format":"binary"}}}}},"tags":["UserAccounts"]}},"/api/useraccounts/export/parquet":{"get":{"operationId":"UserAccountsController_exportParquet","summary":"Export userAccounts document to parquet","parameters":[],"responses":{"200":{"description":"","content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}}},"tags":["UserAccounts"]}},"/api/useraccounts/{id}":{"get":{"operationId":"UserAccountsController_findOne","summary":"Get a UserAccount.","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"UserAccount","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserAccount"}}}}},"tags":["UserAccounts"]},"patch":{"operationId":"UserAccountsController_update","summary":"Update UserAccount","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateUserAccountInputDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateUserAccountResponseDto"}}}}},"tags":["UserAccounts"]}},"/api/api-key":{"post":{"operationId":"ApiKeyController_createApiKey","summary":"Create API key","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateApiKeyInputDto"}}}},"responses":{"201":{"description":"API key created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateApiKeyResponseDto"}}}}},"tags":["API Key"]},"get":{"operationId":"ApiKeyController_findAll","summary":"List all API keys","parameters":[],"responses":{"200":{"description":"Array of API keys","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ApiKey"}}}}}},"tags":["API Key"]}},"/api/api-key/{id}":{"get":{"operationId":"ApiKeyController_findOne","summary":"Get API key by ID","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"An API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKey"}}}}},"tags":["API Key"]},"put":{"operationId":"ApiKeyController_updateApiKeyDescription","summary":"Update API key description","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateDescriptionInputDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKey"}}}},"201":{"description":"API key with updated description","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKey"}}}}},"tags":["API Key"]},"delete":{"operationId":"ApiKeyController_revokeApiKey","summary":"Revoke API key","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKey"}}}},"201":{"description":"Revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKey"}}}}},"tags":["API Key"]}},"/api/auth/eth-signature/nonce":{"post":{"operationId":"EthSignatureController_nonce","summary":"Generates a nonce for the user and returns it","parameters":[],"requestBody":{"required":true,"description":"A request containing the user identityEthAddress","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NonceInputDto"}}}},"responses":{"201":{"description":"Nonce generated successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NonceResponseDto"}}}}},"tags":["Authentication"]}},"/api/auth/eth-signature/login":{"post":{"operationId":"EthSignatureController_login","summary":"Verifies a user's signature and returns a JWT token","parameters":[{"name":"host","required":true,"in":"header","schema":{"type":"string"}}],"requestBody":{"required":true,"description":"A request containing the user identityEthAddress and signedlogin message. The signed message should be structured as follows: \n\n```SIGN THIS MESSAGE TO LOGIN TO PRAISE.\\n\\nADDRESS:\\n[identityEthAddress]\\n\\nNONCE:\\n[nonce]```","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginInputDto"}}}},"responses":{"201":{"description":"User authenticated successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginResponseDto"}}}}},"tags":["Authentication"]}},"/api/auth/eth-signature/refresh":{"post":{"operationId":"EthSignatureController_token","summary":"Verifies a refreshToken and returns a JWT token","parameters":[{"name":"host","required":true,"in":"header","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenerateTokenDto"}}}},"responses":{"201":{"description":"Tokens generated successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginResponseDto"}}}}},"tags":["Authentication"]}},"/api/communities":{"post":{"operationId":"CommunityController_create","summary":"Create a new community","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCommunityInputDto"}}}},"responses":{"200":{"description":"Community","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Community"}}}},"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Community"}}}}},"tags":["Communities"]},"get":{"operationId":"CommunityController_findAll","parameters":[{"name":"limit","required":true,"in":"query","example":10,"schema":{"type":"number"}},{"name":"page","required":true,"in":"query","example":1,"schema":{"type":"number"}},{"name":"sortColumn","required":false,"in":"query","schema":{"type":"string"}},{"name":"sortType","required":false,"in":"query","schema":{"default":"desc","enum":["asc","desc"],"type":"string"}}],"responses":{"200":{"description":"All communities","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommunityPaginatedResponseDto"}}}}},"tags":["Communities"]}},"/api/communities/{id}":{"patch":{"operationId":"CommunityController_update","summary":"Update community","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateCommunityInputDto"}}}},"responses":{"200":{"description":"Community","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Community"}}}}},"tags":["Communities"]},"get":{"operationId":"CommunityController_findOne","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"A single Community","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Community"}}}}},"tags":["Communities"]}},"/api/communities/isNameAvailable":{"get":{"operationId":"CommunityController_isNameAvailable","parameters":[{"name":"name","required":true,"in":"query","example":"test_12345","schema":{"type":"string"}}],"responses":{"200":{"description":"Checking whether the community name is available","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IsNameAvailableResponseDto"}}}}},"tags":["Communities"]}},"/api/communities/{id}/discord/link":{"patch":{"operationId":"CommunityController_linkDiscord","summary":"Link discord to community","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LinkDiscordBotDto"}}}},"responses":{"200":{"description":"Community","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Community"}}}}},"tags":["Communities"]}},"/api/quantifications/export/json":{"get":{"operationId":"QuantificationsController_exportJson","summary":"Export quantifications document to json","parameters":[{"name":"startDate","required":false,"in":"query","schema":{"format":"date-time","type":"string"}},{"name":"endDate","required":false,"in":"query","schema":{"format":"date-time","type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"string","format":"binary"}}}}},"tags":["Quantifications"]}},"/api/quantifications/export/csv":{"get":{"operationId":"QuantificationsController_exportCsv","summary":"Export quantifications document to csv","parameters":[{"name":"startDate","required":false,"in":"query","schema":{"format":"date-time","type":"string"}},{"name":"endDate","required":false,"in":"query","schema":{"format":"date-time","type":"string"}}],"responses":{"200":{"description":"","content":{"text/csv":{"schema":{"type":"string","format":"binary"}}}}},"tags":["Quantifications"]}},"/api/quantifications/export/parquet":{"get":{"operationId":"QuantificationsController_exportParquet","summary":"Export quantifications document to parquet","parameters":[{"name":"startDate","required":false,"in":"query","schema":{"format":"date-time","type":"string"}},{"name":"endDate","required":false,"in":"query","schema":{"format":"date-time","type":"string"}}],"responses":{"200":{"description":"","content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}}},"tags":["Quantifications"]}},"/api/quantifications/multiple":{"patch":{"operationId":"QuantificationsController_quantifyMultiple","summary":"Quantify multiple praise items","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/QuantifyMultipleInputDto"}}}},"responses":{"200":{"description":"Praise items","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Praise"}}}}}},"tags":["Quantifications"]}},"/api/quantifications/{id}":{"patch":{"operationId":"QuantificationsController_quantify","summary":"Quantify praise item by id","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/QuantifyInputDto"}}}},"responses":{"200":{"description":"Praise items","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Praise"}}}}}},"tags":["Quantifications"]}},"/api/reports":{"get":{"operationId":"ReportsController_listAllReports","summary":"List all report manifests","parameters":[],"responses":{"200":{"description":"A list of report manifests","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ReportManifestDto"}}}}},"500":{"description":"An error occurred while fetching report manifests"}},"tags":["Reports"]}},"/api/reports/receiverBio/{userAccountId}":{"get":{"operationId":"ReportsController_receiverBio","summary":"Get one AI generated receiver bio","parameters":[{"name":"userAccountId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"A receiver bio","content":{"application/json":{"schema":{"type":"string"}}}}},"tags":["Reports"]}},"/api/reports/receiverLabels/{userAccountId}":{"get":{"operationId":"ReportsController_receiverLabels","summary":"AI generated labels describing a praise receiver.","parameters":[{"name":"userAccountId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"Comma separated list of labels, 7 max","content":{"application/json":{"schema":{"type":"string"}}}}},"tags":["Reports"]}}},"info":{"title":"Praise API","description":"","version":"1.0.0","contact":{}},"tags":[],"servers":[],"components":{"schemas":{"ActivateInputDto":{"type":"object","properties":{"identityEthAddress":{"type":"string","example":"0xAAB27b150451726EC7738aa1d0A94505c8729bd1"},"accountId":{"type":"string","example":"darth#3455"},"signature":{"type":"string","example":"0xdb4bb91357b23083ec2a36dc1fe23e59b71434fc020542da7e983df206ed06611e275eb30e239508f9758c0608dca6cef5619c41b50a48f22bdb36a8dabc2d201c"}},"required":["identityEthAddress","accountId","signature"]},"UserNoUserAccountsDto":{"type":"object","properties":{"_id":{"type":"string","readOnly":true,"example":"5f9f1b9b9b9b9b9b9b9b9b9b"},"identityEthAddress":{"type":"string","readOnly":true,"example":"0xAAB27b150451726EC7738aa1d0A94505c8729bd1"},"rewardsEthAddress":{"type":"string","example":"0xAAB27b150451726EC7738aa1d0A94505c8729bd1","maxLength":42},"username":{"type":"string","example":"darth","maxLength":20},"roles":{"type":"array","readOnly":true,"items":{"type":"string","enum":["USER","QUANTIFIER","FORWARDER","ADMIN","ROOT","API_KEY_READWRITE","API_KEY_READ","API_KEY_DISCORD_BOT","API_KEY_SETUP_WEB"]}},"createdAt":{"format":"date-time","type":"string","readOnly":true},"updatedAt":{"format":"date-time","type":"string","readOnly":true}},"required":["_id","identityEthAddress","rewardsEthAddress","username","roles","createdAt","updatedAt"]},"UserAccount":{"type":"object","properties":{"_id":{"type":"string","readOnly":true,"example":"63b428f7d9ca4f6ff5370d05"},"user":{"$ref":"#/components/schemas/UserNoUserAccountsDto"},"accountId":{"type":"string","example":"098098098098098","minLength":10,"maxLength":255},"name":{"type":"string","example":"darth#6755","minLength":4,"maxLength":32},"avatarId":{"type":"string","example":"098098098087097","minLength":10,"maxLength":255},"platform":{"type":"string","example":"DISCORD","minLength":4,"maxLength":255},"createdAt":{"format":"date-time","type":"string","readOnly":true},"updatedAt":{"format":"date-time","type":"string","readOnly":true}},"required":["_id","accountId","name","platform","createdAt","updatedAt"]},"User":{"type":"object","properties":{"_id":{"type":"string","readOnly":true,"example":"5f9f1b9b9b9b9b9b9b9b9b9b"},"identityEthAddress":{"type":"string","readOnly":true,"example":"0xAAB27b150451726EC7738aa1d0A94505c8729bd1"},"rewardsEthAddress":{"type":"string","example":"0xAAB27b150451726EC7738aa1d0A94505c8729bd1","maxLength":42},"username":{"type":"string","example":"darth","maxLength":20},"roles":{"type":"array","readOnly":true,"items":{"type":"string","enum":["USER","QUANTIFIER","FORWARDER","ADMIN","ROOT","API_KEY_READWRITE","API_KEY_READ","API_KEY_DISCORD_BOT","API_KEY_SETUP_WEB"]}},"accounts":{"readOnly":true,"type":"array","items":{"$ref":"#/components/schemas/UserAccount"}},"createdAt":{"format":"date-time","type":"string","readOnly":true},"updatedAt":{"format":"date-time","type":"string","readOnly":true}},"required":["_id","identityEthAddress","rewardsEthAddress","username","roles","accounts","createdAt","updatedAt"]},"UserWithStatsDto":{"type":"object","properties":{"_id":{"type":"string","readOnly":true,"example":"5f9f1b9b9b9b9b9b9b9b9b9b"},"identityEthAddress":{"type":"string","readOnly":true,"example":"0xAAB27b150451726EC7738aa1d0A94505c8729bd1"},"rewardsEthAddress":{"type":"string","example":"0xAAB27b150451726EC7738aa1d0A94505c8729bd1","maxLength":42},"username":{"type":"string","example":"darth","maxLength":20},"roles":{"type":"array","readOnly":true,"items":{"type":"string","enum":["USER","QUANTIFIER","FORWARDER","ADMIN","ROOT","API_KEY_READWRITE","API_KEY_READ","API_KEY_DISCORD_BOT","API_KEY_SETUP_WEB"]}},"accounts":{"readOnly":true,"type":"array","items":{"$ref":"#/components/schemas/UserAccount"}},"createdAt":{"format":"date-time","type":"string","readOnly":true},"updatedAt":{"format":"date-time","type":"string","readOnly":true},"receivedTotalScore":{"type":"number","readOnly":true},"receivedTotalCount":{"type":"number","readOnly":true},"givenTotalScore":{"type":"number","readOnly":true},"givenTotalCount":{"type":"number","readOnly":true}},"required":["_id","identityEthAddress","rewardsEthAddress","username","roles","accounts","createdAt","updatedAt"]},"UpdateUserRequestDto":{"type":"object","properties":{"rewardsEthAddress":{"type":"string","example":"0xAAB27b150451726EC7738aa1d0A94505c8729bd1","maxLength":42},"username":{"type":"string","example":"darth","maxLength":20}},"required":["rewardsEthAddress","username"]},"UpdateUserRoleInputDto":{"type":"object","properties":{"role":{"enum":["USER","QUANTIFIER","FORWARDER","ADMIN","ROOT","API_KEY_READWRITE","API_KEY_READ","API_KEY_DISCORD_BOT","API_KEY_SETUP_WEB"],"type":"string"}},"required":["role"]},"Period":{"type":"object","properties":{"_id":{"type":"string","readOnly":true,"example":"621f802b813dbdba9eeaf7d7"},"name":{"type":"string","example":"June 2021"},"status":{"type":"string","readOnly":true,"enum":["OPEN","QUANTIFY","CLOSED"]},"endDate":{"format":"date-time","type":"string","readOnly":true},"createdAt":{"format":"date-time","type":"string","readOnly":true},"updatedAt":{"format":"date-time","type":"string","readOnly":true}},"required":["_id","name","status","endDate","createdAt","updatedAt"]},"PeriodPaginatedResponseDto":{"type":"object","properties":{"totalDocs":{"type":"number","readOnly":true,"example":1200},"limit":{"type":"number","readOnly":true,"example":10},"totalPages":{"type":"number","readOnly":true,"example":12},"page":{"type":"number","readOnly":true,"example":2},"pagingCounter":{"type":"number","readOnly":true,"example":1},"hasPrevPage":{"type":"object","readOnly":true,"example":false},"hasNextPage":{"type":"object","readOnly":true,"example":true},"prevPage":{"type":"object","readOnly":true,"example":1},"nextPage":{"type":"object","readOnly":true,"example":3},"docs":{"readOnly":true,"type":"array","items":{"$ref":"#/components/schemas/Period"}},"meta":{"type":"object"}},"required":["totalDocs","limit","totalPages","pagingCounter","hasPrevPage","hasNextPage","docs"]},"Quantification":{"type":"object","properties":{"_id":{"type":"string","readOnly":true,"example":"639b178f19296ee0f2d0585d"},"score":{"type":"number","readOnly":true,"example":144},"scoreRealized":{"type":"number","readOnly":true,"example":144},"dismissed":{"type":"boolean","readOnly":true,"example":true},"duplicatePraise":{"type":"string","readOnly":true,"example":"639b178f19296ee0f2d0585d"},"quantifier":{"type":"string","readOnly":true,"example":"639b178f19296ee0f2d0585d"},"praise":{"type":"string","readOnly":true,"example":"639b178f19296ee0f2d0585d"},"createdAt":{"format":"date-time","type":"string","readOnly":true,"example":"2021-06-01T00:00:00.000Z"},"updatedAt":{"format":"date-time","type":"string","readOnly":true,"example":"2021-06-01T00:00:00.000Z"}},"required":["_id","score","scoreRealized","dismissed","duplicatePraise","quantifier","praise","createdAt","updatedAt"]},"PeriodDetailsQuantifierDto":{"type":"object","properties":{"_id":{"type":"string","readOnly":true,"example":"5f9f1b9b9b9b9b9b9b9b9b9b"},"identityEthAddress":{"type":"string","readOnly":true,"example":"0xAAB27b150451726EC7738aa1d0A94505c8729bd1"},"username":{"type":"string","example":"darth","maxLength":20},"createdAt":{"format":"date-time","type":"string","readOnly":true},"updatedAt":{"format":"date-time","type":"string","readOnly":true},"finishedCount":{"type":"number","readOnly":true,"example":1},"praiseCount":{"type":"number","readOnly":true,"example":1},"quantifications":{"type":"array","items":{"$ref":"#/components/schemas/Quantification"}}},"required":["_id","identityEthAddress","username","createdAt","updatedAt","finishedCount","praiseCount","quantifications"]},"PeriodDetailsGiverReceiverDto":{"type":"object","properties":{"_id":{"type":"string","readOnly":true,"example":"63b428f7d9ca4f6ff5370d05"},"accountId":{"type":"string","example":"098098098098098","minLength":10,"maxLength":255},"name":{"type":"string","example":"darth#6755","minLength":4,"maxLength":32},"avatarId":{"type":"string","example":"098098098087097","minLength":10,"maxLength":255},"platform":{"type":"string","example":"DISCORD","minLength":4,"maxLength":255},"createdAt":{"format":"date-time","type":"string","readOnly":true},"updatedAt":{"format":"date-time","type":"string","readOnly":true},"user":{"type":"string","readOnly":true,"example":"621f802b813dbdba9eeaf7d7"},"praiseCount":{"type":"number","readOnly":true,"example":"5"},"score":{"type":"number","readOnly":true,"example":144}},"required":["_id","accountId","name","platform","createdAt","updatedAt","user","praiseCount","score"]},"PeriodDetailsDto":{"type":"object","properties":{"_id":{"type":"string","readOnly":true,"example":"621f802b813dbdba9eeaf7d7"},"name":{"type":"string","example":"June 2021"},"status":{"type":"string","readOnly":true,"enum":["OPEN","QUANTIFY","CLOSED"]},"endDate":{"format":"date-time","type":"string","readOnly":true},"createdAt":{"format":"date-time","type":"string","readOnly":true},"updatedAt":{"format":"date-time","type":"string","readOnly":true},"quantifiers":{"readOnly":true,"type":"array","items":{"$ref":"#/components/schemas/PeriodDetailsQuantifierDto"}},"givers":{"readOnly":true,"type":"array","items":{"$ref":"#/components/schemas/PeriodDetailsGiverReceiverDto"}},"receivers":{"readOnly":true,"type":"array","items":{"$ref":"#/components/schemas/PeriodDetailsGiverReceiverDto"}},"numberOfPraise":{"type":"number","readOnly":true,"example":543}},"required":["_id","name","status","endDate","createdAt","updatedAt","numberOfPraise"]},"CreatePeriodInputDto":{"type":"object","properties":{"name":{"type":"string","example":"June 2021"},"endDate":{"type":"string"}},"required":["name","endDate"]},"UpdatePeriodInputDto":{"type":"object","properties":{"name":{"type":"string","example":"June 2021"},"endDate":{"type":"string"}}},"UserAccountWithUserRefDto":{"type":"object","properties":{"_id":{"type":"string","readOnly":true,"example":"63b428f7d9ca4f6ff5370d05"},"user":{"type":"string","readOnly":true,"example":"621f802b813dbdba9eeaf7d7"},"accountId":{"type":"string","example":"098098098098098","minLength":10,"maxLength":255},"name":{"type":"string","example":"darth#6755","minLength":4,"maxLength":32},"avatarId":{"type":"string","example":"098098098087097","minLength":10,"maxLength":255},"platform":{"type":"string","example":"DISCORD","minLength":4,"maxLength":255},"createdAt":{"format":"date-time","type":"string","readOnly":true},"updatedAt":{"format":"date-time","type":"string","readOnly":true}},"required":["_id","accountId","name","platform","createdAt","updatedAt"]},"PraiseWithUserAccountsWithUserRefDto":{"type":"object","properties":{"_id":{"type":"string","readOnly":true,"example":"639b178f19296ee0f2d0585d"},"reasonRaw":{"type":"string","readOnly":true,"example":"for making edits in the welcome text"},"reason":{"type":"string","readOnly":true,"example":"for making edits in the welcome text"},"sourceId":{"type":"string","readOnly":true,"example":"DISCORD:810180621930070088:810180622336262195"},"sourceName":{"type":"string","readOnly":true,"example":"DISCORD:Token%20Engineering%20Commons:%F0%9F%99%8F%EF%BD%9Cpraise"},"score":{"type":"number","readOnly":true,"example":144},"receiver":{"readOnly":true,"allOf":[{"$ref":"#/components/schemas/UserAccountWithUserRefDto"}]},"giver":{"readOnly":true,"allOf":[{"$ref":"#/components/schemas/UserAccountWithUserRefDto"}]},"forwarder":{"readOnly":true,"allOf":[{"$ref":"#/components/schemas/UserAccountWithUserRefDto"}]},"quantifications":{"readOnly":true,"type":"array","items":{"$ref":"#/components/schemas/Quantification"}},"createdAt":{"format":"date-time","type":"string","readOnly":true},"updatedAt":{"format":"date-time","type":"string","readOnly":true}},"required":["_id","reasonRaw","reason","sourceId","sourceName","score","receiver","giver","quantifications","createdAt","updatedAt"]},"VerifyQuantifierPoolSizeDto":{"type":"object","properties":{"quantifierPoolSize":{"type":"number","description":"The number of quantifiers in the pool","example":10},"quantifierPoolSizeNeeded":{"type":"number","description":"The number of quantifiers needed in the pool","example":10},"quantifierPoolDeficitSize":{"type":"number","description":"","example":0}},"required":["quantifierPoolSize","quantifierPoolSizeNeeded","quantifierPoolDeficitSize"]},"ReplaceQuantifierInputDto":{"type":"object","properties":{"currentQuantifierId":{"type":"string","example":"639b178f19296ee0f2d0585d"},"newQuantifierId":{"type":"string","example":"639b178f19296ee0f2d05666"}},"required":["currentQuantifierId","newQuantifierId"]},"Praise":{"type":"object","properties":{"_id":{"type":"string","readOnly":true,"example":"639b178f19296ee0f2d0585d"},"reasonRaw":{"type":"string","readOnly":true,"example":"for making edits in the welcome text"},"reason":{"type":"string","readOnly":true,"example":"for making edits in the welcome text"},"sourceId":{"type":"string","readOnly":true,"example":"DISCORD:810180621930070088:810180622336262195"},"sourceName":{"type":"string","readOnly":true,"example":"DISCORD:Token%20Engineering%20Commons:%F0%9F%99%8F%EF%BD%9Cpraise"},"score":{"type":"number","readOnly":true,"example":144},"receiver":{"readOnly":true,"allOf":[{"$ref":"#/components/schemas/UserAccount"}]},"giver":{"readOnly":true,"allOf":[{"$ref":"#/components/schemas/UserAccount"}]},"forwarder":{"$ref":"#/components/schemas/UserAccount"},"quantifications":{"readOnly":true,"type":"array","items":{"$ref":"#/components/schemas/Quantification"}},"createdAt":{"format":"date-time","type":"string","readOnly":true},"updatedAt":{"format":"date-time","type":"string","readOnly":true}},"required":["_id","reasonRaw","reason","sourceId","sourceName","score","receiver","giver","quantifications","createdAt","updatedAt"]},"ReplaceQuantifierResponseDto":{"type":"object","properties":{"praises":{"readOnly":true,"type":"array","items":{"$ref":"#/components/schemas/Praise"}},"period":{"readOnly":true,"allOf":[{"$ref":"#/components/schemas/PeriodDetailsDto"}]}},"required":["praises","period"]},"UserAccountNoUserId":{"type":"object","properties":{"_id":{"type":"string","readOnly":true,"example":"63b428f7d9ca4f6ff5370d05"},"accountId":{"type":"string","example":"098098098098098","minLength":10,"maxLength":255},"name":{"type":"string","example":"darth#6755","minLength":4,"maxLength":32},"avatarId":{"type":"string","example":"098098098087097","minLength":10,"maxLength":255},"platform":{"type":"string","example":"DISCORD","minLength":4,"maxLength":255},"createdAt":{"format":"date-time","type":"string","readOnly":true},"updatedAt":{"format":"date-time","type":"string","readOnly":true}},"required":["_id","accountId","name","platform","createdAt","updatedAt"]},"EventLogType":{"type":"object","properties":{"key":{"type":"string","enum":["PERMISSION","AUTHENTICATION","PERIOD","PRAISE","QUANTIFICATION","SETTING","USER_ACCOUNT","COMMUNITY"]},"label":{"type":"string","example":"An action that changes user permissions","maxLength":255},"description":{"type":"string","example":"A user's permissions were changed","maxLength":255}},"required":["key","label","description"]},"EventLog":{"type":"object","properties":{"_id":{"type":"string","example":"621f802b813dbdba9eeaf7d7"},"user":{"$ref":"#/components/schemas/User"},"useraccount":{"$ref":"#/components/schemas/UserAccountNoUserId"},"apiKey":{"type":"string","example":"621f802b813dbdba9eeaf7d7"},"period":{"type":"string","example":"621f802b813dbdba9eeaf7d7"},"type":{"$ref":"#/components/schemas/EventLogType"},"description":{"type":"string","example":"A description of the event "},"createdAt":{"format":"date-time","type":"string","example":"2023-03-01T22:51:20.012Z"},"updatedAt":{"format":"date-time","type":"string","example":"2023-03-01T22:51:20.012Z"}},"required":["_id","type","description","createdAt","updatedAt"]},"EventLogPaginatedResponseDto":{"type":"object","properties":{"totalDocs":{"type":"number","readOnly":true,"example":1200},"limit":{"type":"number","readOnly":true,"example":10},"totalPages":{"type":"number","readOnly":true,"example":12},"page":{"type":"number","readOnly":true,"example":2},"pagingCounter":{"type":"number","readOnly":true,"example":1},"hasPrevPage":{"type":"object","readOnly":true,"example":false},"hasNextPage":{"type":"object","readOnly":true,"example":true},"prevPage":{"type":"object","readOnly":true,"example":1},"nextPage":{"type":"object","readOnly":true,"example":3},"docs":{"readOnly":true,"type":"array","items":{"$ref":"#/components/schemas/EventLog"}},"meta":{"type":"object"}},"required":["totalDocs","limit","totalPages","pagingCounter","hasPrevPage","hasNextPage","docs"]},"Setting":{"type":"object","properties":{"_id":{"type":"string","readOnly":true,"example":"621f802b813dbdbaddeaf799"},"key":{"type":"string","readOnly":true,"example":"SETTING_KEY"},"value":{"type":"string","example":"666","maxLength":512},"valueRealized":{"example":666,"oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}},{"type":"boolean"},{"type":"number"},{"type":"array","items":{"type":"number"}}]},"defaultValue":{"type":"string","readOnly":true,"example":"555"},"type":{"type":"string","readOnly":true,"enum":["Integer","Float","String","Textarea","Boolean","IntegerList","StringList","Image","Radio","JSON"]},"label":{"type":"string","readOnly":true,"example":"Quantifiers Per Praise"},"description":{"type":"string","readOnly":true,"example":"How many redundant quantifications are assigned to each praise?"},"group":{"type":"number","readOnly":true,"example":0},"options":{"type":"string","readOnly":true},"subgroup":{"type":"number","readOnly":true,"example":0},"periodOverridable":{"type":"boolean","readOnly":true,"example":true}},"required":["_id","key","value","valueRealized","defaultValue","type","label","description","group","options","subgroup","periodOverridable"]},"SetSettingDto":{"type":"object","properties":{"value":{"type":"string","example":"666","maxLength":512}},"required":["value"]},"PeriodSetting":{"type":"object","properties":{"_id":{"type":"string","readOnly":true,"example":"62291b7ea8b1619f78818524"},"period":{"readOnly":true,"allOf":[{"$ref":"#/components/schemas/Period"}]},"setting":{"readOnly":true,"allOf":[{"$ref":"#/components/schemas/Setting"}]},"value":{"type":"string","example":"666","maxLength":512},"valueRealized":{"example":666,"oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}},{"type":"boolean"},{"type":"number"},{"type":"array","items":{"type":"number"}}]}},"required":["_id","period","setting","value","valueRealized"]},"SetPeriodSettingDto":{"type":"object","properties":{"value":{"type":"string","example":"666","maxLength":512}},"required":["value"]},"PraisePaginatedResponseDto":{"type":"object","properties":{"totalDocs":{"type":"number","readOnly":true,"example":1200},"limit":{"type":"number","readOnly":true,"example":10},"totalPages":{"type":"number","readOnly":true,"example":12},"page":{"type":"number","readOnly":true,"example":2},"pagingCounter":{"type":"number","readOnly":true,"example":1},"hasPrevPage":{"type":"object","readOnly":true,"example":false},"hasNextPage":{"type":"object","readOnly":true,"example":true},"prevPage":{"type":"object","readOnly":true,"example":1},"nextPage":{"type":"object","readOnly":true,"example":3},"docs":{"readOnly":true,"type":"array","items":{"$ref":"#/components/schemas/Praise"}},"meta":{"type":"object"}},"required":["totalDocs","limit","totalPages","pagingCounter","hasPrevPage","hasNextPage","docs"]},"PraiseCreateInputDto":{"type":"object","properties":{"reasonRaw":{"type":"string","readOnly":true,"example":"for making edits in the welcome text"},"reason":{"type":"string","readOnly":true,"example":"for making edits in the welcome text"},"sourceId":{"type":"string","readOnly":true,"example":"DISCORD:810180621930070088:810180622336262195"},"sourceName":{"type":"string","readOnly":true,"example":"DISCORD:Token%20Engineering%20Commons:%F0%9F%99%8F%EF%BD%9Cpraise"},"receiverIds":{"type":"array","items":{"type":"string"}},"giver":{"$ref":"#/components/schemas/UserAccount"}},"required":["reasonRaw","reason","sourceId","sourceName","receiverIds","giver"]},"PraiseForwardInputDto":{"type":"object","properties":{"reasonRaw":{"type":"string","readOnly":true,"example":"for making edits in the welcome text"},"reason":{"type":"string","readOnly":true,"example":"for making edits in the welcome text"},"sourceId":{"type":"string","readOnly":true,"example":"DISCORD:810180621930070088:810180622336262195"},"sourceName":{"type":"string","readOnly":true,"example":"DISCORD:Token%20Engineering%20Commons:%F0%9F%99%8F%EF%BD%9Cpraise"},"receiverIds":{"type":"array","items":{"type":"string"}},"giver":{"$ref":"#/components/schemas/UserAccount"},"forwarder":{"$ref":"#/components/schemas/UserAccount"}},"required":["reasonRaw","reason","sourceId","sourceName","receiverIds","giver","forwarder"]},"CreateUserAccountInputDto":{"type":"object","properties":{"accountId":{"type":"string","example":"098098098098098","minLength":10,"maxLength":255},"name":{"type":"string","example":"darth#6755","minLength":4,"maxLength":32},"avatarId":{"type":"string","example":"098098098087097","minLength":10,"maxLength":255},"platform":{"type":"string","example":"DISCORD","minLength":4,"maxLength":255},"activateToken":{"type":"string","example":"jkhvuygi643jh35g53"},"user":{"type":"string","example":"63b428f7d9ca4f6ff5370d05"}},"required":["accountId","name","platform"]},"CreateUserAccountResponseDto":{"type":"object","properties":{"_id":{"type":"string","readOnly":true,"example":"63b428f7d9ca4f6ff5370d05"},"user":{"$ref":"#/components/schemas/UserNoUserAccountsDto"},"accountId":{"type":"string","example":"098098098098098","minLength":10,"maxLength":255},"name":{"type":"string","example":"darth#6755","minLength":4,"maxLength":32},"avatarId":{"type":"string","example":"098098098087097","minLength":10,"maxLength":255},"platform":{"type":"string","example":"DISCORD","minLength":4,"maxLength":255},"createdAt":{"format":"date-time","type":"string","readOnly":true},"updatedAt":{"format":"date-time","type":"string","readOnly":true},"activateToken":{"type":"string","readOnly":true,"example":"jkhvuygi643jh35g53"}},"required":["_id","accountId","name","platform","createdAt","updatedAt"]},"UpdateUserAccountInputDto":{"type":"object","properties":{"accountId":{"type":"string","example":"098098098098098","minLength":10,"maxLength":255},"name":{"type":"string","example":"darth#6755","minLength":4,"maxLength":32},"avatarId":{"type":"string","example":"098098098087097","minLength":10,"maxLength":255},"platform":{"type":"string","example":"DISCORD","minLength":4,"maxLength":255},"activateToken":{"type":"string","example":"jkhvuygi643jh35g53"},"user":{"type":"string","example":"63b428f7d9ca4f6ff5370d05"}}},"UpdateUserAccountResponseDto":{"type":"object","properties":{"_id":{"type":"string","readOnly":true,"example":"63b428f7d9ca4f6ff5370d05"},"user":{"$ref":"#/components/schemas/UserNoUserAccountsDto"},"accountId":{"type":"string","example":"098098098098098","minLength":10,"maxLength":255},"name":{"type":"string","example":"darth#6755","minLength":4,"maxLength":32},"avatarId":{"type":"string","example":"098098098087097","minLength":10,"maxLength":255},"platform":{"type":"string","example":"DISCORD","minLength":4,"maxLength":255},"createdAt":{"format":"date-time","type":"string","readOnly":true},"updatedAt":{"format":"date-time","type":"string","readOnly":true},"activateToken":{"type":"string","readOnly":true,"example":"jkhvuygi643jh35g53"}},"required":["_id","accountId","name","platform","createdAt","updatedAt"]},"CreateApiKeyInputDto":{"type":"object","properties":{"description":{"type":"string","example":"My API Key"},"role":{"type":"string","enum":["USER","QUANTIFIER","FORWARDER","ADMIN","ROOT","API_KEY_READWRITE","API_KEY_READ","API_KEY_DISCORD_BOT","API_KEY_SETUP_WEB"]}},"required":["description","role"]},"CreateApiKeyResponseDto":{"type":"object","properties":{"_id":{"type":"string","readOnly":true,"example":"639b178f19296ee0f2d0585d"},"name":{"type":"string","readOnly":true,"example":"89f7edbd"},"description":{"type":"string","example":"My API Key"},"hash":{"type":"string","readOnly":true,"example":"$2b$10$hfRNI.V7ewuN/K.5eSt6oelaQ.FDj6irfUNR9wkKnL/qsNT23aE4i"},"role":{"type":"string","enum":["USER","QUANTIFIER","FORWARDER","ADMIN","ROOT","API_KEY_READWRITE","API_KEY_READ","API_KEY_DISCORD_BOT","API_KEY_SETUP_WEB"]},"createdAt":{"format":"date-time","type":"string","readOnly":true},"updatedAt":{"format":"date-time","type":"string","readOnly":true},"key":{"type":"string","readOnly":true,"example":"1834a97caed67b244dd11fa5ef53aa74f13781ad0aea8148b8607d861d9f7535"}},"required":["_id","name","description","hash","role","createdAt","updatedAt","key"]},"ApiKey":{"type":"object","properties":{"_id":{"type":"string","readOnly":true,"example":"639b178f19296ee0f2d0585d"},"name":{"type":"string","readOnly":true,"example":"89f7edbd"},"description":{"type":"string","example":"My API Key"},"hash":{"type":"string","readOnly":true,"example":"$2b$10$hfRNI.V7ewuN/K.5eSt6oelaQ.FDj6irfUNR9wkKnL/qsNT23aE4i"},"role":{"type":"string","enum":["USER","QUANTIFIER","FORWARDER","ADMIN","ROOT","API_KEY_READWRITE","API_KEY_READ","API_KEY_DISCORD_BOT","API_KEY_SETUP_WEB"]},"createdAt":{"format":"date-time","type":"string","readOnly":true},"updatedAt":{"format":"date-time","type":"string","readOnly":true}},"required":["_id","name","description","hash","role","createdAt","updatedAt"]},"UpdateDescriptionInputDto":{"type":"object","properties":{"description":{"type":"string","example":"My API Key"}},"required":["description"]},"NonceInputDto":{"type":"object","properties":{"identityEthAddress":{"type":"string","example":"0xAAB27b150451726EC7738aa1d0A94505c8729bd1"}},"required":["identityEthAddress"]},"NonceResponseDto":{"type":"object","properties":{"identityEthAddress":{"type":"string","readOnly":true,"example":"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"},"nonce":{"type":"string","readOnly":true,"example":"uh9h998u98uj09noj"}},"required":["identityEthAddress","nonce"]},"LoginInputDto":{"type":"object","properties":{"identityEthAddress":{"type":"string","example":"0xAAB27b150451726EC7738aa1d0A94505c8729bd1"},"signature":{"type":"string"}},"required":["identityEthAddress","signature"]},"LoginResponseDto":{"type":"object","properties":{"accessToken":{"type":"string","readOnly":true,"example":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiI2MmIwNmY3NjU1ODA0YjE2MjllODQxNTkiLCJpZGVudGl0eUV0aEFkZHJlc3MiOiIweGEzMmFFQ2RhNzUyY0Y0RUY4OTk1NmU4M2Q2MEMwNDgzNWQ0RkE4NjciLCJyb2xlcyI6WyJVU0VSIiwiQURNSU4iXSwiaXNSZWZyZXNoIjpmYWxzZSwiaWF0IjoxNjcwMzE1OTk4LCJleHAiOjE2NzAzMTk1OTh9.qKvucMZLVbz_1TnsxaSqYX1i5CSpver6fFJTf3pABVA"},"refreshToken":{"type":"string","readOnly":true,"example":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiI2MmIwNmY3NjU1ODA0YjE2MjllODQxNTkiLCJpZGVudGl0eUV0aEFkZHJlc3MiOiIweGEzMmFFQ2RhNzUyY0Y0RUY4OTk1NmU4M2Q2MEMwNDgzNWQ0RkE4NjciLCJyb2xlcyI6WyJVU0VSIiwiQURNSU4iXSwiaXNSZWZyZXNoIjpmYWxzZSwiaWF0IjoxNjcwMzE1OTk4LCJleHAiOjE2NzAzMTk1OTh9.qKvucMZLVbz_1TnsxaSqYX1i5CSpver6fFJTf3pABVA"},"identityEthAddress":{"type":"string","readOnly":true,"example":"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"},"tokenType":{"type":"string","readOnly":true,"example":"bearer"},"user":{"readOnly":true,"allOf":[{"$ref":"#/components/schemas/User"}]}},"required":["accessToken","refreshToken","identityEthAddress","tokenType","user"]},"GenerateTokenDto":{"type":"object","properties":{"refreshToken":{"type":"string","example":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiI2MmIwNmY3NjU1ODA0YjE2MjllODQxNTkiLCJpZGVudGl0eUV0aEFkZHJlc3MiOiIweGEzMmFFQ2RhNzUyY0Y0RUY4OTk1NmU4M2Q2MEMwNDgzNWQ0RkE4NjciLCJyb2xlcyI6WyJVU0VSIiwiQURNSU4iXSwiaXNSZWZyZXNoIjpmYWxzZSwiaWF0IjoxNjcwMzE1OTk4LCJleHAiOjE2NzAzMTk1OTh9.qKvucMZLVbz_1TnsxaSqYX1i5CSpver6fFJTf3pABVA"}},"required":["refreshToken"]},"CreateCommunityInputDto":{"type":"object","properties":{"hostname":{"type":"string","example":"banklessdao.givepraise.xyz","maxLength":255},"name":{"type":"string","example":"BanklessDAO","minLength":4,"maxLength":20},"email":{"type":"string","example":"john.smith@banklessDao.com","maxLength":255},"creator":{"type":"string","example":"0x123..","maxLength":42},"owners":{"example":["0x123..","0x345.."],"type":"array","items":{"type":"string"}},"discordGuildId":{"type":"string","example":"0980987846534","maxLength":32}},"required":["hostname","name","email","creator","owners"]},"Community":{"type":"object","properties":{"_id":{"type":"string","example":"621f802b813dbdba9eeaf7b4"},"hostname":{"type":"string","example":"banklessdao.givepraise.xyz","maxLength":255},"name":{"type":"string","example":"BanklessDAO","minLength":4,"maxLength":20},"email":{"type":"string","example":"john.smith@banklessDao.com","maxLength":255},"creator":{"type":"string","example":"0x123..","maxLength":42},"owners":{"example":["0x123..","0x345.."],"type":"array","items":{"type":"string"}},"discordGuildId":{"type":"string","example":"0980987846534","maxLength":32},"discordLinkNonce":{"type":"string","example":"oiujoiuoo8u","maxLength":255},"isPublic":{"type":"boolean","example":true},"discordLinkState":{"type":"string","enum":["NOT_SET","PENDING","ACTIVE","DEACTIVE"]}},"required":["_id","hostname","name","email","creator","owners","discordLinkNonce","isPublic","discordLinkState"]},"UpdateCommunityInputDto":{"type":"object","properties":{"hostname":{"type":"string","example":"banklessdao.givepraise.xyz","maxLength":255},"name":{"type":"string","example":"BanklessDAO","minLength":4,"maxLength":20},"email":{"type":"string","example":"john.smith@banklessDao.com","maxLength":255},"owners":{"example":["0x123..","0x345.."],"type":"array","items":{"type":"string"}}}},"CommunityPaginatedResponseDto":{"type":"object","properties":{"totalDocs":{"type":"number","readOnly":true,"example":1200},"limit":{"type":"number","readOnly":true,"example":10},"totalPages":{"type":"number","readOnly":true,"example":12},"page":{"type":"number","readOnly":true,"example":2},"pagingCounter":{"type":"number","readOnly":true,"example":1},"hasPrevPage":{"type":"object","readOnly":true,"example":false},"hasNextPage":{"type":"object","readOnly":true,"example":true},"prevPage":{"type":"object","readOnly":true,"example":1},"nextPage":{"type":"object","readOnly":true,"example":3},"docs":{"readOnly":true,"type":"array","items":{"$ref":"#/components/schemas/Community"}},"meta":{"type":"object"}},"required":["totalDocs","limit","totalPages","pagingCounter","hasPrevPage","hasNextPage","docs"]},"IsNameAvailableResponseDto":{"type":"object","properties":{"available":{"type":"boolean","example":false}},"required":["available"]},"LinkDiscordBotDto":{"type":"object","properties":{"signedMessage":{"type":"string","example":"0xdb4bb91357b23083ec2a36dc1fe23e59b71434fc020542da7e983df206ed06611e275eb30e239508f9758c0608dca6cef5619c41b50a48f22bdb36a8dabc2d201c"}},"required":["signedMessage"]},"QuantifyInputDto":{"type":"object","properties":{"score":{"type":"number"},"dismissed":{"type":"boolean"},"duplicatePraise":{"type":"string","example":"639b178f19296ee0f2d0585d"}}},"QuantifyMultipleInputDto":{"type":"object","properties":{"params":{"$ref":"#/components/schemas/QuantifyInputDto"},"praiseIds":{"example":["639b178f19296ee0f2d0585d","639b178f19296ee0f2d0585e","639b178f19296ee0f2d0585f"],"type":"array","items":{"type":"string"}}},"required":["params","praiseIds"]},"SettingDto":{"type":"object","properties":{"type":{"type":"string","description":"Type of the setting","enum":["string","number","boolean","array"],"example":"string"},"default":{"type":"object","description":"Default value for the setting","example":"Some string"},"description":{"type":"string","description":"Description of the setting","example":"Description of the string setting"},"markdownDescription":{"type":"string","description":"Markdown description of the setting","example":"Description of the string setting"},"editPresentation":{"type":"string","description":"Edit presentation style","enum":["multiline"],"example":"multiline"},"order":{"type":"number","description":"Order of the setting","example":1},"enum":{"description":"Enum values for string type settings","example":["left","right"],"type":"array","items":{"type":"string"}},"items":{"type":"object","properties":{"type":{"required":true,"type":"object"}}}},"required":["type","default","description","markdownDescription","order","items"]},"ReportManifestDto":{"type":"object","properties":{"manifestUrl":{"type":"string","example":"https://raw.githubusercontent.com/givepraise/reports/main/reports/disperse-dist-straight-curve-with-ceiling/manifest.json"},"name":{"type":"string","example":"simple-report"},"displayName":{"type":"string","example":"Simple Report"},"description":{"type":"string","example":"A simple report."},"version":{"type":"string","example":"1.2.3"},"author":{"type":"string","example":"General Magic"},"publisher":{"type":"string","example":"general-magic"},"license":{"type":"string","example":"MIT"},"repository":{"type":"string","example":"https://github.com/givepraise/reports"},"bugs":{"type":"string","example":"https://github.com/givepraise/reports/issues"},"categories":{"example":["Basic reports","Praise receiver reports"],"type":"array","items":{"type":"string"}},"keywords":{"example":["toplist"],"type":"array","items":{"type":"string"}},"configuration":{"type":"object","description":"Configuration settings for the report","additionalProperties":{"oneOf":[{"$ref":"#/components/schemas/SettingDto"}]}}},"required":["name","displayName","description","version","author","publisher","license","repository","bugs","categories","keywords","configuration"]}}}} \ No newline at end of file +{"openapi":"3.0.0","paths":{"/api/activate":{"post":{"operationId":"ActivateController_activate","summary":"Activate a user account in order to be able to give praise and receive rewards. Activation a user account creates a new User object or adds user account to User if it already exists.","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ActivateInputDto"}}}},"responses":{"200":{"description":"The created (or updated) user.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/User"}}}},"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/User"}}}}},"tags":["Activate"]}},"/api/users/export/json":{"get":{"operationId":"UsersController_exportJson","summary":"Export users document to json","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"string","format":"binary"}}}}},"tags":["Users"]}},"/api/users/export/csv":{"get":{"operationId":"UsersController_exportCsv","summary":"Export users document to csv","parameters":[],"responses":{"200":{"description":"","content":{"text/csv":{"schema":{"type":"string","format":"binary"}}}}},"tags":["Users"]}},"/api/users/export/parquet":{"get":{"operationId":"UsersController_exportParquet","summary":"Export users document to parquet","parameters":[],"responses":{"200":{"description":"","content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}}},"tags":["Users"]}},"/api/users":{"get":{"operationId":"UsersController_findAll","parameters":[],"responses":{"200":{"description":"All users","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/User"}}}}}},"tags":["Users"]}},"/api/users/{id}":{"get":{"operationId":"UsersController_findOne","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"A single user","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserWithStatsDto"}}}}},"tags":["Users"]},"patch":{"operationId":"UsersController_update","summary":"Updates a user","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateUserRequestDto"}}}},"responses":{"200":{"description":"Updated user","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserWithStatsDto"}}}}},"tags":["Users"]}},"/api/users/{id}/addRole":{"patch":{"operationId":"UsersController_addRole","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateUserRoleInputDto"}}}},"responses":{"200":{"description":"The updated user","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserWithStatsDto"}}}}},"tags":["Users"]}},"/api/users/{id}/removeRole":{"patch":{"operationId":"UsersController_removeRole","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateUserRoleInputDto"}}}},"responses":{"200":{"description":"The updated user","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserWithStatsDto"}}}}},"tags":["Users"]}},"/api/periods/export/json":{"get":{"operationId":"PeriodsController_exportJson","summary":"Export periods document to json","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"string","format":"binary"}}}}},"tags":["Periods"]}},"/api/periods/export/csv":{"get":{"operationId":"PeriodsController_exportCsv","summary":"Export periods document to csv","parameters":[],"responses":{"200":{"description":"","content":{"text/csv":{"schema":{"type":"string","format":"binary"}}}}},"tags":["Periods"]}},"/api/periods/export/parquet":{"get":{"operationId":"PeriodsController_exportParquet","summary":"Export periods document to parquet","parameters":[],"responses":{"200":{"description":"","content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}}},"tags":["Periods"]}},"/api/periods":{"get":{"operationId":"PeriodsController_findAllPaginated","summary":"List all periods","parameters":[{"name":"limit","required":true,"in":"query","example":10,"schema":{"type":"number"}},{"name":"page","required":true,"in":"query","example":1,"schema":{"type":"number"}},{"name":"sortColumn","required":false,"in":"query","schema":{"type":"string"}},{"name":"sortType","required":false,"in":"query","schema":{"default":"desc","enum":["asc","desc"],"type":"string"}}],"responses":{"200":{"description":"Periods","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PeriodPaginatedResponseDto"}}}}},"tags":["Periods"]},"post":{"operationId":"PeriodsController_create","summary":"Create a new period","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePeriodInputDto"}}}},"responses":{"200":{"description":"Period","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PeriodDetailsDto"}}}},"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PeriodDetailsDto"}}}}},"tags":["Periods"]}},"/api/periods/{id}":{"get":{"operationId":"PeriodsController_findOne","summary":"Find period by id","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"Period","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PeriodDetailsDto"}}}}},"tags":["Periods"]},"patch":{"operationId":"PeriodsController_update","summary":"Update a period","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdatePeriodInputDto"}}}},"responses":{"200":{"description":"Period","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PeriodDetailsDto"}}}}},"tags":["Periods"]}},"/api/periods/{id}/close":{"patch":{"operationId":"PeriodsController_close","summary":"Close a period","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"Period","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PeriodDetailsDto"}}}}},"tags":["Periods"]}},"/api/periods/{id}/praise":{"get":{"operationId":"PeriodsController_praise","summary":"Fetch all Praise in a period","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"Period Praise items","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/PraiseWithUserAccountsWithUserRefDto"}}}}}},"tags":["Periods"]}},"/api/periods/{periodId}/praise/receiver/{receiverId}":{"get":{"operationId":"PeriodsController_praiseByReceiver","summary":"Fetch all Praise in a period for a given receiver","parameters":[{"name":"periodId","required":true,"in":"path","schema":{"type":"string"}},{"name":"receiverId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"Period Praise items","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/PraiseWithUserAccountsWithUserRefDto"}}}}}},"tags":["Periods"]}},"/api/periods/{periodId}/praise/giver/{giverId}":{"get":{"operationId":"PeriodsController_praiseByGiver","summary":"Fetch all Praise in a period for a given giver","parameters":[{"name":"periodId","required":true,"in":"path","schema":{"type":"string"}},{"name":"giverId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"Period Praise items","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/PraiseWithUserAccountsWithUserRefDto"}}}}}},"tags":["Periods"]}},"/api/periods/{periodId}/praise/quantifier/{quantifierId}":{"get":{"operationId":"PeriodsController_praiseByQuantifier","summary":"Fetch all Praise in a period for a given quantifier","parameters":[{"name":"periodId","required":true,"in":"path","schema":{"type":"string"}},{"name":"quantifierId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"Period Praise items","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/PraiseWithUserAccountsWithUserRefDto"}}}}}},"tags":["Periods"]}},"/api/periods/{id}/verifyQuantifierPoolSize":{"get":{"operationId":"PeriodsController_verifyQuantifierPoolSize","summary":"Verify quantifier pool size","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"Period","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VerifyQuantifierPoolSizeDto"}}}}},"tags":["Periods"]}},"/api/periods/{id}/assignQuantifiers":{"patch":{"operationId":"PeriodsController_assignQuantifiers","summary":"Assign quantifiers to period","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"Period","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PeriodDetailsDto"}}}}},"tags":["Periods"]}},"/api/periods/{id}/replaceQuantifier":{"patch":{"operationId":"PeriodsController_replaceQuantifier","summary":"Replace quantifier in period","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReplaceQuantifierInputDto"}}}},"responses":{"200":{"description":"Period","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReplaceQuantifierResponseDto"}}}}},"tags":["Periods"]}},"/api/event-log":{"get":{"operationId":"EventLogController_findAllPaginated","summary":"List event logs, paginated results","parameters":[{"name":"limit","required":true,"in":"query","example":10,"schema":{"type":"number"}},{"name":"page","required":true,"in":"query","example":1,"schema":{"type":"number"}},{"name":"sortColumn","required":false,"in":"query","schema":{"type":"string"}},{"name":"sortType","required":false,"in":"query","schema":{"default":"desc","enum":["asc","desc"],"type":"string"}},{"name":"search","required":false,"in":"query","schema":{"type":"string"}},{"name":"types","required":false,"in":"query","schema":{"type":"array","items":{"type":"string"}}}],"responses":{"200":{"description":"Paginated event logs","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EventLogPaginatedResponseDto"}}}}},"tags":["Event Log"]}},"/api/event-log/types":{"get":{"operationId":"EventLogController_types","summary":"List event log types","parameters":[],"responses":{"200":{"description":"Event log types","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/EventLogType"}}}}}},"tags":["Event Log"]}},"/api/settings":{"get":{"operationId":"SettingsController_findAll","summary":"List all settings.","parameters":[{"name":"key","required":false,"in":"query","readOnly":true,"example":"SETTING_KEY","schema":{"type":"string"}},{"name":"type","required":false,"in":"query","readOnly":true,"schema":{"enum":["Integer","Float","String","Textarea","Boolean","IntegerList","StringList","Image","Radio","JSON"],"type":"string"}},{"name":"group","required":false,"in":"query","readOnly":true,"example":0,"schema":{"type":"number"}},{"name":"subgroup","required":false,"in":"query","readOnly":true,"example":0,"schema":{"type":"number"}}],"responses":{"200":{"description":"All settings.","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Setting"}}}}}},"tags":["Settings"]}},"/api/settings/{id}":{"get":{"operationId":"SettingsController_findOne","summary":"Get a setting.","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"Setting.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Setting"}}}}},"tags":["Settings"]},"patch":{"operationId":"SettingsController_set","summary":"Set a value for a setting.","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetSettingDto"}}}},"responses":{"200":{"description":"Updated setting.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Setting"}}}}},"tags":["Settings"]}},"/api/settings/{id}/upload":{"patch":{"operationId":"SettingsController_setWithUpload","summary":"Upload a file for a setting","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"Updated setting.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Setting"}}}}},"tags":["Settings"]}},"/api/settings/uploads/{file}":{"get":{"operationId":"SettingsController_serveUpload","summary":"Serve an uploaded settings file.","parameters":[{"name":"file","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"tags":["Settings"]}},"/api/periods/{periodId}/settings":{"get":{"operationId":"PeriodSettingsController_findAll","summary":"List all period settings.","parameters":[{"name":"periodId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"All period settings","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/PeriodSetting"}}}}}},"tags":["Periods"]}},"/api/periods/{periodId}/settings/{settingId}":{"get":{"operationId":"PeriodSettingsController_findOne","summary":"Get a period setting.","parameters":[{"name":"periodId","required":true,"in":"path","schema":{"type":"string"}},{"name":"settingId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"Period setting","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PeriodSetting"}}}}},"tags":["Periods"]},"patch":{"operationId":"PeriodSettingsController_set","summary":"Set value for a period setting.","parameters":[{"name":"periodId","required":true,"in":"path","schema":{"type":"string"}},{"name":"settingId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetPeriodSettingDto"}}}},"responses":{"200":{"description":"Updated period setting","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PeriodSetting"}}}}},"tags":["Periods"]}},"/api/praise":{"get":{"operationId":"PraiseController_findAllPaginated","summary":"List praise items, paginated results","parameters":[{"name":"limit","required":true,"in":"query","example":10,"schema":{"type":"number"}},{"name":"page","required":true,"in":"query","example":1,"schema":{"type":"number"}},{"name":"sortColumn","required":false,"in":"query","schema":{"type":"string"}},{"name":"sortType","required":false,"in":"query","schema":{"default":"desc","enum":["asc","desc"],"type":"string"}},{"name":"giver","required":false,"in":"query","schema":{"type":"string"}},{"name":"receiver","required":false,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"Paginated praise items","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PraisePaginatedResponseDto"}}}}},"tags":["Praise"]},"post":{"operationId":"PraiseController_praise","summary":"Create praise item","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PraiseCreateInputDto"}}}},"responses":{"200":{"description":"Praise item","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Praise"}}}},"201":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Praise"}}}}}},"tags":["Praise"]}},"/api/praise/export/json":{"get":{"operationId":"PraiseController_exportJson","summary":"Export praise document to json","parameters":[{"name":"startDate","required":false,"in":"query","schema":{"format":"date-time","type":"string"}},{"name":"endDate","required":false,"in":"query","schema":{"format":"date-time","type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"string","format":"binary"}}}}},"tags":["Praise"]}},"/api/praise/export/csv":{"get":{"operationId":"PraiseController_exportCsv","summary":"Export praise document to csv","parameters":[{"name":"startDate","required":false,"in":"query","schema":{"format":"date-time","type":"string"}},{"name":"endDate","required":false,"in":"query","schema":{"format":"date-time","type":"string"}}],"responses":{"200":{"description":"","content":{"text/csv":{"schema":{"type":"string","format":"binary"}}}}},"tags":["Praise"]}},"/api/praise/export/parquet":{"get":{"operationId":"PraiseController_exportParquet","summary":"Export praise document to parquet","parameters":[{"name":"startDate","required":false,"in":"query","schema":{"format":"date-time","type":"string"}},{"name":"endDate","required":false,"in":"query","schema":{"format":"date-time","type":"string"}}],"responses":{"200":{"description":"","content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}}},"tags":["Praise"]}},"/api/praise/{id}":{"get":{"operationId":"PraiseController_findOne","summary":"Find praise item by id","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"Praise item","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Praise"}}}}},"tags":["Praise"]}},"/api/praise/forward":{"post":{"operationId":"PraiseController_forward","summary":"Forward praise item","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PraiseForwardInputDto"}}}},"responses":{"200":{"description":"Praise item","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Praise"}}}},"201":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Praise"}}}}}},"tags":["Praise"]}},"/api/useraccounts":{"post":{"operationId":"UserAccountsController_create","summary":"Create a UserAccount","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateUserAccountInputDto"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateUserAccountResponseDto"}}}}},"tags":["UserAccounts"]},"get":{"operationId":"UserAccountsController_findAll","summary":"UserAccount list","parameters":[{"name":"accountId","required":false,"in":"query","example":"098098098098098","schema":{"minLength":10,"maxLength":255,"type":"string"}},{"name":"name","required":false,"in":"query","example":"darth#6755","schema":{"minLength":4,"maxLength":32,"type":"string"}},{"name":"user","required":false,"in":"query","example":"63b428f7d9ca4f6ff5370d05","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserAccount"}}}}},"tags":["UserAccounts"]}},"/api/useraccounts/export/json":{"get":{"operationId":"UserAccountsController_exportJson","summary":"Export userAccounts document to json","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"string","format":"binary"}}}}},"tags":["UserAccounts"]}},"/api/useraccounts/export/csv":{"get":{"operationId":"UserAccountsController_exportCsv","summary":"Export userAccounts document to csv","parameters":[],"responses":{"200":{"description":"","content":{"text/csv":{"schema":{"type":"string","format":"binary"}}}}},"tags":["UserAccounts"]}},"/api/useraccounts/export/parquet":{"get":{"operationId":"UserAccountsController_exportParquet","summary":"Export userAccounts document to parquet","parameters":[],"responses":{"200":{"description":"","content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}}},"tags":["UserAccounts"]}},"/api/useraccounts/{id}":{"get":{"operationId":"UserAccountsController_findOne","summary":"Get a UserAccount.","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"UserAccount","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserAccount"}}}}},"tags":["UserAccounts"]},"patch":{"operationId":"UserAccountsController_update","summary":"Update UserAccount","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateUserAccountInputDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateUserAccountResponseDto"}}}}},"tags":["UserAccounts"]}},"/api/api-key":{"post":{"operationId":"ApiKeyController_createApiKey","summary":"Create API key","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateApiKeyInputDto"}}}},"responses":{"201":{"description":"API key created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateApiKeyResponseDto"}}}}},"tags":["API Key"]},"get":{"operationId":"ApiKeyController_findAll","summary":"List all API keys","parameters":[],"responses":{"200":{"description":"Array of API keys","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ApiKey"}}}}}},"tags":["API Key"]}},"/api/api-key/{id}":{"get":{"operationId":"ApiKeyController_findOne","summary":"Get API key by ID","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"An API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKey"}}}}},"tags":["API Key"]},"put":{"operationId":"ApiKeyController_updateApiKeyDescription","summary":"Update API key description","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateDescriptionInputDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKey"}}}},"201":{"description":"API key with updated description","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKey"}}}}},"tags":["API Key"]},"delete":{"operationId":"ApiKeyController_revokeApiKey","summary":"Revoke API key","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKey"}}}},"201":{"description":"Revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKey"}}}}},"tags":["API Key"]}},"/api/auth/eth-signature/nonce":{"post":{"operationId":"EthSignatureController_nonce","summary":"Generates a nonce for the user and returns it","parameters":[],"requestBody":{"required":true,"description":"A request containing the user identityEthAddress","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NonceInputDto"}}}},"responses":{"201":{"description":"Nonce generated successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NonceResponseDto"}}}}},"tags":["Authentication"]}},"/api/auth/eth-signature/login":{"post":{"operationId":"EthSignatureController_login","summary":"Verifies a user's signature and returns a JWT token","parameters":[{"name":"host","required":true,"in":"header","schema":{"type":"string"}}],"requestBody":{"required":true,"description":"A request containing the user identityEthAddress and signedlogin message. The signed message should be structured as follows: \n\n```SIGN THIS MESSAGE TO LOGIN TO PRAISE.\\n\\nADDRESS:\\n[identityEthAddress]\\n\\nNONCE:\\n[nonce]```","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginInputDto"}}}},"responses":{"201":{"description":"User authenticated successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginResponseDto"}}}}},"tags":["Authentication"]}},"/api/auth/eth-signature/refresh":{"post":{"operationId":"EthSignatureController_token","summary":"Verifies a refreshToken and returns a JWT token","parameters":[{"name":"host","required":true,"in":"header","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenerateTokenDto"}}}},"responses":{"201":{"description":"Tokens generated successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginResponseDto"}}}}},"tags":["Authentication"]}},"/api/communities":{"post":{"operationId":"CommunityController_create","summary":"Create a new community","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCommunityInputDto"}}}},"responses":{"200":{"description":"Community","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Community"}}}},"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Community"}}}}},"tags":["Communities"]},"get":{"operationId":"CommunityController_findAll","parameters":[{"name":"limit","required":true,"in":"query","example":10,"schema":{"type":"number"}},{"name":"page","required":true,"in":"query","example":1,"schema":{"type":"number"}},{"name":"sortColumn","required":false,"in":"query","schema":{"type":"string"}},{"name":"sortType","required":false,"in":"query","schema":{"default":"desc","enum":["asc","desc"],"type":"string"}}],"responses":{"200":{"description":"All communities","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommunityPaginatedResponseDto"}}}}},"tags":["Communities"]}},"/api/communities/{id}":{"patch":{"operationId":"CommunityController_update","summary":"Update community","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateCommunityInputDto"}}}},"responses":{"200":{"description":"Community","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Community"}}}}},"tags":["Communities"]},"get":{"operationId":"CommunityController_findOne","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"A single Community","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Community"}}}}},"tags":["Communities"]}},"/api/communities/isNameAvailable":{"get":{"operationId":"CommunityController_isNameAvailable","parameters":[{"name":"name","required":true,"in":"query","example":"test_12345","schema":{"type":"string"}}],"responses":{"200":{"description":"Checking whether the community name is available","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IsNameAvailableResponseDto"}}}}},"tags":["Communities"]}},"/api/communities/{id}/discord/link":{"patch":{"operationId":"CommunityController_linkDiscord","summary":"Link discord to community","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LinkDiscordBotDto"}}}},"responses":{"200":{"description":"Community","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Community"}}}}},"tags":["Communities"]}},"/api/quantifications/export/json":{"get":{"operationId":"QuantificationsController_exportJson","summary":"Export quantifications document to json","parameters":[{"name":"startDate","required":false,"in":"query","schema":{"format":"date-time","type":"string"}},{"name":"endDate","required":false,"in":"query","schema":{"format":"date-time","type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"string","format":"binary"}}}}},"tags":["Quantifications"]}},"/api/quantifications/export/csv":{"get":{"operationId":"QuantificationsController_exportCsv","summary":"Export quantifications document to csv","parameters":[{"name":"startDate","required":false,"in":"query","schema":{"format":"date-time","type":"string"}},{"name":"endDate","required":false,"in":"query","schema":{"format":"date-time","type":"string"}}],"responses":{"200":{"description":"","content":{"text/csv":{"schema":{"type":"string","format":"binary"}}}}},"tags":["Quantifications"]}},"/api/quantifications/export/parquet":{"get":{"operationId":"QuantificationsController_exportParquet","summary":"Export quantifications document to parquet","parameters":[{"name":"startDate","required":false,"in":"query","schema":{"format":"date-time","type":"string"}},{"name":"endDate","required":false,"in":"query","schema":{"format":"date-time","type":"string"}}],"responses":{"200":{"description":"","content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}}},"tags":["Quantifications"]}},"/api/quantifications/multiple":{"patch":{"operationId":"QuantificationsController_quantifyMultiple","summary":"Quantify multiple praise items","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/QuantifyMultipleInputDto"}}}},"responses":{"200":{"description":"Praise items","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Praise"}}}}}},"tags":["Quantifications"]}},"/api/quantifications/{id}":{"patch":{"operationId":"QuantificationsController_quantify","summary":"Quantify praise item by id","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/QuantifyInputDto"}}}},"responses":{"200":{"description":"Praise items","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Praise"}}}}}},"tags":["Quantifications"]}},"/api/reports":{"get":{"operationId":"ReportsController_listAllReports","summary":"List all report manifests","parameters":[],"responses":{"200":{"description":"A list of report manifests","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ReportManifestDto"}}}}},"500":{"description":"An error occurred while fetching report manifests"}},"tags":["Reports"]}},"/api/reports/receiverBio/{userAccountId}":{"get":{"operationId":"ReportsController_receiverBio","summary":"Get one AI generated receiver bio","parameters":[{"name":"userAccountId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"A receiver bio","content":{"application/json":{"schema":{"type":"string"}}}}},"tags":["Reports"]}},"/api/reports/receiverLabels/{userAccountId}":{"get":{"operationId":"ReportsController_receiverLabels","summary":"AI generated labels describing a praise receiver.","parameters":[{"name":"userAccountId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"Comma separated list of labels, 7 max","content":{"application/json":{"schema":{"type":"string"}}}}},"tags":["Reports"]}}},"info":{"title":"Praise API","description":"","version":"1.0.0","contact":{}},"tags":[],"servers":[],"components":{"schemas":{"ActivateInputDto":{"type":"object","properties":{"identityEthAddress":{"type":"string","example":"0xAAB27b150451726EC7738aa1d0A94505c8729bd1"},"accountId":{"type":"string","example":"darth#3455"},"signature":{"type":"string","example":"0xdb4bb91357b23083ec2a36dc1fe23e59b71434fc020542da7e983df206ed06611e275eb30e239508f9758c0608dca6cef5619c41b50a48f22bdb36a8dabc2d201c"}},"required":["identityEthAddress","accountId","signature"]},"UserNoUserAccountsDto":{"type":"object","properties":{"_id":{"type":"string","readOnly":true,"example":"5f9f1b9b9b9b9b9b9b9b9b9b"},"identityEthAddress":{"type":"string","readOnly":true,"example":"0xAAB27b150451726EC7738aa1d0A94505c8729bd1"},"rewardsEthAddress":{"type":"string","example":"0xAAB27b150451726EC7738aa1d0A94505c8729bd1","maxLength":42},"username":{"type":"string","example":"darth","maxLength":20},"roles":{"type":"array","readOnly":true,"items":{"type":"string","enum":["USER","QUANTIFIER","FORWARDER","ADMIN","ROOT","API_KEY_READWRITE","API_KEY_READ","API_KEY_DISCORD_BOT","API_KEY_SETUP_WEB"]}},"createdAt":{"format":"date-time","type":"string","readOnly":true},"updatedAt":{"format":"date-time","type":"string","readOnly":true}},"required":["_id","identityEthAddress","rewardsEthAddress","username","roles","createdAt","updatedAt"]},"UserAccount":{"type":"object","properties":{"_id":{"type":"string","readOnly":true,"example":"63b428f7d9ca4f6ff5370d05"},"user":{"$ref":"#/components/schemas/UserNoUserAccountsDto"},"accountId":{"type":"string","example":"098098098098098","minLength":10,"maxLength":255},"name":{"type":"string","example":"darth#6755","minLength":4,"maxLength":32},"avatarId":{"type":"string","example":"098098098087097","minLength":10,"maxLength":255},"platform":{"type":"string","example":"DISCORD","minLength":4,"maxLength":255},"createdAt":{"format":"date-time","type":"string","readOnly":true},"updatedAt":{"format":"date-time","type":"string","readOnly":true}},"required":["_id","accountId","name","platform","createdAt","updatedAt"]},"User":{"type":"object","properties":{"_id":{"type":"string","readOnly":true,"example":"5f9f1b9b9b9b9b9b9b9b9b9b"},"identityEthAddress":{"type":"string","readOnly":true,"example":"0xAAB27b150451726EC7738aa1d0A94505c8729bd1"},"rewardsEthAddress":{"type":"string","example":"0xAAB27b150451726EC7738aa1d0A94505c8729bd1","maxLength":42},"username":{"type":"string","example":"darth","maxLength":20},"roles":{"type":"array","readOnly":true,"items":{"type":"string","enum":["USER","QUANTIFIER","FORWARDER","ADMIN","ROOT","API_KEY_READWRITE","API_KEY_READ","API_KEY_DISCORD_BOT","API_KEY_SETUP_WEB"]}},"accounts":{"readOnly":true,"type":"array","items":{"$ref":"#/components/schemas/UserAccount"}},"createdAt":{"format":"date-time","type":"string","readOnly":true},"updatedAt":{"format":"date-time","type":"string","readOnly":true}},"required":["_id","identityEthAddress","rewardsEthAddress","username","roles","accounts","createdAt","updatedAt"]},"UserWithStatsDto":{"type":"object","properties":{"_id":{"type":"string","readOnly":true,"example":"5f9f1b9b9b9b9b9b9b9b9b9b"},"identityEthAddress":{"type":"string","readOnly":true,"example":"0xAAB27b150451726EC7738aa1d0A94505c8729bd1"},"rewardsEthAddress":{"type":"string","example":"0xAAB27b150451726EC7738aa1d0A94505c8729bd1","maxLength":42},"username":{"type":"string","example":"darth","maxLength":20},"roles":{"type":"array","readOnly":true,"items":{"type":"string","enum":["USER","QUANTIFIER","FORWARDER","ADMIN","ROOT","API_KEY_READWRITE","API_KEY_READ","API_KEY_DISCORD_BOT","API_KEY_SETUP_WEB"]}},"accounts":{"readOnly":true,"type":"array","items":{"$ref":"#/components/schemas/UserAccount"}},"createdAt":{"format":"date-time","type":"string","readOnly":true},"updatedAt":{"format":"date-time","type":"string","readOnly":true},"receivedTotalScore":{"type":"number","readOnly":true},"receivedTotalCount":{"type":"number","readOnly":true},"givenTotalScore":{"type":"number","readOnly":true},"givenTotalCount":{"type":"number","readOnly":true}},"required":["_id","identityEthAddress","rewardsEthAddress","username","roles","accounts","createdAt","updatedAt"]},"UpdateUserRequestDto":{"type":"object","properties":{"rewardsEthAddress":{"type":"string","example":"0xAAB27b150451726EC7738aa1d0A94505c8729bd1","maxLength":42},"username":{"type":"string","example":"darth","maxLength":20}},"required":["rewardsEthAddress","username"]},"UpdateUserRoleInputDto":{"type":"object","properties":{"role":{"enum":["USER","QUANTIFIER","FORWARDER","ADMIN","ROOT","API_KEY_READWRITE","API_KEY_READ","API_KEY_DISCORD_BOT","API_KEY_SETUP_WEB"],"type":"string"}},"required":["role"]},"Period":{"type":"object","properties":{"_id":{"type":"string","readOnly":true,"example":"621f802b813dbdba9eeaf7d7"},"name":{"type":"string","example":"June 2021"},"status":{"type":"string","readOnly":true,"enum":["OPEN","QUANTIFY","CLOSED"]},"endDate":{"format":"date-time","type":"string","readOnly":true},"createdAt":{"format":"date-time","type":"string","readOnly":true},"updatedAt":{"format":"date-time","type":"string","readOnly":true}},"required":["_id","name","status","endDate","createdAt","updatedAt"]},"PeriodPaginatedResponseDto":{"type":"object","properties":{"totalDocs":{"type":"number","readOnly":true,"example":1200},"limit":{"type":"number","readOnly":true,"example":10},"totalPages":{"type":"number","readOnly":true,"example":12},"page":{"type":"number","readOnly":true,"example":2},"pagingCounter":{"type":"number","readOnly":true,"example":1},"hasPrevPage":{"type":"object","readOnly":true,"example":false},"hasNextPage":{"type":"object","readOnly":true,"example":true},"prevPage":{"type":"object","readOnly":true,"example":1},"nextPage":{"type":"object","readOnly":true,"example":3},"docs":{"readOnly":true,"type":"array","items":{"$ref":"#/components/schemas/Period"}},"meta":{"type":"object"}},"required":["totalDocs","limit","totalPages","pagingCounter","hasPrevPage","hasNextPage","docs"]},"Quantification":{"type":"object","properties":{"_id":{"type":"string","readOnly":true,"example":"639b178f19296ee0f2d0585d"},"score":{"type":"number","readOnly":true,"example":144},"scoreRealized":{"type":"number","readOnly":true,"example":144},"dismissed":{"type":"boolean","readOnly":true,"example":true},"duplicatePraise":{"type":"string","readOnly":true,"example":"639b178f19296ee0f2d0585d"},"quantifier":{"type":"string","readOnly":true,"example":"639b178f19296ee0f2d0585d"},"praise":{"type":"string","readOnly":true,"example":"639b178f19296ee0f2d0585d"},"createdAt":{"format":"date-time","type":"string","readOnly":true,"example":"2021-06-01T00:00:00.000Z"},"updatedAt":{"format":"date-time","type":"string","readOnly":true,"example":"2021-06-01T00:00:00.000Z"}},"required":["_id","score","scoreRealized","dismissed","duplicatePraise","quantifier","praise","createdAt","updatedAt"]},"PeriodDetailsQuantifierDto":{"type":"object","properties":{"_id":{"type":"string","readOnly":true,"example":"5f9f1b9b9b9b9b9b9b9b9b9b"},"identityEthAddress":{"type":"string","readOnly":true,"example":"0xAAB27b150451726EC7738aa1d0A94505c8729bd1"},"username":{"type":"string","example":"darth","maxLength":20},"createdAt":{"format":"date-time","type":"string","readOnly":true},"updatedAt":{"format":"date-time","type":"string","readOnly":true},"finishedCount":{"type":"number","readOnly":true,"example":1},"praiseCount":{"type":"number","readOnly":true,"example":1},"quantifications":{"type":"array","items":{"$ref":"#/components/schemas/Quantification"}}},"required":["_id","identityEthAddress","username","createdAt","updatedAt","finishedCount","praiseCount","quantifications"]},"PeriodDetailsGiverReceiverDto":{"type":"object","properties":{"_id":{"type":"string","readOnly":true,"example":"63b428f7d9ca4f6ff5370d05"},"accountId":{"type":"string","example":"098098098098098","minLength":10,"maxLength":255},"name":{"type":"string","example":"darth#6755","minLength":4,"maxLength":32},"avatarId":{"type":"string","example":"098098098087097","minLength":10,"maxLength":255},"platform":{"type":"string","example":"DISCORD","minLength":4,"maxLength":255},"createdAt":{"format":"date-time","type":"string","readOnly":true},"updatedAt":{"format":"date-time","type":"string","readOnly":true},"user":{"type":"string","readOnly":true,"example":"621f802b813dbdba9eeaf7d7"},"praiseCount":{"type":"number","readOnly":true,"example":"5"},"score":{"type":"number","readOnly":true,"example":144}},"required":["_id","accountId","name","platform","createdAt","updatedAt","user","praiseCount","score"]},"PeriodDetailsDto":{"type":"object","properties":{"_id":{"type":"string","readOnly":true,"example":"621f802b813dbdba9eeaf7d7"},"name":{"type":"string","example":"June 2021"},"status":{"type":"string","readOnly":true,"enum":["OPEN","QUANTIFY","CLOSED"]},"endDate":{"format":"date-time","type":"string","readOnly":true},"createdAt":{"format":"date-time","type":"string","readOnly":true},"updatedAt":{"format":"date-time","type":"string","readOnly":true},"quantifiers":{"readOnly":true,"type":"array","items":{"$ref":"#/components/schemas/PeriodDetailsQuantifierDto"}},"givers":{"readOnly":true,"type":"array","items":{"$ref":"#/components/schemas/PeriodDetailsGiverReceiverDto"}},"receivers":{"readOnly":true,"type":"array","items":{"$ref":"#/components/schemas/PeriodDetailsGiverReceiverDto"}},"numberOfPraise":{"type":"number","readOnly":true,"example":543}},"required":["_id","name","status","endDate","createdAt","updatedAt","numberOfPraise"]},"CreatePeriodInputDto":{"type":"object","properties":{"name":{"type":"string","example":"June 2021"},"endDate":{"type":"string"}},"required":["name","endDate"]},"UpdatePeriodInputDto":{"type":"object","properties":{"name":{"type":"string","example":"June 2021"},"endDate":{"type":"string"}}},"UserAccountWithUserRefDto":{"type":"object","properties":{"_id":{"type":"string","readOnly":true,"example":"63b428f7d9ca4f6ff5370d05"},"user":{"type":"string","readOnly":true,"example":"621f802b813dbdba9eeaf7d7"},"accountId":{"type":"string","example":"098098098098098","minLength":10,"maxLength":255},"name":{"type":"string","example":"darth#6755","minLength":4,"maxLength":32},"avatarId":{"type":"string","example":"098098098087097","minLength":10,"maxLength":255},"platform":{"type":"string","example":"DISCORD","minLength":4,"maxLength":255},"createdAt":{"format":"date-time","type":"string","readOnly":true},"updatedAt":{"format":"date-time","type":"string","readOnly":true}},"required":["_id","accountId","name","platform","createdAt","updatedAt"]},"PraiseWithUserAccountsWithUserRefDto":{"type":"object","properties":{"_id":{"type":"string","readOnly":true,"example":"639b178f19296ee0f2d0585d"},"reasonRaw":{"type":"string","readOnly":true,"example":"for making edits in the welcome text"},"reason":{"type":"string","readOnly":true,"example":"for making edits in the welcome text"},"sourceId":{"type":"string","readOnly":true,"example":"DISCORD:810180621930070088:810180622336262195"},"sourceName":{"type":"string","readOnly":true,"example":"DISCORD:Token%20Engineering%20Commons:%F0%9F%99%8F%EF%BD%9Cpraise"},"score":{"type":"number","readOnly":true,"example":144},"receiver":{"readOnly":true,"allOf":[{"$ref":"#/components/schemas/UserAccountWithUserRefDto"}]},"giver":{"readOnly":true,"allOf":[{"$ref":"#/components/schemas/UserAccountWithUserRefDto"}]},"forwarder":{"readOnly":true,"allOf":[{"$ref":"#/components/schemas/UserAccountWithUserRefDto"}]},"quantifications":{"readOnly":true,"type":"array","items":{"$ref":"#/components/schemas/Quantification"}},"createdAt":{"format":"date-time","type":"string","readOnly":true},"updatedAt":{"format":"date-time","type":"string","readOnly":true}},"required":["_id","reasonRaw","reason","sourceId","sourceName","score","receiver","giver","quantifications","createdAt","updatedAt"]},"VerifyQuantifierPoolSizeDto":{"type":"object","properties":{"quantifierPoolSize":{"type":"number","description":"The number of quantifiers in the pool","example":10},"quantifierPoolSizeNeeded":{"type":"number","description":"The number of quantifiers needed in the pool","example":10},"quantifierPoolDeficitSize":{"type":"number","description":"","example":0}},"required":["quantifierPoolSize","quantifierPoolSizeNeeded","quantifierPoolDeficitSize"]},"ReplaceQuantifierInputDto":{"type":"object","properties":{"currentQuantifierId":{"type":"string","example":"639b178f19296ee0f2d0585d"},"newQuantifierId":{"type":"string","example":"639b178f19296ee0f2d05666"}},"required":["currentQuantifierId","newQuantifierId"]},"Praise":{"type":"object","properties":{"_id":{"type":"string","readOnly":true,"example":"639b178f19296ee0f2d0585d"},"reasonRaw":{"type":"string","readOnly":true,"example":"for making edits in the welcome text"},"reason":{"type":"string","readOnly":true,"example":"for making edits in the welcome text"},"sourceId":{"type":"string","readOnly":true,"example":"DISCORD:810180621930070088:810180622336262195"},"sourceName":{"type":"string","readOnly":true,"example":"DISCORD:Token%20Engineering%20Commons:%F0%9F%99%8F%EF%BD%9Cpraise"},"score":{"type":"number","readOnly":true,"example":144},"receiver":{"readOnly":true,"allOf":[{"$ref":"#/components/schemas/UserAccount"}]},"giver":{"readOnly":true,"allOf":[{"$ref":"#/components/schemas/UserAccount"}]},"forwarder":{"$ref":"#/components/schemas/UserAccount"},"quantifications":{"readOnly":true,"type":"array","items":{"$ref":"#/components/schemas/Quantification"}},"createdAt":{"format":"date-time","type":"string","readOnly":true},"updatedAt":{"format":"date-time","type":"string","readOnly":true}},"required":["_id","reasonRaw","reason","sourceId","sourceName","score","receiver","giver","quantifications","createdAt","updatedAt"]},"ReplaceQuantifierResponseDto":{"type":"object","properties":{"praises":{"readOnly":true,"type":"array","items":{"$ref":"#/components/schemas/Praise"}},"period":{"readOnly":true,"allOf":[{"$ref":"#/components/schemas/PeriodDetailsDto"}]}},"required":["praises","period"]},"UserAccountNoUserId":{"type":"object","properties":{"_id":{"type":"string","readOnly":true,"example":"63b428f7d9ca4f6ff5370d05"},"accountId":{"type":"string","example":"098098098098098","minLength":10,"maxLength":255},"name":{"type":"string","example":"darth#6755","minLength":4,"maxLength":32},"avatarId":{"type":"string","example":"098098098087097","minLength":10,"maxLength":255},"platform":{"type":"string","example":"DISCORD","minLength":4,"maxLength":255},"createdAt":{"format":"date-time","type":"string","readOnly":true},"updatedAt":{"format":"date-time","type":"string","readOnly":true}},"required":["_id","accountId","name","platform","createdAt","updatedAt"]},"EventLogType":{"type":"object","properties":{"key":{"type":"string","enum":["PERMISSION","AUTHENTICATION","PERIOD","PRAISE","QUANTIFICATION","SETTING","USER_ACCOUNT","COMMUNITY"]},"label":{"type":"string","example":"An action that changes user permissions","maxLength":255},"description":{"type":"string","example":"A user's permissions were changed","maxLength":255}},"required":["key","label","description"]},"EventLog":{"type":"object","properties":{"_id":{"type":"string","example":"621f802b813dbdba9eeaf7d7"},"user":{"$ref":"#/components/schemas/User"},"useraccount":{"$ref":"#/components/schemas/UserAccountNoUserId"},"apiKey":{"type":"string","example":"621f802b813dbdba9eeaf7d7"},"period":{"type":"string","example":"621f802b813dbdba9eeaf7d7"},"type":{"$ref":"#/components/schemas/EventLogType"},"description":{"type":"string","example":"A description of the event "},"createdAt":{"format":"date-time","type":"string","example":"2023-03-01T22:51:20.012Z"},"updatedAt":{"format":"date-time","type":"string","example":"2023-03-01T22:51:20.012Z"}},"required":["_id","type","description","createdAt","updatedAt"]},"EventLogPaginatedResponseDto":{"type":"object","properties":{"totalDocs":{"type":"number","readOnly":true,"example":1200},"limit":{"type":"number","readOnly":true,"example":10},"totalPages":{"type":"number","readOnly":true,"example":12},"page":{"type":"number","readOnly":true,"example":2},"pagingCounter":{"type":"number","readOnly":true,"example":1},"hasPrevPage":{"type":"object","readOnly":true,"example":false},"hasNextPage":{"type":"object","readOnly":true,"example":true},"prevPage":{"type":"object","readOnly":true,"example":1},"nextPage":{"type":"object","readOnly":true,"example":3},"docs":{"readOnly":true,"type":"array","items":{"$ref":"#/components/schemas/EventLog"}},"meta":{"type":"object"}},"required":["totalDocs","limit","totalPages","pagingCounter","hasPrevPage","hasNextPage","docs"]},"Setting":{"type":"object","properties":{"_id":{"type":"string","readOnly":true,"example":"621f802b813dbdbaddeaf799"},"key":{"type":"string","readOnly":true,"example":"SETTING_KEY"},"value":{"type":"string","example":"666","maxLength":512},"valueRealized":{"example":666,"oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}},{"type":"boolean"},{"type":"number"},{"type":"array","items":{"type":"number"}}]},"defaultValue":{"type":"string","readOnly":true,"example":"555"},"type":{"type":"string","readOnly":true,"enum":["Integer","Float","String","Textarea","Boolean","IntegerList","StringList","Image","Radio","JSON"]},"label":{"type":"string","readOnly":true,"example":"Quantifiers Per Praise"},"description":{"type":"string","readOnly":true,"example":"How many redundant quantifications are assigned to each praise?"},"group":{"type":"number","readOnly":true,"example":0},"options":{"type":"string","readOnly":true},"subgroup":{"type":"number","readOnly":true,"example":0},"periodOverridable":{"type":"boolean","readOnly":true,"example":true}},"required":["_id","key","value","valueRealized","defaultValue","type","label","description","group","options","subgroup","periodOverridable"]},"SetSettingDto":{"type":"object","properties":{"value":{"type":"string","example":"666","maxLength":512}},"required":["value"]},"PeriodSetting":{"type":"object","properties":{"_id":{"type":"string","readOnly":true,"example":"62291b7ea8b1619f78818524"},"period":{"readOnly":true,"allOf":[{"$ref":"#/components/schemas/Period"}]},"setting":{"readOnly":true,"allOf":[{"$ref":"#/components/schemas/Setting"}]},"value":{"type":"string","example":"666","maxLength":512},"valueRealized":{"example":666,"oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}},{"type":"boolean"},{"type":"number"},{"type":"array","items":{"type":"number"}}]}},"required":["_id","period","setting","value","valueRealized"]},"SetPeriodSettingDto":{"type":"object","properties":{"value":{"type":"string","example":"666","maxLength":512}},"required":["value"]},"PraisePaginatedResponseDto":{"type":"object","properties":{"totalDocs":{"type":"number","readOnly":true,"example":1200},"limit":{"type":"number","readOnly":true,"example":10},"totalPages":{"type":"number","readOnly":true,"example":12},"page":{"type":"number","readOnly":true,"example":2},"pagingCounter":{"type":"number","readOnly":true,"example":1},"hasPrevPage":{"type":"object","readOnly":true,"example":false},"hasNextPage":{"type":"object","readOnly":true,"example":true},"prevPage":{"type":"object","readOnly":true,"example":1},"nextPage":{"type":"object","readOnly":true,"example":3},"docs":{"readOnly":true,"type":"array","items":{"$ref":"#/components/schemas/Praise"}},"meta":{"type":"object"}},"required":["totalDocs","limit","totalPages","pagingCounter","hasPrevPage","hasNextPage","docs"]},"PraiseCreateInputDto":{"type":"object","properties":{"reasonRaw":{"type":"string","readOnly":true,"example":"for making edits in the welcome text"},"reason":{"type":"string","readOnly":true,"example":"for making edits in the welcome text"},"sourceId":{"type":"string","readOnly":true,"example":"DISCORD:810180621930070088:810180622336262195"},"sourceName":{"type":"string","readOnly":true,"example":"DISCORD:Token%20Engineering%20Commons:%F0%9F%99%8F%EF%BD%9Cpraise"},"receiverIds":{"type":"array","items":{"type":"string"}},"giver":{"$ref":"#/components/schemas/UserAccount"}},"required":["reasonRaw","reason","sourceId","sourceName","receiverIds","giver"]},"PraiseForwardInputDto":{"type":"object","properties":{"reasonRaw":{"type":"string","readOnly":true,"example":"for making edits in the welcome text"},"reason":{"type":"string","readOnly":true,"example":"for making edits in the welcome text"},"sourceId":{"type":"string","readOnly":true,"example":"DISCORD:810180621930070088:810180622336262195"},"sourceName":{"type":"string","readOnly":true,"example":"DISCORD:Token%20Engineering%20Commons:%F0%9F%99%8F%EF%BD%9Cpraise"},"receiverIds":{"type":"array","items":{"type":"string"}},"giver":{"$ref":"#/components/schemas/UserAccount"},"forwarder":{"$ref":"#/components/schemas/UserAccount"}},"required":["reasonRaw","reason","sourceId","sourceName","receiverIds","giver","forwarder"]},"CreateUserAccountInputDto":{"type":"object","properties":{"accountId":{"type":"string","example":"098098098098098","minLength":10,"maxLength":255},"name":{"type":"string","example":"darth#6755","minLength":4,"maxLength":32},"avatarId":{"type":"string","example":"098098098087097","minLength":10,"maxLength":255},"platform":{"type":"string","example":"DISCORD","minLength":4,"maxLength":255},"activateToken":{"type":"string","example":"jkhvuygi643jh35g53"},"user":{"type":"string","example":"63b428f7d9ca4f6ff5370d05"}},"required":["accountId","name","platform"]},"CreateUserAccountResponseDto":{"type":"object","properties":{"_id":{"type":"string","readOnly":true,"example":"63b428f7d9ca4f6ff5370d05"},"user":{"$ref":"#/components/schemas/UserNoUserAccountsDto"},"accountId":{"type":"string","example":"098098098098098","minLength":10,"maxLength":255},"name":{"type":"string","example":"darth#6755","minLength":4,"maxLength":32},"avatarId":{"type":"string","example":"098098098087097","minLength":10,"maxLength":255},"platform":{"type":"string","example":"DISCORD","minLength":4,"maxLength":255},"createdAt":{"format":"date-time","type":"string","readOnly":true},"updatedAt":{"format":"date-time","type":"string","readOnly":true},"activateToken":{"type":"string","readOnly":true,"example":"jkhvuygi643jh35g53"}},"required":["_id","accountId","name","platform","createdAt","updatedAt"]},"UpdateUserAccountInputDto":{"type":"object","properties":{"accountId":{"type":"string","example":"098098098098098","minLength":10,"maxLength":255},"name":{"type":"string","example":"darth#6755","minLength":4,"maxLength":32},"avatarId":{"type":"string","example":"098098098087097","minLength":10,"maxLength":255},"platform":{"type":"string","example":"DISCORD","minLength":4,"maxLength":255},"activateToken":{"type":"string","example":"jkhvuygi643jh35g53"},"user":{"type":"string","example":"63b428f7d9ca4f6ff5370d05"}}},"UpdateUserAccountResponseDto":{"type":"object","properties":{"_id":{"type":"string","readOnly":true,"example":"63b428f7d9ca4f6ff5370d05"},"user":{"$ref":"#/components/schemas/UserNoUserAccountsDto"},"accountId":{"type":"string","example":"098098098098098","minLength":10,"maxLength":255},"name":{"type":"string","example":"darth#6755","minLength":4,"maxLength":32},"avatarId":{"type":"string","example":"098098098087097","minLength":10,"maxLength":255},"platform":{"type":"string","example":"DISCORD","minLength":4,"maxLength":255},"createdAt":{"format":"date-time","type":"string","readOnly":true},"updatedAt":{"format":"date-time","type":"string","readOnly":true},"activateToken":{"type":"string","readOnly":true,"example":"jkhvuygi643jh35g53"}},"required":["_id","accountId","name","platform","createdAt","updatedAt"]},"CreateApiKeyInputDto":{"type":"object","properties":{"description":{"type":"string","example":"My API Key"},"role":{"type":"string","enum":["USER","QUANTIFIER","FORWARDER","ADMIN","ROOT","API_KEY_READWRITE","API_KEY_READ","API_KEY_DISCORD_BOT","API_KEY_SETUP_WEB"]}},"required":["description","role"]},"CreateApiKeyResponseDto":{"type":"object","properties":{"_id":{"type":"string","readOnly":true,"example":"639b178f19296ee0f2d0585d"},"name":{"type":"string","readOnly":true,"example":"89f7edbd"},"description":{"type":"string","example":"My API Key"},"hash":{"type":"string","readOnly":true,"example":"$2b$10$hfRNI.V7ewuN/K.5eSt6oelaQ.FDj6irfUNR9wkKnL/qsNT23aE4i"},"role":{"type":"string","enum":["USER","QUANTIFIER","FORWARDER","ADMIN","ROOT","API_KEY_READWRITE","API_KEY_READ","API_KEY_DISCORD_BOT","API_KEY_SETUP_WEB"]},"createdAt":{"format":"date-time","type":"string","readOnly":true},"updatedAt":{"format":"date-time","type":"string","readOnly":true},"key":{"type":"string","readOnly":true,"example":"1834a97caed67b244dd11fa5ef53aa74f13781ad0aea8148b8607d861d9f7535"}},"required":["_id","name","description","hash","role","createdAt","updatedAt","key"]},"ApiKey":{"type":"object","properties":{"_id":{"type":"string","readOnly":true,"example":"639b178f19296ee0f2d0585d"},"name":{"type":"string","readOnly":true,"example":"89f7edbd"},"description":{"type":"string","example":"My API Key"},"hash":{"type":"string","readOnly":true,"example":"$2b$10$hfRNI.V7ewuN/K.5eSt6oelaQ.FDj6irfUNR9wkKnL/qsNT23aE4i"},"role":{"type":"string","enum":["USER","QUANTIFIER","FORWARDER","ADMIN","ROOT","API_KEY_READWRITE","API_KEY_READ","API_KEY_DISCORD_BOT","API_KEY_SETUP_WEB"]},"createdAt":{"format":"date-time","type":"string","readOnly":true},"updatedAt":{"format":"date-time","type":"string","readOnly":true}},"required":["_id","name","description","hash","role","createdAt","updatedAt"]},"UpdateDescriptionInputDto":{"type":"object","properties":{"description":{"type":"string","example":"My API Key"}},"required":["description"]},"NonceInputDto":{"type":"object","properties":{"identityEthAddress":{"type":"string","example":"0xAAB27b150451726EC7738aa1d0A94505c8729bd1"}},"required":["identityEthAddress"]},"NonceResponseDto":{"type":"object","properties":{"identityEthAddress":{"type":"string","readOnly":true,"example":"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"},"nonce":{"type":"string","readOnly":true,"example":"uh9h998u98uj09noj"}},"required":["identityEthAddress","nonce"]},"LoginInputDto":{"type":"object","properties":{"identityEthAddress":{"type":"string","example":"0xAAB27b150451726EC7738aa1d0A94505c8729bd1"},"signature":{"type":"string"}},"required":["identityEthAddress","signature"]},"LoginResponseDto":{"type":"object","properties":{"accessToken":{"type":"string","readOnly":true,"example":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiI2MmIwNmY3NjU1ODA0YjE2MjllODQxNTkiLCJpZGVudGl0eUV0aEFkZHJlc3MiOiIweGEzMmFFQ2RhNzUyY0Y0RUY4OTk1NmU4M2Q2MEMwNDgzNWQ0RkE4NjciLCJyb2xlcyI6WyJVU0VSIiwiQURNSU4iXSwiaXNSZWZyZXNoIjpmYWxzZSwiaWF0IjoxNjcwMzE1OTk4LCJleHAiOjE2NzAzMTk1OTh9.qKvucMZLVbz_1TnsxaSqYX1i5CSpver6fFJTf3pABVA"},"refreshToken":{"type":"string","readOnly":true,"example":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiI2MmIwNmY3NjU1ODA0YjE2MjllODQxNTkiLCJpZGVudGl0eUV0aEFkZHJlc3MiOiIweGEzMmFFQ2RhNzUyY0Y0RUY4OTk1NmU4M2Q2MEMwNDgzNWQ0RkE4NjciLCJyb2xlcyI6WyJVU0VSIiwiQURNSU4iXSwiaXNSZWZyZXNoIjpmYWxzZSwiaWF0IjoxNjcwMzE1OTk4LCJleHAiOjE2NzAzMTk1OTh9.qKvucMZLVbz_1TnsxaSqYX1i5CSpver6fFJTf3pABVA"},"identityEthAddress":{"type":"string","readOnly":true,"example":"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"},"tokenType":{"type":"string","readOnly":true,"example":"bearer"},"user":{"readOnly":true,"allOf":[{"$ref":"#/components/schemas/User"}]}},"required":["accessToken","refreshToken","identityEthAddress","tokenType","user"]},"GenerateTokenDto":{"type":"object","properties":{"refreshToken":{"type":"string","example":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiI2MmIwNmY3NjU1ODA0YjE2MjllODQxNTkiLCJpZGVudGl0eUV0aEFkZHJlc3MiOiIweGEzMmFFQ2RhNzUyY0Y0RUY4OTk1NmU4M2Q2MEMwNDgzNWQ0RkE4NjciLCJyb2xlcyI6WyJVU0VSIiwiQURNSU4iXSwiaXNSZWZyZXNoIjpmYWxzZSwiaWF0IjoxNjcwMzE1OTk4LCJleHAiOjE2NzAzMTk1OTh9.qKvucMZLVbz_1TnsxaSqYX1i5CSpver6fFJTf3pABVA"}},"required":["refreshToken"]},"CreateCommunityInputDto":{"type":"object","properties":{"hostname":{"type":"string","example":"banklessdao.givepraise.xyz","maxLength":255},"name":{"type":"string","example":"BanklessDAO","minLength":4,"maxLength":20},"email":{"type":"string","example":"john.smith@banklessDao.com","maxLength":255},"creator":{"type":"string","example":"0x123..","maxLength":42},"owners":{"example":["0x123..","0x345.."],"type":"array","items":{"type":"string"}},"discordGuildId":{"type":"string","example":"0980987846534","maxLength":32}},"required":["hostname","name","email","creator","owners"]},"Community":{"type":"object","properties":{"_id":{"type":"string","example":"621f802b813dbdba9eeaf7b4"},"hostname":{"type":"string","example":"banklessdao.givepraise.xyz","maxLength":255},"name":{"type":"string","example":"BanklessDAO","minLength":4,"maxLength":20},"email":{"type":"string","example":"john.smith@banklessDao.com","maxLength":255},"creator":{"type":"string","example":"0x123..","maxLength":42},"owners":{"example":["0x123..","0x345.."],"type":"array","items":{"type":"string"}},"discordGuildId":{"type":"string","example":"0980987846534","maxLength":32},"discordLinkNonce":{"type":"string","example":"oiujoiuoo8u","maxLength":255},"isPublic":{"type":"boolean","example":true},"discordLinkState":{"type":"string","enum":["NOT_SET","PENDING","ACTIVE","DEACTIVE"]}},"required":["_id","hostname","name","email","creator","owners","discordLinkNonce","isPublic","discordLinkState"]},"UpdateCommunityInputDto":{"type":"object","properties":{"hostname":{"type":"string","example":"banklessdao.givepraise.xyz","maxLength":255},"name":{"type":"string","example":"BanklessDAO","minLength":4,"maxLength":20},"email":{"type":"string","example":"john.smith@banklessDao.com","maxLength":255},"owners":{"example":["0x123..","0x345.."],"type":"array","items":{"type":"string"}}}},"CommunityPaginatedResponseDto":{"type":"object","properties":{"totalDocs":{"type":"number","readOnly":true,"example":1200},"limit":{"type":"number","readOnly":true,"example":10},"totalPages":{"type":"number","readOnly":true,"example":12},"page":{"type":"number","readOnly":true,"example":2},"pagingCounter":{"type":"number","readOnly":true,"example":1},"hasPrevPage":{"type":"object","readOnly":true,"example":false},"hasNextPage":{"type":"object","readOnly":true,"example":true},"prevPage":{"type":"object","readOnly":true,"example":1},"nextPage":{"type":"object","readOnly":true,"example":3},"docs":{"readOnly":true,"type":"array","items":{"$ref":"#/components/schemas/Community"}},"meta":{"type":"object"}},"required":["totalDocs","limit","totalPages","pagingCounter","hasPrevPage","hasNextPage","docs"]},"IsNameAvailableResponseDto":{"type":"object","properties":{"available":{"type":"boolean","example":false}},"required":["available"]},"LinkDiscordBotDto":{"type":"object","properties":{"signedMessage":{"type":"string","example":"0xdb4bb91357b23083ec2a36dc1fe23e59b71434fc020542da7e983df206ed06611e275eb30e239508f9758c0608dca6cef5619c41b50a48f22bdb36a8dabc2d201c"}},"required":["signedMessage"]},"QuantifyInputDto":{"type":"object","properties":{"score":{"type":"number"},"dismissed":{"type":"boolean"},"duplicatePraise":{"type":"string","example":"639b178f19296ee0f2d0585d"}}},"QuantifyMultipleInputDto":{"type":"object","properties":{"params":{"$ref":"#/components/schemas/QuantifyInputDto"},"praiseIds":{"example":["639b178f19296ee0f2d0585d","639b178f19296ee0f2d0585e","639b178f19296ee0f2d0585f"],"type":"array","items":{"type":"string"}}},"required":["params","praiseIds"]},"ConfigurationValueItemsDto":{"type":"object","properties":{"type":{"type":"string","description":"Allowed array types","enum":["string","number"],"example":"string"}},"required":["type"]},"ConfigurationValueDto":{"type":"object","properties":{"type":{"type":"string","description":"Type of the setting","enum":["string","number","boolean","array"],"example":"string"},"default":{"description":"Default value for the setting","example":666,"oneOf":[{"type":"number"},{"type":"string"},{"type":"boolean"},{"type":"array","items":{"type":"number"}},{"type":"array","items":{"type":"string"}}]},"description":{"type":"string","description":"Description of the setting","example":"Description of the string setting"},"markdownDescription":{"type":"string","description":"Markdown description of the setting","example":"Description of the string setting"},"editPresentation":{"type":"string","description":"Edit presentation style","enum":["multiline"],"example":"multiline"},"order":{"type":"number","description":"Order of the setting","example":1},"enum":{"description":"Enum values for string type settings","example":["left","right"],"type":"array","items":{"type":"string"}},"items":{"description":"Defines the type of items for array settings","allOf":[{"$ref":"#/components/schemas/ConfigurationValueItemsDto"}]}},"required":["type","default","description"]},"ReportManifestDto":{"type":"object","properties":{"manifestUrl":{"type":"string","example":"https://raw.githubusercontent.com/givepraise/reports/main/reports/disperse-dist-straight-curve-with-ceiling/manifest.json"},"name":{"type":"string","example":"simple-report"},"displayName":{"type":"string","example":"Simple Report"},"description":{"type":"string","example":"A simple report."},"version":{"type":"string","example":"1.2.3"},"author":{"type":"string","example":"General Magic"},"publisher":{"type":"string","example":"general-magic"},"license":{"type":"string","example":"MIT"},"repository":{"type":"string","example":"https://github.com/givepraise/reports"},"bugs":{"type":"string","example":"https://github.com/givepraise/reports/issues"},"categories":{"example":["Basic reports","Praise receiver reports"],"type":"array","items":{"type":"string"}},"keywords":{"example":["toplist"],"type":"array","items":{"type":"string"}},"configuration":{"type":"object","description":"Configuration settings for the report","additionalProperties":{"oneOf":[{"$ref":"#/components/schemas/ConfigurationValueDto"}]}}},"required":["name","displayName","description","version","author","publisher","license","repository","bugs","categories","keywords","configuration"]}}}} \ No newline at end of file diff --git a/packages/api/src/reports/dto/setting.dto.ts b/packages/api/src/reports/dto/configuration-value.dto.ts similarity index 53% rename from packages/api/src/reports/dto/setting.dto.ts rename to packages/api/src/reports/dto/configuration-value.dto.ts index 3d175c4e7..d61ebb2c6 100644 --- a/packages/api/src/reports/dto/setting.dto.ts +++ b/packages/api/src/reports/dto/configuration-value.dto.ts @@ -1,22 +1,47 @@ import { ApiProperty } from '@nestjs/swagger'; -export type SettingTypeDto = 'string' | 'number' | 'boolean' | 'array'; +export type ConfigurationValueVariant = + | 'string' + | 'number' + | 'boolean' + | 'array'; -export class SettingDto { +export type ConfigurationValueItemsTypeVariant = 'string' | 'number'; + +export class ConfigurationValueItemsDto { + @ApiProperty({ + description: 'Allowed array types', + enum: ['string', 'number'], + required: true, + example: 'string', + }) + type: ConfigurationValueItemsTypeVariant; +} + +export class ConfigurationValueDto { @ApiProperty({ description: 'Type of the setting', enum: ['string', 'number', 'boolean', 'array'], required: true, example: 'string', }) - type: SettingTypeDto; + type: ConfigurationValueVariant; @ApiProperty({ description: 'Default value for the setting', required: true, - example: 'Some string', + example: 666, + oneOf: [ + { type: 'number' }, + { + type: 'string', + }, + { type: 'boolean' }, + { type: 'array', items: { type: 'number' } }, + { type: 'array', items: { type: 'string' } }, + ], }) - default: any; + default: number | string | boolean | number[] | string[]; @ApiProperty({ description: 'Description of the setting', @@ -27,10 +52,10 @@ export class SettingDto { @ApiProperty({ description: 'Markdown description of the setting', - required: true, + required: false, example: 'Description of the string setting', }) - markdownDescription: string; + markdownDescription?: string; @ApiProperty({ description: 'Edit presentation style', @@ -42,10 +67,10 @@ export class SettingDto { @ApiProperty({ description: 'Order of the setting', - required: true, + required: false, example: 1, }) - order: number; + order?: number; @ApiProperty({ description: 'Enum values for string type settings', @@ -55,13 +80,8 @@ export class SettingDto { enum?: string[]; @ApiProperty({ - description: 'Type of items for array settings', + description: 'Defines the type of items for array settings', required: false, - example: { - type: 'string', - }, }) - items?: { - type: SettingTypeDto; - }; + items?: ConfigurationValueItemsDto; } diff --git a/packages/api/src/reports/dto/report-manifest.dto.ts b/packages/api/src/reports/dto/report-manifest.dto.ts index 04993cb1a..99961f934 100644 --- a/packages/api/src/reports/dto/report-manifest.dto.ts +++ b/packages/api/src/reports/dto/report-manifest.dto.ts @@ -1,7 +1,7 @@ import { ApiExtraModels, ApiProperty } from '@nestjs/swagger'; -import { SettingDto } from './setting.dto'; +import { ConfigurationValueDto } from './configuration-value.dto'; -@ApiExtraModels(SettingDto) +@ApiExtraModels(ConfigurationValueDto) export class ReportManifestDto { @ApiProperty({ example: @@ -93,8 +93,8 @@ export class ReportManifestDto { required: true, type: 'object', additionalProperties: { - oneOf: [{ $ref: '#/components/schemas/SettingDto' }], + oneOf: [{ $ref: '#/components/schemas/ConfigurationValueDto' }], }, }) - configuration?: Record; + configuration?: Record; } diff --git a/packages/frontend/src/model/report/dto/configuration-value.dto.ts b/packages/frontend/src/model/report/dto/configuration-value.dto.ts new file mode 100644 index 000000000..829958aa5 --- /dev/null +++ b/packages/frontend/src/model/report/dto/configuration-value.dto.ts @@ -0,0 +1,4 @@ +import { components } from 'api-types'; + +export type ConfigurationValueDto = + components['schemas']['ConfigurationValueDto']; diff --git a/packages/frontend/src/pages/Reports/components/CustomReportDialog.tsx b/packages/frontend/src/pages/Reports/components/CustomReportDialog.tsx index eb2b972d7..56ab7ddf2 100644 --- a/packages/frontend/src/pages/Reports/components/CustomReportDialog.tsx +++ b/packages/frontend/src/pages/Reports/components/CustomReportDialog.tsx @@ -10,8 +10,18 @@ import { Button } from '@/components/ui/Button'; import { makeClient } from '../../../utils/axios'; import { ReportManifestDto } from '../../../model/report/dto/report-manifest.dto'; import { isResponseAxiosError } from '../../../model/api'; +import { recoilPersist } from 'recoil-persist'; +import { atom, useRecoilState } from 'recoil'; -interface ReportConfigDialogProps { +const { persistAtom } = recoilPersist(); + +export const CustomReportUrl = atom({ + key: 'CustomReportUrl', + default: undefined, + effects: [persistAtom], +}); + +interface CustomReportDialogProps { onClose(): void; onRun(url: string, manifest: ReportManifestDto): void; } @@ -19,10 +29,13 @@ interface ReportConfigDialogProps { export const CustomReportDialog = ({ onClose, onRun, -}: ReportConfigDialogProps): JSX.Element => { - const [url, setUrl] = React.useState(''); +}: CustomReportDialogProps): JSX.Element => { + // Local state const [error, setError] = React.useState(''); + // Global state + const [url, setUrl] = useRecoilState(CustomReportUrl); + const handleUrlChange = (event): void => { setUrl(event.target.value); }; @@ -100,7 +113,7 @@ export const CustomReportDialog = ({ icon={faFileDownload} size="1x" /> - Run report + Load report diff --git a/packages/frontend/src/pages/Reports/components/ReportConfigDialog.tsx b/packages/frontend/src/pages/Reports/components/ReportConfigDialog.tsx index 0ff5c1a28..ffa7e8033 100644 --- a/packages/frontend/src/pages/Reports/components/ReportConfigDialog.tsx +++ b/packages/frontend/src/pages/Reports/components/ReportConfigDialog.tsx @@ -10,51 +10,115 @@ import React from 'react'; import { Link } from 'react-router-dom'; import { Button } from '@/components/ui/Button'; import { SingleSetting } from '@/model/settings/settings'; -import toast from 'react-hot-toast'; import { ReportManifestDto } from '../../../model/report/dto/report-manifest.dto'; +import { ReportConfigFormFields } from './ReportConfigFormFields'; +import { ConfigurationValueDto } from '../../../model/report/dto/configuration-value.dto'; +import { Form } from 'react-final-form'; +import toast from 'react-hot-toast'; + +function configToInitialValues( + config?: Record +) { + if (!config) return {}; + const initialValues = {}; + Object.keys(config).forEach((key) => { + let value = config[key]?.default; + if (Array.isArray(value)) { + value = value.join(', '); + } + initialValues[key] = value; + }); + return initialValues; +} -interface ReportConfigDialogProps { +// Function to parse input string to string[] +function parseToStringArray(input: string): string[] { + const regex = /"([^"]+)"|([^,]+)/g; + let match; + const result: string[] = []; + + while ((match = regex.exec(input)) !== null) { + if (match[1]) { + // Matched a string enclosed in quotes + result.push(match[1]); + } else if (match[2]) { + // Matched a string without quotes + result.push(match[2].trim()); + } + } + + return result; +} + +// Function to parse input string to number[] +function parseToNumberArray(input: string): number[] { + const regex = /(\d+(\.\d+)?)/g; // Regex pattern to match only numbers (with optional decimals) + let match; + const result: number[] = []; + + while ((match = regex.exec(input)) !== null) { + const potentialNumber = parseFloat(match[1]); + if (!isNaN(potentialNumber)) { + result.push(potentialNumber); + } + } + + return result; +} + +type FormValue = string | number | boolean | string[] | number[] | undefined; +type FormValues = Record; + +type ReportConfigDialogProps = { manifest?: ReportManifestDto; onClose(): void; onRun(config: Record): void; -} +}; export const ReportConfigDialog = ({ manifest, onClose, onRun, -}: ReportConfigDialogProps): JSX.Element => { - // Store local changes to the config - const [config, setConfig] = React.useState(); +}: ReportConfigDialogProps) => { + // How much of the distribution should go to the development team + const csSupportPercentage = useRecoilValue( + SingleSetting('CS_SUPPORT_PERCENTAGE') + ); - // Update local state when changes are made to the textarea - const handleConfigChange = (event): void => { - setConfig(event.target.value); - }; + const onSubmit = (values: FormValues) => { + const config = {}; - // Set local state when default export context has been loaded - React.useEffect(() => { - if (!manifest) return; + // Make sure that the values are in the correct format for the report engine + Object.keys(values).forEach((key) => { + const value = values[key]; + const c = manifest?.configuration[key]; + if (!c) return; - // eslint-disable-next-line @typescript-eslint/no-explicit-any - const reportDefaults = {} as any; - Object.keys(manifest.configuration).forEach((key) => { - reportDefaults[key] = manifest.configuration[key]?.default; - }); + if (c.type === 'string' || c.type === 'number' || c.type === 'boolean') { + config[key] = value; + } - setConfig(JSON.stringify(reportDefaults, null, 2)); - }, [manifest]); + if ( + c.type === 'array' && + c.items?.type === 'string' && + typeof value === 'string' + ) { + const arr = parseToStringArray(value); + config[key] = arr; + } - // How much of the distribution should go to the development team - const csSupportPercentage = useRecoilValue( - SingleSetting('CS_SUPPORT_PERCENTAGE') - ); + if ( + c.type === 'array' && + c.items?.type === 'number' && + typeof value === 'string' + ) { + const arr = parseToNumberArray(value); + config[key] = arr; + } + }); - const onButtonClick = (): void => { - if (!config) return; try { - const c = JSON.parse(config); - onRun(c); + onRun(config); onClose(); } catch (error) { toast.error((error as Error).message); @@ -62,12 +126,12 @@ export const ReportConfigDialog = ({ } }; - if (!config || !csSupportPercentage) return <>; + if (!csSupportPercentage) return null; return (
-
+