|
@@ -39,6 +39,8 @@ const router = express.Router();
|
|
|
* type: string
|
|
* type: string
|
|
|
* isEmailPublished:
|
|
* isEmailPublished:
|
|
|
* type: boolean
|
|
* type: boolean
|
|
|
|
|
+ * slackMemberId:
|
|
|
|
|
+ * type: string
|
|
|
* Passwords:
|
|
* Passwords:
|
|
|
* description: passwords for update
|
|
* description: passwords for update
|
|
|
* type: object
|
|
* type: object
|
|
@@ -183,6 +185,10 @@ module.exports = (crowi) => {
|
|
|
* properties:
|
|
* properties:
|
|
|
* isPasswordSet:
|
|
* isPasswordSet:
|
|
|
* type: boolean
|
|
* type: boolean
|
|
|
|
|
+ * description: Whether a password has been set
|
|
|
|
|
+ * minPasswordLength:
|
|
|
|
|
+ * type: number
|
|
|
|
|
+ * description: Minimum password length
|
|
|
*/
|
|
*/
|
|
|
router.get('/is-password-set', accessTokenParser, loginRequiredStrictly, async(req, res) => {
|
|
router.get('/is-password-set', accessTokenParser, loginRequiredStrictly, async(req, res) => {
|
|
|
const { username } = req.user;
|
|
const { username } = req.user;
|
|
@@ -222,7 +228,7 @@ module.exports = (crowi) => {
|
|
|
* application/json:
|
|
* application/json:
|
|
|
* schema:
|
|
* schema:
|
|
|
* properties:
|
|
* properties:
|
|
|
- * currentUser:
|
|
|
|
|
|
|
+ * updatedUser:
|
|
|
* type: object
|
|
* type: object
|
|
|
* description: personal params
|
|
* description: personal params
|
|
|
*/
|
|
*/
|
|
@@ -266,6 +272,13 @@ module.exports = (crowi) => {
|
|
|
* operationId: putUserImageType
|
|
* operationId: putUserImageType
|
|
|
* summary: /personal-setting/image-type
|
|
* summary: /personal-setting/image-type
|
|
|
* description: Update user image type
|
|
* description: Update user image type
|
|
|
|
|
+ * requestBody:
|
|
|
|
|
+ * required: true
|
|
|
|
|
+ * content:
|
|
|
|
|
+ * application/json:
|
|
|
|
|
+ * properties:
|
|
|
|
|
+ * isGravatarEnabled:
|
|
|
|
|
+ * type: boolean
|
|
|
* responses:
|
|
* responses:
|
|
|
* 200:
|
|
* 200:
|
|
|
* description: succeded to update user image type
|
|
* description: succeded to update user image type
|
|
@@ -341,8 +354,11 @@ module.exports = (crowi) => {
|
|
|
* required: true
|
|
* required: true
|
|
|
* content:
|
|
* content:
|
|
|
* application/json:
|
|
* application/json:
|
|
|
- * schema:
|
|
|
|
|
- * $ref: '#/components/schemas/Passwords'
|
|
|
|
|
|
|
+ * properties:
|
|
|
|
|
+ * oldPassword:
|
|
|
|
|
+ * type: string
|
|
|
|
|
+ * newPassword:
|
|
|
|
|
+ * type: string
|
|
|
* responses:
|
|
* responses:
|
|
|
* 200:
|
|
* 200:
|
|
|
* description: user password
|
|
* description: user password
|
|
@@ -382,6 +398,8 @@ module.exports = (crowi) => {
|
|
|
* /personal-setting/api-token:
|
|
* /personal-setting/api-token:
|
|
|
* put:
|
|
* put:
|
|
|
* tags: [GeneralSetting]
|
|
* tags: [GeneralSetting]
|
|
|
|
|
+ * security:
|
|
|
|
|
+ * - cookieAuth: []
|
|
|
* operationId: putUserApiToken
|
|
* operationId: putUserApiToken
|
|
|
* summary: /personal-setting/api-token
|
|
* summary: /personal-setting/api-token
|
|
|
* description: Update user api token
|
|
* description: Update user api token
|
|
@@ -428,7 +446,9 @@ module.exports = (crowi) => {
|
|
|
* content:
|
|
* content:
|
|
|
* application/json:
|
|
* application/json:
|
|
|
* schema:
|
|
* schema:
|
|
|
- * $ref: '#/components/schemas/AssociateUser'
|
|
|
|
|
|
|
+ * properties:
|
|
|
|
|
+ * username:
|
|
|
|
|
+ * type: string
|
|
|
* responses:
|
|
* responses:
|
|
|
* 200:
|
|
* 200:
|
|
|
* description: succeded to associate Ldap account
|
|
* description: succeded to associate Ldap account
|
|
@@ -524,18 +544,30 @@ module.exports = (crowi) => {
|
|
|
* put:
|
|
* put:
|
|
|
* tags: [EditorSetting]
|
|
* tags: [EditorSetting]
|
|
|
* operationId: putEditorSettings
|
|
* operationId: putEditorSettings
|
|
|
- * summary: /editor-setting
|
|
|
|
|
|
|
+ * summary: /personal-setting/editor-settings
|
|
|
* description: Put editor preferences
|
|
* description: Put editor preferences
|
|
|
|
|
+ * requestBody:
|
|
|
|
|
+ * required: true
|
|
|
|
|
+ * content:
|
|
|
|
|
+ * application/json:
|
|
|
|
|
+ * schema:
|
|
|
|
|
+ * properties:
|
|
|
|
|
+ * theme:
|
|
|
|
|
+ * type: string
|
|
|
|
|
+ * keymapMode:
|
|
|
|
|
+ * type: string
|
|
|
|
|
+ * styleActiveLine:
|
|
|
|
|
+ * type: boolean
|
|
|
|
|
+ * autoFormatMarkdownTable:
|
|
|
|
|
+ * type: boolean
|
|
|
* responses:
|
|
* responses:
|
|
|
* 200:
|
|
* 200:
|
|
|
* description: params of editor settings
|
|
* description: params of editor settings
|
|
|
* content:
|
|
* content:
|
|
|
* application/json:
|
|
* application/json:
|
|
|
* schema:
|
|
* schema:
|
|
|
- * properties:
|
|
|
|
|
- * currentUser:
|
|
|
|
|
- * type: object
|
|
|
|
|
- * description: editor settings
|
|
|
|
|
|
|
+ * type: object
|
|
|
|
|
+ * description: editor settings
|
|
|
*/
|
|
*/
|
|
|
router.put('/editor-settings', accessTokenParser, loginRequiredStrictly, addActivity, validator.editorSettings, apiV3FormValidator, async(req, res) => {
|
|
router.put('/editor-settings', accessTokenParser, loginRequiredStrictly, addActivity, validator.editorSettings, apiV3FormValidator, async(req, res) => {
|
|
|
const query = { userId: req.user.id };
|
|
const query = { userId: req.user.id };
|
|
@@ -574,7 +606,7 @@ module.exports = (crowi) => {
|
|
|
* get:
|
|
* get:
|
|
|
* tags: [EditorSetting]
|
|
* tags: [EditorSetting]
|
|
|
* operationId: getEditorSettings
|
|
* operationId: getEditorSettings
|
|
|
- * summary: /editor-setting
|
|
|
|
|
|
|
+ * summary: /personal-setting/editor-settings
|
|
|
* description: Get editor preferences
|
|
* description: Get editor preferences
|
|
|
* responses:
|
|
* responses:
|
|
|
* 200:
|
|
* 200:
|
|
@@ -582,10 +614,8 @@ module.exports = (crowi) => {
|
|
|
* content:
|
|
* content:
|
|
|
* application/json:
|
|
* application/json:
|
|
|
* schema:
|
|
* schema:
|
|
|
- * properties:
|
|
|
|
|
- * currentUser:
|
|
|
|
|
- * type: object
|
|
|
|
|
- * description: editor settings
|
|
|
|
|
|
|
+ * type: object
|
|
|
|
|
+ * description: editor settings
|
|
|
*/
|
|
*/
|
|
|
router.get('/editor-settings', accessTokenParser, loginRequiredStrictly, async(req, res) => {
|
|
router.get('/editor-settings', accessTokenParser, loginRequiredStrictly, async(req, res) => {
|
|
|
try {
|
|
try {
|
|
@@ -606,18 +636,30 @@ module.exports = (crowi) => {
|
|
|
* put:
|
|
* put:
|
|
|
* tags: [InAppNotificationSettings]
|
|
* tags: [InAppNotificationSettings]
|
|
|
* operationId: putInAppNotificationSettings
|
|
* operationId: putInAppNotificationSettings
|
|
|
- * summary: personal-setting/in-app-notification-settings
|
|
|
|
|
|
|
+ * summary: /personal-setting/in-app-notification-settings
|
|
|
* description: Put InAppNotificationSettings
|
|
* description: Put InAppNotificationSettings
|
|
|
|
|
+ * requestBody:
|
|
|
|
|
+ * required: true
|
|
|
|
|
+ * content:
|
|
|
|
|
+ * application/json:
|
|
|
|
|
+ * schema:
|
|
|
|
|
+ * properties:
|
|
|
|
|
+ * subscribeRules:
|
|
|
|
|
+ * type: array
|
|
|
|
|
+ * items:
|
|
|
|
|
+ * type: object
|
|
|
|
|
+ * properties:
|
|
|
|
|
+ * name:
|
|
|
|
|
+ * type: string
|
|
|
|
|
+ * isEnabled:
|
|
|
|
|
+ * type: boolean
|
|
|
* responses:
|
|
* responses:
|
|
|
* 200:
|
|
* 200:
|
|
|
* description: params of InAppNotificationSettings
|
|
* description: params of InAppNotificationSettings
|
|
|
* content:
|
|
* content:
|
|
|
* application/json:
|
|
* application/json:
|
|
|
* schema:
|
|
* schema:
|
|
|
- * properties:
|
|
|
|
|
- * currentUser:
|
|
|
|
|
- * type: object
|
|
|
|
|
- * description: in-app-notification-settings
|
|
|
|
|
|
|
+ * type: object
|
|
|
*/
|
|
*/
|
|
|
// eslint-disable-next-line max-len
|
|
// eslint-disable-next-line max-len
|
|
|
router.put('/in-app-notification-settings', accessTokenParser, loginRequiredStrictly, addActivity, validator.inAppNotificationSettings, apiV3FormValidator, async(req, res) => {
|
|
router.put('/in-app-notification-settings', accessTokenParser, loginRequiredStrictly, addActivity, validator.inAppNotificationSettings, apiV3FormValidator, async(req, res) => {
|
|
@@ -675,6 +717,34 @@ module.exports = (crowi) => {
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * @swagger
|
|
|
|
|
+ * /personal-setting/questionnaire-settings:
|
|
|
|
|
+ * put:
|
|
|
|
|
+ * tags: [QuestionnaireSetting]
|
|
|
|
|
+ * operationId: putQuestionnaireSetting
|
|
|
|
|
+ * summary: /personal-setting/questionnaire-settings
|
|
|
|
|
+ * description: Update the questionnaire settings for the current user
|
|
|
|
|
+ * requestBody:
|
|
|
|
|
+ * required: true
|
|
|
|
|
+ * content:
|
|
|
|
|
+ * application/json:
|
|
|
|
|
+ * schema:
|
|
|
|
|
+ * properties:
|
|
|
|
|
+ * isQuestionnaireEnabled:
|
|
|
|
|
+ * type: boolean
|
|
|
|
|
+ * responses:
|
|
|
|
|
+ * 200:
|
|
|
|
|
+ * description: Successfully updated questionnaire settings
|
|
|
|
|
+ * content:
|
|
|
|
|
+ * application/json:
|
|
|
|
|
+ * schema:
|
|
|
|
|
+ * properties:
|
|
|
|
|
+ * message:
|
|
|
|
|
+ * type: string
|
|
|
|
|
+ * isQuestionnaireEnabled:
|
|
|
|
|
+ * type: boolean
|
|
|
|
|
+ */
|
|
|
// eslint-disable-next-line max-len
|
|
// eslint-disable-next-line max-len
|
|
|
router.put('/questionnaire-settings', accessTokenParser, loginRequiredStrictly, validator.questionnaireSettings, apiV3FormValidator, async(req, res) => {
|
|
router.put('/questionnaire-settings', accessTokenParser, loginRequiredStrictly, validator.questionnaireSettings, apiV3FormValidator, async(req, res) => {
|
|
|
const { isQuestionnaireEnabled } = req.body;
|
|
const { isQuestionnaireEnabled } = req.body;
|