@truelab/trueserver 0.0.3 → 0.0.6

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.
Files changed (132) hide show
  1. package/CHANGELOG.md +33 -0
  2. package/MIGRATION.md +303 -0
  3. package/README.md +96 -98
  4. package/dist/application.d.ts.map +1 -1
  5. package/dist/application.js +9 -5
  6. package/dist/application.js.map +1 -1
  7. package/dist/examples.d.ts +7 -0
  8. package/dist/examples.d.ts.map +1 -0
  9. package/dist/examples.js +18 -0
  10. package/dist/examples.js.map +1 -0
  11. package/dist/helpers/config.helper.d.ts +4 -1
  12. package/dist/helpers/config.helper.d.ts.map +1 -1
  13. package/dist/helpers/config.helper.js +26 -0
  14. package/dist/helpers/config.helper.js.map +1 -1
  15. package/dist/helpers/errors.helper.d.ts +18 -0
  16. package/dist/helpers/errors.helper.d.ts.map +1 -0
  17. package/dist/helpers/errors.helper.js +20 -0
  18. package/dist/helpers/errors.helper.js.map +1 -0
  19. package/dist/helpers/fastify.helper.d.ts +5 -1
  20. package/dist/helpers/fastify.helper.d.ts.map +1 -1
  21. package/dist/helpers/fastify.helper.js +3 -1
  22. package/dist/helpers/fastify.helper.js.map +1 -1
  23. package/dist/helpers/handlers.helper.d.ts +10 -1
  24. package/dist/helpers/handlers.helper.d.ts.map +1 -1
  25. package/dist/helpers/handlers.helper.js +2 -1
  26. package/dist/helpers/handlers.helper.js.map +1 -1
  27. package/dist/index.d.ts +6 -4
  28. package/dist/index.d.ts.map +1 -1
  29. package/dist/index.js +7 -4
  30. package/dist/index.js.map +1 -1
  31. package/dist/plugins/404.plugin.d.ts.map +1 -1
  32. package/dist/plugins/404.plugin.js +2 -1
  33. package/dist/plugins/404.plugin.js.map +1 -1
  34. package/dist/plugins/apikey.plugin.d.ts.map +1 -1
  35. package/dist/plugins/apikey.plugin.js +6 -7
  36. package/dist/plugins/apikey.plugin.js.map +1 -1
  37. package/dist/plugins/error.plugin.d.ts.map +1 -1
  38. package/dist/plugins/error.plugin.js +6 -2
  39. package/dist/plugins/error.plugin.js.map +1 -1
  40. package/dist/plugins/sentry.plugin.js +2 -2
  41. package/dist/plugins/sentry.plugin.js.map +1 -1
  42. package/dist/plugins/swagger.plugin.d.ts.map +1 -1
  43. package/dist/plugins/swagger.plugin.js +5 -1
  44. package/dist/plugins/swagger.plugin.js.map +1 -1
  45. package/dist/routes/checksum/checksum.route.d.ts +3 -0
  46. package/dist/routes/checksum/checksum.route.d.ts.map +1 -0
  47. package/dist/routes/checksum/checksum.route.js +21 -0
  48. package/dist/routes/checksum/checksum.route.js.map +1 -0
  49. package/dist/routes/checksum/index.d.ts +3 -0
  50. package/dist/routes/checksum/index.d.ts.map +1 -0
  51. package/dist/routes/checksum/index.js +12 -0
  52. package/dist/routes/checksum/index.js.map +1 -0
  53. package/dist/routes/client/client.route.d.ts +3 -0
  54. package/dist/routes/client/client.route.d.ts.map +1 -0
  55. package/dist/routes/{client.route.js → client/client.route.js} +5 -5
  56. package/dist/routes/client/client.route.js.map +1 -0
  57. package/dist/routes/client/index.d.ts +3 -0
  58. package/dist/routes/client/index.d.ts.map +1 -0
  59. package/dist/routes/client/index.js +12 -0
  60. package/dist/routes/client/index.js.map +1 -0
  61. package/dist/routes/config/config.route.js +1 -1
  62. package/dist/routes/config/config.route.js.map +1 -1
  63. package/dist/routes/config/config.route.validate.plugin.d.ts.map +1 -1
  64. package/dist/routes/config/config.route.validate.plugin.js +43 -17
  65. package/dist/routes/config/config.route.validate.plugin.js.map +1 -1
  66. package/dist/routes/play/play.route.validate.plugin.d.ts +9 -9
  67. package/dist/routes/play/play.route.validate.plugin.d.ts.map +1 -1
  68. package/dist/routes/play/play.route.validate.plugin.js +84 -40
  69. package/dist/routes/play/play.route.validate.plugin.js.map +1 -1
  70. package/dist/routes/validate/validate.route.validate.plugin.d.ts.map +1 -1
  71. package/dist/routes/validate/validate.route.validate.plugin.js +9 -3
  72. package/dist/routes/validate/validate.route.validate.plugin.js.map +1 -1
  73. package/dist/routes-public/healthcheck.route.d.ts.map +1 -0
  74. package/dist/{routes → routes-public}/healthcheck.route.js +4 -10
  75. package/dist/routes-public/healthcheck.route.js.map +1 -0
  76. package/dist/schemas/checksum.schema.d.ts +11 -0
  77. package/dist/schemas/checksum.schema.d.ts.map +1 -0
  78. package/dist/schemas/checksum.schema.js +26 -0
  79. package/dist/schemas/checksum.schema.js.map +1 -0
  80. package/dist/schemas/client.schema.d.ts +1 -1
  81. package/dist/schemas/client.schema.js +4 -4
  82. package/dist/schemas/client.schema.js.map +1 -1
  83. package/dist/schemas/config.schema.d.ts +17 -20
  84. package/dist/schemas/config.schema.d.ts.map +1 -1
  85. package/dist/schemas/config.schema.js +41 -42
  86. package/dist/schemas/config.schema.js.map +1 -1
  87. package/dist/schemas/examples/checksum.schema.examples.d.ts +3 -0
  88. package/dist/schemas/examples/checksum.schema.examples.d.ts.map +1 -0
  89. package/dist/schemas/examples/checksum.schema.examples.js +26 -0
  90. package/dist/schemas/examples/checksum.schema.examples.js.map +1 -0
  91. package/dist/schemas/examples/client.schema.examples.d.ts.map +1 -1
  92. package/dist/schemas/examples/client.schema.examples.js +15 -18
  93. package/dist/schemas/examples/client.schema.examples.js.map +1 -1
  94. package/dist/schemas/examples/config.schema.examples.d.ts.map +1 -1
  95. package/dist/schemas/examples/config.schema.examples.js +30 -34
  96. package/dist/schemas/examples/config.schema.examples.js.map +1 -1
  97. package/dist/schemas/examples/healthcheck.schema.examples.d.ts.map +1 -1
  98. package/dist/schemas/examples/healthcheck.schema.examples.js +3 -14
  99. package/dist/schemas/examples/healthcheck.schema.examples.js.map +1 -1
  100. package/dist/schemas/examples/play.schema.examples.d.ts.map +1 -1
  101. package/dist/schemas/examples/play.schema.examples.js +66 -130
  102. package/dist/schemas/examples/play.schema.examples.js.map +1 -1
  103. package/dist/schemas/examples/validate.schema.examples.d.ts.map +1 -1
  104. package/dist/schemas/examples/validate.schema.examples.js +1 -3
  105. package/dist/schemas/examples/validate.schema.examples.js.map +1 -1
  106. package/dist/schemas/healthcheck.schema.d.ts +2 -20
  107. package/dist/schemas/healthcheck.schema.d.ts.map +1 -1
  108. package/dist/schemas/healthcheck.schema.js +10 -41
  109. package/dist/schemas/healthcheck.schema.js.map +1 -1
  110. package/dist/schemas/play.schema.d.ts +21 -16
  111. package/dist/schemas/play.schema.d.ts.map +1 -1
  112. package/dist/schemas/play.schema.js +36 -45
  113. package/dist/schemas/play.schema.js.map +1 -1
  114. package/dist/schemas/shared.d.ts +13 -21
  115. package/dist/schemas/shared.d.ts.map +1 -1
  116. package/dist/schemas/shared.js +56 -72
  117. package/dist/schemas/shared.js.map +1 -1
  118. package/dist/schemas/validate.schema.d.ts +2 -3
  119. package/dist/schemas/validate.schema.d.ts.map +1 -1
  120. package/dist/schemas/validate.schema.js +2 -5
  121. package/dist/schemas/validate.schema.js.map +1 -1
  122. package/package.json +10 -2
  123. package/dist/plugins/metrics.plugin.d.ts +0 -9
  124. package/dist/plugins/metrics.plugin.d.ts.map +0 -1
  125. package/dist/plugins/metrics.plugin.js +0 -24
  126. package/dist/plugins/metrics.plugin.js.map +0 -1
  127. package/dist/routes/client.route.d.ts +0 -3
  128. package/dist/routes/client.route.d.ts.map +0 -1
  129. package/dist/routes/client.route.js.map +0 -1
  130. package/dist/routes/healthcheck.route.d.ts.map +0 -1
  131. package/dist/routes/healthcheck.route.js.map +0 -1
  132. /package/dist/{routes → routes-public}/healthcheck.route.d.ts +0 -0
@@ -1,165 +1,101 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.playReplyExamples = exports.playRequestExamples = void 0;
4
- const minimalRequest = {
5
- demo: true,
4
+ const openingStepRequest = {
5
+ isDemo: false,
6
6
  currencyDecimals: 2,
7
+ stepIndex: 0,
7
8
  stakes: [{
8
- name: 'default', amount: 3,
9
+ name: 'default',
10
+ amount: 1.0,
11
+ coinValue: 0.1,
12
+ level: 9,
9
13
  }],
10
- isGambleAllowed: false,
11
- metaPublic: '{}',
12
- metaPrivate: '{}',
13
14
  };
14
- const maximalRequest = {
15
- demo: true,
15
+ const continuationStepRequest = {
16
+ isDemo: false,
16
17
  currencyDecimals: 2,
17
- stakes: [{
18
- name: 'slider',
19
- amount: 6,
20
- level: 1,
21
- qty: 1,
22
- params: JSON.stringify({
23
- left: 10, right: 90,
24
- }),
25
- }, {
26
- name: 'cell',
27
- amount: 75,
28
- level: 2,
29
- qty: 6,
30
- params: JSON.stringify({
31
- value: 14,
32
- }),
33
- }],
34
- isGambleAllowed: true,
35
- test: JSON.stringify({
36
- symbols: {
37
- value: 'Wild',
38
- },
39
- randomNumbers: {
40
- value: '0,0,0,0,0',
41
- },
42
- }),
43
- metaPublic: JSON.stringify({
44
- someProgress: 15,
45
- }),
46
- metaPrivate: JSON.stringify({
47
- coinsTotal: 1480,
48
- }),
49
- choice: 2,
50
- };
51
- const buyBonusRequest = {
52
- ...minimalRequest,
53
- stakes: [{
54
- name: 'buyBonus', amount: 30,
55
- }],
56
- };
57
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
58
- const { stakes, ...withoutStakes } = minimalRequest;
59
- const makeChoiceRequest = {
60
- ...withoutStakes,
61
- choice: 0,
62
- metaPrivate: JSON.stringify({
63
- coinsTotal: 100,
64
- }),
65
- };
66
- const metaDataRequest = {
67
- ...minimalRequest,
68
- metaPublic: JSON.stringify({
69
- someProgress: 15,
70
- }),
71
- metaPrivate: JSON.stringify({
72
- hiddenProperty: 'value',
73
- }),
74
- };
75
- const cheatRequest = {
76
- ...minimalRequest,
77
- test: JSON.stringify({
78
- symbols: {
79
- value: 'Wild',
80
- },
81
- randomNumbers: {
82
- value: '0,0,0,0,0',
83
- },
84
- }),
85
- };
86
- const variabelLinesRequest = {
87
- ...minimalRequest,
88
- stakes: [{
89
- name: 'default', amount: 75, level: 2,
90
- }],
18
+ stepIndex: 1,
19
+ choice: 3,
20
+ meta: {
21
+ public: { someProgress: 15 },
22
+ private: { coinsTotal: 1480 },
23
+ },
91
24
  };
92
25
  const multiStakeRequest = {
93
- ...minimalRequest,
26
+ isDemo: false,
27
+ currencyDecimals: 2,
28
+ stepIndex: 0,
94
29
  stakes: [{
95
30
  name: 'red',
96
- amount: 10,
31
+ amount: 30,
97
32
  qty: 3,
98
33
  }, {
99
34
  name: 'single-27',
100
- amount: 2,
35
+ amount: 22,
101
36
  qty: 11,
102
37
  }],
103
38
  };
104
- const minimalReply = {
105
- ok: true,
106
- rng: '[{"value":57,"range":110},{"value":19,"range":126},{"value":4,"range":108},{"value":81,"range":122},{"value":2,"range":108}]',
107
- finished: true,
39
+ const cheatRequest = {
40
+ ...openingStepRequest,
41
+ test: JSON.stringify({
42
+ symbols: { value: 'Wild' },
43
+ randomNumbers: { value: '0,0,0,0,0' },
44
+ }),
45
+ };
46
+ const finishedReply = {
47
+ gameResponse: {},
48
+ rng: [
49
+ { value: 0.1234567 },
50
+ { value: 0.9876543 },
51
+ ],
108
52
  results: {
109
- response: '{"games":[{"type":"regular","spins":[{"coins":0,"fields":[{"coins":0,"symbols":{"coins":0,"original":[8,7,10,10,1,4,8,7,2,1,0,11,4,5,1],"final":[8,7,10,10,1,4,8,7,2,1,0,11,4,5,1],"payouts":[]},"features":{"scatters":{"positions":[2,3]}}}],"added":0}],"coins":0}],"totalResults":{"coins":0,"hasMaxWin":false,"hasChoices":false}}',
110
- winCash: 0.5,
111
- winCoins: 10,
53
+ coins: 250,
54
+ cashWin: 2.5,
55
+ finished: true,
112
56
  },
113
57
  };
114
- const maximalReply = {
115
- ...minimalReply,
116
- metaPrivate: '{"coinsTotal":1480}',
117
- metaPublic: '{"someProgress":15}',
118
- choices: [0],
119
- analytics: [{}],
58
+ const continuesWithChoiceReply = {
59
+ gameResponse: {},
60
+ rng: [
61
+ { value: 0.1234567 },
62
+ ],
63
+ results: {
64
+ cashWin: 0,
65
+ finished: false,
66
+ choices: [1, 3, 5],
67
+ meta: {
68
+ public: {},
69
+ private: {},
70
+ },
71
+ },
120
72
  };
121
73
  exports.playRequestExamples = {
122
- minimal: {
123
- summary: 'Minimal request',
124
- value: minimalRequest,
125
- },
126
- maximal: {
127
- summary: 'Maximal request',
128
- value: maximalRequest,
74
+ openingStep: {
75
+ summary: 'Opening step (round open)',
76
+ value: openingStepRequest,
129
77
  },
130
- buyBonus: {
131
- summary: 'Buy bonus',
132
- value: buyBonusRequest,
78
+ continuationStep: {
79
+ summary: 'Continuation step (in-round choice)',
80
+ value: continuationStepRequest,
133
81
  },
134
- makeChoice: {
135
- summary: 'Make choice',
136
- value: makeChoiceRequest,
137
- },
138
- metaData: {
139
- summary: 'Meta data',
140
- value: metaDataRequest,
82
+ multiStake: {
83
+ summary: 'Multi stake (hasMultiStake=true)',
84
+ value: multiStakeRequest,
141
85
  },
142
86
  cheat: {
143
- summary: 'Cheat',
87
+ summary: 'Cheat tool (non-production only)',
144
88
  value: cheatRequest,
145
89
  },
146
- variabelLines: {
147
- summary: 'Variable lines',
148
- value: variabelLinesRequest,
149
- },
150
- multiStake: {
151
- summary: 'Multi stake',
152
- value: multiStakeRequest,
153
- },
154
90
  };
155
91
  exports.playReplyExamples = {
156
- minimal: {
157
- summary: 'Minimal reply',
158
- value: minimalReply,
92
+ finished: {
93
+ summary: 'Round finishes in one step',
94
+ value: finishedReply,
159
95
  },
160
- maximal: {
161
- summary: 'Maximal reply',
162
- value: maximalReply,
96
+ continuesWithChoice: {
97
+ summary: 'Round continues with a choice',
98
+ value: continuesWithChoiceReply,
163
99
  },
164
100
  };
165
101
  //# sourceMappingURL=play.schema.examples.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"play.schema.examples.js","sourceRoot":"","sources":["../../../schemas/examples/play.schema.examples.ts"],"names":[],"mappings":";;;AAEA,MAAM,cAAc,GAAG;IACnB,IAAI,EAAE,IAAI;IACV,gBAAgB,EAAE,CAAC;IACnB,MAAM,EAAE,CAAC;YACL,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,CAAC;SAC7B,CAAC;IACF,eAAe,EAAE,KAAK;IACtB,UAAU,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,mBAAmB,GAAc;IAC1C,OAAO,EAAE;QACL,OAAO,EAAE,iBAAiB;QAC1B,KAAK,EAAE,cAAc;KACxB;IACD,OAAO,EAAE;QACL,OAAO,EAAE,iBAAiB;QAC1B,KAAK,EAAE,cAAc;KACxB;IACD,QAAQ,EAAE;QACN,OAAO,EAAE,WAAW;QACpB,KAAK,EAAE,eAAe;KACzB;IACD,UAAU,EAAE;QACR,OAAO,EAAE,aAAa;QACtB,KAAK,EAAE,iBAAiB;KAC3B;IACD,QAAQ,EAAE;QACN,OAAO,EAAE,WAAW;QACpB,KAAK,EAAE,eAAe;KACzB;IACD,KAAK,EAAE;QACH,OAAO,EAAE,OAAO;QAChB,KAAK,EAAE,YAAY;KACtB;IACD,aAAa,EAAE;QACX,OAAO,EAAE,gBAAgB;QACzB,KAAK,EAAE,oBAAoB;KAC9B;IACD,UAAU,EAAE;QACR,OAAO,EAAE,aAAa;QACtB,KAAK,EAAE,iBAAiB;KAC3B;CACJ,CAAA;AAEY,QAAA,iBAAiB,GAAc;IACxC,OAAO,EAAE;QACL,OAAO,EAAE,eAAe;QACxB,KAAK,EAAE,YAAY;KACtB;IACD,OAAO,EAAE;QACL,OAAO,EAAE,eAAe;QACxB,KAAK,EAAE,YAAY;KACtB;CACJ,CAAA"}
1
+ {"version":3,"file":"play.schema.examples.js","sourceRoot":"","sources":["../../../schemas/examples/play.schema.examples.ts"],"names":[],"mappings":";;;AAEA,MAAM,kBAAkB,GAAG;IACvB,MAAM,EAAE,KAAK;IACb,gBAAgB,EAAE,CAAC;IACnB,SAAS,EAAE,CAAC;IACZ,MAAM,EAAE,CAAC;YACL,IAAI,EAAE,SAAS;YACf,MAAM,EAAE,GAAG;YACX,SAAS,EAAE,GAAG;YACd,KAAK,EAAE,CAAC;SACX,CAAC;CACL,CAAA;AAED,MAAM,uBAAuB,GAAG;IAC5B,MAAM,EAAE,KAAK;IACb,gBAAgB,EAAE,CAAC;IACnB,SAAS,EAAE,CAAC;IACZ,MAAM,EAA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IAC1C,WAAW,EAAE;QACT,OAAO,EAAE,2BAA2B;QACpC,KAAK,EAAE,kBAAkB;KAC5B;IACD,gBAAgB,EAAE;QACd,OAAO,EAAE,qCAAqC;QAC9C,KAAK,EAAE,uBAAuB;KACjC;IACD,UAAU,EAAE;QACR,OAAO,EAAE,kCAAkC;QAC3C,KAAK,EAAE,iBAAiB;KAC3B;IACD,KAAK,EAAE;QACH,OAAO,EAAE,kCAAkC;QAC3C,KAAK,EAAE,YAAY;KACtB;CACJ,CAAA;AAEY,QAAA,iBAAiB,GAAc;IACxC,QAAQ,EAAE;QACN,OAAO,EAAE,4BAA4B;QACrC,KAAK,EAAE,aAAa;KACvB;IACD,mBAAmB,EAAE;QACjB,OAAO,EAAE,+BAA+B;QACxC,KAAK,EAAE,wBAAwB;KAClC;CACJ,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"validate.schema.examples.d.ts","sourceRoot":"","sources":["../../../schemas/examples/validate.schema.examples.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA;AA4ErC,eAAO,MAAM,uBAAuB,EAAE,SAqBrC,CAAA;AAED,eAAO,MAAM,qBAAqB,EAAE,SAKnC,CAAA"}
1
+ {"version":3,"file":"validate.schema.examples.d.ts","sourceRoot":"","sources":["../../../schemas/examples/validate.schema.examples.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA;AA0ErC,eAAO,MAAM,uBAAuB,EAAE,SAqBrC,CAAA;AAED,eAAO,MAAM,qBAAqB,EAAE,SAKnC,CAAA"}
@@ -66,9 +66,7 @@ const multiStakeRequest = {
66
66
  qty: 35,
67
67
  }],
68
68
  };
69
- const minimalReply = {
70
- ok: true,
71
- };
69
+ const minimalReply = {};
72
70
  exports.validateRequestExamples = {
73
71
  minimal: {
74
72
  summary: 'Minimal request',
@@ -1 +1 @@
1
- {"version":3,"file":"validate.schema.examples.js","sourceRoot":"","sources":["../../../schemas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AI,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,EAAE,KAAK,EAAE,CAAC;SACxC,CAAC;CACL,CAAA;AAED,MAAM,iBAAiB,GAAG;IACtB,GAAG,cAAc;IACjB,MAAM,EAAE,CAAC;YACL,IAAI,EAAE,SAAS;YACf,MAAM,EAAE,EAAE;YACV,GAAG,EAAE,EAAE;SACV,EAAE;YACC,IAAI,EAAE,UAAU;YAChB,MAAM,EAAE,GAAG;YACX,GAAG,EAAE,EAAE;SACV,CAAC;CACL,CAAA;AAED,MAAM,YAAY,GAAG;IACjB,EAAE,EAAE,IAAI;CACX,CAAA;AAEY,QAAA,uBAAuB,GAAc;IAC9C,OAAO,EAAE;QACL,OAAO,EAAE,iBAAiB;QAC1B,KAAK,EAAE,cAAc;KACxB;IACD,OAAO,EAAE;QACL,OAAO,EAAE,iBAAiB;QAC1B,KAAK,EAAE,cAAc;KACxB;IACD,QAAQ,EAAE;QACN,OAAO,EAAE,WAAW;QACpB,KAAK,EAAE,eAAe;KACzB;IACD,aAAa,EAAE;QACX,OAAO,EAAE,gBAAgB;QACzB,KAAK,EAAE,oBAAoB;KAC9B;IACD,UAAU,EAAE;QACR,OAAO,EAAE,aAAa;QACtB,KAAK,EAAE,iBAAiB;KAC3B;CACJ,CAAA;AAEY,QAAA,qBAAqB,GAAc;IAC5C,OAAO,EAAE;QACL,OAAO,EAAE,eAAe;QACxB,KAAK,EAAE,YAAY;KACtB;CACJ,CAAA"}
1
+ {"version":3,"file":"validate.schema.examples.js","sourceRoot":"","sources":["../../../schemas/examples/validate.schema.examples.ts"],"names":[],"mappings":";;;AAEA,MAAM,cAAc,GAAG;IACnB,IAAI,EAAE,IAAI;IACV,gBAAgB,EAAE,CAAC;IACnB,MAAM,EAAE,CAAC;YACL,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,CAAC;SAC7B,CAAC;IACF,WAAW,EAAE,MAAM;IACnB,UAAU,EAAE,IAAI;IAChB,WAAW,EAAE,IAAI;CACpB,CAAA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AAG;YACX,GAAG,EAAE,EAAE;SACV,CAAC;CACL,CAAA;AAED,MAAM,YAAY,GAAG,EAAE,CAAA;AAEV,QAAA,uBAAuB,GAAc;IAC9C,OAAO,EAAE;QACL,OAAO,EAAE,iBAAiB;QAC1B,KAAK,EAAE,cAAc;KACxB;IACD,OAAO,EAAE;QACL,OAAO,EAAE,iBAAiB;QAC1B,KAAK,EAAE,cAAc;KACxB;IACD,QAAQ,EAAE;QACN,OAAO,EAAE,WAAW;QACpB,KAAK,EAAE,eAAe;KACzB;IACD,aAAa,EAAE;QACX,OAAO,EAAE,gBAAgB;QACzB,KAAK,EAAE,oBAAoB;KAC9B;IACD,UAAU,EAAE;QACR,OAAO,EAAE,aAAa;QACtB,KAAK,EAAE,iBAAiB;KAC3B;CACJ,CAAA;AAEY,QAAA,qBAAqB,GAAc;IAC5C,OAAO,EAAE;QACL,OAAO,EAAE,eAAe;QACxB,KAAK,EAAE,YAAY;KACtB;CACJ,CAAA"}
@@ -1,31 +1,13 @@
1
1
  import { Static, Type } from 'typebox';
2
2
  import { EEnvironment } from './shared';
3
3
  export declare const HealthcheckRequestSchema: Type.TObject<{}>;
4
- export declare const MetricsSchema: Type.TObject<{
5
- requests: Type.TObject<{
6
- success: Type.TInteger;
7
- failed: Type.TInteger;
8
- }>;
9
- }>;
10
4
  export declare const HealthcheckReplySchema: Type.TObject<{
11
- code: Type.TInteger;
12
- status: Type.TBoolean;
13
- service: Type.TString;
5
+ ok: Type.TLiteral<true>;
6
+ gameId: Type.TString;
14
7
  environment: Type.TEnum<[EEnvironment.development, EEnvironment.staging, EEnvironment.production]>;
15
8
  uptime: Type.TNumber;
16
- message: Type.TString;
17
9
  timestamp: Type.TInteger;
18
- metrics: Type.TObject<{
19
- requests: Type.TObject<{
20
- success: Type.TInteger;
21
- failed: Type.TInteger;
22
- }>;
23
- }>;
24
- services: Type.TObject<{
25
- sentry: Type.TBoolean;
26
- }>;
27
10
  }>;
28
11
  export type THealthcheckRequest = Static<typeof HealthcheckRequestSchema>;
29
- export type TMetrics = Static<typeof MetricsSchema>;
30
12
  export type THealthcheckReply = Static<typeof HealthcheckReplySchema>;
31
13
  //# sourceMappingURL=healthcheck.schema.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"healthcheck.schema.d.ts","sourceRoot":"","sources":["../../schemas/healthcheck.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAGtC,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AAEvC,eAAO,MAAM,wBAAwB,kBAEnC,CAAA;AAEF,eAAO,MAAM,aAAa;;;;;EAiBxB,CAAA;AAEF,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;EAkCjC,CAAA;AAEF,MAAM,MAAM,mBAAmB,GAAG,MAAM,CAAC,OAAO,wBAAwB,CAAC,CAAA;AACzE,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAC,OAAO,aAAa,CAAC,CAAA;AACnD,MAAM,MAAM,iBAAiB,GAAG,MAAM,CAAC,OAAO,sBAAsB,CAAC,CAAA"}
1
+ {"version":3,"file":"healthcheck.schema.d.ts","sourceRoot":"","sources":["../../schemas/healthcheck.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAGtC,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AAEvC,eAAO,MAAM,wBAAwB,kBAEnC,CAAA;AAEF,eAAO,MAAM,sBAAsB;;;;;;EAqBjC,CAAA;AAEF,MAAM,MAAM,mBAAmB,GAAG,MAAM,CAAC,OAAO,wBAAwB,CAAC,CAAA;AACzE,MAAM,MAAM,iBAAiB,GAAG,MAAM,CAAC,OAAO,sBAAsB,CAAC,CAAA"}
@@ -1,62 +1,31 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.HealthcheckReplySchema = exports.MetricsSchema = exports.HealthcheckRequestSchema = void 0;
3
+ exports.HealthcheckReplySchema = exports.HealthcheckRequestSchema = void 0;
4
4
  const typebox_1 = require("typebox");
5
5
  const healthcheck_schema_examples_1 = require("./examples/healthcheck.schema.examples");
6
6
  const shared_1 = require("./shared");
7
7
  exports.HealthcheckRequestSchema = typebox_1.Type.Object({}, {
8
8
  additionalProperties: false,
9
9
  });
10
- exports.MetricsSchema = typebox_1.Type.Object({
11
- requests: typebox_1.Type.Object({
12
- success: typebox_1.Type.Integer({
13
- minimum: 0,
14
- description: 'Count of success requests',
15
- }),
16
- failed: typebox_1.Type.Integer({
17
- minimum: 0,
18
- description: 'Count of failed requests',
19
- }),
20
- }, {
21
- description: 'Info about requests',
22
- additionalProperties: false,
23
- }),
24
- }, {
25
- description: 'Different metrics',
26
- additionalProperties: false,
27
- });
28
10
  exports.HealthcheckReplySchema = typebox_1.Type.Object({
29
- code: typebox_1.Type.Integer({
30
- description: 'Always 200 for success responses',
11
+ ok: typebox_1.Type.Literal(true, {
12
+ description: 'true when the Game Server is healthy',
31
13
  }),
32
- status: typebox_1.Type.Boolean({
33
- description: 'Always true for success responses',
34
- }),
35
- service: typebox_1.Type.String({
36
- description: 'Name of service. (Game text code for Game Server)',
14
+ gameId: typebox_1.Type.String({
15
+ description: 'Identifier of the game this server serves (e.g. "book-of-odin")',
37
16
  }),
38
17
  environment: typebox_1.Type.Enum(shared_1.EEnvironment, {
39
- description: 'Current environment',
18
+ description: 'Deployment environment',
40
19
  }),
41
20
  uptime: typebox_1.Type.Number({
42
- description: 'Process uptime',
43
- }),
44
- message: typebox_1.Type.String({
45
- description: 'Some text message ("OK" for healthcheck)',
21
+ description: 'Process uptime in seconds (fractional)',
22
+ minimum: 0,
46
23
  }),
47
24
  timestamp: typebox_1.Type.Integer({
48
- description: 'Current timestamp (UTC)',
49
- }),
50
- metrics: exports.MetricsSchema,
51
- services: typebox_1.Type.Object({
52
- sentry: typebox_1.Type.Boolean({
53
- description: 'true, if Sentry is available',
54
- }),
55
- }, {
56
- description: 'Services availabiliy',
57
- additionalProperties: false,
25
+ description: 'Unix epoch time in milliseconds when the response was generated',
58
26
  }),
59
27
  }, {
28
+ $id: 'HealthcheckReply',
60
29
  additionalProperties: false,
61
30
  'x-examples': healthcheck_schema_examples_1.healthcheckReplyExamples,
62
31
  });
@@ -1 +1 @@
1
- {"version":3,"file":"healthcheck.schema.js","sourceRoot":"","sources":["../../schemas/healthcheck.schema.ts"],"names":[],"mappings":";;;AAAA,qCAAsC;AAEtC,wFAAiF;AACjF,qCAAuC;AAE1B,QAAA,wBAAwB,GAAG,cAAI,CAAC,MAAM,CAAC,EAAE,EAAE;IACpD,oBAAoB,EAAE,KAAK;CAC9B,CAAC,CAAA;AAEW,QAAA,aAAa,GAAG,cAAI,CAAC,MAAM,CAAC;IACrC,QAAQ,EAAE,cAAI,CAAC,MAAM,CAAC;QAClB,OAAO,EAAE,cAAI,CAAC,OAAO,CAAC;YAClB,OAAO,EAAE,CAAC;YACV,WAAW,EAAE,2BAA2B;SAC3C,CAAC;QACF,MAAM,EAAE,cAAI,CAAC,OAAO,CAAC;YACjB,OAAO,EAAE,CAAC;YACV,WAAW,EAAE,0BAA0B;SAC1C,CAAC;KACL,EAAE;QACC,WAAW,EAAE,qBAAqB;QAClC,oBAAoB,EAAE,KAAK;KAC9B,CAAC;CACL,EAAE;IACC,WAAW,EAAE,mBAAmB;IAChC,oBAAoB,EAAE,KAAK;CAC9B,CAAC,CAAA;AAEW,QAAA,sBAAsB,GAAG,cAAI,CAAC,MAAM,CAAC;IAC9C,IAAI,EAAE,cAAI,CAAC,OAAO,CAAC;QACf,WAAW,EAAE,kCAAkC;KAClD,CAAC;IACF,MAAM,EAAE,cAAI,CAAC,OAAO,CAAC;QACjB,WAAW,EAAE,mCAAmC;KACnD,CAAC;IACF,OAAO,EAAE,cAAI,CAAC,MAAM,CAAC;QACjB,WAAW,EAAE,mDAAmD;KACnE,CAAC;IACF,WAAW,EAAE,cAAI,CAAC,IAAI,CA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OAAO,EAAE,CAAC;KACb,CAAC;IACF,SAAS,EAAE,cAAI,CAAC,OAAO,CAAC;QACpB,WAAW,EAAE,iEAAiE;KACjF,CAAC;CACL,EAAE;IACC,GAAG,EAAE,kBAAkB;IACvB,oBAAoB,EAAE,KAAK;IAC3B,YAAY,EAAE,sDAAwB;CACzC,CAAC,CAAA"}
@@ -1,33 +1,38 @@
1
1
  import { Static, Type } from 'typebox';
2
2
  export declare const PlayRequestSchema: Type.TObject<{
3
- demo: Type.TBoolean;
4
- currencyDecimals: Type.TOptional<Type.TInteger>;
3
+ isDemo: Type.TBoolean;
4
+ currencyDecimals: Type.TInteger;
5
+ stepIndex: Type.TInteger;
5
6
  stakes: Type.TOptional<Type.TArray<Type.TObject<{
6
7
  name: Type.TString;
7
8
  amount: Type.TNumber;
9
+ coinValue: Type.TOptional<Type.TNumber>;
8
10
  level: Type.TOptional<Type.TInteger>;
9
11
  qty: Type.TOptional<Type.TInteger>;
10
12
  params: Type.TOptional<Type.TString>;
11
13
  }>>>;
12
- isGambleAllowed: Type.TOptional<Type.TBoolean>;
13
- test: Type.TOptional<Type.TString>;
14
- metaPrivate: Type.TOptional<Type.TString>;
15
- metaPublic: Type.TOptional<Type.TString>;
16
14
  choice: Type.TOptional<Type.TInteger>;
15
+ meta: Type.TOptional<Type.TObject<{
16
+ public: Type.TAny;
17
+ private: Type.TAny;
18
+ }>>;
19
+ test: Type.TOptional<Type.TString>;
17
20
  }>;
18
21
  export declare const PlayReplySchema: Type.TObject<{
19
- ok: Type.TBoolean;
20
- rng: Type.TString;
21
- finished: Type.TBoolean;
22
+ gameResponse: Type.TAny;
23
+ rng: Type.TArray<Type.TObject<{
24
+ value: Type.TNumber;
25
+ }>>;
22
26
  results: Type.TObject<{
23
- response: Type.TString;
24
- winCash: Type.TNumber;
25
- winCoins: Type.TOptional<Type.TNumber>;
27
+ coins: Type.TOptional<Type.TNumber>;
28
+ cashWin: Type.TNumber;
29
+ finished: Type.TBoolean;
30
+ choices: Type.TOptional<Type.TArray<Type.TInteger>>;
31
+ meta: Type.TOptional<Type.TObject<{
32
+ public: Type.TAny;
33
+ private: Type.TAny;
34
+ }>>;
26
35
  }>;
27
- metaPrivate: Type.TOptional<Type.TString>;
28
- metaPublic: Type.TOptional<Type.TString>;
29
- choices: Type.TOptional<Type.TArray<Type.TNumber>>;
30
- analytics: Type.TOptional<Type.TArray<Type.TAny>>;
31
36
  }>;
32
37
  export type TPlayRequest = Static<typeof PlayRequestSchema>;
33
38
  export type TPlayReply = Static<typeof PlayReplySchema>;
@@ -1 +1 @@
1
- {"version":3,"file":"play.schema.d.ts","sourceRoot":"","sources":["../../schemas/play.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAKtC,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;EA+B5B,CAAA;AAEF,eAAO,MAAM,eAAe;;;;;;;;;;;;;EAwC1B,CAAA;AAEF,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC,OAAO,iBAAiB,CAAC,CAAA;AAC3D,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,OAAO,eAAe,CAAC,CAAA"}
1
+ {"version":3,"file":"play.schema.d.ts","sourceRoot":"","sources":["../../schemas/play.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAKtC,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;EA2B5B,CAAA;AAEF,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;EAmC1B,CAAA;AAEF,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC,OAAO,iBAAiB,CAAC,CAAA;AAC3D,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,OAAO,eAAe,CAAC,CAAA"}
@@ -5,31 +5,27 @@ const typebox_1 = require("typebox");
5
5
  const play_schema_examples_1 = require("./examples/play.schema.examples");
6
6
  const shared_1 = require("./shared");
7
7
  exports.PlayRequestSchema = typebox_1.Type.Object({
8
- demo: typebox_1.Type.Boolean({
9
- description: 'true if it is demo game',
8
+ isDemo: typebox_1.Type.Boolean({
9
+ description: 'true for demo sessions. A demo Game Server may use a different RNG',
10
10
  }),
11
- currencyDecimals: typebox_1.Type.Optional(typebox_1.Type.Integer({
12
- description: 'Floating point number for current currency profile',
11
+ currencyDecimals: typebox_1.Type.Integer({
12
+ description: 'Decimal places of the currency — used to compute the win amount in currency',
13
13
  minimum: 0,
14
- })),
14
+ }),
15
+ stepIndex: typebox_1.Type.Integer({
16
+ description: 'Index of this /play call within the round (opening step is 0, each continuation increments)',
17
+ minimum: 0,
18
+ }),
15
19
  stakes: typebox_1.Type.Optional(typebox_1.Type.Array(shared_1.StakeSchema, {
16
- description: 'List of stakes of the round',
20
+ description: 'Sent only on the opening step. With hasMultiStake=true may contain more than one stake; otherwise exactly one. Each element must have a unique name',
17
21
  minItems: 1,
18
22
  })),
19
- isGambleAllowed: typebox_1.Type.Optional(typebox_1.Type.Boolean({
20
- description: 'Provided if only game has any “double up” mechanics. true if gamble feature allowed by license settings',
23
+ choice: typebox_1.Type.Optional(typebox_1.Type.Integer({
24
+ description: 'User choice. Absent on opening step; required on every continuation step (must be one of results.choices from the previous step)',
21
25
  })),
26
+ meta: typebox_1.Type.Optional(shared_1.MetaSchema),
22
27
  test: typebox_1.Type.Optional(typebox_1.Type.String({
23
- description: 'Object with cheat config transformed to string (available only for local development and for real game of test operator on preproduction stage)',
24
- })),
25
- metaPrivate: typebox_1.Type.Optional(typebox_1.Type.String({
26
- description: 'Private part of meta data (json object transformed to string). Inner data for calculating average bet, double up payouts, etc.',
27
- })),
28
- metaPublic: typebox_1.Type.Optional(typebox_1.Type.String({
29
- description: 'Public part of meta data (json object transformed to string). Visual progress of cumulative features for client side or something like that',
30
- })),
31
- choice: typebox_1.Type.Optional(typebox_1.Type.Integer({
32
- description: 'User choice. Available only for games with features that need user interaction during single game round',
28
+ description: 'String representation of cheat-tool parameters. MUST be ignored on production deployments',
33
29
  })),
34
30
  }, {
35
31
  $id: 'PlayRequest',
@@ -37,41 +33,36 @@ exports.PlayRequestSchema = typebox_1.Type.Object({
37
33
  'x-examples': play_schema_examples_1.playRequestExamples,
38
34
  });
39
35
  exports.PlayReplySchema = typebox_1.Type.Object({
40
- ok: typebox_1.Type.Boolean({
41
- description: 'Always true for success responses',
36
+ gameResponse: typebox_1.Type.Any({
37
+ description: 'Math results generated by this call. Forwarded to the front-end; must not contain sensitive data',
42
38
  }),
43
- rng: typebox_1.Type.String({
44
- description: 'List of all random numbers with additional service info. Stringified JSON',
45
- }),
46
- finished: typebox_1.Type.Boolean({
47
- description: 'true if game round is finished. Can be false for stepped games',
39
+ rng: typebox_1.Type.Array(typebox_1.Type.Object({
40
+ value: typebox_1.Type.Number({
41
+ description: 'RNG value used to generate gameResponse',
42
+ }),
43
+ }, { additionalProperties: true }), {
44
+ description: 'RNG values used to generate gameResponse. Not forwarded to the client — kept by RGS for internal storage and validation only',
48
45
  }),
49
46
  results: typebox_1.Type.Object({
50
- response: typebox_1.Type.String({
51
- description: 'All game data for displaying game process in game client. Stringified JSON',
47
+ coins: typebox_1.Type.Optional(typebox_1.Type.Number({
48
+ description: 'Win for this step, in coin units',
49
+ })),
50
+ cashWin: typebox_1.Type.Number({
51
+ description: 'Win to add to the round for this step, in currency units (0 if the step has no win)',
52
+ minimum: 0,
52
53
  }),
53
- winCash: typebox_1.Type.Number({
54
- description: 'Calculated payout in currency',
54
+ finished: typebox_1.Type.Boolean({
55
+ description: 'When true, the round is finished. Canonical end-of-round indicator',
55
56
  }),
56
- winCoins: typebox_1.Type.Optional(typebox_1.Type.Number({
57
- description: 'Wining amount in coins',
57
+ choices: typebox_1.Type.Optional(typebox_1.Type.Array(typebox_1.Type.Integer(), {
58
+ description: 'Present only for hasChoice=true when the round must continue. Must be a non-empty array of integers; never null or []',
59
+ minItems: 1,
58
60
  })),
61
+ meta: typebox_1.Type.Optional(shared_1.MetaSchema),
59
62
  }, {
60
- description: 'Results of generated game rounds. Includes game data for game client and coefficients for calculating payouts',
63
+ description: 'Step summary that RGS reads to drive its logic',
64
+ additionalProperties: false,
61
65
  }),
62
- metaPrivate: typebox_1.Type.Optional(typebox_1.Type.String({
63
- description: 'Private part of meta data (json object transformed to string). Inner data for calculating average bet, double up payouts, etc.',
64
- })),
65
- metaPublic: typebox_1.Type.Optional(typebox_1.Type.String({
66
- description: 'Public part of meta data (json object transformed to string). Visual progress of cumulative features for client side or something like that. Only this part of meta must be provided to Game Client',
67
- })),
68
- choices: typebox_1.Type.Optional(typebox_1.Type.Array(typebox_1.Type.Number(), {
69
- description: 'List of available choices for next round to continue game process ',
70
- minItems: 1,
71
- })),
72
- analytics: typebox_1.Type.Optional(typebox_1.Type.Array(typebox_1.Type.Any(), {
73
- description: 'List of some analytics data...',
74
- })),
75
66
  }, {
76
67
  $id: 'PlayReply',
77
68
  additionalProperties: false,
@@ -1 +1 @@
1
- {"version":3,"file":"play.schema.js","sourceRoot":"","sources":["../../schemas/play.schema.ts"],"names":[],"mappings":";;;AAAA,qCAAsC;AAEtC,0EAAwF;AACxF,qCAAsC;AAEzB,QAAA,iBAAiB,GAAG,cAAI,CAAC,MAAM,CAAC;IACzC,IAAI,EAAE,cAAI,CAAC,OAAO,CAAC;QACf,WAAW,EAAE,yBAAyB;KACzC,CAAC;IACF,gBAAgB,EAAE,cAAI,CAAC,QAAQ,CAAC,cAAI,CAAC,OAAO,CAAC;QACzC,WAAW,EAAE,oDAAoD;QACjE,OAAO,EAAE,CAAC;KACb,CAAC,CAAC;IACH,MAAM,EAAE,cAAI,CAAC,QAAQ,CAAC,cAAI,CAAC,KAAK,CAAC,oBAAW,EAAE;QAC1C,WAAW,EAAE,6BAA6B;QAC1C,QAAQ,EAAE,CAAC;KACd,CAAC,CAAC;IACH,eAAe,EAAE,cAAI,CAAC,QAAQ,CAAC,cAAI,CAAC,OAAO,CAAC;QACxC,WAAW,EAAE,yGAAyG;KACzH,CAAC,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