Skip to content

Commit

Permalink
APIドキュメントの改善 (misskey-dev#6757)
Browse files Browse the repository at this point in the history
* Update api document in admin/announcements

* Update api document in announcements

* Update api document in i/read-announcements

* Update api document in username/available

* Update api document & Fix typo in API 403 error

* Update api document

* Update api document

* Update api document

* Fix API permission definition

* Update api document

* Update api document

* Update api document

* Update api document

* Update api document

* Update api document

* Update api document

* Update api document

* Fix bug in users (api)

* Apply reviews misskey-dev#6757

* Apply reviews misskey-dev#6757

Co-authored-by: syuilo <Syuilotan@yahoo.co.jp>
  • Loading branch information
2 people authored and Austin Lanari committed May 2, 2021
1 parent 0593536 commit 02c1447
Show file tree
Hide file tree
Showing 100 changed files with 3,037 additions and 96 deletions.
70 changes: 64 additions & 6 deletions src/models/repositories/antenna.ts
Expand Up @@ -41,20 +41,78 @@ export const packedAntennaSchema = {
id: {
type: 'string' as const,
optional: false as const, nullable: false as const,
format: 'id',
description: 'The unique identifier for this Antenna.',
example: 'xxxxxxxxxx',
format: 'id'
},
createdAt: {
type: 'string' as const,
optional: false as const, nullable: false as const,
format: 'date-time',
description: 'The date that the Antenna was created.'
format: 'date-time'
},
name: {
type: 'string' as const,
optional: false as const, nullable: false as const
},
keywords: {
type: 'array' as const,
optional: false as const, nullable: false as const,
items: {
type: 'string' as const,
optional: false as const, nullable: false as const
}
},
execludeKeywords: {
type: 'array' as const,
optional: false as const, nullable: false as const,
items: {
type: 'string' as const,
optional: false as const, nullable: false as const
}
},
src: {
type: 'string' as const,
optional: false as const, nullable: false as const,
description: 'The name of the Antenna.'
enum: ['home', 'all', 'users', 'list', 'group']
},
userListId: {
type: 'string' as const,
optional: false as const, nullable: true as const,
format: 'id'
},
userGroupId: {
type: 'string' as const,
optional: false as const, nullable: true as const,
format: 'id'
},
users: {
type: 'array' as const,
optional: false as const, nullable: false as const,
items: {
type: 'string' as const,
optional: false as const, nullable: false as const
}
},
caseSensitive: {
type: 'boolean' as const,
optional: false as const, nullable: false as const,
default: false
},
notify: {
type: 'boolean' as const,
optional: false as const, nullable: false as const
},
withReplies: {
type: 'boolean' as const,
optional: false as const, nullable: false as const,
default: false
},
withFile: {
type: 'boolean' as const,
optional: false as const, nullable: false as const
},
hasUnreadNote: {
type: 'boolean' as const,
optional: false as const, nullable: false as const,
default: false
}
},
};
30 changes: 16 additions & 14 deletions src/models/repositories/app.ts
Expand Up @@ -46,33 +46,35 @@ export const packedAppSchema = {
properties: {
id: {
type: 'string' as const,
optional: false as const, nullable: false as const,
format: 'id',
description: 'The unique identifier for this Note.',
example: 'xxxxxxxxxx',
optional: false as const, nullable: false as const
},
name: {
type: 'string' as const,
optional: false as const, nullable: false as const,
description: 'アプリケーションの名前'
optional: false as const, nullable: false as const
},
createdAt: {
type: 'string' as const,
optional: false as const, nullable: false as const
},
callbackUrl: {
lastUsedAt: {
type: 'string' as const,
optional: false as const, nullable: true as const,
description: 'コールバックするURL'
optional: false as const, nullable: false as const
},
permission: {
type: 'array' as const,
optional: true as const, nullable: false as const,
optional: false as const, nullable: false as const,
items: {
type: 'string' as const,
optional: false as const, nullable: false as const,
optional: false as const, nullable: false as const
}
},
secret: {
type: 'string' as const,
optional: true as const, nullable: false as const,
description: 'アプリケーションのシークレットキー'
optional: true as const, nullable: false as const
},
isAuthorized: {
type: 'boolean' as const,
optional: true as const, nullable: false as const
}
},
}
};
62 changes: 58 additions & 4 deletions src/models/repositories/drive-file.ts
Expand Up @@ -189,23 +189,77 @@ export const packedDriveFileSchema = {
description: 'The size of this Drive file. (bytes)',
example: 51469
},
isSensitive: {
type: 'boolean' as const,
optional: false as const, nullable: false as const,
description: 'Whether this Drive file is sensitive.',
},
blurhash: {
type: 'string' as const,
optional: false as const, nullable: true as const
},
properties: {
type: 'object' as const,
optional: false as const, nullable: false as const,
properties: {
width: {
type: 'number' as const,
optional: false as const, nullable: false as const,
example: 1280
},
height: {
type: 'number' as const,
optional: false as const, nullable: false as const,
example: 720
},
avgColor: {
type: 'string' as const,
optional: true as const, nullable: false as const,
example: 'rgb(40,65,87)'
}
}
},
url: {
type: 'string' as const,
optional: false as const, nullable: true as const,
format: 'url',
description: 'The URL of this Drive file.',
},
thumbnailUrl: {
type: 'string' as const,
optional: false as const, nullable: true as const,
format: 'url',
description: 'The thumbnail URL of this Drive file.',
},
comment: {
type: 'string' as const,
optional: false as const, nullable: true as const
},
folderId: {
type: 'string' as const,
optional: false as const, nullable: true as const,
format: 'id',
description: 'The parent folder ID of this Drive file.',
example: 'xxxxxxxxxx',
},
isSensitive: {
type: 'boolean' as const,
optional: false as const, nullable: false as const,
description: 'Whether this Drive file is sensitive.',
folder: {
type: 'object' as const,
optional: true as const, nullable: true as const,
description: 'The parent folder of this Drive file.',
ref: 'DriveFolder'
},
userId: {
type: 'string' as const,
optional: false as const, nullable: true as const,
format: 'id',
description: 'Owner ID of this Drive file.',
example: 'xxxxxxxxxx',
},
user: {
type: 'object' as const,
optional: true as const, nullable: true as const,
description: 'Owner of this Drive file.',
ref: 'User'
}
},
};
106 changes: 106 additions & 0 deletions src/models/repositories/federation-instance.ts
@@ -0,0 +1,106 @@
import config from '../../config';

export const packedFederationInstanceSchema = {
type: 'object' as const,
optional: false as const, nullable: false as const,
properties: {
id: {
type: 'string' as const,
optional: false as const, nullable: false as const,
format: 'id'
},
caughtAt: {
type: 'string' as const,
optional: false as const, nullable: false as const,
format: 'date-time'
},
host: {
type: 'string' as const,
optional: false as const, nullable: false as const,
example: 'misskey.example.com'
},
usersCount: {
type: 'number' as const,
optional: false as const, nullable: false as const
},
notesCount: {
type: 'number' as const,
optional: false as const, nullable: false as const
},
followingCount: {
type: 'number' as const,
optional: false as const, nullable: false as const
},
followersCount: {
type: 'number' as const,
optional: false as const, nullable: false as const
},
driveUsage: {
type: 'number' as const,
optional: false as const, nullable: false as const
},
driveFiles: {
type: 'number' as const,
optional: false as const, nullable: false as const
},
latestRequestSentAt: {
type: 'string' as const,
optional: false as const, nullable: true as const,
format: 'date-time'
},
lastCommunicatedAt: {
type: 'string' as const,
optional: false as const, nullable: false as const,
format: 'date-time'
},
isNotResponding: {
type: 'boolean' as const,
optional: false as const, nullable: false as const
},
isSuspended: {
type: 'boolean' as const,
optional: false as const, nullable: false as const
},
softwareName: {
type: 'string' as const,
optional: false as const, nullable: true as const,
example: 'misskey'
},
softwareVersion: {
type: 'string' as const,
optional: false as const, nullable: true as const,
example: config.version
},
openRegistrations: {
type: 'boolean' as const,
optional: false as const, nullable: true as const,
example: true
},
name: {
type: 'string' as const,
optional: false as const, nullable: true as const
},
description: {
type: 'string' as const,
optional: false as const, nullable: true as const
},
maintainerName: {
type: 'string' as const,
optional: false as const, nullable: true as const
},
maintainerEmail: {
type: 'string' as const,
optional: false as const, nullable: true as const
},
iconUrl: {
type: 'string' as const,
optional: false as const, nullable: true as const,
format: 'url'
},
infoUpdatedAt: {
type: 'string' as const,
optional: false as const, nullable: true as const,
format: 'date-time'
}
}
};
30 changes: 30 additions & 0 deletions src/models/repositories/queue.ts
@@ -0,0 +1,30 @@
export const packedQueueCountSchema = {
type: 'object' as const,
optional: false as const, nullable: false as const,
properties: {
waiting: {
type: 'number' as const,
optional: false as const, nullable: false as const
},
active: {
type: 'number' as const,
optional: false as const, nullable: false as const
},
completed: {
type: 'number' as const,
optional: false as const, nullable: false as const
},
failed: {
type: 'number' as const,
optional: false as const, nullable: false as const
},
delayed: {
type: 'number' as const,
optional: false as const, nullable: false as const
},
paused: {
type: 'number' as const,
optional: false as const, nullable: false as const
}
}
};

0 comments on commit 02c1447

Please sign in to comment.