@kokimoki/app 1.8.0 → 1.8.2
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/kokimoki-client.d.ts +1 -1
- package/dist/kokimoki-client.js +9 -4
- package/dist/kokimoki.min.d.ts +1 -1
- package/dist/kokimoki.min.js +10 -5
- package/dist/kokimoki.min.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
|
@@ -77,7 +77,7 @@ export declare class KokimokiClient<ClientContextT = any> extends KokimokiClient
|
|
|
77
77
|
private sendUnsubscribeReq;
|
|
78
78
|
join<T extends S.Generic<unknown>>(store: KokimokiStore<T>): Promise<void>;
|
|
79
79
|
leave<T extends S.Generic<unknown>>(store: KokimokiStore<T>): Promise<void>;
|
|
80
|
-
transact(handler: (t: KokimokiTransaction) =>
|
|
80
|
+
transact<ReturnT = void>(handler: (t: KokimokiTransaction) => ReturnT | Promise<ReturnT>): Promise<ReturnT>;
|
|
81
81
|
close(): Promise<void>;
|
|
82
82
|
getRoomHash<T extends S.Generic<unknown>>(store: KokimokiStore<T>): number;
|
|
83
83
|
/** Initializers */
|
package/dist/kokimoki-client.js
CHANGED
|
@@ -481,10 +481,10 @@ export class KokimokiClient extends EventEmitter {
|
|
|
481
481
|
// throw new Error("Client not connected");
|
|
482
482
|
// }
|
|
483
483
|
const transaction = new KokimokiTransaction(this);
|
|
484
|
-
await handler(transaction);
|
|
484
|
+
const returnValue = await handler(transaction);
|
|
485
485
|
const { updates, consumedMessages } = await transaction.getUpdates();
|
|
486
486
|
if (!updates.length) {
|
|
487
|
-
return;
|
|
487
|
+
return returnValue;
|
|
488
488
|
}
|
|
489
489
|
// Construct buffers
|
|
490
490
|
const remoteUpdateWriter = new WsMessageWriter();
|
|
@@ -547,6 +547,7 @@ export class KokimokiClient extends EventEmitter {
|
|
|
547
547
|
const reader = new WsMessageReader(localBuffer);
|
|
548
548
|
this.handleRoomUpdateMessage(reader);
|
|
549
549
|
}
|
|
550
|
+
return returnValue;
|
|
550
551
|
}
|
|
551
552
|
async close() {
|
|
552
553
|
this._autoReconnect = false;
|
|
@@ -661,7 +662,9 @@ export class KokimokiClient extends EventEmitter {
|
|
|
661
662
|
* @returns
|
|
662
663
|
*/
|
|
663
664
|
async listLeaderboardEntries(leaderboardName, sortDir, skip = 0, limit = 100) {
|
|
664
|
-
const res = await fetch(`${this._apiUrl}/leaderboard-entries?leaderboardName=${leaderboardName}&sortDir=${sortDir}&skip=${skip}&limit=${limit}
|
|
665
|
+
const res = await fetch(`${this._apiUrl}/leaderboard-entries?leaderboardName=${leaderboardName}&sortDir=${sortDir}&skip=${skip}&limit=${limit}`, {
|
|
666
|
+
headers: this.apiHeaders,
|
|
667
|
+
});
|
|
665
668
|
return await res.json();
|
|
666
669
|
}
|
|
667
670
|
/**
|
|
@@ -671,7 +674,9 @@ export class KokimokiClient extends EventEmitter {
|
|
|
671
674
|
* @param clientId
|
|
672
675
|
*/
|
|
673
676
|
async getBestLeaderboardEntry(leaderboardName, sortDir, clientId) {
|
|
674
|
-
const res = await fetch(`${this._apiUrl}/leaderboard-entries/best?leaderboardName=${leaderboardName}&sortDir=${sortDir}&clientId=${clientId || this.id}
|
|
677
|
+
const res = await fetch(`${this._apiUrl}/leaderboard-entries/best?leaderboardName=${leaderboardName}&sortDir=${sortDir}&clientId=${clientId || this.id}`, {
|
|
678
|
+
headers: this._apiHeaders,
|
|
679
|
+
});
|
|
675
680
|
return await res.json();
|
|
676
681
|
}
|
|
677
682
|
}
|
package/dist/kokimoki.min.d.ts
CHANGED
|
@@ -300,7 +300,7 @@ declare class KokimokiClient<ClientContextT = any> extends KokimokiClient_base {
|
|
|
300
300
|
private sendUnsubscribeReq;
|
|
301
301
|
join<T extends KokimokiSchema.Generic<unknown>>(store: KokimokiStore<T>): Promise<void>;
|
|
302
302
|
leave<T extends KokimokiSchema.Generic<unknown>>(store: KokimokiStore<T>): Promise<void>;
|
|
303
|
-
transact(handler: (t: KokimokiTransaction) =>
|
|
303
|
+
transact<ReturnT = void>(handler: (t: KokimokiTransaction) => ReturnT | Promise<ReturnT>): Promise<ReturnT>;
|
|
304
304
|
close(): Promise<void>;
|
|
305
305
|
getRoomHash<T extends KokimokiSchema.Generic<unknown>>(store: KokimokiStore<T>): number;
|
|
306
306
|
/** Initializers */
|
package/dist/kokimoki.min.js
CHANGED
|
@@ -486,7 +486,7 @@ function eventTargetAgnosticAddListener(emitter, name, listener, flags) {
|
|
|
486
486
|
var eventsExports = events.exports;
|
|
487
487
|
var EventEmitter$1 = /*@__PURE__*/getDefaultExportFromCjs(eventsExports);
|
|
488
488
|
|
|
489
|
-
const KOKIMOKI_APP_VERSION = "1.8.
|
|
489
|
+
const KOKIMOKI_APP_VERSION = "1.8.2";
|
|
490
490
|
|
|
491
491
|
/**
|
|
492
492
|
* Utility module to work with key-value stores.
|
|
@@ -15111,10 +15111,10 @@ class KokimokiClient extends EventEmitter$1 {
|
|
|
15111
15111
|
// throw new Error("Client not connected");
|
|
15112
15112
|
// }
|
|
15113
15113
|
const transaction = new KokimokiTransaction(this);
|
|
15114
|
-
await handler(transaction);
|
|
15114
|
+
const returnValue = await handler(transaction);
|
|
15115
15115
|
const { updates, consumedMessages } = await transaction.getUpdates();
|
|
15116
15116
|
if (!updates.length) {
|
|
15117
|
-
return;
|
|
15117
|
+
return returnValue;
|
|
15118
15118
|
}
|
|
15119
15119
|
// Construct buffers
|
|
15120
15120
|
const remoteUpdateWriter = new WsMessageWriter();
|
|
@@ -15177,6 +15177,7 @@ class KokimokiClient extends EventEmitter$1 {
|
|
|
15177
15177
|
const reader = new WsMessageReader(localBuffer);
|
|
15178
15178
|
this.handleRoomUpdateMessage(reader);
|
|
15179
15179
|
}
|
|
15180
|
+
return returnValue;
|
|
15180
15181
|
}
|
|
15181
15182
|
async close() {
|
|
15182
15183
|
this._autoReconnect = false;
|
|
@@ -15291,7 +15292,9 @@ class KokimokiClient extends EventEmitter$1 {
|
|
|
15291
15292
|
* @returns
|
|
15292
15293
|
*/
|
|
15293
15294
|
async listLeaderboardEntries(leaderboardName, sortDir, skip = 0, limit = 100) {
|
|
15294
|
-
const res = await fetch(`${this._apiUrl}/leaderboard-entries?leaderboardName=${leaderboardName}&sortDir=${sortDir}&skip=${skip}&limit=${limit}
|
|
15295
|
+
const res = await fetch(`${this._apiUrl}/leaderboard-entries?leaderboardName=${leaderboardName}&sortDir=${sortDir}&skip=${skip}&limit=${limit}`, {
|
|
15296
|
+
headers: this.apiHeaders,
|
|
15297
|
+
});
|
|
15295
15298
|
return await res.json();
|
|
15296
15299
|
}
|
|
15297
15300
|
/**
|
|
@@ -15301,7 +15304,9 @@ class KokimokiClient extends EventEmitter$1 {
|
|
|
15301
15304
|
* @param clientId
|
|
15302
15305
|
*/
|
|
15303
15306
|
async getBestLeaderboardEntry(leaderboardName, sortDir, clientId) {
|
|
15304
|
-
const res = await fetch(`${this._apiUrl}/leaderboard-entries/best?leaderboardName=${leaderboardName}&sortDir=${sortDir}&clientId=${clientId || this.id}
|
|
15307
|
+
const res = await fetch(`${this._apiUrl}/leaderboard-entries/best?leaderboardName=${leaderboardName}&sortDir=${sortDir}&clientId=${clientId || this.id}`, {
|
|
15308
|
+
headers: this._apiHeaders,
|
|
15309
|
+
});
|
|
15305
15310
|
return await res.json();
|
|
15306
15311
|
}
|
|
15307
15312
|
}
|