@onlyworlds/sdk 4.108.0 → 4.108.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,12 @@ earlier history lives in git log only.
5
5
 
6
6
  ## [Unreleased]
7
7
 
8
+ ## [4.108.1] - 2026-10-29
9
+
10
+ ### Fixed
11
+
12
+ - **A list filter with an empty value is sent.** `list` and `listAll` sent nothing for a key under `filter` whose value was `''`, so `filter: { characters: '' }` or `filter: { supertype: '' }` listed every element. On keel an empty value is a filter of its own: `supertype=` and `subtype=` list the elements with none, `characters=` the Messages addressed to everyone, and a single link's (`parent_location=`, since every single link became a list filter) the elements linking to nothing. Each key under `filter` is now sent as given, `''` included; an empty `name__icontains` still matches every name, and outside `filter` an empty value is still not sent. The `filter` doc names the single-link filters.
13
+
8
14
  ## [4.108.0] - 2026-10-29
9
15
 
10
16
  ### Added
package/dist/index.d.ts CHANGED
@@ -3409,10 +3409,14 @@ interface ListParams {
3409
3409
  /** Sparse include-set of field names. */
3410
3410
  fields?: string[];
3411
3411
  /**
3412
- * Accepted: `name` (exact), `name__icontains`, `supertype`, `subtype`, and
3412
+ * Accepted: `name` (exact), `name__icontains`, `supertype`, `subtype`,
3413
3413
  * `characters=<id>` (contains) on every type with a `characters` link (at schema
3414
- * 0.30.1: collective, construct, event, narrative, relation, title). Any other key 422s
3415
- * server-side with the list of filters in the message -- the client passes keys
3414
+ * 0.30.1: collective, construct, event, narrative, relation, title), and each single link
3415
+ * of the type (`parent_location`, `birthplace`, ...: the elements linking to that id). An
3416
+ * empty value is sent as `key=`, a filter of its own: `supertype: ''` lists the elements
3417
+ * with none, `characters: ''` a Message to everyone, a single link's the elements linking
3418
+ * to nothing (until 4.108.1 it was dropped and the list came back whole). Any other key
3419
+ * 422s server-side with the list of filters in the message -- the client passes keys
3416
3420
  * through unchecked and lets the platform say so. (`__in`, `__gte`, `__lte` and
3417
3421
  * `__isnull` are designed in keel's spec but not built; `ordering` 422s too.)
3418
3422
  */
package/dist/index.js CHANGED
@@ -827,7 +827,7 @@ var OwV2Client = class {
827
827
  created_by: params.createdBy,
828
828
  ...params.filter,
829
829
  as: params.viewAs
830
- });
830
+ }, new Set(Object.keys(params.filter ?? {})));
831
831
  return this.request("GET", `/${type}/`, { query, worldRead: true, ...withSignal(params.signal) });
832
832
  }
833
833
  async draught(characterId, policy = {}) {
@@ -2301,10 +2301,10 @@ function clientNameOf(value) {
2301
2301
  }
2302
2302
  return value;
2303
2303
  }
2304
- function buildQuery(params) {
2304
+ function buildQuery(params, keepEmpty) {
2305
2305
  const q = new URLSearchParams();
2306
2306
  for (const [k, v] of Object.entries(params)) {
2307
- if (v !== void 0 && v !== null && v !== "") q.set(k, String(v));
2307
+ if (v !== void 0 && v !== null && (v !== "" || keepEmpty?.has(k))) q.set(k, String(v));
2308
2308
  }
2309
2309
  return q.toString();
2310
2310
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onlyworlds/sdk",
3
- "version": "4.108.0",
3
+ "version": "4.108.1",
4
4
  "description": "TypeScript SDK for the OnlyWorlds API - build world-building applications with type safety",
5
5
  "type": "module",
6
6
  "exports": {