summaryrefslogtreecommitdiff
path: root/packages/backend/src/models
diff options
context:
space:
mode:
authorsyuilo <4439005+syuilo@users.noreply.github.com>2025-08-27 15:59:39 +0900
committersyuilo <4439005+syuilo@users.noreply.github.com>2025-08-27 15:59:39 +0900
commit87d09f255dd702627bbc6fa58692eebba3830889 (patch)
treeb5defcefd421adcc24c56708ea3393b91c788c93 /packages/backend/src/models
parentperf(frontend): use WeakMap (diff)
downloadmisskey-87d09f255dd702627bbc6fa58692eebba3830889.tar.gz
misskey-87d09f255dd702627bbc6fa58692eebba3830889.tar.bz2
misskey-87d09f255dd702627bbc6fa58692eebba3830889.zip
refactor
Diffstat (limited to 'packages/backend/src/models')
-rw-r--r--packages/backend/src/models/json-schema/user-webhook.ts55
1 files changed, 55 insertions, 0 deletions
diff --git a/packages/backend/src/models/json-schema/user-webhook.ts b/packages/backend/src/models/json-schema/user-webhook.ts
new file mode 100644
index 0000000000..8ea0991716
--- /dev/null
+++ b/packages/backend/src/models/json-schema/user-webhook.ts
@@ -0,0 +1,55 @@
+/*
+ * SPDX-FileCopyrightText: syuilo and misskey-project
+ * SPDX-License-Identifier: AGPL-3.0-only
+ */
+
+import { webhookEventTypes } from '@/models/Webhook.js';
+
+export const packedUserWebhookSchema = {
+ type: 'object',
+ properties: {
+ id: {
+ type: 'string',
+ format: 'id',
+ optional: false, nullable: false,
+ },
+ userId: {
+ type: 'string',
+ format: 'id',
+ optional: false, nullable: false,
+ },
+ name: {
+ type: 'string',
+ optional: false, nullable: false,
+ },
+ on: {
+ type: 'array',
+ items: {
+ type: 'string',
+ optional: false, nullable: false,
+ enum: webhookEventTypes,
+ },
+ },
+ url: {
+ type: 'string',
+ optional: false, nullable: false,
+ },
+ secret: {
+ type: 'string',
+ optional: false, nullable: false,
+ },
+ active: {
+ type: 'boolean',
+ optional: false, nullable: false,
+ },
+ latestSentAt: {
+ type: 'string',
+ format: 'date-time',
+ optional: false, nullable: true,
+ },
+ latestStatus: {
+ type: 'integer',
+ optional: false, nullable: true,
+ },
+ },
+} as const;