@moneypot/hub 1.17.0-dev.1 → 1.17.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/cli/add-casino.js +6 -3
- package/dist/dashboard/assets/index-32DtKox_.css +5 -0
- package/dist/dashboard/assets/index-B4xPUnuF.js +412 -0
- package/dist/dashboard/index.html +2 -2
- package/dist/src/__generated__/graphql.d.ts +74 -32
- package/dist/src/__generated__/graphql.js +23 -14
- package/dist/src/db/index.js +29 -13
- package/dist/src/db/transaction.js +1 -1
- package/dist/src/hash-chain/db-hash-chain.d.ts +2 -1
- package/dist/src/hash-chain/db-hash-chain.js +11 -16
- package/dist/src/hash-chain/plugins/hub-reveal-hash-chain.js +9 -10
- package/dist/src/hash-chain/reveal-hash-chain.d.ts +3 -3
- package/dist/src/hash-chain/reveal-hash-chain.js +28 -5
- package/dist/src/plugins/chat/hub-chat-subscription.d.ts +1 -1
- package/dist/src/plugins/hub-authenticate.js +5 -5
- package/dist/src/plugins/hub-make-outcome-bet.d.ts +4 -44
- package/dist/src/plugins/hub-make-outcome-bet.js +2 -1
- package/dist/src/plugins/hub-put-alert.js +2 -2
- package/dist/src/plugins/listen-with-filter.d.ts +4 -3
- package/dist/src/plugins/listen-with-filter.js +65 -8
- package/dist/src/plugins/validate-fields.js +25 -33
- package/dist/src/process-transfers/index.js +1 -1
- package/dist/src/risk-policy.js +1 -1
- package/dist/src/server/index.js +1 -1
- package/dist/src/services/jwt-service.js +1 -1
- package/dist/src/take-request/process-take-request.js +19 -13
- package/dist/src/validate-zod.d.ts +3 -0
- package/dist/src/validate-zod.js +19 -0
- package/package.json +3 -4
- package/dist/dashboard/assets/index-D7SlWXgD.js +0 -383
- package/dist/dashboard/assets/index-LZVcTrKv.css +0 -5
- package/dist/src/validate.d.ts +0 -9
- package/dist/src/validate.js +0 -91
package/dist/src/validate.js
DELETED
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
import * as Yup from "yup";
|
|
2
|
-
import * as util from "./util.js";
|
|
3
|
-
export const isUuid = {
|
|
4
|
-
name: "uuid",
|
|
5
|
-
message: "Must be a valid UUID",
|
|
6
|
-
test(value) {
|
|
7
|
-
return value === undefined || util.isUuid(value);
|
|
8
|
-
},
|
|
9
|
-
};
|
|
10
|
-
const isUrl = {
|
|
11
|
-
name: "url",
|
|
12
|
-
message: "URL must be valid",
|
|
13
|
-
test(value, _ctx) {
|
|
14
|
-
if (value === undefined)
|
|
15
|
-
return true;
|
|
16
|
-
try {
|
|
17
|
-
new URL(value || "");
|
|
18
|
-
return true;
|
|
19
|
-
}
|
|
20
|
-
catch {
|
|
21
|
-
return false;
|
|
22
|
-
}
|
|
23
|
-
},
|
|
24
|
-
};
|
|
25
|
-
const isHttpProtocol = {
|
|
26
|
-
name: "http-protocol",
|
|
27
|
-
message: "URL must use http or https protocol",
|
|
28
|
-
test(value) {
|
|
29
|
-
if (value === undefined)
|
|
30
|
-
return true;
|
|
31
|
-
try {
|
|
32
|
-
const url = new URL(value || "");
|
|
33
|
-
return url.protocol === "http:" || url.protocol === "https:";
|
|
34
|
-
}
|
|
35
|
-
catch {
|
|
36
|
-
return false;
|
|
37
|
-
}
|
|
38
|
-
},
|
|
39
|
-
};
|
|
40
|
-
const isBaseUrl = {
|
|
41
|
-
name: "base-url",
|
|
42
|
-
message: "URL must be a base URL with no path, query, nor hash",
|
|
43
|
-
test(value) {
|
|
44
|
-
if (value === undefined)
|
|
45
|
-
return true;
|
|
46
|
-
try {
|
|
47
|
-
const url = new URL(value || "");
|
|
48
|
-
return url.pathname === "/" && url.search === "" && url.hash === "";
|
|
49
|
-
}
|
|
50
|
-
catch {
|
|
51
|
-
return false;
|
|
52
|
-
}
|
|
53
|
-
},
|
|
54
|
-
};
|
|
55
|
-
const isGraphqlUrl = {
|
|
56
|
-
name: "graphql-url-path",
|
|
57
|
-
message: "URL must be have /graphql path",
|
|
58
|
-
test(value) {
|
|
59
|
-
if (value === undefined)
|
|
60
|
-
return true;
|
|
61
|
-
try {
|
|
62
|
-
const url = new URL(value || "");
|
|
63
|
-
return url.pathname === "/graphql";
|
|
64
|
-
}
|
|
65
|
-
catch {
|
|
66
|
-
return false;
|
|
67
|
-
}
|
|
68
|
-
},
|
|
69
|
-
};
|
|
70
|
-
const doesNotHaveTrailingSlash = {
|
|
71
|
-
name: "does-not-have-trailing-slash",
|
|
72
|
-
message: "URL must not have a trailing slash",
|
|
73
|
-
test(value) {
|
|
74
|
-
if (value === undefined)
|
|
75
|
-
return true;
|
|
76
|
-
return !value.endsWith("/");
|
|
77
|
-
},
|
|
78
|
-
};
|
|
79
|
-
export const graphqlUrl = () => Yup.string()
|
|
80
|
-
.trim()
|
|
81
|
-
.test(isUrl)
|
|
82
|
-
.test(isHttpProtocol)
|
|
83
|
-
.test(isGraphqlUrl)
|
|
84
|
-
.test(doesNotHaveTrailingSlash);
|
|
85
|
-
export const baseUrl = () => Yup.string()
|
|
86
|
-
.trim()
|
|
87
|
-
.test(isUrl)
|
|
88
|
-
.test(isHttpProtocol)
|
|
89
|
-
.test(isBaseUrl)
|
|
90
|
-
.test(doesNotHaveTrailingSlash);
|
|
91
|
-
export const uuid = () => Yup.string().trim().test(isUuid);
|