diff --git a/CHANGELOG.md b/CHANGELOG.md index df7c1ca48..96df30587 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added +- **Frontend**: New feature: Run custom reports from the reports page. #1050 + ### Fixed - **Frontend:** Fix styling bug that caused the login button to be hidden on short screens. #1107 diff --git a/packages/api-types/out/schema.ts b/packages/api-types/out/schema.ts index d361a374b..999c2278d 100644 --- a/packages/api-types/out/schema.ts +++ b/packages/api-types/out/schema.ts @@ -1096,6 +1096,8 @@ export interface components { }; }; ReportManifestDto: { + /** @example https://raw.githubusercontent.com/givepraise/reports/main/reports/disperse-dist-straight-curve-with-ceiling/manifest.json */ + manifestUrl?: string; /** @example simple-report */ name: string; /** @example Simple Report */ diff --git a/packages/api/openapi.json b/packages/api/openapi.json index c5934dc6d..77684788b 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":{"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"]},"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 diff --git a/packages/api/src/reports/dto/report-manifest.dto.ts b/packages/api/src/reports/dto/report-manifest.dto.ts index b15ca366f..04993cb1a 100644 --- a/packages/api/src/reports/dto/report-manifest.dto.ts +++ b/packages/api/src/reports/dto/report-manifest.dto.ts @@ -3,6 +3,14 @@ import { SettingDto } from './setting.dto'; @ApiExtraModels(SettingDto) export class ReportManifestDto { + @ApiProperty({ + example: + 'https://raw.githubusercontent.com/givepraise/reports/main/reports/disperse-dist-straight-curve-with-ceiling/manifest.json', + type: String, + required: false, + }) + manifestUrl: string; + @ApiProperty({ example: 'simple-report', type: String, diff --git a/packages/api/src/reports/reports.service.ts b/packages/api/src/reports/reports.service.ts index 86b2eab5c..b21f8091c 100644 --- a/packages/api/src/reports/reports.service.ts +++ b/packages/api/src/reports/reports.service.ts @@ -54,10 +54,11 @@ export class ReportsService { .filter((item: { type: string }) => item.type === 'dir') .map(async (dir: { name: any }) => { try { + const manifestPath = `${this.basePath}/${dir.name}/manifest.json`; const manifest = await this.octokit.repos.getContent({ owner: this.owner, repo: this.repo, - path: `${this.basePath}/${dir.name}/manifest.json`, + path: manifestPath, }); const content = Buffer.from( @@ -65,7 +66,9 @@ export class ReportsService { 'base64', ).toString(); - return JSON.parse(content); + const manifestDto = JSON.parse(content) as ReportManifestDto; + manifestDto.manifestUrl = `https://raw.githubusercontent.com/${this.owner}/${this.repo}/main/${manifestPath}`; + return manifestDto; } catch (error) { throw new ApiException( errorMessages.REPORTS_LIST_ERROR, diff --git a/packages/frontend/src/components/report/DatePeriodRange.tsx b/packages/frontend/src/components/report/DatePeriodRange.tsx index 16b55425a..3b4b4cd29 100644 --- a/packages/frontend/src/components/report/DatePeriodRange.tsx +++ b/packages/frontend/src/components/report/DatePeriodRange.tsx @@ -107,8 +107,10 @@ export const DatePeriodRange: React.FC = () => { options={periodOptions} className="text-sm min-w-[200px]" /> -
-
or dates:
+
+ or dates: +
+
{ disabled={allPeriods.length === 0} />
+
); diff --git a/packages/frontend/src/model/api.ts b/packages/frontend/src/model/api.ts index cfb391e22..3d67fda87 100644 --- a/packages/frontend/src/model/api.ts +++ b/packages/frontend/src/model/api.ts @@ -34,7 +34,7 @@ export const isResponseOk = ( return axiosResponse.status === 200 || axiosResponse.status === 201; }; -export const isApiResponseAxiosError = ( +export const isResponseAxiosError = ( axiosResponse: AxiosResponse | AxiosError | null | unknown ): axiosResponse is AxiosError => { return ( @@ -47,7 +47,7 @@ export const isApiResponseValidationError = ( axiosResponse: AxiosResponse | AxiosError | null | unknown ): axiosResponse is AxiosError => { if ( - isApiResponseAxiosError(axiosResponse) && + isResponseAxiosError(axiosResponse) && axiosResponse.response?.status === 400 && axiosResponse.response.data.errors ) diff --git a/packages/frontend/src/model/periods/periods.ts b/packages/frontend/src/model/periods/periods.ts index b482b4590..fca4a366e 100644 --- a/packages/frontend/src/model/periods/periods.ts +++ b/packages/frontend/src/model/periods/periods.ts @@ -16,7 +16,7 @@ import { periodReceiverPraiseListKey, } from '@/utils/periods'; import { useApiAuthClient } from '@/utils/api'; -import { ApiGet, isApiResponseAxiosError, isResponseOk } from '../api'; +import { ApiGet, isResponseAxiosError, isResponseOk } from '../api'; import { ActiveUserId } from '../auth/auth'; import { AllPraiseList, PraiseIdList, SinglePraise } from '../praise/praise'; import { Praise } from '../praise/praise.dto'; @@ -405,7 +405,7 @@ export const useAssignQuantifiers = ( setPeriod(updatedPeriod); return response as AxiosResponse; } - if (isApiResponseAxiosError(response)) { + if (isResponseAxiosError(response)) { throw response; } return response as AxiosResponse | AxiosError; diff --git a/packages/frontend/src/model/praise/praise.ts b/packages/frontend/src/model/praise/praise.ts index b1a497265..17c4e12d6 100644 --- a/packages/frontend/src/model/praise/praise.ts +++ b/packages/frontend/src/model/praise/praise.ts @@ -10,7 +10,7 @@ import { useRecoilValue, useSetRecoilState, } from 'recoil'; -import { ApiGet, isApiResponseAxiosError, isResponseOk } from '../api'; +import { ApiGet, isResponseAxiosError, isResponseOk } from '../api'; import { PaginatedResponseBody } from 'shared/interfaces/paginated-response-body.interface'; /** @@ -200,10 +200,7 @@ export const useAllPraise = ( ); React.useEffect(() => { - if ( - !allPraiseQueryResponse || - isApiResponseAxiosError(allPraiseQueryResponse) - ) + if (!allPraiseQueryResponse || isResponseAxiosError(allPraiseQueryResponse)) return; const paginatedResponse = allPraiseQueryResponse.data; diff --git a/packages/frontend/src/model/report/hooks/use-report.hook.ts b/packages/frontend/src/model/report/hooks/use-report.hook.ts index 9ba4eefd2..9e26d5eee 100644 --- a/packages/frontend/src/model/report/hooks/use-report.hook.ts +++ b/packages/frontend/src/model/report/hooks/use-report.hook.ts @@ -15,31 +15,26 @@ import { ReportManifestDto } from '../dto/report-manifest.dto'; //lockdown(); -export function useReport(input: useReportInput): UseReportReturn { - const { url: reportUrl, periodId, startDate, endDate } = input; +export function useReport(reportInput: useReportInput): UseReportReturn { + const { manifestUrl, periodId, startDate, endDate } = reportInput; const duckDb = useDuckDbFiltered({ periodId, startDate, endDate }); const periods = useRecoilValue(AllPeriods); const { create: createCompartment } = useCompartment(); const manifest = async (): Promise => { - if (!reportUrl) return; + if (!manifestUrl) return; // Create secure compartment to run report in const compartment = createCompartment(); - // Import report from url - const manifestUrl = `${reportUrl.substring( - 0, - reportUrl.lastIndexOf('/') - )}/manifest.json`; const { namespace } = await compartment.import(manifestUrl); return namespace.default as ReportManifestDto; }; const run = async ( - input: useReportRunInput + runInput: useReportRunInput ): Promise => { - if (!reportUrl) return; - const { format, config: configInput } = input; + if (!manifestUrl) return; + const { format, config: configInput } = runInput; if (!duckDb || !duckDb.db) { throw new Error('DuckDb has not be loaded'); } @@ -69,6 +64,7 @@ export function useReport(input: useReportInput): UseReportReturn { const compartment = createCompartment(); // Import report from url + const reportUrl = manifestUrl.replace('manifest.json', 'report.js'); const { namespace } = await compartment.import(reportUrl); // Create report instance, supplying config and db query object diff --git a/packages/frontend/src/model/report/types/use-report-input.type.ts b/packages/frontend/src/model/report/types/use-report-input.type.ts index a84b2f292..0f5f512fd 100644 --- a/packages/frontend/src/model/report/types/use-report-input.type.ts +++ b/packages/frontend/src/model/report/types/use-report-input.type.ts @@ -1,5 +1,5 @@ export type useReportInput = { - url?: string; + manifestUrl?: string; periodId?: string; startDate?: string; endDate?: string; diff --git a/packages/frontend/src/pages/Reports/ReportsPage.tsx b/packages/frontend/src/pages/Reports/ReportsPage.tsx index 52cd7240c..725968972 100644 --- a/packages/frontend/src/pages/Reports/ReportsPage.tsx +++ b/packages/frontend/src/pages/Reports/ReportsPage.tsx @@ -1,4 +1,4 @@ -import { faTableList } from '@fortawesome/free-solid-svg-icons'; +import { faCogs, faTableList } from '@fortawesome/free-solid-svg-icons'; import { Dialog } from '@headlessui/react'; import React from 'react'; import { Link, useHistory } from 'react-router-dom'; @@ -10,12 +10,15 @@ import { } from '../../components/report/DatePeriodRange'; import { BreadCrumb } from '../../components/ui/BreadCrumb'; import { Page } from '../../components/ui/Page'; -import { SingleReport } from '../../model/report/reports'; import { ReportConfigDialog } from './components/ReportConfigDialog'; import { ReportsTable } from './components/ReportsTable'; import { AllPeriods } from '../../model/periods/periods'; import * as check from 'wasm-check'; import toast from 'react-hot-toast'; +import { Button } from '../../components/ui/Button'; +import { CustomReportDialog } from './components/CustomReportDialog'; +import { ReportManifestDto } from '../../model/report/dto/report-manifest.dto'; +import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; const NoPeriodsMessage = (): JSX.Element | null => { const allPeriods = useRecoilValue(AllPeriods); @@ -30,31 +33,44 @@ const NoPeriodsMessage = (): JSX.Element | null => { const ReportsPage = (): JSX.Element | null => { const [isConfigDialogOpen, setIsConfigDialogOpen] = React.useState(false); - const [selectedReportName, setSelectedReportName] = React.useState(); + const [isCustomReportDialogOpen, setIsCustomReportDialogOpen] = + React.useState(false); const allPeriods = useRecoilValue(AllPeriods); const startDate = useRecoilValue(DatePeriodRangeStartDate); const endDate = useRecoilValue(DatePeriodRangeEndDate); - const report = useRecoilValue(SingleReport(selectedReportName)); + const [reportManifest, setReportManifest] = React.useState< + ReportManifestDto | undefined + >(undefined); + const [manifestUrl, setManifestUrl] = React.useState(''); const history = useHistory(); - const handleReportClick = (name: string) => (): void => { - if (allPeriods.length === 0) return; + const handleReportClick = (manifest: ReportManifestDto) => (): void => { + if (allPeriods.length === 0 || !manifest || !manifest.manifestUrl) return; if (!check.support()) { toast.error( 'Your browser does not support WebAssembly which is required to run reports. Please try a different browser.' ); return; } - setSelectedReportName(name); + setReportManifest(manifest); + setManifestUrl(manifest.manifestUrl); + }; + + const handleCustomReportLoad = ( + url: string, + manifest: ReportManifestDto + ): void => { + setReportManifest(manifest); + setManifestUrl(url); }; const runReport = React.useCallback( - (name: string, config: Record) => { + (manifestUrl: string, config: Record) => { if (!startDate || !endDate) return; const qs = new URLSearchParams({ - report: name, + manifestUrl, ...config, startDate: startDate.toISOString(), endDate: endDate.toISOString(), @@ -65,13 +81,16 @@ const ReportsPage = (): JSX.Element | null => { ); React.useEffect(() => { - if (!selectedReportName || !report) return; - if (report.configuration && Object.keys(report.configuration).length > 0) { + if (!reportManifest) return; + if ( + reportManifest.configuration && + Object.keys(reportManifest.configuration).length > 0 + ) { setIsConfigDialogOpen(true); return; } - runReport(selectedReportName, {}); - }, [endDate, history, selectedReportName, startDate, report, runReport]); + runReport(manifestUrl, {}); + }, [endDate, history, startDate, reportManifest, manifestUrl, runReport]); return ( @@ -79,6 +98,16 @@ const ReportsPage = (): JSX.Element | null => { +
+ +
+
@@ -91,15 +120,30 @@ const ReportsPage = (): JSX.Element | null => { >
{ - setSelectedReportName(undefined); + setReportManifest(undefined); + setManifestUrl(''); setIsConfigDialogOpen(false); }} onRun={(config): void => { - runReport(selectedReportName || '', config); + runReport(manifestUrl, config); + }} + /> +
+ + + setIsCustomReportDialogOpen(false)} + className="fixed inset-0 z-10 overflow-y-auto" + > +
+ { + setIsCustomReportDialogOpen(false); }} + onRun={handleCustomReportLoad} />
diff --git a/packages/frontend/src/pages/Reports/ReportsRunPage.tsx b/packages/frontend/src/pages/Reports/ReportsRunPage.tsx index 94f92efd4..f73a97c80 100644 --- a/packages/frontend/src/pages/Reports/ReportsRunPage.tsx +++ b/packages/frontend/src/pages/Reports/ReportsRunPage.tsx @@ -27,9 +27,7 @@ const ReportsRunPage = (): JSX.Element | null => { const report = useReport({ startDate: qs.get('startDate') || undefined, endDate: qs.get('endDate') || undefined, - url: `https://raw.githubusercontent.com/givepraise/reports/main/reports/${qs.get( - 'report' - )}/report.js`, + manifestUrl: `${qs.get('manifestUrl')}`, }); // Run report when report is loaded diff --git a/packages/frontend/src/pages/Reports/RewardsPage.tsx b/packages/frontend/src/pages/Reports/RewardsPage.tsx index 31c119cd4..af33298fd 100644 --- a/packages/frontend/src/pages/Reports/RewardsPage.tsx +++ b/packages/frontend/src/pages/Reports/RewardsPage.tsx @@ -10,12 +10,12 @@ import { } from '../../components/report/DatePeriodRange'; import { BreadCrumb } from '../../components/ui/BreadCrumb'; import { Page } from '../../components/ui/Page'; -import { SingleReport } from '../../model/report/reports'; import { ReportConfigDialog } from './components/ReportConfigDialog'; import { ReportsTable } from './components/ReportsTable'; import { AllPeriods } from '../../model/periods/periods'; import * as check from 'wasm-check'; import toast from 'react-hot-toast'; +import { ReportManifestDto } from '../../model/report/dto/report-manifest.dto'; const NoPeriodsMessage = (): JSX.Element | null => { const allPeriods = useRecoilValue(AllPeriods); @@ -30,31 +30,33 @@ const NoPeriodsMessage = (): JSX.Element | null => { const RewardsPage = (): JSX.Element | null => { const [isConfigDialogOpen, setIsConfigDialogOpen] = React.useState(false); - const [selectedReportName, setSelectedReportName] = React.useState(); const allPeriods = useRecoilValue(AllPeriods); - const startDate = useRecoilValue(DatePeriodRangeStartDate); const endDate = useRecoilValue(DatePeriodRangeEndDate); - const report = useRecoilValue(SingleReport(selectedReportName)); + const [reportManifest, setReportManifest] = React.useState< + ReportManifestDto | undefined + >(undefined); + const [manifestUrl, setManifestUrl] = React.useState(''); const history = useHistory(); - const handleReportClick = (name: string) => (): void => { - if (allPeriods.length === 0) return; + const handleReportClick = (manifest: ReportManifestDto) => (): void => { + if (allPeriods.length === 0 || !manifest || !manifest.manifestUrl) return; if (!check.support()) { toast.error( 'Your browser does not support WebAssembly which is required to run reports. Please try a different browser.' ); return; } - setSelectedReportName(name); + setReportManifest(manifest); + setManifestUrl(manifest.manifestUrl); }; const runReport = React.useCallback( - (name: string, config: Record) => { + (manifestUrl: string, config: Record) => { if (!startDate || !endDate) return; const qs = new URLSearchParams({ - report: name, + manifestUrl, ...config, startDate: startDate.toISOString(), endDate: endDate.toISOString(), @@ -65,13 +67,16 @@ const RewardsPage = (): JSX.Element | null => { ); React.useEffect(() => { - if (!selectedReportName || !report) return; - if (report.configuration && Object.keys(report.configuration).length > 0) { + if (!reportManifest || !manifestUrl) return; + if ( + reportManifest.configuration && + Object.keys(reportManifest.configuration).length > 0 + ) { setIsConfigDialogOpen(true); return; } - runReport(selectedReportName, {}); - }, [endDate, history, selectedReportName, startDate, report, runReport]); + runReport(manifestUrl, {}); + }, [endDate, history, startDate, reportManifest, manifestUrl, runReport]); return ( @@ -92,14 +97,14 @@ const RewardsPage = (): JSX.Element | null => { >
{ - setSelectedReportName(undefined); + setReportManifest(undefined); + setManifestUrl(''); setIsConfigDialogOpen(false); }} onRun={(config): void => { - runReport(selectedReportName || '', config); + runReport(manifestUrl, config); }} />
diff --git a/packages/frontend/src/pages/Reports/components/CustomReportDialog.tsx b/packages/frontend/src/pages/Reports/components/CustomReportDialog.tsx new file mode 100644 index 000000000..eb2b972d7 --- /dev/null +++ b/packages/frontend/src/pages/Reports/components/CustomReportDialog.tsx @@ -0,0 +1,110 @@ +import { + faCogs, + faFileDownload, + faTimes, +} from '@fortawesome/free-solid-svg-icons'; +import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; +import { Dialog } from '@headlessui/react'; +import React from 'react'; +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'; + +interface ReportConfigDialogProps { + onClose(): void; + onRun(url: string, manifest: ReportManifestDto): void; +} + +export const CustomReportDialog = ({ + onClose, + onRun, +}: ReportConfigDialogProps): JSX.Element => { + const [url, setUrl] = React.useState(''); + const [error, setError] = React.useState(''); + + const handleUrlChange = (event): void => { + setUrl(event.target.value); + }; + + const onButtonClick = async (): Promise => { + setError(''); + const client = makeClient(); + const response = await client.get(url); + if (isResponseAxiosError(response)) { + setError( + `Unabe to load report. ${response.response?.status || ''} ${ + response.response?.statusText || '' + } ` + ); + return; + } + if (!response.data || !response.data.configuration || !response.data.name) { + setError('Invalid report manifest.'); + return; + } + onRun(url, response.data); + onClose(); + }; + + return ( +
+ +
+
+ +
+
+
+ +
+ + Run Custom Report + + +
+ You can run custom reports by providing a full manifest url. The{' '} + report.js is assumed to be located in the same + directory as the manifest file. The easiest way to get started + creating custom reports is to fork the{' '} + + Praise reports repository + + . +
+
+ + + {error &&
{error}
} +
+ +
+ +
+
+
+
+ ); +}; diff --git a/packages/frontend/src/pages/Reports/components/ReportConfigDialog.tsx b/packages/frontend/src/pages/Reports/components/ReportConfigDialog.tsx index ed0cec650..0ff5c1a28 100644 --- a/packages/frontend/src/pages/Reports/components/ReportConfigDialog.tsx +++ b/packages/frontend/src/pages/Reports/components/ReportConfigDialog.tsx @@ -11,23 +11,19 @@ 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 { SingleReport } from '../../../model/report/reports'; +import { ReportManifestDto } from '../../../model/report/dto/report-manifest.dto'; interface ReportConfigDialogProps { - title: string; - reportName?: string; + manifest?: ReportManifestDto; onClose(): void; onRun(config: Record): void; } export const ReportConfigDialog = ({ - title, - reportName, + manifest, onClose, onRun, }: ReportConfigDialogProps): JSX.Element => { - const report = useRecoilValue(SingleReport(reportName)); - // Store local changes to the config const [config, setConfig] = React.useState(); @@ -38,16 +34,16 @@ export const ReportConfigDialog = ({ // Set local state when default export context has been loaded React.useEffect(() => { - if (!report) return; + if (!manifest) return; // eslint-disable-next-line @typescript-eslint/no-explicit-any const reportDefaults = {} as any; - Object.keys(report.configuration).forEach((key) => { - reportDefaults[key] = report.configuration[key]?.default; + Object.keys(manifest.configuration).forEach((key) => { + reportDefaults[key] = manifest.configuration[key]?.default; }); setConfig(JSON.stringify(reportDefaults, null, 2)); - }, [report]); + }, [manifest]); // How much of the distribution should go to the development team const csSupportPercentage = useRecoilValue( @@ -71,7 +67,7 @@ export const ReportConfigDialog = ({ return (
-
+