@moneypot/hub 0.0.2 → 1.0.0
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 +19 -6
- package/dist/src/plugins/hub-authenticate.js +1 -1
- package/package.json +7 -4
package/README.md
CHANGED
|
@@ -22,20 +22,33 @@ $ npm install @moneypot/hub
|
|
|
22
22
|
## Usage
|
|
23
23
|
|
|
24
24
|
```typescript
|
|
25
|
-
import {
|
|
25
|
+
import {
|
|
26
|
+
type ServerOptions,
|
|
27
|
+
defaultPlugins,
|
|
28
|
+
startAndListen,
|
|
29
|
+
} from "@moneypot/hub";
|
|
26
30
|
import path from "path";
|
|
27
31
|
|
|
28
32
|
const options: ServerOptions = {
|
|
29
|
-
//
|
|
33
|
+
// PostgreSQL schemas to expose to the GraphQL API
|
|
34
|
+
// This allows your application-specific tables to be accessible through GraphQL
|
|
30
35
|
extraPgSchemas: ["app"],
|
|
36
|
+
|
|
31
37
|
plugins: [
|
|
38
|
+
// These are required for the hub server to function
|
|
32
39
|
...defaultPlugins,
|
|
33
|
-
//
|
|
40
|
+
// Add your custom plugins here to extend server functionality
|
|
34
41
|
],
|
|
35
|
-
|
|
42
|
+
|
|
43
|
+
// File path where the generated GraphQL schema definition will be saved
|
|
36
44
|
exportSchemaSDLPath: path.join(import.meta.dirname, "../schema.graphql"),
|
|
37
|
-
|
|
38
|
-
|
|
45
|
+
|
|
46
|
+
// Optional: Directory containing migration files for your database
|
|
47
|
+
// When enabled, the server will automatically apply pending migrations on startup
|
|
48
|
+
userDatabaseMigrationsPath: path.join(
|
|
49
|
+
import.meta.dirname,
|
|
50
|
+
"../automigrations"
|
|
51
|
+
),
|
|
39
52
|
};
|
|
40
53
|
|
|
41
54
|
startAndListen(options)
|
|
@@ -53,7 +53,7 @@ export const HubAuthenticatePlugin = makeExtendSchemaPlugin(() => {
|
|
|
53
53
|
})
|
|
54
54
|
.then(maybeOneRow);
|
|
55
55
|
if (!casino) {
|
|
56
|
-
throw new GraphQLError(`
|
|
56
|
+
throw new GraphQLError(`hub server is unaware of casino with a base url of provided casinoBaseUrl`);
|
|
57
57
|
}
|
|
58
58
|
if (!casino.api_key) {
|
|
59
59
|
throw new GraphQLError("Casino secret not configured");
|
package/package.json
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@moneypot/hub",
|
|
3
|
-
"
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
"
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"author": "moneypot.com",
|
|
5
|
+
"homepage": "https://moneypot.com/hub",
|
|
6
|
+
"keywords": [
|
|
7
|
+
"moneypot"
|
|
8
|
+
],
|
|
9
|
+
"description": "Official MoneyPot hub server",
|
|
7
10
|
"type": "module",
|
|
8
11
|
"main": "dist/src/index.js",
|
|
9
12
|
"types": "dist/src/index.d.ts",
|