diff options
| author | syuilo <Syuilotan@yahoo.co.jp> | 2018-08-01 08:34:22 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-08-01 08:34:22 +0900 |
| commit | 77faf7a84cc28d9a24803940730e59706edd4ec8 (patch) | |
| tree | a3a366deedc99a98bcfe7358eb48aff0ff5fe71c /src/server/api/endpoints/app/create.ts | |
| parent | New translations ja.yml (English) (diff) | |
| parent | Merge pull request #2033 from syuilo/greenkeeper/qrcode-1.2.2 (diff) | |
| download | misskey-77faf7a84cc28d9a24803940730e59706edd4ec8.tar.gz misskey-77faf7a84cc28d9a24803940730e59706edd4ec8.tar.bz2 misskey-77faf7a84cc28d9a24803940730e59706edd4ec8.zip | |
Merge branch 'master' into l10n_master
Diffstat (limited to 'src/server/api/endpoints/app/create.ts')
| -rw-r--r-- | src/server/api/endpoints/app/create.ts | 59 |
1 files changed, 5 insertions, 54 deletions
diff --git a/src/server/api/endpoints/app/create.ts b/src/server/api/endpoints/app/create.ts index c7bc91a079..5df8bd2f25 100644 --- a/src/server/api/endpoints/app/create.ts +++ b/src/server/api/endpoints/app/create.ts @@ -3,63 +3,14 @@ import $ from 'cafy'; import App, { isValidNameId, pack } from '../../../../models/app'; import { ILocalUser } from '../../../../models/user'; -/** - * @swagger - * /app/create: - * note: - * summary: Create an application - * parameters: - * - $ref: "#/parameters/AccessToken" - * - - * name: nameId - * description: Application unique name - * in: formData - * required: true - * type: string - * - - * name: name - * description: Application name - * in: formData - * required: true - * type: string - * - - * name: description - * description: Application description - * in: formData - * required: true - * type: string - * - - * name: permission - * description: Permissions that application has - * in: formData - * required: true - * type: array - * items: - * type: string - * collectionFormat: csv - * - - * name: callbackUrl - * description: URL called back after authentication - * in: formData - * required: false - * type: string - * - * responses: - * 200: - * description: Created application's information - * schema: - * $ref: "#/definitions/Application" - * - * default: - * description: Failed - * schema: - * $ref: "#/definitions/Error" - */ +export const meta = { + requireCredential: true +}; /** * Create an app */ -module.exports = async (params: any, user: ILocalUser) => new Promise(async (res, rej) => { +export default async (params: any, user: ILocalUser) => new Promise(async (res, rej) => { // Get 'nameId' parameter const [nameId, nameIdErr] = $.str.pipe(isValidNameId).get(params.nameId); if (nameIdErr) return rej('invalid nameId param'); @@ -78,7 +29,7 @@ module.exports = async (params: any, user: ILocalUser) => new Promise(async (res // Get 'callbackUrl' parameter // TODO: Check it is valid url - const [callbackUrl = null, callbackUrlErr] = $.str.optional().nullable().get(params.callbackUrl); + const [callbackUrl = null, callbackUrlErr] = $.str.optional.nullable.get(params.callbackUrl); if (callbackUrlErr) return rej('invalid callbackUrl param'); // Generate secret |