🛣️ チャットルート
チャットルートは Express ミドルウェアではなく、SDK のコンポーザーです。以下の一覧と詳細では、公開される HTTP および WebSocket エンドポイントの正確な契約を説明します。
一覧
詳細
createChatChannelRoute
実装
エンドポイント: POST /channels
アクセス: isAuthenticated() → some(...) → checkIdentityType(...) → isSelf(...) は、ここに示したソース順で実行されます。正確な呼び出し: isAuthenticated(), some( checkIdentityType(['admin']), isSelf(['params', 'requestBody', 'ownerId']) ),.
リクエスト: createChatChannelSchema は application/json 本文を検証します: 必須: name および ownerId; 省略可能な null 許容アイコン。
パイプライン: createChatChannel → getChatChannelById → createChatChannelTerminator.
成功: レスポンス記述子の data に正規化されたチャンネルを含む 201 を返します。
失敗: 認証および認可の失敗は、ハンドラーパイプラインの前にリンク先のバリデーターに従います。パイプラインの失敗は、リンク先のハンドラー/ブロック契約と共通エラーミドルウェアに従います。このルートは個別のインラインエラーマッピングを追加しません。完全なソースを表示
findChatChannelsRoute
実装
エンドポイント: GET /channels
アクセス: isAuthenticated() → some(...) → checkIdentityType(...) → isSelf(...) は、ここに示したソース順で実行されます。正確な呼び出し: isAuthenticated(), some( checkIdentityType(['admin']), isSelf(['params', 'requestQuery', 'ownerId']) ),.
リクエスト: findChatChannelsSchema はクエリパラメータを検証します: 省略可能: name, ownerId, および共通ページネーションフィールド。
パイプライン: findChatChannels → normalizeChatChannelsListTerminator.
成功: 正規化されたチャンネルとページネーションメタデータを含む 200 を返します。
失敗: 認証および認可の失敗は、ハンドラーパイプラインの前にリンク先のバリデーターに従います。パイプラインの失敗は、リンク先のハンドラー/ブロック契約と共通エラーミドルウェアに従います。このルートは個別のインラインエラーマッピングを追加しません。完全なソースを表示
getChatChannelRoute
実装
エンドポイント: GET /channels/:channelId
アクセス: isAuthenticated() → some(...) → checkIdentityType(...) → ownsChannel(...) → hasSubscription(...) は、ここに示したソース順で実行されます。正確な呼び出し: isAuthenticated(), some( checkIdentityType(['admin']), ownsChannel(['params', 'requestParams', 'channelId']), hasSubscription(['params', 'requestParams', 'channelId']) ),.
リクエスト: getChatChannelSchema はパスパラメータを検証します: 必須: channelId.
パイプライン: getChatChannelById → normalizeChatChannelTerminator.
成功: 正規化されたチャンネルを含む 200 を返します。
失敗: 認証および認可の失敗は、ハンドラーパイプラインの前にリンク先のバリデーターに従います。パイプラインの失敗は、リンク先のハンドラー/ブロック契約と共通エラーミドルウェアに従います。このルートは個別のインラインエラーマッピングを追加しません。完全なソースを表示
updateChatChannelRoute
実装
エンドポイント: PATCH /channels/:channelId
アクセス: isAuthenticated() → some(...) → checkIdentityType(...) → ownsChannel(...) は、ここに示したソース順で実行されます。正確な呼び出し: isAuthenticated(), some( checkIdentityType(['admin']), ownsChannel(['params', 'requestParams', 'channelId']) ),.
リクエスト: updateChatChannelSchema はパスパラメータおよび application/json 本文を検証します: 必須: channelId; 本文では省略可能な name および null 許容の icon.
パイプライン: updateChatChannel → getChatChannelById → normalizeChatChannelTerminator.
成功: 更新済みで正規化されたチャンネルを含む 200 を返します。
失敗: 認証および認可の失敗は、ハンドラーパイプラインの前にリンク先のバリデーターに従います。パイプラインの失敗は、リンク先のハンドラー/ブロック契約と共通エラーミドルウェアに従います。このルートは個別のインラインエラーマッピングを追加しません。完全なソースを表示
deleteChatChannelRoute
実装
エンドポイント: DELETE /channels/:channelId
アクセス: isAuthenticated() → some(...) → checkIdentityType(...) → ownsChannel(...) は、ここに示したソース順で実行されます。正確な呼び出し: isAuthenticated(), some( checkIdentityType(['admin']), ownsChannel(['params', 'requestParams', 'channelId']) ),.
リクエスト: deleteChatChannelSchema はパスパラメータを検証します: 必須: channelId.
パイプライン: deleteChatChannel → deleteChatChannelTerminator.
成功: 空の 204 レスポンス。
失敗: 認証および認可の失敗は、ハンドラーパイプラインの前にリンク先のバリデーターに従います。パイプラインの失敗は、リンク先のハンドラー/ブロック契約と共通エラーミドルウェアに従います。このルートは個別のインラインエラーマッピングを追加しません。完全なソースを表示
getChannelMessagesRoute
実装
エンドポイント: GET /channels/:channelId/messages
アクセス: isAuthenticated() → hasSubscription(...) → channelExists(...) は、ここに示したソース順で実行されます。正確な呼び出し: isAuthenticated(), channelExists(['params', 'requestParams', 'channelId']), hasSubscription(['params', 'requestParams', 'channelId']),.
リクエスト: getChannelMessagesSchema はパスおよびクエリパラメータを検証します: 必須: channelId および 省略可能な共通ページネーションフィールド。
パイプライン: getChannelMessagesByChannelId → ページネーション → normalizeChatMessages → レスポンスへの射影。
成功: 正規化されたメッセージとページネーションメタデータを含む 200 を返します。
失敗: 認証および認可の失敗は、ハンドラーパイプラインの前にリンク先のバリデーターに従います。このルートは、ソースに示される次のマッピングを使用します: ChatChannelUnknownError → 500。完全なソースを表示
getChatChannelIconUploadUrlRoute
実装
エンドポイント: GET /channels/:channelId/icon-upload-url
アクセス: isAuthenticated() → some(...) → checkIdentityType(...) → ownsChannel(...) は、ここに示したソース順で実行されます。正確な呼び出し: isAuthenticated(), some( checkIdentityType(['admin']), ownsChannel(['params', 'requestParams', 'channelId']) ),.
リクエスト: 共有の getSignedImageUploadUrlSchema はパス channelId と署名付き画像アップロードリクエストの契約を検証します。
パイプライン: generateChatChannelIconUploadUrl → orThrow.
成功: { objectId, url } を含む 200 を返します。
失敗: 認証および認可の失敗は、ハンドラーパイプラインの前にリンク先のバリデーターに従います。このルートは、ソースに示される次のマッピングを使用します: FileStorageServiceError → 500, ChatChannelUnknownError → 500。完全なソースを表示
createChatMessageRoute
実装
エンドポイント: POST /messages
アクセス: isAuthenticated() → isSelf(...) → hasSubscription(...) は、ここに示したソース順で実行されます。正確な呼び出し: isAuthenticated(), isSelf(['params', 'requestBody', 'senderId']), hasSubscription(['params', 'requestBody', 'channelId']),.
リクエスト: createChatMessageSchema は application/json 本文を検証します: 必須: content, senderId, および channelId。省略可能: title.
パイプライン: createChatMessage → getChatMessageById → normalizeChatMessage → orThrow.
成功: 201正規化されたメッセージと署名付き添付ファイル URL を含む 201 を返します。
失敗: 認証および認可の失敗は、ハンドラーパイプラインの前にリンク先のバリデーターに従います。このルートは、ソースに示される次のマッピングを使用します: ChatMessageNotFoundBlockError → 404, FileStorageServiceError → 500, ChatMessageUnexpectedDBError → 500。完全なソースを表示
findChatMessagesRoute
実装
エンドポイント: GET /messages
アクセス: isAuthenticated() → some(...) → checkIdentityType(...) → isSelf(...) → hasSubscription(...) は、ここに示したソース順で実行されます。正確な呼び出し: isAuthenticated(), some( checkIdentityType(['admin']), hasSubscription(['params', 'requestQuery', 'channelId']), isSelf(['params', 'requestQuery', 'senderId']) ),.
リクエスト: findChatMessagesSchema はクエリパラメータを検証します: 必須: channelId; 省略可能なメッセージフィルターおよびページネーション。
パイプライン: findChatMessages.
成功: 正規化されたメッセージとページネーションメタデータを含む 200 を返します。
失敗: 認証および認可の失敗は、ハンドラーパイプラインの前にリンク先のバリデーターに従います。このルートは、ソースに示される次のマッピングを使用します: ChatMessageNotFoundBlockError → 404, FileStorageServiceError → 500, ChatMessageBlockError → 500。完全なソースを表示
getChatMessageRoute
実装
エンドポイント: GET /messages/:messageId
アクセス: isAuthenticated() → some(...) → checkIdentityType(...) → ownsMessage(...) は、ここに示したソース順で実行されます。正確な呼び出し: isAuthenticated(), some( checkIdentityType(['admin']), ownsMessage(['params', 'requestParams', 'messageId']) ),.
リクエスト: getChatMessageSchema はパスパラメータを検証します: 必須: messageId.
パイプライン: getChatMessageById → normalizeChatMessage → orThrow.
成功: 正規化されたメッセージを含む 200 を返します。
失敗: 認証および認可の失敗は、ハンドラーパイプラインの前にリンク先のバリデーターに従います。このルートは、ソースに示される次のマッピングを使用します: ChatMessageNotFoundBlockError → 404, FileStorageServiceError → 500, ChatMessageBlockError → 500。完全なソースを表示
updateChatMessageRoute
実装
エンドポイント: PATCH /messages/:messageId
アクセス: isAuthenticated() → ownsMessage(...) は、ここに示したソース順で実行されます。正確な呼び出し: isAuthenticated(), ownsMessage(['params', 'requestParams', 'messageId']),.
リクエスト: updateChatMessageSchema はパスパラメータおよび application/json 本文を検証します: 必須: messageId。省略可能: content, senderId, および title.
パイプライン: updateChatMessage → getChatMessageById.
成功: 更新済みで正規化されたメッセージを含む 200 を返します。
失敗: 認証および認可の失敗は、ハンドラーパイプラインの前にリンク先のバリデーターに従います。このルートは、ソースに示される次のマッピングを使用します: ChatMessageNotFoundBlockError → 404, FileStorageServiceError → 500, ChatMessageBlockError → 500。完全なソースを表示
deleteChatMessageRoute
実装
エンドポイント: DELETE /messages/:messageId
アクセス: isAuthenticated() → some(...) → checkIdentityType(...) → ownsMessage(...) は、ここに示したソース順で実行されます。正確な呼び出し: isAuthenticated(), some( checkIdentityType(['admin']), ownsMessage(['params', 'requestParams', 'messageId']) ),.
リクエスト: deleteChatMessageSchema はパスパラメータを検証します: 必須: messageId.
パイプライン: deleteChatMessage → deleteChatMessageTerminator.
成功: 空の 204 レスポンス。
失敗: 認証および認可の失敗は、ハンドラーパイプラインの前にリンク先のバリデーターに従います。パイプラインの失敗は、リンク先のハンドラー/ブロック契約と共通エラーミドルウェアに従います。このルートは個別のインラインエラーマッピングを追加しません。完全なソースを表示
getChatMessageAttachmentUploadUrlRoute
実装
エンドポイント: GET /messages/:messageId/attachment-upload-url
アクセス: isAuthenticated() → ownsMessage(...) は、ここに示したソース順で実行されます。正確な呼び出し: isAuthenticated(), ownsMessage(['params', 'requestParams', 'messageId']),.
リクエスト: 共有の getSignedFileUploadUrlSchema はパス messageId と署名付きファイルアップロードリクエストの契約を検証します。
パイプライン: generateChatMessageAttachmentUploadUrl → orThrow.
成功: { objectId, url } を含む 200 を返します。
失敗: 認証および認可の失敗は、ハンドラーパイプラインの前にリンク先のバリデーターに従います。このルートは、ソースに示される次のマッピングを使用します: FileStorageServiceError → 500, ChatMessageBlockError → 500。完全なソースを表示
streamChatMessagesRoute
実装
エンドポイント: ws /messages/listen
アクセス: 有効なバリデーターはありません。ソースでは isAuthenticated() および hasSubscription(...) がコメントアウトされているため、現在の WebSocket エンドポイントでは Bearer/cookie 認証またはチャンネルメンバーシップは強制されません。
リクエスト: streamChatMessagesSchema はクエリパラメータを検証します: 必須: channelId.
パイプライン: streamChatMessages → normalizeChatMessageStream → orThrow により WebSocket Subject を生成します。
成功: 正規化された挿入メッセージを発行し、各値を JSON としてシリアライズする WebSocket Subject。
失敗: アクセスバリデーターは実行されません。パイプラインのマッピングは ChatMessageBadRequestError → 400, ChatMessageUnknownError → 500 です。Subject/データベースの失敗によって WebSocket ストリームが終了することもあります。完全なソースを表示
createChatMessageAttachmentRoute
実装
エンドポイント: POST /messages/:messageId/attachments
アクセス: isAuthenticated() → ownsMessage(...) は、ここに示したソース順で実行されます。正確な呼び出し: isAuthenticated(), ownsMessage(['params', 'requestParams', 'messageId']),.
リクエスト: createChatMessageAttachmentSchema は application/json 本文を検証します: 必須: UUID の objectId および 文字列の type.
パイプライン: createChatMessageAttachment → getChatMessageAttachmentById → normalizeChatMessageAttachment → orThrow.
成功: 正規化された添付ファイル { type, url } を含む 201 を返します。
失敗: 認証および認可の失敗は、ハンドラーパイプラインの前にリンク先のバリデーターに従います。このルートは、ソースに示される次のマッピングを使用します: ChatMessageNotFoundBlockError → 404, ChatMessageAttachmentNotFoundBlockError → 404, ChatMessageUnexpectedDBError → 500。完全なソースを表示
deleteChatMessageAttachmentRoute
実装
エンドポイント: DELETE /messages/:messageId/attachments/:attachmentId
アクセス: isAuthenticated() → some(...) → checkIdentityType(...) → ownsMessage(...) は、ここに示したソース順で実行されます。正確な呼び出し: isAuthenticated(), some( checkIdentityType(['admin']), ownsMessage(['params', 'requestParams', 'messageId']) ),.
リクエスト: deleteChatMessageAttachmentSchema はパスパラメータを検証します: 必須: messageId および attachmentId.
パイプライン: deleteChatMessageAttachment → orThrow.
成功: メタデータおよび保存済みファイルを削除した後、空の 204 レスポンスを返します。
失敗: 認証および認可の失敗は、ハンドラーパイプラインの前にリンク先のバリデーターに従います。このルートは、ソースに示される次のマッピングを使用します: ChatMessageNotFoundBlockError → 404, ChatMessageAttachmentNotFoundBlockError → 404, ChatMessageUnexpectedDBError → 500, ChatMessageBlockError → 500, FileStorageServiceError → 500。完全なソースを表示
createChatMessageTemplateRoute
実装
エンドポイント: POST /message-templates
アクセス: isAuthenticated() → some(...) → checkIdentityType(...) → hasOrgRole(...) は、ここに示したソース順で実行されます。正確な呼び出し: isAuthenticated(), some( checkIdentityType(['admin']), hasOrgRole( ['owner', 'admin'], ['params', 'requestBody', 'organizationId'] ) ),.
リクエスト: createChatMessageTemplateSchema は application/json 本文を検証します: 必須: content および title。省略可能: organizationId.
パイプライン: createChatMessageTemplate → getChatMessageTemplateById → orThrow.
成功: MongoDB の _id を除外した作成済みテンプレートを含む 201 を返します。
失敗: 認証および認可の失敗は、ハンドラーパイプラインの前にリンク先のバリデーターに従います。このルートは、ソースに示される次のマッピングを使用します: ChatMessageTemplateNotFoundError → 404, ChatMessageTemplateInternalError → 500, ChatMessageTemplateDbError → 500。完全なソースを表示
getChatMessageTemplateRoute
実装
エンドポイント: GET /message-templates/:messageTemplateId
アクセス: isAuthenticated() → some(...) → checkIdentityType(...) → hasOrganizationAccessToMessageTemplate(...) は、ここに示したソース順で実行されます。正確な呼び出し: isAuthenticated(), some( checkIdentityType(['admin']), hasOrganizationAccessToMessageTemplate( ['owner', 'admin'], ['params', 'requestParams', 'messageTemplateId'] ) ),.
リクエスト: getChatMessageTemplateSchema はパスパラメータを検証します: 必須: messageTemplateId.
パイプライン: getChatMessageTemplateById → orThrow.
成功: MongoDB の _id を除外したテンプレートを含む 200 を返します。
失敗: 認証および認可の失敗は、ハンドラーパイプラインの前にリンク先のバリデーターに従います。このルートは、ソースに示される次のマッピングを使用します: ChatMessageTemplateNotFoundError → 404, ChatMessageTemplateUnauthorizedError → 403, ChatMessageTemplateInternalError → 500, ChatMessageTemplateDbError → 500。完全なソースを表示
updateChatMessageTemplateRoute
実装
エンドポイント: PATCH /message-templates/:messageTemplateId
アクセス: isAuthenticated() → some(...) → checkIdentityType(...) → hasOrganizationAccessToMessageTemplate(...) は、ここに示したソース順で実行されます。正確な呼び出し: isAuthenticated(), some( checkIdentityType(['admin']), hasOrganizationAccessToMessageTemplate( ['owner', 'admin'], ['params', 'requestParams', 'messageTemplateId'] ) ),.
リクエスト: updateChatMessageTemplateSchema はパスパラメータおよび application/json 本文を検証します: 必須: テンプレート ID。省略可能: content および title.
パイプライン: updateChatMessageTemplate → getChatMessageTemplateById → orThrow.
成功: MongoDB の _id を除外した更新済みテンプレートを含む 200 を返します。
失敗: 認証および認可の失敗は、ハンドラーパイプラインの前にリンク先のバリデーターに従います。このルートは、ソースに示される次のマッピングを使用します: ChatMessageTemplateNotFoundError → 404, ChatMessageTemplateUnauthorizedError → 403, ChatMessageTemplateInternalError → 500, ChatMessageTemplateDbError → 500。完全なソースを表示
deleteChatMessageTemplateRoute
実装
エンドポイント: DELETE /message-templates/:messageTemplateId
アクセス: isAuthenticated() → some(...) → checkIdentityType(...) → hasOrganizationAccessToMessageTemplate(...) は、ここに示したソース順で実行されます。正確な呼び出し: isAuthenticated(), some( checkIdentityType(['admin']), hasOrganizationAccessToMessageTemplate( ['owner', 'admin'], ['params', 'requestParams', 'messageTemplateId'] ) ),.
リクエスト: deleteChatMessageTemplateSchema はパスパラメータを検証します: 必須: messageTemplateId.
パイプライン: deleteChatMessageTemplate → orThrow.
成功: 空の 204 レスポンス。
失敗: 認証および認可の失敗は、ハンドラーパイプラインの前にリンク先のバリデーターに従います。このルートは、ソースに示される次のマッピングを使用します: ChatMessageTemplateNotFoundError → 404, ChatMessageTemplateUnauthorizedError → 403, ChatMessageTemplateInternalError → 500, ChatMessageTemplateDbError → 500。完全なソースを表示
findChatMessageTemplatesRoute
実装
エンドポイント: GET /message-templates
アクセス: isAuthenticated() → checkIdentityType(...) は、ここに示したソース順で実行されます。正確な呼び出し: isAuthenticated(), checkIdentityType(['admin']).
リクエスト: findChatMessageTemplatesSchema はクエリパラメータを検証します: 共通のページネーションフィールドのみ。
パイプライン: findChatMessageTemplates → ページネーション → 共通の normalizeDocuments → orThrow.
成功: 正規化されたテンプレートとページネーションメタデータを含む 200 を返します。
失敗: 認証および認可の失敗は、ハンドラーパイプラインの前にリンク先のバリデーターに従います。このルートは、ソースに示される次のマッピングを使用します: ChatMessageTemplateNotFoundError → 404, ChatMessageTemplateUnauthorizedError → 403, ChatMessageTemplateInternalError → 500, ChatMessageTemplateDbError → 500。完全なソースを表示
findChatMessageTemplatesForOrganizationRoute
実装
エンドポイント: GET /organizations/:organizationId/message-templates
アクセス: isAuthenticated() → hasOrgRole(...) は、ここに示したソース順で実行されます。正確な呼び出し: isAuthenticated(), hasOrgRole( ['owner', 'admin'], ['params', 'requestParams', 'organizationId'] ),.
リクエスト: findChatMessageTemplatesForOrganizationSchema はパスおよびクエリパラメータを検証します: 必須: organizationId および共通ページネーションフィールド。
パイプライン: buildFilterToGetChatMessageTemplatesByOrganizationId → findChatMessageTemplates → ページネーション → 共通の normalizeDocuments → orThrow.
成功: パスで指定された組織の正規化済みテンプレートとページネーションメタデータを含む 200 を返します。
失敗: 認証および認可の失敗は、ハンドラーパイプラインの前にリンク先のバリデーターに従います。このルートは、ソースに示される次のマッピングを使用します: ChatMessageTemplateNotFoundError → 404, ChatMessageTemplateUnauthorizedError → 403, ChatMessageTemplateInternalError → 500, ChatMessageTemplateDbError → 500。完全なソースを表示
upsertChatChannelReadStateRoute
実装
エンドポイント: PUT /channels/:channelId/read-state
アクセス: isAuthenticated() → isSelf(...) → hasSubscription(...) → channelExists(...) は、ここに示したソース順で実行されます。正確な呼び出し: isAuthenticated(), channelExists(['params', 'requestParams', 'channelId']), hasSubscription(['params', 'requestParams', 'channelId']), isSelf(['params', 'requestBody', 'identityId']),.
リクエスト: upsertChatChannelReadStateSchema はパスパラメータおよび application/json 本文を検証します: 必須: channelId, identityId, および lastReadMessageId.
パイプライン: findChatMessages.
成功: 空の 204 レスポンス既読状態を作成または更新した後、空の 204 レスポンスを返します。
失敗: 認証および認可の失敗は、ハンドラーパイプラインの前にリンク先のバリデーターに従います。このルートは、ソースに示される次のマッピングを使用します: ChatChannelReadStateNotFoundError → 404, ChatChannelReadStateDatabaseError → 500, ChatChannelReadStateUnknownError → 500。完全なソースを表示
createChatSubscriptionRoute
実装
エンドポイント: POST /subscriptions
アクセス: isAuthenticated() → some(...) → checkIdentityType(...) → isSelf(...) は、ここに示したソース順で実行されます。正確な呼び出し: isAuthenticated(), some( checkIdentityType(['admin']), isSelf(['params', 'requestBody', 'subscribedId']) ),.
リクエスト: createChatSubscriptionSchema は application/json 本文を検証します: 必須: channelId および subscribedId; その他のサブスクリプションフィールドは省略可能です。
パイプライン: createChatSubscription → getChatSubscriptionById → createChatSubscriptionTerminator.
成功: レスポンス記述子の data に作成済みサブスクリプションを含む 201 を返します。
失敗: 認証および認可の失敗は、ハンドラーパイプラインの前にリンク先のバリデーターに従います。パイプラインの失敗は、リンク先のハンドラー/ブロック契約と共通エラーミドルウェアに従います。このルートは個別のインラインエラーマッピングを追加しません。完全なソースを表示
findChatSubscriptionsRoute
実装
エンドポイント: GET /subscriptions
アクセス: isAuthenticated() → some(...) → checkIdentityType(...) → isSelf(...) → ownsChannel(...) → hasSubscription(...) は、ここに示したソース順で実行されます。正確な呼び出し: isAuthenticated(), some( checkIdentityType(['admin']), hasSubscription(['params', 'requestQuery', 'channelId']), ownsChannel(['params', 'requestQuery', 'channelId']), isSelf(['params', 'requestQuery', 'subscribedId']) ),.
リクエスト: findChatSubscriptionsSchema はクエリパラメータを検証します: 省略可能: subscription filters および共通ページネーションフィールド。
パイプライン: findChatSubscriptions → normalizeChatSubscriptionsListTerminator.
成功: 200正規化されたサブスクリプションとページネーションメタデータを含む 200 を返します。
失敗: 認証および認可の失敗は、ハンドラーパイプラインの前にリンク先のバリデーターに従います。パイプラインの失敗は、リンク先のハンドラー/ブロック契約と共通エラーミドルウェアに従います。このルートは個別のインラインエラーマッピングを追加しません。完全なソースを表示
getChatSubscriptionRoute
実装
エンドポイント: GET /subscriptions/:subscriptionId
アクセス: isAuthenticated() → some(...) → checkIdentityType(...) → ownsSubscription(...) は、ここに示したソース順で実行されます。正確な呼び出し: isAuthenticated(), some( checkIdentityType(['admin']), ownsSubscription(['params', 'requestParams', 'subscriptionId']) ),.
リクエスト: getChatSubscriptionSchema はパスパラメータを検証します: 必須: subscriptionId.
パイプライン: getChatSubscriptionById → normalizeChatSubscriptionTerminator.
成功: MongoDB の _id を除外したサブスクリプションを含む 200 を返します。
失敗: 認証および認可の失敗は、ハンドラーパイプラインの前にリンク先のバリデーターに従います。パイプラインの失敗は、リンク先のハンドラー/ブロック契約と共通エラーミドルウェアに従います。このルートは個別のインラインエラーマッピングを追加しません。完全なソースを表示
deleteChatSubscriptionRoute
実装
エンドポイント: DELETE /subscriptions/:subscriptionId
アクセス: isAuthenticated() → some(...) → checkIdentityType(...) → ownsSubscription(...) は、ここに示したソース順で実行されます。正確な呼び出し: isAuthenticated(), some( checkIdentityType(['admin']), ownsSubscription(['params', 'requestParams', 'subscriptionId']) ),.
リクエスト: deleteChatSubscriptionSchema はパスパラメータを検証します: 必須: subscriptionId.
パイプライン: deleteChatSubscription → deleteChatSubscriptionTerminator.
成功: 空の 204 レスポンス。
失敗: 認証および認可の失敗は、ハンドラーパイプラインの前にリンク先のバリデーターに従います。パイプラインの失敗は、リンク先のハンドラー/ブロック契約と共通エラーミドルウェアに従います。このルートは個別のインラインエラーマッピングを追加しません。完全なソースを表示