@kozojs/core 0.3.3 → 0.3.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/index.d.ts CHANGED
@@ -430,42 +430,42 @@ interface ProblemDetails {
430
430
  }
431
431
  declare const ERROR_RESPONSES: {
432
432
  readonly VALIDATION_FAILED: {
433
- readonly type: "https://kozo.dev/errors/validation-failed";
433
+ readonly type: "https://kozo-docs.vercel.app/docs/core/errors#validation-failed";
434
434
  readonly title: "Validation Failed";
435
435
  readonly status: 400;
436
436
  };
437
437
  readonly INVALID_BODY: {
438
- readonly type: "https://kozo.dev/errors/invalid-body";
438
+ readonly type: "https://kozo-docs.vercel.app/docs/core/errors#invalid-body";
439
439
  readonly title: "Invalid Request Body";
440
440
  readonly status: 400;
441
441
  };
442
442
  readonly INVALID_QUERY: {
443
- readonly type: "https://kozo.dev/errors/invalid-query";
443
+ readonly type: "https://kozo-docs.vercel.app/docs/core/errors#invalid-query";
444
444
  readonly title: "Invalid Query Parameters";
445
445
  readonly status: 400;
446
446
  };
447
447
  readonly INVALID_PARAMS: {
448
- readonly type: "https://kozo.dev/errors/invalid-params";
448
+ readonly type: "https://kozo-docs.vercel.app/docs/core/errors#invalid-params";
449
449
  readonly title: "Invalid Path Parameters";
450
450
  readonly status: 400;
451
451
  };
452
452
  readonly INTERNAL_ERROR: {
453
- readonly type: "https://kozo.dev/errors/internal-error";
453
+ readonly type: "https://kozo-docs.vercel.app/docs/core/errors#internal-error";
454
454
  readonly title: "Internal Server Error";
455
455
  readonly status: 500;
456
456
  };
457
457
  readonly NOT_FOUND: {
458
- readonly type: "https://kozo.dev/errors/not-found";
458
+ readonly type: "https://kozo-docs.vercel.app/docs/core/errors#not-found";
459
459
  readonly title: "Resource Not Found";
460
460
  readonly status: 404;
461
461
  };
462
462
  readonly UNAUTHORIZED: {
463
- readonly type: "https://kozo.dev/errors/unauthorized";
463
+ readonly type: "https://kozo-docs.vercel.app/docs/core/errors#unauthorized";
464
464
  readonly title: "Unauthorized";
465
465
  readonly status: 401;
466
466
  };
467
467
  readonly FORBIDDEN: {
468
- readonly type: "https://kozo.dev/errors/forbidden";
468
+ readonly type: "https://kozo-docs.vercel.app/docs/core/errors#forbidden";
469
469
  readonly title: "Forbidden";
470
470
  readonly status: 403;
471
471
  };
package/lib/index.js CHANGED
@@ -207,42 +207,42 @@ import { createServer as netCreateServer } from "net";
207
207
  var CONTENT_TYPE_PROBLEM = "application/problem+json";
208
208
  var ERROR_RESPONSES = {
209
209
  VALIDATION_FAILED: {
210
- type: "https://kozo.dev/errors/validation-failed",
210
+ type: "https://kozo-docs.vercel.app/docs/core/errors#validation-failed",
211
211
  title: "Validation Failed",
212
212
  status: 400
213
213
  },
214
214
  INVALID_BODY: {
215
- type: "https://kozo.dev/errors/invalid-body",
215
+ type: "https://kozo-docs.vercel.app/docs/core/errors#invalid-body",
216
216
  title: "Invalid Request Body",
217
217
  status: 400
218
218
  },
219
219
  INVALID_QUERY: {
220
- type: "https://kozo.dev/errors/invalid-query",
220
+ type: "https://kozo-docs.vercel.app/docs/core/errors#invalid-query",
221
221
  title: "Invalid Query Parameters",
222
222
  status: 400
223
223
  },
224
224
  INVALID_PARAMS: {
225
- type: "https://kozo.dev/errors/invalid-params",
225
+ type: "https://kozo-docs.vercel.app/docs/core/errors#invalid-params",
226
226
  title: "Invalid Path Parameters",
227
227
  status: 400
228
228
  },
229
229
  INTERNAL_ERROR: {
230
- type: "https://kozo.dev/errors/internal-error",
230
+ type: "https://kozo-docs.vercel.app/docs/core/errors#internal-error",
231
231
  title: "Internal Server Error",
232
232
  status: 500
233
233
  },
234
234
  NOT_FOUND: {
235
- type: "https://kozo.dev/errors/not-found",
235
+ type: "https://kozo-docs.vercel.app/docs/core/errors#not-found",
236
236
  title: "Resource Not Found",
237
237
  status: 404
238
238
  },
239
239
  UNAUTHORIZED: {
240
- type: "https://kozo.dev/errors/unauthorized",
240
+ type: "https://kozo-docs.vercel.app/docs/core/errors#unauthorized",
241
241
  title: "Unauthorized",
242
242
  status: 401
243
243
  },
244
244
  FORBIDDEN: {
245
- type: "https://kozo.dev/errors/forbidden",
245
+ type: "https://kozo-docs.vercel.app/docs/core/errors#forbidden",
246
246
  title: "Forbidden",
247
247
  status: 403
248
248
  }
@@ -352,7 +352,7 @@ var KozoError = class extends Error {
352
352
  }
353
353
  toResponse(instance) {
354
354
  const body = {
355
- type: `https://kozo.dev/errors/${this.code}`,
355
+ type: `https://kozo-docs.vercel.app/docs/core/errors#${this.code}`,
356
356
  title: this.message,
357
357
  status: this.statusCode
358
358
  };
@@ -378,7 +378,7 @@ var ValidationFailedError = class extends KozoError {
378
378
  }
379
379
  toResponse(instance) {
380
380
  const body = {
381
- type: "https://kozo.dev/errors/validation-failed",
381
+ type: "https://kozo-docs.vercel.app/docs/core/errors#validation-failed",
382
382
  title: this.message,
383
383
  status: 400,
384
384
  errors: this.errors
@@ -424,7 +424,7 @@ var STATUS_TEXT = {
424
424
  503: "503 Service Unavailable"
425
425
  };
426
426
  var BODY_404 = JSON.stringify({
427
- type: "https://kozo.dev/errors/not-found",
427
+ type: "https://kozo-docs.vercel.app/docs/core/errors#not-found",
428
428
  title: "Resource Not Found",
429
429
  status: 404
430
430
  });
@@ -432,7 +432,7 @@ var NO_BODY_METHODS = /* @__PURE__ */ new Set(["GET", "HEAD", "DELETE", "OPTIONS
432
432
  var CT_JSON = "application/json";
433
433
  var CT_PROBLEM = "application/problem+json";
434
434
  var BODY_500 = JSON.stringify({
435
- type: "https://kozo.dev/errors/internal-error",
435
+ type: "https://kozo-docs.vercel.app/docs/core/errors#internal-error",
436
436
  title: "Internal Server Error",
437
437
  status: 500
438
438
  });
@@ -445,7 +445,7 @@ function uwsFastWriteJson(uwsRes, body) {
445
445
  }
446
446
  function uwsFastWrite400(field, errors, uwsRes) {
447
447
  const body = JSON.stringify({
448
- type: "https://kozo.dev/errors/validation-failed",
448
+ type: "https://kozo-docs.vercel.app/docs/core/errors#validation-failed",
449
449
  title: "Validation Failed",
450
450
  status: 400,
451
451
  errors: (errors ?? []).map((e) => ({
@@ -470,7 +470,7 @@ function uwsFastWrite500(uwsRes) {
470
470
  function uwsFastWriteError(err, uwsRes) {
471
471
  if (err instanceof KozoError) {
472
472
  const body = JSON.stringify({
473
- type: `https://kozo.dev/errors/${err.code}`,
473
+ type: `https://kozo-docs.vercel.app/docs/core/errors#${err.code}`,
474
474
  title: err.message,
475
475
  status: err.statusCode
476
476
  });
@@ -619,13 +619,13 @@ var CT_PROBLEM2 = "application/problem+json";
619
619
  var CT_TEXT = "text/plain";
620
620
  var CT_HTML = "text/html; charset=utf-8";
621
621
  var BODY_4042 = JSON.stringify({
622
- type: "https://kozo.dev/errors/not-found",
622
+ type: "https://kozo-docs.vercel.app/docs/core/errors#not-found",
623
623
  title: "Resource Not Found",
624
624
  status: 404
625
625
  });
626
626
  var LEN_404 = fastCL(BODY_4042.length);
627
627
  var BODY_5002 = JSON.stringify({
628
- type: "https://kozo.dev/errors/internal-error",
628
+ type: "https://kozo-docs.vercel.app/docs/core/errors#internal-error",
629
629
  title: "Internal Server Error",
630
630
  status: 500
631
631
  });
@@ -688,7 +688,7 @@ function fastWrite500(res) {
688
688
  }
689
689
  function fastWrite400(field, errors, res) {
690
690
  const body = JSON.stringify({
691
- type: "https://kozo.dev/errors/validation-failed",
691
+ type: "https://kozo-docs.vercel.app/docs/core/errors#validation-failed",
692
692
  title: "Validation Failed",
693
693
  status: 400,
694
694
  errors: (errors ?? []).map((e) => ({
@@ -708,7 +708,7 @@ function fastWrite400(field, errors, res) {
708
708
  function fastWriteError(err, res) {
709
709
  if (err instanceof KozoError) {
710
710
  const body = JSON.stringify({
711
- type: `https://kozo.dev/errors/${err.code}`,
711
+ type: `https://kozo-docs.vercel.app/docs/core/errors#${err.code}`,
712
712
  title: err.message,
713
713
  status: err.statusCode
714
714
  });