@onlyworlds/sdk 4.142.0 → 4.142.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
@@ -5,6 +5,16 @@ earlier history lives in git log only.
5
5
 
6
6
  ## [Unreleased]
7
7
 
8
+ ## [4.142.1] - 2026-11-10
9
+
10
+ ### Fixed
11
+
12
+ - `mintAiToken`'s `name` (at most 255) and `ai`'s `idempotencyKey` (1 to 200) are counted in code points, as the server counts them, not in UTF-16 units. A name of 255 characters outside the Basic Multilingual Plane (an emoji, say) was refused before sending, though the server takes it.
13
+
14
+ ### Tests
15
+
16
+ - Both caps are held at their edge with characters above U+FFFF: 255 pass and 256 are refused for the name, 201 are refused for the key.
17
+
8
18
  ## [4.142.0] - 2026-11-10
9
19
 
10
20
  ### Added
package/dist/index.js CHANGED
@@ -2152,7 +2152,7 @@ var OwV2Client = class {
2152
2152
  }
2153
2153
  const body = aiTokenParams("mintAiToken", uses ?? null, opts.lifetimeMinutes);
2154
2154
  if (opts.name !== void 0) {
2155
- if (typeof opts.name !== "string" || opts.name.length > 255) {
2155
+ if (typeof opts.name !== "string" || [...opts.name].length > 255) {
2156
2156
  throw new TypeError(`mintAiToken: name is a string of at most 255 characters, got ${JSON.stringify(opts.name)}. Nothing was sent.`);
2157
2157
  }
2158
2158
  body.name = opts.name;
@@ -2283,7 +2283,7 @@ var OwV2Client = class {
2283
2283
  if (body === null || typeof body !== "object" || Array.isArray(body)) {
2284
2284
  throw new TypeError(`ai: the body is the use's own object, got ${body === null ? "null" : Array.isArray(body) ? "an array" : typeof body}. Nothing was sent.`);
2285
2285
  }
2286
- if (opts.idempotencyKey !== void 0 && (typeof opts.idempotencyKey !== "string" || opts.idempotencyKey === "" || opts.idempotencyKey.length > 200)) {
2286
+ if (opts.idempotencyKey !== void 0 && (typeof opts.idempotencyKey !== "string" || opts.idempotencyKey === "" || [...opts.idempotencyKey].length > 200)) {
2287
2287
  throw new TypeError(`ai: idempotencyKey is a string of 1 to 200 characters, got ${JSON.stringify(opts.idempotencyKey)}. Nothing was sent.`);
2288
2288
  }
2289
2289
  return this.request("POST", path, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onlyworlds/sdk",
3
- "version": "4.142.0",
3
+ "version": "4.142.1",
4
4
  "description": "TypeScript SDK for the OnlyWorlds API - build world-building applications with type safety",
5
5
  "type": "module",
6
6
  "exports": {