fets 0.8.1 → 0.8.2
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/README.md +2 -0
- package/cjs/client/clientResponse.js +1 -2
- package/cjs/client/createClient.js +2 -2
- package/cjs/client/plugins/useClientCookieStore.js +1 -2
- package/cjs/createRouter.js +2 -3
- package/cjs/plugins/define-routes.js +1 -2
- package/cjs/plugins/formats.js +2 -2
- package/cjs/plugins/openapi.js +1 -2
- package/cjs/plugins/typebox.js +1 -2
- package/cjs/plugins/utils.js +2 -2
- package/cjs/utils.js +2 -3
- package/package.json +2 -2
- package/typings/index.d.cts +0 -1
- package/typings/index.d.ts +0 -1
- package/typings/types.d.cts +0 -1
- package/typings/types.d.ts +0 -1
package/README.md
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
[](https://graphql.org/conf/2024/?utm_source=github&utm_medium=fets&utm_campaign=readme)
|
|
2
|
+
|
|
1
3
|
<div align="center">
|
|
2
4
|
<h3>feTS</h3>
|
|
3
5
|
<h5>Fetch API ❤️ TypeScript</h5>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createClientTypedResponsePromise =
|
|
3
|
+
exports.createClientTypedResponsePromise = createClientTypedResponsePromise;
|
|
4
4
|
function createClientTypedResponsePromise(response$) {
|
|
5
5
|
return new Proxy(response$, {
|
|
6
6
|
get(target, key, receiver) {
|
|
@@ -21,4 +21,3 @@ function createClientTypedResponsePromise(response$) {
|
|
|
21
21
|
},
|
|
22
22
|
});
|
|
23
23
|
}
|
|
24
|
-
exports.createClientTypedResponsePromise = createClientTypedResponsePromise;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.ClientValidationError = void 0;
|
|
4
|
+
exports.createClient = createClient;
|
|
4
5
|
const qs_1 = require("qs");
|
|
5
6
|
const fetch_1 = require("@whatwg-node/fetch");
|
|
6
7
|
const server_1 = require("@whatwg-node/server");
|
|
@@ -192,4 +193,3 @@ function createClient({ endpoint, fetchFn = fetch_1.fetch, plugins = [], globalP
|
|
|
192
193
|
},
|
|
193
194
|
});
|
|
194
195
|
}
|
|
195
|
-
exports.createClient = createClient;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useClientCookieStore =
|
|
3
|
+
exports.useClientCookieStore = useClientCookieStore;
|
|
4
4
|
const cookie_store_1 = require("@whatwg-node/cookie-store");
|
|
5
5
|
const fetch_1 = require("@whatwg-node/fetch");
|
|
6
6
|
function useClientCookieStore(cookieStore) {
|
|
@@ -28,4 +28,3 @@ function useClientCookieStore(cookieStore) {
|
|
|
28
28
|
},
|
|
29
29
|
};
|
|
30
30
|
}
|
|
31
|
-
exports.useClientCookieStore = useClientCookieStore;
|
package/cjs/createRouter.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.createRouterBase = createRouterBase;
|
|
4
|
+
exports.createRouter = createRouter;
|
|
4
5
|
const tslib_1 = require("tslib");
|
|
5
6
|
const qs_1 = require("qs");
|
|
6
7
|
const DefaultFetchAPI = tslib_1.__importStar(require("@whatwg-node/fetch"));
|
|
@@ -167,7 +168,6 @@ function createRouterBase({ fetchAPI: givenFetchAPI, base: basePath = '/', plugi
|
|
|
167
168
|
__onRouterInitHooks,
|
|
168
169
|
};
|
|
169
170
|
}
|
|
170
|
-
exports.createRouterBase = createRouterBase;
|
|
171
171
|
function createRouter(options = {}) {
|
|
172
172
|
const { openAPI: { endpoint: oasEndpoint = '/openapi.json', includeValidationErrors, ...openAPIDocument } = {}, swaggerUI: { endpoint: swaggerUIEndpoint = '/docs', ...swaggerUIOpts } = {}, plugins: userPlugins = [], base = '/', } = options;
|
|
173
173
|
openAPIDocument.openapi = openAPIDocument.openapi || '3.0.1';
|
|
@@ -214,4 +214,3 @@ function createRouter(options = {}) {
|
|
|
214
214
|
}
|
|
215
215
|
return router;
|
|
216
216
|
}
|
|
217
|
-
exports.createRouter = createRouter;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useDefineRoutes =
|
|
3
|
+
exports.useDefineRoutes = useDefineRoutes;
|
|
4
4
|
const HTTP_METHODS = [
|
|
5
5
|
'GET',
|
|
6
6
|
'HEAD',
|
|
@@ -65,4 +65,3 @@ function useDefineRoutes() {
|
|
|
65
65
|
},
|
|
66
66
|
};
|
|
67
67
|
}
|
|
68
|
-
exports.useDefineRoutes = useDefineRoutes;
|
package/cjs/plugins/formats.js
CHANGED
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
// based on https://github.com/epoberezkin/ajv/blob/master/lib/compile/formats.js &
|
|
3
3
|
// https://github.com/cfworker/cfworker/blob/main/packages/json-schema/src/format.ts
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
-
exports.
|
|
5
|
+
exports.fastFormat = exports.fullFormat = void 0;
|
|
6
|
+
exports.registerFormats = registerFormats;
|
|
6
7
|
const typebox_1 = require("@sinclair/typebox");
|
|
7
8
|
const fetch_1 = require("@whatwg-node/fetch");
|
|
8
9
|
const DATE = /^(\d\d\d\d)-(\d\d)-(\d\d)$/;
|
|
@@ -176,4 +177,3 @@ function registerFormats({ formats = Object.keys(exports.fastFormat), type = 'fa
|
|
|
176
177
|
typebox_1.FormatRegistry.Set(format, formatMap[format]);
|
|
177
178
|
}
|
|
178
179
|
}
|
|
179
|
-
exports.registerFormats = registerFormats;
|
package/cjs/plugins/openapi.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useOpenAPI =
|
|
3
|
+
exports.useOpenAPI = useOpenAPI;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const Response_js_1 = require("../Response.js");
|
|
6
6
|
const swagger_ui_html_js_1 = tslib_1.__importDefault(require("../swagger-ui-html.js"));
|
|
@@ -196,4 +196,3 @@ function useOpenAPI({ oasEndpoint, swaggerUIEndpoint, swaggerUIOpts, includeVali
|
|
|
196
196
|
},
|
|
197
197
|
};
|
|
198
198
|
}
|
|
199
|
-
exports.useOpenAPI = useOpenAPI;
|
package/cjs/plugins/typebox.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useTypeBox =
|
|
3
|
+
exports.useTypeBox = useTypeBox;
|
|
4
4
|
const typebox_1 = require("@sinclair/typebox");
|
|
5
5
|
const compiler_1 = require("@sinclair/typebox/compiler");
|
|
6
6
|
const value_1 = require("@sinclair/typebox/value");
|
|
@@ -141,7 +141,6 @@ function useTypeBox({ components = {}, } = {}) {
|
|
|
141
141
|
},
|
|
142
142
|
};
|
|
143
143
|
}
|
|
144
|
-
exports.useTypeBox = useTypeBox;
|
|
145
144
|
function isByteArray(value) {
|
|
146
145
|
return value?.forEach != null;
|
|
147
146
|
}
|
package/cjs/plugins/utils.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.EMPTY_OBJECT = void 0;
|
|
4
|
+
exports.getHeadersObj = getHeadersObj;
|
|
4
5
|
exports.EMPTY_OBJECT = {};
|
|
5
6
|
function getHeadersObj(headers) {
|
|
6
7
|
return new Proxy(exports.EMPTY_OBJECT, {
|
|
@@ -29,4 +30,3 @@ function getHeadersObj(headers) {
|
|
|
29
30
|
},
|
|
30
31
|
});
|
|
31
32
|
}
|
|
32
|
-
exports.getHeadersObj = getHeadersObj;
|
package/cjs/utils.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.asyncIterationUntilReturn = asyncIterationUntilReturn;
|
|
4
|
+
exports.isBlob = isBlob;
|
|
4
5
|
const server_1 = require("@whatwg-node/server");
|
|
5
6
|
function asyncIterationUntilReturn(iterable, callback) {
|
|
6
7
|
const iterator = iterable[Symbol.iterator]();
|
|
@@ -27,8 +28,6 @@ function asyncIterationUntilReturn(iterable, callback) {
|
|
|
27
28
|
}
|
|
28
29
|
return iterate();
|
|
29
30
|
}
|
|
30
|
-
exports.asyncIterationUntilReturn = asyncIterationUntilReturn;
|
|
31
31
|
function isBlob(value) {
|
|
32
32
|
return value.arrayBuffer !== undefined;
|
|
33
33
|
}
|
|
34
|
-
exports.isBlob = isBlob;
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fets",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.2",
|
|
4
4
|
"description": "TypeScript HTTP Framework focusing on e2e type-safety, easy setup, performance & great developer experience",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"dependencies": {
|
|
7
|
-
"@sinclair/typebox": "^0.
|
|
7
|
+
"@sinclair/typebox": "^0.33.0",
|
|
8
8
|
"@whatwg-node/cookie-store": "^0.2.0",
|
|
9
9
|
"@whatwg-node/fetch": "^0.9.4",
|
|
10
10
|
"@whatwg-node/server": "^0.9.15",
|
package/typings/index.d.cts
CHANGED
package/typings/index.d.ts
CHANGED
package/typings/types.d.cts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="urlpattern-polyfill" />
|
|
2
1
|
import type { Pipe, Strings, Tuples } from 'hotscript';
|
|
3
2
|
import type { FromSchema as FromSchemaOriginal, JSONSchema as JSONSchemaOrBoolean } from 'json-schema-to-ts';
|
|
4
3
|
import type { ErrorHandler, FetchAPI, ServerAdapter, ServerAdapterOptions, ServerAdapterPlugin, ServerAdapterRequestHandler } from '@whatwg-node/server';
|
package/typings/types.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="urlpattern-polyfill" />
|
|
2
1
|
import type { Pipe, Strings, Tuples } from 'hotscript';
|
|
3
2
|
import type { FromSchema as FromSchemaOriginal, JSONSchema as JSONSchemaOrBoolean } from 'json-schema-to-ts';
|
|
4
3
|
import type { ErrorHandler, FetchAPI, ServerAdapter, ServerAdapterOptions, ServerAdapterPlugin, ServerAdapterRequestHandler } from '@whatwg-node/server';
|