@kispi/chat 0.5.1 → 0.6.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/README.en.md CHANGED
@@ -225,11 +225,13 @@ try {
225
225
 
226
226
  | Field | |
227
227
  |---|---|
228
- | `code` | A union of the known values (`ChatErrorCode`), so a typo fails to compile. From the server: `unauthorized`, `forbidden`, `not_found`, `invalid`, `too_large`, `rate_limited`, `banned`, `moderation_denied`, `cursor_too_old`, `internal`. From the SDK: `timeout`, `closed`. A code the server adds later still type-checks |
228
+ | `code` | A union of the known values (`ChatErrorCode`), so a typo fails to compile. From the server: `unauthorized`, `forbidden`, `not_found`, `invalid`, `too_large`, `rate_limited`, `banned`, `moderation_denied`, `cursor_too_old`, `quota_exceeded`, `internal`. From the SDK: `timeout`, `closed`. A code the server adds later still type-checks |
229
229
  | `retryAfterMs` | Wait time reported by the server when you hit a limit |
230
230
  | `appCode` | Consumer-side code attached by a `before_publish` webhook when rejecting |
231
231
  | `status` | HTTP status, if the error came from a REST call |
232
232
 
233
+ `quota_exceeded` means the app's storage quota (`limits.maxStoredMessages`) is full. Only new messages are refused (403 over REST); edits, deletes and reactions still work. Deleting messages does not free space (deleted messages are still counted) -- it clears when the app operator raises the quota or purges rooms. Waiting does not clear it, so there is no `retryAfterMs` and the SDK does not resend -- show "storage is full" instead of retrying.
234
+
233
235
  ---
234
236
 
235
237
  ## `@kispi/chat/server` — backend
package/README.md CHANGED
@@ -215,11 +215,13 @@ try {
215
215
 
216
216
  | 필드 | |
217
217
  |---|---|
218
- | `code` | 알려진 값의 유니온(`ChatErrorCode`)이라 오타가 컴파일에서 잡힌다. 서버: `unauthorized`, `forbidden`, `not_found`, `invalid`, `too_large`, `rate_limited`, `banned`, `moderation_denied`, `cursor_too_old`, `internal`. SDK: `timeout`, `closed`. 서버가 새 코드를 내도 좁혀 놓은 타입이 막지 않는다 |
218
+ | `code` | 알려진 값의 유니온(`ChatErrorCode`)이라 오타가 컴파일에서 잡힌다. 서버: `unauthorized`, `forbidden`, `not_found`, `invalid`, `too_large`, `rate_limited`, `banned`, `moderation_denied`, `cursor_too_old`, `quota_exceeded`, `internal`. SDK: `timeout`, `closed`. 서버가 새 코드를 내도 좁혀 놓은 타입이 막지 않는다 |
219
219
  | `retryAfterMs` | 한도에 걸렸을 때 서버가 알려 준 대기 시간 |
220
220
  | `appCode` | `before_publish` 웹훅이 거절하며 붙인 소비자 쪽 코드 |
221
221
  | `status` | REST 호출에서 난 에러면 HTTP 상태 |
222
222
 
223
+ `quota_exceeded`는 앱의 저장 쿼터(`limits.maxStoredMessages`)가 찼다는 뜻이다. 새 메시지만 거절되고(REST는 403) 편집·삭제·리액션은 된다. 메시지를 지워도 공간은 비지 않는다(삭제된 메시지도 센다) — 풀리는 길은 앱 운영자가 쿼터를 올리거나 방을 purge하는 것이다. 기다려서 풀리지 않으므로 `retryAfterMs`가 없고 SDK도 다시 보내지 않는다 — 재시도 루프를 짜지 말고 "저장 공간이 찼다"를 보여 준다.
224
+
223
225
  ---
224
226
 
225
227
  ## `@kispi/chat/server` — 백엔드
package/dist/index.d.cts CHANGED
@@ -22,7 +22,13 @@ declare class Emitter<Events extends Record<string, unknown>> {
22
22
  * 사실은 한도에 실제로 걸리는 날에야 드러난다. 목록은
23
23
  * `docs/protocol.md`의 "에러 코드"가 정본이다.
24
24
  */
25
- type ChatErrorCode = 'unauthorized' | 'forbidden' | 'not_found' | 'invalid' | 'too_large' | 'rate_limited' | 'banned' | 'moderation_denied' | 'cursor_too_old' | 'internal'
25
+ type ChatErrorCode = 'unauthorized' | 'forbidden' | 'not_found' | 'invalid' | 'too_large' | 'rate_limited' | 'banned' | 'moderation_denied' | 'cursor_too_old'
26
+ /**
27
+ * 앱의 저장 쿼터(`limits.maxStoredMessages`)가 찼다. 기다려서 풀리지 않으므로
28
+ * `retryAfterMs`가 없고 SDK도 재시도하지 않는다. 메시지를 지워도 비지 않는다
29
+ * (삭제된 메시지도 센다) — 앱 운영자가 쿼터를 올리거나 방을 purge해야 한다.
30
+ */
31
+ | 'quota_exceeded' | 'internal'
26
32
  /** SDK가 낸다: ack가 제 시간에 오지 않았다. */
27
33
  | 'timeout'
28
34
  /** SDK가 낸다: 연결이 없거나 닫혔다. */
package/dist/index.d.ts CHANGED
@@ -22,7 +22,13 @@ declare class Emitter<Events extends Record<string, unknown>> {
22
22
  * 사실은 한도에 실제로 걸리는 날에야 드러난다. 목록은
23
23
  * `docs/protocol.md`의 "에러 코드"가 정본이다.
24
24
  */
25
- type ChatErrorCode = 'unauthorized' | 'forbidden' | 'not_found' | 'invalid' | 'too_large' | 'rate_limited' | 'banned' | 'moderation_denied' | 'cursor_too_old' | 'internal'
25
+ type ChatErrorCode = 'unauthorized' | 'forbidden' | 'not_found' | 'invalid' | 'too_large' | 'rate_limited' | 'banned' | 'moderation_denied' | 'cursor_too_old'
26
+ /**
27
+ * 앱의 저장 쿼터(`limits.maxStoredMessages`)가 찼다. 기다려서 풀리지 않으므로
28
+ * `retryAfterMs`가 없고 SDK도 재시도하지 않는다. 메시지를 지워도 비지 않는다
29
+ * (삭제된 메시지도 센다) — 앱 운영자가 쿼터를 올리거나 방을 purge해야 한다.
30
+ */
31
+ | 'quota_exceeded' | 'internal'
26
32
  /** SDK가 낸다: ack가 제 시간에 오지 않았다. */
27
33
  | 'timeout'
28
34
  /** SDK가 낸다: 연결이 없거나 닫혔다. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kispi/chat",
3
- "version": "0.5.1",
3
+ "version": "0.6.0",
4
4
  "description": "Client SDK for the chat server: one WebSocket, many rooms, ordered history.",
5
5
  "license": "MIT",
6
6
  "type": "module",