Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(fromOpenApi): add browser support #51

Merged
merged 6 commits into from
Aug 22, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,8 @@ jobs:
- name: Build the library
run: pnpm build

- name: Test the library
run: pnpm test
- name: Node.js tests
run: pnpm test:node

- name: Browser tests
run: pnpm test:browser
11,724 changes: 11,724 additions & 0 deletions assets/git.luolix.top.har

Large diffs are not rendered by default.

163 changes: 163 additions & 0 deletions assets/localhost.har
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
{
"log": {
"version": "1.2",
"creator": {
"name": "WebInspector",
"version": "537.36"
},
"pages": [
{
"startedDateTime": "2022-06-23T23:00:02.566Z",
"id": "page_1",
"title": "http://localhost:8043/resource?foo=bar&foo=nul",
"pageTimings": {
"onContentLoad": 1032.1950000034121,
"onLoad": 1074.1980000020703
}
}
],
"entries": [
{
"_initiator": {
"type": "other"
},
"_priority": "VeryHigh",
"_resourceType": "document",
"cache": {},
"connection": "163269",
"pageref": "page_1",
"request": {
"method": "GET",
"url": "http://localhost:8043/resource?foo=bar&foo=nul",
"httpVersion": "HTTP/1.1",
"headers": [
{
"name": "Accept",
"value": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9"
},
{
"name": "Accept-Encoding",
"value": "gzip, deflate, br"
},
{
"name": "Accept-Language",
"value": "en-US,en;q=0.9"
},
{
"name": "Connection",
"value": "keep-alive"
},
{
"name": "Cookie",
"value": "io=WZyHDuKmbu9P2XSoAAAQ"
},
{
"name": "Host",
"value": "localhost:8043"
},
{
"name": "Sec-Fetch-Dest",
"value": "document"
},
{
"name": "Sec-Fetch-Mode",
"value": "navigate"
},
{
"name": "Sec-Fetch-Site",
"value": "none"
},
{
"name": "Sec-Fetch-User",
"value": "?1"
},
{
"name": "Sec-GPC",
"value": "1"
},
{
"name": "Upgrade-Insecure-Requests",
"value": "1"
},
{
"name": "User-Agent",
"value": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.61 Safari/537.36"
}
],
"queryString": [
{
"name": "foo",
"value": "bar"
},
{
"name": "foo",
"value": "nul"
}
],
"cookies": [
{
"name": "io",
"value": "WZyHDuKmbu9P2XSoAAAQ",
"path": "/",
"domain": "localhost",
"expires": "1969-12-31T23:59:59.000Z",
"httpOnly": true,
"secure": false,
"sameSite": "Strict"
}
],
"headersSize": 604,
"bodySize": 0
},
"response": {
"status": 200,
"statusText": "OK",
"httpVersion": "HTTP/1.1",
"headers": [
{
"name": "Connection",
"value": "keep-alive"
},
{
"name": "Date",
"value": "Thu, 23 Jun 2022 23:00:03 GMT"
},
{
"name": "Keep-Alive",
"value": "timeout=5"
},
{
"name": "Transfer-Encoding",
"value": "chunked"
}
],
"cookies": [],
"content": {
"size": 36,
"mimeType": "text/plain",
"compression": -11,
"text": "2022-06-23T23:00:03.567Z hello world"
},
"redirectURL": "",
"headersSize": 131,
"bodySize": 47,
"_transferSize": 178,
"_error": null
},
"serverIPAddress": "[::1]",
"startedDateTime": "2022-06-23T23:00:02.560Z",
"time": 1007.6789999974457,
"timings": {
"blocked": 5.749999997275416,
"dns": 0.0030000000000000027,
"ssl": -1,
"connect": 0.17,
"send": 0.08400000000000002,
"wait": 1001.482000001332,
"receive": 0.1899999988381751,
"_blocked_queueing": 5.536999997275416
}
}
]
}
}
163 changes: 163 additions & 0 deletions assets/nodejs.org.har
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
{
"log": {
"version": "1.2",
"creator": {
"name": "WebInspector",
"version": "537.36"
},
"pages": [],
"entries": [
{
"_initiator": {
"type": "script",
"stack": {
"callFrames": [
{
"functionName": "",
"scriptId": "220",
"url": "",
"lineNumber": 0,
"columnNumber": 0
}
]
}
},
"_priority": "High",
"_resourceType": "fetch",
"cache": {},
"connection": "162359",
"request": {
"method": "GET",
"url": "https://httpbin.org/get?foo=bar&n=1",
"httpVersion": "http/2.0",
"headers": [
{
"name": ":authority",
"value": "httpbin.org"
},
{
"name": ":method",
"value": "GET"
},
{
"name": ":path",
"value": "/get?foo=bar&n=1"
},
{
"name": ":scheme",
"value": "https"
},
{
"name": "accept",
"value": "*/*"
},
{
"name": "accept-encoding",
"value": "gzip, deflate, br"
},
{
"name": "accept-language",
"value": "en-US,en;q=0.9"
},
{
"name": "origin",
"value": "https://nodejs.org"
},
{
"name": "referer",
"value": "https://nodejs.org/"
},
{
"name": "sec-fetch-dest",
"value": "empty"
},
{
"name": "sec-fetch-mode",
"value": "cors"
},
{
"name": "sec-fetch-site",
"value": "cross-site"
},
{
"name": "sec-gpc",
"value": "1"
},
{
"name": "user-agent",
"value": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.61 Safari/537.36"
}
],
"queryString": [
{
"name": "foo",
"value": "bar"
},
{
"name": "n",
"value": "1"
}
],
"cookies": [],
"headersSize": -1,
"bodySize": 0
},
"response": {
"status": 200,
"statusText": "",
"httpVersion": "http/2.0",
"headers": [
{
"name": "access-control-allow-credentials",
"value": "true"
},
{
"name": "access-control-allow-origin",
"value": "https://nodejs.org"
},
{
"name": "content-length",
"value": "696"
},
{
"name": "content-type",
"value": "application/json"
},
{
"name": "date",
"value": "Thu, 23 Jun 2022 22:55:36 GMT"
},
{
"name": "server",
"value": "gunicorn/19.9.0"
}
],
"cookies": [],
"content": {
"size": 696,
"mimeType": "application/json",
"text": "{\n \"args\": {\n \"foo\": \"bar\", \n \"n\": \"1\"\n }, \n \"headers\": {\n \"Accept\": \"*/*\", \n \"Accept-Encoding\": \"gzip, deflate, br\", \n \"Accept-Language\": \"en-US,en;q=0.9\", \n \"Host\": \"httpbin.org\", \n \"Origin\": \"https://nodejs.org\", \n \"Referer\": \"https://nodejs.org/\", \n \"Sec-Fetch-Dest\": \"empty\", \n \"Sec-Fetch-Mode\": \"cors\", \n \"Sec-Fetch-Site\": \"cross-site\", \n \"Sec-Gpc\": \"1\", \n \"User-Agent\": \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.61 Safari/537.36\", \n \"X-Amzn-Trace-Id\": \"Root=1-62b4ef68-22a4a703341faee3459b869b\"\n }, \n \"origin\": \"31.30.161.205\", \n \"url\": \"https://httpbin.org/get?foo=bar&n=1\"\n}\n"
},
"redirectURL": "",
"headersSize": -1,
"bodySize": -1,
"_transferSize": 849,
"_error": null
},
"serverIPAddress": "34.195.104.96",
"startedDateTime": "2022-06-23T22:55:36.665Z",
"time": 321.76399999702,
"timings": {
"blocked": 10.139999999753432,
"dns": 2.32,
"ssl": 109.586,
"connect": 209.245,
"send": 0.27899999999999636,
"wait": 99.49699999968638,
"receive": 0.2829999975801911,
"_blocked_queueing": 10.003999999753432
}
}
]
}
}
Loading
Loading