wip
This commit is contained in:
		@@ -960,6 +960,86 @@ export const endpoints = {
 | 
			
		||||
			},
 | 
			
		||||
		}],
 | 
			
		||||
	},
 | 
			
		||||
	'admin/queue/promote': {
 | 
			
		||||
		tags: ['admin'],
 | 
			
		||||
	
 | 
			
		||||
		requireCredential: true,
 | 
			
		||||
		requireModerator: true,
 | 
			
		||||
 | 
			
		||||
		defines: [{
 | 
			
		||||
			req: {
 | 
			
		||||
				type: 'object',
 | 
			
		||||
				properties: {
 | 
			
		||||
					type: { type: 'string', enum: ['deliver', 'inbox'] },
 | 
			
		||||
				},
 | 
			
		||||
				required: ['type'],
 | 
			
		||||
			},
 | 
			
		||||
			res: undefined,
 | 
			
		||||
		}],
 | 
			
		||||
	},
 | 
			
		||||
	'admin/queue/stats': {
 | 
			
		||||
		tags: ['admin'],
 | 
			
		||||
	
 | 
			
		||||
		requireCredential: true,
 | 
			
		||||
		requireModerator: true,
 | 
			
		||||
	
 | 
			
		||||
		defines: [{
 | 
			
		||||
			req: undefined,
 | 
			
		||||
			res: {
 | 
			
		||||
				type: 'object',
 | 
			
		||||
				properties: {
 | 
			
		||||
					deliver: { $ref: 'https://misskey-hub.net/api/schemas/QueueCount' },
 | 
			
		||||
					inbox: { $ref: 'https://misskey-hub.net/api/schemas/QueueCount' },
 | 
			
		||||
					db: { $ref: 'https://misskey-hub.net/api/schemas/QueueCount' },
 | 
			
		||||
					objectStorage: { $ref: 'https://misskey-hub.net/api/schemas/QueueCount' },
 | 
			
		||||
				},
 | 
			
		||||
				required: ['deliver', 'inbox', 'db', 'objectStorage'],
 | 
			
		||||
			}
 | 
			
		||||
		}],
 | 
			
		||||
	},
 | 
			
		||||
	'admin/relays/add': {
 | 
			
		||||
		tags: ['admin'],
 | 
			
		||||
	
 | 
			
		||||
		requireCredential: true,
 | 
			
		||||
		requireModerator: true,
 | 
			
		||||
	
 | 
			
		||||
		errors: {
 | 
			
		||||
			invalidUrl: {
 | 
			
		||||
				message: 'Invalid URL',
 | 
			
		||||
				code: 'INVALID_URL',
 | 
			
		||||
				id: 'fb8c92d3-d4e5-44e7-b3d4-800d5cef8b2c',
 | 
			
		||||
			},
 | 
			
		||||
		},
 | 
			
		||||
	
 | 
			
		||||
		defines: [{
 | 
			
		||||
			req: {
 | 
			
		||||
				type: 'object',
 | 
			
		||||
				properties: {
 | 
			
		||||
					inbox: { type: 'string' },
 | 
			
		||||
				},
 | 
			
		||||
				required: ['inbox'],
 | 
			
		||||
			},
 | 
			
		||||
			res: {
 | 
			
		||||
				$ref: 'https://misskey-hub.net/api/schemas/Relay',
 | 
			
		||||
			},
 | 
			
		||||
		}],
 | 
			
		||||
	},
 | 
			
		||||
	'admin/relays/list': {
 | 
			
		||||
		tags: ['admin'],
 | 
			
		||||
	
 | 
			
		||||
		requireCredential: true,
 | 
			
		||||
		requireModerator: true,
 | 
			
		||||
 | 
			
		||||
		defines: [{
 | 
			
		||||
			req: undefined,
 | 
			
		||||
			res: {
 | 
			
		||||
				type: 'array',
 | 
			
		||||
				items: {
 | 
			
		||||
					$ref: 'https://misskey-hub.net/api/schemas/Relay',
 | 
			
		||||
				},
 | 
			
		||||
			},
 | 
			
		||||
		}],
 | 
			
		||||
	}
 | 
			
		||||
} as const satisfies { [x: string]: IEndpointMeta; };
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 
 | 
			
		||||
@@ -38,6 +38,7 @@ export type Clip = Packed<'Clip'>;
 | 
			
		||||
export type Channel = Packed<'Channel'>;
 | 
			
		||||
export type Following = Packed<'Following'>;
 | 
			
		||||
export type Blocking = Packed<'Blocking'>;
 | 
			
		||||
export type Relay = Packed<'Relay'>;
 | 
			
		||||
 | 
			
		||||
export type LiteInstanceMetadata = {
 | 
			
		||||
	maintainerName: string | null;
 | 
			
		||||
 
 | 
			
		||||
@@ -35,6 +35,7 @@ import { packedEmojiDetailedSchema, packedEmojiSimpleSchema } from './schemas/em
 | 
			
		||||
import { packedFlashSchema } from './schemas/flash.js';
 | 
			
		||||
import { packedAdSchema } from './schemas/ad.js';
 | 
			
		||||
import { packedAnnouncementSchema } from './schemas/announcement.js';
 | 
			
		||||
import { packedRelaySchema } from './schemas/relay.js';
 | 
			
		||||
import { Error, ApiError } from './schemas/error.js';
 | 
			
		||||
import type { JSONSchema7, JSONSchema7Definition, GetDef, GetRefs, GetKeys, UnionToArray } from 'schema-type';
 | 
			
		||||
 | 
			
		||||
@@ -75,6 +76,7 @@ export const refs = {
 | 
			
		||||
	Flash: packedFlashSchema,
 | 
			
		||||
	Ad: packedAdSchema,
 | 
			
		||||
	Announcement: packedAnnouncementSchema,
 | 
			
		||||
	Relay: packedRelaySchema,
 | 
			
		||||
 | 
			
		||||
	Error: Error,
 | 
			
		||||
	ApiError: ApiError,
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										31
									
								
								packages/misskey-js/src/schemas/relay.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										31
									
								
								packages/misskey-js/src/schemas/relay.ts
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,31 @@
 | 
			
		||||
import type { JSONSchema7Definition } from 'schema-type';
 | 
			
		||||
 | 
			
		||||
export const packedRelaySchema = {
 | 
			
		||||
	$id: 'https://misskey-hub.net/api/schemas/Relay',
 | 
			
		||||
 | 
			
		||||
	type: 'object',
 | 
			
		||||
	properties: {
 | 
			
		||||
		id: {
 | 
			
		||||
			type: 'string',
 | 
			
		||||
			format: 'id',
 | 
			
		||||
		},
 | 
			
		||||
		inbox: {
 | 
			
		||||
			type: 'string',
 | 
			
		||||
			format: 'url',
 | 
			
		||||
		},
 | 
			
		||||
		status: {
 | 
			
		||||
			type: 'string',
 | 
			
		||||
			default: 'requesting',
 | 
			
		||||
			enum: [
 | 
			
		||||
				'requesting',
 | 
			
		||||
				'accepted',
 | 
			
		||||
				'rejected',
 | 
			
		||||
			],
 | 
			
		||||
		},
 | 
			
		||||
	},
 | 
			
		||||
	required: [
 | 
			
		||||
		'id',
 | 
			
		||||
		'inbox',
 | 
			
		||||
		'status'
 | 
			
		||||
	],
 | 
			
		||||
} as const satisfies JSONSchema7Definition;
 | 
			
		||||
		Reference in New Issue
	
	Block a user