@truelab/trueserver 0.0.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.
Files changed (167) hide show
  1. package/CHANGELOG.md +36 -0
  2. package/README.md +220 -0
  3. package/dist/application.d.ts +7 -0
  4. package/dist/application.d.ts.map +1 -0
  5. package/dist/application.js +41 -0
  6. package/dist/application.js.map +1 -0
  7. package/dist/helpers/config.helper.d.ts +5 -0
  8. package/dist/helpers/config.helper.d.ts.map +1 -0
  9. package/dist/helpers/config.helper.js +12 -0
  10. package/dist/helpers/config.helper.js.map +1 -0
  11. package/dist/helpers/env.helper.d.ts +5 -0
  12. package/dist/helpers/env.helper.d.ts.map +1 -0
  13. package/dist/helpers/env.helper.js +29 -0
  14. package/dist/helpers/env.helper.js.map +1 -0
  15. package/dist/helpers/fastify.helper.d.ts +9 -0
  16. package/dist/helpers/fastify.helper.d.ts.map +1 -0
  17. package/dist/helpers/fastify.helper.js +27 -0
  18. package/dist/helpers/fastify.helper.js.map +1 -0
  19. package/dist/helpers/handlers.helper.d.ts +39 -0
  20. package/dist/helpers/handlers.helper.d.ts.map +1 -0
  21. package/dist/helpers/handlers.helper.js +25 -0
  22. package/dist/helpers/handlers.helper.js.map +1 -0
  23. package/dist/helpers/logger.helper.d.ts +6 -0
  24. package/dist/helpers/logger.helper.d.ts.map +1 -0
  25. package/dist/helpers/logger.helper.js +21 -0
  26. package/dist/helpers/logger.helper.js.map +1 -0
  27. package/dist/helpers/pkg-version.helper.d.ts +5 -0
  28. package/dist/helpers/pkg-version.helper.d.ts.map +1 -0
  29. package/dist/helpers/pkg-version.helper.js +22 -0
  30. package/dist/helpers/pkg-version.helper.js.map +1 -0
  31. package/dist/helpers/random.helper.d.ts +7 -0
  32. package/dist/helpers/random.helper.d.ts.map +1 -0
  33. package/dist/helpers/random.helper.js +18 -0
  34. package/dist/helpers/random.helper.js.map +1 -0
  35. package/dist/helpers/tests.helper.d.ts +9 -0
  36. package/dist/helpers/tests.helper.d.ts.map +1 -0
  37. package/dist/helpers/tests.helper.js +45 -0
  38. package/dist/helpers/tests.helper.js.map +1 -0
  39. package/dist/index.d.ts +14 -0
  40. package/dist/index.d.ts.map +1 -0
  41. package/dist/index.js +57 -0
  42. package/dist/index.js.map +1 -0
  43. package/dist/plugins/404.plugin.d.ts +3 -0
  44. package/dist/plugins/404.plugin.d.ts.map +1 -0
  45. package/dist/plugins/404.plugin.js +10 -0
  46. package/dist/plugins/404.plugin.js.map +1 -0
  47. package/dist/plugins/apikey.plugin.d.ts +3 -0
  48. package/dist/plugins/apikey.plugin.d.ts.map +1 -0
  49. package/dist/plugins/apikey.plugin.js +18 -0
  50. package/dist/plugins/apikey.plugin.js.map +1 -0
  51. package/dist/plugins/cors.plugin.d.ts +3 -0
  52. package/dist/plugins/cors.plugin.d.ts.map +1 -0
  53. package/dist/plugins/cors.plugin.js +15 -0
  54. package/dist/plugins/cors.plugin.js.map +1 -0
  55. package/dist/plugins/error.plugin.d.ts +3 -0
  56. package/dist/plugins/error.plugin.d.ts.map +1 -0
  57. package/dist/plugins/error.plugin.js +18 -0
  58. package/dist/plugins/error.plugin.js.map +1 -0
  59. package/dist/plugins/logger.plugin.d.ts +3 -0
  60. package/dist/plugins/logger.plugin.d.ts.map +1 -0
  61. package/dist/plugins/logger.plugin.js +51 -0
  62. package/dist/plugins/logger.plugin.js.map +1 -0
  63. package/dist/plugins/metrics.plugin.d.ts +9 -0
  64. package/dist/plugins/metrics.plugin.d.ts.map +1 -0
  65. package/dist/plugins/metrics.plugin.js +24 -0
  66. package/dist/plugins/metrics.plugin.js.map +1 -0
  67. package/dist/plugins/sentry.plugin.d.ts +3 -0
  68. package/dist/plugins/sentry.plugin.d.ts.map +1 -0
  69. package/dist/plugins/sentry.plugin.js +24 -0
  70. package/dist/plugins/sentry.plugin.js.map +1 -0
  71. package/dist/plugins/swagger.plugin.d.ts +3 -0
  72. package/dist/plugins/swagger.plugin.d.ts.map +1 -0
  73. package/dist/plugins/swagger.plugin.js +58 -0
  74. package/dist/plugins/swagger.plugin.js.map +1 -0
  75. package/dist/routes/client.route.d.ts +3 -0
  76. package/dist/routes/client.route.d.ts.map +1 -0
  77. package/dist/routes/client.route.js +21 -0
  78. package/dist/routes/client.route.js.map +1 -0
  79. package/dist/routes/config/config.route.d.ts +3 -0
  80. package/dist/routes/config/config.route.d.ts.map +1 -0
  81. package/dist/routes/config/config.route.js +21 -0
  82. package/dist/routes/config/config.route.js.map +1 -0
  83. package/dist/routes/config/config.route.validate.plugin.d.ts +3 -0
  84. package/dist/routes/config/config.route.validate.plugin.d.ts.map +1 -0
  85. package/dist/routes/config/config.route.validate.plugin.js +42 -0
  86. package/dist/routes/config/config.route.validate.plugin.js.map +1 -0
  87. package/dist/routes/config/index.d.ts +3 -0
  88. package/dist/routes/config/index.d.ts.map +1 -0
  89. package/dist/routes/config/index.js +14 -0
  90. package/dist/routes/config/index.js.map +1 -0
  91. package/dist/routes/healthcheck.route.d.ts +3 -0
  92. package/dist/routes/healthcheck.route.d.ts.map +1 -0
  93. package/dist/routes/healthcheck.route.js +34 -0
  94. package/dist/routes/healthcheck.route.js.map +1 -0
  95. package/dist/routes/play/index.d.ts +3 -0
  96. package/dist/routes/play/index.d.ts.map +1 -0
  97. package/dist/routes/play/index.js +14 -0
  98. package/dist/routes/play/index.js.map +1 -0
  99. package/dist/routes/play/play.route.d.ts +3 -0
  100. package/dist/routes/play/play.route.d.ts.map +1 -0
  101. package/dist/routes/play/play.route.js +22 -0
  102. package/dist/routes/play/play.route.js.map +1 -0
  103. package/dist/routes/play/play.route.validate.plugin.d.ts +13 -0
  104. package/dist/routes/play/play.route.validate.plugin.d.ts.map +1 -0
  105. package/dist/routes/play/play.route.validate.plugin.js +108 -0
  106. package/dist/routes/play/play.route.validate.plugin.js.map +1 -0
  107. package/dist/routes/validate/index.d.ts +3 -0
  108. package/dist/routes/validate/index.d.ts.map +1 -0
  109. package/dist/routes/validate/index.js +14 -0
  110. package/dist/routes/validate/index.js.map +1 -0
  111. package/dist/routes/validate/validate.route.d.ts +3 -0
  112. package/dist/routes/validate/validate.route.d.ts.map +1 -0
  113. package/dist/routes/validate/validate.route.js +22 -0
  114. package/dist/routes/validate/validate.route.js.map +1 -0
  115. package/dist/routes/validate/validate.route.validate.plugin.d.ts +3 -0
  116. package/dist/routes/validate/validate.route.validate.plugin.d.ts.map +1 -0
  117. package/dist/routes/validate/validate.route.validate.plugin.js +28 -0
  118. package/dist/routes/validate/validate.route.validate.plugin.js.map +1 -0
  119. package/dist/schemas/client.schema.d.ts +9 -0
  120. package/dist/schemas/client.schema.d.ts.map +1 -0
  121. package/dist/schemas/client.schema.js +22 -0
  122. package/dist/schemas/client.schema.js.map +1 -0
  123. package/dist/schemas/config.schema.d.ts +34 -0
  124. package/dist/schemas/config.schema.d.ts.map +1 -0
  125. package/dist/schemas/config.schema.js +78 -0
  126. package/dist/schemas/config.schema.js.map +1 -0
  127. package/dist/schemas/examples/client.schema.examples.d.ts +3 -0
  128. package/dist/schemas/examples/client.schema.examples.d.ts.map +1 -0
  129. package/dist/schemas/examples/client.schema.examples.js +32 -0
  130. package/dist/schemas/examples/client.schema.examples.js.map +1 -0
  131. package/dist/schemas/examples/config.schema.examples.d.ts +3 -0
  132. package/dist/schemas/examples/config.schema.examples.d.ts.map +1 -0
  133. package/dist/schemas/examples/config.schema.examples.js +56 -0
  134. package/dist/schemas/examples/config.schema.examples.js.map +1 -0
  135. package/dist/schemas/examples/healthcheck.schema.examples.d.ts +3 -0
  136. package/dist/schemas/examples/healthcheck.schema.examples.d.ts.map +1 -0
  137. package/dist/schemas/examples/healthcheck.schema.examples.js +28 -0
  138. package/dist/schemas/examples/healthcheck.schema.examples.js.map +1 -0
  139. package/dist/schemas/examples/play.schema.examples.d.ts +4 -0
  140. package/dist/schemas/examples/play.schema.examples.d.ts.map +1 -0
  141. package/dist/schemas/examples/play.schema.examples.js +165 -0
  142. package/dist/schemas/examples/play.schema.examples.js.map +1 -0
  143. package/dist/schemas/examples/validate.schema.examples.d.ts +4 -0
  144. package/dist/schemas/examples/validate.schema.examples.d.ts.map +1 -0
  145. package/dist/schemas/examples/validate.schema.examples.js +100 -0
  146. package/dist/schemas/examples/validate.schema.examples.js.map +1 -0
  147. package/dist/schemas/healthcheck.schema.d.ts +31 -0
  148. package/dist/schemas/healthcheck.schema.d.ts.map +1 -0
  149. package/dist/schemas/healthcheck.schema.js +63 -0
  150. package/dist/schemas/healthcheck.schema.js.map +1 -0
  151. package/dist/schemas/play.schema.d.ts +34 -0
  152. package/dist/schemas/play.schema.d.ts.map +1 -0
  153. package/dist/schemas/play.schema.js +80 -0
  154. package/dist/schemas/play.schema.js.map +1 -0
  155. package/dist/schemas/shared.d.ts +71 -0
  156. package/dist/schemas/shared.d.ts.map +1 -0
  157. package/dist/schemas/shared.js +147 -0
  158. package/dist/schemas/shared.js.map +1 -0
  159. package/dist/schemas/validate.schema.d.ts +21 -0
  160. package/dist/schemas/validate.schema.d.ts.map +1 -0
  161. package/dist/schemas/validate.schema.js +43 -0
  162. package/dist/schemas/validate.schema.js.map +1 -0
  163. package/dist/test-utils.d.ts +6 -0
  164. package/dist/test-utils.d.ts.map +1 -0
  165. package/dist/test-utils.js +13 -0
  166. package/dist/test-utils.js.map +1 -0
  167. package/package.json +80 -0
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.testHeaders = void 0;
7
+ exports.testBuild = testBuild;
8
+ exports.validator = validator;
9
+ exports.checkSchemaPropertyDescriptions = checkSchemaPropertyDescriptions;
10
+ const ajv_1 = __importDefault(require("ajv"));
11
+ const fastify_1 = __importDefault(require("fastify"));
12
+ const env_helper_1 = require("./env.helper");
13
+ function testBuild() {
14
+ return (0, fastify_1.default)({
15
+ ajv: {
16
+ customOptions: {
17
+ keywords: ['x-examples'],
18
+ },
19
+ },
20
+ }).withTypeProvider();
21
+ }
22
+ exports.testHeaders = {
23
+ [(0, env_helper_1.getenv)('API_HEADER', 'x-api-key')]: (0, env_helper_1.getenv)('API_KEY', 'test'),
24
+ };
25
+ function validator(schema) {
26
+ const ajv = new ajv_1.default({
27
+ keywords: ['x-examples'],
28
+ });
29
+ return ajv.compile(schema);
30
+ }
31
+ function checkSchemaPropertyDescriptions(props) {
32
+ const propsAll = [];
33
+ const propsWithDesc = [];
34
+ Object.entries(props).forEach(([prop, propSchema]) => {
35
+ propsAll.push(prop);
36
+ if (propSchema.description !== undefined) {
37
+ propsWithDesc.push(prop);
38
+ }
39
+ if (propSchema.type === 'object') {
40
+ checkSchemaPropertyDescriptions(propSchema.properties);
41
+ }
42
+ });
43
+ expect(propsAll).toEqual(propsWithDesc);
44
+ }
45
+ //# sourceMappingURL=tests.helper.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tests.helper.js","sourceRoot":"","sources":["../../helpers/tests.helper.ts"],"names":[],"mappings":";;;;;;AAOA,8BAQC;AAMD,8BAKC;AAED,0EAgBC;AA3CD,8CAAmD;AACnD,sDAA6B;AAE7B,6CAAqC;AAGrC,SAAgB,SAAS;IACrB,OAAO,IAAA,iBAAO,EAAC;QACX,GAAG,EAAE;YACD,aAAa,EAAE;gBACX,QAAQ,EAAE,CAAC,YAAY,CAAC;aAC3B;SACJ;KACJ,CAAC,CAAC,gBAAgB,EAAuB,CAAA;AAC9C,CAAC;AAEY,QAAA,WAAW,GAAG;IACvB,CAAC,IAAA,mBAAM,EAAC,YAAY,EAAE,WAAW,CAAC,CAAC,EAAE,IAAA,mBAAM,EAAC,SAAS,EAAE,MAAM,CAAC;CACjE,CAAA;AAED,SAAgB,SAAS,CAAC,MAAc;IACpC,MAAM,GAAG,GAAG,IAAI,aAAG,CAAC;QAChB,QAAQ,EAAE,CAAC,YAAY,CAAC;KAC3B,CAAC,CAAA;IACF,OAAO,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,CAAA;AAC9B,CAAC;AAED,SAAgB,+BAA+B,CAAC,KAA0B;IACtE,MAAM,QAAQ,GAAa,EAAE,CAAA;IAC7B,MAAM,aAAa,GAAa,EAAE,CAAA;IAElC,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,EAAE,UAAU,CAAC,EAAE,EAAE;QACjD,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QACnB,IAAI,UAAU,CAAC,WAAW,KAAK,SAAS,EAAE,CAAC;YACvC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QAC5B,CAAC;QAED,IAAI,UAAU,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;YAC/B,+BAA+B,CAAC,UAAU,CAAC,UAAU,CAAC,CAAA;QAC1D,CAAC;IACL,CAAC,CAAC,CAAA;IAEF,MAAM,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC,CAAA;AAC3C,CAAC"}
@@ -0,0 +1,14 @@
1
+ export { default as Application } from './application';
2
+ export { getGameConfig, registerGameConfig, type TGameConfig, } from './helpers/config.helper';
3
+ export { getenv, variation } from './helpers/env.helper';
4
+ export { type FastifyTypebox, getRoutePrefix, httpError, registerPlugin, registerRoute, } from './helpers/fastify.helper';
5
+ export { type RouteHandler, HandlersHelper, handlers, } from './helpers/handlers.helper';
6
+ export { logger, loggerOptions } from './helpers/logger.helper';
7
+ export { getByChance, random, randomOf } from './helpers/random.helper';
8
+ export { ClientReplySchema, ClientRequestSchema, type TClientReply, type TClientRequest, } from './schemas/client.schema';
9
+ export { ConfigReplySchema, ConfigRequestSchema, type TConfigReply, type TConfigRequest, } from './schemas/config.schema';
10
+ export { HealthcheckReplySchema, HealthcheckRequestSchema, MetricsSchema, type THealthcheckReply, type THealthcheckRequest, type TMetrics, } from './schemas/healthcheck.schema';
11
+ export { PlayReplySchema, PlayRequestSchema, type TPlayReply, type TPlayRequest, } from './schemas/play.schema';
12
+ export { AccessErrorSchema, ECategory, EEnvironment, EStakeType, EVolatility, HeadersSchema, InternalErrorSchema, RequestErrorSchema, StakeModeSchema, StakeSchema, type TAccessError, type TExamples, type TInternalError, type TRequestError, type TStake, type TStakeMode, } from './schemas/shared';
13
+ export { ValidateReplySchema, ValidateRequestSchema, type TValidateReply, type TValidateRequest, } from './schemas/validate.schema';
14
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,eAAe,CAAA;AACtD,OAAO,EACH,aAAa,EACb,kBAAkB,EAClB,KAAK,WAAW,GACnB,MAAM,yBAAyB,CAAA;AAChC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAA;AACxD,OAAO,EACH,KAAK,cAAc,EACnB,cAAc,EACd,SAAS,EACT,cAAc,EACd,aAAa,GAChB,MAAM,0BAA0B,CAAA;AACjC,OAAO,EACH,KAAK,YAAY,EACjB,cAAc,EACd,QAAQ,GACX,MAAM,2BAA2B,CAAA;AAClC,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAA;AAC/D,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAA;AAEvE,OAAO,EACH,iBAAiB,EACjB,mBAAmB,EACnB,KAAK,YAAY,EACjB,KAAK,cAAc,GACtB,MAAM,yBAAyB,CAAA;AAChC,OAAO,EACH,iBAAiB,EACjB,mBAAmB,EACnB,KAAK,YAAY,EACjB,KAAK,cAAc,GACtB,MAAM,yBAAyB,CAAA;AAChC,OAAO,EACH,sBAAsB,EACtB,wBAAwB,EACxB,aAAa,EACb,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,KAAK,QAAQ,GAChB,MAAM,8BAA8B,CAAA;AACrC,OAAO,EACH,eAAe,EACf,iBAAiB,EACjB,KAAK,UAAU,EACf,KAAK,YAAY,GACpB,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EACH,iBAAiB,EACjB,SAAS,EACT,YAAY,EACZ,UAAU,EACV,WAAW,EACX,aAAa,EACb,mBAAmB,EACnB,kBAAkB,EAClB,eAAe,EACf,WAAW,EACX,KAAK,YAAY,EACjB,KAAK,SAAS,EACd,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,MAAM,EACX,KAAK,UAAU,GAClB,MAAM,kBAAkB,CAAA;AACzB,OAAO,EACH,mBAAmB,EACnB,qBAAqB,EACrB,KAAK,cAAc,EACnB,KAAK,gBAAgB,GACxB,MAAM,2BAA2B,CAAA"}
package/dist/index.js ADDED
@@ -0,0 +1,57 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.ValidateRequestSchema = exports.ValidateReplySchema = exports.StakeSchema = exports.StakeModeSchema = exports.RequestErrorSchema = exports.InternalErrorSchema = exports.HeadersSchema = exports.EVolatility = exports.EStakeType = exports.EEnvironment = exports.ECategory = exports.AccessErrorSchema = exports.PlayRequestSchema = exports.PlayReplySchema = exports.MetricsSchema = exports.HealthcheckRequestSchema = exports.HealthcheckReplySchema = exports.ConfigRequestSchema = exports.ConfigReplySchema = exports.ClientRequestSchema = exports.ClientReplySchema = exports.randomOf = exports.random = exports.getByChance = exports.loggerOptions = exports.logger = exports.handlers = exports.HandlersHelper = exports.registerRoute = exports.registerPlugin = exports.httpError = exports.getRoutePrefix = exports.variation = exports.getenv = exports.registerGameConfig = exports.getGameConfig = exports.Application = void 0;
7
+ var application_1 = require("./application");
8
+ Object.defineProperty(exports, "Application", { enumerable: true, get: function () { return __importDefault(application_1).default; } });
9
+ var config_helper_1 = require("./helpers/config.helper");
10
+ Object.defineProperty(exports, "getGameConfig", { enumerable: true, get: function () { return config_helper_1.getGameConfig; } });
11
+ Object.defineProperty(exports, "registerGameConfig", { enumerable: true, get: function () { return config_helper_1.registerGameConfig; } });
12
+ var env_helper_1 = require("./helpers/env.helper");
13
+ Object.defineProperty(exports, "getenv", { enumerable: true, get: function () { return env_helper_1.getenv; } });
14
+ Object.defineProperty(exports, "variation", { enumerable: true, get: function () { return env_helper_1.variation; } });
15
+ var fastify_helper_1 = require("./helpers/fastify.helper");
16
+ Object.defineProperty(exports, "getRoutePrefix", { enumerable: true, get: function () { return fastify_helper_1.getRoutePrefix; } });
17
+ Object.defineProperty(exports, "httpError", { enumerable: true, get: function () { return fastify_helper_1.httpError; } });
18
+ Object.defineProperty(exports, "registerPlugin", { enumerable: true, get: function () { return fastify_helper_1.registerPlugin; } });
19
+ Object.defineProperty(exports, "registerRoute", { enumerable: true, get: function () { return fastify_helper_1.registerRoute; } });
20
+ var handlers_helper_1 = require("./helpers/handlers.helper");
21
+ Object.defineProperty(exports, "HandlersHelper", { enumerable: true, get: function () { return handlers_helper_1.HandlersHelper; } });
22
+ Object.defineProperty(exports, "handlers", { enumerable: true, get: function () { return handlers_helper_1.handlers; } });
23
+ var logger_helper_1 = require("./helpers/logger.helper");
24
+ Object.defineProperty(exports, "logger", { enumerable: true, get: function () { return logger_helper_1.logger; } });
25
+ Object.defineProperty(exports, "loggerOptions", { enumerable: true, get: function () { return logger_helper_1.loggerOptions; } });
26
+ var random_helper_1 = require("./helpers/random.helper");
27
+ Object.defineProperty(exports, "getByChance", { enumerable: true, get: function () { return random_helper_1.getByChance; } });
28
+ Object.defineProperty(exports, "random", { enumerable: true, get: function () { return random_helper_1.random; } });
29
+ Object.defineProperty(exports, "randomOf", { enumerable: true, get: function () { return random_helper_1.randomOf; } });
30
+ var client_schema_1 = require("./schemas/client.schema");
31
+ Object.defineProperty(exports, "ClientReplySchema", { enumerable: true, get: function () { return client_schema_1.ClientReplySchema; } });
32
+ Object.defineProperty(exports, "ClientRequestSchema", { enumerable: true, get: function () { return client_schema_1.ClientRequestSchema; } });
33
+ var config_schema_1 = require("./schemas/config.schema");
34
+ Object.defineProperty(exports, "ConfigReplySchema", { enumerable: true, get: function () { return config_schema_1.ConfigReplySchema; } });
35
+ Object.defineProperty(exports, "ConfigRequestSchema", { enumerable: true, get: function () { return config_schema_1.ConfigRequestSchema; } });
36
+ var healthcheck_schema_1 = require("./schemas/healthcheck.schema");
37
+ Object.defineProperty(exports, "HealthcheckReplySchema", { enumerable: true, get: function () { return healthcheck_schema_1.HealthcheckReplySchema; } });
38
+ Object.defineProperty(exports, "HealthcheckRequestSchema", { enumerable: true, get: function () { return healthcheck_schema_1.HealthcheckRequestSchema; } });
39
+ Object.defineProperty(exports, "MetricsSchema", { enumerable: true, get: function () { return healthcheck_schema_1.MetricsSchema; } });
40
+ var play_schema_1 = require("./schemas/play.schema");
41
+ Object.defineProperty(exports, "PlayReplySchema", { enumerable: true, get: function () { return play_schema_1.PlayReplySchema; } });
42
+ Object.defineProperty(exports, "PlayRequestSchema", { enumerable: true, get: function () { return play_schema_1.PlayRequestSchema; } });
43
+ var shared_1 = require("./schemas/shared");
44
+ Object.defineProperty(exports, "AccessErrorSchema", { enumerable: true, get: function () { return shared_1.AccessErrorSchema; } });
45
+ Object.defineProperty(exports, "ECategory", { enumerable: true, get: function () { return shared_1.ECategory; } });
46
+ Object.defineProperty(exports, "EEnvironment", { enumerable: true, get: function () { return shared_1.EEnvironment; } });
47
+ Object.defineProperty(exports, "EStakeType", { enumerable: true, get: function () { return shared_1.EStakeType; } });
48
+ Object.defineProperty(exports, "EVolatility", { enumerable: true, get: function () { return shared_1.EVolatility; } });
49
+ Object.defineProperty(exports, "HeadersSchema", { enumerable: true, get: function () { return shared_1.HeadersSchema; } });
50
+ Object.defineProperty(exports, "InternalErrorSchema", { enumerable: true, get: function () { return shared_1.InternalErrorSchema; } });
51
+ Object.defineProperty(exports, "RequestErrorSchema", { enumerable: true, get: function () { return shared_1.RequestErrorSchema; } });
52
+ Object.defineProperty(exports, "StakeModeSchema", { enumerable: true, get: function () { return shared_1.StakeModeSchema; } });
53
+ Object.defineProperty(exports, "StakeSchema", { enumerable: true, get: function () { return shared_1.StakeSchema; } });
54
+ var validate_schema_1 = require("./schemas/validate.schema");
55
+ Object.defineProperty(exports, "ValidateReplySchema", { enumerable: true, get: function () { return validate_schema_1.ValidateReplySchema; } });
56
+ Object.defineProperty(exports, "ValidateRequestSchema", { enumerable: true, get: function () { return validate_schema_1.ValidateRequestSchema; } });
57
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";;;;;;AAAA,6CAAsD;AAA7C,2HAAA,OAAO,OAAe;AAC/B,yDAIgC;AAH5B,8GAAA,aAAa,OAAA;AACb,mHAAA,kBAAkB,OAAA;AAGtB,mDAAwD;AAA/C,oGAAA,MAAM,OAAA;AAAE,uGAAA,SAAS,OAAA;AAC1B,2DAMiC;AAJ7B,gHAAA,cAAc,OAAA;AACd,2GAAA,SAAS,OAAA;AACT,gHAAA,cAAc,OAAA;AACd,+GAAA,aAAa,OAAA;AAEjB,6DAIkC;AAF9B,iHAAA,cAAc,OAAA;AACd,2GAAA,QAAQ,OAAA;AAEZ,yDAA+D;AAAtD,uGAAA,MAAM,OAAA;AAAE,8GAAA,aAAa,OAAA;AAC9B,yDAAuE;AAA9D,4GAAA,WAAW,OAAA;AAAE,uGAAA,MAAM,OAAA;AAAE,yGAAA,QAAQ,OAAA;AAEtC,yDAKgC;AAJ5B,kHAAA,iBAAiB,OAAA;AACjB,oHAAA,mBAAmB,OAAA;AAIvB,yDAKgC;AAJ5B,kHAAA,iBAAiB,OAAA;AACjB,oHAAA,mBAAmB,OAAA;AAIvB,mEAOqC;AANjC,4HAAA,sBAAsB,OAAA;AACtB,8HAAA,wBAAwB,OAAA;AACxB,mHAAA,aAAa,OAAA;AAKjB,qDAK8B;AAJ1B,8GAAA,eAAe,OAAA;AACf,gHAAA,iBAAiB,OAAA;AAIrB,2CAiByB;AAhBrB,2GAAA,iBAAiB,OAAA;AACjB,mGAAA,SAAS,OAAA;AACT,sGAAA,YAAY,OAAA;AACZ,oGAAA,UAAU,OAAA;AACV,qGAAA,WAAW,OAAA;AACX,uGAAA,aAAa,OAAA;AACb,6GAAA,mBAAmB,OAAA;AACnB,4GAAA,kBAAkB,OAAA;AAClB,yGAAA,eAAe,OAAA;AACf,qGAAA,WAAW,OAAA;AAQf,6DAKkC;AAJ9B,sHAAA,mBAAmB,OAAA;AACnB,wHAAA,qBAAqB,OAAA"}
@@ -0,0 +1,3 @@
1
+ declare const notFoundPlugin: (fastify: import("../helpers/fastify.helper").FastifyTypebox) => Promise<void>;
2
+ export default notFoundPlugin;
3
+ //# sourceMappingURL=404.plugin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"404.plugin.d.ts","sourceRoot":"","sources":["../../plugins/404.plugin.ts"],"names":[],"mappings":"AAEA,QAAA,MAAM,cAAc,gFAIlB,CAAA;AAEF,eAAe,cAAc,CAAA"}
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const fastify_helper_1 = require("../helpers/fastify.helper");
4
+ const notFoundPlugin = (0, fastify_helper_1.registerPlugin)(async (fastify) => {
5
+ fastify.setNotFoundHandler((request) => {
6
+ throw (0, fastify_helper_1.httpError)(`Route "${request.url}" is not found`, 404);
7
+ });
8
+ });
9
+ exports.default = notFoundPlugin;
10
+ //# sourceMappingURL=404.plugin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"404.plugin.js","sourceRoot":"","sources":["../../plugins/404.plugin.ts"],"names":[],"mappings":";;AAAA,8DAAqE;AAErE,MAAM,cAAc,GAAG,IAAA,+BAAc,EAAC,KAAK,EAAE,OAAO,EAAE,EAAE;IACpD,OAAO,CAAC,kBAAkB,CAAC,CAAC,OAAO,EAAE,EAAE;QACnC,MAAM,IAAA,0BAAS,EAAC,UAAU,OAAO,CAAC,GAAG,gBAAgB,EAAE,GAAG,CAAC,CAAA;IAC/D,CAAC,CAAC,CAAA;AACN,CAAC,CAAC,CAAA;AAEF,kBAAe,cAAc,CAAA"}
@@ -0,0 +1,3 @@
1
+ declare const apikeyPlugin: (fastify: import("../helpers/fastify.helper").FastifyTypebox) => Promise<void>;
2
+ export default apikeyPlugin;
3
+ //# sourceMappingURL=apikey.plugin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"apikey.plugin.d.ts","sourceRoot":"","sources":["../../plugins/apikey.plugin.ts"],"names":[],"mappings":"AAGA,QAAA,MAAM,YAAY,gFAahB,CAAA;AAEF,eAAe,YAAY,CAAA"}
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const env_helper_1 = require("../helpers/env.helper");
4
+ const fastify_helper_1 = require("../helpers/fastify.helper");
5
+ const apikeyPlugin = (0, fastify_helper_1.registerPlugin)(async (fastify) => {
6
+ fastify.addHook('preHandler', (request, reply, done) => {
7
+ if (request.method === 'POST') {
8
+ const currentKey = request.headers[(0, env_helper_1.getenv)('API_HEADER', 'x-api-key')];
9
+ const expectedKey = (0, env_helper_1.getenv)('API_KEY', 'test');
10
+ if (currentKey !== expectedKey) {
11
+ throw (0, fastify_helper_1.httpError)('API_KEY doesn\'t match', 403);
12
+ }
13
+ }
14
+ done();
15
+ });
16
+ });
17
+ exports.default = apikeyPlugin;
18
+ //# sourceMappingURL=apikey.plugin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"apikey.plugin.js","sourceRoot":"","sources":["../../plugins/apikey.plugin.ts"],"names":[],"mappings":";;AAAA,sDAA8C;AAC9C,8DAAqE;AAErE,MAAM,YAAY,GAAG,IAAA,+BAAc,EAAC,KAAK,EAAE,OAAO,EAAE,EAAE;IAClD,OAAO,CAAC,OAAO,CAAC,YAAY,EAAE,CAAC,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE;QACnD,IAAI,OAAO,CAAC,MAAM,KAAK,MAAM,EAAE,CAAC;YAC5B,MAAM,UAAU,GAAG,OAAO,CAAC,OAAO,CAAC,IAAA,mBAAM,EAAC,YAAY,EAAE,WAAW,CAAC,CAAC,CAAA;YACrE,MAAM,WAAW,GAAG,IAAA,mBAAM,EAAC,SAAS,EAAE,MAAM,CAAC,CAAA;YAE7C,IAAI,UAAU,KAAK,WAAW,EAAE,CAAC;gBAC7B,MAAM,IAAA,0BAAS,EAAC,wBAAwB,EAAE,GAAG,CAAC,CAAA;YAClD,CAAC;QACL,CAAC;QAED,IAAI,EAAE,CAAA;IACV,CAAC,CAAC,CAAA;AACN,CAAC,CAAC,CAAA;AAEF,kBAAe,YAAY,CAAA"}
@@ -0,0 +1,3 @@
1
+ declare const corsPlugin: (fastify: import("../helpers/fastify.helper").FastifyTypebox) => Promise<void>;
2
+ export default corsPlugin;
3
+ //# sourceMappingURL=cors.plugin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cors.plugin.d.ts","sourceRoot":"","sources":["../../plugins/cors.plugin.ts"],"names":[],"mappings":"AAIA,QAAA,MAAM,UAAU,gFAKd,CAAA;AAEF,eAAe,UAAU,CAAA"}
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const cors_1 = __importDefault(require("@fastify/cors"));
7
+ const fastify_helper_1 = require("../helpers/fastify.helper");
8
+ const corsPlugin = (0, fastify_helper_1.registerPlugin)(async (fastify) => {
9
+ fastify.register(cors_1.default, {
10
+ origin: '*',
11
+ methods: ['POST'],
12
+ });
13
+ });
14
+ exports.default = corsPlugin;
15
+ //# sourceMappingURL=cors.plugin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cors.plugin.js","sourceRoot":"","sources":["../../plugins/cors.plugin.ts"],"names":[],"mappings":";;;;;AAAA,yDAAuC;AAEvC,8DAA0D;AAE1D,MAAM,UAAU,GAAG,IAAA,+BAAc,EAAC,KAAK,EAAE,OAAO,EAAE,EAAE;IAChD,OAAO,CAAC,QAAQ,CAAC,cAAW,EAAE;QAC1B,MAAM,EAAE,GAAG;QACX,OAAO,EAAE,CAAC,MAAM,CAAC;KACpB,CAAC,CAAA;AACN,CAAC,CAAC,CAAA;AAEF,kBAAe,UAAU,CAAA"}
@@ -0,0 +1,3 @@
1
+ declare const errorPlugin: (fastify: import("../helpers/fastify.helper").FastifyTypebox) => Promise<void>;
2
+ export default errorPlugin;
3
+ //# sourceMappingURL=error.plugin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"error.plugin.d.ts","sourceRoot":"","sources":["../../plugins/error.plugin.ts"],"names":[],"mappings":"AAIA,QAAA,MAAM,WAAW,gFAcf,CAAA;AAEF,eAAe,WAAW,CAAA"}
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const fastify_helper_1 = require("../helpers/fastify.helper");
4
+ const errorPlugin = (0, fastify_helper_1.registerPlugin)(async (fastify) => {
5
+ fastify.setErrorHandler((error, request, reply) => {
6
+ fastify.Sentry?.captureException(error);
7
+ fastify.log.error({
8
+ reqId: request.id,
9
+ err: error,
10
+ });
11
+ reply.status(error.statusCode ?? 500).send({
12
+ ok: false,
13
+ message: error.message,
14
+ });
15
+ });
16
+ });
17
+ exports.default = errorPlugin;
18
+ //# sourceMappingURL=error.plugin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"error.plugin.js","sourceRoot":"","sources":["../../plugins/error.plugin.ts"],"names":[],"mappings":";;AAEA,8DAA0D;AAE1D,MAAM,WAAW,GAAG,IAAA,+BAAc,EAAC,KAAK,EAAE,OAAO,EAAE,EAAE;IACjD,OAAO,CAAC,eAAe,CAAe,CAAC,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE;QAC5D,OAAO,CAAC,MAAM,EAAE,gBAAgB,CAAC,KAAK,CAAC,CAAA;QAEvC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC;YACd,KAAK,EAAE,OAAO,CAAC,EAAE;YACjB,GAAG,EAAE,KAAK;SACb,CAAC,CAAA;QAEF,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,UAAU,IAAI,GAAG,CAAC,CAAC,IAAI,CAAC;YACvC,EAAE,EAAE,KAAK;YACT,OAAO,EAAE,KAAK,CAAC,OAAO;SACzB,CAAC,CAAA;IACN,CAAC,CAAC,CAAA;AACN,CAAC,CAAC,CAAA;AAEF,kBAAe,WAAW,CAAA"}
@@ -0,0 +1,3 @@
1
+ declare const _default: (fastify: import("../helpers/fastify.helper").FastifyTypebox) => Promise<void>;
2
+ export default _default;
3
+ //# sourceMappingURL=logger.plugin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logger.plugin.d.ts","sourceRoot":"","sources":["../../plugins/logger.plugin.ts"],"names":[],"mappings":";AAOA,wBA6CE"}
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const pino_1 = require("pino");
4
+ const env_helper_1 = require("../helpers/env.helper");
5
+ const fastify_helper_1 = require("../helpers/fastify.helper");
6
+ const level = (0, env_helper_1.getenv)('LOG_LEVEL', 'error');
7
+ exports.default = (0, fastify_helper_1.registerPlugin)(async (fastify) => {
8
+ // Override due to {"disableRequestLogging": true}
9
+ if (pino_1.levels.values[level] <= pino_1.levels.values.info) {
10
+ fastify.addHook('onRequest', (request, _reply, done) => {
11
+ request.log.info({
12
+ url: request.raw.url,
13
+ }, 'incoming request');
14
+ done();
15
+ });
16
+ }
17
+ // Override due to {"disableRequestLogging": true}
18
+ if (pino_1.levels.values[level] <= pino_1.levels.values.info) {
19
+ fastify.addHook('onResponse', (request, reply, done) => {
20
+ request.log.info({
21
+ statusCode: reply.raw.statusCode,
22
+ responseTime: reply.elapsedTime,
23
+ }, 'request completed');
24
+ done();
25
+ });
26
+ }
27
+ if (pino_1.levels.values[level] <= pino_1.levels.values.trace) {
28
+ fastify.addHook('preHandler', (request, _reply, done) => {
29
+ request.log.trace({
30
+ payload: request.body,
31
+ }, 'request payload');
32
+ done();
33
+ });
34
+ }
35
+ if (pino_1.levels.values[level] <= pino_1.levels.values.trace) {
36
+ fastify.addHook('preSerialization', (request, _reply, payload, done) => {
37
+ try {
38
+ request.log.trace({
39
+ payload: JSON.parse(payload),
40
+ }, 'reply payload');
41
+ }
42
+ catch (_e) {
43
+ request.log.trace({
44
+ payload,
45
+ }, 'reply payload');
46
+ }
47
+ done(null, payload);
48
+ });
49
+ }
50
+ });
51
+ //# sourceMappingURL=logger.plugin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logger.plugin.js","sourceRoot":"","sources":["../../plugins/logger.plugin.ts"],"names":[],"mappings":";;AAAA,+BAA6B;AAE7B,sDAA8C;AAC9C,8DAA0D;AAE1D,MAAM,KAAK,GAAG,IAAA,mBAAM,EAAC,WAAW,EAAE,OAAO,CAAC,CAAA;AAE1C,kBAAe,IAAA,+BAAc,EAAC,KAAK,EAAE,OAAO,EAAE,EAAE;IAC5C,kDAAkD;IAClD,IAAI,aAAM,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,aAAM,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;QAC7C,OAAO,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE;YACnD,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC;gBACb,GAAG,EAAE,OAAO,CAAC,GAAG,CAAC,GAAG;aACvB,EAAE,kBAAkB,CAAC,CAAA;YACtB,IAAI,EAAE,CAAA;QACV,CAAC,CAAC,CAAA;IACN,CAAC;IAED,kDAAkD;IAClD,IAAI,aAAM,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,aAAM,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;QAC7C,OAAO,CAAC,OAAO,CA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 -0,0 +1,9 @@
1
+ import { TMetrics } from '../schemas/healthcheck.schema';
2
+ declare module 'fastify' {
3
+ interface FastifyInstance {
4
+ metrics: TMetrics;
5
+ }
6
+ }
7
+ declare const metricsPlugin: (fastify: import("../helpers/fastify.helper").FastifyTypebox) => Promise<void>;
8
+ export default metricsPlugin;
9
+ //# sourceMappingURL=metrics.plugin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"metrics.plugin.d.ts","sourceRoot":"","sources":["../../plugins/metrics.plugin.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAA;AAExD,OAAO,QAAQ,SAAS,CAAC;IACrB,UAAU,eAAe;QACrB,OAAO,EAAE,QAAQ,CAAA;KACpB;CACJ;AASD,QAAA,MAAM,aAAa,gFAYjB,CAAA;AAEF,eAAe,aAAa,CAAA"}
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ /* eslint-disable no-param-reassign */
4
+ const fastify_helper_1 = require("../helpers/fastify.helper");
5
+ const metricsSingleton = {
6
+ requests: {
7
+ success: 0,
8
+ failed: 0,
9
+ },
10
+ };
11
+ const metricsPlugin = (0, fastify_helper_1.registerPlugin)(async (fastify) => {
12
+ fastify.decorate('metrics', metricsSingleton);
13
+ fastify.addHook('onResponse', (_request, reply, done) => {
14
+ if (reply.raw.statusCode < 400) {
15
+ fastify.metrics.requests.success += 1;
16
+ }
17
+ else {
18
+ fastify.metrics.requests.failed += 1;
19
+ }
20
+ done();
21
+ });
22
+ });
23
+ exports.default = metricsPlugin;
24
+ //# sourceMappingURL=metrics.plugin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"metrics.plugin.js","sourceRoot":"","sources":["../../plugins/metrics.plugin.ts"],"names":[],"mappings":";;AAAA,sCAAsC;AACtC,8DAA0D;AAS1D,MAAM,gBAAgB,GAAa;IAC/B,QAAQ,EAAE;QACN,OAAO,EAAE,CAAC;QACV,MAAM,EAAE,CAAC;KACZ;CACJ,CAAA;AAED,MAAM,aAAa,GAAG,IAAA,+BAAc,EAAC,KAAK,EAAE,OAAO,EAAE,EAAE;IACnD,OAAO,CAAC,QAAQ,CAAC,SAAS,EAAE,gBAAgB,CAAC,CAAA;IAE7C,OAAO,CAAC,OAAO,CAAC,YAAY,EAAE,CAAC,QAAQ,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE;QACpD,IAAI,KAAK,CAAC,GAAG,CAAC,UAAU,GAAG,GAAG,EAAE,CAAC;YAC7B,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAA;QACzC,CAAC;aAAM,CAAC;YACJ,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,MAAM,IAAI,CAAC,CAAA;QACxC,CAAC;QAED,IAAI,EAAE,CAAA;IACV,CAAC,CAAC,CAAA;AACN,CAAC,CAAC,CAAA;AAEF,kBAAe,aAAa,CAAA"}
@@ -0,0 +1,3 @@
1
+ declare const sentryPlugin: (fastify: import("../helpers/fastify.helper").FastifyTypebox) => Promise<void>;
2
+ export default sentryPlugin;
3
+ //# sourceMappingURL=sentry.plugin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sentry.plugin.d.ts","sourceRoot":"","sources":["../../plugins/sentry.plugin.ts"],"names":[],"mappings":"AAMA,QAAA,MAAM,YAAY,gFAchB,CAAA;AAEF,eAAe,YAAY,CAAA"}
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const fastify_sentry_1 = __importDefault(require("@immobiliarelabs/fastify-sentry"));
7
+ const config_helper_1 = require("../helpers/config.helper");
8
+ const env_helper_1 = require("../helpers/env.helper");
9
+ const fastify_helper_1 = require("../helpers/fastify.helper");
10
+ const sentryPlugin = (0, fastify_helper_1.registerPlugin)(async (fastify) => {
11
+ const gameConfig = (0, config_helper_1.getGameConfig)();
12
+ fastify.register(fastify_sentry_1.default, {
13
+ dsn: (0, env_helper_1.getenv)('SENTRY_DSN', undefined),
14
+ environment: (0, env_helper_1.variation)('development', 'staging', 'production'),
15
+ tracesSampleRate: parseFloat((0, env_helper_1.getenv)('SENTRY_RATE', '0.01')), // 1% by default
16
+ setErrorHandler: false,
17
+ });
18
+ fastify.addHook('onReady', () => {
19
+ fastify.Sentry.setTag('game.name', gameConfig.name);
20
+ fastify.Sentry.setTag('game.id', (0, env_helper_1.getenv)('GAME_ID', '0001'));
21
+ });
22
+ });
23
+ exports.default = sentryPlugin;
24
+ //# sourceMappingURL=sentry.plugin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sentry.plugin.js","sourceRoot":"","sources":["../../plugins/sentry.plugin.ts"],"names":[],"mappings":";;;;;AAAA,qFAA2D;AAE3D,4DAAwD;AACxD,sDAAyD;AACzD,8DAA0D;AAE1D,MAAM,YAAY,GAAG,IAAA,+BAAc,EAAC,KAAK,EAAE,OAAO,EAAE,EAAE;IAClD,MAAM,UAAU,GAAG,IAAA,6BAAa,GAAE,CAAA;IAElC,OAAO,CAAC,QAAQ,CAAC,wBAAa,EAAE;QAC5B,GAAG,EAAE,IAAA,mBAAM,EAAC,YAAY,EAAE,SAAS,CAAC;QACpC,WAAW,EAAE,IAAA,sBAAS,EAAC,aAAa,EAAE,SAAS,EAAE,YAAY,CAAC;QAC9D,gBAAgB,EAAE,UAAU,CAAC,IAAA,mBAAM,EAAC,aAAa,EAAE,MAAM,CAAC,CAAC,EAAE,gBAAgB;QAC7E,eAAe,EAAE,KAAK;KACzB,CAAC,CAAA;IAEF,OAAO,CAAC,OAAO,CAAC,SAAS,EAAE,GAAG,EAAE;QAC5B,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,WAAW,EAAE,UAAU,CAAC,IAAI,CAAC,CAAA;QACnD,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,SAAS,EAAE,IAAA,mBAAM,EAAC,SAAS,EAAE,MAAM,CAAC,CAAC,CAAA;IAC/D,CAAC,CAAC,CAAA;AACN,CAAC,CAAC,CAAA;AAEF,kBAAe,YAAY,CAAA"}
@@ -0,0 +1,3 @@
1
+ declare const swaggerPlugin: (fastify: import("../helpers/fastify.helper").FastifyTypebox) => Promise<void>;
2
+ export default swaggerPlugin;
3
+ //# sourceMappingURL=swagger.plugin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"swagger.plugin.d.ts","sourceRoot":"","sources":["../../plugins/swagger.plugin.ts"],"names":[],"mappings":"AAeA,QAAA,MAAM,aAAa,gFA2CjB,CAAA;AAEF,eAAe,aAAa,CAAA"}
@@ -0,0 +1,58 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const swagger_1 = __importDefault(require("@fastify/swagger"));
7
+ const swagger_ui_1 = __importDefault(require("@fastify/swagger-ui"));
8
+ const config_helper_1 = require("../helpers/config.helper");
9
+ const env_helper_1 = require("../helpers/env.helper");
10
+ const fastify_helper_1 = require("../helpers/fastify.helper");
11
+ const pkg_version_helper_1 = require("../helpers/pkg-version.helper");
12
+ const client_schema_1 = require("../schemas/client.schema");
13
+ const config_schema_1 = require("../schemas/config.schema");
14
+ const play_schema_1 = require("../schemas/play.schema");
15
+ const shared_1 = require("../schemas/shared");
16
+ const validate_schema_1 = require("../schemas/validate.schema");
17
+ const swaggerPlugin = (0, fastify_helper_1.registerPlugin)(async (fastify) => {
18
+ if ((0, env_helper_1.variation)(false, true, true))
19
+ return;
20
+ const gameConfig = (0, config_helper_1.getGameConfig)();
21
+ const routePrefix = '/docs';
22
+ fastify.get('/', (_request, reply) => {
23
+ reply.redirect(routePrefix);
24
+ });
25
+ fastify.register(swagger_1.default, {
26
+ openapi: {
27
+ info: {
28
+ title: '@truelab/trueserver',
29
+ version: (0, pkg_version_helper_1.getPackageVersion)(),
30
+ },
31
+ },
32
+ });
33
+ fastify.register(swagger_ui_1.default, {
34
+ routePrefix,
35
+ uiConfig: {
36
+ docExpansion: 'list',
37
+ deepLinking: false,
38
+ },
39
+ theme: {
40
+ title: `Swagger - ${gameConfig.name}`,
41
+ },
42
+ });
43
+ fastify.addSchema(shared_1.StakeSchema);
44
+ fastify.addSchema(shared_1.StakeModeSchema);
45
+ fastify.addSchema(shared_1.RequestErrorSchema);
46
+ fastify.addSchema(shared_1.AccessErrorSchema);
47
+ fastify.addSchema(shared_1.InternalErrorSchema);
48
+ fastify.addSchema(play_schema_1.PlayRequestSchema);
49
+ fastify.addSchema(play_schema_1.PlayReplySchema);
50
+ fastify.addSchema(validate_schema_1.ValidateRequestSchema);
51
+ fastify.addSchema(validate_schema_1.ValidateReplySchema);
52
+ fastify.addSchema(config_schema_1.ConfigRequestSchema);
53
+ fastify.addSchema(config_schema_1.ConfigReplySchema);
54
+ fastify.addSchema(client_schema_1.ClientRequestSchema);
55
+ fastify.addSchema(client_schema_1.ClientReplySchema);
56
+ });
57
+ exports.default = swaggerPlugin;
58
+ //# sourceMappingURL=swagger.plugin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"swagger.plugin.js","sourceRoot":"","sources":["../../plugins/swagger.plugin.ts"],"names":[],"mappings":";;;;;AAAA,+DAA6C;AAC7C,qEAAkD;AAElD,4DAAwD;AACxD,sDAAiD;AACjD,8DAA0D;AAC1D,sEAAiE;AACjE,4DAAiF;AACjF,4DAAiF;AACjF,wDAA2E;AAC3E,8CAE0B;AAC1B,gEAAuF;AAEvF,MAAM,aAAa,GAAG,IAAA,+BAAc,EAAC,KAAK,EAAE,OAAO,EAAE,EAAE;IACnD,IAAI,IAAA,sBAAS,EAAC,KAAK,EAAE,IAAI,EAAE,IAAI,CAAC;QAAE,OAAM;IAExC,MAAM,UAAU,GAAG,IAAA,6BAAa,GAAE,CAAA;IAClC,MAA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;AACxC,CAAC,CAAC,CAAA;AAEF,kBAAe,aAAa,CAAA"}
@@ -0,0 +1,3 @@
1
+ declare const clientRoute: (fastify: import("../helpers/fastify.helper").FastifyTypebox) => Promise<void>;
2
+ export default clientRoute;
3
+ //# sourceMappingURL=client.route.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.route.d.ts","sourceRoot":"","sources":["../../routes/client.route.ts"],"names":[],"mappings":"AAOA,QAAA,MAAM,WAAW,gFAYf,CAAA;AAEF,eAAe,WAAW,CAAA"}
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const fastify_helper_1 = require("../helpers/fastify.helper");
4
+ const handlers_helper_1 = require("../helpers/handlers.helper");
5
+ const client_schema_1 = require("../schemas/client.schema");
6
+ const shared_1 = require("../schemas/shared");
7
+ const clientRoute = (0, fastify_helper_1.registerRoute)(async (fastify) => {
8
+ fastify.post('/client', {
9
+ schema: {
10
+ response: {
11
+ 200: client_schema_1.ClientReplySchema,
12
+ 400: shared_1.RequestErrorSchema,
13
+ 403: shared_1.AccessErrorSchema,
14
+ 500: shared_1.InternalErrorSchema,
15
+ },
16
+ headers: shared_1.HeadersSchema,
17
+ },
18
+ }, async (request, reply) => handlers_helper_1.handlers.get('client').bind(fastify)(request, reply));
19
+ });
20
+ exports.default = clientRoute;
21
+ //# sourceMappingURL=client.route.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.route.js","sourceRoot":"","sources":["../../routes/client.route.ts"],"names":[],"mappings":";;AAAA,8DAAyD;AACzD,gEAAqD;AACrD,4DAA4D;AAC5D,8CAE0B;AAE1B,MAAM,WAAW,GAAG,IAAA,8BAAa,EAAC,KAAK,EAAE,OAAO,EAAE,EAAE;IAChD,OAAO,CAAC,IAAI,CAAC,SAAS,EAAE;QACpB,MAAM,EAAE;YACJ,QAAQ,EAAE;gBACN,GAAG,EAAE,iCAAiB;gBACtB,GAAG,EAAE,2BAAkB;gBACvB,GAAG,EAAE,0BAAiB;gBACtB,GAAG,EAAE,4BAAmB;aAC3B;YACD,OAAO,EAAE,sBAAa;SACzB;KACJ,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,CAAC,0BAAQ,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,CAAA;AACtF,CAAC,CAAC,CAAA;AAEF,kBAAe,WAAW,CAAA"}
@@ -0,0 +1,3 @@
1
+ declare const configRouteOriginal: (fastify: import("../../helpers/fastify.helper").FastifyTypebox) => Promise<void>;
2
+ export default configRouteOriginal;
3
+ //# sourceMappingURL=config.route.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.route.d.ts","sourceRoot":"","sources":["../../../routes/config/config.route.ts"],"names":[],"mappings":"AAOA,QAAA,MAAM,mBAAmB,mFAYvB,CAAA;AAEF,eAAe,mBAAmB,CAAA"}
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const fastify_helper_1 = require("../../helpers/fastify.helper");
4
+ const handlers_helper_1 = require("../../helpers/handlers.helper");
5
+ const config_schema_1 = require("../../schemas/config.schema");
6
+ const shared_1 = require("../../schemas/shared");
7
+ const configRouteOriginal = (0, fastify_helper_1.registerRoute)(async (fastify) => {
8
+ fastify.post('/config', {
9
+ schema: {
10
+ response: {
11
+ 200: config_schema_1.ConfigReplySchema,
12
+ 400: shared_1.RequestErrorSchema,
13
+ 403: shared_1.AccessErrorSchema,
14
+ 500: shared_1.InternalErrorSchema,
15
+ },
16
+ headers: shared_1.HeadersSchema,
17
+ },
18
+ }, async (request, reply) => handlers_helper_1.handlers.get('config').bind(fastify)(request, reply));
19
+ });
20
+ exports.default = configRouteOriginal;
21
+ //# sourceMappingURL=config.route.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.route.js","sourceRoot":"","sources":["../../../routes/config/config.route.ts"],"names":[],"mappings":";;AAAA,iEAA4D;AAC5D,mEAAwD;AACxD,+DAA+D;AAC/D,iDAE6B;AAE7B,MAAM,mBAAmB,GAAG,IAAA,8BAAa,EAAC,KAAK,EAAE,OAAO,EAAE,EAAE;IACxD,OAAO,CAAC,IAAI,CAAC,SAAS,EAAE;QACpB,MAAM,EAAE;YACJ,QAAQ,EAAE;gBACN,GAAG,EAAE,iCAAiB;gBACtB,GAAG,EAAE,2BAAkB;gBACvB,GAAG,EAAE,0BAAiB;gBACtB,GAAG,EAAE,4BAAmB;aAC3B;YACD,OAAO,EAAE,sBAAa;SACzB;KACJ,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,CAAC,0BAAQ,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,CAAA;AACtF,CAAC,CAAC,CAAA;AAEF,kBAAe,mBAAmB,CAAA"}
@@ -0,0 +1,3 @@
1
+ declare const configRouteValidatePlugin: (fastify: import("../../helpers/fastify.helper").FastifyTypebox) => Promise<void>;
2
+ export default configRouteValidatePlugin;
3
+ //# sourceMappingURL=config.route.validate.plugin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.route.validate.plugin.d.ts","sourceRoot":"","sources":["../../../routes/config/config.route.validate.plugin.ts"],"names":[],"mappings":"AAKA,QAAA,MAAM,yBAAyB,mFA2C7B,CAAA;AAEF,eAAe,yBAAyB,CAAA"}
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const config_helper_1 = require("../../helpers/config.helper");
4
+ const fastify_helper_1 = require("../../helpers/fastify.helper");
5
+ const shared_1 = require("../../schemas/shared");
6
+ const configRouteValidatePlugin = (0, fastify_helper_1.registerPlugin)(async (fastify) => {
7
+ const gameConfig = (0, config_helper_1.getGameConfig)();
8
+ fastify.addHook('preSerialization', (_request, _reply, payload, done) => {
9
+ if (payload?.ok) {
10
+ try {
11
+ payload.stakeModes.forEach((stakeMode) => {
12
+ if (!gameConfig.hasBuy
13
+ && ([shared_1.EStakeType.buy, shared_1.EStakeType.bonusBet].includes(stakeMode.type))) {
14
+ throw new Error(`Game doesn't support buyable stake modes ("${stakeMode.name}")`);
15
+ }
16
+ if (stakeMode.multiple && stakeMode.maxQty === undefined) {
17
+ throw new Error(`Property "maxQty" should be defined for the stake mode ("${stakeMode.name}")`);
18
+ }
19
+ if (!stakeMode.multiple && stakeMode.maxQty !== undefined) {
20
+ throw new Error(`Stake mode ("${stakeMode.name}") should be multiple`);
21
+ }
22
+ });
23
+ if (payload.coinRatio === undefined && payload.variableLevels === undefined) {
24
+ throw new Error('coinRatio or variableLevels should be defined');
25
+ }
26
+ if (payload.coinRatio !== undefined && payload.variableLevels !== undefined) {
27
+ throw new Error('coinRatio and variableLevels must not be defined together');
28
+ }
29
+ if ((payload.coinRatio !== gameConfig.coinRatio)
30
+ || (payload.variableLevels !== gameConfig.variableLevels)) {
31
+ throw new Error('coinRatio or variableLevels should be equal in gameConfig and in the handler');
32
+ }
33
+ }
34
+ catch (error) {
35
+ throw (0, fastify_helper_1.httpError)(`Advanced validation failed: ${error.message}`, 500);
36
+ }
37
+ }
38
+ done(null, payload);
39
+ });
40
+ });
41
+ exports.default = configRouteValidatePlugin;
42
+ //# sourceMappingURL=config.route.validate.plugin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.route.validate.plugin.js","sourceRoot":"","sources":["../../../routes/config/config.route.validate.plugin.ts"],"names":[],"mappings":";;AAAA,+DAA2D;AAC3D,iEAAwE;AAExE,iDAAiD;AAEjD,MAAM,yBAAyB,GAAG,IAAA,+BAAc,EAAC,KAAK,EAAE,OAAO,EAAE,EAAE;IAC/D,MAAM,UAAU,GAAG,IAAA,6BAAa,GAAE,CAAA;IAElC,OAAO,CAAC,OAAO,CAAe,kBAAkB,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,OAA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