enhance: api.jsonのレスポンスの内容を実際の内容に合わせる (#12723)

* Create packedAdSchema

* admin/emoji/add

* admin/get-user-ips

* admin/roles/users

* admin/get-index-stats

* admin/accounts/find-by-email

* fix type of admin/ad/list

* federation/stats

* endpoints

* get-online-users-count

* i/2fa/register-key

* i/2fa/key-done

* i/2fa/register

* i/apps

* i/authorized-apps

* i/registry/get-all

* i/registry/get

* i/registry/get-detail

* i/registry/key-with-type

* i/registry/scopes-with-domain

* i/update-email

* i/move

* i/webhooks/create

* fix miss type

* i/webhooks/show

* i/webhooks/list

* flash/create

* roles/users

* server-info

* test

* users/lists/get-memberships

* users/achievements

* fetch-rss

* fetch-external-resources
This commit is contained in:
GrapeApple0
2023-12-21 16:57:05 +09:00
committed by GitHub
parent 07d4632cd7
commit 79ca93cefb
35 changed files with 822 additions and 7 deletions

View File

@@ -27,6 +27,33 @@ export const meta = {
id: '87a9bb19-111e-4e37-81d3-a3e7426453b0',
},
},
res: {
type: 'object',
properties: {
id: {
type: 'string',
format: 'misskey:id'
},
userId: {
type: 'string',
format: 'misskey:id',
},
name: { type: 'string' },
on: {
type: 'array',
items: {
type: 'string',
enum: webhookEventTypes,
}
},
url: { type: 'string' },
secret: { type: 'string' },
active: { type: 'boolean' },
latestSentAt: { type: 'string', format: 'date-time', nullable: true },
latestStatus: { type: 'integer', nullable: true },
},
},
} as const;
export const paramDef = {
@@ -73,7 +100,17 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
this.globalEventService.publishInternalEvent('webhookCreated', webhook);
return webhook;
return {
id: webhook.id,
userId: webhook.userId,
name: webhook.name,
on: webhook.on,
url: webhook.url,
secret: webhook.secret,
active: webhook.active,
latestSentAt: webhook.latestSentAt?.toISOString(),
latestStatus: webhook.latestStatus,
};
});
}
}