@moneypot/hub 1.19.15 → 1.19.17

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.
@@ -4,8 +4,8 @@
4
4
  <meta charset="UTF-8" />
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
6
  <title>Dashboard</title>
7
- <script type="module" crossorigin src="/dashboard/assets/index-BlgWJql2.js"></script>
8
- <link rel="stylesheet" crossorigin href="/dashboard/assets/index-32DtKox_.css">
7
+ <script type="module" crossorigin src="/dashboard/assets/index-QbfKgHTj.js"></script>
8
+ <link rel="stylesheet" crossorigin href="/dashboard/assets/index-Bl5lLFHa.css">
9
9
  </head>
10
10
  <body>
11
11
  <div id="root"></div>
@@ -57,6 +57,7 @@ export const HubAddCasinoPlugin = makeExtendSchemaPlugin((build) => {
57
57
  }
58
58
  assert(is(input));
59
59
  const { name, baseUrl, graphqlUrl, apiKey } = input;
60
+ logger.info({ name, baseUrl, graphqlUrl }, "Input");
60
61
  const graphqlClient = new GraphQLClient(graphqlUrl, {
61
62
  headers: {
62
63
  Authorization: `apikey:${apiKey}`,
@@ -68,7 +69,7 @@ export const HubAddCasinoPlugin = makeExtendSchemaPlugin((build) => {
68
69
  .catch((e) => {
69
70
  if (e.cause?.code === "ECONNREFUSED" ||
70
71
  e.cause?.code === "ENOTFOUND") {
71
- throw new GraphQLError(`Cannot connect to graphqlUrl`);
72
+ throw new GraphQLError(`Cannot connect to casino graphql url: ${graphqlUrl}`);
72
73
  }
73
74
  throw e;
74
75
  });
@@ -145,6 +146,9 @@ export const HubAddCasinoPlugin = makeExtendSchemaPlugin((build) => {
145
146
  pool: superuserPool,
146
147
  });
147
148
  return casino.id;
149
+ }).catch((e) => {
150
+ logger.error(e, "Error adding casino");
151
+ throw e;
148
152
  });
149
153
  });
150
154
  return object({
@@ -1 +1,8 @@
1
+ import z from "zod/v4";
2
+ export declare const AddCasinoSchema: z.ZodObject<{
3
+ name: z.ZodString;
4
+ baseUrl: z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<URL, string>>, z.ZodTransform<string, URL>>;
5
+ graphqlUrl: z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<URL, string>>, z.ZodTransform<string, URL>>;
6
+ apiKey: z.ZodUUID;
7
+ }, z.core.$strict>;
1
8
  export declare const ValidateCasinoFieldsPlugin: GraphileConfig.Plugin;
@@ -23,7 +23,7 @@ const CasinoPatchSchema = z.strictObject({
23
23
  graphqlUrl: v.graphqlUrl().optional(),
24
24
  baseUrl: v.baseUrl().optional(),
25
25
  });
26
- const AddCasinoSchema = z.strictObject({
26
+ export const AddCasinoSchema = z.strictObject({
27
27
  name: z.string().trim().min(1),
28
28
  baseUrl: v.baseUrl(),
29
29
  graphqlUrl: v.graphqlUrl(),
@@ -50,7 +50,7 @@ async function mpGetExperienceTransfer(graphqlClient, id) {
50
50
  return mpTransfer;
51
51
  }
52
52
  export function startWebsocketProcessor({ casinoId, graphqlUrl, signal, controllerId, apiKey, pool, }) {
53
- logger.info(`Starting websocket processor for ${graphqlUrl} using apiKey ${apiKey}`);
53
+ logger.info(`Starting websocket processor for ${graphqlUrl}`);
54
54
  const client = createWebsocketClient({
55
55
  url: httpToWs(new URL(graphqlUrl)).toString(),
56
56
  connectionParams: {
package/package.json CHANGED
@@ -1,13 +1,12 @@
1
1
  {
2
2
  "name": "@moneypot/hub",
3
- "version": "1.19.15",
3
+ "version": "1.19.17",
4
4
  "author": "moneypot.com",
5
5
  "homepage": "https://moneypot.com/hub",
6
6
  "keywords": [
7
7
  "moneypot"
8
8
  ],
9
9
  "description": "Official MoneyPot hub server",
10
- "packageManager": "pnpm@10.25.0",
11
10
  "type": "module",
12
11
  "main": "dist/src/index.js",
13
12
  "types": "dist/src/index.d.ts",
@@ -35,24 +34,6 @@
35
34
  "add-casino": "./dist/cli/add-casino.js",
36
35
  "db-migrate": "./dist/cli/db-migrate.js"
37
36
  },
38
- "scripts": {
39
- "build:hub": "tsc && cp -R src/pg-versions dist/src/ && ./scripts/strip-sql.sh",
40
- "build": "pnpm run build:hub && pnpm run build-dashboard",
41
- "check": "tsc --noEmit && pnpm run check-dashboard",
42
- "check-tests": "tsc -p tests/tsconfig.json --noEmit",
43
- "check-dashboard": "cd ./dashboard && pnpm run check",
44
- "format": "prettier --write \"**/*.ts\"",
45
- "lint": "eslint --fix . && pnpm run lint-dashboard",
46
- "lint-dashboard": "cd ./dashboard && pnpm run lint",
47
- "prepublishOnly": "pnpm run build",
48
- "codegen": "npx graphql-codegen",
49
- "codegen-watch": "graphql-codegen --watch",
50
- "build-dashboard": "cd ./dashboard && pnpm run build && rm -rf ../dist/dashboard && cp -Rv dist ../dist/dashboard",
51
- "test:startup": "dropdb --if-exists hub-test && createdb hub-test && SUPERUSER_DATABASE_URL=postgres://localhost:5432/hub-test DATABASE_URL=postgres://localhost:5432/hub-test tsx src/test-startup.ts",
52
- "test": "vitest run",
53
- "test:watch": "vitest",
54
- "test:bail": "pnpm test -- --bail --silent --reporter=basic 2>&1 | head -25"
55
- },
56
37
  "dependencies": {
57
38
  "@graphile-contrib/pg-omit-archived": "4.0.0-rc.1",
58
39
  "@moneypot/hash-herald": "^1.0.0",
@@ -95,5 +76,22 @@
95
76
  "optionalDependencies": {
96
77
  "@moneypot/server": "file:../moneypot-server"
97
78
  },
98
- "license": "UNLICENSED"
99
- }
79
+ "license": "UNLICENSED",
80
+ "scripts": {
81
+ "build:hub": "tsc && cp -R src/pg-versions dist/src/ && ./scripts/strip-sql.sh",
82
+ "build": "pnpm run build:hub && pnpm run build-dashboard",
83
+ "check": "tsc --noEmit && pnpm run check-dashboard",
84
+ "check-tests": "tsc -p tests/tsconfig.json --noEmit",
85
+ "check-dashboard": "cd ./dashboard && pnpm run check",
86
+ "format": "prettier --write \"**/*.ts\"",
87
+ "lint": "eslint --fix . && pnpm run lint-dashboard",
88
+ "lint-dashboard": "cd ./dashboard && pnpm run lint",
89
+ "codegen": "npx graphql-codegen",
90
+ "codegen-watch": "graphql-codegen --watch",
91
+ "build-dashboard": "cd ./dashboard && pnpm run build && rm -rf ../dist/dashboard && cp -Rv dist ../dist/dashboard",
92
+ "test:startup": "dropdb --if-exists hub-test && createdb hub-test && SUPERUSER_DATABASE_URL=postgres://localhost:5432/hub-test DATABASE_URL=postgres://localhost:5432/hub-test tsx src/test-startup.ts",
93
+ "test": "vitest run",
94
+ "test:watch": "vitest",
95
+ "test:bail": "pnpm test -- --bail --silent --reporter=basic 2>&1 | head -25"
96
+ }
97
+ }