repo
stringlengths
5
106
file_url
stringlengths
78
301
file_path
stringlengths
4
211
content
stringlengths
0
32.8k
language
stringclasses
1 value
license
stringclasses
7 values
commit_sha
stringlengths
40
40
retrieved_at
stringdate
2026-01-04 14:56:49
2026-01-05 02:23:25
truncated
bool
2 classes
usebruno/bruno
https://github.com/usebruno/bruno/blob/b6a27bc66c93946b93ea736674830f700dbccb6e/packages/bruno-app/src/utils/filesystem.js
packages/bruno-app/src/utils/filesystem.js
/** * Filesystem utilities for the renderer process * These functions communicate with the main process via IPC */ /** * Check if a file exists * @param {string} filePath - The file path to check * @returns {Promise<boolean>} - True if file exists, false otherwise */ export const existsSync = async (filePath) =...
javascript
MIT
b6a27bc66c93946b93ea736674830f700dbccb6e
2026-01-04T14:59:20.022123Z
false
usebruno/bruno
https://github.com/usebruno/bruno/blob/b6a27bc66c93946b93ea736674830f700dbccb6e/packages/bruno-app/src/utils/terminal.js
packages/bruno-app/src/utils/terminal.js
import { openConsole, setActiveTab } from 'providers/ReduxStore/slices/logs'; import { getSessionId } from 'components/Devtools/Console/TerminalTab'; /** * Opens the devtools console and switches to the terminal tab * Optionally opens/switches to a terminal session at a specific CWD * @param {Function} dispatch - R...
javascript
MIT
b6a27bc66c93946b93ea736674830f700dbccb6e
2026-01-04T14:59:20.022123Z
false
usebruno/bruno
https://github.com/usebruno/bruno/blob/b6a27bc66c93946b93ea736674830f700dbccb6e/packages/bruno-app/src/utils/beta-features.js
packages/bruno-app/src/utils/beta-features.js
import { useSelector } from 'react-redux'; /** * Beta features configuration object * Contains all available beta feature keys */ export const BETA_FEATURES = Object.freeze({ NODE_VM: 'nodevm' }); /** * Hook to check if a beta feature is enabled * @param {string} featureName - The name of the beta feature * @...
javascript
MIT
b6a27bc66c93946b93ea736674830f700dbccb6e
2026-01-04T14:59:20.022123Z
false
usebruno/bruno
https://github.com/usebruno/bruno/blob/b6a27bc66c93946b93ea736674830f700dbccb6e/packages/bruno-app/src/utils/auth/index.spec.js
packages/bruno-app/src/utils/auth/index.spec.js
import { resolveInheritedAuth } from './index'; jest.mock('utils/collections/index', () => ({ getTreePathFromCollectionToItem: (collection, item) => { const itemUid = item.uid; if (itemUid === 'r1') { return [collection.items[0], collection.items[0].items[0]]; } return []; } })); // Helper ...
javascript
MIT
b6a27bc66c93946b93ea736674830f700dbccb6e
2026-01-04T14:59:20.022123Z
false
usebruno/bruno
https://github.com/usebruno/bruno/blob/b6a27bc66c93946b93ea736674830f700dbccb6e/packages/bruno-app/src/utils/auth/index.js
packages/bruno-app/src/utils/auth/index.js
import { get } from 'lodash'; import { getTreePathFromCollectionToItem } from 'utils/collections/index'; // Resolve inherited auth by traversing up the folder hierarchy export const resolveInheritedAuth = (item, collection) => { const mergedRequest = { ...(item.request || {}), ...(item.draft?.request || {}...
javascript
MIT
b6a27bc66c93946b93ea736674830f700dbccb6e
2026-01-04T14:59:20.022123Z
false
usebruno/bruno
https://github.com/usebruno/bruno/blob/b6a27bc66c93946b93ea736674830f700dbccb6e/packages/bruno-app/src/utils/codemirror/autocomplete.js
packages/bruno-app/src/utils/codemirror/autocomplete.js
import { mockDataFunctions } from '@usebruno/common'; const CodeMirror = require('codemirror'); // Static API hints - Bruno JavaScript API (subgrouped by category) const STATIC_API_HINTS = { req: [ 'req', 'req.url', 'req.method', 'req.headers', 'req.body', 'req.timeout', 'req.getUrl()', ...
javascript
MIT
b6a27bc66c93946b93ea736674830f700dbccb6e
2026-01-04T14:59:20.022123Z
false
usebruno/bruno
https://github.com/usebruno/bruno/blob/b6a27bc66c93946b93ea736674830f700dbccb6e/packages/bruno-app/src/utils/codemirror/javascript-lint.js
packages/bruno-app/src/utils/codemirror/javascript-lint.js
/** * MIT License * https://github.com/codemirror/codemirror5/blob/master/LICENSE * * Copyright (C) 2017 by Marijn Haverbeke <marijnh@gmail.com> and others */ import { JSHINT } from 'jshint'; let CodeMirror; const SERVER_RENDERED = typeof window === 'undefined' || global['PREVENT_CODEMIRROR_RENDER'] === true; i...
javascript
MIT
b6a27bc66c93946b93ea736674830f700dbccb6e
2026-01-04T14:59:20.022123Z
false
usebruno/bruno
https://github.com/usebruno/bruno/blob/b6a27bc66c93946b93ea736674830f700dbccb6e/packages/bruno-app/src/utils/codemirror/autocompleteConstants.js
packages/bruno-app/src/utils/codemirror/autocompleteConstants.js
export const MimeTypes = [ 'application/atom+xml', 'application/ecmascript', 'application/json', 'application/vnd.api+json', 'application/javascript', 'application/octet-stream', 'application/ogg', 'application/pdf', 'application/postscript', 'application/rdf+xml', 'application/rss+xml', 'applic...
javascript
MIT
b6a27bc66c93946b93ea736674830f700dbccb6e
2026-01-04T14:59:20.022123Z
false
usebruno/bruno
https://github.com/usebruno/bruno/blob/b6a27bc66c93946b93ea736674830f700dbccb6e/packages/bruno-app/src/utils/codemirror/linkAware.js
packages/bruno-app/src/utils/codemirror/linkAware.js
import LinkifyIt from 'linkify-it'; import { isMacOS } from 'utils/common/platform'; import { debounce } from 'lodash'; /** * Gets the visible line range using scroll info and lineAtHeight * @param {Object} editor - The CodeMirror editor instance * @param {number} padding - Number of lines to add above and below vie...
javascript
MIT
b6a27bc66c93946b93ea736674830f700dbccb6e
2026-01-04T14:59:20.022123Z
false
usebruno/bruno
https://github.com/usebruno/bruno/blob/b6a27bc66c93946b93ea736674830f700dbccb6e/packages/bruno-app/src/utils/codemirror/brunoVarInfo.spec.js
packages/bruno-app/src/utils/codemirror/brunoVarInfo.spec.js
import { interpolate } from '@usebruno/common'; import { COPY_SUCCESS_TIMEOUT, extractVariableInfo, renderVarInfo } from './brunoVarInfo'; // Mock the dependencies jest.mock('@usebruno/common', () => ({ interpolate: jest.fn(), mockDataFunctions: { randomFirstName: jest.fn(() => 'John'), randomLastName: jes...
javascript
MIT
b6a27bc66c93946b93ea736674830f700dbccb6e
2026-01-04T14:59:20.022123Z
false
usebruno/bruno
https://github.com/usebruno/bruno/blob/b6a27bc66c93946b93ea736674830f700dbccb6e/packages/bruno-app/src/utils/codemirror/linkAware.spec.js
packages/bruno-app/src/utils/codemirror/linkAware.spec.js
import { setupLinkAware } from './linkAware'; import LinkifyIt from 'linkify-it'; import { isMacOS } from 'utils/common/platform'; // No need to mock CodeMirror since setupLinkAware works with an existing editor // Mock linkify-it jest.mock('linkify-it', () => { return jest.fn().mockImplementation(() => ({ matc...
javascript
MIT
b6a27bc66c93946b93ea736674830f700dbccb6e
2026-01-04T14:59:20.022123Z
false
usebruno/bruno
https://github.com/usebruno/bruno/blob/b6a27bc66c93946b93ea736674830f700dbccb6e/packages/bruno-app/src/utils/codemirror/brunoVarInfo.js
packages/bruno-app/src/utils/codemirror/brunoVarInfo.js
/** * Copyright (c) 2017, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file at https://github.com/graphql/codemirror-graphql/tree/v0.8.3 */ import { interpolate, mockDataFunctions } from '@usebruno/common'; import { getVariableScope...
javascript
MIT
b6a27bc66c93946b93ea736674830f700dbccb6e
2026-01-04T14:59:20.022123Z
false
usebruno/bruno
https://github.com/usebruno/bruno/blob/b6a27bc66c93946b93ea736674830f700dbccb6e/packages/bruno-app/src/utils/codemirror/lang-detect.js
packages/bruno-app/src/utils/codemirror/lang-detect.js
/** * @param {string} snippet * @returns {boolean} */ export function isXML(snippet) { return /<\/?[a-z][\s\S]*>/i.test(snippet); } /** * @param {string} snippet * @returns {boolean} */ export function isJSON(snippet) { try { JSON.parse(snippet); return true; } catch (err) { return false; } }...
javascript
MIT
b6a27bc66c93946b93ea736674830f700dbccb6e
2026-01-04T14:59:20.022123Z
false
usebruno/bruno
https://github.com/usebruno/bruno/blob/b6a27bc66c93946b93ea736674830f700dbccb6e/packages/bruno-app/src/utils/codemirror/mock-data-hints.js
packages/bruno-app/src/utils/codemirror/mock-data-hints.js
import { mockDataFunctions } from '@usebruno/common'; const MOCK_FUNCTION_SUGGESTIONS = Object.keys(mockDataFunctions).map((key) => `$${key}`); export const getMockDataHints = (cm) => { const cursor = cm.getCursor(); const currentString = cm.getRange({ line: cursor.line, ch: 0 }, cursor); const match = current...
javascript
MIT
b6a27bc66c93946b93ea736674830f700dbccb6e
2026-01-04T14:59:20.022123Z
false
usebruno/bruno
https://github.com/usebruno/bruno/blob/b6a27bc66c93946b93ea736674830f700dbccb6e/packages/bruno-app/src/utils/codemirror/autocomplete.spec.js
packages/bruno-app/src/utils/codemirror/autocomplete.spec.js
const { describe, it, expect, jest, beforeEach, afterEach } = require('@jest/globals'); const _mockedCodemirror = { commands: {}, getCursor: jest.fn(), getLine: jest.fn(), getRange: jest.fn(), showHint: jest.fn(), on: jest.fn(), off: jest.fn(), state: {} }; jest.mock('codemirror', () => { return _mo...
javascript
MIT
b6a27bc66c93946b93ea736674830f700dbccb6e
2026-01-04T14:59:20.022123Z
false
usebruno/bruno
https://github.com/usebruno/bruno/blob/b6a27bc66c93946b93ea736674830f700dbccb6e/packages/bruno-app/src/utils/codemirror/lint-errors.js
packages/bruno-app/src/utils/codemirror/lint-errors.js
/** * Lint Error Tooltip for CodeMirror * Shows lint errors in a popover when hovering over line numbers */ let activeTooltip = null; /** * Get lint errors for a specific line from the editor's lint state * @param {CodeMirror} editor - The CodeMirror editor instance * @param {number} lineNumber - The 0-indexed ...
javascript
MIT
b6a27bc66c93946b93ea736674830f700dbccb6e
2026-01-04T14:59:20.022123Z
false
usebruno/bruno
https://github.com/usebruno/bruno/blob/b6a27bc66c93946b93ea736674830f700dbccb6e/packages/bruno-app/src/utils/curl/curl-to-json.js
packages/bruno-app/src/utils/curl/curl-to-json.js
/** * Copyright (c) 2014-2016 Nick Carneiro * https://github.com/curlconverter/curlconverter * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ import parseCurlCommand from './parse-curl'; import * as querystring from 'query-string'; i...
javascript
MIT
b6a27bc66c93946b93ea736674830f700dbccb6e
2026-01-04T14:59:20.022123Z
false
usebruno/bruno
https://github.com/usebruno/bruno/blob/b6a27bc66c93946b93ea736674830f700dbccb6e/packages/bruno-app/src/utils/curl/index.js
packages/bruno-app/src/utils/curl/index.js
import { forOwn } from 'lodash'; import curlToJson from './curl-to-json'; import { prettifyJsonString } from 'utils/common/index'; import { isJsonLikeContentType, isPlainTextContentType, isXmlLikeContentType } from './content-type'; export const getRequestFromCurlCommand = (curlCommand, requestType = 'http-request') =...
javascript
MIT
b6a27bc66c93946b93ea736674830f700dbccb6e
2026-01-04T14:59:20.022123Z
false
usebruno/bruno
https://github.com/usebruno/bruno/blob/b6a27bc66c93946b93ea736674830f700dbccb6e/packages/bruno-app/src/utils/curl/content-type.js
packages/bruno-app/src/utils/curl/content-type.js
const normalizeContentType = (contentType) => { if (!contentType || typeof contentType !== 'string') { return ''; } return contentType.toLowerCase(); }; export const isJsonLikeContentType = (contentType) => { const normalized = normalizeContentType(contentType); return normalized.includes('application/...
javascript
MIT
b6a27bc66c93946b93ea736674830f700dbccb6e
2026-01-04T14:59:20.022123Z
false
usebruno/bruno
https://github.com/usebruno/bruno/blob/b6a27bc66c93946b93ea736674830f700dbccb6e/packages/bruno-app/src/utils/curl/curl-to-json.spec.js
packages/bruno-app/src/utils/curl/curl-to-json.spec.js
const { describe, it, expect } = require('@jest/globals'); import curlToJson from './curl-to-json'; describe('curlToJson', () => { it('should return a parse a simple curl command', () => { const curlCommand = 'curl https://www.usebruno.com'; const result = curlToJson(curlCommand); expect(result).toEqua...
javascript
MIT
b6a27bc66c93946b93ea736674830f700dbccb6e
2026-01-04T14:59:20.022123Z
false
usebruno/bruno
https://github.com/usebruno/bruno/blob/b6a27bc66c93946b93ea736674830f700dbccb6e/packages/bruno-app/src/utils/curl/parse-curl.spec.js
packages/bruno-app/src/utils/curl/parse-curl.spec.js
const { describe, it, expect } = require('@jest/globals'); import parseCurlCommand from './parse-curl'; describe('parseCurlCommand', () => { describe('Basic HTTP Methods', () => { it('should parse simple GET request', () => { const result = parseCurlCommand(` curl https://api.example.com/users ...
javascript
MIT
b6a27bc66c93946b93ea736674830f700dbccb6e
2026-01-04T14:59:20.022123Z
false
usebruno/bruno
https://github.com/usebruno/bruno/blob/b6a27bc66c93946b93ea736674830f700dbccb6e/packages/bruno-app/src/utils/curl/parse-curl.js
packages/bruno-app/src/utils/curl/parse-curl.js
import cookie from 'cookie'; import URL from 'url'; import { parse } from 'shell-quote'; import { isEmpty } from 'lodash'; import { parseQueryParams } from '@usebruno/common/utils'; /** * Flag definitions - maps flag names to their states and actions * State-returning flags expect a value, immediate action flags don...
javascript
MIT
b6a27bc66c93946b93ea736674830f700dbccb6e
2026-01-04T14:59:20.022123Z
false
usebruno/bruno
https://github.com/usebruno/bruno/blob/b6a27bc66c93946b93ea736674830f700dbccb6e/packages/bruno-app/src/utils/importers/bruno-environment.js
packages/bruno-app/src/utils/importers/bruno-environment.js
import { BrunoError } from 'utils/common/error'; import { buildEnvVariable } from 'utils/environments'; const validateBrunoEnvironment = (env) => { if (!env || typeof env !== 'object') { throw new BrunoError('Invalid environment: expected an object'); } if (!Array.isArray(env.variables)) { throw new Bru...
javascript
MIT
b6a27bc66c93946b93ea736674830f700dbccb6e
2026-01-04T14:59:20.022123Z
false
usebruno/bruno
https://github.com/usebruno/bruno/blob/b6a27bc66c93946b93ea736674830f700dbccb6e/packages/bruno-app/src/utils/importers/file-reader.js
packages/bruno-app/src/utils/importers/file-reader.js
import { BrunoError } from 'utils/common/error'; const readFile = (file) => { return new Promise((resolve, reject) => { const fileReader = new FileReader(); fileReader.onload = (e) => { try { const parsed = JSON.parse(e.target.result); resolve({ fileName: file.name, content: parsed }); ...
javascript
MIT
b6a27bc66c93946b93ea736674830f700dbccb6e
2026-01-04T14:59:20.022123Z
false
usebruno/bruno
https://github.com/usebruno/bruno/blob/b6a27bc66c93946b93ea736674830f700dbccb6e/packages/bruno-app/src/utils/importers/bruno-collection.js
packages/bruno-app/src/utils/importers/bruno-collection.js
import { BrunoError } from 'utils/common/error'; import { validateSchema, transformItemsInCollection, updateUidsInCollection, hydrateSeqInCollection } from './common'; const stripExportMetadata = (collection) => { delete collection.exportedAt; delete collection.exportedUsing; return collection; }; export const ...
javascript
MIT
b6a27bc66c93946b93ea736674830f700dbccb6e
2026-01-04T14:59:20.022123Z
false
usebruno/bruno
https://github.com/usebruno/bruno/blob/b6a27bc66c93946b93ea736674830f700dbccb6e/packages/bruno-app/src/utils/importers/openapi-collection.js
packages/bruno-app/src/utils/importers/openapi-collection.js
import { BrunoError } from 'utils/common/error'; import { openApiToBruno } from '@usebruno/converters'; export const convertOpenapiToBruno = (data, options = {}) => { try { return openApiToBruno(data, options); } catch (err) { console.error('Error converting OpenAPI to Bruno:', err); throw new BrunoErr...
javascript
MIT
b6a27bc66c93946b93ea736674830f700dbccb6e
2026-01-04T14:59:20.022123Z
false
usebruno/bruno
https://github.com/usebruno/bruno/blob/b6a27bc66c93946b93ea736674830f700dbccb6e/packages/bruno-app/src/utils/importers/opencollection.js
packages/bruno-app/src/utils/importers/opencollection.js
import each from 'lodash/each'; import { uuid } from 'utils/common'; import { BrunoError } from 'utils/common/error'; import { validateSchema, updateUidsInCollection, hydrateSeqInCollection } from './common'; import { openCollectionToBruno } from '@usebruno/converters'; const addUidsToRoot = (collection) => { if (co...
javascript
MIT
b6a27bc66c93946b93ea736674830f700dbccb6e
2026-01-04T14:59:20.022123Z
false
usebruno/bruno
https://github.com/usebruno/bruno/blob/b6a27bc66c93946b93ea736674830f700dbccb6e/packages/bruno-app/src/utils/importers/common.js
packages/bruno-app/src/utils/importers/common.js
import each from 'lodash/each'; import get from 'lodash/get'; import cloneDeep from 'lodash/cloneDeep'; import { uuid } from 'utils/common'; import { isItemARequest } from 'utils/collections'; import { collectionSchema } from '@usebruno/schema'; import { BrunoError } from 'utils/common/error'; export const validateSc...
javascript
MIT
b6a27bc66c93946b93ea736674830f700dbccb6e
2026-01-04T14:59:20.022123Z
false
usebruno/bruno
https://github.com/usebruno/bruno/blob/b6a27bc66c93946b93ea736674830f700dbccb6e/packages/bruno-app/src/utils/importers/postman-environment.js
packages/bruno-app/src/utils/importers/postman-environment.js
import { BrunoError } from 'utils/common/error'; import { postmanToBrunoEnvironment } from '@usebruno/converters'; const importEnvironment = async (parsedFiles) => { try { const environments = []; for (const parsedFile of parsedFiles) { try { const environment = postmanToBrunoEnvironment(parse...
javascript
MIT
b6a27bc66c93946b93ea736674830f700dbccb6e
2026-01-04T14:59:20.022123Z
false
usebruno/bruno
https://github.com/usebruno/bruno/blob/b6a27bc66c93946b93ea736674830f700dbccb6e/packages/bruno-app/src/utils/importers/postman-collection.js
packages/bruno-app/src/utils/importers/postman-collection.js
import fileDialog from 'file-dialog'; import { BrunoError } from 'utils/common/error'; import { safeParseJSON } from 'utils/common/index'; const readFile = (files) => { return new Promise((resolve, reject) => { const fileReader = new FileReader(); fileReader.onload = (e) => resolve(safeParseJSON(e.target.res...
javascript
MIT
b6a27bc66c93946b93ea736674830f700dbccb6e
2026-01-04T14:59:20.022123Z
false
usebruno/bruno
https://github.com/usebruno/bruno/blob/b6a27bc66c93946b93ea736674830f700dbccb6e/packages/bruno-app/src/utils/importers/wsdl-collection.js
packages/bruno-app/src/utils/importers/wsdl-collection.js
const isWSDLCollection = (data) => { // Check if data is a string (WSDL content) if (typeof data !== 'string') { return false; } // Check for WSDL-specific XML elements const wsdlIndicators = [ 'wsdl:definitions', 'definitions', 'wsdl:types', 'wsdl:message', 'wsdl:portType', 'wsdl...
javascript
MIT
b6a27bc66c93946b93ea736674830f700dbccb6e
2026-01-04T14:59:20.022123Z
false
usebruno/bruno
https://github.com/usebruno/bruno/blob/b6a27bc66c93946b93ea736674830f700dbccb6e/packages/bruno-app/src/utils/importers/insomnia-collection.js
packages/bruno-app/src/utils/importers/insomnia-collection.js
import { BrunoError } from 'utils/common/error'; import { insomniaToBruno } from '@usebruno/converters'; export const convertInsomniaToBruno = (data) => { try { return insomniaToBruno(data); } catch (err) { console.error('Error converting Insomnia to Bruno:', err); throw new BrunoError('Import collecti...
javascript
MIT
b6a27bc66c93946b93ea736674830f700dbccb6e
2026-01-04T14:59:20.022123Z
false
usebruno/bruno
https://github.com/usebruno/bruno/blob/b6a27bc66c93946b93ea736674830f700dbccb6e/packages/bruno-app/src/utils/tests/collections/grpc-export-import.spec.js
packages/bruno-app/src/utils/tests/collections/grpc-export-import.spec.js
import { transformCollectionToSaveToExportAsFile, transformRequestToSaveToFilesystem } from '../../collections/index'; import { transformItemsInCollection } from '../../importers/common'; describe('gRPC Export/Import', () => { describe('transformCollectionToSaveToExportAsFile', () => { it('should preserve gRPC-s...
javascript
MIT
b6a27bc66c93946b93ea736674830f700dbccb6e
2026-01-04T14:59:20.022123Z
false
usebruno/bruno
https://github.com/usebruno/bruno/blob/b6a27bc66c93946b93ea736674830f700dbccb6e/packages/bruno-app/src/utils/tests/collections/items-sequencing.spec.js
packages/bruno-app/src/utils/tests/collections/items-sequencing.spec.js
import { resetSequencesInFolder, isItemBetweenSequences } from 'utils/collections/index'; describe('resetSequencesInFolder', () => { it('should fix the sequences in the folder 1', () => { const folder = { items: [ { uid: '1', seq: 1 }, { uid: '2', seq: 3 }, { uid: '3', seq: 6 } ...
javascript
MIT
b6a27bc66c93946b93ea736674830f700dbccb6e
2026-01-04T14:59:20.022123Z
false
usebruno/bruno
https://github.com/usebruno/bruno/blob/b6a27bc66c93946b93ea736674830f700dbccb6e/packages/bruno-app/src/utils/tests/collections/examples-export-import.spec.js
packages/bruno-app/src/utils/tests/collections/examples-export-import.spec.js
import { transformCollectionToSaveToExportAsFile, transformRequestToSaveToFilesystem } from '../../collections/index'; import { transformItemsInCollection } from '../../importers/common'; import { deleteUidsInItems, transformItem } from '../../collections/export'; describe('Examples Export/Import', () => { describe(...
javascript
MIT
b6a27bc66c93946b93ea736674830f700dbccb6e
2026-01-04T14:59:20.022123Z
false
usebruno/bruno
https://github.com/usebruno/bruno/blob/b6a27bc66c93946b93ea736674830f700dbccb6e/packages/bruno-app/src/utils/exporters/bruno-environment.js
packages/bruno-app/src/utils/exporters/bruno-environment.js
import { buildEnvVariable } from 'utils/environments'; export const exportBrunoEnvironment = async ({ environments, environmentType, filePath, exportFormat = 'folder' }) => { try { const { ipcRenderer } = window; let cleanEnvironments = environments.map((environment) => ({ name: environment.name, ...
javascript
MIT
b6a27bc66c93946b93ea736674830f700dbccb6e
2026-01-04T14:59:20.022123Z
false
usebruno/bruno
https://github.com/usebruno/bruno/blob/b6a27bc66c93946b93ea736674830f700dbccb6e/packages/bruno-app/src/utils/exporters/openapi-spec.js
packages/bruno-app/src/utils/exporters/openapi-spec.js
import jsyaml from 'js-yaml'; import { interpolate } from '@usebruno/common'; import { isValidUrl } from 'utils/url/index'; const xml2js = require('xml2js'); export const exportApiSpec = ({ variables, items, name }) => { items = items.filter((item) => !['grpc-request'].includes(item.type)); const components = { ...
javascript
MIT
b6a27bc66c93946b93ea736674830f700dbccb6e
2026-01-04T14:59:20.022123Z
false
usebruno/bruno
https://github.com/usebruno/bruno/blob/b6a27bc66c93946b93ea736674830f700dbccb6e/packages/bruno-app/src/utils/exporters/opencollection.js
packages/bruno-app/src/utils/exporters/opencollection.js
import * as FileSaver from 'file-saver'; import jsyaml from 'js-yaml'; import { brunoToOpenCollection } from '@usebruno/converters'; import { sanitizeName } from 'utils/common/regex'; export const exportCollection = (collection, version) => { const openCollection = brunoToOpenCollection(collection); if (!openColl...
javascript
MIT
b6a27bc66c93946b93ea736674830f700dbccb6e
2026-01-04T14:59:20.022123Z
false
usebruno/bruno
https://github.com/usebruno/bruno/blob/b6a27bc66c93946b93ea736674830f700dbccb6e/packages/bruno-app/src/utils/exporters/postman-collection.js
packages/bruno-app/src/utils/exporters/postman-collection.js
import * as FileSaver from 'file-saver'; import { brunoToPostman } from '@usebruno/converters'; export const exportCollection = (collection) => { const collectionToExport = brunoToPostman(collection); const fileName = `${collection.name}.json`; const fileBlob = new Blob([JSON.stringify(collectionToExport, null,...
javascript
MIT
b6a27bc66c93946b93ea736674830f700dbccb6e
2026-01-04T14:59:20.022123Z
false
usebruno/bruno
https://github.com/usebruno/bruno/blob/b6a27bc66c93946b93ea736674830f700dbccb6e/packages/bruno-app/src/utils/idb/index.js
packages/bruno-app/src/utils/idb/index.js
export const saveCollectionToIdb = (connection, collection) => { return new Promise((resolve, reject) => { connection .then((db) => { let tx = db.transaction(`collection`, 'readwrite'); let collectionStore = tx.objectStore('collection'); collectionStore.put(collection); res...
javascript
MIT
b6a27bc66c93946b93ea736674830f700dbccb6e
2026-01-04T14:59:20.022123Z
false
usebruno/bruno
https://github.com/usebruno/bruno/blob/b6a27bc66c93946b93ea736674830f700dbccb6e/packages/bruno-app/src/utils/codegenerator/har.js
packages/bruno-app/src/utils/codegenerator/har.js
const createContentType = (mode) => { switch (mode) { case 'json': return 'application/json'; case 'text': return 'text/plain'; case 'xml': return 'application/xml'; case 'sparql': return 'application/sparql-query'; case 'formUrlEncoded': return 'application/x-www-for...
javascript
MIT
b6a27bc66c93946b93ea736674830f700dbccb6e
2026-01-04T14:59:20.022123Z
false
usebruno/bruno
https://github.com/usebruno/bruno/blob/b6a27bc66c93946b93ea736674830f700dbccb6e/packages/bruno-app/src/utils/codegenerator/auth.js
packages/bruno-app/src/utils/codegenerator/auth.js
import get from 'lodash/get'; export const getAuthHeaders = (collectionRootAuth, requestAuth) => { // Discovered edge case where code generation fails when you create a collection which has not been saved yet: // Collection auth therefore null, and request inherits from collection, therefore it is also null // T...
javascript
MIT
b6a27bc66c93946b93ea736674830f700dbccb6e
2026-01-04T14:59:20.022123Z
false
usebruno/bruno
https://github.com/usebruno/bruno/blob/b6a27bc66c93946b93ea736674830f700dbccb6e/packages/bruno-app/src/utils/codegenerator/targets.js
packages/bruno-app/src/utils/codegenerator/targets.js
import { targets } from 'httpsnippet'; export const getLanguages = () => { const allLanguages = []; for (const target of Object.values(targets)) { const { key, title } = target.info; const clients = Object.keys(target.clientsById); const languages = (clients.length === 1) ? [{ ...
javascript
MIT
b6a27bc66c93946b93ea736674830f700dbccb6e
2026-01-04T14:59:20.022123Z
false
usebruno/bruno
https://github.com/usebruno/bruno/blob/b6a27bc66c93946b93ea736674830f700dbccb6e/packages/bruno-app/src/utils/url/index.spec.js
packages/bruno-app/src/utils/url/index.spec.js
import { splitOnFirst, parsePathParams, interpolateUrl, interpolateUrlPathParams } from './index'; describe('Url Utils - parsePathParams', () => { it('should parse path - case 1', () => { const params = parsePathParams('www.example.com'); expect(params).toEqual([]); }); it('should parse path - case 2', ...
javascript
MIT
b6a27bc66c93946b93ea736674830f700dbccb6e
2026-01-04T14:59:20.022123Z
false
usebruno/bruno
https://github.com/usebruno/bruno/blob/b6a27bc66c93946b93ea736674830f700dbccb6e/packages/bruno-app/src/utils/url/index.js
packages/bruno-app/src/utils/url/index.js
import find from 'lodash/find'; import { interpolate } from '@usebruno/common'; const hasLength = (str) => { if (!str || !str.length) { return false; } str = str.trim(); return str.length > 0; }; export const parsePathParams = (url) => { let uri = url.slice(); if (!uri || !uri.length) { return...
javascript
MIT
b6a27bc66c93946b93ea736674830f700dbccb6e
2026-01-04T14:59:20.022123Z
false
usebruno/bruno
https://github.com/usebruno/bruno/blob/b6a27bc66c93946b93ea736674830f700dbccb6e/packages/bruno-app/src/utils/common/index.spec.js
packages/bruno-app/src/utils/common/index.spec.js
const { describe, it, expect } = require('@jest/globals'); import { normalizeFileName, startsWith, humanizeDate, relativeDate, getContentType, formatSize, prettifyJsonString } from './index'; describe('common utils', () => { describe('normalizeFileName', () => { it('should remove special character...
javascript
MIT
b6a27bc66c93946b93ea736674830f700dbccb6e
2026-01-04T14:59:20.022123Z
false
usebruno/bruno
https://github.com/usebruno/bruno/blob/b6a27bc66c93946b93ea736674830f700dbccb6e/packages/bruno-app/src/utils/common/codemirror.js
packages/bruno-app/src/utils/common/codemirror.js
import get from 'lodash/get'; import { mockDataFunctions } from '@usebruno/common'; import { PROMPT_VARIABLE_TEXT_PATTERN } from '@usebruno/common/utils'; const CodeMirror = require('codemirror'); const pathFoundInVariables = (path, obj) => { const value = get(obj, path); return value !== undefined; }; /** * De...
javascript
MIT
b6a27bc66c93946b93ea736674830f700dbccb6e
2026-01-04T14:59:20.022123Z
false
usebruno/bruno
https://github.com/usebruno/bruno/blob/b6a27bc66c93946b93ea736674830f700dbccb6e/packages/bruno-app/src/utils/common/setupPolyfills.js
packages/bruno-app/src/utils/common/setupPolyfills.js
export const setupPolyfills = () => { // polyfill required to make react-pdf if (typeof Promise.withResolvers === 'undefined') { if (typeof window !== 'undefined') { window.Promise.withResolvers = function () { let resolve, reject; const promise = new Promise((res, rej) => { reso...
javascript
MIT
b6a27bc66c93946b93ea736674830f700dbccb6e
2026-01-04T14:59:20.022123Z
false
usebruno/bruno
https://github.com/usebruno/bruno/blob/b6a27bc66c93946b93ea736674830f700dbccb6e/packages/bruno-app/src/utils/common/regex.spec.js
packages/bruno-app/src/utils/common/regex.spec.js
const { describe, it, expect } = require('@jest/globals'); import { sanitizeName, validateName } from './regex'; describe('regex validators', () => { describe('sanitize name', () => { it('should remove invalid characters', () => { expect(sanitizeName('hello world')).toBe('hello world'); expect(sanit...
javascript
MIT
b6a27bc66c93946b93ea736674830f700dbccb6e
2026-01-04T14:59:20.022123Z
false
usebruno/bruno
https://github.com/usebruno/bruno/blob/b6a27bc66c93946b93ea736674830f700dbccb6e/packages/bruno-app/src/utils/common/folders-requests-sorting.spec.js
packages/bruno-app/src/utils/common/folders-requests-sorting.spec.js
const { describe, it, expect } = require('@jest/globals'); const { sortByNameThenSequence } = require('./index'); describe('sortByNameThenSequence', () => { describe('Basic functionality', () => { it('should return an empty array when given an empty array', () => { const items = []; const result = so...
javascript
MIT
b6a27bc66c93946b93ea736674830f700dbccb6e
2026-01-04T14:59:20.022123Z
false
usebruno/bruno
https://github.com/usebruno/bruno/blob/b6a27bc66c93946b93ea736674830f700dbccb6e/packages/bruno-app/src/utils/common/platform.js
packages/bruno-app/src/utils/common/platform.js
import trim from 'lodash/trim'; import platform from 'platform'; import path from './path'; export const isElectron = () => { if (!window) { return false; } return window.ipcRenderer ? true : false; }; export const resolveRequestFilename = (name, extension = 'bru') => { return `${trim(name)}.${extension}...
javascript
MIT
b6a27bc66c93946b93ea736674830f700dbccb6e
2026-01-04T14:59:20.022123Z
false
usebruno/bruno
https://github.com/usebruno/bruno/blob/b6a27bc66c93946b93ea736674830f700dbccb6e/packages/bruno-app/src/utils/common/index.js
packages/bruno-app/src/utils/common/index.js
import { customAlphabet } from 'nanoid'; import xmlFormat from 'xml-formatter'; import { JSONPath } from 'jsonpath-plus'; import fastJsonFormat from 'fast-json-format'; import { format, applyEdits } from 'jsonc-parser'; import { patternHasher } from '@usebruno/common/utils'; import prettierFormat from 'prettier/standal...
javascript
MIT
b6a27bc66c93946b93ea736674830f700dbccb6e
2026-01-04T14:59:20.022123Z
false
usebruno/bruno
https://github.com/usebruno/bruno/blob/b6a27bc66c93946b93ea736674830f700dbccb6e/packages/bruno-app/src/utils/common/error.js
packages/bruno-app/src/utils/common/error.js
import toast from 'react-hot-toast'; // levels: 'warning, error' export class BrunoError extends Error { constructor(message, level) { super(message); this.name = 'BrunoError'; this.level = level || 'error'; } } export const parseError = (error, defaultErrorMsg = 'An error occurred') => { if (error ...
javascript
MIT
b6a27bc66c93946b93ea736674830f700dbccb6e
2026-01-04T14:59:20.022123Z
false
usebruno/bruno
https://github.com/usebruno/bruno/blob/b6a27bc66c93946b93ea736674830f700dbccb6e/packages/bruno-app/src/utils/common/masked-editor.js
packages/bruno-app/src/utils/common/masked-editor.js
/** * MaskedEditor - A robust, multiline-capable masking system for CodeMirror editors * * OVERVIEW: * This implementation provides flawless masking of sensitive content with proper * multiline support, error handling, and memory management. It replaces visible * characters with mask characters while preserving t...
javascript
MIT
b6a27bc66c93946b93ea736674830f700dbccb6e
2026-01-04T14:59:20.022123Z
false
usebruno/bruno
https://github.com/usebruno/bruno/blob/b6a27bc66c93946b93ea736674830f700dbccb6e/packages/bruno-app/src/utils/common/constants.js
packages/bruno-app/src/utils/common/constants.js
export const REQUEST_TYPES = ['http-request', 'graphql-request', 'grpc-request', 'ws-request'];
javascript
MIT
b6a27bc66c93946b93ea736674830f700dbccb6e
2026-01-04T14:59:20.022123Z
false
usebruno/bruno
https://github.com/usebruno/bruno/blob/b6a27bc66c93946b93ea736674830f700dbccb6e/packages/bruno-app/src/utils/common/path.windows.spec.js
packages/bruno-app/src/utils/common/path.windows.spec.js
// Mock platform module for Windows before importing path utilities jest.mock('platform', () => ({ os: { family: 'Windows' } })); import { getRelativePath, getBasename, getAbsoluteFilePath } from './path'; describe('Path Utilities - Windows Platform', () => { describe('getRelativePath', () => { it('shou...
javascript
MIT
b6a27bc66c93946b93ea736674830f700dbccb6e
2026-01-04T14:59:20.022123Z
false
usebruno/bruno
https://github.com/usebruno/bruno/blob/b6a27bc66c93946b93ea736674830f700dbccb6e/packages/bruno-app/src/utils/common/format-response.spec.js
packages/bruno-app/src/utils/common/format-response.spec.js
import { formatResponse } from './index'; describe('formatResponse', () => { const createBase64Buffer = (content) => Buffer.from(content).toString('base64'); const createLargeBase64Buffer = (data) => { // Create buffer from the actual data without modification const content = typeof data === 'string' ? dat...
javascript
MIT
b6a27bc66c93946b93ea736674830f700dbccb6e
2026-01-04T14:59:20.022123Z
false
usebruno/bruno
https://github.com/usebruno/bruno/blob/b6a27bc66c93946b93ea736674830f700dbccb6e/packages/bruno-app/src/utils/common/bulkKeyValueUtils.js
packages/bruno-app/src/utils/common/bulkKeyValueUtils.js
export function parseBulkKeyValue(value) { return value .split(/\r?\n/) .map((pair) => { const isEnabled = !pair.trim().startsWith('//'); const cleanPair = pair.replace(/^\/\/\s*/, ''); const sep = cleanPair.indexOf(':'); if (sep < 0) return null; return { name: cleanPair...
javascript
MIT
b6a27bc66c93946b93ea736674830f700dbccb6e
2026-01-04T14:59:20.022123Z
false
usebruno/bruno
https://github.com/usebruno/bruno/blob/b6a27bc66c93946b93ea736674830f700dbccb6e/packages/bruno-app/src/utils/common/ipc.js
packages/bruno-app/src/utils/common/ipc.js
/** * Wrapper for ipcRenderer.invoke that handles error cases * @param {string} channel - The IPC channel name * @param {...any} args - Arguments to pass to the channel * @returns {Promise} - Resolves with the result or rejects with error */ export const callIpc = (channel, ...args) => { const { ipcRenderer } = ...
javascript
MIT
b6a27bc66c93946b93ea736674830f700dbccb6e
2026-01-04T14:59:20.022123Z
false
usebruno/bruno
https://github.com/usebruno/bruno/blob/b6a27bc66c93946b93ea736674830f700dbccb6e/packages/bruno-app/src/utils/common/regex.js
packages/bruno-app/src/utils/common/regex.js
const invalidCharacters = /[<>:"/\\|?*\x00-\x1F]/g; // replace invalid characters with hyphens const reservedDeviceNames = /^(CON|PRN|AUX|NUL|COM[0-9]|LPT[0-9])$/i; const firstCharacter = /^[^\s\-<>:"/\\|?*\x00-\x1F]/; // no space, hyphen and `invalidCharacters` const middleCharacters = /^[^<>:"/\\|?*\x00-\x1F]*$/; // ...
javascript
MIT
b6a27bc66c93946b93ea736674830f700dbccb6e
2026-01-04T14:59:20.022123Z
false
usebruno/bruno
https://github.com/usebruno/bruno/blob/b6a27bc66c93946b93ea736674830f700dbccb6e/packages/bruno-app/src/utils/common/path.spec.js
packages/bruno-app/src/utils/common/path.spec.js
// Mock platform module for Unix before importing path utilities jest.mock('platform', () => ({ os: { family: 'Unix' } })); import { getRelativePath, getBasename, getAbsoluteFilePath } from './path'; describe('Path Utilities - Unix Platform', () => { describe('getRelativePath', () => { it('should return...
javascript
MIT
b6a27bc66c93946b93ea736674830f700dbccb6e
2026-01-04T14:59:20.022123Z
false
usebruno/bruno
https://github.com/usebruno/bruno/blob/b6a27bc66c93946b93ea736674830f700dbccb6e/packages/bruno-app/src/utils/common/path.js
packages/bruno-app/src/utils/common/path.js
import platform from 'platform'; import path from 'path'; const isWindowsOS = () => { const os = platform.os; const osFamily = os.family.toLowerCase(); return osFamily.includes('windows'); }; /** * Cross-Platform Path Standardization for Bruno Configuration Files * * Bruno stores relative paths in configurat...
javascript
MIT
b6a27bc66c93946b93ea736674830f700dbccb6e
2026-01-04T14:59:20.022123Z
false
usebruno/bruno
https://github.com/usebruno/bruno/blob/b6a27bc66c93946b93ea736674830f700dbccb6e/packages/bruno-app/src/utils/collections/index.spec.js
packages/bruno-app/src/utils/collections/index.spec.js
const { describe, it, expect } = require('@jest/globals'); import { mergeHeaders } from './index'; describe('mergeHeaders', () => { it('should include headers from collection, folder and request (with correct precedence)', () => { const collection = { root: { request: { headers: [ ...
javascript
MIT
b6a27bc66c93946b93ea736674830f700dbccb6e
2026-01-04T14:59:20.022123Z
false
usebruno/bruno
https://github.com/usebruno/bruno/blob/b6a27bc66c93946b93ea736674830f700dbccb6e/packages/bruno-app/src/utils/collections/index.js
packages/bruno-app/src/utils/collections/index.js
import { cloneDeep, isEqual, sortBy, filter, map, isString, findIndex, find, each, get } from 'lodash'; import { uuid } from 'utils/common'; import { buildPersistedEnvVariables } from 'utils/environments'; import { sortByNameThenSequence } from 'utils/common/index'; import path from 'utils/common/path'; import { isRequ...
javascript
MIT
b6a27bc66c93946b93ea736674830f700dbccb6e
2026-01-04T14:59:20.022123Z
true
usebruno/bruno
https://github.com/usebruno/bruno/blob/b6a27bc66c93946b93ea736674830f700dbccb6e/packages/bruno-app/src/utils/collections/export.js
packages/bruno-app/src/utils/collections/export.js
import * as FileSaver from 'file-saver'; import get from 'lodash/get'; import each from 'lodash/each'; export const deleteUidsInItems = (items) => { each(items, (item) => { delete item.uid; if (['http-request', 'graphql-request', 'grpc-request'].includes(item.type)) { each(get(item, 'request.headers')...
javascript
MIT
b6a27bc66c93946b93ea736674830f700dbccb6e
2026-01-04T14:59:20.022123Z
false
usebruno/bruno
https://github.com/usebruno/bruno/blob/b6a27bc66c93946b93ea736674830f700dbccb6e/packages/bruno-app/src/utils/collections/search.js
packages/bruno-app/src/utils/collections/search.js
import { flattenItems, isItemARequest } from './index'; import filter from 'lodash/filter'; import find from 'lodash/find'; export const doesRequestMatchSearchText = (request, searchText = '') => { return request?.name?.toLowerCase().includes(searchText.toLowerCase()); }; export const doesFolderHaveItemsMatchSearch...
javascript
MIT
b6a27bc66c93946b93ea736674830f700dbccb6e
2026-01-04T14:59:20.022123Z
false
usebruno/bruno
https://github.com/usebruno/bruno/blob/b6a27bc66c93946b93ea736674830f700dbccb6e/packages/bruno-app/src/utils/tabs/index.js
packages/bruno-app/src/utils/tabs/index.js
import find from 'lodash/find'; export const isItemARequest = (item) => { return item.hasOwnProperty('request') && ['http-request', 'graphql-request', 'grpc-request', 'ws-request'].includes(item.type); }; export const isItemAFolder = (item) => { return !item.hasOwnProperty('request') && item.type === 'folder'; };...
javascript
MIT
b6a27bc66c93946b93ea736674830f700dbccb6e
2026-01-04T14:59:20.022123Z
false
usebruno/bruno
https://github.com/usebruno/bruno/blob/b6a27bc66c93946b93ea736674830f700dbccb6e/packages/bruno-app/src/utils/network/grpc-event-listeners.js
packages/bruno-app/src/utils/network/grpc-event-listeners.js
import { useEffect } from 'react'; import { grpcResponseReceived, runGrpcRequestEvent } from 'providers/ReduxStore/slices/collections/index'; import { useDispatch } from 'react-redux'; import { isElectron } from 'utils/common/platform'; import { updateActiveConnectionsInStore } from 'providers/ReduxStore/slices/collect...
javascript
MIT
b6a27bc66c93946b93ea736674830f700dbccb6e
2026-01-04T14:59:20.022123Z
false
usebruno/bruno
https://github.com/usebruno/bruno/blob/b6a27bc66c93946b93ea736674830f700dbccb6e/packages/bruno-app/src/utils/network/index.js
packages/bruno-app/src/utils/network/index.js
import cloneDeep from 'lodash/cloneDeep'; import { resolvePath } from 'utils/filesystem'; export const sendNetworkRequest = async (item, collection, environment, runtimeVariables) => { return new Promise((resolve, reject) => { if (['http-request', 'graphql-request'].includes(item.type)) { sendHttpRequest(i...
javascript
MIT
b6a27bc66c93946b93ea736674830f700dbccb6e
2026-01-04T14:59:20.022123Z
false
usebruno/bruno
https://github.com/usebruno/bruno/blob/b6a27bc66c93946b93ea736674830f700dbccb6e/packages/bruno-app/src/utils/network/cancelTokens.js
packages/bruno-app/src/utils/network/cancelTokens.js
// we maintain cancel tokens for a request separately as redux does not recommend to store // non-serializable value in the store const cancelTokens = {}; export default cancelTokens; export const saveCancelToken = (uid, axiosRequest) => { cancelTokens[uid] = axiosRequest; }; export const deleteCancelToken = (uid...
javascript
MIT
b6a27bc66c93946b93ea736674830f700dbccb6e
2026-01-04T14:59:20.022123Z
false
usebruno/bruno
https://github.com/usebruno/bruno/blob/b6a27bc66c93946b93ea736674830f700dbccb6e/packages/bruno-app/src/utils/network/ws-event-listeners.js
packages/bruno-app/src/utils/network/ws-event-listeners.js
import { useEffect } from 'react'; import { wsResponseReceived, runWsRequestEvent } from 'providers/ReduxStore/slices/collections/index'; import { useDispatch } from 'react-redux'; import { isElectron } from 'utils/common/platform'; import { updateActiveConnectionsInStore } from 'providers/ReduxStore/slices/collections...
javascript
MIT
b6a27bc66c93946b93ea736674830f700dbccb6e
2026-01-04T14:59:20.022123Z
false
usebruno/bruno
https://github.com/usebruno/bruno/blob/b6a27bc66c93946b93ea736674830f700dbccb6e/packages/bruno-app/src/utils/workspaces/index.js
packages/bruno-app/src/utils/workspaces/index.js
// Utility functions for workspace pinning and reordering export const sortWorkspaces = (workspaces, preferences) => { const pinnedUids = preferences?.workspaces?.pinnedWorkspaceUids || []; const pinnedOrder = preferences?.workspaces?.pinnedOrder || []; const unpinnedOrder = preferences?.workspaces?.unpinnedOrde...
javascript
MIT
b6a27bc66c93946b93ea736674830f700dbccb6e
2026-01-04T14:59:20.022123Z
false
usebruno/bruno
https://github.com/usebruno/bruno/blob/b6a27bc66c93946b93ea736674830f700dbccb6e/packages/bruno-app/src/utils/response/index.js
packages/bruno-app/src/utils/response/index.js
// Normalize & extract MIME type from full header const extractMimeType = (contentType = '') => { const cleaned = String(contentType).trim().toLowerCase(); const match = cleaned.match(/^[^;]+/); // strip "; charset=utf-8" return match ? match[0] : cleaned; }; export const getDefaultResponseFormat = (contentType)...
javascript
MIT
b6a27bc66c93946b93ea736674830f700dbccb6e
2026-01-04T14:59:20.022123Z
false
usebruno/bruno
https://github.com/usebruno/bruno/blob/b6a27bc66c93946b93ea736674830f700dbccb6e/packages/bruno-app/src/providers/ReduxStore/index.js
packages/bruno-app/src/providers/ReduxStore/index.js
import { configureStore } from '@reduxjs/toolkit'; import tasksMiddleware from './middlewares/tasks/middleware'; import debugMiddleware from './middlewares/debug/middleware'; import appReducer from './slices/app'; import collectionsReducer from './slices/collections'; import tabsReducer from './slices/tabs'; import wor...
javascript
MIT
b6a27bc66c93946b93ea736674830f700dbccb6e
2026-01-04T14:59:20.022123Z
false
usebruno/bruno
https://github.com/usebruno/bruno/blob/b6a27bc66c93946b93ea736674830f700dbccb6e/packages/bruno-app/src/providers/ReduxStore/slices/workspaceTabs.js
packages/bruno-app/src/providers/ReduxStore/slices/workspaceTabs.js
import { createSlice } from '@reduxjs/toolkit'; import filter from 'lodash/filter'; import find from 'lodash/find'; import last from 'lodash/last'; const initialState = { tabs: [], activeTabUid: null }; export const workspaceTabsSlice = createSlice({ name: 'workspaceTabs', initialState, reducers: { addW...
javascript
MIT
b6a27bc66c93946b93ea736674830f700dbccb6e
2026-01-04T14:59:20.022123Z
false
usebruno/bruno
https://github.com/usebruno/bruno/blob/b6a27bc66c93946b93ea736674830f700dbccb6e/packages/bruno-app/src/providers/ReduxStore/slices/tabs.js
packages/bruno-app/src/providers/ReduxStore/slices/tabs.js
import { createSlice } from '@reduxjs/toolkit'; import filter from 'lodash/filter'; import find from 'lodash/find'; import last from 'lodash/last'; // todo: errors should be tracked in each slice and displayed as toasts const initialState = { tabs: [], activeTabUid: null }; const tabTypeAlreadyExists = (tabs, co...
javascript
MIT
b6a27bc66c93946b93ea736674830f700dbccb6e
2026-01-04T14:59:20.022123Z
false
usebruno/bruno
https://github.com/usebruno/bruno/blob/b6a27bc66c93946b93ea736674830f700dbccb6e/packages/bruno-app/src/providers/ReduxStore/slices/logs.js
packages/bruno-app/src/providers/ReduxStore/slices/logs.js
import { createSlice } from '@reduxjs/toolkit'; const initialState = { logs: [], debugErrors: [], isConsoleOpen: false, activeTab: 'console', filters: { info: true, warn: true, error: true, debug: true, log: true }, networkFilters: { GET: true, POST: true, PUT: true, D...
javascript
MIT
b6a27bc66c93946b93ea736674830f700dbccb6e
2026-01-04T14:59:20.022123Z
false
usebruno/bruno
https://github.com/usebruno/bruno/blob/b6a27bc66c93946b93ea736674830f700dbccb6e/packages/bruno-app/src/providers/ReduxStore/slices/performance.js
packages/bruno-app/src/providers/ReduxStore/slices/performance.js
import { createSlice } from '@reduxjs/toolkit'; const initialState = { systemResources: { cpu: 0, memory: 0, pid: null, uptime: 0, lastUpdated: null } }; export const performanceSlice = createSlice({ name: 'performance', initialState, reducers: { updateSystemResources: (state, action...
javascript
MIT
b6a27bc66c93946b93ea736674830f700dbccb6e
2026-01-04T14:59:20.022123Z
false
usebruno/bruno
https://github.com/usebruno/bruno/blob/b6a27bc66c93946b93ea736674830f700dbccb6e/packages/bruno-app/src/providers/ReduxStore/slices/global-environments.js
packages/bruno-app/src/providers/ReduxStore/slices/global-environments.js
import { createSlice } from '@reduxjs/toolkit'; import { uuid } from 'utils/common/index'; import { environmentSchema } from '@usebruno/schema'; import { cloneDeep, has } from 'lodash'; const initialState = { globalEnvironments: [], activeGlobalEnvironmentUid: null, globalEnvironmentDraft: null }; export const ...
javascript
MIT
b6a27bc66c93946b93ea736674830f700dbccb6e
2026-01-04T14:59:20.022123Z
false
usebruno/bruno
https://github.com/usebruno/bruno/blob/b6a27bc66c93946b93ea736674830f700dbccb6e/packages/bruno-app/src/providers/ReduxStore/slices/notifications.spec.js
packages/bruno-app/src/providers/ReduxStore/slices/notifications.spec.js
const { filterNotificationsByVersion } = require('./notifications'); describe('filterNotificationsByVersion - basic', () => { it('should filter notifications by version', () => { const notifications = [{ minVersion: '1.0.0', maxVersion: '1.1.0' }]; const currentVersion = '1.0.5'; const filteredNotificati...
javascript
MIT
b6a27bc66c93946b93ea736674830f700dbccb6e
2026-01-04T14:59:20.022123Z
false
usebruno/bruno
https://github.com/usebruno/bruno/blob/b6a27bc66c93946b93ea736674830f700dbccb6e/packages/bruno-app/src/providers/ReduxStore/slices/notifications.js
packages/bruno-app/src/providers/ReduxStore/slices/notifications.js
import toast from 'react-hot-toast'; import { createSlice } from '@reduxjs/toolkit'; import { getAppInstallDate } from 'utils/common/platform'; import semver from 'semver'; const getReadNotificationIds = () => { try { let readNotificationIdsString = window.localStorage.getItem('bruno.notifications.read'); let...
javascript
MIT
b6a27bc66c93946b93ea736674830f700dbccb6e
2026-01-04T14:59:20.022123Z
false
usebruno/bruno
https://github.com/usebruno/bruno/blob/b6a27bc66c93946b93ea736674830f700dbccb6e/packages/bruno-app/src/providers/ReduxStore/slices/app.js
packages/bruno-app/src/providers/ReduxStore/slices/app.js
import { createSlice } from '@reduxjs/toolkit'; import filter from 'lodash/filter'; import brunoClipboard from 'utils/bruno-clipboard'; import { addTab, focusTab } from './tabs'; const initialState = { isDragging: false, idbConnectionReady: false, leftSidebarWidth: 250, sidebarCollapsed: false, screenWidth: ...
javascript
MIT
b6a27bc66c93946b93ea736674830f700dbccb6e
2026-01-04T14:59:20.022123Z
false
usebruno/bruno
https://github.com/usebruno/bruno/blob/b6a27bc66c93946b93ea736674830f700dbccb6e/packages/bruno-app/src/providers/ReduxStore/slices/apiSpec.js
packages/bruno-app/src/providers/ReduxStore/slices/apiSpec.js
import { createSlice } from '@reduxjs/toolkit'; import { find } from 'lodash'; import toast from 'react-hot-toast'; const initialState = { apiSpecs: [], activeApiSpecUid: null }; export const apiSpecSlice = createSlice({ name: 'apiSpec', initialState, reducers: { apiSpecAddFileEvent: (state, action) => ...
javascript
MIT
b6a27bc66c93946b93ea736674830f700dbccb6e
2026-01-04T14:59:20.022123Z
false
usebruno/bruno
https://github.com/usebruno/bruno/blob/b6a27bc66c93946b93ea736674830f700dbccb6e/packages/bruno-app/src/providers/ReduxStore/slices/collections/exampleReducers.js
packages/bruno-app/src/providers/ReduxStore/slices/collections/exampleReducers.js
import { find, map, filter, cloneDeep, each, concat } from 'lodash'; import { parseQueryParams, buildQueryString as stringifyQueryParams } from '@usebruno/common/utils'; import { uuid } from 'utils/common'; import { findCollectionByUid, findItemInCollection } from 'utils/collections'; import { parsePathParams, splitOnF...
javascript
MIT
b6a27bc66c93946b93ea736674830f700dbccb6e
2026-01-04T14:59:20.022123Z
true
usebruno/bruno
https://github.com/usebruno/bruno/blob/b6a27bc66c93946b93ea736674830f700dbccb6e/packages/bruno-app/src/providers/ReduxStore/slices/collections/index.js
packages/bruno-app/src/providers/ReduxStore/slices/collections/index.js
import { parseQueryParams, buildQueryString as stringifyQueryParams } from '@usebruno/common/utils'; import { uuid } from 'utils/common'; import { find, map, forOwn, concat, filter, each, cloneDeep, get, set, findIndex } from 'lodash'; import { createSlice } from '@reduxjs/toolkit'; import { hexy as hexdump } from 'hex...
javascript
MIT
b6a27bc66c93946b93ea736674830f700dbccb6e
2026-01-04T14:59:20.022123Z
true
usebruno/bruno
https://github.com/usebruno/bruno/blob/b6a27bc66c93946b93ea736674830f700dbccb6e/packages/bruno-app/src/providers/ReduxStore/slices/collections/actions.js
packages/bruno-app/src/providers/ReduxStore/slices/collections/actions.js
import { collectionSchema, environmentSchema, itemSchema } from '@usebruno/schema'; import { parseQueryParams, extractPromptVariables } from '@usebruno/common/utils'; import { REQUEST_TYPES } from 'utils/common/constants'; import cloneDeep from 'lodash/cloneDeep'; import filter from 'lodash/filter'; import find from 'l...
javascript
MIT
b6a27bc66c93946b93ea736674830f700dbccb6e
2026-01-04T14:59:20.022123Z
true
usebruno/bruno
https://github.com/usebruno/bruno/blob/b6a27bc66c93946b93ea736674830f700dbccb6e/packages/bruno-app/src/providers/ReduxStore/slices/workspaces/index.js
packages/bruno-app/src/providers/ReduxStore/slices/workspaces/index.js
import { createSlice } from '@reduxjs/toolkit'; import { normalizePath } from 'utils/common/path'; const DEFAULT_WORKSPACE_UID = 'default'; const initialState = { workspaces: [], activeWorkspaceUid: DEFAULT_WORKSPACE_UID }; export const workspacesSlice = createSlice({ name: 'workspaces', initialState, redu...
javascript
MIT
b6a27bc66c93946b93ea736674830f700dbccb6e
2026-01-04T14:59:20.022123Z
false
usebruno/bruno
https://github.com/usebruno/bruno/blob/b6a27bc66c93946b93ea736674830f700dbccb6e/packages/bruno-app/src/providers/ReduxStore/slices/workspaces/actions.js
packages/bruno-app/src/providers/ReduxStore/slices/workspaces/actions.js
import path from 'path'; import { createWorkspace, removeWorkspace, setActiveWorkspace, updateWorkspace, addCollectionToWorkspace, removeCollectionFromWorkspace, updateWorkspaceLoadingState } from '../workspaces'; import { showHomePage } from '../app'; import { createCollection, openCollection, openMultip...
javascript
MIT
b6a27bc66c93946b93ea736674830f700dbccb6e
2026-01-04T14:59:20.022123Z
false
usebruno/bruno
https://github.com/usebruno/bruno/blob/b6a27bc66c93946b93ea736674830f700dbccb6e/packages/bruno-app/src/providers/ReduxStore/middlewares/tasks/middleware.js
packages/bruno-app/src/providers/ReduxStore/middlewares/tasks/middleware.js
import get from 'lodash/get'; import each from 'lodash/each'; import filter from 'lodash/filter'; import { createListenerMiddleware } from '@reduxjs/toolkit'; import { removeTaskFromQueue } from 'providers/ReduxStore/slices/app'; import { addTab } from 'providers/ReduxStore/slices/tabs'; import { collectionAddFileEvent...
javascript
MIT
b6a27bc66c93946b93ea736674830f700dbccb6e
2026-01-04T14:59:20.022123Z
false
usebruno/bruno
https://github.com/usebruno/bruno/blob/b6a27bc66c93946b93ea736674830f700dbccb6e/packages/bruno-app/src/providers/ReduxStore/middlewares/tasks/utils.js
packages/bruno-app/src/providers/ReduxStore/middlewares/tasks/utils.js
export const taskTypes = { OPEN_REQUEST: 'OPEN_REQUEST', OPEN_EXAMPLE: 'OPEN_EXAMPLE' };
javascript
MIT
b6a27bc66c93946b93ea736674830f700dbccb6e
2026-01-04T14:59:20.022123Z
false
usebruno/bruno
https://github.com/usebruno/bruno/blob/b6a27bc66c93946b93ea736674830f700dbccb6e/packages/bruno-app/src/providers/ReduxStore/middlewares/draft/middleware.js
packages/bruno-app/src/providers/ReduxStore/middlewares/draft/middleware.js
import { handleMakeTabParmanent } from './utils'; const actionsToIntercept = [ // Request-level actions 'collections/requestUrlChanged', 'collections/updateAuth', 'collections/addQueryParam', 'collections/moveQueryParam', 'collections/updateQueryParam', 'collections/deleteQueryParam', 'collections/setQ...
javascript
MIT
b6a27bc66c93946b93ea736674830f700dbccb6e
2026-01-04T14:59:20.022123Z
false
usebruno/bruno
https://github.com/usebruno/bruno/blob/b6a27bc66c93946b93ea736674830f700dbccb6e/packages/bruno-app/src/providers/ReduxStore/middlewares/draft/utils.js
packages/bruno-app/src/providers/ReduxStore/middlewares/draft/utils.js
import { makeTabPermanent } from 'providers/ReduxStore/slices/tabs'; import { findCollectionByUid, findItemInCollection } from 'utils/collections/index'; import find from 'lodash/find'; function handleMakeTabParmanent(state, action, dispatch) { const tabs = state.tabs.tabs; const activeTabUid = state.tabs.activeTa...
javascript
MIT
b6a27bc66c93946b93ea736674830f700dbccb6e
2026-01-04T14:59:20.022123Z
false
usebruno/bruno
https://github.com/usebruno/bruno/blob/b6a27bc66c93946b93ea736674830f700dbccb6e/packages/bruno-app/src/providers/ReduxStore/middlewares/debug/middleware.js
packages/bruno-app/src/providers/ReduxStore/middlewares/debug/middleware.js
import { createListenerMiddleware } from '@reduxjs/toolkit'; const debugMiddleware = createListenerMiddleware(); debugMiddleware.startListening({ predicate: () => true, // it'll track every change effect: (action, listenerApi) => { console.debug('---redux action---'); console.debug('action', action.type);...
javascript
MIT
b6a27bc66c93946b93ea736674830f700dbccb6e
2026-01-04T14:59:20.022123Z
false
usebruno/bruno
https://github.com/usebruno/bruno/blob/b6a27bc66c93946b93ea736674830f700dbccb6e/packages/bruno-app/src/providers/ReduxStore/middlewares/autosave/middleware.js
packages/bruno-app/src/providers/ReduxStore/middlewares/autosave/middleware.js
import { saveRequest, saveCollectionSettings, saveFolderRoot } from '../../slices/collections/actions'; import { flattenItems, isItemARequest, isItemAFolder } from 'utils/collections'; const actionsToIntercept = [ // Request-level actions 'collections/requestUrlChanged', 'collections/updateAuth', 'collections/...
javascript
MIT
b6a27bc66c93946b93ea736674830f700dbccb6e
2026-01-04T14:59:20.022123Z
false
usebruno/bruno
https://github.com/usebruno/bruno/blob/b6a27bc66c93946b93ea736674830f700dbccb6e/packages/bruno-app/src/providers/Theme/index.js
packages/bruno-app/src/providers/Theme/index.js
import React from 'react'; import { Validator } from 'jsonschema'; import toast from 'react-hot-toast'; import themes from 'themes/index'; import themeSchema from 'themes/schema'; import useLocalStorage from 'hooks/useLocalStorage/index'; import { createContext, useContext, useEffect, useState, useMemo } from 'react';...
javascript
MIT
b6a27bc66c93946b93ea736674830f700dbccb6e
2026-01-04T14:59:20.022123Z
false
usebruno/bruno
https://github.com/usebruno/bruno/blob/b6a27bc66c93946b93ea736674830f700dbccb6e/packages/bruno-app/src/providers/PromptVariables/index.js
packages/bruno-app/src/providers/PromptVariables/index.js
import PromptVariablesModal from 'components/RequestPane/PromptVariables/PromptVariablesModal'; import React, { createContext, useCallback, useState } from 'react'; const PromptVariablesContext = createContext(); export function PromptVariablesProvider({ children }) { const [modalState, setModalState] = useState({ ...
javascript
MIT
b6a27bc66c93946b93ea736674830f700dbccb6e
2026-01-04T14:59:20.022123Z
false
usebruno/bruno
https://github.com/usebruno/bruno/blob/b6a27bc66c93946b93ea736674830f700dbccb6e/packages/bruno-app/src/providers/Toaster/index.js
packages/bruno-app/src/providers/Toaster/index.js
import React from 'react'; import { Toaster } from 'react-hot-toast'; import { useTheme } from 'providers/Theme'; import { isPlaywright } from 'utils/common'; export const ToastContext = React.createContext(); export const ToastProvider = (props) => { const { theme, displayedTheme } = useTheme(); const toastOpti...
javascript
MIT
b6a27bc66c93946b93ea736674830f700dbccb6e
2026-01-04T14:59:20.022123Z
false
usebruno/bruno
https://github.com/usebruno/bruno/blob/b6a27bc66c93946b93ea736674830f700dbccb6e/packages/bruno-app/src/providers/Hotkeys/index.js
packages/bruno-app/src/providers/Hotkeys/index.js
import React, { useState, useEffect } from 'react'; import toast from 'react-hot-toast'; import find from 'lodash/find'; import Mousetrap from 'mousetrap'; import { useSelector, useDispatch } from 'react-redux'; import NetworkError from 'components/ResponsePane/NetworkError'; import NewRequest from 'components/Sidebar/...
javascript
MIT
b6a27bc66c93946b93ea736674830f700dbccb6e
2026-01-04T14:59:20.022123Z
false
usebruno/bruno
https://github.com/usebruno/bruno/blob/b6a27bc66c93946b93ea736674830f700dbccb6e/packages/bruno-app/src/providers/Hotkeys/keyMappings.js
packages/bruno-app/src/providers/Hotkeys/keyMappings.js
const KeyMapping = { save: { mac: 'command+s', windows: 'ctrl+s', name: 'Save' }, sendRequest: { mac: 'command+enter', windows: 'ctrl+enter', name: 'Send Request' }, editEnvironment: { mac: 'command+e', windows: 'ctrl+e', name: 'Edit Environment' }, newRequest: { mac: 'command+b', windows: 'ctrl+b', name: 'New ...
javascript
MIT
b6a27bc66c93946b93ea736674830f700dbccb6e
2026-01-04T14:59:20.022123Z
false
usebruno/bruno
https://github.com/usebruno/bruno/blob/b6a27bc66c93946b93ea736674830f700dbccb6e/packages/bruno-app/src/providers/App/index.js
packages/bruno-app/src/providers/App/index.js
import React, { useEffect } from 'react'; import { get } from 'lodash'; import { useDispatch } from 'react-redux'; import { refreshScreenWidth } from 'providers/ReduxStore/slices/app'; import ConfirmAppClose from './ConfirmAppClose'; import useIpcEvents from './useIpcEvents'; import useTelemetry from './useTelemetry'; ...
javascript
MIT
b6a27bc66c93946b93ea736674830f700dbccb6e
2026-01-04T14:59:20.022123Z
false