fix(backend): add missing schemas and fix incorrect schemas (#13295)

* fix(backend): add missing schemas and fix incorrect schemas

* fix: ci

* fix: ci (本命)

* fix: run `pnpm build-misskey-js-with-types`

* fix: typos

* fix: role-condition-formula-value contains `id`

* fix: incorrect schema
This commit is contained in:
zyoshoka
2024-02-16 14:27:33 +09:00
committed by GitHub
parent 147e8f1e3e
commit 40bbae3d6c
31 changed files with 1038 additions and 160 deletions

View File

@@ -15,6 +15,19 @@ export const meta = {
requireCredential: true,
secure: true,
res: {
type: 'object',
properties: {
backupCodes: {
type: 'array',
optional: false,
items: {
type: 'string',
},
},
},
},
} as const;
export const paramDef = {

View File

@@ -47,7 +47,7 @@ export const meta = {
properties: {
id: {
type: 'string',
nullable: true,
optional: true,
},
},
},

View File

@@ -21,26 +21,31 @@ export const meta = {
properties: {
id: {
type: 'string',
optional: false,
format: 'misskey:id',
},
name: {
type: 'string',
optional: true,
},
createdAt: {
type: 'string',
optional: false,
format: 'date-time',
},
lastUsedAt: {
type: 'string',
optional: true,
format: 'date-time',
},
permission: {
type: 'array',
optional: false,
uniqueItems: true,
items: {
type: 'string'
type: 'string',
},
}
},
},
},
},

View File

@@ -23,23 +23,27 @@ export const meta = {
id: {
type: 'string',
format: 'misskey:id',
optional: false,
},
name: {
type: 'string',
optional: false,
},
callbackUrl: {
type: 'string',
nullable: true,
optional: false, nullable: true,
},
permission: {
type: 'array',
optional: false,
uniqueItems: true,
items: {
type: 'string'
type: 'string',
},
},
isAuthorized: {
type: 'boolean',
optional: true,
},
},
},

View File

@@ -22,7 +22,16 @@ export const meta = {
res: {
type: 'object',
}
properties: {
updatedAt: {
type: 'string',
optional: false,
},
value: {
optional: false,
},
},
},
} as const;
export const paramDef = {
@@ -50,7 +59,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
}
return {
updatedAt: item.updatedAt,
updatedAt: item.updatedAt.toISOString(),
value: item.value,
};
});

View File

@@ -13,6 +13,9 @@ export const meta = {
res: {
type: 'object',
additionalProperties: {
type: 'string',
},
},
} as const;

View File

@@ -10,6 +10,13 @@ import { RegistryApiService } from '@/core/RegistryApiService.js';
export const meta = {
requireCredential: true,
kind: 'read:account',
res: {
type: 'array',
items: {
type: 'string',
},
},
} as const;
export const paramDef = {

View File

@@ -33,6 +33,7 @@ import { HttpRequestService } from '@/core/HttpRequestService.js';
import type { Config } from '@/config.js';
import { safeForSql } from '@/misc/safe-for-sql.js';
import { AvatarDecorationService } from '@/core/AvatarDecorationService.js';
import { notificationRecieveConfig } from '@/models/json-schema/user.js';
import { ApiLoggerService } from '../../ApiLoggerService.js';
import { ApiError } from '../../error.js';
@@ -184,7 +185,26 @@ export const paramDef = {
mutedInstances: { type: 'array', items: {
type: 'string',
} },
notificationRecieveConfig: { type: 'object' },
notificationRecieveConfig: {
type: 'object',
nullable: false,
properties: {
note: notificationRecieveConfig,
follow: notificationRecieveConfig,
mention: notificationRecieveConfig,
reply: notificationRecieveConfig,
renote: notificationRecieveConfig,
quote: notificationRecieveConfig,
reaction: notificationRecieveConfig,
pollEnded: notificationRecieveConfig,
receiveFollowRequest: notificationRecieveConfig,
followRequestAccepted: notificationRecieveConfig,
roleAssigned: notificationRecieveConfig,
achievementEarned: notificationRecieveConfig,
app: notificationRecieveConfig,
test: notificationRecieveConfig,
},
},
emailNotificationTypes: { type: 'array', items: {
type: 'string',
} },

View File

@@ -33,7 +33,7 @@ export const meta = {
properties: {
id: {
type: 'string',
format: 'misskey:id'
format: 'misskey:id',
},
userId: {
type: 'string',
@@ -45,7 +45,7 @@ export const meta = {
items: {
type: 'string',
enum: webhookEventTypes,
}
},
},
url: { type: 'string' },
secret: { type: 'string' },
@@ -108,7 +108,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
url: webhook.url,
secret: webhook.secret,
active: webhook.active,
latestSentAt: webhook.latestSentAt?.toISOString(),
latestSentAt: webhook.latestSentAt ? webhook.latestSentAt.toISOString() : null,
latestStatus: webhook.latestStatus,
};
});

View File

@@ -23,7 +23,7 @@ export const meta = {
properties: {
id: {
type: 'string',
format: 'misskey:id'
format: 'misskey:id',
},
userId: {
type: 'string',
@@ -35,7 +35,7 @@ export const meta = {
items: {
type: 'string',
enum: webhookEventTypes,
}
},
},
url: { type: 'string' },
secret: { type: 'string' },
@@ -43,8 +43,8 @@ export const meta = {
latestSentAt: { type: 'string', format: 'date-time', nullable: true },
latestStatus: { type: 'integer', nullable: true },
},
}
}
},
},
} as const;
export const paramDef = {
@@ -73,7 +73,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
url: webhook.url,
secret: webhook.secret,
active: webhook.active,
latestSentAt: webhook.latestSentAt?.toISOString(),
latestSentAt: webhook.latestSentAt ? webhook.latestSentAt.toISOString() : null,
latestStatus: webhook.latestStatus,
}
));

View File

@@ -30,7 +30,7 @@ export const meta = {
properties: {
id: {
type: 'string',
format: 'misskey:id'
format: 'misskey:id',
},
userId: {
type: 'string',
@@ -42,7 +42,7 @@ export const meta = {
items: {
type: 'string',
enum: webhookEventTypes,
}
},
},
url: { type: 'string' },
secret: { type: 'string' },
@@ -85,7 +85,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
url: webhook.url,
secret: webhook.secret,
active: webhook.active,
latestSentAt: webhook.latestSentAt?.toISOString(),
latestSentAt: webhook.latestSentAt ? webhook.latestSentAt.toISOString() : null,
latestStatus: webhook.latestStatus,
};
});