@onlyworlds/sdk 4.184.1 → 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/dist/index.d.ts +6 -1
- package/dist/index.js +11 -3
- package/package.json +1 -1
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
|
|
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
|
|
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,
|