@flitt/api 1.2.0 → 1.2.1

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/CHANGELOG.md CHANGED
@@ -1,9 +1,14 @@
1
1
  # Changelog
2
2
 
3
- ## 1.2.0 — 2026-09-30
3
+ ## 1.2.1 — 2026-10-01
4
+
5
+ - Same content as 1.2.0, which could not be published (version number already used by a cancelled staged publish).
6
+
7
+ ## 1.2.0 — 2026-09-30 (not published)
4
8
 
5
9
  - `hold` on `servers.list()` items and `servers.get()`: maintenance, development or temporary closure set by the owner (`kind`, `message`, `since`, `until`), `null` otherwise. While set, the uptime is paused and up / down alerts are muted.
6
10
  - New webhook events `server_hold_started` and `server_hold_ended` in `WebhookEventType`.
11
+ - README: list of webhook events with their `data`, and the Premium quota granted by a Server Premium server.
7
12
 
8
13
  ## 1.1.0 — 2026-09-29
9
14
 
package/README.md CHANGED
@@ -61,6 +61,8 @@ const flitt = new Flitt({ serverToken: process.env.FLITT_SERVER_TOKEN });
61
61
  | Premium | 20,000 requests / month | 120 requests / minute |
62
62
  | Enterprise | Unlimited | 120 requests / minute |
63
63
 
64
+ An account that owns a server with **Server Premium** (or a Flitt partner server) gets the Premium quota.
65
+
64
66
  The quota state of the last response is available on `flitt.rateLimit` (`{ limit, remaining, reset }`, `null` values meaning unlimited), or through the `onRateLimit` callback.
65
67
 
66
68
  ## Public API
@@ -242,6 +244,28 @@ export async function POST(request: Request) {
242
244
  }
243
245
  ```
244
246
 
247
+ ### Events
248
+
249
+ Every event has the same envelope, typed as `WebhookEvent`: `{ event, timestamp, server: { id, name }, data }`.
250
+
251
+ | Event | `data` |
252
+ |---|---|
253
+ | `server_down`, `server_down_addon`, `server_down_tcp`, `server_up`, `server_up_addon`, `server_up_tcp` | status change |
254
+ | `player_peak`, `player_joined`, `player_left`, `player_first_join`, `player_chat` | player |
255
+ | `review_created`, `vote_created` | review / vote |
256
+ | `affluence_low`, `affluence_high` | `{ current, expectedP50, p10, p90, durationMinutes }` |
257
+ | `server_hold_started` | `{ kind, message, until }` |
258
+ | `server_hold_ended` | `{ kind, reason, durationMinutes }` (`reason`: `"manual"`, `"planned"` or `"max_duration"`) |
259
+
260
+ `kind` is `"MAINTENANCE"`, `"DEVELOPMENT"` or `"CLOSED"`. While a server is on hold, the up / down events are not sent.
261
+
262
+ ```ts
263
+ if (event.event === "server_hold_started") {
264
+ const { kind, until } = event.data as { kind: string; until: string | null };
265
+ console.log(`${event.server.name}: ${kind} until ${until ?? "further notice"}`);
266
+ }
267
+ ```
268
+
245
269
  The signature is HMAC-SHA256 of `timestamp.nonce.body`, compared in constant time; deliveries older than 5 minutes are refused (`toleranceSec`).
246
270
 
247
271
  ## Errors
@@ -1,3 +1,3 @@
1
1
  /** Package version, kept in sync with package.json by scripts/sync-version.mjs. */
2
- export declare const VERSION = "1.2.0";
2
+ export declare const VERSION = "1.2.1";
3
3
  //# sourceMappingURL=version.d.ts.map
@@ -2,5 +2,5 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
4
  /** Package version, kept in sync with package.json by scripts/sync-version.mjs. */
5
- exports.VERSION = "1.2.0";
5
+ exports.VERSION = "1.2.1";
6
6
  //# sourceMappingURL=version.js.map
@@ -1,3 +1,3 @@
1
1
  /** Package version, kept in sync with package.json by scripts/sync-version.mjs. */
2
- export declare const VERSION = "1.2.0";
2
+ export declare const VERSION = "1.2.1";
3
3
  //# sourceMappingURL=version.d.ts.map
@@ -1,3 +1,3 @@
1
1
  /** Package version, kept in sync with package.json by scripts/sync-version.mjs. */
2
- export const VERSION = "1.2.0";
2
+ export const VERSION = "1.2.1";
3
3
  //# sourceMappingURL=version.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flitt/api",
3
- "version": "1.2.0",
3
+ "version": "1.2.1",
4
4
  "description": "Official TypeScript / JavaScript client for the Flitt Public API: servers, players, firewall, commands, Discord linking, votes and reviews (FiveM, Garry's Mod, Minecraft).",
5
5
  "keywords": [
6
6
  "flitt",
package/src/version.ts CHANGED
@@ -1,2 +1,2 @@
1
1
  /** Package version, kept in sync with package.json by scripts/sync-version.mjs. */
2
- export const VERSION = "1.2.0";
2
+ export const VERSION = "1.2.1";