@moneypot/hub 1.15.0-dev.1 → 1.15.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/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.
@@ -18,6 +18,7 @@ declare global {
18
18
  }
19
19
  }
20
20
  export { MakeOutcomeBetPlugin, type OutcomeBetConfigMap, type OutcomeBetConfig, } from "./plugins/hub-make-outcome-bet.js";
21
+ export { HubCreatePlaygroundSessionPlugin } from "./plugins/hub-create-playground-session.js";
21
22
  export { validateRisk, type RiskPolicy, type RiskPolicyArgs, type RiskLimits, } from "./risk-policy.js";
22
23
  export type PluginContext = Grafast.Context;
23
24
  export { defaultPlugins, type PluginIdentity, type UserSessionContext, } from "./server/graphile.config.js";
package/dist/src/index.js CHANGED
@@ -7,6 +7,7 @@ import { join } from "path";
7
7
  import { logger } from "./logger.js";
8
8
  import { createServerContext, closeServerContext, } from "./context.js";
9
9
  export { MakeOutcomeBetPlugin, } from "./plugins/hub-make-outcome-bet.js";
10
+ export { HubCreatePlaygroundSessionPlugin } from "./plugins/hub-create-playground-session.js";
10
11
  export { validateRisk, } from "./risk-policy.js";
11
12
  export { defaultPlugins, } from "./server/graphile.config.js";
12
13
  async function initialize(options) {
@@ -1,5 +1,5 @@
1
1
  import { GraphQLError } from "graphql";
2
- import { gql, makeExtendSchemaPlugin } from "postgraphile/utils";
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 = makeExtendSchemaPlugin(() => {
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: [
@@ -25,13 +25,11 @@ import { HubOutcomeInputNonNullFieldsPlugin } from "../plugins/hub-outcome-input
25
25
  import { HubPutAlertPlugin } from "../plugins/hub-put-alert.js";
26
26
  import { HubRevealHashChainPlugin } from "../hash-chain/plugins/hub-reveal-hash-chain.js";
27
27
  import { HubPreimageHashFieldPlugin } from "../hash-chain/plugins/hub-preimage-hash-field.js";
28
- import { HubCreatePlaygroundSessionPlugin } from "../plugins/hub-create-playground-session.js";
29
28
  export const requiredPlugins = [
30
29
  SmartTagsPlugin,
31
30
  IdToNodeIdPlugin,
32
31
  HubPrefixPlugin,
33
32
  HubAuthenticatePlugin,
34
- HubCreatePlaygroundSessionPlugin,
35
33
  HubCurrentXPlugin,
36
34
  HubBalanceAlertPlugin,
37
35
  HubPutAlertPlugin,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moneypot/hub",
3
- "version": "1.15.0-dev.1",
3
+ "version": "1.15.0-dev.3",
4
4
  "author": "moneypot.com",
5
5
  "homepage": "https://moneypot.com/hub",
6
6
  "keywords": [