@onlyworlds/sdk 4.184.0 → 4.185.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/AGENTS.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # For AI agents using @onlyworlds/sdk
2
2
 
3
- **Current as of**: SDK **4.x** · schema-dist **v0.34.1-dist.141** (canonical 00.34.01).
3
+ **Current as of**: SDK **4.x** · schema-dist **v0.34.1-dist.142** (canonical 00.34.01).
4
4
  This line is asserted by `codegen:check` in CI — if the pin moves and this file is not
5
5
  re-read against it, the check fails rather than letting this document rot quietly.
6
6
 
package/SCHEMA.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # OnlyWorlds Schema Reference
2
2
 
3
- **Source**: https://github.com/OnlyWorlds/schema-dist @ **v0.34.1-dist.141** — canonical schema **00.34.01**, published 2026-11-20.
3
+ **Source**: https://github.com/OnlyWorlds/schema-dist @ **v0.34.1-dist.142** — canonical schema **00.34.01**, published 2026-11-21.
4
4
 
5
5
  GENERATED from the canonical schema YAML — do not hand-edit (regenerate: `python codegen/generate_types.py`).
6
6
  Written for both humans and AI agents reading this package locally.
package/dist/index.d.ts CHANGED
@@ -4925,7 +4925,8 @@ declare class OwV2Client {
4925
4925
  * membership and Character, the lenses it starts with, the world's reading aids, and the front
4926
4926
  * door (`front_door`: the sponsor and their Character, your own Character, the Charter and the
4927
4927
  * Objects it names, the seats you sponsor). The client's PIN is sent here when it has one, so a
4928
- * wrong PIN shows on this call first, which makes it the connection test. An account token is
4928
+ * wrong PIN shows on this call first, which makes it the connection test for a key that can write;
4929
+ * beside a key that cannot (a read key, a player's), onlyworlds.com never reads a PIN. An account token is
4929
4930
  * refused before sending: it is not a member of one world.
4930
4931
  */
4931
4932
  me(): Promise<OwMe>;
@@ -5099,10 +5100,14 @@ declare class OwV2Client {
5099
5100
  * `idempotencyKey`, derived from the key and the position (the ids the Python package mints),
5100
5101
  * so a retry with the same key and items sends the same body; without one, a
5101
5102
  * fresh UUIDv7. Ids you supply are kept.
5103
+ * With `createOnly: true` (sent as `create_only`), every item with an id is created as `create` creates it, never
5104
+ * replaced: an id the world already holds answers that item's slot `{status: 409}` with `id_conflict`, and the
5105
+ * element stays as it was. Left out or false, an item with an id held replaces it whole, as before.
5102
5106
  */
5103
5107
  bulk(items: OwBulkItem[], opts?: {
5104
5108
  atomic?: boolean;
5105
5109
  idempotencyKey?: string;
5110
+ createOnly?: boolean;
5106
5111
  }): Promise<OwBulkResponse>;
5107
5112
  /**
5108
5113
  * GET /changes -- one page of the world's ordered change feed.
package/dist/index.js CHANGED
@@ -1002,7 +1002,8 @@ var OwV2Client = class {
1002
1002
  * membership and Character, the lenses it starts with, the world's reading aids, and the front
1003
1003
  * door (`front_door`: the sponsor and their Character, your own Character, the Charter and the
1004
1004
  * Objects it names, the seats you sponsor). The client's PIN is sent here when it has one, so a
1005
- * wrong PIN shows on this call first, which makes it the connection test. An account token is
1005
+ * wrong PIN shows on this call first, which makes it the connection test for a key that can write;
1006
+ * beside a key that cannot (a read key, a player's), onlyworlds.com never reads a PIN. An account token is
1006
1007
  * refused before sending: it is not a member of one world.
1007
1008
  */
1008
1009
  async me() {
@@ -1230,9 +1231,15 @@ var OwV2Client = class {
1230
1231
  * `idempotencyKey`, derived from the key and the position (the ids the Python package mints),
1231
1232
  * so a retry with the same key and items sends the same body; without one, a
1232
1233
  * fresh UUIDv7. Ids you supply are kept.
1234
+ * With `createOnly: true` (sent as `create_only`), every item with an id is created as `create` creates it, never
1235
+ * replaced: an id the world already holds answers that item's slot `{status: 409}` with `id_conflict`, and the
1236
+ * element stays as it was. Left out or false, an item with an id held replaces it whole, as before.
1233
1237
  */
1234
1238
  async bulk(items, opts = {}) {
1235
- only("bulk", opts, ["atomic", "idempotencyKey"]);
1239
+ only("bulk", opts, ["atomic", "idempotencyKey", "createOnly"]);
1240
+ if (opts.createOnly !== void 0 && typeof opts.createOnly !== "boolean") {
1241
+ throw new TypeError("bulk: createOnly is true or false. Nothing was sent.");
1242
+ }
1236
1243
  items.forEach((it, index) => refuseKnownOf(it.element, `bulk: items[${index}]`));
1237
1244
  const body = {
1238
1245
  items: items.map((it, index) => {
@@ -1242,7 +1249,8 @@ var OwV2Client = class {
1242
1249
  }
1243
1250
  return { type: it.type, element };
1244
1251
  }),
1245
- atomic: opts.atomic ?? false
1252
+ atomic: opts.atomic ?? false,
1253
+ ...opts.createOnly === true ? { create_only: true } : {}
1246
1254
  };
1247
1255
  return this.request("POST", "/bulk/", {
1248
1256
  write: true,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onlyworlds/sdk",
3
- "version": "4.184.0",
3
+ "version": "4.185.0",
4
4
  "description": "TypeScript SDK for the OnlyWorlds API - build world-building applications with type safety",
5
5
  "type": "module",
6
6
  "exports": {