@kaito-http/core 3.0.2 → 3.0.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/dist/index.cjs CHANGED
@@ -21,6 +21,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
21
21
  var index_exports = {};
22
22
  __export(index_exports, {
23
23
  KaitoError: () => KaitoError,
24
+ KaitoHead: () => KaitoHead,
24
25
  KaitoRequest: () => KaitoRequest,
25
26
  Router: () => Router,
26
27
  WrappedError: () => WrappedError,
@@ -77,44 +78,6 @@ function createKaitoHandler(config) {
77
78
  };
78
79
  }
79
80
 
80
- // src/request.ts
81
- var KaitoRequest = class {
82
- url;
83
- _request;
84
- constructor(url, request) {
85
- this._request = request;
86
- this.url = url;
87
- }
88
- get headers() {
89
- return this._request.headers;
90
- }
91
- get method() {
92
- return this._request.method;
93
- }
94
- async arrayBuffer() {
95
- return this._request.arrayBuffer();
96
- }
97
- async blob() {
98
- return this._request.blob();
99
- }
100
- async formData() {
101
- return this._request.formData();
102
- }
103
- async bytes() {
104
- const buffer = await this.arrayBuffer();
105
- return new Uint8Array(buffer);
106
- }
107
- async json() {
108
- return this._request.json();
109
- }
110
- async text() {
111
- return this._request.text();
112
- }
113
- get request() {
114
- return this._request;
115
- }
116
- };
117
-
118
81
  // src/head.ts
119
82
  var KaitoHead = class {
120
83
  _headers;
@@ -158,6 +121,44 @@ var KaitoHead = class {
158
121
  }
159
122
  };
160
123
 
124
+ // src/request.ts
125
+ var KaitoRequest = class {
126
+ url;
127
+ _request;
128
+ constructor(url, request) {
129
+ this._request = request;
130
+ this.url = url;
131
+ }
132
+ get headers() {
133
+ return this._request.headers;
134
+ }
135
+ get method() {
136
+ return this._request.method;
137
+ }
138
+ async arrayBuffer() {
139
+ return this._request.arrayBuffer();
140
+ }
141
+ async blob() {
142
+ return this._request.blob();
143
+ }
144
+ async formData() {
145
+ return this._request.formData();
146
+ }
147
+ async bytes() {
148
+ const buffer = await this.arrayBuffer();
149
+ return new Uint8Array(buffer);
150
+ }
151
+ async json() {
152
+ return this._request.json();
153
+ }
154
+ async text() {
155
+ return this._request.text();
156
+ }
157
+ get request() {
158
+ return this._request;
159
+ }
160
+ };
161
+
161
162
  // src/util.ts
162
163
  var isNodeLikeDev = typeof process !== "undefined" && typeof process.env !== "undefined" && process.env.NODE_ENV === "development";
163
164
  function createUtilities(getContext) {
@@ -334,6 +335,7 @@ var Router = class _Router {
334
335
  // Annotate the CommonJS export names for ESM import in node:
335
336
  0 && (module.exports = {
336
337
  KaitoError,
338
+ KaitoHead,
337
339
  KaitoRequest,
338
340
  Router,
339
341
  WrappedError,
package/dist/index.d.cts CHANGED
@@ -252,4 +252,4 @@ type HandlerConfig<ContextFrom> = {
252
252
  };
253
253
  declare function createKaitoHandler<Context>(config: HandlerConfig<Context>): (request: Request) => Promise<Response>;
254
254
 
255
- export { type APIResponse, type AnyQueryDefinition, type AnyResponse, type AnyRoute, type ErroredAPIResponse, type ExtractRouteParams, type GetContext, type HandlerConfig, type InferParsable, type InferRoutes, KaitoError, type KaitoMethod, KaitoRequest, type MakeOptional, type Parsable, type Route, type RouteArgument, Router, type RouterState, type SuccessfulAPIResponse, type Through, WrappedError, createKaitoHandler, createUtilities, isNodeLikeDev, parsable };
255
+ export { type APIResponse, type AnyQueryDefinition, type AnyResponse, type AnyRoute, type ErroredAPIResponse, type ExtractRouteParams, type GetContext, type HandlerConfig, type InferParsable, type InferRoutes, KaitoError, KaitoHead, type KaitoMethod, KaitoRequest, type MakeOptional, type Parsable, type Route, type RouteArgument, Router, type RouterState, type SuccessfulAPIResponse, type Through, WrappedError, createKaitoHandler, createUtilities, isNodeLikeDev, parsable };
package/dist/index.d.ts CHANGED
@@ -252,4 +252,4 @@ type HandlerConfig<ContextFrom> = {
252
252
  };
253
253
  declare function createKaitoHandler<Context>(config: HandlerConfig<Context>): (request: Request) => Promise<Response>;
254
254
 
255
- export { type APIResponse, type AnyQueryDefinition, type AnyResponse, type AnyRoute, type ErroredAPIResponse, type ExtractRouteParams, type GetContext, type HandlerConfig, type InferParsable, type InferRoutes, KaitoError, type KaitoMethod, KaitoRequest, type MakeOptional, type Parsable, type Route, type RouteArgument, Router, type RouterState, type SuccessfulAPIResponse, type Through, WrappedError, createKaitoHandler, createUtilities, isNodeLikeDev, parsable };
255
+ export { type APIResponse, type AnyQueryDefinition, type AnyResponse, type AnyRoute, type ErroredAPIResponse, type ExtractRouteParams, type GetContext, type HandlerConfig, type InferParsable, type InferRoutes, KaitoError, KaitoHead, type KaitoMethod, KaitoRequest, type MakeOptional, type Parsable, type Route, type RouteArgument, Router, type RouterState, type SuccessfulAPIResponse, type Through, WrappedError, createKaitoHandler, createUtilities, isNodeLikeDev, parsable };
package/dist/index.js CHANGED
@@ -44,44 +44,6 @@ function createKaitoHandler(config) {
44
44
  };
45
45
  }
46
46
 
47
- // src/request.ts
48
- var KaitoRequest = class {
49
- url;
50
- _request;
51
- constructor(url, request) {
52
- this._request = request;
53
- this.url = url;
54
- }
55
- get headers() {
56
- return this._request.headers;
57
- }
58
- get method() {
59
- return this._request.method;
60
- }
61
- async arrayBuffer() {
62
- return this._request.arrayBuffer();
63
- }
64
- async blob() {
65
- return this._request.blob();
66
- }
67
- async formData() {
68
- return this._request.formData();
69
- }
70
- async bytes() {
71
- const buffer = await this.arrayBuffer();
72
- return new Uint8Array(buffer);
73
- }
74
- async json() {
75
- return this._request.json();
76
- }
77
- async text() {
78
- return this._request.text();
79
- }
80
- get request() {
81
- return this._request;
82
- }
83
- };
84
-
85
47
  // src/head.ts
86
48
  var KaitoHead = class {
87
49
  _headers;
@@ -125,6 +87,44 @@ var KaitoHead = class {
125
87
  }
126
88
  };
127
89
 
90
+ // src/request.ts
91
+ var KaitoRequest = class {
92
+ url;
93
+ _request;
94
+ constructor(url, request) {
95
+ this._request = request;
96
+ this.url = url;
97
+ }
98
+ get headers() {
99
+ return this._request.headers;
100
+ }
101
+ get method() {
102
+ return this._request.method;
103
+ }
104
+ async arrayBuffer() {
105
+ return this._request.arrayBuffer();
106
+ }
107
+ async blob() {
108
+ return this._request.blob();
109
+ }
110
+ async formData() {
111
+ return this._request.formData();
112
+ }
113
+ async bytes() {
114
+ const buffer = await this.arrayBuffer();
115
+ return new Uint8Array(buffer);
116
+ }
117
+ async json() {
118
+ return this._request.json();
119
+ }
120
+ async text() {
121
+ return this._request.text();
122
+ }
123
+ get request() {
124
+ return this._request;
125
+ }
126
+ };
127
+
128
128
  // src/util.ts
129
129
  var isNodeLikeDev = typeof process !== "undefined" && typeof process.env !== "undefined" && process.env.NODE_ENV === "development";
130
130
  function createUtilities(getContext) {
@@ -300,6 +300,7 @@ var Router = class _Router {
300
300
  };
301
301
  export {
302
302
  KaitoError,
303
+ KaitoHead,
303
304
  KaitoRequest,
304
305
  Router,
305
306
  WrappedError,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kaito-http/core",
3
- "version": "3.0.2",
3
+ "version": "3.0.4",
4
4
  "type": "module",
5
5
  "author": "Alistair Smith <hi@alistair.sh>",
6
6
  "description": "Functional HTTP Framework for TypeScript",