Files
insomnia/packages/insomnia-data/common-src/constants.ts
Bingbing b09cde814d refactor: extract insomnia-data into workspace package (#10010)
Move insomnia-data models, services, database code, and common utilities into a dedicated workspace package. Update consumers to import from the new package entrypoints and declare workspace dependencies for the extracted package.
2026-06-02 09:49:10 +00:00

24 lines
1.1 KiB
TypeScript

export const CONTENT_TYPE_FORM_URLENCODED = 'application/x-www-form-urlencoded';
export const CONTENT_TYPE_GRAPHQL = 'application/graphql';
export const CONTENT_TYPE_JSON = 'application/json';
export const METHOD_GET = 'GET';
export function getContentTypeFromHeaders(headers: any[], defaultValue: string | null = null) {
if (!Array.isArray(headers)) {
return null;
}
const header = headers.find(({ name }) => name.toLowerCase() === 'content-type');
return header ? header.value : defaultValue;
}
export type OAuth1SignatureMethod = 'HMAC-SHA1' | 'RSA-SHA1' | 'HMAC-SHA256' | 'PLAINTEXT';
export const SIGNATURE_METHOD_HMAC_SHA1: OAuth1SignatureMethod = 'HMAC-SHA1';
export const SIGNATURE_METHOD_HMAC_SHA256: OAuth1SignatureMethod = 'HMAC-SHA256';
export const SIGNATURE_METHOD_RSA_SHA1: OAuth1SignatureMethod = 'RSA-SHA1';
export const SIGNATURE_METHOD_PLAINTEXT: OAuth1SignatureMethod = 'PLAINTEXT';
export const getAppDefaultTheme = () => 'default';
export const getAppDefaultLightTheme = () => 'studio-light';
export const getAppDefaultDarkTheme = () => 'default';