/** * 全API 共通レスポンス * (Welfareは後日実装) */ export type CommonBaseResponse = { code: number; status: 'OK' | 'BadRequest' | 'Unauthorized' | 'Forbidden' | 'NotFound' | 'ServerError'; data: T; }; /** * 一覧 ベースレスポンス */ export type CommonListBaseResponse = { count: number; result: T; }; /** * 一覧 共通レスポンス * @type {T} - IFレスポンス * @example * { * code: 200, * status: 'OK' * data: { * // ~CommonListBaseResponse~ * count: 1, * result: { * // ~T~ * ...IFレスポンス * } * } * } */ export type CommonListResponse = CommonBaseResponse>; /** * 詳細 ベースレスポンス * 作成者,作成時間、更新者,更新時間 * @example * type example = CommonDetailBaseResponse & { * ...固有レスポンス * } * @todo API実装後オプショナル外す */ export type CommonDetailBaseResponse = { createdAt: string; createdBy?: T; updatedAt: string; updatedBy?: T; }; /** * 詳細 共通レスポンス * @type {T} IFレスポンス */ export type CommonDetailResponse = CommonBaseResponse; /** * 共通 エラーレスポンス * @see https://docs.google.com/spreadsheets/d/1PHE0YLtA9zM6MP0ssfK6Bb81BAKIoZjLQ6eM7Qdnuxg/edit#gid=407824715 * @example * { * code: 404, * status: 'NotFound' * data: { * messages: string | {[key: string]: string * } * } */ export type CommonErrorResponse = CommonBaseResponse; export type ErrorDict = { type: 'ErrorDict'; messages: string | { [key: string]: string; }; }; /** * 共通削除処理レスポンス */ export type CommonDeleteResponse = CommonBaseResponse; //# sourceMappingURL=api.d.ts.map