132 lines
3.3 KiB
JavaScript
132 lines
3.3 KiB
JavaScript
// Metro module 1919 (f1920).
|
|
import { Table, TableTransaction } from "./TableTransaction";
|
|
import { ConflictOptions } from "./Module1914";
|
|
class GuildDao {
|
|
constructor(a0, a1, a2, r8 = true) {
|
|
this.originalPrefix = a0;
|
|
this.table = new Table([a0], a1, a2, r8);
|
|
}
|
|
get prefix() {
|
|
return this.table.prefix;
|
|
}
|
|
withoutLogging() {
|
|
const originalPrefix = this.originalPrefix;
|
|
const tableId = this.table.tableId;
|
|
const database = this.table.database;
|
|
const r17 = {
|
|
__proto__: GuildDao.prototype
|
|
};
|
|
r17.originalPrefix = originalPrefix;
|
|
r17.table = new Table([originalPrefix], tableId, database, false);
|
|
return r17;
|
|
}
|
|
get(a0, a1) {
|
|
return this.table.get([a0, a1]);
|
|
}
|
|
getMany(a0, a1) {
|
|
return this.table.getMany([a0], a1);
|
|
}
|
|
getRange(a0, a1, a2, a3) {
|
|
return this.table.getRange([a0, a1], [a0, a2], a3);
|
|
}
|
|
getKvEntries() {
|
|
return this.table.getKvEntries();
|
|
}
|
|
getMapEntries() {
|
|
return this.table.getMapEntries();
|
|
}
|
|
getIds(a0) {
|
|
return this.table.getChildIds([a0]);
|
|
}
|
|
getGuildIds() {
|
|
return this.table.getChildIds([]);
|
|
}
|
|
getGuildId(a0) {
|
|
return this.table.getParentId([null, a0]);
|
|
}
|
|
put(a0, a1, a2, r6 = ConflictOptions.Replace) {
|
|
return this.putWithGeneration(a0, a1, a2, null, r6);
|
|
}
|
|
putWithGeneration(a0, a1, a2, a3, r4 = ConflictOptions.Replace) {
|
|
return this.table.put({
|
|
key: [a0, a1],
|
|
data: a2,
|
|
generation: a3
|
|
}, r4);
|
|
}
|
|
delete(a0, a1) {
|
|
const length = arguments.length;
|
|
if (length === 0) {
|
|
return this.table.delete([]);
|
|
}
|
|
if (length === 1) {
|
|
return this.table.delete([a0]);
|
|
}
|
|
return this.table.delete([a0, a1]);
|
|
}
|
|
deleteGeneration(a0, a1) {
|
|
return this.table.deleteGeneration([], a0, a1);
|
|
}
|
|
transaction(c13332_0, a1) {
|
|
return this.table.transaction((a0) => {
|
|
const r10 = {
|
|
__proto__: GuildDaoTransaction.prototype
|
|
};
|
|
r10.state = a0;
|
|
return c13332_0(r10);
|
|
}, a1);
|
|
}
|
|
upgradeTransaction(a0) {
|
|
const state = this.table.upgradeTransaction(a0);
|
|
const r11 = {
|
|
__proto__: GuildDaoTransaction.prototype
|
|
};
|
|
r11.state = state;
|
|
return r11;
|
|
}
|
|
getManySyncUnsafe(a0, a1) {
|
|
return this.table.getManySyncUnsafe([a0], a1);
|
|
}
|
|
getMapEntriesSyncUnsafe() {
|
|
return this.table.getMapEntriesSyncUnsafe();
|
|
}
|
|
}
|
|
class GuildDaoTransaction {
|
|
constructor(a0) {
|
|
this.state = a0;
|
|
}
|
|
static fromDatabaseTransaction(a0, a1, a2) {
|
|
const tableTransaction = new TableTransaction(a0, a1, a2);
|
|
const r20 = {
|
|
__proto__: GuildDaoTransaction.prototype
|
|
};
|
|
r20.state = tableTransaction;
|
|
return r20;
|
|
}
|
|
put(a0, a1, a2, r7 = ConflictOptions.Replace) {
|
|
this.putWithGeneration(a0, a1, a2, null, r7);
|
|
}
|
|
putWithGeneration(a0, a1, a2, a3, r4 = ConflictOptions.Replace) {
|
|
return this.state.put({
|
|
key: [a0, a1],
|
|
data: a2,
|
|
generation: a3
|
|
}, r4);
|
|
}
|
|
delete(a0, a1) {
|
|
const length = arguments.length;
|
|
if (length === 0) {
|
|
this.state.delete([]);
|
|
} else if (length === 1) {
|
|
this.state.delete([a0]);
|
|
} else {
|
|
this.state.delete([a0, a1]);
|
|
}
|
|
}
|
|
deleteGeneration(a0, a1) {
|
|
return this.state.deleteGeneration([], a0, a1);
|
|
}
|
|
}
|
|
export { GuildDao };
|
|
export { GuildDaoTransaction };
|