diff --git a/packages/api-types/out/schema.ts b/packages/api-types/out/schema.ts index c9f856a66..bedbbc096 100644 --- a/packages/api-types/out/schema.ts +++ b/packages/api-types/out/schema.ts @@ -215,6 +215,9 @@ export interface paths { '/api/communities/isNameAvailable': { get: operations['CommunityController_isNameAvailable']; }; + '/api/communities/current': { + get: operations['CommunityController_current']; + }; '/api/communities/{id}/discord/link': { /** Link discord to community */ patch: operations['CommunityController_linkDiscord']; @@ -987,6 +990,12 @@ export interface components { isPublic: boolean; /** @enum {string} */ discordLinkState: 'NOT_SET' | 'PENDING' | 'ACTIVE' | 'DEACTIVE'; + /** + * @example { + * "attestations": true + * } + */ + features: Record; }; UpdateCommunityInputDto: { /** @example banklessdao.givepraise.xyz */ @@ -1003,7 +1012,7 @@ export interface components { */ owners?: string[]; }; - CommunityPaginatedResponseDto: { + CommunityFindAllResponseDto: { /** @example 1200 */ totalDocs: number; /** @example 10 */ @@ -2113,13 +2122,15 @@ export interface operations { page: number; sortColumn?: string; sortType?: 'asc' | 'desc'; + /** @example hostname.givepraise.xyz */ + hostname?: string; }; }; responses: { /** @description All communities */ 200: { content: { - 'application/json': components['schemas']['CommunityPaginatedResponseDto']; + 'application/json': components['schemas']['CommunityFindAllResponseDto']; }; }; }; @@ -2192,6 +2203,16 @@ export interface operations { }; }; }; + CommunityController_current: { + responses: { + /** @description Returns the current community, based on hostname */ + 200: { + content: { + 'application/json': components['schemas']['Community']; + }; + }; + }; + }; /** Link discord to community */ CommunityController_linkDiscord: { requestBody: { diff --git a/packages/api/openapi.json b/packages/api/openapi.json index e769b1828..ce1718a09 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":2,"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":2,"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":2,"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":2,"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":2,"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":2,"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":2,"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":2,"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":2,"maxLength":32},"avatarId":{"type":"string","example":"098098098087097","minLength":10,"maxLength":255},"platform":{"type":"string","example":"DISCORD","minLength":4,"maxLength":255},"createdAt":{"format":"date-time","type":"string","readOnly":true},"updatedAt":{"format":"date-time","type":"string","readOnly":true},"activateToken":{"type":"string","readOnly":true,"example":"jkhvuygi643jh35g53"}},"required":["_id","accountId","name","platform","createdAt","updatedAt"]},"CreateApiKeyInputDto":{"type":"object","properties":{"description":{"type":"string","example":"My API Key"},"role":{"type":"string","enum":["USER","QUANTIFIER","FORWARDER","ADMIN","ROOT","API_KEY_READWRITE","API_KEY_READ","API_KEY_DISCORD_BOT","API_KEY_SETUP_WEB"]}},"required":["description","role"]},"CreateApiKeyResponseDto":{"type":"object","properties":{"_id":{"type":"string","readOnly":true,"example":"639b178f19296ee0f2d0585d"},"name":{"type":"string","readOnly":true,"example":"89f7edbd"},"description":{"type":"string","example":"My API Key"},"hash":{"type":"string","readOnly":true,"example":"$2b$10$hfRNI.V7ewuN/K.5eSt6oelaQ.FDj6irfUNR9wkKnL/qsNT23aE4i"},"role":{"type":"string","enum":["USER","QUANTIFIER","FORWARDER","ADMIN","ROOT","API_KEY_READWRITE","API_KEY_READ","API_KEY_DISCORD_BOT","API_KEY_SETUP_WEB"]},"createdAt":{"format":"date-time","type":"string","readOnly":true},"updatedAt":{"format":"date-time","type":"string","readOnly":true},"key":{"type":"string","readOnly":true,"example":"1834a97caed67b244dd11fa5ef53aa74f13781ad0aea8148b8607d861d9f7535"}},"required":["_id","name","description","hash","role","createdAt","updatedAt","key"]},"ApiKey":{"type":"object","properties":{"_id":{"type":"string","readOnly":true,"example":"639b178f19296ee0f2d0585d"},"name":{"type":"string","readOnly":true,"example":"89f7edbd"},"description":{"type":"string","example":"My API Key"},"hash":{"type":"string","readOnly":true,"example":"$2b$10$hfRNI.V7ewuN/K.5eSt6oelaQ.FDj6irfUNR9wkKnL/qsNT23aE4i"},"role":{"type":"string","enum":["USER","QUANTIFIER","FORWARDER","ADMIN","ROOT","API_KEY_READWRITE","API_KEY_READ","API_KEY_DISCORD_BOT","API_KEY_SETUP_WEB"]},"createdAt":{"format":"date-time","type":"string","readOnly":true},"updatedAt":{"format":"date-time","type":"string","readOnly":true}},"required":["_id","name","description","hash","role","createdAt","updatedAt"]},"UpdateDescriptionInputDto":{"type":"object","properties":{"description":{"type":"string","example":"My API Key"}},"required":["description"]},"NonceInputDto":{"type":"object","properties":{"identityEthAddress":{"type":"string","example":"0xAAB27b150451726EC7738aa1d0A94505c8729bd1"}},"required":["identityEthAddress"]},"NonceResponseDto":{"type":"object","properties":{"identityEthAddress":{"type":"string","readOnly":true,"example":"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"},"nonce":{"type":"string","readOnly":true,"example":"uh9h998u98uj09noj"}},"required":["identityEthAddress","nonce"]},"LoginInputDto":{"type":"object","properties":{"identityEthAddress":{"type":"string","example":"0xAAB27b150451726EC7738aa1d0A94505c8729bd1"},"signature":{"type":"string"}},"required":["identityEthAddress","signature"]},"LoginResponseDto":{"type":"object","properties":{"accessToken":{"type":"string","readOnly":true,"example":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiI2MmIwNmY3NjU1ODA0YjE2MjllODQxNTkiLCJpZGVudGl0eUV0aEFkZHJlc3MiOiIweGEzMmFFQ2RhNzUyY0Y0RUY4OTk1NmU4M2Q2MEMwNDgzNWQ0RkE4NjciLCJyb2xlcyI6WyJVU0VSIiwiQURNSU4iXSwiaXNSZWZyZXNoIjpmYWxzZSwiaWF0IjoxNjcwMzE1OTk4LCJleHAiOjE2NzAzMTk1OTh9.qKvucMZLVbz_1TnsxaSqYX1i5CSpver6fFJTf3pABVA"},"refreshToken":{"type":"string","readOnly":true,"example":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiI2MmIwNmY3NjU1ODA0YjE2MjllODQxNTkiLCJpZGVudGl0eUV0aEFkZHJlc3MiOiIweGEzMmFFQ2RhNzUyY0Y0RUY4OTk1NmU4M2Q2MEMwNDgzNWQ0RkE4NjciLCJyb2xlcyI6WyJVU0VSIiwiQURNSU4iXSwiaXNSZWZyZXNoIjpmYWxzZSwiaWF0IjoxNjcwMzE1OTk4LCJleHAiOjE2NzAzMTk1OTh9.qKvucMZLVbz_1TnsxaSqYX1i5CSpver6fFJTf3pABVA"},"identityEthAddress":{"type":"string","readOnly":true,"example":"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"},"tokenType":{"type":"string","readOnly":true,"example":"bearer"},"user":{"readOnly":true,"allOf":[{"$ref":"#/components/schemas/User"}]}},"required":["accessToken","refreshToken","identityEthAddress","tokenType","user"]},"GenerateTokenDto":{"type":"object","properties":{"refreshToken":{"type":"string","example":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiI2MmIwNmY3NjU1ODA0YjE2MjllODQxNTkiLCJpZGVudGl0eUV0aEFkZHJlc3MiOiIweGEzMmFFQ2RhNzUyY0Y0RUY4OTk1NmU4M2Q2MEMwNDgzNWQ0RkE4NjciLCJyb2xlcyI6WyJVU0VSIiwiQURNSU4iXSwiaXNSZWZyZXNoIjpmYWxzZSwiaWF0IjoxNjcwMzE1OTk4LCJleHAiOjE2NzAzMTk1OTh9.qKvucMZLVbz_1TnsxaSqYX1i5CSpver6fFJTf3pABVA"}},"required":["refreshToken"]},"CreateCommunityInputDto":{"type":"object","properties":{"hostname":{"type":"string","example":"banklessdao.givepraise.xyz","maxLength":255},"name":{"type":"string","example":"BanklessDAO","minLength":4,"maxLength":20},"email":{"type":"string","example":"john.smith@banklessDao.com","maxLength":255},"creator":{"type":"string","example":"0x123..","maxLength":42},"owners":{"example":["0x123..","0x345.."],"type":"array","items":{"type":"string"}},"discordGuildId":{"type":"string","example":"0980987846534","maxLength":32}},"required":["hostname","name","email","creator","owners"]},"Community":{"type":"object","properties":{"_id":{"type":"string","example":"621f802b813dbdba9eeaf7b4"},"hostname":{"type":"string","example":"banklessdao.givepraise.xyz","maxLength":255},"name":{"type":"string","example":"BanklessDAO","minLength":4,"maxLength":20},"email":{"type":"string","example":"john.smith@banklessDao.com","maxLength":255},"creator":{"type":"string","example":"0x123..","maxLength":42},"owners":{"example":["0x123..","0x345.."],"type":"array","items":{"type":"string"}},"discordGuildId":{"type":"string","example":"0980987846534","maxLength":32},"discordLinkNonce":{"type":"string","example":"oiujoiuoo8u","maxLength":255},"isPublic":{"type":"boolean","example":true},"discordLinkState":{"type":"string","enum":["NOT_SET","PENDING","ACTIVE","DEACTIVE"]}},"required":["_id","hostname","name","email","creator","owners","discordLinkNonce","isPublic","discordLinkState"]},"UpdateCommunityInputDto":{"type":"object","properties":{"hostname":{"type":"string","example":"banklessdao.givepraise.xyz","maxLength":255},"name":{"type":"string","example":"BanklessDAO","minLength":4,"maxLength":20},"email":{"type":"string","example":"john.smith@banklessDao.com","maxLength":255},"owners":{"example":["0x123..","0x345.."],"type":"array","items":{"type":"string"}}}},"CommunityPaginatedResponseDto":{"type":"object","properties":{"totalDocs":{"type":"number","readOnly":true,"example":1200},"limit":{"type":"number","readOnly":true,"example":10},"totalPages":{"type":"number","readOnly":true,"example":12},"page":{"type":"number","readOnly":true,"example":2},"pagingCounter":{"type":"number","readOnly":true,"example":1},"hasPrevPage":{"type":"object","readOnly":true,"example":false},"hasNextPage":{"type":"object","readOnly":true,"example":true},"prevPage":{"type":"object","readOnly":true,"example":1},"nextPage":{"type":"object","readOnly":true,"example":3},"docs":{"readOnly":true,"type":"array","items":{"$ref":"#/components/schemas/Community"}},"meta":{"type":"object"}},"required":["totalDocs","limit","totalPages","pagingCounter","hasPrevPage","hasNextPage","docs"]},"IsNameAvailableResponseDto":{"type":"object","properties":{"available":{"type":"boolean","example":false}},"required":["available"]},"LinkDiscordBotDto":{"type":"object","properties":{"signedMessage":{"type":"string","example":"0xdb4bb91357b23083ec2a36dc1fe23e59b71434fc020542da7e983df206ed06611e275eb30e239508f9758c0608dca6cef5619c41b50a48f22bdb36a8dabc2d201c"}},"required":["signedMessage"]},"QuantifyInputDto":{"type":"object","properties":{"score":{"type":"number"},"dismissed":{"type":"boolean"},"duplicatePraise":{"type":"string","example":"639b178f19296ee0f2d0585d"}}},"QuantifyMultipleInputDto":{"type":"object","properties":{"params":{"$ref":"#/components/schemas/QuantifyInputDto"},"praiseIds":{"example":["639b178f19296ee0f2d0585d","639b178f19296ee0f2d0585e","639b178f19296ee0f2d0585f"],"type":"array","items":{"type":"string"}}},"required":["params","praiseIds"]},"ConfigurationValueItemsDto":{"type":"object","properties":{"type":{"type":"string","description":"Allowed array types","enum":["string","number"],"example":"string"}},"required":["type"]},"ConfigurationValueDto":{"type":"object","properties":{"type":{"type":"string","description":"Type of the setting","enum":["string","number","boolean","array"],"example":"string"},"default":{"description":"Default value for the setting","example":666,"oneOf":[{"type":"number"},{"type":"string"},{"type":"boolean"},{"type":"array","items":{"type":"number"}},{"type":"array","items":{"type":"string"}}]},"description":{"type":"string","description":"Description of the setting","example":"Description of the string setting"},"markdownDescription":{"type":"string","description":"Markdown description of the setting","example":"Description of the string setting"},"editPresentation":{"type":"string","description":"Edit presentation style","enum":["multiline"],"example":"multiline"},"order":{"type":"number","description":"Order of the setting","example":1},"enum":{"description":"Enum values for string type settings","example":["left","right"],"type":"array","items":{"type":"string"}},"items":{"description":"Defines the type of items for array settings","allOf":[{"$ref":"#/components/schemas/ConfigurationValueItemsDto"}]}},"required":["type","default","description"]},"ReportManifestDto":{"type":"object","properties":{"manifestUrl":{"type":"string","example":"https://raw.githubusercontent.com/givepraise/reports/main/reports/disperse-dist-straight-curve-with-ceiling/manifest.json"},"name":{"type":"string","example":"simple-report"},"displayName":{"type":"string","example":"Simple Report"},"description":{"type":"string","example":"A simple report."},"version":{"type":"string","example":"1.2.3"},"author":{"type":"string","example":"General Magic"},"publisher":{"type":"string","example":"general-magic"},"license":{"type":"string","example":"MIT"},"repository":{"type":"string","example":"https://github.com/givepraise/reports"},"bugs":{"type":"string","example":"https://github.com/givepraise/reports/issues"},"categories":{"example":["Basic reports","Praise receiver reports"],"type":"array","items":{"type":"string"}},"keywords":{"example":["toplist"],"type":"array","items":{"type":"string"}},"configuration":{"type":"object","description":"Configuration settings for the report","additionalProperties":{"oneOf":[{"$ref":"#/components/schemas/ConfigurationValueDto"}]}}},"required":["name","displayName","description","version","author","publisher","license","repository","bugs","categories","keywords","configuration"]}}}} \ No newline at end of file +{"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":2,"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"}},{"name":"hostname","required":false,"in":"query","example":"hostname.givepraise.xyz","schema":{"type":"string"}}],"responses":{"200":{"description":"All communities","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommunityFindAllResponseDto"}}}}},"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/current":{"get":{"operationId":"CommunityController_current","parameters":[],"responses":{"200":{"description":"Returns the current community, based on hostname","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Community"}}}}},"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":2,"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":2,"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":2,"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":2,"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":2,"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":2,"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":2,"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":2,"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"]},"features":{"type":"object","example":{"attestations":true}}},"required":["_id","hostname","name","email","creator","owners","discordLinkNonce","isPublic","discordLinkState","features"]},"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"}}}},"CommunityFindAllResponseDto":{"type":"object","properties":{"totalDocs":{"type":"number","readOnly":true,"example":1200},"limit":{"type":"number","readOnly":true,"example":10},"totalPages":{"type":"number","readOnly":true,"example":12},"page":{"type":"number","readOnly":true,"example":2},"pagingCounter":{"type":"number","readOnly":true,"example":1},"hasPrevPage":{"type":"object","readOnly":true,"example":false},"hasNextPage":{"type":"object","readOnly":true,"example":true},"prevPage":{"type":"object","readOnly":true,"example":1},"nextPage":{"type":"object","readOnly":true,"example":3},"docs":{"readOnly":true,"type":"array","items":{"$ref":"#/components/schemas/Community"}},"meta":{"type":"object"}},"required":["totalDocs","limit","totalPages","pagingCounter","hasPrevPage","hasNextPage","docs"]},"IsNameAvailableResponseDto":{"type":"object","properties":{"available":{"type":"boolean","example":false}},"required":["available"]},"LinkDiscordBotDto":{"type":"object","properties":{"signedMessage":{"type":"string","example":"0xdb4bb91357b23083ec2a36dc1fe23e59b71434fc020542da7e983df206ed06611e275eb30e239508f9758c0608dca6cef5619c41b50a48f22bdb36a8dabc2d201c"}},"required":["signedMessage"]},"QuantifyInputDto":{"type":"object","properties":{"score":{"type":"number"},"dismissed":{"type":"boolean"},"duplicatePraise":{"type":"string","example":"639b178f19296ee0f2d0585d"}}},"QuantifyMultipleInputDto":{"type":"object","properties":{"params":{"$ref":"#/components/schemas/QuantifyInputDto"},"praiseIds":{"example":["639b178f19296ee0f2d0585d","639b178f19296ee0f2d0585e","639b178f19296ee0f2d0585f"],"type":"array","items":{"type":"string"}}},"required":["params","praiseIds"]},"ConfigurationValueItemsDto":{"type":"object","properties":{"type":{"type":"string","description":"Allowed array types","enum":["string","number"],"example":"string"}},"required":["type"]},"ConfigurationValueDto":{"type":"object","properties":{"type":{"type":"string","description":"Type of the setting","enum":["string","number","boolean","array"],"example":"string"},"default":{"description":"Default value for the setting","example":666,"oneOf":[{"type":"number"},{"type":"string"},{"type":"boolean"},{"type":"array","items":{"type":"number"}},{"type":"array","items":{"type":"string"}}]},"description":{"type":"string","description":"Description of the setting","example":"Description of the string setting"},"markdownDescription":{"type":"string","description":"Markdown description of the setting","example":"Description of the string setting"},"editPresentation":{"type":"string","description":"Edit presentation style","enum":["multiline"],"example":"multiline"},"order":{"type":"number","description":"Order of the setting","example":1},"enum":{"description":"Enum values for string type settings","example":["left","right"],"type":"array","items":{"type":"string"}},"items":{"description":"Defines the type of items for array settings","allOf":[{"$ref":"#/components/schemas/ConfigurationValueItemsDto"}]}},"required":["type","default","description"]},"ReportManifestDto":{"type":"object","properties":{"manifestUrl":{"type":"string","example":"https://raw.githubusercontent.com/givepraise/reports/main/reports/disperse-dist-straight-curve-with-ceiling/manifest.json"},"name":{"type":"string","example":"simple-report"},"displayName":{"type":"string","example":"Simple Report"},"description":{"type":"string","example":"A simple report."},"version":{"type":"string","example":"1.2.3"},"author":{"type":"string","example":"General Magic"},"publisher":{"type":"string","example":"general-magic"},"license":{"type":"string","example":"MIT"},"repository":{"type":"string","example":"https://github.com/givepraise/reports"},"bugs":{"type":"string","example":"https://github.com/givepraise/reports/issues"},"categories":{"example":["Basic reports","Praise receiver reports"],"type":"array","items":{"type":"string"}},"keywords":{"example":["toplist"],"type":"array","items":{"type":"string"}},"configuration":{"type":"object","description":"Configuration settings for the report","additionalProperties":{"oneOf":[{"$ref":"#/components/schemas/ConfigurationValueDto"}]}}},"required":["name","displayName","description","version","author","publisher","license","repository","bugs","categories","keywords","configuration"]}}}} \ No newline at end of file diff --git a/packages/api/src/community/community.controller.ts b/packages/api/src/community/community.controller.ts index 5a4e241d9..8f279d89c 100644 --- a/packages/api/src/community/community.controller.ts +++ b/packages/api/src/community/community.controller.ts @@ -6,6 +6,7 @@ import { Patch, Post, Query, + Req, SerializeOptions, UseInterceptors, } from '@nestjs/common'; @@ -15,8 +16,7 @@ import { Permission } from '../auth/enums/permission.enum'; import { Community } from './schemas/community.schema'; import { MongooseClassSerializerInterceptor } from '../shared/interceptors/mongoose-class-serializer.interceptor'; import { ObjectIdPipe } from '../shared/pipes/object-id.pipe'; -import { CommunityPaginatedResponseDto } from './dto/community-pagination-model.dto'; -import { PaginatedQueryDto } from '../shared/dto/pagination-query.dto'; +import { CommunityFindAllResponseDto } from './dto/find-all-response.dto'; import { ObjectId, Types } from 'mongoose'; import { Permissions } from '../auth/decorators/permissions.decorator'; import { CreateCommunityInputDto } from './dto/create-community-input.dto'; @@ -29,6 +29,9 @@ import { IsNameAvailableResponseDto } from './dto/is-name-available-response-dto import { IsNameAvailableRequestDto } from './dto/is-name-available-request-dto'; import { EventLogService } from '../event-log/event-log.service'; import { EventLogTypeKey } from '../event-log/enums/event-log-type-key'; +import { CommunityFindAllQueryDto } from './dto/find-all-query.dto'; +import { Public } from '../shared/decorators/public.decorator'; +import { Request } from 'express'; @Controller('communities') @ApiTags('Communities') @@ -78,12 +81,12 @@ export class CommunityController { @ApiResponse({ status: 200, description: 'All communities', - type: CommunityPaginatedResponseDto, + type: CommunityFindAllResponseDto, }) @UseInterceptors(MongooseClassSerializerInterceptor(Community)) async findAll( - @Query() options: PaginatedQueryDto, - ): Promise { + @Query() options: CommunityFindAllQueryDto, + ): Promise { return this.communityService.findAllPaginated(options); } @@ -99,6 +102,18 @@ export class CommunityController { return await this.communityService.isCommunityNameAvailable(options.name); } + @Get('/current') + @Public() + @ApiResponse({ + status: 200, + description: 'Returns the current community, based on hostname', + type: Community, + }) + @UseInterceptors(MongooseClassSerializerInterceptor(Community)) + async current(@Req() req: Request): Promise { + return this.communityService.findOne({ host: req.hostname }); + } + @Get(':id') @Permissions(Permission.CommunitiesView) @ApiResponse({ diff --git a/packages/api/src/community/community.service.ts b/packages/api/src/community/community.service.ts index 484fd1c08..d7568baf2 100644 --- a/packages/api/src/community/community.service.ts +++ b/packages/api/src/community/community.service.ts @@ -3,8 +3,7 @@ import { InjectConnection, InjectModel } from '@nestjs/mongoose'; import { Connection, Types } from 'mongoose'; import { ApiException } from '../shared/exceptions/api-exception'; import { Community } from './schemas/community.schema'; -import { PaginatedQueryDto } from '../shared/dto/pagination-query.dto'; -import { CommunityPaginatedResponseDto } from './dto/community-pagination-model.dto'; +import { CommunityFindAllResponseDto } from './dto/find-all-response.dto'; import { CreateCommunityInputDto } from './dto/create-community-input.dto'; import { UpdateCommunityInputDto } from './dto/update-community-input.dto'; import { LinkDiscordBotDto } from './dto/link-discord-bot.dto'; @@ -20,6 +19,7 @@ import { databaseExists } from '../database/utils/database-exists'; import { hostNameToDbName } from '../database/utils/host-name-to-db-name'; import { PaginateModel } from '../shared/interfaces/paginate-model.interface'; import { IsNameAvailableResponseDto } from './dto/is-name-available-response-dto'; +import { CommunityFindAllQueryDto } from './dto/find-all-query.dto'; @Injectable() export class CommunityService { @@ -56,10 +56,11 @@ export class CommunityService { * @returns */ async findAllPaginated( - options: PaginatedQueryDto, - ): Promise { + options: CommunityFindAllQueryDto, + ): Promise { const { sortColumn, sortType } = options; - const query = {} as any; + const { hostname } = options; + const query = options.hostname ? { hostname } : {}; // Sorting - defaults to descending const sort = diff --git a/packages/api/src/community/dto/find-all-query.dto.ts b/packages/api/src/community/dto/find-all-query.dto.ts new file mode 100644 index 000000000..a459858a8 --- /dev/null +++ b/packages/api/src/community/dto/find-all-query.dto.ts @@ -0,0 +1,13 @@ +import { ApiProperty } from '@nestjs/swagger'; +import { PaginatedQueryDto } from '../../shared/dto/pagination-query.dto'; +import { IsOptional } from 'class-validator'; + +export class CommunityFindAllQueryDto extends PaginatedQueryDto { + @ApiProperty({ + required: false, + type: 'string', + example: 'hostname.givepraise.xyz', + }) + @IsOptional() + hostname?: string; +} diff --git a/packages/api/src/community/dto/community-pagination-model.dto.ts b/packages/api/src/community/dto/find-all-response.dto.ts similarity index 81% rename from packages/api/src/community/dto/community-pagination-model.dto.ts rename to packages/api/src/community/dto/find-all-response.dto.ts index b59e639e7..465a7bb4b 100644 --- a/packages/api/src/community/dto/community-pagination-model.dto.ts +++ b/packages/api/src/community/dto/find-all-response.dto.ts @@ -3,7 +3,7 @@ import { Type } from 'class-transformer'; import { PaginatedResponseDto } from '../../shared/dto/paginated-response.dto'; import { Community } from '../schemas/community.schema'; -export class CommunityPaginatedResponseDto extends PaginatedResponseDto { +export class CommunityFindAllResponseDto extends PaginatedResponseDto { @ApiResponseProperty({ type: [Community], }) diff --git a/packages/api/src/community/schemas/community.schema.ts b/packages/api/src/community/schemas/community.schema.ts index 45d7e3427..750d738a6 100644 --- a/packages/api/src/community/schemas/community.schema.ts +++ b/packages/api/src/community/schemas/community.schema.ts @@ -17,6 +17,7 @@ import { isValidCommunityName } from '../utils/is-valid-community-name'; import { isValidOwners } from '../utils/is-valid-owners'; import { isValidHostname } from '../utils/is-valid-hostname'; import mongoosePaginate from 'mongoose-paginate-v2'; +import { Features } from '../types/features.type'; export type CommunityDocument = Community & Document; @@ -144,6 +145,21 @@ export class Community { required: true, }) discordLinkState: string; + + @ApiProperty({ + example: { + attestations: true, + }, + }) + @IsOptional() + @Prop({ + type: Object, + required: false, + default: { + attestations: false, + }, + }) + features?: Features; } export const CommunitySchema = SchemaFactory.createForClass(Community); diff --git a/packages/api/src/community/types/features.type.ts b/packages/api/src/community/types/features.type.ts new file mode 100644 index 000000000..2b2ccc6e4 --- /dev/null +++ b/packages/api/src/community/types/features.type.ts @@ -0,0 +1,6 @@ +/** + * The features object is used to enable or disable features for a community. + */ +export type Features = { + attestations: boolean; +}; diff --git a/packages/frontend/src/model/community/community.ts b/packages/frontend/src/model/community/community.ts new file mode 100644 index 000000000..bf15ac07f --- /dev/null +++ b/packages/frontend/src/model/community/community.ts @@ -0,0 +1,26 @@ +import { AxiosError, AxiosResponse } from 'axios'; +import { selector } from 'recoil'; +import { ApiGet, isResponseOk } from '../api'; +import { Community } from './dto/community.dto'; + +export const CurrentCommunityQuery = selector({ + key: 'CurrentCommunity', + get: ({ get }): AxiosResponse | AxiosError => { + return get(ApiGet({ url: '/communities/current' })) as + | AxiosResponse + | AxiosError; + }, +}); + +export const CurrentCommunity = selector({ + key: 'AllReports', + get: ({ get }): Community | undefined => { + const response = get(CurrentCommunityQuery); + + if (isResponseOk(response)) { + return response.data; + } + + return; + }, +}); diff --git a/packages/frontend/src/model/community/dto/community.dto.ts b/packages/frontend/src/model/community/dto/community.dto.ts new file mode 100644 index 000000000..1a2898b44 --- /dev/null +++ b/packages/frontend/src/model/community/dto/community.dto.ts @@ -0,0 +1,3 @@ +import { components } from 'api-types'; + +export type Community = components['schemas']['Community']; diff --git a/packages/frontend/src/pages/Settings/components/ApplicationSettings.tsx b/packages/frontend/src/pages/Settings/components/ApplicationSettings.tsx index e51b81070..989047354 100644 --- a/packages/frontend/src/pages/Settings/components/ApplicationSettings.tsx +++ b/packages/frontend/src/pages/Settings/components/ApplicationSettings.tsx @@ -4,6 +4,9 @@ import { Box } from '@/components/ui/Box'; import { SettingsSubgroup } from './SettingsSubgroup'; import ApplicationSettingsApiKeys from './ApplicationSettingsApiKeys'; import { Setting as SettingDto } from '@/model/settings/dto/setting.dto'; +import { useRecoilValue } from 'recoil'; +import { CurrentCommunity } from '../../../model/community/community'; +import { Jazzicon } from '@ukstv/jazzicon-react'; interface Params { settings: SettingDto[] | undefined; @@ -16,13 +19,55 @@ export const ApplicationSettings = ({ settings, parentOnSubmit, }: Params): JSX.Element | null => { + const community = useRecoilValue(CurrentCommunity); if (!settings) return null; - return ( <> - + <> +
+
+ +
+ The creator address is the address that represents this + community onchain. To be able to create attestations or + distribute tokens from this address, it should be a{' '} + + Safe + {' '} + address. +
+
+ {' '} + {community?.creator} +
+
+
+ +
+ The owner addresses represent the identities that will allways + have adin permissions in this Praise community. +
+
+ {community?.owners.map((owner) => ( +
+ {' '} + {owner} +
+ ))} +
+
+
+ +