@moneypot/hub 1.20.0 → 1.20.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/dist/src/test/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { DbUser, DbPlayerBalance, DbHashChain, DbCasino, DbExperience, DbCurrenc
|
|
|
3
3
|
import { GraphQLClient } from "graphql-request";
|
|
4
4
|
import { ServerOptions } from "../index.js";
|
|
5
5
|
import type { QueryExecutor } from "../db/util.js";
|
|
6
|
-
import {
|
|
6
|
+
import { LiabilityConfig } from "../liability/public/config.js";
|
|
7
7
|
export { type QueryExecutor };
|
|
8
8
|
export declare function uniqueTestId(): string;
|
|
9
9
|
export type HubTestServer = {
|
|
@@ -65,7 +65,7 @@ export declare function getPlayerBalance(pgClient: QueryExecutor, { userId, expe
|
|
|
65
65
|
currencyKey: DbCurrency["key"];
|
|
66
66
|
}): Promise<DbPlayerBalance | null>;
|
|
67
67
|
export declare function processOneDeadlinedLiability<RefType extends string>(dbPool: pg.Pool, { liabilityConfig, refType, refId, }: {
|
|
68
|
-
liabilityConfig:
|
|
68
|
+
liabilityConfig: LiabilityConfig<RefType>;
|
|
69
69
|
refType: RefType;
|
|
70
70
|
refId: string;
|
|
71
71
|
}): Promise<void>;
|
package/dist/src/test/index.js
CHANGED
|
@@ -176,13 +176,16 @@ export async function getPlayerBalance(pgClient, { userId, experienceId, currenc
|
|
|
176
176
|
.then((row) => row ?? null);
|
|
177
177
|
}
|
|
178
178
|
export async function processOneDeadlinedLiability(dbPool, { liabilityConfig, refType, refId, }) {
|
|
179
|
+
if (!("_refTypes" in liabilityConfig)) {
|
|
180
|
+
throw new Error("liabilityConfig must be created via createLiabilityConfig()");
|
|
181
|
+
}
|
|
179
182
|
await withPgPoolTransaction(dbPool, async (pgClient) => {
|
|
180
183
|
const dbLiability = await dbGetLiabilityByRef(pgClient, { refType, refId });
|
|
181
184
|
if (!dbLiability) {
|
|
182
185
|
throw new Error(`Liability not found: refType=${refType}, refId=${refId}`);
|
|
183
186
|
}
|
|
184
187
|
return internalProcessOneDeadlinedLiability(pgClient, {
|
|
185
|
-
liabilityConfig,
|
|
188
|
+
liabilityConfig: liabilityConfig,
|
|
186
189
|
liabilityId: dbLiability.id,
|
|
187
190
|
});
|
|
188
191
|
});
|