@moneypot/hub 1.15.0-dev.1 → 1.15.0-dev.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/README.md
CHANGED
|
@@ -76,6 +76,12 @@ insert into hub.api_key default values returning key;
|
|
|
76
76
|
|
|
77
77
|
## Changelog
|
|
78
78
|
|
|
79
|
+
### 1.15.x
|
|
80
|
+
|
|
81
|
+
- Added a "playground" casino (`hub.casino.is_playground = true`) that lets skin devs create ephemeral sessions for testing.
|
|
82
|
+
- Added `hubCreatePlaygroundSession` mutation to create a playground session.
|
|
83
|
+
- It's a drop-in replacement for `hubAuthenticate({ userToken, baseCasinoUrl })` when you're testing your experience outside of the MoneyPot.com iframe (thus you don't have a userToken).
|
|
84
|
+
|
|
79
85
|
### 1.14.x
|
|
80
86
|
|
|
81
87
|
- Added `preimageHash` field to `HubHashChain` to expose the preimage hash for a hash chain if it's revealed.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { GraphQLError } from "graphql";
|
|
2
|
-
import {
|
|
2
|
+
import { extendSchema, gql } from "postgraphile/utils";
|
|
3
3
|
import { exactlyOneRow, maybeOneRow } from "../db/util.js";
|
|
4
4
|
import { constant, context, object, sideEffect } from "postgraphile/grafast";
|
|
5
5
|
import { withPgPoolTransaction, } from "../db/index.js";
|
|
@@ -9,7 +9,7 @@ import { prettifyError } from "zod/v4";
|
|
|
9
9
|
const InputSchema = z.object({
|
|
10
10
|
dummy: z.string().optional(),
|
|
11
11
|
});
|
|
12
|
-
export const HubCreatePlaygroundSessionPlugin =
|
|
12
|
+
export const HubCreatePlaygroundSessionPlugin = extendSchema(() => {
|
|
13
13
|
return {
|
|
14
14
|
typeDefs: gql `
|
|
15
15
|
input HubCreatePlaygroundSessionInput {
|
|
@@ -100,8 +100,8 @@ export const HubCreatePlaygroundSessionPlugin = makeExtendSchemaPlugin(() => {
|
|
|
100
100
|
const dbSession = await pgClient
|
|
101
101
|
.query({
|
|
102
102
|
text: `
|
|
103
|
-
INSERT INTO hub.session(casino_id, user_id, experience_id, user_token)
|
|
104
|
-
VALUES($1, $2, $3, $4)
|
|
103
|
+
INSERT INTO hub.session(casino_id, user_id, experience_id, user_token, expired_at)
|
|
104
|
+
VALUES($1, $2, $3, $4, now() + interval '1 hour')
|
|
105
105
|
RETURNING id, key
|
|
106
106
|
`,
|
|
107
107
|
values: [
|