@scrypted/server 0.81.0 → 0.82.0

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 +1 @@
1
- {"version":3,"file":"scrypted-server-main.js","sourceRoot":"","sources":["../src/scrypted-server-main.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,8DAAqC;AACrC,kEAAyC;AACzC,oDAA4B;AAC5B,mCAA8B;AAC9B,sDAA2C;AAC3C,4CAAoB;AACpB,gDAAwB;AACxB,0DAAiC;AACjC,kDAA0B;AAC1B,yCAAoC;AACpC,8CAAsB;AACtB,4CAAoB;AACpB,gDAAwB;AACxB,sDAA8B;AAC9B,oDAA4B;AAC5B,2DAAwE;AACxE,iCAA8F;AAC9F,yCAA4D;AAC5D,6DAAyD;AACzD,oDAA4B;AAC5B,wDAAoD;AACpD,0DAA2D;AAC3D,+BAAuC;AACvC,uCAA4C;AAC5C,uDAAwH;AACxH,4CAAyE;AACzE,mCAAgC;AAChC,2CAA8D;AAI9D,IAAI,CAAC,gBAAM,CAAC,GAAG,CAAC,iBAAO,CAAC,OAAO,EAAE,QAAQ,CAAC,EAAE,CAAC;IACzC,MAAM,IAAI,KAAK,CAAC,kEAAkE,CAAC,CAAA;AACvF,CAAC;AAED,iBAAO,CAAC,EAAE,CAAC,oBAAoB,EAAE,KAAK,CAAC,EAAE;IACrC,IAAI,KAAK,EAAE,WAAW,KAAK,oBAAc,IAAI,KAAK,EAAE,WAAW,KAAK,0BAAW,EAAE,CAAC;QAC9E,OAAO,CAAC,KAAK,CAAC,eAAe,EAAE,KAAK,CAAC,CAAC;QACtC,MAAM,KAAK,CAAC;IAChB,CAAC;IACD,OAAO,CAAC,IAAI,CAAC,mCAAmC,EAAE,KAAK,CAAC,CAAC;AAC7D,CAAC,CAAC,CAAC;AAEH,KAAK,UAAU,gBAAgB,CAAC,GAAW,EAAE,IAAY,EAAE,MAAW;IAClE,MAAM,CAAC,MAA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AO,QAAQ,CAAC;AACpB,CAAC;AAED,kBAAe,KAAK,CAAC"}
@@ -1,6 +1,7 @@
1
1
  /// <reference types="node" />
2
2
  import { ScryptedNativeId } from "@scrypted/types";
3
3
  import { ScryptedRuntime } from "../runtime";
4
+ export declare function getNpmPackageInfo(pkg: string): Promise<any>;
4
5
  export declare class PluginComponent {
5
6
  scrypted: ScryptedRuntime;
6
7
  constructor(scrypted: ScryptedRuntime);
@@ -3,14 +3,24 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.PluginComponent = void 0;
6
+ exports.PluginComponent = exports.getNpmPackageInfo = void 0;
7
7
  const types_1 = require("@scrypted/types");
8
8
  const semver_1 = __importDefault(require("semver"));
9
9
  const db_types_1 = require("../db-types");
10
- const http_fetch_helpers_1 = require("../http-fetch-helpers");
11
10
  const mixin_cycle_1 = require("../mixin/mixin-cycle");
12
11
  const sleep_1 = require("../sleep");
13
12
  const state_1 = require("../state");
13
+ const http_fetch_1 = require("../fetch/http-fetch");
14
+ async function getNpmPackageInfo(pkg) {
15
+ const { body } = await (0, http_fetch_1.httpFetch)({
16
+ url: `https://registry.npmjs.org/${pkg}`,
17
+ // force ipv4 in case of busted ipv6.
18
+ family: 4,
19
+ responseType: 'json',
20
+ });
21
+ return body;
22
+ }
23
+ exports.getNpmPackageInfo = getNpmPackageInfo;
14
24
  class PluginComponent {
15
25
  scrypted;
16
26
  constructor(scrypted) {
@@ -114,7 +124,7 @@ class PluginComponent {
114
124
  await this.scrypted.installNpm(pkg, version);
115
125
  }
116
126
  async npmInfo(endpoint) {
117
- return (0, http_fetch_helpers_1.getNpmPackageInfo)(endpoint);
127
+ return getNpmPackageInfo(endpoint);
118
128
  }
119
129
  async updatePlugins() {
120
130
  console.log('updating plugins');
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.js","sourceRoot":"","sources":["../../src/services/pl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I,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;;YAE7B,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;IACtC,CAAC;IAED,KAAK,CAAC,YAAY,CAAC,QAAgB,EAAE,IAAY;QAC7C,MAAM,IAAI,GAAG,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;QAC7C,MAAM,GAAG,GAAG,aAAa,IAAI,EAAE,CAAC;QAChC,OAAO,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC;IACrC,CAAC;CACJ;AA/KD,0CA+KC"}
@@ -5,7 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.ServiceControl = void 0;
7
7
  const fs_1 = __importDefault(require("fs"));
8
- const http_fetch_helpers_1 = require("../http-fetch-helpers");
8
+ const http_fetch_1 = require("../fetch/http-fetch");
9
9
  class ServiceControl {
10
10
  scrypted;
11
11
  constructor(scrypted) {
@@ -25,7 +25,7 @@ class ServiceControl {
25
25
  const webhookUpdate = process.env.SCRYPTED_WEBHOOK_UPDATE;
26
26
  if (webhookUpdate) {
27
27
  const webhookUpdateAuthorization = process.env.SCRYPTED_WEBHOOK_UPDATE_AUTHORIZATION;
28
- await (0, http_fetch_helpers_1.httpFetch)({
28
+ await (0, http_fetch_1.httpFetch)({
29
29
  url: webhookUpdate,
30
30
  headers: {
31
31
  Authorization: webhookUpdateAuthorization,
@@ -1 +1 @@
1
- {"version":3,"file":"service-control.js","sourceRoot":"","sources":["../../src/services/service-control.ts"],"names":[],"mappings":";;;;;;AAAA,4CAAoB;AACpB,8DAAkD;AAGlD,MAAa,cAAc;IACJ;IAAnB,YAAmB,QAAyB;QAAzB,aAAQ,GAAR,QAAQ,CAAiB;IAC5C,CAAC;IAED,KAAK,CAAC,IAAI;QACN,YAAE,CAAC,aAAa,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;QAC9B,IAAI,CAAC,OAAO,EAAE,CAAC;IACnB,CAAC;IAED,KAAK,CAAC,OAAO;QACT,OAAO,CAAC,IAAI,EAAE,CAAC;IACnB,CAAC;IAED,KAAK,CAAC,kBAAkB;QACpB,MAAM,IAAI,KAAK,CAAC,6FAA6F,CAAC,CAAC;IACnH,CAAC;IAED,KAAK,CAAC,MAAM;QACR,MAAM,aAAa,GAAG,OAAO,CAAC,GAAG,CAAC,uBAAuB,CAAC;QAC1D,IAAI,aAAa,EAAE,CAAC;YAChB,MAAM,0BAA0B,GAAG,OAAO,CAAC,GAAG,CAAC,qCAAqC,CAAC;YACrF,MAAM,IAAA,8BAAS,EAAC;gBACZ,GAAG,EAAE,aAAa;gBAClB,OAAO,EAAE;oBACL,aAAa,EAAE,0BAA0B;iBAC5C;aACJ,CAAC,CAAC;QACP,CAAC;aACI,CAAC;YACF,YAAE,CAAC,aAAa,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC;YAChC,IAAI,CAAC,OAAO,EAAE,CAAC;QACnB,CAAC;IACL,CAAC;CACJ;AAjCD,wCAiCC"}
1
+ {"version":3,"file":"service-control.js","sourceRoot":"","sources":["../../src/services/service-control.ts"],"names":[],"mappings":";;;;;;AAAA,4CAAoB;AACpB,oDAAgD;AAGhD,MAAa,cAAc;IACJ;IAAnB,YAAmB,QAAyB;QAAzB,aAAQ,GAAR,QAAQ,CAAiB;IAC5C,CAAC;IAED,KAAK,CAAC,IAAI;QACN,YAAE,CAAC,aAAa,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;QAC9B,IAAI,CAAC,OAAO,EAAE,CAAC;IACnB,CAAC;IAED,KAAK,CAAC,OAAO;QACT,OAAO,CAAC,IAAI,EAAE,CAAC;IACnB,CAAC;IAED,KAAK,CAAC,kBAAkB;QACpB,MAAM,IAAI,KAAK,CAAC,6FAA6F,CAAC,CAAC;IACnH,CAAC;IAED,KAAK,CAAC,MAAM;QACR,MAAM,aAAa,GAAG,OAAO,CAAC,GAAG,CAAC,uBAAuB,CAAC;QAC1D,IAAI,aAAa,EAAE,CAAC;YAChB,MAAM,0BAA0B,GAAG,OAAO,CAAC,GAAG,CAAC,qCAAqC,CAAC;YACrF,MAAM,IAAA,sBAAS,EAAC;gBACZ,GAAG,EAAE,aAAa;gBAClB,OAAO,EAAE;oBACL,aAAa,EAAE,0BAA0B;iBAC5C;aACJ,CAAC,CAAC;QACP,CAAC;aACI,CAAC;YACF,YAAE,CAAC,aAAa,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC;YAChC,IAAI,CAAC,OAAO,EAAE,CAAC;QACnB,CAAC;IACL,CAAC;CACJ;AAjCD,wCAiCC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scrypted/server",
3
- "version": "0.81.0",
3
+ "version": "0.82.0",
4
4
  "description": "",
5
5
  "dependencies": {
6
6
  "@mapbox/node-pre-gyp": "^1.0.11",
@@ -12,21 +12,21 @@
12
12
  "engine.io": "^6.5.4",
13
13
  "express": "^4.18.2",
14
14
  "ffmpeg-static": "^5.2.0",
15
- "follow-redirects": "^1.15.4",
15
+ "follow-redirects": "^1.15.5",
16
16
  "http-auth": "^4.2.0",
17
17
  "ip": "^1.1.8",
18
18
  "level": "^8.0.0",
19
19
  "linkfs": "^2.1.0",
20
20
  "lodash": "^4.17.21",
21
21
  "memfs": "^4.6.0",
22
- "mime": "^3.0.0",
22
+ "mime": "^4.0.1",
23
23
  "nan": "^2.18.0",
24
24
  "node-dijkstra": "^2.5.0",
25
25
  "node-forge": "^1.3.1",
26
26
  "node-gyp": "^10.0.1",
27
27
  "router": "^1.3.8",
28
28
  "semver": "^7.5.4",
29
- "sharp": "^0.33.1",
29
+ "sharp": "^0.33.2",
30
30
  "source-map-support": "^0.5.21",
31
31
  "tar": "^6.2.0",
32
32
  "tslib": "^2.6.2",
@@ -45,7 +45,7 @@
45
45
  "@types/lodash": "^4.14.202",
46
46
  "@types/mime": "^3.0.4",
47
47
  "@types/node-dijkstra": "^2.5.6",
48
- "@types/node-forge": "^1.3.10",
48
+ "@types/node-forge": "^1.3.11",
49
49
  "@types/pem": "^1.14.4",
50
50
  "@types/semver": "^7.5.6",
51
51
  "@types/source-map-support": "^0.5.10",
@@ -1,109 +1,46 @@
1
- import { once } from 'events';
2
- import { http, https } from 'follow-redirects';
3
- import { IncomingMessage } from 'http';
1
+ import type events from 'events';
2
+ import type stream from 'stream';
3
+ import type followRedirects from 'follow-redirects';
4
+ import type { IncomingMessage } from 'http';
4
5
  import type { Readable } from 'stream';
5
-
6
- export type HttpFetchResponseType = 'json' | 'text' | 'buffer' | 'readable';
7
- export interface HttpFetchOptions<T extends HttpFetchResponseType> {
8
- url: string | URL;
9
- family?: 4 | 6;
10
- method?: string;
11
- headers?: HeadersInit;
12
- timeout?: number;
13
- rejectUnauthorized?: boolean;
14
- ignoreStatusCode?: boolean;
15
- body?: Readable;
16
- responseType?: T;
17
- }
18
-
19
- export interface HttpFetchJsonOptions extends HttpFetchOptions<'json'> {
20
- }
21
-
22
- export interface HttpFetchBufferOptions extends HttpFetchOptions<'buffer'> {
23
- }
24
-
25
- export interface HttpFetchTextOptions extends HttpFetchOptions<'text'> {
26
- }
27
- export interface HttpFetchReadableOptions extends HttpFetchOptions<'readable'> {
28
- }
6
+ import { HttpFetchBufferOptions, HttpFetchJsonOptions, HttpFetchOptions, HttpFetchReadableOptions, HttpFetchResponse, HttpFetchResponseType, HttpFetchTextOptions, checkStatus, createStringOrBufferBody, getFetchMethod, setDefaultHttpFetchAccept } from '.';
7
+ export type { HttpFetchBufferOptions, HttpFetchJsonOptions, HttpFetchOptions, HttpFetchReadableOptions, HttpFetchResponse, HttpFetchResponseType, HttpFetchTextOptions, checkStatus, setDefaultHttpFetchAccept } from '.';
29
8
 
30
9
  async function readMessageBuffer(response: IncomingMessage) {
31
10
  const buffers: Buffer[] = [];
32
11
  response.on('data', buffer => buffers.push(buffer));
12
+ const { once } = require('events') as typeof events;
33
13
  await once(response, 'end');
34
14
  return Buffer.concat(buffers);
35
15
  }
36
16
 
37
17
  export interface FetchParser<T> {
38
- accept: string;
39
18
  parse(message: IncomingMessage): Promise<T>;
40
19
  }
41
20
 
42
21
  const TextParser: FetchParser<string> = {
43
- accept: 'text/plain',
44
22
  async parse(message: IncomingMessage) {
45
23
  return (await readMessageBuffer(message)).toString();
46
24
  }
47
25
  }
48
26
  const JSONParser: FetchParser<any> = {
49
- accept: 'application/json',
50
27
  async parse(message: IncomingMessage) {
51
28
  return JSON.parse((await readMessageBuffer(message)).toString());
52
29
  }
53
30
  }
54
31
 
55
32
  const BufferParser: FetchParser<Buffer> = {
56
- accept: undefined as string,
57
33
  async parse(message: IncomingMessage) {
58
34
  return readMessageBuffer(message);
59
35
  }
60
36
  }
61
37
 
62
38
  const StreamParser: FetchParser<IncomingMessage> = {
63
- accept: undefined as string,
64
39
  async parse(message: IncomingMessage) {
65
40
  return message;
66
41
  }
67
42
  }
68
43
 
69
- export async function getNpmPackageInfo(pkg: string) {
70
- const { body } = await httpFetch({
71
- url: `https://registry.npmjs.org/${pkg}`,
72
- // force ipv4 in case of busted ipv6.
73
- family: 4,
74
- responseType: 'json',
75
- });
76
- return body;
77
- }
78
-
79
- export function getHttpFetchAccept(responseType: HttpFetchResponseType) {
80
- const { accept } = getHttpFetchParser(responseType);
81
- return accept;
82
- }
83
-
84
- export function setDefaultHttpFetchAccept(headers: Headers, responseType: HttpFetchResponseType) {
85
- if (headers.has('Accept'))
86
- return;
87
- const { accept } = getHttpFetchParser(responseType);
88
- if (accept)
89
- headers.set('Accept', accept);
90
- }
91
-
92
- export function fetchStatusCodeOk(statusCode: number) {
93
- return statusCode >= 200 && statusCode <= 299;
94
- }
95
-
96
- export function checkStatus(statusCode: number) {
97
- if (!fetchStatusCodeOk(statusCode))
98
- throw new Error(`http response statusCode ${statusCode}`);
99
- }
100
-
101
- export interface HttpFetchResponse<T> {
102
- statusCode: number;
103
- headers: Headers;
104
- body: T;
105
- }
106
-
107
44
  export function getHttpFetchParser(responseType: HttpFetchResponseType) {
108
45
  switch (responseType) {
109
46
  case 'json':
@@ -116,26 +53,36 @@ export function getHttpFetchParser(responseType: HttpFetchResponseType) {
116
53
  return BufferParser;
117
54
  }
118
55
 
119
- export function parseResponseType(readable: IncomingMessage, responseType: HttpFetchResponseType) {
56
+ export function httpFetchParseIncomingMessage(readable: IncomingMessage, responseType: HttpFetchResponseType) {
120
57
  return getHttpFetchParser(responseType).parse(readable);
121
58
  }
122
59
 
123
- export async function httpFetch<T extends HttpFetchOptions<HttpFetchResponseType>>(options: T): Promise<HttpFetchResponse<
60
+ export async function httpFetch<T extends HttpFetchOptions<Readable>>(options: T): Promise<HttpFetchResponse<
124
61
  // first one serves as default.
125
- T extends HttpFetchBufferOptions ? Buffer
126
- : T extends HttpFetchTextOptions ? string
127
- : T extends HttpFetchReadableOptions ? IncomingMessage
128
- : T extends HttpFetchJsonOptions ? any : Buffer
62
+ T extends HttpFetchBufferOptions<Readable> ? Buffer
63
+ : T extends HttpFetchTextOptions<Readable> ? string
64
+ : T extends HttpFetchReadableOptions<Readable> ? IncomingMessage
65
+ : T extends HttpFetchJsonOptions<Readable> ? any : Buffer
129
66
  >> {
130
67
  const headers = new Headers(options.headers);
131
68
  setDefaultHttpFetchAccept(headers, options.responseType);
132
69
 
133
- const parser = getHttpFetchParser(options.responseType);
70
+ const { once } = require('events') as typeof events;
71
+ const { PassThrough, Readable } = require('stream') as typeof stream;
72
+ const { http, https } = require('follow-redirects') as typeof followRedirects;
134
73
 
135
74
  const { url } = options;
136
75
  const isSecure = url.toString().startsWith('https:');
137
76
  const proto = isSecure ? https : http;
138
77
 
78
+ let { body } = options;
79
+ if (body && !(body instanceof Readable)) {
80
+ const newBody = new PassThrough();
81
+ newBody.write(Buffer.from(createStringOrBufferBody(headers, body)));
82
+ newBody.end();
83
+ body = newBody;
84
+ }
85
+
139
86
  const nodeHeaders: Record<string, string[]> = {};
140
87
  for (const [k, v] of headers) {
141
88
  if (nodeHeaders[k]) {
@@ -147,14 +94,15 @@ export async function httpFetch<T extends HttpFetchOptions<HttpFetchResponseType
147
94
  }
148
95
 
149
96
  const request = proto.request(url, {
150
- method: options.method,
97
+ method: getFetchMethod(options),
151
98
  rejectUnauthorized: options.rejectUnauthorized,
152
99
  family: options.family,
153
100
  headers: nodeHeaders,
154
101
  timeout: options.timeout,
155
102
  });
156
- if (options.body)
157
- options.body.pipe(request);
103
+
104
+ if (body)
105
+ body.pipe(request);
158
106
  else
159
107
  request.end();
160
108
  const [response] = await once(request, 'response') as [IncomingMessage];
@@ -179,7 +127,7 @@ export async function httpFetch<T extends HttpFetchOptions<HttpFetchResponseType
179
127
  return {
180
128
  statusCode: response.statusCode,
181
129
  headers: incomingHeaders,
182
- body: await parser.parse(response),
130
+ body: await httpFetchParseIncomingMessage(response, options.responseType),
183
131
  };
184
132
  }
185
133
 
@@ -0,0 +1,178 @@
1
+
2
+ export type HttpFetchResponseType = 'json' | 'text' | 'buffer' | 'readable';
3
+ export interface HttpFetchOptionsBase<B> {
4
+ url: string | URL;
5
+ family?: 4 | 6;
6
+ method?: string;
7
+ headers?: HeadersInit;
8
+ timeout?: number;
9
+ rejectUnauthorized?: boolean;
10
+ ignoreStatusCode?: boolean;
11
+ body?: B | string | ArrayBufferView | any;
12
+ withCredentials?: boolean;
13
+ }
14
+
15
+ export interface HttpFetchJsonOptions<B> extends HttpFetchOptionsBase< B> {
16
+ responseType: 'json';
17
+ }
18
+
19
+ export interface HttpFetchBufferOptions<B> extends HttpFetchOptionsBase< B> {
20
+ responseType: 'buffer';
21
+ }
22
+
23
+ export interface HttpFetchDefaultOptions<B> extends HttpFetchOptionsBase<B> {
24
+ responseType?: undefined;
25
+ }
26
+
27
+ export interface HttpFetchTextOptions<B> extends HttpFetchOptionsBase<B> {
28
+ responseType: 'text';
29
+ }
30
+ export interface HttpFetchReadableOptions<B> extends HttpFetchOptionsBase<B> {
31
+ responseType: 'readable';
32
+ }
33
+
34
+ export type HttpFetchOptions<B> = HttpFetchJsonOptions<B> | HttpFetchBufferOptions<B> | HttpFetchDefaultOptions<B> | HttpFetchTextOptions<B> | HttpFetchReadableOptions<B>;
35
+
36
+ export function fetchStatusCodeOk(statusCode: number) {
37
+ return statusCode >= 200 && statusCode <= 299;
38
+ }
39
+
40
+ export function checkStatus(statusCode: number) {
41
+ if (!fetchStatusCodeOk(statusCode))
42
+ throw new Error(`http response statusCode ${statusCode}`);
43
+ }
44
+
45
+ export function getFetchMethod(options: HttpFetchOptions<any>) {
46
+ const method = options.method || (options.body ? 'POST' : 'GET');
47
+ return method;
48
+ }
49
+
50
+ export interface HttpFetchResponse<T> {
51
+ statusCode: number;
52
+ headers: Headers;
53
+ body: T;
54
+ }
55
+
56
+ export type fetcher<B, M> = <T extends HttpFetchOptions<B>>(options: T) => Promise<HttpFetchResponse<
57
+ // first one serves as default.
58
+ T extends HttpFetchBufferOptions<B> ? Buffer
59
+ : T extends HttpFetchTextOptions<B> ? string
60
+ : T extends HttpFetchReadableOptions<B> ? M
61
+ : T extends HttpFetchJsonOptions<B> ? any : Buffer
62
+ >>;
63
+
64
+
65
+ export function getHttpFetchAccept(responseType: HttpFetchResponseType) {
66
+ switch (responseType) {
67
+ case 'json':
68
+ return 'application/json';
69
+ case 'text':
70
+ return 'text/plain';
71
+ }
72
+ return;
73
+ }
74
+
75
+ export function setDefaultHttpFetchAccept(headers: Headers, responseType: HttpFetchResponseType) {
76
+ if (headers.has('Accept'))
77
+ return;
78
+ const accept = getHttpFetchAccept(responseType);
79
+ if (accept)
80
+ headers.set('Accept', accept);
81
+ }
82
+
83
+ export function createStringOrBufferBody(headers: Headers, body: any) {
84
+ let contentType: string;
85
+ if (typeof body === 'object') {
86
+ body = JSON.stringify(body);
87
+ contentType = 'application/json';
88
+ }
89
+ else if (typeof body === 'string') {
90
+ contentType = 'text/plain';
91
+ }
92
+
93
+ if (!headers.has('Content-Type'))
94
+ headers.set('Content-Type', contentType);
95
+
96
+ return body;
97
+ }
98
+
99
+ export async function domFetchParseIncomingMessage(response: Response, responseType: HttpFetchResponseType) {
100
+ switch (responseType) {
101
+ case 'json':
102
+ return response.json();
103
+ case 'text':
104
+ return response.text();
105
+ case 'readable':
106
+ return response;
107
+ }
108
+ return new Uint8Array(await response.arrayBuffer());
109
+ }
110
+
111
+ export async function domFetch<T extends HttpFetchOptions<BodyInit>>(options: T): Promise<HttpFetchResponse<
112
+ // first one serves as default.
113
+ T extends HttpFetchBufferOptions<BodyInit> ? Buffer
114
+ : T extends HttpFetchTextOptions<BodyInit> ? string
115
+ : T extends HttpFetchReadableOptions<BodyInit> ? Response
116
+ : T extends HttpFetchJsonOptions<BodyInit> ? any : Buffer
117
+ >> {
118
+ const headers = new Headers(options.headers);
119
+ setDefaultHttpFetchAccept(headers, options.responseType);
120
+
121
+ let { body } = options;
122
+ if (body && !(body instanceof ReadableStream)) {
123
+ body = createStringOrBufferBody(headers, body);
124
+ }
125
+
126
+ const { url } = options;
127
+ const response = await fetch(url, {
128
+ method: getFetchMethod(options),
129
+ headers,
130
+ signal: options.timeout ? AbortSignal.timeout(options.timeout) : undefined,
131
+ body,
132
+ });
133
+
134
+ if (!options?.ignoreStatusCode) {
135
+ try {
136
+ checkStatus(response.status);
137
+ }
138
+ catch (e) {
139
+ response.arrayBuffer().catch(() => { });
140
+ throw e;
141
+ }
142
+ }
143
+
144
+ return {
145
+ statusCode: response.status,
146
+ headers: response.headers,
147
+ body: await domFetchParseIncomingMessage(response, options.responseType),
148
+ };
149
+ }
150
+
151
+ function ensureType<T>(v: T) {
152
+ }
153
+
154
+ async function test() {
155
+ const a = await domFetch({
156
+ url: 'http://example.com',
157
+ });
158
+
159
+ ensureType<Buffer>(a.body);
160
+
161
+ const b = await domFetch({
162
+ url: 'http://example.com',
163
+ responseType: 'json',
164
+ });
165
+ ensureType<any>(b.body);
166
+
167
+ const c = await domFetch({
168
+ url: 'http://example.com',
169
+ responseType: 'readable',
170
+ });
171
+ ensureType<Response>(c.body);
172
+
173
+ const d = await domFetch({
174
+ url: 'http://example.com',
175
+ responseType: 'buffer',
176
+ });
177
+ ensureType<Buffer>(d.body);
178
+ }
package/src/runtime.ts CHANGED
@@ -20,7 +20,7 @@ import WebSocket, { Server as WebSocketServer } from "ws";
20
20
  import { computeClusterObjectHash } from './cluster/cluster-hash';
21
21
  import { ClusterObject } from './cluster/connect-rpc-object';
22
22
  import { Plugin, PluginDevice, ScryptedAlert, ScryptedUser } from './db-types';
23
- import { getNpmPackageInfo, httpFetch } from './http-fetch-helpers';
23
+ import { httpFetch } from './fetch/http-fetch';
24
24
  import { createResponseInterface } from './http-interfaces';
25
25
  import { getDisplayName, getDisplayRoom, getDisplayType, getProvidedNameOrDefault, getProvidedRoomOrDefault, getProvidedTypeOrDefault } from './infer-defaults';
26
26
  import { IOServer } from './io';
@@ -42,7 +42,7 @@ import { AddressSettings } from './services/addresses';
42
42
  import { Alerts } from './services/alerts';
43
43
  import { CORSControl } from './services/cors';
44
44
  import { Info } from './services/info';
45
- import { PluginComponent } from './services/plugin';
45
+ import { getNpmPackageInfo, PluginComponent } from './services/plugin';
46
46
  import { ServiceControl } from './services/service-control';
47
47
  import { UsersService } from './services/users';
48
48
  import { getState, ScryptedStateManager, setState } from './state';
@@ -16,13 +16,13 @@ import semver from 'semver';
16
16
  import { install as installSourceMapSupport } from 'source-map-support';
17
17
  import { createSelfSignedCertificate, CURRENT_SELF_SIGNED_CERTIFICATE_VERSION } from './cert';
18
18
  import { Plugin, ScryptedUser, Settings } from './db-types';
19
- import { getNpmPackageInfo } from './http-fetch-helpers';
20
19
  import Level from './level';
21
20
  import { PluginError } from './plugin/plugin-error';
22
21
  import { getScryptedVolume } from './plugin/plugin-volume';
23
22
  import { RPCResultError } from './rpc';
24
23
  import { ScryptedRuntime } from './runtime';
25
24
  import { getHostAddresses, SCRYPTED_DEBUG_PORT, SCRYPTED_INSECURE_PORT, SCRYPTED_SECURE_PORT } from './server-settings';
25
+ import { getNpmPackageInfo } from './services/plugin';
26
26
  import { setScryptedUserPassword, UsersService } from './services/users';
27
27
  import { sleep } from './sleep';
28
28
  import { ONE_DAY_MILLISECONDS, UserToken } from './usertoken';