@gjsify/https 0.4.36 → 0.4.38

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
- import"./_virtual/_rolldown/runtime.js";import e,{ClientRequest as t,IncomingMessage as n,METHODS as r,OutgoingMessage as i,STATUS_CODES as a,Server as o,ServerResponse as s,createServer as c,get as l,globalAgent as u,maxHeaderSize as d,request as f,setMaxIdleHTTPParsers as p,validateHeaderName as m,validateHeaderValue as h}from"@gjsify/http/browser";var Agent=class{keepAlive=!1;keepAliveMsecs=1e3;maxSockets=1/0;maxFreeSockets=256;sockets={};freeSockets={};requests={};destroy(){}};const g=new Agent,_={...e,Agent,globalAgent:g};export{Agent,t as ClientRequest,n as IncomingMessage,r as METHODS,i as OutgoingMessage,a as STATUS_CODES,o as Server,s as ServerResponse,c as createServer,_ as default,l as get,u as globalAgent,g as globalHttpsAgent,d as maxHeaderSize,f as request,p as setMaxIdleHTTPParsers,m as validateHeaderName,h as validateHeaderValue};
1
+ import"./_virtual/_rolldown/runtime.js";import e,{ClientRequest as t,IncomingMessage as n,METHODS as r,OutgoingMessage as i,STATUS_CODES as a,Server as o,ServerResponse as s,createServer as c,globalAgent as l,maxHeaderSize as u,request as d,setMaxIdleHTTPParsers as f,validateHeaderName as p,validateHeaderValue as m}from"@gjsify/http/browser";var Agent=class{keepAlive=!1;keepAliveMsecs=1e3;maxSockets=1/0;maxFreeSockets=256;sockets={};freeSockets={};requests={};destroy(){}};const h=new Agent;function request(e,t,n){return typeof e==`string`||e instanceof URL?typeof t==`object`&&t?d(e,{protocol:`https:`,...t},n):d(e,t,n):d({protocol:`https:`,...e},t)}function get(e,t,n){let r=request(e,t,n);return r.end(),r}const g={...e,Agent,globalAgent:h,request,get};export{Agent,t as ClientRequest,n as IncomingMessage,r as METHODS,i as OutgoingMessage,a as STATUS_CODES,o as Server,s as ServerResponse,c as createServer,g as default,get,l as globalAgent,h as globalHttpsAgent,u as maxHeaderSize,request,f as setMaxIdleHTTPParsers,p as validateHeaderName,m as validateHeaderValue};
@@ -1,4 +1,7 @@
1
- export { METHODS, STATUS_CODES, maxHeaderSize, globalAgent, IncomingMessage, ClientRequest, Server, ServerResponse, OutgoingMessage, createServer, request, get, validateHeaderName, validateHeaderValue, setMaxIdleHTTPParsers, } from '@gjsify/http/browser';
1
+ import { METHODS, STATUS_CODES, maxHeaderSize, globalAgent, IncomingMessage, ClientRequest, Server, ServerResponse, OutgoingMessage, createServer, validateHeaderName, validateHeaderValue, setMaxIdleHTTPParsers } from '@gjsify/http/browser';
2
+ import type { RequestOptions } from '@gjsify/http/browser';
3
+ export { METHODS, STATUS_CODES, maxHeaderSize, globalAgent, IncomingMessage, ClientRequest, Server, ServerResponse, OutgoingMessage, createServer, validateHeaderName, validateHeaderValue, setMaxIdleHTTPParsers, };
4
+ export type { RequestOptions };
2
5
  /**
3
6
  * Browser `https.Agent` stub — there is no real socket pool in the browser, so
4
7
  * we surface a minimal shape that satisfies typical consumer-code probes (e.g.
@@ -15,22 +18,31 @@ export declare class Agent {
15
18
  destroy(): void;
16
19
  }
17
20
  export declare const globalHttpsAgent: Agent;
21
+ /**
22
+ * `https.request` — identical to `http.request` over the browser `fetch()`
23
+ * client, except that an options object without an explicit `protocol`
24
+ * defaults to `https:` (Node `lib/https.js`). A string/`URL` argument already
25
+ * carries its own protocol, so it is forwarded unchanged.
26
+ */
27
+ export declare function request(urlOrOptions: string | URL | RequestOptions, optsOrCb?: RequestOptions | ((res: IncomingMessage) => void), maybeCb?: (res: IncomingMessage) => void): ClientRequest;
28
+ /** `https.get` — `https.request` followed by `req.end()` (no request body). */
29
+ export declare function get(urlOrOptions: string | URL | RequestOptions, optsOrCb?: RequestOptions | ((res: IncomingMessage) => void), maybeCb?: (res: IncomingMessage) => void): ClientRequest;
18
30
  declare const httpsDefault: {
19
31
  Agent: typeof Agent;
20
32
  globalAgent: Agent;
33
+ request: typeof request;
34
+ get: typeof get;
21
35
  METHODS: string[];
22
36
  STATUS_CODES: Record<number, string>;
23
37
  maxHeaderSize: number;
24
- IncomingMessage: typeof import("@gjsify/http/browser").IncomingMessage;
25
- ClientRequest: typeof import("@gjsify/http/browser").ClientRequest;
26
- Server: typeof import("@gjsify/http/browser").Server;
27
- ServerResponse: typeof import("@gjsify/http/browser").ServerResponse;
28
- OutgoingMessage: typeof import("@gjsify/http/browser").OutgoingMessage;
29
- createServer: typeof import("@gjsify/http/browser").createServer;
30
- request: typeof import("@gjsify/http/browser").request;
31
- get: typeof import("@gjsify/http/browser").get;
32
- validateHeaderName: typeof import("@gjsify/http/browser").validateHeaderName;
33
- validateHeaderValue: typeof import("@gjsify/http/browser").validateHeaderValue;
34
- setMaxIdleHTTPParsers: typeof import("@gjsify/http/browser").setMaxIdleHTTPParsers;
38
+ IncomingMessage: typeof IncomingMessage;
39
+ ClientRequest: typeof ClientRequest;
40
+ Server: typeof Server;
41
+ ServerResponse: typeof ServerResponse;
42
+ OutgoingMessage: typeof OutgoingMessage;
43
+ createServer: typeof createServer;
44
+ validateHeaderName: typeof validateHeaderName;
45
+ validateHeaderValue: typeof validateHeaderValue;
46
+ setMaxIdleHTTPParsers: typeof setMaxIdleHTTPParsers;
35
47
  };
36
48
  export default httpsDefault;
@@ -0,0 +1,2 @@
1
+ declare const _default: () => Promise<void>;
2
+ export default _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gjsify/https",
3
- "version": "0.4.36",
3
+ "version": "0.4.38",
4
4
  "description": "Node.js https module for Gjs",
5
5
  "type": "module",
6
6
  "module": "lib/esm/index.js",
@@ -29,6 +29,7 @@
29
29
  "build:test": "gjsify run build:test:gjs && gjsify run build:test:node",
30
30
  "build:test:gjs": "gjsify build src/test.mts --app gjs --outfile test.gjs.mjs",
31
31
  "build:test:node": "gjsify build src/test.mts --app node --outfile test.node.mjs",
32
+ "build:test:browser": "gjsify build src/test.browser.mts --app browser --outfile dist/test.browser.mjs",
32
33
  "test": "gjsify run build:gjsify && gjsify run build:test && gjsify run test:node && gjsify run test:gjs",
33
34
  "test:gjs": "gjsify run test.gjs.mjs",
34
35
  "test:node": "node test.node.mjs"
@@ -39,20 +40,21 @@
39
40
  "https"
40
41
  ],
41
42
  "devDependencies": {
42
- "@gjsify/cli": "^0.4.36",
43
- "@gjsify/unit": "^0.4.36",
43
+ "@gjsify/cli": "^0.4.38",
44
+ "@gjsify/unit": "^0.4.38",
44
45
  "@types/node": "^25.9.1",
45
- "typescript": "^5.9.3"
46
+ "typescript": "^6.0.3"
46
47
  },
47
48
  "dependencies": {
48
- "@gjsify/http": "^0.4.36",
49
- "@gjsify/tls": "^0.4.36"
49
+ "@gjsify/http": "^0.4.38",
50
+ "@gjsify/tls": "^0.4.38"
50
51
  },
51
52
  "gjsify": {
52
53
  "runtimes": {
53
54
  "gjs": "polyfill",
54
55
  "node": "native",
55
- "browser": "partial"
56
+ "browser": "partial",
57
+ "nativescript": "polyfill"
56
58
  }
57
59
  },
58
60
  "license": "MIT",