メインコンテンツまでスキップ
バージョン: 0.14.0 (以前)

📐 チャットスキーマ

スキーマは公開されるチャットリクエストの契約を定義します。各ソースエクスポートには、フィールドレベルの要約と完全なソース定義があります。フィールド表では、Body はエクスポートされたスキーマが宣言する application/json リクエスト本文を意味します。

一覧​

エクスポートリクエストの場所契約
channelIdPathParameterパス必須の文字列 channelId。
ChatChannelIcon該当なし保存されるアイコンメタデータ: objectId および MIME type。
channelIdQueryParameterクエリ必須の文字列 channelId。
chatChannelSchema該当なし省略可能な name, ownerId, および null 許容の icon。
createChatChannelSchema本文必須: name および ownerId。省略可能な null 許容アイコン。
updateChatChannelSchemaパス、本文必須: channelId。本文では省略可能な name および null 許容の icon。
getChatChannelSchemaパス必須: channelId。
deleteChatChannelSchemaパス必須: channelId。
findChatChannelsSchemaクエリ省略可能: name, ownerId, および 共通ページネーションフィールド。
getChannelMessagesSchemaパス、クエリ必須: channelId および 省略可能な共通ページネーションフィールド。
chatMessageSchema該当なし省略可能な content, senderId, および title。
createChatMessageAttachmentSchema本文必須の UUID objectId および 文字列の type。
ChatMessageAttachment該当なし保存される添付ファイルメタデータ: objectId および type。
NormalizedChatMessageAttachment該当なし公開添付ファイル形式: 署名付き url および type。
createChatMessageSchema本文必須: content, senderId, および channelId。省略可能: title。
updateChatMessageSchemaパス、本文必須: messageId。省略可能: content, senderId, および title。
getChatMessageSchemaパス必須: messageId。
deleteChatMessageSchemaパス必須: messageId。
findChatMessagesSchemaクエリ必須: channelId。省略可能: メッセージフィルター および ページネーション。
deleteChatMessageAttachmentSchemaパス必須: messageId および attachmentId。
streamChatMessagesSchemaクエリ必須: channelId。
chatMessageTemplateSchema該当なし省略可能な 文字列の content および title。
createChatMessageTemplateSchema本文必須: content および title。省略可能: organizationId。
getChatMessageTemplateSchemaパス必須: messageTemplateId。
updateChatMessageTemplateSchemaパス、本文必須: テンプレート ID。省略可能: content および title。
deleteChatMessageTemplateSchemaパス必須: messageTemplateId。
findChatMessageTemplatesSchemaクエリ共通のページネーションフィールドのみ。
findChatMessageTemplatesForOrganizationSchemaパス、クエリ必須: organizationId および 共通ページネーションフィールド。
chatChannelReadStateSchema該当なし以下を含む閉じたオブジェクト: identityId および lastReadMessageId フィールド。
upsertChatChannelReadStateSchemaパス、本文必須: channelId, identityId, および lastReadMessageId。
chatSubscriptionSchema該当なし以下を含む閉じたサブスクリプションオブジェクト: 承認、チャンネル、権限、時刻、およびアイデンティティフィールド。
createChatSubscriptionSchema本文必須: channelId および subscribedId。その他のサブスクリプションフィールドは省略可能です。
getChatSubscriptionSchemaパス必須: subscriptionId。
deleteChatSubscriptionSchemaパス必須: subscriptionId。
findChatSubscriptionsSchemaクエリ省略可能: サブスクリプションフィルター および 共通ページネーションフィールド。

詳細​

channelIdPathParameter​

定義

必須の文字列 channelId。

場所フィールド型必須制約
パスchannelId文字列。はい—

ルートでの使用: getChatChannelRoute, updateChatChannelRoute, deleteChatChannelRoute, getChannelMessagesRoute, および upsertChatChannelReadStateRoute。機能での使用: getChannelFeature, updateChannelFeature, deleteChannelFeature, getChannelMessagesFeature, および upsertChatChannelReadStateFeature。

完全なソースを表示
export const channelIdPathParameter: OpenAPIParameter = {
in: 'path',
name: 'channelId',
required: true,
schema: {
type: 'string',
},
};

const iconSchema: SchemaDefinition = {
additionalProperties: false,
properties: {
objectId: {format: 'uuid', type: 'string'},
type: {type: 'string'},
},
required: ['objectId', 'type'],
type: 'object',
};

ChatChannelIcon​

定義

保存されるアイコンメタデータ: objectId および MIME type。

場所フィールド型必須制約
該当なしobjectId文字列。リクエストスキーマでは UUID 形式が必要です。はい—
該当なしtype通常は MIME タイプの文字列。はい—

ルートでの使用: 対応する JSON Schema は createChatChannelRoute および updateChatChannelRoute。機能での使用: createChannelFeature および updateChannelFeature。

完全なソースを表示
export type ChatChannelIcon = {
objectId: string;
type: string;
};

channelIdQueryParameter​

定義

必須の文字列 channelId。

場所フィールド型必須制約
クエリchannelId文字列。はい—

ルートでの使用: streamChatMessagesRoute。機能での使用: streamChatMessagesFeature。

完全なソースを表示
export const channelIdQueryParameter: OpenAPIParameter = {
in: 'query',
name: 'channelId',
required: true,
schema: {
type: 'string',
},
};

chatChannelSchema​

定義

省略可能な name, ownerId, および null 許容の icon。

場所フィールド型必須制約
該当なしiconnull または閉じた { objectId: UUID string, type: string }。いいえ—
該当なしname文字列。いいえ—
該当なしownerId文字列。いいえ—

ルートでの使用: chatChannelSchema は createChatChannelSchema に展開されます。機能での使用: createChannelFeature。更新スキーマでは許可された更新サブセットが複製されます。

完全なソースを表示
export const chatChannelSchema: SchemaDefinition = {
$schema: 'http://json-schema.org/draft-07/schema#',
additionalProperties: false,
properties: {
icon: {
oneOf: [iconSchema, {type: 'null'}],
},
name: {type: 'string'},
ownerId: {type: 'string'},
},
type: 'object',
};

createChatChannelSchema​

定義

必須: name および ownerId。省略可能な null 許容アイコン。

場所フィールド型必須制約
本文name文字列。はい—
本文ownerId文字列。はい—
本文iconnull または閉じた { objectId: UUID string, type: string }。いいえ—

ルートでの使用: createChatChannelRoute (createChannelFeature 経由)。

機能での使用: createChannelFeature

完全なソースを表示
export const createChatChannelSchema = withSchema({
requestBody: {
content: {
'application/json': {
schema: {
...chatChannelSchema,
required: ['name', 'ownerId'],
},
},
},
required: true,
},
});

updateChatChannelSchema​

定義

必須: channelId。本文では省略可能な name および null 許容の icon。

場所フィールド型必須制約
パスchannelId文字列。はい—
本文name文字列。いいえ—
本文iconnull または閉じた { objectId: UUID string, type: string }。いいえ—

ルートでの使用: updateChatChannelRoute (経由: updateChannelFeature

機能での使用: updateChannelFeature

完全なソースを表示
export const updateChatChannelSchema = withSchema({
parameters: [{...channelIdPathParameter}],
requestBody: {
content: {
'application/json': {
schema: {
additionalProperties: false,
properties: {
icon: {
oneOf: [iconSchema, {type: 'null'}],
},
name: {type: 'string'},
},
required: [],
type: 'object',
},
},
},
required: true,
},
});

getChatChannelSchema​

定義

必須: channelId。

場所フィールド型必須制約
パスchannelId文字列。はい—

ルートでの使用: getChatChannelRoute (経由: getChannelFeature

機能での使用: getChannelFeature

完全なソースを表示
export const getChatChannelSchema = withSchema({
parameters: [{...channelIdPathParameter}],
});

deleteChatChannelSchema​

定義

必須: channelId。

場所フィールド型必須制約
パスchannelId文字列。はい—

ルートでの使用: deleteChatChannelRoute (経由: deleteChannelFeature

機能での使用: deleteChannelFeature

完全なソースを表示
export const deleteChatChannelSchema = withSchema({
parameters: [{...channelIdPathParameter}],
});

findChatChannelsSchema​

定義

省略可能: name, ownerId, および 共通ページネーションフィールド。

場所フィールド型必須制約
クエリnameString filter。いいえ—
クエリownerIdString filter。いいえ—
クエリ共通ページネーションフィールド参照: paginationQueryParametersSchema。いいえ—

ルートでの使用: findChatChannelsRoute (経由: findChannelsFeature

機能での使用: findChannelsFeature

完全なソースを表示
export const findChatChannelsSchema = withSchema({
parameters: [
{
in: 'query',
name: 'name',
required: false,
schema: {
type: 'string',
},
},
{
in: 'query',
name: 'ownerId',
required: false,
schema: {
type: 'string',
},
},
...paginationQueryParametersSchema,
],
});

getChannelMessagesSchema​

定義

必須: channelId および 省略可能な共通ページネーションフィールド。

場所フィールド型必須制約
パスchannelId文字列。はい—
クエリ共通ページネーションフィールド参照: paginationQueryParametersSchema。いいえ—

ルートでの使用: getChannelMessagesRoute (経由: getChannelMessagesFeature

機能での使用: getChannelMessagesFeature

完全なソースを表示
export const getChannelMessagesSchema = withSchema({
parameters: [channelIdPathParameter, ...paginationQueryParametersSchema],
});

chatMessageSchema​

定義

省略可能な content, senderId, および title。

場所フィールド型必須制約
該当なしcontent文字列。いいえ—
該当なしsenderId文字列。いいえ—
該当なしtitle文字列。いいえ—

ルートでの使用: chatMessageSchema は createChatMessageSchema および updateChatMessageSchema に展開されます。機能での使用: createChatMessageFeature および updateChatMessageFeature。

完全なソースを表示
export const chatMessageSchema = {
$schema: 'http://json-schema.org/draft-07/schema#',
additionalProperties: false,
properties: {
content: {type: 'string'},
senderId: {type: 'string'},
title: {type: 'string'},
},
type: 'object',
} as const satisfies SchemaDefinition;

createChatMessageAttachmentSchema​

定義

必須の UUID objectId および 文字列の type。

場所フィールド型必須制約
本文objectIdUUID-formatted string。はい—
本文type文字列。はい—

ルートでの使用: createChatMessageAttachmentRoute (経由: createChatMessageAttachmentFeature

機能での使用: createChatMessageAttachmentFeature

完全なソースを表示
export const createChatMessageAttachmentSchema = withSchema({
requestBody: {
content: {
'application/json': {
schema: {
...chatMessageAttachmentSchema,
required: ['objectId', 'type'],
},
},
},
required: true,
},
});

ChatMessageAttachment​

定義

保存される添付ファイルメタデータ: objectId および type。

場所フィールド型必須制約
該当なしobjectId文字列。はい—
該当なしtype文字列。はい—

ルートでの使用: createChatMessageAttachmentRoute persists this shape。message create/get/list/update routes consume it during normalization, および deleteChatMessageAttachmentRoute removes it。機能での使用: createChatMessageAttachmentFeature。

完全なソースを表示
export type ChatMessageAttachment = {
objectId: string;
type: string;
};

NormalizedChatMessageAttachment​

定義

公開添付ファイル形式: 署名付き url および type。

場所フィールド型必須制約
該当なしurl署名付きダウンロード URL 文字列。はい—
該当なしtype文字列。はい—

ルートでの使用: createChatMessageRoute, getChatMessageRoute, findChatMessagesRoute, updateChatMessageRoute, および createChatMessageAttachmentRoute expose this normalized shape。機能での使用: createChatMessageFeature, getChatMessageFeature, findChatMessagesFeature, updateChatMessageFeature, および createChatMessageAttachmentFeature。

完全なソースを表示
export type NormalizedChatMessageAttachment = {
url: string;
type: string;
};

createChatMessageSchema​

定義

必須: content, senderId, および channelId。省略可能: title。

場所フィールド型必須制約
本文content文字列。はい—
本文senderId文字列。はい—
本文channelId文字列。はい—
本文title文字列。いいえ—

ルートでの使用: createChatMessageRoute (経由: createChatMessageFeature

機能での使用: createChatMessageFeature

完全なソースを表示
export const createChatMessageSchema = withSchema({
requestBody: {
content: {
'application/json': {
schema: {
...chatMessageSchema,
properties: {
...chatMessageSchema.properties,
channelId: {type: 'string'},
},
required: ['content', 'senderId', 'channelId'],
},
},
},
required: true,
},
});

updateChatMessageSchema​

定義

必須: messageId。省略可能: content, senderId, および title。

場所フィールド型必須制約
パスmessageId文字列。はい—
本文content文字列。いいえ—
本文senderId文字列。いいえ—
本文title文字列。いいえ—

ルートでの使用: updateChatMessageRoute (経由: updateChatMessageFeature

機能での使用: updateChatMessageFeature

完全なソースを表示
export const updateChatMessageSchema = withSchema({
parameters: [{...messageIdPathParameter}],
requestBody: {
content: {
'application/json': {
schema: {
...chatMessageSchema,
required: [],
},
},
},
required: true,
},
});

getChatMessageSchema​

定義

必須: messageId。

場所フィールド型必須制約
パスmessageId文字列。はい—

ルートでの使用: getChatMessageRoute (経由: getChatMessageFeature

機能での使用: getChatMessageFeature

完全なソースを表示
export const getChatMessageSchema = withSchema({
parameters: [{...messageIdPathParameter}],
});

deleteChatMessageSchema​

定義

必須: messageId。

場所フィールド型必須制約
パスmessageId文字列。はい—

ルートでの使用: deleteChatMessageRoute (経由: deleteChatMessageFeature

機能での使用: deleteChatMessageFeature

完全なソースを表示
export const deleteChatMessageSchema = withSchema({
parameters: [{...messageIdPathParameter}],
});

findChatMessagesSchema​

定義

必須: channelId。省略可能: メッセージフィルター および ページネーション。

場所フィールド型必須制約
クエリchannelId文字列。はい—
クエリcontentString filter。いいえ—
クエリsenderIdString filter。いいえ—
クエリtitleString filter。いいえ—
クエリ共通ページネーションフィールド参照: paginationQueryParametersSchema。いいえ—

ルートでの使用: findChatMessagesRoute (経由: findChatMessagesFeature

機能での使用: findChatMessagesFeature

完全なソースを表示
export const findChatMessagesSchema = withSchema({
parameters: [
{
in: 'query',
name: 'channelId',
required: true,
schema: {
type: 'string',
},
},
{
in: 'query',
name: 'content',
required: false,
schema: {
type: 'string',
},
},
{
in: 'query',
name: 'senderId',
required: false,
schema: {
type: 'string',
},
},
{
in: 'query',
name: 'title',
required: false,
schema: {
type: 'string',
},
},
...paginationQueryParametersSchema,
],
});

deleteChatMessageAttachmentSchema​

定義

必須: messageId および attachmentId。

場所フィールド型必須制約
パスmessageId文字列。はい—
パスattachmentId文字列。はい—

ルートでの使用: deleteChatMessageAttachmentRoute (経由: deleteChatMessageAttachmentFeature

機能での使用: deleteChatMessageAttachmentFeature

完全なソースを表示
export const deleteChatMessageAttachmentSchema = withSchema({
parameters: [{...messageIdPathParameter}, {...attachmentIdPathParameter}],
});

streamChatMessagesSchema​

定義

必須: channelId。

場所フィールド型必須制約
クエリchannelId文字列。はい—

ルートでの使用: streamChatMessagesRoute (経由: streamChatMessagesFeature

機能での使用: streamChatMessagesFeature

完全なソースを表示
export const streamChatMessagesSchema = withSchema({
parameters: [channelIdQueryParameter],
});

chatMessageTemplateSchema​

定義

省略可能な 文字列の content および title。

場所フィールド型必須制約
該当なしcontent文字列。いいえ—
該当なしtitle文字列。いいえ—

ルートでの使用: chatMessageTemplateSchema は createChatMessageTemplateSchema および updateChatMessageTemplateSchema に展開されます。機能での使用: createChatMessageTemplateFeature および updateChatMessageTemplateFeature。

完全なソースを表示
export const chatMessageTemplateSchema: SchemaDefinition = {
$schema: 'http://json-schema.org/draft-07/schema#',
additionalProperties: false,
properties: {
content: {type: 'string'},
title: {type: 'string'},
},
type: 'object',
};

createChatMessageTemplateSchema​

定義

必須: content および title。省略可能: organizationId。

場所フィールド型必須制約
本文content文字列。はい—
本文title文字列。はい—
本文organizationId文字列。いいえ—

ルートでの使用: createChatMessageTemplateRoute (経由: createChatMessageTemplateFeature

機能での使用: createChatMessageTemplateFeature

完全なソースを表示
export const createChatMessageTemplateSchema = withSchema({
requestBody: {
content: {
'application/json': {
schema: {
...chatMessageTemplateSchema,
properties: {
...chatMessageTemplateSchema.properties,
organizationId: {type: 'string'},
},
required: ['content', 'title'],
},
},
},
required: true,
},
});

getChatMessageTemplateSchema​

定義

必須: messageTemplateId。

場所フィールド型必須制約
パスmessageTemplateId文字列。はい—

ルートでの使用: getChatMessageTemplateRoute (経由: getChatMessageTemplateFeature

機能での使用: getChatMessageTemplateFeature

完全なソースを表示
export const getChatMessageTemplateSchema = withSchema({
parameters: [messageTemplateIdPathParameter],
});

updateChatMessageTemplateSchema​

定義

必須: テンプレート ID。省略可能: content および title。

場所フィールド型必須制約
パスmessageTemplateId文字列。はい—
本文content文字列。いいえ—
本文title文字列。いいえ—

ルートでの使用: updateChatMessageTemplateRoute (経由: updateChatMessageTemplateFeature

機能での使用: updateChatMessageTemplateFeature

完全なソースを表示
export const updateChatMessageTemplateSchema = withSchema({
parameters: [messageTemplateIdPathParameter],
requestBody: {
content: {
'application/json': {
schema: {
...chatMessageTemplateSchema,
required: [],
},
},
},
required: true,
},
});

deleteChatMessageTemplateSchema​

定義

必須: messageTemplateId。

場所フィールド型必須制約
パスmessageTemplateId文字列。はい—

ルートでの使用: deleteChatMessageTemplateRoute (経由: deleteChatMessageTemplateFeature

機能での使用: deleteChatMessageTemplateFeature

完全なソースを表示
export const deleteChatMessageTemplateSchema = withSchema({
parameters: [messageTemplateIdPathParameter],
});

findChatMessageTemplatesSchema​

定義

共通のページネーションフィールドのみ。

場所フィールド型必須制約
クエリ共通ページネーションフィールド参照: paginationQueryParametersSchema。いいえ—

ルートでの使用: findChatMessageTemplatesRoute (経由: findChatMessageTemplatesFeature

機能での使用: findChatMessageTemplatesFeature

完全なソースを表示
export const findChatMessageTemplatesSchema = withSchema({
parameters: [...paginationQueryParametersSchema],
});

findChatMessageTemplatesForOrganizationSchema​

定義

必須: organizationId および 共通ページネーションフィールド。

場所フィールド型必須制約
クエリ共通ページネーションフィールド参照: paginationQueryParametersSchema。いいえ—
パスorganizationId文字列。はい—

ルートでの使用: findChatMessageTemplatesForOrganizationRoute (経由: findChatMessageTemplatesForOrganizationFeature

機能での使用: findChatMessageTemplatesForOrganizationFeature

完全なソースを表示
export const findChatMessageTemplatesForOrganizationSchema = withSchema({
parameters: [
...paginationQueryParametersSchema,
{
in: 'path',
name: 'organizationId',
required: true,
schema: {
type: 'string',
},
},
],
});

chatChannelReadStateSchema​

定義

以下を含む閉じたオブジェクト: identityId および lastReadMessageId フィールド。

場所フィールド型必須制約
該当なしidentityId文字列。リクエスト合成により必須になります。いいえ—
該当なしlastReadMessageId文字列。リクエスト合成により必須になります。いいえ—

ルートでの使用: chatChannelReadStateSchema は upsertChatChannelReadStateSchema に展開されます。機能での使用: upsertChatChannelReadStateFeature。

完全なソースを表示
export const chatChannelReadStateSchema: SchemaDefinition = {
$schema: 'http://json-schema.org/draft-07/schema#',
additionalProperties: false,
properties: {
identityId: {type: 'string'},
lastReadMessageId: {type: 'string'},
},
type: 'object',
};

upsertChatChannelReadStateSchema​

定義

必須: channelId, identityId, および lastReadMessageId。

場所フィールド型必須制約
パスchannelId文字列。はい—
本文identityId文字列。はい—
本文lastReadMessageId文字列。はい—

ルートでの使用: upsertChatChannelReadStateRoute (経由: upsertChatChannelReadStateFeature

機能での使用: upsertChatChannelReadStateFeature

完全なソースを表示
export const upsertChatChannelReadStateSchema = withSchema({
parameters: [{...channelIdPathParameter}],
requestBody: {
content: {
'application/json': {
schema: {
...chatChannelReadStateSchema,
required: ['identityId', 'lastReadMessageId'],
},
},
},
required: true,
},
});

chatSubscriptionSchema​

定義

以下を含む閉じたサブスクリプションオブジェクト: 承認、チャンネル、権限、時刻、およびアイデンティティフィールド。

場所フィールド型必須制約
該当なしapprovedBoolean。いいえ—
該当なしchannelId文字列。いいえ—
該当なしpermissions文字列の配列。いいえ—
該当なしsubscribedAt日時形式の文字列。いいえ—
該当なしsubscribedId文字列。いいえ—

ルートでの使用: chatSubscriptionSchema は createChatSubscriptionSchema に展開されます。機能での使用: createChatSubscriptionFeature。

完全なソースを表示
export const chatSubscriptionSchema: SchemaDefinition = {
$schema: 'http://json-schema.org/draft-07/schema#',
additionalProperties: false,
properties: {
approved: {type: 'boolean'},
channelId: {type: 'string'},
permissions: {items: {type: 'string'}, type: 'array'},
subscribedAt: {format: 'date-time', type: 'string'},
subscribedId: {type: 'string'},
},
type: 'object',
};

createChatSubscriptionSchema​

定義

必須: channelId および subscribedId。その他のサブスクリプションフィールドは省略可能です。

場所フィールド型必須制約
本文approvedBoolean。いいえ—
本文channelId文字列。はい—
本文permissions文字列の配列。いいえ—
本文subscribedAt日時形式の文字列。いいえ—
本文subscribedId文字列。はい—

ルートでの使用: createChatSubscriptionRoute (経由: createChatSubscriptionFeature

機能での使用: createChatSubscriptionFeature

完全なソースを表示
export const createChatSubscriptionSchema = withSchema({
requestBody: {
content: {
'application/json': {
schema: {
...chatSubscriptionSchema,
required: ['channelId', 'subscribedId'],
},
},
},
required: true,
},
});

getChatSubscriptionSchema​

定義

必須: subscriptionId。

場所フィールド型必須制約
パスsubscriptionId文字列。はい—

ルートでの使用: getChatSubscriptionRoute (経由: getChatSubscriptionFeature

機能での使用: getChatSubscriptionFeature

完全なソースを表示
export const getChatSubscriptionSchema = withSchema({
parameters: [{...subscriptionIdPathParameter}],
});

deleteChatSubscriptionSchema​

定義

必須: subscriptionId。

場所フィールド型必須制約
パスsubscriptionId文字列。はい—

ルートでの使用: deleteChatSubscriptionRoute (経由: deleteChatSubscriptionFeature

機能での使用: deleteChatSubscriptionFeature

完全なソースを表示
export const deleteChatSubscriptionSchema = withSchema({
parameters: [{...subscriptionIdPathParameter}],
});

findChatSubscriptionsSchema​

定義

省略可能: サブスクリプションフィルター および 共通ページネーションフィールド。

場所フィールド型必須制約
クエリapprovedBoolean filter。いいえ—
クエリchannelIdString filter。いいえ—
クエリsubscribedAt日時形式の文字列フィルター。いいえ—
クエリsubscribedIdString filter。いいえ—
クエリ共通ページネーションフィールド参照: paginationQueryParametersSchema。いいえ—

ルートでの使用: findChatSubscriptionsRoute (経由: findChatSubscriptionsFeature

機能での使用: findChatSubscriptionsFeature

完全なソースを表示
export const findChatSubscriptionsSchema = withSchema({
parameters: [
{
in: 'query',
name: 'approved',
required: false,
schema: {
type: 'boolean',
},
},
{
in: 'query',
name: 'channelId',
required: false,
schema: {
type: 'string',
},
},
{
in: 'query',
name: 'subscribedAt',
required: false,
schema: {
format: 'date-time',
type: 'string',
},
},
{
in: 'query',
name: 'subscribedId',
required: false,
schema: {
type: 'string',
},
},
...paginationQueryParametersSchema,
],
});