Skip to content

Feature/update messages#6

Merged
Na-x4 merged 15 commits into
developfrom
feature/update-messages
Jan 19, 2022
Merged

Feature/update messages#6
Na-x4 merged 15 commits into
developfrom
feature/update-messages

Conversation

@Na-x4

@Na-x4 Na-x4 commented Jan 18, 2022

Copy link
Copy Markdown
Owner

メッセージの形式を変更した

Before

エラーが発生した場合に、次のリクエストが受付可能かがわからなかった。

type Result =
    | {
          type: "success"; // 成功した場合
          wav: string; // WAV データ、Base64 エンコード
      }
    | {
          type: "error"; // エラーが発生した場合
          code?: number; // エラーコード (AquesTalk ライブラリ内でエラーが発生した場合)
          message: string; // エラーメッセージ
      };

After

isConnectionReusable を追加し、現在の接続が使用可能かを応答に含める。

request を追加し、現在の応答がどのリクエストに対するものかを明確にする。

type Result = {
    isSuccess: boolean; // リクエストの結果が成功かどうか
    isConnectionReusable: boolean; // 続けて新たなリクエストが可能かどうか
    response:
        | { type: "Wav"; wav: string } // WAV データ、Base64 エンコード
        | {
              type: "AquestalkError"; // AquesTalk ライブラリ内でエラーが発生した場合
              code?: number; // エラーコード (AquesTalk ライブラリ内でエラーが発生した場合)
              message: string; // エラーメッセージ
          }
        | {
              type: "JsonError"; // リクエストのパース中にエラーが発生した場合
              message: String; // エラーメッセージ
          }
        | {
              type: "ConnectionError"; // 接続関連のエラー
              message: String; // エラーメッセージ
          };
    request?: any; // 対応するリクエスト (JSON構文エラーまたは接続エラーが発生しなかった場合)
};

@Na-x4 Na-x4 marked this pull request as ready for review January 19, 2022 08:33
@Na-x4 Na-x4 merged commit 77c1abb into develop Jan 19, 2022
@Na-x4 Na-x4 deleted the feature/update-messages branch January 19, 2022 12:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant