@moneypot/hub 1.12.0-dev.1 → 1.12.0-dev.3
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/audit-log.d.ts +4 -3
- package/dist/src/audit-log.js +1 -1
- package/package.json +3 -2
package/dist/src/audit-log.d.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { DbBalance, DbBankroll } from "./db/types.js";
|
|
2
2
|
import { QueryExecutor } from "./db/util.js";
|
|
3
3
|
export type AuditLogType = "player-balance" | "house-bankroll" | "both";
|
|
4
|
-
type
|
|
5
|
-
type
|
|
4
|
+
export type HubAuditAction = "hub:init" | "hub:deposit" | "hub:take_request:pending" | "hub:take_request:refund" | "hub:outcome_bet";
|
|
5
|
+
export type HubAuditRefType = "hub.deposit" | "hub.outcome_bet" | "hub.take_request";
|
|
6
|
+
export type AuditAction = HubAuditAction | (string & {});
|
|
7
|
+
export type AuditRefType = HubAuditRefType | (string & {});
|
|
6
8
|
export type BaseAudit = {
|
|
7
9
|
action: AuditAction;
|
|
8
10
|
metadata?: Record<string, unknown> | null;
|
|
@@ -29,4 +31,3 @@ export type NewBothAudit = NewBalanceAudit & NewBankrollAudit;
|
|
|
29
31
|
export declare function insertAuditLog(pgClient: QueryExecutor, type: "player-balance", audit: NewBalanceAudit & BaseAudit): Promise<void>;
|
|
30
32
|
export declare function insertAuditLog(pgClient: QueryExecutor, type: "house-bankroll", audit: NewBankrollAudit & BaseAudit): Promise<void>;
|
|
31
33
|
export declare function insertAuditLog(pgClient: QueryExecutor, type: "both", audit: NewBothAudit & BaseAudit): Promise<void>;
|
|
32
|
-
export {};
|
package/dist/src/audit-log.js
CHANGED
|
@@ -21,7 +21,7 @@ export async function insertAuditLog(pgClient, type, audit) {
|
|
|
21
21
|
)
|
|
22
22
|
VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12)
|
|
23
23
|
`, buildAuditParams(type, audit));
|
|
24
|
-
logger.
|
|
24
|
+
logger.debug({ ...audit }, "audit log inserted");
|
|
25
25
|
}
|
|
26
26
|
function buildAuditParams(type, audit) {
|
|
27
27
|
const balance = type === "player-balance" || type === "both"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@moneypot/hub",
|
|
3
|
-
"version": "1.12.0-dev.
|
|
3
|
+
"version": "1.12.0-dev.3",
|
|
4
4
|
"author": "moneypot.com",
|
|
5
5
|
"homepage": "https://moneypot.com/hub",
|
|
6
6
|
"keywords": [
|
|
@@ -22,7 +22,8 @@
|
|
|
22
22
|
"./express": "./dist/src/express.js",
|
|
23
23
|
"./dataplan/pg": "./dist/src/dataplan/pg.js",
|
|
24
24
|
"./hash-chain": "./dist/src/hash-chain/index.js",
|
|
25
|
-
"./logger": "./dist/src/logger.js"
|
|
25
|
+
"./logger": "./dist/src/logger.js",
|
|
26
|
+
"./audit-log": "./dist/src/audit-log.js"
|
|
26
27
|
},
|
|
27
28
|
"files": [
|
|
28
29
|
"/dist"
|