mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
1 parent
24f754697b
commit
6fd9b7cf76
14 files changed
+452
-535
No files matched your search
+22
-5
@@ -1,11 +1,28 @@
|
||||
import request from "request"
|
||||
import requestPromise from "request-promise-native"
|
||||
import { userStore } from "./user-store"
|
||||
|
||||
export function globalRequestOpts(requestOpts: request.Options) {
|
||||
// todo: get rid of "request" (deprecated)
|
||||
// https://github.com/lensapp/lens/issues/459
|
||||
|
||||
function getDefaultRequestOpts(): Partial<request.Options> {
|
||||
const { httpsProxy, allowUntrustedCAs } = userStore.preferences
|
||||
if (httpsProxy) {
|
||||
requestOpts.proxy = httpsProxy
|
||||
return {
|
||||
proxy: httpsProxy || undefined,
|
||||
rejectUnauthorized: !allowUntrustedCAs,
|
||||
}
|
||||
requestOpts.rejectUnauthorized = !allowUntrustedCAs;
|
||||
return requestOpts
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
export function customRequest(opts: request.Options) {
|
||||
return request.defaults(getDefaultRequestOpts())(opts)
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
export function customRequestPromise(opts: requestPromise.Options) {
|
||||
return requestPromise.defaults(getDefaultRequestOpts())(opts)
|
||||
}
|
||||
@@ -13,6 +13,12 @@ export enum ThemeType {
|
||||
DARK = "dark",
|
||||
}
|
||||
|
||||
export interface Theme {
|
||||
name: string;
|
||||
type: ThemeType;
|
||||
colors?: Record<string, string>;
|
||||
}
|
||||
|
||||
export interface UserStoreModel {
|
||||
lastSeenAppVersion: string;
|
||||
seenContexts: string[];
|
||||
|
||||
Reference in new issue
Block a user