@scrypted/auth-fetch 1.0.3 → 1.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.
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
/// <reference types="node" />
|
|
3
3
|
/// <reference types="node" />
|
|
4
|
-
import type { Readable } from "stream";
|
|
5
4
|
import type { IncomingMessage } from "http";
|
|
5
|
+
import type { Readable } from "stream";
|
|
6
|
+
export { httpFetch } from '../../../server/src/fetch/http-fetch';
|
|
6
7
|
export declare const authFetch: <T extends import("../../../server/src/fetch").HttpFetchOptions<Readable>>(options: T & import("./auth-fetch").AuthFetchOptions) => Promise<import("../../../server/src/fetch").HttpFetchResponse<T extends import("../../../server/src/fetch").HttpFetchBufferOptions<Readable> ? Buffer : T extends import("../../../server/src/fetch").HttpFetchTextOptions<Readable> ? string : T extends import("../../../server/src/fetch").HttpFetchReadableOptions<Readable> ? IncomingMessage : T extends import("../../../server/src/fetch").HttpFetchJsonOptions<Readable> ? any : Buffer>>;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.authFetch = void 0;
|
|
4
|
-
const auth_fetch_1 = require("./auth-fetch");
|
|
5
|
-
const http_fetch_1 = require("../../../server/src/fetch/http-fetch");
|
|
3
|
+
exports.authFetch = exports.httpFetch = void 0;
|
|
6
4
|
const fetch_1 = require("../../../server/src/fetch");
|
|
5
|
+
const http_fetch_1 = require("../../../server/src/fetch/http-fetch");
|
|
6
|
+
const auth_fetch_1 = require("./auth-fetch");
|
|
7
|
+
var http_fetch_2 = require("../../../server/src/fetch/http-fetch");
|
|
8
|
+
Object.defineProperty(exports, "httpFetch", { enumerable: true, get: function () { return http_fetch_2.httpFetch; } });
|
|
7
9
|
function init() {
|
|
8
10
|
try {
|
|
9
11
|
require('net');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/index.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/index.ts"],"names":[],"mappings":";;;AAEA,qDAAmF;AACnF,qEAAgG;AAChG,6CAA+C;AAC/C,mEAAiE;AAAxD,uGAAA,SAAS,OAAA;AAElB,SAAS,IAAI;IACT,IAAI,CAAC;QACD,OAAO,CAAC,KAAK,CAAC,CAAC;QACf,OAAO,CAAC,QAAQ,CAAC,CAAC;QAClB,OAAO,IAAA,4BAAe,EAA4B,sBAAS,EAAE,0CAA6B,CAAC,CAAC;IAChG,CAAC;IACD,OAAO,CAAC,EAAE,CAAC;IACX,CAAC;IAED,OAAO,IAAA,4BAAe,EAAqB,gBAAQ,EAAE,oCAA4B,CAAC,CAAC;AACvF,CAAC;AAEY,QAAA,SAAS,GAAG,IAAI,EAAE,CAAC","sourcesContent":["import type { IncomingMessage } from \"http\";\nimport type { Readable } from \"stream\";\nimport { domFetch, domFetchParseIncomingMessage } from \"../../../server/src/fetch\";\nimport { httpFetch, httpFetchParseIncomingMessage } from '../../../server/src/fetch/http-fetch';\nimport { createAuthFetch } from \"./auth-fetch\";\nexport { httpFetch } from '../../../server/src/fetch/http-fetch';\n\nfunction init() {\n try {\n require('net');\n require('events');\n return createAuthFetch<Readable, IncomingMessage>(httpFetch, httpFetchParseIncomingMessage);\n }\n catch (e) {\n }\n\n return createAuthFetch<BodyInit, Response>(domFetch, domFetchParseIncomingMessage);\n}\n\nexport const authFetch = init();\n"]}
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { createAuthFetch } from "./auth-fetch";
|
|
2
|
-
import { httpFetch, httpFetchParseIncomingMessage } from '../../../server/src/fetch/http-fetch';
|
|
3
|
-
import type { Readable } from "stream";
|
|
4
1
|
import type { IncomingMessage } from "http";
|
|
2
|
+
import type { Readable } from "stream";
|
|
5
3
|
import { domFetch, domFetchParseIncomingMessage } from "../../../server/src/fetch";
|
|
4
|
+
import { httpFetch, httpFetchParseIncomingMessage } from '../../../server/src/fetch/http-fetch';
|
|
5
|
+
import { createAuthFetch } from "./auth-fetch";
|
|
6
|
+
export { httpFetch } from '../../../server/src/fetch/http-fetch';
|
|
6
7
|
|
|
7
8
|
function init() {
|
|
8
9
|
try {
|