mirror of
https://github.com/Kong/insomnia.git
synced 2026-10-12 02:06:34 +00:00
chore: fix typos (#8929)
This commit is contained in:
@@ -52,7 +52,7 @@ g++ -lkernel32 -mwindows -c $CPP_DIR/final.cpp -o $CPP_DIR/insomnia.o
|
||||
echo "Linking Insomnia..."
|
||||
g++ -O2 -static -static-libgcc -static-libstdc++ -mwindows -lwinpthread $CPP_DIR/insomnia.o $CPP_DIR/res.o -o $DEST_EXE
|
||||
|
||||
echo "Secure wapper built successfully."
|
||||
echo "Secure wrapper built successfully."
|
||||
|
||||
if [ ! $BUILD_CONTEXT ]; then
|
||||
echo "Packaging distributables..."
|
||||
|
||||
@@ -51,29 +51,29 @@ export class PropertyBase {
|
||||
const parents: PropertyBase[] = [];
|
||||
|
||||
while (queue.length > 0) {
|
||||
const ancester = queue.shift();
|
||||
if (!ancester) {
|
||||
const ancestor = queue.shift();
|
||||
if (!ancestor) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// TODO: check options
|
||||
const cloned = clone(ancester);
|
||||
const cloned = clone(ancestor);
|
||||
const keepIterating = iterator(cloned);
|
||||
parents.push(cloned);
|
||||
if (!keepIterating) {
|
||||
break;
|
||||
}
|
||||
|
||||
const olderAncester = ancester.parent();
|
||||
if (olderAncester) {
|
||||
queue.push(olderAncester);
|
||||
const olderAncestor = ancestor.parent();
|
||||
if (olderAncestor) {
|
||||
queue.push(olderAncestor);
|
||||
}
|
||||
}
|
||||
|
||||
return parents;
|
||||
}
|
||||
|
||||
findInParents(property: string, customizer?: (ancester: PropertyBase) => boolean): PropertyBase | undefined {
|
||||
findInParents(property: string, customizer?: (ancestor: PropertyBase) => boolean): PropertyBase | undefined {
|
||||
const currentParent = this.parent();
|
||||
if (!currentParent) {
|
||||
return;
|
||||
@@ -82,12 +82,12 @@ export class PropertyBase {
|
||||
const queue: PropertyBase[] = [currentParent];
|
||||
|
||||
while (queue.length > 0) {
|
||||
const ancester = queue.shift();
|
||||
if (!ancester) {
|
||||
const ancestor = queue.shift();
|
||||
if (!ancestor) {
|
||||
continue;
|
||||
}
|
||||
|
||||
const cloned = clone(ancester);
|
||||
const cloned = clone(ancestor);
|
||||
const hasProperty = Object.keys(cloned.meta()).includes(property);
|
||||
if (!hasProperty) {
|
||||
// keep traversing until parent has the property
|
||||
@@ -105,9 +105,9 @@ export class PropertyBase {
|
||||
}
|
||||
}
|
||||
|
||||
const olderAncester = ancester.parent();
|
||||
if (olderAncester) {
|
||||
queue.push(olderAncester);
|
||||
const olderAncestor = ancestor.parent();
|
||||
if (olderAncestor) {
|
||||
queue.push(olderAncestor);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ resources:
|
||||
created: 1735021392123
|
||||
name: Base Environment
|
||||
data:
|
||||
from: global env with secert vault
|
||||
from: global env with secret vault
|
||||
dataPropertyOrder: null
|
||||
color: null
|
||||
isPrivate: false
|
||||
@@ -28,7 +28,7 @@ resources:
|
||||
kvPairData:
|
||||
- id: envPair_1eefc750fae74ab0870d8e77b31023f6
|
||||
name: from
|
||||
value: global env with secert vault
|
||||
value: global env with secret vault
|
||||
type: str
|
||||
enabled: true
|
||||
- id: envPair_c2edecbf93744867acae6b9846c2fb48
|
||||
|
||||
@@ -19,7 +19,7 @@ exports.default = async function (configuration) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Note: Avoid changing the lines bellow. Risk of breaking the windows code-signing process.
|
||||
// Note: Avoid changing the lines below. Risk of breaking the windows code-signing process.
|
||||
// Feedback loop > 15 mins. Requires a branch on origin, a PR, and a separate dummy release pipeline to test changes.
|
||||
// sslcom/codesigner-win has large image size (>1GB) and requires docker within windows-latest host.
|
||||
const rawPath = configuration.path.replace(/(\r\n|\n|\r)/gm, ''); // remove /n and other crap from path
|
||||
|
||||
@@ -120,7 +120,7 @@ export const database = {
|
||||
return database.update<T>(doc, false, patches);
|
||||
},
|
||||
|
||||
/** duplicate doc and its decendents recursively */
|
||||
/** duplicate doc and its descendents recursively */
|
||||
duplicate: async function <T extends BaseModel>(originalDoc: T, patch: Patch<T> = {}) {
|
||||
if (db._empty) {
|
||||
return _send<T>('duplicate', ...arguments);
|
||||
|
||||
@@ -274,7 +274,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine
|
||||
// no more to read
|
||||
::CloseHandle(outrd);
|
||||
|
||||
// wait for the process to finish (probably arlready done since the read
|
||||
// wait for the process to finish (probably already done since the read
|
||||
// handle is not readable)
|
||||
::WaitForSingleObject(pi.hProcess, INFINITE);
|
||||
|
||||
|
||||
@@ -56,7 +56,7 @@ const deleteSecret = async (key: string) => {
|
||||
const secretStorage = getElectronStorage();
|
||||
secretStorage.deleteItem(key);
|
||||
} catch (error) {
|
||||
console.error(`Can not delele secret ${error.toString()}`);
|
||||
console.error(`Can not delete secret ${error.toString()}`);
|
||||
return Promise.reject(error);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -445,7 +445,7 @@ const openWebSocketConnection = async (
|
||||
}
|
||||
};
|
||||
|
||||
// graphql ws protocl message handler. Refer: https://github.com/enisdenjo/graphql-ws/blob/master/PROTOCOL.md
|
||||
// graphql ws protocol message handler. Refer: https://github.com/enisdenjo/graphql-ws/blob/master/PROTOCOL.md
|
||||
const handleGraphQLWsMessage = (data: MessageEvent['data'], request: Request) => {
|
||||
const graphqlServerData = parseMessage(data);
|
||||
const graphqlServerDataType = graphqlServerData.type;
|
||||
@@ -467,7 +467,7 @@ const handleGraphQLWsMessage = (data: MessageEvent['data'], request: Request) =>
|
||||
});
|
||||
sendWebSocketEvent({ payload, requestId });
|
||||
} else if (graphqlServerDataType === MessageType.Error || graphqlServerDataType === MessageType.Complete) {
|
||||
// close connection if server responsed with error or complete
|
||||
// close connection if server responded with error or complete
|
||||
closeWebSocketConnection({ requestId });
|
||||
}
|
||||
};
|
||||
|
||||
@@ -119,7 +119,7 @@ export async function createHiddenBrowserWindow() {
|
||||
if (browserWindows.get('HiddenBrowserWindow')) {
|
||||
console.log('[main] closing hidden browser window');
|
||||
browserWindows.delete('HiddenBrowserWindow');
|
||||
// @TODO: This should be set when the window closed is event is emmited so it's guaranteed to be realiable
|
||||
// @TODO: This should be set when the window closed is event is emitted so it's guaranteed to be reliable
|
||||
// There might be other events we need to listen to also
|
||||
hiddenWindowIsBusy = false;
|
||||
}
|
||||
|
||||
@@ -108,7 +108,7 @@ export function getDataFromKVPair(kvPair: EnvironmentKvPairData[]) {
|
||||
};
|
||||
}
|
||||
|
||||
// mask vault environment varibale if necessary
|
||||
// mask vault environment variable if necessary
|
||||
export const maskVaultEnvironmentData = (environment: Environment) => {
|
||||
if (environment.isPrivate) {
|
||||
const { data, kvPairData } = environment;
|
||||
|
||||
@@ -1035,7 +1035,7 @@ describe('getSetCookiesFromResponseHeaders', () => {
|
||||
const headers = [{ name: 'Set-Cookie', value: 'monster' }];
|
||||
expect(getSetCookiesFromResponseHeaders(headers)).toEqual(['monster']);
|
||||
});
|
||||
it('gets two case-insenstive set-cookies', () => {
|
||||
it('gets two case-insensitive set-cookies', () => {
|
||||
const headers = [
|
||||
{ name: 'Set-Cookie', value: 'monster' },
|
||||
{ name: 'set-cookie', value: 'mash' },
|
||||
|
||||
@@ -363,7 +363,7 @@ export const tryToExecutePreRequestScript = async (
|
||||
|
||||
// savePatchesMadeByScript persists entities
|
||||
// The rule for the global environment:
|
||||
// - If no global environment is seleted, no operation
|
||||
// - If no global environment is selected, no operation
|
||||
// - If one global environment is selected, it persists content to the selected global environment (base or sub).
|
||||
export async function savePatchesMadeByScript(patches: {
|
||||
mutatedContext: TransformedExecuteScriptContext;
|
||||
|
||||
@@ -58,7 +58,7 @@ export function chunkArray<T>(arr: T[], chunkSize: number) {
|
||||
}
|
||||
|
||||
// Stage/Unstage
|
||||
// Staged items are about to be commited
|
||||
// Staged items are about to be committed
|
||||
// Unstaged items have changed compared to staged or not and can be staged
|
||||
//
|
||||
export class VCS {
|
||||
|
||||
@@ -246,7 +246,7 @@ export async function maskOrDecryptVaultDataIfNecessary(vaultEnvironmentData: an
|
||||
const isVaultEnabled = !!vaultSalt;
|
||||
if (isVaultEnabled && vaultKey) {
|
||||
const symmetricKey = (await decryptVaultKeyFromSession(vaultKey, true)) as JsonWebKey;
|
||||
// decrypt all secert values under vaultEnvironmentPath property in context
|
||||
// decrypt all secret values under vaultEnvironmentPath property in context
|
||||
Object.keys(vaultEnvironmentData).forEach(vaultContextKey => {
|
||||
const encryptedValue = vaultEnvironmentData[vaultContextKey];
|
||||
vaultEnvironmentData[vaultContextKey] = decryptSecretValue(encryptedValue, symmetricKey);
|
||||
@@ -256,7 +256,7 @@ export async function maskOrDecryptVaultDataIfNecessary(vaultEnvironmentData: an
|
||||
vaultEnvironmentData = {};
|
||||
}
|
||||
} else {
|
||||
// mask all secert values under vaultEnvironmentPath property in context
|
||||
// mask all secret values under vaultEnvironmentPath property in context
|
||||
Object.keys(vaultEnvironmentData).forEach(vaultContextKey => {
|
||||
vaultEnvironmentData[vaultContextKey] = vaultEnvironmentMaskValue;
|
||||
});
|
||||
@@ -279,7 +279,7 @@ export function extractNunjucksTagFromCoords(
|
||||
const range = textMarker.find() as MarkerRange;
|
||||
return {
|
||||
range,
|
||||
// @ts-expect-error __template shoule be property of nunjucks tag markText
|
||||
// @ts-expect-error __template should be property of nunjucks tag markText
|
||||
template: textMarker.__template || '',
|
||||
};
|
||||
}
|
||||
|
||||
+1
-1
@@ -130,7 +130,7 @@ export const EnvironmentKVEditor = ({ data, onChange, vaultKey = '', isPrivate =
|
||||
const changedItemIdx = kvPairs.findIndex(p => p.id === id);
|
||||
if (changedItemIdx !== -1) {
|
||||
const changedItem = kvPairs[changedItemIdx];
|
||||
// enable item since user modifies the item unless manual disbale it
|
||||
// enable item since user modifies the item unless manual disable it
|
||||
changedItem['enabled'] = true;
|
||||
changedItem[changedPropertyName] = newValue;
|
||||
// update value to emptfy object json string when switch to json type and current value is empty string
|
||||
|
||||
@@ -202,7 +202,7 @@ const HistoryViewWrapperComponentFactory = ({
|
||||
}
|
||||
console.log('[mock] Error: fetching logs from remote', { mockbinUrl, res });
|
||||
} catch (e) {
|
||||
// network erros will be managed by the upsert trigger, so we can ignore them here
|
||||
// network errors will be managed by the upsert trigger, so we can ignore them here
|
||||
console.log({ mockbinUrl, e });
|
||||
}
|
||||
}, [
|
||||
@@ -213,7 +213,7 @@ const HistoryViewWrapperComponentFactory = ({
|
||||
mockServer.useInsomniaCloud,
|
||||
userSession.id,
|
||||
]);
|
||||
// refetches logs whenever the path changes, or a response is recieved, or tenseconds elapses or history tab is click
|
||||
// refetches logs whenever the path changes, or a response is received, or tenseconds elapses or history tab is click
|
||||
// chatgpt: answer my called
|
||||
useInterval(() => {
|
||||
fetchLogs();
|
||||
|
||||
+2
-2
@@ -47,7 +47,7 @@ describe('test generate table preview data ', () => {
|
||||
[1, 2, 3],
|
||||
null,
|
||||
];
|
||||
// @ts-expect-error test inalid input
|
||||
// @ts-expect-error test invalid input
|
||||
const { data, headers } = genPreviewTableData(uploadData);
|
||||
expect(headers).toEqual(['position', 'value']);
|
||||
expect(data).toEqual([
|
||||
@@ -60,7 +60,7 @@ describe('test generate table preview data ', () => {
|
||||
|
||||
it('test invalid json input', () => {
|
||||
const uploadData = ['invalid', [1, 2, 3], undefined, null];
|
||||
// @ts-expect-error test inalid input
|
||||
// @ts-expect-error test invalid input
|
||||
const { data, headers } = genPreviewTableData(uploadData);
|
||||
expect(headers.length).toBe(0);
|
||||
expect(data.length).toBe(0);
|
||||
|
||||
@@ -844,7 +844,7 @@ export const ImportExport: FC<Props> = ({ hideSettingsModal, onModalChange }) =>
|
||||
</Heading>
|
||||
<p className="text-sm text-[--hl]">
|
||||
<Icon icon="info-circle" /> These files are not associated with any project in your account. You can
|
||||
move them to a project in your current organization bellow.
|
||||
move them to a project in your current organization below.
|
||||
</p>
|
||||
</div>
|
||||
<div className="flex flex-col gap-1 divide-y divide-solid divide-[--hl-md] overflow-y-auto">
|
||||
|
||||
@@ -28,7 +28,7 @@ export const useLoaderDeferData = <T>(
|
||||
setData(data);
|
||||
} catch (err) {
|
||||
setError(err);
|
||||
console.warn('Failed to load defered data', err);
|
||||
console.warn('Failed to load deferred data', err);
|
||||
}
|
||||
})();
|
||||
}, [deferedDataPromise, keepStaleDataKey]);
|
||||
|
||||
+1
-1
@@ -160,7 +160,7 @@ export const loader: LoaderFunction = async ({
|
||||
// read the body if its smaller than the limit add it to the activeResponse
|
||||
const length = Math.max(activeResponse.bytesContent, activeResponse.bytesRead);
|
||||
const isOversizedResponse = length > 5 * 1024 * 1024; // 5MB
|
||||
// Oversized repsonses are handled in the response-viewer.tsx for now
|
||||
// Oversized responses are handled in the response-viewer.tsx for now
|
||||
if (!isOversizedResponse) {
|
||||
const buffer = await models.response.getBodyBuffer(activeResponse);
|
||||
activeResponse.bodyBuffer = typeof buffer === 'string' ? Buffer.from(buffer) : buffer;
|
||||
|
||||
+1
-1
@@ -62,7 +62,7 @@ export const loader: LoaderFunction = async ({ params }): Promise<MockRouteLoade
|
||||
// read the body if its smaller than the limit add it to the activeResponse
|
||||
const length = Math.max(activeResponse.bytesContent, activeResponse.bytesRead);
|
||||
const isOversizedResponse = length > 5 * 1024 * 1024; // 5MB
|
||||
// Oversized repsonses are handled in the response-viewer.tsx for now
|
||||
// Oversized responses are handled in the response-viewer.tsx for now
|
||||
if (!isOversizedResponse) {
|
||||
const buffer = await models.response.getBodyBuffer(activeResponse);
|
||||
activeResponse.bodyBuffer = typeof buffer === 'string' ? Buffer.from(buffer) : buffer;
|
||||
|
||||
@@ -26,7 +26,7 @@ export async function action({ request }: ActionFunctionArgs) {
|
||||
if (resetVaultClientSessionId !== sessionId) {
|
||||
// remove all secret environment variables
|
||||
await removeAllSecrets(organizations);
|
||||
// Update vault salt and delelte vault key from session
|
||||
// Update vault salt and delete vault key from session
|
||||
sessionModel.update(userSession, { vaultSalt: newVaultSalt, vaultKey: '' });
|
||||
// show notification
|
||||
const notification: ToastNotification = {
|
||||
|
||||
@@ -439,7 +439,7 @@ export interface EdgeGridAuthentication {
|
||||
[k: string]: unknown;
|
||||
}
|
||||
/**
|
||||
* The attributes for [Hawk Authentication](https://github.com/hueniverse/hawk). e.g. authId, authKey, algorith, user, nonce, extraData, appId, delegation, timestamp.
|
||||
* The attributes for [Hawk Authentication](https://github.com/hueniverse/hawk). e.g. authId, authKey, algorithm, user, nonce, extraData, appId, delegation, timestamp.
|
||||
*/
|
||||
export interface HawkAuthentication {
|
||||
[k: string]: unknown;
|
||||
|
||||
@@ -14,7 +14,7 @@ const RFC_3986_SUB_DELIMITERS = '$+,;='; // (unintentionally?) missing: !&'()*
|
||||
const URL_PATH_CHARACTER_WHITELIST = `${RFC_3986_GENERAL_DELIMITERS}${RFC_3986_SUB_DELIMITERS}`;
|
||||
|
||||
interface IQueryStringOptions {
|
||||
// Option to distingush between parameters with(&foo=) and without(&foo) equal signs. Both are converted to empty string by default.
|
||||
// Option to distinguish between parameters with(&foo=) and without(&foo) equal signs. Both are converted to empty string by default.
|
||||
strictNullHandling?: boolean;
|
||||
// Option to encode parameters, default to true, necessary to disable for request.settingEncodeUrl = false
|
||||
encodeParams?: boolean;
|
||||
@@ -80,7 +80,7 @@ export const buildQueryParameter = (
|
||||
|
||||
/** allow empty names and values */
|
||||
strict?: boolean,
|
||||
/** extra options like strict hanlde null value */
|
||||
/** extra options like strict handle null value */
|
||||
options?: IQueryStringOptions,
|
||||
) => {
|
||||
strict = strict === undefined ? true : strict;
|
||||
@@ -117,7 +117,7 @@ export const buildQueryStringFromParams = (
|
||||
parameters: { name: string; value?: StrictNullSearchParamsValueType }[],
|
||||
/** allow empty names and values */
|
||||
strict?: boolean,
|
||||
/** extra options like strict hanlde null value */
|
||||
/** extra options like strict handle null value */
|
||||
options?: IQueryStringOptions,
|
||||
) => {
|
||||
strict = strict === undefined ? true : strict;
|
||||
@@ -145,7 +145,7 @@ export const deconstructQueryStringToParams = <T extends IQueryStringOptions>(
|
||||
|
||||
/** allow empty names and values */
|
||||
strict?: boolean,
|
||||
/** extra deconstruct options like strict hanlde null value */
|
||||
/** extra deconstruct options like strict handle null value */
|
||||
options?: T,
|
||||
): ProcessDeconstructFuncReturnType<T> => {
|
||||
strict = strict === undefined ? true : strict;
|
||||
|
||||
@@ -23,7 +23,7 @@ export const decryptVaultKeyFromSession = async (vaultKey: string, toJsonWebKey:
|
||||
if (process.env.PLAYWRIGHT) {
|
||||
const testVaultKey = getInsomniaVaultKey() || '';
|
||||
if (testVaultKey) {
|
||||
// return vault key from environmet variable directly when running playwright tests
|
||||
// return vault key from environment variable directly when running playwright tests
|
||||
return toJsonWebKey ? base64decode(testVaultKey, true) : testVaultKey;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user