JavaScript SDK: 通知リファレンス
通知を送信および管理するためのすべてのメソッドとその署名。
6 分 読み取り·レベル 参照·2026/10/12 に改訂
この英語のテキストはフランス語のオリジナルから自動的に生成されたもので、まだレビューされていません。
このページは自動翻訳されました。英語版が正式です。
#
クラス
通知サービス
| プロパティ | 説明 |
|---|---|
readonly admin: NotificationsAdminService | 管理サブクライアント: 統計、キュー、スクラップ (DLQ)、サプライヤー ログ、イベント、ルール、設定。 |
| 方法 | 説明 |
|---|---|
send(options: SendNotificationOptions): Promise<AuraResponse<Notification>>send(channel: NotificationChannel, recipient: string, body: string, options?: { subject?: string; templateId?: string; variables?: Record<string, unknown>; metadata?: Record<string, unknown>; idempotencyKey?: string; }): Promise<AuraResponse<Notification>> | 送信する通知をキューに入れます (モダン オブジェクト API)。 |
sendBatch(items: Array<SendNotificationRequest | SendNotificationItem>): Promise<AuraResponse<BatchSendResponse>> | 通知のバッチを送信します (POST /send/batch)。 |
sendEmail(recipient: string, subject: string, body: string, options?: SendEmailOptions): Promise<AuraResponse<Notification>> | トランザクション電子メール (channel: 'email') を送信します。 |
sendSms(recipient: string, body: string, options?: SendSmsOptions): Promise<AuraResponse<Notification>> | トランザクション SMS (channel: 'sms') を送信します。 |
sendPush(recipient: string, title: string, body: string, options?: SendPushOptions): Promise<AuraResponse<Notification>> | モバイル プッシュ通知 (channel: 'push'、FCM または APN) を送信します。 |
sendWebhook(targetUrl: string, event: string, payload: string | Record<string, unknown>, options?: SendWebhookOptions): Promise<AuraResponse<Notification>> | 送信 HTTP POST Webhook (channel: 'webhook') を発行します。 |
retry(id: string): Promise<AuraResponse<Notification>> | 失敗した通知を再試行します (status: 'failed' または 'dead_lettered')。 |
list(options?: { channel?: NotificationChannel; status?: NotificationStatus; search?: string; sort?: 'created_at' | 'updated_at' | 'status'; order?: 'asc' | 'desc'; limit?: number; offset?: number; }): Promise<AuraResponse<Notification[]>> | プロジェクトの通知履歴をリストします。 channel、 status 、 searchでフィルタリングでき、 created_at、 updated_at または statusで並べ替えられ、 limit / offset ページネーションを使用します。 |
get(id: string): Promise<AuraResponse<Notification>> | 通知をその識別子によって読み取ります。 |
listTemplates(): Promise<AuraResponse<NotificationTemplate[]>> | プロジェクトメッセージテンプレートをリストします。 |
getTemplate(id: string): Promise<AuraResponse<NotificationTemplate>> | メッセージ テンプレートをその識別子によって読み取ります。 |
createTemplate(template: Omit<NotificationTemplate, 'id' | 'project_id' | 'created_at' | 'updated_at'>): Promise<AuraResponse<NotificationTemplate>> | テンプレート ( name、 channel、 subject、 body) を作成します。それ以外は何も作成しません。 |
updateTemplate(id: string, updates: Partial<Pick<NotificationTemplate, 'name' | 'subject' | 'body'>>): Promise<AuraResponse<NotificationTemplate>> | テンプレートを更新します: name、 subject 、および/または body。 |
deleteTemplate(id: string): Promise<AuraResponse<null>> | メッセージテンプレートを削除します。 |
#
クラス
通知管理サービス
| 方法 | 説明 |
|---|---|
getSettings(): Promise<AuraResponse<NotificationSettingsPublic>> | プロジェクトのパブリック サプライヤーとクォータ設定 (GET /settings) を取得します。 |
updateSettings(settings: NotificationSettingsPatch | Partial<NotificationSettings>): Promise<AuraResponse<NotificationSettingsPublic>> | プロジェクトのサプライヤーまたはクォータ設定を更新します (PATCH /settings)。 |
getStats(options?: { window?: NotificationStatsWindow; channel?: NotificationChannel; }): Promise<AuraResponse<NotificationStats>> | 集約された送信統計 (GET /stats)。 |
getQueue(): Promise<AuraResponse<NotificationQueueStats>> | 送信キューのステータス、つまり保留中の通知の深さと分布を読み取ります。 |
listAttempts(notificationId: string): Promise<AuraResponse<NotificationAttempt[]>> | 通知の送信試行と、それぞれに対するプロバイダーの応答をリストします。 |
listDeadLetters(options?: { channel?: NotificationChannel; search?: string; limit?: number; offset?: number; }): Promise<AuraResponse<NotificationDeadLetter[]>> | ガベージ キュー (DLQ) に置かれた通知をリストします。 channel および searchでフィルタリングできます。 |
retryDeadLetter(id: string): Promise<AuraResponse<Notification>> | スクラップ キュー (DLQ) から特定の通知を再送信します。 |
listEvents(options?: { status?: 'received' | 'matched' | 'ignored' | 'failed' | 'enqueued'; limit?: number; offset?: number; }): Promise<AuraResponse<NotificationEvent[]>> | ルール エンジンによって受信されたイベントをリストします。 statusによってフィルタリングできます。 |
listProviderLogs(options?: { channel?: NotificationChannel; status?: NotificationAttemptStatus; limit?: number; offset?: number; }): Promise<AuraResponse<NotificationProviderLog[]>> | サードパーティベンダーの実行ログ (GET /providers/logs)。 |
previewTemplate(id: string, variables: Record<string, unknown>): Promise<AuraResponse<NotificationTemplatePreview>> | メッセージを送信せずに、指定された variables を使用してモデルをプレビュー用にレンダリングします。 |
listRules(): Promise<AuraResponse<NotificationRule[]>> | プロジェクト通知ルール (送信の自動トリガー) をリストします。 |
createRule(rule: CreateNotificationRuleRequest): Promise<AuraResponse<NotificationRule>> | 通知ルールを作成します。 conditionをチェックする trigger_type タイプのイベントごとに、メッセージが channel で recipient_exprで指定された受信者に、オプションの遅延付きで送信されます。 |
getRule(id: string): Promise<AuraResponse<NotificationRule>> | 識別子によって通知ルールを読み取ります。 |
updateRule(id: string, updates: UpdateNotificationRuleRequest): Promise<AuraResponse<NotificationRule>> | 通知ルールを更新します。指定されたフィールドのみが変更されます (例: enabled)。 |
deleteRule(id: string): Promise<AuraResponse<null>> | 通知ルールを削除します。 |
生成されたページ
このページは SDK の型宣言とコメントから生成されるため、公開されたコードから逸脱することはできません。実用的な例については、ガイドを参照してください。
最終更新日 · 2026/10/12