1
0
forked from mirror/misskey

Clean up: Remove unmaintained codes

This commit is contained in:
syuilo 2018-07-25 00:33:48 +09:00
parent c3b3b9b9a6
commit 575da76235
10 changed files with 0 additions and 499 deletions

View File

@ -188,7 +188,6 @@
"stylus": "0.54.5",
"stylus-loader": "3.0.2",
"summaly": "2.0.6",
"swagger-jsdoc": "1.10.3",
"syuilo-password-strength": "0.0.1",
"textarea-caret": "3.1.0",
"tmp": "0.0.33",

View File

@ -7,59 +7,6 @@ export const meta = {
requireCredential: true
};
/**
* @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"
*/
/**
* Create an app
*/

View File

@ -5,35 +5,6 @@ import $ from 'cafy';
import App from '../../../../../models/app';
import { isValidNameId } from '../../../../../models/app';
/**
* @swagger
* /app/nameId/available:
* note:
* summary: Check available nameId on creation an application
* parameters:
* -
* name: nameId
* description: Application unique name
* in: formData
* required: true
* type: string
*
* responses:
* 200:
* description: Success
* schema:
* type: object
* properties:
* available:
* description: Whether nameId is available
* type: boolean
*
* default:
* description: Failed
* schema:
* $ref: "#/definitions/Error"
*/
/**
* Check available nameId of app
*

View File

@ -2,36 +2,6 @@ import $ from 'cafy'; import ID from '../../../../misc/cafy-id';
import App, { pack, IApp } from '../../../../models/app';
import { ILocalUser } from '../../../../models/user';
/**
* @swagger
* /app/show:
* note:
* summary: Show an application's information
* description: Require appId or nameId
* parameters:
* -
* name: appId
* description: Application ID
* in: formData
* type: string
* -
* name: nameId
* description: Application unique name
* in: formData
* type: string
*
* responses:
* 200:
* description: Success
* schema:
* $ref: "#/definitions/Application"
*
* default:
* description: Failed
* schema:
* $ref: "#/definitions/Error"
*/
/**
* Show an app
*/

View File

@ -11,29 +11,6 @@ export const meta = {
secure: true
};
/**
* @swagger
* /auth/accept:
* note:
* summary: Accept a session
* parameters:
* - $ref: "#/parameters/NativeToken"
* -
* name: token
* description: Session Token
* in: formData
* required: true
* type: string
* responses:
* 204:
* description: OK
*
* default:
* description: Failed
* schema:
* $ref: "#/definitions/Error"
*/
/**
* Accept
*/

View File

@ -7,37 +7,6 @@ import App from '../../../../../models/app';
import AuthSess from '../../../../../models/auth-session';
import config from '../../../../../config';
/**
* @swagger
* /auth/session/generate:
* note:
* summary: Generate a session
* parameters:
* -
* name: appSecret
* description: App Secret
* in: formData
* required: true
* type: string
*
* responses:
* 200:
* description: OK
* schema:
* type: object
* properties:
* token:
* type: string
* description: Session Token
* url:
* type: string
* description: Authentication form's URL
* default:
* description: Failed
* schema:
* $ref: "#/definitions/Error"
*/
/**
* Generate a session
*

View File

@ -2,46 +2,6 @@ import $ from 'cafy';
import AuthSess, { pack } from '../../../../../models/auth-session';
import { ILocalUser } from '../../../../../models/user';
/**
* @swagger
* /auth/session/show:
* note:
* summary: Show a session information
* parameters:
* -
* name: token
* description: Session Token
* in: formData
* required: true
* type: string
*
* responses:
* 200:
* description: OK
* schema:
* type: object
* properties:
* createdAt:
* type: string
* format: date-time
* description: Date and time of the session creation
* appId:
* type: string
* description: Application ID
* token:
* type: string
* description: Session Token
* userId:
* type: string
* description: ID of user who create the session
* app:
* $ref: "#/definitions/Application"
* default:
* description: Failed
* schema:
* $ref: "#/definitions/Error"
*/
/**
* Show a session
*/

View File

@ -7,42 +7,6 @@ import AuthSess from '../../../../../models/auth-session';
import AccessToken from '../../../../../models/access-token';
import { pack } from '../../../../../models/user';
/**
* @swagger
* /auth/session/userkey:
* note:
* summary: Get an access token(userkey)
* parameters:
* -
* name: appSecret
* description: App Secret
* in: formData
* required: true
* type: string
* -
* name: token
* description: Session Token
* in: formData
* required: true
* type: string
*
* responses:
* 200:
* description: OK
* schema:
* type: object
* properties:
* userkey:
* type: string
* description: Access Token
* user:
* $ref: "#/definitions/User"
* default:
* description: Failed
* schema:
* $ref: "#/definitions/Error"
*/
/**
* Generate a session
*

View File

@ -8,33 +8,6 @@ import Meta from '../../../models/meta';
const pkg = require('../../../../package.json');
const client = require('../../../../built/client/meta.json');
/**
* @swagger
* /meta:
* note:
* summary: Show the misskey's information
* responses:
* 200:
* description: Success
* schema:
* type: object
* properties:
* maintainer:
* description: maintainer's name
* type: string
* commit:
* description: latest commit's hash
* type: string
* secure:
* description: whether the server supports secure protocols
* type: boolean
*
* default:
* description: Failed
* schema:
* $ref: "#/definitions/Error"
*/
/**
* Show core info
*/

View File

@ -1,229 +0,0 @@
'use strict'
const swaggerJSDoc = require('swagger-jsdoc');
const fs = require('fs');
const yaml = require('js-yaml');
const apiRoot = './src/api/endpoints';
const files = [
'meta.js',
//app
'app/show.js',
'app/create.js',
'app/name_id/available.js',
//auth
'auth/accept.js',
//auth/session
'auth/session/generate.js',
'auth/session/show.js',
'auth/session/userkey.js',
];
const defaultSwagger = {
"swagger": "2.0",
"info": {
"title": "Misskey API",
"version": "nighthike"
},
"host": "api.misskey.xyz",
"schemes": [
"https"
],
"consumes": [
"application/x-www-form-urlencoded"
],
"produces": [
"application/json"
],
"parameters": {
"AccessToken": {
"name": "i",
"description": "Access Token",
"in": "formData",
"required": true,
"type": "string"
},
"NativeToken": {
"name": "i",
"description": "Native Access Token",
"in": "formData",
"required": true,
"type": "string",
"pattern": "^\!.+"
}
},
"definitions": {
"Error": {
"type": "object",
"properties": {
"error": {
"type": "string",
"description": "Error message"
}
}
},
"User": {
"type": "object",
"required": [
"created_at",
"followers_count",
"following_count",
"id",
"liked_count",
"likes_count",
"name",
"posts_count",
"username"
],
"properties": {
"avatar_id": {
"type": "string",
"description": "アバターに設定しているドライブのファイルのID"
},
"avatarUrl": {
"type": "string",
"description": "アバターURL"
},
"banner_id": {
"type": "string",
"description": "バナーに設定しているドライブのファイルのID"
},
"bannerUrl": {
"type": "string",
"description": "バナーURL"
},
"bio": {
"type": "string",
"description": "プロフィール"
},
"birthday": {
"type": "string",
"format": "date",
"description": "誕生日"
},
"created_at": {
"type": "string",
"format": "date-time",
"description": "アカウント作成日時"
},
"drive_capacity": {
"type": "integer",
"description": "ドライブの最大容量"
},
"followers_count": {
"type": "integer",
"description": "フォロワー数"
},
"following_count": {
"type": "integer",
"description": "フォロー数"
},
"id": {
"type": "string",
"description": "ユーザーID"
},
"is_followed": {
"type": "boolean",
"description": "フォローされているか"
},
"is_following": {
"type": "boolean",
"description": "フォローしているか"
},
"liked_count": {
"type": "integer",
"description": "投稿にいいねされた数"
},
"likes_count": {
"type": "integer",
"description": "投稿にいいねした数"
},
"location": {
"type": "string",
"description": "場所"
},
"name": {
"type": "string",
"description": "ニックネーム"
},
"posts_count": {
"type": "integer",
"description": "投稿数"
},
"username": {
"type": "string",
"description": "ユーザー名"
}
}
},
"Application": {
"type": "object",
"properties": {
"created_at": {
"type": "string",
"format": "date-time",
"description": "アプリケーションの作成日時"
},
"user_id": {
"type": "string",
"description": "アプリケーションを作成したユーザーのID"
},
"name": {
"type": "string",
"description": "アプリケーションの名前"
},
"name_id": {
"type": "string",
"description": "アプリケーションのユニークな名前"
},
"description": {
"type": "string",
"description": "アプリケーションの説明"
},
"permission": {
"type": "array",
"items": {
"type": "string"
},
"description": "アプリケーションの持つ権限一覧"
},
"callback_url": {
"type": "string",
"description": "コールバックURL"
},
"id": {
"type": "string",
"description": "アプリケーションID"
},
"icon_url": {
"type": "string",
"description": "アプリケーションのアイコンのURL"
}
}
}
},
"securityDefinitions": {},
"tags": []
};
var options = {
swaggerDefinition: defaultSwagger,
apis: []
};
options.apis = files.map(c => {return `${apiRoot}/${c}`;});
if(fs.existsSync('.config/config.yml')){
var config = yaml.safeLoad(fs.readFileSync('./.config/config.yml', 'utf8'));
options.swaggerDefinition.host = `api.${config.url.match(/\:\/\/(.+)$/)[1]}`;
options.swaggerDefinition.schemes = config.https.enable ?
['https'] :
['http'];
}
var swaggerSpec = swaggerJSDoc(options);
fs.writeFileSync('api-docs.json', JSON.stringify(swaggerSpec));