@orakl/protocol 0.3.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -19,6 +19,6 @@ export type { StreakFlourish } from "./streak-flourish.ts";
19
19
  export type { LeaderboardBoard, LeaderboardDifficulty, LeaderboardScope, } from "./wire/leaderboard.ts";
20
20
  export type { OperatorQuestionRevision, PublishManyResult, QuestionRevision, } from "./wire/question-bank.ts";
21
21
  export type { FlagDetail, FlagReporter, FlagStatus, QuestionFlagAnswerSnapshot, QuestionSnapshot, } from "./wire/question-flags.ts";
22
- export type { ClientMessage, CuratorAdvanceMessage, CuratorIntermissionMessage, CuratorPlayerActionMessage, CuratorResetMessage, CuratorStartMessage, CuratorStartRoleSelectionMessage, CuratorStopMessage, GameErrorMessage, GameFinalScoresMessage, GameIntermissionMessage, GamePingMessage, GameQuestionMessage, GameResultsReadyMessage, GameResumeMessage, GameRoundResultMessage, GameStartMessage, GameTickMessage, JoinAcceptedMessage, JoinRejectedMessage, LobbyEndedMessage, LobbyResetMessage, LobbyUpdateMessage, PlayerAnsweredMessage, PlayerAnswerMessage, PlayerEmoteBroadcastMessage, PlayerEmoteMessage, PlayerLeaveMessage, PlayerNicknameChangedMessage, PlayerQuestionAnswer, PlayerRateAckMessage, PlayerRateMessage, PlayerRemovedMessage, PlayerRoleMessage, RoleSelectionLockedMessage, RoleSelectionStartMessage, RoleSelectionUpdateMessage, ServerMessage, WsAuthMessage, WsPongMessage, } from "./ws.ts";
22
+ export type { ClientMessage, CuratorAdvanceMessage, CuratorIntermissionMessage, CuratorPlayerActionMessage, CuratorResetMessage, CuratorStartMessage, CuratorStartRoleSelectionMessage, CuratorStopMessage, GameErrorMessage, GameFinalScoresMessage, GameIntermissionMessage, GamePingMessage, GameQuestionMessage, GameResultsReadyMessage, GameResumeMessage, GameRoundResultMessage, GameStartMessage, GameTickMessage, JoinAcceptedMessage, JoinRejectedMessage, LobbyEndedMessage, LobbyResetMessage, LobbyUpdateMessage, PlayerAnsweredMessage, PlayerAnswerMessage, PlayerEmoteBroadcastMessage, PlayerEmoteMessage, PlayerLeaveMessage, PlayerNicknameChangedMessage, PlayerQuestionAnswer, PlayerRateAckMessage, PlayerRateMessage, PlayerRemovedMessage, PlayerRoleMessage, RateAckReason, RoleSelectionLockedMessage, RoleSelectionStartMessage, RoleSelectionUpdateMessage, ServerMessage, WsAuthMessage, WsPongMessage, } from "./ws.ts";
23
23
  export { ClientMessageSchema } from "./ws-game.schema.ts";
24
24
  export { SoloClientMessageSchema } from "./ws-solo.schema.ts";
package/dist/solo-ws.d.ts CHANGED
@@ -2,6 +2,7 @@ import type { BadgeAward } from "./badges.ts";
2
2
  import type { PlayerSafeQuestion } from "./player-safe-question.ts";
3
3
  import type { MediaType, QuestionSource } from "./question.ts";
4
4
  import type { QuestionRating } from "./question-rating.ts";
5
+ import type { RateAckReason } from "./ws.ts";
5
6
  export type SoloAuthMessage = {
6
7
  type: "auth";
7
8
  token: string;
@@ -49,7 +50,8 @@ export type SoloResumeMessage = {
49
50
  resumeToken?: string;
50
51
  };
51
52
  /** Rate a question revealed in this run (signed-in runs only). The server
52
- * answers with `solo:rate-ack` echoing `questionId`. */
53
+ * answers with `solo:rate-ack` echoing `questionId`; `reason: "disabled"`
54
+ * when the rating flag is off. */
53
55
  export type SoloRateMessage = {
54
56
  type: "solo:rate";
55
57
  /** Bank question id, as on `solo:question`. */
@@ -214,5 +216,7 @@ export type SoloRateAckMessage = {
214
216
  type: "solo:rate-ack";
215
217
  questionId: string;
216
218
  ok: boolean;
219
+ /** Set when the server refuses every rating because the flag is off. */
220
+ reason?: RateAckReason;
217
221
  };
218
222
  export type SoloServerMessage = SoloReadyMessage | SoloQuestionMessage | SoloTickMessage | SoloRoundResultMessage | SoloStreakMessage | SoloStreakLostMessage | SoloStreakNearMissMessage | SoloStreakBestMessage | SoloLifeSpentMessage | SoloFinalMessage | SoloPingMessage | SoloErrorMessage | SoloGuestLimitMessage | SoloRateAckMessage;
package/dist/ws.d.ts CHANGED
@@ -37,7 +37,7 @@ export interface PlayerLeaveMessage {
37
37
  }
38
38
  /** Rate a question revealed in this game — from a signed-in player who played
39
39
  * its round, or the curator. The server answers with `player:rate-ack`
40
- * echoing `questionId`. */
40
+ * echoing `questionId`; `reason: "disabled"` when the rating flag is off. */
41
41
  export interface PlayerRateMessage {
42
42
  type: "player:rate";
43
43
  /** Bank question id, as on `game:question`. */
@@ -289,6 +289,8 @@ export interface GameErrorMessage {
289
289
  /** Human-readable fallback when the UI has no copy for `code`. */
290
290
  message: string;
291
291
  }
292
+ /** Why a rate ack failed for every rating alike: the flag is off. */
293
+ export type RateAckReason = "disabled";
292
294
  /** Outcome of one `player:rate`, to the rater only: `ok` is false when the
293
295
  * rating was refused or not stored. Failures ride here, never on
294
296
  * `game:error`, which carries no request id. */
@@ -296,4 +298,6 @@ export interface PlayerRateAckMessage {
296
298
  type: "player:rate-ack";
297
299
  questionId: string;
298
300
  ok: boolean;
301
+ /** Set when the server refuses every rating because the flag is off. */
302
+ reason?: RateAckReason;
299
303
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@orakl/protocol",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
4
  "description": "Orakl wire contract: WebSocket frames and API response schemas.",
5
5
  "license": "AGPL-3.0-only",
6
6
  "repository": {