mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-04-25 10:08:29 +02:00
NPM workspaces
This commit is contained in:
5064
package-lock.json
generated
5064
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
13
package.json
13
package.json
@@ -1,15 +1,24 @@
|
||||
{
|
||||
"name": "@yaakapp/plugins",
|
||||
"repository": "https://github.com/yaakapp/plugins",
|
||||
"workspaces": [
|
||||
"plugins/*"
|
||||
],
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"build": "node scripts/build-plugins.cjs",
|
||||
"build": "workspaces-run --parallel -- npm run --workspaces build",
|
||||
"dev": "workspaces-run --parallel -- npm run --workspaces dev",
|
||||
"test": "vitest run",
|
||||
"lint": "tsc"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^22.7.4",
|
||||
"jsonpath": "^1.1.1",
|
||||
"typescript": "^5.6.2",
|
||||
"vitest": "^2.0.4",
|
||||
"typescript": "^5.5.2"
|
||||
"workspaces-run": "^1.0.2"
|
||||
},
|
||||
"dependencies": {
|
||||
"@yaakapp/api": "^0.2.9"
|
||||
}
|
||||
}
|
||||
|
||||
1657
plugins/exporter-curl/package-lock.json
generated
1657
plugins/exporter-curl/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -3,15 +3,7 @@
|
||||
"private": true,
|
||||
"version": "0.0.1",
|
||||
"scripts": {
|
||||
"build": "yaakcli build ./src/index.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"@yaakapp/api": "^0.2.7"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^20.14.9",
|
||||
"typescript": "^5.5.2",
|
||||
"vitest": "^1.4.0",
|
||||
"@yaakapp/cli": "^0.0.42"
|
||||
"build": "yaakcli build ./src/index.js",
|
||||
"dev": "yaakcli dev ./src/index.js"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,6 +23,7 @@ export async function pluginHookExport(_ctx: Context, request: Partial<HttpReque
|
||||
if (request.method) xs.push('-X', request.method);
|
||||
if (request.url) xs.push(quote(request.url));
|
||||
|
||||
|
||||
xs.push(NEWLINE);
|
||||
|
||||
// Add URL params
|
||||
|
||||
8
plugins/filter-jsonpath/package-lock.json
generated
8
plugins/filter-jsonpath/package-lock.json
generated
@@ -8,7 +8,7 @@
|
||||
"name": "filter-jsonpath",
|
||||
"version": "0.0.1",
|
||||
"dependencies": {
|
||||
"@yaakapp/api": "^0.2.7",
|
||||
"@yaakapp/api": "^0.2.9",
|
||||
"jsonpath-plus": "^9.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
@@ -49,9 +49,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@yaakapp/api": {
|
||||
"version": "0.2.7",
|
||||
"resolved": "https://registry.npmjs.org/@yaakapp/api/-/api-0.2.7.tgz",
|
||||
"integrity": "sha512-vU9KtEwe5a+6VpDtV5+GSV+BpZETer/M9TtZ+oDZovvFMO0d55KqPfs7S6PuMru6e8Yxky8mO1TjL4Vsylh2Gg==",
|
||||
"version": "0.2.8",
|
||||
"resolved": "https://registry.npmjs.org/@yaakapp/api/-/api-0.2.8.tgz",
|
||||
"integrity": "sha512-m+6xHIH/X8uTP65oeaSGmz90UOhl7sW5E2rNKix5MEKSFg0BzBupXMjBIT6EXtrxcCvUdOPtSP3ARriWsiZixQ==",
|
||||
"dependencies": {
|
||||
"@types/node": "^22.5.4"
|
||||
}
|
||||
|
||||
@@ -3,15 +3,13 @@
|
||||
"private": true,
|
||||
"version": "0.0.1",
|
||||
"scripts": {
|
||||
"build": "yaakcli build ./src/index.ts"
|
||||
"build": "yaakcli build ./src/index.ts",
|
||||
"dev": "yaakcli dev ./src/index.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"jsonpath-plus": "^9.0.0",
|
||||
"@yaakapp/api": "^0.2.7"
|
||||
"jsonpath-plus": "^9.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@yaakapp/cli": "^0.0.42",
|
||||
"@types/node": "^20.14.9",
|
||||
"typescript": "^5.5.2"
|
||||
"@types/jsonpath": "^0.2.4"
|
||||
}
|
||||
}
|
||||
|
||||
8
plugins/filter-xpath/package-lock.json
generated
8
plugins/filter-xpath/package-lock.json
generated
@@ -9,7 +9,7 @@
|
||||
"version": "0.0.1",
|
||||
"dependencies": {
|
||||
"@xmldom/xmldom": "^0.8.10",
|
||||
"@yaakapp/api": "^0.2.7",
|
||||
"@yaakapp/api": "^0.2.9",
|
||||
"xpath": "^0.0.34"
|
||||
},
|
||||
"devDependencies": {
|
||||
@@ -36,9 +36,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@yaakapp/api": {
|
||||
"version": "0.2.7",
|
||||
"resolved": "https://registry.npmjs.org/@yaakapp/api/-/api-0.2.7.tgz",
|
||||
"integrity": "sha512-vU9KtEwe5a+6VpDtV5+GSV+BpZETer/M9TtZ+oDZovvFMO0d55KqPfs7S6PuMru6e8Yxky8mO1TjL4Vsylh2Gg==",
|
||||
"version": "0.2.8",
|
||||
"resolved": "https://registry.npmjs.org/@yaakapp/api/-/api-0.2.8.tgz",
|
||||
"integrity": "sha512-m+6xHIH/X8uTP65oeaSGmz90UOhl7sW5E2rNKix5MEKSFg0BzBupXMjBIT6EXtrxcCvUdOPtSP3ARriWsiZixQ==",
|
||||
"dependencies": {
|
||||
"@types/node": "^22.5.4"
|
||||
}
|
||||
|
||||
@@ -3,16 +3,11 @@
|
||||
"private": true,
|
||||
"version": "0.0.1",
|
||||
"scripts": {
|
||||
"build": "yaakcli build ./src/index.js"
|
||||
"build": "yaakcli build ./src/index.js",
|
||||
"dev": "yaakcli dev ./src/index.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"@yaakapp/api": "^0.2.7",
|
||||
"@xmldom/xmldom": "^0.8.10",
|
||||
"xpath": "^0.0.34"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@yaakapp/cli": "^0.0.42",
|
||||
"@types/node": "^20.14.9",
|
||||
"typescript": "^5.5.2"
|
||||
}
|
||||
}
|
||||
|
||||
8
plugins/importer-curl/package-lock.json
generated
8
plugins/importer-curl/package-lock.json
generated
@@ -8,7 +8,7 @@
|
||||
"name": "importer-curl",
|
||||
"version": "0.0.1",
|
||||
"dependencies": {
|
||||
"@yaakapp/api": "^0.2.7",
|
||||
"@yaakapp/api": "^0.2.9",
|
||||
"shell-quote": "^1.8.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
@@ -710,9 +710,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@yaakapp/api": {
|
||||
"version": "0.2.7",
|
||||
"resolved": "https://registry.npmjs.org/@yaakapp/api/-/api-0.2.7.tgz",
|
||||
"integrity": "sha512-vU9KtEwe5a+6VpDtV5+GSV+BpZETer/M9TtZ+oDZovvFMO0d55KqPfs7S6PuMru6e8Yxky8mO1TjL4Vsylh2Gg==",
|
||||
"version": "0.2.8",
|
||||
"resolved": "https://registry.npmjs.org/@yaakapp/api/-/api-0.2.8.tgz",
|
||||
"integrity": "sha512-m+6xHIH/X8uTP65oeaSGmz90UOhl7sW5E2rNKix5MEKSFg0BzBupXMjBIT6EXtrxcCvUdOPtSP3ARriWsiZixQ==",
|
||||
"dependencies": {
|
||||
"@types/node": "^22.5.4"
|
||||
}
|
||||
|
||||
@@ -3,17 +3,10 @@
|
||||
"private": true,
|
||||
"version": "0.0.1",
|
||||
"scripts": {
|
||||
"build": "yaakcli build ./src/index.js"
|
||||
"build": "yaakcli build ./src/index.js",
|
||||
"dev": "yaakcli dev ./src/index.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"@yaakapp/api": "^0.2.7",
|
||||
"shell-quote": "^1.8.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@yaakapp/cli": "^0.0.42",
|
||||
"@types/node": "^20.14.9",
|
||||
"@types/shell-quote": "^1.7.5",
|
||||
"typescript": "^5.5.2",
|
||||
"vitest": "^1.4.0"
|
||||
}
|
||||
}
|
||||
|
||||
8
plugins/importer-insomnia/package-lock.json
generated
8
plugins/importer-insomnia/package-lock.json
generated
@@ -8,7 +8,7 @@
|
||||
"name": "importer-insomnia",
|
||||
"version": "0.0.1",
|
||||
"dependencies": {
|
||||
"@yaakapp/api": "^0.2.7",
|
||||
"@yaakapp/api": "^0.2.9",
|
||||
"yaml": "^2.4.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
@@ -27,9 +27,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@yaakapp/api": {
|
||||
"version": "0.2.7",
|
||||
"resolved": "https://registry.npmjs.org/@yaakapp/api/-/api-0.2.7.tgz",
|
||||
"integrity": "sha512-vU9KtEwe5a+6VpDtV5+GSV+BpZETer/M9TtZ+oDZovvFMO0d55KqPfs7S6PuMru6e8Yxky8mO1TjL4Vsylh2Gg==",
|
||||
"version": "0.2.8",
|
||||
"resolved": "https://registry.npmjs.org/@yaakapp/api/-/api-0.2.8.tgz",
|
||||
"integrity": "sha512-m+6xHIH/X8uTP65oeaSGmz90UOhl7sW5E2rNKix5MEKSFg0BzBupXMjBIT6EXtrxcCvUdOPtSP3ARriWsiZixQ==",
|
||||
"dependencies": {
|
||||
"@types/node": "^22.5.4"
|
||||
}
|
||||
|
||||
@@ -3,15 +3,10 @@
|
||||
"private": true,
|
||||
"version": "0.0.1",
|
||||
"scripts": {
|
||||
"build": "yaakcli build ./src/index.js"
|
||||
"build": "yaakcli build ./src/index.js",
|
||||
"dev": "yaakcli dev ./src/index.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"@yaakapp/api": "^0.2.7",
|
||||
"yaml": "^2.4.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@yaakapp/cli": "^0.0.42",
|
||||
"@types/node": "^20.14.9",
|
||||
"typescript": "^5.5.2"
|
||||
}
|
||||
}
|
||||
|
||||
8
plugins/importer-openapi/package-lock.json
generated
8
plugins/importer-openapi/package-lock.json
generated
@@ -8,7 +8,7 @@
|
||||
"name": "importer-openapi",
|
||||
"version": "0.0.1",
|
||||
"dependencies": {
|
||||
"@yaakapp/api": "^0.2.7",
|
||||
"@yaakapp/api": "^0.2.9",
|
||||
"openapi-to-postmanv2": "^4.23.1",
|
||||
"yaml": "^2.4.2"
|
||||
},
|
||||
@@ -57,9 +57,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@yaakapp/api": {
|
||||
"version": "0.2.7",
|
||||
"resolved": "https://registry.npmjs.org/@yaakapp/api/-/api-0.2.7.tgz",
|
||||
"integrity": "sha512-vU9KtEwe5a+6VpDtV5+GSV+BpZETer/M9TtZ+oDZovvFMO0d55KqPfs7S6PuMru6e8Yxky8mO1TjL4Vsylh2Gg==",
|
||||
"version": "0.2.8",
|
||||
"resolved": "https://registry.npmjs.org/@yaakapp/api/-/api-0.2.8.tgz",
|
||||
"integrity": "sha512-m+6xHIH/X8uTP65oeaSGmz90UOhl7sW5E2rNKix5MEKSFg0BzBupXMjBIT6EXtrxcCvUdOPtSP3ARriWsiZixQ==",
|
||||
"dependencies": {
|
||||
"@types/node": "^22.5.4"
|
||||
}
|
||||
|
||||
@@ -3,17 +3,11 @@
|
||||
"private": true,
|
||||
"version": "0.0.1",
|
||||
"scripts": {
|
||||
"build": "yaakcli build ./src/index.js"
|
||||
"build": "yaakcli build ./src/index.js",
|
||||
"dev": "yaakcli dev ./src/index.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"@yaakapp/api": "^0.2.7",
|
||||
"openapi-to-postmanv2": "^4.23.1",
|
||||
"yaml": "^2.4.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@yaakapp/cli": "^0.0.42",
|
||||
"@types/node": "^20.14.9",
|
||||
"@types/openapi-to-postmanv2": "^3.2.4",
|
||||
"typescript": "^5.5.2"
|
||||
}
|
||||
}
|
||||
|
||||
2
plugins/importer-postman/package-lock.json
generated
2
plugins/importer-postman/package-lock.json
generated
@@ -8,7 +8,7 @@
|
||||
"name": "importer-postman",
|
||||
"version": "0.0.1",
|
||||
"dependencies": {
|
||||
"@yaakapp/api": "^0.2.7"
|
||||
"@yaakapp/api": "^0.2.9"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^20.14.9",
|
||||
|
||||
@@ -4,16 +4,7 @@
|
||||
"version": "0.0.1",
|
||||
"main": "./build/index.js",
|
||||
"scripts": {
|
||||
"build": "yaakcli build ./src/index.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"@yaakapp/api": "^0.2.7"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@yaakapp/cli": "^0.0.42",
|
||||
"@types/node": "^20.14.9",
|
||||
"esbuild": "^0.21.5",
|
||||
"typescript": "^5.5.2",
|
||||
"vitest": "^1.4.0"
|
||||
"build": "yaakcli build ./src/index.js",
|
||||
"dev": "yaakcli dev ./src/index.js"
|
||||
}
|
||||
}
|
||||
|
||||
2
plugins/importer-yaak/package-lock.json
generated
2
plugins/importer-yaak/package-lock.json
generated
@@ -8,7 +8,7 @@
|
||||
"name": "importer-yaak",
|
||||
"version": "0.0.1",
|
||||
"dependencies": {
|
||||
"@yaakapp/api": "^0.2.7"
|
||||
"@yaakapp/api": "^0.2.9"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^20.14.9",
|
||||
|
||||
@@ -3,15 +3,7 @@
|
||||
"private": true,
|
||||
"version": "0.0.1",
|
||||
"scripts": {
|
||||
"build": "yaakcli build ./src/index.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"@yaakapp/api": "^0.2.7"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@yaakapp/cli": "^0.0.42",
|
||||
"@types/node": "^20.14.9",
|
||||
"esbuild": "^0.21.5",
|
||||
"typescript": "^5.5.2"
|
||||
"build": "yaakcli build ./src/index.js",
|
||||
"dev": "yaakcli dev ./src/index.js"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
"version": "0.0.1",
|
||||
"dependencies": {
|
||||
"@xmldom/xmldom": "^0.8.10",
|
||||
"@yaakapp/api": "^0.2.7",
|
||||
"@yaakapp/api": "^0.2.9",
|
||||
"jsonpath-plus": "^9.0.0",
|
||||
"xpath": "^0.0.34"
|
||||
},
|
||||
|
||||
@@ -3,19 +3,15 @@
|
||||
"private": true,
|
||||
"version": "0.0.1",
|
||||
"scripts": {
|
||||
"build": "yaakcli build ./src/index.ts"
|
||||
"build": "yaakcli build ./src/index.ts",
|
||||
"dev": "yaakcli dev ./src/index.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"@yaakapp/api": "^0.2.7",
|
||||
"jsonpath-plus": "^9.0.0",
|
||||
"xpath": "^0.0.34",
|
||||
"@xmldom/xmldom": "^0.8.10"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@yaakapp/cli": "^0.0.42",
|
||||
"@types/jsonpath": "^0.2.4",
|
||||
"@types/node": "^20.14.9",
|
||||
"typescript": "^5.5.2",
|
||||
"vitest": "^1.4.0"
|
||||
"@types/jsonpath": "^0.2.4"
|
||||
}
|
||||
}
|
||||
|
||||
213
types/models.ts
213
types/models.ts
@@ -1,213 +0,0 @@
|
||||
export type Model =
|
||||
| Settings
|
||||
| Workspace
|
||||
| Folder
|
||||
| GrpcConnection
|
||||
| GrpcRequest
|
||||
| GrpcEvent
|
||||
| HttpRequest
|
||||
| HttpResponse
|
||||
| KeyValue
|
||||
| Environment
|
||||
| CookieJar;
|
||||
|
||||
export interface BaseModel {
|
||||
readonly id: string;
|
||||
readonly createdAt: string;
|
||||
readonly updatedAt: string;
|
||||
}
|
||||
|
||||
export interface Settings extends BaseModel {
|
||||
readonly model: 'settings';
|
||||
theme: string;
|
||||
appearance: string;
|
||||
themeLight: string;
|
||||
themeDark: string;
|
||||
updateChannel: string;
|
||||
interfaceFontSize: number;
|
||||
interfaceScale: number;
|
||||
editorFontSize: number;
|
||||
editorSoftWrap: boolean;
|
||||
openWorkspaceNewWindow: boolean | null;
|
||||
}
|
||||
|
||||
export interface Workspace extends BaseModel {
|
||||
readonly model: 'workspace';
|
||||
name: string;
|
||||
description: string;
|
||||
variables: EnvironmentVariable[];
|
||||
settingValidateCertificates: boolean;
|
||||
settingFollowRedirects: boolean;
|
||||
settingRequestTimeout: number;
|
||||
}
|
||||
|
||||
export interface CookieJar extends BaseModel {
|
||||
readonly model: 'cookie_jar';
|
||||
workspaceId: string;
|
||||
name: string;
|
||||
cookies: Cookie[];
|
||||
}
|
||||
|
||||
export interface Cookie {
|
||||
raw_cookie: string;
|
||||
domain: { HostOnly: string } | { Suffix: string } | 'NotPresent' | 'Empty';
|
||||
expires: { AtUtc: string } | 'SessionEnd';
|
||||
path: [string, boolean];
|
||||
}
|
||||
|
||||
export function cookieDomain(cookie: Cookie): string {
|
||||
if (cookie.domain === 'NotPresent' || cookie.domain === 'Empty') {
|
||||
return 'n/a';
|
||||
}
|
||||
if ('HostOnly' in cookie.domain) {
|
||||
return cookie.domain.HostOnly;
|
||||
}
|
||||
if ('Suffix' in cookie.domain) {
|
||||
return cookie.domain.Suffix;
|
||||
}
|
||||
return 'unknown';
|
||||
}
|
||||
|
||||
export interface EnvironmentVariable {
|
||||
name: string;
|
||||
value: string;
|
||||
enabled?: boolean;
|
||||
}
|
||||
|
||||
export interface Folder extends BaseModel {
|
||||
readonly workspaceId: string;
|
||||
readonly model: 'folder';
|
||||
folderId: string | null;
|
||||
sortPriority: number;
|
||||
name: string;
|
||||
}
|
||||
|
||||
export interface Environment extends BaseModel {
|
||||
readonly workspaceId: string;
|
||||
readonly model: 'environment';
|
||||
name: string;
|
||||
variables: EnvironmentVariable[];
|
||||
}
|
||||
|
||||
export interface HttpHeader {
|
||||
name: string;
|
||||
value: string;
|
||||
enabled?: boolean;
|
||||
}
|
||||
|
||||
export interface HttpUrlParameter {
|
||||
name: string;
|
||||
value: string;
|
||||
enabled?: boolean;
|
||||
}
|
||||
|
||||
export interface GrpcMetadataEntry {
|
||||
name: string;
|
||||
value: string;
|
||||
enabled?: boolean;
|
||||
}
|
||||
|
||||
export interface GrpcRequest extends BaseModel {
|
||||
readonly workspaceId: string;
|
||||
readonly model: 'grpc_request';
|
||||
folderId: string | null;
|
||||
sortPriority: number;
|
||||
name: string;
|
||||
url: string;
|
||||
service: string | null;
|
||||
method: string | null;
|
||||
message: string;
|
||||
authentication: Record<string, string | number | boolean | null | undefined>;
|
||||
authenticationType: string | null;
|
||||
metadata: GrpcMetadataEntry[];
|
||||
}
|
||||
|
||||
export interface GrpcEvent extends BaseModel {
|
||||
readonly workspaceId: string;
|
||||
readonly requestId: string;
|
||||
readonly connectionId: string;
|
||||
readonly model: 'grpc_event';
|
||||
content: string;
|
||||
status: number | null;
|
||||
error: string | null;
|
||||
eventType:
|
||||
| 'info'
|
||||
| 'error'
|
||||
| 'client_message'
|
||||
| 'server_message'
|
||||
| 'connection_start'
|
||||
| 'connection_end';
|
||||
metadata: Record<string, string>;
|
||||
}
|
||||
|
||||
export interface GrpcConnection extends BaseModel {
|
||||
readonly workspaceId: string;
|
||||
readonly requestId: string;
|
||||
readonly model: 'grpc_connection';
|
||||
service: string;
|
||||
method: string;
|
||||
elapsed: number;
|
||||
elapsedConnection: number;
|
||||
status: number;
|
||||
url: string;
|
||||
error: string | null;
|
||||
trailers: Record<string, string>;
|
||||
}
|
||||
|
||||
export interface HttpRequest extends BaseModel {
|
||||
readonly workspaceId: string;
|
||||
readonly model: 'http_request';
|
||||
folderId: string | null;
|
||||
sortPriority: number;
|
||||
name: string;
|
||||
url: string;
|
||||
urlParameters: HttpUrlParameter[];
|
||||
body: Record<string, unknown>;
|
||||
bodyType: string | null;
|
||||
authentication: Record<string, string | number | boolean | null | undefined>;
|
||||
authenticationType: string | null;
|
||||
method: string;
|
||||
headers: HttpHeader[];
|
||||
}
|
||||
|
||||
export interface KeyValue extends Omit<BaseModel, 'id'> {
|
||||
readonly model: 'key_value';
|
||||
readonly key: string;
|
||||
readonly namespace: string;
|
||||
value: string;
|
||||
}
|
||||
|
||||
export interface HttpResponse extends BaseModel {
|
||||
readonly workspaceId: string;
|
||||
readonly model: 'http_response';
|
||||
readonly requestId: string;
|
||||
readonly bodyPath: string | null;
|
||||
readonly contentLength: number | null;
|
||||
readonly error: string;
|
||||
readonly status: number;
|
||||
readonly elapsed: number;
|
||||
readonly elapsedHeaders: number;
|
||||
readonly statusReason: string;
|
||||
readonly version: string;
|
||||
readonly remoteAddr: string;
|
||||
readonly url: string;
|
||||
readonly headers: HttpHeader[];
|
||||
}
|
||||
|
||||
export function isResponseLoading(response: HttpResponse | GrpcConnection): boolean {
|
||||
return response.elapsed === 0;
|
||||
}
|
||||
|
||||
export function modelsEq(a: Model, b: Model) {
|
||||
if (a.model === 'key_value' && b.model === 'key_value') {
|
||||
return a.key === b.key && a.namespace === b.namespace;
|
||||
}
|
||||
if ('id' in a && 'id' in b) {
|
||||
return a.id === b.id;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
export function getContentTypeHeader(headers: HttpHeader[]): string | null {
|
||||
return headers.find((h) => h.name.toLowerCase() === 'content-type')?.value ?? null;
|
||||
}
|
||||
Reference in New Issue
Block a user