equipped 5.3.1 → 5.3.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 (203) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/dist/cjs/cache/adapters/in-memory/index.cjs +155 -155
  3. package/dist/cjs/cache/adapters/in-memory/index.cjs.map +1 -1
  4. package/dist/cjs/cache/adapters/in-memory/index.min.cjs +3 -3
  5. package/dist/cjs/cache/adapters/in-memory/index.min.cjs.map +1 -1
  6. package/dist/cjs/dbs/adapters/mongodb/index.cjs.map +1 -1
  7. package/dist/cjs/dbs/adapters/mongodb/index.min.cjs +2 -2
  8. package/dist/cjs/dbs/adapters/mongodb/index.min.cjs.map +1 -1
  9. package/dist/cjs/dbs/index.cjs +181 -179
  10. package/dist/cjs/dbs/index.cjs.map +1 -1
  11. package/dist/cjs/dbs/index.min.cjs +3 -3
  12. package/dist/cjs/dbs/index.min.cjs.map +1 -1
  13. package/dist/cjs/errors/index.cjs +11 -0
  14. package/dist/cjs/errors/index.cjs.map +1 -1
  15. package/dist/cjs/errors/index.min.cjs +1 -1
  16. package/dist/cjs/errors/index.min.cjs.map +1 -1
  17. package/dist/cjs/events/adapters/kafka/index.cjs.map +1 -1
  18. package/dist/cjs/events/adapters/kafka/index.min.cjs +2 -2
  19. package/dist/cjs/events/adapters/kafka/index.min.cjs.map +1 -1
  20. package/dist/cjs/events/adapters/rabbitmq/index.cjs +179 -179
  21. package/dist/cjs/events/adapters/rabbitmq/index.cjs.map +1 -1
  22. package/dist/cjs/events/adapters/rabbitmq/index.min.cjs +3 -3
  23. package/dist/cjs/events/adapters/rabbitmq/index.min.cjs.map +1 -1
  24. package/dist/cjs/orm/adapters/mongodb/index.cjs +144 -144
  25. package/dist/cjs/orm/adapters/mongodb/index.cjs.map +1 -1
  26. package/dist/cjs/orm/adapters/mongodb/index.min.cjs +1 -1
  27. package/dist/cjs/orm/adapters/mongodb/index.min.cjs.map +1 -1
  28. package/dist/cjs/orm/adapters/postgresql/index.cjs +152 -215
  29. package/dist/cjs/orm/adapters/postgresql/index.cjs.map +1 -1
  30. package/dist/cjs/orm/adapters/postgresql/index.min.cjs +11 -11
  31. package/dist/cjs/orm/adapters/postgresql/index.min.cjs.map +1 -1
  32. package/dist/cjs/server/adapters/express/index.cjs +292 -225
  33. package/dist/cjs/server/adapters/express/index.cjs.map +1 -1
  34. package/dist/cjs/server/adapters/express/index.min.cjs +7 -7
  35. package/dist/cjs/server/adapters/express/index.min.cjs.map +1 -1
  36. package/dist/cjs/server/adapters/fastify/index.cjs +277 -210
  37. package/dist/cjs/server/adapters/fastify/index.cjs.map +1 -1
  38. package/dist/cjs/server/adapters/fastify/index.min.cjs +7 -7
  39. package/dist/cjs/server/adapters/fastify/index.min.cjs.map +1 -1
  40. package/dist/cjs/server/index.cjs +82 -15
  41. package/dist/cjs/server/index.cjs.map +1 -1
  42. package/dist/cjs/server/index.min.cjs +7 -7
  43. package/dist/cjs/server/index.min.cjs.map +1 -1
  44. package/dist/cjs/utilities/index.cjs +0 -5
  45. package/dist/cjs/utilities/index.cjs.map +1 -1
  46. package/dist/cjs/utilities/index.min.cjs +2 -2
  47. package/dist/cjs/utilities/index.min.cjs.map +1 -1
  48. package/dist/cjs/validations/index.cjs +1 -0
  49. package/dist/cjs/validations/index.cjs.map +1 -1
  50. package/dist/cjs/validations/index.min.cjs +1 -1
  51. package/dist/cjs/validations/index.min.cjs.map +1 -1
  52. package/dist/esm/cache/adapters/in-memory/index.min.mjs +1 -1
  53. package/dist/esm/cache/adapters/in-memory/index.min.mjs.map +1 -1
  54. package/dist/esm/cache/adapters/in-memory/index.mjs +6 -3
  55. package/dist/esm/cache/adapters/in-memory/index.mjs.map +1 -1
  56. package/dist/esm/cache/adapters/redis/index.min.mjs +1 -1
  57. package/dist/esm/cache/adapters/redis/index.mjs +5 -3
  58. package/dist/esm/cache/index.min.mjs +1 -1
  59. package/dist/esm/cache/index.mjs +2 -2
  60. package/dist/esm/{chunk-2GGMLKRP.min.mjs → chunk-4GZ43EQ2.min.mjs} +2 -2
  61. package/dist/esm/{chunk-IRYCN6PI.min.mjs → chunk-5FEVQT6K.min.mjs} +2 -2
  62. package/dist/esm/{chunk-LKS5ZE45.mjs → chunk-74GY55PM.mjs} +2 -2
  63. package/dist/esm/{chunk-A4P7P6BU.mjs → chunk-7N4WUZ7P.mjs} +167 -347
  64. package/dist/esm/chunk-7N4WUZ7P.mjs.map +1 -0
  65. package/dist/esm/chunk-A332TTED.mjs +135 -0
  66. package/dist/esm/chunk-A332TTED.mjs.map +1 -0
  67. package/dist/esm/{chunk-7CP7ZE2O.mjs → chunk-BONYW6LU.mjs} +9 -5
  68. package/dist/esm/{chunk-7CP7ZE2O.mjs.map → chunk-BONYW6LU.mjs.map} +1 -1
  69. package/dist/esm/{chunk-HXFNN6RI.mjs → chunk-C3G4W4ZV.mjs} +3 -3
  70. package/dist/esm/chunk-CU2HU5UE.min.mjs +2 -0
  71. package/dist/esm/chunk-CU2HU5UE.min.mjs.map +1 -0
  72. package/dist/esm/{chunk-676VIABN.min.mjs → chunk-LJZOS62I.min.mjs} +2 -2
  73. package/dist/esm/{chunk-7SQ5JQYR.min.mjs → chunk-MCX2O5IT.min.mjs} +2 -2
  74. package/dist/esm/{chunk-BWUFPMVG.mjs → chunk-MNKDFIVK.mjs} +2 -2
  75. package/dist/esm/chunk-N3OD4QL2.min.mjs +32 -0
  76. package/dist/esm/chunk-N3OD4QL2.min.mjs.map +1 -0
  77. package/dist/esm/chunk-NEF3UYFA.mjs +144 -0
  78. package/dist/esm/chunk-NEF3UYFA.mjs.map +1 -0
  79. package/dist/esm/{chunk-TSVHZZE4.mjs → chunk-RFJ5URMP.mjs} +5 -5
  80. package/dist/esm/chunk-RX4XPABH.min.mjs +2 -0
  81. package/dist/esm/{chunk-MQXTTWPS.min.mjs.map → chunk-RX4XPABH.min.mjs.map} +1 -1
  82. package/dist/esm/chunk-SPOVKWV3.min.mjs +2 -0
  83. package/dist/esm/chunk-SPOVKWV3.min.mjs.map +1 -0
  84. package/dist/esm/{chunk-3TP7NINX.mjs → chunk-XESM7IWM.mjs} +2 -2
  85. package/dist/esm/{chunk-5PZACGPI.mjs → chunk-XJKBHQWO.mjs} +7 -5
  86. package/dist/esm/{chunk-5PZACGPI.mjs.map → chunk-XJKBHQWO.mjs.map} +1 -1
  87. package/dist/esm/chunk-YC6V4HLT.min.mjs +2 -0
  88. package/dist/esm/{chunk-7NF7PV6S.min.mjs.map → chunk-YC6V4HLT.min.mjs.map} +1 -1
  89. package/dist/esm/{chunk-P4PRHHIY.min.mjs → chunk-YWQTFKNY.min.mjs} +2 -2
  90. package/dist/esm/dbs/adapters/mongodb/index.min.mjs +1 -1
  91. package/dist/esm/dbs/adapters/mongodb/index.min.mjs.map +1 -1
  92. package/dist/esm/dbs/adapters/mongodb/index.mjs +8 -5
  93. package/dist/esm/dbs/adapters/mongodb/index.mjs.map +1 -1
  94. package/dist/esm/dbs/index.min.mjs +1 -1
  95. package/dist/esm/dbs/index.mjs +5 -3
  96. package/dist/esm/errors/index.min.mjs +1 -1
  97. package/dist/esm/errors/index.mjs +3 -1
  98. package/dist/esm/events/adapters/kafka/index.min.mjs +1 -1
  99. package/dist/esm/events/adapters/kafka/index.mjs +4 -2
  100. package/dist/esm/events/adapters/rabbitmq/index.min.mjs +1 -1
  101. package/dist/esm/events/adapters/rabbitmq/index.min.mjs.map +1 -1
  102. package/dist/esm/events/adapters/rabbitmq/index.mjs +7 -3
  103. package/dist/esm/events/adapters/rabbitmq/index.mjs.map +1 -1
  104. package/dist/esm/index.min.mjs +1 -1
  105. package/dist/esm/index.mjs +1 -1
  106. package/dist/esm/instance/index.min.mjs +1 -1
  107. package/dist/esm/instance/index.mjs +1 -1
  108. package/dist/esm/introspection-TO27QT2X.min.mjs +2 -0
  109. package/dist/esm/{introspection-YJF3QAUK.mjs → introspection-ZUQYVEFC.mjs} +3 -3
  110. package/dist/esm/jobs/adapters/redis/index.min.mjs +1 -1
  111. package/dist/esm/jobs/adapters/redis/index.min.mjs.map +1 -1
  112. package/dist/esm/jobs/adapters/redis/index.mjs +10 -6
  113. package/dist/esm/jobs/adapters/redis/index.mjs.map +1 -1
  114. package/dist/esm/orm/adapters/in-memory/index.min.mjs +1 -1
  115. package/dist/esm/orm/adapters/in-memory/index.mjs +4 -3
  116. package/dist/esm/orm/adapters/json/index.min.mjs +1 -1
  117. package/dist/esm/orm/adapters/json/index.min.mjs.map +1 -1
  118. package/dist/esm/orm/adapters/json/index.mjs +6 -5
  119. package/dist/esm/orm/adapters/json/index.mjs.map +1 -1
  120. package/dist/esm/orm/adapters/mongodb/index.min.mjs +1 -1
  121. package/dist/esm/orm/adapters/mongodb/index.min.mjs.map +1 -1
  122. package/dist/esm/orm/adapters/mongodb/index.mjs +6 -4
  123. package/dist/esm/orm/adapters/mongodb/index.mjs.map +1 -1
  124. package/dist/esm/orm/adapters/postgresql/index.min.mjs +2 -2
  125. package/dist/esm/orm/adapters/postgresql/index.min.mjs.map +1 -1
  126. package/dist/esm/orm/adapters/postgresql/index.mjs +8 -5
  127. package/dist/esm/orm/adapters/postgresql/index.mjs.map +1 -1
  128. package/dist/esm/orm/index.min.mjs +1 -1
  129. package/dist/esm/orm/index.mjs +3 -3
  130. package/dist/esm/server/adapters/express/index.min.mjs +1 -1
  131. package/dist/esm/server/adapters/express/index.min.mjs.map +1 -1
  132. package/dist/esm/server/adapters/express/index.mjs +7 -3
  133. package/dist/esm/server/adapters/express/index.mjs.map +1 -1
  134. package/dist/esm/server/adapters/fastify/index.min.mjs +1 -1
  135. package/dist/esm/server/adapters/fastify/index.min.mjs.map +1 -1
  136. package/dist/esm/server/adapters/fastify/index.mjs +7 -3
  137. package/dist/esm/server/adapters/fastify/index.mjs.map +1 -1
  138. package/dist/esm/server/index.min.mjs +1 -1
  139. package/dist/esm/server/index.mjs +1 -1
  140. package/dist/esm/utilities/index.min.mjs +1 -1
  141. package/dist/esm/utilities/index.mjs +5 -4
  142. package/dist/esm/validations/index.min.mjs +1 -1
  143. package/dist/esm/validations/index.mjs +1 -1
  144. package/dist/types/{base-BDTBLZ9a.d.ts → base-BnwwLupM.d.ts} +3 -3
  145. package/dist/types/cache/adapters/in-memory/index.js +6 -3
  146. package/dist/types/cache/adapters/redis/index.js +5 -3
  147. package/dist/types/cache/index.js +2 -2
  148. package/dist/types/chunk-7MXHWHRV.js +134 -0
  149. package/dist/types/{chunk-LPB5LS7A.js → chunk-BKXNLF6X.js} +1 -1
  150. package/dist/types/{chunk-J3TGB5YQ.js → chunk-DZFKDZDZ.js} +8 -4
  151. package/dist/types/{chunk-YLJNBL6J.js → chunk-GQRSK2KP.js} +6 -4
  152. package/dist/types/chunk-PPD4WDG6.js +143 -0
  153. package/dist/types/{chunk-55CTVK7R.js → chunk-SZAA5GF6.js} +1 -1
  154. package/dist/types/{chunk-4DH3POYM.js → chunk-UGLZIYAR.js} +4 -4
  155. package/dist/types/{chunk-5Z26ZURE.js → chunk-UR7O43FC.js} +1 -1
  156. package/dist/types/{chunk-IZDJDGOV.js → chunk-X5ZDIXCZ.js} +2 -2
  157. package/dist/types/{chunk-TT5EORDK.js → chunk-YGIIUOQM.js} +166 -346
  158. package/dist/types/dbs/adapters/mongodb/index.js +8 -5
  159. package/dist/types/dbs/index.js +5 -3
  160. package/dist/types/errors/index.d.ts +8 -3
  161. package/dist/types/errors/index.js +3 -1
  162. package/dist/types/events/adapters/kafka/index.js +4 -2
  163. package/dist/types/events/adapters/rabbitmq/index.js +7 -3
  164. package/dist/types/index.js +1 -1
  165. package/dist/types/instance/index.js +1 -1
  166. package/dist/types/{introspection-EHGM4RMO.js → introspection-ZQMYTW6H.js} +2 -2
  167. package/dist/types/jobs/adapters/redis/index.js +10 -6
  168. package/dist/types/orm/adapters/in-memory/index.js +4 -3
  169. package/dist/types/orm/adapters/json/index.js +6 -5
  170. package/dist/types/orm/adapters/mongodb/index.js +6 -4
  171. package/dist/types/orm/adapters/postgresql/index.js +8 -5
  172. package/dist/types/orm/index.js +3 -3
  173. package/dist/types/{requestError-DdaL8hc3.d.ts → requestError-BmOhSuFb.d.ts} +1 -0
  174. package/dist/types/server/adapters/express/index.d.ts +2 -2
  175. package/dist/types/server/adapters/express/index.js +7 -3
  176. package/dist/types/server/adapters/fastify/index.d.ts +3 -3
  177. package/dist/types/server/adapters/fastify/index.js +7 -3
  178. package/dist/types/server/index.d.ts +4 -4
  179. package/dist/types/server/index.js +1 -1
  180. package/dist/types/utilities/index.d.ts +1 -2
  181. package/dist/types/utilities/index.js +5 -4
  182. package/dist/types/{validationError-oigtHqBi.d.ts → validationError-C2tVK4s7.d.ts} +1 -1
  183. package/dist/types/validations/index.d.ts +4 -4
  184. package/dist/types/validations/index.js +1 -1
  185. package/package.json +1 -1
  186. package/dist/esm/chunk-7NF7PV6S.min.mjs +0 -2
  187. package/dist/esm/chunk-A4P7P6BU.mjs.map +0 -1
  188. package/dist/esm/chunk-IN5YKIJ7.min.mjs +0 -32
  189. package/dist/esm/chunk-IN5YKIJ7.min.mjs.map +0 -1
  190. package/dist/esm/chunk-MQXTTWPS.min.mjs +0 -2
  191. package/dist/esm/introspection-THKMXV5V.min.mjs +0 -2
  192. /package/dist/esm/{chunk-2GGMLKRP.min.mjs.map → chunk-4GZ43EQ2.min.mjs.map} +0 -0
  193. /package/dist/esm/{chunk-IRYCN6PI.min.mjs.map → chunk-5FEVQT6K.min.mjs.map} +0 -0
  194. /package/dist/esm/{chunk-LKS5ZE45.mjs.map → chunk-74GY55PM.mjs.map} +0 -0
  195. /package/dist/esm/{chunk-HXFNN6RI.mjs.map → chunk-C3G4W4ZV.mjs.map} +0 -0
  196. /package/dist/esm/{chunk-676VIABN.min.mjs.map → chunk-LJZOS62I.min.mjs.map} +0 -0
  197. /package/dist/esm/{chunk-7SQ5JQYR.min.mjs.map → chunk-MCX2O5IT.min.mjs.map} +0 -0
  198. /package/dist/esm/{chunk-BWUFPMVG.mjs.map → chunk-MNKDFIVK.mjs.map} +0 -0
  199. /package/dist/esm/{chunk-TSVHZZE4.mjs.map → chunk-RFJ5URMP.mjs.map} +0 -0
  200. /package/dist/esm/{chunk-3TP7NINX.mjs.map → chunk-XESM7IWM.mjs.map} +0 -0
  201. /package/dist/esm/{chunk-P4PRHHIY.min.mjs.map → chunk-YWQTFKNY.min.mjs.map} +0 -0
  202. /package/dist/esm/{introspection-THKMXV5V.min.mjs.map → introspection-TO27QT2X.min.mjs.map} +0 -0
  203. /package/dist/esm/{introspection-YJF3QAUK.mjs.map → introspection-ZUQYVEFC.mjs.map} +0 -0
@@ -19,12 +19,12 @@ __export(valleyed_exports, {
19
19
  withResponse: () => withResponse
20
20
  });
21
21
  import { AsyncLocalStorage } from "async_hooks";
22
- import { PipeError as PipeError2, v as v6 } from "valleyed";
22
+ import { PipeError as PipeError2, v as v5 } from "valleyed";
23
23
 
24
24
  // src/instance/index.ts
25
25
  import pino from "pino";
26
26
  import { ulid } from "ulid";
27
- import { v as v5 } from "valleyed";
27
+ import { v as v4 } from "valleyed";
28
28
 
29
29
  // src/errors/equippedError.ts
30
30
  var EquippedError = class extends Error {
@@ -51,7 +51,7 @@ import "@fastify/cors";
51
51
  import "cors";
52
52
  import { Server as SocketServer } from "socket.io";
53
53
  import supertest from "supertest";
54
- import { PipeError, v as v3 } from "valleyed";
54
+ import { PipeError, v as v2 } from "valleyed";
55
55
 
56
56
  // src/server/openapi.ts
57
57
  import { convert } from "@openapi-contrib/json-schema-to-openapi-schema";
@@ -78,6 +78,7 @@ var StatusCodes = {
78
78
  NotAuthorized: 403,
79
79
  NotFound: 404,
80
80
  ValidationError: 422,
81
+ PreconditionRequired: 428,
81
82
  TooManyRequests: 429,
82
83
  TokenExpired: 461
83
84
  };
@@ -337,266 +338,6 @@ var openapi = (config) => {
337
338
  };
338
339
  };
339
340
 
340
- // src/utilities/authProviders.ts
341
- var authProviders_exports = {};
342
- __export(authProviders_exports, {
343
- signinWithApple: () => signinWithApple,
344
- signinWithFacebook: () => signinWithFacebook,
345
- signinWithGoogle: () => signinWithGoogle
346
- });
347
- import axios from "axios";
348
- import jwt from "jsonwebtoken";
349
- import jwksClient from "jwks-rsa";
350
- var signinWithGoogle = async (idToken) => {
351
- const authUrl = `https://oauth2.googleapis.com/tokeninfo?id_token=${idToken}`;
352
- const { data } = await axios.get(authUrl).catch((err) => {
353
- throw new EquippedError("Failed to sign in with google", { idToken }, err);
354
- });
355
- data.first_name = data.given_name;
356
- data.last_name = data.family_name;
357
- return data;
358
- };
359
- var signinWithApple = async (idToken) => {
360
- try {
361
- const APPLE_BASE = "https://appleid.apple.com";
362
- const json = jwt.decode(idToken, { complete: true });
363
- if (!json?.header) throw new EquippedError("Missing JWT header", { idToken, json });
364
- const { kid, alg } = json.header;
365
- const publicKey = await jwksClient({ jwksUri: `${APPLE_BASE}/auth/keys`, cache: true }).getSigningKey(kid).then((key) => key.getPublicKey()).catch(() => null);
366
- if (!publicKey) throw new EquippedError("no publicKey", { idToken, publicKey, json });
367
- const data = jwt.verify(idToken, publicKey, { algorithms: [alg] });
368
- if (!data) throw new EquippedError("no data", { idToken, data });
369
- if (data.iss !== APPLE_BASE) throw new EquippedError("iss doesnt match", { idToken, data });
370
- if (data.exp * 1e3 < Date.now()) throw new EquippedError("expired idToken", { idToken, data });
371
- return data;
372
- } catch (err) {
373
- throw new EquippedError("Failed to sign in with apple", { idToken }, err);
374
- }
375
- };
376
- var signinWithFacebook = async (accessToken, fields = []) => {
377
- fields = [.../* @__PURE__ */ new Set([...fields, "name", "picture", "email"])];
378
- const { data } = await axios.request({
379
- method: "get",
380
- url: "https://graph.facebook.com/v15.0/me",
381
- params: {
382
- fields: fields.join(","),
383
- access_token: accessToken
384
- }
385
- }).catch((err) => {
386
- throw new EquippedError("Failed to sign in with facebook", { accessToken, fields }, err);
387
- });
388
- const isValidData = fields.every((key) => key in data);
389
- if (!isValidData) throw new EquippedError("Incomplete scope for access token", { accessToken, fields, data });
390
- data.email_verified = "true";
391
- return data;
392
- };
393
-
394
- // src/utilities/configurable.ts
395
- import { v as v2 } from "valleyed";
396
- function configurable(pipeFn, base) {
397
- const pipe = pipeFn();
398
- v2.compile(pipe);
399
- class Configurable extends base {
400
- constructor(config, ...baseArgs) {
401
- super(...baseArgs);
402
- this.config = config;
403
- }
404
- static create(input, ...args) {
405
- const r = v2.validate(pipe, input);
406
- if (!r.valid) throw r.error;
407
- return new this(r.value, ...args);
408
- }
409
- }
410
- return Configurable;
411
- }
412
- if (void 0) {
413
- const { describe, test, expect, expectTypeOf } = void 0;
414
- const { v: v8 } = await null;
415
- const testPipe = () => v8.object({
416
- host: v8.string(),
417
- port: v8.number()
418
- });
419
- class TestBase {
420
- baseValue;
421
- constructor() {
422
- this.baseValue = "base";
423
- }
424
- }
425
- class TestBaseWithArgs {
426
- label;
427
- constructor(label) {
428
- this.label = label;
429
- }
430
- }
431
- describe("configurable", () => {
432
- test("validation runs in static create before constructor body executes", () => {
433
- let constructorRan = false;
434
- const Wrapped = configurable(testPipe, TestBase);
435
- class MyClass extends Wrapped {
436
- constructor(config) {
437
- super(config);
438
- constructorRan = true;
439
- }
440
- }
441
- expect(() => MyClass.create({ host: 123, port: "bad" })).toThrow();
442
- expect(constructorRan).toBe(false);
443
- MyClass.create({ host: "localhost", port: 3e3 });
444
- expect(constructorRan).toBe(true);
445
- });
446
- test("constructor receives validated value", () => {
447
- const Wrapped = configurable(testPipe, TestBase);
448
- let receivedConfig;
449
- class MyClass extends Wrapped {
450
- constructor(config) {
451
- super(config);
452
- receivedConfig = this.config;
453
- }
454
- }
455
- MyClass.create({ host: "localhost", port: 3e3 });
456
- expect(receivedConfig).toEqual({ host: "localhost", port: 3e3 });
457
- });
458
- test("external new is a compile error", () => {
459
- const Wrapped = configurable(testPipe, TestBase);
460
- class MyClass extends Wrapped {
461
- constructor(config) {
462
- super(config);
463
- }
464
- }
465
- void (() => new MyClass({ host: "localhost", port: 3e3 }));
466
- });
467
- test("static Config resolves to PipeOutput<P> at the type level", () => {
468
- const Wrapped = configurable(testPipe, TestBase);
469
- class MyClass extends Wrapped {
470
- constructor(config) {
471
- super(config);
472
- }
473
- }
474
- expectTypeOf().toEqualTypeOf();
475
- expect(MyClass.create).toBeTypeOf("function");
476
- });
477
- test("ConstructorParameters<This>-based extras inference works for non-zero-arg leaf signatures", () => {
478
- const Wrapped = configurable(testPipe, TestBase);
479
- class MyClass extends Wrapped {
480
- extra;
481
- constructor(config, extra) {
482
- super(config);
483
- this.extra = extra;
484
- }
485
- }
486
- const instance = MyClass.create({ host: "localhost", port: 3e3 }, 42);
487
- expect(instance.extra).toBe(42);
488
- expectTypeOf(instance).toHaveProperty("extra");
489
- expectTypeOf(instance.extra).toEqualTypeOf();
490
- void (() => MyClass.create({ host: "localhost", port: 3e3 }, "not-a-number"));
491
- });
492
- test("base-args forwarding works for non-zero-arg bases", () => {
493
- const Wrapped = configurable(testPipe, TestBaseWithArgs);
494
- class MyClass extends Wrapped {
495
- constructor(config, label) {
496
- super(config, label);
497
- }
498
- }
499
- const instance = MyClass.create({ host: "localhost", port: 3e3 }, "test-label");
500
- expect(instance.label).toBe("test-label");
501
- });
502
- test("config is accessible as protected readonly on instances", () => {
503
- const Wrapped = configurable(testPipe, TestBase);
504
- class MyClass extends Wrapped {
505
- constructor(config) {
506
- super(config);
507
- }
508
- getHost() {
509
- return this.config.host;
510
- }
511
- }
512
- const instance = MyClass.create({ host: "localhost", port: 3e3 });
513
- expect(instance.getHost()).toBe("localhost");
514
- });
515
- test("accepts an abstract base class", () => {
516
- class AbstractBase {
517
- }
518
- const Wrapped = configurable(testPipe, AbstractBase);
519
- class Concrete extends Wrapped {
520
- constructor(config) {
521
- super(config);
522
- }
523
- greet() {
524
- return `hello from ${this.config.host}`;
525
- }
526
- }
527
- const instance = Concrete.create({ host: "localhost", port: 3e3 });
528
- expect(instance.greet()).toBe("hello from localhost");
529
- expectTypeOf(instance).toHaveProperty("config");
530
- });
531
- });
532
- }
533
-
534
- // src/utilities/hash.ts
535
- var hash_exports = {};
536
- __export(hash_exports, {
537
- compare: () => compare2,
538
- hash: () => hash2
539
- });
540
- import * as bcrypt from "bcryptjs";
541
- var hash2 = async (password) => {
542
- password = password.trim();
543
- if (!password) return "";
544
- return await bcrypt.hash(password, Instance.get().settings.utils.hashSaltRounds);
545
- };
546
- var compare2 = async (plainPassword, hashed) => {
547
- plainPassword = plainPassword.trim();
548
- if (!plainPassword && plainPassword === hashed) return true;
549
- return await bcrypt.compare(plainPassword, hashed);
550
- };
551
-
552
- // src/utilities/json.ts
553
- var parseJSONValue = (data) => {
554
- try {
555
- if (data?.constructor?.name !== "String") return data;
556
- return JSON.parse(data);
557
- } catch {
558
- return data;
559
- }
560
- };
561
- function parseJSONObject(data) {
562
- return Object.fromEntries(Object.entries(data).map(([key, value]) => [key, parseJSONValue(value)]));
563
- }
564
-
565
- // src/utilities/media.ts
566
- import { parseBuffer } from "music-metadata";
567
- var getMediaDuration = async (buffer) => {
568
- try {
569
- const meta = await parseBuffer(buffer);
570
- return meta.format.duration ?? 0;
571
- } catch {
572
- return 0;
573
- }
574
- };
575
-
576
- // src/utilities/random.ts
577
- var random_exports = {};
578
- __export(random_exports, {
579
- number: () => number,
580
- string: () => string
581
- });
582
- import crypto from "crypto";
583
- function string(length = 20) {
584
- return crypto.randomBytes(length).toString("hex").slice(0, length);
585
- }
586
- function number(min = 0, max = 2 ** 48 - 1) {
587
- return crypto.randomInt(min, max);
588
- }
589
-
590
- // src/utilities/retry.ts
591
- var sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
592
- var retry = async (cb, tries, waitTimeInMs) => {
593
- if (tries <= 0) throw new EquippedError("out of tries", { tries, waitTimeInMs });
594
- const result = await cb();
595
- if (result.done === true) return result.value;
596
- await sleep(waitTimeInMs);
597
- return await retry(cb, tries - 1, waitTimeInMs);
598
- };
599
-
600
341
  // src/server/requests.ts
601
342
  var Request = class {
602
343
  ip;
@@ -625,8 +366,10 @@ var Request = class {
625
366
  this.params = params;
626
367
  this.cookies = cookies;
627
368
  this.headers = headers;
628
- this.query = parseJSONObject(query);
629
- this.body = Object.assign(parseJSONObject(body), files);
369
+ const hasFiles = Object.keys(files).length > 0;
370
+ const bodyFields = body && typeof body === "object" && !Array.isArray(body) ? body : {};
371
+ this.query = query;
372
+ this.body = hasFiles ? Object.assign({}, bodyFields, files) : body;
630
373
  }
631
374
  pipe(stream, opts = {}) {
632
375
  return new Response({ ...opts, piped: true, body: stream });
@@ -672,6 +415,83 @@ var Response = class {
672
415
  });
673
416
  }
674
417
  };
418
+ if (void 0) {
419
+ const { describe, expect, test } = void 0;
420
+ describe("Request", () => {
421
+ test("preserves adapter-provided query and body values without JSON normalization", () => {
422
+ const query = {
423
+ count: "10",
424
+ active: "true",
425
+ filter: '{"name":"test"}',
426
+ quoted: '"value"'
427
+ };
428
+ const body = {
429
+ count: "10",
430
+ active: "false",
431
+ payload: '{"nested":true}',
432
+ quoted: '"value"'
433
+ };
434
+ const request = new Request({
435
+ ip: void 0,
436
+ body,
437
+ cookies: {},
438
+ params: {},
439
+ query,
440
+ method: "post",
441
+ path: "/items",
442
+ headers: {},
443
+ files: {}
444
+ });
445
+ expect(request.query).toEqual(query);
446
+ expect(request.body).toEqual(body);
447
+ });
448
+ test("continues merging uploaded files into body fields without parsing string fields", () => {
449
+ const file = {
450
+ name: "avatar.png",
451
+ type: "image/png",
452
+ size: 4,
453
+ isTruncated: false,
454
+ data: Buffer.from("file"),
455
+ duration: 0
456
+ };
457
+ const body = { metadata: '{"alt":"avatar"}' };
458
+ const request = new Request({
459
+ ip: void 0,
460
+ body,
461
+ cookies: {},
462
+ params: {},
463
+ query: {},
464
+ method: "post",
465
+ path: "/upload",
466
+ headers: {},
467
+ files: { avatar: [file] }
468
+ });
469
+ expect(request.body).toEqual({ metadata: '{"alt":"avatar"}', avatar: [file] });
470
+ });
471
+ test("does not spread non-object body values when uploaded files are present", () => {
472
+ const file = {
473
+ name: "avatar.png",
474
+ type: "image/png",
475
+ size: 4,
476
+ isTruncated: false,
477
+ data: Buffer.from("file"),
478
+ duration: 0
479
+ };
480
+ const request = new Request({
481
+ ip: void 0,
482
+ body: "raw text body",
483
+ cookies: {},
484
+ params: {},
485
+ query: {},
486
+ method: "post",
487
+ path: "/upload",
488
+ headers: {},
489
+ files: { avatar: [file] }
490
+ });
491
+ expect(request.body).toEqual({ avatar: [file] });
492
+ });
493
+ });
494
+ }
675
495
 
676
496
  // src/server/requests-auth-methods/base.ts
677
497
  import "http2";
@@ -709,7 +529,7 @@ var BaseApiKeyRequestAuthMethod = class extends BaseRequestAuthMethod {
709
529
 
710
530
  // src/server/requests-auth-methods/jwt.ts
711
531
  import cookie from "@fastify/cookie";
712
- import jwt2 from "jsonwebtoken";
532
+ import jwt from "jsonwebtoken";
713
533
  var BaseJwtRequestAuthMethod = class extends BaseRequestAuthMethod {
714
534
  options;
715
535
  constructor(options) {
@@ -720,14 +540,14 @@ var BaseJwtRequestAuthMethod = class extends BaseRequestAuthMethod {
720
540
  return `${this.options.storagePrefix ?? ""}${userId}`;
721
541
  }
722
542
  async createToken(payload) {
723
- const token = jwt2.sign(payload, this.options.signingKey, { expiresIn: this.options.storageTTL });
543
+ const token = jwt.sign(payload, this.options.signingKey, { expiresIn: this.options.storageTTL });
724
544
  await this.store(this.#getKey(payload.id), token, this.options.storageTTL);
725
545
  return token;
726
546
  }
727
547
  async parse(headers) {
728
548
  try {
729
549
  const token = await this.parseHeader(headers);
730
- const user = jwt2.verify(token, this.options.signingKey);
550
+ const user = jwt.verify(token, this.options.signingKey);
731
551
  if (!user) throw new NotAuthenticatedError();
732
552
  if (this.options.enforceSingleSession) {
733
553
  const cachedToken = await this.retrieve(this.#getKey(user.id));
@@ -736,7 +556,7 @@ var BaseJwtRequestAuthMethod = class extends BaseRequestAuthMethod {
736
556
  return user;
737
557
  } catch (err) {
738
558
  if (err instanceof TokenExpired) throw err;
739
- if (err instanceof jwt2.TokenExpiredError) throw new TokenExpired(void 0, err);
559
+ if (err instanceof jwt.TokenExpiredError) throw new TokenExpired(void 0, err);
740
560
  else throw new NotAuthenticatedError(void 0, err);
741
561
  }
742
562
  }
@@ -891,50 +711,50 @@ var SocketEmitter = class {
891
711
  };
892
712
 
893
713
  // src/server/adapters/base.ts
894
- var serverConfigPipe = () => v3.object({
895
- port: v3.number(),
896
- cors: v3.optional(
897
- v3.object({
898
- origin: v3.optional(v3.or([v3.array(v3.string()), v3.is(true)])),
899
- methods: v3.optional(v3.array(v3.in(Object.values(Methods)))),
900
- credentials: v3.optional(v3.boolean())
714
+ var serverConfigPipe = () => v2.object({
715
+ port: v2.number(),
716
+ cors: v2.optional(
717
+ v2.object({
718
+ origin: v2.optional(v2.or([v2.array(v2.string()), v2.is(true)])),
719
+ methods: v2.optional(v2.array(v2.in(Object.values(Methods)))),
720
+ credentials: v2.optional(v2.boolean())
901
721
  })
902
722
  ),
903
- eventBus: v3.optional(v3.instanceOf(EventBus)),
904
- publicPath: v3.optional(v3.string()),
905
- healthPath: v3.optional(v3.string()),
906
- openapi: v3.defaults(
907
- v3.object({
908
- docsVersion: v3.defaults(v3.string(), "1.0.0"),
909
- docsBaseUrl: v3.defaults(v3.array(v3.string()), ["/"]),
910
- docsPath: v3.defaults(v3.string(), "/__docs")
723
+ eventBus: v2.optional(v2.instanceOf(EventBus)),
724
+ publicPath: v2.optional(v2.string()),
725
+ healthPath: v2.optional(v2.string()),
726
+ openapi: v2.defaults(
727
+ v2.object({
728
+ docsVersion: v2.defaults(v2.string(), "1.0.0"),
729
+ docsBaseUrl: v2.defaults(v2.array(v2.string()), ["/"]),
730
+ docsPath: v2.defaults(v2.string(), "/__docs")
911
731
  }),
912
732
  {}
913
733
  ),
914
- requests: v3.defaults(
915
- v3.object({
916
- log: v3.defaults(v3.boolean(), true),
917
- rateLimit: v3.defaults(
918
- v3.object({
919
- enabled: v3.defaults(v3.boolean(), false),
920
- periodInMs: v3.defaults(v3.number(), 60 * 60 * 1e3),
921
- limit: v3.defaults(v3.number(), 5e3)
734
+ requests: v2.defaults(
735
+ v2.object({
736
+ log: v2.defaults(v2.boolean(), true),
737
+ rateLimit: v2.defaults(
738
+ v2.object({
739
+ enabled: v2.defaults(v2.boolean(), false),
740
+ periodInMs: v2.defaults(v2.number(), 60 * 60 * 1e3),
741
+ limit: v2.defaults(v2.number(), 5e3)
922
742
  }),
923
743
  {}
924
744
  ),
925
- slowdown: v3.defaults(
926
- v3.object({
927
- enabled: v3.defaults(v3.boolean(), false),
928
- periodInMs: v3.defaults(v3.number(), 10 * 60 * 1e3),
929
- delayAfter: v3.defaults(v3.number(), 2e3),
930
- delayInMs: v3.defaults(v3.number(), 500)
745
+ slowdown: v2.defaults(
746
+ v2.object({
747
+ enabled: v2.defaults(v2.boolean(), false),
748
+ periodInMs: v2.defaults(v2.number(), 10 * 60 * 1e3),
749
+ delayAfter: v2.defaults(v2.number(), 2e3),
750
+ delayInMs: v2.defaults(v2.number(), 500)
931
751
  }),
932
752
  {}
933
753
  )
934
754
  }),
935
755
  {}
936
756
  ),
937
- socketsAuthMethods: v3.defaults(v3.array(v3.instanceOf(BaseRequestAuthMethod)), [])
757
+ socketsAuthMethods: v2.defaults(v2.array(v2.instanceOf(BaseRequestAuthMethod)), [])
938
758
  });
939
759
  var rawResponseHandledSymbol = /* @__PURE__ */ Symbol("rawResponseHandled");
940
760
  var rawResponseHandled = Object.freeze({ [rawResponseHandledSymbol]: true });
@@ -955,7 +775,7 @@ function writeRawHandlerError(response, error) {
955
775
  var errorsSchemas = Object.entries(StatusCodes).filter(([, value]) => value > 399).map(([key, value]) => ({
956
776
  status: value,
957
777
  contentType: "application/json",
958
- pipe: v3.meta(v3.array(v3.object({ message: v3.string(), field: v3.optional(v3.string()) })), {
778
+ pipe: v2.meta(v2.array(v2.object({ message: v2.string(), field: v2.optional(v2.string()) })), {
959
779
  $refId: `Errors.${key}Response`,
960
780
  description: `${key} Response`
961
781
  })
@@ -1112,37 +932,37 @@ var Server = class {
1112
932
  { key: "responseCookies", type: "response" }
1113
933
  ];
1114
934
  defs.forEach((def) => {
1115
- const pipe = schema[def.key] ?? v3.any();
935
+ const pipe = schema[def.key] ?? v2.any();
1116
936
  if (def.skip) return;
1117
937
  if (def.type === "request") {
1118
938
  requestPipeDefs[def.key] = pipe;
1119
- jsonSchema.request[def.key] = v3.schema(pipe);
939
+ jsonSchema.request[def.key] = v2.schema(pipe);
1120
940
  }
1121
941
  if (def.type === "response") {
1122
942
  const pipeRecords = errorsSchemas.concat({ status: defaultStatusCode, contentType, pipe });
1123
- responsePipeDefs[def.key] = v3.any().pipe((input) => {
943
+ responsePipeDefs[def.key] = v2.any().pipe((input) => {
1124
944
  const p = pipeRecords.find((rec) => rec.status === status)?.pipe;
1125
945
  if (!p) throw PipeError.root(`schema not defined for status code: ${status}`, input);
1126
- const r = v3.validate(p, input);
946
+ const r = v2.validate(p, input);
1127
947
  if (!r.valid) throw r.error;
1128
948
  return r.value;
1129
949
  });
1130
950
  jsonSchema.response[def.key] = pipeRecords.map((record) => ({
1131
951
  status: record.status,
1132
952
  contentType: record.contentType,
1133
- schema: v3.schema(record.pipe)
953
+ schema: v2.schema(record.pipe)
1134
954
  }));
1135
955
  }
1136
956
  });
1137
- const requestPipe = v3.object(requestPipeDefs);
1138
- v3.compile(requestPipe, { allErrors: true });
1139
- const responsePipe = v3.object(responsePipeDefs);
1140
- v3.compile(responsePipe, { allErrors: true });
957
+ const requestPipe = v2.object(requestPipeDefs);
958
+ v2.compile(requestPipe, { allErrors: true });
959
+ const responsePipe = v2.object(responsePipeDefs);
960
+ v2.compile(responsePipe, { allErrors: true });
1141
961
  const validateRequest = async (request) => {
1142
962
  if (!Object.keys(requestPipeDefs)) return request;
1143
963
  const validity = requestLocalStorage.run(
1144
964
  request,
1145
- () => v3.validate(requestPipe, {
965
+ () => v2.validate(requestPipe, {
1146
966
  params: request.params,
1147
967
  headers: request.headers,
1148
968
  query: request.query,
@@ -1164,7 +984,7 @@ var Server = class {
1164
984
  contentType = response.contentType;
1165
985
  const validity = responseLocalStorage.run(
1166
986
  response,
1167
- () => v3.validate(responsePipe, {
987
+ () => v2.validate(responsePipe, {
1168
988
  responseHeaders: response.headers,
1169
989
  responseCookies: Object.fromEntries(Object.entries(response.cookies).map(([key, val]) => [key, val.value])),
1170
990
  response: response.body
@@ -1436,6 +1256,14 @@ var NotFoundError = class extends RequestError {
1436
1256
  }
1437
1257
  };
1438
1258
 
1259
+ // src/errors/types/preconditionRequiredError.ts
1260
+ var PreconditionRequiredError = class extends RequestError {
1261
+ statusCode = StatusCodes.PreconditionRequired;
1262
+ constructor(message = "Precondition required", cause) {
1263
+ super(message, [{ message }], cause);
1264
+ }
1265
+ };
1266
+
1439
1267
  // src/errors/types/tokenExpired.ts
1440
1268
  var TokenExpired = class extends RequestError {
1441
1269
  statusCode = StatusCodes.TokenExpired;
@@ -1858,22 +1686,22 @@ if (void 0) {
1858
1686
  }
1859
1687
 
1860
1688
  // src/instance/settings.ts
1861
- import { v as v4 } from "valleyed";
1862
- var instanceSettingsPipe = () => v4.object({
1863
- app: v4.object({
1864
- name: v4.string()
1689
+ import { v as v3 } from "valleyed";
1690
+ var instanceSettingsPipe = () => v3.object({
1691
+ app: v3.object({
1692
+ name: v3.string()
1865
1693
  }),
1866
- log: v4.defaults(
1867
- v4.object({
1868
- level: v4.defaults(v4.in(["fatal", "error", "warn", "info", "debug", "trace", "silent"]), "info")
1694
+ log: v3.defaults(
1695
+ v3.object({
1696
+ level: v3.defaults(v3.in(["fatal", "error", "warn", "info", "debug", "trace", "silent"]), "info")
1869
1697
  }),
1870
1698
  {}
1871
1699
  ),
1872
- utils: v4.defaults(
1873
- v4.object({
1874
- hashSaltRounds: v4.defaults(v4.number(), 10),
1875
- paginationDefaultLimit: v4.defaults(v4.number(), 100),
1876
- maxFileUploadSizeInMb: v4.defaults(v4.number(), 500)
1700
+ utils: v3.defaults(
1701
+ v3.object({
1702
+ hashSaltRounds: v3.defaults(v3.number(), 10),
1703
+ paginationDefaultLimit: v3.defaults(v3.number(), 100),
1704
+ maxFileUploadSizeInMb: v3.defaults(v3.number(), 500)
1877
1705
  }),
1878
1706
  {}
1879
1707
  )
@@ -1923,7 +1751,7 @@ var Instance = class _Instance {
1923
1751
  }
1924
1752
  }
1925
1753
  static envs(envsPipe) {
1926
- const envValidity = v5.validate(envsPipe, process.env);
1754
+ const envValidity = v4.validate(envsPipe, process.env);
1927
1755
  if (!envValidity.valid) {
1928
1756
  _Instance.crash(
1929
1757
  new EquippedError(`Environment variables are not valid
@@ -1936,7 +1764,7 @@ ${envValidity.error.toString()}`, {
1936
1764
  }
1937
1765
  static create(settings) {
1938
1766
  if (_Instance.#instance) return _Instance.crash(new EquippedError("Instance has been initialized already", {}));
1939
- const settingsValidity = v5.validate(instanceSettingsPipe(), settings);
1767
+ const settingsValidity = v4.validate(instanceSettingsPipe(), settings);
1940
1768
  if (!settingsValidity.valid) {
1941
1769
  _Instance.crash(
1942
1770
  new EquippedError(`Settings are not valid
@@ -1991,40 +1819,40 @@ ${settingsValidity.error.toString()}`, {
1991
1819
  };
1992
1820
 
1993
1821
  // src/validations/valleyed.ts
1994
- var filePipe = (err) => v6.array(
1995
- v6.file(err).pipe((input) => {
1822
+ var filePipe = (err) => v5.array(
1823
+ v5.file(err).pipe((input) => {
1996
1824
  const err2 = `is larger than allowed limit of ${Instance.get().settings.utils.maxFileUploadSizeInMb}mb`;
1997
1825
  const valid = input ? !input.isTruncated : true;
1998
1826
  if (valid) return input;
1999
1827
  throw PipeError2.root(err2, input);
2000
1828
  })
2001
1829
  );
2002
- var incomingFile = (err) => v6.define(
2003
- v6.compile(
2004
- filePipe(err).pipe(v6.min(1, "no file provided")).pipe((files) => files[0])
1830
+ var incomingFile = (err) => v5.define(
1831
+ v5.compile(
1832
+ filePipe(err).pipe(v5.min(1, "no file provided")).pipe((files) => files[0])
2005
1833
  ),
2006
1834
  { schema: () => ({ type: "string", format: "binary" }) }
2007
1835
  );
2008
- var incomingFiles = (err) => v6.define(v6.compile(filePipe(err)), {
1836
+ var incomingFiles = (err) => v5.define(v5.compile(filePipe(err)), {
2009
1837
  schema: () => ({ type: "string", format: "binary" })
2010
1838
  });
2011
1839
  var requestLocalStorage = new AsyncLocalStorage();
2012
1840
  var responseLocalStorage = new AsyncLocalStorage();
2013
- var withRequest = (fn) => v6.define((input) => {
1841
+ var withRequest = (fn) => v5.define((input) => {
2014
1842
  const req = requestLocalStorage.getStore();
2015
1843
  if (!req) throw new Error("Request not found in context");
2016
- const validated = v6.validate(fn(req), input);
1844
+ const validated = v5.validate(fn(req), input);
2017
1845
  return validated.valid ? validated.value : validated.error;
2018
1846
  });
2019
- var withResponse = (fn) => v6.define((input) => {
1847
+ var withResponse = (fn) => v5.define((input) => {
2020
1848
  const res = responseLocalStorage.getStore();
2021
1849
  if (!res) throw new Error("Response not found in context");
2022
- const validated = v6.validate(fn(res), input);
1850
+ const validated = v5.validate(fn(res), input);
2023
1851
  return validated.valid ? validated.value : validated.error;
2024
1852
  });
2025
1853
 
2026
1854
  // src/validations/index.ts
2027
- import { v as v7 } from "valleyed";
1855
+ import { v as v6 } from "valleyed";
2028
1856
  function pipeErrorToValidationError(error) {
2029
1857
  const errorsObject = error.messages.reduce((acc, { path = "", message }) => {
2030
1858
  if (acc[path]) acc[path].messages.push(message);
@@ -2034,7 +1862,7 @@ function pipeErrorToValidationError(error) {
2034
1862
  return new ValidationError(Object.values(errorsObject));
2035
1863
  }
2036
1864
  function validate(pipe, value) {
2037
- const validity = v7.validate(pipe, value);
1865
+ const validity = v6.validate(pipe, value);
2038
1866
  if (validity.valid) return validity.value;
2039
1867
  throw pipeErrorToValidationError(validity.error);
2040
1868
  }
@@ -2051,15 +1879,6 @@ export {
2051
1879
  makeResponseMiddleware,
2052
1880
  makeErrorMiddleware,
2053
1881
  Router,
2054
- authProviders_exports,
2055
- configurable,
2056
- hash_exports,
2057
- parseJSONValue,
2058
- parseJSONObject,
2059
- getMediaDuration,
2060
- random_exports,
2061
- sleep,
2062
- retry,
2063
1882
  Request,
2064
1883
  Response,
2065
1884
  BaseRequestAuthMethod,
@@ -2074,6 +1893,7 @@ export {
2074
1893
  NotAuthenticatedError,
2075
1894
  NotAuthorizedError,
2076
1895
  NotFoundError,
1896
+ PreconditionRequiredError,
2077
1897
  TokenExpired,
2078
1898
  ValidationError,
2079
1899
  Instance